# Buggy code
def add_for_stake(
    general_config,
    staker_address,
    host_address,
    login_name,
    key_path,
    ssh_port,
    namespace,
):
    """Sets an existing node as the host for the given staker address."""

    emitter = setup_emitter(general_config)

    STAKEHOLDER = staker_options.create_character(emitter, config_file)

    stakers = STAKEHOLDER.get_stakers()
    if not stakers:
        emitter.echo("No staking accounts found.")
        return

    staker_addresses = filter_staker_addresses(stakers, [staker_address])
    if not staker_addresses:
        emitter.echo(
            f"Could not find staker address: {staker_address} among your stakes. (try `nucypher stake --list`)",
            color="red",
        )
        return

    config_file = config_file or StakeHolderConfiguration.default_filepath()

    deployer = CloudDeployers.get_deployer("generic")(
        emitter,
        STAKEHOLDER,
        config_file,
        namespace=namespace,
        network=STAKEHOLDER.network,
        action="add_for_stake",
    )
    config = deployer.create_nodes(
        staker_addresses, host_address, login_name, key_path, ssh_port
    )


# Traceback (TypeError)
Traceback (most recent call last):
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/bin/nucypher", line 33, in <module>
sys.exit(load_entry_point('nucypher', 'console_scripts', 'nucypher')())
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/k/.local/share/virtualenvs/nucypher-iNjwDRsw/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/k/Git/nucypher/nucypher/cli/options.py", line 167, in wrapper
return func(**kwargs)
File "/home/k/Git/nucypher/nucypher/cli/options.py", line 167, in wrapper
return func(**kwargs)
File "/home/k/Git/nucypher/nucypher/cli/options.py", line 167, in wrapper
return func(**kwargs)
TypeError: add_for_stake() got an unexpected keyword argument 'config_file'

# Fixed code
def add_for_stake(
    general_config,
    staker_options,
    config_file,
    staker_address,
    host_address,
    login_name,
    key_path,
    ssh_port,
    namespace,
):
    """Sets an existing node as the host for the given staker address."""

    emitter = setup_emitter(general_config)

    STAKEHOLDER = staker_options.create_character(emitter, config_file)

    stakers = STAKEHOLDER.get_stakers()
    if not stakers:
        emitter.echo("No staking accounts found.")
        return

    staker_addresses = filter_staker_addresses(stakers, [staker_address])
    if not staker_addresses:
        emitter.echo(
            f"Could not find staker address: {staker_address} among your stakes. (try `nucypher stake --list`)",
            color="red",
        )
        return

    config_file = config_file or StakeHolderConfiguration.default_filepath()

    deployer = CloudDeployers.get_deployer("generic")(
        emitter,
        STAKEHOLDER,
        config_file,
        namespace=namespace,
        network=STAKEHOLDER.network,
        action="add_for_stake",
    )
    config = deployer.create_nodes(
        staker_addresses, host_address, login_name, key_path, ssh_port
    )