def _domain_from_json(domain):
  """Translate a JSON domain dict into an IntDomain or None."""
  if domain.get('ints') is not None:
    def maybe_to_int(s):
      return int(s) if s is not None else None
    return schema_pb2.IntDomain(
        min=maybe_to_int(domain['ints'].get('min')),
        max=maybe_to_int(domain['ints'].get('max')),
        is_categorical=domain['ints'].get('isCategorical'))
  return None
Translate a JSON domain dict into an IntDomain or None.
tensorflow_transform/tf_metadata/metadata_io.py