docs: def flatten_(structure):
    """Combine all leaves of a nested structure into a tuple.
  
    The nested structure can consist of any combination of tuples, lists, and
    dicts. Dictionary keys will be discarded but values will ordered by the
    sorting of the keys.
  
    Args:
      structure: Nested structure.
  
    Returns:
      Flat tuple.
    """
    if isinstance(structure, dict):
      if structure:
        structure = zip(*sorted(structure.items(), key=lambda x: x[0]))[1]
      else:
        # Zip doesn't work on an the items of an empty dictionary.
        structure = ()
    if isinstance(structure, (tuple, list)):
      result = []
      for element in structure:
        result += flatten_(element)
      return tuple(result)
    return (structure,)