def METHOD_NAME(d: Union[dict, list], sort_lists: bool = False):
    if isinstance(d, list):
        return [METHOD_NAME(x) for x in (sorted(d) if sort_lists else d)]
    if isinstance(d, dict):
        return OrderedDict(**{k: METHOD_NAME(d[k]) for k in sorted(d.keys())})
    return d