def process_unset(line, annotations):
    """Process UNSET lines in BEL Script"""

    matches = re.match('UNSET\s+"?(.*?)"?\s*$', line)
    if matches:
        val = matches.group(1)
        if val == "ALL" or val == "STATEMENT_GROUP":
            annotations = {}
        elif re.match("{", val):
            vals = convert_csv_str_to_list(val)
            for val in vals:
                annotations.pop(val, None)
        else:
            annotations.pop(val, None)

    else:
        log.warn(f"Problem with UNSET line: {line}")

    return annotations
def process_unset ( line , annotations ) : matches = re . match ( 'UNSET\s+"?(.*?)"?\s*$' , line ) if matches : val = matches . group ( 1 ) if val == "ALL" or val == "STATEMENT_GROUP" : annotations = { } elif re . match ( "{" , val ) : vals = convert_csv_str_to_list ( val ) for val in vals : annotations . pop ( val , None ) else : annotations . pop ( val , None ) else : log . warn ( f"Problem with UNSET line: {line}" ) return annotations
Process UNSET lines in BEL Script