code: def compute_neighbor_cells(cells, ndim, n_cells):
      """Compute neighbors of cells in grid.
  
      # TODO(rbharath): Do we need to handle periodic boundary conditions
      properly here?
      # TODO(rbharath): This doesn't handle boundaries well. We hard-code
      # looking for 26 neighbors, which isn't right for boundary cells in
      # the cube.
  
      Note n_cells is box_size**ndim. 26 is the number of neighbors of a cube in
      a grid (including diagonals).
  
      Parameters
      ----------
      cells: tf.Tensor
        (n_cells, 26) shape.
      """
      n_cells = int(n_cells)
      if ndim != 3:
          raise ValueError("Not defined for dimensions besides 3")
      # Number of neighbors of central cube in 3-space is
      # 3^2 (top-face) + 3^2 (bottom-face) + (3^2-1) (middle-band)
      # TODO(rbharath)
      k = 9 + 9 + 8  # (26 faces on Rubik's cube for example)
      # n_cells = int(cells.get_shape()[0])
      # Tile cells to form arrays of size (n_cells*n_cells, ndim)
      # Two tilings (a, b, c, a, b, c, ...) vs. (a, a, a, b, b, b, etc.)
      # Tile (a, a, a, b, b, b, etc.)
      tiled_centers = tf.reshape(
          tf.tile(cells, (1, n_cells)), (n_cells * n_cells, ndim)
      )
      # Tile (a, b, c, a, b, c, ...)
      tiled_cells = tf.tile(cells, (n_cells, 1))
  
      # Lists of n_cells tensors of shape (N, 1)
      tiled_centers = tf.split(tiled_centers, n_cells)
      tiled_cells = tf.split(tiled_cells, n_cells)
  
      # Lists of length n_cells
      coords_rel = [
          tf.cast(cells, tf.float32) - tf.cast(centers, tf.float32)
          for (cells, centers) in zip(tiled_centers, tiled_cells)
      ]
      coords_norm = [
          tf.reduce_sum(rel**2, axis=1) for rel in coords_rel
      ]
  
      # Lists of length n_cells
      # Get indices of k atoms closest to each cell point
      # n_cells tensors of shape (26,)
      closest_inds = tf.stack(
          [tf.nn.top_k(norm, k=k)[1] for norm in coords_norm]
      )
  
      return closest_inds
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import unicode_literals
  import warnings
  import numpy
  import tensorflow
  from deepchem.models import Model
  from deepchem.nn import model_ops
  import deepchem.utils.rdkit_util
label_desc: Use image node_id 6 for calling a global function with example usage: compute_neighbor_cells(cells, ndim, n_cells) and returns: closest_inds