code: def requires_authentication(func):
          
          def _auth(self, *args, **kwargs):
              if not self._authenticated:
                  raise NotAuthenticatedException('Function {} requires'
                                                  .format(func.__name__)
                                                  + ' authentication')
              else:
                  return func(self, *args, **kwargs)
          return _auth
docs: Function decorator that throws an exception if the user
          is not authenticated, and executes the function normally
          if the user is authenticated.