Path: blob/master/scenario-notebooks/UserSecurityMetadata/NodeEdge.py
3253 views
# -------------------------------------------------------------------------1# Copyright (c) Microsoft Corporation. All rights reserved.2# Licensed under the MIT License. See License.txt in the project root for3# license information.4# --------------------------------------------------------------------------5from abc import ABC, abstractmethod678class Node:9def __init__(self, id, label, group):10self.id = id11self.label = label12self.group = group1314def __eq__(self, other):15return self.id == other.id1617def __hash__(self):18return hash(self.id)192021class DrawableNode(ABC):22def __init__(self):23super().__init__()2425@abstractmethod26def getNode(self):27pass282930class Edge:31def __init__(self, from_, to, label):32self.from_ = from_33self.to = to34self.label = label3536def __eq__(self, other):37return self.from_ == other.from_ and self.to == other.to and self.label == other.label3839def __hash__(self):40return hash(self.from_ + self.to + self.label)414243