matlab-prodserver-client 24.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. google/__init__.py +7 -0
  2. google/protobuf_ml/__init__.py +33 -0
  3. google/protobuf_ml/descriptor.py +1230 -0
  4. google/protobuf_ml/descriptor_database.py +177 -0
  5. google/protobuf_ml/descriptor_pb2.py +1925 -0
  6. google/protobuf_ml/descriptor_pool.py +1295 -0
  7. google/protobuf_ml/internal/__init__.py +0 -0
  8. google/protobuf_ml/internal/_parameterized.py +443 -0
  9. google/protobuf_ml/internal/api_implementation.py +168 -0
  10. google/protobuf_ml/internal/builder.py +130 -0
  11. google/protobuf_ml/internal/containers.py +708 -0
  12. google/protobuf_ml/internal/decoder.py +1068 -0
  13. google/protobuf_ml/internal/descriptor_database_test.py +127 -0
  14. google/protobuf_ml/internal/descriptor_pool_test.py +1149 -0
  15. google/protobuf_ml/internal/descriptor_test.py +1076 -0
  16. google/protobuf_ml/internal/encoder.py +829 -0
  17. google/protobuf_ml/internal/enum_type_wrapper.py +124 -0
  18. google/protobuf_ml/internal/extension_dict.py +213 -0
  19. google/protobuf_ml/internal/generator_test.py +354 -0
  20. google/protobuf_ml/internal/import_test.py +49 -0
  21. google/protobuf_ml/internal/json_format_test.py +1285 -0
  22. google/protobuf_ml/internal/keywords_test.py +103 -0
  23. google/protobuf_ml/internal/message_factory_test.py +299 -0
  24. google/protobuf_ml/internal/message_listener.py +78 -0
  25. google/protobuf_ml/internal/message_test.py +2573 -0
  26. google/protobuf_ml/internal/proto_builder_test.py +106 -0
  27. google/protobuf_ml/internal/python_message.py +1539 -0
  28. google/protobuf_ml/internal/reflection_test.py +3381 -0
  29. google/protobuf_ml/internal/service_reflection_test.py +139 -0
  30. google/protobuf_ml/internal/symbol_database_test.py +133 -0
  31. google/protobuf_ml/internal/test_util.py +878 -0
  32. google/protobuf_ml/internal/testing_refleaks.py +142 -0
  33. google/protobuf_ml/internal/text_encoding_test.py +67 -0
  34. google/protobuf_ml/internal/text_format_test.py +2447 -0
  35. google/protobuf_ml/internal/type_checkers.py +435 -0
  36. google/protobuf_ml/internal/unknown_fields_test.py +461 -0
  37. google/protobuf_ml/internal/well_known_types.py +887 -0
  38. google/protobuf_ml/internal/well_known_types_test.py +1013 -0
  39. google/protobuf_ml/internal/wire_format.py +268 -0
  40. google/protobuf_ml/internal/wire_format_test.py +252 -0
  41. google/protobuf_ml/json_format.py +912 -0
  42. google/protobuf_ml/message.py +424 -0
  43. google/protobuf_ml/message_factory.py +189 -0
  44. google/protobuf_ml/proto_builder.py +134 -0
  45. google/protobuf_ml/reflection.py +95 -0
  46. google/protobuf_ml/service.py +228 -0
  47. google/protobuf_ml/service_reflection.py +295 -0
  48. google/protobuf_ml/symbol_database.py +194 -0
  49. google/protobuf_ml/text_encoding.py +110 -0
  50. google/protobuf_ml/text_format.py +1842 -0
  51. google/protobuf_ml/unknown_fields.py +120 -0
  52. matlab/__init__.py +43 -0
  53. matlab/bin/win64/libmwfoundation_matlabdata.dll +0 -0
  54. matlab/bin/win64/libmwfoundation_matlabdata_standalone.dll +0 -0
  55. matlab/extern/bin/win64/libMatlabDataArray.dll +0 -0
  56. matlab/extern/bin/win64/matlabmultidimarrayforpython.cp310-win_amd64.pyd +0 -0
  57. matlab/extern/bin/win64/matlabmultidimarrayforpython.cp39-win_amd64.pyd +0 -0
  58. matlab/extern/bin/win64/matlabmultidimarrayforpython.pyd +0 -0
  59. matlab/production_server/__init__.py +2 -0
  60. matlab/production_server/_internal_mps/__init__.py +2 -0
  61. matlab/production_server/_internal_mps/feval_handler.py +76 -0
  62. matlab/production_server/_internal_mps/invocation_handler_utils.py +52 -0
  63. matlab/production_server/_internal_mps/matlab_array_builder.py +201 -0
  64. matlab/production_server/_internal_mps/matlab_response_builder.py +134 -0
  65. matlab/production_server/_proto_generated/MATLABArray_pb2.py +129 -0
  66. matlab/production_server/_proto_generated/MATLABError_pb2.py +27 -0
  67. matlab/production_server/_proto_generated/MATLABParams_pb2.py +26 -0
  68. matlab/production_server/_proto_generated/MATLABResult_pb2.py +27 -0
  69. matlab/production_server/_proto_generated/__init__.py +0 -0
  70. matlab/production_server/client.py +140 -0
  71. matlab/production_server/mpsexceptions.py +56 -0
  72. matlab_prodserver_client-24.2.dist-info/LICENSE.txt +27 -0
  73. matlab_prodserver_client-24.2.dist-info/METADATA +94 -0
  74. matlab_prodserver_client-24.2.dist-info/RECORD +77 -0
  75. matlab_prodserver_client-24.2.dist-info/WHEEL +5 -0
  76. matlab_prodserver_client-24.2.dist-info/top_level.txt +3 -0
  77. six.py +953 -0
