code: def _set_handle_data(list_handle, element_shape, element_dtype):
      """Sets type information on `list_handle` for consistency with graphs."""
      # TODO(b/169968286): It would be better if we had a consistent story for
      # creating handle data from eager operations (shared with VarHandleOp).
      if isinstance(list_handle, ops.EagerTensor):
          if tensor_util.is_tf_type(element_shape):
              element_shape = tensor_shape.TensorShape(None)
          elif not isinstance(element_shape, tensor_shape.TensorShape):
              element_shape = tensor_shape.TensorShape(element_shape)
          handle_data = (
              cpp_shape_inference_pb2.CppShapeInferenceResult.HandleData()
          )
          handle_data.is_set = True
          # TODO(b/191472076): This duplicates type inference. Clean up.
          handle_data.shape_and_type.append(
              cpp_shape_inference_pb2.CppShapeInferenceResult.HandleShapeAndType(
                  shape=element_shape.as_proto(),
                  dtype=element_dtype.as_datatype_enum,
                  type=full_type_pb2.FullTypeDef(
                      type_id=full_type_pb2.TFT_ARRAY
                  ),
              )
          )
          list_handle._handle_data = handle_data
  
imports: import numpy
  from tensorflow.core.framework import full_type_pb2
  from tensorflow.python.framework import cpp_shape_inference_pb2
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_list_ops
  from tensorflow.python.ops import handle_data_util
  from tensorflow.python.ops.gen_list_ops import *
label_desc: Use image node_id 2 for calling a global function with example usage: _set_handle_data(list_handle, element_shape, element_dtype) without return types