code: def _get_scope(node_name):
      """Extract the scope name from a node name.
  
      The scope name is everything before the final slash,
      not including any ^ prefix denoting a control dependency.
  
      Args:
        node_name: the full name of an Op or a Tensor in the graph.
      Returns:
        The deepest named scope containing the node.
      Raises:
        ValueError: if tensor_name is None or empty
      """
      if not node_name:
          raise ValueError(
              f"Node name cannot be empty or None. Received: {node_name}."
          )
  
      # Control dependency inputs start with ^.
      if node_name.startswith("^"):
          node_name = node_name[1:]
      if "/" in node_name:
          scope, _ = node_name.rsplit("/", 1)
          return scope
  
      return ""
  
imports: import copy
  from packaging import version
  import os.path
  import re
  import sys
  from google.protobuf.any_pb2 import Any
  from google.protobuf import text_format
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.framework import op_def_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.client import pywrap_tf_session
  from tensorflow.python.eager import context
  from tensorflow.python.framework import byte_swap_tensor
  from tensorflow.python.framework import error_interpolation
  from tensorflow.python.framework import graph_io
  from tensorflow.python.framework import importer
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import versions
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import compat
label_desc: Use image node_id 6 for calling a global function with example usage: _get_scope(node_name) and returns: str, scope