code: def test_weave_gather():
      """Test invoking WeaveGather."""
      n_atoms = 4  # In CCC and C, there are 4 atoms
      raw_smiles = ["CCC", "C"]
      from rdkit import Chem
  
      mols = [Chem.MolFromSmiles(s) for s in raw_smiles]
      featurizer = dc.feat.WeaveFeaturizer()
      mols = featurizer.featurize(mols)
      atom_feat = []
      atom_split = []
      for im, mol in enumerate(mols):
          n_atoms = mol.get_num_atoms()
          atom_split.extend([im] * n_atoms)
  
          # atom features
          atom_feat.append(mol.get_atom_features())
      inputs = [
          np.array(np.concatenate(atom_feat, axis=0), dtype=np.float32),
          np.array(atom_split),
      ]
      # Try without compression
      gather = layers.WeaveGather(
          batch_size=2, n_input=75, gaussian_expand=True
      )
      # Outputs should be [mol1_vec, mol2_vec)
      outputs = gather(inputs)
      assert len(outputs) == 2
      assert np.array(outputs[0]).shape == (11 * 75,)
      assert np.array(outputs[1]).shape == (11 * 75,)
  
      # Try with compression
      gather = layers.WeaveGather(
          batch_size=2,
          n_input=75,
          gaussian_expand=True,
          compress_post_gaussian_expansion=True,
      )
      # Outputs should be [mol1_vec, mol2_vec)
      outputs = gather(inputs)
      assert len(outputs) == 2
      assert np.array(outputs[0]).shape == (75,)
      assert np.array(outputs[1]).shape == (75,)
  
imports: import deepchem
  import numpy
  import pytest
  import os
label_desc: Use image node_id 8 for calling a global function with example usage: test_weave_gather() without return types