code: def get_op_sharding(op):
      """Returns sharding attribute of an op.
  
      Args:
        op: a TensorFlow op.
  
      Returns:
        The attribute representing XLA sharding on this op.
      """
      try:
          return op.get_attr("_XlaSharding")
      except ValueError:
          return None
      except AttributeError:
          # AttributeError: 'DistributedVarOp' object has no attribute 'get_attr'.
          return None
  
imports: import numpy
  from tensorflow.compiler.tf2xla.python import xla
  from local_xla.xla import xla_data_pb2
  from tensorflow.core.framework import attr_value_pb2
label_desc: Use image node_id 7 for calling a global function with example usage: get_op_sharding(op) and returns: op, None, None