def __init__(
    self,
    fail: bool,
    typeOverrides: Dict[str, TypeExpectation] = dict(),
    silent: bool = False,
  ):
    """Initialize a PandasPatcher with particular failure and type expectations.

    Args:
      fail: Whether to raise errors or log to stderr when expectations are violated.
      expectations: Type expecatations for select columns.
    """
    self._silent = silent  # Set to True to basically disable
    self._fail = fail
    self._counter = TypeErrorCounter()
    self._origConcat = pd.concat
    self._origJoin = pd.DataFrame.join
    self._origMerge = pd.DataFrame.merge
    self._origApply = pd.DataFrame.apply
    self._origInit = pd.DataFrame.__init__
    self._origGetItem = pd.DataFrame.__getitem__
    self._origSetItem = pd.DataFrame.__setitem__
    self._origLocGetItem = pd.core.indexing._LocationIndexer.__getitem__
    self._origLocSetItem = pd.core.indexing._LocationIndexer.__setitem__
    self._expectations = {
      c.noteIdKey: TypeExpectation(np.int64, LogLevel.ERROR),
    }
    for column, expectation in typeOverrides.items():
      self._expectations[column] = expectation
Initialize a PandasPatcher with particular failure and type expectations.

    Args:
      fail: Whether to raise errors or log to stderr when expectations are violated.
      expectations: Type expecatations for select columns.
    
sourcecode/scoring/pandas_utils.py