<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_quadrant_from_class(node_class):
 """Return the ID of the segment of the plane corresponding to a class."""

    up, edge_type, _ = node_class
    if up == 0:
        return 0 if random.random() < 0.5 else 7
    mappings = {(-1, 'modification'): 1,
                (-1, 'amount'): 2,
                (-1, 'activity'): 3,
                (1, 'activity'): 4,
                (1, 'amount'): 5,
                (1, 'modification'): 6}
    return mappings[(up, edge_type)]