code: def _get_domain(feature, string_domains):
      """Get the domain of a feature, possibly looking up a schema-level domain."""
      domain_info = feature.WhichOneof("domain_info")
      if domain_info is None:
          return None
      if domain_info == "domain":
          try:
              return string_domains[feature.domain]
          except KeyError:
              tf.compat.v1.logging.warn(
                  'Feature "%s" referred to string domain "%s" which did not exist',
                  feature.name,
                  feature.domain,
              )
              return None
      return getattr(feature, domain_info)
  
imports: import dataclasses
  import typing
  from typing import Dict, List, Mapping, Optional, Tuple, Union
  import tensorflow
  from tensorflow_transform import common_types
  from tensorflow_transform.tf_metadata import schema_utils_legacy
  from tfx_bsl.tfxio import tensor_representation_util
  from tensorflow_metadata.proto.v0 import path_pb2
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 12 for calling a global function with example usage: _get_domain(feature, string_domains) and returns: getattr, None, string_domains, None