code: def lookup_pattern(name: str) -> Callable[[AnyStr], Pattern]:
      """
      Lookups a registered pattern factory by name.
  
      *name* (:class:`str`) is the name of the pattern factory.
  
      Returns the registered pattern factory (:class:`~collections.abc.Callable`).
      If no pattern factory is registered, raises :exc:`KeyError`.
      """
      return _registered_patterns[name]
  
imports: import os
  import os.path
  import pathlib
  import posixpath
  import stat
  import sys
  import warnings
  from collections.abc import Collection, Iterable
  from dataclasses import dataclass
  from os import PathLike
  from typing import Any, AnyStr, Callable, Collection, Dict, Generic, Iterable, Iterator, List, Optional, Sequence, Set, Tuple, TypeVar, Union
  from .pattern import Pattern
label_desc: Use image node_id 10 for calling a global function with example usage: lookup_pattern(name) and returns: _registered_patterns