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

Sourcery refactored master branch #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Aug 5, 2022

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from hassiahk August 5, 2022 11:15
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

Comment on lines -38 to -39
for _ in dataset:
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function read_unformated refactored with the following changes:

Comment on lines -48 to -49
for _ in dataset:
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function read_formatted_as_numpy refactored with the following changes:

Comment on lines -107 to +103
times[read_func.__name__ + " after write_array2d"] = read_func(feats, tmp_dir)
times[f"{read_func.__name__} after write_array2d"] = read_func(feats, tmp_dir)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function benchmark_array_xd refactored with the following changes:

Comment on lines -81 to +96
print(func.__name__, str(kwargs))
times[func.__name__ + " " + " ".join(str(v) for v in kwargs.values())] = func(dataset, **kwargs)
print(func.__name__, kwargs)
times[
f"{func.__name__} " + " ".join(str(v) for v in kwargs.values())
] = func(dataset, **kwargs)


print("shuffling dataset")
dataset = dataset.shuffle()
print("Second set of iterations (after shuffling")
for func, kwargs in functions_shuffled:
print("shuffled ", func.__name__, str(kwargs))
times["shuffled " + func.__name__ + " " + " ".join(str(v) for v in kwargs.values())] = func(
dataset, **kwargs
)
print("shuffled ", func.__name__, kwargs)
times[
f"shuffled {func.__name__} "
+ " ".join(str(v) for v in kwargs.values())
] = func(dataset, **kwargs)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function benchmark_iterating refactored with the following changes:

Comment on lines -34 to +36
title += " " + metric_name + " |"
title += f" {metric_name} |"
lines += "---|"
value += val_str + " |"
value += f"{val_str} |"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function format_json_to_md refactored with the following changes:

@@ -16,6 +16,7 @@
"""Amazon Customer Reviews Dataset --- US REVIEWS DATASET."""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 101-101 refactored with the following changes:

Comment on lines -179 to +180
for i, row in enumerate(reader):
yield i, row
yield from enumerate(reader)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function AmazonUSReviews._generate_examples refactored with the following changes:

  • Replace yield inside for loop with yield from (yield-from)

@@ -16,6 +16,7 @@
"""AmbigQA: Answering Ambiguous Open-domain Questions"""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 43-46 refactored with the following changes:

Comment on lines -102 to +100
features_dict.update(detail_features)
features_dict |= detail_features
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function AmbigQa._info refactored with the following changes:

Comment on lines -107 to +109
path_dict = dict()
path_dict = {}
for round_tag in ["R1", "R2", "R3"]:
path_dict[round_tag] = dict()
path_dict[round_tag] = {}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ANLI._split_generators refactored with the following changes:

for idx, line in enumerate(open(filepath, "rb")):
for line in open(filepath, "rb"):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ANLI._generate_examples refactored with the following changes:

@@ -15,6 +15,7 @@
"""AQUA-RAT (Algebra Question Answering with Rationales) Dataset"""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 56-60 refactored with the following changes:

features = {}

features["tweetID"] = datasets.Value("int64")
features = {"tweetID": datasets.Value("int64")}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ArCov19._info refactored with the following changes:

@@ -15,6 +15,7 @@
"""Arabic Billion Words Corpus"""

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 44-53 refactored with the following changes:

Comment on lines -138 to +140
out = re.findall(r"" + pattern, sample.group(0), re.MULTILINE | re.DOTALL)
out = re.findall(f"{pattern}", sample.group(0), re.MULTILINE | re.DOTALL)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ArabicBillionWords._extract_tags refactored with the following changes:

Comment on lines -119 to +124
if self.config.name == "full" or self.config.name == "ptpt":
if self.config.name in ["full", "ptpt"]:
train_paths.append(os.path.join(data_dir, "assin-ptpt-train.xml"))
dev_paths.append(os.path.join(data_dir, "assin-ptpt-dev.xml"))
test_paths.append(os.path.join(data_dir, "assin-ptpt-test.xml"))

if self.config.name == "full" or self.config.name == "ptbr":
if self.config.name in ["full", "ptbr"]:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Assin._split_generators refactored with the following changes:

  • Replace multiple comparisons of same variable with in operator [×2] (merge-comparisons)

rest = "[" + rest
rest = f"[{rest}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Atomic._generate_examples refactored with the following changes:

for idx, line in enumerate(f):
for line in f:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BabiQa._generate_examples refactored with the following changes:

This removes the following comments ( why? ):

# After last line

if line == "" or line == "\n":
if line in ["", "\n"]:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Bc2gmCorpus._generate_examples refactored with the following changes:

