def _split_python ( python ) : python = _preprocess ( python ) if not python : return [ ] lexer = PythonSplitLexer ( ) lexer . read ( python ) return lexer . chunks
split python only first
Split Python source into chunks .
def _split_python(python):
    """Split Python source into chunks.

    Chunks are separated by at least two return lines. The break must not
    be followed by a space. Also, long Python strings spanning several lines
    are not splitted.

    """
    python = _preprocess(python)
    if not python:
        return []
    lexer = PythonSplitLexer()
    lexer.read(python)
    return lexer.chunks