code: def get_best_dataset_key(key, choices):
      """Choose the "best" `DataID` from `choices` based on `key`.
  
      To see how the keys are sorted, refer to `:meth:satpy.datasets.DataQuery.sort_dataids`.
  
      This function assumes `choices` has already been filtered to only
      include datasets that match the provided `key`.
  
      Args:
          key (DataQuery): Query parameters to sort `choices` by.
          choices (iterable): `DataID` objects to sort through to determine
                              the best dataset.
  
      Returns: List of best `DataID`s from `choices`. If there is more
               than one element this function could not choose between the
               available datasets.
  
      """
      sorted_choices, distances = key.sort_dataids(choices)
      if len(sorted_choices) == 0 or distances[0] is np.inf:
          return []
      else:
          return [
              choice
              for choice, distance in zip(sorted_choices, distances)
              if distance == distances[0]
          ]
  
file_path: satpy/satpy/dataset/data_dict.py
imports: import numpy
  from .dataid import DataID, create_filtered_query, minimal_default_keys_config
label_desc: Use image node_id 1 for calling a global function with example usage: get_best_dataset_key(key, choices) and returns: list, unknown