def sameStructure(d1, d2):
    """
    Checks weather the two directories have the same structure - only the values
    may be different but not the key

    To the structure does not count the type of the value

    Taken from https://stackoverflow.com/a/24193949/1935553

    :param    d1:   The first directory that will be compared with the second
    :param    d2:   The second directory that will be compared with the first

    :returns: True if the two directories have the same structure,
              False otherwise
    """
    if isinstance(d1, dict):
        if isinstance(d2, dict):
            # then we have shapes to check
            return (d1.keys() == d2.keys() and
                    # so the keys are all the same
                    all(sameStructure(d1[k], d2[k]) for k in d1.keys()))
            # thus all values will be tested in the same way.
        else:
            return False  # d1 is a dict, but d2 isn't
    else:
        return not isinstance(d2, dict)