def _validate_dict_of_dicts(x, function):
    message = (function + ' must be a dict of dict representing a simmetric matrix')
    if ((not isinstance(x, dict)) and (not isinstance(x[list(x.keys())], dict))):
        raise TypeError(message)
    for k in x.keys():
        if (x[k].keys() != x.keys()):
            raise ValueError(message)
def _validate_dict_of_dicts(x, function):
    message = (function + ' must be a dict of dict representing a simmetric matrix')
    if ((not isinstance(x, dict)) and (not isinstance(x[list(x.keys())], dict))):
        raise TypeError(message)
    for k in x.keys():
        if (x[k].keys() != x.keys()):
            raise ValueError(message)