def validate_arg_values(ast, bo):
if not bo.api_url:<EOL><INDENT>log.info("<STR_LIT>")<EOL>return bo<EOL><DEDENT>log.debug(f"<STR_LIT>")<EOL>if isinstance(ast, NSArg):<EOL><INDENT>term_id = "<STR_LIT>".format(ast.namespace, ast.value)<EOL>value_types = ast.value_types<EOL>log.debug(f"<STR_LIT>")<EOL>if ast.namespace == "<STR_LIT>":  <EOL><INDENT>for value_type in value_types:<EOL><INDENT>default_namespace = [<EOL>ns["<STR_LIT:name>"] for ns in bo.spec["<STR_LIT>"][value_type]["<STR_LIT:info>"]<EOL>] + [<EOL>ns["<STR_LIT>"]<EOL>for ns in bo.spec["<STR_LIT>"][value_type]["<STR_LIT:info>"]<EOL>]<EOL>if ast.value in default_namespace:<EOL><INDENT>log.debug("<STR_LIT>".format(term_id))<EOL>break<EOL><DEDENT><DEDENT>else:  <EOL><INDENT>log.debug("<STR_LIT>".format(term_id))<EOL>bo.validation_messages.append(<EOL>("<STR_LIT>", f"<STR_LIT>")<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>request_url = bo.api_url + "<STR_LIT>".format(<EOL>url_path_param_quoting(term_id)<EOL>)<EOL>log.info(f"<STR_LIT>")<EOL>r = get_url(request_url)<EOL>if r and r.status_code == <NUM_LIT:200>:<EOL><INDENT>result = r.json()<EOL>log.debug(<EOL>f'<STR_LIT>'<EOL>)<EOL>if (<EOL>len(<EOL>set(ast.value_types).intersection(<EOL>result.get("<STR_LIT>", [])<EOL>)<EOL>)<EOL>== <NUM_LIT:0><EOL>):<EOL><INDENT>log.debug(<EOL>"<STR_LIT>".format(<EOL>term_id, ast.value_types, result.get("<STR_LIT>", [])<EOL>)<EOL>)<EOL>bo.validation_messages.append(<EOL>(<EOL>"<STR_LIT>",<EOL>"<STR_LIT>".format(<EOL>term_id, ast.value_types, result.get("<STR_LIT>", [])<EOL>),<EOL>)<EOL>)<EOL><DEDENT>if term_id in result.get("<STR_LIT>", []):<EOL><INDENT>bo.validation_messages.append(<EOL>(<EOL>"<STR_LIT>",<EOL>f'<STR_LIT>',<EOL>)<EOL>)<EOL><DEDENT><DEDENT>elif r.status_code == <NUM_LIT>:<EOL><INDENT>bo.validation_messages.append(<EOL>("<STR_LIT>", f"<STR_LIT>")<EOL>)<EOL><DEDENT>else:<EOL><INDENT>log.error(f"<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>if isinstance(ast, StrArg):<EOL><INDENT>log.debug(f"<STR_LIT>")<EOL>for value_type in ast.value_types:<EOL><INDENT>if re.match("<STR_LIT:/>", value_type):<EOL><INDENT>value_type = re.sub("<STR_LIT>", "<STR_LIT>", value_type)<EOL>value_type = re.sub("<STR_LIT>", "<STR_LIT>", value_type)<EOL>match = re.match(value_type, ast.value)<EOL>if match:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if value_type in bo.spec["<STR_LIT>"]:<EOL><INDENT>default_namespace = [<EOL>ns["<STR_LIT:name>"] for ns in bo.spec["<STR_LIT>"][value_type]["<STR_LIT:info>"]<EOL>] + [<EOL>ns["<STR_LIT>"]<EOL>for ns in bo.spec["<STR_LIT>"][value_type]["<STR_LIT:info>"]<EOL>]<EOL>if ast.value in default_namespace:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>else:  <EOL><INDENT>bo.validation_messages.append(<EOL>(<EOL>"<STR_LIT>",<EOL>f"<STR_LIT>",<EOL>)<EOL>)<EOL><DEDENT><DEDENT>if hasattr(ast, "<STR_LIT:args>"):<EOL><INDENT>for arg in ast.args:<EOL><INDENT>validate_arg_values(arg, bo)<EOL><DEDENT><DEDENT>return bo<EOL>
Recursively validate arg (NSArg and StrArg) values

    Check that NSArgs are found in BELbio API and match appropriate entity_type.
    Check that StrArgs match their value - either default namespace or regex string

    Generate a WARNING if not.

    Args:
        bo: bel object

    Returns:
        bel object