cast the string lines for a pest control file into actual inputs

        Parameters
        ----------
        lines : list
            strings from pest control file
342977
def parse_values_from_lines(self,lines,iskeyword=False):
        

        if iskeyword:
            extra = {}
            for line in lines:
                raw = line.strip().split()
                if len(raw) == 0 or raw[0] == "#":
                    continue
                name = raw[0].strip().lower()

                value = raw[1].strip()
                v,t,f = self._parse_value(value)
                if name not in self._df.index:
                    extra[name] = v
                else:
                    # if the parsed values type isn't right
                    if t != self._df.loc[name, "type"]:

                        # if a float was expected and int return, not a problem
                        if t == np.int32 and self._df.loc[name, "type"] == np.float64:
                            self._df.loc[name, "value"] = np.float64(v)


                        # if this is a required input, throw
                        elif self._df.loc[name, "required"]:
                            raise Exception("wrong type found for variable " + name + ":" + str(t))
                        else:

                            # else, since this problem is usually a string, check for acceptable values
                            found = False
                            for nname, avalues in self.accept_values.items():
                                if v in avalues:
                                    if t == self._df.loc[nname, "type"]:
                                        self._df.loc[nname, "value"] = v
                                        found = True
                                        break
                            if not found:
                                warnings.warn("non-conforming value found for " + \
                                              name + ":" + str(v) + "...ignoring", PyemuWarning)


                    else:
                        self._df.loc[name, "value"] = v
            return extra




        assert len(lines) == len(CONTROL_VARIABLE_LINES),\
        "ControlData error: len of lines not equal to " +\
        str(len(CONTROL_VARIABLE_LINES))

        for iline,line in enumerate(lines):
            vals = line.strip().split()
            names = CONTROL_VARIABLE_LINES[iline].strip().split()
            for name,val in zip(names,vals):
                v,t,f = self._parse_value(val)
                name = name.replace('[','').replace(']','')
                
                #if the parsed values type isn't right
                if t != self._df.loc[name,"type"]:

                    # if a float was expected and int return, not a problem
                    if t == np.int32 and self._df.loc[name,"type"] == np.float64:
                        self._df.loc[name,"value"] = np.float64(v)


                    # if this is a required input, throw
                    elif self._df.loc[name,"required"]:
                        raise Exception("wrong type found for variable " + name + ":" + str(t))
                    else:
                        
                        #else, since this problem is usually a string, check for acceptable values
                        found = False
                        for nname,avalues in self.accept_values.items():
                            if v in avalues:
                                if t == self._df.loc[nname,"type"]:
                                    self._df.loc[nname,"value"] = v
                                    found = True
                                    break
                        if not found:
                            warnings.warn("non-conforming value found for " +\
                                  name + ":" + str(v) + "...ignoring",PyemuWarning)


                else:
                    self._df.loc[name,"value"] = v
314271
def filter_lines(input_file, output_file, translate=lambda line: line):
    
    filepath, lines = get_lines([input_file])[0]
    return filepath, [(tag, translate(line=line, tag=tag)) for (tag, line) in lines]
1081366
def source_lines(self, filename):
        
        with self.filesystem.open(filename) as f:
            return f.readlines()
1215421
def parse_line(self, line_str):
        
        line_str = line_str.rstrip()
        if not line_str:
            return None  # empty line, EOF
        arr = self._split_line(line_str)
        # CHROM
        chrom = arr[0]
        # POS
        pos = int(arr[1])
        # IDS
        if arr[2] == ".":
            ids = []
        else:
            ids = arr[2].split(";")
        # REF
        ref = arr[3]
        # ALT
        alts = []
        if arr[4] != ".":
            for alt in arr[4].split(","):
                alts.append(process_alt(self.header, ref, alt))
        # QUAL
        if arr[5] == ".":
            qual = None
        else:
            try:
                qual = int(arr[5])
            except ValueError:  # try as float
                qual = float(arr[5])
        # FILTER
        if arr[6] == ".":
            filt = []
        else:
            filt = arr[6].split(";")
        self._check_filters(filt, "FILTER")
        # INFO
        info = self._parse_info(arr[7], len(alts))
        if len(arr) == 9:
            raise exceptions.IncorrectVCFFormat("Expected 8 or 10+ columns, got 9!")
        elif len(arr) == 8:
            format_ = None
            calls = None
        else:
            # FORMAT
            format_ = arr[8].split(":")
            # sample/call columns
            calls = self._handle_calls(alts, format_, arr[8], arr)
        return record.Record(chrom, pos, ids, ref, alts, qual, filt, info, format_, calls)
