Skip to content

Commit 470d259

Browse files
h-jooThe TensorFlow Datasets Authors
authored andcommitted
Automated Code Change
PiperOrigin-RevId: 944183338
1 parent fa62a1b commit 470d259

50 files changed

Lines changed: 183 additions & 183 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tensorflow_datasets/datasets/patch_camelyon/patch_camelyon_dataset_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ def _split_generators(self, dl_manager):
5454
paths = dl_manager.download_and_extract(resources)
5555
return [
5656
tfds.core.SplitGenerator(
57-
name=tfds.Split.TEST, gen_kwargs=dict(split='test', paths=paths)
57+
name=tfds.Split.TEST, gen_kwargs=dict(split='test', paths=paths) # pyrefly: ignore[missing-attribute]
5858
),
5959
tfds.core.SplitGenerator(
60-
name=tfds.Split.TRAIN, gen_kwargs=dict(split='train', paths=paths)
60+
name=tfds.Split.TRAIN, gen_kwargs=dict(split='train', paths=paths) # pyrefly: ignore[missing-attribute]
6161
),
6262
tfds.core.SplitGenerator(
63-
name=tfds.Split.VALIDATION,
63+
name=tfds.Split.VALIDATION, # pyrefly: ignore[missing-attribute]
6464
gen_kwargs=dict(split='valid', paths=paths),
6565
),
6666
]

tensorflow_datasets/datasets/paws_wiki/paws_wiki_dataset_builder.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
_UNLABELED_FINAL: ["train", "dev"],
4545
}
4646
_SPLIT_MAPPINGS = {
47-
"train": tfds.Split.TRAIN,
48-
"dev": tfds.Split.VALIDATION,
49-
"test": tfds.Split.TEST,
47+
"train": tfds.Split.TRAIN, # pyrefly: ignore[missing-attribute]
48+
"dev": tfds.Split.VALIDATION, # pyrefly: ignore[missing-attribute]
49+
"test": tfds.Split.TEST, # pyrefly: ignore[missing-attribute]
5050
}
5151

5252
_CLASS_LABELS = ["different_meaning", "paraphrase"]
@@ -101,10 +101,10 @@ def _info(self):
101101
def _split_generators(self, dl_manager):
102102
"""Returns SplitGenerators."""
103103
dl_paths = dl_manager.download_and_extract(_DOWNLOAD_URLS)
104-
subset = self.builder_config.subset
104+
subset = self.builder_config.subset # pyrefly: ignore[missing-attribute]
105105
labels_path = os.path.join(dl_paths[subset], _EXTRACTED_FOLDERS[subset])
106106

