import csv


def read_csvfile(cache_file, return_dicts):
    """
        Args:
        cache_file - name of a csv file.
        return_dicts - if True, return a csv.DictReader(), 
                       else plain csv.reader()
                         if csv.DictReader() then each row will be a dict,
                            with column names for keys and values,
                         if csv.reader() every row is a list of values.  This
                            includes the row for column names.
        Returns:
            A csv_reader object, the type determined by return_dicts.
            NOTE: All values are STRINGS. 
    """
    input_fd = open(cache_file,'r')
    if return_dicts:
        reader = csv.DictReader(input_fd)
    else:
        # NOTE: also returns headers as a row.
        reader = csv.reader(input_fd)
    return reader