def detect_clause(parser, clause_name, tokens):
if clause_name in tokens:<EOL><INDENT>t_index = tokens.index(clause_name)<EOL>clause_value = parser.compile_filter(tokens[t_index + <NUM_LIT:1>])<EOL>del tokens[t_index:t_index + <NUM_LIT:2>]<EOL><DEDENT>else:<EOL><INDENT>clause_value = None<EOL><DEDENT>return clause_value<EOL>
Helper function detects a certain clause in tag tokens list.
    Returns its value.