107-
if self.builder_config.tokenized:
107+
if self.builder_config.tokenized: # pyrefly: ignore[missing-attribute]
108108
mappings_path = ""
109109
tags2texts = {}
110110
else:
@@ -193,7 +193,7 @@ def _generate_examples(
193193
key = row["id"]
194194
label_str = (
195195
"noisy_label"
196-
if self.builder_config.subset == _UNLABELED_FINAL
196+
if self.builder_config.subset == _UNLABELED_FINAL # pyrefly: ignore[missing-attribute]
197197
else "label"
198198
)
199199
example = {

tensorflow_datasets/datasets/paws_x_wiki/paws_x_wiki_dataset_builder.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,32 @@ def _split_generators(self, dl_manager):
7575
base_path = os.path.join(dl_path["x-final"], "x-final")
7676

7777
# Name of file for training for 'en' is different from other languages
78-
if self.builder_config.language == "en":
78+
if self.builder_config.language == "en": # pyrefly: ignore[missing-attribute]
7979
training_path = os.path.join(
8080
base_path, self.builder_config.language, "train.tsv"
8181
)
8282
else:
83-
training_path = os.path.join(
83+
training_path = os.path.join( # pyrefly: ignore[no-matching-overload]
8484
base_path, self.builder_config.language, "translated_train.tsv"
8585
)
8686

8787
return [
8888
tfds.core.SplitGenerator(
89-
name=tfds.Split.TRAIN,
89+
name=tfds.Split.TRAIN, # pyrefly: ignore[missing-attribute]
9090
gen_kwargs={"path": training_path},
9191
),
9292
tfds.core.SplitGenerator(
93-
name=tfds.Split.TEST,
93+
name=tfds.Split.TEST, # pyrefly: ignore[missing-attribute]
9494
gen_kwargs={
95-
"path": os.path.join(
95+
"path": os.path.join( # pyrefly: ignore[no-matching-overload]
9696
base_path, self.builder_config.language, "test_2k.tsv"
9797
)
9898
},
9999
),
100100
tfds.core.SplitGenerator(
101-
name=tfds.Split.VALIDATION,
101+
name=tfds.Split.VALIDATION, # pyrefly: ignore[missing-attribute]
102102
gen_kwargs={
103-
"path": os.path.join(
103+
"path": os.path.join( # pyrefly: ignore[no-matching-overload]
104104
base_path, self.builder_config.language, "dev_2k.tsv"
105105
)
106106
},

tensorflow_datasets/datasets/penguins/penguins_dataset_builder.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ class Builder(tfds.core.GeneratorBasedBuilder):
159159
def _info(self) -> tfds.core.DatasetInfo:
160160
"""Returns the dataset metadata."""
161161
supervised_keys = None
162-
features = self.builder_config.features
162+
features = self.builder_config.features # pyrefly: ignore[missing-attribute]
163163
supervised_features = features.copy()
164-
label_name = self.builder_config.label
164+
label_name = self.builder_config.label # pyrefly: ignore[missing-attribute]
165165

166-
if self.builder_config.name == 'processed':
166+
if self.builder_config.name == 'processed': # pyrefly: ignore[missing-attribute]
167167
label_feature = supervised_features.pop(label_name, None)
168168
supervised_keys = ('features', label_name)
169169
features = {
@@ -187,7 +187,7 @@ def _info(self) -> tfds.core.DatasetInfo:
187187

188188
def _split_generators(self, dl_manager: tfds.download.DownloadManager):
189189
"""Returns SplitGenerators."""
190-
path = dl_manager.download(_PENGUINS_PATH + self.builder_config.file_name)
190+
path = dl_manager.download(_PENGUINS_PATH + self.builder_config.file_name) # pyrefly: ignore[missing-attribute]
191191
return {'train': self._generate_examples(path)}
192192

193193
def _generate_examples(self, path):
@@ -197,8 +197,8 @@ def _generate_examples(self, path):
197197
row = {f: self._clean_up(f, v) for f, v in row.items()}
198198

199199
# Pack features if requested.
200-
if self.builder_config.name == 'processed':
201-
label_name = self.builder_config.label
200+
if self.builder_config.name == 'processed': # pyrefly: ignore[missing-attribute]
201+
label_name = self.builder_config.label # pyrefly: ignore[missing-attribute]
202202
label = row.pop(label_name, None)
203203
row = list(row.values())
204204
yield i, {'features': row, label_name: label}
@@ -207,21 +207,21 @@ def _generate_examples(self, path):
207207

208208
def _clean_up(self, field, value):
209209
"""Applies field-level pre-processing, if needed."""
210-
if not self.builder_config.cleanup:
210+
if not self.builder_config.cleanup: # pyrefly: ignore[missing-attribute]
211211
return value
212212
if field not in self.builder_config.cleanup:
213213
return value
214214

215-
feature_type = self.builder_config.features[field]
215+
feature_type = self.builder_config.features[field] # pyrefly: ignore[missing-attribute]
216216
if feature_type == np.float32:
217217
# Field is a float. If it won't parse, clean it up.
218218
try:
219219
return float(value)
220220
except ValueError:
221-
return self.builder_config.cleanup[field]
221+
return self.builder_config.cleanup[field] # pyrefly: ignore[bad-index]
222222
elif isinstance(feature_type, tfds.features.ClassLabel):
223223
# Field is a class. If it's OOV, clean it up.
224224
if value not in feature_type.names:
225-
return self.builder_config.cleanup[field]
225+
return self.builder_config.cleanup[field] # pyrefly: ignore[bad-index]
226226

227227
return value

tensorflow_datasets/datasets/pet_finder/pet_finder_dataset_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ def _split_generators(self, dl_manager):
100100

101101
return [
102102
tfds.core.SplitGenerator(
103-
name=tfds.Split.TRAIN,
103+
name=tfds.Split.TRAIN, # pyrefly: ignore[missing-attribute]
104104
gen_kwargs={
105105
"csv_name": "train.csv",
106106
"csv_paths": dl_paths["train"],
107107
"img_paths": dl_paths["train_images"],
108108
},
109109
),
110110
tfds.core.SplitGenerator(
111-
name=tfds.Split.TEST,
111+
name=tfds.Split.TEST, # pyrefly: ignore[missing-attribute]
112112
gen_kwargs={
113113
"csv_name": "test.csv",
114114
"csv_paths": dl_paths["test"],

tensorflow_datasets/datasets/pg19/pg19_dataset_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,21 @@ def _split_generators(self, dl_manager):
5959

6060
return [
6161
tfds.core.SplitGenerator(
62-
name=tfds.Split.TRAIN,
62+
name=tfds.Split.TRAIN, # pyrefly: ignore[missing-attribute]
6363
gen_kwargs={
6464
'metadata': metadata_dict,
6565
'filepath': os.path.join(_DATA_DIR, 'train'),
6666
},
6767
),
6868
tfds.core.SplitGenerator(
69-
name=tfds.Split.VALIDATION,
69+
name=tfds.Split.VALIDATION, # pyrefly: ignore[missing-attribute]
7070
gen_kwargs={
7171
'metadata': metadata_dict,
7272
'filepath': os.path.join(_DATA_DIR, 'validation'),
7373
},
7474
),
7575
tfds.core.SplitGenerator(
76-
name=tfds.Split.TEST,
76+
name=tfds.Split.TEST, # pyrefly: ignore[missing-attribute]
7777
gen_kwargs={
7878
'metadata': metadata_dict,
7979
'filepath': os.path.join(_DATA_DIR, 'test'),

tensorflow_datasets/datasets/piqa/piqa_dataset_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _split_generators(self, dl_manager):
5858
# Specify the splits
5959
return [
6060
tfds.core.SplitGenerator(
61-
name=tfds.Split.TRAIN,
61+
name=tfds.Split.TRAIN, # pyrefly: ignore[missing-attribute]
6262
gen_kwargs={
6363
"data_path": os.path.join(
6464
extracted_path, "physicaliqa-train-dev/train.jsonl"
@@ -69,7 +69,7 @@ def _split_generators(self, dl_manager):
6969
},
7070
),
7171
tfds.core.SplitGenerator(
72-
name=tfds.Split.VALIDATION,
72+
name=tfds.Split.VALIDATION, # pyrefly: ignore[missing-attribute]
7373
gen_kwargs={
7474
"data_path": os.path.join(
7575
extracted_path, "physicaliqa-train-dev/dev.jsonl"

tensorflow_datasets/datasets/places365_small/places365_small_dataset_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import os
1919

2020
from etils import epath
21-
import six.moves.urllib as urllib
21+
import six.moves.urllib as urllib # pyrefly: ignore[missing-source-for-stubs]
2222
import tensorflow_datasets.public_api as tfds
2323

2424
_BASE_URL = "http://data.csail.mit.edu/places/places365/"

tensorflow_datasets/datasets/plant_leaves/plant_leaves_dataset_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _split_generators(self, dl_manager):
8080
archive_path = dl_manager.download(_DOWNLOAD_URL)
8181
return [
8282
tfds.core.SplitGenerator(
83-
name=tfds.Split.TRAIN,
83+
name=tfds.Split.TRAIN, # pyrefly: ignore[missing-attribute]
8484
gen_kwargs={"archive": dl_manager.iter_archive(archive_path)},
8585
)
8686
]

tensorflow_datasets/datasets/plant_village/plant_village_dataset_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _split_generators(self, dl_manager):
8484
path = dl_manager.download_and_extract(_URL)
8585
return [
8686
tfds.core.SplitGenerator(
87-
name=tfds.Split.TRAIN, gen_kwargs={"datapath": path}
87+
name=tfds.Split.TRAIN, gen_kwargs={"datapath": path} # pyrefly: ignore[missing-attribute]
8888
)
8989
]
9090

0 commit comments

Comments
 (0)