@register.tag('clientsideexperiment')
def clientsideexperiment(parser, token, user_factory=WebUserFactory()):
    """
    Used to declare an experiment that affects JavaScript :
    
    (in template)
    {% clientsideexperiment <experiment_name> %}
    
    (in Javascript)
    if (experiment.test("<experiment_name>")) {
      // test case
    } else {
      // control case
    }
    
    The template tag populates the context with a dict at
    'client_side_experiments' with entries for each experiment name that map to
    either 'test' or 'control'.
    """
    try:
        tag_name, experiment_name = token.split_contents()
    except __HOLE__:
        raise template.TemplateSyntaxError("Syntax should be like :"
                "{% clientsideexperiment experiment_name  %}")
    
    return ClientSideExperimentNode(experiment_name, user_factory)
dataset/ETHPy150Open MontmereLimited/django-lean/django_lean/experiments/templatetags/experiments.py/clientsideexperiment