Comment on lines -133 to +143
yield f"{file_idx}_{line_idx}", {
"fname": fname.name,
"char": chars,
"char_type": char_types,
"is_beginning": is_beginnings if split == "train" else [0 for i in range(len(chars))],
}
yield (
f"{file_idx}_{line_idx}",
{
"fname": fname.name,
"char": chars,
"char_type": char_types,
"is_beginning": is_beginnings
if split == "train"
else [0 for _ in range(len(chars))],
},
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Best2009._generate_examples refactored with the following changes:

Comment on lines -75 to 78
name = "%s_to_%s" % (language_pair[0], language_pair[1])
name = f"{language_pair[0]}_to_{language_pair[1]}"

description = f"Translation dataset from {language_pair[0]} to {language_pair[1]} or {language_pair[1]} to {language_pair[0]}."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BianetConfig.__init__ refactored with the following changes:

Comment on lines -141 to -148
result = (
yield (
sentence_counter,
{
"id": str(sentence_counter),
"translation": {lang1: x, lang2: y},
},
)
yield result
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Bianet._generate_examples refactored with the following changes:

folder = l1 + "-" + l2
folder = f"{l1}-{l2}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BiblePara._generate_examples refactored with the following changes:

Comment on lines -125 to +130
{k: os.path.join(dl_path, "bigPatentData", k + ".tar.gz") for k in split_types}
{
k: os.path.join(dl_path, "bigPatentData", f"{k}.tar.gz")
for k in split_types
}
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BigPatent._split_generators refactored with the following changes:

Comment on lines -148 to 164
"train": "https://archive.org/download/biomrc_dataset/biomrc_large/dataset_train{}.json.gz".format(
setting
),
"val": "https://archive.org/download/biomrc_dataset/biomrc_large/dataset_val{}.json.gz".format(
setting
),
"test": "https://archive.org/download/biomrc_dataset/biomrc_large/dataset_test{}.json.gz".format(
setting
),
"train": f"https://archive.org/download/biomrc_dataset/biomrc_large/dataset_train{setting}.json.gz",
"val": f"https://archive.org/download/biomrc_dataset/biomrc_large/dataset_val{setting}.json.gz",
"test": f"https://archive.org/download/biomrc_dataset/biomrc_large/dataset_test{setting}.json.gz",
}

elif self.config.biomrc_version == "small":
urls_to_download = {
"train": "https://archive.org/download/biomrc_dataset/biomrc_small/dataset_train_small{}.json.gz".format(
setting
),
"val": "https://archive.org/download/biomrc_dataset/biomrc_small/dataset_val_small{}.json.gz".format(
setting
),
"test": "https://archive.org/download/biomrc_dataset/biomrc_small/dataset_test_small{}.json.gz".format(
setting
),
"train": f"https://archive.org/download/biomrc_dataset/biomrc_small/dataset_train_small{setting}.json.gz",
"val": f"https://archive.org/download/biomrc_dataset/biomrc_small/dataset_val_small{setting}.json.gz",
"test": f"https://archive.org/download/biomrc_dataset/biomrc_small/dataset_test_small{setting}.json.gz",
}

else:
urls_to_download = {
"test": "https://archive.org/download/biomrc_dataset/biomrc_tiny/dataset_tiny{}.json.gz".format(
setting
)
"test": f"https://archive.org/download/biomrc_dataset/biomrc_tiny/dataset_tiny{setting}.json.gz"
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Biomrc._split_generators refactored with the following changes:

Comment on lines -128 to -135
result = (
yield (
sentence_counter,
{
"id": str(sentence_counter),
"text": row,
},
)
yield result
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Cc100._generate_examples refactored with the following changes:

url = my_urls + "en_XX-" + self.config.language_code + ".tsv.xz"
url = f"{my_urls}en_XX-{self.config.language_code}.tsv.xz"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CcalignedMultilingual._split_generators refactored with the following changes:

Comment on lines +205 to +215
elif reverse:
yield id_, {
"translation": {lc: data[0].strip(), "en_XX": data[1].strip()},
"LASER_similarity": data[2],
}

else:
if not reverse:
yield id_, {
"translation": {"en_XX": data[0].strip(), lc: data[1].strip()},
"LASER_similarity": data[2],
}
else:
yield id_, {
"translation": {lc: data[0].strip(), "en_XX": data[1].strip()},
"LASER_similarity": data[2],
}
yield id_, {
"translation": {"en_XX": data[0].strip(), lc: data[1].strip()},
"LASER_similarity": data[2],
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CcalignedMultilingual._generate_examples refactored with the following changes:

self.split_file = os.path.join(directory, name + ".json")
self.split_file = os.path.join(directory, f"{name}.json")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CfqConfig.__init__ refactored with the following changes:

Comment on lines -95 to +99
if split == "train":
batches = ["data_batch_1", "data_batch_2", "data_batch_3", "data_batch_4", "data_batch_5"]

if split == "test":
batches = ["test_batch"]

elif split == "train":
batches = ["data_batch_1", "data_batch_2", "data_batch_3", "data_batch_4", "data_batch_5"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Cifar10._generate_examples refactored with the following changes:

  • Simplify conditional into switch-like form (switch)

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Aug 5, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.77%.

Quality metrics Before After Change
Complexity 19.18 😞 18.09 🙂 -1.09 👍
Method Length 88.90 🙂 88.25 🙂 -0.65 👍
Working memory 8.99 🙂 8.90 🙂 -0.09 👍
Quality 62.38% 🙂 63.15% 🙂 0.77% 👍
Other metrics Before After Change
Lines 35662 35660 -2
Changed files Quality Before Quality After Quality Change
benchmarks/benchmark_array_xd.py 73.85% 🙂 73.01% 🙂 -0.84% 👎
benchmarks/benchmark_iterating.py 70.43% 🙂 70.46% 🙂 0.03% 👍
benchmarks/format.py 39.97% 😞 39.91% 😞 -0.06% 👎
benchmarks/utils.py 59.53% 🙂 60.75% 🙂 1.22% 👍
datasets/acronym_identification/acronym_identification.py 83.71% ⭐ 86.00% ⭐ 2.29% 👍
datasets/ade_corpus_v2/ade_corpus_v2.py 28.75% 😞 35.02% 😞 6.27% 👍
datasets/adversarial_qa/adversarial_qa.py 69.24% 🙂 69.23% 🙂 -0.01% 👎
datasets/afrikaans_ner_corpus/afrikaans_ner_corpus.py 75.60% ⭐ 77.61% ⭐ 2.01% 👍
datasets/ai2_arc/ai2_arc.py 81.01% ⭐ 80.95% ⭐ -0.06% 👎
datasets/alt/alt.py 16.00% ⛔ 18.17% ⛔ 2.17% 👍
datasets/amazon_us_reviews/amazon_us_reviews.py 90.05% ⭐ 90.56% ⭐ 0.51% 👍
datasets/ambig_qa/ambig_qa.py 76.33% ⭐ 76.33% ⭐ 0.00%
datasets/anli/anli.py 78.26% ⭐ 78.50% ⭐ 0.24% 👍
datasets/aqua_rat/aqua_rat.py 88.42% ⭐ 88.14% ⭐ -0.28% 👎
datasets/ar_cov19/ar_cov19.py 92.26% ⭐ 92.35% ⭐ 0.09% 👍
datasets/arabic_billion_words/arabic_billion_words.py 67.71% 🙂 67.53% 🙂 -0.18% 👎
datasets/arabic_pos_dialect/arabic_pos_dialect.py 67.22% 🙂 68.80% 🙂 1.58% 👍
datasets/arabic_speech_corpus/arabic_speech_corpus.py 63.34% 🙂 63.29% 🙂 -0.05% 👎
datasets/arcd/arcd.py 75.33% ⭐ 75.27% ⭐ -0.06% 👎
datasets/art/art.py 86.08% ⭐ 86.31% ⭐ 0.23% 👍
datasets/arxiv_dataset/arxiv_dataset.py 88.64% ⭐ 87.82% ⭐ -0.82% 👎
datasets/ascent_kb/ascent_kb.py 79.89% ⭐ 80.40% ⭐ 0.51% 👍
datasets/aslg_pc12/aslg_pc12.py 90.59% ⭐ 91.31% ⭐ 0.72% 👍
datasets/asset/asset.py 64.24% 🙂 64.50% 🙂 0.26% 👍
datasets/assin/assin.py 72.58% 🙂 74.92% 🙂 2.34% 👍
datasets/atomic/atomic.py 73.60% 🙂 73.56% 🙂 -0.04% 👎
datasets/babi_qa/babi_qa.py 47.50% 😞 48.39% 😞 0.89% 👍
datasets/bc2gm_corpus/bc2gm_corpus.py 76.87% ⭐ 78.64% ⭐ 1.77% 👍
datasets/best2009/best2009.py 61.38% 🙂 61.38% 🙂 0.00%
datasets/bianet/bianet.py 81.57% ⭐ 80.15% ⭐ -1.42% 👎
datasets/bible_para/bible_para.py 80.95% ⭐ 80.90% ⭐ -0.05% 👎
datasets/big_patent/big_patent.py 83.06% ⭐ 83.03% ⭐ -0.03% 👎
datasets/biomrc/biomrc.py 67.58% 🙂 67.58% 🙂 0.00%
datasets/blimp/blimp.py 86.53% ⭐ 86.53% ⭐ 0.00%
datasets/boolq/boolq.py 90.06% ⭐ 89.98% ⭐ -0.08% 👎
datasets/bprec/bprec.py 84.21% ⭐ 84.31% ⭐ 0.10% 👍
datasets/break_data/break_data.py 59.97% 🙂 65.76% 🙂 5.79% 👍
datasets/bsd_ja_en/bsd_ja_en.py 75.78% ⭐ 75.68% ⭐ -0.10% 👎
datasets/c3/c3.py 85.68% ⭐ 85.68% ⭐ 0.00%
datasets/cbt/cbt.py 38.72% 😞 42.82% 😞 4.10% 👍
datasets/cc100/cc100.py 91.92% ⭐ 92.65% ⭐ 0.73% 👍
datasets/ccaligned_multilingual/ccaligned_multilingual.py 68.22% 🙂 69.58% 🙂 1.36% 👍
datasets/cfq/cfq.py 82.13% ⭐ 82.11% ⭐ -0.02% 👎
datasets/cifar10/cifar10.py 77.87% ⭐ 78.29% ⭐ 0.42% 👍
datasets/civil_comments/civil_comments.py 85.52% ⭐ 86.49% ⭐ 0.97% 👍
datasets/clickbait_news_bg/clickbait_news_bg.py 70.54% 🙂 70.61% 🙂 0.07% 👍
datasets/clinc_oos/clinc_oos.py 81.52% ⭐ 82.16% ⭐ 0.64% 👍
datasets/clue/clue.py 23.87% ⛔ 24.12% ⛔ 0.25% 👍
datasets/cnn_dailymail/cnn_dailymail.py 75.28% ⭐ 76.23% ⭐ 0.95% 👍
datasets/coarse_discourse/coarse_discourse.py 57.08% 🙂 57.03% 🙂 -0.05% 👎
datasets/codah/codah.py 81.16% ⭐ 81.01% ⭐ -0.15% 👎
datasets/code_search_net/code_search_net.py 76.86% ⭐ 76.86% ⭐ 0.00%
datasets/code_x_glue_cc_clone_detection_big_clone_bench/code_x_glue_cc_clone_detection_big_clone_bench.py 80.50% ⭐ 80.73% ⭐ 0.23% 👍
datasets/code_x_glue_cc_clone_detection_big_clone_bench/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_cc_clone_detection_poj104/code_x_glue_cc_clone_detection_poj104.py 75.73% ⭐ 75.61% ⭐ -0.12% 👎
datasets/code_x_glue_cc_clone_detection_poj104/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_cc_cloze_testing_all/code_x_glue_cc_cloze_testing_all.py 90.17% ⭐ 90.94% ⭐ 0.77% 👍
datasets/code_x_glue_cc_cloze_testing_all/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_cc_cloze_testing_maxmin/code_x_glue_cc_cloze_testing_maxmin.py 90.17% ⭐ 90.94% ⭐ 0.77% 👍
datasets/code_x_glue_cc_cloze_testing_maxmin/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_cc_code_completion_line/code_x_glue_cc_code_completion_line.py 90.25% ⭐ 90.72% ⭐ 0.47% 👍
datasets/code_x_glue_cc_code_completion_line/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_cc_code_completion_token/code_x_glue_cc_code_completion_token.py 56.24% 🙂 55.27% 🙂 -0.97% 👎
datasets/code_x_glue_cc_code_completion_token/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_cc_code_refinement/code_x_glue_cc_code_refinement.py 84.48% ⭐ 85.03% ⭐ 0.55% 👍
datasets/code_x_glue_cc_code_refinement/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_cc_code_to_code_trans/code_x_glue_cc_code_to_code_trans.py 85.05% ⭐ 85.67% ⭐ 0.62% 👍
datasets/code_x_glue_cc_code_to_code_trans/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_cc_defect_detection/code_x_glue_cc_defect_detection.py 85.99% ⭐ 86.20% ⭐ 0.21% 👍
datasets/code_x_glue_cc_defect_detection/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_ct_code_to_text/code_x_glue_ct_code_to_text.py 66.83% 🙂 67.07% 🙂 0.24% 👍
datasets/code_x_glue_ct_code_to_text/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_tc_nl_code_search_adv/code_x_glue_tc_nl_code_search_adv.py 68.94% 🙂 69.41% 🙂 0.47% 👍
datasets/code_x_glue_tc_nl_code_search_adv/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_tc_text_to_code/code_x_glue_tc_text_to_code.py 90.19% ⭐ 90.66% ⭐ 0.47% 👍
datasets/code_x_glue_tc_text_to_code/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/code_x_glue_tt_text_to_text/code_x_glue_tt_text_to_text.py 83.08% ⭐ 83.53% ⭐ 0.45% 👍
datasets/code_x_glue_tt_text_to_text/common.py 77.20% ⭐ 78.60% ⭐ 1.40% 👍
datasets/com_qa/com_qa.py 81.97% ⭐ 81.88% ⭐ -0.09% 👎
datasets/common_gen/common_gen.py 77.04% ⭐ 78.52% ⭐ 1.48% 👍
datasets/common_voice/common_voice.py 65.24% 🙂 65.45% 🙂 0.21% 👍
datasets/commonsense_qa/commonsense_qa.py 77.90% ⭐ 78.32% ⭐ 0.42% 👍
datasets/conceptnet5/conceptnet5.py 52.13% 🙂 57.21% 🙂 5.08% 👍
datasets/conll2000/conll2000.py 71.88% 🙂 73.79% 🙂 1.91% 👍
datasets/conv_questions/conv_questions.py 85.57% ⭐ 85.40% ⭐ -0.17% 👎
datasets/cord19/cord19.py 48.58% 😞 48.31% 😞 -0.27% 👎
datasets/cos_e/cos_e.py 79.93% ⭐ 79.92% ⭐ -0.01% 👎
datasets/cosmos_qa/cosmos_qa.py 77.40% ⭐ 77.30% ⭐ -0.10% 👎
datasets/counter/counter.py 72.93% 🙂 72.86% 🙂 -0.07% 👎
datasets/covid_qa_castorini/covid_qa_castorini.py 76.25% ⭐ 76.21% ⭐ -0.04% 👎
datasets/covid_qa_deepset/covid_qa_deepset.py 73.77% 🙂 73.73% 🙂 -0.04% 👎
datasets/covid_qa_ucsd/covid_qa_ucsd.py 17.05% ⛔ 17.08% ⛔ 0.03% 👍
datasets/covost2/covost2.py 76.29% ⭐ 76.29% ⭐ 0.00%
datasets/craigslist_bargains/craigslist_bargains.py 38.20% 😞 39.71% 😞 1.51% 👍
datasets/crd3/crd3.py 58.39% 🙂 58.42% 🙂 0.03% 👍
datasets/crime_and_punish/crime_and_punish.py 81.98% ⭐ 82.62% ⭐ 0.64% 👍
datasets/cs_restaurants/cs_restaurants.py 87.70% ⭐ 87.56% ⭐ -0.14% 👎
datasets/curiosity_dialogs/curiosity_dialogs.py 51.33% 🙂 51.24% 🙂 -0.09% 👎
datasets/dane/dane.py 39.79% 😞 41.00% 😞 1.21% 👍
datasets/datacommons_factcheck/datacommons_factcheck.py 73.42% 🙂 78.64% ⭐ 5.22% 👍
datasets/dbrd/dbrd.py 74.75% 🙂 74.69% 🙂 -0.06% 👎
datasets/deal_or_no_dialog/deal_or_no_dialog.py 72.18% 🙂 72.18% 🙂 0.00%
datasets/dialog_re/dialog_re.py 89.24% ⭐ 89.09% ⭐ -0.15% 👎
datasets/discofuse/discofuse.py 63.44% 🙂 65.08% 🙂 1.64% 👍
datasets/disfl_qa/disfl_qa.py 73.00% 🙂 73.26% 🙂 0.26% 👍
datasets/doc2dial/doc2dial.py 39.47% 😞 39.64% 😞 0.17% 👍
datasets/docred/docred.py 76.19% ⭐ 76.16% ⭐ -0.03% 👎
datasets/dream/dream.py 85.27% ⭐ 85.17% ⭐ -0.10% 👎
datasets/drop/drop.py 65.72% 🙂 65.91% 🙂 0.19% 👍
datasets/duorc/duorc.py 79.60% ⭐ 79.39% ⭐ -0.21% 👎
datasets/dutch_social/dutch_social.py 72.60% 🙂 72.70% 🙂 0.10% 👍
datasets/ecb/ecb.py 81.59% ⭐ 82.09% ⭐ 0.50% 👍
datasets/eli5/eli5.py 42.94% 😞 43.85% 😞 0.91% 👍
datasets/emea/emea.py 81.59% ⭐ 82.09% ⭐ 0.50% 👍
datasets/empathetic_dialogues/empathetic_dialogues.py 74.01% 🙂 75.65% ⭐ 1.64% 👍
datasets/enriched_web_nlg/enriched_web_nlg.py 62.96% 🙂 63.15% 🙂 0.19% 👍
datasets/esnli/esnli.py 88.30% ⭐ 88.44% ⭐ 0.14% 👍
datasets/eth_py150_open/eth_py150_open.py 90.24% ⭐ 91.68% ⭐ 1.44% 👍
datasets/ethos/ethos.py 58.27% 🙂 59.15% 🙂 0.88% 👍
datasets/eu_regulatory_ir/eu_regulatory_ir.py 80.29% ⭐ 84.08% ⭐ 3.79% 👍
datasets/euronews/euronews.py 67.65% 🙂 69.13% 🙂 1.48% 👍
datasets/europa_eac_tm/europa_eac_tm.py 72.93% 🙂 72.33% 🙂 -0.60% 👎
datasets/europa_ecdc_tm/europa_ecdc_tm.py 79.10% ⭐ 78.91% ⭐ -0.19% 👎
datasets/europarl_bilingual/europarl_bilingual.py 73.84% 🙂 74.17% 🙂 0.33% 👍
datasets/evidence_infer_treatment/evidence_infer_treatment.py 44.94% 😞 46.90% 😞 1.96% 👍
datasets/farsi_news/farsi_news.py 92.70% ⭐ 93.30% ⭐ 0.60% 👍
datasets/fever/fever.py 37.20% 😞 42.19% 😞 4.99% 👍
datasets/few_rel/few_rel.py 46.79% 😞 47.07% 😞 0.28% 👍
datasets/flores/flores.py 74.53% 🙂 73.55% 🙂 -0.98% 👎
datasets/flue/flue.py 50.75% 🙂 51.95% 🙂 1.20% 👍
datasets/fquad/fquad.py 77.80% ⭐ 77.67% ⭐ -0.13% 👎
datasets/freebase_qa/freebase_qa.py 76.81% ⭐ 77.92% ⭐ 1.11% 👍
datasets/gem/gem.py 7.27% ⛔ 7.28% ⛔ 0.01% 👍
datasets/generics_kb/generics_kb.py 50.51% 🙂 51.92% 🙂 1.41% 👍
datasets/german_legal_entity_recognition/german_legal_entity_recognition.py 71.63% 🙂 72.19% 🙂 0.56% 👍
datasets/germaner/germaner.py 72.18% 🙂 72.75% 🙂 0.57% 👍
datasets/giga_fren/giga_fren.py 84.72% ⭐ 85.36% ⭐ 0.64% 👍
datasets/glue/glue.py 50.37% 🙂 50.36% 🙂 -0.01% 👎
datasets/go_emotions/go_emotions.py 71.71% 🙂 72.02% 🙂 0.31% 👍
datasets/hansards/hansards.py 68.73% 🙂 68.73% 🙂 0.00%
datasets/harem/harem.py 63.89% 🙂 64.81% 🙂 0.92% 👍
datasets/hate_speech18/hate_speech18.py 77.79% ⭐ 77.72% ⭐ -0.07% 👎
datasets/hatexplain/hatexplain.py 86.88% ⭐ 86.79% ⭐ -0.09% 👎
datasets/hausa_voa_ner/hausa_voa_ner.py 75.26% ⭐ 77.13% ⭐ 1.87% 👍
datasets/head_qa/head_qa.py 65.21% 🙂 65.21% 🙂 0.00%
datasets/health_fact/health_fact.py 50.09% 🙂 54.46% 🙂 4.37% 👍
datasets/hebrew_projectbenyehuda/hebrew_projectbenyehuda.py 71.45% 🙂 71.50% 🙂 0.05% 👍
datasets/hebrew_this_world/hebrew_this_world.py 87.19% ⭐ 87.32% ⭐ 0.13% 👍
datasets/hellaswag/hellaswag.py 87.26% ⭐ 87.13% ⭐ -0.13% 👎
datasets/hippocorpus/hippocorpus.py 85.07% ⭐ 85.07% ⭐ 0.00%
datasets/hkcancor/hkcancor.py 40.06% 😞 40.11% 😞 0.05% 👍
datasets/hotpot_qa/hotpot_qa.py 75.35% ⭐ 76.29% ⭐ 0.94% 👍
datasets/hyperpartisan_news_detection/hyperpartisan_news_detection.py 63.63% 🙂 64.70% 🙂 1.07% 👍
datasets/id_liputan6/id_liputan6.py 67.57% 🙂 69.10% 🙂 1.53% 👍
datasets/id_nergrit_corpus/id_nergrit_corpus.py 75.53% ⭐ 77.08% ⭐ 1.55% 👍
datasets/id_newspapers_2018/id_newspapers_2018.py 89.04% ⭐ 89.80% ⭐ 0.76% 👍
datasets/id_panl_bppt/id_panl_bppt.py 76.61% ⭐ 73.83% 🙂 -2.78% 👎
datasets/igbo_english_machine_translation/igbo_english_machine_translation.py 85.08% ⭐ 85.28% ⭐ 0.20% 👍
datasets/igbo_ner/igbo_ner.py 69.37% 🙂 72.35% 🙂 2.98% 👍
datasets/imdb/imdb.py 74.33% 🙂 74.28% 🙂 -0.05% 👎
datasets/imppres/imppres.py 71.05% 🙂 70.98% 🙂 -0.07% 👎
datasets/indic_glue/indic_glue.py 35.13% 😞 35.41% 😞 0.28% 👍
datasets/indonlu/indonlu.py 31.25% 😞 32.33% 😞 1.08% 👍
datasets/irc_disentangle/irc_disentangle.py 35.11% 😞 35.68% 😞 0.57% 👍
datasets/isixhosa_ner_corpus/isixhosa_ner_corpus.py 75.60% ⭐ 77.61% ⭐ 2.01% 👍
datasets/isizulu_ner_corpus/isizulu_ner_corpus.py 75.60% ⭐ 77.61% ⭐ 2.01% 👍
datasets/iwslt2017/iwslt2017.py 63.07% 🙂 63.29% 🙂 0.22% 👍
datasets/jfleg/jfleg.py 74.26% 🙂 74.32% 🙂 0.06% 👍
datasets/jigsaw_toxicity_pred/jigsaw_toxicity_pred.py 74.61% 🙂 75.25% ⭐ 0.64% 👍
datasets/jnlpba/jnlpba.py 77.16% ⭐ 78.82% ⭐ 1.66% 👍
datasets/kannada_news/kannada_news.py 89.14% ⭐ 87.90% ⭐ -1.24% 👎
datasets/kd_conv/kd_conv.py 41.50% 😞 41.96% 😞 0.46% 👍
datasets/kde4/kde4.py 81.59% ⭐ 82.09% ⭐ 0.50% 👍
datasets/kelm/kelm.py 90.38% ⭐ 90.94% ⭐ 0.56% 👍
datasets/labr/labr.py 85.85% ⭐ 86.63% ⭐ 0.78% 👍
datasets/lama/lama.py 25.91% 😞 25.91% 😞 0.00%
datasets/lc_quad/lc_quad.py 79.36% ⭐ 84.64% ⭐ 5.28% 👍
datasets/lener_br/lener_br.py 75.22% ⭐ 77.10% ⭐ 1.88% 👍
datasets/librispeech_asr/librispeech_asr.py 72.62% 🙂 72.42% 🙂 -0.20% 👎
datasets/librispeech_lm/librispeech_lm.py 93.96% ⭐ 94.36% ⭐ 0.40% 👍
datasets/lince/lince.py 58.30% 🙂 58.43% 🙂 0.13% 👍
datasets/linnaeus/linnaeus.py 77.16% ⭐ 78.82% ⭐ 1.66% 👍
datasets/liveqa/liveqa.py 66.96% 🙂 68.11% 🙂 1.15% 👍
datasets/mac_morpho/mac_morpho.py 80.87% ⭐ 81.65% ⭐ 0.78% 👍
datasets/makhzan/makhzan.py 67.27% 🙂 72.70% 🙂 5.43% 👍
datasets/masakhaner/masakhaner.py 74.28% 🙂 76.14% ⭐ 1.86% 👍
datasets/math_dataset/math_dataset.py 78.45% ⭐ 77.23% ⭐ -1.22% 👎
datasets/math_qa/math_qa.py 91.51% ⭐ 92.20% ⭐ 0.69% 👍
datasets/matinf/matinf.py 75.39% ⭐ 75.63% ⭐ 0.24% 👍
datasets/mc4/mc4.py 74.99% 🙂 75.92% ⭐ 0.93% 👍
datasets/mdd/mdd.py 31.63% 😞 32.47% 😞 0.84% 👍
datasets/med_hop/med_hop.py 86.13% ⭐ 86.32% ⭐ 0.19% 👍
datasets/medal/medal.py 77.45% ⭐ 77.31% ⭐ -0.14% 👎
datasets/medical_dialog/medical_dialog.py 14.47% ⛔ 14.90% ⛔ 0.43% 👍
datasets/miam/miam.py 79.47% ⭐ 79.48% ⭐ 0.01% 👍
datasets/mlqa/mlqa.py 67.33% 🙂 66.68% 🙂 -0.65% 👎
datasets/mlsum/mlsum.py 85.83% ⭐ 85.81% ⭐ -0.02% 👎
datasets/movie_rationales/movie_rationales.py 78.98% ⭐ 79.50% ⭐ 0.52% 👍
datasets/mrqa/mrqa.py 56.00% 🙂 59.73% 🙂 3.73% 👍
datasets/ms_terms/ms_terms.py 79.58% ⭐ 78.73% ⭐ -0.85% 👎
datasets/msr_genomics_kbcomp/msr_genomics_kbcomp.py 88.13% ⭐ 88.13% ⭐ 0.00%
datasets/msr_sqa/msr_sqa.py 83.60% ⭐ 85.09% ⭐ 1.49% 👍
datasets/msr_text_compression/msr_text_compression.py 84.49% ⭐ 84.49% ⭐ 0.00%
datasets/msr_zhen_translation_parity/msr_zhen_translation_parity.py 85.52% ⭐ 85.00% ⭐ -0.52% 👎
datasets/mt_eng_vietnamese/mt_eng_vietnamese.py 71.42% 🙂 70.83% 🙂 -0.59% 👎
datasets/muchocine/muchocine.py 52.85% 🙂 52.76% 🙂 -0.09% 👎
datasets/multi_booked/multi_booked.py 34.22% 😞 50.32% 🙂 16.10% 👍
datasets/multi_news/multi_news.py 89.33% ⭐ 89.25% ⭐ -0.08% 👎
datasets/multi_para_crawl/multi_para_crawl.py 81.59% ⭐ 82.09% ⭐ 0.50% 👍
datasets/multi_re_qa/multi_re_qa.py 63.89% 🙂 68.64% 🙂 4.75% 👍
datasets/multi_x_science_sum/multi_x_science_sum.py 81.18% ⭐ 81.18% ⭐ 0.00%
datasets/mwsc/mwsc.py 68.09% 🙂 69.08% 🙂 0.99% 👍
datasets/myanmar_news/myanmar_news.py 90.04% ⭐ 90.10% ⭐ 0.06% 👍
datasets/narrativeqa/narrativeqa.py 55.83% 🙂 55.80% 🙂 -0.03% 👎
datasets/narrativeqa_manual/narrativeqa_manual.py 51.64% 🙂 51.64% 🙂 0.00%
datasets/ncbi_disease/ncbi_disease.py 76.87% ⭐ 78.64% ⭐ 1.77% 👍
datasets/nell/nell.py 22.87% ⛔ 22.88% ⛔ 0.01% 👍
datasets/neural_code_search/neural_code_search.py 61.47% 🙂 61.37% 🙂 -0.10% 👎
datasets/news_commentary/news_commentary.py 77.12% ⭐ 77.48% ⭐ 0.36% 👍
datasets/newsgroup/newsgroup.py 81.61% ⭐ 82.09% ⭐ 0.48% 👍
datasets/newspop/newspop.py 75.63% ⭐ 77.72% ⭐ 2.09% 👍
datasets/newsqa/newsqa.py 23.18% ⛔ 25.68% 😞 2.50% 👍
datasets/newsroom/newsroom.py 88.00% ⭐ 88.06% ⭐ 0.06% 👍
datasets/nli_tr/nli_tr.py 76.47% ⭐ 77.35% ⭐ 0.88% 👍
datasets/norwegian_ner/norwegian_ner.py 82.91% ⭐ 83.23% ⭐ 0.32% 👍
datasets/nsmc/nsmc.py 92.25% ⭐ 92.14% ⭐ -0.11% 👎
datasets/numer_sense/numer_sense.py 83.22% ⭐ 85.23% ⭐ 2.01% 👍
datasets/ofis_publik/ofis_publik.py 82.02% ⭐ 82.53% ⭐ 0.51% 👍
datasets/onestop_english/onestop_english.py 57.24% 🙂 57.82% 🙂 0.58% 👍
datasets/open_subtitles/open_subtitles.py 70.04% 🙂 70.01% 🙂 -0.03% 👎
datasets/openslr/openslr.py 45.40% 😞 46.11% 😞 0.71% 👍
datasets/opus100/opus100.py 59.03% 🙂 60.07% 🙂 1.04% 👍
datasets/opus_books/opus_books.py 77.17% ⭐ 77.52% ⭐ 0.35% 👍
datasets/opus_dgt/opus_dgt.py 81.06% ⭐ 81.55% ⭐ 0.49% 👍
datasets/opus_gnome/opus_gnome.py 81.06% ⭐ 81.55% ⭐ 0.49% 👍
datasets/opus_paracrawl/opus_paracrawl.py 81.13% ⭐ 81.63% ⭐ 0.50% 👍
datasets/opus_rf/opus_rf.py 80.98% ⭐ 81.49% ⭐ 0.51% 👍
datasets/opus_tedtalks/opus_tedtalks.py 82.02% ⭐ 82.53% ⭐ 0.51% 👍
datasets/opus_ubuntu/opus_ubuntu.py 81.06% ⭐ 81.55% ⭐ 0.49% 👍
datasets/opus_wikipedia/opus_wikipedia.py 81.59% ⭐ 82.09% ⭐ 0.50% 👍
datasets/orange_sum/orange_sum.py 88.80% ⭐ 88.88% ⭐ 0.08% 👍
datasets/oscar/oscar.py 68.62% 🙂 69.92% 🙂 1.30% 👍
datasets/para_crawl/para_crawl.py 83.12% ⭐ 82.25% ⭐ -0.87% 👎
datasets/para_pat/para_pat.py 70.22% 🙂 69.41% 🙂 -0.81% 👎
datasets/parsinlu_reading_comprehension/parsinlu_reading_comprehension.py 78.57% ⭐ 78.44% ⭐ -0.13% 👎
datasets/paws/paws.py 68.09% 🙂 68.11% 🙂 0.02% 👍
datasets/pec/pec.py 64.84% 🙂 68.49% 🙂 3.65% 👍
datasets/peer_read/peer_read.py 66.14% 🙂 64.68% 🙂 -1.46% 👎
datasets/per_sent/per_sent.py 75.42% ⭐ 75.31% ⭐ -0.11% 👎
datasets/pg19/pg19.py 60.41% 🙂 60.38% 🙂 -0.03% 👎
datasets/php/php.py 81.05% ⭐ 81.00% ⭐ -0.05% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
datasets/gem/gem.py Gem._generate_examples 315 ⛔ 2748 ⛔ 31 ⛔ 0.75% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
datasets/medical_dialog/medical_dialog.py MedicalDialog._generate_examples 131 ⛔ 466 ⛔ 27 ⛔ 2.12% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
datasets/covid_qa_ucsd/covid_qa_ucsd.py CovidQaUcsd._generate_examples 106 ⛔ 458 ⛔ 26 ⛔ 2.50% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
datasets/alt/alt.py Alt._generate_examples 104 ⛔ 861 ⛔ 21 ⛔ 3.69% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
datasets/nell/nell.py Nell._generate_examples 69 ⛔ 498 ⛔ 20 ⛔ 5.67% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants