code: def _index_key_from_dict(
      field: str,
      type_: t.Union[
          t.Literal[-1],
          t.Literal[1],
          t.Literal["2dsphere"],
          t.Literal["text"],
      ],
  ):
      if type_ == 1:
          type_ = "asc"
      elif type_ == -1:
          type_ = "desc"
      else:
          # ignore 2dsphere/text keys
          return None
  
      return IndexFields(field=field, type=type_)
  
file_path: fiftyone/fiftyone/server/indexes.py
imports: from enum import Enum
  import typing
  import strawberry
  from fiftyone.core.collections import SampleCollection
label_desc: Use image node_id 3 for calling a global function with example usage: _index_key_from_dict(field, type_) and returns: IndexFields, None