uid stringlengths 24 24 | split stringclasses 1
value | category stringclasses 2
values | content stringlengths 5 482k | signature stringlengths 1 14k | suffix stringlengths 1 482k | prefix stringlengths 9 14k | prefix_token_count int64 3 5.01k | prefix_token_budget int64 64 256 | element_token_count int64 1 292k | signature_token_count int64 1 5.01k | prefix_context_token_count int64 0 255 | repo stringlengths 7 112 | path stringlengths 4 208 | language stringclasses 1
value | name stringlengths 1 218 | qualname stringlengths 1 218 | start_line int64 1 26.7k | end_line int64 1 26.7k | signature_start_line int64 1 26.7k | signature_end_line int64 1 26.7k | source_hash stringlengths 40 40 | source_dataset stringclasses 1
value | source_split stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
66dcbe7e02905caaee2f6115 | train | class | class TestNewLineOrEnd(unittest.TestCase):
def test_match(self):
new_line_or_end = NewlineOrEnd()
self.assertEqual(new_line_or_end.match("\n"), MATCH)
self.assertEqual(new_line_or_end.match(""), MATCH)
self.assertEqual(new_line_or_end.match("bla"), NO_MATCH)
| class TestNewLineOrEnd(unittest.TestCase):
| def test_match(self):
new_line_or_end = NewlineOrEnd()
self.assertEqual(new_line_or_end.match("\n"), MATCH)
self.assertEqual(new_line_or_end.match(""), MATCH)
self.assertEqual(new_line_or_end.match("bla"), NO_MATCH)
| Markers([Marker("test"), Marker("hey")])
with self.assertRaises(TypeError):
MultiplePossibleMarkers(["hey", "ho"])
with self.assertRaises(TypeError):
MultiplePossibleMarkers([RepeatableMarker("bla"), OptionalMarker("bla")])
class TestNewLineOrEnd(unittest.TestCase):
| 64 | 64 | 69 | 10 | 54 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestNewLineOrEnd | TestNewLineOrEnd | 179 | 185 | 179 | 179 | ddc0cc27c2d61f20b0c6979be347f6ee3b6ed6e8 | bigcode/the-stack | train |
266508addfe937dee8dbe644 | train | class | class TestOptionalRepeatableMarker(unittest.TestCase):
def test_match(self):
marker1 = OptionalRepeatableMarker(" ")
marker2 = OptionalRepeatableMarker("test")
string1 = ""
string2 = " "
string3 = "test"
string4 = "tes"
string5 = "testt"
string6 = "bl... | class TestOptionalRepeatableMarker(unittest.TestCase):
| def test_match(self):
marker1 = OptionalRepeatableMarker(" ")
marker2 = OptionalRepeatableMarker("test")
string1 = ""
string2 = " "
string3 = "test"
string4 = "tes"
string5 = "testt"
string6 = "bla"
string7 = "_"
string8 = "testtest"
... | 3), MATCH)
self.assertEqual(marker2.match(string4), POT_MATCH)
self.assertEqual(marker2.match(string5), POT_MATCH)
self.assertEqual(marker2.match(string6), NO_MATCH)
self.assertEqual(marker2.match(string8), MATCH)
with self.assertRaises(ValueError):
RepeatableMarker(... | 78 | 79 | 264 | 10 | 68 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestOptionalRepeatableMarker | TestOptionalRepeatableMarker | 102 | 132 | 102 | 102 | 3dfa5a0a96c68f6c7bced3da3fe25c3f1c3a934b | bigcode/the-stack | train |
ea1637c382c9317612410b51 | train | class | class TestReplacer(unittest.TestCase):
def test_replace(self):
replacer1 = Replacer([(MarkerSequence([Marker("hey")]), MarkerSequence([Marker("ho")]),
lambda string, _, __: (string.upper(), REPLACE_TARGET))])
self.assertEqual(replacer1.replace("heytollhoheytollho"), "h... | class TestReplacer(unittest.TestCase):
| def test_replace(self):
replacer1 = Replacer([(MarkerSequence([Marker("hey")]), MarkerSequence([Marker("ho")]),
lambda string, _, __: (string.upper(), REPLACE_TARGET))])
self.assertEqual(replacer1.replace("heytollhoheytollho"), "heyTOLLhoheyTOLLho")
replacer2 ... | self.assertEqual(marker_sequence7.match("test\""), MATCH)
self.assertEqual(marker_sequence7.match("test\"t"), NO_MATCH)
marker_sequence7 = MarkerSequence([Marker("test"), MultiplePossibleMarkers([Marker("hey"), Marker("hoo")])])
self.assertEqual(marker_sequence7.match("testhey"), MATCH... | 256 | 256 | 1,281 | 8 | 248 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestReplacer | TestReplacer | 285 | 370 | 285 | 285 | 0f3e07c3a5bb925c60590fbb0905cf6ab3befd8a | bigcode/the-stack | train |
bbcff5a9a87470b6f7f10c4c | train | class | class TestRepeatableMarker(unittest.TestCase):
def test_match(self):
marker1 = RepeatableMarker(" ")
marker2 = RepeatableMarker("test")
string1 = ""
string2 = " "
string3 = "test"
string4 = "tes"
string5 = "testt"
string6 = "bla"
string7 = "_"... | class TestRepeatableMarker(unittest.TestCase):
| def test_match(self):
marker1 = RepeatableMarker(" ")
marker2 = RepeatableMarker("test")
string1 = ""
string2 = " "
string3 = "test"
string4 = "tes"
string5 = "testt"
string6 = "bla"
string7 = "_"
string8 = "testtest"
string9 =... | 2), NO_MATCH)
self.assertEqual(marker2.match(string3), MATCH)
self.assertEqual(marker2.match(string4), POT_MATCH)
self.assertEqual(marker2.match(string5), NO_MATCH)
self.assertEqual(marker2.match(string6), NO_MATCH)
with self.assertRaises(ValueError):
OptionalMarker(... | 77 | 78 | 260 | 9 | 68 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestRepeatableMarker | TestRepeatableMarker | 69 | 99 | 69 | 69 | 3da0090e6923302b6e4dcf21848177ec6fd20f45 | bigcode/the-stack | train |
81eea7818044467fd2f327e1 | train | class | class TestMarkerSequence(unittest.TestCase):
def test_match(self):
marker_sequence1 = MarkerSequence([Marker("{{"), OptionalRepeatableMarker(" "), Marker("test"),
OptionalRepeatableMarker(" "), Marker("("), Marker("'")])
self.assertEqual(marker_sequence1.m... | class TestMarkerSequence(unittest.TestCase):
| def test_match(self):
marker_sequence1 = MarkerSequence([Marker("{{"), OptionalRepeatableMarker(" "), Marker("test"),
OptionalRepeatableMarker(" "), Marker("("), Marker("'")])
self.assertEqual(marker_sequence1.match("{{test('"), MATCH)
self.assertE... | self.assertEqual(markers2.match(string3), POT_MATCH)
self.assertEqual(markers2.match(string4), NO_MATCH)
self.assertEqual(markers2.match(string5), NO_MATCH)
self.assertEqual(markers2.match(string6), MATCH)
self.assertEqual(markers2.match(string7), MATCH)
self.assertEqual(markers... | 256 | 256 | 1,152 | 8 | 248 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestMarkerSequence | TestMarkerSequence | 188 | 282 | 188 | 188 | 0e99b949f8053e432208884e0852c8d837658cb2 | bigcode/the-stack | train |
c687c28407f22fb70f463d77 | train | class | class TestOptionalMarker(unittest.TestCase):
def test_match(self):
marker1 = OptionalMarker(" ")
marker2 = OptionalMarker("test")
string1 = ""
string2 = " "
string3 = "test"
string4 = "tes"
string5 = "testt"
string6 = "bla"
string7 = "_"
... | class TestOptionalMarker(unittest.TestCase):
| def test_match(self):
marker1 = OptionalMarker(" ")
marker2 = OptionalMarker("test")
string1 = ""
string2 = " "
string3 = "test"
string4 = "tes"
string5 = "testt"
string6 = "bla"
string7 = "_"
self.assertEqual(marker1.match(string1), ... | .assertEqual(marker2.match(string3), MATCH)
self.assertEqual(marker2.match(string4), POT_MATCH)
self.assertEqual(marker2.match(string5), NO_MATCH)
self.assertEqual(marker2.match(string6), NO_MATCH)
with self.assertRaises(ValueError):
Marker("")
class TestOptionalMarker(unitt... | 68 | 69 | 230 | 8 | 60 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestOptionalMarker | TestOptionalMarker | 40 | 66 | 40 | 40 | e87adad7a81e3e235c5d5736e2599ca9449b08f5 | bigcode/the-stack | train |
7ef31e29881a584d657663d2 | train | class | class TestGetter(unittest.TestCase):
def test_get(self):
getter1 = Getter([(MarkerSequence([Marker("hey")]), MarkerSequence([Marker("ho")]), lambda _, __, ___: _)])
self.assertEqual(getter1.get("heytesthohabla"), ["test"])
getter2 = Getter([(MarkerSequence([Marker("hey")]), MarkerSequence([... | class TestGetter(unittest.TestCase):
| def test_get(self):
getter1 = Getter([(MarkerSequence([Marker("hey")]), MarkerSequence([Marker("ho")]), lambda _, __, ___: _)])
self.assertEqual(getter1.get("heytesthohabla"), ["test"])
getter2 = Getter([(MarkerSequence([Marker("hey")]), MarkerSequence([Marker("ho")]), lambda _, __, ___: No... | 2 = "test hey ho bla bla {{ static_url('H') }} " \
"blub{{static_url( 'HEY')}} {{ blob({{static_url('HEY' )}} "
self.assertEqual(replacer13.replace(str2), correctly_processed_str2)
class TestGetter(unittest.TestCase):
| 64 | 64 | 107 | 7 | 57 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestGetter | TestGetter | 373 | 379 | 373 | 373 | 3b43705095402020767730f63e5dce96e853b52a | bigcode/the-stack | train |
22fe198121c8a57c0a7534f9 | train | class | class TestMultiplePossibleMarkers(unittest.TestCase):
def test_match(self):
markers1 = MultiplePossibleMarkers([Marker("'"), Marker('"')])
markers2 = MultiplePossibleMarkers([Marker("test"), Marker('täst')])
string1 = "'"
string2 = '"'
string3 = ""
string4 = " "
... | class TestMultiplePossibleMarkers(unittest.TestCase):
| def test_match(self):
markers1 = MultiplePossibleMarkers([Marker("'"), Marker('"')])
markers2 = MultiplePossibleMarkers([Marker("test"), Marker('täst')])
string1 = "'"
string2 = '"'
string3 = ""
string4 = " "
string5 = "bla"
string6 = "test"
s... | 2.match(string1), POT_MATCH)
self.assertEqual(marker2.match(string2), NO_MATCH)
self.assertEqual(marker2.match(string3), MATCH)
self.assertEqual(marker2.match(string4), POT_MATCH)
self.assertEqual(marker2.match(string5), POT_MATCH)
self.assertEqual(marker2.match(string6), NO_MATC... | 107 | 108 | 362 | 9 | 98 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestMultiplePossibleMarkers | TestMultiplePossibleMarkers | 135 | 176 | 135 | 135 | 5f95e1e8f944a5b41b92d79140830b7c40f8f541 | bigcode/the-stack | train |
4160c10b5c046a9530371838 | train | class | class TestMarker(unittest.TestCase):
def test_match(self):
marker1 = Marker(" ")
marker2 = Marker("test")
string1 = ""
string2 = " "
string3 = "test"
string4 = "tes"
string5 = "testt"
string6 = "bla"
string7 = "_"
self.assertEqual(mar... | class TestMarker(unittest.TestCase):
| def test_match(self):
marker1 = Marker(" ")
marker2 = Marker("test")
string1 = ""
string2 = " "
string3 = "test"
string4 = "tes"
string5 = "testt"
string6 = "bla"
string7 = "_"
self.assertEqual(marker1.match(string1), POT_MATCH)
... | .get_insert_replace.main import MarkerSequence
from utils.get_insert_replace.main import REPLACE_TARGET, REPLACE_TARGET_AND_MARKER_SEQUENCE, \
REPLACE_TARGET_AND_MARKER_SEQUENCE_BEFORE, REPLACE_TARGET_AND_MARKER_SEQUENCE_AFTER
from utils.get_insert_replace.main import Replacer, Getter
class TestMarker(unittest.Test... | 67 | 67 | 226 | 7 | 59 | juliuskrahn/Taskstack | taskstack/utils/get_insert_replace/test_main.py | Python | TestMarker | TestMarker | 11 | 37 | 11 | 11 | e1fcc46780d8ed37fc0867d88559dcab68bd7dac | bigcode/the-stack | train |
6a4d76d9784ba47b1c79659a | train | class | class ExtendedJavaWrapper(JavaWrapper):
def __init__(self, java_obj, *args):
super(ExtendedJavaWrapper, self).__init__(java_obj)
self.sc = SparkContext._active_spark_context
self._java_obj = self.new_java_obj(java_obj, *args)
self.java_obj = self._java_obj
def __del__(self):
... | class ExtendedJavaWrapper(JavaWrapper):
| def __init__(self, java_obj, *args):
super(ExtendedJavaWrapper, self).__init__(java_obj)
self.sc = SparkContext._active_spark_context
self._java_obj = self.new_java_obj(java_obj, *args)
self.java_obj = self._java_obj
def __del__(self):
pass
def apply(self):
... | ):
if params is None:
params = dict()
if isinstance(params, dict):
if params:
return self.copy(params)._transform_recursive(dataset, recursive_pipeline)
else:
return self._transform_recursive(dataset, recursive_pipeline)
else:
... | 80 | 80 | 269 | 7 | 73 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | ExtendedJavaWrapper | ExtendedJavaWrapper | 140 | 171 | 140 | 140 | 5c6e64c54c3b2961ad55876e0fd13537389ca966 | bigcode/the-stack | train |
5ecf4d991841600eb427e657 | train | class | class _T5Loader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_T5Loader, self).__init__(
"com.johnsnowlabs.nlp.annotators.seq2seq.T5Transformer.loadSavedModel", path, jspark)
| class _T5Loader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_T5Loader, self).__init__(
"com.johnsnowlabs.nlp.annotators.seq2seq.T5Transformer.loadSavedModel", path, jspark)
| etLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_XlnetLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.XlnetEmbeddings.loadSavedModel", path, jspark)
class _T5Loader(ExtendedJavaWrapper):
| 64 | 64 | 59 | 10 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _T5Loader | _T5Loader | 306 | 309 | 306 | 306 | 00c4a745e84ac4e262b292c1bed3c8e7b490032e | bigcode/the-stack | train |
fcdd430f451354f234e70c6f | train | class | class _EmbeddingsCoverageColumn(ExtendedJavaWrapper):
def __init__(self, dataset, embeddings_col, output_col):
super(_EmbeddingsCoverageColumn, self).__init__("com.johnsnowlabs.nlp.embeddings.WordEmbeddingsModel.withCoverageColumn", dataset._jdf, embeddings_col, output_col)
| class _EmbeddingsCoverageColumn(ExtendedJavaWrapper):
| def __init__(self, dataset, embeddings_col, output_col):
super(_EmbeddingsCoverageColumn, self).__init__("com.johnsnowlabs.nlp.embeddings.WordEmbeddingsModel.withCoverageColumn", dataset._jdf, embeddings_col, output_col)
| ExtendedJavaWrapper):
def __init__(self, dataset, embeddings_col):
super(_EmbeddingsOverallCoverage, self).__init__("com.johnsnowlabs.nlp.embeddings.WordEmbeddingsModel.overallCoverage", dataset._jdf, embeddings_col)
class _EmbeddingsCoverageColumn(ExtendedJavaWrapper):
| 64 | 64 | 66 | 11 | 53 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _EmbeddingsCoverageColumn | _EmbeddingsCoverageColumn | 266 | 268 | 266 | 266 | 2740a444e7e625ee6c35da778d63c75093517f7a | bigcode/the-stack | train |
c09a72042ac1a56343ffc19f | train | class | class _ExternalResource(ExtendedJavaWrapper):
def __init__(self, path, read_as, options):
super(_ExternalResource, self).__init__("com.johnsnowlabs.nlp.util.io.ExternalResource.fromJava", path, read_as, options)
| class _ExternalResource(ExtendedJavaWrapper):
| def __init__(self, path, read_as, options):
super(_ExternalResource, self).__init__("com.johnsnowlabs.nlp.util.io.ExternalResource.fromJava", path, read_as, options)
| .java.lang.Integer)
return java_array
class _RegexRule(ExtendedJavaWrapper):
def __init__(self, rule, identifier):
super(_RegexRule, self).__init__("com.johnsnowlabs.nlp.util.regex.RegexRule", rule, identifier)
class _ExternalResource(ExtendedJavaWrapper):
| 64 | 64 | 54 | 9 | 55 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _ExternalResource | _ExternalResource | 179 | 181 | 179 | 179 | 773d39c65db4554af6edcb8a74875ac7d2056945 | bigcode/the-stack | train |
36c9097eb2300738bc9e472c | train | class | class AnnotatorJavaMLReader(JavaMLReader):
@classmethod
def _java_loader_class(cls, clazz):
if hasattr(clazz, '_java_class_name') and clazz._java_class_name is not None:
return clazz._java_class_name
else:
return JavaMLReader._java_loader_class(clazz)
| class AnnotatorJavaMLReader(JavaMLReader):
@classmethod
| def _java_loader_class(cls, clazz):
if hasattr(clazz, '_java_class_name') and clazz._java_class_name is not None:
return clazz._java_class_name
else:
return JavaMLReader._java_loader_class(clazz)
| ), v)
return self
return r
class AnnotatorJavaMLReadable(JavaMLReadable):
@classmethod
def read(cls):
"""Returns an MLReader instance for this class."""
return AnnotatorJavaMLReader(cls())
class AnnotatorJavaMLReader(JavaMLReader):
@classmethod
| 64 | 64 | 66 | 14 | 50 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | AnnotatorJavaMLReader | AnnotatorJavaMLReader | 69 | 75 | 69 | 70 | 2f0a24c960962628630dd9dbdfd790c073129dcb | bigcode/the-stack | train |
99bb56ee7c3e8a47bd2c5e22 | train | class | class AnnotatorJavaMLReadable(JavaMLReadable):
@classmethod
def read(cls):
"""Returns an MLReader instance for this class."""
return AnnotatorJavaMLReader(cls())
| class AnnotatorJavaMLReadable(JavaMLReadable):
@classmethod
| def read(cls):
"""Returns an MLReader instance for this class."""
return AnnotatorJavaMLReader(cls())
| (paramName)
except KeyError:
return None
return r
def setParamValue(self, paramName):
def r(v):
self.set(self.getParam(paramName), v)
return self
return r
class AnnotatorJavaMLReadable(JavaMLReadable):
@classmethod
| 64 | 64 | 39 | 14 | 49 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | AnnotatorJavaMLReadable | AnnotatorJavaMLReadable | 62 | 66 | 62 | 63 | 49484c55e0742b48765567ff7ec28ab4a99de941 | bigcode/the-stack | train |
c57b56c83f22149ab6ac9d45 | train | class | class _DistilBertLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_DistilBertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.DistilBertEmbeddings.loadSavedModel", path, jspark)
| class _DistilBertLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_DistilBertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.DistilBertEmbeddings.loadSavedModel", path, jspark)
| JavaWrapper):
def __init__(self, path, jspark):
super(_MarianLoader, self).__init__(
"com.johnsnowlabs.nlp.annotators.seq2seq.MarianTransformer.loadSavedModel", path, jspark)
class _DistilBertLoader(ExtendedJavaWrapper):
| 64 | 64 | 62 | 12 | 52 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _DistilBertLoader | _DistilBertLoader | 318 | 320 | 318 | 318 | 27e598f7e1f901c0c3de2b48ea44f7f1387717a4 | bigcode/the-stack | train |
dd210ded158fcf575b8d0f7d | train | class | class _ClearCache(ExtendedJavaWrapper):
def __init__(self, name, language, remote_loc):
super(_ClearCache, self).__init__("com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.clearCache", name, language, remote_loc)
| class _ClearCache(ExtendedJavaWrapper):
| def __init__(self, name, language, remote_loc):
super(_ClearCache, self).__init__("com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.clearCache", name, language, remote_loc)
| _DownloadPipeline(ExtendedJavaWrapper):
def __init__(self, name, language, remote_loc):
super(_DownloadPipeline, self).__init__("com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.downloadPipeline", name, language, remote_loc)
class _ClearCache(ExtendedJavaWrapper):
| 64 | 64 | 56 | 9 | 55 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _ClearCache | _ClearCache | 199 | 201 | 199 | 199 | 60d850fa34de8447298df8f23e81b3ca0dc14853 | bigcode/the-stack | train |
abb1ff8c83437a955d7f261d | train | class | class _RegexRule(ExtendedJavaWrapper):
def __init__(self, rule, identifier):
super(_RegexRule, self).__init__("com.johnsnowlabs.nlp.util.regex.RegexRule", rule, identifier)
| class _RegexRule(ExtendedJavaWrapper):
| def __init__(self, rule, identifier):
super(_RegexRule, self).__init__("com.johnsnowlabs.nlp.util.regex.RegexRule", rule, identifier)
| _array(pylist, self.sc._gateway.jvm.java.lang.String)
return java_array
def new_java_array_integer(self, pylist):
java_array = self._new_java_array(pylist, self.sc._gateway.jvm.java.lang.Integer)
return java_array
class _RegexRule(ExtendedJavaWrapper):
| 64 | 64 | 46 | 9 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _RegexRule | _RegexRule | 174 | 176 | 174 | 174 | 4bd2c030f4ae1f79c9dad06412b189c8c88c690a | bigcode/the-stack | train |
c0b05d0a04f1c9fa061dc118 | train | class | class _LightPipeline(ExtendedJavaWrapper):
def __init__(self, pipelineModel, parse_embeddings):
super(_LightPipeline, self).__init__("com.johnsnowlabs.nlp.LightPipeline", pipelineModel._to_java(), parse_embeddings)
| class _LightPipeline(ExtendedJavaWrapper):
| def __init__(self, pipelineModel, parse_embeddings):
super(_LightPipeline, self).__init__("com.johnsnowlabs.nlp.LightPipeline", pipelineModel._to_java(), parse_embeddings)
| ohnsnowlabs.nlp.pretrained.PythonResourceDownloader.showPublicModels")
# predefined pipelines
class _DownloadPredefinedPipeline(ExtendedJavaWrapper):
def __init__(self, java_path):
super(_DownloadPredefinedPipeline, self).__init__(java_path)
class _LightPipeline(ExtendedJavaWrapper):
| 64 | 64 | 51 | 9 | 55 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _LightPipeline | _LightPipeline | 234 | 236 | 234 | 234 | 2815d847ce38c341511cd73320fb02a2e34d2ecd | bigcode/the-stack | train |
422e6c803fd3a4504a923755 | train | class | class _DownloadModel(ExtendedJavaWrapper):
def __init__(self, reader, name, language, remote_loc, validator):
super(_DownloadModel, self).__init__("com.johnsnowlabs.nlp.pretrained."+validator+".downloadModel", reader, name, language, remote_loc)
| class _DownloadModel(ExtendedJavaWrapper):
| def __init__(self, reader, name, language, remote_loc, validator):
super(_DownloadModel, self).__init__("com.johnsnowlabs.nlp.pretrained."+validator+".downloadModel", reader, name, language, remote_loc)
| p.util.io.ExternalResource.fromJava", path, read_as, options)
class _ConfigLoaderGetter(ExtendedJavaWrapper):
def __init__(self):
super(_ConfigLoaderGetter, self).__init__("com.johnsnowlabs.util.ConfigLoader.getConfigPath")
class _DownloadModel(ExtendedJavaWrapper):
| 64 | 64 | 61 | 9 | 55 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _DownloadModel | _DownloadModel | 189 | 191 | 189 | 189 | 7a1047ca11f9d6ecbdf215840feedf7ce4980787 | bigcode/the-stack | train |
5a6d5e1ed1d6fc66b4d1a58d | train | class | class AnnotatorTransformer(JavaTransformer, AnnotatorJavaMLReadable, JavaMLWritable, ParamsGettersSetters):
@keyword_only
def __init__(self, classname):
super(AnnotatorTransformer, self).__init__()
kwargs = self._input_kwargs
if 'classname' in kwargs:
kwargs.pop('classname')
... | class AnnotatorTransformer(JavaTransformer, AnnotatorJavaMLReadable, JavaMLWritable, ParamsGettersSetters):
@keyword_only
| def __init__(self, classname):
super(AnnotatorTransformer, self).__init__()
kwargs = self._input_kwargs
if 'classname' in kwargs:
kwargs.pop('classname')
self.setParams(**kwargs)
self.__class__._java_class_name = classname
self._java_obj = self._new_java_o... | java_class_name') and clazz._java_class_name is not None:
return clazz._java_class_name
else:
return JavaMLReader._java_loader_class(clazz)
class AnnotatorTransformer(JavaTransformer, AnnotatorJavaMLReadable, JavaMLWritable, ParamsGettersSetters):
@keyword_only
| 64 | 64 | 106 | 28 | 36 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | AnnotatorTransformer | AnnotatorTransformer | 78 | 87 | 78 | 79 | 06780f68f81a1ea19c1c2f373230c7a839f8c81c | bigcode/the-stack | train |
a7ff013b3791d1cfd16e1cb5 | train | class | class _GetResourceSize(ExtendedJavaWrapper):
def __init__(self, name, language, remote_loc):
super(_GetResourceSize, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.getDownloadSize", name, language, remote_loc)
| class _GetResourceSize(ExtendedJavaWrapper):
| def __init__(self, name, language, remote_loc):
super(_GetResourceSize, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.getDownloadSize", name, language, remote_loc)
| ClearCache(ExtendedJavaWrapper):
def __init__(self, name, language, remote_loc):
super(_ClearCache, self).__init__("com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.clearCache", name, language, remote_loc)
class _GetResourceSize(ExtendedJavaWrapper):
| 64 | 64 | 61 | 10 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _GetResourceSize | _GetResourceSize | 204 | 207 | 204 | 204 | 3a6d8b69c6fd845261c4f66c458515e28daf7273 | bigcode/the-stack | train |
3a972a6eb645227a6eb58a27 | train | class | class _USELoader(ExtendedJavaWrapper):
def __init__(self, path, jspark, loadsp):
super(_USELoader, self).__init__("com.johnsnowlabs.nlp.embeddings.UniversalSentenceEncoder.loadSavedModel", path, jspark, loadsp)
| class _USELoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark, loadsp):
super(_USELoader, self).__init__("com.johnsnowlabs.nlp.embeddings.UniversalSentenceEncoder.loadSavedModel", path, jspark, loadsp)
| ertSentenceLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_BertSentenceLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.BertSentenceEmbeddings.loadSavedModel", path, jspark)
class _USELoader(ExtendedJavaWrapper):
| 64 | 64 | 59 | 9 | 55 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _USELoader | _USELoader | 286 | 288 | 286 | 286 | a23c69fd9dc984fcf9fa00a36206fb2328058999 | bigcode/the-stack | train |
3a64fc0362fddd6ac46fb121 | train | class | class _ShowUnCategorizedResources(ExtendedJavaWrapper):
def __init__(self):
super(_ShowUnCategorizedResources, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showUnCategorizedResources")
| class _ShowUnCategorizedResources(ExtendedJavaWrapper):
| def __init__(self):
super(_ShowUnCategorizedResources, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showUnCategorizedResources")
| ):
def __init__(self, name, language, remote_loc):
super(_GetResourceSize, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.getDownloadSize", name, language, remote_loc)
class _ShowUnCategorizedResources(ExtendedJavaWrapper):
| 64 | 64 | 53 | 12 | 52 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _ShowUnCategorizedResources | _ShowUnCategorizedResources | 210 | 213 | 210 | 210 | 96aeb4c6eb557b9dafc046f250058af00e08411a | bigcode/the-stack | train |
2f053de83decfbc2248ba196 | train | class | class _XlmRoBertaLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_XlmRoBertaLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.XlmRoBertaEmbeddings.loadSavedModel", path, jspark)
| class _XlmRoBertaLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_XlmRoBertaLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.XlmRoBertaEmbeddings.loadSavedModel", path, jspark)
| JavaWrapper):
def __init__(self, path, jspark):
super(_RoBertaLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.RoBertaEmbeddings.loadSavedModel", path, jspark)
class _XlmRoBertaLoader(ExtendedJavaWrapper):
| 64 | 64 | 64 | 13 | 51 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _XlmRoBertaLoader | _XlmRoBertaLoader | 328 | 330 | 328 | 328 | 6c9a5e9166d1ac9fe09f2a8aa062d1b295b80e31 | bigcode/the-stack | train |
beb119887507bd73ae08540a | train | class | class _ElmoLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_ElmoLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.ElmoEmbeddings.loadSavedModel", path, jspark)
| class _ElmoLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_ElmoLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.ElmoEmbeddings.loadSavedModel", path, jspark)
| ExtendedJavaWrapper):
def __init__(self, path, jspark, loadsp):
super(_USELoader, self).__init__("com.johnsnowlabs.nlp.embeddings.UniversalSentenceEncoder.loadSavedModel", path, jspark, loadsp)
class _ElmoLoader(ExtendedJavaWrapper):
| 64 | 64 | 55 | 10 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _ElmoLoader | _ElmoLoader | 291 | 293 | 291 | 291 | 3832c8d233597bf34a488395b26e073187b6a6f6 | bigcode/the-stack | train |
5f7ba478fcf4339c03a2cf9d | train | class | class _XlnetLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_XlnetLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.XlnetEmbeddings.loadSavedModel", path, jspark)
| class _XlnetLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_XlnetLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.XlnetEmbeddings.loadSavedModel", path, jspark)
| class _AlbertLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_AlbertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.AlbertEmbeddings.loadSavedModel", path, jspark)
class _XlnetLoader(ExtendedJavaWrapper):
| 64 | 64 | 58 | 11 | 53 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _XlnetLoader | _XlnetLoader | 301 | 303 | 301 | 301 | dc1e7adfc6a9fc6614aee276327cd0030d653e5d | bigcode/the-stack | train |
27209df466cf9f94f8a4857a | train | class | class _DownloadPipeline(ExtendedJavaWrapper):
def __init__(self, name, language, remote_loc):
super(_DownloadPipeline, self).__init__("com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.downloadPipeline", name, language, remote_loc)
| class _DownloadPipeline(ExtendedJavaWrapper):
| def __init__(self, name, language, remote_loc):
super(_DownloadPipeline, self).__init__("com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.downloadPipeline", name, language, remote_loc)
| JavaWrapper):
def __init__(self, reader, name, language, remote_loc, validator):
super(_DownloadModel, self).__init__("com.johnsnowlabs.nlp.pretrained."+validator+".downloadModel", reader, name, language, remote_loc)
class _DownloadPipeline(ExtendedJavaWrapper):
| 64 | 64 | 56 | 9 | 55 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _DownloadPipeline | _DownloadPipeline | 194 | 196 | 194 | 194 | 94c48c84eba9fd7682a5edde827a9807276d39ee | bigcode/the-stack | train |
f8f27fdf5219518eeac3c61e | train | class | class _ShowPublicModels(ExtendedJavaWrapper):
def __init__(self):
super(_ShowPublicModels, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showPublicModels")
| class _ShowPublicModels(ExtendedJavaWrapper):
| def __init__(self):
super(_ShowPublicModels, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showPublicModels")
| CategorizedResources")
class _ShowPublicPipelines(ExtendedJavaWrapper):
def __init__(self):
super(_ShowPublicPipelines, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showPublicPipelines")
class _ShowPublicModels(ExtendedJavaWrapper):
| 64 | 64 | 47 | 10 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _ShowPublicModels | _ShowPublicModels | 222 | 225 | 222 | 222 | 7b54d2c222c8e970df2f7b5b5db535ef5f8c24d6 | bigcode/the-stack | train |
d2ae7d3549d8c94d9b5fe400 | train | class | class _CoNLLGeneratorExport(ExtendedJavaWrapper):
def __init__(self, spark, target, pipeline, output_path):
if type(pipeline) == PipelineModel:
pipeline = pipeline._to_java()
if type(target) == DataFrame:
super(_CoNLLGeneratorExport, self).__init__("com.johnsnowlabs.util.CoNL... | class _CoNLLGeneratorExport(ExtendedJavaWrapper):
| def __init__(self, spark, target, pipeline, output_path):
if type(pipeline) == PipelineModel:
pipeline = pipeline._to_java()
if type(target) == DataFrame:
super(_CoNLLGeneratorExport, self).__init__("com.johnsnowlabs.util.CoNLLGenerator.exportConllFiles", target._jdf, pipelin... | init__(self, path, spark, database, storage_ref, within_storage):
super(_StorageHelper, self).__init__("com.johnsnowlabs.storage.StorageHelper.load", path, spark._jsparkSession, database, storage_ref, within_storage)
class _CoNLLGeneratorExport(ExtendedJavaWrapper):
| 64 | 64 | 182 | 12 | 52 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _CoNLLGeneratorExport | _CoNLLGeneratorExport | 248 | 258 | 248 | 248 | 604ea5bc4e61dbf4176c789ec687f032f8f9201e | bigcode/the-stack | train |
cac55b876f66abf191bbe65d | train | class | class _EmbeddingsOverallCoverage(ExtendedJavaWrapper):
def __init__(self, dataset, embeddings_col):
super(_EmbeddingsOverallCoverage, self).__init__("com.johnsnowlabs.nlp.embeddings.WordEmbeddingsModel.overallCoverage", dataset._jdf, embeddings_col)
| class _EmbeddingsOverallCoverage(ExtendedJavaWrapper):
| def __init__(self, dataset, embeddings_col):
super(_EmbeddingsOverallCoverage, self).__init__("com.johnsnowlabs.nlp.embeddings.WordEmbeddingsModel.overallCoverage", dataset._jdf, embeddings_col)
| , target, pipeline, output_path)
def __init__(self, dataframe, output_path):
super(_CoNLLGeneratorExport, self).__init__("com.johnsnowlabs.util.CoNLLGenerator.exportConllFiles", dataframe, output_path)
class _EmbeddingsOverallCoverage(ExtendedJavaWrapper):
| 64 | 64 | 60 | 11 | 53 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _EmbeddingsOverallCoverage | _EmbeddingsOverallCoverage | 261 | 263 | 261 | 261 | bb9b4f7d3d97d2e367f80d4513436501c9c40b9f | bigcode/the-stack | train |
da099f48b16b3cbf56668f6e | train | class | class _ConfigLoaderGetter(ExtendedJavaWrapper):
def __init__(self):
super(_ConfigLoaderGetter, self).__init__("com.johnsnowlabs.util.ConfigLoader.getConfigPath")
| class _ConfigLoaderGetter(ExtendedJavaWrapper):
| def __init__(self):
super(_ConfigLoaderGetter, self).__init__("com.johnsnowlabs.util.ConfigLoader.getConfigPath")
| class _ExternalResource(ExtendedJavaWrapper):
def __init__(self, path, read_as, options):
super(_ExternalResource, self).__init__("com.johnsnowlabs.nlp.util.io.ExternalResource.fromJava", path, read_as, options)
class _ConfigLoaderGetter(ExtendedJavaWrapper):
| 64 | 64 | 40 | 10 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _ConfigLoaderGetter | _ConfigLoaderGetter | 184 | 186 | 184 | 184 | 164cb5459acebfdcae2a1e1d2f153b71fda329a0 | bigcode/the-stack | train |
54d46bb6704e50b924265fde | train | class | class _MarianLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_MarianLoader, self).__init__(
"com.johnsnowlabs.nlp.annotators.seq2seq.MarianTransformer.loadSavedModel", path, jspark)
| class _MarianLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_MarianLoader, self).__init__(
"com.johnsnowlabs.nlp.annotators.seq2seq.MarianTransformer.loadSavedModel", path, jspark)
| (ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_T5Loader, self).__init__(
"com.johnsnowlabs.nlp.annotators.seq2seq.T5Transformer.loadSavedModel", path, jspark)
class _MarianLoader(ExtendedJavaWrapper):
| 64 | 64 | 59 | 10 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _MarianLoader | _MarianLoader | 312 | 315 | 312 | 312 | 64cc6e5aad27f6c955cad4ef8e8a9f30443ad880 | bigcode/the-stack | train |
fab7d0533954827c926122e0 | train | class | class ParamsGettersSetters(Params):
getter_attrs = []
def __init__(self):
super(ParamsGettersSetters, self).__init__()
for param in self.params:
param_name = param.name
fg_attr = "get" + re.sub(r"(?:^|_)(.)", lambda m: m.group(1).upper(), param_name)
fs_attr ... | class ParamsGettersSetters(Params):
| getter_attrs = []
def __init__(self):
super(ParamsGettersSetters, self).__init__()
for param in self.params:
param_name = param.name
fg_attr = "get" + re.sub(r"(?:^|_)(.)", lambda m: m.group(1).upper(), param_name)
fs_attr = "set" + re.sub(r"(?:^|_)(.)", lamb... | .ml.wrapper import JavaWrapper, JavaTransformer, JavaEstimator, JavaModel
from pyspark.ml.util import JavaMLWritable, JavaMLReadable, JavaMLReader
from pyspark.sql.dataframe import DataFrame
from pyspark.ml.param.shared import Params
import re
# Helper class used to generate the getters for all params
class ParamsGet... | 76 | 76 | 254 | 9 | 66 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | ParamsGettersSetters | ParamsGettersSetters | 28 | 59 | 28 | 28 | 9f6869534e1a69f2fe29f27114691014789e9112 | bigcode/the-stack | train |
da3b6f7e04a1365e93b3ed55 | train | class | class _RoBertaLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_RoBertaLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.RoBertaEmbeddings.loadSavedModel", path, jspark)
| class _RoBertaLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_RoBertaLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.RoBertaEmbeddings.loadSavedModel", path, jspark)
| JavaWrapper):
def __init__(self, path, jspark):
super(_DistilBertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.DistilBertEmbeddings.loadSavedModel", path, jspark)
class _RoBertaLoader(ExtendedJavaWrapper):
| 64 | 64 | 59 | 11 | 53 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _RoBertaLoader | _RoBertaLoader | 323 | 325 | 323 | 323 | 94c14edff358ecf9df46a2d4a2b7d171218718c8 | bigcode/the-stack | train |
0af3b570e5ba7ce03e54cbc2 | train | class | class RecursiveTransformer(JavaModel):
def _transform_recursive(self, dataset, recursive_pipeline):
self._transfer_params_to_java()
return DataFrame(self._java_obj.recursiveTransform(dataset._jdf, recursive_pipeline._to_java()), dataset.sql_ctx)
def transform_recursive(self, dataset, recursive... | class RecursiveTransformer(JavaModel):
| def _transform_recursive(self, dataset, recursive_pipeline):
self._transfer_params_to_java()
return DataFrame(self._java_obj.recursiveTransform(dataset._jdf, recursive_pipeline._to_java()), dataset.sql_ctx)
def transform_recursive(self, dataset, recursive_pipeline, params=None):
if para... | )._fit(dataset, pipeline=pipeline)
else:
return self._fit(dataset, pipeline=pipeline)
else:
raise ValueError("Params must be either a param map or a list/tuple of param maps, "
"but got %s." % type(params))
class RecursiveTransformer(JavaModel... | 64 | 64 | 138 | 6 | 58 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | RecursiveTransformer | RecursiveTransformer | 122 | 137 | 122 | 123 | 7d3fbe3d2f0b0faf39724de4868304150eb55bb4 | bigcode/the-stack | train |
16bd2ae39019ea5b2d74cebb | train | class | class _AlbertLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_AlbertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.AlbertEmbeddings.loadSavedModel", path, jspark)
| class _AlbertLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_AlbertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.AlbertEmbeddings.loadSavedModel", path, jspark)
| class _ElmoLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_ElmoLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.ElmoEmbeddings.loadSavedModel", path, jspark)
class _AlbertLoader(ExtendedJavaWrapper):
| 64 | 64 | 53 | 9 | 55 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _AlbertLoader | _AlbertLoader | 296 | 298 | 296 | 296 | 5099345ae0d47c74df8b6571c848e07641cb66cd | bigcode/the-stack | train |
c113973b000cb6edc22ed2d2 | train | class | class _BertSentenceLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_BertSentenceLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.BertSentenceEmbeddings.loadSavedModel", path, jspark)
| class _BertSentenceLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_BertSentenceLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.BertSentenceEmbeddings.loadSavedModel", path, jspark)
| BertLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_BertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.BertEmbeddings.loadSavedModel", path, jspark)
class _BertSentenceLoader(ExtendedJavaWrapper):
| 64 | 64 | 58 | 11 | 53 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _BertSentenceLoader | _BertSentenceLoader | 281 | 283 | 281 | 281 | b8288da6e67ffbd9a22df7ea8acdd00f2df652e4 | bigcode/the-stack | train |
64e7f66e8c88994068ce6555 | train | class | class _CoverageResult(ExtendedJavaWrapper):
def __init__(self, covered, total, percentage):
super(_CoverageResult, self).__init__("com.johnsnowlabs.nlp.embeddings.CoverageResult", covered, total, percentage)
| class _CoverageResult(ExtendedJavaWrapper):
| def __init__(self, covered, total, percentage):
super(_CoverageResult, self).__init__("com.johnsnowlabs.nlp.embeddings.CoverageResult", covered, total, percentage)
| def __init__(self, dataset, embeddings_col, output_col):
super(_EmbeddingsCoverageColumn, self).__init__("com.johnsnowlabs.nlp.embeddings.WordEmbeddingsModel.withCoverageColumn", dataset._jdf, embeddings_col, output_col)
class _CoverageResult(ExtendedJavaWrapper):
| 64 | 64 | 52 | 9 | 55 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _CoverageResult | _CoverageResult | 271 | 273 | 271 | 271 | 107cf27e0fcf3affd983722594ad368aa5711232 | bigcode/the-stack | train |
97b7787eb098c7ee40b7c78f | train | class | class _DownloadPredefinedPipeline(ExtendedJavaWrapper):
def __init__(self, java_path):
super(_DownloadPredefinedPipeline, self).__init__(java_path)
| class _DownloadPredefinedPipeline(ExtendedJavaWrapper):
| def __init__(self, java_path):
super(_DownloadPredefinedPipeline, self).__init__(java_path)
| ipelines")
class _ShowPublicModels(ExtendedJavaWrapper):
def __init__(self):
super(_ShowPublicModels, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showPublicModels")
# predefined pipelines
class _DownloadPredefinedPipeline(ExtendedJavaWrapper):
| 64 | 64 | 36 | 11 | 52 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _DownloadPredefinedPipeline | _DownloadPredefinedPipeline | 229 | 231 | 229 | 229 | 7b1d7affb165a22b92ac2c4778d7db1aa9342dfd | bigcode/the-stack | train |
c17c0e9df07d6688bddbe1cb | train | class | class _BertLoader(ExtendedJavaWrapper):
def __init__(self, path, jspark):
super(_BertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.BertEmbeddings.loadSavedModel", path, jspark)
| class _BertLoader(ExtendedJavaWrapper):
| def __init__(self, path, jspark):
super(_BertLoader, self).__init__("com.johnsnowlabs.nlp.embeddings.BertEmbeddings.loadSavedModel", path, jspark)
| _col)
class _CoverageResult(ExtendedJavaWrapper):
def __init__(self, covered, total, percentage):
super(_CoverageResult, self).__init__("com.johnsnowlabs.nlp.embeddings.CoverageResult", covered, total, percentage)
class _BertLoader(ExtendedJavaWrapper):
| 64 | 64 | 55 | 10 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _BertLoader | _BertLoader | 276 | 278 | 276 | 276 | f1d784a11e4e4aac5086aac9b8dd690d5a910332 | bigcode/the-stack | train |
d050ff0ac1b02c0b45aeb7d6 | train | class | class _ShowPublicPipelines(ExtendedJavaWrapper):
def __init__(self):
super(_ShowPublicPipelines, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showPublicPipelines")
| class _ShowPublicPipelines(ExtendedJavaWrapper):
| def __init__(self):
super(_ShowPublicPipelines, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showPublicPipelines")
| class _ShowUnCategorizedResources(ExtendedJavaWrapper):
def __init__(self):
super(_ShowUnCategorizedResources, self).__init__(
"com.johnsnowlabs.nlp.pretrained.PythonResourceDownloader.showUnCategorizedResources")
class _ShowPublicPipelines(ExtendedJavaWrapper):
| 64 | 64 | 50 | 11 | 53 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _ShowPublicPipelines | _ShowPublicPipelines | 216 | 219 | 216 | 216 | 949fa404f93cd8f1b2d3e861bc624407190d8171 | bigcode/the-stack | train |
07ba763745b5b410a58e0d0c | train | class | class _StorageHelper(ExtendedJavaWrapper):
def __init__(self, path, spark, database, storage_ref, within_storage):
super(_StorageHelper, self).__init__("com.johnsnowlabs.storage.StorageHelper.load", path, spark._jsparkSession, database, storage_ref, within_storage)
| class _StorageHelper(ExtendedJavaWrapper):
| def __init__(self, path, spark, database, storage_ref, within_storage):
super(_StorageHelper, self).__init__("com.johnsnowlabs.storage.StorageHelper.load", path, spark._jsparkSession, database, storage_ref, within_storage)
| JavaWrapper):
def __init__(self, pipelineModel, parse_embeddings):
super(_LightPipeline, self).__init__("com.johnsnowlabs.nlp.LightPipeline", pipelineModel._to_java(), parse_embeddings)
# ==================
# Utils
# ==================
class _StorageHelper(ExtendedJavaWrapper):
| 63 | 64 | 64 | 9 | 54 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | _StorageHelper | _StorageHelper | 243 | 245 | 243 | 243 | d7946dca4d78ee64bf80248d3f0c93b0bb515cf6 | bigcode/the-stack | train |
2248b0488ff6d48784b3771f | train | class | class RecursiveEstimator(JavaEstimator, ABC):
def _fit_java(self, dataset, pipeline=None):
self._transfer_params_to_java()
if pipeline:
return self._java_obj.recursiveFit(dataset._jdf, pipeline._to_java())
else:
return self._java_obj.fit(dataset._jdf)
def _fit(s... | class RecursiveEstimator(JavaEstimator, ABC):
| def _fit_java(self, dataset, pipeline=None):
self._transfer_params_to_java()
if pipeline:
return self._java_obj.recursiveFit(dataset._jdf, pipeline._to_java())
else:
return self._java_obj.fit(dataset._jdf)
def _fit(self, dataset, pipeline=None):
java_mode... | AnnotatorTransformer, self).__init__()
kwargs = self._input_kwargs
if 'classname' in kwargs:
kwargs.pop('classname')
self.setParams(**kwargs)
self.__class__._java_class_name = classname
self._java_obj = self._new_java_obj(classname, self.uid)
class RecursiveEstimator(... | 74 | 74 | 249 | 8 | 66 | ramayer-fli/spark-nlp | python/sparknlp/internal.py | Python | RecursiveEstimator | RecursiveEstimator | 90 | 119 | 90 | 91 | 200139e821ca32d27d1cfc98e2f16a3f69d1d0c1 | bigcode/the-stack | train |
b27ddbeb93ef3b9c3eb9b730 | train | class | class PyMica:
'''Main project class. Calculates the regressions, corrects
them with the interpolated residuals and saves files and gives
errors.
'''
def __init__(self, data_file, variables_file,
clusters=None, data_format=None, residuals_int='id2d',
z_field='altitu... | class PyMica:
| '''Main project class. Calculates the regressions, corrects
them with the interpolated residuals and saves files and gives
errors.
'''
def __init__(self, data_file, variables_file,
clusters=None, data_format=None, residuals_int='id2d',
z_field='altitude'):
... | '''Main class. Calculates data fields from points, using
clusters multi-linear regressions corrected with residuals.
'''
import json
import gdal
import ogr
import osr
from numpy import concatenate, newaxis
from interpolation.idw import idw
from interpolation.inverse_distance import inverse_distance
from interpolation... | 117 | 256 | 1,328 | 5 | 112 | weatherai/pymica | pymica/pymica.py | Python | PyMica | PyMica | 20 | 173 | 20 | 20 | eeeb39509b225e9cbcde7e151d8e7a675ec0b28f | bigcode/the-stack | train |
5582a817103b26dc0e5c2293 | train | class | class DataSnapshotTestCase(TestCase):
def setUp(self):
self.key_1 = 'test_key_1'
self.key_2 = 'test_key_2'
self.not_exist_key = 'not_exist'
self.obj_1 = {'a': 'a', 1: '1', 2: '2', 'list': [1, 2, 3]}
self.obj_2 = [1, 5, 3]
self.obj_3 = [1, 2, 3]
def test_set_objec... | class DataSnapshotTestCase(TestCase):
| def setUp(self):
self.key_1 = 'test_key_1'
self.key_2 = 'test_key_2'
self.not_exist_key = 'not_exist'
self.obj_1 = {'a': 'a', 1: '1', 2: '2', 'list': [1, 2, 3]}
self.obj_2 = [1, 5, 3]
self.obj_3 = [1, 2, 3]
def test_set_object(self):
set_result = DataSnap... | 9 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distr... | 136 | 136 | 454 | 8 | 127 | gangh/bk-sops | pipeline/tests/engine/models/data/test_data_snapshot.py | Python | DataSnapshotTestCase | DataSnapshotTestCase | 18 | 61 | 18 | 18 | 4506d9293e84369712e51c6583ccc0ccbfc536b3 | bigcode/the-stack | train |
c47f3572c53fc51e34db1006 | train | function | def setup_package():
setup(
name = "plio",
version = '1.2.1',
author = "Jay Laura",
author_email = "jlaura@usgs.gov",
description = ("I/O API to support planetary data formats."),
long_description = long_description,
license = "Public Domain",
keywords... | def setup_package():
| setup(
name = "plio",
version = '1.2.1',
author = "Jay Laura",
author_email = "jlaura@usgs.gov",
description = ("I/O API to support planetary data formats."),
long_description = long_description,
license = "Public Domain",
keywords = "planetary io",
... | import os
from setuptools import setup, find_packages
#Grab the README.md for the long description
with open('README.md', 'r') as f:
long_description = f.read()
def setup_package():
| 44 | 91 | 306 | 4 | 40 | kaitlyndlee/plio | setup.py | Python | setup_package | setup_package | 8 | 48 | 8 | 8 | 492a752ee49cf076bd05ccc364befffcc15f83ef | bigcode/the-stack | train |
b06359211096b2663d499e5e | train | class | class RasterObjectBase:
"""
Abstract base class for raster objects.
"""
# These properties must be defined in the class that implements this ABC
tableName = None # Name of the table to which the raster column belongs
id = None # ID of the record containing the raster ... | class RasterObjectBase:
| """
Abstract base class for raster objects.
"""
# These properties must be defined in the class that implements this ABC
tableName = None # Name of the table to which the raster column belongs
id = None # ID of the record containing the raster column
rasterColumnN... | """
********************************************************************************
* Name: RasterObjectBase
* Author: Nathan Swain
* Created On: July 22, 2014
* Copyright: (c) Brigham Young University 2014
* License: BSD 2-Clause
********************************************************************************
"""
im... | 100 | 256 | 2,425 | 5 | 95 | Aquaveo/gsshapy | gsshapy/base/rast.py | Python | RasterObjectBase | RasterObjectBase | 19 | 246 | 19 | 19 | 4380eecac938a20f484d548836ec491416a6463d | bigcode/the-stack | train |
5189da854908fe887ffd4bcd | train | function | def ContainsElfMagic(file_path):
if os.path.getsize(file_path) < 4:
return False
try:
with open(file_path, 'rb') as f:
b = f.read(4)
return b == ELF_MAGIC
except IOError:
return False
| def ContainsElfMagic(file_path):
| if os.path.getsize(file_path) < 4:
return False
try:
with open(file_path, 'rb') as f:
b = f.read(4)
return b == ELF_MAGIC
except IOError:
return False
| constant
# controls how many lookups we do before restarting the process. 4000
# gives near peak performance without extreme memory usage.
ADDR2LINE_RECYCLE_LIMIT = 4000
ELF_MAGIC = b'\x7f\x45\x4c\x46'
def ContainsElfMagic(file_path):
| 64 | 64 | 62 | 7 | 57 | chromium/chromium | build/android/pylib/symbols/elf_symbolizer.py | Python | ContainsElfMagic | ContainsElfMagic | 32 | 40 | 32 | 32 | 04830d2bba094455255610211c126c9f7fa0ddec | bigcode/the-stack | train |
c8af24043f6388409b780bbb | train | class | class ELFSymbolizer:
"""An uber-fast (multiprocessing, pipelined and asynchronous) ELF symbolizer.
This class is a frontend for addr2line (part of GNU binutils), designed to
symbolize batches of large numbers of symbols for a given ELF file. It
supports sharding symbolization against many addr2line instances a... | class ELFSymbolizer:
| """An uber-fast (multiprocessing, pipelined and asynchronous) ELF symbolizer.
This class is a frontend for addr2line (part of GNU binutils), designed to
symbolize batches of large numbers of symbols for a given ELF file. It
supports sharding symbolization against many addr2line instances and
pipelining of mu... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import datetime
import logging
import multiprocessing
import os
import posixpath
try:
from queue import Empty, Queue
except ImportError:... | 247 | 256 | 4,476 | 6 | 240 | chromium/chromium | build/android/pylib/symbols/elf_symbolizer.py | Python | ELFSymbolizer | ELFSymbolizer | 43 | 477 | 43 | 43 | 83316e5795750d1820a6ab3178e7af1f56f7cfca | bigcode/the-stack | train |
c71efba34c070a3a1078cf0c | train | class | class ELFSymbolInfo:
"""The result of the symbolization passed as first arg. of each callback."""
def __init__(self, name, source_path, source_line, was_ambiguous=False,
disambiguated=False):
"""All the fields here can be None (if addr2line replies with '??')."""
self.name = name
self.so... | class ELFSymbolInfo:
| """The result of the symbolization passed as first arg. of each callback."""
def __init__(self, name, source_path, source_line, was_ambiguous=False,
disambiguated=False):
"""All the fields here can be None (if addr2line replies with '??')."""
self.name = name
self.source_path = source_pa... | except (IOError, OSError):
pass
@property
def first_request_id(self):
"""Returns the request_id of the oldest pending request in the queue."""
return self._request_queue[0][2] if self._request_queue else 0
class ELFSymbolInfo:
| 64 | 64 | 203 | 6 | 57 | chromium/chromium | build/android/pylib/symbols/elf_symbolizer.py | Python | ELFSymbolInfo | ELFSymbolInfo | 480 | 497 | 480 | 480 | 3789a747adc4143f7031f9c7a67e5d0145f3a1ec | bigcode/the-stack | train |
a48072c3bdeeba21ea5f3708 | train | class | class WhiteIpListRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Dts', '2020-01-01', 'WhiteIpList','dts')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
if hasattr(self, "endpoint_regional"):
setattr(self, "e... | class WhiteIpListRequest(RpcRequest):
| def __init__(self):
RpcRequest.__init__(self, 'Dts', '2020-01-01', 'WhiteIpList','dts')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
if hasattr(self, "endpoint_regional"):
setattr(self, "endpoint_regional", endpoint_data.getEnd... | IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from aliyunsdkcore.request import RpcRequest
from aliyunsdkdts.endpoint import endpoint_data
class WhiteIpListRequest(RpcRequest... | 69 | 69 | 233 | 9 | 59 | yndu13/aliyun-openapi-python-sdk | aliyun-python-sdk-dts/aliyunsdkdts/request/v20200101/WhiteIpListRequest.py | Python | WhiteIpListRequest | WhiteIpListRequest | 23 | 48 | 23 | 24 | 6f2a3fe548f46f0aba00004606563977e88b76e9 | bigcode/the-stack | train |
49bc73db83ffdcd7fcd81cd8 | train | function | def create(data):
print('bucket_data.create started', data)
print('using bucket', bucket.name)
key = str(uuid.uuid4())
print('bucket_data.create generated key', key)
object = bucket.Object(key)
object.put(Body=json.dumps(data))
print('bucket_create.create succeeded', key)... | def create(data):
| print('bucket_data.create started', data)
print('using bucket', bucket.name)
key = str(uuid.uuid4())
print('bucket_data.create generated key', key)
object = bucket.Object(key)
object.put(Body=json.dumps(data))
print('bucket_create.create succeeded', key)
return key
| if start:
args['Marker'] = start
summaries = bucket.objects.filter(**args)
if count:
summaries = summaries.limit(count)
result = [ summary.key for summary in summaries ]
print('bucket_data.list succeeded', result)
return result
def create(data):
| 64 | 64 | 76 | 5 | 58 | brianherrera/lumberyard | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/initial-gem-content/api-lambda-bucket/lambda-code/ServiceLambda/bucket_data.py | Python | create | create | 36 | 48 | 36 | 37 | 1ed953c31fa9d2e5ca3a8ed758b62952ad081ded | bigcode/the-stack | train |
0dec1e583b90f9338a5685b9 | train | function | def update(key, data):
print('bucket_data.update started', key, data)
print('using bucket', bucket.name)
object = bucket.Object(key)
try:
object.load() # verify it exists
except botocore.exceptions.ClientError as e:
if e.response.get('Error', {}).get('Code') ... | def update(key, data):
| print('bucket_data.update started', key, data)
print('using bucket', bucket.name)
object = bucket.Object(key)
try:
object.load() # verify it exists
except botocore.exceptions.ClientError as e:
if e.response.get('Error', {}).get('Code') == '404':
... | Error as e:
if e.response.get('Error', {}).get('Code') == 'NoSuchKey':
print('bucket_data.read failed: data not found')
return None
else:
print('bucket_data.read failed:', e)
raise
def update(key, data):
| 64 | 64 | 134 | 6 | 57 | brianherrera/lumberyard | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/initial-gem-content/api-lambda-bucket/lambda-code/ServiceLambda/bucket_data.py | Python | update | update | 80 | 105 | 80 | 81 | 14ac0c03181bb86a268a44b92ae5e1850f753d0a | bigcode/the-stack | train |
a77a6a13ad3c6e612985bdfc | train | function | def list(start = None, count = None):
print('bucket_data.list started', start, count)
print('using bucket', bucket.name)
args = {}
if start:
args['Marker'] = start
summaries = bucket.objects.filter(**args)
if count:
summaries = summaries.limit(count)
r... | def list(start = None, count = None):
| print('bucket_data.list started', start, count)
print('using bucket', bucket.name)
args = {}
if start:
args['Marker'] = start
summaries = bucket.objects.filter(**args)
if count:
summaries = summaries.limit(count)
result = [ summary.key for summary in su... | .exceptions
from botocore.client import Config
import CloudCanvas
bucket_name = CloudCanvas.get_setting('Bucket')
s3 = boto3.resource('s3', config=Config(signature_version='s3v4'))
bucket = s3.Bucket(bucket_name)
def list(start = None, count = None):
| 64 | 64 | 95 | 10 | 54 | brianherrera/lumberyard | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/initial-gem-content/api-lambda-bucket/lambda-code/ServiceLambda/bucket_data.py | Python | list | list | 17 | 33 | 17 | 18 | 13c07a42047277cb3dc15a12dcb2528ec79ad320 | bigcode/the-stack | train |
47cedd15c2718077967614c7 | train | function | def delete(key):
print('bucket_data.delete started', key)
print('using bucket', bucket.name)
object = bucket.Object(key)
try:
object.delete()
print('bucket_data.delete succeeded')
return True
except botocore.exceptions.ClientError as e:
if... | def delete(key):
| print('bucket_data.delete started', key)
print('using bucket', bucket.name)
object = bucket.Object(key)
try:
object.delete()
print('bucket_data.delete succeeded')
return True
except botocore.exceptions.ClientError as e:
if e.response.get('... | '404':
print('bucket_data.update failed: data not found')
return False
else:
print('bucket_data.update failed:', e)
raise
object.put(Body=json.dumps(data))
print('bucket_data.update succeeded')
... | 64 | 64 | 117 | 4 | 59 | brianherrera/lumberyard | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/initial-gem-content/api-lambda-bucket/lambda-code/ServiceLambda/bucket_data.py | Python | delete | delete | 108 | 130 | 108 | 109 | c2929fc09ace03e12afdbdd9b46bcb04241b62bd | bigcode/the-stack | train |
eec217924eb4537dd107ae62 | train | function | def read(key):
print('bucket_data.read started', key)
print('using bucket', bucket.name)
object = bucket.Object(key)
try:
content = object.get()['Body'].read()
print('bucket_data.read content', content)
result = json.loads(content)
print('bucket_data.r... | def read(key):
| print('bucket_data.read started', key)
print('using bucket', bucket.name)
object = bucket.Object(key)
try:
content = object.get()['Body'].read()
print('bucket_data.read content', content)
result = json.loads(content)
print('bucket_data.read json', resul... | print('using bucket', bucket.name)
key = str(uuid.uuid4())
print('bucket_data.create generated key', key)
object = bucket.Object(key)
object.put(Body=json.dumps(data))
print('bucket_create.create succeeded', key)
return key
def read(key):
| 64 | 64 | 143 | 4 | 59 | brianherrera/lumberyard | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/initial-gem-content/api-lambda-bucket/lambda-code/ServiceLambda/bucket_data.py | Python | read | read | 51 | 77 | 51 | 52 | 9c57bb4ce95b2e2f3d27cb35c974798af51ad044 | bigcode/the-stack | train |
08b075c873b79ffdd75d8c24 | train | class | class QueueRunner(Component):
"""
A queue runner that contains n sub-components, of which an API-method is called. The return values are bundled
into a FIFOQueue as inputs. Queue runner uses multi-threading and is started after session creation.
API:
enqueue() -> Returns a noop, but creates the enq... | class QueueRunner(Component):
| """
A queue runner that contains n sub-components, of which an API-method is called. The return values are bundled
into a FIFOQueue as inputs. Queue runner uses multi-threading and is started after session creation.
API:
enqueue() -> Returns a noop, but creates the enqueue ops for enqueuing data in... | # Copyright 2018/2019 The RLgraph authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 217 | 256 | 888 | 5 | 211 | theSoenke/rlgraph | rlgraph/components/memories/queue_runner.py | Python | QueueRunner | QueueRunner | 29 | 118 | 29 | 29 | 1b1ffc4e2d643edcc4391768348b9d6cca9b0dd4 | bigcode/the-stack | train |
735ee5f4cbf746a77fadf7eb | train | function | def get_personal_data() -> dict:
"""
:return: Returns a dictionary of personal information.
"""
personal_data = {"name": "Jim", "a_role": "teacher"}
return personal_data
| def get_personal_data() -> dict:
| """
:return: Returns a dictionary of personal information.
"""
personal_data = {"name": "Jim", "a_role": "teacher"}
return personal_data
| def get_personal_data() -> dict:
| 9 | 64 | 46 | 9 | 0 | LoganKoch17/Projects | In Class Work/dictionaries.py | Python | get_personal_data | get_personal_data | 1 | 6 | 1 | 1 | ead7e335e3e850d1fad20055a1fc2b7d4bd26782 | bigcode/the-stack | train |
e36d4c73505471d1a6be8ec1 | train | function | def main() -> int:
default_dict = dict()
print(default_dict)
initialized_dict = dict([('name','Jim'), ('a_role','joker')])
print(initialized_dict)
simple_init_dict = dict(name='Jim', a_role='teacher')
print(simple_init_dict)
simple_init_dict['a_role'] = 'joker'
print(simple_init_dict)
... | def main() -> int:
| default_dict = dict()
print(default_dict)
initialized_dict = dict([('name','Jim'), ('a_role','joker')])
print(initialized_dict)
simple_init_dict = dict(name='Jim', a_role='teacher')
print(simple_init_dict)
simple_init_dict['a_role'] = 'joker'
print(simple_init_dict)
my_comprehension ... | def get_personal_data() -> dict:
"""
:return: Returns a dictionary of personal information.
"""
personal_data = {"name": "Jim", "a_role": "teacher"}
return personal_data
def main() -> int:
| 52 | 64 | 125 | 6 | 45 | LoganKoch17/Projects | In Class Work/dictionaries.py | Python | main | main | 9 | 24 | 9 | 9 | 90d589e0b83f83ead103c2b6ae8164a7a711b40f | bigcode/the-stack | train |
dd4a8fb6a590a510e9ff4074 | train | class | class TransformerDecoder(nn.Module):
def __init__(self, output_size, d_model=256, attention_heads=4, linear_units=2048, num_blocks=6, pos_dropout_rate=0.0,
slf_attn_dropout_rate=0.0, src_attn_dropout_rate=0.0, ffn_dropout_rate=0.0, residual_dropout_rate=0.1,
activation='relu', nor... | class TransformerDecoder(nn.Module):
| def __init__(self, output_size, d_model=256, attention_heads=4, linear_units=2048, num_blocks=6, pos_dropout_rate=0.0,
slf_attn_dropout_rate=0.0, src_attn_dropout_rate=0.0, ffn_dropout_rate=0.0, residual_dropout_rate=0.1,
activation='relu', normalize_before=True, concat_after=Fals... | import torch
import random
import torch.nn as nn
import torch.nn.functional as F
from otrans.utils import get_seq_mask, get_dec_seq_mask
from otrans.module import LayerNorm, PositionalEncoding
from otrans.layer import TransformerDecoderLayer, TransformerEncoderLayer
class TransformerDecoder(nn.Module):
| 64 | 157 | 525 | 6 | 57 | baozixifan/TransformerAndLm | otrans/decoder.py | Python | TransformerDecoder | TransformerDecoder | 10 | 69 | 10 | 10 | 2fa091d5872e68924648c8049c01f46b3c150ac5 | bigcode/the-stack | train |
fac1ca146d981bd0947aadf0 | train | class | class TestMinterTx(unittest.TestCase):
def setUp(self):
self.SIGNED_TX = 'f8900102018a4d4e540000000000000007b6f5a00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a438a4d4e5400000000000000888ac7230489e80000808001b845f8431ba01c2c8f702d80cf64da1e9bf1f07a52e2fee8721aebe419aa9f62260a98983f89a07e... | class TestMinterTx(unittest.TestCase):
| def setUp(self):
self.SIGNED_TX = 'f8900102018a4d4e540000000000000007b6f5a00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a438a4d4e5400000000000000888ac7230489e80000808001b845f8431ba01c2c8f702d80cf64da1e9bf1f07a52e2fee8721aebe419aa9f62260a98983f89a07ed297d71d9dc37a57ffe9bb16915dccc703d8c09f30... | """
@author: rymka1989
"""
import unittest
from mintersdk.sdk.transactions import (
MinterTx, MinterDelegateTx, MinterSendCoinTx, MinterBuyCoinTx,
MinterCreateCoinTx, MinterDeclareCandidacyTx, MinterEditCandidateTx,
MinterRedeemCheckTx, MinterSellAllCoinTx, MinterSellCoinTx,
MinterSetCandidateOf... | 124 | 126 | 420 | 9 | 115 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterTx | TestMinterTx | 14 | 38 | 14 | 15 | 63b30fe6a64942c3db0af1b71a30465f00cec738 | bigcode/the-stack | train |
193a39a89fa25479ab290dad | train | class | class TestMinterSetCandidateOffTx(unittest.TestCase):
def setUp(self):
self.PRIVATE_KEY = '05ddcd4e6f7d248ed1388f0091fe345bf9bf4fc2390384e26005e7675c98b3c1'
self.SIGNED_TX = 'f87c0102018a4d4e54000000000000000ba2e1a00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a43808001b845f8431c... | class TestMinterSetCandidateOffTx(unittest.TestCase):
| def setUp(self):
self.PRIVATE_KEY = '05ddcd4e6f7d248ed1388f0091fe345bf9bf4fc2390384e26005e7675c98b3c1'
self.SIGNED_TX = 'f87c0102018a4d4e54000000000000000ba2e1a00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a43808001b845f8431ca02ac45817f167c34b55b8afa0b6d9692be28e2aa41dd28a134663d1f... | Tx)
def test_sign_tx(self):
"""
Sign transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
self.assertEqual(self.TX.signed_tx, self.SIGNED_TX)
def test_from_raw(self):
tx = MinterTx.from_raw(self.SIGNED_TX)
self.asser... | 128 | 128 | 427 | 12 | 116 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterSetCandidateOffTx | TestMinterSetCandidateOffTx | 361 | 391 | 361 | 362 | c4b79429f01d5cd9e162b12c6e7e2262f641f284 | bigcode/the-stack | train |
c006dc97884903851b16fc02 | train | class | class TestMinterSellCoinTx(unittest.TestCase):
def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f8830102018a4d4e540000000000000002a9e88a4d4e54000000000000008... | class TestMinterSellCoinTx(unittest.TestCase):
| def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f8830102018a4d4e540000000000000002a9e88a4d4e5400000000000000880de0b6b3a76400008a54455354000000000000880de0b6b3a... | .TX, MinterSellAllCoinTx)
def test_sign_tx(self):
"""
Sign transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
self.assertEqual(self.TX.signed_tx, self.SIGNED_TX)
def test_from_raw(self):
tx = MinterTx.from_raw(raw_tx=self.SIG... | 151 | 151 | 505 | 11 | 140 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterSellCoinTx | TestMinterSellCoinTx | 280 | 318 | 280 | 281 | c45a970cdb14e271e820cfe6ce431b95419435be | bigcode/the-stack | train |
a44c44ef0a2bb1a12fcdc85d | train | class | class TestMinterDelegateTx(unittest.TestCase):
def setUp(self):
self.PRIVATE_KEY = '6e1df6ec69638d152f563c5eca6c13cdb5db4055861efc11ec1cdd578afd96bf'
self.PUBLIC_KEY = 'Mp0eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a43'
self.SIGNED_TX = 'f8900102018a4d4e540000000000000... | class TestMinterDelegateTx(unittest.TestCase):
| def setUp(self):
self.PRIVATE_KEY = '6e1df6ec69638d152f563c5eca6c13cdb5db4055861efc11ec1cdd578afd96bf'
self.PUBLIC_KEY = 'Mp0eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a43'
self.SIGNED_TX = 'f8900102018a4d4e540000000000000007b6f5a00eb98ea04ae466d8d38f490db3c99b3996a90e242... | transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
self.assertEqual(self.TX.signed_tx, self.SIGNED_TX)
def test_from_raw(self):
tx = MinterTx.from_raw(raw_tx=self.SIGNED_TX)
self.assertEqual(tx.from_mx, self.TX.address)
self.asse... | 146 | 146 | 487 | 10 | 136 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterDelegateTx | TestMinterDelegateTx | 167 | 203 | 167 | 168 | f43801cda1551c9797b62271a1ea59b6e836e134 | bigcode/the-stack | train |
2077b2d998128d0ca552e88a | train | class | class TestMinterEditCandidateTx(unittest.TestCase):
def setUp(self):
self.FROM = 'Mxa879439b0a29ecc7c5a0afe54b9eb3c22dbde8d9'
self.PRIVATE_KEY = 'a3fb55450f53dbbf4f2494280188f7f0cd51a7b51ec27ed49ed364d920e326ba'
self.SIGNED_TX = 'f8a80102018a4d4e54000000000000000eb84df84ba04ae1ee73e613... | class TestMinterEditCandidateTx(unittest.TestCase):
| def setUp(self):
self.FROM = 'Mxa879439b0a29ecc7c5a0afe54b9eb3c22dbde8d9'
self.PRIVATE_KEY = 'a3fb55450f53dbbf4f2494280188f7f0cd51a7b51ec27ed49ed364d920e326ba'
self.SIGNED_TX = 'f8a80102018a4d4e54000000000000000eb84df84ba04ae1ee73e6136c85b0ca933a9a1347758a334885f10b3238398a67ac2eb153b8948... | 1e2c1a43',
'coin': 'MNT',
'value': 10
})
def test_valid_tx(self):
"""
Is tx instance of needed TX class.
"""
self.assertIsInstance(self.TX, MinterUnbondTx)
def test_sign_tx(self):
"""
Sign transaction and check sign... | 177 | 177 | 593 | 11 | 166 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterEditCandidateTx | TestMinterEditCandidateTx | 464 | 500 | 464 | 465 | e9e075d548d952276b4dbf1f5bc1fb9150179b32 | bigcode/the-stack | train |
40156749a4d92f81bdaf4437 | train | class | class TestMinterSendTx(unittest.TestCase):
def setUp(self):
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.TO = 'Mx1b685a7c1e78726c48f619c497a07ed75fe00483'
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.SIGNED_TX = 'f... | class TestMinterSendTx(unittest.TestCase):
| def setUp(self):
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.TO = 'Mx1b685a7c1e78726c48f619c497a07ed75fe00483'
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.SIGNED_TX = 'f8840102018a4d4e540000000000000001aae98a4d4e540... | transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
self.assertEqual(self.TX.signed_tx, self.SIGNED_TX)
def test_from_raw(self):
tx = MinterTx.from_raw(raw_tx=self.SIGNED_TX)
self.assertEqual(tx.from_mx, self.FROM)
self.assertEqua... | 145 | 145 | 485 | 10 | 135 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterSendTx | TestMinterSendTx | 321 | 358 | 321 | 322 | 47d868f3fd02e2757031e9f56eb593b420b5b796 | bigcode/the-stack | train |
bf4f45a7b25386c2cb8e9e6b | train | class | class TestMinterBuyCoinTx(unittest.TestCase):
def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f8830102018a4d4e540000000000000004a9e88a5445535400000000000088... | class TestMinterBuyCoinTx(unittest.TestCase):
| def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f8830102018a4d4e540000000000000004a9e88a54455354000000000000880de0b6b3a76400008a4d4e5400000000000000880de0b6b3a... | = 10
self.TX_PAYLOAD = '🔳' # 4 bytes
self.tx = MinterTx.from_raw(self.SIGNED_TX)
def test_instance(self):
self.assertIsInstance(self.tx, MinterDelegateTx)
def test_public_key(self):
self.assertEqual(self.tx.pub_key, self.PUBLIC_KEY)
def test_from_mx(self):
... | 149 | 149 | 497 | 11 | 138 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterBuyCoinTx | TestMinterBuyCoinTx | 41 | 79 | 41 | 42 | 91b6df692f98d11e75903b5a4bf7a56a95171f1c | bigcode/the-stack | train |
e87f9efe5b1283a3e9028696 | train | class | class TestTxFees(unittest.TestCase):
def setUp(self):
self.TO = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.TX_PAYLOAD_UTF = '🔳' # 4 bytes
self.EXPECTED_SEND_COIN_FEE = 18000000000000... | class TestTxFees(unittest.TestCase):
| def setUp(self):
self.TO = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.TX_PAYLOAD_UTF = '🔳' # 4 bytes
self.EXPECTED_SEND_COIN_FEE = 18000000000000000
self.MULTISEND_RECIPIENTS... | 'value': 0.2
}
]
})
def test_valid_tx(self):
"""
Is tx instance of needed TX class.
"""
self.assertIsInstance(self.TX, MinterMultiSendCoinTx)
def test_sign_tx(self):
"""
Sign transaction and check signed transa... | 139 | 139 | 466 | 8 | 131 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestTxFees | TestTxFees | 548 | 593 | 548 | 549 | 7f5a3acec74b161909e971ec63c43d0ac10c3d2e | bigcode/the-stack | train |
5b48c7f40f1e6e596815cfdc | train | class | class TestMinterCreateCoinTx(unittest.TestCase):
def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f8850102018a4d4e540000000000000005abea8a5355504552205445535... | class TestMinterCreateCoinTx(unittest.TestCase):
| def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f8850102018a4d4e540000000000000005abea8a535550455220544553548a5350525445535400000089056bc75e2d63100000888ac7230... | """
Sign transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
self.assertEqual(self.TX.signed_tx, self.SIGNED_TX)
def test_from_raw(self):
tx = MinterTx.from_raw(raw_tx=self.SIGNED_TX)
self.assertEqual(tx.from_mx, self.FROM)... | 150 | 150 | 502 | 11 | 139 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterCreateCoinTx | TestMinterCreateCoinTx | 82 | 122 | 82 | 83 | b44dc44faf50e0b20dcd5f3934edc060dd205037 | bigcode/the-stack | train |
7067299c0b63069bda56e017 | train | class | class TestMinterRedeemCheckTx(unittest.TestCase):
def setUp(self):
self.PRIVATE_KEY = '05ddcd4e6f7d248ed1388f0091fe345bf9bf4fc2390384e26005e7675c98b3c1'
self.SIGNED_TX = 'f9013f0102018a4d4e540000000000000009b8e4f8e2b89df89b01830f423f8a4d4e5400000000000000843b9aca00b8419b3beac2c6ad88a8bd54d24912... | class TestMinterRedeemCheckTx(unittest.TestCase):
| def setUp(self):
self.PRIVATE_KEY = '05ddcd4e6f7d248ed1388f0091fe345bf9bf4fc2390384e26005e7675c98b3c1'
self.SIGNED_TX = 'f9013f0102018a4d4e540000000000000009b8e4f8e2b89df89b01830f423f8a4d4e5400000000000000843b9aca00b8419b3beac2c6ad88a8bd54d24912754bb820e58345731cb1b9bc0885ee74f9e50a58a80aa990a29c9... | 297d71d9dc37a57ffe9bb16915dccc703d8c09f30da8aadb9d5dbab8c7da9'
self.TX = MinterDelegateTx(**{
'nonce': 1,
'chain_id': MinterTx.TESTNET_CHAIN_ID,
'gas_coin': 'MNT',
'pub_key': self.PUBLIC_KEY,
'coin': 'MNT',
'stake': 10
})
... | 256 | 256 | 892 | 12 | 244 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterRedeemCheckTx | TestMinterRedeemCheckTx | 206 | 238 | 206 | 207 | eeadb8f0ef0094cb357e653b1bdde7d6938c7cda | bigcode/the-stack | train |
25340dd364bc9fb3a422137a | train | class | class TestMinterSetCandidateOnTx(unittest.TestCase):
def setUp(self):
self.PRIVATE_KEY = '05ddcd4e6f7d248ed1388f0091fe345bf9bf4fc2390384e26005e7675c98b3c1'
self.SIGNED_TX = 'f87c0102018a4d4e54000000000000000aa2e1a00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a43808001b845f8431ba... | class TestMinterSetCandidateOnTx(unittest.TestCase):
| def setUp(self):
self.PRIVATE_KEY = '05ddcd4e6f7d248ed1388f0091fe345bf9bf4fc2390384e26005e7675c98b3c1'
self.SIGNED_TX = 'f87c0102018a4d4e54000000000000000aa2e1a00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a43808001b845f8431ba0095aed433171fe5ac385ccd299507bdcad3dd2269794fd0d14d4f58... | _tx(self):
"""
Is tx instance of needed TX class.
"""
self.assertIsInstance(self.TX, MinterSetCandidateOffTx)
def test_sign_tx(self):
"""
Sign transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
self.asse... | 126 | 126 | 421 | 12 | 114 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterSetCandidateOnTx | TestMinterSetCandidateOnTx | 394 | 424 | 394 | 395 | d26de48d169ad16e9afd7c7920f0772af3f448d1 | bigcode/the-stack | train |
7e6ab8d8a6e5fba8b5f32670 | train | class | class TestMinterMultiSendCoinTx(unittest.TestCase):
def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f8b30102018a4d4e54000000000000000db858f856f854e98a4d4e54... | class TestMinterMultiSendCoinTx(unittest.TestCase):
| def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f8b30102018a4d4e54000000000000000db858f856f854e98a4d4e540000000000000094fe60014a6e9ac91618f5d1cab3fd58cded61ee9... | _valid_tx(self):
"""
Is tx instance of needed TX class.
"""
self.assertIsInstance(self.TX, MinterEditCandidateTx)
def test_sign_tx(self):
"""
Sign transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
self.... | 167 | 167 | 559 | 12 | 155 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterMultiSendCoinTx | TestMinterMultiSendCoinTx | 503 | 545 | 503 | 504 | cb09f8f7e99f190d5843db776e9784bc04d5aaba | bigcode/the-stack | train |
7a71b8c7bb7d54678c24940e | train | class | class TestMinterUnbondTx(unittest.TestCase):
def setUp(self):
self.PRIVATE_KEY = '6e1df6ec69638d152f563c5eca6c13cdb5db4055861efc11ec1cdd578afd96bf'
self.SIGNED_TX = 'f88f0102018a4d4e540000000000000008b6f5a00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a438a4d4e5400000000000000888... | class TestMinterUnbondTx(unittest.TestCase):
| def setUp(self):
self.PRIVATE_KEY = '6e1df6ec69638d152f563c5eca6c13cdb5db4055861efc11ec1cdd578afd96bf'
self.SIGNED_TX = 'f88f0102018a4d4e540000000000000008b6f5a00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a438a4d4e5400000000000000888ac7230489e80000808001b844f8421ca0ff5766c85847b37... | 2c6dc1e2c1a43'
})
def test_valid_tx(self):
"""
Is tx instance of needed TX class.
"""
self.assertIsInstance(self.TX, MinterSetCandidateOnTx)
def test_sign_tx(self):
"""
Sign transaction and check signed transaction
"""
self... | 143 | 143 | 478 | 11 | 132 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterUnbondTx | TestMinterUnbondTx | 427 | 461 | 427 | 428 | 2bdbac031999c95a36d63b55fd1a5493010fd0fc | bigcode/the-stack | train |
5c5ce12f4343cfe13b5c37e4 | train | class | class TestMinterDeclareCandidacyTx(unittest.TestCase):
def setUp(self):
self.PRIVATE_KEY = '6e1df6ec69638d152f563c5eca6c13cdb5db4055861efc11ec1cdd578afd96bf'
self.SIGNED_TX = 'f8a80102018a4d4e540000000000000006b84df84b949f7fd953c2c69044b901426831ed03ee0bd0597aa00eb98ea04ae466d8d38f490db3c99b399... | class TestMinterDeclareCandidacyTx(unittest.TestCase):
| def setUp(self):
self.PRIVATE_KEY = '6e1df6ec69638d152f563c5eca6c13cdb5db4055861efc11ec1cdd578afd96bf'
self.SIGNED_TX = 'f8a80102018a4d4e540000000000000006b84df84b949f7fd953c2c69044b901426831ed03ee0bd0597aa00eb98ea04ae466d8d38f490db3c99b3996a90e24243952ce9822c6dc1e2c1a430a8a4d4e5400000000000000884... | self.assertIsInstance(self.TX, MinterCreateCoinTx)
def test_sign_tx(self):
"""
Sign transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
self.assertEqual(self.TX.signed_tx, self.SIGNED_TX)
def test_from_raw(self):
tx = MinterT... | 175 | 175 | 585 | 13 | 162 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterDeclareCandidacyTx | TestMinterDeclareCandidacyTx | 125 | 164 | 125 | 126 | 20b01f1555642be31505d67b26a5141b8790f19b | bigcode/the-stack | train |
3a7220cc86ce4a0761bfbaab | train | class | class TestMinterSellAllCoinTx(unittest.TestCase):
def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f87a0102018a4d4e540000000000000003a0df8a4d4e54000000000000... | class TestMinterSellAllCoinTx(unittest.TestCase):
| def setUp(self):
self.FROM = 'Mx31e61a05adbd13c6b625262704bc305bf7725026'
self.PRIVATE_KEY = '07bc17abdcee8b971bb8723e36fe9d2523306d5ab2d683631693238e0f9df142'
self.SIGNED_TX = 'f87a0102018a4d4e540000000000000003a0df8a4d4e54000000000000008a54455354000000000000880de0b6b3a7640000808001b845f... | test_valid_tx(self):
"""
Is tx instance of needed TX class.
"""
self.assertIsInstance(self.TX, MinterRedeemCheckTx)
def test_sign_tx(self):
"""
Sign transaction and check signed transaction
"""
self.TX.sign(self.PRIVATE_KEY)
se... | 140 | 140 | 468 | 12 | 128 | michaelshapkin/minter-sdk | mintersdk/test/test_transactions.py | Python | TestMinterSellAllCoinTx | TestMinterSellAllCoinTx | 241 | 277 | 241 | 242 | bcddd8c0da6ecff7ae2cdf77236b01798bb8b6d4 | bigcode/the-stack | train |
5e01ffe19bbcdb1918421e16 | train | function | def _clear(x):
x.value.clear()
return x
| def _clear(x):
| x.value.clear()
return x
|
def persist(self, *args, **kwargs):
return type(self)(self._delayed.persist(*args, **kwargs))
def visualize(self, *args, **kwargs):
return self._delayed.visualize(*args, **kwargs)
# Dask task functions
def _clear(x):
| 64 | 64 | 14 | 5 | 58 | jim22k/dask-grblas | dask_grblas/base.py | Python | _clear | _clear | 242 | 244 | 242 | 242 | d4480d9feb0249b8adbaa68ad32f2ef8628b7d12 | bigcode/the-stack | train |
4b4b924c9ac08d2c71485abf | train | function | def _dup(x, mask, dtype, mask_type):
if mask is not None:
mask = mask_type(mask.value)
return wrap_inner(x.value.dup(dtype=dtype, mask=mask))
| def _dup(x, mask, dtype, mask_type):
| if mask is not None:
mask = mask_type(mask.value)
return wrap_inner(x.value.dup(dtype=dtype, mask=mask))
| .persist(*args, **kwargs))
def visualize(self, *args, **kwargs):
return self._delayed.visualize(*args, **kwargs)
# Dask task functions
def _clear(x):
x.value.clear()
return x
def _dup(x, mask, dtype, mask_type):
| 64 | 64 | 43 | 12 | 51 | jim22k/dask-grblas | dask_grblas/base.py | Python | _dup | _dup | 247 | 250 | 247 | 247 | 4aa026828d4466f6d6dbfed56c6eaaa0dcb09582 | bigcode/the-stack | train |
1ee0b03a55e959cc38838641 | train | function | def _reduction_value(x, val):
"""Helper function used when reducing objects to scalars such as for `isclose`"""
if x.ndim == 0:
return wrap_inner(gb.Scalar.from_value(val))
elif x.ndim == 1:
return np.array([val])
else:
return np.array([[val]])
| def _reduction_value(x, val):
| """Helper function used when reducing objects to scalars such as for `isclose`"""
if x.ndim == 0:
return wrap_inner(gb.Scalar.from_value(val))
elif x.ndim == 1:
return np.array([val])
else:
return np.array([[val]])
| check_dtype=check_dtype)
return _reduction_value(x, val)
def _nvals(x):
val = x.value.nvals
return _reduction_value(x, val)
def _optional_dup(x):
return wrap_inner(x.value.dup())
def _reduction_value(x, val):
| 64 | 64 | 75 | 9 | 55 | jim22k/dask-grblas | dask_grblas/base.py | Python | _reduction_value | _reduction_value | 274 | 281 | 274 | 274 | 54654aab9ebc371e76227fdbc4ef3ce6fe88f38e | bigcode/the-stack | train |
a8674fc0fad8680dcc3e7afc | train | function | def _update_assign(updating, accum, mask, mask_type, replace, x):
if mask is not None:
mask = mask_type(mask.value)
updating.value(accum=accum, mask=mask, replace=replace) << x.value
return updating
| def _update_assign(updating, accum, mask, mask_type, replace, x):
| if mask is not None:
mask = mask_type(mask.value)
updating.value(accum=accum, mask=mask, replace=replace) << x.value
return updating
| val])
else:
return np.array([[val]])
def _to_scalar(x, dtype):
return wrap_inner(gb.Scalar.from_value(x, dtype))
# This mutates the value in `updating`
def _update_assign(updating, accum, mask, mask_type, replace, x):
| 64 | 64 | 58 | 18 | 46 | jim22k/dask-grblas | dask_grblas/base.py | Python | _update_assign | _update_assign | 289 | 293 | 289 | 289 | 951f1ca6aab5b61600212dc6c0d521905d0d86d5 | bigcode/the-stack | train |
a3cf5765e094f491a5b7acd9 | train | class | class InnerBaseType:
def astype(self, dtype):
return wrap_inner(self.value.dup(dtype))
| class InnerBaseType:
| def astype(self, dtype):
return wrap_inner(self.value.dup(dtype))
| import dask.array as da
import grblas as gb
import numpy as np
from .mask import Mask
from .utils import get_grblas_type, get_meta, np_dtype, wrap_inner
_expect_type = gb.base._expect_type
class InnerBaseType:
| 56 | 64 | 23 | 5 | 50 | jim22k/dask-grblas | dask_grblas/base.py | Python | InnerBaseType | InnerBaseType | 11 | 13 | 11 | 11 | 0d05e061ff253360d1cdbc2cec2038d89de9d921 | bigcode/the-stack | train |
1c4a660f9f0cf1d3e8d3a83e | train | function | def _to_scalar(x, dtype):
return wrap_inner(gb.Scalar.from_value(x, dtype))
| def _to_scalar(x, dtype):
| return wrap_inner(gb.Scalar.from_value(x, dtype))
| such as for `isclose`"""
if x.ndim == 0:
return wrap_inner(gb.Scalar.from_value(val))
elif x.ndim == 1:
return np.array([val])
else:
return np.array([[val]])
def _to_scalar(x, dtype):
| 63 | 64 | 22 | 8 | 55 | jim22k/dask-grblas | dask_grblas/base.py | Python | _to_scalar | _to_scalar | 284 | 285 | 284 | 284 | d49eab589cbc6c4df59a8f899524f853dc276b22 | bigcode/the-stack | train |
03a97cf4886d76aa41e8dea7 | train | function | def _isequal(x, y, check_dtype):
val = x.value.isequal(y.value, check_dtype=check_dtype)
return _reduction_value(x, val)
| def _isequal(x, y, check_dtype):
| val = x.value.isequal(y.value, check_dtype=check_dtype)
return _reduction_value(x, val)
| y, rel_tol, abs_tol, check_dtype):
val = x.value.isclose(
y.value, rel_tol=rel_tol, abs_tol=abs_tol, check_dtype=check_dtype
)
return _reduction_value(x, val)
def _isequal(x, y, check_dtype):
| 64 | 64 | 38 | 11 | 53 | jim22k/dask-grblas | dask_grblas/base.py | Python | _isequal | _isequal | 260 | 262 | 260 | 260 | 5876c5cd4a138b3dadb82275e23e59a3e99070a4 | bigcode/the-stack | train |
2ee725b38848fad34c27e40c | train | function | def _isclose(x, y, rel_tol, abs_tol, check_dtype):
val = x.value.isclose(
y.value, rel_tol=rel_tol, abs_tol=abs_tol, check_dtype=check_dtype
)
return _reduction_value(x, val)
| def _isclose(x, y, rel_tol, abs_tol, check_dtype):
| val = x.value.isclose(
y.value, rel_tol=rel_tol, abs_tol=abs_tol, check_dtype=check_dtype
)
return _reduction_value(x, val)
| return x
def _dup(x, mask, dtype, mask_type):
if mask is not None:
mask = mask_type(mask.value)
return wrap_inner(x.value.dup(dtype=dtype, mask=mask))
def _isclose(x, y, rel_tol, abs_tol, check_dtype):
| 64 | 64 | 59 | 17 | 47 | jim22k/dask-grblas | dask_grblas/base.py | Python | _isclose | _isclose | 253 | 257 | 253 | 253 | 00df9728c9d5a20f5b48f6623d779da7a5fcc4ca | bigcode/the-stack | train |
0a8b9dd42b2e09c6789fc829 | train | class | class BaseType:
_expect_type = _expect_type
def isequal(self, other, *, check_dtype=False):
from .scalar import PythonScalar
# if type(other) is not type(self):
# raise TypeError(f'Argument of isequal must be of type {type(self).__name__}')
if not self._meta.isequal(other._... | class BaseType:
| _expect_type = _expect_type
def isequal(self, other, *, check_dtype=False):
from .scalar import PythonScalar
# if type(other) is not type(self):
# raise TypeError(f'Argument of isequal must be of type {type(self).__name__}')
if not self._meta.isequal(other._meta):
... | import dask.array as da
import grblas as gb
import numpy as np
from .mask import Mask
from .utils import get_grblas_type, get_meta, np_dtype, wrap_inner
_expect_type = gb.base._expect_type
class InnerBaseType:
def astype(self, dtype):
return wrap_inner(self.value.dup(dtype))
class BaseType:
| 78 | 256 | 1,719 | 4 | 74 | jim22k/dask-grblas | dask_grblas/base.py | Python | BaseType | BaseType | 16 | 238 | 16 | 16 | f9ca27302d2679d44a2c13e2677857844519adec | bigcode/the-stack | train |
6c794a23e19f3fcce3a582c0 | train | function | def _optional_dup(x):
return wrap_inner(x.value.dup())
| def _optional_dup(x):
| return wrap_inner(x.value.dup())
| (x, y, check_dtype):
val = x.value.isequal(y.value, check_dtype=check_dtype)
return _reduction_value(x, val)
def _nvals(x):
val = x.value.nvals
return _reduction_value(x, val)
def _optional_dup(x):
| 64 | 64 | 15 | 6 | 58 | jim22k/dask-grblas | dask_grblas/base.py | Python | _optional_dup | _optional_dup | 270 | 271 | 270 | 270 | 66cd585d17df58daea9e508a33ee09afe12ea953 | bigcode/the-stack | train |
419074ff70dbbf8fa921925c | train | function | def _nvals(x):
val = x.value.nvals
return _reduction_value(x, val)
| def _nvals(x):
| val = x.value.nvals
return _reduction_value(x, val)
| _tol, check_dtype=check_dtype
)
return _reduction_value(x, val)
def _isequal(x, y, check_dtype):
val = x.value.isequal(y.value, check_dtype=check_dtype)
return _reduction_value(x, val)
def _nvals(x):
| 64 | 64 | 24 | 6 | 58 | jim22k/dask-grblas | dask_grblas/base.py | Python | _nvals | _nvals | 265 | 267 | 265 | 265 | 002774596e10b1c23175be29c8d3092f4e92a7f2 | bigcode/the-stack | train |
33ca29542bc7163d220b6d2f | train | class | class BuildingPhase(ModelSimple):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The ... | class BuildingPhase(ModelSimple):
| """NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a c... | /><br/>To access these resources, you need an authorization token. If you do not have one yet, see the chapter about Authorization in the [API documentation](https://docs.madaster.com/api). This token should be sent as a header with the name 'X-API-Key', which will authenticate the request with the token. The documenta... | 256 | 256 | 1,244 | 6 | 250 | Madaster/examples | python3/madasterapi/model/building_phase.py | Python | BuildingPhase | BuildingPhase | 31 | 186 | 31 | 31 | 2d588ccddd67764c4b3bb1ec27faa41f331fff9f | bigcode/the-stack | train |
14c6c18326ae734a1bf7afc5 | train | class | class ExtendibleTestCase(HDF5CompatibilityTestCase):
"""
Test for extendible datasets.
See the example programs in the Introduction to HDF5.
"""
h5fname = 'smpl_SDSextendible.h5'
def _test(self):
self.assertTrue('/ExtendibleArray' in self.h5file)
arr = self.h5file.get_node('... | class ExtendibleTestCase(HDF5CompatibilityTestCase):
| """
Test for extendible datasets.
See the example programs in the Introduction to HDF5.
"""
h5fname = 'smpl_SDSextendible.h5'
def _test(self):
self.assertTrue('/ExtendibleArray' in self.h5file)
arr = self.h5file.get_node('/ExtendibleArray')
self.assertTrue(isinstance(... | .assertRaises(tables.HDF5ExtError, tbl.append,
[(4.0, 5.0, [2.0, 3.0], 'd')])
# Appending using the Row interface
self.assertRaises(tables.HDF5ExtError, tbl.row.append)
# Remove the file copy
self.h5file.close() # Close the handler first
os.remove(h5fna... | 104 | 104 | 347 | 12 | 92 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | ExtendibleTestCase | ExtendibleTestCase | 274 | 309 | 274 | 275 | 128108a08c491e8efb0f9b195d8c709da9679329 | bigcode/the-stack | train |
a1d7cc12f87c75f3cc10afc0 | train | class | class ChunkedCompoundTestCase(HDF5CompatibilityTestCase):
"""
Test for a more complex and chunked compound structure.
This is generated by a chunked version of the example in
ftp://ftp.ncsa.uiuc.edu/HDF/files/hdf5/samples/compound2.c.
"""
h5fname = 'smpl_compound_chunked.h5'
def _test(se... | class ChunkedCompoundTestCase(HDF5CompatibilityTestCase):
| """
Test for a more complex and chunked compound structure.
This is generated by a chunked version of the example in
ftp://ftp.ncsa.uiuc.edu/HDF/files/hdf5/samples/compound2.c.
"""
h5fname = 'smpl_compound_chunked.h5'
def _test(self):
self.assertTrue('/CompoundChunked' in self.h5f... | ):
h5fname = 'smpl_i64be.h5'
type = 'int64'
byteorder = 'big'
class I64LETestCase(NumericTestCase):
h5fname = 'smpl_i64le.h5'
type = 'int64'
byteorder = 'little'
class I32BETestCase(NumericTestCase):
h5fname = 'smpl_i32be.h5'
type = 'int32'
byteorder = 'big'
class I32LETestCase... | 159 | 159 | 530 | 13 | 146 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | ChunkedCompoundTestCase | ChunkedCompoundTestCase | 145 | 198 | 145 | 146 | 28ee427673c566f59a074aeed7ea19113070099e | bigcode/the-stack | train |
de54c5d4c388a6d9570b7137 | train | class | class EnumTestCase(HDF5CompatibilityTestCase):
"""
Test for enumerated datatype.
See ftp://ftp.hdfgroup.org/HDF5/current/src/unpacked/test/enum.c.
"""
h5fname = 'smpl_enum.h5'
def _test(self):
self.assertTrue('/EnumTest' in self.h5file)
arr = self.h5file.get_node('/EnumTest'... | class EnumTestCase(HDF5CompatibilityTestCase):
| """
Test for enumerated datatype.
See ftp://ftp.hdfgroup.org/HDF5/current/src/unpacked/test/enum.c.
"""
h5fname = 'smpl_enum.h5'
def _test(self):
self.assertTrue('/EnumTest' in self.h5file)
arr = self.h5file.get_node('/EnumTest')
self.assertTrue(isinstance(arr, tables... | self.h5file.close()
self.h5file = None
def test(self):
self.h5fname = self._testFilename(self.h5fname)
self.h5file = tables.open_file(self.h5fname)
self._test()
class EnumTestCase(HDF5CompatibilityTestCase):
| 64 | 64 | 197 | 11 | 53 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | EnumTestCase | EnumTestCase | 51 | 76 | 51 | 52 | 8c651ffe26a130526aed57dec4d9d20e6d468846 | bigcode/the-stack | train |
aec8579470752794d42d77b7 | train | class | class I32BETestCase(NumericTestCase):
h5fname = 'smpl_i32be.h5'
type = 'int32'
byteorder = 'big'
| class I32BETestCase(NumericTestCase):
| h5fname = 'smpl_i32be.h5'
type = 'int32'
byteorder = 'big'
| type = 'int64'
byteorder = 'big'
class I64LETestCase(NumericTestCase):
h5fname = 'smpl_i64le.h5'
type = 'int64'
byteorder = 'little'
class I32BETestCase(NumericTestCase):
| 64 | 64 | 39 | 11 | 53 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | I32BETestCase | I32BETestCase | 133 | 136 | 133 | 133 | 3339cb31810e9da3a0bf5959e91b3f311794b57b | bigcode/the-stack | train |
cb1df25d3229ff3eb85c18c0 | train | class | class I64LETestCase(NumericTestCase):
h5fname = 'smpl_i64le.h5'
type = 'int64'
byteorder = 'little'
| class I64LETestCase(NumericTestCase):
| h5fname = 'smpl_i64le.h5'
type = 'int64'
byteorder = 'little'
| type = 'float64'
byteorder = 'little'
class I64BETestCase(NumericTestCase):
h5fname = 'smpl_i64be.h5'
type = 'int64'
byteorder = 'big'
class I64LETestCase(NumericTestCase):
| 64 | 64 | 39 | 11 | 53 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | I64LETestCase | I64LETestCase | 127 | 130 | 127 | 127 | 4153cb910ff3c3dc64a27e67c2fbd0e2c537d84d | bigcode/the-stack | train |
e6e149f6bcbdc34059147c6b | train | class | class NumericTestCase(HDF5CompatibilityTestCase):
"""
Test for several numeric datatypes.
See ftp://ftp.ncsa.uiuc.edu/HDF/files/hdf5/samples/[fiu]l?{8,16,32,64}{be,le}.c
(they seem to be no longer available).
"""
def _test(self):
self.assertTrue('/TestArray' in self.h5file)
a... | class NumericTestCase(HDF5CompatibilityTestCase):
| """
Test for several numeric datatypes.
See ftp://ftp.ncsa.uiuc.edu/HDF/files/hdf5/samples/[fiu]l?{8,16,32,64}{be,le}.c
(they seem to be no longer available).
"""
def _test(self):
self.assertTrue('/TestArray' in self.h5file)
arr = self.h5file.get_node('/TestArray')
sel... | BLACK'])
self.assertEqual(enum, expectedEnum)
data = list(arr.read())
expectedData = [
enum[name] for name in
['RED', 'GREEN', 'BLUE', 'WHITE', 'BLACK',
'RED', 'GREEN', 'BLUE', 'WHITE', 'BLACK']]
self.assertEqual(data, expectedData)
class NumericTest... | 83 | 83 | 278 | 11 | 72 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | NumericTestCase | NumericTestCase | 79 | 106 | 79 | 80 | 7140b4103e705f10a572f52de046ad5e79422e16 | bigcode/the-stack | train |
6c7ec7472eba9355e87983a4 | train | class | class MatlabFileTestCase(common.PyTablesTestCase):
def setUp(self):
h5fname = 'matlab_file.mat'
file_path = self._testFilename(h5fname)
self.h5file = tables.open_file(file_path, 'r')
def tearDown(self):
self.h5file.close()
def test_unicode(self):
array = self.h5fil... | class MatlabFileTestCase(common.PyTablesTestCase):
| def setUp(self):
h5fname = 'matlab_file.mat'
file_path = self._testFilename(h5fname)
self.h5file = tables.open_file(file_path, 'r')
def tearDown(self):
self.h5file.close()
def test_unicode(self):
array = self.h5file.get_node(unicode('/'), unicode('a'))
self.... | arr = self.h5file.get_node('/dset_szip')
filters = "Filters(complib='szip', shuffle=False, fletcher32=False)"
self.assertEqual(repr(arr.filters), filters)
# this demonstrates github #203
class MatlabFileTestCase(common.PyTablesTestCase):
| 64 | 64 | 194 | 12 | 51 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | MatlabFileTestCase | MatlabFileTestCase | 328 | 349 | 328 | 329 | 3f5c7de8c8ae024ee93cf95ed133923ed0892736 | bigcode/the-stack | train |
2ca0dd5e7113ddcc216e676d | train | class | class F64LETestCase(NumericTestCase):
h5fname = 'smpl_f64le.h5'
type = 'float64'
byteorder = 'little'
| class F64LETestCase(NumericTestCase):
| h5fname = 'smpl_f64le.h5'
type = 'float64'
byteorder = 'little'
| )
self.assertTrue(common.areArraysEqual(data, expectedData))
class F64BETestCase(NumericTestCase):
h5fname = 'smpl_f64be.h5'
type = 'float64'
byteorder = 'big'
class F64LETestCase(NumericTestCase):
| 64 | 64 | 39 | 11 | 53 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | F64LETestCase | F64LETestCase | 115 | 118 | 115 | 115 | de8dd851c9e19e2aff118a6170a3e76894744c44 | bigcode/the-stack | train |
cb94dd1670d2f49cf8bf9aeb | train | function | def suite():
"""Return a test suite consisting of all the test cases in the module."""
theSuite = unittest.TestSuite()
niter = 1
for i in range(niter):
theSuite.addTest(unittest.makeSuite(EnumTestCase))
theSuite.addTest(unittest.makeSuite(F64BETestCase))
theSuite.addTest(unitte... | def suite():
| """Return a test suite consisting of all the test cases in the module."""
theSuite = unittest.TestSuite()
niter = 1
for i in range(niter):
theSuite.addTest(unittest.makeSuite(EnumTestCase))
theSuite.addTest(unittest.makeSuite(F64BETestCase))
theSuite.addTest(unittest.makeSuite(... | array = self.h5file.get_node('/', 'a')
self.assertEqual(array.shape, (3, 1))
def test_numpy_str(self):
array = self.h5file.get_node(numpy.str_('/'), numpy.str_('a'))
self.assertEqual(array.shape, (3, 1))
def suite():
| 69 | 69 | 230 | 3 | 66 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | suite | suite | 352 | 373 | 352 | 352 | e557b27630955f0c61b72e1e3a5f2eabeef15ba6 | bigcode/the-stack | train |
076d69922d09618db0d7ec93 | train | class | class ContiguousCompoundTestCase(HDF5CompatibilityTestCase):
"""
Test for support of native contiguous compound datasets.
This example has been provided by Dav Clark.
"""
h5fname = 'non-chunked-table.h5'
def _test(self):
self.assertTrue('/test_var/structure variable' in self.h5file)
... | class ContiguousCompoundTestCase(HDF5CompatibilityTestCase):
| """
Test for support of native contiguous compound datasets.
This example has been provided by Dav Clark.
"""
h5fname = 'non-chunked-table.h5'
def _test(self):
self.assertTrue('/test_var/structure variable' in self.h5file)
tbl = self.h5file.get_node('/test_var/structure varia... | Equal(dRow[n][o], m + n + o)
self.assertAlmostEqual(row['e_name'], m * 0.96, places=6)
fRow = row['f_name']
for n in range(10):
self.assertAlmostEqual(fRow[n], m * 1024.9637)
self.assertEqual(row['g_name'], ord('m'))
class ContiguousCompoundTestCase(HDF5Co... | 95 | 96 | 322 | 13 | 82 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | ContiguousCompoundTestCase | ContiguousCompoundTestCase | 201 | 240 | 201 | 202 | 010d0eb51e56727a264cf32b74301780af0d7e3b | bigcode/the-stack | train |
7a9d92e92618fe46c5eb0e53 | train | class | class F64BETestCase(NumericTestCase):
h5fname = 'smpl_f64be.h5'
type = 'float64'
byteorder = 'big'
| class F64BETestCase(NumericTestCase):
| h5fname = 'smpl_f64be.h5'
type = 'float64'
byteorder = 'big'
| , 7],
[4, 5, 6, 7, 8],
[5, 6, 7, 8, 9]], dtype=self.type)
self.assertTrue(common.areArraysEqual(data, expectedData))
class F64BETestCase(NumericTestCase):
| 64 | 64 | 39 | 11 | 53 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | F64BETestCase | F64BETestCase | 109 | 112 | 109 | 109 | c81ae65e86933acd39d68ac831164841136af15e | bigcode/the-stack | train |
3c1ee60c0a3e77123c8fc791 | train | class | class SzipTestCase(HDF5CompatibilityTestCase):
"""
Test for native HDF5 files with datasets compressed with szip.
"""
h5fname = 'test_szip.h5'
def _test(self):
self.assertTrue('/dset_szip' in self.h5file)
arr = self.h5file.get_node('/dset_szip')
filters = "Filters(complib=... | class SzipTestCase(HDF5CompatibilityTestCase):
| """
Test for native HDF5 files with datasets compressed with szip.
"""
h5fname = 'test_szip.h5'
def _test(self):
self.assertTrue('/dset_szip' in self.h5file)
arr = self.h5file.get_node('/dset_szip')
filters = "Filters(complib='szip', shuffle=False, fletcher32=False)"
... | ],
[2, 0, 0, 0, 0],
[2, 0, 0, 0, 0]], dtype=arr.atom.type)
self.assertTrue(common.areArraysEqual(data, expectedData))
class SzipTestCase(HDF5CompatibilityTestCase):
| 64 | 64 | 111 | 12 | 52 | crs4/PyTables | tables/tests/test_hdf5compat.py | Python | SzipTestCase | SzipTestCase | 312 | 324 | 312 | 312 | 505aac8e29b2b6d89d406cd4ac36a32e674582ed | bigcode/the-stack | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.