code: def check_preconditions(f, args, kwargs):
      
      f = getattr(f, 'wrapped_fn', f)
      if f and hasattr(f, 'preconditions'):
          for cond in f.preconditions:
              cond(args, kwargs)
docs: Runs all of the preconditions.