def __eq__(self, other, deep=False):
    if (len(self.entity_dict) != len(other.entity_dict)):
        return False
    for (eid, e) in self.entity_dict.items():
        if (eid not in other.entity_dict):
            return False
        if (not e.__eq__(other[eid], deep=deep)):
            return False
    for r in other.relationships:
        if (r not in other.relationships):
            return False
    return True
def __eq__(self, other, deep=False):
    if (len(self.entity_dict) != len(other.entity_dict)):
        return False
    for (eid, e) in self.entity_dict.items():
        if (eid not in other.entity_dict):
            return False
        if (not e.__eq__(other[eid], deep=deep)):
            return False
    for r in other.relationships:
        if (r not in other.relationships):
            return False
    return True