def METHOD_NAME(cmd, resource_group_name, namespace_name, ip_rule=None):
    from azure.cli.command_modules.servicebus.aaz.latest.servicebus.namespace.network_rule_set import Update
    from azure.cli.command_modules.servicebus.aaz.latest.servicebus.namespace.network_rule_set import Show
    servicebus_ip_rule = Show(cli_ctx=cmd.cli_ctx)(command_args={
        "resource_group": resource_group_name,
        "namespace_name": namespace_name
    })
    ip_rule_list = []
    for i in servicebus_ip_rule["ipRules"]:
        ip_rule_dict = {
            "ip_address": i["ipMask"],
            "action": i["action"]
        }
        ip_rule_list.append(ip_rule_dict)
    for i in ip_rule:
        for j in ip_rule_list[:]:
            if i['ip-address'] == j["ip_address"]:
                ip_rule_list.remove(j)
    command_args_dict = {
        "resource_group": resource_group_name,
        "namespace_name": namespace_name,
        "ip_rules": ip_rule_list
    }
    return Update(cli_ctx=cmd.cli_ctx)(command_args=command_args_dict)