Loop over value arrays and write index by index, to correspond to the rows of a txt file
        :param list ll: List of lists, column data
        :return:
502418
def __write_data_col_vals(self, ll, pc):
        

        # all columns should have the same amount of values. grab that number
        try:
            _items_in_cols = len(ll[0]["values"])
            for idx in range(0, _items_in_cols):
                # amount of columns
                _count = len(ll)
                self.noaa_txt += "# "
                for col in ll:
                    self.noaa_txt += "{}\t".format(str(col["values"][idx]))
                    _count -= 1
                if (idx < _items_in_cols):
                    self.noaa_txt += '\n'

        except IndexError:
            logger_lpd_noaa("_write_data_col_vals: IndexError: couldn't get length of columns")

        return
1220693
void createRowElementLinkedLists( int leftmost[] , int w[]) {
        for (int k = 0; k < n; k++) {
            w[head+k] = -1; w[tail+k] = -1;  w[nque+k] = 0;
        }

        // scan rows in reverse order creating a linked list of nz element indexes in each row
        for (int i = m-1; i >= 0; i--) {
            int k = leftmost[i];      // 'k' = left most column in row 'i'
            if( k == -1 )             // row 'i' is empty
                continue;
            if( w[nque+k]++ == 0 )
                w[tail+k] = i;
            w[next+i] = w[head+k];
            w[head+k] = i;
        }
    }
743597
def create_index(modules):
    ''''''
    for key in modules.keys():
        file_path = join(HERE, '%s_modules/_list_of_modules.rst' % key)
        list_file = open(file_path, 'w')

        # Write the generic header
        list_file.write('%s\n' % AUTOGEN)
        list_file.write('%s\n' % key.title())
        list_file.write('=' * len(key))
        list_file.write('\n\n')
        list_file.write('.. toctree::\n')
        list_file.write('   :maxdepth: 2\n\n')

        for module in modules[key]:
            list_file.write('   %s\n' % module)
1086758
def _writeMzmlIndexList(xmlWriter, spectrumIndexList, chromatogramIndexList):
    
    counts = 0
    if spectrumIndexList:
        counts += 1
    if chromatogramIndexList:
        counts += 1
    if counts == 0:
        return None
    #Create indexList node
    xmlIndexList = xmlWriter.element('indexList', {'count': str(counts)})
    xmlIndexList.__enter__()
    xmlWriter.write('\n')

    _writeIndexListElement(xmlWriter, 'spectrum', spectrumIndexList)
    _writeIndexListElement(xmlWriter, 'chromatogram', chromatogramIndexList)

    #Close indexList node
    xmlIndexList.__exit__(None, None, None)
    xmlWriter.write('\n')
13066
def split_list_by(lst, key):
  

  first, second = [], []
  for item in lst:
    if key(item):
      second.append(item)
    else:
      first.append(item)
  return (first, second)
949757
public static <T> void fill(final List<? super T> list, final int fromIndex, final int toIndex, final T val) {
        checkFromToIndex(fromIndex, toIndex, Integer.MAX_VALUE);

        int size = list.size();

        if (size < toIndex) {
            if (fromIndex < size) {
                for (int i = fromIndex; i < size; i++) {
                    list.set(i, val);
                }
            } else {
                for (int i = size; i < fromIndex; i++) {
                    list.add(null);
                }
            }

            for (int i = 0, len = toIndex - list.size(); i < len; i++) {
                list.add(val);
            }
        } else {
            if (toIndex - fromIndex < FILL_THRESHOLD || list instanceof RandomAccess) {
                for (int i = fromIndex; i < toIndex; i++) {
                    list.set(i, val);
                }
            } else {
                final ListIterator<? super T> itr = list.listIterator(fromIndex);

                for (int i = fromIndex; i < toIndex; i++) {
                    itr.next();

                    itr.set(val);
                }
            }
        }
    }
1356233
def extendlist(lst, i, value=''):
    """"""
    if i < len(lst):
        pass
    else:
        lst.extend([value, ] * (i - len(lst) + 1))