@@ -0,0 +1,142 @@
1
+ # Protocol Buffers - Google's data interchange format
2
+ # Copyright 2008 Google Inc. All rights reserved.
3
+ # https://developers.google.com/protocol-buffers/
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are
7
+ # met:
8
+ #
9
+ # * Redistributions of source code must retain the above copyright
10
+ # notice, this list of conditions and the following disclaimer.
11
+ # * Redistributions in binary form must reproduce the above
12
+ # copyright notice, this list of conditions and the following disclaimer
13
+ # in the documentation and/or other materials provided with the
14
+ # distribution.
15
+ # * Neither the name of Google Inc. nor the names of its
16
+ # contributors may be used to endorse or promote products derived from
17
+ # this software without specific prior written permission.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ """A subclass of unittest.TestCase which checks for reference leaks.
32
+
33
+ To use:
34
+ - Use testing_refleak.BaseTestCase instead of unittest.TestCase
35
+ - Configure and compile Python with --with-pydebug
36
+
37
+ If sys.gettotalrefcount() is not available (because Python was built without
38
+ the Py_DEBUG option), then this module is a no-op and tests will run normally.
39
+ """
40
+
41
+ import copyreg
42
+ import gc
43
+ import sys
44
+ import unittest
45
+
46
+
47
+ class LocalTestResult(unittest.TestResult):
48
+ """A TestResult which forwards events to a parent object, except for Skips."""
49
+
50
+ def __init__(self, parent_result):
51
+ unittest.TestResult.__init__(self)
52
+ self.parent_result = parent_result
53
+
54
+ def addError(self, test, error):
55
+ self.parent_result.addError(test, error)
56
+
57
+ def addFailure(self, test, error):
58
+ self.parent_result.addFailure(test, error)
59
+
60
+ def addSkip(self, test, reason):
61
+ pass
62
+
63
+
64
+ class ReferenceLeakCheckerMixin(object):
65
+ """A mixin class for TestCase, which checks reference counts."""
66
+
67
+ NB_RUNS = 3
68
+
69
+ def run(self, result=None):
70
+ testMethod = getattr(self, self._testMethodName)
71
+ expecting_failure_method = getattr(testMethod, "__unittest_expecting_failure__", False)
72
+ expecting_failure_class = getattr(self, "__unittest_expecting_failure__", False)
73
+ if expecting_failure_class or expecting_failure_method:
74
+ return
75
+
76
+ # python_message.py registers all Message classes to some pickle global
77
+ # registry, which makes the classes immortal.
78
+ # We save a copy of this registry, and reset it before we could references.
79
+ self._saved_pickle_registry = copyreg.dispatch_table.copy()
80
+
81
+ # Run the test twice, to warm up the instance attributes.
82
+ super(ReferenceLeakCheckerMixin, self).run(result=result)
83
+ super(ReferenceLeakCheckerMixin, self).run(result=result)
84
+
85
+ oldrefcount = 0
86
+ local_result = LocalTestResult(result)
87
+ num_flakes = 0
88
+
89
+ refcount_deltas = []
90
+ while len(refcount_deltas) < self.NB_RUNS:
91
+ oldrefcount = self._getRefcounts()
92
+ super(ReferenceLeakCheckerMixin, self).run(result=local_result)
93
+ newrefcount = self._getRefcounts()
94
+ # If the GC was able to collect some objects after the call to run() that
95
+ # it could not collect before the call, then the counts won't match.
96
+ if newrefcount < oldrefcount and num_flakes < 2:
97
+ # This result is (probably) a flake -- garbage collectors aren't very
98
+ # predictable, but a lower ending refcount is the opposite of the
99
+ # failure we are testing for. If the result is repeatable, then we will
100
+ # eventually report it, but not after trying to eliminate it.
101
+ num_flakes += 1
102
+ continue
103
+ num_flakes = 0
104
+ refcount_deltas.append(newrefcount - oldrefcount)
105
+ print(refcount_deltas, self)
106
+
107
+ try:
108
+ self.assertEqual(refcount_deltas, [0] * self.NB_RUNS)
109
+ except Exception: # pylint: disable=broad-except
110
+ result.addError(self, sys.exc_info())
111
+
112
+ def _getRefcounts(self):
113
+ copyreg.dispatch_table.clear()
114
+ copyreg.dispatch_table.update(self._saved_pickle_registry)
115
+ # It is sometimes necessary to gc.collect() multiple times, to ensure
116
+ # that all objects can be collected.
117
+ gc.collect()
118
+ gc.collect()
119
+ gc.collect()
120
+ return sys.gettotalrefcount()
121
+
122
+
123
+ if hasattr(sys, 'gettotalrefcount'):
124
+
125
+ def TestCase(test_class):
126
+ new_bases = (ReferenceLeakCheckerMixin,) + test_class.__bases__
127
+ new_class = type(test_class)(
128
+ test_class.__name__, new_bases, dict(test_class.__dict__))
129
+ return new_class
130
+ SkipReferenceLeakChecker = unittest.skip
131
+
132
+ else:
133
+ # When PyDEBUG is not enabled, run the tests normally.
134
+
135
+ def TestCase(test_class):
136
+ return test_class
137
+
138
+ def SkipReferenceLeakChecker(reason):
139
+ del reason # Don't skip, so don't need a reason.
140
+ def Same(func):
141
+ return func
142
+ return Same
@@ -0,0 +1,67 @@
1
+ # Protocol Buffers - Google's data interchange format
2
+ # Copyright 2008 Google Inc. All rights reserved.
3
+ # https://developers.google.com/protocol-buffers/
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are
7
+ # met:
8
+ #
9
+ # * Redistributions of source code must retain the above copyright
10
+ # notice, this list of conditions and the following disclaimer.
11
+ # * Redistributions in binary form must reproduce the above
12
+ # copyright notice, this list of conditions and the following disclaimer
13
+ # in the documentation and/or other materials provided with the
14
+ # distribution.
15
+ # * Neither the name of Google Inc. nor the names of its
16
+ # contributors may be used to endorse or promote products derived from
17
+ # this software without specific prior written permission.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ """Tests for google.protobuf_ml.text_encoding."""
32
+
33
+ import unittest
34
+
35
+ from google.protobuf_ml import text_encoding
36
+
37
+ TEST_VALUES = [
38
+ ("foo\\rbar\\nbaz\\t",
39
+ "foo\\rbar\\nbaz\\t",
40
+ b"foo\rbar\nbaz\t"),
41
+ ("\\'full of \\\"sound\\\" and \\\"fury\\\"\\'",
42
+ "\\'full of \\\"sound\\\" and \\\"fury\\\"\\'",
43
+ b"'full of \"sound\" and \"fury\"'"),
44
+ ("signi\\\\fying\\\\ nothing\\\\",
45
+ "signi\\\\fying\\\\ nothing\\\\",
46
+ b"signi\\fying\\ nothing\\"),
47
+ ("\\010\\t\\n\\013\\014\\r",
48
+ "\x08\\t\\n\x0b\x0c\\r",
49
+ b"\010\011\012\013\014\015")]
50
+
51
+
52
+ class TextEncodingTestCase(unittest.TestCase):
53
+ def testCEscape(self):
54
+ for escaped, escaped_utf8, unescaped in TEST_VALUES:
55
+ self.assertEqual(escaped,
56
+ text_encoding.CEscape(unescaped, as_utf8=False))
57
+ self.assertEqual(escaped_utf8,
58
+ text_encoding.CEscape(unescaped, as_utf8=True))
59
+
60
+ def testCUnescape(self):
61
+ for escaped, escaped_utf8, unescaped in TEST_VALUES:
62
+ self.assertEqual(unescaped, text_encoding.CUnescape(escaped))
63
+ self.assertEqual(unescaped, text_encoding.CUnescape(escaped_utf8))
64
+
65
+
66
+ if __name__ == "__main__":
67
+ unittest.main()