Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Retrieve the experiments the user is a part of
@param experiment_ids : Either a single or list of experiment ids to retreive
@param user_id : An identifier for the user
@param client_id : Bernoulli Client ID - will default to BERNOULLI_CLIENT_ID ENV variable
@param bucket_if_necessary : Choose a variant for the user if one has not been chosen
@param user_data : Dictionary of user information to be used by the segment filters

        def get_experiments(experiment_ids=None, user_id=None, client_id=None, bucket_if_necessary=True, user_data=None):
    """
    Retrieve the experiments the user is a part of
    @param experiment_ids : Either a single or list of experiment ids to retreive
    @param user_id : An identifier for the user
    @param client_id : Bernoulli Client ID - will default to BERNOULLI_CLIENT_ID ENV variable
    @param bucket_if_necessary : Choose a variant for the user if one has not been chosen
    @param user_data : Dictionary of user information to be used by the segment filters
    """

    if not client_id:
        client_id = os.environ.get('BERNOULLI_CLIENT_ID')

    if not client_id:
        raise Exception("client_id is required")

    if type(experiment_ids) is dict:
        experiment_ids = ','.join(experiment_ids)

    params = {
        'clientId': client_id,
        'experimentIds': experiment_ids,
        'userId': user_id,
        'bucketIfNecessary': bucket_if_necessary,
    }

    if user_data is None:
        user_data = {}

    try:
        response = requests.get(BASE_URL, params=dict(params.items() + user_data.items()))
    except requests.ConnectionError:
        raise Exception("Unable to access service")

    val = response.json()
    if val['status'] != 'ok':
        raise Exception(val['message'])

    return val['value']
        


src/b/e/bernoulli_django-0.1.8/bernoulli_django/templatetags/experiments.py   bernoulli_django(Download)
        if not is_a_bot:
            experiments = bernoulli.get_experiments(
                client_id=settings.BERNOULLI_CLIENT_ID,
                experiment_ids=self.experiment_id,
                user_id=user_id,