ca10c185d94470054d693f19e7691523dbe3ec55,skll/data/readers.py,NDJReader,_sub_read,#NDJReader#Any#,434

Before Change


            line = line.strip()

            // If this is a comment line or a blank line, move on
            if line.startswith("//") or not line:
                continue

            // Process good lines
            example = json.loads(line)
            // Convert all IDs to strings initially,
            // for consistency with csv and megam formats.
            curr_id = str(example.get("id",
                                      "EXAMPLE_{}".format(example_num)))
            class_name = (safe_float(example["y"],
                                     replace_dict=self.class_map)
                          if "y" in example else None)
            example = example["x"]

After Change


        // create a data frame; if it"s empty,
        // then return `_parse_dataframe()`, which
        // will raise an error
        df = pd.DataFrame(lines)
        if df.empty:
            return self._parse_dataframe(df, None, None)

        // if it"s PY2 and `id` is in the
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: EducationalTestingService/skll
Commit Name: ca10c185d94470054d693f19e7691523dbe3ec55
Time: 2019-03-05
Author: jbiggs@ets.org
File Name: skll/data/readers.py
Class Name: NDJReader
Method Name: _sub_read


Project Name: bokeh/bokeh
Commit Name: 2f045e23607f4660d3920d6a91e322311516d6d6
Time: 2017-03-29
Author: jsignell@gmail.com
File Name: examples/plotting/file/unemployment.py
Class Name:
Method Name:


Project Name: bokeh/bokeh
Commit Name: baeb73146346b7caf27155dfef0914138b2e7201
Time: 2017-11-27
Author: pratapgr8@gmail.com
File Name: examples/plotting/file/brewer.py
Class Name:
Method Name: