code: def _tensor_name_base(full_tensor_name):
      """Removes the device assignment code from a tensor.
  
      e.g. _tensor_name_base("foo:3") => "foo"
  
      Args:
        full_tensor_name: A tensor name that is annotated with a device placement
          (this is what tensor flow introspection gives).
  
      Returns:
        A name without any device assignment.
      """
      if full_tensor_name.startswith("^"):
          return full_tensor_name[1:]
      return full_tensor_name.split(":")[0]
  
imports: import collections
  import copy
  import json
  import uuid
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.framework import node_def_pb2
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.framework.graph_util_impl import _bfs_for_reachable_nodes
  from tensorflow.python.framework.graph_util_impl import _extract_graph_summary
  from tensorflow.python.ops import array_ops
  from tensorflow.python.util import compat
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.all_util import remove_undocumented
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 5 for calling a global function with example usage: _tensor_name_base(full_tensor_name) and returns: full_tensor_name, full_tensor_name