code: def _ExtractAttrProto(op_type_name, op_def, attrs, attr_protos):
      """Extracts `attr_protos`. For use in _apply_op_helper."""
      for attr_def in op_def.attr:
          key = attr_def.name
          value = attrs[key]
  
          if attr_def.HasField("default_value") and value is None:
              attr_value = attr_value_pb2.AttrValue()
              attr_value.CopyFrom(attr_def.default_value)
              attr_protos[key] = attr_value
              continue
  
          attr_value = value_to_attr_value(value, attr_def.type, key)
          if attr_def.type.startswith("list("):
              _SatisfiesLengthConstraint(
                  len(value), attr_def, key, op_type_name
              )
          if attr_def.HasField("allowed_values"):
              if attr_def.type == "string":
                  _SatisfiesAllowedStringsConstraint(
                      attr_value.s, attr_def, key, op_type_name
                  )
              elif attr_def.type == "list(string)":
                  for value in attr_value.list.s:
                      _SatisfiesAllowedStringsConstraint(
                          value, attr_def, key, op_type_name
                      )
          if attr_def.has_minimum and attr_def.type == "int":
              _SatisfiesIntMinimumConstraint(
                  attr_value.i, attr_def, key, op_type_name
              )
          if attr_def.type == "type":
              _SatisfiesTypeConstraint(attr_value.type, attr_def, key)
          if attr_def.type == "list(type)":
              for value in attr_value.list.type:
                  _SatisfiesTypeConstraint(value, attr_def, key)
  
          attr_protos[key] = attr_value
  
imports: from google.protobuf import text_format
  from tensorflow.core.config import flags
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.core.framework import tensor_pb2
  from tensorflow.core.framework import tensor_shape_pb2
  from tensorflow.core.framework import types_pb2
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import op_callbacks
  from tensorflow.python.framework import op_def_library_pybind
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import _pywrap_utils
  from tensorflow.python.util import compat
  from tensorflow.python.util import tf_contextlib
label_desc: Use image node_id 22 for calling a global function with example usage: _ExtractAttrProto(op_type_name, op_def, attrs, attr_protos) without return types