

def __verify_hackathon(self, hackathon_name):
    'validate the event_start_time and event_end_time of a hackathon\n\n        Will return None if hackathon not found or current time is not between its start time and end time\n        '
    hackathon = self.hackathon_manager.get_hackathon_by_name(hackathon_name)
    if hackathon:
        if (HACKATHON_CONFIG.CLOUD_PROVIDER not in hackathon.config):
            raise PreconditionFailed('No cloud resource is configured for this hackathon.')
        if (self.util.get_now() < hackathon.event_end_time):
            return hackathon
        else:
            raise PreconditionFailed('Hackathon was already ended')
    else:
        raise NotFound(('Hackathon with name %s not found' % hackathon_name))

dataset/ETHPy150Open msopentechcn/open-hackathon/open-hackathon-server/src/hackathon/expr/expr_mgr.py ExprManager.__verify_hackathon/original