code: def cross_eps(X, Y, eps=1.0):
      """Return the eps-neighbours graph of from X to Y
  
      Parameters
      ----------
      X, Y arrays of shape (n1, p) and (n2, p)
      where p = common dimension of the features
      eps=1, float: the neighbourhood size considered
  
      Returns
      -------
      the resulting bipartite graph instance
  
      Notes
      -----
      for the sake of speed it is advisable to give PCA-preprocessed matrices X
      and Y.
      """
      from scipy.sparse import coo_matrix
  
      check_feature_matrices(X, Y)
      try:
          eps = float(eps)
      except:
          "eps cannot be cast to a float"
      if np.isnan(eps):
          raise ValueError("eps is nan")
      if np.isinf(eps):
          raise ValueError("eps is inf")
      ij = np.zeros((0, 2))
      data = np.zeros(0)
      for i, x in enumerate(X):
          dist = np.sum((Y - x) ** 2, 1)
          idx = np.asanyarray(np.where(dist < eps))
          data = np.hstack((data, dist[idx.ravel()]))
          ij = np.vstack(
              (ij, np.hstack((i * np.ones((idx.size, 1)), idx.T)))
          ).astype(np.int_)
  
      data = np.maximum(data, 1.0e-15)
      adj = coo_matrix((data, ij.T), shape=(X.shape[0], Y.shape[0]))
      return bipartite_graph_from_coo_matrix(adj)
  
file_path: nipy/nipy/algorithms/graph/bipartite_graph.py
imports: import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: cross_eps(X, Y, eps) and returns: bipartite_graph_from_coo_matrix