def get_ast_dict(belstr, component_type: str = ""):
    """Convert BEL string to AST dictionary

    Args:
        belstr: BEL string
        component_type: Empty string or 'subject' or 'object' to indicate that we
            are parsing the subject or object field input
    """

    errors = []
    parsed = {}
    bels = list(belstr)
    char_locs, errors = parse_chars(bels, errors)
    parsed, errors = parse_functions(belstr, char_locs, parsed, errors)
    parsed, errors = parse_args(bels, char_locs, parsed, errors)
    parsed, errors = arg_types(parsed, errors)
    parsed, errors = parse_relations(belstr, char_locs, parsed, errors)
    parsed, errors = parse_nested(bels, char_locs, parsed, errors)
    errors = parsed_top_level_errors(parsed, errors)

    ast, errors = parsed_to_ast(parsed, errors, component_type=component_type)

    return ast, errors
def get_ast_dict ( belstr , component_type : str = "" ) : errors = [ ] parsed = { } bels = list ( belstr ) char_locs , errors = parse_chars ( bels , errors ) parsed , errors = parse_functions ( belstr , char_locs , parsed , errors ) parsed , errors = parse_args ( bels , char_locs , parsed , errors ) parsed , errors = arg_types ( parsed , errors ) parsed , errors = parse_relations ( belstr , char_locs , parsed , errors ) parsed , errors = parse_nested ( bels , char_locs , parsed , errors ) errors = parsed_top_level_errors ( parsed , errors ) ast , errors = parsed_to_ast ( parsed , errors , component_type = component_type ) return ast , errors
Convert BEL string to AST dictionary

    Args:
        belstr: BEL string
        component_type: Empty string or 'subject' or 'object' to indicate that we
            are parsing the subject or object field input