Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update black #2265

Merged
merged 2 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion datasets/afrikaans_ner_corpus/afrikaans_ner_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, **kwargs):


class AfrikaansNerCorpus(datasets.GeneratorBasedBuilder):
""" Afrikaans Ner dataset"""
"""Afrikaans Ner dataset"""

BUILDER_CONFIGS = [
AfrikaansNerCorpusConfig(
Expand Down
2 changes: 1 addition & 1 deletion datasets/air_dialogue/air_dialogue.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""
# TODO: This method will receive as arguments the `gen_kwargs` defined in the previous `_split_generators` method.
# It is in charge of opening the given file and yielding (key, example) tuples from the dataset
# The key is not important, it's more here for legacy reason (legacy from tfds)
Expand Down
2 changes: 1 addition & 1 deletion datasets/allegro_reviews/allegro_reviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""
with open(filepath, encoding="utf-8") as f:
reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
for id_, row in enumerate(reader):
Expand Down
2 changes: 1 addition & 1 deletion datasets/amazon_polarity/amazon_polarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

with open(filepath, encoding="utf-8") as f:
data = csv.reader(f, delimiter=",", quoting=csv.QUOTE_ALL)
Expand Down
2 changes: 1 addition & 1 deletion datasets/aqua_rat/aqua_rat.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""
with open(filepath, encoding="utf-8") as f:
for id_, row in enumerate(f):
data = json.loads(row)
Expand Down
2 changes: 1 addition & 1 deletion datasets/aquamuse/aquamuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""
filepath = [join(filepath, f) for f in listdir(filepath) if isfile(join(filepath, f))]
filepath = sorted(filepath)
raw_dataset = tf.data.TFRecordDataset(filepath)
Expand Down
2 changes: 1 addition & 1 deletion datasets/ar_cov19/ar_cov19.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _split_generators(self, dl_manager):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"data_dir": data_dir})]

def _generate_examples(self, data_dir):
""" Yields examples. """
"""Yields examples."""
# TODO: This method will receive as arguments the `gen_kwargs` defined in the previous `_split_generators` method.
# It is in charge of opening the given file and yielding (key, example) tuples from the dataset
# The key is not important, it's more here for legacy reason (legacy from tfds)
Expand Down
2 changes: 1 addition & 1 deletion datasets/arabic_billion_words/arabic_billion_words.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _clean_text(self, text):
return text.replace("?", "")

def _generate_examples(self, filepath):
""" Yields examples. """
"""Yields examples."""
current_multi_line = ""
_idx = 0
data_tag = self.config.name
Expand Down
4 changes: 2 additions & 2 deletions datasets/arabic_pos_dialect/arabic_pos_dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@


class ArabicPosDialectConfig(datasets.BuilderConfig):
""" BuilderConfig for ArabicPosDialect"""
"""BuilderConfig for ArabicPosDialect"""

def __init__(self, dialect=None, **kwargs):
"""
Expand Down Expand Up @@ -112,7 +112,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath):
""" Yields examples in the raw (text) form. """
"""Yields examples in the raw (text) form."""
with open(filepath, encoding="utf-8") as csv_file:
reader = csv.DictReader(csv_file, delimiter="\t", quoting=csv.QUOTE_NONE)
fold = -1
Expand Down
2 changes: 1 addition & 1 deletion datasets/arsentd_lev/arsentd_lev.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


class ArsentdLev(datasets.GeneratorBasedBuilder):
""""ArSenTD-Lev Dataset"""
""" "ArSenTD-Lev Dataset"""

VERSION = datasets.Version("1.1.0")

Expand Down
2 changes: 1 addition & 1 deletion datasets/arxiv_dataset/arxiv_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _split_generators(self, dl_manager):
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"path": path_to_manual_file})]

def _generate_examples(self, path=None, title_set=None):
""" Yields examples. """
"""Yields examples."""
with open(path, encoding="utf8") as f:
for i, entry in enumerate(f):
data = dict(json.loads(entry))
Expand Down
2 changes: 1 addition & 1 deletion datasets/aslg_pc12/aslg_pc12.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, gloss_path, text_path):
""" Yields examples. """
"""Yields examples."""

