Returns list of digested values in line
518293
def digested_line(line, digest_types):
    """"""

    digested_line = []
    for i, ele in enumerate(line):
        try:
            digest_key = digest_types[i]

        except IndexError:
            digest_key = digest_types[0]

        digest = Digest(acceptable_types=[digest_key])

        try:
            digested_line.append(repr(digest(ele)))

        except Exception:
            digested_line.append("")

    return digested_line
476354
def validlines(self):
		""""""

		return [ln for ln in self.lines() if (not ln.isBroken() and not ln.ignoreMe)]
480120
private List<String> getCollection(String value) {
        String arrayString = value;

        if (arrayString.startsWith("[") && arrayString.endsWith("]")) {
            arrayString = arrayString.substring(1, arrayString.length()-1);
        }

        return Arrays.stream(StringUtils.commaDelimitedListToStringArray(arrayString))
                .map(String::trim)
                .map(VariableUtils::cutOffDoubleQuotes)
                .collect(Collectors.toList());
    }
331936
def prune_cached(values):
    """"""
    import os
    config_path = os.path.expanduser('~/.config/blockade')
    file_path = os.path.join(config_path, 'cache.txt')
    if not os.path.isfile(file_path):
        return values
    cached = [x.strip() for x in open(file_path, 'r').readlines()]
    output = list()
    for item in values:
        hashed = hash_values(item)
        if hashed in cached:
            continue
        output.append(item)
    return output
1154838
def list_(runas=None):
    '''
    
    '''
    rubies = []
    output = _rvm(['list'], runas=runas)
    if output:
        regex = re.compile(r'^[= ]([*> ]) ([^- ]+)-([^ ]+) \[ (.*) \]')
        for line in output.splitlines():
            match = regex.match(line)
            if match:
                rubies.append([
                    match.group(2), match.group(3), match.group(1) == '*'
                ])
    return rubies
999354
def parse(self, line):
        """"""
        csv_list = line.split(",")
        date_time_message = csv_list.pop(0).split(" ", 2)
        otherinfo = dict()

        for item in csv_list:
            key_value_pair = item.split(":", 1)
            key = key_value_pair[0].strip()

            if len(key_value_pair) > 1:
                value = key_value_pair[1].strip()
                if not value:
                    value = "-"
            else:
                value = "-"

            otherinfo[key] = value

        self.message = '%s\n' \
                       'Date: %s\n' \
                       'Time: %s\n' \
                       'Request: %s\n' \
                       'Referrer: %s\n' \
                       'Server: %s\n' \
                       'Client: %s\n' \
                       'Host: %s\n' \
                       'Upstream: %s\n'
        self.params = [
            date_time_message[2],
            date_time_message[0],
            date_time_message[1],
            otherinfo.get("request", "-"),
            otherinfo.get("referrer", "-"),
            otherinfo.get("server", "-"),
            otherinfo.get("client", "-"),
            otherinfo.get("host", "-"),
            otherinfo.get("upstream", "-"),
        ]
        self.site = otherinfo.get("referrer", "-")
1271985
def parse_seq(tokens, options):
    """"""
    result = []
    while tokens.current() not in [None, ']', ')', '|']:
        atom = parse_atom(tokens, options)
        if tokens.current() == '...':
            atom = [OneOrMore(*atom)]
            tokens.move()
        result += atom
    return result
1154230
def list_line(self, line):
        
        
        if len(line) == 0:
            return
        
        self.stream.write(str(line[0]))
        
        for item in line[1:]:
            self.stream.write("\t")
            self.stream.write(str(item))
        
        self.stream.write("\n")
38002
def extract_values(query):
    
    # pylint
    if isinstance(query, subqueries.UpdateQuery):
        row = query.values
        return extract_values_inner(row, query)
    if isinstance(query, subqueries.InsertQuery):
        ret = []
        for row in query.objs:
            ret.append(extract_values_inner(row, query))
        return ret
    raise NotSupportedError
1041134
def tail(self, lines=10):
        
        self.seek_end()
        end_pos = self.file.tell()

        for i in range(lines):
            if not self.seek_line():
                break

        data = self.file.read(end_pos - self.file.tell() - 1)
        if data:
            return self.splitlines(data)
        else:
            return []
971216
def digest_chunks(chunks, algorithms=(hashlib.md5, hashlib.sha1)):
    

    hashes = [algorithm() for algorithm in algorithms]

    for chunk in chunks:
        for h in hashes:
            h.update(chunk)

    return [_b64encode_to_str(h.digest()) for h in hashes]
401364
def parse(line):
    
    values = None
    matches = re.search(regex, line)
    if matches:

        # Standard values
        values = {
            'date_time': matches.group(DATE_TIME),
            'log_level': matches.group(LOG_LEVEL),
            'process_id': matches.group(PROCESS_ID),
            'thread_name': matches.group(THREAD_NAME),
            'logger_name': matches.group(LOGGER_NAME),
            'log_message': matches.group(LOG_MESSAGE)
        }

        # Optional transaction tracking information
        if matches.group(TRANSACTION):
            values["transaction"] = {
                "app": matches.group(TRANSACTION_APP),
                "id": matches.group(TRANSACTION_ID),
                "span": matches.group(TRANSACTION_SPAN),
                "exported": matches.group(TRANSACTION_EXPORTED)
            }

    return values
986021
def get_list_of_sql_string_literals_from_quoted_csv(x: str) -> List[str]:
    
    f = io.StringIO(x)
    reader = csv.reader(f, delimiter=',', quotechar="'", quoting=csv.QUOTE_ALL,
                        skipinitialspace=True)
    for line in reader:  # should only be one
        return [x for x in line]
966069
def get_lines(self, first, last):
        """"""
        line = 1
        linestring = []
        linestrings = []
        for char in self.string:
            if line >= first and line <= last:
                linestring.append(char)
                if char == '\n':
                    linestrings.append((''.join(linestring), line))
                    linestring = []
            elif line > last:
                break

            if char == '\n':
                line += 1
        if linestring:
            linestrings.append((''.join(linestring), line))
        elif not linestrings:
            return None

        return [SourceLine(string, lineno) for string, lineno in linestrings]
823966
def parse_line(line):
  
  columns = line.split()
  token = columns.pop(0)
  values = [float(column) for column in columns]
  return token, values
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
1374456
def parse_values_from_lines(self,lines):
        
        assert len(lines) == 3,"SvdData.parse_values_from_lines: expected " + \
                               "3 lines, not {0}".format(len(lines))
        try:
            self.svdmode = int(lines[0].strip().split()[0])
        except Exception as e:
            raise Exception("SvdData.parse_values_from_lines: error parsing" + \
                            " svdmode from line {0}: {1} \n".format(lines[0],str(e)))
        try:
            raw = lines[1].strip().split()
            self.maxsing = int(raw[0])
            self.eigthresh = float(raw[1])
        except Exception as e:
            raise Exception("SvdData.parse_values_from_lines: error parsing" + \
                            " maxsing and eigthresh from line {0}: {1} \n"\
                            .format(lines[1],str(e)))
        # try:
        #     self.eigwrite = int(lines[2].strip())
        # except Exception as e:
        #     raise Exception("SvdData.parse_values_from_lines: error parsing" + \
        #                     " eigwrite from line {0}: {1} \n".format(lines[2],str(e)))
        self.eigwrite = lines[2].strip()