id
int64 0
843k
| repository_name
stringlengths 7
55
| file_path
stringlengths 9
332
| class_name
stringlengths 3
290
| human_written_code
stringlengths 12
4.36M
| class_skeleton
stringlengths 19
2.2M
| total_program_units
int64 1
9.57k
| total_doc_str
int64 0
4.2k
| AvgCountLine
float64 0
7.89k
| AvgCountLineBlank
float64 0
300
| AvgCountLineCode
float64 0
7.89k
| AvgCountLineComment
float64 0
7.89k
| AvgCyclomatic
float64 0
130
| CommentToCodeRatio
float64 0
176
| CountClassBase
float64 0
48
| CountClassCoupled
float64 0
589
| CountClassCoupledModified
float64 0
581
| CountClassDerived
float64 0
5.37k
| CountDeclInstanceMethod
float64 0
4.2k
| CountDeclInstanceVariable
float64 0
299
| CountDeclMethod
float64 0
4.2k
| CountDeclMethodAll
float64 0
4.2k
| CountLine
float64 1
115k
| CountLineBlank
float64 0
9.01k
| CountLineCode
float64 0
94.4k
| CountLineCodeDecl
float64 0
46.1k
| CountLineCodeExe
float64 0
91.3k
| CountLineComment
float64 0
27k
| CountStmt
float64 1
93.2k
| CountStmtDecl
float64 0
46.1k
| CountStmtExe
float64 0
90.2k
| MaxCyclomatic
float64 0
759
| MaxInheritanceTree
float64 0
16
| MaxNesting
float64 0
34
| SumCyclomatic
float64 0
6k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
141,048 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/cli.py
|
src.kaggle.cli.Help
|
class Help(object):
kaggle_choices = [
'competitions', 'c', 'datasets', 'd', 'kernels', 'k', 'models', 'm',
'files', 'f', 'config'
]
competitions_choices = [
'list', 'files', 'download', 'submit', 'submissions', 'leaderboard'
]
datasets_choices = [
'list', 'files', 'download', 'create', 'version', 'init', 'metadata',
'status'
]
kernels_choices = [
'list', 'files', 'init', 'push', 'pull', 'output', 'status'
]
models_choices = [
'instances', 'get', 'list', 'init', 'create', 'delete', 'update'
]
model_instances_choices = [
'versions', 'get', 'files', 'init', 'create', 'delete', 'update'
]
model_instance_versions_choices = [
'init', 'create', 'download', 'delete', 'files'
]
files_choices = ['upload']
config_choices = ['view', 'set', 'unset']
kaggle = 'Use one of:\ncompetitions {' + ', '.join(
competitions_choices) + '}\ndatasets {' + ', '.join(
datasets_choices) + '}\nkernels {' + ', '.join(
kernels_choices) + '}\nmodels {' + ', '.join(
models_choices) + '}\nmodels instances {' + ', '.join(
model_instances_choices
) + '}\nmodels instances versions {' + ', '.join(
model_instance_versions_choices
) + '}\nconfig {' + ', '.join(config_choices) + '}'
group_competitions = 'Commands related to Kaggle competitions'
group_datasets = 'Commands related to Kaggle datasets'
group_kernels = 'Commands related to Kaggle kernels'
group_models = 'Commands related to Kaggle models'
group_model_instances = 'Commands related to Kaggle model instances'
group_model_instance_versions = 'Commands related to Kaggle model instance versions'
group_files = 'Commands related files'
group_config = 'Configuration settings'
# Competitions commands
command_competitions_list = 'List available competitions'
command_competitions_files = 'List competition files'
command_competitions_download = 'Download competition files'
command_competitions_submit = 'Make a new competition submission'
command_competitions_submissions = 'Show your competition submissions'
command_competitions_leaderboard = 'Get competition leaderboard information'
# Datasets commands
command_datasets_list = 'List available datasets'
command_datasets_files = 'List dataset files'
command_datasets_download = 'Download dataset files'
command_datasets_new = 'Create a new dataset'
command_datasets_new_version = 'Create a new dataset version'
command_datasets_init = 'Initialize metadata file for dataset creation'
command_datasets_metadata = 'Download metadata about a dataset'
command_datasets_status = 'Get the creation status for a dataset'
# Kernels commands
command_kernels_list = (
'List available kernels. By default, shows 20 results sorted by '
'hotness')
command_kernels_files = 'List kernel output files'
command_kernels_init = 'Initialize metadata file for a kernel'
command_kernels_push = 'Push new code to a kernel and run the kernel'
command_kernels_pull = 'Pull down code from a kernel'
command_kernels_output = 'Get data output from the latest kernel run'
command_kernels_status = 'Display the status of the latest kernel run'
# Models commands
command_models_files = 'List model files'
command_models_get = 'Get a model'
command_models_list = 'List models'
command_models_init = 'Initialize metadata file for model creation'
command_models_new = 'Create a new model'
command_models_delete = 'Delete a model'
command_models_update = 'Update a model'
# Files commands
command_files_upload = 'Upload files'
# Config commands
command_config_path = (
'Set folder where competition or dataset files will be '
'downloaded')
command_config_proxy = 'Set proxy server'
command_config_competition = 'Set default competition'
command_config_view = 'View current config values'
command_config_set = 'Set a configuration value'
command_config_unset = 'Clear a configuration value'
# General params
param_downfolder = (
'Folder where file(s) will be downloaded, defaults to current working '
'directory')
param_wp = 'Download files to current working path'
param_proxy = 'Proxy for HTTP requests'
param_quiet = (
'Suppress printing information about the upload/download progress')
param_public = 'Create publicly (default is private)'
param_keep_tabular = (
'Do not convert tabular files to CSV (default is to convert)')
param_dir_mode = (
'What to do with directories: "skip" - ignore; "zip" - compressed upload; "tar" - '
'uncompressed upload')
param_delete_old_version = 'Delete old versions of this dataset'
param_force = ('Skip check whether local version of file is up to date, force'
' file download')
param_upfile = 'File for upload (full path), or the name of the output file produced by a kernel (for code competitions)'
param_code_kernel = 'Name of kernel (notebook) to submit to a code competition'
param_code_version = 'Version of kernel to submit to a code competition, e.g. "Version 1"'
param_csv = 'Print results in CSV format (if not set print in table format)'
param_page = 'Page number for results paging. Page size is 20 by default'
# NOTE: Default and max page size are set by the mid-tier code.
param_page_size = ('Number of items to show on a page. Default size is 20, '
'max is 200')
param_page_token = 'Page token for results paging.'
param_search = 'Term(s) to search for'
param_mine = 'Display only my items'
param_unzip = (
'Unzip the downloaded file. Will delete the zip file when completed.')
param_untar = (
'Untar the downloaded file. Will delete the tar file when completed.')
param_yes = (
'Sets any confirmation values to "yes" automatically. Users will not be asked to confirm.'
)
# Competitions params
param_competition = ('Competition URL suffix (use "kaggle competitions list" '
'to show options)\nIf empty, the default competition '
'will be used (use "kaggle config set competition")"')
param_competition_nonempty = (
'Competition URL suffix (use "kaggle competitions list" to show '
'options)')
param_competition_leaderboard_view = 'Show the top of the leaderboard'
param_competition_leaderboard_download = 'Download entire leaderboard'
param_competition_file = (
'File name, all files downloaded if not provided\n(use "kaggle '
'competitions files -c <competition>" to show options)')
param_competition_message = 'Message describing this submission'
param_competition_group = (
'Search for competitions in a specific group. Default is \'general\'. '
'Valid options are \'general\', \'entered\', and \'inClass\'')
param_competition_category = (
'Search for competitions of a specific category. Default is \'all\'. '
'Valid options are \'all\', \'featured\', \'research\', '
'\'recruitment\', \'gettingStarted\', \'masters\', and \'playground\'')
param_competition_sort_by = (
'Sort list results. Default is \'latestDeadline\'. Valid options are '
'\'grouped\', \'prize\', \'earliestDeadline\', \'latestDeadline\', '
'\'numberOfTeams\', and \'recentlyCreated\'')
# Datasets params
param_dataset = ('Dataset URL suffix in format <owner>/<dataset-name> (use '
'"kaggle datasets list" to show options)')
param_dataset_file = ('File name, all files downloaded if not provided\n(use '
'"kaggle datasets files -d <dataset>" to show options)')
param_dataset_version_notes = 'Message describing the new version'
param_dataset_upfile = (
'Folder for upload, containing data files and a '
'special datasets-metadata.json file '
'(https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata). '
'Defaults to current working directory')
param_dataset_sort_by = (
'Sort list results. Default is \'hottest\'. Valid options are '
'\'hottest\', \'votes\', \'updated\', and \'active\'')
param_dataset_size = (
'DEPRECATED. Please use --max-size and --min-size to filter dataset sizes.'
)
param_dataset_file_type = (
'Search for datasets with a specific file type. Default is \'all\'. '
'Valid options are \'all\', \'csv\', \'sqlite\', \'json\', and '
'\'bigQuery\'. Please note that bigQuery datasets cannot be downloaded')
param_dataset_license = (
'Search for datasets with a specific license. Default is \'all\'. '
'Valid options are \'all\', \'cc\', \'gpl\', \'odb\', and \'other\'')
param_dataset_tags = (
'Search for datasets that have specific tags. Tag list should be '
'comma separated')
param_dataset_user = (
'Find public datasets owned by a specific user or organization')
param_dataset_metadata_dir = (
'Location to download dataset metadata to. Defaults to current working '
'directory')
param_dataset_metadata_update = ('A flag to indicate whether the dataset'
'metadata should be updated.')
param_dataset_maxsize = 'Specify the maximum size of the dataset to return (bytes)'
param_dataset_minsize = 'Specify the minimum size of the dataset to return (bytes)'
# Kernels params
param_kernel = (
'Kernel URL suffix in format <owner>/<kernel-name> (use "kaggle '
'kernels list" to show options)')
param_kernel_init = (
'Create a metadata file for an existing kernel URL suffix in format '
'<owner>/<kernel-name> (use "kaggle kernels list" to show options)')
param_kernel_upfile = (
'Folder for upload, containing data files and a '
'special kernel-metadata.json file '
'(https://github.com/Kaggle/kaggle-api/wiki/Kernel-Metadata). '
'Defaults to current working directory')
param_kernel_parent = 'Find children of the specified parent kernel'
param_kernel_competition = 'Find kernels for a given competition slug'
param_kernel_dataset = ('Find kernels for a given dataset slug. Format is '
'{username/dataset-slug}')
param_kernel_user = 'Find kernels created by a given username'
# TODO(b/129357583): Pull these from the same spot as the api impl
param_kernel_language = (
'Specify the language the kernel is written in. Default is \'all\'. '
'Valid options are \'all\', \'python\', \'r\', \'sqlite\', and '
'\'julia\'')
param_kernel_type = ('Specify the type of kernel. Default is \'all\'. Valid '
'options are \'all\', \'script\', and \'notebook\'')
param_kernel_output_type = ('Search for specific kernel output types. '
'Default is \'all\'. Valid options are \'all\', '
'\'visualizations\', and \'data\'')
param_kernel_sort_by = ('Sort list results. Default is \'hotness\'. Valid '
'options are \'hotness\', \'commentCount\', '
'\'dateCreated\', \'dateRun\', \'relevance\', '
'\'scoreAscending\', \'scoreDescending\', '
'\'viewCount\', and \'voteCount\'. \'relevance\' '
'is only applicable if a search term is specified.')
param_kernel_pull_metadata = 'Generate metadata when pulling kernel'
# Models params
param_model = ('Model URL suffix in format <owner>/<model-name>')
param_model_sort_by = (
'Sort list results. Default is \'hotness\'. Valid options are '
'\'hotness\', \'downloadCount\', \'voteCount\', \'notebookCount\' and \'createTime\''
)
param_model_owner = (
'Find public models owned by a specific user or organization')
param_model_downfile = (
'Folder containing the special model-metadata.json file '
'(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata).')
param_model_upfile = (
'Folder containing the special model-metadata.json file '
'(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata). '
'Defaults to current working directory')
# Model Instances params
param_model_instance = (
'Model Instance URL suffix in format <owner>/<model-name>/<framework>/<instance-slug>'
)
command_model_instances_get = 'Get a model instance'
command_model_instances_init = 'Initialize metadata file for model instance creation'
command_model_instances_files = 'List files for the current version of a model instance'
command_model_instances_new = 'Create a new model instance'
param_model_instance_downfile = (
'Folder for downloading the special model-instance-metadata.json file '
'(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata#model-instance). '
)
param_model_instance_upfile = (
'Folder for upload, containing data files and a '
'special model-instance-metadata.json file '
'(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata#model-instance). '
'Defaults to current working directory')
command_model_instances_delete = 'Delete a model instance'
command_model_instances_update = 'Update a model instance'
# Model Instance Versions params
param_model_instance_version = (
'Model Instance Version URL suffix in format <owner>/<model-name>/<framework>/<instance-slug>/<version-number>'
)
# Model Instance Versions params
command_model_instance_versions_new = 'Create a new model instance version'
param_model_instance_version_upfile = (
'Folder for upload. Defaults to current working directory')
command_model_instance_versions_delete = 'Delete a model instance version'
command_model_instance_versions_download = 'Download model instance version files'
command_model_instance_versions_files = 'List model instance version files'
param_model_instance_version_notes = 'Version notes to record for the new model instance version'
# Files params
param_files_upload_inbox_path = 'Virtual path on the server where the uploaded files will be stored'
param_files_upload_local_paths = (
'List of local filesystem paths. Each path creates a separate file on the server. '
'Directories are uploaded as zip archives by default (e.g., a directory called '
'"data" will be uploaded as "data.zip")')
param_files_upload_no_compress = 'Whether to compress directories (zip) or not (tar)'
param_files_upload_no_resume = 'Whether to skip resumable uploads.'
# Config params
param_config_name = ('Name of the configuration parameter\n(one of '
'competition, path, proxy)')
param_config_value = (('Value of the configuration parameter, valid values '
'depending on name\n- competition: ') +
param_competition_nonempty + '\n- path: ' +
param_downfolder + '\n- proxy: ' + param_proxy)
|
class Help(object):
pass
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.08 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 296 | 18 | 260 | 137 | 259 | 20 | 137 | 137 | 136 | 0 | 1 | 0 | 0 |
141,049 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/configuration.py
|
src.kaggle.configuration.Configuration
|
class Configuration:
def __init__(self):
"""Constructor"""
# Default Base url
self.host = _get_endpoint_from_env() or "https://www.kaggle.com/api/v1"
# Authentication Settings
# dict to store API key(s)
self.api_key = {}
# dict to store API prefix (e.g. Bearer)
self.api_key_prefix = {}
# Username for HTTP basic authentication
self.username = ""
# Password for HTTP basic authentication
self.password = ""
# Logging Settings
self.logger = {
"package_logger": logging.getLogger("kaggle"),
"urllib3_logger": logging.getLogger("urllib3")
}
# Log format
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
# Log stream handler
self.logger_stream_handler = None
# Log file handler
self.logger_file_handler = None
# Debug file location
self.logger_file = None
# Debug switch
self.debug = False
@property
def logger_file(self):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
def logger_file(self, value):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
if self.logger_stream_handler:
logger.removeHandler(self.logger_stream_handler)
else:
# If not set logging file,
# then add stream handler and remove file handler.
self.logger_stream_handler = logging.StreamHandler()
self.logger_stream_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_stream_handler)
if self.logger_file_handler:
logger.removeHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
@property
def logger_format(self):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
return self.__logger_format
@logger_format.setter
def logger_format(self, value):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
"""
if (self.api_key.get(identifier) and self.api_key_prefix.get(identifier)):
return self.api_key_prefix[identifier] + ' ' + self.api_key[
identifier] # noqa: E501
elif self.api_key.get(identifier):
return self.api_key[identifier]
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(basic_auth=self.username + ':' +
self.password).get('authorization')
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
return {
'basicAuth': {
'type': 'basic',
'in': 'header',
'key': 'Authorization',
'value': self.get_basic_auth_token()
},
}
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return "Python SDK Debug Report:\n" \
"OS: {env}\n" \
"Python Version: {pyversion}\n" \
"Version of the API: 1\n" \
"SDK Package Version: 1". \
format(env=sys.platform, pyversion=sys.version)
|
class Configuration:
def __init__(self):
'''Constructor'''
pass
@property
def logger_file(self):
'''The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
'''
pass
@logger_file.setter
def logger_file(self):
'''The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
'''
pass
@property
def debug(self):
'''Debug status
:param value: The debug status, True or False.
:type: bool
'''
pass
@debug.setter
def debug(self):
'''Debug status
:param value: The debug status, True or False.
:type: bool
'''
pass
@property
def logger_format(self):
'''The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
'''
pass
@logger_format.setter
def logger_format(self):
'''The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
'''
pass
def get_api_key_with_prefix(self, identifier):
'''Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
'''
pass
def get_basic_auth_token(self):
'''Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
'''
pass
def auth_settings(self):
'''Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
'''
pass
def to_debug_report(self):
'''Gets the essential information for debugging.
:return: The report for debugging.
'''
pass
| 18 | 11 | 14 | 1 | 7 | 6 | 2 | 0.8 | 0 | 3 | 0 | 0 | 11 | 12 | 11 | 11 | 170 | 27 | 80 | 32 | 62 | 64 | 54 | 26 | 42 | 6 | 0 | 3 | 21 |
141,050 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/api_blob_type.py
|
src.kaggle.models.api_blob_type.ApiBlobType
|
class ApiBlobType(object):
DATASET = "dataset"
MODEL = "model"
INBOX = "inbox"
|
class ApiBlobType(object):
pass
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 1 | 0 | 0 |
141,051 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/dataset_column.py
|
src.kaggle.models.dataset_column.DatasetColumn
|
class DatasetColumn(object):
"""
Attributes:
column_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
column_types = {
'order': 'float',
'name': 'str',
'type': 'str',
'original_type': 'str',
'description': 'str'
}
attribute_map = {
'order': 'order',
'name': 'name',
'type': 'type',
'original_type': 'originalType',
'description': 'description'
}
def __init__(self,
order=None,
name=None,
type=None,
original_type=None,
description=None): # noqa: E501
"""DatasetColumn - a model defined in Swagger""" # noqa: E501
self._order = None
self._name = None
self._type = None
self._original_type = None
self._description = None
self.discriminator = None
if order is not None:
self.order = order
if name is not None:
self.name = name
if type is not None:
self.type = type
if original_type is not None:
self.original_type = original_type
if description is not None:
self.description = description
@property
def order(self):
"""Gets the order of this DatasetColumn. # noqa: E501
The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.) # noqa: E501
:return: The order of this DatasetColumn. # noqa: E501
:rtype: float
"""
return self._order
@order.setter
def order(self, order):
"""Sets the order of this DatasetColumn.
The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.) # noqa: E501
:param order: The order of this DatasetColumn. # noqa: E501
:type: float
"""
self._order = order
@property
def name(self):
"""Gets the name of this DatasetColumn. # noqa: E501
The column name # noqa: E501
:return: The name of this DatasetColumn. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this DatasetColumn.
The column name # noqa: E501
:param name: The name of this DatasetColumn. # noqa: E501
:type: str
"""
self._name = name
@property
def type(self):
"""Gets the type of this DatasetColumn. # noqa: E501
The type of all of the fields in the column. Please see the data types on https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata # noqa: E501
:return: The type of this DatasetColumn. # noqa: E501
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this DatasetColumn.
The type of all of the fields in the column. Please see the data types on https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata # noqa: E501
:param type: The type of this DatasetColumn. # noqa: E501
:type: str
"""
self._type = type
@property
def original_type(self):
"""Gets the original_type of this DatasetColumn. # noqa: E501
Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `\"integer\"` would convert to a `type` of `\"numeric\"` # noqa: E501
:return: The original_type of this DatasetColumn. # noqa: E501
:rtype: str
"""
return self._original_type
@original_type.setter
def original_type(self, original_type):
"""Sets the original_type of this DatasetColumn.
Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `\"integer\"` would convert to a `type` of `\"numeric\"` # noqa: E501
:param original_type: The original_type of this DatasetColumn. # noqa: E501
:type: str
"""
self._original_type = original_type
@property
def description(self):
"""Gets the description of this DatasetColumn. # noqa: E501
The description of the column # noqa: E501
:return: The description of this DatasetColumn. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this DatasetColumn.
The description of the column # noqa: E501
:param description: The description of this DatasetColumn. # noqa: E501
:type: str
"""
self._description = description
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.column_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(
map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(
map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item, value.items()))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DatasetColumn):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
|
class DatasetColumn(object):
'''
Attributes:
column_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
'''
def __init__(self,
order=None,
name=None,
type=None,
original_type=None,
description=None):
'''DatasetColumn - a model defined in Swagger'''
pass
@property
def order(self):
'''Gets the order of this DatasetColumn. # noqa: E501
The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.) # noqa: E501
:return: The order of this DatasetColumn. # noqa: E501
:rtype: float
'''
pass
@order.setter
def order(self):
'''Sets the order of this DatasetColumn.
The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.) # noqa: E501
:param order: The order of this DatasetColumn. # noqa: E501
:type: float
'''
pass
@property
def name(self):
'''Gets the name of this DatasetColumn. # noqa: E501
The column name # noqa: E501
:return: The name of this DatasetColumn. # noqa: E501
:rtype: str
'''
pass
@name.setter
def name(self):
'''Sets the name of this DatasetColumn.
The column name # noqa: E501
:param name: The name of this DatasetColumn. # noqa: E501
:type: str
'''
pass
@property
def type(self):
'''Gets the type of this DatasetColumn. # noqa: E501
The type of all of the fields in the column. Please see the data types on https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata # noqa: E501
:return: The type of this DatasetColumn. # noqa: E501
:rtype: str
'''
pass
@type.setter
def type(self):
'''Sets the type of this DatasetColumn.
The type of all of the fields in the column. Please see the data types on https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata # noqa: E501
:param type: The type of this DatasetColumn. # noqa: E501
:type: str
'''
pass
@property
def original_type(self):
'''Gets the original_type of this DatasetColumn. # noqa: E501
Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `"integer"` would convert to a `type` of `"numeric"` # noqa: E501
:return: The original_type of this DatasetColumn. # noqa: E501
:rtype: str
'''
pass
@original_type.setter
def original_type(self):
'''Sets the original_type of this DatasetColumn.
Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `"integer"` would convert to a `type` of `"numeric"` # noqa: E501
:param original_type: The original_type of this DatasetColumn. # noqa: E501
:type: str
'''
pass
@property
def description(self):
'''Gets the description of this DatasetColumn. # noqa: E501
The description of the column # noqa: E501
:return: The description of this DatasetColumn. # noqa: E501
:rtype: str
'''
pass
@description.setter
def description(self):
'''Sets the description of this DatasetColumn.
The description of the column # noqa: E501
:param description: The description of this DatasetColumn. # noqa: E501
:type: str
'''
pass
def to_dict(self):
'''Returns the model properties as a dict'''
pass
def to_str(self):
'''Returns the string representation of the model'''
pass
def __repr__(self):
'''For `print` and `pprint`'''
pass
def __eq__(self, other):
'''Returns true if both objects are equal'''
pass
def __ne__(self, other):
'''Returns true if both objects are not equal'''
pass
| 27 | 17 | 10 | 2 | 4 | 4 | 2 | 0.68 | 1 | 3 | 0 | 0 | 16 | 6 | 16 | 16 | 204 | 47 | 94 | 43 | 62 | 64 | 60 | 28 | 43 | 6 | 1 | 2 | 26 |
141,052 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/dataset_new_request.py
|
src.kaggle.models.dataset_new_request.DatasetNewRequest
|
class DatasetNewRequest(object):
"""
Attributes:
project_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
project_types = {
'title': 'str',
'slug': 'str',
'owner_slug': 'str',
'license_name': 'str',
'subtitle': 'str',
'description': 'str',
'files': 'list[UploadFile]',
'is_private': 'bool',
'convert_to_csv': 'bool',
'category_ids': 'list[str]'
}
attribute_map = {
'title': 'title',
'slug': 'slug',
'owner_slug': 'ownerSlug',
'license_name': 'licenseName',
'subtitle': 'subtitle',
'description': 'description',
'files': 'files',
'is_private': 'isPrivate',
'convert_to_csv': 'convertToCsv',
'category_ids': 'categoryIds'
}
def __init__(self, title=None, slug=None, owner_slug=None, license_name='unknown', subtitle=None, description='', files=None, is_private=True, convert_to_csv=True, category_ids=None): # noqa: E501
self._title = None
self._slug = None
self._owner_slug = None
self._license_name = None
self._subtitle = None
self._description = None
self._files = None
self._is_private = None
self._convert_to_csv = None
self._category_ids = None
self.discriminator = None
self.title = title
if slug is not None:
self.slug = slug
if owner_slug is not None:
self.owner_slug = owner_slug
if license_name is not None:
self.license_name = license_name
if subtitle is not None:
self.subtitle = subtitle
if description is not None:
self.description = description
self.files = files
if is_private is not None:
self.is_private = is_private
if convert_to_csv is not None:
self.convert_to_csv = convert_to_csv
if category_ids is not None:
self.category_ids = category_ids
@property
def title(self):
"""Gets the title of this DatasetNewRequest. # noqa: E501
The title of the new dataset # noqa: E501
:return: The title of this DatasetNewRequest. # noqa: E501
:rtype: str
"""
return self._title
@title.setter
def title(self, title):
"""Sets the title of this DatasetNewRequest.
The title of the new dataset # noqa: E501
:param title: The title of this DatasetNewRequest. # noqa: E501
:type: str
"""
if title is None:
raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501
self._title = title
@property
def slug(self):
"""Gets the slug of this DatasetNewRequest. # noqa: E501
The slug that the dataset should be created with # noqa: E501
:return: The slug of this DatasetNewRequest. # noqa: E501
:rtype: str
"""
return self._slug
@slug.setter
def slug(self, slug):
"""Sets the slug of this DatasetNewRequest.
The slug that the dataset should be created with # noqa: E501
:param slug: The slug of this DatasetNewRequest. # noqa: E501
:type: str
"""
self._slug = slug
@property
def owner_slug(self):
"""Gets the owner_slug of this DatasetNewRequest. # noqa: E501
The owner's username # noqa: E501
:return: The owner_slug of this DatasetNewRequest. # noqa: E501
:rtype: str
"""
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug):
"""Sets the owner_slug of this DatasetNewRequest.
The owner's username # noqa: E501
:param owner_slug: The owner_slug of this DatasetNewRequest. # noqa: E501
:type: str
"""
self._owner_slug = owner_slug
@property
def license_name(self):
"""Gets the license_name of this DatasetNewRequest. # noqa: E501
The license that should be associated with the dataset # noqa: E501
:return: The license_name of this DatasetNewRequest. # noqa: E501
:rtype: str
"""
return self._license_name
@license_name.setter
def license_name(self, license_name):
"""Sets the license_name of this DatasetNewRequest.
The license that should be associated with the dataset # noqa: E501
:param license_name: The license_name of this DatasetNewRequest. # noqa: E501
:type: str
"""
allowed_values = ["CC0-1.0", "CC-BY-SA-4.0", "GPL-2.0", "ODbL-1.0", "CC-BY-NC-SA-4.0", "unknown", "DbCL-1.0", "CC-BY-SA-3.0", "copyright-authors", "other", "reddit-api", "world-bank", "CC-BY-4.0", "CC-BY-NC-4.0", "PDDL", "CC-BY-3.0", "CC-BY-3.0-IGO", "US-Government-Works", "CC-BY-NC-SA-3.0-IGO", "CDLA-Permissive-1.0", "CDLA-Sharing-1.0", "CC-BY-ND-4.0", "CC-BY-NC-ND-4.0", "ODC-BY-1.0", "LGPL-3.0", "AGPL-3.0", "FDL-1.3", "EU-ODP-Legal-Notice", "apache-2.0", "GPL-3.0"] # noqa: E501
if license_name not in allowed_values:
raise ValueError(
"Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
.format(license_name, allowed_values)
)
else:
license_name = license_name.lower()
if license_name[0-1] == 'cc':
license_name = 'cc'
elif license_name[0-3] == 'gpl':
license_name = 'gpl'
elif license_name[0-3] == 'odb':
license_name = 'odb'
else:
license_name = 'other'
self._license_name = license_name
@property
def subtitle(self):
"""Gets the subtitle of this DatasetNewRequest. # noqa: E501
The subtitle to be set on the dataset # noqa: E501
:return: The subtitle of this DatasetNewRequest. # noqa: E501
:rtype: str
"""
return self._subtitle
@subtitle.setter
def subtitle(self, subtitle):
"""Sets the subtitle of this DatasetNewRequest.
The subtitle to be set on the dataset # noqa: E501
:param subtitle: The subtitle of this DatasetNewRequest. # noqa: E501
:type: str
"""
self._subtitle = subtitle
@property
def description(self):
"""Gets the description of this DatasetNewRequest. # noqa: E501
The description to be set on the dataset # noqa: E501
:return: The description of this DatasetNewRequest. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this DatasetNewRequest.
The description to be set on the dataset # noqa: E501
:param description: The description of this DatasetNewRequest. # noqa: E501
:type: str
"""
self._description = description
@property
def files(self):
"""Gets the files of this DatasetNewRequest. # noqa: E501
A list of files that should be associated with the dataset # noqa: E501
:return: The files of this DatasetNewRequest. # noqa: E501
:rtype: list[UploadFile]
"""
return self._files
@files.setter
def files(self, files):
"""Sets the files of this DatasetNewRequest.
A list of files that should be associated with the dataset # noqa: E501
:param files: The files of this DatasetNewRequest. # noqa: E501
:type: list[UploadFile]
"""
if files is None:
raise ValueError("Invalid value for `files`, must not be `None`") # noqa: E501
self._files = files
@property
def is_private(self):
"""Gets the is_private of this DatasetNewRequest. # noqa: E501
Whether or not the dataset should be private # noqa: E501
:return: The is_private of this DatasetNewRequest. # noqa: E501
:rtype: bool
"""
return self._is_private
@is_private.setter
def is_private(self, is_private):
"""Sets the is_private of this DatasetNewRequest.
Whether or not the dataset should be private # noqa: E501
:param is_private: The is_private of this DatasetNewRequest. # noqa: E501
:type: bool
"""
self._is_private = is_private
@property
def convert_to_csv(self):
"""Gets the convert_to_csv of this DatasetNewRequest. # noqa: E501
Whether or not a tabular dataset should be converted to csv # noqa: E501
:return: The convert_to_csv of this DatasetNewRequest. # noqa: E501
:rtype: bool
"""
return self._convert_to_csv
@convert_to_csv.setter
def convert_to_csv(self, convert_to_csv):
"""Sets the convert_to_csv of this DatasetNewRequest.
Whether or not a tabular dataset should be converted to csv # noqa: E501
:param convert_to_csv: The convert_to_csv of this DatasetNewRequest. # noqa: E501
:type: bool
"""
self._convert_to_csv = convert_to_csv
@property
def category_ids(self):
"""Gets the category_ids of this DatasetNewRequest. # noqa: E501
A list of tag IDs to associated with the dataset # noqa: E501
:return: The category_ids of this DatasetNewRequest. # noqa: E501
:rtype: list[str]
"""
return self._category_ids
@category_ids.setter
def category_ids(self, category_ids):
"""Sets the category_ids of this DatasetNewRequest.
A list of tag IDs to associated with the dataset # noqa: E501
:param category_ids: The category_ids of this DatasetNewRequest. # noqa: E501
:type: list[str]
"""
self._category_ids = category_ids
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.project_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DatasetNewRequest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
|
class DatasetNewRequest(object):
'''
Attributes:
project_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
'''
def __init__(self, title=None, slug=None, owner_slug=None, license_name='unknown', subtitle=None, description='', files=None, is_private=True, convert_to_csv=True, category_ids=None):
pass
@property
def title(self):
'''Gets the title of this DatasetNewRequest. # noqa: E501
The title of the new dataset # noqa: E501
:return: The title of this DatasetNewRequest. # noqa: E501
:rtype: str
'''
pass
@title.setter
def title(self):
'''Sets the title of this DatasetNewRequest.
The title of the new dataset # noqa: E501
:param title: The title of this DatasetNewRequest. # noqa: E501
:type: str
'''
pass
@property
def slug(self):
'''Gets the slug of this DatasetNewRequest. # noqa: E501
The slug that the dataset should be created with # noqa: E501
:return: The slug of this DatasetNewRequest. # noqa: E501
:rtype: str
'''
pass
@slug.setter
def slug(self):
'''Sets the slug of this DatasetNewRequest.
The slug that the dataset should be created with # noqa: E501
:param slug: The slug of this DatasetNewRequest. # noqa: E501
:type: str
'''
pass
@property
def owner_slug(self):
'''Gets the owner_slug of this DatasetNewRequest. # noqa: E501
The owner's username # noqa: E501
:return: The owner_slug of this DatasetNewRequest. # noqa: E501
:rtype: str
'''
pass
@owner_slug.setter
def owner_slug(self):
'''Sets the owner_slug of this DatasetNewRequest.
The owner's username # noqa: E501
:param owner_slug: The owner_slug of this DatasetNewRequest. # noqa: E501
:type: str
'''
pass
@property
def license_name(self):
'''Gets the license_name of this DatasetNewRequest. # noqa: E501
The license that should be associated with the dataset # noqa: E501
:return: The license_name of this DatasetNewRequest. # noqa: E501
:rtype: str
'''
pass
@license_name.setter
def license_name(self):
'''Sets the license_name of this DatasetNewRequest.
The license that should be associated with the dataset # noqa: E501
:param license_name: The license_name of this DatasetNewRequest. # noqa: E501
:type: str
'''
pass
@property
def subtitle(self):
'''Gets the subtitle of this DatasetNewRequest. # noqa: E501
The subtitle to be set on the dataset # noqa: E501
:return: The subtitle of this DatasetNewRequest. # noqa: E501
:rtype: str
'''
pass
@subtitle.setter
def subtitle(self):
'''Sets the subtitle of this DatasetNewRequest.
The subtitle to be set on the dataset # noqa: E501
:param subtitle: The subtitle of this DatasetNewRequest. # noqa: E501
:type: str
'''
pass
@property
def description(self):
'''Gets the description of this DatasetNewRequest. # noqa: E501
The description to be set on the dataset # noqa: E501
:return: The description of this DatasetNewRequest. # noqa: E501
:rtype: str
'''
pass
@description.setter
def description(self):
'''Sets the description of this DatasetNewRequest.
The description to be set on the dataset # noqa: E501
:param description: The description of this DatasetNewRequest. # noqa: E501
:type: str
'''
pass
@property
def files(self):
'''Gets the files of this DatasetNewRequest. # noqa: E501
A list of files that should be associated with the dataset # noqa: E501
:return: The files of this DatasetNewRequest. # noqa: E501
:rtype: list[UploadFile]
'''
pass
@files.setter
def files(self):
'''Sets the files of this DatasetNewRequest.
A list of files that should be associated with the dataset # noqa: E501
:param files: The files of this DatasetNewRequest. # noqa: E501
:type: list[UploadFile]
'''
pass
@property
def is_private(self):
'''Gets the is_private of this DatasetNewRequest. # noqa: E501
Whether or not the dataset should be private # noqa: E501
:return: The is_private of this DatasetNewRequest. # noqa: E501
:rtype: bool
'''
pass
@is_private.setter
def is_private(self):
'''Sets the is_private of this DatasetNewRequest.
Whether or not the dataset should be private # noqa: E501
:param is_private: The is_private of this DatasetNewRequest. # noqa: E501
:type: bool
'''
pass
@property
def convert_to_csv(self):
'''Gets the convert_to_csv of this DatasetNewRequest. # noqa: E501
Whether or not a tabular dataset should be converted to csv # noqa: E501
:return: The convert_to_csv of this DatasetNewRequest. # noqa: E501
:rtype: bool
'''
pass
@convert_to_csv.setter
def convert_to_csv(self):
'''Sets the convert_to_csv of this DatasetNewRequest.
Whether or not a tabular dataset should be converted to csv # noqa: E501
:param convert_to_csv: The convert_to_csv of this DatasetNewRequest. # noqa: E501
:type: bool
'''
pass
@property
def category_ids(self):
'''Gets the category_ids of this DatasetNewRequest. # noqa: E501
A list of tag IDs to associated with the dataset # noqa: E501
:return: The category_ids of this DatasetNewRequest. # noqa: E501
:rtype: list[str]
'''
pass
@category_ids.setter
def category_ids(self):
'''Sets the category_ids of this DatasetNewRequest.
A list of tag IDs to associated with the dataset # noqa: E501
:param category_ids: The category_ids of this DatasetNewRequest. # noqa: E501
:type: list[str]
'''
pass
def to_dict(self):
'''Returns the model properties as a dict'''
pass
def to_str(self):
'''Returns the string representation of the model'''
pass
def __repr__(self):
'''For `print` and `pprint`'''
pass
def __eq__(self, other):
'''Returns true if both objects are equal'''
pass
def __ne__(self, other):
'''Returns true if both objects are not equal'''
pass
| 47 | 26 | 11 | 2 | 5 | 4 | 2 | 0.71 | 1 | 4 | 0 | 0 | 26 | 11 | 26 | 26 | 358 | 81 | 165 | 64 | 118 | 117 | 106 | 44 | 79 | 9 | 1 | 2 | 45 |
141,053 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/dataset_new_version_request.py
|
src.kaggle.models.dataset_new_version_request.DatasetNewVersionRequest
|
class DatasetNewVersionRequest(object):
"""
Attributes:
project_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
project_types = {
'version_notes': 'str',
'subtitle': 'str',
'description': 'str',
'files': 'list[UploadFile]',
'convert_to_csv': 'bool',
'category_ids': 'list[str]',
'delete_old_versions': 'bool'
}
attribute_map = {
'version_notes': 'versionNotes',
'subtitle': 'subtitle',
'description': 'description',
'files': 'files',
'convert_to_csv': 'convertToCsv',
'category_ids': 'categoryIds',
'delete_old_versions': 'deleteOldVersions'
}
def __init__(self, version_notes=None, subtitle=None, description=None, files=None, convert_to_csv=True, category_ids=None, delete_old_versions=False): # noqa: E501
self._version_notes = None
self._subtitle = None
self._description = None
self._files = None
self._convert_to_csv = None
self._category_ids = None
self._delete_old_versions = None
self.discriminator = None
self.version_notes = version_notes
if subtitle is not None:
self.subtitle = subtitle
if description is not None:
self.description = description
self.files = files
if convert_to_csv is not None:
self.convert_to_csv = convert_to_csv
if category_ids is not None:
self.category_ids = category_ids
if delete_old_versions is not None:
self.delete_old_versions = delete_old_versions
@property
def version_notes(self):
"""Gets the version_notes of this DatasetNewVersionRequest. # noqa: E501
The version notes for the new dataset version # noqa: E501
:return: The version_notes of this DatasetNewVersionRequest. # noqa: E501
:rtype: str
"""
return self._version_notes
@version_notes.setter
def version_notes(self, version_notes):
"""Sets the version_notes of this DatasetNewVersionRequest.
The version notes for the new dataset version # noqa: E501
:param version_notes: The version_notes of this DatasetNewVersionRequest. # noqa: E501
:type: str
"""
if version_notes is None:
raise ValueError("Invalid value for `version_notes`, must not be `None`") # noqa: E501
self._version_notes = version_notes
@property
def subtitle(self):
"""Gets the subtitle of this DatasetNewVersionRequest. # noqa: E501
The subtitle to set on the dataset # noqa: E501
:return: The subtitle of this DatasetNewVersionRequest. # noqa: E501
:rtype: str
"""
return self._subtitle
@subtitle.setter
def subtitle(self, subtitle):
"""Sets the subtitle of this DatasetNewVersionRequest.
The subtitle to set on the dataset # noqa: E501
:param subtitle: The subtitle of this DatasetNewVersionRequest. # noqa: E501
:type: str
"""
self._subtitle = subtitle
@property
def description(self):
"""Gets the description of this DatasetNewVersionRequest. # noqa: E501
The description to set on the dataset # noqa: E501
:return: The description of this DatasetNewVersionRequest. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this DatasetNewVersionRequest.
The description to set on the dataset # noqa: E501
:param description: The description of this DatasetNewVersionRequest. # noqa: E501
:type: str
"""
self._description = description
@property
def files(self):
"""Gets the files of this DatasetNewVersionRequest. # noqa: E501
A list of files that should be associated with the dataset # noqa: E501
:return: The files of this DatasetNewVersionRequest. # noqa: E501
:rtype: list[UploadFile]
"""
return self._files
@files.setter
def files(self, files):
"""Sets the files of this DatasetNewVersionRequest.
A list of files that should be associated with the dataset # noqa: E501
:param files: The files of this DatasetNewVersionRequest. # noqa: E501
:type: list[UploadFile]
"""
if files is None:
raise ValueError("Invalid value for `files`, must not be `None`") # noqa: E501
self._files = files
@property
def convert_to_csv(self):
"""Gets the convert_to_csv of this DatasetNewVersionRequest. # noqa: E501
Whether or not a tabular dataset should be converted to csv # noqa: E501
:return: The convert_to_csv of this DatasetNewVersionRequest. # noqa: E501
:rtype: bool
"""
return self._convert_to_csv
@convert_to_csv.setter
def convert_to_csv(self, convert_to_csv):
"""Sets the convert_to_csv of this DatasetNewVersionRequest.
Whether or not a tabular dataset should be converted to csv # noqa: E501
:param convert_to_csv: The convert_to_csv of this DatasetNewVersionRequest. # noqa: E501
:type: bool
"""
self._convert_to_csv = convert_to_csv
@property
def category_ids(self):
"""Gets the category_ids of this DatasetNewVersionRequest. # noqa: E501
A list of tag IDs to associated with the dataset # noqa: E501
:return: The category_ids of this DatasetNewVersionRequest. # noqa: E501
:rtype: list[str]
"""
return self._category_ids
@category_ids.setter
def category_ids(self, category_ids):
"""Sets the category_ids of this DatasetNewVersionRequest.
A list of tag IDs to associated with the dataset # noqa: E501
:param category_ids: The category_ids of this DatasetNewVersionRequest. # noqa: E501
:type: list[str]
"""
self._category_ids = category_ids
@property
def delete_old_versions(self):
"""Gets the delete_old_versions of this DatasetNewVersionRequest. # noqa: E501
Whether or not all previous versions of the dataset should be deleted upon creating the new version # noqa: E501
:return: The delete_old_versions of this DatasetNewVersionRequest. # noqa: E501
:rtype: bool
"""
return self._delete_old_versions
@delete_old_versions.setter
def delete_old_versions(self, delete_old_versions):
"""Sets the delete_old_versions of this DatasetNewVersionRequest.
Whether or not all previous versions of the dataset should be deleted upon creating the new version # noqa: E501
:param delete_old_versions: The delete_old_versions of this DatasetNewVersionRequest. # noqa: E501
:type: bool
"""
self._delete_old_versions = delete_old_versions
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.project_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DatasetNewVersionRequest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
|
class DatasetNewVersionRequest(object):
'''
Attributes:
project_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
'''
def __init__(self, version_notes=None, subtitle=None, description=None, files=None, convert_to_csv=True, category_ids=None, delete_old_versions=False):
pass
@property
def version_notes(self):
'''Gets the version_notes of this DatasetNewVersionRequest. # noqa: E501
The version notes for the new dataset version # noqa: E501
:return: The version_notes of this DatasetNewVersionRequest. # noqa: E501
:rtype: str
'''
pass
@version_notes.setter
def version_notes(self):
'''Sets the version_notes of this DatasetNewVersionRequest.
The version notes for the new dataset version # noqa: E501
:param version_notes: The version_notes of this DatasetNewVersionRequest. # noqa: E501
:type: str
'''
pass
@property
def subtitle(self):
'''Gets the subtitle of this DatasetNewVersionRequest. # noqa: E501
The subtitle to set on the dataset # noqa: E501
:return: The subtitle of this DatasetNewVersionRequest. # noqa: E501
:rtype: str
'''
pass
@subtitle.setter
def subtitle(self):
'''Sets the subtitle of this DatasetNewVersionRequest.
The subtitle to set on the dataset # noqa: E501
:param subtitle: The subtitle of this DatasetNewVersionRequest. # noqa: E501
:type: str
'''
pass
@property
def description(self):
'''Gets the description of this DatasetNewVersionRequest. # noqa: E501
The description to set on the dataset # noqa: E501
:return: The description of this DatasetNewVersionRequest. # noqa: E501
:rtype: str
'''
pass
@description.setter
def description(self):
'''Sets the description of this DatasetNewVersionRequest.
The description to set on the dataset # noqa: E501
:param description: The description of this DatasetNewVersionRequest. # noqa: E501
:type: str
'''
pass
@property
def files(self):
'''Gets the files of this DatasetNewVersionRequest. # noqa: E501
A list of files that should be associated with the dataset # noqa: E501
:return: The files of this DatasetNewVersionRequest. # noqa: E501
:rtype: list[UploadFile]
'''
pass
@files.setter
def files(self):
'''Sets the files of this DatasetNewVersionRequest.
A list of files that should be associated with the dataset # noqa: E501
:param files: The files of this DatasetNewVersionRequest. # noqa: E501
:type: list[UploadFile]
'''
pass
@property
def convert_to_csv(self):
'''Gets the convert_to_csv of this DatasetNewVersionRequest. # noqa: E501
Whether or not a tabular dataset should be converted to csv # noqa: E501
:return: The convert_to_csv of this DatasetNewVersionRequest. # noqa: E501
:rtype: bool
'''
pass
@convert_to_csv.setter
def convert_to_csv(self):
'''Sets the convert_to_csv of this DatasetNewVersionRequest.
Whether or not a tabular dataset should be converted to csv # noqa: E501
:param convert_to_csv: The convert_to_csv of this DatasetNewVersionRequest. # noqa: E501
:type: bool
'''
pass
@property
def category_ids(self):
'''Gets the category_ids of this DatasetNewVersionRequest. # noqa: E501
A list of tag IDs to associated with the dataset # noqa: E501
:return: The category_ids of this DatasetNewVersionRequest. # noqa: E501
:rtype: list[str]
'''
pass
@category_ids.setter
def category_ids(self):
'''Sets the category_ids of this DatasetNewVersionRequest.
A list of tag IDs to associated with the dataset # noqa: E501
:param category_ids: The category_ids of this DatasetNewVersionRequest. # noqa: E501
:type: list[str]
'''
pass
@property
def delete_old_versions(self):
'''Gets the delete_old_versions of this DatasetNewVersionRequest. # noqa: E501
Whether or not all previous versions of the dataset should be deleted upon creating the new version # noqa: E501
:return: The delete_old_versions of this DatasetNewVersionRequest. # noqa: E501
:rtype: bool
'''
pass
@delete_old_versions.setter
def delete_old_versions(self):
'''Sets the delete_old_versions of this DatasetNewVersionRequest.
Whether or not all previous versions of the dataset should be deleted upon creating the new version # noqa: E501
:param delete_old_versions: The delete_old_versions of this DatasetNewVersionRequest. # noqa: E501
:type: bool
'''
pass
def to_dict(self):
'''Returns the model properties as a dict'''
pass
def to_str(self):
'''Returns the string representation of the model'''
pass
def __repr__(self):
'''For `print` and `pprint`'''
pass
def __eq__(self, other):
'''Returns true if both objects are equal'''
pass
def __ne__(self, other):
'''Returns true if both objects are not equal'''
pass
| 35 | 20 | 10 | 2 | 4 | 4 | 2 | 0.73 | 1 | 4 | 0 | 0 | 20 | 8 | 20 | 20 | 259 | 61 | 116 | 48 | 81 | 85 | 76 | 34 | 55 | 6 | 1 | 2 | 32 |
141,054 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/dataset_update_settings_request.py
|
src.kaggle.models.dataset_update_settings_request.DatasetUpdateSettingsRequest
|
class DatasetUpdateSettingsRequest(object):
"""
Attributes:
project_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
project_types = {
'title': 'str',
'subtitle': 'str',
'description': 'str',
'is_private': 'bool',
'licenses': 'list[object]',
'keywords': 'list[str]',
'collaborators': 'list[object]',
'data': 'list[object]'
}
attribute_map = {
'title': 'title',
'subtitle': 'subtitle',
'description': 'description',
'is_private': 'isPrivate',
'licenses': 'licenses',
'keywords': 'keywords',
'collaborators': 'collaborators',
'data': 'data'
}
def __init__(self, title=None, subtitle=None, description=None, is_private=None, licenses=None, keywords=None, collaborators=None, data=None): # noqa: E501
self._title = None
self._subtitle = None
self._description = None
self._is_private = None
self._licenses = None
self._keywords = None
self._collaborators = None
self._data = None
self.discriminator = None
if title is not None:
self.title = title
if subtitle is not None:
self.subtitle = subtitle
if description is not None:
self.description = description
if is_private is not None:
self.is_private = is_private
if licenses is not None:
self.licenses = licenses
if keywords is not None:
self.keywords = keywords
if collaborators is not None:
self.collaborators = collaborators
if data is not None:
self.data = data
@property
def title(self):
"""Gets the title of this DatasetUpdateSettingsRequest. # noqa: E501
Title of the dataset # noqa: E501
:return: The title of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: str
"""
return self._title
@title.setter
def title(self, title):
"""Sets the title of this DatasetUpdateSettingsRequest.
Title of the dataset # noqa: E501
:param title: The title of this DatasetUpdateSettingsRequest. # noqa: E501
:type: str
"""
self._title = title
@property
def subtitle(self):
"""Gets the subtitle of this DatasetUpdateSettingsRequest. # noqa: E501
Subtitle of the dataset # noqa: E501
:return: The subtitle of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: str
"""
return self._subtitle
@subtitle.setter
def subtitle(self, subtitle):
"""Sets the subtitle of this DatasetUpdateSettingsRequest.
Subtitle of the dataset # noqa: E501
:param subtitle: The subtitle of this DatasetUpdateSettingsRequest. # noqa: E501
:type: str
"""
self._subtitle = subtitle
@property
def description(self):
"""Gets the description of this DatasetUpdateSettingsRequest. # noqa: E501
Decription of the dataset # noqa: E501
:return: The description of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this DatasetUpdateSettingsRequest.
Decription of the dataset # noqa: E501
:param description: The description of this DatasetUpdateSettingsRequest. # noqa: E501
:type: str
"""
self._description = description
@property
def is_private(self):
"""Gets the is_private of this DatasetUpdateSettingsRequest. # noqa: E501
Whether or not the dataset should be private # noqa: E501
:return: The is_private of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: bool
"""
return self._is_private
@is_private.setter
def is_private(self, is_private):
"""Sets the is_private of this DatasetUpdateSettingsRequest.
Whether or not the dataset should be private # noqa: E501
:param is_private: The is_private of this DatasetUpdateSettingsRequest. # noqa: E501
:type: bool
"""
self._is_private = is_private
@property
def licenses(self):
"""Gets the licenses of this DatasetUpdateSettingsRequest. # noqa: E501
A list of licenses that apply to this dataset # noqa: E501
:return: The licenses of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: list[object]
"""
return self._licenses
@licenses.setter
def licenses(self, licenses):
"""Sets the licenses of this DatasetUpdateSettingsRequest.
A list of licenses that apply to this dataset # noqa: E501
:param licenses: The licenses of this DatasetUpdateSettingsRequest. # noqa: E501
:type: list[object]
"""
self._licenses = licenses
@property
def keywords(self):
"""Gets the keywords of this DatasetUpdateSettingsRequest. # noqa: E501
A list of keywords that apply to this dataset # noqa: E501
:return: The keywords of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: list[str]
"""
return self._keywords
@keywords.setter
def keywords(self, keywords):
"""Sets the keywords of this DatasetUpdateSettingsRequest.
A list of keywords that apply to this dataset # noqa: E501
:param keywords: The keywords of this DatasetUpdateSettingsRequest. # noqa: E501
:type: list[str]
"""
self._keywords = keywords
@property
def collaborators(self):
"""Gets the collaborators of this DatasetUpdateSettingsRequest. # noqa: E501
A list of collaborators that may read or edit this dataset # noqa: E501
:return: The collaborators of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: list[object]
"""
return self._collaborators
@collaborators.setter
def collaborators(self, collaborators):
"""Sets the collaborators of this DatasetUpdateSettingsRequest.
A list of collaborators that may read or edit this dataset # noqa: E501
:param collaborators: The collaborators of this DatasetUpdateSettingsRequest. # noqa: E501
:type: list[object]
"""
self._collaborators = collaborators
@property
def data(self):
"""Gets the data of this DatasetUpdateSettingsRequest. # noqa: E501
A list containing metadata for each file in the dataset # noqa: E501
:return: The data of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: list[object]
"""
return self._data
@data.setter
def data(self, data):
"""Sets the data of this DatasetUpdateSettingsRequest.
A list containing metadata for each file in the dataset # noqa: E501
:param data: The data of this DatasetUpdateSettingsRequest. # noqa: E501
:type: list[object]
"""
self._data = data
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.project_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DatasetUpdateSettingsRequest):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
|
class DatasetUpdateSettingsRequest(object):
'''
Attributes:
project_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
'''
def __init__(self, title=None, subtitle=None, description=None, is_private=None, licenses=None, keywords=None, collaborators=None, data=None):
pass
@property
def title(self):
'''Gets the title of this DatasetUpdateSettingsRequest. # noqa: E501
Title of the dataset # noqa: E501
:return: The title of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: str
'''
pass
@title.setter
def title(self):
'''Sets the title of this DatasetUpdateSettingsRequest.
Title of the dataset # noqa: E501
:param title: The title of this DatasetUpdateSettingsRequest. # noqa: E501
:type: str
'''
pass
@property
def subtitle(self):
'''Gets the subtitle of this DatasetUpdateSettingsRequest. # noqa: E501
Subtitle of the dataset # noqa: E501
:return: The subtitle of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: str
'''
pass
@subtitle.setter
def subtitle(self):
'''Sets the subtitle of this DatasetUpdateSettingsRequest.
Subtitle of the dataset # noqa: E501
:param subtitle: The subtitle of this DatasetUpdateSettingsRequest. # noqa: E501
:type: str
'''
pass
@property
def description(self):
'''Gets the description of this DatasetUpdateSettingsRequest. # noqa: E501
Decription of the dataset # noqa: E501
:return: The description of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: str
'''
pass
@description.setter
def description(self):
'''Sets the description of this DatasetUpdateSettingsRequest.
Decription of the dataset # noqa: E501
:param description: The description of this DatasetUpdateSettingsRequest. # noqa: E501
:type: str
'''
pass
@property
def is_private(self):
'''Gets the is_private of this DatasetUpdateSettingsRequest. # noqa: E501
Whether or not the dataset should be private # noqa: E501
:return: The is_private of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: bool
'''
pass
@is_private.setter
def is_private(self):
'''Sets the is_private of this DatasetUpdateSettingsRequest.
Whether or not the dataset should be private # noqa: E501
:param is_private: The is_private of this DatasetUpdateSettingsRequest. # noqa: E501
:type: bool
'''
pass
@property
def licenses(self):
'''Gets the licenses of this DatasetUpdateSettingsRequest. # noqa: E501
A list of licenses that apply to this dataset # noqa: E501
:return: The licenses of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: list[object]
'''
pass
@licenses.setter
def licenses(self):
'''Sets the licenses of this DatasetUpdateSettingsRequest.
A list of licenses that apply to this dataset # noqa: E501
:param licenses: The licenses of this DatasetUpdateSettingsRequest. # noqa: E501
:type: list[object]
'''
pass
@property
def keywords(self):
'''Gets the keywords of this DatasetUpdateSettingsRequest. # noqa: E501
A list of keywords that apply to this dataset # noqa: E501
:return: The keywords of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: list[str]
'''
pass
@keywords.setter
def keywords(self):
'''Sets the keywords of this DatasetUpdateSettingsRequest.
A list of keywords that apply to this dataset # noqa: E501
:param keywords: The keywords of this DatasetUpdateSettingsRequest. # noqa: E501
:type: list[str]
'''
pass
@property
def collaborators(self):
'''Gets the collaborators of this DatasetUpdateSettingsRequest. # noqa: E501
A list of collaborators that may read or edit this dataset # noqa: E501
:return: The collaborators of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: list[object]
'''
pass
@collaborators.setter
def collaborators(self):
'''Sets the collaborators of this DatasetUpdateSettingsRequest.
A list of collaborators that may read or edit this dataset # noqa: E501
:param collaborators: The collaborators of this DatasetUpdateSettingsRequest. # noqa: E501
:type: list[object]
'''
pass
@property
def data(self):
'''Gets the data of this DatasetUpdateSettingsRequest. # noqa: E501
A list containing metadata for each file in the dataset # noqa: E501
:return: The data of this DatasetUpdateSettingsRequest. # noqa: E501
:rtype: list[object]
'''
pass
@data.setter
def data(self):
'''Sets the data of this DatasetUpdateSettingsRequest.
A list containing metadata for each file in the dataset # noqa: E501
:param data: The data of this DatasetUpdateSettingsRequest. # noqa: E501
:type: list[object]
'''
pass
def to_dict(self):
'''Returns the model properties as a dict'''
pass
def to_str(self):
'''Returns the string representation of the model'''
pass
def __repr__(self):
'''For `print` and `pprint`'''
pass
def __eq__(self, other):
'''Returns true if both objects are equal'''
pass
def __ne__(self, other):
'''Returns true if both objects are not equal'''
pass
| 39 | 22 | 10 | 2 | 4 | 4 | 2 | 0.74 | 1 | 3 | 0 | 0 | 22 | 9 | 22 | 22 | 285 | 68 | 125 | 53 | 86 | 93 | 81 | 37 | 58 | 9 | 1 | 2 | 35 |
141,055 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.Competition
|
class Competition(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
self.tags = [Tag(t) for t in self.tags]
def __repr__(self):
return self.ref
|
class Competition(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 2 | 1 | 2 | 2 | 9 | 2 | 7 | 5 | 4 | 0 | 7 | 5 | 4 | 1 | 1 | 0 | 2 |
141,056 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.Dataset
|
class Dataset(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
self.tags = [Tag(t) for t in self.tags]
self.files = [File(f) for f in self.files]
self.versions = [DatasetVersion(v) for v in self.versions]
self.size = File.get_size(self.totalBytes)
def __repr__(self):
return self.ref
|
class Dataset(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 3 | 3 | 0 | 2 | 4 | 2 | 2 | 12 | 2 | 10 | 8 | 7 | 0 | 10 | 8 | 7 | 1 | 1 | 0 | 2 |
141,057 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.DatasetNewResponse
|
class DatasetNewResponse(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return self.url
|
class DatasetNewResponse(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,058 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.DatasetNewVersionResponse
|
class DatasetNewVersionResponse(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return self.url
|
class DatasetNewVersionResponse(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,059 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.DatasetVersion
|
class DatasetVersion(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return str(self.versionNumber)
|
class DatasetVersion(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,060 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.File
|
class File(object):
def __init__(self, init_dict):
try: # TODO Remove try-block
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
self.size = File.get_size(self.totalBytes)
except AttributeError:
self.name = init_dict.name
self.creation_date = init_dict.creation_date
self.size = File.get_size(init_dict.total_bytes)
def __repr__(self):
return self.name
@staticmethod
def get_size(size, precision=0):
suffixes = ['B', 'KB', 'MB', 'GB', 'TB']
suffix_index = 0
while size >= 1024 and suffix_index < 4:
suffix_index += 1
size /= 1024.0
return '%.*f%s' % (precision, size, suffixes[suffix_index])
|
class File(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
@staticmethod
def get_size(size, precision=0):
pass
| 5 | 0 | 6 | 0 | 6 | 0 | 2 | 0.05 | 1 | 1 | 0 | 0 | 2 | 3 | 3 | 3 | 23 | 3 | 20 | 11 | 15 | 1 | 19 | 10 | 15 | 2 | 1 | 1 | 5 |
141,061 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.Kernel
|
class Kernel:
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return self.title
|
class Kernel:
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 0 | 0 | 2 |
141,062 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.KernelPushResponse
|
class KernelPushResponse(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return self.newUrl
|
class KernelPushResponse(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,063 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.LeaderboardEntry
|
class LeaderboardEntry(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return self.teamId
|
class LeaderboardEntry(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,064 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.Metadata
|
class Metadata(object):
def __init__(self, init_info):
parsed_info = {k: parse(v) for k, v in init_info.items()}
# backwards compatibility
self.id = parsed_info["ownerUser"] + "/" + parsed_info['datasetSlug']
self.id_no = parsed_info['datasetId']
self.__dict__.update(parsed_info)
def __repr__(self):
return str(self.datasetId)
|
class Metadata(object):
def __init__(self, init_info):
pass
def __repr__(self):
pass
| 3 | 0 | 4 | 0 | 4 | 1 | 1 | 0.13 | 1 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 11 | 2 | 8 | 6 | 5 | 1 | 8 | 6 | 5 | 1 | 1 | 0 | 2 |
141,065 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.Model
|
class Model(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return self.ref
|
class Model(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,066 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.ModelDeleteResponse
|
class ModelDeleteResponse(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return self.error
|
class ModelDeleteResponse(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,067 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.ModelNewResponse
|
class ModelNewResponse(object):
def __init__(self, init_dict):
parsed_dict = {k: parse(v) for k, v in init_dict.items()}
self.__dict__.update(parsed_dict)
def __repr__(self):
return self.url
|
class ModelNewResponse(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,068 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiDataFile
|
class ApiDataFile(KaggleObject):
r"""
Attributes:
ref (str)
name (str)
description (str)
total_bytes (int)
url (str)
creation_date (datetime)
"""
def __init__(self):
self._ref = ""
self._name = None
self._description = None
self._total_bytes = 0
self._url = None
self._creation_date = None
self._freeze()
@property
def ref(self) -> str:
return self._ref
@ref.setter
def ref(self, ref: str):
if ref is None:
del self.ref
return
if not isinstance(ref, str):
raise TypeError('ref must be of type str')
self._ref = ref
@property
def name(self) -> str:
return self._name or ""
@name.setter
def name(self, name: str):
if name is None:
del self.name
return
if not isinstance(name, str):
raise TypeError('name must be of type str')
self._name = name
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
@property
def total_bytes(self) -> int:
return self._total_bytes
@total_bytes.setter
def total_bytes(self, total_bytes: int):
if total_bytes is None:
del self.total_bytes
return
if not isinstance(total_bytes, int):
raise TypeError('total_bytes must be of type int')
self._total_bytes = total_bytes
@property
def url(self) -> str:
return self._url or ""
@url.setter
def url(self, url: str):
if url is None:
del self.url
return
if not isinstance(url, str):
raise TypeError('url must be of type str')
self._url = url
@property
def creation_date(self) -> datetime:
return self._creation_date
@creation_date.setter
def creation_date(self, creation_date: datetime):
if creation_date is None:
del self.creation_date
return
if not isinstance(creation_date, datetime):
raise TypeError('creation_date must be of type datetime')
self._creation_date = creation_date
|
class ApiDataFile(KaggleObject):
'''
Attributes:
ref (str)
name (str)
description (str)
total_bytes (int)
url (str)
creation_date (datetime)
'''
def __init__(self):
pass
@property
def ref(self) -> str:
pass
@ref.setter
def ref(self) -> str:
pass
@property
def name(self) -> str:
pass
@name.setter
def name(self) -> str:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
@property
def total_bytes(self) -> int:
pass
@total_bytes.setter
def total_bytes(self) -> int:
pass
@property
def url(self) -> str:
pass
@url.setter
def url(self) -> str:
pass
@property
def creation_date(self) -> datetime:
pass
@creation_date.setter
def creation_date(self) -> datetime:
pass
| 26 | 1 | 5 | 0 | 5 | 0 | 2 | 0.12 | 1 | 4 | 0 | 0 | 13 | 6 | 13 | 30 | 97 | 13 | 75 | 32 | 49 | 9 | 63 | 20 | 49 | 3 | 2 | 1 | 25 |
141,069 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kaggle/models/kaggle_models_extended.py
|
src.kaggle.models.kaggle_models_extended.ListFilesResult
|
class ListFilesResult(object):
def __init__(self, init_dict):
try: # TODO Remove try-block
self.error_message = init_dict['errorMessage']
files = init_dict['datasetFiles']
token = init_dict['nextPageToken']
except TypeError:
self.error_message = init_dict.error_message
files = init_dict.dataset_files
token = init_dict.next_page_token
if files:
self.files = [File(f) for f in files]
else:
self.files = {}
if token:
self.nextPageToken = token
else:
self.nextPageToken = ""
def __repr__(self):
return self.error_message
|
class ListFilesResult(object):
def __init__(self, init_dict):
pass
def __repr__(self):
pass
| 3 | 0 | 10 | 0 | 10 | 1 | 3 | 0.05 | 1 | 2 | 1 | 0 | 2 | 3 | 2 | 2 | 22 | 2 | 20 | 8 | 17 | 1 | 18 | 8 | 15 | 4 | 1 | 1 | 5 |
141,070 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiDownloadDataFilesRequest
|
class ApiDownloadDataFilesRequest(KaggleObject):
r"""
Attributes:
competition_name (str)
Competition name. Example: 'titanic'.
"""
def __init__(self):
self._competition_name = ""
self._freeze()
@property
def competition_name(self) -> str:
"""Competition name. Example: 'titanic'."""
return self._competition_name
@competition_name.setter
def competition_name(self, competition_name: str):
if competition_name is None:
del self.competition_name
return
if not isinstance(competition_name, str):
raise TypeError('competition_name must be of type str')
self._competition_name = competition_name
def endpoint(self):
path = '/api/v1/competitions/data/download-all/{competition_name}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/competitions/data/download-all/{competition_name}'
|
class ApiDownloadDataFilesRequest(KaggleObject):
'''
Attributes:
competition_name (str)
Competition name. Example: 'titanic'.
'''
def __init__(self):
pass
@property
def competition_name(self) -> str:
'''Competition name. Example: 'titanic'.'''
pass
@competition_name.setter
def competition_name(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 9 | 2 | 4 | 0 | 3 | 0 | 1 | 0.29 | 1 | 2 | 0 | 0 | 4 | 1 | 5 | 22 | 32 | 5 | 21 | 11 | 12 | 6 | 18 | 8 | 12 | 3 | 2 | 1 | 7 |
141,071 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiCategory
|
class ApiCategory(KaggleObject):
r"""
Attributes:
ref (str)
name (str)
description (str)
full_path (str)
competition_count (int)
dataset_count (int)
script_count (int)
total_count (int)
"""
def __init__(self):
self._ref = ""
self._name = None
self._description = None
self._full_path = None
self._competition_count = 0
self._dataset_count = 0
self._script_count = 0
self._total_count = 0
self._freeze()
@property
def ref(self) -> str:
return self._ref
@ref.setter
def ref(self, ref: str):
if ref is None:
del self.ref
return
if not isinstance(ref, str):
raise TypeError('ref must be of type str')
self._ref = ref
@property
def name(self) -> str:
return self._name or ""
@name.setter
def name(self, name: str):
if name is None:
del self.name
return
if not isinstance(name, str):
raise TypeError('name must be of type str')
self._name = name
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
@property
def full_path(self) -> str:
return self._full_path or ""
@full_path.setter
def full_path(self, full_path: str):
if full_path is None:
del self.full_path
return
if not isinstance(full_path, str):
raise TypeError('full_path must be of type str')
self._full_path = full_path
@property
def competition_count(self) -> int:
return self._competition_count
@competition_count.setter
def competition_count(self, competition_count: int):
if competition_count is None:
del self.competition_count
return
if not isinstance(competition_count, int):
raise TypeError('competition_count must be of type int')
self._competition_count = competition_count
@property
def dataset_count(self) -> int:
return self._dataset_count
@dataset_count.setter
def dataset_count(self, dataset_count: int):
if dataset_count is None:
del self.dataset_count
return
if not isinstance(dataset_count, int):
raise TypeError('dataset_count must be of type int')
self._dataset_count = dataset_count
@property
def script_count(self) -> int:
return self._script_count
@script_count.setter
def script_count(self, script_count: int):
if script_count is None:
del self.script_count
return
if not isinstance(script_count, int):
raise TypeError('script_count must be of type int')
self._script_count = script_count
@property
def total_count(self) -> int:
return self._total_count
@total_count.setter
def total_count(self, total_count: int):
if total_count is None:
del self.total_count
return
if not isinstance(total_count, int):
raise TypeError('total_count must be of type int')
self._total_count = total_count
|
class ApiCategory(KaggleObject):
'''
Attributes:
ref (str)
name (str)
description (str)
full_path (str)
competition_count (int)
dataset_count (int)
script_count (int)
total_count (int)
'''
def __init__(self):
pass
@property
def ref(self) -> str:
pass
@ref.setter
def ref(self) -> str:
pass
@property
def name(self) -> str:
pass
@name.setter
def name(self) -> str:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
@property
def full_path(self) -> str:
pass
@full_path.setter
def full_path(self) -> str:
pass
@property
def competition_count(self) -> int:
pass
@competition_count.setter
def competition_count(self) -> int:
pass
@property
def dataset_count(self) -> int:
pass
@dataset_count.setter
def dataset_count(self) -> int:
pass
@property
def script_count(self) -> int:
pass
@script_count.setter
def script_count(self) -> int:
pass
@property
def total_count(self) -> int:
pass
@total_count.setter
def total_count(self) -> int:
pass
| 34 | 1 | 5 | 0 | 5 | 0 | 2 | 0.11 | 1 | 3 | 0 | 0 | 17 | 8 | 17 | 34 | 127 | 17 | 99 | 42 | 65 | 11 | 83 | 26 | 65 | 3 | 2 | 1 | 33 |
141,072 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiCreateDatasetRequest
|
class ApiCreateDatasetRequest(KaggleObject):
r"""
Attributes:
id (int)
owner_slug (str)
slug (str)
title (str)
license_name (str)
is_private (bool)
files (ApiDatasetNewFile)
subtitle (str)
description (str)
category_ids (str)
"""
def __init__(self):
self._id = None
self._owner_slug = None
self._slug = None
self._title = None
self._license_name = None
self._is_private = False
self._files = []
self._subtitle = None
self._description = None
self._category_ids = []
self._freeze()
@property
def id(self) -> int:
return self._id or 0
@id.setter
def id(self, id: int):
if id is None:
del self.id
return
if not isinstance(id, int):
raise TypeError('id must be of type int')
self._id = id
@property
def owner_slug(self) -> str:
return self._owner_slug or ""
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def slug(self) -> str:
return self._slug or ""
@slug.setter
def slug(self, slug: str):
if slug is None:
del self.slug
return
if not isinstance(slug, str):
raise TypeError('slug must be of type str')
self._slug = slug
@property
def title(self) -> str:
return self._title or ""
@title.setter
def title(self, title: str):
if title is None:
del self.title
return
if not isinstance(title, str):
raise TypeError('title must be of type str')
self._title = title
@property
def license_name(self) -> str:
return self._license_name or ""
@license_name.setter
def license_name(self, license_name: str):
if license_name is None:
del self.license_name
return
if not isinstance(license_name, str):
raise TypeError('license_name must be of type str')
self._license_name = license_name
@property
def is_private(self) -> bool:
return self._is_private
@is_private.setter
def is_private(self, is_private: bool):
if is_private is None:
del self.is_private
return
if not isinstance(is_private, bool):
raise TypeError('is_private must be of type bool')
self._is_private = is_private
@property
def files(self) -> Optional[List[Optional['ApiDatasetNewFile']]]:
return self._files
@files.setter
def files(self, files: Optional[List[Optional['ApiDatasetNewFile']]]):
if files is None:
del self.files
return
if not isinstance(files, list):
raise TypeError('files must be of type list')
if not all([isinstance(t, ApiDatasetNewFile) for t in files]):
raise TypeError('files must contain only items of type ApiDatasetNewFile')
self._files = files
@property
def subtitle(self) -> str:
return self._subtitle or ""
@subtitle.setter
def subtitle(self, subtitle: str):
if subtitle is None:
del self.subtitle
return
if not isinstance(subtitle, str):
raise TypeError('subtitle must be of type str')
self._subtitle = subtitle
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
@property
def category_ids(self) -> Optional[List[str]]:
return self._category_ids
@category_ids.setter
def category_ids(self, category_ids: Optional[List[str]]):
if category_ids is None:
del self.category_ids
return
if not isinstance(category_ids, list):
raise TypeError('category_ids must be of type list')
if not all([isinstance(t, str) for t in category_ids]):
raise TypeError('category_ids must contain only items of type str')
self._category_ids = category_ids
def endpoint(self):
path = '/api/v1/datasets/create/new'
return path.format_map(self.to_field_map(self))
@staticmethod
def method():
return 'POST'
@staticmethod
def body_fields():
return '*'
|
class ApiCreateDatasetRequest(KaggleObject):
'''
Attributes:
id (int)
owner_slug (str)
slug (str)
title (str)
license_name (str)
is_private (bool)
files (ApiDatasetNewFile)
subtitle (str)
description (str)
category_ids (str)
'''
def __init__(self):
pass
@property
def id(self) -> int:
pass
@id.setter
def id(self) -> int:
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def slug(self) -> str:
pass
@slug.setter
def slug(self) -> str:
pass
@property
def title(self) -> str:
pass
@title.setter
def title(self) -> str:
pass
@property
def license_name(self) -> str:
pass
@license_name.setter
def license_name(self) -> str:
pass
@property
def is_private(self) -> bool:
pass
@is_private.setter
def is_private(self) -> bool:
pass
@property
def files(self) -> Optional[List[Optional['ApiDatasetNewFile']]]:
pass
@files.setter
def files(self) -> Optional[List[Optional['ApiDatasetNewFile']]]:
pass
@property
def subtitle(self) -> str:
pass
@subtitle.setter
def subtitle(self) -> str:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
@property
def category_ids(self) -> Optional[List[str]]:
pass
@category_ids.setter
def category_ids(self) -> Optional[List[str]]:
pass
def endpoint(self):
pass
@staticmethod
def method():
pass
@staticmethod
def body_fields():
pass
| 47 | 1 | 5 | 0 | 5 | 0 | 2 | 0.1 | 1 | 6 | 1 | 0 | 22 | 10 | 24 | 41 | 174 | 25 | 136 | 58 | 89 | 13 | 114 | 36 | 89 | 4 | 2 | 1 | 46 |
141,073 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiCreateDatasetResponse
|
class ApiCreateDatasetResponse(KaggleObject):
r"""
Attributes:
ref (str)
url (str)
status (str)
error (str)
invalid_tags (str)
"""
def __init__(self):
self._ref = None
self._url = None
self._status = None
self._error = None
self._invalid_tags = []
self._freeze()
@property
def ref(self) -> str:
return self._ref or ""
@ref.setter
def ref(self, ref: str):
if ref is None:
del self.ref
return
if not isinstance(ref, str):
raise TypeError('ref must be of type str')
self._ref = ref
@property
def url(self) -> str:
return self._url or ""
@url.setter
def url(self, url: str):
if url is None:
del self.url
return
if not isinstance(url, str):
raise TypeError('url must be of type str')
self._url = url
@property
def status(self) -> str:
return self._status or ""
@status.setter
def status(self, status: str):
if status is None:
del self.status
return
if not isinstance(status, str):
raise TypeError('status must be of type str')
self._status = status
@property
def error(self) -> str:
return self._error or ""
@error.setter
def error(self, error: str):
if error is None:
del self.error
return
if not isinstance(error, str):
raise TypeError('error must be of type str')
self._error = error
@property
def invalid_tags(self) -> Optional[List[str]]:
return self._invalid_tags
@invalid_tags.setter
def invalid_tags(self, invalid_tags: Optional[List[str]]):
if invalid_tags is None:
del self.invalid_tags
return
if not isinstance(invalid_tags, list):
raise TypeError('invalid_tags must be of type list')
if not all([isinstance(t, str) for t in invalid_tags]):
raise TypeError('invalid_tags must contain only items of type str')
self._invalid_tags = invalid_tags
@property
def invalidTags(self):
return self.invalid_tags
|
class ApiCreateDatasetResponse(KaggleObject):
'''
Attributes:
ref (str)
url (str)
status (str)
error (str)
invalid_tags (str)
'''
def __init__(self):
pass
@property
def ref(self) -> str:
pass
@ref.setter
def ref(self) -> str:
pass
@property
def url(self) -> str:
pass
@url.setter
def url(self) -> str:
pass
@property
def status(self) -> str:
pass
@status.setter
def status(self) -> str:
pass
@property
def error(self) -> str:
pass
@error.setter
def error(self) -> str:
pass
@property
def invalid_tags(self) -> Optional[List[str]]:
pass
@invalid_tags.setter
def invalid_tags(self) -> Optional[List[str]]:
pass
@property
def invalidTags(self):
pass
| 24 | 1 | 5 | 0 | 5 | 0 | 2 | 0.12 | 1 | 3 | 0 | 0 | 12 | 5 | 12 | 29 | 88 | 12 | 68 | 29 | 44 | 8 | 57 | 18 | 44 | 4 | 2 | 1 | 23 |
141,074 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiCreateDatasetVersionByIdRequest
|
class ApiCreateDatasetVersionByIdRequest(KaggleObject):
r"""
Attributes:
id (int)
body (ApiCreateDatasetVersionRequestBody)
"""
def __init__(self):
self._id = 0
self._body = None
self._freeze()
@property
def id(self) -> int:
return self._id
@id.setter
def id(self, id: int):
if id is None:
del self.id
return
if not isinstance(id, int):
raise TypeError('id must be of type int')
self._id = id
@property
def body(self) -> Optional['ApiCreateDatasetVersionRequestBody']:
return self._body
@body.setter
def body(self, body: Optional['ApiCreateDatasetVersionRequestBody']):
if body is None:
del self.body
return
if not isinstance(body, ApiCreateDatasetVersionRequestBody):
raise TypeError('body must be of type ApiCreateDatasetVersionRequestBody')
self._body = body
def endpoint(self):
path = '/api/v1/datasets/create/version/{id}'
return path.format_map(self.to_field_map(self))
@staticmethod
def method():
return 'POST'
@staticmethod
def body_fields():
return 'body'
|
class ApiCreateDatasetVersionByIdRequest(KaggleObject):
'''
Attributes:
id (int)
body (ApiCreateDatasetVersionRequestBody)
'''
def __init__(self):
pass
@property
def id(self) -> int:
pass
@id.setter
def id(self) -> int:
pass
@property
def body(self) -> Optional['ApiCreateDatasetVersionRequestBody']:
pass
@body.setter
def body(self) -> Optional['ApiCreateDatasetVersionRequestBody']:
pass
def endpoint(self):
pass
@staticmethod
def method():
pass
@staticmethod
def body_fields():
pass
| 15 | 1 | 4 | 0 | 4 | 0 | 2 | 0.14 | 1 | 3 | 1 | 0 | 6 | 2 | 8 | 25 | 50 | 9 | 36 | 18 | 21 | 5 | 30 | 12 | 21 | 3 | 2 | 1 | 12 |
141,075 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiCreateDatasetVersionRequest
|
class ApiCreateDatasetVersionRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
body (ApiCreateDatasetVersionRequestBody)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._body = None
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
@property
def body(self) -> Optional['ApiCreateDatasetVersionRequestBody']:
return self._body
@body.setter
def body(self, body: Optional['ApiCreateDatasetVersionRequestBody']):
if body is None:
del self.body
return
if not isinstance(body, ApiCreateDatasetVersionRequestBody):
raise TypeError('body must be of type ApiCreateDatasetVersionRequestBody')
self._body = body
def endpoint(self):
path = '/api/v1/datasets/create/version/{owner_slug}/{dataset_slug}'
return path.format_map(self.to_field_map(self))
@staticmethod
def method():
return 'POST'
@staticmethod
def body_fields():
return 'body'
|
class ApiCreateDatasetVersionRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
body (ApiCreateDatasetVersionRequestBody)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
@property
def body(self) -> Optional['ApiCreateDatasetVersionRequestBody']:
pass
@body.setter
def body(self) -> Optional['ApiCreateDatasetVersionRequestBody']:
pass
def endpoint(self):
pass
@staticmethod
def method():
pass
@staticmethod
def body_fields():
pass
| 19 | 1 | 4 | 0 | 4 | 0 | 2 | 0.13 | 1 | 3 | 1 | 0 | 8 | 3 | 10 | 27 | 65 | 11 | 48 | 23 | 29 | 6 | 40 | 15 | 29 | 3 | 2 | 1 | 16 |
141,076 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiCreateDatasetVersionRequestBody
|
class ApiCreateDatasetVersionRequestBody(KaggleObject):
r"""
Attributes:
version_notes (str)
delete_old_versions (bool)
files (ApiDatasetNewFile)
subtitle (str)
description (str)
category_ids (str)
"""
def __init__(self):
self._version_notes = None
self._delete_old_versions = False
self._files = []
self._subtitle = None
self._description = None
self._category_ids = []
self._freeze()
@property
def version_notes(self) -> str:
return self._version_notes or ""
@version_notes.setter
def version_notes(self, version_notes: str):
if version_notes is None:
del self.version_notes
return
if not isinstance(version_notes, str):
raise TypeError('version_notes must be of type str')
self._version_notes = version_notes
@property
def delete_old_versions(self) -> bool:
return self._delete_old_versions
@delete_old_versions.setter
def delete_old_versions(self, delete_old_versions: bool):
if delete_old_versions is None:
del self.delete_old_versions
return
if not isinstance(delete_old_versions, bool):
raise TypeError('delete_old_versions must be of type bool')
self._delete_old_versions = delete_old_versions
@property
def files(self) -> Optional[List[Optional['ApiDatasetNewFile']]]:
return self._files
@files.setter
def files(self, files: Optional[List[Optional['ApiDatasetNewFile']]]):
if files is None:
del self.files
return
if not isinstance(files, list):
raise TypeError('files must be of type list')
if not all([isinstance(t, ApiDatasetNewFile) for t in files]):
raise TypeError('files must contain only items of type ApiDatasetNewFile')
self._files = files
@property
def subtitle(self) -> str:
return self._subtitle or ""
@subtitle.setter
def subtitle(self, subtitle: str):
if subtitle is None:
del self.subtitle
return
if not isinstance(subtitle, str):
raise TypeError('subtitle must be of type str')
self._subtitle = subtitle
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
@property
def category_ids(self) -> Optional[List[str]]:
return self._category_ids
@category_ids.setter
def category_ids(self, category_ids: Optional[List[str]]):
if category_ids is None:
del self.category_ids
return
if not isinstance(category_ids, list):
raise TypeError('category_ids must be of type list')
if not all([isinstance(t, str) for t in category_ids]):
raise TypeError('category_ids must contain only items of type str')
self._category_ids = category_ids
|
class ApiCreateDatasetVersionRequestBody(KaggleObject):
'''
Attributes:
version_notes (str)
delete_old_versions (bool)
files (ApiDatasetNewFile)
subtitle (str)
description (str)
category_ids (str)
'''
def __init__(self):
pass
@property
def version_notes(self) -> str:
pass
@version_notes.setter
def version_notes(self) -> str:
pass
@property
def delete_old_versions(self) -> bool:
pass
@delete_old_versions.setter
def delete_old_versions(self) -> bool:
pass
@property
def files(self) -> Optional[List[Optional['ApiDatasetNewFile']]]:
pass
@files.setter
def files(self) -> Optional[List[Optional['ApiDatasetNewFile']]]:
pass
@property
def subtitle(self) -> str:
pass
@subtitle.setter
def subtitle(self) -> str:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
@property
def category_ids(self) -> Optional[List[str]]:
pass
@category_ids.setter
def category_ids(self) -> Optional[List[str]]:
pass
| 26 | 1 | 5 | 0 | 5 | 0 | 2 | 0.11 | 1 | 5 | 1 | 0 | 13 | 6 | 13 | 30 | 101 | 13 | 79 | 32 | 53 | 9 | 67 | 20 | 53 | 4 | 2 | 1 | 27 |
141,077 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDataset
|
class ApiDataset(KaggleObject):
r"""
Attributes:
id (int)
ref (str)
subtitle (str)
creator_name (str)
creator_url (str)
total_bytes (int)
url (str)
last_updated (datetime)
download_count (int)
is_private (bool)
is_featured (bool)
license_name (str)
description (str)
owner_name (str)
owner_ref (str)
kernel_count (int)
title (str)
topic_count (int)
view_count (int)
vote_count (int)
current_version_number (int)
usability_rating (float)
tags (ApiCategory)
files (ApiDatasetFile)
versions (ApiDatasetVersion)
"""
def __init__(self):
self._id = 0
self._ref = ""
self._subtitle = None
self._creator_name = None
self._creator_url = None
self._total_bytes = None
self._url = None
self._last_updated = None
self._download_count = 0
self._is_private = False
self._is_featured = False
self._license_name = None
self._description = None
self._owner_name = None
self._owner_ref = None
self._kernel_count = 0
self._title = None
self._topic_count = 0
self._view_count = 0
self._vote_count = 0
self._current_version_number = None
self._usability_rating = None
self._tags = []
self._files = []
self._versions = []
self._freeze()
@property
def id(self) -> int:
return self._id
@id.setter
def id(self, id: int):
if id is None:
del self.id
return
if not isinstance(id, int):
raise TypeError('id must be of type int')
self._id = id
@property
def ref(self) -> str:
return self._ref
@ref.setter
def ref(self, ref: str):
if ref is None:
del self.ref
return
if not isinstance(ref, str):
raise TypeError('ref must be of type str')
self._ref = ref
@property
def subtitle(self) -> str:
return self._subtitle or ""
@subtitle.setter
def subtitle(self, subtitle: str):
if subtitle is None:
del self.subtitle
return
if not isinstance(subtitle, str):
raise TypeError('subtitle must be of type str')
self._subtitle = subtitle
@property
def creator_name(self) -> str:
return self._creator_name or ""
@creator_name.setter
def creator_name(self, creator_name: str):
if creator_name is None:
del self.creator_name
return
if not isinstance(creator_name, str):
raise TypeError('creator_name must be of type str')
self._creator_name = creator_name
@property
def creator_url(self) -> str:
return self._creator_url or ""
@creator_url.setter
def creator_url(self, creator_url: str):
if creator_url is None:
del self.creator_url
return
if not isinstance(creator_url, str):
raise TypeError('creator_url must be of type str')
self._creator_url = creator_url
@property
def total_bytes(self) -> int:
return self._total_bytes or 0
@total_bytes.setter
def total_bytes(self, total_bytes: int):
if total_bytes is None:
del self.total_bytes
return
if not isinstance(total_bytes, int):
raise TypeError('total_bytes must be of type int')
self._total_bytes = total_bytes
@property
def url(self) -> str:
return self._url or ""
@url.setter
def url(self, url: str):
if url is None:
del self.url
return
if not isinstance(url, str):
raise TypeError('url must be of type str')
self._url = url
@property
def last_updated(self) -> datetime:
return self._last_updated
@last_updated.setter
def last_updated(self, last_updated: datetime):
if last_updated is None:
del self.last_updated
return
if not isinstance(last_updated, datetime):
raise TypeError('last_updated must be of type datetime')
self._last_updated = last_updated
@property
def download_count(self) -> int:
return self._download_count
@download_count.setter
def download_count(self, download_count: int):
if download_count is None:
del self.download_count
return
if not isinstance(download_count, int):
raise TypeError('download_count must be of type int')
self._download_count = download_count
@property
def is_private(self) -> bool:
return self._is_private
@is_private.setter
def is_private(self, is_private: bool):
if is_private is None:
del self.is_private
return
if not isinstance(is_private, bool):
raise TypeError('is_private must be of type bool')
self._is_private = is_private
@property
def is_featured(self) -> bool:
return self._is_featured
@is_featured.setter
def is_featured(self, is_featured: bool):
if is_featured is None:
del self.is_featured
return
if not isinstance(is_featured, bool):
raise TypeError('is_featured must be of type bool')
self._is_featured = is_featured
@property
def license_name(self) -> str:
return self._license_name or ""
@license_name.setter
def license_name(self, license_name: str):
if license_name is None:
del self.license_name
return
if not isinstance(license_name, str):
raise TypeError('license_name must be of type str')
self._license_name = license_name
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
@property
def owner_name(self) -> str:
return self._owner_name or ""
@owner_name.setter
def owner_name(self, owner_name: str):
if owner_name is None:
del self.owner_name
return
if not isinstance(owner_name, str):
raise TypeError('owner_name must be of type str')
self._owner_name = owner_name
@property
def owner_ref(self) -> str:
return self._owner_ref or ""
@owner_ref.setter
def owner_ref(self, owner_ref: str):
if owner_ref is None:
del self.owner_ref
return
if not isinstance(owner_ref, str):
raise TypeError('owner_ref must be of type str')
self._owner_ref = owner_ref
@property
def kernel_count(self) -> int:
return self._kernel_count
@kernel_count.setter
def kernel_count(self, kernel_count: int):
if kernel_count is None:
del self.kernel_count
return
if not isinstance(kernel_count, int):
raise TypeError('kernel_count must be of type int')
self._kernel_count = kernel_count
@property
def title(self) -> str:
return self._title or ""
@title.setter
def title(self, title: str):
if title is None:
del self.title
return
if not isinstance(title, str):
raise TypeError('title must be of type str')
self._title = title
@property
def topic_count(self) -> int:
return self._topic_count
@topic_count.setter
def topic_count(self, topic_count: int):
if topic_count is None:
del self.topic_count
return
if not isinstance(topic_count, int):
raise TypeError('topic_count must be of type int')
self._topic_count = topic_count
@property
def view_count(self) -> int:
return self._view_count
@view_count.setter
def view_count(self, view_count: int):
if view_count is None:
del self.view_count
return
if not isinstance(view_count, int):
raise TypeError('view_count must be of type int')
self._view_count = view_count
@property
def vote_count(self) -> int:
return self._vote_count
@vote_count.setter
def vote_count(self, vote_count: int):
if vote_count is None:
del self.vote_count
return
if not isinstance(vote_count, int):
raise TypeError('vote_count must be of type int')
self._vote_count = vote_count
@property
def current_version_number(self) -> int:
return self._current_version_number or 0
@current_version_number.setter
def current_version_number(self, current_version_number: int):
if current_version_number is None:
del self.current_version_number
return
if not isinstance(current_version_number, int):
raise TypeError('current_version_number must be of type int')
self._current_version_number = current_version_number
@property
def usability_rating(self) -> float:
return self._usability_rating or 0.0
@usability_rating.setter
def usability_rating(self, usability_rating: float):
if usability_rating is None:
del self.usability_rating
return
if not isinstance(usability_rating, float):
raise TypeError('usability_rating must be of type float')
self._usability_rating = usability_rating
@property
def tags(self) -> Optional[List[Optional['ApiCategory']]]:
return self._tags
@tags.setter
def tags(self, tags: Optional[List[Optional['ApiCategory']]]):
if tags is None:
del self.tags
return
if not isinstance(tags, list):
raise TypeError('tags must be of type list')
if not all([isinstance(t, ApiCategory) for t in tags]):
raise TypeError('tags must contain only items of type ApiCategory')
self._tags = tags
@property
def files(self) -> Optional[List[Optional['ApiDatasetFile']]]:
return self._files
@files.setter
def files(self, files: Optional[List[Optional['ApiDatasetFile']]]):
if files is None:
del self.files
return
if not isinstance(files, list):
raise TypeError('files must be of type list')
if not all([isinstance(t, ApiDatasetFile) for t in files]):
raise TypeError('files must contain only items of type ApiDatasetFile')
self._files = files
@property
def versions(self) -> Optional[List[Optional['ApiDatasetVersion']]]:
return self._versions
@versions.setter
def versions(self, versions: Optional[List[Optional['ApiDatasetVersion']]]):
if versions is None:
del self.versions
return
if not isinstance(versions, list):
raise TypeError('versions must be of type list')
if not all([isinstance(t, ApiDatasetVersion) for t in versions]):
raise TypeError('versions must contain only items of type ApiDatasetVersion')
self._versions = versions
|
class ApiDataset(KaggleObject):
'''
Attributes:
id (int)
ref (str)
subtitle (str)
creator_name (str)
creator_url (str)
total_bytes (int)
url (str)
last_updated (datetime)
download_count (int)
is_private (bool)
is_featured (bool)
license_name (str)
description (str)
owner_name (str)
owner_ref (str)
kernel_count (int)
title (str)
topic_count (int)
view_count (int)
vote_count (int)
current_version_number (int)
usability_rating (float)
tags (ApiCategory)
files (ApiDatasetFile)
versions (ApiDatasetVersion)
'''
def __init__(self):
pass
@property
def id(self) -> int:
pass
@id.setter
def id(self) -> int:
pass
@property
def ref(self) -> str:
pass
@ref.setter
def ref(self) -> str:
pass
@property
def subtitle(self) -> str:
pass
@subtitle.setter
def subtitle(self) -> str:
pass
@property
def creator_name(self) -> str:
pass
@creator_name.setter
def creator_name(self) -> str:
pass
@property
def creator_url(self) -> str:
pass
@creator_url.setter
def creator_url(self) -> str:
pass
@property
def total_bytes(self) -> int:
pass
@total_bytes.setter
def total_bytes(self) -> int:
pass
@property
def url(self) -> str:
pass
@url.setter
def url(self) -> str:
pass
@property
def last_updated(self) -> datetime:
pass
@last_updated.setter
def last_updated(self) -> datetime:
pass
@property
def download_count(self) -> int:
pass
@download_count.setter
def download_count(self) -> int:
pass
@property
def is_private(self) -> bool:
pass
@is_private.setter
def is_private(self) -> bool:
pass
@property
def is_featured(self) -> bool:
pass
@is_featured.setter
def is_featured(self) -> bool:
pass
@property
def license_name(self) -> str:
pass
@license_name.setter
def license_name(self) -> str:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
@property
def owner_name(self) -> str:
pass
@owner_name.setter
def owner_name(self) -> str:
pass
@property
def owner_ref(self) -> str:
pass
@owner_ref.setter
def owner_ref(self) -> str:
pass
@property
def kernel_count(self) -> int:
pass
@kernel_count.setter
def kernel_count(self) -> int:
pass
@property
def title(self) -> str:
pass
@title.setter
def title(self) -> str:
pass
@property
def topic_count(self) -> int:
pass
@topic_count.setter
def topic_count(self) -> int:
pass
@property
def view_count(self) -> int:
pass
@view_count.setter
def view_count(self) -> int:
pass
@property
def vote_count(self) -> int:
pass
@vote_count.setter
def vote_count(self) -> int:
pass
@property
def current_version_number(self) -> int:
pass
@current_version_number.setter
def current_version_number(self) -> int:
pass
@property
def usability_rating(self) -> float:
pass
@usability_rating.setter
def usability_rating(self) -> float:
pass
@property
def tags(self) -> Optional[List[Optional['ApiCategory']]]:
pass
@tags.setter
def tags(self) -> Optional[List[Optional['ApiCategory']]]:
pass
@property
def files(self) -> Optional[List[Optional['ApiDatasetFile']]]:
pass
@files.setter
def files(self) -> Optional[List[Optional['ApiDatasetFile']]]:
pass
@property
def versions(self) -> Optional[List[Optional['ApiDatasetVersion']]]:
pass
@versions.setter
def versions(self) -> Optional[List[Optional['ApiDatasetVersion']]]:
pass
| 102 | 1 | 5 | 0 | 5 | 0 | 2 | 0.09 | 1 | 10 | 3 | 0 | 51 | 25 | 51 | 68 | 388 | 51 | 309 | 127 | 207 | 28 | 259 | 77 | 207 | 4 | 2 | 1 | 104 |
141,078 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDatasetColumn
|
class ApiDatasetColumn(KaggleObject):
r"""
Attributes:
order (int)
name (str)
type (str)
original_type (str)
description (str)
"""
def __init__(self):
self._order = None
self._name = None
self._type = None
self._original_type = None
self._description = None
self._freeze()
@property
def order(self) -> int:
return self._order or 0
@order.setter
def order(self, order: int):
if order is None:
del self.order
return
if not isinstance(order, int):
raise TypeError('order must be of type int')
self._order = order
@property
def name(self) -> str:
return self._name or ""
@name.setter
def name(self, name: str):
if name is None:
del self.name
return
if not isinstance(name, str):
raise TypeError('name must be of type str')
self._name = name
@property
def type(self) -> str:
return self._type or ""
@type.setter
def type(self, type: str):
if type is None:
del self.type
return
if not isinstance(type, str):
raise TypeError('type must be of type str')
self._type = type
@property
def original_type(self) -> str:
return self._original_type or ""
@original_type.setter
def original_type(self, original_type: str):
if original_type is None:
del self.original_type
return
if not isinstance(original_type, str):
raise TypeError('original_type must be of type str')
self._original_type = original_type
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
|
class ApiDatasetColumn(KaggleObject):
'''
Attributes:
order (int)
name (str)
type (str)
original_type (str)
description (str)
'''
def __init__(self):
pass
@property
def order(self) -> int:
pass
@order.setter
def order(self) -> int:
pass
@property
def name(self) -> str:
pass
@name.setter
def name(self) -> str:
pass
@property
def type(self) -> str:
pass
@type.setter
def type(self) -> str:
pass
@property
def original_type(self) -> str:
pass
@original_type.setter
def original_type(self) -> str:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
| 22 | 1 | 5 | 0 | 5 | 0 | 2 | 0.13 | 1 | 3 | 0 | 0 | 11 | 5 | 11 | 28 | 82 | 11 | 63 | 27 | 41 | 8 | 53 | 17 | 41 | 3 | 2 | 1 | 21 |
141,079 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDatasetFile
|
class ApiDatasetFile(KaggleObject):
r"""
Attributes:
ref (str)
dataset_ref (str)
owner_ref (str)
name (str)
creation_date (datetime)
description (str)
file_type (str)
url (str)
total_bytes (int)
columns (ApiDatasetColumn)
"""
def __init__(self):
self._ref = ""
self._dataset_ref = None
self._owner_ref = None
self._name = None
self._creation_date = None
self._description = None
self._file_type = None
self._url = None
self._total_bytes = 0
self._columns = []
self._freeze()
@property
def ref(self) -> str:
return self._ref
@ref.setter
def ref(self, ref: str):
if ref is None:
del self.ref
return
if not isinstance(ref, str):
raise TypeError('ref must be of type str')
self._ref = ref
@property
def dataset_ref(self) -> str:
return self._dataset_ref or ""
@dataset_ref.setter
def dataset_ref(self, dataset_ref: str):
if dataset_ref is None:
del self.dataset_ref
return
if not isinstance(dataset_ref, str):
raise TypeError('dataset_ref must be of type str')
self._dataset_ref = dataset_ref
@property
def owner_ref(self) -> str:
return self._owner_ref or ""
@owner_ref.setter
def owner_ref(self, owner_ref: str):
if owner_ref is None:
del self.owner_ref
return
if not isinstance(owner_ref, str):
raise TypeError('owner_ref must be of type str')
self._owner_ref = owner_ref
@property
def name(self) -> str:
return self._name or ""
@name.setter
def name(self, name: str):
if name is None:
del self.name
return
if not isinstance(name, str):
raise TypeError('name must be of type str')
self._name = name
@property
def creation_date(self) -> datetime:
return self._creation_date
@creation_date.setter
def creation_date(self, creation_date: datetime):
if creation_date is None:
del self.creation_date
return
if not isinstance(creation_date, datetime):
raise TypeError('creation_date must be of type datetime')
self._creation_date = creation_date
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
@property
def file_type(self) -> str:
return self._file_type or ""
@file_type.setter
def file_type(self, file_type: str):
if file_type is None:
del self.file_type
return
if not isinstance(file_type, str):
raise TypeError('file_type must be of type str')
self._file_type = file_type
@property
def url(self) -> str:
return self._url or ""
@url.setter
def url(self, url: str):
if url is None:
del self.url
return
if not isinstance(url, str):
raise TypeError('url must be of type str')
self._url = url
@property
def total_bytes(self) -> int:
return self._total_bytes
@total_bytes.setter
def total_bytes(self, total_bytes: int):
if total_bytes is None:
del self.total_bytes
return
if not isinstance(total_bytes, int):
raise TypeError('total_bytes must be of type int')
self._total_bytes = total_bytes
@property
def columns(self) -> Optional[List[Optional['ApiDatasetColumn']]]:
return self._columns
@columns.setter
def columns(self, columns: Optional[List[Optional['ApiDatasetColumn']]]):
if columns is None:
del self.columns
return
if not isinstance(columns, list):
raise TypeError('columns must be of type list')
if not all([isinstance(t, ApiDatasetColumn) for t in columns]):
raise TypeError('columns must contain only items of type ApiDatasetColumn')
self._columns = columns
|
class ApiDatasetFile(KaggleObject):
'''
Attributes:
ref (str)
dataset_ref (str)
owner_ref (str)
name (str)
creation_date (datetime)
description (str)
file_type (str)
url (str)
total_bytes (int)
columns (ApiDatasetColumn)
'''
def __init__(self):
pass
@property
def ref(self) -> str:
pass
@ref.setter
def ref(self) -> str:
pass
@property
def dataset_ref(self) -> str:
pass
@dataset_ref.setter
def dataset_ref(self) -> str:
pass
@property
def owner_ref(self) -> str:
pass
@owner_ref.setter
def owner_ref(self) -> str:
pass
@property
def name(self) -> str:
pass
@name.setter
def name(self) -> str:
pass
@property
def creation_date(self) -> datetime:
pass
@creation_date.setter
def creation_date(self) -> datetime:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
@property
def file_type(self) -> str:
pass
@file_type.setter
def file_type(self) -> str:
pass
@property
def url(self) -> str:
pass
@url.setter
def url(self) -> str:
pass
@property
def total_bytes(self) -> int:
pass
@total_bytes.setter
def total_bytes(self) -> int:
pass
@property
def columns(self) -> Optional[List[Optional['ApiDatasetColumn']]]:
pass
@columns.setter
def columns(self) -> Optional[List[Optional['ApiDatasetColumn']]]:
pass
| 42 | 1 | 5 | 0 | 5 | 0 | 2 | 0.1 | 1 | 6 | 1 | 0 | 21 | 10 | 21 | 38 | 159 | 21 | 125 | 52 | 83 | 13 | 105 | 32 | 83 | 4 | 2 | 1 | 42 |
141,080 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDatasetNewFile
|
class ApiDatasetNewFile(KaggleObject):
r"""
Attributes:
token (str)
description (str)
columns (ApiDatasetColumn)
"""
def __init__(self):
self._token = None
self._description = None
self._columns = []
self._freeze()
@property
def token(self) -> str:
return self._token or ""
@token.setter
def token(self, token: str):
if token is None:
del self.token
return
if not isinstance(token, str):
raise TypeError('token must be of type str')
self._token = token
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
@property
def columns(self) -> Optional[List[Optional['ApiDatasetColumn']]]:
return self._columns
@columns.setter
def columns(self, columns: Optional[List[Optional['ApiDatasetColumn']]]):
if columns is None:
del self.columns
return
if not isinstance(columns, list):
raise TypeError('columns must be of type list')
if not all([isinstance(t, ApiDatasetColumn) for t in columns]):
raise TypeError('columns must contain only items of type ApiDatasetColumn')
self._columns = columns
|
class ApiDatasetNewFile(KaggleObject):
'''
Attributes:
token (str)
description (str)
columns (ApiDatasetColumn)
'''
def __init__(self):
pass
@property
def token(self) -> str:
pass
@token.setter
def token(self) -> str:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
@property
def columns(self) -> Optional[List[Optional['ApiDatasetColumn']]]:
pass
@columns.setter
def columns(self) -> Optional[List[Optional['ApiDatasetColumn']]]:
pass
| 14 | 1 | 5 | 0 | 5 | 0 | 2 | 0.15 | 1 | 4 | 1 | 0 | 7 | 3 | 7 | 24 | 54 | 7 | 41 | 17 | 27 | 6 | 35 | 11 | 27 | 4 | 2 | 1 | 14 |
141,081 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDatasetVersion
|
class ApiDatasetVersion(KaggleObject):
r"""
Attributes:
version_number (int)
creation_date (datetime)
creator_name (str)
creator_ref (str)
version_notes (str)
status (str)
"""
def __init__(self):
self._version_number = 0
self._creation_date = None
self._creator_name = None
self._creator_ref = None
self._version_notes = None
self._status = None
self._freeze()
@property
def version_number(self) -> int:
return self._version_number
@version_number.setter
def version_number(self, version_number: int):
if version_number is None:
del self.version_number
return
if not isinstance(version_number, int):
raise TypeError('version_number must be of type int')
self._version_number = version_number
@property
def creation_date(self) -> datetime:
return self._creation_date
@creation_date.setter
def creation_date(self, creation_date: datetime):
if creation_date is None:
del self.creation_date
return
if not isinstance(creation_date, datetime):
raise TypeError('creation_date must be of type datetime')
self._creation_date = creation_date
@property
def creator_name(self) -> str:
return self._creator_name or ""
@creator_name.setter
def creator_name(self, creator_name: str):
if creator_name is None:
del self.creator_name
return
if not isinstance(creator_name, str):
raise TypeError('creator_name must be of type str')
self._creator_name = creator_name
@property
def creator_ref(self) -> str:
return self._creator_ref or ""
@creator_ref.setter
def creator_ref(self, creator_ref: str):
if creator_ref is None:
del self.creator_ref
return
if not isinstance(creator_ref, str):
raise TypeError('creator_ref must be of type str')
self._creator_ref = creator_ref
@property
def version_notes(self) -> str:
return self._version_notes or ""
@version_notes.setter
def version_notes(self, version_notes: str):
if version_notes is None:
del self.version_notes
return
if not isinstance(version_notes, str):
raise TypeError('version_notes must be of type str')
self._version_notes = version_notes
@property
def status(self) -> str:
return self._status or ""
@status.setter
def status(self, status: str):
if status is None:
del self.status
return
if not isinstance(status, str):
raise TypeError('status must be of type str')
self._status = status
|
class ApiDatasetVersion(KaggleObject):
'''
Attributes:
version_number (int)
creation_date (datetime)
creator_name (str)
creator_ref (str)
version_notes (str)
status (str)
'''
def __init__(self):
pass
@property
def version_number(self) -> int:
pass
@version_number.setter
def version_number(self) -> int:
pass
@property
def creation_date(self) -> datetime:
pass
@creation_date.setter
def creation_date(self) -> datetime:
pass
@property
def creator_name(self) -> str:
pass
@creator_name.setter
def creator_name(self) -> str:
pass
@property
def creator_ref(self) -> str:
pass
@creator_ref.setter
def creator_ref(self) -> str:
pass
@property
def version_notes(self) -> str:
pass
@version_notes.setter
def version_notes(self) -> str:
pass
@property
def status(self) -> str:
pass
@status.setter
def status(self) -> str:
pass
| 26 | 1 | 5 | 0 | 5 | 0 | 2 | 0.12 | 1 | 4 | 0 | 0 | 13 | 6 | 13 | 30 | 97 | 13 | 75 | 32 | 49 | 9 | 63 | 20 | 49 | 3 | 2 | 1 | 25 |
141,082 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDeleteDatasetRequest
|
class ApiDeleteDatasetRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
def endpoint(self):
path = '/api/v1/dataset/{owner_slug}/{dataset_slug}/delete'
return path.format_map(self.to_field_map(self))
@staticmethod
def method():
return 'POST'
|
class ApiDeleteDatasetRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def method():
pass
| 13 | 1 | 4 | 0 | 4 | 0 | 2 | 0.15 | 1 | 2 | 0 | 0 | 6 | 2 | 7 | 24 | 46 | 8 | 33 | 16 | 20 | 5 | 28 | 11 | 20 | 3 | 2 | 1 | 11 |
141,083 |
Kaggle/kaggle-api
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Kaggle_kaggle-api/src/kagglesdk/kaggle_client.py
|
src.kagglesdk.kaggle_client.KaggleClient.Admin
|
class Admin(object):
def __init__(self, http_client: KaggleHttpClient):
self.inbox_file_client = InboxFileClient(http_client)
|
class Admin(object):
def __init__(self, http_client: KaggleHttpClient):
pass
| 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 2 | 0 | 1 | 1 | 1 | 1 | 3 | 0 | 3 | 3 | 1 | 0 | 3 | 3 | 1 | 1 | 1 | 0 | 1 |
141,084 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDeleteDatasetResponse
|
class ApiDeleteDatasetResponse(KaggleObject):
r"""
Attributes:
error (str)
"""
def __init__(self):
self._error = None
self._freeze()
@property
def error(self) -> str:
return self._error or ""
@error.setter
def error(self, error: str):
if error is None:
del self.error
return
if not isinstance(error, str):
raise TypeError('error must be of type str')
self._error = error
|
class ApiDeleteDatasetResponse(KaggleObject):
'''
Attributes:
error (str)
'''
def __init__(self):
pass
@property
def error(self) -> str:
pass
@error.setter
def error(self) -> str:
pass
| 6 | 1 | 4 | 0 | 4 | 0 | 2 | 0.27 | 1 | 2 | 0 | 0 | 3 | 1 | 3 | 20 | 22 | 3 | 15 | 7 | 9 | 4 | 13 | 5 | 9 | 3 | 2 | 1 | 5 |
141,085 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDownloadDatasetRequest
|
class ApiDownloadDatasetRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
file_name (str)
dataset_version_number (int)
raw (bool)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._file_name = None
self._dataset_version_number = None
self._raw = False
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
@property
def file_name(self) -> str:
return self._file_name or ""
@file_name.setter
def file_name(self, file_name: str):
if file_name is None:
del self.file_name
return
if not isinstance(file_name, str):
raise TypeError('file_name must be of type str')
self._file_name = file_name
@property
def dataset_version_number(self) -> int:
return self._dataset_version_number or 0
@dataset_version_number.setter
def dataset_version_number(self, dataset_version_number: int):
if dataset_version_number is None:
del self.dataset_version_number
return
if not isinstance(dataset_version_number, int):
raise TypeError('dataset_version_number must be of type int')
self._dataset_version_number = dataset_version_number
@property
def raw(self) -> bool:
return self._raw
@raw.setter
def raw(self, raw: bool):
if raw is None:
del self.raw
return
if not isinstance(raw, bool):
raise TypeError('raw must be of type bool')
self._raw = raw
def endpoint(self):
if self.file_name:
path = '/api/v1/datasets/download/{owner_slug}/{dataset_slug}/{file_name}'
else:
path = '/api/v1/datasets/download/{owner_slug}/{dataset_slug}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/datasets/download/{owner_slug}/{dataset_slug}'
|
class ApiDownloadDatasetRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
file_name (str)
dataset_version_number (int)
raw (bool)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
@property
def file_name(self) -> str:
pass
@file_name.setter
def file_name(self) -> str:
pass
@property
def dataset_version_number(self) -> int:
pass
@dataset_version_number.setter
def dataset_version_number(self) -> int:
pass
@property
def raw(self) -> bool:
pass
@raw.setter
def raw(self) -> bool:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 25 | 1 | 5 | 0 | 5 | 0 | 2 | 0.11 | 1 | 4 | 0 | 0 | 12 | 5 | 13 | 30 | 93 | 13 | 72 | 31 | 47 | 8 | 60 | 20 | 46 | 3 | 2 | 1 | 24 |
141,086 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiGetDatasetMetadataRequest
|
class ApiGetDatasetMetadataRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
def endpoint(self):
path = '/api/v1/datasets/metadata/{owner_slug}/{dataset_slug}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/datasets/metadata/{owner_slug}/{dataset_slug}'
|
class ApiGetDatasetMetadataRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 13 | 1 | 4 | 0 | 4 | 0 | 2 | 0.15 | 1 | 2 | 0 | 0 | 6 | 2 | 7 | 24 | 45 | 7 | 33 | 16 | 20 | 5 | 28 | 11 | 20 | 3 | 2 | 1 | 11 |
141,087 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiGetDatasetMetadataResponse
|
class ApiGetDatasetMetadataResponse(KaggleObject):
r"""
Attributes:
info (DatasetInfo)
error_message (str)
Required for backwards-compatibility. See
https://github.com/Kaggle/kaggle-api/issues/235
"""
def __init__(self):
self._info = None
self._error_message = None
self._freeze()
@property
def info(self) -> Optional['DatasetInfo']:
return self._info
@info.setter
def info(self, info: Optional['DatasetInfo']):
if info is None:
del self.info
return
if not isinstance(info, DatasetInfo):
raise TypeError('info must be of type DatasetInfo')
self._info = info
@property
def error_message(self) -> str:
r"""
Required for backwards-compatibility. See
https://github.com/Kaggle/kaggle-api/issues/235
"""
return self._error_message or ""
@error_message.setter
def error_message(self, error_message: str):
if error_message is None:
del self.error_message
return
if not isinstance(error_message, str):
raise TypeError('error_message must be of type str')
self._error_message = error_message
@property
def errorMessage(self):
return self.error_message
|
class ApiGetDatasetMetadataResponse(KaggleObject):
'''
Attributes:
info (DatasetInfo)
error_message (str)
Required for backwards-compatibility. See
https://github.com/Kaggle/kaggle-api/issues/235
'''
def __init__(self):
pass
@property
def info(self) -> Optional['DatasetInfo']:
pass
@info.setter
def info(self) -> Optional['DatasetInfo']:
pass
@property
def error_message(self) -> str:
'''
Required for backwards-compatibility. See
https://github.com/Kaggle/kaggle-api/issues/235
'''
pass
@error_message.setter
def error_message(self) -> str:
pass
@property
def errorMessage(self):
pass
| 12 | 2 | 5 | 0 | 4 | 1 | 2 | 0.37 | 1 | 3 | 1 | 0 | 6 | 2 | 6 | 23 | 47 | 6 | 30 | 14 | 18 | 11 | 25 | 9 | 18 | 3 | 2 | 1 | 10 |
141,088 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiGetDatasetRequest
|
class ApiGetDatasetRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
def endpoint(self):
path = '/api/v1/datasets/view/{owner_slug}/{dataset_slug}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/datasets/view/{owner_slug}/{dataset_slug}'
|
class ApiGetDatasetRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 13 | 1 | 4 | 0 | 4 | 0 | 2 | 0.15 | 1 | 2 | 0 | 0 | 6 | 2 | 7 | 24 | 45 | 7 | 33 | 16 | 20 | 5 | 28 | 11 | 20 | 3 | 2 | 1 | 11 |
141,089 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiGetDatasetStatusRequest
|
class ApiGetDatasetStatusRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
def endpoint(self):
path = '/api/v1/datasets/status/{owner_slug}/{dataset_slug}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/datasets/status/{owner_slug}/{dataset_slug}'
|
class ApiGetDatasetStatusRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 13 | 1 | 4 | 0 | 4 | 0 | 2 | 0.15 | 1 | 2 | 0 | 0 | 6 | 2 | 7 | 24 | 45 | 7 | 33 | 16 | 20 | 5 | 28 | 11 | 20 | 3 | 2 | 1 | 11 |
141,090 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiGetDatasetStatusResponse
|
class ApiGetDatasetStatusResponse(KaggleObject):
r"""
Attributes:
status (DatabundleVersionStatus)
"""
def __init__(self):
self._status = DatabundleVersionStatus.NOT_YET_PERSISTED
self._freeze()
@property
def status(self) -> 'DatabundleVersionStatus':
return self._status
@status.setter
def status(self, status: 'DatabundleVersionStatus'):
if status is None:
del self.status
return
if not isinstance(status, DatabundleVersionStatus):
raise TypeError('status must be of type DatabundleVersionStatus')
self._status = status
@classmethod
def prepare_from(cls, http_response):
return cls.from_dict({'status': json.loads(http_response.text)})
|
class ApiGetDatasetStatusResponse(KaggleObject):
'''
Attributes:
status (DatabundleVersionStatus)
'''
def __init__(self):
pass
@property
def status(self) -> 'DatabundleVersionStatus':
pass
@status.setter
def status(self) -> 'DatabundleVersionStatus':
pass
@classmethod
def prepare_from(cls, http_response):
pass
| 8 | 1 | 4 | 0 | 4 | 0 | 2 | 0.22 | 1 | 2 | 1 | 0 | 3 | 1 | 4 | 21 | 26 | 4 | 18 | 9 | 10 | 4 | 15 | 6 | 10 | 3 | 2 | 1 | 6 |
141,091 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiListDatasetFilesRequest
|
class ApiListDatasetFilesRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
dataset_version_number (int)
page_token (str)
page_size (int)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._dataset_version_number = None
self._page_token = None
self._page_size = None
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
@property
def dataset_version_number(self) -> int:
return self._dataset_version_number or 0
@dataset_version_number.setter
def dataset_version_number(self, dataset_version_number: int):
if dataset_version_number is None:
del self.dataset_version_number
return
if not isinstance(dataset_version_number, int):
raise TypeError('dataset_version_number must be of type int')
self._dataset_version_number = dataset_version_number
@property
def page_token(self) -> str:
return self._page_token or ""
@page_token.setter
def page_token(self, page_token: str):
if page_token is None:
del self.page_token
return
if not isinstance(page_token, str):
raise TypeError('page_token must be of type str')
self._page_token = page_token
@property
def page_size(self) -> int:
return self._page_size or 0
@page_size.setter
def page_size(self, page_size: int):
if page_size is None:
del self.page_size
return
if not isinstance(page_size, int):
raise TypeError('page_size must be of type int')
self._page_size = page_size
def endpoint(self):
path = '/api/v1/datasets/list/{owner_slug}/{dataset_slug}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/datasets/list/{owner_slug}/{dataset_slug}'
|
class ApiListDatasetFilesRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
dataset_version_number (int)
page_token (str)
page_size (int)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
@property
def dataset_version_number(self) -> int:
pass
@dataset_version_number.setter
def dataset_version_number(self) -> int:
pass
@property
def page_token(self) -> str:
pass
@page_token.setter
def page_token(self) -> str:
pass
@property
def page_size(self) -> int:
pass
@page_size.setter
def page_size(self) -> int:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 25 | 1 | 4 | 0 | 4 | 0 | 2 | 0.12 | 1 | 3 | 0 | 0 | 12 | 5 | 13 | 30 | 90 | 13 | 69 | 31 | 44 | 8 | 58 | 20 | 44 | 3 | 2 | 1 | 23 |
141,092 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiListDatasetFilesResponse
|
class ApiListDatasetFilesResponse(KaggleObject):
r"""
Attributes:
dataset_files (ApiDatasetFile)
error_message (str)
next_page_token (str)
"""
def __init__(self):
self._dataset_files = []
self._error_message = None
self._next_page_token = None
self._freeze()
@property
def dataset_files(self) -> Optional[List[Optional['ApiDatasetFile']]]:
return self._dataset_files
@dataset_files.setter
def dataset_files(self, dataset_files: Optional[List[Optional['ApiDatasetFile']]]):
if dataset_files is None:
del self.dataset_files
return
if not isinstance(dataset_files, list):
raise TypeError('dataset_files must be of type list')
if not all([isinstance(t, ApiDatasetFile) for t in dataset_files]):
raise TypeError('dataset_files must contain only items of type ApiDatasetFile')
self._dataset_files = dataset_files
@property
def error_message(self) -> str:
return self._error_message or ""
@error_message.setter
def error_message(self, error_message: str):
if error_message is None:
del self.error_message
return
if not isinstance(error_message, str):
raise TypeError('error_message must be of type str')
self._error_message = error_message
@property
def next_page_token(self) -> str:
return self._next_page_token or ""
@next_page_token.setter
def next_page_token(self, next_page_token: str):
if next_page_token is None:
del self.next_page_token
return
if not isinstance(next_page_token, str):
raise TypeError('next_page_token must be of type str')
self._next_page_token = next_page_token
@property
def files(self):
return self.dataset_files
@property
def errorMessage(self):
return self.error_message
@property
def nextPageToken(self):
return self.next_page_token
|
class ApiListDatasetFilesResponse(KaggleObject):
'''
Attributes:
dataset_files (ApiDatasetFile)
error_message (str)
next_page_token (str)
'''
def __init__(self):
pass
@property
def dataset_files(self) -> Optional[List[Optional['ApiDatasetFile']]]:
pass
@dataset_files.setter
def dataset_files(self) -> Optional[List[Optional['ApiDatasetFile']]]:
pass
@property
def error_message(self) -> str:
pass
@error_message.setter
def error_message(self) -> str:
pass
@property
def next_page_token(self) -> str:
pass
@next_page_token.setter
def next_page_token(self) -> str:
pass
@property
def files(self):
pass
@property
def errorMessage(self):
pass
@property
def nextPageToken(self):
pass
| 20 | 1 | 4 | 0 | 4 | 0 | 2 | 0.12 | 1 | 4 | 1 | 0 | 10 | 3 | 10 | 27 | 66 | 10 | 50 | 23 | 30 | 6 | 41 | 14 | 30 | 4 | 2 | 1 | 17 |
141,093 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiListDatasetsRequest
|
class ApiListDatasetsRequest(KaggleObject):
r"""
Attributes:
group (DatasetSelectionGroup)
sort_by (DatasetSortBy)
size (DatasetSizeGroup)
file_type (DatasetFileTypeGroup)
license (DatasetLicenseGroup)
viewed (DatasetViewedGroup)
tag_ids (str)
search (str)
user (str)
min_size (int)
max_size (int)
page (int)
page_token (str)
page_size (int)
"""
def __init__(self):
self._group = DatasetSelectionGroup.DATASET_SELECTION_GROUP_PUBLIC
self._sort_by = DatasetSortBy.DATASET_SORT_BY_HOTTEST
self._size = DatasetSizeGroup.DATASET_SIZE_GROUP_ALL
self._file_type = DatasetFileTypeGroup.DATASET_FILE_TYPE_GROUP_ALL
self._license = DatasetLicenseGroup.DATASET_LICENSE_GROUP_ALL
self._viewed = DatasetViewedGroup.DATASET_VIEWED_GROUP_UNSPECIFIED
self._tag_ids = None
self._search = None
self._user = None
self._min_size = None
self._max_size = None
self._page = None
self._page_token = None
self._page_size = None
self._freeze()
@property
def group(self) -> 'DatasetSelectionGroup':
return self._group
@group.setter
def group(self, group: 'DatasetSelectionGroup'):
if group is None:
del self.group
return
if not isinstance(group, DatasetSelectionGroup):
raise TypeError('group must be of type DatasetSelectionGroup')
self._group = group
@property
def sort_by(self) -> 'DatasetSortBy':
return self._sort_by
@sort_by.setter
def sort_by(self, sort_by: 'DatasetSortBy'):
if sort_by is None:
del self.sort_by
return
if not isinstance(sort_by, DatasetSortBy):
raise TypeError('sort_by must be of type DatasetSortBy')
self._sort_by = sort_by
@property
def size(self) -> 'DatasetSizeGroup':
return self._size
@size.setter
def size(self, size: 'DatasetSizeGroup'):
if size is None:
del self.size
return
if not isinstance(size, DatasetSizeGroup):
raise TypeError('size must be of type DatasetSizeGroup')
self._size = size
@property
def file_type(self) -> 'DatasetFileTypeGroup':
return self._file_type
@file_type.setter
def file_type(self, file_type: 'DatasetFileTypeGroup'):
if file_type is None:
del self.file_type
return
if not isinstance(file_type, DatasetFileTypeGroup):
raise TypeError('file_type must be of type DatasetFileTypeGroup')
self._file_type = file_type
@property
def license(self) -> 'DatasetLicenseGroup':
return self._license
@license.setter
def license(self, license: 'DatasetLicenseGroup'):
if license is None:
del self.license
return
if not isinstance(license, DatasetLicenseGroup):
raise TypeError('license must be of type DatasetLicenseGroup')
self._license = license
@property
def viewed(self) -> 'DatasetViewedGroup':
return self._viewed
@viewed.setter
def viewed(self, viewed: 'DatasetViewedGroup'):
if viewed is None:
del self.viewed
return
if not isinstance(viewed, DatasetViewedGroup):
raise TypeError('viewed must be of type DatasetViewedGroup')
self._viewed = viewed
@property
def tag_ids(self) -> str:
return self._tag_ids or ""
@tag_ids.setter
def tag_ids(self, tag_ids: str):
if tag_ids is None:
del self.tag_ids
return
if not isinstance(tag_ids, str):
raise TypeError('tag_ids must be of type str')
self._tag_ids = tag_ids
@property
def search(self) -> str:
return self._search or ""
@search.setter
def search(self, search: str):
if search is None:
del self.search
return
if not isinstance(search, str):
raise TypeError('search must be of type str')
self._search = search
@property
def user(self) -> str:
return self._user or ""
@user.setter
def user(self, user: str):
if user is None:
del self.user
return
if not isinstance(user, str):
raise TypeError('user must be of type str')
self._user = user
@property
def min_size(self) -> int:
return self._min_size or 0
@min_size.setter
def min_size(self, min_size: int):
if min_size is None:
del self.min_size
return
if not isinstance(min_size, int):
raise TypeError('min_size must be of type int')
self._min_size = min_size
@property
def max_size(self) -> int:
return self._max_size or 0
@max_size.setter
def max_size(self, max_size: int):
if max_size is None:
del self.max_size
return
if not isinstance(max_size, int):
raise TypeError('max_size must be of type int')
self._max_size = max_size
@property
def page(self) -> int:
return self._page or 0
@page.setter
def page(self, page: int):
if page is None:
del self.page
return
if not isinstance(page, int):
raise TypeError('page must be of type int')
self._page = page
@property
def page_token(self) -> str:
return self._page_token or ""
@page_token.setter
def page_token(self, page_token: str):
if page_token is None:
del self.page_token
return
if not isinstance(page_token, str):
raise TypeError('page_token must be of type str')
self._page_token = page_token
@property
def page_size(self) -> int:
return self._page_size or 0
@page_size.setter
def page_size(self, page_size: int):
if page_size is None:
del self.page_size
return
if not isinstance(page_size, int):
raise TypeError('page_size must be of type int')
self._page_size = page_size
def endpoint(self):
path = '/api/v1/datasets/list'
return path.format_map(self.to_field_map(self))
|
class ApiListDatasetsRequest(KaggleObject):
'''
Attributes:
group (DatasetSelectionGroup)
sort_by (DatasetSortBy)
size (DatasetSizeGroup)
file_type (DatasetFileTypeGroup)
license (DatasetLicenseGroup)
viewed (DatasetViewedGroup)
tag_ids (str)
search (str)
user (str)
min_size (int)
max_size (int)
page (int)
page_token (str)
page_size (int)
'''
def __init__(self):
pass
@property
def group(self) -> 'DatasetSelectionGroup':
pass
@group.setter
def group(self) -> 'DatasetSelectionGroup':
pass
@property
def sort_by(self) -> 'DatasetSortBy':
pass
@sort_by.setter
def sort_by(self) -> 'DatasetSortBy':
pass
@property
def size(self) -> 'DatasetSizeGroup':
pass
@size.setter
def size(self) -> 'DatasetSizeGroup':
pass
@property
def file_type(self) -> 'DatasetFileTypeGroup':
pass
@file_type.setter
def file_type(self) -> 'DatasetFileTypeGroup':
pass
@property
def license(self) -> 'DatasetLicenseGroup':
pass
@license.setter
def license(self) -> 'DatasetLicenseGroup':
pass
@property
def viewed(self) -> 'DatasetViewedGroup':
pass
@viewed.setter
def viewed(self) -> 'DatasetViewedGroup':
pass
@property
def tag_ids(self) -> str:
pass
@tag_ids.setter
def tag_ids(self) -> str:
pass
@property
def search(self) -> str:
pass
@search.setter
def search(self) -> str:
pass
@property
def user(self) -> str:
pass
@user.setter
def user(self) -> str:
pass
@property
def min_size(self) -> int:
pass
@min_size.setter
def min_size(self) -> int:
pass
@property
def max_size(self) -> int:
pass
@max_size.setter
def max_size(self) -> int:
pass
@property
def page(self) -> int:
pass
@page.setter
def page(self) -> int:
pass
@property
def page_token(self) -> str:
pass
@page_token.setter
def page_token(self) -> str:
pass
@property
def page_size(self) -> int:
pass
@page_size.setter
def page_size(self) -> int:
pass
def endpoint(self):
pass
| 59 | 1 | 5 | 0 | 5 | 0 | 2 | 0.1 | 1 | 9 | 6 | 0 | 30 | 14 | 30 | 47 | 221 | 30 | 174 | 74 | 115 | 17 | 146 | 46 | 115 | 3 | 2 | 1 | 58 |
141,094 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiListDatasetsResponse
|
class ApiListDatasetsResponse(KaggleObject):
r"""
Attributes:
datasets (ApiDataset)
"""
def __init__(self):
self._datasets = []
self._freeze()
@property
def datasets(self) -> Optional[List[Optional['ApiDataset']]]:
return self._datasets
@datasets.setter
def datasets(self, datasets: Optional[List[Optional['ApiDataset']]]):
if datasets is None:
del self.datasets
return
if not isinstance(datasets, list):
raise TypeError('datasets must be of type list')
if not all([isinstance(t, ApiDataset) for t in datasets]):
raise TypeError('datasets must contain only items of type ApiDataset')
self._datasets = datasets
@classmethod
def prepare_from(cls, http_response):
return cls.from_dict({'datasets': json.loads(http_response.text)})
|
class ApiListDatasetsResponse(KaggleObject):
'''
Attributes:
datasets (ApiDataset)
'''
def __init__(self):
pass
@property
def datasets(self) -> Optional[List[Optional['ApiDataset']]]:
pass
@datasets.setter
def datasets(self) -> Optional[List[Optional['ApiDataset']]]:
pass
@classmethod
def prepare_from(cls, http_response):
pass
| 8 | 1 | 4 | 0 | 4 | 0 | 2 | 0.2 | 1 | 3 | 1 | 0 | 3 | 1 | 4 | 21 | 28 | 4 | 20 | 9 | 12 | 4 | 17 | 6 | 12 | 4 | 2 | 1 | 7 |
141,095 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiUpdateDatasetMetadataRequest
|
class ApiUpdateDatasetMetadataRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
settings (DatasetSettings)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._settings = None
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
@property
def settings(self) -> Optional['DatasetSettings']:
return self._settings
@settings.setter
def settings(self, settings: Optional['DatasetSettings']):
if settings is None:
del self.settings
return
if not isinstance(settings, DatasetSettings):
raise TypeError('settings must be of type DatasetSettings')
self._settings = settings
def endpoint(self):
path = '/api/v1/datasets/metadata/{owner_slug}/{dataset_slug}'
return path.format_map(self.to_field_map(self))
@staticmethod
def method():
return 'POST'
@staticmethod
def body_fields():
return 'settings'
|
class ApiUpdateDatasetMetadataRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
settings (DatasetSettings)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
@property
def settings(self) -> Optional['DatasetSettings']:
pass
@settings.setter
def settings(self) -> Optional['DatasetSettings']:
pass
def endpoint(self):
pass
@staticmethod
def method():
pass
@staticmethod
def body_fields():
pass
| 19 | 1 | 4 | 0 | 4 | 0 | 2 | 0.13 | 1 | 3 | 1 | 0 | 8 | 3 | 10 | 27 | 65 | 11 | 48 | 23 | 29 | 6 | 40 | 15 | 29 | 3 | 2 | 1 | 16 |
141,096 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiDownloadDataFileRequest
|
class ApiDownloadDataFileRequest(KaggleObject):
r"""
Attributes:
competition_name (str)
Competition name. Example: 'titanic'.
file_name (str)
Name of the file to download. Example: 'train/foo/bar.png'.
"""
def __init__(self):
self._competition_name = ""
self._file_name = ""
self._freeze()
@property
def competition_name(self) -> str:
"""Competition name. Example: 'titanic'."""
return self._competition_name
@competition_name.setter
def competition_name(self, competition_name: str):
if competition_name is None:
del self.competition_name
return
if not isinstance(competition_name, str):
raise TypeError('competition_name must be of type str')
self._competition_name = competition_name
@property
def file_name(self) -> str:
"""Name of the file to download. Example: 'train/foo/bar.png'."""
return self._file_name
@file_name.setter
def file_name(self, file_name: str):
if file_name is None:
del self.file_name
return
if not isinstance(file_name, str):
raise TypeError('file_name must be of type str')
self._file_name = file_name
def endpoint(self):
path = '/api/v1/competitions/data/download/{competition_name}/{file_name}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/competitions/data/download/{competition_name}/{file_name}'
|
class ApiDownloadDataFileRequest(KaggleObject):
'''
Attributes:
competition_name (str)
Competition name. Example: 'titanic'.
file_name (str)
Name of the file to download. Example: 'train/foo/bar.png'.
'''
def __init__(self):
pass
@property
def competition_name(self) -> str:
'''Competition name. Example: 'titanic'.'''
pass
@competition_name.setter
def competition_name(self) -> str:
pass
@property
def file_name(self) -> str:
'''Name of the file to download. Example: 'train/foo/bar.png'.'''
pass
@file_name.setter
def file_name(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 13 | 3 | 4 | 0 | 4 | 0 | 2 | 0.27 | 1 | 2 | 0 | 0 | 6 | 2 | 7 | 24 | 49 | 7 | 33 | 16 | 20 | 9 | 28 | 11 | 20 | 3 | 2 | 1 | 11 |
141,097 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/types/dataset_api_service.py
|
src.kagglesdk.datasets.types.dataset_api_service.ApiDownloadDatasetRawRequest
|
class ApiDownloadDatasetRawRequest(KaggleObject):
r"""
Attributes:
owner_slug (str)
dataset_slug (str)
file_name (str)
dataset_version_number (int)
"""
def __init__(self):
self._owner_slug = ""
self._dataset_slug = ""
self._file_name = None
self._dataset_version_number = None
self._freeze()
@property
def owner_slug(self) -> str:
return self._owner_slug
@owner_slug.setter
def owner_slug(self, owner_slug: str):
if owner_slug is None:
del self.owner_slug
return
if not isinstance(owner_slug, str):
raise TypeError('owner_slug must be of type str')
self._owner_slug = owner_slug
@property
def dataset_slug(self) -> str:
return self._dataset_slug
@dataset_slug.setter
def dataset_slug(self, dataset_slug: str):
if dataset_slug is None:
del self.dataset_slug
return
if not isinstance(dataset_slug, str):
raise TypeError('dataset_slug must be of type str')
self._dataset_slug = dataset_slug
@property
def file_name(self) -> str:
return self._file_name or ""
@file_name.setter
def file_name(self, file_name: str):
if file_name is None:
del self.file_name
return
if not isinstance(file_name, str):
raise TypeError('file_name must be of type str')
self._file_name = file_name
@property
def dataset_version_number(self) -> int:
return self._dataset_version_number or 0
@dataset_version_number.setter
def dataset_version_number(self, dataset_version_number: int):
if dataset_version_number is None:
del self.dataset_version_number
return
if not isinstance(dataset_version_number, int):
raise TypeError('dataset_version_number must be of type int')
self._dataset_version_number = dataset_version_number
def endpoint(self):
path = '/api/v1/datasets/download-raw/{owner_slug}/{dataset_slug}/{file_name}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/datasets/download-raw/{owner_slug}/{dataset_slug}/{file_name}'
|
class ApiDownloadDatasetRawRequest(KaggleObject):
'''
Attributes:
owner_slug (str)
dataset_slug (str)
file_name (str)
dataset_version_number (int)
'''
def __init__(self):
pass
@property
def owner_slug(self) -> str:
pass
@owner_slug.setter
def owner_slug(self) -> str:
pass
@property
def dataset_slug(self) -> str:
pass
@dataset_slug.setter
def dataset_slug(self) -> str:
pass
@property
def file_name(self) -> str:
pass
@file_name.setter
def file_name(self) -> str:
pass
@property
def dataset_version_number(self) -> int:
pass
@dataset_version_number.setter
def dataset_version_number(self) -> int:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 21 | 1 | 4 | 0 | 4 | 0 | 2 | 0.12 | 1 | 3 | 0 | 0 | 10 | 4 | 11 | 28 | 75 | 11 | 57 | 26 | 36 | 7 | 48 | 17 | 36 | 3 | 2 | 1 | 19 |
141,098 |
Kaggle/kaggle-api
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Kaggle_kaggle-api/src/kagglesdk/kaggle_client.py
|
src.kagglesdk.kaggle_client.KaggleClient.Competitions
|
class Competitions(object):
def __init__(self, http_client: KaggleHttpClient):
self.competition_api_client = CompetitionApiClient(http_client)
|
class Competitions(object):
def __init__(self, http_client: KaggleHttpClient):
pass
| 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 2 | 0 | 1 | 1 | 1 | 1 | 3 | 0 | 3 | 3 | 1 | 0 | 3 | 3 | 1 | 1 | 1 | 0 | 1 |
141,099 |
Kaggle/kaggle-api
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Kaggle_kaggle-api/src/kagglesdk/kaggle_client.py
|
src.kagglesdk.kaggle_client.KaggleClient.Blobs
|
class Blobs(object):
def __init__(self, http_client: KaggleHttpClient):
self.blob_api_client = BlobApiClient(http_client)
|
class Blobs(object):
def __init__(self, http_client: KaggleHttpClient):
pass
| 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 2 | 0 | 1 | 1 | 1 | 1 | 3 | 0 | 3 | 3 | 1 | 0 | 3 | 3 | 1 | 1 | 1 | 0 | 1 |
141,100 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiStartSubmissionUploadRequest
|
class ApiStartSubmissionUploadRequest(KaggleObject):
r"""
Attributes:
competition_name (str)
content_length (int)
last_modified_epoch_seconds (int)
file_name (str)
Comes from form upload
"""
def __init__(self):
self._competition_name = None
self._content_length = 0
self._last_modified_epoch_seconds = 0
self._file_name = ""
self._freeze()
@property
def competition_name(self) -> str:
return self._competition_name or ""
@competition_name.setter
def competition_name(self, competition_name: str):
if competition_name is None:
del self.competition_name
return
if not isinstance(competition_name, str):
raise TypeError('competition_name must be of type str')
self._competition_name = competition_name
@property
def content_length(self) -> int:
return self._content_length
@content_length.setter
def content_length(self, content_length: int):
if content_length is None:
del self.content_length
return
if not isinstance(content_length, int):
raise TypeError('content_length must be of type int')
self._content_length = content_length
@property
def last_modified_epoch_seconds(self) -> int:
return self._last_modified_epoch_seconds
@last_modified_epoch_seconds.setter
def last_modified_epoch_seconds(self, last_modified_epoch_seconds: int):
if last_modified_epoch_seconds is None:
del self.last_modified_epoch_seconds
return
if not isinstance(last_modified_epoch_seconds, int):
raise TypeError('last_modified_epoch_seconds must be of type int')
self._last_modified_epoch_seconds = last_modified_epoch_seconds
@property
def file_name(self) -> str:
"""Comes from form upload"""
return self._file_name
@file_name.setter
def file_name(self, file_name: str):
if file_name is None:
del self.file_name
return
if not isinstance(file_name, str):
raise TypeError('file_name must be of type str')
self._file_name = file_name
def endpoint(self):
path = '/api/v1/competitions/submission-url'
return path.format_map(self.to_field_map(self))
@staticmethod
def method():
return 'POST'
|
class ApiStartSubmissionUploadRequest(KaggleObject):
'''
Attributes:
competition_name (str)
content_length (int)
last_modified_epoch_seconds (int)
file_name (str)
Comes from form upload
'''
def __init__(self):
pass
@property
def competition_name(self) -> str:
pass
@competition_name.setter
def competition_name(self) -> str:
pass
@property
def content_length(self) -> int:
pass
@content_length.setter
def content_length(self) -> int:
pass
@property
def last_modified_epoch_seconds(self) -> int:
pass
@last_modified_epoch_seconds.setter
def last_modified_epoch_seconds(self) -> int:
pass
@property
def file_name(self) -> str:
'''Comes from form upload'''
pass
@file_name.setter
def file_name(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def method():
pass
| 21 | 2 | 4 | 0 | 4 | 0 | 2 | 0.16 | 1 | 3 | 0 | 0 | 10 | 4 | 11 | 28 | 78 | 12 | 57 | 26 | 36 | 9 | 48 | 17 | 36 | 3 | 2 | 1 | 19 |
141,101 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiGetSubmissionRequest
|
class ApiGetSubmissionRequest(KaggleObject):
r"""
Attributes:
ref (int)
SubmissionId.
"""
def __init__(self):
self._ref = 0
self._freeze()
@property
def ref(self) -> int:
"""SubmissionId."""
return self._ref
@ref.setter
def ref(self, ref: int):
if ref is None:
del self.ref
return
if not isinstance(ref, int):
raise TypeError('ref must be of type int')
self._ref = ref
def endpoint(self):
path = '/api/v1/competitions/submissions/get/{ref}'
return path.format_map(self.to_field_map(self))
@staticmethod
def method():
return 'POST'
|
class ApiGetSubmissionRequest(KaggleObject):
'''
Attributes:
ref (int)
SubmissionId.
'''
def __init__(self):
pass
@property
def ref(self) -> int:
'''SubmissionId.'''
pass
@ref.setter
def ref(self) -> int:
pass
def endpoint(self):
pass
@staticmethod
def method():
pass
| 9 | 2 | 4 | 0 | 3 | 0 | 1 | 0.29 | 1 | 2 | 0 | 0 | 4 | 1 | 5 | 22 | 33 | 6 | 21 | 11 | 12 | 6 | 18 | 8 | 12 | 3 | 2 | 1 | 7 |
141,102 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiLeaderboardSubmission
|
class ApiLeaderboardSubmission(KaggleObject):
r"""
Attributes:
team_id (int)
team_name (str)
submission_date (datetime)
score (str)
"""
def __init__(self):
self._team_id = 0
self._team_name = None
self._submission_date = None
self._score = None
self._freeze()
@property
def team_id(self) -> int:
return self._team_id
@team_id.setter
def team_id(self, team_id: int):
if team_id is None:
del self.team_id
return
if not isinstance(team_id, int):
raise TypeError('team_id must be of type int')
self._team_id = team_id
@property
def team_name(self) -> str:
return self._team_name or ""
@team_name.setter
def team_name(self, team_name: str):
if team_name is None:
del self.team_name
return
if not isinstance(team_name, str):
raise TypeError('team_name must be of type str')
self._team_name = team_name
@property
def submission_date(self) -> datetime:
return self._submission_date
@submission_date.setter
def submission_date(self, submission_date: datetime):
if submission_date is None:
del self.submission_date
return
if not isinstance(submission_date, datetime):
raise TypeError('submission_date must be of type datetime')
self._submission_date = submission_date
@property
def score(self) -> str:
return self._score or ""
@score.setter
def score(self, score: str):
if score is None:
del self.score
return
if not isinstance(score, str):
raise TypeError('score must be of type str')
self._score = score
|
class ApiLeaderboardSubmission(KaggleObject):
'''
Attributes:
team_id (int)
team_name (str)
submission_date (datetime)
score (str)
'''
def __init__(self):
pass
@property
def team_id(self) -> int:
pass
@team_id.setter
def team_id(self) -> int:
pass
@property
def team_name(self) -> str:
pass
@team_name.setter
def team_name(self) -> str:
pass
@property
def submission_date(self) -> datetime:
pass
@submission_date.setter
def submission_date(self) -> datetime:
pass
@property
def score(self) -> str:
pass
@score.setter
def score(self) -> str:
pass
| 18 | 1 | 5 | 0 | 5 | 0 | 2 | 0.14 | 1 | 4 | 0 | 0 | 9 | 4 | 9 | 26 | 67 | 9 | 51 | 22 | 33 | 7 | 43 | 14 | 33 | 3 | 2 | 1 | 17 |
141,103 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiListCompetitionsRequest
|
class ApiListCompetitionsRequest(KaggleObject):
r"""
Attributes:
group (CompetitionListTab)
Filter competitions by a particular group (default is 'general').
One of 'general', 'entered' and 'inClass'.
category (HostSegment)
Filter competitions by a particular category (default is 'all').
One of 'all', 'featured', 'research', 'recruitment', 'gettingStarted',
'masters', 'playground'.
sort_by (CompetitionSortBy)
Sort the results (default is 'latestDeadline').
One of 'grouped', 'prize', 'earliestDeadline', 'latestDeadline',
'numberOfTeams', 'recentlyCreated'.
search (str)
Filter competitions by search terms.
page (int)
Page number (default is 1).
"""
def __init__(self):
self._group = None
self._category = None
self._sort_by = None
self._search = None
self._page = None
self._freeze()
@property
def group(self) -> 'CompetitionListTab':
r"""
Filter competitions by a particular group (default is 'general').
One of 'general', 'entered' and 'inClass'.
"""
return self._group or CompetitionListTab.COMPETITION_LIST_TAB_GENERAL
@group.setter
def group(self, group: 'CompetitionListTab'):
if group is None:
del self.group
return
if not isinstance(group, CompetitionListTab):
raise TypeError('group must be of type CompetitionListTab')
self._group = group
@property
def category(self) -> 'HostSegment':
r"""
Filter competitions by a particular category (default is 'all').
One of 'all', 'featured', 'research', 'recruitment', 'gettingStarted',
'masters', 'playground'.
"""
return self._category or HostSegment.HOST_SEGMENT_UNSPECIFIED
@category.setter
def category(self, category: 'HostSegment'):
if category is None:
del self.category
return
if not isinstance(category, HostSegment):
raise TypeError('category must be of type HostSegment')
self._category = category
@property
def sort_by(self) -> 'CompetitionSortBy':
r"""
Sort the results (default is 'latestDeadline').
One of 'grouped', 'prize', 'earliestDeadline', 'latestDeadline',
'numberOfTeams', 'recentlyCreated'.
"""
return self._sort_by or CompetitionSortBy.COMPETITION_SORT_BY_GROUPED
@sort_by.setter
def sort_by(self, sort_by: 'CompetitionSortBy'):
if sort_by is None:
del self.sort_by
return
if not isinstance(sort_by, CompetitionSortBy):
raise TypeError('sort_by must be of type CompetitionSortBy')
self._sort_by = sort_by
@property
def search(self) -> str:
"""Filter competitions by search terms."""
return self._search or ""
@search.setter
def search(self, search: str):
if search is None:
del self.search
return
if not isinstance(search, str):
raise TypeError('search must be of type str')
self._search = search
@property
def page(self) -> int:
"""Page number (default is 1)."""
return self._page or 0
@page.setter
def page(self, page: int):
if page is None:
del self.page
return
if not isinstance(page, int):
raise TypeError('page must be of type int')
self._page = page
def endpoint(self):
path = '/api/v1/competitions/list'
return path.format_map(self.to_field_map(self))
|
class ApiListCompetitionsRequest(KaggleObject):
'''
Attributes:
group (CompetitionListTab)
Filter competitions by a particular group (default is 'general').
One of 'general', 'entered' and 'inClass'.
category (HostSegment)
Filter competitions by a particular category (default is 'all').
One of 'all', 'featured', 'research', 'recruitment', 'gettingStarted',
'masters', 'playground'.
sort_by (CompetitionSortBy)
Sort the results (default is 'latestDeadline').
One of 'grouped', 'prize', 'earliestDeadline', 'latestDeadline',
'numberOfTeams', 'recentlyCreated'.
search (str)
Filter competitions by search terms.
page (int)
Page number (default is 1).
'''
def __init__(self):
pass
@property
def group(self) -> 'CompetitionListTab':
'''
Filter competitions by a particular group (default is 'general').
One of 'general', 'entered' and 'inClass'.
'''
pass
@group.setter
def group(self) -> 'CompetitionListTab':
pass
@property
def category(self) -> 'HostSegment':
'''
Filter competitions by a particular category (default is 'all').
One of 'all', 'featured', 'research', 'recruitment', 'gettingStarted',
'masters', 'playground'.
'''
pass
@category.setter
def category(self) -> 'HostSegment':
pass
@property
def sort_by(self) -> 'CompetitionSortBy':
'''
Sort the results (default is 'latestDeadline').
One of 'grouped', 'prize', 'earliestDeadline', 'latestDeadline',
'numberOfTeams', 'recentlyCreated'.
'''
pass
@sort_by.setter
def sort_by(self) -> 'CompetitionSortBy':
pass
@property
def search(self) -> str:
'''Filter competitions by search terms.'''
pass
@search.setter
def search(self) -> str:
pass
@property
def page(self) -> int:
'''Page number (default is 1).'''
pass
@page.setter
def page(self) -> int:
pass
def endpoint(self):
pass
| 23 | 6 | 6 | 0 | 5 | 1 | 2 | 0.52 | 1 | 6 | 3 | 0 | 12 | 5 | 12 | 29 | 112 | 12 | 66 | 29 | 43 | 34 | 56 | 19 | 43 | 3 | 2 | 1 | 22 |
141,104 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiListCompetitionsResponse
|
class ApiListCompetitionsResponse(KaggleObject):
r"""
Attributes:
competitions (ApiCompetition)
"""
def __init__(self):
self._competitions = []
self._freeze()
@property
def competitions(self) -> Optional[List[Optional['ApiCompetition']]]:
return self._competitions
@competitions.setter
def competitions(self, competitions: Optional[List[Optional['ApiCompetition']]]):
if competitions is None:
del self.competitions
return
if not isinstance(competitions, list):
raise TypeError('competitions must be of type list')
if not all([isinstance(t, ApiCompetition) for t in competitions]):
raise TypeError('competitions must contain only items of type ApiCompetition')
self._competitions = competitions
@classmethod
def prepare_from(cls, http_response):
return cls.from_dict({'competitions': json.loads(http_response.text)})
|
class ApiListCompetitionsResponse(KaggleObject):
'''
Attributes:
competitions (ApiCompetition)
'''
def __init__(self):
pass
@property
def competitions(self) -> Optional[List[Optional['ApiCompetition']]]:
pass
@competitions.setter
def competitions(self) -> Optional[List[Optional['ApiCompetition']]]:
pass
@classmethod
def prepare_from(cls, http_response):
pass
| 8 | 1 | 4 | 0 | 4 | 0 | 2 | 0.2 | 1 | 3 | 1 | 0 | 3 | 1 | 4 | 21 | 28 | 4 | 20 | 9 | 12 | 4 | 17 | 6 | 12 | 4 | 2 | 1 | 7 |
141,105 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiListDataFilesRequest
|
class ApiListDataFilesRequest(KaggleObject):
r"""
Attributes:
competition_name (str)
Competition name. Example: 'titanic'.
page_size (int)
page_token (str)
"""
def __init__(self):
self._competition_name = ""
self._page_size = None
self._page_token = None
self._freeze()
@property
def competition_name(self) -> str:
"""Competition name. Example: 'titanic'."""
return self._competition_name
@competition_name.setter
def competition_name(self, competition_name: str):
if competition_name is None:
del self.competition_name
return
if not isinstance(competition_name, str):
raise TypeError('competition_name must be of type str')
self._competition_name = competition_name
@property
def page_size(self) -> int:
return self._page_size or 0
@page_size.setter
def page_size(self, page_size: int):
if page_size is None:
del self.page_size
return
if not isinstance(page_size, int):
raise TypeError('page_size must be of type int')
self._page_size = page_size
@property
def page_token(self) -> str:
return self._page_token or ""
@page_token.setter
def page_token(self, page_token: str):
if page_token is None:
del self.page_token
return
if not isinstance(page_token, str):
raise TypeError('page_token must be of type str')
self._page_token = page_token
def endpoint(self):
path = '/api/v1/competitions/data/list/{competition_name}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/competitions/data/list/{competition_name}'
|
class ApiListDataFilesRequest(KaggleObject):
'''
Attributes:
competition_name (str)
Competition name. Example: 'titanic'.
page_size (int)
page_token (str)
'''
def __init__(self):
pass
@property
def competition_name(self) -> str:
'''Competition name. Example: 'titanic'.'''
pass
@competition_name.setter
def competition_name(self) -> str:
pass
@property
def page_size(self) -> int:
pass
@page_size.setter
def page_size(self) -> int:
pass
@property
def page_token(self) -> str:
pass
@page_token.setter
def page_token(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 17 | 2 | 4 | 0 | 4 | 0 | 2 | 0.18 | 1 | 3 | 0 | 0 | 8 | 3 | 9 | 26 | 62 | 9 | 45 | 21 | 28 | 8 | 38 | 14 | 28 | 3 | 2 | 1 | 15 |
141,106 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiListDataFilesResponse
|
class ApiListDataFilesResponse(KaggleObject):
r"""
Attributes:
files (ApiDataFile)
next_page_token (str)
"""
def __init__(self):
self._files = []
self._next_page_token = ""
self._freeze()
@property
def files(self) -> Optional[List[Optional['ApiDataFile']]]:
return self._files
@files.setter
def files(self, files: Optional[List[Optional['ApiDataFile']]]):
if files is None:
del self.files
return
if not isinstance(files, list):
raise TypeError('files must be of type list')
if not all([isinstance(t, ApiDataFile) for t in files]):
raise TypeError('files must contain only items of type ApiDataFile')
self._files = files
@property
def next_page_token(self) -> str:
return self._next_page_token
@next_page_token.setter
def next_page_token(self, next_page_token: str):
if next_page_token is None:
del self.next_page_token
return
if not isinstance(next_page_token, str):
raise TypeError('next_page_token must be of type str')
self._next_page_token = next_page_token
@property
def nextPageToken(self):
return self.next_page_token
|
class ApiListDataFilesResponse(KaggleObject):
'''
Attributes:
files (ApiDataFile)
next_page_token (str)
'''
def __init__(self):
pass
@property
def files(self) -> Optional[List[Optional['ApiDataFile']]]:
pass
@files.setter
def files(self) -> Optional[List[Optional['ApiDataFile']]]:
pass
@property
def next_page_token(self) -> str:
pass
@next_page_token.setter
def next_page_token(self) -> str:
pass
@property
def nextPageToken(self):
pass
| 12 | 1 | 4 | 0 | 4 | 0 | 2 | 0.16 | 1 | 4 | 1 | 0 | 6 | 2 | 6 | 23 | 43 | 6 | 32 | 14 | 20 | 5 | 27 | 9 | 20 | 4 | 2 | 1 | 11 |
141,107 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiListSubmissionsRequest
|
class ApiListSubmissionsRequest(KaggleObject):
r"""
Attributes:
competition_name (str)
sort_by (SubmissionSortBy)
group (SubmissionGroup)
page (int)
"""
def __init__(self):
self._competition_name = ""
self._sort_by = SubmissionSortBy.SUBMISSION_SORT_BY_DATE
self._group = SubmissionGroup.SUBMISSION_GROUP_ALL
self._page = None
self._freeze()
@property
def competition_name(self) -> str:
return self._competition_name
@competition_name.setter
def competition_name(self, competition_name: str):
if competition_name is None:
del self.competition_name
return
if not isinstance(competition_name, str):
raise TypeError('competition_name must be of type str')
self._competition_name = competition_name
@property
def sort_by(self) -> 'SubmissionSortBy':
return self._sort_by
@sort_by.setter
def sort_by(self, sort_by: 'SubmissionSortBy'):
if sort_by is None:
del self.sort_by
return
if not isinstance(sort_by, SubmissionSortBy):
raise TypeError('sort_by must be of type SubmissionSortBy')
self._sort_by = sort_by
@property
def group(self) -> 'SubmissionGroup':
return self._group
@group.setter
def group(self, group: 'SubmissionGroup'):
if group is None:
del self.group
return
if not isinstance(group, SubmissionGroup):
raise TypeError('group must be of type SubmissionGroup')
self._group = group
@property
def page(self) -> int:
return self._page or 0
@page.setter
def page(self, page: int):
if page is None:
del self.page
return
if not isinstance(page, int):
raise TypeError('page must be of type int')
self._page = page
def endpoint(self):
path = '/api/v1/competitions/submissions/list/{competition_name}'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/competitions/submissions/list/{competition_name}'
|
class ApiListSubmissionsRequest(KaggleObject):
'''
Attributes:
competition_name (str)
sort_by (SubmissionSortBy)
group (SubmissionGroup)
page (int)
'''
def __init__(self):
pass
@property
def competition_name(self) -> str:
pass
@competition_name.setter
def competition_name(self) -> str:
pass
@property
def sort_by(self) -> 'SubmissionSortBy':
pass
@sort_by.setter
def sort_by(self) -> 'SubmissionSortBy':
pass
@property
def group(self) -> 'SubmissionGroup':
pass
@group.setter
def group(self) -> 'SubmissionGroup':
pass
@property
def page(self) -> int:
pass
@page.setter
def page(self) -> int:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 21 | 1 | 4 | 0 | 4 | 0 | 2 | 0.12 | 1 | 5 | 2 | 0 | 10 | 4 | 11 | 28 | 75 | 11 | 57 | 26 | 36 | 7 | 48 | 17 | 36 | 3 | 2 | 1 | 19 |
141,108 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiListSubmissionsResponse
|
class ApiListSubmissionsResponse(KaggleObject):
r"""
Attributes:
submissions (ApiSubmission)
"""
def __init__(self):
self._submissions = []
self._freeze()
@property
def submissions(self) -> Optional[List[Optional['ApiSubmission']]]:
return self._submissions
@submissions.setter
def submissions(self, submissions: Optional[List[Optional['ApiSubmission']]]):
if submissions is None:
del self.submissions
return
if not isinstance(submissions, list):
raise TypeError('submissions must be of type list')
if not all([isinstance(t, ApiSubmission) for t in submissions]):
raise TypeError('submissions must contain only items of type ApiSubmission')
self._submissions = submissions
@classmethod
def prepare_from(cls, http_response):
return cls.from_dict({'submissions': json.loads(http_response.text)})
|
class ApiListSubmissionsResponse(KaggleObject):
'''
Attributes:
submissions (ApiSubmission)
'''
def __init__(self):
pass
@property
def submissions(self) -> Optional[List[Optional['ApiSubmission']]]:
pass
@submissions.setter
def submissions(self) -> Optional[List[Optional['ApiSubmission']]]:
pass
@classmethod
def prepare_from(cls, http_response):
pass
| 8 | 1 | 4 | 0 | 4 | 0 | 2 | 0.2 | 1 | 3 | 1 | 0 | 3 | 1 | 4 | 21 | 28 | 4 | 20 | 9 | 12 | 4 | 17 | 6 | 12 | 4 | 2 | 1 | 7 |
141,109 |
Kaggle/kaggle-api
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Kaggle_kaggle-api/src/kagglesdk/kaggle_client.py
|
src.kagglesdk.kaggle_client.KaggleClient.Datasets
|
class Datasets(object):
def __init__(self, http_client: KaggleHttpClient):
self.dataset_api_client = DatasetApiClient(http_client)
|
class Datasets(object):
def __init__(self, http_client: KaggleHttpClient):
pass
| 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 2 | 0 | 1 | 1 | 1 | 1 | 3 | 0 | 3 | 3 | 1 | 0 | 3 | 3 | 1 | 1 | 1 | 0 | 1 |
141,110 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiStartSubmissionUploadResponse
|
class ApiStartSubmissionUploadResponse(KaggleObject):
r"""
Currently identical to StartBlobUploadResponse, but keeping separate since
they could change independently and this is a legacy V1 type.
Attributes:
token (str)
create_url (str)
"""
def __init__(self):
self._token = ""
self._create_url = ""
self._freeze()
@property
def token(self) -> str:
return self._token
@token.setter
def token(self, token: str):
if token is None:
del self.token
return
if not isinstance(token, str):
raise TypeError('token must be of type str')
self._token = token
@property
def create_url(self) -> str:
return self._create_url
@create_url.setter
def create_url(self, create_url: str):
if create_url is None:
del self.create_url
return
if not isinstance(create_url, str):
raise TypeError('create_url must be of type str')
self._create_url = create_url
@property
def createUrl(self):
return self.create_url
|
class ApiStartSubmissionUploadResponse(KaggleObject):
'''
Currently identical to StartBlobUploadResponse, but keeping separate since
they could change independently and this is a legacy V1 type.
Attributes:
token (str)
create_url (str)
'''
def __init__(self):
pass
@property
def token(self) -> str:
pass
@token.setter
def token(self) -> str:
pass
@property
def create_url(self) -> str:
pass
@create_url.setter
def create_url(self) -> str:
pass
@property
def createUrl(self):
pass
| 12 | 1 | 4 | 0 | 4 | 0 | 2 | 0.23 | 1 | 2 | 0 | 0 | 6 | 2 | 6 | 23 | 44 | 7 | 30 | 14 | 18 | 7 | 25 | 9 | 18 | 3 | 2 | 1 | 10 |
141,111 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiSubmission
|
class ApiSubmission(KaggleObject):
r"""
Attributes:
ref (int)
total_bytes (int)
date (datetime)
description (str)
error_description (str)
file_name (str)
public_score (str)
private_score (str)
status (SubmissionStatus)
submitted_by (str)
submitted_by_ref (str)
team_name (str)
url (str)
Minor note: ListSubmissions and GetSubmission may differ in setting this
field.
"""
def __init__(self):
self._ref = 0
self._total_bytes = None
self._date = None
self._description = None
self._error_description = None
self._file_name = None
self._public_score = None
self._private_score = None
self._status = SubmissionStatus.PENDING
self._submitted_by = None
self._submitted_by_ref = None
self._team_name = None
self._url = None
self._freeze()
@property
def ref(self) -> int:
return self._ref
@ref.setter
def ref(self, ref: int):
if ref is None:
del self.ref
return
if not isinstance(ref, int):
raise TypeError('ref must be of type int')
self._ref = ref
@property
def total_bytes(self) -> int:
return self._total_bytes or 0
@total_bytes.setter
def total_bytes(self, total_bytes: int):
if total_bytes is None:
del self.total_bytes
return
if not isinstance(total_bytes, int):
raise TypeError('total_bytes must be of type int')
self._total_bytes = total_bytes
@property
def date(self) -> datetime:
return self._date
@date.setter
def date(self, date: datetime):
if date is None:
del self.date
return
if not isinstance(date, datetime):
raise TypeError('date must be of type datetime')
self._date = date
@property
def description(self) -> str:
return self._description or ""
@description.setter
def description(self, description: str):
if description is None:
del self.description
return
if not isinstance(description, str):
raise TypeError('description must be of type str')
self._description = description
@property
def error_description(self) -> str:
return self._error_description or ""
@error_description.setter
def error_description(self, error_description: str):
if error_description is None:
del self.error_description
return
if not isinstance(error_description, str):
raise TypeError('error_description must be of type str')
self._error_description = error_description
@property
def file_name(self) -> str:
return self._file_name or ""
@file_name.setter
def file_name(self, file_name: str):
if file_name is None:
del self.file_name
return
if not isinstance(file_name, str):
raise TypeError('file_name must be of type str')
self._file_name = file_name
@property
def public_score(self) -> str:
return self._public_score or ""
@public_score.setter
def public_score(self, public_score: str):
if public_score is None:
del self.public_score
return
if not isinstance(public_score, str):
raise TypeError('public_score must be of type str')
self._public_score = public_score
@property
def private_score(self) -> str:
return self._private_score or ""
@private_score.setter
def private_score(self, private_score: str):
if private_score is None:
del self.private_score
return
if not isinstance(private_score, str):
raise TypeError('private_score must be of type str')
self._private_score = private_score
@property
def status(self) -> 'SubmissionStatus':
return self._status
@status.setter
def status(self, status: 'SubmissionStatus'):
if status is None:
del self.status
return
if not isinstance(status, SubmissionStatus):
raise TypeError('status must be of type SubmissionStatus')
self._status = status
@property
def submitted_by(self) -> str:
return self._submitted_by or ""
@submitted_by.setter
def submitted_by(self, submitted_by: str):
if submitted_by is None:
del self.submitted_by
return
if not isinstance(submitted_by, str):
raise TypeError('submitted_by must be of type str')
self._submitted_by = submitted_by
@property
def submitted_by_ref(self) -> str:
return self._submitted_by_ref or ""
@submitted_by_ref.setter
def submitted_by_ref(self, submitted_by_ref: str):
if submitted_by_ref is None:
del self.submitted_by_ref
return
if not isinstance(submitted_by_ref, str):
raise TypeError('submitted_by_ref must be of type str')
self._submitted_by_ref = submitted_by_ref
@property
def team_name(self) -> str:
return self._team_name or ""
@team_name.setter
def team_name(self, team_name: str):
if team_name is None:
del self.team_name
return
if not isinstance(team_name, str):
raise TypeError('team_name must be of type str')
self._team_name = team_name
@property
def url(self) -> str:
r"""
Minor note: ListSubmissions and GetSubmission may differ in setting this
field.
"""
return self._url or ""
@url.setter
def url(self, url: str):
if url is None:
del self.url
return
if not isinstance(url, str):
raise TypeError('url must be of type str')
self._url = url
|
class ApiSubmission(KaggleObject):
'''
Attributes:
ref (int)
total_bytes (int)
date (datetime)
description (str)
error_description (str)
file_name (str)
public_score (str)
private_score (str)
status (SubmissionStatus)
submitted_by (str)
submitted_by_ref (str)
team_name (str)
url (str)
Minor note: ListSubmissions and GetSubmission may differ in setting this
field.
'''
def __init__(self):
pass
@property
def ref(self) -> int:
pass
@ref.setter
def ref(self) -> int:
pass
@property
def total_bytes(self) -> int:
pass
@total_bytes.setter
def total_bytes(self) -> int:
pass
@property
def date(self) -> datetime:
pass
@date.setter
def date(self) -> datetime:
pass
@property
def description(self) -> str:
pass
@description.setter
def description(self) -> str:
pass
@property
def error_description(self) -> str:
pass
@error_description.setter
def error_description(self) -> str:
pass
@property
def file_name(self) -> str:
pass
@file_name.setter
def file_name(self) -> str:
pass
@property
def public_score(self) -> str:
pass
@public_score.setter
def public_score(self) -> str:
pass
@property
def private_score(self) -> str:
pass
@private_score.setter
def private_score(self) -> str:
pass
@property
def status(self) -> 'SubmissionStatus':
pass
@status.setter
def status(self) -> 'SubmissionStatus':
pass
@property
def submitted_by(self) -> str:
pass
@submitted_by.setter
def submitted_by(self) -> str:
pass
@property
def submitted_by_ref(self) -> str:
pass
@submitted_by_ref.setter
def submitted_by_ref(self) -> str:
pass
@property
def team_name(self) -> str:
pass
@team_name.setter
def team_name(self) -> str:
pass
@property
def url(self) -> str:
'''
Minor note: ListSubmissions and GetSubmission may differ in setting this
field.
'''
pass
@url.setter
def url(self) -> str:
pass
| 54 | 2 | 5 | 0 | 5 | 0 | 2 | 0.14 | 1 | 5 | 1 | 0 | 27 | 13 | 27 | 44 | 208 | 27 | 159 | 67 | 105 | 22 | 133 | 41 | 105 | 3 | 2 | 1 | 53 |
141,112 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_enums.py
|
src.kagglesdk.competitions.types.competition_enums.CompetitionListTab
|
class CompetitionListTab(enum.Enum):
COMPETITION_LIST_TAB_GENERAL = 0
"""TODO(aip.dev/126): (-- api-linter: core::0126::unspecified=disabled --)"""
COMPETITION_LIST_TAB_ENTERED = 1
COMPETITION_LIST_TAB_COMMUNITY = 2
COMPETITION_LIST_TAB_HOSTED = 3
COMPETITION_LIST_TAB_UNLAUNCHED = 4
COMPETITION_LIST_TAB_UNLAUNCHED_COMMUNITY = 5
COMPETITION_LIST_TAB_EVERYTHING = 6
|
class CompetitionListTab(enum.Enum):
pass
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.13 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 9 | 0 | 8 | 8 | 7 | 1 | 8 | 8 | 7 | 0 | 4 | 0 | 0 |
141,113 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_enums.py
|
src.kagglesdk.competitions.types.competition_enums.CompetitionSortBy
|
class CompetitionSortBy(enum.Enum):
COMPETITION_SORT_BY_GROUPED = 0
"""TODO(aip.dev/126): (-- api-linter: core::0126::unspecified=disabled --)"""
COMPETITION_SORT_BY_BEST = 1
COMPETITION_SORT_BY_PRIZE = 2
COMPETITION_SORT_BY_EARLIEST_DEADLINE = 3
COMPETITION_SORT_BY_LATEST_DEADLINE = 4
COMPETITION_SORT_BY_NUMBER_OF_TEAMS = 5
COMPETITION_SORT_BY_RELEVANCE = 6
COMPETITION_SORT_BY_RECENTLY_CREATED = 7
|
class CompetitionSortBy(enum.Enum):
pass
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.11 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 10 | 0 | 9 | 9 | 8 | 1 | 9 | 9 | 8 | 0 | 4 | 0 | 0 |
141,114 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_enums.py
|
src.kagglesdk.competitions.types.competition_enums.HostSegment
|
class HostSegment(enum.Enum):
r"""
NOTE: Keep in Sync with Kaggle.Entities.HostSegment until migrated! Also keep
the comment in
competition_service.ListCompetitionsRequest.Selector.host_segment_id_filter
up to date
"""
HOST_SEGMENT_UNSPECIFIED = 0
HOST_SEGMENT_FEATURED = 1
HOST_SEGMENT_GETTING_STARTED = 5
HOST_SEGMENT_MASTERS = 6
HOST_SEGMENT_PLAYGROUND = 8
HOST_SEGMENT_RECRUITMENT = 3
HOST_SEGMENT_RESEARCH = 2
HOST_SEGMENT_COMMUNITY = 10
HOST_SEGMENT_ANALYTICS = 11
|
class HostSegment(enum.Enum):
'''
NOTE: Keep in Sync with Kaggle.Entities.HostSegment until migrated! Also keep
the comment in
competition_service.ListCompetitionsRequest.Selector.host_segment_id_filter
up to date
'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 16 | 0 | 10 | 10 | 9 | 6 | 10 | 10 | 9 | 0 | 4 | 0 | 0 |
141,115 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_enums.py
|
src.kagglesdk.competitions.types.competition_enums.SubmissionGroup
|
class SubmissionGroup(enum.Enum):
SUBMISSION_GROUP_ALL = 0
"""TODO(aip.dev/126): (-- api-linter: core::0126::unspecified=disabled --)"""
SUBMISSION_GROUP_SUCCESSFUL = 1
SUBMISSION_GROUP_SELECTED = 2
|
class SubmissionGroup(enum.Enum):
pass
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 5 | 0 | 4 | 4 | 3 | 1 | 4 | 4 | 3 | 0 | 4 | 0 | 0 |
141,116 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_enums.py
|
src.kagglesdk.competitions.types.competition_enums.SubmissionSortBy
|
class SubmissionSortBy(enum.Enum):
SUBMISSION_SORT_BY_DATE = 0
"""TODO(aip.dev/126): (-- api-linter: core::0126::unspecified=disabled --)"""
SUBMISSION_SORT_BY_NAME = 1
SUBMISSION_SORT_BY_PRIVATE_SCORE = 2
SUBMISSION_SORT_BY_PUBLIC_SCORE = 3
|
class SubmissionSortBy(enum.Enum):
pass
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 6 | 0 | 5 | 5 | 4 | 1 | 5 | 5 | 4 | 0 | 4 | 0 | 0 |
141,117 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/submission_status.py
|
src.kagglesdk.competitions.types.submission_status.SubmissionStatus
|
class SubmissionStatus(enum.Enum):
"""TODO(aip.dev/216): (-- api-linter: core::0216::synonyms=disabled --)"""
PENDING = 0
"""TODO(aip.dev/126): (-- api-linter: core::0126::unspecified=disabled --)"""
COMPLETE = 1
ERROR = 2
|
class SubmissionStatus(enum.Enum):
'''TODO(aip.dev/216): (-- api-linter: core::0216::synonyms=disabled --)'''
pass
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 6 | 0 | 4 | 4 | 3 | 2 | 4 | 4 | 3 | 0 | 4 | 0 | 0 |
141,118 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiDownloadLeaderboardRequest
|
class ApiDownloadLeaderboardRequest(KaggleObject):
r"""
Attributes:
competition_name (str)
"""
def __init__(self):
self._competition_name = ""
self._freeze()
@property
def competition_name(self) -> str:
return self._competition_name
@competition_name.setter
def competition_name(self, competition_name: str):
if competition_name is None:
del self.competition_name
return
if not isinstance(competition_name, str):
raise TypeError('competition_name must be of type str')
self._competition_name = competition_name
def endpoint(self):
path = '/api/v1/competitions/{competition_name}/leaderboard/download'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/competitions/{competition_name}/leaderboard/download'
|
class ApiDownloadLeaderboardRequest(KaggleObject):
'''
Attributes:
competition_name (str)
'''
def __init__(self):
pass
@property
def competition_name(self) -> str:
pass
@competition_name.setter
def competition_name(self) -> str:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 9 | 1 | 3 | 0 | 3 | 0 | 1 | 0.19 | 1 | 2 | 0 | 0 | 4 | 1 | 5 | 22 | 30 | 5 | 21 | 11 | 12 | 4 | 18 | 8 | 12 | 3 | 2 | 1 | 7 |
141,119 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/datasets/services/dataset_api_service.py
|
src.kagglesdk.datasets.services.dataset_api_service.DatasetApiClient
|
class DatasetApiClient(object):
def __init__(self, client: KaggleHttpClient):
self._client = client
def list_datasets(self, request: ApiListDatasetsRequest = None) -> ApiListDatasetsResponse:
r"""
Args:
request (ApiListDatasetsRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiListDatasetsRequest()
return self._client.call("datasets.DatasetApiService", "ApiListDatasets", request, ApiListDatasetsResponse)
def get_dataset(self, request: ApiGetDatasetRequest = None) -> ApiDataset:
r"""
Args:
request (ApiGetDatasetRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiGetDatasetRequest()
return self._client.call("datasets.DatasetApiService", "ApiGetDataset", request, ApiDataset)
def list_dataset_files(self, request: ApiListDatasetFilesRequest = None) -> ApiListDatasetFilesResponse:
r"""
Args:
request (ApiListDatasetFilesRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiListDatasetFilesRequest()
return self._client.call("datasets.DatasetApiService", "ApiListDatasetFiles", request, ApiListDatasetFilesResponse)
def get_dataset_metadata(self, request: ApiGetDatasetMetadataRequest = None) -> ApiGetDatasetMetadataResponse:
r"""
Args:
request (ApiGetDatasetMetadataRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiGetDatasetMetadataRequest()
return self._client.call("datasets.DatasetApiService", "ApiGetDatasetMetadata", request, ApiGetDatasetMetadataResponse)
def update_dataset_metadata(self, request: ApiUpdateDatasetMetadataRequest = None) -> ApiUpdateDatasetMetadataResponse:
r"""
Args:
request (ApiUpdateDatasetMetadataRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiUpdateDatasetMetadataRequest()
return self._client.call("datasets.DatasetApiService", "ApiUpdateDatasetMetadata", request, ApiUpdateDatasetMetadataResponse)
def download_dataset(self, request: ApiDownloadDatasetRequest = None) -> HttpRedirect:
r"""
Args:
request (ApiDownloadDatasetRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiDownloadDatasetRequest()
return self._client.call("datasets.DatasetApiService", "ApiDownloadDataset", request, HttpRedirect)
def download_dataset_raw(self, request: ApiDownloadDatasetRawRequest = None) -> HttpRedirect:
r"""
Note: This API method has extremely low usage, and can be considered for
deprecation. The existing DownloadDataset RPC, with `raw=true` set on the
request, is equivalent.
Args:
request (ApiDownloadDatasetRawRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiDownloadDatasetRawRequest()
return self._client.call("datasets.DatasetApiService", "ApiDownloadDatasetRaw", request, HttpRedirect)
def create_dataset_version(self, request: ApiCreateDatasetVersionRequest = None) -> ApiCreateDatasetResponse:
r"""
Args:
request (ApiCreateDatasetVersionRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiCreateDatasetVersionRequest()
return self._client.call("datasets.DatasetApiService", "ApiCreateDatasetVersion", request, ApiCreateDatasetResponse)
def create_dataset_version_by_id(self, request: ApiCreateDatasetVersionByIdRequest = None) -> ApiCreateDatasetResponse:
r"""
Args:
request (ApiCreateDatasetVersionByIdRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiCreateDatasetVersionByIdRequest()
return self._client.call("datasets.DatasetApiService", "ApiCreateDatasetVersionById", request, ApiCreateDatasetResponse)
def create_dataset(self, request: ApiCreateDatasetRequest = None) -> ApiCreateDatasetResponse:
r"""
Args:
request (ApiCreateDatasetRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiCreateDatasetRequest()
return self._client.call("datasets.DatasetApiService", "ApiCreateDataset", request, ApiCreateDatasetResponse)
def get_dataset_status(self, request: ApiGetDatasetStatusRequest = None) -> ApiGetDatasetStatusResponse:
r"""
Args:
request (ApiGetDatasetStatusRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiGetDatasetStatusRequest()
return self._client.call("datasets.DatasetApiService", "ApiGetDatasetStatus", request, ApiGetDatasetStatusResponse)
def upload_dataset_file(self, request: ApiUploadDatasetFileRequest = None) -> ApiUploadDatasetFileResponse:
r"""
Deprecated. Use the new unified BlobApiService#StartBlobUpload rpc.
Args:
request (ApiUploadDatasetFileRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiUploadDatasetFileRequest()
return self._client.call("datasets.DatasetApiService", "ApiUploadDatasetFile", request, ApiUploadDatasetFileResponse)
def delete_dataset(self, request: ApiDeleteDatasetRequest = None) -> ApiDeleteDatasetResponse:
r"""
Args:
request (ApiDeleteDatasetRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = ApiDeleteDatasetRequest()
return self._client.call("datasets.DatasetApiService", "ApiDeleteDataset", request, ApiDeleteDatasetResponse)
|
class DatasetApiClient(object):
def __init__(self, client: KaggleHttpClient):
pass
def list_datasets(self, request: ApiListDatasetsRequest = None) -> ApiListDatasetsResponse:
'''
Args:
request (ApiListDatasetsRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def get_dataset(self, request: ApiGetDatasetRequest = None) -> ApiDataset:
'''
Args:
request (ApiGetDatasetRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def list_dataset_files(self, request: ApiListDatasetFilesRequest = None) -> ApiListDatasetFilesResponse:
'''
Args:
request (ApiListDatasetFilesRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def get_dataset_metadata(self, request: ApiGetDatasetMetadataRequest = None) -> ApiGetDatasetMetadataResponse:
'''
Args:
request (ApiGetDatasetMetadataRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def update_dataset_metadata(self, request: ApiUpdateDatasetMetadataRequest = None) -> ApiUpdateDatasetMetadataResponse:
'''
Args:
request (ApiUpdateDatasetMetadataRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def download_dataset(self, request: ApiDownloadDatasetRequest = None) -> HttpRedirect:
'''
Args:
request (ApiDownloadDatasetRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def download_dataset_raw(self, request: ApiDownloadDatasetRawRequest = None) -> HttpRedirect:
'''
Note: This API method has extremely low usage, and can be considered for
deprecation. The existing DownloadDataset RPC, with `raw=true` set on the
request, is equivalent.
Args:
request (ApiDownloadDatasetRawRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def create_dataset_version(self, request: ApiCreateDatasetVersionRequest = None) -> ApiCreateDatasetResponse:
'''
Args:
request (ApiCreateDatasetVersionRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def create_dataset_version_by_id(self, request: ApiCreateDatasetVersionByIdRequest = None) -> ApiCreateDatasetResponse:
'''
Args:
request (ApiCreateDatasetVersionByIdRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def create_dataset_version(self, request: ApiCreateDatasetVersionRequest = None) -> ApiCreateDatasetResponse:
'''
Args:
request (ApiCreateDatasetRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def get_dataset_status(self, request: ApiGetDatasetStatusRequest = None) -> ApiGetDatasetStatusResponse:
'''
Args:
request (ApiGetDatasetStatusRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def upload_dataset_file(self, request: ApiUploadDatasetFileRequest = None) -> ApiUploadDatasetFileResponse:
'''
Deprecated. Use the new unified BlobApiService#StartBlobUpload rpc.
Args:
request (ApiUploadDatasetFileRequest):
The request object; initialized to empty instance if not specified.
'''
pass
def delete_dataset(self, request: ApiDeleteDatasetRequest = None) -> ApiDeleteDatasetResponse:
'''
Args:
request (ApiDeleteDatasetRequest):
The request object; initialized to empty instance if not specified.
'''
pass
| 15 | 13 | 11 | 2 | 4 | 5 | 2 | 1.25 | 1 | 24 | 24 | 0 | 14 | 1 | 14 | 14 | 166 | 42 | 55 | 16 | 40 | 69 | 55 | 16 | 40 | 2 | 1 | 1 | 27 |
141,120 |
Kaggle/kaggle-api
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Kaggle_kaggle-api/src/kagglesdk/kaggle_http_client.py
|
src.kagglesdk.kaggle_http_client.KaggleHttpClient.BearerAuth
|
class BearerAuth(requests.auth.AuthBase):
def __init__(self, token):
self.token = token
def __call__(self, r):
r.headers["Authorization"] = f"Bearer {self.token}"
return r
|
class BearerAuth(requests.auth.AuthBase):
def __init__(self, token):
pass
def __call__(self, r):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 1 | 0 | 2 |
141,121 |
Kaggle/kaggle-api
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Kaggle_kaggle-api/src/kagglesdk/kaggle_client.py
|
src.kagglesdk.kaggle_client.KaggleClient.Models
|
class Models(object):
def __init__(self, http_client: KaggleHttpClient):
self.model_api_client = ModelApiClient(http_client)
self.model_client = ModelClient(http_client)
|
class Models(object):
def __init__(self, http_client: KaggleHttpClient):
pass
| 2 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 3 | 3 | 0 | 1 | 2 | 1 | 1 | 4 | 0 | 4 | 4 | 2 | 0 | 4 | 4 | 2 | 1 | 1 | 0 | 1 |
141,122 |
Kaggle/kaggle-api
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Kaggle_kaggle-api/src/kagglesdk/kaggle_client.py
|
src.kagglesdk.kaggle_client.KaggleClient.Kernels
|
class Kernels(object):
def __init__(self, http_client: KaggleHttpClient):
self.kernels_api_client = KernelsApiClient(http_client)
|
class Kernels(object):
def __init__(self, http_client: KaggleHttpClient):
pass
| 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 2 | 0 | 1 | 1 | 1 | 1 | 3 | 0 | 3 | 3 | 1 | 0 | 3 | 3 | 1 | 1 | 1 | 0 | 1 |
141,123 |
Kaggle/kaggle-api
|
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Kaggle_kaggle-api/src/kagglesdk/kaggle_client.py
|
src.kagglesdk.kaggle_client.KaggleClient.Education
|
class Education(object):
def __init__(self, http_client: KaggleHttpClient):
self.education_api_client = EducationApiClient(http_client)
|
class Education(object):
def __init__(self, http_client: KaggleHttpClient):
pass
| 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 2 | 0 | 1 | 1 | 1 | 1 | 3 | 0 | 3 | 3 | 1 | 0 | 3 | 3 | 1 | 1 | 1 | 0 | 1 |
141,124 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiGetLeaderboardRequest
|
class ApiGetLeaderboardRequest(KaggleObject):
r"""
Attributes:
competition_name (str)
Competition name. Example: 'titanic'.
override_public (bool)
By default we return the private leaderboard if it's available, otherwise
the public LB. This flag lets you override to get public even if private
is available.
"""
def __init__(self):
self._competition_name = ""
self._override_public = None
self._freeze()
@property
def competition_name(self) -> str:
"""Competition name. Example: 'titanic'."""
return self._competition_name
@competition_name.setter
def competition_name(self, competition_name: str):
if competition_name is None:
del self.competition_name
return
if not isinstance(competition_name, str):
raise TypeError('competition_name must be of type str')
self._competition_name = competition_name
@property
def override_public(self) -> bool:
r"""
By default we return the private leaderboard if it's available, otherwise
the public LB. This flag lets you override to get public even if private
is available.
"""
return self._override_public or False
@override_public.setter
def override_public(self, override_public: bool):
if override_public is None:
del self.override_public
return
if not isinstance(override_public, bool):
raise TypeError('override_public must be of type bool')
self._override_public = override_public
def endpoint(self):
path = '/api/v1/competitions/{competition_name}/leaderboard/view'
return path.format_map(self.to_field_map(self))
@staticmethod
def endpoint_path():
return '/api/v1/competitions/{competition_name}/leaderboard/view'
|
class ApiGetLeaderboardRequest(KaggleObject):
'''
Attributes:
competition_name (str)
Competition name. Example: 'titanic'.
override_public (bool)
By default we return the private leaderboard if it's available, otherwise
the public LB. This flag lets you override to get public even if private
is available.
'''
def __init__(self):
pass
@property
def competition_name(self) -> str:
'''Competition name. Example: 'titanic'.'''
pass
@competition_name.setter
def competition_name(self) -> str:
pass
@property
def override_public(self) -> bool:
'''
By default we return the private leaderboard if it's available, otherwise
the public LB. This flag lets you override to get public even if private
is available.
'''
pass
@override_public.setter
def override_public(self) -> bool:
pass
def endpoint(self):
pass
@staticmethod
def endpoint_path():
pass
| 13 | 3 | 5 | 0 | 4 | 1 | 2 | 0.45 | 1 | 3 | 0 | 0 | 6 | 2 | 7 | 24 | 55 | 7 | 33 | 16 | 20 | 15 | 28 | 11 | 20 | 3 | 2 | 1 | 11 |
141,125 |
Kaggle/kaggle-api
|
Kaggle_kaggle-api/src/kagglesdk/competitions/types/competition_api_service.py
|
src.kagglesdk.competitions.types.competition_api_service.ApiGetLeaderboardResponse
|
class ApiGetLeaderboardResponse(KaggleObject):
r"""
Attributes:
submissions (ApiLeaderboardSubmission)
"""
def __init__(self):
self._submissions = []
self._freeze()
@property
def submissions(self) -> Optional[List[Optional['ApiLeaderboardSubmission']]]:
return self._submissions
@submissions.setter
def submissions(self, submissions: Optional[List[Optional['ApiLeaderboardSubmission']]]):
if submissions is None:
del self.submissions
return
if not isinstance(submissions, list):
raise TypeError('submissions must be of type list')
if not all([isinstance(t, ApiLeaderboardSubmission) for t in submissions]):
raise TypeError('submissions must contain only items of type ApiLeaderboardSubmission')
self._submissions = submissions
|
class ApiGetLeaderboardResponse(KaggleObject):
'''
Attributes:
submissions (ApiLeaderboardSubmission)
'''
def __init__(self):
pass
@property
def submissions(self) -> Optional[List[Optional['ApiLeaderboardSubmission']]]:
pass
@submissions.setter
def submissions(self) -> Optional[List[Optional['ApiLeaderboardSubmission']]]:
pass
| 6 | 1 | 5 | 0 | 5 | 0 | 2 | 0.24 | 1 | 3 | 1 | 0 | 3 | 1 | 3 | 20 | 24 | 3 | 17 | 7 | 11 | 4 | 15 | 5 | 11 | 4 | 2 | 1 | 6 |
141,126 |
Kami/python-yubico-client
|
Kami_python-yubico-client/yubico_client/yubico.py
|
yubico_client.yubico.Yubico
|
class Yubico(object):
# pylint: disable=too-many-instance-attributes
def __init__(self, client_id, key=None, verify_cert=True,
translate_otp=True, api_urls=DEFAULT_API_URLS,
ca_certs_bundle_path=None, max_retries=3, retry_delay=0.5):
"""
:param max_retries: Number of times to try to retry the request if
server returns 5xx status code.
:type max_retries: ``int``
:param retry_delay: How long to wait (in seconds) beteween each retry
attempt.
:param retry_delay: ``float``
"""
if ca_certs_bundle_path and \
not self._is_valid_ca_bundle_file(ca_certs_bundle_path):
raise ValueError('Invalid value provided for ca_certs_bundle_path'
' argument')
self.client_id = client_id
if key is not None:
key = base64.b64decode(key.encode('ascii'))
self.key = key
self.verify_cert = verify_cert
self.translate_otp = translate_otp
self.api_urls = self._init_request_urls(api_urls=api_urls)
self.ca_certs_bundle_path = ca_certs_bundle_path
self.max_retries = max_retries
self.retry_delay = retry_delay
def verify(self, otp, timestamp=False, sl=None, timeout=None,
return_response=False):
"""
Verify a provided OTP.
:param otp: OTP to verify.
:type otp: ``str``
:param timestamp: True to include request timestamp and session counter
in the response. Defaults to False.
:type timestamp: ``bool``
:param sl: A value indicating percentage of syncing required by client.
:type sl: ``int`` or ``str``
:param timeout: Number of seconds to wait for sync responses.
:type timeout: ``int``
:param return_response: True to return a response object instead of the
status code. Defaults to False.
:type return_response: ``bool``
:return: True is the provided OTP is valid, False if the
REPLAYED_OTP status value is returned or the response message signature
verification failed and None for the rest of the status values.
"""
ca_bundle_path = self._get_ca_bundle_path()
otp = OTP(otp, self.translate_otp)
rand_str = b(os.urandom(30))
nonce = base64.b64encode(rand_str, b('xz'))[:25].decode('utf-8')
query_string = self.generate_query_string(otp.otp, nonce, timestamp,
sl, timeout)
threads = []
timeout = timeout or DEFAULT_TIMEOUT
for url in self.api_urls:
thread = URLThread(url='%s?%s' % (url, query_string),
timeout=timeout,
verify_cert=self.verify_cert,
ca_bundle_path=ca_bundle_path,
max_retries=self.max_retries,
retry_delay=self.retry_delay)
thread.start()
threads.append(thread)
# Wait for a first positive or negative response
start_time = time.time()
# If there's only one server to talk to, raise thread exceptions.
# Otherwise we end up ignoring a good answer from a different
# server later.
raise_exceptions = (len(threads) == 1)
# pylint: disable=too-many-nested-blocks
while threads and (start_time + timeout) > time.time():
for thread in threads:
if not thread.is_alive():
if thread.exception and raise_exceptions:
raise thread.exception
elif thread.response:
status = self.verify_response(thread.response,
otp.otp, nonce,
return_response)
if status:
# pylint: disable=no-else-return
if return_response:
return status
else:
return True
threads.remove(thread)
time.sleep(0.1)
# Timeout or no valid response received
raise Exception('NO_VALID_ANSWERS')
def verify_multi(self, otp_list, max_time_window=DEFAULT_MAX_TIME_WINDOW,
sl=None, timeout=None):
"""
Verify a provided list of OTPs.
:param max_time_window: Maximum number of seconds which can pass
between the first and last OTP generation for
the OTP to still be considered valid.
:type max_time_window: ``int``
"""
# Create the OTP objects
otps = []
for otp in otp_list:
otps.append(OTP(otp, self.translate_otp))
if len(otp_list) < 2:
raise ValueError('otp_list needs to contain at least two OTPs')
device_ids = set()
for otp in otps:
device_ids.add(otp.device_id)
# Check that all the OTPs contain same device id
if len(device_ids) != 1:
raise Exception('OTPs contain different device ids')
# Now we verify the OTPs and save the server response for each OTP.
# We need the server response, to retrieve the timestamp.
# It's possible to retrieve this value locally, without querying the
# server but in this case, user would need to provide his AES key.
for otp in otps:
response = self.verify(otp.otp, True, sl, timeout,
return_response=True)
if not response:
return False
otp.timestamp = int(response['timestamp'])
count = len(otps)
delta = otps[count - 1].timestamp - otps[0].timestamp
# OTPs have an 8Hz timestamp counter so we need to divide it to get
# seconds
delta = delta / 8
if delta < 0:
raise Exception('delta is smaller than zero. First OTP appears to '
'be older than the last one')
if delta > max_time_window:
raise Exception('More than %s seconds have passed between '
'generating the first and the last OTP.' %
(max_time_window))
return True
def verify_response(self, response, otp, nonce, return_response=False):
"""
Returns True if the OTP is valid (status=OK) and return_response=False,
otherwise (return_response = True) it returns the server response as a
dictionary.
Throws an exception if the OTP is replayed, the server response message
verification failed or the client id is invalid, returns False
otherwise.
"""
try:
status = re.search(r'status=([A-Z0-9_]+)', response) \
.groups()
if len(status) > 1:
message = 'More than one status= returned. Possible attack!'
raise InvalidValidationResponse(message, response)
status = status[0]
except (AttributeError, IndexError):
return False
signature, parameters = \
self.parse_parameters_from_response(response)
# Secret key is specified, so we verify the response message
# signature
if self.key:
generated_signature = \
self.generate_message_signature(parameters)
# Signature located in the response does not match the one we
# have generated
if signature != generated_signature:
logger.warning("signature mismatch for parameters=%r",
parameters)
raise SignatureVerificationError(generated_signature,
signature)
param_dict = self.get_parameters_as_dictionary(parameters)
if 'otp' in param_dict and param_dict['otp'] != otp:
message = 'Unexpected OTP in response. Possible attack!'
raise InvalidValidationResponse(message, response, param_dict)
if 'nonce' in param_dict and param_dict['nonce'] != nonce:
message = 'Unexpected nonce in response. Possible attack!'
raise InvalidValidationResponse(message, response, param_dict)
if status == 'OK':
if return_response: # pylint: disable=no-else-return
return param_dict
else:
return True
elif status == 'NO_SUCH_CLIENT':
raise InvalidClientIdError(self.client_id)
elif status == 'REPLAYED_OTP':
raise StatusCodeError(status)
return False
def generate_query_string(self, otp, nonce, timestamp=False, sl=None,
timeout=None):
"""
Returns a query string which is sent to the validation servers.
"""
data = [('id', self.client_id),
('otp', otp),
('nonce', nonce)]
if timestamp:
data.append(('timestamp', '1'))
if sl is not None:
if sl not in range(0, 101) and sl not in ['fast', 'secure']:
raise Exception('sl parameter value must be between 0 and '
'100 or string "fast" or "secure"')
data.append(('sl', sl))
if timeout:
data.append(('timeout', timeout))
query_string = urlencode(data)
if self.key:
hmac_signature = self.generate_message_signature(query_string)
query_string += '&h=%s' % (hmac_signature.replace('+', '%2B'))
return query_string
def generate_message_signature(self, query_string):
"""
Returns a HMAC-SHA-1 signature for the given query string.
http://goo.gl/R4O0E
"""
# split for sorting
pairs = query_string.split('&')
pairs = [pair.split('=', 1) for pair in pairs]
pairs_sorted = sorted(pairs)
pairs_string = '&' . join(['=' . join(pair) for pair in pairs_sorted])
digest = hmac.new(self.key, b(pairs_string), hashlib.sha1).digest()
signature = base64.b64encode(digest).decode('utf-8')
return signature
def parse_parameters_from_response(self, response):
"""
Returns a response signature and query string generated from the
server response. 'h' aka signature argument is stripped from the
returned query string.
"""
lines = response.splitlines()
pairs = [line.strip().split('=', 1) for line in lines if '=' in line]
pairs = sorted(pairs)
signature = ([unquote(v) for k, v in pairs if k == 'h'] or [None])[0]
# already quoted
query_string = '&' . join([k + '=' + v for k, v in pairs if k != 'h'])
return (signature, query_string)
def get_parameters_as_dictionary(self, query_string):
""" Returns query string parameters as a dictionary. """
pairs = (x.split('=', 1) for x in query_string.split('&'))
return dict((k, unquote(v)) for k, v in pairs)
def _init_request_urls(self, api_urls):
"""
Returns a list of the API URLs.
"""
if not isinstance(api_urls, (str, list, tuple)):
raise TypeError('api_urls needs to be string or iterable!')
if isinstance(api_urls, str):
api_urls = (api_urls,)
api_urls = list(api_urls)
for url in api_urls:
if not url.startswith('http://') and \
not url.startswith('https://'):
raise ValueError('URL "%s" contains an invalid or missing'
' scheme' % (url))
return list(api_urls)
def _get_ca_bundle_path(self):
"""
Return a path to the CA bundle which is used for verifying the hosts
SSL certificate.
"""
if self.ca_certs_bundle_path:
# User provided a custom path
return self.ca_certs_bundle_path
# Return first bundle which is available
for file_path in COMMON_CA_LOCATIONS:
if self._is_valid_ca_bundle_file(file_path=file_path):
return file_path
return None
def _is_valid_ca_bundle_file(self, file_path):
return os.path.exists(file_path) and os.path.isfile(file_path)
|
class Yubico(object):
def __init__(self, client_id, key=None, verify_cert=True,
translate_otp=True, api_urls=DEFAULT_API_URLS,
ca_certs_bundle_path=None, max_retries=3, retry_delay=0.5):
'''
:param max_retries: Number of times to try to retry the request if
server returns 5xx status code.
:type max_retries: ``int``
:param retry_delay: How long to wait (in seconds) beteween each retry
attempt.
:param retry_delay: ``float``
'''
pass
def verify(self, otp, timestamp=False, sl=None, timeout=None,
return_response=False):
'''
Verify a provided OTP.
:param otp: OTP to verify.
:type otp: ``str``
:param timestamp: True to include request timestamp and session counter
in the response. Defaults to False.
:type timestamp: ``bool``
:param sl: A value indicating percentage of syncing required by client.
:type sl: ``int`` or ``str``
:param timeout: Number of seconds to wait for sync responses.
:type timeout: ``int``
:param return_response: True to return a response object instead of the
status code. Defaults to False.
:type return_response: ``bool``
:return: True is the provided OTP is valid, False if the
REPLAYED_OTP status value is returned or the response message signature
verification failed and None for the rest of the status values.
'''
pass
def verify_multi(self, otp_list, max_time_window=DEFAULT_MAX_TIME_WINDOW,
sl=None, timeout=None):
'''
Verify a provided list of OTPs.
:param max_time_window: Maximum number of seconds which can pass
between the first and last OTP generation for
the OTP to still be considered valid.
:type max_time_window: ``int``
'''
pass
def verify_response(self, response, otp, nonce, return_response=False):
'''
Returns True if the OTP is valid (status=OK) and return_response=False,
otherwise (return_response = True) it returns the server response as a
dictionary.
Throws an exception if the OTP is replayed, the server response message
verification failed or the client id is invalid, returns False
otherwise.
'''
pass
def generate_query_string(self, otp, nonce, timestamp=False, sl=None,
timeout=None):
'''
Returns a query string which is sent to the validation servers.
'''
pass
def generate_message_signature(self, query_string):
'''
Returns a HMAC-SHA-1 signature for the given query string.
http://goo.gl/R4O0E
'''
pass
def parse_parameters_from_response(self, response):
'''
Returns a response signature and query string generated from the
server response. 'h' aka signature argument is stripped from the
returned query string.
'''
pass
def get_parameters_as_dictionary(self, query_string):
''' Returns query string parameters as a dictionary. '''
pass
def _init_request_urls(self, api_urls):
'''
Returns a list of the API URLs.
'''
pass
def _get_ca_bundle_path(self):
'''
Return a path to the CA bundle which is used for verifying the hosts
SSL certificate.
'''
pass
def _is_valid_ca_bundle_file(self, file_path):
pass
| 12 | 10 | 29 | 5 | 16 | 8 | 5 | 0.48 | 1 | 18 | 6 | 0 | 11 | 8 | 11 | 11 | 331 | 66 | 180 | 61 | 163 | 86 | 146 | 56 | 134 | 11 | 1 | 6 | 51 |
141,127 |
Kami/python-yubico-client
|
Kami_python-yubico-client/yubico_client/yubico_exceptions.py
|
yubico_client.yubico_exceptions.SignatureVerificationError
|
class SignatureVerificationError(YubicoError):
def __init__(self, generated_signature, response_signature):
super(SignatureVerificationError, self).__init__()
self.generated_signature = generated_signature
self.response_signature = response_signature
def __str__(self):
return repr('Server response message signature verification failed'
'(expected %s, got %s)' % (self.generated_signature,
self.response_signature))
|
class SignatureVerificationError(YubicoError):
def __init__(self, generated_signature, response_signature):
pass
def __str__(self):
pass
| 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 2 | 2 | 12 | 10 | 1 | 9 | 5 | 6 | 0 | 7 | 5 | 4 | 1 | 4 | 0 | 2 |
141,128 |
Kami/python-yubico-client
|
Kami_python-yubico-client/yubico_client/yubico_exceptions.py
|
yubico_client.yubico_exceptions.InvalidValidationResponse
|
class InvalidValidationResponse(YubicoError):
def __init__(self, reason, response, parameters=None):
super(InvalidValidationResponse, self).__init__()
self.reason = reason
self.response = response
self.parameters = parameters
self.message = self.reason
def __str__(self):
return self.reason
|
class InvalidValidationResponse(YubicoError):
def __init__(self, reason, response, parameters=None):
pass
def __str__(self):
pass
| 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 4 | 2 | 12 | 10 | 1 | 9 | 7 | 6 | 0 | 9 | 7 | 6 | 1 | 4 | 0 | 2 |
141,129 |
Kami/python-yubico-client
|
Kami_python-yubico-client/yubico_client/yubico_exceptions.py
|
yubico_client.yubico_exceptions.StatusCodeError
|
class StatusCodeError(YubicoError):
def __init__(self, status_code):
super(StatusCodeError, self).__init__()
self.status_code = status_code
def __str__(self):
return ('Yubico server returned the following status code: %s' %
(self.status_code))
|
class StatusCodeError(YubicoError):
def __init__(self, status_code):
pass
def __str__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 12 | 8 | 1 | 7 | 4 | 4 | 0 | 6 | 4 | 3 | 1 | 4 | 0 | 2 |
141,130 |
Kami/python-yubico-client
|
Kami_python-yubico-client/yubico_client/yubico.py
|
yubico_client.yubico.URLThread
|
class URLThread(threading.Thread):
# pylint: disable=too-many-instance-attributes
def __init__(self, url, timeout, verify_cert, ca_bundle_path=None,
max_retries=3, retry_delay=0.5):
super(URLThread, self).__init__()
self.url = url
self.timeout = timeout
self.verify_cert = verify_cert
self.ca_bundle_path = ca_bundle_path
self.max_retries = max_retries
self.retry_delay = retry_delay
self.exception = None
self.request = None
self.response = None
def run(self):
logger.debug('Sending HTTP request to %s (thread=%s)' % (self.url,
self.name))
verify = self.verify_cert
if self.ca_bundle_path is not None:
verify = self.ca_bundle_path
logger.debug('Using custom CA bunde: %s' % (self.ca_bundle_path))
headers = {
'User-Agent': ('yubico-python-client/%s (Python v%s)' %
(CLIENT_VERSION, PYTHON_VERSION))
}
try:
retry = 0
done = False
while retry < self.max_retries and not done:
retry += 1
self.request = requests.get(
url=self.url, timeout=self.timeout, verify=verify,
headers=headers
)
status_code = self.request.status_code
args = (status_code, self.url, self.name)
logger.debug('HTTP %d from %s (thread=%s)' % (args))
if status_code in (500, 502, 503, 504):
logger.debug('Retrying HTTP request (attempt_count=%s,'
'max_retries=%s)' % (retry, self.max_retries))
time.sleep(self.retry_delay)
else:
done = True
self.response = self.request.content.decode("utf-8")
except requests.exceptions.SSLError:
e = sys.exc_info()[1]
args = (self.url, self.name, str(e))
logger.error('SSL error talking to %s (thread=%s): %s' % (args))
self.exception = e
self.response = None
except Exception: # pylint: disable=broad-except
e = sys.exc_info()[1]
logger.error('Failed to retrieve response: %s' % (str(e)))
self.response = None
args = (self.url, self.name, self.response)
logger.debug('Received response from %s (thread=%s): %s' % (args))
|
class URLThread(threading.Thread):
def __init__(self, url, timeout, verify_cert, ca_bundle_path=None,
max_retries=3, retry_delay=0.5):
pass
def run(self):
pass
| 3 | 0 | 30 | 3 | 27 | 1 | 4 | 0.04 | 1 | 3 | 0 | 0 | 2 | 9 | 2 | 27 | 63 | 7 | 55 | 20 | 51 | 2 | 45 | 19 | 42 | 6 | 1 | 3 | 7 |
141,131 |
Kami/python-yubico-client
|
Kami_python-yubico-client/yubico_client/yubico_exceptions.py
|
yubico_client.yubico_exceptions.InvalidClientIdError
|
class InvalidClientIdError(YubicoError):
def __init__(self, client_id):
super(InvalidClientIdError, self).__init__()
self.client_id = client_id
def __str__(self):
return 'The client with ID %s does not exist' % (self.client_id)
|
class InvalidClientIdError(YubicoError):
def __init__(self, client_id):
pass
def __str__(self):
pass
| 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 1 | 2 | 12 | 7 | 1 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 4 | 0 | 2 |
141,132 |
Kami/python-yubico-client
|
Kami_python-yubico-client/tests/test_yubico.py
|
tests.test_yubico.TestYubicoVerifySingle
|
class TestYubicoVerifySingle(unittest.TestCase):
def setUp(self):
yubico.DEFAULT_TIMEOUT = 2
self.client_no_verify_sig = yubico.Yubico('1234', None,
api_urls=LOCAL_SERVER)
self.client_verify_sig = yubico.Yubico('1234', 'secret123456',
api_urls=LOCAL_SERVER)
def test_invalid_custom_ca_certs_path(self):
client = yubico.Yubico('1234', 'secret123456',
api_urls=LOCAL_SERVER_HTTPS,
ca_certs_bundle_path=os.path.abspath(__file__))
try:
client.verify('bad')
except requests.exceptions.SSLError:
pass
else:
self.fail('SSL exception was not thrown')
def test_ssl_error_with_multiple_servers(self):
# Timeout will wait a second, giving time for the HTTPS thread
# to fail first
self._set_mock_action('timeout')
client = yubico.Yubico('1234', None,
api_urls=(LOCAL_SERVER_HTTPS + LOCAL_SERVER),
ca_certs_bundle_path=os.path.abspath(__file__))
status = client.verify('test')
self.assertTrue(status)
def test_custom_ca_certs_path_invalid_path(self):
expected_msg = ('Invalid value provided for ca_certs_bundle_path '
'argument')
self.assertRaisesRegexp(ValueError, expected_msg,
yubico.Yubico, '1234', 'secret123456',
ca_certs_bundle_path='/does/not/exist.1')
def test_custom_ca_certs_path(self):
file_path = os.path.abspath(__file__)
client = yubico.Yubico('1234', 'secret123456',
ca_certs_bundle_path=file_path)
self.assertEqual(client._get_ca_bundle_path(), file_path)
def test_replayed_otp(self):
self._set_mock_action('REPLAYED_OTP')
try:
self.client_no_verify_sig.verify('bad')
except StatusCodeError:
e = sys.exc_info()[1]
self.assertEqual(e.status_code, 'REPLAYED_OTP')
def test_verify_bad_status_codes(self):
for status in (set(yubico.BAD_STATUS_CODES) - set(['REPLAYED_OTP'])):
self._set_mock_action(status)
try:
self.client_no_verify_sig.verify('bad')
except Exception:
e = sys.exc_info()[1]
self.assertEqual(str(e), 'NO_VALID_ANSWERS')
def test_verify_local_timeout(self):
self._set_mock_action('timeout')
try:
self.client_no_verify_sig.verify('bad')
except Exception:
e = sys.exc_info()[1]
self.assertEqual(str(e), 'NO_VALID_ANSWERS')
def test_verify_invalid_signature(self):
self._set_mock_action('no_signature_ok')
try:
self.client_verify_sig.verify('test')
except SignatureVerificationError:
pass
else:
self.fail('Exception was not thrown')
def test_verify_no_such_client(self):
self._set_mock_action('no_such_client')
try:
self.client_no_verify_sig.verify('test')
except InvalidClientIdError:
e = sys.exc_info()[1]
self.assertEqual(e.client_id, '1234')
else:
self.fail('Exception was not thrown')
def test_verify_ok_dont_check_signature(self):
self._set_mock_action('no_signature_ok')
status = self.client_no_verify_sig.verify('test')
self.assertTrue(status)
def test_verify_ok_check_signature(self):
signature = \
self.client_verify_sig.generate_message_signature('status=OK')
self._set_mock_action('ok_signature', signature=signature)
status = self.client_verify_sig.verify('test')
self.assertTrue(status)
def test_verify_invalid_otp_returned_in_the_response(self):
self._set_mock_action('no_signature_ok_invalid_otp_in_response')
try:
self.client_no_verify_sig.verify('test')
except InvalidValidationResponse:
e = sys.exc_info()[1]
self.assertTrue('Unexpected OTP in response' in e.message)
else:
self.fail('Exception was not thrown')
def test_verify_invalid_nonce_returned_in_the_response(self):
self._set_mock_action('no_signature_ok_invalid_nonce_in_response')
try:
self.client_no_verify_sig.verify('test')
except InvalidValidationResponse:
e = sys.exc_info()[1]
self.assertTrue('Unexpected nonce in response' in e.message)
else:
self.fail('Exception was not thrown')
def test_verify_retries_500_responses(self):
self._set_mock_action('one_gateway_error')
status = self.client_no_verify_sig.verify('test')
self.assertTrue(status)
def test_verify_multi_different_device_ids(self):
otp_list = [
'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl',
'blerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl',
]
expected_msg = 'OTPs contain different device ids'
self.assertRaisesRegexp(Exception, expected_msg,
self.client_no_verify_sig.verify_multi,
otp_list=otp_list)
def test_verify_multi_single_otp(self):
otp_list = [
'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl'
]
expected_msg = 'otp_list needs to contain at least two OTPs'
self.assertRaisesRegexp(ValueError, expected_msg,
self.client_no_verify_sig.verify_multi,
otp_list=otp_list)
def test_verify_multi_too_much_time_passed_between_otp_generations(self):
otp_list = [
'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl',
'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbc',
]
max_time_window = 7
def mock_verify(*args, **kwargs):
otp = args[0]
response = {}
if otp == 'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl':
timestamp = 1383997754 * 8
elif otp == 'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbc':
timestamp = (1383997754 + max_time_window + 1) * 8
else:
raise Exception('Invalid OTP')
response['timestamp'] = timestamp
return response
self.client_no_verify_sig.verify = mock_verify
expected_msg = ('More than 7 seconds have passed between generating '
'the first and the last OTP')
self.assertRaisesRegexp(Exception, expected_msg,
self.client_no_verify_sig.verify_multi,
otp_list=otp_list,
max_time_window=max_time_window)
def test_verify_multi_first_otp_is_older_than_last(self):
otp_list = [
'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl',
'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbc',
]
max_time_window = 7
def mock_verify(*args, **kwargs):
otp = args[0]
response = {}
if otp == 'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl':
timestamp = (1383997754 + max_time_window + 1) * 8
elif otp == 'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbc':
timestamp = 1383997754 * 8
else:
raise Exception('Invalid OTP')
response['timestamp'] = timestamp
return response
self.client_no_verify_sig.verify = mock_verify
expected_msg = ('delta is smaller than zero. First OTP appears '
'to be older than the last one')
self.assertRaisesRegexp(Exception, expected_msg,
self.client_no_verify_sig.verify_multi,
otp_list=otp_list,
max_time_window=max_time_window)
def test_verify_multi_success(self):
otp_list = [
'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl',
'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbc',
]
def mock_verify(*args, **kwargs):
otp = args[0]
response = {}
if otp == 'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl':
timestamp = 1383997754 * 8
elif otp == 'tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbc':
timestamp = (1383997754 + 2) * 8
else:
raise Exception('Invalid OTP')
response['timestamp'] = timestamp
return response
self.client_no_verify_sig.verify = mock_verify
status = self.client_no_verify_sig.verify_multi(otp_list=otp_list)
self.assertTrue(status)
def _set_mock_action(self, action, port=8881, signature=None):
path = '/set_mock_action?action=%s' % (action)
if signature:
path += '&signature=%s' % (signature)
requests.get(url='http://127.0.0.1:%s%s' % (port, path))
|
class TestYubicoVerifySingle(unittest.TestCase):
def setUp(self):
pass
def test_invalid_custom_ca_certs_path(self):
pass
def test_ssl_error_with_multiple_servers(self):
pass
def test_custom_ca_certs_path_invalid_path(self):
pass
def test_custom_ca_certs_path_invalid_path(self):
pass
def test_replayed_otp(self):
pass
def test_verify_bad_status_codes(self):
pass
def test_verify_local_timeout(self):
pass
def test_verify_invalid_signature(self):
pass
def test_verify_no_such_client(self):
pass
def test_verify_ok_dont_check_signature(self):
pass
def test_verify_ok_check_signature(self):
pass
def test_verify_invalid_otp_returned_in_the_response(self):
pass
def test_verify_invalid_nonce_returned_in_the_response(self):
pass
def test_verify_retries_500_responses(self):
pass
def test_verify_multi_different_device_ids(self):
pass
def test_verify_multi_single_otp(self):
pass
def test_verify_multi_too_much_time_passed_between_otp_generations(self):
pass
def mock_verify(*args, **kwargs):
pass
def test_verify_multi_first_otp_is_older_than_last(self):
pass
def mock_verify(*args, **kwargs):
pass
def test_verify_multi_success(self):
pass
def mock_verify(*args, **kwargs):
pass
def _set_mock_action(self, action, port=8881, signature=None):
pass
| 25 | 0 | 12 | 2 | 9 | 0 | 2 | 0.01 | 1 | 9 | 5 | 0 | 21 | 2 | 21 | 93 | 259 | 62 | 195 | 66 | 170 | 2 | 152 | 66 | 127 | 3 | 2 | 2 | 40 |
141,133 |
Kami/python-yubico-client
|
Kami_python-yubico-client/tests/test_yubico.py
|
tests.test_yubico.TestOTPClass
|
class TestOTPClass(unittest.TestCase):
def test_otp_class(self):
otp1 = OTP('tlerefhcvijlngibueiiuhkeibbcbecehvjiklltnbbl')
otp2 = OTP('jjjjjjjjnhe.ngcgjeiuujjjdtgihjuecyixinxunkhj',
translate_otp=True)
self.assertEqual(otp1.device_id, 'tlerefhcvijl')
self.assertEqual(otp2.otp,
'ccccccccljdeluiucdgffccchkugjcfditgbglbflvjc')
def test_translation_multiple_interpretations(self):
otp_str1 = 'vvbtbtndhtlfguefgluvbdcetnitidgkvfkbicevgcin'
otp1 = OTP(otp_str1)
self.assertEqual(otp1.otp, otp_str1)
def test_translation_single_interpretation(self):
otp_str1 = 'cccfgvgitchndibrrtuhdrgeufrdkrjfgutfjbnhhglv'
otp_str2 = 'cccagvgitchndibrrtuhdrgeufrdkrjfgutfjbnhhglv'
otp1 = OTP(otp_str1)
otp2 = OTP(otp_str2)
self.assertEqual(otp1.otp, otp_str1)
self.assertEqual(otp2.otp, otp_str2)
|
class TestOTPClass(unittest.TestCase):
def test_otp_class(self):
pass
def test_translation_multiple_interpretations(self):
pass
def test_translation_single_interpretation(self):
pass
| 4 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 3 | 0 | 3 | 75 | 22 | 3 | 19 | 12 | 15 | 0 | 17 | 12 | 13 | 1 | 2 | 0 | 3 |
141,134 |
Kami/python-yubico-client
|
Kami_python-yubico-client/tests/test_yubico.py
|
tests.test_yubico.TestAPIUrls
|
class TestAPIUrls(unittest.TestCase):
def test_default_urls(self):
client = yubico.Yubico('1234', 'secret123456')
expected_urls = list(yubico.DEFAULT_API_URLS)
for url in expected_urls:
self.assertTrue(url.startswith('https://'))
self.assertEqual(client.api_urls, expected_urls)
def test_custom_urls(self):
custom_urls = ['https://example.com/wsapi/2.0/verify',
'http://example.com/wsapi/2.0/verify',
'http://example.com/wsapi/2.0/verify']
client = yubico.Yubico('1234', 'secret123456', api_urls=custom_urls)
self.assertEqual(client.api_urls, custom_urls)
def test_custom_urls_invalid_or_missing_scheme(self):
invalid_urls = [
'127.0.0.1:8000/test',
'ftp.example.com/test',
'example.com'
]
for url in invalid_urls:
expected_msg = r'URL ".+?" contains an invalid or missing scheme'
self.assertRaisesRegexp(ValueError, expected_msg,
yubico.Yubico, '1234', 'secret123456',
api_urls=[url])
def test_single_url(self):
single_url = 'http://www.example.com'
client = yubico.Yubico('1234', 'secret123456', api_urls=single_url)
self.assertEqual(client.api_urls, [single_url])
|
class TestAPIUrls(unittest.TestCase):
def test_default_urls(self):
pass
def test_custom_urls(self):
pass
def test_custom_urls_invalid_or_missing_scheme(self):
pass
def test_single_url(self):
pass
| 5 | 0 | 8 | 1 | 7 | 0 | 2 | 0 | 1 | 3 | 1 | 0 | 4 | 0 | 4 | 76 | 35 | 7 | 28 | 15 | 23 | 0 | 20 | 15 | 15 | 2 | 2 | 1 | 6 |
141,135 |
Kami/python-yubico-client
|
Kami_python-yubico-client/yubico_client/otp.py
|
yubico_client.otp.OTP
|
class OTP(object):
"""
Class which holds data about an OTP.
"""
def __init__(self, otp, translate_otp=True):
"""
Represents an OTP token.
:param otp: OTP token.
:type: otp: ``str``
:param translate_otp: True if the OTP should be translated.
:type translate_otp: ``bool``
"""
if translate_otp:
self.otp = self.get_otp_modehex_interpretation(otp)
else:
self.otp = otp
self.device_id = self.otp[:12]
self.session_counter = None
self.timestamp = None
self.session_user = None
def get_otp_modehex_interpretation(self, otp):
"""
Return modhex interpretation of the provided OTP.
If there are multiple interpretations available, first one is used,
because if the OTP uses all 16 characters in its alphabet there is only
one possible interpretation of that OTP.
:return: Modhex interpretation of the OTP.
:rtype: ``str``
"""
try:
interpretations = translate(u(otp))
except Exception: # pylint: disable=broad-except
return otp
if not interpretations:
return otp
elif len(interpretations) > 1:
# If there are multiple interpretations first try to use the same
# translation as the input OTP. If the one is not found, use the
# random interpretation.
if u(otp) in interpretations:
return otp
return interpretations.pop()
def __repr__(self):
return '%s, %s, %s' % (self.otp, self.device_id, self.timestamp)
|
class OTP(object):
'''
Class which holds data about an OTP.
'''
def __init__(self, otp, translate_otp=True):
'''
Represents an OTP token.
:param otp: OTP token.
:type: otp: ``str``
:param translate_otp: True if the OTP should be translated.
:type translate_otp: ``bool``
'''
pass
def get_otp_modehex_interpretation(self, otp):
'''
Return modhex interpretation of the provided OTP.
If there are multiple interpretations available, first one is used,
because if the OTP uses all 16 characters in its alphabet there is only
one possible interpretation of that OTP.
:return: Modhex interpretation of the OTP.
:rtype: ``str``
'''
pass
def __repr__(self):
pass
| 4 | 3 | 16 | 2 | 7 | 6 | 3 | 0.96 | 1 | 1 | 0 | 0 | 3 | 5 | 3 | 3 | 54 | 10 | 23 | 10 | 19 | 22 | 21 | 10 | 17 | 5 | 1 | 2 | 8 |
141,136 |
Kami/python-yubico-client
|
Kami_python-yubico-client/tests/mock_http_server.py
|
tests.mock_http_server.Handler
|
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
global mock_action, signature
if self.path.find('?') != -1:
self.path, self.query_string = self.path.split('?', 1)
split = self.query_string.split('&')
self.query_string = dict([pair.split('=', 1) for pair in split])
else:
self.query_string = {}
if self.path == '/set_mock_action':
action = self.query_string['action']
if 'signature' in self.query_string:
signature = self.query_string['signature']
else:
signature = None
print('Setting mock_action to %s' % (action))
mock_action = action
self._end(status_code=200)
return
if mock_action in BAD_STATUS_CODES:
return self._send_status(status=mock_action)
elif mock_action == 'no_such_client':
return self._send_status(status='NO_SUCH_CLIENT')
elif mock_action == 'no_signature_ok':
return self._send_status(status='OK')
elif mock_action == 'ok_signature':
return self._send_status(status='OK',
signature=signature)
elif mock_action == 'no_signature_ok_invalid_otp_in_response':
return self._send_status(status='OK',
signature=signature, otp='different')
elif mock_action == 'no_signature_ok_invalid_nonce_in_response':
return self._send_status(status='OK',
signature=signature, nonce='different')
elif mock_action == 'timeout':
time.sleep(1)
return self._send_status(status='OK')
elif mock_action == 'one_gateway_error':
mock_action = 'no_signature_ok'
return self._end(status_code=502)
else:
self._end(status_code=500)
return
def _end(self, status_code=200, body=''):
print('Sending response: status_code=%s, body=%s' %
(status_code, body))
self.send_response(status_code)
self.send_header('Content-Type', 'text/plain')
self.send_header('Content-Length', str(len(body)))
self.end_headers()
self.wfile.write(b(body))
def _send_status(self, status, signature=None, otp=None, nonce=None):
if signature:
body = '\nh=%s\nstatus=%s' % (signature, status)
else:
body = 'status=%s' % (status)
if otp:
body += '&otp=%s' % (otp)
if nonce:
body += '&nonce=%s' % (nonce)
self._end(body=b(body))
|
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
pass
def _end(self, status_code=200, body=''):
pass
def _send_status(self, status, signature=None, otp=None, nonce=None):
pass
| 4 | 0 | 23 | 3 | 20 | 0 | 6 | 0 | 1 | 2 | 0 | 0 | 3 | 2 | 3 | 3 | 73 | 12 | 61 | 9 | 56 | 0 | 46 | 9 | 41 | 12 | 1 | 2 | 17 |
141,137 |
Kami/python-yubico-client
|
Kami_python-yubico-client/setup.py
|
setup.TestCommand
|
class TestCommand(Command):
description = 'run test suite'
user_options = []
log_paths = []
# Set to False to preserve mock server log files even if the tests succeed
delete_mock_server_logs_on_success = True
def initialize_options(self):
FORMAT = '%(asctime)-15s [%(levelname)s] %(message)s'
logging.basicConfig(format=FORMAT)
THIS_DIR = os.path.abspath(os.path.split(__file__)[0])
sys.path.insert(0, THIS_DIR)
for test_path in TEST_PATHS:
sys.path.insert(0, pjoin(THIS_DIR, test_path))
self._dir = os.getcwd()
def finalize_options(self):
pass
def run(self):
self._run_mock_api_server()
succeeded = self._run_tests()
status_code = 0 if succeeded else 1
if succeeded and self.delete_mock_server_logs_on_success:
# On success we delete mock server log files
for file_path in self.log_paths:
if not os.path.isfile(file_path):
continue
os.unlink(file_path)
sys.exit(status_code)
def _run_tests(self):
testfiles = []
for test_path in TEST_PATHS:
for t in glob(pjoin(self._dir, test_path, 'test_*.py')):
testfiles.append('.'.join(
[test_path.replace('/', '.'), splitext(basename(t))[0]]))
tests = TestLoader().loadTestsFromNames(testfiles)
t = TextTestRunner(verbosity=2)
res = t.run(tests)
return res.wasSuccessful()
def _run_mock_api_server(self):
# pylint: disable=import-outside-toplevel
from test_utils.process_runners import TCPProcessRunner
script = pjoin(os.path.dirname(__file__), 'tests/mock_http_server.py')
for port in [8881, 8882, 8883]:
args = [script, '--port=%s' % (port)]
log_path = 'mock_api_server_%s.log' % (port)
wait_for_address = ('127.0.0.1', port)
server = TCPProcessRunner(args=args,
wait_for_address=wait_for_address,
log_path=log_path)
server.setUp()
self.log_paths.append(log_path)
|
class TestCommand(Command):
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass
def _run_tests(self):
pass
def _run_mock_api_server(self):
pass
| 6 | 0 | 10 | 2 | 8 | 0 | 3 | 0.06 | 1 | 2 | 0 | 0 | 5 | 1 | 5 | 35 | 65 | 15 | 47 | 29 | 40 | 3 | 44 | 29 | 37 | 5 | 1 | 3 | 13 |
141,138 |
Kane610/aiounifi
|
aiounifi/models/device.py
|
aiounifi.models.device.DeviceListRequest
|
class DeviceListRequest(ApiRequest):
"""Request object for device list."""
@classmethod
def create(cls) -> Self:
"""Create device list request."""
return cls(method="get", path="/stat/device")
|
class DeviceListRequest(ApiRequest):
'''Request object for device list.'''
@classmethod
def create(cls) -> Self:
'''Create device list request.'''
pass
| 3 | 2 | 3 | 0 | 2 | 1 | 1 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 3 | 7 | 1 | 4 | 3 | 1 | 2 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
141,139 |
Kane610/aiounifi
|
aiounifi/models/device.py
|
aiounifi.models.device.Device
|
class Device(ApiItem):
"""Represents a network device."""
raw: TypedDevice
@property
def board_revision(self) -> int:
"""Board revision of device."""
return self.raw.get("board_rev", 0)
@property
def considered_lost_at(self) -> int:
"""When device is considered lost."""
return self.raw["considered_lost_at"]
@property
def disabled(self) -> bool:
"""Is device disabled."""
return self.raw.get("disabled", False)
@property
def downlink_table(self) -> list[dict[str, Any]]:
"""All devices with device as uplink."""
return self.raw.get("downlink_table", [])
@property
def fan_level(self) -> int | None:
"""Fan level of device."""
return self.raw.get("fan_level")
@property
def general_temperature(self) -> int | None:
"""General temperature of device."""
return self.raw.get("general_temperature")
@property
def has_fan(self) -> bool:
"""Do device have a fan."""
return self.raw.get("has_fan", False)
@property
def has_temperature(self) -> bool:
"""Do the device have a general temperature."""
return self.raw.get("has_temperature", False)
@property
def hw_caps(self) -> int:
"""Hardware capabilities."""
return self.raw.get("hw_caps", 0)
@property
def id(self) -> str:
"""ID of device."""
return self.raw["device_id"]
@property
def ip(self) -> str | None:
"""IP of device."""
return self.raw.get("ip")
@property
def last_seen(self) -> int | None:
"""When was device last seen."""
return self.raw.get("last_seen")
@property
def led_override(self) -> str | None:
"""LED override."""
return self.raw.get("led_override")
@property
def led_override_color(self) -> str | None:
"""LED override color."""
return self.raw.get("led_override_color")
@property
def led_override_color_brightness(self) -> int | None:
"""LED override color brightness."""
return self.raw.get("led_override_color_brightness")
@property
def lldp_table(self) -> list[TypedDeviceLldpTable]:
"""All clients and devices directly attached to device."""
return self.raw.get("lldp_table", [])
@property
def mac(self) -> str:
"""MAC address of device."""
return self.raw["mac"]
@property
def model(self) -> str:
"""Model of device."""
return self.raw["model"]
@property
def name(self) -> str:
"""Name of device."""
return self.raw.get("name", "")
@property
def next_heartbeat_at(self) -> int | None:
"""Next heart beat full UNIX time."""
return self.raw.get("next_heartbeat_at")
@property
def next_interval(self) -> int:
"""Next heart beat in seconds."""
return self.raw.get("next_interval", 30)
@property
def overheating(self) -> bool:
"""Is device overheating."""
return self.raw.get("overheating", False)
@property
def outlet_overrides(self) -> list[TypedDeviceOutletOverrides]:
"""Overridden outlet configuration."""
return self.raw.get("outlet_overrides", [])
@property
def outlet_ac_power_budget(self) -> str | None:
"""The amount of power available to outlets."""
return self.raw.get("outlet_ac_power_budget")
@property
def outlet_ac_power_consumption(self) -> str | None:
"""The amount of power consumed by all outlets."""
return self.raw.get("outlet_ac_power_consumption")
@property
def outlet_table(self) -> list[TypedDeviceOutletTable]:
"""List of outlets."""
return self.raw.get("outlet_table", [])
@property
def port_overrides(self) -> list[TypedDevicePortOverrides]:
"""Overridden port configuration."""
return self.raw.get("port_overrides", [])
@property
def port_table(self) -> list[TypedDevicePortTable]:
"""List of ports and data."""
return self.raw.get("port_table", [])
@property
def speedtest_status(self) -> TypedDeviceSpeedtestStatus | None:
"""Speedtest status."""
if value := self.raw.get("speedtest-status"):
return cast(TypedDeviceSpeedtestStatus, value)
return None
@property
def state(self) -> DeviceState:
"""State of device."""
return DeviceState(self.raw["state"])
@property
def storage(self) -> list[TypedDeviceStorage] | None:
"""Device storage information."""
return self.raw.get("storage")
@property
def sys_stats(self) -> TypedDeviceSysStats:
"""Output from top."""
return self.raw["sys_stats"]
@property
def system_stats(self) -> tuple[str, str, str]:
"""System statistics."""
data = self.raw["system-stats"] # type: ignore [typeddict-item]
return (data.get("cpu", ""), data.get("mem", ""), data.get("uptime", ""))
@property
def temperatures(self) -> list[TypedDeviceTemperature] | None:
"""Device temperature sensors."""
return self.raw.get("temperatures")
@property
def type(self) -> str:
"""Type of device."""
return self.raw["type"]
@property
def version(self) -> str:
"""Firmware version."""
return self.raw["version"]
@property
def upgradable(self) -> bool:
"""Is a new firmware available."""
return self.raw.get("upgradable", False)
@property
def upgrade_to_firmware(self) -> str:
"""Firmware version to update to."""
return self.raw.get("upgrade_to_firmware", "")
@property
def uplink(self) -> TypedDeviceUplink:
"""Information about uplink."""
return self.raw["uplink"]
@property
def uplink_depth(self) -> int | None:
"""Hops to gateway."""
return self.raw.get("uplink_depth")
@property
def uptime(self) -> int:
"""Uptime of device."""
return self.raw.get("uptime", 0)
@property
def uptime_stats(self) -> TypedDeviceUptimeStats | None:
"""Uptime statistics."""
return self.raw.get("uptime_stats")
@property
def user_num_sta(self) -> int:
"""Amount of connected clients."""
value = self.raw.get("user-num_sta")
assert isinstance(value, int)
return value
@property
def wlan_overrides(self) -> list[TypedDeviceWlanOverrides]:
"""Wlan configuration override."""
return self.raw.get("wlan_overrides", [])
@property
def supports_led_ring(self) -> bool:
"""Check if the hardware supports an LED ring based on the second bit of `hw_caps`."""
return bool(self.hw_caps & HardwareCapability.LED_RING)
def __repr__(self) -> str:
"""Return the representation."""
return f"<Device {self.name}: {self.mac}>"
|
class Device(ApiItem):
'''Represents a network device.'''
@property
def board_revision(self) -> int:
'''Board revision of device.'''
pass
@property
def considered_lost_at(self) -> int:
'''When device is considered lost.'''
pass
@property
def disabled(self) -> bool:
'''Is device disabled.'''
pass
@property
def downlink_table(self) -> list[dict[str, Any]]:
'''All devices with device as uplink.'''
pass
@property
def fan_level(self) -> int | None:
'''Fan level of device.'''
pass
@property
def general_temperature(self) -> int | None:
'''General temperature of device.'''
pass
@property
def has_fan(self) -> bool:
'''Do device have a fan.'''
pass
@property
def has_temperature(self) -> bool:
'''Do the device have a general temperature.'''
pass
@property
def hw_caps(self) -> int:
'''Hardware capabilities.'''
pass
@property
def id(self) -> str:
'''ID of device.'''
pass
@property
def ip(self) -> str | None:
'''IP of device.'''
pass
@property
def last_seen(self) -> int | None:
'''When was device last seen.'''
pass
@property
def led_override(self) -> str | None:
'''LED override.'''
pass
@property
def led_override_color(self) -> str | None:
'''LED override color.'''
pass
@property
def led_override_color_brightness(self) -> int | None:
'''LED override color brightness.'''
pass
@property
def lldp_table(self) -> list[TypedDeviceLldpTable]:
'''All clients and devices directly attached to device.'''
pass
@property
def mac(self) -> str:
'''MAC address of device.'''
pass
@property
def model(self) -> str:
'''Model of device.'''
pass
@property
def name(self) -> str:
'''Name of device.'''
pass
@property
def next_heartbeat_at(self) -> int | None:
'''Next heart beat full UNIX time.'''
pass
@property
def next_interval(self) -> int:
'''Next heart beat in seconds.'''
pass
@property
def overheating(self) -> bool:
'''Is device overheating.'''
pass
@property
def outlet_overrides(self) -> list[TypedDeviceOutletOverrides]:
'''Overridden outlet configuration.'''
pass
@property
def outlet_ac_power_budget(self) -> str | None:
'''The amount of power available to outlets.'''
pass
@property
def outlet_ac_power_consumption(self) -> str | None:
'''The amount of power consumed by all outlets.'''
pass
@property
def outlet_table(self) -> list[TypedDeviceOutletTable]:
'''List of outlets.'''
pass
@property
def port_overrides(self) -> list[TypedDevicePortOverrides]:
'''Overridden port configuration.'''
pass
@property
def port_table(self) -> list[TypedDevicePortTable]:
'''List of ports and data.'''
pass
@property
def speedtest_status(self) -> TypedDeviceSpeedtestStatus | None:
'''Speedtest status.'''
pass
@property
def state(self) -> DeviceState:
'''State of device.'''
pass
@property
def storage(self) -> list[TypedDeviceStorage] | None:
'''Device storage information.'''
pass
@property
def sys_stats(self) -> TypedDeviceSysStats:
'''Output from top.'''
pass
@property
def system_stats(self) -> tuple[str, str, str]:
'''System statistics.'''
pass
@property
def temperatures(self) -> list[TypedDeviceTemperature] | None:
'''Device temperature sensors.'''
pass
@property
def type(self) -> str:
'''Type of device.'''
pass
@property
def version(self) -> str:
'''Firmware version.'''
pass
@property
def upgradable(self) -> bool:
'''Is a new firmware available.'''
pass
@property
def upgrade_to_firmware(self) -> str:
'''Firmware version to update to.'''
pass
@property
def uplink(self) -> TypedDeviceUplink:
'''Information about uplink.'''
pass
@property
def uplink_depth(self) -> int | None:
'''Hops to gateway.'''
pass
@property
def uptime(self) -> int:
'''Uptime of device.'''
pass
@property
def uptime_stats(self) -> TypedDeviceUptimeStats | None:
'''Uptime statistics.'''
pass
@property
def user_num_sta(self) -> int:
'''Amount of connected clients.'''
pass
@property
def wlan_overrides(self) -> list[TypedDeviceWlanOverrides]:
'''Wlan configuration override.'''
pass
@property
def supports_led_ring(self) -> bool:
'''Check if the hardware supports an LED ring based on the second bit of `hw_caps`.'''
pass
def __repr__(self) -> str:
'''Return the representation.'''
pass
| 92 | 47 | 3 | 0 | 2 | 1 | 1 | 0.33 | 1 | 21 | 14 | 0 | 46 | 0 | 46 | 67 | 238 | 47 | 144 | 95 | 52 | 48 | 99 | 49 | 52 | 2 | 5 | 1 | 47 |
141,140 |
Kane610/aiounifi
|
aiounifi/models/configuration.py
|
aiounifi.models.configuration.Configuration
|
class Configuration:
"""Console configuration."""
session: ClientSession
host: str
_: KW_ONLY
username: str
password: str
port: int = 8443
site: str = "default"
ssl_context: SSLContext | Literal[False] = False
@property
def url(self) -> str:
"""Represent console path."""
return f"https://{self.host}:{self.port}"
|
class Configuration:
'''Console configuration.'''
@property
def url(self) -> str:
'''Represent console path.'''
pass
| 3 | 2 | 3 | 0 | 2 | 1 | 1 | 0.17 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 16 | 2 | 12 | 6 | 9 | 2 | 11 | 5 | 9 | 1 | 0 | 0 | 1 |
141,141 |
Kane610/aiounifi
|
aiounifi/models/client.py
|
aiounifi.models.client.TypedClient
|
class TypedClient(TypedDict):
"""Client type definition."""
_id: str
_is_guest_by_uap: bool
_is_guest_by_ugw: bool
_is_guest_by_usw: bool
_last_seen_by_uap: int
_last_seen_by_ugw: int
_last_seen_by_usw: int
_uptime_by_uap: int
_uptime_by_ugw: int
_uptime_by_usw: int
anomalies: int
ap_mac: str
assoc_time: int
authorized: bool
blocked: bool
bssid: str
bytes_r: int
ccq: int
channel: int
dev_cat: int
dev_family: int
dev_id: int
dev_id_override: int
dev_vendor: int
device_name: str
dhcpend_time: int
disconnect_timestamp: int
eagerly_discovered: bool
essid: str
fingerprint_engine_version: str
fingerprint_override: bool
fingerprint_source: int
first_seen: int
fixed_ip: str
fw_version: str
gw_mac: str
hostname: str
hostname_source: str
idletime: int
ip: str
is_11r: bool
is_guest: bool
is_wired: bool
last_seen: bool
latest_assoc_time: bool
mac: str
name: str
network: str
network_id: str
noise: int
noted: bool
os_class: int
os_name: int
oui: str
powersave_enabled: bool
qos_policy_applied: bool
radio: str
radio_name: str
radio_proto: str
rssi: int
rx_bytes: int
rx_packets: int
rx_rate: int
satisfaction: int
score: int
signal: int
site_id: str
sw_depth: int
sw_mac: str
sw_port: int
tx_bytes: int
tx_packets: int
tx_power: int
tx_rate: int
tx_retries: int
uptime: int
use_fixedip: bool
user_id: str
usergroup_id: str
vlan: int
wifi_tx_attempts: int
wired_rate_mbps: int
wired_tx_bytes: int
wired_rx_bytes: int
wired_tx_packets: int
wired_rx_packets: int
wired_tx_bytes_r: int
wired_rx_bytes_r: int
|
class TypedClient(TypedDict):
'''Client type definition.'''
| 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.01 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 91 | 1 | 89 | 1 | 88 | 1 | 89 | 1 | 88 | 0 | 1 | 0 | 0 |
141,142 |
Kane610/aiounifi
|
aiounifi/models/client.py
|
aiounifi.models.client.ClientRemoveRequest
|
class ClientRemoveRequest(ApiRequest):
"""Request object for client removal."""
@classmethod
def create(cls, macs: list[str]) -> Self:
"""Create client removal request."""
return cls(
method="post",
path="/cmd/stamgr",
data={
"cmd": "forget-sta",
"macs": macs,
},
)
|
class ClientRemoveRequest(ApiRequest):
'''Request object for client removal.'''
@classmethod
def create(cls, macs: list[str]) -> Self:
'''Create client removal request.'''
pass
| 3 | 2 | 10 | 0 | 9 | 1 | 1 | 0.18 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 3 | 14 | 1 | 11 | 3 | 8 | 2 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
141,143 |
Kane610/aiounifi
|
aiounifi/models/client.py
|
aiounifi.models.client.ClientBlockRequest
|
class ClientBlockRequest(ApiRequest):
"""Request object for client block."""
@classmethod
def create(cls, mac: str, block: bool) -> Self:
"""Create client block request."""
return cls(
method="post",
path="/cmd/stamgr",
data={
"cmd": "block-sta" if block else "unblock-sta",
"mac": mac,
},
)
|
class ClientBlockRequest(ApiRequest):
'''Request object for client block.'''
@classmethod
def create(cls, mac: str, block: bool) -> Self:
'''Create client block request.'''
pass
| 3 | 2 | 10 | 0 | 9 | 1 | 2 | 0.18 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 3 | 14 | 1 | 11 | 3 | 8 | 2 | 3 | 2 | 1 | 2 | 1 | 0 | 2 |
141,144 |
Kane610/aiounifi
|
aiounifi/models/client.py
|
aiounifi.models.client.ClientListRequest
|
class ClientListRequest(ApiRequest):
"""Request object for active client list."""
@classmethod
def create(cls) -> Self:
"""Create active client list request."""
return cls(method="get", path="/stat/sta")
|
class ClientListRequest(ApiRequest):
'''Request object for active client list.'''
@classmethod
def create(cls) -> Self:
'''Create active client list request.'''
pass
| 3 | 2 | 3 | 0 | 2 | 1 | 1 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 3 | 7 | 1 | 4 | 3 | 1 | 2 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
141,145 |
Kane610/aiounifi
|
aiounifi/models/device.py
|
aiounifi.models.device.DevicePowerCyclePortRequest
|
class DevicePowerCyclePortRequest(ApiRequest):
"""Request object for power cycle PoE port."""
@classmethod
def create(cls, mac: str, port_idx: int) -> Self:
"""Create power cycle of PoE request."""
return cls(
method="post",
path="/cmd/devmgr",
data={
"cmd": "power-cycle",
"mac": mac,
"port_idx": port_idx,
},
)
|
class DevicePowerCyclePortRequest(ApiRequest):
'''Request object for power cycle PoE port.'''
@classmethod
def create(cls, mac: str, port_idx: int) -> Self:
'''Create power cycle of PoE request.'''
pass
| 3 | 2 | 11 | 0 | 10 | 1 | 1 | 0.17 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 3 | 15 | 1 | 12 | 3 | 9 | 2 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
141,146 |
Kane610/aiounifi
|
aiounifi/models/client.py
|
aiounifi.models.client.Client
|
class Client(ApiItem):
"""Represents a client network device."""
raw: TypedClient
@property
def access_point_mac(self) -> str:
"""MAC address of access point."""
return self.raw.get("ap_mac", "")
@property
def association_time(self) -> int:
"""When was client associated with controller."""
return self.raw.get("assoc_time", 0)
@property
def blocked(self) -> bool:
"""Is client blocked."""
return self.raw.get("blocked", False)
@property
def device_name(self) -> str:
"""Device name of client."""
return self.raw.get("device_name", "")
@property
def essid(self) -> str:
"""ESSID client is connected to."""
return self.raw.get("essid", "")
@property
def firmware_version(self) -> str:
"""Firmware version of client."""
return self.raw.get("fw_version", "")
@property
def first_seen(self) -> int:
"""When was client first seen."""
return self.raw.get("first_seen", 0)
@property
def fixed_ip(self) -> str:
"""List IP if fixed IP is configured."""
return self.raw.get("fixed_ip", "")
@property
def hostname(self) -> str:
"""Hostname of client."""
return self.raw.get("hostname", "")
@property
def idle_time(self) -> int:
"""Idle time of client."""
return self.raw.get("idletime", 0)
@property
def ip(self) -> str:
"""IP of client."""
return self.raw.get("ip", "")
@property
def is_guest(self) -> bool:
"""Is client guest."""
return self.raw.get("is_guest", False)
@property
def is_wired(self) -> bool:
"""Is client wired."""
return self.raw.get("is_wired", False)
@property
def last_seen(self) -> int:
"""When was client last seen."""
return self.raw.get("last_seen", 0)
@property
def last_seen_by_access_point(self) -> int:
"""When was client last seen by access point."""
return self.raw.get("_last_seen_by_uap", 0)
@property
def last_seen_by_gateway(self) -> int:
"""When was client last seen by gateway."""
return self.raw.get("_last_seen_by_ugw", 0)
@property
def last_seen_by_switch(self) -> int:
"""When was client last seen by network switch."""
return self.raw.get("_last_seen_by_usw", 0)
@property
def latest_association_time(self) -> int:
"""When was client last associated with controller."""
return self.raw.get("latest_assoc_time", 0)
@property
def mac(self) -> str:
"""MAC address of client."""
return self.raw.get("mac", "")
@property
def name(self) -> str:
"""Name of client."""
return self.raw.get("name", "")
@property
def oui(self) -> str:
"""Vendor string for client MAC."""
return self.raw.get("oui", "")
@property
def powersave_enabled(self) -> bool | None:
"""Powersave functionality enabled for wireless client."""
return self.raw.get("powersave_enabled")
@property
def site_id(self) -> str:
"""Site ID client belongs to."""
return self.raw.get("site_id", "")
@property
def switch_depth(self) -> int | None:
"""How many layers of switches client is in."""
return self.raw.get("sw_depth")
@property
def switch_mac(self) -> str:
"""MAC for switch client is connected to."""
return self.raw.get("sw_mac", "")
@property
def switch_port(self) -> int | None:
"""Switch port client is connected to."""
return self.raw.get("sw_port")
@property
def rx_bytes(self) -> int:
"""Bytes received over wireless connection."""
return self.raw.get("rx_bytes", 0)
@property
def rx_bytes_r(self) -> float:
"""Bytes recently received over wireless connection."""
return cast(float, self.raw.get("rx_bytes-r", 0.0))
@property
def tx_bytes(self) -> int:
"""Bytes transferred over wireless connection."""
return self.raw.get("tx_bytes", 0)
@property
def tx_bytes_r(self) -> float:
"""Bytes recently transferred over wireless connection."""
return cast(float, self.raw.get("tx_bytes-r", 0.0))
@property
def uptime(self) -> int:
"""Uptime of client."""
return self.raw.get("uptime", 0)
@property
def uptime_by_access_point(self) -> int:
"""Uptime of client observed by access point."""
return self.raw.get("_uptime_by_uap", 0)
@property
def uptime_by_gateway(self) -> int:
"""Uptime of client observed by gateway."""
return self.raw.get("_uptime_by_ugw", 0)
@property
def uptime_by_switch(self) -> int:
"""Uptime of client observed by network switch."""
return self.raw.get("_uptime_by_usw", 0)
@property
def wired_rate_mbps(self) -> int:
"""Wired rate in Mbps."""
return self.raw.get("wired_rate_mbps", 0)
@property
def wired_rx_bytes(self) -> int:
"""Bytes received over wired connection."""
return cast(int, self.raw.get("wired-rx_bytes", 0))
@property
def wired_rx_bytes_r(self) -> float:
"""Bytes recently received over wired connection."""
return cast(float, self.raw.get("wired-rx_bytes-r", 0.0))
@property
def wired_tx_bytes(self) -> int:
"""Bytes transferred over wired connection."""
return cast(int, self.raw.get("wired-tx_bytes", 0))
@property
def wired_tx_bytes_r(self) -> float:
"""Bytes recently transferred over wired connection."""
return cast(float, self.raw.get("wired-tx_bytes-r", 0.0))
|
class Client(ApiItem):
'''Represents a client network device.'''
@property
def access_point_mac(self) -> str:
'''MAC address of access point.'''
pass
@property
def association_time(self) -> int:
'''When was client associated with controller.'''
pass
@property
def blocked(self) -> bool:
'''Is client blocked.'''
pass
@property
def device_name(self) -> str:
'''Device name of client.'''
pass
@property
def essid(self) -> str:
'''ESSID client is connected to.'''
pass
@property
def firmware_version(self) -> str:
'''Firmware version of client.'''
pass
@property
def first_seen(self) -> int:
'''When was client first seen.'''
pass
@property
def fixed_ip(self) -> str:
'''List IP if fixed IP is configured.'''
pass
@property
def hostname(self) -> str:
'''Hostname of client.'''
pass
@property
def idle_time(self) -> int:
'''Idle time of client.'''
pass
@property
def ip(self) -> str:
'''IP of client.'''
pass
@property
def is_guest(self) -> bool:
'''Is client guest.'''
pass
@property
def is_wired(self) -> bool:
'''Is client wired.'''
pass
@property
def last_seen(self) -> int:
'''When was client last seen.'''
pass
@property
def last_seen_by_access_point(self) -> int:
'''When was client last seen by access point.'''
pass
@property
def last_seen_by_gateway(self) -> int:
'''When was client last seen by gateway.'''
pass
@property
def last_seen_by_switch(self) -> int:
'''When was client last seen by network switch.'''
pass
@property
def latest_association_time(self) -> int:
'''When was client last associated with controller.'''
pass
@property
def mac(self) -> str:
'''MAC address of client.'''
pass
@property
def name(self) -> str:
'''Name of client.'''
pass
@property
def oui(self) -> str:
'''Vendor string for client MAC.'''
pass
@property
def powersave_enabled(self) -> bool | None:
'''Powersave functionality enabled for wireless client.'''
pass
@property
def site_id(self) -> str:
'''Site ID client belongs to.'''
pass
@property
def switch_depth(self) -> int | None:
'''How many layers of switches client is in.'''
pass
@property
def switch_mac(self) -> str:
'''MAC for switch client is connected to.'''
pass
@property
def switch_port(self) -> int | None:
'''Switch port client is connected to.'''
pass
@property
def rx_bytes(self) -> int:
'''Bytes received over wireless connection.'''
pass
@property
def rx_bytes_r(self) -> float:
'''Bytes recently received over wireless connection.'''
pass
@property
def tx_bytes(self) -> int:
'''Bytes transferred over wireless connection.'''
pass
@property
def tx_bytes_r(self) -> float:
'''Bytes recently transferred over wireless connection.'''
pass
@property
def uptime(self) -> int:
'''Uptime of client.'''
pass
@property
def uptime_by_access_point(self) -> int:
'''Uptime of client observed by access point.'''
pass
@property
def uptime_by_gateway(self) -> int:
'''Uptime of client observed by gateway.'''
pass
@property
def uptime_by_switch(self) -> int:
'''Uptime of client observed by network switch.'''
pass
@property
def wired_rate_mbps(self) -> int:
'''Wired rate in Mbps.'''
pass
@property
def wired_rx_bytes(self) -> int:
'''Bytes received over wired connection.'''
pass
@property
def wired_rx_bytes_r(self) -> float:
'''Bytes recently received over wired connection.'''
pass
@property
def wired_tx_bytes(self) -> int:
'''Bytes transferred over wired connection.'''
pass
@property
def wired_tx_bytes_r(self) -> float:
'''Bytes recently transferred over wired connection.'''
pass
| 79 | 40 | 3 | 0 | 2 | 1 | 1 | 0.34 | 1 | 4 | 0 | 0 | 39 | 0 | 39 | 60 | 199 | 40 | 119 | 79 | 40 | 40 | 80 | 40 | 40 | 1 | 5 | 0 | 39 |
141,147 |
Kane610/aiounifi
|
aiounifi/models/client.py
|
aiounifi.models.client.AllClientListRequest
|
class AllClientListRequest(ApiRequest):
"""Request object for all clients list."""
@classmethod
def create(cls) -> Self:
"""Create all clients list request."""
return cls(method="get", path="/rest/user")
|
class AllClientListRequest(ApiRequest):
'''Request object for all clients list.'''
@classmethod
def create(cls) -> Self:
'''Create all clients list request.'''
pass
| 3 | 2 | 3 | 0 | 2 | 1 | 1 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 3 | 7 | 1 | 4 | 3 | 1 | 2 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.