human
Write me a the Python program you requested given the following:
Complete the below
def can_flag_exploration(handler):

    ''''Decorator to check whether user can flag given exploration.'
    '''
assistant
#Here is the Python program you requested.
    def test_can_flag(self, exploration_id, **kwargs):
        if (role_services.ACTION_FLAG_EXPLORATION in self.actions):
            return handler(self, exploration_id, **kwargs)
        else:
            raise base.UserFacingExceptions.UnauthorizedUserException('You    do    not    have    credentials    to    flag    explorations.')
    test_can_flag.__wrapped__ = True
    return test_can_flag