code: def _metadata():
      root_dir = os.path.dirname(
          os.path.dirname(os.path.realpath(__file__))
      )
      core_dir = os.path.join(
          root_dir,
          "third_party",
          "source",
          "tensorflow",
          "tensorflow",
          "core",
      )
      api_def_map = _read_api_def_map(
          os.path.join(core_dir, "api_def", "base_api")
      )
      ops_list = _read_op_list(
          os.path.join(core_dir, "ops", "ops.pbtxt")
      )
  
      json_root = []
      for operator in ops_list.op:
          json_schema = {}
          json_schema["name"] = operator.name
          if operator.name in categories:
              json_schema["category"] = categories[operator.name]
          api_def = api_def_pb2.ApiDef()  # pylint: disable=no-member
          if operator.name in api_def_map:
              api_def = api_def_map[operator.name]
          if api_def.summary:
              json_schema["summary"] = api_def.summary
          if api_def.description:
              json_schema["description"] = api_def.description
          _update_attributes(json_schema, operator, api_def)
          _update_inputs(json_schema, operator, api_def)
          _update_outputs(json_schema, operator, api_def)
          json_root.append(json_schema)
      json_file = os.path.join(root_dir, "source", "tf-metadata.json")
      _write(
          json_file, json.dumps(json_root, sort_keys=False, indent=2)
      )
  
imports: import json
  import logging
  import os
  import google.protobuf
  from tensorflow.core.framework import api_def_pb2
  from tensorflow.core.framework import op_def_pb2
  from tensorflow.core.framework import types_pb2
label_desc: Use image node_id 20 for calling a global function with example usage: _metadata() without return types