def get_signature(token, contextable=False, comparison=False):
bits = split(token.contents)<EOL>args, kwargs = (), {}<EOL>if comparison and bits[-<NUM_LIT:1>] == '<STR_LIT>':<EOL><INDENT>kwargs['<STR_LIT>'] = True<EOL>bits = bits[:-<NUM_LIT:1>]<EOL><DEDENT>if contextable and len(bits) > <NUM_LIT:2> and bits[-<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>kwargs['<STR_LIT>'] = bits[-<NUM_LIT:1>]<EOL>bits = bits[:-<NUM_LIT:2>]<EOL><DEDENT>kwarg_re = re.compile(r'<STR_LIT>')<EOL>for bit in bits[<NUM_LIT:1>:]:<EOL><INDENT>match = kwarg_re.match(bit)<EOL>if match:<EOL><INDENT>kwargs[str(match.group(<NUM_LIT:1>))] = force_unicode(match.group(<NUM_LIT:2>))<EOL><DEDENT>else:<EOL><INDENT>args += (bit,)<EOL><DEDENT><DEDENT>return bits[<NUM_LIT:0>], args, kwargs<EOL>
Gets the signature tuple for any native tag
contextable searchs for ``as`` variable to update context
comparison if true uses ``negate`` (p) to ``not`` the result (~p)
returns (``tag_name``, ``args``, ``kwargs``)