match-predicting-ann-server-pub-api 5.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.

Potentially problematic release.


This version of match-predicting-ann-server-pub-api might be problematic. Click here for more details.

Files changed (23) hide show
  1. match_predicting_ann_server_pub_api/__init__.py +0 -0
  2. match_predicting_ann_server_pub_api/__main__.py +19 -0
  3. match_predicting_ann_server_pub_api/controllers/__init__.py +0 -0
  4. match_predicting_ann_server_pub_api/controllers/network_controller.py +29 -0
  5. match_predicting_ann_server_pub_api/controllers/security_controller.py +2 -0
  6. match_predicting_ann_server_pub_api/encoder.py +19 -0
  7. match_predicting_ann_server_pub_api/models/__init__.py +8 -0
  8. match_predicting_ann_server_pub_api/models/base_model.py +68 -0
  9. match_predicting_ann_server_pub_api/models/network_dto.py +113 -0
  10. match_predicting_ann_server_pub_api/models/predicting_data.py +89 -0
  11. match_predicting_ann_server_pub_api/models/training_data.py +143 -0
  12. match_predicting_ann_server_pub_api/models/training_match_dto.py +87 -0
  13. match_predicting_ann_server_pub_api/models/training_network_dto.py +191 -0
  14. match_predicting_ann_server_pub_api/models/training_request_dto.py +167 -0
  15. match_predicting_ann_server_pub_api/openapi/openapi.yaml +243 -0
  16. match_predicting_ann_server_pub_api/test/__init__.py +16 -0
  17. match_predicting_ann_server_pub_api/typing_utils.py +30 -0
  18. match_predicting_ann_server_pub_api/util.py +147 -0
  19. match_predicting_ann_server_pub_api-5.2.dist-info/METADATA +19 -0
  20. match_predicting_ann_server_pub_api-5.2.dist-info/RECORD +23 -0
  21. match_predicting_ann_server_pub_api-5.2.dist-info/WHEEL +5 -0
  22. match_predicting_ann_server_pub_api-5.2.dist-info/entry_points.txt +2 -0
  23. match_predicting_ann_server_pub_api-5.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,191 @@
