def script_guard(line):
    """Detect the idiomatic trick C{if __name__ == "__main__":}"""
    return (len(line) == 5
        and line[1][1] == '__name__' # this is the most selective
        and line[0][1] == 'if'
        and line[2][1] == '=='
        and line[4][1] == ':'
        and line[3][1][1:-1] == '__main__')