# Buggy code
def install(prefix, specs, args, env, prune=False):
    # TODO: support all various ways this happens
    # Including 'nodefaults' in the channels list disables the defaults
    new_specs = []
    channel_urls = set()
    for elem in specs:
        if "::" in elem:
            channel_urls.add(elem.split("::")[0])
            new_specs.append(elem.split("::")[-1])
        else:
            new_specs.append(elem)
    specs = new_specs
    channel_urls = list(channel_urls)
    # TODO: support all various ways this happens
    # Including 'nodefaults' in the channels list disables the defaults
    channel_urls = channel_urls + [
        chan for chan in env.channels if chan != "nodefaults"
    ]
    if "nodefaults" not in env.channels:
        channel_urls.extend(context.channels)
    _channel_priority_map = prioritize_channels(channel_urls)

    channel_names = IndexedSet(
        Channel(url).canonical_name for url in _channel_priority_map
    )
    channels = IndexedSet(Channel(cn) for cn in channel_names)
    subdirs = IndexedSet(basename(url) for url in _channel_priority_map)

    solver = Solver(prefix, channels, subdirs, specs_to_add=specs)
    unlink_link_transaction = solver.solve_for_transaction(prune=prune)

    pfe = unlink_link_transaction.get_pfe()
    pfe.execute()
    unlink_link_transaction.execute()


# Traceback (TypeError)
{
"command":"/home/travis/miniconda/bin/conda-env update",
"conda_info":{
"GID":2000,
"UID":2000,
"_channels":"https://conda.anaconda.org/conda-canary/linux-64
https://conda.anaconda.org/conda-canary/noarch
https://repo.continuum.io/pkgs/free/linux-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/linux-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/linux-64
https://repo.continuum.io/pkgs/pro/noarch",
"_config_files":"/home/travis/.condarc",
"_envs_dirs":"/home/travis/miniconda/envs
/home/travis/.conda/envs",
"_pkgs_dirs":"/home/travis/miniconda/pkgs
/home/travis/.conda/pkgs",
"_rtwro":"writable",
"active_prefix":null,
"active_prefix_name":null,
"channels":[
"https://conda.anaconda.org/conda-canary/linux-64",
"https://conda.anaconda.org/conda-canary/noarch",
"https://repo.continuum.io/pkgs/free/linux-64",
"https://repo.continuum.io/pkgs/free/noarch",
"https://repo.continuum.io/pkgs/r/linux-64",
"https://repo.continuum.io/pkgs/r/noarch",
"https://repo.continuum.io/pkgs/pro/linux-64",
"https://repo.continuum.io/pkgs/pro/noarch"
],
"conda_build_version":"not installed",
"conda_env_version":"4.4.0rc0",
"conda_location":"/home/travis/miniconda/lib/python3.6/site-packages/conda",
"conda_prefix":"/home/travis/miniconda",
"conda_private":false,
"conda_shlvl":-1,
"conda_version":"4.4.0rc0",
"config_files":[
"/home/travis/.condarc"
],
"default_prefix":"/home/travis/miniconda",
"envs":[

],
"envs_dirs":[
"/home/travis/miniconda/envs",
"/home/travis/.conda/envs"
],
"netrc_file":null,
"offline":false,
"pkgs_dirs":[
"/home/travis/miniconda/pkgs",
"/home/travis/.conda/pkgs"
],
"platform":"linux-64",
"python_version":"3.6.1.final.0",
"rc_path":"/home/travis/.condarc",
"requests_version":"2.14.2",
"root_prefix":"/home/travis/miniconda",
"root_writable":true,
"sys_rc_path":"/home/travis/miniconda/.condarc",
"user_agent":"conda/4.4.0rc0 requests/2.14.2 CPython/3.6.1 Linux/4.4.0-83-generic ubuntu/14.04 glibc/2.19",
"user_rc_path":"/home/travis/.condarc"
},
"error":"TypeError(\"_pip_install_via_requirements() got an unexpected keyword argument 'prune'\",)",
"exception_name":"TypeError",
"exception_type":"<class 'TypeError'>",
"traceback":"Traceback (most recent call last):
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda/exceptions.py\", line 653, in __call__
return func(*args, **kwargs)
File \"/home/travis/miniconda/lib/python3.6/site-packages/conda_env/cli/main_update.py\", line 107, in execute
installer.install(prefix, specs, args, env, prune=args.prune)
TypeError: _pip_install_via_requirements() got an unexpected keyword argument 'prune'
"
}

# Fixed code
def install(prefix, specs, args, env, *_, **kwargs):
    # TODO: support all various ways this happens
    # Including 'nodefaults' in the channels list disables the defaults
    new_specs = []
    channel_urls = set()
    for elem in specs:
        if "::" in elem:
            channel_urls.add(elem.split("::")[0])
            new_specs.append(elem.split("::")[-1])
        else:
            new_specs.append(elem)
    specs = new_specs
    channel_urls = list(channel_urls)
    # TODO: support all various ways this happens
    # Including 'nodefaults' in the channels list disables the defaults
    channel_urls = channel_urls + [
        chan for chan in env.channels if chan != "nodefaults"
    ]
    if "nodefaults" not in env.channels:
        channel_urls.extend(context.channels)
    _channel_priority_map = prioritize_channels(channel_urls)

    channel_names = IndexedSet(
        Channel(url).canonical_name for url in _channel_priority_map
    )
    channels = IndexedSet(Channel(cn) for cn in channel_names)
    subdirs = IndexedSet(basename(url) for url in _channel_priority_map)

    solver = Solver(prefix, channels, subdirs, specs_to_add=specs)
    unlink_link_transaction = solver.solve_for_transaction(
        prune=getattr(args, "prune", False)
    )

    pfe = unlink_link_transaction.get_pfe()
    pfe.execute()
    unlink_link_transaction.execute()