code: def _to_value(
      value: _PrimitiveFlagValueType,
  ) -> metadata_store_pb2.Value:
      result = metadata_store_pb2.Value()
      data_types_utils.set_metadata_value(result, value)
      return result
  
file_path: tfx/tfx/dsl/hooks.py
imports: import abc
  from typing import Optional, Union
  import attr
  from tfx.orchestration import data_types_utils
  from tfx.proto.orchestration import execution_hook_pb2
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _to_value(value) and returns: result