891723
@Pure
	protected String lines(String prefix, String... lines) {
		final String delimiter = getCodeConfig().getLineDelimiter();
		final StringBuilder buffer = new StringBuilder();
		for (final String line : lines) {
			buffer.append(prefix);
			buffer.append(line);
			buffer.append(delimiter);
		}
		return buffer.toString();
	}
821702
def _line_parse(line):
    
    if line[-2:] in ['\r\n', b'\r\n']:
        return line[:-2], True
    elif line[-1:] in ['\r', '\n', b'\r', b'\n']:
        return line[:-1], True
    return line, False
1026276
def get_lines_from_file(filename, lineno, context_lines):
    

    def get_lines(start, end):
        return [linecache.getline(filename, l).rstrip() for l in range(start, end)]

    lower_bound = max(1, lineno - context_lines)
    upper_bound = lineno + context_lines
    linecache.checkcache(filename)
    pre_context = get_lines(lower_bound, lineno)
    context_line = linecache.getline(filename, lineno).rstrip()
    post_context = get_lines(lineno + 1, upper_bound)
    return lower_bound, pre_context, context_line, post_context
552942
def get_lines(data_nts, prtfmt=None, nt_fields=None, **kws):
    """"""
    lines = []
    # optional keyword args: prt_if sort_by
    if prtfmt is None:
        prtfmt = mk_fmtfld(data_nts[0], kws.get('joinchr', ' '), kws.get('eol', '\n'))
    # if nt_fields arg is None, use fields from prtfmt string.
    if nt_fields is not None:
        _chk_flds_fmt(nt_fields, prtfmt)
    if 'sort_by' in kws:
        data_nts = sorted(data_nts, key=kws['sort_by'])
    prt_if = kws.get('prt_if', None)
    for data_nt in data_nts:
        if prt_if is None or prt_if(data_nt):
            lines.append(prtfmt.format(**data_nt._asdict()))
    return lines
662812
def process_line(line, line_number, filename)
      warnings = all_warnings_for_line(line, line_number, filename)
      fix_input(warnings, line, line_number, filename) if @settings[:fix]
      warnings
    end
835478
def get_lines(handle, line):
    
    for i, l in enumerate(handle):
        if i == line:
            return l
74491
def append(self, lines):
        
        if isinstance(lines, list):
            self._lines = self._lines + lines
        elif isinstance(lines, str):
            lines = lines.split('\n')
            self._lines = self._lines + lines
        else:
            raise TypeError('Unsupported type {0} for lines.'.format(type(lines)))
167977
def split_lines(lines):
    
    container = []
    new_list = []
    for line in lines:
        if '>>>' in line:
            container.append(new_list)
            new_list = []
        else:
            new_list.append(line)
    container.append(new_list)
    return container
12634
def line_input(*args, **kwargs):
    '''
    
    '''
    line_input = wtforms.TextField(*args, **kwargs)
    line_input.input_type = 'line'
    return line_input
252701
private List<String> getCommandLines(File file) {
        List<String> lines = new ArrayList<>();
        try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
            String line = reader.readLine();
            while (line != null) {
                lines.add(line);
                line = reader.readLine();
            }
        } catch (Throwable e) {
            throw new IllegalStateException("Failed to process file " + file.getAbsolutePath(), e);
        }
        return lines;
    }
183676
def inspect(lines):
    
    labels = set()
    count = 0
    exp = re.compile(r">.*?<([\w ]+)>")  # Space should be accepted
    valid = False
    for line in lines:
        if line.startswith("M  END\n"):
            valid = True
        elif line.startswith("$$$$"):
            count += 1
            valid = False
        else:
            result = exp.match(line)
            if result:
                labels.add(result.group(1))
    if valid:
        count += 1
    return list(labels), count
1241776
def find_lines_with(cls, lines, what):
        
        result = []
        for line in lines:
            if what in line:
                result = result + [line]
        return result
962334
def filter_line(line: str, context: RunContext) -> typing.Optional[str]:
    
    if context.filters is not None:
        for filter_ in context.filters:
            if re.match(filter_, line):
                return None
    return line