gloss_f = open(gloss_path, "r", encoding="utf-8")
text_f = open(text_path, "r", encoding="utf-8")
Expand Down
2 changes: 1 addition & 1 deletion datasets/asset/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepaths, split):
""" Yields examples. """
"""Yields examples."""
if self.config.name == "simplification":
files = [open(filepaths[f"asset.{split}.orig"], encoding="utf-8")] + [
open(filepaths[f"asset.{split}.simp.{i}"], encoding="utf-8") for i in range(10)
Expand Down
2 changes: 1 addition & 1 deletion datasets/assin/assin.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepaths, split):
""" Yields examples. """
"""Yields examples."""

id_ = 0

Expand Down
2 changes: 1 addition & 1 deletion datasets/assin2/assin2.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

id_ = 0

Expand Down
2 changes: 1 addition & 1 deletion datasets/atomic/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples from the Atomic dataset. """
"""Yields examples from the Atomic dataset."""

with open(filepath, encoding="utf-8") as f:
for id_, row in enumerate(f):
Expand Down
4 changes: 2 additions & 2 deletions datasets/autshumato/autshumato.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


class AutshumatoConfig(datasets.BuilderConfig):
""" BuilderConfig for NewDataset"""
"""BuilderConfig for NewDataset"""

def __init__(self, langs, zip_file, **kwargs):
"""
Expand Down Expand Up @@ -206,7 +206,7 @@ def _split_generators_translation(self, dl_manager):
]

def _generate_examples(self, source_files, target_files, split):
""" Yields examples. """
"""Yields examples."""
if len(self.config.langs) == 2:
return self._generate_examples_translation(source_files, target_files, split)
elif len(self.config.langs) == 1:
Expand Down
2 changes: 1 addition & 1 deletion datasets/banking77/banking77.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath):
""" Yields examples as (key, example) tuples. """
"""Yields examples as (key, example) tuples."""
with open(filepath, encoding="utf-8") as f:
csv_reader = csv.reader(f, quotechar='"', delimiter=",", quoting=csv.QUOTE_ALL, skipinitialspace=True)
# call next to skip header
Expand Down
2 changes: 1 addition & 1 deletion datasets/bbc_hindi_nli/bbc_hindi_nli.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath):
""" Yields examples. """
"""Yields examples."""

with open(filepath, encoding="utf-8") as tsv_file:
tsv_reader = csv.reader(tsv_file, delimiter="\t")
Expand Down
2 changes: 1 addition & 1 deletion datasets/bprec/bprec.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filedirs, split="tele"):
""" Yields examples. """
"""Yields examples."""
# TODO: This method will receive as arguments the `gen_kwargs` defined in the previous `_split_generators` method.
# It is in charge of opening the given file and yielding (key, example) tuples from the dataset
# The key is not important, it's more here for legacy reason (legacy from tfds)
Expand Down
2 changes: 1 addition & 1 deletion datasets/brwac/brwac.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

with open(filepath, encoding="utf-8") as f:

Expand Down
4 changes: 2 additions & 2 deletions datasets/bsd_ja_en/bsd_ja_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@


class BsdJaEn(datasets.GeneratorBasedBuilder):
"""Japanese-English Business Scene Dialogue (BSD) dataset. """
"""Japanese-English Business Scene Dialogue (BSD) dataset."""

VERSION = datasets.Version("1.0.0")

Expand Down Expand Up @@ -131,7 +131,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

with open(filepath, encoding="utf-8") as f:
data = json.load(f)
Expand Down
4 changes: 2 additions & 2 deletions datasets/c3/c3.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


class C3Config(datasets.BuilderConfig):
""" BuilderConfig for NewDataset"""
"""BuilderConfig for NewDataset"""

