def METHOD_NAME(self, res, d):
    for name in d.keys():
        sane_name = name.replace(".", "__")
        if hasattr(res, f"_parse_{sane_name}_dict"):
            getattr(res, f"_parse_{sane_name}_dict")(self, d[name])
        elif isinstance(res, (dict, OrderedDict)):
            result = self._parse(d[name])
            try:
                res[name] = result
            except (TypeError, KeyError):  # hmmm...
                res = {}  # ugly, this fixes nested dicts in customparameters
                res[name] = result
        else:
            res[name] = d[name]