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,106 @@
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.proto_builder."""
32
+
33
+ import collections
34
+ import unittest
35
+
36
+ from google.protobuf_ml import descriptor_pb2 # pylint: disable=g-import-not-at-top
37
+ from google.protobuf_ml import descriptor
38
+ from google.protobuf_ml import descriptor_pool
39
+ from google.protobuf_ml import proto_builder
40
+ from google.protobuf_ml import text_format
41
+
42
+
43
+ class ProtoBuilderTest(unittest.TestCase):
44
+
45
+ def setUp(self):
46
+ self.ordered_fields = collections.OrderedDict([
47
+ ('foo', descriptor_pb2.FieldDescriptorProto.TYPE_INT64),
48
+ ('bar', descriptor_pb2.FieldDescriptorProto.TYPE_STRING),
49
+ ])
50
+ self._fields = dict(self.ordered_fields)
51
+
52
+ def testMakeSimpleProtoClass(self):
53
+ """Test that we can create a proto class."""
54
+ proto_cls = proto_builder.MakeSimpleProtoClass(
55
+ self._fields,
56
+ full_name='net.proto2.python.public.proto_builder_test.Test')
57
+ proto = proto_cls()
58
+ proto.foo = 12345
59
+ proto.bar = 'asdf'
60
+ self.assertMultiLineEqual(
61
+ 'bar: "asdf"\nfoo: 12345\n', text_format.MessageToString(proto))
62
+
63
+ def testOrderedFields(self):
64
+ """Test that the field order is maintained when given an OrderedDict."""
65
+ proto_cls = proto_builder.MakeSimpleProtoClass(
66
+ self.ordered_fields,
67
+ full_name='net.proto2.python.public.proto_builder_test.OrderedTest')
68
+ proto = proto_cls()
69
+ proto.foo = 12345
70
+ proto.bar = 'asdf'
71
+ self.assertMultiLineEqual(
72
+ 'foo: 12345\nbar: "asdf"\n', text_format.MessageToString(proto))
73
+
74
+ def testMakeSameProtoClassTwice(self):
75
+ """Test that the DescriptorPool is used."""
76
+ pool = descriptor_pool.DescriptorPool()
77
+ proto_cls1 = proto_builder.MakeSimpleProtoClass(
78
+ self._fields,
79
+ full_name='net.proto2.python.public.proto_builder_test.Test',
80
+ pool=pool)
81
+ proto_cls2 = proto_builder.MakeSimpleProtoClass(
82
+ self._fields,
83
+ full_name='net.proto2.python.public.proto_builder_test.Test',
84
+ pool=pool)
85
+ self.assertIs(proto_cls1.DESCRIPTOR, proto_cls2.DESCRIPTOR)
86
+
87
+ def testMakeLargeProtoClass(self):
88
+ """Test that large created protos don't use reserved field numbers."""
89
+ num_fields = 123456
90
+ fields = {
91
+ 'foo%d' % i: descriptor_pb2.FieldDescriptorProto.TYPE_INT64
92
+ for i in range(num_fields)
93
+ }
94
+ proto_cls = proto_builder.MakeSimpleProtoClass(
95
+ fields,
96
+ full_name='net.proto2.python.public.proto_builder_test.LargeProtoTest')
97
+
98
+ reserved_field_numbers = set(
99
+ range(descriptor.FieldDescriptor.FIRST_RESERVED_FIELD_NUMBER,
100
+ descriptor.FieldDescriptor.LAST_RESERVED_FIELD_NUMBER + 1))
101
+ proto_field_numbers = set(proto_cls.DESCRIPTOR.fields_by_number)
102
+ self.assertFalse(reserved_field_numbers.intersection(proto_field_numbers))
103
+
104
+
105
+ if __name__ == '__main__':
106
+ unittest.main()