class_docstr: A class that represents a collection/database of rewrites.
  
  These databases are used to logically organize collections of rewrites
  (i.e. `GraphRewriter`\s and `NodeRewriter`).
class_docstr_tok: ["A","class","that","represents","a","collection\/database","of","rewrites",".","These","databases","are","used","to","logically","organize","collections","of","rewrites","(","i.e",".","`","GraphRewriter","`","\\s","and","`","NodeRewriter","`",")","."]
code: def __getitem__(self, name):
      variables = self.__db__[name]
      if not variables:
          raise KeyError(f"Nothing registered for '{name}'")
      elif len(variables) > 1:
          raise ValueError(
              f"More than one match for {name} (please use query)"
          )
      for variable in variables:
          return variable
  
imports: import copy
  import math
  import sys
  from collections.abc import Iterable, Sequence
  from functools import cmp_to_key
  from io import StringIO
  from typing import Optional, Union
  from pytensor.configdefaults import config
  from pytensor.graph.rewriting import basic
  from pytensor.misc.ordered_set import OrderedSet
  from pytensor.utils import DefaultOrderedDict
label_desc: Use image node_id 7 for calling the RewriteDatabase obj's underlying member method code with example usage: obj.__getitem__(name) and returns: variable