Find all lines matching a given line.
549016
def find_lines(self, line):
        """"""
        for other_line in self.lines:
            if other_line.match(line):
                yield other_line
549835
def group_lines(lines):
    """"""
    groups = []
    group = []

    for line in lines:
        if line.strip() == "":
            groups.append(group[:])
            group = []
            continue
        group.append(line)

    if group:
        groups.append(group[:])

    return groups
216546
def find(pattern, path='.', exclude=None, recursive=True):
    """"""
    import fnmatch
    import os

    if recursive:
        for root, dirnames, filenames in os.walk(path):
            for pat in _to_list(pattern):
                for filename in fnmatch.filter(filenames, pat):
                    filepath = join(abspath(root), filename)
                    for excl in _to_list(exclude):
                        if excl and fnmatch.fnmatch(filepath, excl):
                            break
                    else:
                        yield filepath
    else:
        for pat in _to_list(pattern):
            for filename in fnmatch.filter(list(path), pat):
                filepath = join(abspath(path), filename)
                for excl in _to_list(exclude):
                    if excl and fnmatch.fnmatch(filepath, excl):
                        break
                    else:
                        yield filepath
634601
def parse_line(self, text, fh=None):
        """"""
        match = self.ok.match(text)
        if match:
            return self._parse_result(True, match, fh)

        match = self.not_ok.match(text)
        if match:
            return self._parse_result(False, match, fh)

        if self.diagnostic.match(text):
            return Diagnostic(text)

        match = self.plan.match(text)
        if match:
            return self._parse_plan(match)

        match = self.bail.match(text)
        if match:
            return Bail(match.group("reason"))

        match = self.version.match(text)
        if match:
            return self._parse_version(match)

        return Unknown()
1241481
public Map<Path,List<LineMatches>> find(String search) throws IOException {
        count = 0;
        Pattern pattern = Pattern.compile(search);
        Map<Path,List<LineMatches>> fileMatches = new LinkedHashMap<>();
        Files.walkFileTree(root,
            EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
                public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException {
                    for (PathMatcher matcher : matchers) {
                        if (matcher.matches(path)) {
                            List<LineMatches> lineMatches = search(path, pattern);
                            if (lineMatches != null)
                                fileMatches.put(root.relativize(path), lineMatches);
                        }
                    }
                    return count == 0 || count < limit ? FileVisitResult.CONTINUE : FileVisitResult.TERMINATE;
                }
            }
        );

        return fileMatches;
    }
649643
def match(pattern, data, **parse_kwargs):
    """"""
    return [m.value for m in parse(pattern, **parse_kwargs).find(data)]
254524
def lines(input):
    """"""
    for raw_line in input:
        line = raw_line.strip()
        if line and not line.startswith('#'):
            yield strip_comments(line)
687631
def readlines(self, *args, **kwargs):
        """"""
        return list(iter(partial(self.readline, *args, **kwargs), u''))
480126
def match(self, context, line):
		""""""
		
		return line.kind == 'code' and line.partitioned[0] in self._both
653029
def get_all( line )
      retval = nil
      m = /^\s*;\s*all_parts\s*(.+)[^\s]*/.match( line )
      if m && m[1]
        retval = m[1]
      end
      return retval
    end
1123136
def all_matches(grammar, text):
    """"""
    for tokens, start, stop in grammar.parseWithTabs().scanString(text):
        yield unpack(tokens), start, stop
476354
def validlines(self):
		""""""

		return [ln for ln in self.lines() if (not ln.isBroken() and not ln.ignoreMe)]
637896
def re_filter(text, regexps):
    """"""
    if not regexps:
        return text

    matched_text = []
    compiled_regexps = [re.compile(x) for x in regexps]
    for line in text:
        if line in matched_text:
            continue

        for regexp in compiled_regexps:
            found = regexp.search(line)
            if found and found.group():
                matched_text.append(line)

    return matched_text or text
170898
async def _parse_lines(lines, regex):
    
    results = []
    if inspect.iscoroutinefunction(lines):
        lines = await lines
    for line in lines:
        if line:
            match = regex.search(line)
            if not match:
                _LOGGER.debug("Could not parse row: %s", line)
                continue
            results.append(match.groupdict())
    return results
192850
def matching_line(lines, keyword):
    
    for line in lines:
        matching = match(line,keyword)
        if matching != None:
            return matching
    return None
1281808
def find_matches(text):
    
    """
    path = os.path.expanduser(text)
    if os.path.isdir(path) and not path.endswith('/'):
        return [ text + '/' ]

    pattern = path + '*'
    is_implicit_cwd = not (path.startswith('/') or path.startswith('./'))
    if is_implicit_cwd:
        pattern = './' + pattern
    rawlist = glob.glob(pattern)
    ret = []
    for fname in rawlist:
        if is_implicit_cwd:
            fname = fname[2:]
        if os.path.isdir(fname):
            ret.append(fname + '/')
        else:
            ret.append(fname)
    return ret
209076
def match_regex_list(patterns, string):
    """"""

    for p in patterns:

        if re.findall(p, string):
            return True

    return False