def __init__(self, type_, **kwargs):
"""
Expand Down Expand Up @@ -138,7 +138,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filename, split):
""" Yields examples. """
"""Yields examples."""
with open(filename, "r", encoding="utf-8") as sf:
data = json.load(sf)
for id_, (documents, questions, document_id) in enumerate(data):
Expand Down
2 changes: 1 addition & 1 deletion datasets/caner/caner.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

with open(filepath, encoding="utf-8") as csv_file:
reader = csv.reader(csv_file, delimiter=",")
Expand Down
2 changes: 1 addition & 1 deletion datasets/cbt/cbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _split_generators(self, dl_manager):
def _generate_examples(
self, filepath # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
):
""" Yields examples as (key, example) tuples. """
"""Yields examples as (key, example) tuples."""
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
# The `key` is here for legacy reason (tfds) and is not important in itself.

Expand Down
2 changes: 1 addition & 1 deletion datasets/ccaligned_multilingual/ccaligned_multilingual.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, from_english=False):
""" Yields examples. """
"""Yields examples."""
lc = self.config.language_code
reverse = lc in reverse_mapped_sentences
with open(filepath, encoding="utf-8") as f:
Expand Down
2 changes: 1 addition & 1 deletion datasets/cdsc/cdsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""
with open(filepath, encoding="utf-8") as f:
reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
for id_, row in enumerate(reader):
Expand Down
2 changes: 1 addition & 1 deletion datasets/cdt/cdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""
with open(filepath, encoding="utf-8") as f:
reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
for id_, row in enumerate(reader):
Expand Down
2 changes: 1 addition & 1 deletion datasets/clickbait_news_bg/clickbait_news_bg.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""
keys = [
"fake_news_score",
"click_bait_score",
Expand Down
2 changes: 1 addition & 1 deletion datasets/climate_fever/climate_fever.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""
with open(filepath, encoding="utf-8") as f:
for id_, row in enumerate(f):
doc = json.loads(row)
Expand Down
2 changes: 1 addition & 1 deletion datasets/coached_conv_pref/coached_conv_pref.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

# Empty Segment list with annotations dictionary
# First prompt of a conversation does not contain the segment dictionary
Expand Down
2 changes: 1 addition & 1 deletion datasets/code_search_net/code_search_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


class CodeSearchNet(datasets.GeneratorBasedBuilder):
""""CodeSearchNet corpus: proxy dataset for semantic code search."""
""" "CodeSearchNet corpus: proxy dataset for semantic code search."""

VERSION = datasets.Version("1.0.0", "Add CodeSearchNet corpus dataset")
BUILDER_CONFIGS = [
Expand Down
2 changes: 1 addition & 1 deletion datasets/common_voice/common_voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, path_to_clips):
""" Yields examples. """
"""Yields examples."""
data_fields = list(self._info().features.keys())
path_idx = data_fields.index("path")

Expand Down
2 changes: 1 addition & 1 deletion datasets/compguesswhat/compguesswhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class CompguesswhatConfig(datasets.BuilderConfig):
""" BuilderConfig for CompGuessWhat?!"""
"""BuilderConfig for CompGuessWhat?!"""

def __init__(self, data_url, splits, gameplay_scenario, **kwargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion datasets/conceptnet5/conceptnet5.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples from the conceptnet5 graph if the config is 'conceptnet5', otherwise yields the sentences for omcs. """
"""Yields examples from the conceptnet5 graph if the config is 'conceptnet5', otherwise yields the sentences for omcs."""

with open(filepath, "rb") as f:
for id_, row in enumerate(f):
Expand Down
2 changes: 1 addition & 1 deletion datasets/cord19/cord19.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

metadata_filepath = filepath["metadata"]

Expand Down
2 changes: 1 addition & 1 deletion datasets/cos_e/cos_e.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _get_choices_and_answer(cqa):

class CosEConfig(datasets.BuilderConfig):

""" BuilderConfig for CosE"""
"""BuilderConfig for CosE"""

def __init__(self, **kwargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion datasets/counter/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, data_dir):
""" Yields examples. """
"""Yields examples."""

def parse_file(file):
tree = ET.parse(file)
Expand Down
2 changes: 1 addition & 1 deletion datasets/covid_tweets_japanese/covid_tweets_japanese.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

with bz2.open(filepath, "rt") as f:
data = csv.reader(f)
Expand Down
2 changes: 1 addition & 1 deletion datasets/craigslist_bargains/craigslist_bargains.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _split_generators(self, dl_manager):
]

def _generate_examples(self, filepath, split):
""" Yields examples. """
"""Yields examples."""

# Set default values for items when the information is missing
# `items` is the description of the item advertised on craigslist
Expand Down