def remove_attrs_startwith(dictionary, chars):
    def for_list(val):
        for v in val:
            if isinstance(v, (list, tuple)):
                for_list(v)
            elif type(v) == dict:
                remove_attrs_startwith(v, chars)

    for key, val in dictionary.items():
        if key.startswith(chars):
            dictionary.pop(key)
        elif type(val) != dict:
            if isinstance(val, (list, tuple)):
                for_list(val)
        else:
            remove_attrs_startwith(val, chars)
Updates security group rules for all instances associated with a
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/addons/jsonmap/utils.py/remove_attrs_startwith--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/driver.py/XenAPIDriver.refresh_security_group_rules