def degree(self, vertex):
        try:
            return len(self.vertices[vertex]['edges'])
        except KeyError:
            return 0
Return the number of edges for a given vertex.
dataset/ETHPy150Open christabor/MoAL/MOAL/data_structures/graphs/graphs.py/Graph.degree