code: def opt_transport(supply, demand, costs):
      """A wrapper for the EMD computation using the Optimal Transport (ot) package.
      if emd_only is False, it only returns the emd value. Else it returns the transport
      matrix and the minimum value of the objective.
      """
      if py_opt_transport is None:
          raise Exception(
              "Could not import Python optimal transport library. "
              + 'You can install this via "pip install cython POT".'
          )
      supply = supply.astype(np.float64)
      demand = demand.astype(np.float64)
      tot_supply = supply.sum()
      tot_demand = demand.sum()
      supply = supply / tot_supply
      demand = demand / tot_demand
      # Now solve the problem
      T = py_opt_transport.emd(supply, demand, costs)
      T = tot_supply * T
      min_val = np.sum(T * costs)
      emd = min_val / tot_supply
      return T, min_val, emd
  
imports: from __future__ import print_function
  from __future__ import division
  from argparse import Namespace
  from datetime import datetime
  from warnings import warn
  import os
  import numpy
  from .general_utils import map_to_bounds
  from .doo import DOOFunction, pdoo_wrap
label_desc: Use image node_id 1 for calling a global function with example usage: opt_transport(supply, demand, costs) and returns: T,  min_val,  emd