Module Expr Str Import alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str ListLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Dict Str Str NameLoad NameLoad FunctionDef arguments args NameParam defaults body AugAssignMult NameStore Num If CompareLt Call NameLoad NameLoad Num body Return BinOpMod Str Call NameLoad NameLoad Num orelse Return BinOpMod Str Call NameLoad NameLoad decorator_list Call AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults vararg body Expr Str Assign NameStore Call NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If AttributeLoad NameLoad attr body Return AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If NameLoad body Return NameLoad Expr Call NameLoad NameLoad If BoolOpOr Call NameLoad Call NameLoad AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call NameLoad attr AttributeLoad NameLoad attr If NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body If UnaryOpNot SubscriptLoad AttributeLoad NameLoad attr Index Str body Raise Assign NameStore SubscriptLoad NameLoad Index Num Return IfExp Call NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If Call NameLoad body Return Assign NameStore Call NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot NameLoad body Return Assign NameStore Call AttributeLoad Call NameLoad attr AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str ListLoad If CompareNotIn AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad Call NameLoad attr AttributeLoad NameLoad attr NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Pass orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad handlers ExceptHandler type NameLoad body If UnaryOpNot SubscriptLoad AttributeLoad NameLoad attr Index Str body Raise decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIn Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body If UnaryOpNot NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore Call NameLoad Index AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Dict Return SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args defaults body Expr Str Return BoolOpOr Call NameLoad Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BoolOpAnd UnaryOpNot SubscriptLoad AttributeLoad NameLoad attr Index Str Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call AttributeLoad Call NameLoad attr body If CompareNotEq NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore Call NameLoad NameLoad body Delete SubscriptDel Call NameLoad Index NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareGt AttributeLoad NameLoad attr Num body Return ListComp NameLoad comprehension NameStore Call AttributeLoad Call NameLoad attr BoolOpAnd Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareNotEq NameLoad AttributeLoad NameLoad attr orelse Return ListLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Return Call AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Return CompareIn AttributeLoad NameLoad attr NameLoad decorator_list
N/A N/A 
    flask.ext.split.core
    ~~~~~~~~~~~~~~~~~~~~

    Implements the core functionality for doing A/B tests.

    :copyright: (c) 2012-2015 by Janne Vanhala.
    :license: MIT, see LICENSE for more details.
 N/A re flask current_app request session redis ConnectionError models Alternative Experiment utils _get_redis_connection views split init_app N/A N/A state N/A N/A N/A 
    Prepare the Flask application for Flask-Split.

    :param state: :class:`BlueprintSetupState` instance
     N/A app N/A state app N/A N/A N/A N/A app config setdefault SPLIT_ALLOW_MULTIPLE_EXPERIMENTS False N/A N/A N/A N/A app config setdefault SPLIT_DB_FAILOVER False N/A N/A N/A N/A app config setdefault SPLIT_IGNORE_IP_ADDRESSES N/A N/A N/A N/A N/A app config setdefault SPLIT_ROBOT_REGEX 
        (?i)\b(
            Baidu|
            Gigabot|
            Googlebot|
            libwww-perl|
            lwp-trivial|
            msnbot|
            SiteUptime|
            Slurp|
            WordPress|
            ZIBB|
            ZyBorg
        )\b
     N/A N/A N/A N/A N/A app jinja_env globals update N/A ab_test finished ab_test finished percentage N/A N/A number N/A N/A N/A number 100 N/A N/A N/A abs number 10 N/A N/A N/A %.1f%% N/A round number 1 N/A N/A N/A %d%% N/A round number N/A N/A N/A app template_filter N/A N/A split record ab_test N/A N/A experiment_name N/A alternatives N/A N/A 
    Start a new A/B test.

    Returns one of the alternatives. If the user has already seen the test,
    they will get the same alternative as before.

    :param experiment_name: Name of the experiment.  You should never use the
        same experiment name to refer to a second experiment.
    :param alternatives: A list of alternatives.  Each item can be either a
        string or a two-tuple of the form (alternative name, weight).  By
        default each alternative has the weight of 1.  The first alternative
        is the control.  Every experiment must have at least  two alternatives.
     N/A redis N/A _get_redis_connection N/A N/A N/A experiment N/A N/A Experiment find_or_create redis experiment_name alternatives N/A N/A experiment winner N/A N/A N/A N/A experiment winner name N/A N/A forced_alternative N/A _override N/A experiment name N/A experiment alternative_names N/A forced_alternative N/A N/A forced_alternative N/A N/A _clean_old_versions experiment N/A N/A N/A _exclude_visitor N/A _not_allowed_to_test N/A experiment key N/A N/A N/A _begin_experiment experiment N/A alternative_name N/A N/A N/A _get_session get N/A experiment key N/A alternative_name N/A N/A alternative_name N/A alternative N/A N/A experiment next_alternative N/A N/A N/A alternative increment_participation N/A N/A _begin_experiment experiment N/A alternative name N/A N/A alternative name N/A N/A N/A ConnectionError N/A N/A N/A N/A N/A current_app config N/A SPLIT_DB_FAILOVER N/A N/A N/A control N/A alternatives N/A 0 N/A N/A N/A isinstance control tuple N/A control N/A 0 control N/A finished N/A N/A experiment_name reset N/A True N/A N/A 
    Track a conversion.

    :param experiment_name: Name of the experiment.
    :param reset: If set to `True` current user's session is reset so that they
        may start the test again in the future.  If set to `False` the user
        will always see the alternative they started with.  Defaults to `True`.
     N/A N/A _exclude_visitor N/A N/A N/A redis N/A _get_redis_connection N/A N/A N/A experiment N/A N/A Experiment find redis experiment_name N/A N/A experiment N/A N/A N/A alternative_name N/A N/A N/A _get_session get N/A experiment key N/A alternative_name N/A N/A split_finished N/A set N/A N/A session get split_finished N/A N/A N/A N/A experiment key split_finished N/A N/A alternative N/A Alternative redis alternative_name experiment_name N/A N/A N/A alternative increment_completion N/A reset N/A N/A N/A N/A N/A _get_session pop N/A experiment key None N/A N/A N/A N/A N/A split_finished remove N/A experiment key N/A N/A N/A KeyError N/A N/A N/A N/A N/A N/A split_finished add N/A experiment key N/A N/A session N/A split_finished N/A list split_finished N/A N/A N/A ConnectionError N/A N/A N/A N/A N/A current_app config N/A SPLIT_DB_FAILOVER N/A N/A N/A _override N/A N/A experiment_name alternatives N/A N/A N/A N/A N/A N/A N/A request args get experiment_name alternatives N/A N/A N/A N/A N/A request args get experiment_name N/A _begin_experiment N/A N/A experiment alternative_name N/A None N/A N/A N/A alternative_name N/A N/A alternative_name N/A N/A experiment control name N/A N/A N/A _get_session N/A N/A experiment key alternative_name N/A N/A session modified True N/A _get_session N/A N/A N/A N/A N/A N/A split session N/A N/A N/A session N/A split N/A N/A N/A session N/A split N/A _exclude_visitor N/A N/A N/A N/A N/A 
    Return `True` if the current visitor should be excluded from participating
    to the A/B test, or `False` otherwise.
     N/A N/A N/A _is_robot N/A _is_ignored_ip_address N/A _not_allowed_to_test N/A N/A experiment_key N/A N/A N/A N/A N/A N/A N/A current_app config N/A SPLIT_ALLOW_MULTIPLE_EXPERIMENTS N/A _doing_other_tests experiment_key N/A _doing_other_tests N/A N/A experiment_key N/A N/A N/A 
    Return `True` if the current user is doing other experiments than the
    experiment with the key ``experiment_key`` at the moment, or `False`
    otherwise.
     N/A key N/A N/A N/A _get_session iterkeys N/A N/A N/A key experiment_key N/A N/A True N/A False N/A _clean_old_versions N/A N/A experiment N/A N/A N/A old_key N/A _old_versions experiment N/A N/A N/A N/A _get_session N/A old_key N/A N/A session modified True N/A _old_versions N/A N/A experiment N/A N/A N/A N/A N/A experiment version 0 N/A N/A N/A key N/A key N/A N/A N/A _get_session iterkeys N/A N/A N/A key startswith N/A experiment name N/A key N/A experiment key N/A N/A N/A N/A _is_robot N/A N/A N/A N/A N/A 
    Return `True` if the current visitor is a robot or spider, or
    `False` otherwise.

    This function works by comparing the request's user agent with a regular
    expression.  The regular expression can be configured with the
    ``SPLIT_ROBOT_REGEX`` setting.
     N/A robot_regex N/A N/A current_app config N/A SPLIT_ROBOT_REGEX N/A user_agent N/A N/A N/A request headers get User-Agent N/A N/A N/A re search robot_regex user_agent flags N/A re VERBOSE N/A _is_ignored_ip_address N/A N/A N/A N/A N/A 
    Return `True` if the IP address of the current visitor should be
    ignored, or `False` otherwise.

    The list of ignored IP addresses can be configured with the
    ``SPLIT_IGNORE_IP_ADDRESSES`` setting.
     N/A ignore_ip_addresses N/A N/A current_app config N/A SPLIT_IGNORE_IP_ADDRESSES N/A N/A N/A request remote_addr ignore_ip_addresses N/A