def read_csv(filename, delimiter="<STR_LIT:U+002C>", skip=<NUM_LIT:0>, guess_type=True, has_header=True, use_types={}):
with open(filename, '<STR_LIT:r>') as f:<EOL><INDENT>if has_header:<EOL><INDENT>header = f.readline().strip().split(delimiter)<EOL><DEDENT>else:<EOL><INDENT>header = None<EOL><DEDENT>for i in range(skip):<EOL><INDENT>f.readline()<EOL><DEDENT>for line in csv.DictReader(f, delimiter=delimiter, fieldnames=header):<EOL><INDENT>if use_types:<EOL><INDENT>yield apply_types(use_types, guess_type, line)<EOL><DEDENT>elif guess_type:<EOL><INDENT>yield dmap(determine_type, line)<EOL><DEDENT>else:<EOL><INDENT>yield line<EOL><DEDENT><DEDENT><DEDENT>
Read a CSV file

    Usage
    -----
    >>> data = read_csv(filename, delimiter=delimiter, skip=skip,
            guess_type=guess_type, has_header=True, use_types={}) 

    # Use specific types
    >>> types = {"sepal.length": int, "petal.width": float}
    >>> data = read_csv(filename, guess_type=guess_type, use_types=types) 

    keywords
    :has_header:
        Determine whether the file has a header or not