<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_irregular_vertex(bgedge):
 """ This method is called only in irregular edges in current implementation, thus at least one edge will be irregular """

    if not bgedge.is_irregular_edge:
        raise Exception("trying to retrieve an irregular vertex from regular edge")
    return bgedge.vertex1 if bgedge.vertex1.is_irregular_vertex else bgedge.vertex2