1
+ from datetime import date, datetime # noqa: F401
2
+
3
+ from typing import List, Dict # noqa: F401
4
+
5
+ from match_predicting_ann_server_pub_api.models.base_model import Model
6
+ from match_predicting_ann_server_pub_api import util
7
+
8
+
9
+ class TrainingNetworkDTO(Model):
10
+ """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+
12
+ Do not edit the class manually.
13
+ """
14
+
15
+ def __init__(self, network_version=None, ignore_matches_with_insufficient_data=None, number_of_last_matches=None, number_of_last_common_matches=None, number_of_matches_for_team_hard_factor=None, number_of_matches_for_player_hard_factor=None): # noqa: E501
16
+ """TrainingNetworkDTO - a model defined in OpenAPI
17
+
18
+ :param network_version: The network_version of this TrainingNetworkDTO. # noqa: E501
19
+ :type network_version: int
20
+ :param ignore_matches_with_insufficient_data: The ignore_matches_with_insufficient_data of this TrainingNetworkDTO. # noqa: E501
21
+ :type ignore_matches_with_insufficient_data: bool
22
+ :param number_of_last_matches: The number_of_last_matches of this TrainingNetworkDTO. # noqa: E501
23
+ :type number_of_last_matches: int
24
+ :param number_of_last_common_matches: The number_of_last_common_matches of this TrainingNetworkDTO. # noqa: E501
25
+ :type number_of_last_common_matches: int
26
+ :param number_of_matches_for_team_hard_factor: The number_of_matches_for_team_hard_factor of this TrainingNetworkDTO. # noqa: E501
27
+ :type number_of_matches_for_team_hard_factor: int
28
+ :param number_of_matches_for_player_hard_factor: The number_of_matches_for_player_hard_factor of this TrainingNetworkDTO. # noqa: E501
29
+ :type number_of_matches_for_player_hard_factor: int
30
+ """
31
+ self.openapi_types = {
32
+ 'network_version': int,
33
+ 'ignore_matches_with_insufficient_data': bool,
34
+ 'number_of_last_matches': int,
35
+ 'number_of_last_common_matches': int,
36
+ 'number_of_matches_for_team_hard_factor': int,
37
+ 'number_of_matches_for_player_hard_factor': int
38
+ }
39
+
40
+ self.attribute_map = {
41
+ 'network_version': 'networkVersion',
42
+ 'ignore_matches_with_insufficient_data': 'ignoreMatchesWithInsufficientData',
43
+ 'number_of_last_matches': 'numberOfLastMatches',
44
+ 'number_of_last_common_matches': 'numberOfLastCommonMatches',
45
+ 'number_of_matches_for_team_hard_factor': 'numberOfMatchesForTeamHardFactor',
46
+ 'number_of_matches_for_player_hard_factor': 'numberOfMatchesForPlayerHardFactor'
47
+ }
48
+
49
+ self._network_version = network_version
50
+ self._ignore_matches_with_insufficient_data = ignore_matches_with_insufficient_data
51
+ self._number_of_last_matches = number_of_last_matches
52
+ self._number_of_last_common_matches = number_of_last_common_matches
53
+ self._number_of_matches_for_team_hard_factor = number_of_matches_for_team_hard_factor
54
+ self._number_of_matches_for_player_hard_factor = number_of_matches_for_player_hard_factor
55
+
56
+ @classmethod
57
+ def from_dict(cls, dikt) -> 'TrainingNetworkDTO':
58
+ """Returns the dict as a model
59
+
60
+ :param dikt: A dict.
61
+ :type: dict
62
+ :return: The TrainingNetworkDTO of this TrainingNetworkDTO. # noqa: E501
63
+ :rtype: TrainingNetworkDTO
64
+ """
65
+ return util.deserialize_model(dikt, cls)
66
+
67
+ @property
68
+ def network_version(self) -> int:
69
+ """Gets the network_version of this TrainingNetworkDTO.
70
+
71
+
72
+ :return: The network_version of this TrainingNetworkDTO.
73
+ :rtype: int
74
+ """
75
+ return self._network_version
76
+
77
+ @network_version.setter
78
+ def network_version(self, network_version: int):
79
+ """Sets the network_version of this TrainingNetworkDTO.
80
+
81
+
82
+ :param network_version: The network_version of this TrainingNetworkDTO.
83
+ :type network_version: int
84
+ """
85
+
86
+ self._network_version = network_version
87
+
88
+ @property
89
+ def ignore_matches_with_insufficient_data(self) -> bool:
90
+ """Gets the ignore_matches_with_insufficient_data of this TrainingNetworkDTO.
91
+
92
+
93
+ :return: The ignore_matches_with_insufficient_data of this TrainingNetworkDTO.
94
+ :rtype: bool
95
+ """
96
+ return self._ignore_matches_with_insufficient_data
97
+
98
+ @ignore_matches_with_insufficient_data.setter
99
+ def ignore_matches_with_insufficient_data(self, ignore_matches_with_insufficient_data: bool):
100
+ """Sets the ignore_matches_with_insufficient_data of this TrainingNetworkDTO.
101
+
102
+
103
+ :param ignore_matches_with_insufficient_data: The ignore_matches_with_insufficient_data of this TrainingNetworkDTO.
104
+ :type ignore_matches_with_insufficient_data: bool
105
+ """
106
+
107
+ self._ignore_matches_with_insufficient_data = ignore_matches_with_insufficient_data
108
+
109
+ @property
110
+ def number_of_last_matches(self) -> int:
111
+ """Gets the number_of_last_matches of this TrainingNetworkDTO.
112
+
113
+
114
+ :return: The number_of_last_matches of this TrainingNetworkDTO.
115
+ :rtype: int
116
+ """
117
+ return self._number_of_last_matches
118
+
119
+ @number_of_last_matches.setter
120
+ def number_of_last_matches(self, number_of_last_matches: int):
121
+ """Sets the number_of_last_matches of this TrainingNetworkDTO.
122
+
123
+
124
+ :param number_of_last_matches: The number_of_last_matches of this TrainingNetworkDTO.
125
+ :type number_of_last_matches: int
126
+ """
127
+
128
+ self._number_of_last_matches = number_of_last_matches
129
+
130
+ @property
131
+ def number_of_last_common_matches(self) -> int:
132
+ """Gets the number_of_last_common_matches of this TrainingNetworkDTO.
133
+
134
+
135
+ :return: The number_of_last_common_matches of this TrainingNetworkDTO.
136
+ :rtype: int
137
+ """
138
+ return self._number_of_last_common_matches
139
+
140
+ @number_of_last_common_matches.setter
141
+ def number_of_last_common_matches(self, number_of_last_common_matches: int):
142
+ """Sets the number_of_last_common_matches of this TrainingNetworkDTO.
143
+
144
+
145
+ :param number_of_last_common_matches: The number_of_last_common_matches of this TrainingNetworkDTO.
146
+ :type number_of_last_common_matches: int
147
+ """
148
+
149
+ self._number_of_last_common_matches = number_of_last_common_matches
150
+
151
+ @property
152
+ def number_of_matches_for_team_hard_factor(self) -> int:
153
+ """Gets the number_of_matches_for_team_hard_factor of this TrainingNetworkDTO.
154
+
155
+
156
+ :return: The number_of_matches_for_team_hard_factor of this TrainingNetworkDTO.
157
+ :rtype: int
158
+ """
159
+ return self._number_of_matches_for_team_hard_factor
160
+
161
+ @number_of_matches_for_team_hard_factor.setter
162
+ def number_of_matches_for_team_hard_factor(self, number_of_matches_for_team_hard_factor: int):
163
+ """Sets the number_of_matches_for_team_hard_factor of this TrainingNetworkDTO.
164
+
165
+
166
+ :param number_of_matches_for_team_hard_factor: The number_of_matches_for_team_hard_factor of this TrainingNetworkDTO.
167
+ :type number_of_matches_for_team_hard_factor: int
168
+ """
169
+
170
+ self._number_of_matches_for_team_hard_factor = number_of_matches_for_team_hard_factor
171
+
172
+ @property
173
+ def number_of_matches_for_player_hard_factor(self) -> int:
174
+ """Gets the number_of_matches_for_player_hard_factor of this TrainingNetworkDTO.
175
+
176
+
177
+ :return: The number_of_matches_for_player_hard_factor of this TrainingNetworkDTO.
178
+ :rtype: int
179
+ """
180
+ return self._number_of_matches_for_player_hard_factor
181
+
182
+ @number_of_matches_for_player_hard_factor.setter
183
+ def number_of_matches_for_player_hard_factor(self, number_of_matches_for_player_hard_factor: int):
184
+ """Sets the number_of_matches_for_player_hard_factor of this TrainingNetworkDTO.
185
+
186
+
187
+ :param number_of_matches_for_player_hard_factor: The number_of_matches_for_player_hard_factor of this TrainingNetworkDTO.
188
+ :type number_of_matches_for_player_hard_factor: int
189
+ """
190
+
191
+ self._number_of_matches_for_player_hard_factor = number_of_matches_for_player_hard_factor
@@ -0,0 +1,167 @@
1
+ from datetime import date, datetime # noqa: F401
2
+
3
+ from typing import List, Dict # noqa: F401
4
+
5
+ from match_predicting_ann_server_pub_api.models.base_model import Model
6
+ from match_predicting_ann_server_pub_api.models.training_network_dto import TrainingNetworkDTO
7
+ from match_predicting_ann_server_pub_api import util
8
+
9
+ from match_predicting_ann_server_pub_api.models.training_network_dto import TrainingNetworkDTO # noqa: E501
10
+
11
+ class TrainingRequestDTO(Model):
12
+ """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13
+
14
+ Do not edit the class manually.
15
+ """
16
+
17
+ def __init__(self, competition_ids=None, seasons=None, number_of_epochs=None, learning_rate=None, training_network=None): # noqa: E501
18
+ """TrainingRequestDTO - a model defined in OpenAPI
19
+
20
+ :param competition_ids: The competition_ids of this TrainingRequestDTO. # noqa: E501
21
+ :type competition_ids: List[int]
22
+ :param seasons: The seasons of this TrainingRequestDTO. # noqa: E501
23
+ :type seasons: List[int]
24
+ :param number_of_epochs: The number_of_epochs of this TrainingRequestDTO. # noqa: E501
25
+ :type number_of_epochs: int
26
+ :param learning_rate: The learning_rate of this TrainingRequestDTO. # noqa: E501
27
+ :type learning_rate: float
28
+ :param training_network: The training_network of this TrainingRequestDTO. # noqa: E501
29
+ :type training_network: TrainingNetworkDTO
30
+ """
31
+ self.openapi_types = {
32
+ 'competition_ids': List[int],
33
+ 'seasons': List[int],
34
+ 'number_of_epochs': int,
35
+ 'learning_rate': float,
36
+ 'training_network': TrainingNetworkDTO
37
+ }
38
+
39
+ self.attribute_map = {
40
+ 'competition_ids': 'competitionIds',
41
+ 'seasons': 'seasons',
42
+ 'number_of_epochs': 'numberOfEpochs',
43
+ 'learning_rate': 'learningRate',
44
+ 'training_network': 'trainingNetwork'
45
+ }
46
+
47
+ self._competition_ids = competition_ids
48
+ self._seasons = seasons
49
+ self._number_of_epochs = number_of_epochs
50
+ self._learning_rate = learning_rate
51
+ self._training_network = training_network
52
+
53
+ @classmethod
54
+ def from_dict(cls, dikt) -> 'TrainingRequestDTO':
55
+ """Returns the dict as a model
56
+
57
+ :param dikt: A dict.
58
+ :type: dict
59
+ :return: The TrainingRequestDTO of this TrainingRequestDTO. # noqa: E501
60
+ :rtype: TrainingRequestDTO
61
+ """
62
+ return util.deserialize_model(dikt, cls)
63
+
64
+ @property
65
+ def competition_ids(self) -> List[int]:
66
+ """Gets the competition_ids of this TrainingRequestDTO.
67
+
68
+
69
+ :return: The competition_ids of this TrainingRequestDTO.
70
+ :rtype: List[int]
71
+ """
72
+ return self._competition_ids
73
+
74
+ @competition_ids.setter
75
+ def competition_ids(self, competition_ids: List[int]):
76
+ """Sets the competition_ids of this TrainingRequestDTO.
77
+
78
+
79
+ :param competition_ids: The competition_ids of this TrainingRequestDTO.
80
+ :type competition_ids: List[int]
81
+ """
82
+
83
+ self._competition_ids = competition_ids
84
+
85
+ @property
86
+ def seasons(self) -> List[int]:
87
+ """Gets the seasons of this TrainingRequestDTO.
88
+
89
+
90
+ :return: The seasons of this TrainingRequestDTO.
91
+ :rtype: List[int]
92
+ """
93
+ return self._seasons
94
+
95
+ @seasons.setter
96
+ def seasons(self, seasons: List[int]):
97
+ """Sets the seasons of this TrainingRequestDTO.
98
+
99
+
100
+ :param seasons: The seasons of this TrainingRequestDTO.
101
+ :type seasons: List[int]
102
+ """
103
+
104
+ self._seasons = seasons
105
+
106
+ @property
107
+ def number_of_epochs(self) -> int:
108
+ """Gets the number_of_epochs of this TrainingRequestDTO.
109
+
110
+
111
+ :return: The number_of_epochs of this TrainingRequestDTO.
112
+ :rtype: int
113
+ """
114
+ return self._number_of_epochs
115
+
116
+ @number_of_epochs.setter
117
+ def number_of_epochs(self, number_of_epochs: int):
118
+ """Sets the number_of_epochs of this TrainingRequestDTO.
119
+
120
+
121
+ :param number_of_epochs: The number_of_epochs of this TrainingRequestDTO.
122
+ :type number_of_epochs: int
123
+ """
124
+
125
+ self._number_of_epochs = number_of_epochs
126
+
127
+ @property
128
+ def learning_rate(self) -> float:
129
+ """Gets the learning_rate of this TrainingRequestDTO.
130
+
131
+
132
+ :return: The learning_rate of this TrainingRequestDTO.
133
+ :rtype: float
134
+ """
135
+ return self._learning_rate
136
+
137
+ @learning_rate.setter
138
+ def learning_rate(self, learning_rate: float):
139
+ """Sets the learning_rate of this TrainingRequestDTO.
140
+
141
+
142
+ :param learning_rate: The learning_rate of this TrainingRequestDTO.
143
+ :type learning_rate: float
144
+ """
145
+
146
+ self._learning_rate = learning_rate
147
+
148
+ @property
149
+ def training_network(self) -> TrainingNetworkDTO:
150
+ """Gets the training_network of this TrainingRequestDTO.
151
+
152
+
153
+ :return: The training_network of this TrainingRequestDTO.
154
+ :rtype: TrainingNetworkDTO
155
+ """
156
+ return self._training_network
157
+
158
+ @training_network.setter
159
+ def training_network(self, training_network: TrainingNetworkDTO):
160
+ """Sets the training_network of this TrainingRequestDTO.
161
+
162
+
163
+ :param training_network: The training_network of this TrainingRequestDTO.
164
+ :type training_network: TrainingNetworkDTO
165
+ """
166
+
167
+ self._training_network = training_network
@@ -0,0 +1,243 @@
1
+ openapi: 3.0.1
2
+ info:
3
+ title: Match Predicting ANN Server Public API
4
+ version: "1.0"
5
+ servers:
6
+ - url: /
7
+ paths:
8
+ /api/network/predict:
9
+ post:
10
+ operationId: predict_result
11
+ requestBody:
12
+ content:
13
+ application/json:
14
+ schema:
15
+ $ref: "#/components/schemas/PredictingData"
16
+ description: Predicting data
17
+ required: true
18
+ responses:
19
+ "200":
20
+ content:
21
+ application/json:
22
+ schema:
23
+ items:
24
+ format: double
25
+ type: number
26
+ type: array
27
+ description: Successful operation
28
+ summary: Predicts the result using the given network and input data
29
+ tags:
30
+ - Network
31
+ x-openapi-router-controller: match_predicting_ann_server_pub_api.controllers.network_controller
32
+ /api/network/train:
33
+ post:
34
+ operationId: start_training
35
+ requestBody:
36
+ content:
37
+ application/json:
38
+ schema:
39
+ $ref: "#/components/schemas/TrainingData"
40
+ description: Training data
41
+ required: true
42
+ responses:
43
+ default:
44
+ content:
45
+ application/json: {}
46
+ description: default response
47
+ summary: Starts the training with the given data
48
+ tags:
49
+ - Network
50
+ x-openapi-router-controller: match_predicting_ann_server_pub_api.controllers.network_controller
51
+ components:
52
+ schemas:
53
+ NetworkDTO:
54
+ example:
55
+ sizes: sizes
56
+ biases: biases
57
+ weights: weights
58
+ properties:
59
+ sizes:
60
+ title: sizes
61
+ type: string
62
+ biases:
63
+ title: biases
64
+ type: string
65
+ weights:
66
+ title: weights
67
+ type: string
68
+ title: NetworkDTO
69
+ type: object
70
+ PredictingData:
71
+ example:
72
+ networkData:
73
+ sizes: sizes
74
+ biases: biases
75
+ weights: weights
76
+ inputs:
77
+ - 0.8008281904610115
78
+ - 0.8008281904610115
79
+ properties:
80
+ networkData:
81
+ $ref: "#/components/schemas/NetworkDTO"
82
+ inputs:
83
+ items:
84
+ format: double
85
+ type: number
86
+ title: inputs
87
+ type: array
88
+ title: PredictingData
89
+ type: object
90
+ TrainingData:
91
+ example:
92
+ trainingDTO:
93
+ seasons:
94
+ - 6
95
+ - 6
96
+ competitionIds:
97
+ - 0
98
+ - 0
99
+ trainingNetwork:
100
+ ignoreMatchesWithInsufficientData: true
101
+ numberOfLastCommonMatches: 7
102
+ numberOfMatchesForTeamHardFactor: 9
103
+ networkVersion: 5
104
+ numberOfLastMatches: 2
105
+ numberOfMatchesForPlayerHardFactor: 3
106
+ numberOfEpochs: 1
107
+ learningRate: 5.962133916683182
108
+ sizes:
109
+ - 1
110
+ - 1
111
+ startingTime: 2
112
+ matches:
113
+ - result:
114
+ - 7
115
+ - 7
116
+ inputs:
117
+ - 4.145608029883936
118
+ - 4.145608029883936
119
+ - result:
120
+ - 7
121
+ - 7
122
+ inputs:
123
+ - 4.145608029883936
124
+ - 4.145608029883936
125
+ properties:
126
+ trainingDTO:
127
+ $ref: "#/components/schemas/TrainingRequestDTO"
128
+ startingTime:
129
+ format: int64
130
+ title: startingTime
131
+ type: integer
132
+ matches:
133
+ items:
134
+ $ref: "#/components/schemas/TrainingMatchDTO"
135
+ title: matches
136
+ type: array
137
+ sizes:
138
+ items:
139
+ format: int32
140
+ type: integer
141
+ title: sizes
142
+ type: array
143
+ title: TrainingData
144
+ type: object
145
+ TrainingMatchDTO:
146
+ example:
147
+ result:
148
+ - 7
149
+ - 7
150
+ inputs:
151
+ - 4.145608029883936
152
+ - 4.145608029883936
153
+ properties:
154
+ inputs:
155
+ items:
156
+ format: double
157
+ type: number
158
+ title: inputs
159
+ type: array
160
+ result:
161
+ items:
162
+ format: int32
163
+ type: integer
164
+ title: result
165
+ type: array
166
+ title: TrainingMatchDTO
167
+ type: object
168
+ TrainingNetworkDTO:
169
+ example:
170
+ ignoreMatchesWithInsufficientData: true
171
+ numberOfLastCommonMatches: 7
172
+ numberOfMatchesForTeamHardFactor: 9
173
+ networkVersion: 5
174
+ numberOfLastMatches: 2
175
+ numberOfMatchesForPlayerHardFactor: 3
176
+ properties:
177
+ networkVersion:
178
+ format: int32
179
+ title: networkVersion
180
+ type: integer
181
+ ignoreMatchesWithInsufficientData:
182
+ title: ignoreMatchesWithInsufficientData
183
+ type: boolean
184
+ numberOfLastMatches:
185
+ format: int32
186
+ title: numberOfLastMatches
187
+ type: integer
188
+ numberOfLastCommonMatches:
189
+ format: int32
190
+ title: numberOfLastCommonMatches
191
+ type: integer
192
+ numberOfMatchesForTeamHardFactor:
193
+ format: int32
194
+ title: numberOfMatchesForTeamHardFactor
195
+ type: integer
196
+ numberOfMatchesForPlayerHardFactor:
197
+ format: int32
198
+ title: numberOfMatchesForPlayerHardFactor
199
+ type: integer
200
+ title: TrainingNetworkDTO
201
+ type: object
202
+ TrainingRequestDTO:
203
+ example:
204
+ seasons:
205
+ - 6
206
+ - 6
207
+ competitionIds:
208
+ - 0
209
+ - 0
210
+ trainingNetwork:
211
+ ignoreMatchesWithInsufficientData: true
212
+ numberOfLastCommonMatches: 7
213
+ numberOfMatchesForTeamHardFactor: 9
214
+ networkVersion: 5
215
+ numberOfLastMatches: 2
216
+ numberOfMatchesForPlayerHardFactor: 3
217
+ numberOfEpochs: 1
218
+ learningRate: 5.962133916683182
219
+ properties:
220
+ competitionIds:
221
+ items:
222
+ format: int64
223
+ type: integer
224
+ title: competitionIds
225
+ type: array
226
+ seasons:
227
+ items:
228
+ format: int32
229
+ type: integer
230
+ title: seasons
231
+ type: array
232
+ numberOfEpochs:
233
+ format: int64
234
+ title: numberOfEpochs
235
+ type: integer
236
+ learningRate:
237
+ format: double
238
+ title: learningRate
239
+ type: number
240
+ trainingNetwork:
241
+ $ref: "#/components/schemas/TrainingNetworkDTO"
242
+ title: TrainingRequestDTO
243
+ type: object
@@ -0,0 +1,16 @@
1
+ import logging
2
+
3
+ import connexion
4
+ from flask_testing import TestCase
5
+
6
+ from match_predicting_ann_server_pub_api.encoder import JSONEncoder
7
+
8
+
9
+ class BaseTestCase(TestCase):
10
+
11
+ def create_app(self):
12
+ logging.getLogger('connexion.operation').setLevel('ERROR')
13
+ app = connexion.App(__name__, specification_dir='../openapi/')
14
+ app.app.json_encoder = JSONEncoder
15
+ app.add_api('openapi.yaml', pythonic_params=True)
16
+ return app.app
@@ -0,0 +1,30 @@
1
+ import sys
2
+
3
+ if sys.version_info < (3, 7):
4
+ import typing
5
+
6
+ def is_generic(klass):
7
+ """ Determine whether klass is a generic class """
8
+ return type(klass) == typing.GenericMeta
9
+
10
+ def is_dict(klass):
11
+ """ Determine whether klass is a Dict """
12
+ return klass.__extra__ == dict
13
+
14
+ def is_list(klass):
15
+ """ Determine whether klass is a List """
16
+ return klass.__extra__ == list
17
+
18
+ else:
19
+
20
+ def is_generic(klass):
21
+ """ Determine whether klass is a generic class """
22
+ return hasattr(klass, '__origin__')
23
+
24
+ def is_dict(klass):
25
+ """ Determine whether klass is a Dict """
26
+ return klass.__origin__ == dict
27
+
28
+ def is_list(klass):
29
+ """ Determine whether klass is a List """
30
+ return klass.__origin__ == list