code: def _constant_impl(
      value, dtype, shape, name, verify_shape, allow_broadcast
  ) -> Union[ops.Operation, ops._EagerTensorBase]:
      """Implementation of constant."""
      ctx = context.context()
      if ctx.executing_eagerly():
          if trace.enabled:
              with trace.Trace("tf.constant"):
                  return _constant_eager_impl(
                      ctx, value, dtype, shape, verify_shape
                  )
          return _constant_eager_impl(
              ctx, value, dtype, shape, verify_shape
          )
  
      const_tensor = ops._create_graph_constant(  # pylint: disable=protected-access
          value, dtype, shape, name, verify_shape, allow_broadcast
      )
      return const_tensor
  
imports: from typing import Union
  import numpy
  from tensorflow.core.framework import types_pb2
  from tensorflow.core.protobuf import struct_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.eager import execute
  from tensorflow.python.framework import constant_tensor_conversion
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_conversion_registry
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.profiler import trace
  from tensorflow.python.saved_model import nested_structure_coder
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 7 for calling a global function with example usage: _constant_impl(value, dtype, shape, name, verify_shape, allow_broadcast) and returns: const_tensor, _constant_eager_impl, _constant_eager_impl