<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def degree(self, vertex):

 """
 Return the degree of a vertex
 """

        try:
            return len(self.vertices[vertex])
        except KeyError:
            raise GraphInsertError("Vertex %s doesn't exist." % (vertex,))