def generate_lines(text, ext=['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']):
if isinstance(text, basestring):<EOL><INDENT>if len(text) <= <NUM_LIT>:<EOL><INDENT>if os.path.isfile(text) and os.path.splitext(text)[-<NUM_LIT:1>].lower() in ext:<EOL><INDENT>return open(text)<EOL><DEDENT>elif os.path.isdir(text):<EOL><INDENT>return chain.from_iterable(generate_lines(stat['<STR_LIT:path>']) for stat in find_files(text, ext=ext))<EOL><DEDENT>else:<EOL><INDENT>return (line for line in Split(text=text))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return Split(text=text)<EOL><DEDENT><DEDENT>return chain.from_iterable(generate_lines(obj) for obj in text)<EOL>
r""" Yield text one line at a time from from a single file path, files in a directory, or a text string

    >>> list(generate_lines('Hello crazy\r\nMS/Apple world\rof EOLS.\n'))
    ['Hello crazy\r\n', 'MS/Apple world\r', 'of EOLS.\n']