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.
- google/__init__.py +7 -0
- google/protobuf_ml/__init__.py +33 -0
- google/protobuf_ml/descriptor.py +1230 -0
- google/protobuf_ml/descriptor_database.py +177 -0
- google/protobuf_ml/descriptor_pb2.py +1925 -0
- google/protobuf_ml/descriptor_pool.py +1295 -0
- google/protobuf_ml/internal/__init__.py +0 -0
- google/protobuf_ml/internal/_parameterized.py +443 -0
- google/protobuf_ml/internal/api_implementation.py +168 -0
- google/protobuf_ml/internal/builder.py +130 -0
- google/protobuf_ml/internal/containers.py +708 -0
- google/protobuf_ml/internal/decoder.py +1068 -0
- google/protobuf_ml/internal/descriptor_database_test.py +127 -0
- google/protobuf_ml/internal/descriptor_pool_test.py +1149 -0
- google/protobuf_ml/internal/descriptor_test.py +1076 -0
- google/protobuf_ml/internal/encoder.py +829 -0
- google/protobuf_ml/internal/enum_type_wrapper.py +124 -0
- google/protobuf_ml/internal/extension_dict.py +213 -0
- google/protobuf_ml/internal/generator_test.py +354 -0
- google/protobuf_ml/internal/import_test.py +49 -0
- google/protobuf_ml/internal/json_format_test.py +1285 -0
- google/protobuf_ml/internal/keywords_test.py +103 -0
- google/protobuf_ml/internal/message_factory_test.py +299 -0
- google/protobuf_ml/internal/message_listener.py +78 -0
- google/protobuf_ml/internal/message_test.py +2573 -0
- google/protobuf_ml/internal/proto_builder_test.py +106 -0
- google/protobuf_ml/internal/python_message.py +1539 -0
- google/protobuf_ml/internal/reflection_test.py +3381 -0
- google/protobuf_ml/internal/service_reflection_test.py +139 -0
- google/protobuf_ml/internal/symbol_database_test.py +133 -0
- google/protobuf_ml/internal/test_util.py +878 -0
- google/protobuf_ml/internal/testing_refleaks.py +142 -0
- google/protobuf_ml/internal/text_encoding_test.py +67 -0
- google/protobuf_ml/internal/text_format_test.py +2447 -0
- google/protobuf_ml/internal/type_checkers.py +435 -0
- google/protobuf_ml/internal/unknown_fields_test.py +461 -0
- google/protobuf_ml/internal/well_known_types.py +887 -0
- google/protobuf_ml/internal/well_known_types_test.py +1013 -0
- google/protobuf_ml/internal/wire_format.py +268 -0
- google/protobuf_ml/internal/wire_format_test.py +252 -0
- google/protobuf_ml/json_format.py +912 -0
- google/protobuf_ml/message.py +424 -0
- google/protobuf_ml/message_factory.py +189 -0
- google/protobuf_ml/proto_builder.py +134 -0
- google/protobuf_ml/reflection.py +95 -0
- google/protobuf_ml/service.py +228 -0
- google/protobuf_ml/service_reflection.py +295 -0
- google/protobuf_ml/symbol_database.py +194 -0
- google/protobuf_ml/text_encoding.py +110 -0
- google/protobuf_ml/text_format.py +1842 -0
- google/protobuf_ml/unknown_fields.py +120 -0
- matlab/__init__.py +43 -0
- matlab/bin/win64/libmwfoundation_matlabdata.dll +0 -0
- matlab/bin/win64/libmwfoundation_matlabdata_standalone.dll +0 -0
- matlab/extern/bin/win64/libMatlabDataArray.dll +0 -0
- matlab/extern/bin/win64/matlabmultidimarrayforpython.cp310-win_amd64.pyd +0 -0
- matlab/extern/bin/win64/matlabmultidimarrayforpython.cp39-win_amd64.pyd +0 -0
- matlab/extern/bin/win64/matlabmultidimarrayforpython.pyd +0 -0
- matlab/production_server/__init__.py +2 -0
- matlab/production_server/_internal_mps/__init__.py +2 -0
- matlab/production_server/_internal_mps/feval_handler.py +76 -0
- matlab/production_server/_internal_mps/invocation_handler_utils.py +52 -0
- matlab/production_server/_internal_mps/matlab_array_builder.py +201 -0
- matlab/production_server/_internal_mps/matlab_response_builder.py +134 -0
- matlab/production_server/_proto_generated/MATLABArray_pb2.py +129 -0
- matlab/production_server/_proto_generated/MATLABError_pb2.py +27 -0
- matlab/production_server/_proto_generated/MATLABParams_pb2.py +26 -0
- matlab/production_server/_proto_generated/MATLABResult_pb2.py +27 -0
- matlab/production_server/_proto_generated/__init__.py +0 -0
- matlab/production_server/client.py +140 -0
- matlab/production_server/mpsexceptions.py +56 -0
- matlab_prodserver_client-24.2.dist-info/LICENSE.txt +27 -0
- matlab_prodserver_client-24.2.dist-info/METADATA +94 -0
- matlab_prodserver_client-24.2.dist-info/RECORD +77 -0
- matlab_prodserver_client-24.2.dist-info/WHEEL +5 -0
- matlab_prodserver_client-24.2.dist-info/top_level.txt +3 -0
- six.py +953 -0
|
@@ -0,0 +1,127 @@
|
|
|
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.descriptor_database."""
|
|
32
|
+
|
|
33
|
+
__author__ = 'matthewtoia@google.com (Matt Toia)'
|
|
34
|
+
|
|
35
|
+
import unittest
|
|
36
|
+
import warnings
|
|
37
|
+
|
|
38
|
+
from google.protobuf_ml import unittest_pb2
|
|
39
|
+
from google.protobuf_ml import descriptor_pb2
|
|
40
|
+
from google.protobuf_ml.internal import factory_test2_pb2
|
|
41
|
+
from google.protobuf_ml.internal import no_package_pb2
|
|
42
|
+
from google.protobuf_ml.internal import testing_refleaks
|
|
43
|
+
from google.protobuf_ml import descriptor_database
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@testing_refleaks.TestCase
|
|
47
|
+
class DescriptorDatabaseTest(unittest.TestCase):
|
|
48
|
+
|
|
49
|
+
def testAdd(self):
|
|
50
|
+
db = descriptor_database.DescriptorDatabase()
|
|
51
|
+
file_desc_proto = descriptor_pb2.FileDescriptorProto.FromString(
|
|
52
|
+
factory_test2_pb2.DESCRIPTOR.serialized_pb)
|
|
53
|
+
file_desc_proto2 = descriptor_pb2.FileDescriptorProto.FromString(
|
|
54
|
+
no_package_pb2.DESCRIPTOR.serialized_pb)
|
|
55
|
+
db.Add(file_desc_proto)
|
|
56
|
+
db.Add(file_desc_proto2)
|
|
57
|
+
|
|
58
|
+
self.assertEqual(file_desc_proto, db.FindFileByName(
|
|
59
|
+
'google/protobuf_ml/internal/factory_test2.proto'))
|
|
60
|
+
# Can find message type.
|
|
61
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
62
|
+
'google.protobuf_ml.python.internal.Factory2Message'))
|
|
63
|
+
# Can find nested message type.
|
|
64
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
65
|
+
'google.protobuf_ml.python.internal.Factory2Message.NestedFactory2Message'))
|
|
66
|
+
# Can find enum type.
|
|
67
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
68
|
+
'google.protobuf_ml.python.internal.Factory2Enum'))
|
|
69
|
+
# Can find nested enum type.
|
|
70
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
71
|
+
'google.protobuf_ml.python.internal.Factory2Message.NestedFactory2Enum'))
|
|
72
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
73
|
+
'google.protobuf_ml.python.internal.MessageWithNestedEnumOnly.NestedEnum'))
|
|
74
|
+
# Can find field.
|
|
75
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
76
|
+
'google.protobuf_ml.python.internal.Factory2Message.list_field'))
|
|
77
|
+
# Can find enum value.
|
|
78
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
79
|
+
'google.protobuf_ml.python.internal.Factory2Enum.FACTORY_2_VALUE_0'))
|
|
80
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
81
|
+
'google.protobuf_ml.python.internal.FACTORY_2_VALUE_0'))
|
|
82
|
+
self.assertEqual(file_desc_proto2, db.FindFileContainingSymbol(
|
|
83
|
+
'.NO_PACKAGE_VALUE_0'))
|
|
84
|
+
# Can find top level extension.
|
|
85
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
86
|
+
'google.protobuf_ml.python.internal.another_field'))
|
|
87
|
+
# Can find nested extension inside a message.
|
|
88
|
+
self.assertEqual(file_desc_proto, db.FindFileContainingSymbol(
|
|
89
|
+
'google.protobuf_ml.python.internal.Factory2Message.one_more_field'))
|
|
90
|
+
|
|
91
|
+
# Can find service.
|
|
92
|
+
file_desc_proto2 = descriptor_pb2.FileDescriptorProto.FromString(
|
|
93
|
+
unittest_pb2.DESCRIPTOR.serialized_pb)
|
|
94
|
+
db.Add(file_desc_proto2)
|
|
95
|
+
self.assertEqual(file_desc_proto2, db.FindFileContainingSymbol(
|
|
96
|
+
'protobuf_unittest.TestService'))
|
|
97
|
+
|
|
98
|
+
# Non-existent field under a valid top level symbol can also be
|
|
99
|
+
# found. The behavior is the same with protobuf C++.
|
|
100
|
+
self.assertEqual(file_desc_proto2, db.FindFileContainingSymbol(
|
|
101
|
+
'protobuf_unittest.TestAllTypes.none_field'))
|
|
102
|
+
|
|
103
|
+
with self.assertRaisesRegex(KeyError, r'\'protobuf_unittest\.NoneMessage\''):
|
|
104
|
+
db.FindFileContainingSymbol('protobuf_unittest.NoneMessage')
|
|
105
|
+
|
|
106
|
+
def testConflictRegister(self):
|
|
107
|
+
db = descriptor_database.DescriptorDatabase()
|
|
108
|
+
unittest_fd = descriptor_pb2.FileDescriptorProto.FromString(
|
|
109
|
+
unittest_pb2.DESCRIPTOR.serialized_pb)
|
|
110
|
+
db.Add(unittest_fd)
|
|
111
|
+
conflict_fd = descriptor_pb2.FileDescriptorProto.FromString(
|
|
112
|
+
unittest_pb2.DESCRIPTOR.serialized_pb)
|
|
113
|
+
conflict_fd.name = 'other_file2'
|
|
114
|
+
with warnings.catch_warnings(record=True) as w:
|
|
115
|
+
# Cause all warnings to always be triggered.
|
|
116
|
+
warnings.simplefilter('always')
|
|
117
|
+
db.Add(conflict_fd)
|
|
118
|
+
self.assertTrue(len(w))
|
|
119
|
+
self.assertIs(w[0].category, RuntimeWarning)
|
|
120
|
+
self.assertIn('Conflict register for file "other_file2": ',
|
|
121
|
+
str(w[0].message))
|
|
122
|
+
self.assertIn('already defined in file '
|
|
123
|
+
'"google/protobuf_ml/unittest.proto"',
|
|
124
|
+
str(w[0].message))
|
|
125
|
+
|
|
126
|
+
if __name__ == '__main__':
|
|
127
|
+
unittest.main()
|