code: def _create_handle_data_proto(shape_proto, dtype_enum):
      """Create handle data based on shape and dtype protos."""
      variant_shape_and_type_data = (
          cpp_shape_inference_pb2.CppShapeInferenceResult.HandleData()
      )
      variant_shape_and_type_data.is_set = True
      # NOTE(ebrevdo): shape_and_type lacks append() in some versions of protobuf.
      variant_shape_and_type_data.shape_and_type.extend(
          [
              cpp_shape_inference_pb2.CppShapeInferenceResult.HandleShapeAndType(
                  shape=shape_proto, dtype=dtype_enum
              )
          ]
      )
      return variant_shape_and_type_data
  
imports: import abc
  import collections
  from tensorflow.python.eager import context
  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 sparse_tensor
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops.linalg.sparse import gen_sparse_csr_matrix_ops
  from tensorflow.python.ops.linalg.sparse.gen_sparse_csr_matrix_ops import *
label_desc: Use image node_id 2 for calling a global function with example usage: _create_handle_data_proto(shape_proto, dtype_enum) and returns: variant_shape_and_type_data