kaggle 1.8.3__py3-none-any.whl → 1.8.4__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.
@@ -1,608 +0,0 @@
1
- #!/usr/bin/python
2
- #
3
- # Copyright 2024 Kaggle Inc
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # coding: utf-8
18
-
19
-
20
- import pprint
21
- import re # noqa: F401
22
-
23
- import six
24
-
25
-
26
- class KernelPushRequest(object):
27
- """
28
- Attributes:
29
- project_types (dict): The key is attribute name
30
- and the value is attribute type.
31
- attribute_map (dict): The key is attribute name
32
- and the value is json key in definition.
33
- """
34
-
35
- project_types = {
36
- "id": "int",
37
- "slug": "str",
38
- "new_title": "str",
39
- "text": "str",
40
- "language": "str",
41
- "kernel_type": "str",
42
- "is_private": "bool",
43
- "enable_gpu": "bool",
44
- "enable_tpu": "bool",
45
- "enable_internet": "bool",
46
- "dataset_data_sources": "list[str]",
47
- "competition_data_sources": "list[str]",
48
- "kernel_data_sources": "list[str]",
49
- "model_data_sources": "list[str]",
50
- "category_ids": "list[str]",
51
- "docker_image_pinning_type": "str",
52
- }
53
-
54
- attribute_map = {
55
- "id": "id",
56
- "slug": "slug",
57
- "new_title": "newTitle",
58
- "text": "text",
59
- "language": "language",
60
- "kernel_type": "kernelType",
61
- "is_private": "isPrivate",
62
- "enable_gpu": "enableGpu",
63
- "enable_tpu": "enableTpu",
64
- "enable_internet": "enableInternet",
65
- "dataset_data_sources": "datasetDataSources",
66
- "competition_data_sources": "competitionDataSources",
67
- "kernel_data_sources": "kernelDataSources",
68
- "model_data_sources": "modelDataSources",
69
- "category_ids": "categoryIds",
70
- "docker_image_pinning_type": "dockerImagePinningType",
71
- }
72
-
73
- def __init__(
74
- self,
75
- id=None,
76
- slug=None,
77
- new_title=None,
78
- text=None,
79
- language=None,
80
- kernel_type=None,
81
- is_private=None,
82
- enable_gpu=None,
83
- enable_tpu=None,
84
- enable_internet=None,
85
- dataset_data_sources=None,
86
- competition_data_sources=None,
87
- kernel_data_sources=None,
88
- model_data_sources=None,
89
- category_ids=None,
90
- docker_image_pinning_type=None,
91
- ): # noqa: E501
92
-
93
- self._id = None
94
- self._slug = None
95
- self._new_title = None
96
- self._text = None
97
- self._language = None
98
- self._kernel_type = None
99
- self._is_private = None
100
- self._enable_gpu = None
101
- self._enable_tpu = None
102
- self._enable_internet = None
103
- self._dataset_data_sources = None
104
- self._competition_data_sources = None
105
- self._kernel_data_sources = None
106
- self._model_data_sources = None
107
- self._category_ids = None
108
- self._docker_image_pinning_type = None
109
- self.discriminator = None
110
-
111
- if id is not None:
112
- self.id = id
113
- if slug is not None:
114
- self.slug = slug
115
- if new_title is not None:
116
- self.new_title = new_title
117
- self.text = text
118
- self.language = language
119
- self.kernel_type = kernel_type
120
- if is_private is not None:
121
- self.is_private = is_private
122
- if enable_gpu is not None:
123
- self.enable_gpu = enable_gpu
124
- if enable_tpu is not None:
125
- self.enable_tpu = enable_tpu
126
- if enable_internet is not None:
127
- self.enable_internet = enable_internet
128
- if dataset_data_sources is not None:
129
- self.dataset_data_sources = dataset_data_sources
130
- if competition_data_sources is not None:
131
- self.competition_data_sources = competition_data_sources
132
- if kernel_data_sources is not None:
133
- self.kernel_data_sources = kernel_data_sources
134
- if model_data_sources is not None:
135
- self.model_data_sources = model_data_sources
136
- if category_ids is not None:
137
- self.category_ids = category_ids
138
- if docker_image_pinning_type is not None:
139
- self.docker_image_pinning_type = docker_image_pinning_type
140
-
141
- @property
142
- def id(self):
143
- """Gets the id of this KernelPushRequest. # noqa: E501.
144
-
145
- The kernel's ID number. One of `id` and `slug` are required. If both are specified, `id` will be preferred # noqa: E501
146
-
147
- :return: The id of this KernelPushRequest. # noqa: E501
148
- :rtype: int
149
- """
150
- return self._id
151
-
152
- @id.setter
153
- def id(self, id):
154
- """Sets the id of this KernelPushRequest.
155
-
156
- The kernel's ID number. One of `id` and `slug` are required. If both are specified, `id` will be preferred # noqa: E501
157
-
158
- :param id: The id of this KernelPushRequest. # noqa: E501
159
- :type: int
160
- """
161
-
162
- self._id = id
163
-
164
- @property
165
- def slug(self):
166
- """Gets the slug of this KernelPushRequest. # noqa: E501.
167
-
168
- The full slug of the kernel to push to, in the format `USERNAME/KERNEL-SLUG`. The kernel slug must be the title lowercased with dashes (`-`) replacing spaces. One of `id` and `slug` are required. If both are specified, `id` will be preferred # noqa: E501
169
-
170
- :return: The slug of this KernelPushRequest. # noqa: E501
171
- :rtype: str
172
- """
173
- return self._slug
174
-
175
- @slug.setter
176
- def slug(self, slug):
177
- """Sets the slug of this KernelPushRequest.
178
-
179
- The full slug of the kernel to push to, in the format `USERNAME/KERNEL-SLUG`. The kernel slug must be the title lowercased with dashes (`-`) replacing spaces. One of `id` and `slug` are required. If both are specified, `id` will be preferred # noqa: E501
180
-
181
- :param slug: The slug of this KernelPushRequest. # noqa: E501
182
- :type: str
183
- """
184
-
185
- self._slug = slug
186
-
187
- @property
188
- def new_title(self):
189
- """Gets the new_title of this KernelPushRequest. # noqa: E501.
190
-
191
- The title to be set on the kernel # noqa: E501
192
-
193
- :return: The new_title of this KernelPushRequest. # noqa: E501
194
- :rtype: str
195
- """
196
- return self._new_title
197
-
198
- @new_title.setter
199
- def new_title(self, new_title):
200
- """Sets the new_title of this KernelPushRequest.
201
-
202
- The title to be set on the kernel # noqa: E501
203
-
204
- :param new_title: The new_title of this KernelPushRequest. #
205
- noqa: E501
206
- :type: str
207
- """
208
-
209
- self._new_title = new_title
210
-
211
- @property
212
- def text(self):
213
- """Gets the text of this KernelPushRequest. # noqa: E501.
214
-
215
- The kernel's source code # noqa: E501
216
-
217
- :return: The text of this KernelPushRequest. # noqa: E501
218
- :rtype: str
219
- """
220
- return self._text
221
-
222
- @text.setter
223
- def text(self, text):
224
- """Sets the text of this KernelPushRequest.
225
-
226
- The kernel's source code # noqa: E501
227
-
228
- :param text: The text of this KernelPushRequest. # noqa: E501
229
- :type: str
230
- """
231
- if text is None:
232
- raise ValueError("Invalid value for `text`, must not be `None`") # noqa: E501
233
-
234
- self._text = text
235
-
236
- @property
237
- def language(self):
238
- """Gets the language of this KernelPushRequest. # noqa: E501.
239
-
240
- The language that the kernel is written in # noqa: E501
241
-
242
- :return: The language of this KernelPushRequest. # noqa: E501
243
- :rtype: str
244
- """
245
- return self._language
246
-
247
- @language.setter
248
- def language(self, language):
249
- """Sets the language of this KernelPushRequest.
250
-
251
- The language that the kernel is written in # noqa: E501
252
-
253
- :param language: The language of this KernelPushRequest. #
254
- noqa: E501
255
- :type: str
256
- """
257
- if language is None:
258
- raise ValueError("Invalid value for `language`, must not be `None`") # noqa: E501
259
- allowed_values = ["python", "r", "rmarkdown"] # noqa: E501
260
- if language not in allowed_values:
261
- raise ValueError(
262
- "Invalid value for `language` ({0}), must be one of {1}".format(language, allowed_values) # noqa: E501
263
- )
264
-
265
- self._language = language
266
-
267
- @property
268
- def kernel_type(self):
269
- """Gets the kernel_type of this KernelPushRequest. # noqa: E501.
270
-
271
- The type of kernel. Cannot be changed once the kernel has been
272
- created # noqa: E501
273
-
274
- :return: The kernel_type of this KernelPushRequest. # noqa: E501
275
- :rtype: str
276
- """
277
- return self._kernel_type
278
-
279
- @kernel_type.setter
280
- def kernel_type(self, kernel_type):
281
- """Sets the kernel_type of this KernelPushRequest.
282
-
283
- The type of kernel. Cannot be changed once the kernel has been
284
- created # noqa: E501
285
-
286
- :param kernel_type: The kernel_type of this KernelPushRequest. #
287
- noqa: E501
288
- :type: str
289
- """
290
- if kernel_type is None:
291
- raise ValueError("Invalid value for `kernel_type`, must not be `None`") # noqa: E501
292
- allowed_values = ["script", "notebook"] # noqa: E501
293
- if kernel_type not in allowed_values:
294
- raise ValueError(
295
- "Invalid value for `kernel_type` ({0}), must be one of {1}".format( # noqa: E501
296
- kernel_type, allowed_values
297
- )
298
- )
299
-
300
- self._kernel_type = kernel_type
301
-
302
- @property
303
- def is_private(self):
304
- """Gets the is_private of this KernelPushRequest. # noqa: E501.
305
-
306
- Whether or not the kernel should be private # noqa: E501
307
-
308
- :return: The is_private of this KernelPushRequest. # noqa: E501
309
- :rtype: bool
310
- """
311
- return self._is_private
312
-
313
- @is_private.setter
314
- def is_private(self, is_private):
315
- """Sets the is_private of this KernelPushRequest.
316
-
317
- Whether or not the kernel should be private # noqa: E501
318
-
319
- :param is_private: The is_private of this KernelPushRequest. #
320
- noqa: E501
321
- :type: bool
322
- """
323
-
324
- self._is_private = is_private
325
-
326
- @property
327
- def enable_gpu(self):
328
- """Gets the enable_gpu of this KernelPushRequest. # noqa: E501.
329
-
330
- Whether or not the kernel should run on a GPU # noqa: E501
331
-
332
- :return: The enable_gpu of this KernelPushRequest. # noqa: E501
333
- :rtype: bool
334
- """
335
- return self._enable_gpu
336
-
337
- @enable_gpu.setter
338
- def enable_gpu(self, enable_gpu):
339
- """Sets the enable_gpu of this KernelPushRequest.
340
-
341
- Whether or not the kernel should run on a GPU # noqa: E501
342
-
343
- :param enable_gpu: The enable_gpu of this KernelPushRequest. #
344
- noqa: E501
345
- :type: bool
346
- """
347
-
348
- self._enable_gpu = enable_gpu
349
-
350
- @property
351
- def enable_tpu(self):
352
- """Gets the enable_tpu of this KernelPushRequest. # noqa: E501.
353
-
354
- Whether or not the kernel should run on a TPU # noqa: E501
355
-
356
- :return: The enable_tpu of this KernelPushRequest. # noqa: E501
357
- :rtype: bool
358
- """
359
- return self._enable_tpu
360
-
361
- @enable_tpu.setter
362
- def enable_tpu(self, enable_tpu):
363
- """Sets the enable_tpu of this KernelPushRequest.
364
-
365
- Whether or not the kernel should run on a TPU # noqa: E501
366
-
367
- :param enable_tpu: The enable_tpu of this KernelPushRequest. #
368
- noqa: E501
369
- :type: bool
370
- """
371
-
372
- self._enable_tpu = enable_tpu
373
-
374
- @property
375
- def enable_internet(self):
376
- """Gets the enable_internet of this KernelPushRequest. # noqa: E501.
377
-
378
- Whether or not the kernel should be able to access the internet
379
- # noqa: E501
380
-
381
- :return: The enable_internet of this KernelPushRequest. # noqa:
382
- E501
383
- :rtype: bool
384
- """
385
- return self._enable_internet
386
-
387
- @enable_internet.setter
388
- def enable_internet(self, enable_internet):
389
- """Sets the enable_internet of this KernelPushRequest.
390
-
391
- Whether or not the kernel should be able to access the internet
392
- # noqa: E501
393
-
394
- :param enable_internet: The enable_internet of this
395
- KernelPushRequest. # noqa: E501
396
- :type: bool
397
- """
398
-
399
- self._enable_internet = enable_internet
400
-
401
- @property
402
- def dataset_data_sources(self):
403
- """Gets the dataset_data_sources of this KernelPushRequest. # noqa:
404
- E501.
405
-
406
- A list of dataset data sources that the kernel should use. Each
407
- dataset is specified as `USERNAME/DATASET-SLUG` # noqa: E501
408
-
409
- :return: The dataset_data_sources of this KernelPushRequest. #
410
- noqa: E501
411
- :rtype: list[str]
412
- """
413
- return self._dataset_data_sources
414
-
415
- @dataset_data_sources.setter
416
- def dataset_data_sources(self, dataset_data_sources):
417
- """Sets the dataset_data_sources of this KernelPushRequest.
418
-
419
- A list of dataset data sources that the kernel should use. Each
420
- dataset is specified as `USERNAME/DATASET-SLUG` # noqa: E501
421
-
422
- :param dataset_data_sources: The dataset_data_sources of this
423
- KernelPushRequest. # noqa: E501
424
- :type: list[str]
425
- """
426
-
427
- self._dataset_data_sources = dataset_data_sources
428
-
429
- @property
430
- def competition_data_sources(self):
431
- """Gets the competition_data_sources of this KernelPushRequest. #
432
- noqa: E501.
433
-
434
- A list of competition data sources that the kernel should use #
435
- noqa: E501
436
-
437
- :return: The competition_data_sources of this KernelPushRequest.
438
- # noqa: E501
439
- :rtype: list[str]
440
- """
441
- return self._competition_data_sources
442
-
443
- @competition_data_sources.setter
444
- def competition_data_sources(self, competition_data_sources):
445
- """Sets the competition_data_sources of this KernelPushRequest.
446
-
447
- A list of competition data sources that the kernel should use #
448
- noqa: E501
449
-
450
- :param competition_data_sources: The competition_data_sources of
451
- this KernelPushRequest. # noqa: E501
452
- :type: list[str]
453
- """
454
-
455
- self._competition_data_sources = competition_data_sources
456
-
457
- @property
458
- def kernel_data_sources(self):
459
- """Gets the kernel_data_sources of this KernelPushRequest. # noqa:
460
- E501.
461
-
462
- A list of kernel data sources that the kernel should use. Each
463
- dataset is specified as `USERNAME/KERNEL-SLUG` # noqa: E501
464
-
465
- :return: The kernel_data_sources of this KernelPushRequest. #
466
- noqa: E501
467
- :rtype: list[str]
468
- """
469
- return self._kernel_data_sources
470
-
471
- @kernel_data_sources.setter
472
- def kernel_data_sources(self, kernel_data_sources):
473
- """Sets the kernel_data_sources of this KernelPushRequest.
474
-
475
- A list of kernel data sources that the kernel should use. Each
476
- dataset is specified as `USERNAME/KERNEL-SLUG` # noqa: E501
477
-
478
- :param kernel_data_sources: The kernel_data_sources of this
479
- KernelPushRequest. # noqa: E501
480
- :type: list[str]
481
- """
482
-
483
- self._kernel_data_sources = kernel_data_sources
484
-
485
- @property
486
- def model_data_sources(self):
487
- """Gets the model_data_sources of this KernelPushRequest. # noqa:
488
- E501.
489
-
490
- A list of model data sources that the kernel should use. Each model is specified as `USERNAME/MODEL-SLUG/FRAMEWORK/VARIATION-SLUG/VERSION-NUMBER` # noqa: E501
491
-
492
- :return: The model_data_sources of this KernelPushRequest. # noqa: E501
493
- :rtype: list[str]
494
- """
495
- return self._model_data_sources
496
-
497
- @model_data_sources.setter
498
- def model_data_sources(self, model_data_sources):
499
- """Sets the model_data_sources of this KernelPushRequest.
500
-
501
- A list of model data sources that the kernel should use. Each model is specified as `USERNAME/MODEL-SLUG/FRAMEWORK/VARIATION-SLUG/VERSION-NUMBER` # noqa: E501
502
-
503
- :param model_data_sources: The model_data_sources of this KernelPushRequest. # noqa: E501
504
- :type: list[str]
505
- """
506
-
507
- self._model_data_sources = model_data_sources
508
-
509
- @property
510
- def category_ids(self):
511
- """Gets the category_ids of this KernelPushRequest. # noqa: E501.
512
-
513
- A list of tag IDs to associated with the kernel # noqa: E501
514
-
515
- :return: The category_ids of this KernelPushRequest. # noqa:
516
- E501
517
- :rtype: list[str]
518
- """
519
- return self._category_ids
520
-
521
- @category_ids.setter
522
- def category_ids(self, category_ids):
523
- """Sets the category_ids of this KernelPushRequest.
524
-
525
- A list of tag IDs to associated with the kernel # noqa: E501
526
-
527
- :param category_ids: The category_ids of this KernelPushRequest.
528
- # noqa: E501
529
- :type: list[str]
530
- """
531
-
532
- self._category_ids = category_ids
533
-
534
- @property
535
- def docker_image_pinning_type(self):
536
- """Gets the docker_image_pinning_type of this KernelPushRequest. #
537
- noqa: E501.
538
-
539
- Which docker image to use for executing new versions going
540
- forward. # noqa: E501
541
-
542
- :return: The docker_image_pinning_type of this
543
- KernelPushRequest. # noqa: E501
544
- :rtype: str
545
- """
546
- return self._docker_image_pinning_type
547
-
548
- @docker_image_pinning_type.setter
549
- def docker_image_pinning_type(self, docker_image_pinning_type):
550
- """Sets the docker_image_pinning_type of this KernelPushRequest.
551
-
552
- Which docker image to use for executing new versions going
553
- forward. # noqa: E501
554
-
555
- :param docker_image_pinning_type: The docker_image_pinning_type
556
- of this KernelPushRequest. # noqa: E501
557
- :type: str
558
- """
559
- allowed_values = ["original", "latest"] # noqa: E501
560
- if docker_image_pinning_type not in allowed_values:
561
- raise ValueError(
562
- "Invalid value for `docker_image_pinning_type` ({0}), must be one of {1}".format( # noqa: E501
563
- docker_image_pinning_type, allowed_values
564
- )
565
- )
566
-
567
- self._docker_image_pinning_type = docker_image_pinning_type
568
-
569
- def to_dict(self):
570
- """Returns the model properties as a dict."""
571
- result = {}
572
-
573
- for attr, _ in six.iteritems(self.project_types):
574
- value = getattr(self, attr)
575
- if isinstance(value, list):
576
- result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
577
- elif hasattr(value, "to_dict"):
578
- result[attr] = value.to_dict()
579
- elif isinstance(value, dict):
580
- result[attr] = dict(
581
- map(
582
- lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
583
- value.items(),
584
- )
585
- )
586
- else:
587
- result[attr] = value
588
-
589
- return result
590
-
591
- def to_str(self):
592
- """Returns the string representation of the model."""
593
- return pprint.pformat(self.to_dict())
594
-
595
- def __repr__(self):
596
- """For `print` and `pprint`"""
597
- return self.to_str()
598
-
599
- def __eq__(self, other):
600
- """Returns true if both objects are equal."""
601
- if not isinstance(other, KernelPushRequest):
602
- return False
603
-
604
- return self.__dict__ == other.__dict__
605
-
606
- def __ne__(self, other):
607
- """Returns true if both objects are not equal."""
608
- return not self == other