This function is similar to read_csv, but it reads data from the
    list of <lines>.

fd = open("foo", "r")
data = chart_data.read_str(",", fd.readlines())
1109
def read_str(delim=',', *lines):
    """"""

    data = []
    for line in lines:
        com = parse_line(line, delim)
        data.append(com)
    return data
904331
def read_csv(filename, delimiter=CSV_DELIMITER):
    
    with open(filename, 'r') as file:
        return list(csv.reader(file, delimiter=delimiter))
1026836
def read_function(data, window, ij, g_args):
    """"""
    output = (data[0] > numpy.mean(data[0])).astype(data[0].dtype) * data[0].max()
    return output
713029
def read(self, frame, data):
        ""
        seq = []
        while data:
            elem, data = self.spec.read(frame, data)
            seq.append(elem)
        return seq, data
83693
def read_csv(text, sep="\t"):
    """"""
    import pandas as pd    # no top level load to make a faster import of db
    return pd.read_csv(StringIO(text), sep="\t")
885302
def readlines(self):
        """"""

        t = self.resolved_url.get_resource().get_target()
        with open(t.fspath) as f:
            return f.readlines()
26367
def _get_chart_info(df, vtype, cat, prep, callers):
    
    maxval_raw = max(list(df["value.floor"]))
    curdf = df[(df["variant.type"] == vtype) & (df["category"] == cat)
               & (df["bamprep"] == prep)]
    vals = []
    labels = []
    for c in callers:
        row = curdf[df["caller"] == c]
        if len(row) > 0:
            vals.append(list(row["value.floor"])[0])
            labels.append(list(row["value"])[0])
        else:
            vals.append(1)
            labels.append("")
    return vals, labels, maxval_raw
365283
def read_csv_from_file(filename):
    
    logger_csvs.info("enter read_csv_from_file")
    d = {}
    l = []
    try:
        logger_csvs.info("open file: {}".format(filename))
        with open(filename, 'r') as f:
            r = csv.reader(f, delimiter=',')

            # Create a dict with X lists corresponding to X columns
            for idx, col in enumerate(next(r)):
                d[idx] = []
                d = cast_values_csvs(d, idx, col)

            # Start iter through CSV data
            for row in r:
                for idx, col in enumerate(row):
                    # Append the cell to the correct column list
                    d = cast_values_csvs(d, idx, col)

        # Make a list of lists out of the dictionary instead
        for idx, col in d.items():
            l.append(col)
    except FileNotFoundError as e:
        print('CSV FileNotFound: ' + filename)
        logger_csvs.warn("read_csv_to_columns: FileNotFound: {}, {}".format(filename, e))
    logger_csvs.info("exit read_csv_from_file")
    return l
51562
def read_c_string( self ):
        
        rval = []
        while 1:
            ch = self.file.read(1)
            assert len( ch ) == 1, "Unexpected end of file"
            if ch == b'\0':
                break
            rval.append( ch )
        return b''.join( rval )
722288
def load_tbl_from_csv(fname):
	
	import csv

	rows_to_load = []

	with open(fname, 'r', encoding='cp1252', errors='ignore') as csvfile:
		csvreader = csv.reader(csvfile, delimiter = ',' )

		reader = csv.reader(csvfile)

		rows_to_load = list(reader)

	return rows_to_load
890300
def skip_read_line(fd, no_eof=False):
    
    ls = ''
    while 1:
        try:
            line = fd.readline()

        except EOFError:
            break

        if not line:
            if no_eof:
                raise EOFError

            else:
                break

        ls = line.strip()
        if ls and (ls[0] != '#'):
            break

    return ls
661934
def read_csv(csvfile, options):
    

    # open file or exit
    name, ext = os.path.splitext(csvfile)
    try:
        if ext == '.gz':
            f = gzip.open(csvfile, 'rb')
        else:
            f = open(csvfile, 'rU')
    except IOError:
        print(" \n '{f}' could not be opened\n".format(f=os.path.basename(csvfile)))
        sys.exit(1)

    # read file
    csv_reader = csv.reader(f)
    molList = []
    linenumber = 1

    for line in csv_reader:
        # get column labels from the first line
        if linenumber == 1:
            prop_indices = read_header(line, options)

        # otherwise read line & append to MolList
        else:
            mol = Molecule()
            mol = read_line(line, options, prop_indices, mol)
            # if the line's junk, skip it
            if mol == 1:
                print(" skipping molecule 'm'\n".format(m=(linenumber - 1)))
            else:
                molList.append(mol)

        linenumber += 1

    # return molList

    return molList
806407
def _readedf_extractline(left, right):
    
    functions = [int, float, lambda l:float(l.split(None, 1)[0]),
                 lambda l:int(l.split(None, 1)[0]),
                 dateutil.parser.parse, lambda x:str(x)]
    for f in functions:
        try:
            right = f(right)
            break
        except ValueError:
            continue
    return right
144866
def read_tsv(cls, file_or_buffer: str):
        """"""
        df = pd.read_csv(file_or_buffer, sep='\t', index_col=0)
        df = df.where(pd.notnull(df), None)
        # Note: df.where(..., None) changes all column types to `object`.
        return cls(df)
1090159
def _init_data_line(self, fnc, lnum, line):
        """"""
        fld = re.split(self.sep, line)
        # Lines may contain different numbers of items.
        # The line should have all columns requested by the user.
        if self.usr_max_idx < len(fld):
            self.convert_ints_floats(fld)
            fnc(fld)
        else:
            for fld in enumerate(zip(self.hdr2idx.keys(), fld)):
                print(fld)
            for hdr in self.hdrs_usr:
                print(hdr)
            print('# ITEMS ON A LINE:', len(fld))
            print('MAX USR IDX:', self.usr_max_idx)
            raise Exception("ERROR ON LINE {} IN {}".format(lnum+1, self.fin))
1005774
private static String[] getSeriesDataFromCSVRows(File csvFile) {

    String[] xAndYData = new String[3];

    BufferedReader bufferedReader = null;
    try {
      int counter = 0;
      String line;
      bufferedReader = new BufferedReader(new FileReader(csvFile));
      while ((line = bufferedReader.readLine()) != null) {
        xAndYData[counter++] = line;
      }
    } catch (Exception e) {
      System.out.println("Exception while reading csv file: " + e);
    } finally {
      if (bufferedReader != null) {
        try {
          bufferedReader.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
    return xAndYData;
  }
1358565
def read_parfile(parfile):
    
    assert os.path.exists(parfile), "Pst.parrep(): parfile not found: " +\
                                    str(parfile)
    f = open(parfile, 'r')
    header = f.readline()
    par_df = pd.read_csv(f, header=None,
                             names=["parnme", "parval1", "scale", "offset"],
                             sep="\s+")
    par_df.index = par_df.parnme
    return par_df