code: def require(*requirements, **kwargs):
      
      # TODO: require(*requirements, none_on_failure=False) is not supported by Python 2
      none_on_failure = kwargs.get('none_on_failure', False)
  
      def inner(f):
          @functools.wraps(f)
          def wrapper(*args, **kwargs):
              for req in requirements:
                  if none_on_failure:
                      if not getattr(req, 'is_available'):
                          return None
                  else:
                      getattr(req, 'require')()
              return f(*args, **kwargs)
          return wrapper
      return inner
docs: Decorator that can be used to require requirements.
  
      :param requirements: List of requirements that should be verified
      :param none_on_failure: If true, does not raise a PrerequisiteFailedError, but instead returns None