code: def iter_dataset_classes(
      regex_name_filter: Union[None, str, Pattern] = None,
      *,
      max_triples: Optional[int] = None,
      min_triples: Optional[int] = None,
      use_tqdm: bool = True,
  ) -> Iterable[Tuple[str, Type[Dataset]]]:
      """Iterate over dataset classes with given constraints.
  
      :param regex_name_filter: An optional regular expression string or pre-compiled regular expression
      :param max_triples: An optional maximum number of triples for the dataset
      :param min_triples: An optional minimum number of triples for the dataset
      :param use_tqdm: Should a progress bar be shown?
      :yields: Pairs of dataset names and dataset classes
      """
      from . import dataset_resolver
  
      it = sorted(
          dataset_resolver.lookup_dict.items(),
          key=Dataset.triples_pair_sort_key,
      )
      if max_triples is not None:
          it = [
              pair
              for pair in it
              if Dataset.triples_pair_sort_key(pair) <= max_triples
          ]
      if min_triples is not None:
          it = [
              pair
              for pair in it
              if Dataset.triples_pair_sort_key(pair) >= min_triples
          ]
      if regex_name_filter is not None:
          if isinstance(regex_name_filter, str):
              regex_name_filter = re.compile(regex_name_filter)
          it = [
              (name, dataset_cls)
              for name, dataset_cls in it
              if regex_name_filter.match(name)
          ]
      it_tqdm = tqdm(
          it,
          desc="Datasets",
          disable=not use_tqdm,
      )
      for name, dataset_cls in it_tqdm:
          n_triples = Dataset.triples_sort_key(dataset_cls)
          it_tqdm.set_postfix(name=name, triples=f"{n_triples:,}")
          yield name, dataset_cls
  
file_path: pykeen/src/pykeen/datasets/utils.py
imports: import base64
  import hashlib
  import logging
  import pathlib
  import re
  from typing import Any, Collection, Iterable, Mapping, Optional, Pattern, Tuple, Type, Union
  import click
  from tqdm import tqdm
  from .base import Dataset, EagerDataset, PathDataset
  from ..constants import PYKEEN_DATASETS
  from ..triples import CoreTriplesFactory
label_desc: Use image node_id 1 for calling a global function with example usage: iter_dataset_classes(regex_name_filter) without return types