Parse the given seed file, returning an UnparsedNode and the agate
        table.
337358
def parse_seed_file(cls, file_match, root_dir, package_name, should_parse):
        
        abspath = file_match['absolute_path']
        logger.debug("Parsing {}".format(abspath))
        table_name = os.path.basename(abspath)[:-4]
        node = UnparsedNode(
            path=file_match['relative_path'],
            name=table_name,
            root_path=root_dir,
            resource_type=NodeType.Seed,
            # Give this raw_sql so it conforms to the node spec,
            # use dummy text so it doesn't look like an empty node
            raw_sql='-- csv --',
            package_name=package_name,
            original_file_path=os.path.join(file_match.get('searched_path'),
                                            file_match.get('relative_path')),
        )
        if should_parse:
            try:
                table = dbt.clients.agate_helper.from_csv(abspath)
            except ValueError as e:
                dbt.exceptions.raise_compiler_error(str(e), node)
        else:
            table = dbt.clients.agate_helper.empty_table()
        table.original_abspath = abspath
        return node, table
1075776
def Parse(self, stat, file_object, knowledge_base):
    """"""
    _, _ = stat, knowledge_base

    # TODO(hanuszczak): This parser only allows single use because it messes
    # with its state. This should be fixed.
    field_parser = NtpdFieldParser()
    for line in field_parser.ParseEntries(
        utils.ReadFileBytesAsUnicode(file_object)):
      field_parser.ParseLine(line)

    yield rdf_config_file.NtpConfig(
        config=field_parser.config,
        server=field_parser.keyed.get("server"),
        restrict=field_parser.keyed.get("restrict"),
        fudge=field_parser.keyed.get("fudge"),
        trap=field_parser.keyed.get("trap"),
        peer=field_parser.keyed.get("peer"),
        broadcast=field_parser.keyed.get("broadcast"),
        manycastclient=field_parser.keyed.get("manycastclient"))
937825
protected void parseColumns( DdlTokenStream tokens,
                                 AstNode tableNode,
                                 boolean isAlterTable ) throws ParsingException {
        String tableElementString = getTableElementsString(tokens, false);

        DdlTokenStream localTokens = new DdlTokenStream(tableElementString, DdlTokenStream.ddlTokenizer(false), false);

        localTokens.start();

        StringBuilder unusedTokensSB = new StringBuilder();

        do {
            if (isColumnDefinitionStart(localTokens)) {
                parseColumnDefinition(localTokens, tableNode, isAlterTable);
            } else {
                // THIS IS AN ERROR. NOTHING FOUND.
                // NEED TO absorb tokens
                unusedTokensSB.append(SPACE).append(localTokens.consume());
            }
        } while (localTokens.canConsume(COMMA));

        if (unusedTokensSB.length() > 0) {
            String msg = DdlSequencerI18n.unusedTokensParsingColumnDefinition.text(tableNode.getName());
            DdlParserProblem problem = new DdlParserProblem(Problems.WARNING, getCurrentMarkedPosition(), msg);
            problem.setUnusedSource(unusedTokensSB.toString());
            addProblem(problem, tableNode);
        }
    }
703458
private Object parseFile(File file, String scharset) {
        Charset charset = scharset==null || scharset.length ()==0 ? StandardCharsets.UTF_8 : Charset.forName ( scharset );

        if (file.length() > 2_000_000) {
            try (Reader reader = Files.newBufferedReader( Classpaths.path(file.toString()), charset )) {
                return parse(reader);
            } catch(IOException ioe) {
                throw new JsonException("Unable to process file: " + file.getPath(), ioe);
            }
        } else {
            try {
                return JsonFactory.create().fromJson ( Files.newBufferedReader( Classpaths.path(file.toString()), charset ) );
            } catch ( IOException e ) {
                throw new JsonException("Unable to process file: " + file.getPath(), e);
            }
        }
    }
812530
def load_seed
      seed_file = paths["db/seeds.rb"].existent.first
      return unless seed_file

      if config.try(:active_job)&.queue_adapter == :async
        with_inline_jobs { load(seed_file) }
      else
        load(seed_file)
      end
    end
1198767
def _read_table(self, filename):
        
        filename = pkg_resources.resource_filename(
            __name__, filename)
        segments = []
        with open(filename, 'rb') as f:
            reader = csv.reader(f, encoding='utf-8')
            header = next(reader)
            names = header[1:]
            for row in reader:
                seg = row[0]
                vals = row[1:]
                specs = set(zip(vals, names))
                segments.append((seg, specs))
        seg_dict = dict(segments)
        return segments, seg_dict, names
404237
def Parse(factory, file):
    

    entities = []

    while 1:
        # Just gets the whole struct nicely formatted
        data = GetNextStruct(file)

        if not data:
            break

        entities.extend(ProcessStruct(factory, data))

    return entities
693819
def parse(self, limit=None):
        '''
            
        '''

        if limit is not None:
            LOG.info("Only parsing first %s rows of each file", limit)

        if self.test_only:
            self.test_mode = True

        LOG.info("Parsing files...")

        self._process_nlx_157874_1_view(
            '/'.join((self.rawdir, 'dvp.pr_nlx_157874_1')), limit)
        self._map_eom_terms(
            '/'.join((self.rawdir, self.files['map']['file'])), limit)

        LOG.info("Finished parsing.")

        # since it's so small,
        # we default to copying the entire graph to the test set
        self.testgraph = self.graph

        return
