code: def iter_patterns(
      mapped_triples: Collection[Tuple[int, int, int]],
  ) -> Iterable[PatternMatch]:
      """Iterate over unary, binary, and ternary patterns.
  
      :param mapped_triples:
          A collection of ID-based triples.
  
      :yields: Patterns from :func:`iter_unary_patterns`, func:`iter_binary_patterns`, and :func:`iter_ternary_patterns`.
      """
      pairs = index_pairs(mapped_triples)
  
      yield from iter_unary_patterns(pairs=pairs)
      yield from iter_binary_patterns(pairs=pairs)
      yield from iter_ternary_patterns(mapped_triples, pairs=pairs)
  
imports: import hashlib
  import itertools
  import logging
  from collections import defaultdict
  from typing import Collection, DefaultDict, Iterable, Mapping, NamedTuple, Optional, Sequence, Set, Tuple, Union
  import numpy
  import pandas
  from tqdm.auto import tqdm
  from .None import TriplesFactory
  from ..constants import COLUMN_LABELS, TARGET_TO_INDEX
  from ..typing import COLUMN_HEAD, COLUMN_RELATION, COLUMN_TAIL, LABEL_HEAD, LABEL_RELATION, LABEL_TAIL, MappedTriples
label_desc: Use image node_id 11 for calling a global function with example usage: iter_patterns(mapped_triples) without return types