# Buggy code
def set_lb_outbound_rule(
    instance,
    cmd,
    parent,
    item_name,
    protocol=None,
    outbound_ports=None,
    idle_timeout=None,
    frontend_ip_configurations=None,
    enable_tcp_reset=None,
    backend_address_pool=None,
):
    SubResource = cmd.get_models("SubResource")
    _set_param(instance, "protocol", protocol)
    _set_param(instance, "allocated_outbound_ports", outbound_ports)
    _set_param(instance, "idle_timeout_in_minutes", idle_timeout)
    _set_param(instance, "enable_tcp_reset", enable_tcp_reset)
    _set_param(
        instance,
        "backend_address_pool",
        SubResource(id=backend_address_pool) if backend_address_pool else None,
    )
    _set_param(
        instance,
        "frontend_ip_configurations",
        [SubResource(x) for x in frontend_ip_configurations]
        if frontend_ip_configurations
        else None,
    )

    return parent


# Traceback (TypeError)
__init__() takes 1 positional argument but 2 were given
Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.0.50/libexec/lib/python3.7/site-packages/knack/cli.py", line 197, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/Cellar/azure-cli/2.0.50/libexec/lib/python3.7/site-packages/azure/cli/core/commands/__init__.py", line 373, in execute
six.reraise(*sys.exc_info())
File "/usr/local/Cellar/azure-cli/2.0.50/libexec/lib/python3.7/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/Cellar/azure-cli/2.0.50/libexec/lib/python3.7/site-packages/azure/cli/core/commands/__init__.py", line 347, in execute
result = cmd(params)
File "/usr/local/Cellar/azure-cli/2.0.50/libexec/lib/python3.7/site-packages/azure/cli/core/commands/__init__.py", line 182, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/Cellar/azure-cli/2.0.50/libexec/lib/python3.7/site-packages/azure/cli/core/commands/arm.py", line 471, in handler
parent = custom_function(instance=instance, parent=parent, **custom_func_args)
File "/usr/local/Cellar/azure-cli/2.0.50/libexec/lib/python3.7/site-packages/azure/cli/command_modules/network/custom.py", line 1955, in set_lb_outbound_rule
[SubResource(x) for x in frontend_ip_configurations] if frontend_ip_configurations else None)
File "/usr/local/Cellar/azure-cli/2.0.50/libexec/lib/python3.7/site-packages/azure/cli/command_modules/network/custom.py", line 1955, in <listcomp>
[SubResource(x) for x in frontend_ip_configurations] if frontend_ip_configurations else None)
TypeError: __init__() takes 1 positional argument but 2 were given

# Fixed code
def set_lb_outbound_rule(
    instance,
    cmd,
    parent,
    item_name,
    protocol=None,
    outbound_ports=None,
    idle_timeout=None,
    frontend_ip_configurations=None,
    enable_tcp_reset=None,
    backend_address_pool=None,
):
    SubResource = cmd.get_models("SubResource")
    _set_param(instance, "protocol", protocol)
    _set_param(instance, "allocated_outbound_ports", outbound_ports)
    _set_param(instance, "idle_timeout_in_minutes", idle_timeout)
    _set_param(instance, "enable_tcp_reset", enable_tcp_reset)
    _set_param(
        instance,
        "backend_address_pool",
        SubResource(id=backend_address_pool) if backend_address_pool else None,
    )
    _set_param(
        instance,
        "frontend_ip_configurations",
        [SubResource(id=x) for x in frontend_ip_configurations]
        if frontend_ip_configurations
        else None,
    )

    return parent