code: def tile(cls, op):
      x, y = op.x, op.y
      if x is y:
          S = cosine_similarity(x)
      else:
          S = cosine_similarity(x, y)
      S = (S * -1) + 1
      S = mt.clip(S, 0, 2)
      if x is y:
          mt.fill_diagonal(S, 0.0)
      return [(yield from recursive_tile(S))]
  
file_path: mars/mars/learn/metrics/pairwise/cosine.py
imports: import numpy
  from ....None import opcodes
  from ....core import recursive_tile
  from ....serialization.serializables import KeyField
  from ....None import tensor
  from ....tensor.core import TensorOrder
  from ...preprocessing import normalize
  from .core import PairwiseDistances
label_desc: Use image node_id 6 for calling the CosineDistances obj's underlying member method code with example usage: obj.tile(cls, op) and returns: list