898239
public static Array listToArrayTrim(String list, String delimiter, int[] info) {
	if (delimiter.length() == 1) return listToArrayTrim(list, delimiter.charAt(0), info);
	if (list.length() == 0) return new ArrayImpl();
	char[] del = delimiter.toCharArray();
	char c;

	// remove at start
	outer: while (list.length() > 0) {
	    c = list.charAt(0);
	    for (int i = 0; i < del.length; i++) {
		if (c == del[i]) {
		    info[0]++;
		    list = list.substring(1);
		    continue outer;
		}
	    }
	    break;
	}

	int len;
	outer: while (list.length() > 0) {
	    c = list.charAt(list.length() - 1);
	    for (int i = 0; i < del.length; i++) {
		if (c == del[i]) {
		    info[1]++;
		    len = list.length();
		    list = list.substring(0, len - 1 < 0 ? 0 : len - 1);
		    continue outer;
		}
	    }
	    break;
	}
	return listToArray(list, delimiter);
    }
275856
def _append_array(self, value, _file):
        
        if not value:
            self._append_none(None, _file)
            return

        _bptr = ''
        _tabs = ''
        _tlen = len(value) - 1
        if _tlen:
            _bptr = '  |-->'
            for _ in range(self._tctr + 1):
                _tabs += _TEMP_SPACES if self._bctr[_] else _TEMP_BRANCH
        else:
            _tabs = ''

        for (_nctr, _item) in enumerate(value):
            _text = '{tabs}{bptr}'.format(tabs=_tabs, bptr=_bptr)
            _file.write(_text)

            _item = self.object_hook(_item)
            _type = type(_item).__name__
            _MAGIC_TYPES[_type](self, _item, _file)

            _suff = '\n' if _nctr < _tlen else ''
            _file.write(_suff)
461547
def _make_index(self, fasta, index):
        
        out = open(index, "wb")
        f = open(fasta)
        # Skip first line of fasta-file
        line = f.readline()
        offset = f.tell()
        line = f.readline()
        while line:
            out.write(pack(self.pack_char, offset))
            offset = f.tell()
            line = f.readline()
        f.close()
        out.close()
177424
def file_rows(self, fo):
        """"""

        rows = []
        for i in range(NUMROWS):
            line = fo.readline()
            if not line:
                break
            rows += [line]

        return rows
834690
def write_matrix(outputfile, matrix):
    

    try:
        stream = open(outputfile, 'w')
        for row in matrix:
            if isinstance(row, list) or isinstance(row, tuple):
                row = [str(el).strip() for el in row]
                stream.write(','.join(row) + '\n')
            else:
                stream.write(row + '\n')
    except IOError as err:  # pragma: no cover
        LOG.info('An error occured while writing the file %s'
                 % outputfile)
        LOG.debug("Error: %s" % err)
    finally:
        stream.close()
    LOG.info('Wrote QTLs in file %s' % outputfile)
1048279
def append(self, vals: list, index=None):
        
        try:
            self.df = self.df.loc[len(self.df.index)] = vals
        except Exception as e:
            self.err(e, self.append, "Can not append row")
            return
        self.ok("Row added to dataframe")
450536
def _fill_array_from_list(the_list, the_array):
        """"""
        for i, val in enumerate(the_list):
            the_array[i] = val
        return the_array
1206971
def _list_lstrip(self, L, val=0):
        ''''''
        for i in _range(len(L)):
            if L[i] != val:
                return L[i:]
782171
def write(self, data, method='w'):
        
        # Create list of lists from flat list
        data = data if isinstance(data[0], (list, set, tuple)) else [[d] for d in data]

        # Open file and write rows
        with open(self.file_path, method) as write:
            wr = csv_builtin.writer(write)
            wr.writerows(data)
        return self.file_path
449060
def datagetter(cls):
        
        with open('myfile', 'rt') as f:
            rows = [r for r in csv.reader(f)]
        dothing = lambda _: [i for i, v in enumerate(_)]
        rows = [dothing(_) for _ in rows]
        raise NotImplementedError('You need to implement this yourlself!')
        return rows