import ast

timing_to_temporal = {
    "t_before": ["precedes", "meets", "overlaps", "finished_by", "contains"],
    "t_while": ["overlaps", "finished_by", "contains", "starts", "equals", "started_by", "during", "finishes", "overlapped_by"],
    "t_after": ["during", "finishes", "overlapped_by", "met_by", "preceded_by"]
}

region_to_spatial= {    
    "top": [('s_precedes', 's_contains'), ('s_precedes', 's_started_by'), ('s_precedes', 's_overlapped_by'), ('s_precedes', 's_met_by'), ('s_precedes', 's_preceded_by'), ('s_meets', 's_contains'), ('s_meets', 's_started_by'), ('s_meets', 's_overlapped_by'), ('s_meets', 's_met_by'), ('s_meets', 's_preceded_by'), ('s_overlaps', 's_contains'), ('s_overlaps', 's_started_by'), ('s_overlaps', 's_overlapped_by'), ('s_overlaps', 's_met_by'), ('s_overlaps', 's_preceded_by'), ('s_finished_by', 's_contains'), ('s_finished_by', 's_started_by'), ('s_finished_by', 's_overlapped_by'), ('s_finished_by', 's_met_by'), ('s_finished_by', 's_preceded_by'), ('s_contains', 's_contains'), ('s_contains', 's_started_by'), ('s_contains', 's_overlapped_by'), ('s_contains', 's_met_by'), ('s_contains', 's_preceded_by'), ('s_starts', 's_contains'), ('s_starts', 's_started_by'), ('s_starts', 's_overlapped_by'), ('s_starts', 's_met_by'), ('s_starts', 's_preceded_by'), ('s_equals', 's_contains'), ('s_equals', 's_started_by'), ('s_equals', 's_overlapped_by'), ('s_equals', 's_met_by'), ('s_equals', 's_preceded_by'), ('s_started_by', 's_contains'), ('s_started_by', 's_started_by'), ('s_started_by', 's_overlapped_by'), ('s_started_by', 's_met_by'), ('s_started_by', 's_preceded_by'), ('s_during', 's_contains'), ('s_during', 's_started_by'), ('s_during', 's_overlapped_by'), ('s_during', 's_met_by'), ('s_during', 's_preceded_by'), ('s_finishes', 's_contains'), ('s_finishes', 's_started_by'), ('s_finishes', 's_overlapped_by'), ('s_finishes', 's_met_by'), ('s_finishes', 's_preceded_by'), ('s_overlapped_by', 's_contains'), ('s_overlapped_by', 's_started_by'), ('s_overlapped_by', 's_overlapped_by'), ('s_overlapped_by', 's_met_by'), ('s_overlapped_by', 's_preceded_by'), ('s_met_by', 's_contains'), ('s_met_by', 's_started_by'), ('s_met_by', 's_overlapped_by'), ('s_met_by', 's_met_by'), ('s_met_by', 's_preceded_by'), ('s_preceded_by', 's_contains'), ('s_preceded_by', 's_started_by'), ('s_preceded_by', 's_overlapped_by'), ('s_preceded_by', 's_met_by'), ('s_preceded_by', 's_preceded_by')],
    
    "right": [('s_started_by', 's_precedes'), ('s_started_by', 's_meets'), ('s_started_by', 's_overlaps'), ('s_started_by', 's_starts'), ('s_started_by', 's_during'), ('s_started_by', 's_finished_by'), ('s_started_by', 's_equals'), ('s_started_by', 's_finishes'), ('s_started_by', 's_contains'), ('s_started_by', 's_started_by'), ('s_started_by', 's_overlapped_by'), ('s_started_by', 's_met_by'), ('s_started_by', 's_preceded_by'), ('s_overlapped_by', 's_precedes'), ('s_overlapped_by', 's_meets'), ('s_overlapped_by', 's_overlaps'), ('s_overlapped_by', 's_starts'), ('s_overlapped_by', 's_during'), ('s_overlapped_by', 's_finished_by'), ('s_overlapped_by', 's_equals'), ('s_overlapped_by', 's_finishes'), ('s_overlapped_by', 's_contains'), ('s_overlapped_by', 's_started_by'), ('s_overlapped_by', 's_overlapped_by'), ('s_overlapped_by', 's_met_by'), ('s_overlapped_by', 's_preceded_by'), ('s_met_by', 's_precedes'), ('s_met_by', 's_meets'), ('s_met_by', 's_overlaps'), ('s_met_by', 's_starts'), ('s_met_by', 's_during'), ('s_met_by', 's_finished_by'), ('s_met_by', 's_equals'), ('s_met_by', 's_finishes'), ('s_met_by', 's_contains'), ('s_met_by', 's_started_by'), ('s_met_by', 's_overlapped_by'), ('s_met_by', 's_met_by'), ('s_met_by', 's_preceded_by'), ('s_preceded_by', 's_precedes'), ('s_preceded_by', 's_meets'), ('s_preceded_by', 's_overlaps'), ('s_preceded_by', 's_starts'), ('s_preceded_by', 's_during'), ('s_preceded_by', 's_finished_by'), ('s_preceded_by', 's_equals'), ('s_preceded_by', 's_finishes'), ('s_preceded_by', 's_contains'), ('s_preceded_by', 's_started_by'), ('s_preceded_by', 's_overlapped_by'), ('s_preceded_by', 's_met_by'), ('s_preceded_by', 's_preceded_by')],
    
    "left": [('s_precedes', 's_precedes'), ('s_precedes', 's_meets'), ('s_precedes', 's_overlaps'), ('s_precedes', 's_starts'), ('s_precedes', 's_during'), ('s_precedes', 's_finished_by'), ('s_precedes', 's_equals'), ('s_precedes', 's_finishes'), ('s_precedes', 's_contains'), ('s_precedes', 's_started_by'), ('s_precedes', 's_overlapped_by'), ('s_precedes', 's_met_by'), ('s_precedes', 's_preceded_by'), ('s_meets', 's_precedes'), ('s_meets', 's_meets'), ('s_meets', 's_overlaps'), ('s_meets', 's_starts'), ('s_meets', 's_during'), ('s_meets', 's_finished_by'), ('s_meets', 's_equals'), ('s_meets', 's_finishes'), ('s_meets', 's_contains'), ('s_meets', 's_started_by'), ('s_meets', 's_overlapped_by'), ('s_meets', 's_met_by'), ('s_meets', 's_preceded_by'), ('s_overlaps', 's_precedes'), ('s_overlaps', 's_meets'), ('s_overlaps', 's_overlaps'), ('s_overlaps', 's_starts'), ('s_overlaps', 's_during'), ('s_overlaps', 's_finished_by'), ('s_overlaps', 's_equals'), ('s_overlaps', 's_finishes'), ('s_overlaps', 's_contains'), ('s_overlaps', 's_started_by'), ('s_overlaps', 's_overlapped_by'), ('s_overlaps', 's_met_by'), ('s_overlaps', 's_preceded_by'), ('s_finished_by', 's_precedes'), ('s_finished_by', 's_meets'), ('s_finished_by', 's_overlaps'), ('s_finished_by', 's_starts'), ('s_finished_by', 's_during'), ('s_finished_by', 's_finished_by'), ('s_finished_by', 's_equals'), ('s_finished_by', 's_finishes'), ('s_finished_by', 's_contains'), ('s_finished_by', 's_started_by'), ('s_finished_by', 's_overlapped_by'), ('s_finished_by', 's_met_by'), ('s_finished_by', 's_preceded_by')],
    
    "bottom": [('s_precedes', 's_precedes'), ('s_precedes', 's_meets'), ('s_precedes', 's_overlaps'), ('s_precedes', 's_finished_by'), ('s_meets', 's_precedes'), ('s_meets', 's_meets'), ('s_meets', 's_overlaps'), ('s_meets', 's_finished_by'), ('s_overlaps', 's_precedes'), ('s_overlaps', 's_meets'), ('s_overlaps', 's_overlaps'), ('s_overlaps', 's_finished_by'), ('s_finished_by', 's_precedes'), ('s_finished_by', 's_meets'), ('s_finished_by', 's_overlaps'), ('s_finished_by', 's_finished_by'), ('s_contains', 's_precedes'), ('s_contains', 's_meets'), ('s_contains', 's_overlaps'), ('s_contains', 's_finished_by'), ('s_starts', 's_precedes'), ('s_starts', 's_meets'), ('s_starts', 's_overlaps'), ('s_starts', 's_finished_by'), ('s_equals', 's_precedes'), ('s_equals', 's_meets'), ('s_equals', 's_overlaps'), ('s_equals', 's_finished_by'), ('s_started_by', 's_precedes'), ('s_started_by', 's_meets'), ('s_started_by', 's_overlaps'), ('s_started_by', 's_finished_by'), ('s_during', 's_precedes'), ('s_during', 's_meets'), ('s_during', 's_overlaps'), ('s_during', 's_finished_by'), ('s_finishes', 's_precedes'), ('s_finishes', 's_meets'), ('s_finishes', 's_overlaps'), ('s_finishes', 's_finished_by'), ('s_overlapped_by', 's_precedes'), ('s_overlapped_by', 's_meets'), ('s_overlapped_by', 's_overlaps'), ('s_overlapped_by', 's_finished_by'), ('s_met_by', 's_precedes'), ('s_met_by', 's_meets'), ('s_met_by', 's_overlaps'), ('s_met_by', 's_finished_by'), ('s_preceded_by', 's_precedes'), ('s_preceded_by', 's_meets'), ('s_preceded_by', 's_overlaps'), ('s_preceded_by', 's_finished_by')],
    
    "bordering": [('s_meets', 's_meets'), ('s_meets', 's_starts'), ('s_meets', 's_finished_by'), ('s_meets', 's_equals'), ('s_meets', 's_finishes'), ('s_meets', 's_started_by'), ('s_meets', 's_met_by'), ('s_overlaps', 's_meets'), ('s_overlaps', 's_starts'), ('s_overlaps', 's_finished_by'), ('s_overlaps', 's_equals'), ('s_overlaps', 's_finishes'), ('s_overlaps', 's_started_by'), ('s_overlaps', 's_met_by'), ('s_finished_by', 's_meets'), ('s_finished_by', 's_starts'), ('s_finished_by', 's_finished_by'), ('s_finished_by', 's_equals'), ('s_finished_by', 's_finishes'), ('s_finished_by', 's_started_by'), ('s_finished_by', 's_met_by'), ('s_contains', 's_meets'), ('s_contains', 's_starts'), ('s_contains', 's_finished_by'), ('s_contains', 's_equals'), ('s_contains', 's_finishes'), ('s_contains', 's_started_by'), ('s_contains', 's_met_by'), ('s_starts', 's_meets'), ('s_starts', 's_starts'), ('s_starts', 's_finished_by'), ('s_starts', 's_equals'), ('s_starts', 's_finishes'), ('s_starts', 's_started_by'), ('s_starts', 's_met_by'), ('s_equals', 's_meets'), ('s_equals', 's_starts'), ('s_equals', 's_finished_by'), ('s_equals', 's_equals'), ('s_equals', 's_finishes'), ('s_equals', 's_started_by'), ('s_equals', 's_met_by'), ('s_started_by', 's_meets'), ('s_started_by', 's_starts'), ('s_started_by', 's_finished_by'), ('s_started_by', 's_equals'), ('s_started_by', 's_finishes'), ('s_started_by', 's_started_by'), ('s_started_by', 's_met_by'), ('s_during', 's_meets'), ('s_during', 's_starts'), ('s_during', 's_finished_by'), ('s_during', 's_equals'), ('s_during', 's_finishes'), ('s_during', 's_started_by'), ('s_during', 's_met_by'), ('s_finishes', 's_meets'), ('s_finishes', 's_starts'), ('s_finishes', 's_finished_by'), ('s_finishes', 's_equals'), ('s_finishes', 's_finishes'), ('s_finishes', 's_started_by'), ('s_finishes', 's_met_by'), ('s_overlapped_by', 's_meets'), ('s_overlapped_by', 's_starts'), ('s_overlapped_by', 's_finished_by'), ('s_overlapped_by', 's_equals'), ('s_overlapped_by', 's_finishes'), ('s_overlapped_by', 's_started_by'), ('s_overlapped_by', 's_met_by'), ('s_met_by', 's_meets'), ('s_met_by', 's_starts'), ('s_met_by', 's_finished_by'), ('s_met_by', 's_equals'), ('s_met_by', 's_finishes'), ('s_met_by', 's_started_by'), ('s_met_by', 's_met_by'), ('s_meets', 's_meets'), ('s_meets', 's_overlaps'), ('s_meets', 's_starts'), ('s_meets', 's_during'), ('s_meets', 's_finished_by'), ('s_meets', 's_equals'), ('s_meets', 's_finishes'), ('s_meets', 's_contains'), ('s_meets', 's_started_by'), ('s_meets', 's_overlapped_by'), ('s_meets', 's_met_by'), ('s_finished_by', 's_meets'), ('s_finished_by', 's_overlaps'), ('s_finished_by', 's_starts'), ('s_finished_by', 's_during'), ('s_finished_by', 's_finished_by'), ('s_finished_by', 's_equals'), ('s_finished_by', 's_finishes'), ('s_finished_by', 's_contains'), ('s_finished_by', 's_started_by'), ('s_finished_by', 's_overlapped_by'), ('s_finished_by', 's_met_by'), ('s_starts', 's_meets'), ('s_starts', 's_overlaps'), ('s_starts', 's_starts'), ('s_starts', 's_during'), ('s_starts', 's_finished_by'), ('s_starts', 's_equals'), ('s_starts', 's_finishes'), ('s_starts', 's_contains'), ('s_starts', 's_started_by'), ('s_starts', 's_overlapped_by'), ('s_starts', 's_met_by'), ('s_equals', 's_meets'), ('s_equals', 's_overlaps'), ('s_equals', 's_starts'), ('s_equals', 's_during'), ('s_equals', 's_finished_by'), ('s_equals', 's_equals'), ('s_equals', 's_finishes'), ('s_equals', 's_contains'), ('s_equals', 's_started_by'), ('s_equals', 's_overlapped_by'), ('s_equals', 's_met_by'), ('s_started_by', 's_meets'), ('s_started_by', 's_overlaps'), ('s_started_by', 's_starts'), ('s_started_by', 's_during'), ('s_started_by', 's_finished_by'), ('s_started_by', 's_equals'), ('s_started_by', 's_finishes'), ('s_started_by', 's_contains'), ('s_started_by', 's_started_by'), ('s_started_by', 's_overlapped_by'), ('s_started_by', 's_met_by'), ('s_finishes', 's_meets'), ('s_finishes', 's_overlaps'), ('s_finishes', 's_starts'), ('s_finishes', 's_during'), ('s_finishes', 's_finished_by'), ('s_finishes', 's_equals'), ('s_finishes', 's_finishes'), ('s_finishes', 's_contains'), ('s_finishes', 's_started_by'), ('s_finishes', 's_overlapped_by'), ('s_finishes', 's_met_by'), ('s_met_by', 's_meets'), ('s_met_by', 's_overlaps'), ('s_met_by', 's_starts'), ('s_met_by', 's_during'), ('s_met_by', 's_finished_by'), ('s_met_by', 's_equals'), ('s_met_by', 's_finishes'), ('s_met_by', 's_contains'), ('s_met_by', 's_started_by'), ('s_met_by', 's_overlapped_by'), ('s_met_by', 's_met_by')],
    
    "intersecting": [('s_overlaps', 's_overlaps'), ('s_overlaps', 's_starts'), ('s_overlaps', 's_during'), ('s_overlaps', 's_finished_by'), ('s_overlaps', 's_equals'), ('s_overlaps', 's_finishes'), ('s_overlaps', 's_contains'), ('s_overlaps', 's_started_by'), ('s_overlaps', 's_overlapped_by'), ('s_finished_by', 's_overlaps'), ('s_finished_by', 's_starts'), ('s_finished_by', 's_during'), ('s_finished_by', 's_finished_by'), ('s_finished_by', 's_equals'), ('s_finished_by', 's_finishes'), ('s_finished_by', 's_contains'), ('s_finished_by', 's_started_by'), ('s_finished_by', 's_overlapped_by'), ('s_contains', 's_overlaps'), ('s_contains', 's_starts'), ('s_contains', 's_during'), ('s_contains', 's_finished_by'), ('s_contains', 's_equals'), ('s_contains', 's_finishes'), ('s_contains', 's_contains'), ('s_contains', 's_started_by'), ('s_contains', 's_overlapped_by'), ('s_starts', 's_overlaps'), ('s_starts', 's_starts'), ('s_starts', 's_during'), ('s_starts', 's_finished_by'), ('s_starts', 's_equals'), ('s_starts', 's_finishes'), ('s_starts', 's_contains'), ('s_starts', 's_started_by'), ('s_starts', 's_overlapped_by'), ('s_equals', 's_overlaps'), ('s_equals', 's_starts'), ('s_equals', 's_during'), ('s_equals', 's_finished_by'), ('s_equals', 's_equals'), ('s_equals', 's_finishes'), ('s_equals', 's_contains'), ('s_equals', 's_started_by'), ('s_equals', 's_overlapped_by'), ('s_started_by', 's_overlaps'), ('s_started_by', 's_starts'), ('s_started_by', 's_during'), ('s_started_by', 's_finished_by'), ('s_started_by', 's_equals'), ('s_started_by', 's_finishes'), ('s_started_by', 's_contains'), ('s_started_by', 's_started_by'), ('s_started_by', 's_overlapped_by'), ('s_during', 's_overlaps'), ('s_during', 's_starts'), ('s_during', 's_during'), ('s_during', 's_finished_by'), ('s_during', 's_equals'), ('s_during', 's_finishes'), ('s_during', 's_contains'), ('s_during', 's_started_by'), ('s_during', 's_overlapped_by'), ('s_finishes', 's_overlaps'), ('s_finishes', 's_starts'), ('s_finishes', 's_during'), ('s_finishes', 's_finished_by'), ('s_finishes', 's_equals'), ('s_finishes', 's_finishes'), ('s_finishes', 's_contains'), ('s_finishes', 's_started_by'), ('s_finishes', 's_overlapped_by'), ('s_overlapped_by', 's_overlaps'), ('s_overlapped_by', 's_starts'), ('s_overlapped_by', 's_during'), ('s_overlapped_by', 's_finished_by'), ('s_overlapped_by', 's_equals'), ('s_overlapped_by', 's_finishes'), ('s_overlapped_by', 's_contains'), ('s_overlapped_by', 's_started_by'), ('s_overlapped_by', 's_overlapped_by')],
    
    "top_left": [('s_precedes', 's_contains'), ('s_precedes', 's_started_by'), ('s_precedes', 's_overlapped_by'), ('s_precedes', 's_met_by'), ('s_precedes', 's_preceded_by'), ('s_meets', 's_contains'), ('s_meets', 's_started_by'), ('s_meets', 's_overlapped_by'), ('s_meets', 's_met_by'), ('s_meets', 's_preceded_by'), ('s_overlaps', 's_contains'), ('s_overlaps', 's_started_by'), ('s_overlaps', 's_overlapped_by'), ('s_overlaps', 's_met_by'), ('s_overlaps', 's_preceded_by'), ('s_finished_by', 's_contains'), ('s_finished_by', 's_started_by'), ('s_finished_by', 's_overlapped_by'), ('s_finished_by', 's_met_by'), ('s_finished_by', 's_preceded_by'), ('s_contains', 's_contains'), ('s_contains', 's_started_by'), ('s_contains', 's_overlapped_by'), ('s_contains', 's_met_by'), ('s_contains', 's_preceded_by')],
    
    "top_right": [('s_started_by', 's_contains'), ('s_started_by', 's_started_by'), ('s_started_by', 's_overlapped_by'), ('s_started_by', 's_met_by'), ('s_started_by', 's_preceded_by'), ('s_overlapped_by', 's_contains'), ('s_overlapped_by', 's_started_by'), ('s_overlapped_by', 's_overlapped_by'), ('s_overlapped_by', 's_met_by'), ('s_overlapped_by', 's_preceded_by'), ('s_met_by', 's_contains'), ('s_met_by', 's_started_by'), ('s_met_by', 's_overlapped_by'), ('s_met_by', 's_met_by'), ('s_met_by', 's_preceded_by'), ('s_preceded_by', 's_contains'), ('s_preceded_by', 's_started_by'), ('s_preceded_by', 's_overlapped_by'), ('s_preceded_by', 's_met_by'), ('s_preceded_by', 's_preceded_by')],
    
    "bottom_left": [('s_precedes', 's_precedes'), ('s_precedes', 's_meets'), ('s_precedes', 's_overlaps'), ('s_precedes', 's_finished_by'), ('s_meets', 's_precedes'), ('s_meets', 's_meets'), ('s_meets', 's_overlaps'), ('s_meets', 's_finished_by'), ('s_overlaps', 's_precedes'), ('s_overlaps', 's_meets'), ('s_overlaps', 's_overlaps'), ('s_overlaps', 's_finished_by'), ('s_finished_by', 's_precedes'), ('s_finished_by', 's_meets'), ('s_finished_by', 's_overlaps'), ('s_finished_by', 's_finished_by'), ('s_contains', 's_precedes'), ('s_contains', 's_meets'), ('s_contains', 's_overlaps'), ('s_contains', 's_finished_by')],
    
    "bottom_right": [('s_started_by', 's_precedes'), ('s_started_by', 's_meets'), ('s_started_by', 's_overlaps'), ('s_started_by', 's_finished_by'), ('s_overlapped_by', 's_precedes'), ('s_overlapped_by', 's_meets'), ('s_overlapped_by', 's_overlaps'), ('s_overlapped_by', 's_finished_by'), ('s_met_by', 's_precedes'), ('s_met_by', 's_meets'), ('s_met_by', 's_overlaps'), ('s_met_by', 's_finished_by'), ('s_preceded_by', 's_precedes'), ('s_preceded_by', 's_meets'), ('s_preceded_by', 's_overlaps'), ('s_preceded_by', 's_finished_by')],
    
    "top_bordering": [('s_precedes', 's_finished_by'), ('s_precedes', 's_equals'), ('s_precedes', 's_finishes'), ('s_precedes', 's_met_by'), ('s_meets', 's_finished_by'), ('s_meets', 's_equals'), ('s_meets', 's_finishes'), ('s_meets', 's_met_by'), ('s_overlaps', 's_finished_by'), ('s_overlaps', 's_equals'), ('s_overlaps', 's_finishes'), ('s_overlaps', 's_met_by'), ('s_finished_by', 's_finished_by'), ('s_finished_by', 's_equals'), ('s_finished_by', 's_finishes'), ('s_finished_by', 's_met_by'), ('s_contains', 's_finished_by'), ('s_contains', 's_equals'), ('s_contains', 's_finishes'), ('s_contains', 's_met_by'), ('s_starts', 's_finished_by'), ('s_starts', 's_equals'), ('s_starts', 's_finishes'), ('s_starts', 's_met_by'), ('s_equals', 's_finished_by'), ('s_equals', 's_equals'), ('s_equals', 's_finishes'), ('s_equals', 's_met_by'), ('s_started_by', 's_finished_by'), ('s_started_by', 's_equals'), ('s_started_by', 's_finishes'), ('s_started_by', 's_met_by'), ('s_during', 's_finished_by'), ('s_during', 's_equals'), ('s_during', 's_finishes'), ('s_during', 's_met_by'), ('s_finishes', 's_finished_by'), ('s_finishes', 's_equals'), ('s_finishes', 's_finishes'), ('s_finishes', 's_met_by'), ('s_overlapped_by', 's_finished_by'), ('s_overlapped_by', 's_equals'), ('s_overlapped_by', 's_finishes'), ('s_overlapped_by', 's_met_by'), ('s_met_by', 's_finished_by'), ('s_met_by', 's_equals'), ('s_met_by', 's_finishes'), ('s_met_by', 's_met_by'), ('s_preceded_by', 's_finished_by'), ('s_preceded_by', 's_equals'), ('s_preceded_by', 's_finishes'), ('s_preceded_by', 's_met_by')],

    "bottom_bordering": [('s_precedes', 's_meets'), ('s_precedes', 's_starts'), ('s_precedes', 's_equals'), ('s_precedes', 's_started_by'), ('s_meets', 's_meets'), ('s_meets', 's_starts'), ('s_meets', 's_equals'), ('s_meets', 's_started_by'), ('s_overlaps', 's_meets'), ('s_overlaps', 's_starts'), ('s_overlaps', 's_equals'), ('s_overlaps', 's_started_by'), ('s_finished_by', 's_meets'), ('s_finished_by', 's_starts'), ('s_finished_by', 's_equals'), ('s_finished_by', 's_started_by'), ('s_contains', 's_meets'), ('s_contains', 's_starts'), ('s_contains', 's_equals'), ('s_contains', 's_started_by'), ('s_starts', 's_meets'), ('s_starts', 's_starts'), ('s_starts', 's_equals'), ('s_starts', 's_started_by'), ('s_equals', 's_meets'), ('s_equals', 's_starts'), ('s_equals', 's_equals'), ('s_equals', 's_started_by'), ('s_started_by', 's_meets'), ('s_started_by', 's_starts'), ('s_started_by', 's_equals'), ('s_started_by', 's_started_by'), ('s_during', 's_meets'), ('s_during', 's_starts'), ('s_during', 's_equals'), ('s_during', 's_started_by'), ('s_finishes', 's_meets'), ('s_finishes', 's_starts'), ('s_finishes', 's_equals'), ('s_finishes', 's_started_by'), ('s_overlapped_by', 's_meets'), ('s_overlapped_by', 's_starts'), ('s_overlapped_by', 's_equals'), ('s_overlapped_by', 's_started_by'), ('s_met_by', 's_meets'), ('s_met_by', 's_starts'), ('s_met_by', 's_equals'), ('s_met_by', 's_started_by'), ('s_preceded_by', 's_meets'), ('s_preceded_by', 's_starts'), ('s_preceded_by', 's_equals'), ('s_preceded_by', 's_started_by')],

    "left_bordering": [('s_meets', 's_precedes'), ('s_meets', 's_meets'), ('s_meets', 's_overlaps'), ('s_meets', 's_starts'), ('s_meets', 's_during'), ('s_meets', 's_finished_by'), ('s_meets', 's_equals'), ('s_meets', 's_finishes'), ('s_meets', 's_contains'), ('s_meets', 's_started_by'), ('s_meets', 's_overlapped_by'), ('s_meets', 's_met_by'), ('s_meets', 's_preceded_by'), ('s_starts', 's_precedes'), ('s_starts', 's_meets'), ('s_starts', 's_overlaps'), ('s_starts', 's_starts'), ('s_starts', 's_during'), ('s_starts', 's_finished_by'), ('s_starts', 's_equals'), ('s_starts', 's_finishes'), ('s_starts', 's_contains'), ('s_starts', 's_started_by'), ('s_starts', 's_overlapped_by'), ('s_starts', 's_met_by'), ('s_starts', 's_preceded_by'), ('s_equals', 's_precedes'), ('s_equals', 's_meets'), ('s_equals', 's_overlaps'), ('s_equals', 's_starts'), ('s_equals', 's_during'), ('s_equals', 's_finished_by'), ('s_equals', 's_equals'), ('s_equals', 's_finishes'), ('s_equals', 's_contains'), ('s_equals', 's_started_by'), ('s_equals', 's_overlapped_by'), ('s_equals', 's_met_by'), ('s_equals', 's_preceded_by'), ('s_started_by', 's_precedes'), ('s_started_by', 's_meets'), ('s_started_by', 's_overlaps'), ('s_started_by', 's_starts'), ('s_started_by', 's_during'), ('s_started_by', 's_finished_by'), ('s_started_by', 's_equals'), ('s_started_by', 's_finishes'), ('s_started_by', 's_contains'), ('s_started_by', 's_started_by'), ('s_started_by', 's_overlapped_by'), ('s_started_by', 's_met_by'), ('s_started_by', 's_preceded_by')],

    "right_bordering": [('s_finished_by', 's_precedes'), ('s_finished_by', 's_meets'), ('s_finished_by', 's_overlaps'), ('s_finished_by', 's_starts'), ('s_finished_by', 's_during'), ('s_finished_by', 's_finished_by'), ('s_finished_by', 's_equals'), ('s_finished_by', 's_finishes'), ('s_finished_by', 's_contains'), ('s_finished_by', 's_started_by'), ('s_finished_by', 's_overlapped_by'), ('s_finished_by', 's_met_by'), ('s_finished_by', 's_preceded_by'), ('s_equals', 's_precedes'), ('s_equals', 's_meets'), ('s_equals', 's_overlaps'), ('s_equals', 's_starts'), ('s_equals', 's_during'), ('s_equals', 's_finished_by'), ('s_equals', 's_equals'), ('s_equals', 's_finishes'), ('s_equals', 's_contains'), ('s_equals', 's_started_by'), ('s_equals', 's_overlapped_by'), ('s_equals', 's_met_by'), ('s_equals', 's_preceded_by'), ('s_finishes', 's_precedes'), ('s_finishes', 's_meets'), ('s_finishes', 's_overlaps'), ('s_finishes', 's_starts'), ('s_finishes', 's_during'), ('s_finishes', 's_finished_by'), ('s_finishes', 's_equals'), ('s_finishes', 's_finishes'), ('s_finishes', 's_contains'), ('s_finishes', 's_started_by'), ('s_finishes', 's_overlapped_by'), ('s_finishes', 's_met_by'), ('s_finishes', 's_preceded_by'), ('s_met_by', 's_precedes'), ('s_met_by', 's_meets'), ('s_met_by', 's_overlaps'), ('s_met_by', 's_starts'), ('s_met_by', 's_during'), ('s_met_by', 's_finished_by'), ('s_met_by', 's_equals'), ('s_met_by', 's_finishes'), ('s_met_by', 's_contains'), ('s_met_by', 's_started_by'), ('s_met_by', 's_overlapped_by'), ('s_met_by', 's_met_by'), ('s_met_by', 's_preceded_by')],
}

def clean_up_program_string(program_str):
    program_str = ast.unparse(ast.parse(program_str))
    program_str_list = program_str.split("\n")
    program_str_list = [line.replace("'", '"') for line in program_str_list]
    return program_str_list