MCPcopy Create free account
hub / github.com/tensorflow/datasets / match

Method match

tensorflow_datasets/core/utils/version.py:217–229  ·  view source on GitHub ↗

Returns True if other_version matches. Args: other_version: string, of the form "x[.y[.x]]" where {x,y,z} can be a number or a wildcard.

(self, other_version)

Source from the content-addressed store, hash-verified

215 return hash(self.tuple)
216
217 def match(self, other_version) -> bool:
218 """Returns True if other_version matches.
219
220 Args:
221 other_version: string, of the form "x[.y[.x]]" where {x,y,z} can be a
222 number or a wildcard.
223 """
224 major, minor, patch = _str_to_version(other_version, allow_wildcard=True)
225 return (
226 major in [self.major, "*"]
227 and minor in [self.minor, "*"]
228 and patch in [self.patch, "*"]
229 )
230
231 @classmethod
232 def is_valid(cls, version: VersionOrStr | None) -> bool:

Callers 15

test_matchMethod · 0.95
_generate_examplesMethod · 0.45
process_fileMethod · 0.45
_split_generatorsMethod · 0.45
_generate_examplesMethod · 0.45
_generate_examplesMethod · 0.45
_get_versionFunction · 0.45
is_valid_dataset_nameFunction · 0.45
_key_to_feature_nameFunction · 0.45

Calls 1

_str_to_versionFunction · 0.85

Tested by 1

test_matchMethod · 0.76