def pi_version():
<EOL>with open('<STR_LIT>', '<STR_LIT:r>') as infile:<EOL><INDENT>cpuinfo = infile.read()<EOL><DEDENT>match = re.search('<STR_LIT>', cpuinfo,<EOL>flags=re.MULTILINE | re.IGNORECASE)<EOL>if not match:<EOL><INDENT>return None<EOL><DEDENT>if match.group(<NUM_LIT:1>) == '<STR_LIT>':<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT>elif match.group(<NUM_LIT:1>) == '<STR_LIT>':<EOL><INDENT>return <NUM_LIT:2><EOL><DEDENT>elif match.group(<NUM_LIT:1>) == '<STR_LIT>':<EOL><INDENT>return <NUM_LIT:3><EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>
Detect the version of the Raspberry Pi.  Returns either 1, 2 or
    None depending on if it's a Raspberry Pi 1 (model A, B, A+, B+),
    Raspberry Pi 2 (model B+), or not a Raspberry Pi.