(lines)
return lines[:blockfinder.last]
Extract the block of code at the top of the given list of lines.
Extract the block of code at the top of the given list of lines.
Extract the block of code at the top of the given list of lines .
def getblock(lines):
    """Extract the block of code at the top of the given list of lines."""
    blockfinder = BlockFinder()
    try:
        tokens = tokenize.generate_tokens(iter(lines).__next__)
        for _token in tokens:
            blockfinder.tokeneater(*_token)
    except (EndOfBlock, IndentationError):
        pass
    return lines[:blockfinder.last]
def getblock ( lines ) : blockfinder = BlockFinder ( ) try : tokens = tokenize . generate_tokens ( iter ( lines ) . __next__ ) for _token in tokens : blockfinder . tokeneater ( * _token ) except ( EndOfBlock , IndentationError ) : pass return lines [ : blockfinder . last ]