code: def cosine(x, y):
      result = 0.0
      norm_x = 0.0
      norm_y = 0.0
      for i in range(x.shape[0]):
          result += x[i] * y[i]
          norm_x += x[i] ** 2
          norm_y += y[i] ** 2
  
      if norm_x == 0.0 and norm_y == 0.0:
          return 0.0
      elif norm_x == 0.0 or norm_y == 0.0:
          return 1.0
      else:
          return 1.0 - (result / np.sqrt(norm_x * norm_y))
  
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 24 for calling a global function with example usage: cosine(x, y) and returns: int, int, unknown