code: def put_atoms_in_cells(coords, x_bins, y_bins, z_bins):
      """Place each atom into cells. O(N) runtime.
  
      Parameters
      ----------
      coords: np.ndarray
        (N, 3) array where N is number of atoms
      x_bins: list
        List of (cell_start, cell_end) for x-coordinate
      y_bins: list
        List of (cell_start, cell_end) for y-coordinate
      z_bins: list
        List of (cell_start, cell_end) for z-coordinate
  
      Returns
      -------
      cell_to_atoms: dict
        Dict elements contain atom indices for cell
      atom_to_cell: dict
        Dict elements contain cell indices for atom
  
      """
  
      N = coords.shape[0]
      cell_to_atoms = {}
      atom_to_cell = {}
      for x_ind in range(len(x_bins)):
          for y_ind in range(len(y_bins)):
              for z_ind in range(len(z_bins)):
                  cell_to_atoms[(x_ind, y_ind, z_ind)] = []
      for atom in range(N):
          x_coord, y_coord, z_coord = coords[atom]
          x_ind, y_ind, z_ind = None, None, None
          for ind, (x_cell_min, x_cell_max) in enumerate(x_bins):
              if x_coord >= x_cell_min and x_coord <= x_cell_max:
                  x_ind = ind
                  break
          if x_ind is None:
              raise ValueError("No x-cell found!")
          for ind, (y_cell_min, y_cell_max) in enumerate(y_bins):
              if y_coord >= y_cell_min and y_coord <= y_cell_max:
                  y_ind = ind
                  break
          if y_ind is None:
              raise ValueError("No y-cell found!")
          for ind, (z_cell_min, z_cell_max) in enumerate(z_bins):
              if z_coord >= z_cell_min and z_coord <= z_cell_max:
                  z_ind = ind
                  break
          if z_ind is None:
              raise ValueError("No z-cell found!")
          cell_to_atoms[(x_ind, y_ind, z_ind)].append(atom)
          atom_to_cell[atom] = (x_ind, y_ind, z_ind)
      return cell_to_atoms, atom_to_cell
  
file_path: deepchem/contrib/atomicconv/feat/atomicnet_coordinates.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import unicode_literals
  import numpy
  from rdkit import Chem
  from deepchem.feat import Featurizer
  from deepchem.feat import ComplexFeaturizer
  from deepchem.utils import pad_array
label_desc: Use image node_id 2 for calling a global function with example usage: put_atoms_in_cells(coords, x_bins, y_bins, z_bins) and returns: cell_to_atoms,  atom_to_cell