code: def parse_name_scope(name):
      """
      Given a tensor or op name, return the name scope of the raw name.
  
      Args:
          name: The name of a tensor or an op.
  
      Returns:
          str: The name scope
      """
      i = name.rfind("/")
      if i != -1:
          return name[:i] if not name.startswith("^") else name[1:i]
      return ""
  
file_path: autodist/autodist/kernel/common/utils.py
imports: from collections import deque
  from tensorflow.core.framework.attr_value_pb2 import AttrValue
  from tensorflow.python.util.compat import as_bytes
  from autodist.const import AUTODIST_REPLICA_PREFIX, COLOCATION_PREFIX
label_desc: Use image node_id 3 for calling a global function with example usage: parse_name_scope(name) and returns: str, unknown