def METHOD_NAME(o):
    """
    Function to create hashes for dictionaries with nested objects
    Source: https://stackoverflow.com/a/42151923
    """
    if isinstance(o, (tuple, list)):
        return tuple((METHOD_NAME(e) for e in o))
    if isinstance(o, dict):
        return tuple(sorted((k, METHOD_NAME(v)) for k, v in o.items()))
    if isinstance(o, (set, frozenset)):
        return tuple(sorted(METHOD_NAME(e) for e in o))
    if callable(
        getattr(o, "make_hashable", None)
    ):  # checks if the object o has the method make_hashable
        return o.METHOD_NAME()
    return o