@classmethod
    def __test_group(cls, experiment_name, experiment_user, queried_group):
        from django_lean.experiments.loader import ExperimentLoader
        ExperimentLoader.load_all_experiments()

        experiment = None
        try:
            experiment = Experiment.objects.get(name=experiment_name)
        except Experiment.DoesNotExist:
            if settings.DEBUG:
                raise Exception("Can't find the Experiment named %s" %
                                experiment_name)
            else:
                l.warning("Can't find the Experiment named %s" %
                          experiment_name)
                return queried_group == Participant.CONTROL_GROUP
        if experiment.state == Experiment.DISABLED_STATE:
            return queried_group == Participant.CONTROL_GROUP
        elif experiment.state == Experiment.PROMOTED_STATE:
            return queried_group == Participant.TEST_GROUP

        if experiment.state != Experiment.ENABLED_STATE:
            raise Exception("Invalid experiment state !")

        user = cls.__create_user(experiment_user)

        assigned_group = user.get_enrollment(experiment)

        if assigned_group == None:
            assigned_group = random.choice((Participant.CONTROL_GROUP,
                                            Participant.TEST_GROUP))
            user.set_enrollment(experiment, assigned_group)

        return queried_group == assigned_group
Iterate the lines of a function.
dataset/ETHPy150Open e-loue/django-lean/django_lean/experiments/models.py/Experiment.__test_group--crossover with--dataset/ETHPy150Open tmr232/Sark/sark/code/function.py/iter_function_lines