human
Complete the below
def can_perform_cron_tasks(handler):

    ''''Decorator to ensure that the handler is being called by cron or by a
    superadmin of the application.'
    '''
 Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    def test_can_perform(self, **kwargs):
        if ((self.request.headers.get('X-AppEngine-Cron') is None) and (not self.is_super_admin)):
            raise self.UnauthorizedUserException('You    do    not    have    the    credentials    to    access    this    page.')
        else:
            return handler(self, **kwargs)
    test_can_perform.__wrapped__ = True
    return test_can_perform