code: def sinkhorn(x, y, cost=_dummy_cost, regularization=1.0):
      row_mask = x != 0
      col_mask = y != 0
  
      a = x[row_mask].astype(np.float64)
      b = y[col_mask].astype(np.float64)
  
      a_sum = a.sum()
      b_sum = b.sum()
  
      a /= a_sum
      b /= b_sum
  
      sub_cost = cost[row_mask, :][:, col_mask]
  
      transport_plan = sinkhorn_transport_plan(
          x, y, cost=sub_cost, regularization=regularization
      )
      dim_i = transport_plan.shape[0]
      dim_j = transport_plan.shape[1]
      result = 0.0
      for i in range(dim_i):
          for j in range(dim_j):
              result += transport_plan[i, j] * cost[i, j]
  
      return result
  
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 39 for calling a global function with example usage: sinkhorn(x, y, cost, regularization) and returns: result