Load a suite with lines produced by the line generator.
189423
def _load_lines(self, filename, line_generator, suite, rules):
        """"""
        line_counter = 0
        for line in line_generator:
            line_counter += 1

            if line.category in self.ignored_lines:
                continue

            if line.category == "test":
                suite.addTest(Adapter(filename, line))
                rules.saw_test()
            elif line.category == "plan":
                if line.skip:
                    rules.handle_skipping_plan(line)
                    return suite
                rules.saw_plan(line, line_counter)
            elif line.category == "bail":
                rules.handle_bail(line)
                return suite
            elif line.category == "version":
                rules.saw_version_at(line_counter)

        rules.check(line_counter)
        return suite
681997
def load_stream(cls, st):
        """"""
        y = yaml.load(st)
        return [ Automaton(k, v) for k, v in y.iteritems() ]
1140801
def example_generator(all_files, urls_path, sum_token):
  """"""

  def fix_run_on_sents(line):
    if u"@highlight" in line:
      return line
    if not line:
      return line
    if line[-1] in END_TOKENS:
      return line
    return line + u"."

  filelist = example_splits(urls_path, all_files)
  story_summary_split_token = u" <summary> " if sum_token else " "

  for story_file in filelist:
    story = []
    summary = []
    reading_highlights = False
    for line in tf.gfile.Open(story_file, "rb"):
      line = text_encoder.to_unicode_utf8(line.strip())
      line = fix_run_on_sents(line)
      if not line:
        continue
      elif line.startswith(u"@highlight"):
        if not story:
          break  # No article text.
        reading_highlights = True
      elif reading_highlights:
        summary.append(line)
      else:
        story.append(line)

    if (not story) or not summary:
      continue

    yield " ".join(story) + story_summary_split_token + " ".join(summary)
607139
public function load($locator, $line = null)
    {
        foreach ($this->manager->locateResources($locator) as $resource) {
            if ($resource->getSpecFilename() == $locator){
                return parent::load($locator, $line);
            }
        }

        return new Suite;
    }
843697
def load_ext(self):
        """"""
        try:
            sequencemanager = hydpy.pub.sequencemanager
        except AttributeError:
            raise RuntimeError(
                'The time series of sequence %s cannot be loaded.  Firstly, '
                'you have to prepare `pub.sequencemanager` correctly.'
                % objecttools.devicephrase(self))
        sequencemanager.load_file(self)
661978
def run(self, lines):
        """"""
        ret = []

        for block in self.blocks(lines):
            ret.extend(self.convert_table(block))

        return ret
1264012
def load(self):
        """"""
        self._list = self._source.load()
        self._list_iter = itertools.cycle(self._list)
1025576
def iter_lines(self, section):
        
        try:
            section = self._get_section(section, create=False)
        except KeyError:
            return

        for block in section:
            for line in block:
                yield line
227597
def _run(self, line):
        ''' 

        '''
        line = self._setup('RUN', line)
        self.install += line
925341
def run(self):
        """"""
        self.console.load(self.lines, setup=self.setup, teardown=self.teardown)
        return self.console.interpret()
857755
def loads(content):
    """"""
    lines = _group_lines(line for line in content.split('\n'))
    lines = [
        (i, _parse_procfile_line(line))
        for i, line in lines if line.strip()
    ]
    errors = []
    # Reject files with duplicate process types (no sane default).
    duplicates = _find_duplicates(((i, line[0]) for i, line in lines))
    for i, process_type, j in duplicates:
        errors.append(''.join([
                'Line %d: duplicate process type "%s": ',
                'already appears on line %d.',
            ]) % (i + 1, process_type, j + 1)
        )
    # Reject commands with duplicate variables (no sane default).
    for i, line in lines:
        process_type, env = line[0], line[2]
        duplicates = _find_duplicates(((0, var[0]) for var in env))
        for _, variable, _ in duplicates:
            errors.append(''.join([
                    'Line %d: duplicate variable "%s" ',
                    'for process type "%s".',
                ]) % (i + 1, variable, process_type)
            )
    # Done!
    if errors:
        raise ValueError(errors)
    return {k: {'cmd': cmd, 'env': dict(env)} for _, (k, cmd, env) in lines}
482791
def lines(self, lines):
        
        if self.cache_content:
            self.cached_content = ''.join([b2u(l) for l in lines])

        try:
            with self._open_dockerfile('wb') as dockerfile:
                dockerfile.writelines([u2b(l) for l in lines])
        except (IOError, OSError) as ex:
            logger.error("Couldn't write lines to dockerfile: %r", ex)
            raise
896940
def load_visible_suites(cls, paths=None):
        
        suite_paths = cls.visible_suite_paths(paths)
        suites = [cls.load(x) for x in suite_paths]
        return suites
244770
def build_file_lines(self):
    """"""
    build_file_lines = self._build_file_source_lines[:]
    target_begin, target_end = self._target_interval
    build_file_lines[target_begin:target_end] = self.target_lines()
    return build_file_lines
770293
def load_outputs(self):
        """"""
        for output in sorted(logdissect.output.__formats__):
            self.output_modules[output] = \
                __import__('logdissect.output.' + output, globals(), \
                locals(), [logdissect]).OutputModule(args=self.output_args)
1298035
def iter_lines(file_like: Iterable[str]) -> Generator[str, None, None]:
    
    for line in file_like:
        line = line.rstrip('\r\n')
        if line:
            yield line
505582
def logical_lines(lines):
    """"""
    if isinstance(lines, string_types):
        lines = StringIO(lines)
    buf = []
    for line in lines:
        if buf and not line.startswith(' '):
            chunk = ''.join(buf).strip()
            if chunk:
                yield chunk
            buf[:] = []

        buf.append(line)
    chunk = ''.join(buf).strip()
    if chunk:
        yield chunk