1220216
def parse(parent_node)
    #return parse_nongreedy_optional(src,offset,parent_node) # nongreedy optionals break standard PEG
    node = variant_node_class.new(parent_node, delimiter_pattern)

    node.match parser.delimiter_pattern if root_rule?

    pattern_elements.each do |pe|
      return unless node.match(pe)
    end
    node.pop_match if node.last_match && node.last_match.delimiter

    node.match parser.delimiter_pattern if root_rule?

    node && node.post_match_processing
  end
65254
void parse(File file) throws ParseException {
        if (file == null) {
            Log.warn("parsing NULL file, so fallback on default configuration!");
            return;
        }
        if (!file.exists()) {
            Log.warn(String.format("parsing not existing file %s, so fallback on default configuration!", file.getAbsolutePath()));
            return;
        }
        try {
            FileReader reader = new FileReader(file);
            parse(reader);
        } catch (FileNotFoundException fex) {
            Log.warn(String.format("parsing not existing file %s, so fallback on default configuration!", file.getAbsolutePath()), fex);
            return;
        }
    }
502847
def parse(self, file=None, string=None):
        
        timer = metrics.Timer()
        timer.start()
        sax, handler = self.saxparser()
        if file is not None:
            sax.parse(file)
            timer.stop()
            metrics.log.debug('sax (%s) duration: %s', file, timer)
            return handler.nodes[0]
        if string is not None:
            source = InputSource(None)
            source.setByteStream(StringIO(string))
            sax.parse(source)
            timer.stop()
            metrics.log.debug('%s\nsax duration: %s', string, timer)
            return handler.nodes[0]
667576
def parse(file)
      return nil unless File.exist?(file)

      document = parse_xml(file)
      node = document.xpath('*').first

      node.attributes.each do |key, value|
        case key
        when 'count'
          @count = value.value.to_i
        when 'uniqueCount'
          @unique_count = value.value.to_i
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'si'
          @string_indexes << StringIndex.new(parent: self).parse(node_child)
        end
      end
      self
    end
275270
def parse(self, fo, width, seed=None):
        
        motifs = []

        lines = [fo.readline() for x in range(6)]
        while lines[0]:
            matrix = [[float(x) for x in line.strip().split("\t")] for line in lines[2:]]
            matrix = [[matrix[x][y] for x in range(4)] for y in range(len(matrix[0]))]
            m = Motif(matrix)
            m.trim(0.1)
            m.id = lines[0].strip().split(" ")[-1]
            motifs.append(m)
            lines = [fo.readline() for x in range(6)]
        
        for i,motif in enumerate(motifs):
            if seed:
                motif.id = "%s_w%s.%s_%s" % (self.name, width, seed, i + 1)
            else:
                motif.id = "%s_w%s_%s" % (self.name, width, i + 1)
            motif.trim(0.25)
        
        return motifs
851985
def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'lnL', 'left'
          @left = TableCellLine.new(parent: self).parse(node_child)
        when 'lnR', 'right'
          @right = TableCellLine.new(parent: self).parse(node_child)
        when 'lnT', 'top'
          @top = TableCellLine.new(parent: self).parse(node_child)
        when 'lnB', 'bottom'
          @bottom = TableCellLine.new(parent: self).parse(node_child)
        when 'lnTlToBr', 'tl2br'
          @top_left_to_bottom_right = TableCellLine.new(parent: self).parse(node_child)
        when 'lnBlToTr', 'tr2bl'
          @top_right_to_bottom_left = TableCellLine.new(parent: self).parse(node_child)
        when 'insideV'
          @inner_vertical = TableCellLine.new(parent: self).parse(node_child)
        when 'insideH'
          @inner_horizontal = TableCellLine.new(parent: self).parse(node_child)
        end
      end
      self
    end
1373290
def _convert_to_seeder_format(dataset):
    
    data = {}
    seed = {}

    _add_if_set(data, "name", dataset.get("title"))
    _add_if_set(data, "issn", dataset.get("issn"))
    _add_if_set(data, "annotation", dataset.get("annotation"))

    rules = dataset.get("rules", {})
    if rules:
        _add_if_set(data, "frequency", rules.get("frequency"))

        # set seed info
        _add_if_set(seed, "budget", rules.get("budget"))
        _add_if_set(seed, "calendars", rules.get("calendars"))
        _add_if_set(seed, "global_reject", rules.get("global_reject"))
        _add_if_set(seed, "gentle_fetch", rules.get("gentle_fetch"))
        _add_if_set(seed, "javascript", rules.get("javascript"))
        _add_if_set(seed, "local_traps", rules.get("local_traps"))
        _add_if_set(seed, "youtube", rules.get("youtube"))

        _add_if_set(seed, "url", dataset.get("url"))

    if seed:
        data["seed"] = seed

    return data
11785
public Table file(File file) throws IOException {
	String extension = Files.getFileExtension(file.getCanonicalPath());
	DataReader<?> reader = registry.getReaderForExtension(extension);
	return reader.read(new Source(file));
    }
797703
function parseStringSeedlist(seedlist) {
  return seedlist.split(',').map(seed => ({
    host: seed.split(':')[0],
    port: seed.split(':')[1] || 27017
  }));
}