code: def get_key(
      key,
      key_container,
      num_results=1,
      best=True,
      query=None,  # noqa: D417
      **kwargs,
  ):
      """Get the fully-specified key best matching the provided key.
  
      Only the best match is returned if `best` is `True` (default). See
      `get_best_dataset_key` for more information on how this is determined.
  
      `query` is provided as a convenience to filter by multiple parameters
      at once without having to filter by multiple `key` inputs.
  
      Args:
          key (DataID): DataID of query parameters to use for
                           searching. Any parameter that is `None`
                           is considered a wild card and any match is
                           accepted.
          key_container (dict or set): Container of DataID objects that
                                       uses hashing to quickly access items.
          num_results (int): Number of results to return. Use `0` for all
                             matching results. If `1` then the single matching
                             key is returned instead of a list of length 1.
                             (default: 1)
          best (bool): Sort results to get "best" result first
                       (default: True). See `get_best_dataset_key` for details.
          query (DataQuery): filter for the key which can contain for example:
  
              resolution (float, int, or list): Resolution of the dataset in
                                              dataset units (typically
                                              meters). This can also be a
                                              list of these numbers.
              calibration (str or list): Dataset calibration
                                      (ex.'reflectance'). This can also be a
                                      list of these strings.
              polarization (str or list): Dataset polarization
                                          (ex.'V'). This can also be a
                                          list of these strings.
              level (number or list): Dataset level (ex. 100). This can also be a
                                      list of these numbers.
              modifiers (list): Modifiers applied to the dataset. Unlike
                              resolution and calibration this is the exact
                              desired list of modifiers for one dataset, not
                              a list of possible modifiers.
  
      Returns:
          list or DataID: Matching key(s)
  
      Raises: KeyError if no matching results or if more than one result is
              found when `num_results` is `1`.
  
      """
      key = create_filtered_query(key, query)
  
      res = key.filter_dataids(key_container)
      if not res:
          raise KeyError(
              "No dataset matching '{}' found".format(str(key))
          )
  
      if best:
          res = get_best_dataset_key(key, res)
  
      if num_results == 1 and not res:
          raise KeyError(
              "No dataset matching '{}' found".format(str(key))
          )
      if num_results == 1 and len(res) != 1:
          raise TooManyResults(
              "No unique dataset matching {}".format(str(key))
          )
      if num_results == 1:
          return res[0]
      if num_results == 0:
          return res
  
      return res[:num_results]
  
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 2 for calling a global function with example usage: get_key(key, key_container, num_results, best, query) and returns: res, res, res