code: def cosine_distance(x, y, name=""):
      """
      Computes the cosine distance between ``x`` and ``y``:
  
      Example:
          >>> a = np.asarray([-1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1]).reshape(3,2,2)
          >>> b = np.asarray([1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1]).reshape(3,2,2)
          >>> x = C.sequence.input_variable(shape=(2,))
          >>> y = C.sequence.input_variable(shape=(2,))
          >>> np.round(C.cosine_distance(x,y).eval({x:a,y:b}),5)
          array([[-1.,  1.],
                 [ 1.,  0.],
                 [ 0., -1.]], dtype=float32)
  
      Args:
          x: numpy array or any :class:`~cntk.ops.functions.Function` that outputs a tensor
          name (str, optional): the name of the Function instance in the network
      Returns:
          :class:`~cntk.ops.functions.Function`
      """
      from cntk.cntk_py import cosine_distance
  
      dtype = get_data_type(x, y)
      x = sanitize_input(x, dtype)
      y = sanitize_input(y, dtype)
      return cosine_distance(x, y, name)
  
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  from ..ops.functions import CloneMethod, Function
  from ..variables import Variable, Parameter, Constant
  from cntk.internal import sanitize_input, sanitize_shape, sanitize_axis, sanitize_dynamic_axes, typemap
  from cntk.internal.utils import get_data_type
  from cntk.cntk_py import sentinel_value_for_auto_select_random_seed
  from cntk import times, softmax, parameter
  import cntk
  from ..axis import Axis
label_desc: Use image node_id 1 for calling a global function with example usage: cosine_distance(x, y, name) and returns: cosine_distance