def __check_expr_status(self, user, hackathon, template):
        criterion = Q(status__in=[EStatus.RUNNING, EStatus.STARTING], hackathon=hackathon, user=user)
        is_admin = self.admin_manager.is_hackathon_admin(hackathon.id, user.id)
        if is_admin:
            criterion &= Q(template=template)

        expr = Experiment.objects(criterion).first()
        if expr:
            # user has a running/starting experiment
            return expr

        # try to assign pre-configured expr to user
        expr = Experiment.objects(status=EStatus.RUNNING, hackathon=hackathon, template=template, user=None).first()
        if expr:
            expr.user = user
            expr.save()
            return expr
check experiment status, if there are pre-allocate experiments, the experiment will be assigned directly
dataset/ETHPy150Open msopentechcn/open-hackathon/open-hackathon-server/src/hackathon/expr/expr_mgr.py/ExprManager.__check_expr_status