class_docstr: Structure to discover and store `Dataset` dependencies.
  
  Used primarily by the `Scene` object to organize dependency finding.
  Dependencies are stored used a series of `Node` objects which this
  class is a subclass of.
class_docstr_tok: ["Structure","to","discover","and","store","`","Dataset","`","dependencies",".","Used","primarily","by","the","`","Scene","`","object","to","organize","dependency","finding",".","Dependencies","are","stored","used","a","series","of","`","Node","`","objects","which","this","class","is","a","subclass","of","."]
docstr: Get unique matching id from `matching_ids`, for a given `dataset_key` and some optional `query`.
docstr_tok: ["Get","unique","matching","id","from","`","matching_ids","`",",","for","a","given","`","dataset_key","`","and","some","optional","`","query","`","."]
code: def _get_unique_matching_id(self, matching_ids, dataset_key, query):
      """Get unique matching id from `matching_ids`, for a given `dataset_key` and some optional `query`."""
      all_ids = sum(matching_ids.values(), [])
      if len(all_ids) == 0:
          raise MissingDependencies({dataset_key})
      elif len(all_ids) == 1:
          result = all_ids[0]
      else:
          (
              sorted_ids,
              distances,
          ) = dataset_key.sort_dataids_with_preference(all_ids, query)
          try:
              result = self._get_unique_id_from_sorted_ids(
                  sorted_ids, distances
              )
          except TooManyResults:
              LOG.trace(
                  "Too many datasets matching key {} in readers {}".format(
                      dataset_key, matching_ids.keys()
                  )
              )
              raise TooManyResults(
                  "Too many keys matching: {}".format(dataset_key)
              )
          except MissingDependencies:
              raise MissingDependencies({dataset_key})
      return result
  
imports: from __future__ import annotations
  from typing import Container, Iterable, Optional
  import numpy
  from satpy import DataID, DatasetDict
  from satpy.dataset import ModifierTuple, create_filtered_query
  from satpy.dataset.data_dict import TooManyResults, get_key
  from satpy.node import EMPTY_LEAF_NAME, LOG, CompositorNode, MissingDependencies, Node, ReaderNode
label_desc: Use image node_id 11 for calling the DependencyTree obj's underlying member method code with example usage: obj._get_unique_matching_id(matching_ids, dataset_key, query) and returns: result