docs: def apply(self, args, kwargs):
          """
          Replicate a call to the encapsulated function.
  
          Unlike func(*args, **kwargs) the call is deterministic in the order
          kwargs are being checked by python. In other words, it behaves exactly
          the same as if typed into the repl prompt.
  
          This is usually only a problem when a function is given two invalid
          keyword arguments. In such cases func(*args, **kwargs) syntax will
          result in random error on either of those invalid keyword arguments.
          This is most likely caused by a temporary dictionary created by the
          runtime.
  
          For testing a OderedDictionary instance may be passed as kwargs.  In
          such case the call, and the error message, is fully deterministic.
  
          This function is implemented with eval()
          """
          # Construct helper locals that only contain the function to call as
          # 'func', all positional arguments as 'argX' and all keyword arguments
          # as 'kwX'
          _locals = {'func': self._func}
          if args is not None:
              _locals.update({
                  "arg{}".format(index): args[index]
                  for index, value in enumerate(args)})
          if kwargs is not None:
              # Explicitly build a list of keyword arguments so that we never
              # traverse kwargs more than once
              kw_list = list(kwargs.keys())
              _locals.update({
                  "kw{}".format(index): kwargs[key]
                  for index, key in enumerate(kw_list)})
          # Construct the call expression string by carefully
          # placing each positional and keyword arguments in right
          # order that _exactly_ matches how apply() was called.
          params = []
          if args is not None:
              params.extend([
                  "arg{}".format(index)
                  for index in range(len(args))])
          if kwargs is not None:
              params.extend([
                  "{}=kw{}".format(key, index)
                  for index, key in enumerate(kw_list)])
          expr = "func({})".format(", ".join(params))
          return eval(expr, globals(), _locals)