code: def rankdata(a, method="average"):
      arr = np.ravel(np.asarray(a))
      if method == "ordinal":
          sorter = arr.argsort(kind="mergesort")
      else:
          sorter = arr.argsort(kind="quicksort")
  
      inv = np.empty(sorter.size, dtype=np.intp)
      inv[sorter] = np.arange(sorter.size)
  
      if method == "ordinal":
          return (inv + 1).astype(np.float64)
  
      arr = arr[sorter]
      obs = np.ones(arr.size, np.bool_)
      obs[1:] = arr[1:] != arr[:-1]
      dense = obs.cumsum()[inv]
  
      if method == "dense":
          return dense.astype(np.float64)
  
      # cumulative counts of each unique value
      nonzero = np.nonzero(obs)[0]
      count = np.concatenate(
          (nonzero, np.array([len(obs)], nonzero.dtype))
      )
  
      if method == "max":
          return count[dense].astype(np.float64)
  
      if method == "min":
          return (count[dense - 1] + 1).astype(np.float64)
  
      # average method
      return 0.5 * (count[dense] + count[dense - 1] + 1)
  
imports: import numpy
  import numba
  from pynndescent.optimal_transport import allocate_graph_structures, initialize_graph_structures, initialize_supply, initialize_cost, network_simplex_core, total_cost, ProblemStatus, sinkhorn_transport_plan
label_desc: Use image node_id 36 for calling a global function with example usage: rankdata(a, method) and returns: unknown, unknown, dense, count, unknown