<s> import re <EOL> from collections import namedtuple <EOL> from robot . utils import ET <EOL> MATCHER = re . compile ( r'<STR_LIT>' ) <EOL> Interpreter = namedtuple ( '<STR_LIT>' , [ '<STR_LIT>' , '<STR_LIT:version>' , '<STR_LIT>' ] ) <EOL> def get_interpreter ( output ) : <EOL> tree = ET . parse ( output ) <EOL> root = tree . getroot ( ) <EOL> return Interpreter ( * MATCHER . match ( root . attrib [ '<STR_LIT>' ] ) . groups ( ) ) <EOL> def is_27 ( interpreter ) : <EOL> return interpreter . version . startswith ( '<STR_LIT>' ) <EOL> def is_25 ( interpreter ) : <EOL> return interpreter . version . startswith ( '<STR_LIT>' ) <EOL> def is_jython ( interpreter ) : <EOL> return interpreter . interpreter . lower ( ) == '<STR_LIT>' <EOL> def is_python ( interpreter ) : <EOL> return interpreter . interpreter . lower ( ) == '<STR_LIT>' </s>
