def finished(experiment_name, reset=True):
if _exclude_visitor():<EOL><INDENT>return<EOL><DEDENT>redis = _get_redis_connection()<EOL>try:<EOL><INDENT>experiment = Experiment.find(redis, experiment_name)<EOL>if not experiment:<EOL><INDENT>return<EOL><DEDENT>alternative_name = _get_session().get(experiment.key)<EOL>if alternative_name:<EOL><INDENT>split_finished = set(session.get('<STR_LIT>', []))<EOL>if experiment.key not in split_finished:<EOL><INDENT>alternative = Alternative(<EOL>redis, alternative_name, experiment_name)<EOL>alternative.increment_completion()<EOL><DEDENT>if reset:<EOL><INDENT>_get_session().pop(experiment.key, None)<EOL>try:<EOL><INDENT>split_finished.remove(experiment.key)<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>split_finished.add(experiment.key)<EOL><DEDENT>session['<STR_LIT>'] = list(split_finished)<EOL><DEDENT><DEDENT>except ConnectionError:<EOL><INDENT>if not current_app.config['<STR_LIT>']:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>
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`.