def _initialize_override(module, override, cfg):
    if (not isinstance(override, (dict, list))):
        raise TypeError(f'override must be a dict or a list of dict,                 but got {type(override)}')
    override = ([override] if isinstance(override, dict) else override)
    for override_ in override:
        cp_override = copy.deepcopy(override_)
        name = cp_override.pop('name', None)
        if (name is None):
            raise ValueError(f'`override` must contain the key "name",but got {cp_override}')
        if (not cp_override):
            cp_override.update(cfg)
        elif ('type' not in cp_override.keys()):
            raise ValueError(f'`override` need "type" key, but got {cp_override}')
        if hasattr(module, name):
            _initialize(getattr(module, name), cp_override, wholemodule=True)
        else:
            raise RuntimeError(f'module did not have attribute {name}, but init_cfg is {cp_override}.')
def _initialize_override(module, override, cfg):
    if (not isinstance(override, (dict, list))):
        raise TypeError(f'override must be a dict or a list of dict,                 but got {type(override)}')
    override = ([override] if isinstance(override, dict) else override)
    for override_ in override:
        cp_override = copy.deepcopy(override_)
        name = cp_override.pop('name', None)
        if (name is None):
            raise ValueError(f'`override` must contain the key "name",but got {cp_override}')
        if (not cp_override):
            cp_override.update(cfg)
        elif ('type' not in cp_override.keys()):
            raise ValueError(f'`override` need "type" key, but got {cp_override}')
        if hasattr(module, name):
            _initialize(getattr(module, name), cp_override, wholemodule=True)
        else:
            raise RuntimeError(f'module did not have attribute {name}, but init_cfg is {cp_override}.')