code: def transform(tr, x, y):
      """Try transforming with X and y. Else, transform with only X."""
      try:
          x = tr.transform(x)
      except TypeError:
          x, y = tr.transform(x, y)
  
      return x, y
  
imports: from __future__ import division
  import os
  import warnings
  from scipy.sparse import issparse
  import numpy
  from ..utils import pickle_load, pickle_save, load
  from ..utils.exceptions import MetricWarning, ParameterChangeWarning
label_desc: Use image node_id 11 for calling a global function with example usage: transform(tr, x, y) and returns: x,  y