uid
stringlengths
24
24
split
stringclasses
1 value
category
stringclasses
2 values
content
stringlengths
5
482k
signature
stringlengths
1
14k
suffix
stringlengths
1
482k
prefix
stringlengths
9
14k
prefix_token_count
int64
3
5.01k
prefix_token_budget
int64
64
256
element_token_count
int64
1
292k
signature_token_count
int64
1
5.01k
prefix_context_token_count
int64
0
255
repo
stringlengths
7
112
path
stringlengths
4
208
language
stringclasses
1 value
name
stringlengths
1
218
qualname
stringlengths
1
218
start_line
int64
1
26.7k
end_line
int64
1
26.7k
signature_start_line
int64
1
26.7k
signature_end_line
int64
1
26.7k
source_hash
stringlengths
40
40
source_dataset
stringclasses
1 value
source_split
stringclasses
1 value
a5bcac8f5be7bf3aafa8db7b
train
function
def group_follower_count( context: Context, data_dict: DataDict) -> ActionResult.GroupFollowerCount: '''Return the number of followers of a group. :param id: the id or name of the group :type id: string :rtype: int ''' return _follower_count( context, data_dict, ...
def group_follower_count( context: Context, data_dict: DataDict) -> ActionResult.GroupFollowerCount:
'''Return the number of followers of a group. :param id: the id or name of the group :type id: string :rtype: int ''' return _follower_count( context, data_dict, ckan.logic.schema.default_follow_group_schema(), context['model'].UserFollowingGroup)
:rtype: int ''' return _follower_count( context, data_dict, ckan.logic.schema.default_follow_dataset_schema(), context['model'].UserFollowingDataset) def group_follower_count( context: Context, data_dict: DataDict) -> ActionResult.GroupFollowerCount:
64
64
96
25
39
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
group_follower_count
group_follower_count
2,530
2,544
2,530
2,532
4b4d63d2f8bdd048b8265213a6d06b902295b5be
bigcode/the-stack
train
97bb721020176f39fcfc324c
train
function
def member_list(context: Context, data_dict: DataDict) -> ActionResult.MemberList: '''Return the members of a group. The user must have permission to 'get' the group. :param id: the id or name of the group :type id: string :param object_type: restrict the members returned to those of a given type,...
def member_list(context: Context, data_dict: DataDict) -> ActionResult.MemberList:
'''Return the members of a group. The user must have permission to 'get' the group. :param id: the id or name of the group :type id: string :param object_type: restrict the members returned to those of a given type, e.g. ``'user'`` or ``'package'`` (optional, default: ``None``) :type obj...
. ' 'Use the "offset" parameter instead') page = data_dict['page'] if limit: offset = (page - 1) * limit else: offset = 0 _check_access('current_package_list_with_resources', context, data_dict) search = package_search(context, { 'q'...
125
126
422
19
106
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
member_list
member_list
153
203
153
153
d0de916fc0f4b2c795f48d34e9059c55c6fb1d45
bigcode/the-stack
train
d3a3632fca7a62230875ea49
train
function
def group_autocomplete( context: Context, data_dict: DataDict) -> ActionResult.GroupAutocomplete: ''' Return a list of group names that contain a string. :param q: the string to search for :type q: string :param limit: the maximum number of groups to return (optional, default: 20) ...
def group_autocomplete( context: Context, data_dict: DataDict) -> ActionResult.GroupAutocomplete:
''' Return a list of group names that contain a string. :param q: the string to search for :type q: string :param limit: the maximum number of groups to return (optional, default: 20) :type limit: int :rtype: a list of group dictionaries each with keys ``'name'``, ``'title'...
(): result_dict = {} for k in ['id', 'name', 'title']: result_dict[k] = getattr(group, k) group_list.append(result_dict) return group_list def group_autocomplete( context: Context, data_dict: DataDict) -> ActionResult.GroupAutocomplete:
64
64
147
22
41
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
group_autocomplete
group_autocomplete
1,669
1,686
1,669
1,670
15fa5c99e802da6bdbc9430cdc783618a6e7c5e9
bigcode/the-stack
train
cab9bf264f5b2a91c6df36f7
train
function
def tag_show(context: Context, data_dict: DataDict) -> ActionResult.TagShow: '''Return the details of a tag and all its datasets. :param id: the name or id of the tag :type id: string :param vocabulary_id: the id or name of the tag vocabulary that the tag is in - if it is not specified it will ...
def tag_show(context: Context, data_dict: DataDict) -> ActionResult.TagShow:
'''Return the details of a tag and all its datasets. :param id: the name or id of the tag :type id: string :param vocabulary_id: the id or name of the tag vocabulary that the tag is in - if it is not specified it will assume it is a free tag. (optional) :type vocabulary_id: string ...
(group_id) if group is None: raise NotFound context['group'] = group _check_access('group_show', context, data_dict) result = logic.get_action('package_search')(context, { 'fq': 'groups:{0}'.format(group.name), 'rows': limit, }) return result['results'] def tag_show(co...
94
94
315
19
75
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
tag_show
tag_show
1,366
1,398
1,366
1,366
29f1c9e322dc58e3c923612096b1247c304ff772
bigcode/the-stack
train
a84a8b8840c27c255c386e07
train
function
def package_relationships_list(context: Context, data_dict: DataDict) -> ActionResult.PackageRelationshipsList: '''Return a dataset (package)'s relationships. :param id: the id or name of the first package :type id: string :param id2: the id or name of the second package ...
def package_relationships_list(context: Context, data_dict: DataDict) -> ActionResult.PackageRelationshipsList:
'''Return a dataset (package)'s relationships. :param id: the id or name of the first package :type id: string :param id2: the id or name of the second package :type id2: string :param rel: relationship as string see :py:func:`~ckan.logic.action.create.package_relationship_create` for ...
query.filter(model.User.state != model.State.DELETED) ## hack for pagination if context.get('return_query'): return query users_list: ActionResult.UserList = [] if all_fields: for user in query.all(): result_dict = model_dictize.user_dictize(user[0], context) ...
120
120
402
23
96
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
package_relationships_list
package_relationships_list
924
973
924
925
5e42dfacdbb948c34413cb257227d4c8f1332918
bigcode/the-stack
train
f9f9dd84afcf2b009080e228
train
function
def followee_count(context: Context, data_dict: DataDict) -> ActionResult.FolloweeCount: '''Return the number of objects that are followed by the given user. Counts all objects, of any type, that the given user is following (e.g. followed users, followed datasets, followed groups). ...
def followee_count(context: Context, data_dict: DataDict) -> ActionResult.FolloweeCount:
'''Return the number of objects that are followed by the given user. Counts all objects, of any type, that the given user is following (e.g. followed users, followed datasets, followed groups). :param id: the id of the user :type id: string :rtype: int ''' model = context['model'] ...
_schema()) data_dict, errors = _validate(data_dict, schema, context) if errors: raise ValidationError(errors) return FollowerClass.followee_count(data_dict['id']) def followee_count(context: Context, data_dict: DataDict) -> ActionResult.FolloweeCount:
63
64
211
23
40
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
followee_count
followee_count
2,736
2,762
2,736
2,737
485748b424055f1b3fcc70fc64a9dbc4e1acf358
bigcode/the-stack
train
ddae4fa0aa37dd176c0d229c
train
function
def resource_view_show(context: Context, data_dict: DataDict) -> ActionResult.ResourceViewShow: ''' Return the metadata of a resource_view. :param id: the id of the resource_view :type id: string :rtype: dictionary ''' model = context['model'] id = _get_or_bust(data_dict, 'id') re...
def resource_view_show(context: Context, data_dict: DataDict) -> ActionResult.ResourceViewShow:
''' Return the metadata of a resource_view. :param id: the id of the resource_view :type id: string :rtype: dictionary ''' model = context['model'] id = _get_or_bust(data_dict, 'id') resource_view = model.ResourceView.get(id) if not resource_view: _check_access('resour...
else: log.error('Resource %s exists but it is not found in the package it should belong to.', id) raise NotFound(_('Resource was not found.')) return resource_dict def resource_view_show(context: Context, data_dict: DataDict) -> ActionResult.ResourceViewShow:
64
64
182
21
42
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
resource_view_show
resource_view_show
1,115
1,139
1,115
1,115
4543e9badaa439dc5f25fa38a28914f42faae306
bigcode/the-stack
train
e781b7a12e4368b652c790c6
train
function
def user_followee_count( context: Context, data_dict: DataDict) -> ActionResult.UserFolloweeCount: '''Return the number of users that are followed by the given user. :param id: the id of the user :type id: string :rtype: int ''' return _followee_count( context, data_di...
def user_followee_count( context: Context, data_dict: DataDict) -> ActionResult.UserFolloweeCount:
'''Return the number of users that are followed by the given user. :param id: the id of the user :type id: string :rtype: int ''' return _followee_count( context, data_dict, context['model'].UserFollowingUser)
) followee_groups = _followee_count(context, data_dict, model.UserFollowingGroup) return sum((followee_users, followee_datasets, followee_groups)) def user_followee_count( context: Context, data_dict: DataDict) -> ActionResult.UserFolloweeCount:
64
64
89
26
38
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
user_followee_count
user_followee_count
2,765
2,778
2,765
2,767
2de26b4b9c9881255140698f8fd74164c6246c19
bigcode/the-stack
train
0aede082ec85e9ff7bb1ffb3
train
function
def user_show(context: Context, data_dict: DataDict) -> ActionResult.UserShow: '''Return a user account. Either the ``id`` should be passed or the user should be logged in. :param id: the id or name of the user (optional) :type id: string :param include_datasets: Include a list of datasets the use...
def user_show(context: Context, data_dict: DataDict) -> ActionResult.UserShow:
'''Return a user account. Either the ``id`` should be passed or the user should be logged in. :param id: the id or name of the user (optional) :type id: string :param include_datasets: Include a list of datasets the user has created. If it is the same user or a sysadmin requesting, it incl...
tag. (optional) :type vocabulary_id: string :param include_datasets: include a list of the tag's datasets. (Up to a limit of 1000 - for more flexibility, use package_search - see :py:func:`package_search` for an example.) (optional, default: ``False``) :type include_datasets...
248
248
827
19
229
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
user_show
user_show
1,401
1,501
1,401
1,401
64be05c12f43c58041d5cf6a6c6b432312251cb8
bigcode/the-stack
train
d2b24feb1890071478e85f60
train
function
def group_list(context: Context, data_dict: DataDict) -> ActionResult.GroupList: '''Return a list of the names of the site's groups. :param type: the type of group to list (optional, default: ``'group'``), See docs for :py:class:`~ckan.plugins.interfaces.IGroupForm` :type type: string :param or...
def group_list(context: Context, data_dict: DataDict) -> ActionResult.GroupList:
'''Return a list of the names of the site's groups. :param type: the type of group to list (optional, default: ``'group'``), See docs for :py:class:`~ckan.plugins.interfaces.IGroupForm` :type type: string :param order_by: the field to sort the list by, must be ``'name'`` or ``'packages'``...
_field)) else: query = query.order_by(sqlalchemy.desc(sort_model_field)) if limit: query = query.limit(limit) if offset: query = query.offset(offset) groups = query.all() if all_fields: action = 'organization_show' if is_org else 'group_show' group_...
190
190
635
19
170
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
group_list
group_list
448
499
448
448
c6742da2b74f8cf468ce1dfe5bbecbf074db3d6f
bigcode/the-stack
train
e629882a8dbc51bdd31e44bd
train
function
def am_following_group(context: Context, data_dict: DataDict) -> ActionResult.AmFollowingGroup: '''Return ``True`` if you're following the given group, ``False`` if not. :param id: the id or name of the group :type id: string :rtype: bool ''' return _am_following( ...
def am_following_group(context: Context, data_dict: DataDict) -> ActionResult.AmFollowingGroup:
'''Return ``True`` if you're following the given group, ``False`` if not. :param id: the id or name of the group :type id: string :rtype: bool ''' return _am_following( context, data_dict, ckan.logic.schema.default_follow_group_schema(), context['model'].UserFollowingG...
:rtype: bool ''' return _am_following( context, data_dict, ckan.logic.schema.default_follow_dataset_schema(), context['model'].UserFollowingDataset) def am_following_group(context: Context, data_dict: DataDict) -> ActionResult.AmFollowingGroup:
64
64
103
24
40
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
am_following_group
am_following_group
2,708
2,721
2,708
2,709
d8add97ee56bd296786eb4cfa488cd39915dbe0a
bigcode/the-stack
train
426606cbf433afe2f42acd5f
train
function
def term_translation_show( context: Context, data_dict: DataDict) -> ActionResult.TermTranslationShow: '''Return the translations for the given term(s) and language(s). :param terms: the terms to search for translations of, e.g. ``'Russian'``, ``'romantic novel'`` :type terms: list of strin...
def term_translation_show( context: Context, data_dict: DataDict) -> ActionResult.TermTranslationShow:
'''Return the translations for the given term(s) and language(s). :param terms: the terms to search for translations of, e.g. ``'Russian'``, ``'romantic novel'`` :type terms: list of strings :param lang_codes: the language codes of the languages to search for translations into, e.g. ``'...
_dict, 'entity_id'), model.TaskStatus.task_type == _get_or_bust(data_dict, 'task_type'), model.TaskStatus.key == _get_or_bust(data_dict, 'key') )) task_status = query.first() if task_status is None: raise NotFound conte...
137
137
458
23
113
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
term_translation_show
term_translation_show
2,344
2,394
2,344
2,345
3f3364594f4ab4959d17bbf5b6d51aa60400cc08
bigcode/the-stack
train
ef0e48f25dc8daef20929372
train
function
def status_show(context: Context, data_dict: DataDict) -> ActionResult.StatusShow: '''Return a dictionary with information about the site's configuration. :rtype: dictionary ''' _check_access('status_show', context, data_dict) extensions = config.get_value('ckan.plugins') site_info = { ...
def status_show(context: Context, data_dict: DataDict) -> ActionResult.StatusShow:
'''Return a dictionary with information about the site's configuration. :rtype: dictionary ''' _check_access('status_show', context, data_dict) extensions = config.get_value('ckan.plugins') site_info = { 'site_title': config.get_value('ckan.site_title'), 'site_description': co...
= True model.Session.add(user) model.Session.flush() if not context.get('defer_commit'): model.repo.commit() return {'name': user.name, 'apikey': user.apikey} def status_show(context: Context, data_dict: DataDict) -> ActionResult.StatusShow:
64
64
187
19
45
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
status_show
status_show
2,428
2,447
2,428
2,428
bbbc21f70b5b3400fb6e84085d0a00508e40ff72
bigcode/the-stack
train
f97179f41963b7cbb44129fa
train
function
def _group_or_org_show( context: Context, data_dict: DataDict, is_org: bool = False) -> dict[str, Any]: model = context['model'] id = _get_or_bust(data_dict, 'id') group = model.Group.get(id) if asbool(data_dict.get('include_datasets', False)): packages_field = 'datasets' e...
def _group_or_org_show( context: Context, data_dict: DataDict, is_org: bool = False) -> dict[str, Any]:
model = context['model'] id = _get_or_bust(data_dict, 'id') group = model.Group.get(id) if asbool(data_dict.get('include_datasets', False)): packages_field = 'datasets' elif asbool(data_dict.get('include_dataset_count', True)): packages_field = 'dataset_count' else: pac...
:rtype: list of dictionaries. ''' model = context['model'] id = _get_or_bust(data_dict, 'id') resource = model.Resource.get(id) if not resource: raise NotFound context['resource'] = resource _check_access('resource_view_list', context, data_dict) q = model.Session.query(model...
185
185
618
32
153
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
_group_or_org_show
_group_or_org_show
1,169
1,248
1,169
1,171
b604b59ee570d3f8ebba911f04918bf83396ab12
bigcode/the-stack
train
341565e198687a4590e76818
train
function
def _followee_count( context: Context, data_dict: DataDict, FollowerClass: Type['ModelFollowingModel[Any ,Any]']) -> int: if not context.get('skip_validation'): schema = context.get('schema', ckan.logic.schema.default_follow_user_schema()) data_dict, erro...
def _followee_count( context: Context, data_dict: DataDict, FollowerClass: Type['ModelFollowingModel[Any ,Any]']) -> int:
if not context.get('skip_validation'): schema = context.get('schema', ckan.logic.schema.default_follow_user_schema()) data_dict, errors = _validate(data_dict, schema, context) if errors: raise ValidationError(errors) return FollowerClass.followee_...
am_following( context, data_dict, ckan.logic.schema.default_follow_group_schema(), context['model'].UserFollowingGroup) def _followee_count( context: Context, data_dict: DataDict, FollowerClass: Type['ModelFollowingModel[Any ,Any]']) -> int:
64
64
100
35
29
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
_followee_count
_followee_count
2,724
2,733
2,724
2,726
b1456440f2f924b27f53d668252ffb6290475c2e
bigcode/the-stack
train
2f6dd35f57a4e17402b15e8b
train
function
def am_following_dataset( context: Context, data_dict: DataDict) -> ActionResult.AmFollowingDataset: '''Return ``True`` if you're following the given dataset, ``False`` if not. :param id: the id or name of the dataset :type id: string :rtype: bool ''' return _am_following( ...
def am_following_dataset( context: Context, data_dict: DataDict) -> ActionResult.AmFollowingDataset:
'''Return ``True`` if you're following the given dataset, ``False`` if not. :param id: the id or name of the dataset :type id: string :rtype: bool ''' return _am_following( context, data_dict, ckan.logic.schema.default_follow_dataset_schema(), context['model'].UserFoll...
rtype: bool ''' return _am_following( context, data_dict, ckan.logic.schema.default_follow_user_schema(), context['model'].UserFollowingUser) def am_following_dataset( context: Context, data_dict: DataDict) -> ActionResult.AmFollowingDataset:
64
64
105
26
38
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
am_following_dataset
am_following_dataset
2,691
2,705
2,691
2,693
8c264b264f07abac415ef101851216d3dbd05de4
bigcode/the-stack
train
565ce115263aeecfee81e823
train
function
def site_read(context: Context, data_dict: Optional[DataDict]=None) -> bool: '''Return ``True``. :rtype: bool ''' _check_access('site_read', context, data_dict) return True
def site_read(context: Context, data_dict: Optional[DataDict]=None) -> bool:
'''Return ``True``. :rtype: bool ''' _check_access('site_read', context, data_dict) return True
= logic.ValidationError _get_or_bust = logic.get_or_bust _select = sqlalchemy.sql.select _or_ = sqlalchemy.or_ _and_ = sqlalchemy.and_ _func = sqlalchemy.func _case = sqlalchemy.case def site_read(context: Context, data_dict: Optional[DataDict]=None) -> bool:
64
64
51
20
43
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
site_read
site_read
60
66
60
60
ac7faefed8bfd4298ae9179ee01393b2cf734171
bigcode/the-stack
train
cca68e0bb74420aebe9d492e
train
function
@logic.validate(ckan.logic.schema.default_pagination_schema) def package_list(context: Context, data_dict: DataDict) -> ActionResult.PackageList: '''Return a list of the names of the site's datasets (packages). :param limit: if given, the list of datasets will be broken into pages of at most ``limit`` ...
@logic.validate(ckan.logic.schema.default_pagination_schema) def package_list(context: Context, data_dict: DataDict) -> ActionResult.PackageList:
'''Return a list of the names of the site's datasets (packages). :param limit: if given, the list of datasets will be broken into pages of at most ``limit`` datasets per page and only one page will be returned at a time (optional) :type limit: int :param offset: when ``limit`` is given,...
_ _func = sqlalchemy.func _case = sqlalchemy.case def site_read(context: Context, data_dict: Optional[DataDict]=None) -> bool: '''Return ``True``. :rtype: bool ''' _check_access('site_read', context, data_dict) return True @logic.validate(ckan.logic.schema.default_pagination_schema) def package_l...
94
94
314
32
61
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
package_list
package_list
69
108
69
70
c1ec009e1743b1af3bc9e28baaf345a0acb92388
bigcode/the-stack
train
fa43a1bc78563f367f9454a2
train
function
@logic.validate(ckan.logic.schema.default_autocomplete_schema) def package_autocomplete( context: Context, data_dict: DataDict) -> ActionResult.PackageAutocomplete: '''Return a list of datasets (packages) that match a string. Datasets with names or titles that contain the query string will be retur...
@logic.validate(ckan.logic.schema.default_autocomplete_schema) def package_autocomplete( context: Context, data_dict: DataDict) -> ActionResult.PackageAutocomplete:
'''Return a list of datasets (packages) that match a string. Datasets with names or titles that contain the query string will be returned. :param q: the string to search for :type q: string :param limit: the maximum number of resource formats to return (optional, default: ``10``) :...
True}) search_dict.update({'fq': fq}) user_dict['datasets'] = \ logic.get_action('package_search')(context, search_dict) \ .get('results') if asbool(data_dict.get('include_num_followers', False)): user_dict['num_followers'] = logic.get_action('user_follower_count'...
135
135
453
35
99
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
package_autocomplete
package_autocomplete
1,504
1,565
1,504
1,506
e413abd0a7562898aaee70589f64e869d12aeeab
bigcode/the-stack
train
204c05879918d8249999b6ef
train
function
def group_followee_count( context: Context, data_dict: DataDict) -> ActionResult.GroupFolloweeCount: '''Return the number of groups that are followed by the given user. :param id: the id of the user :type id: string :rtype: int ''' return _followee_count( context, data...
def group_followee_count( context: Context, data_dict: DataDict) -> ActionResult.GroupFolloweeCount:
'''Return the number of groups that are followed by the given user. :param id: the id of the user :type id: string :rtype: int ''' return _followee_count( context, data_dict, context['model'].UserFollowingGroup)
:type id: string :rtype: int ''' return _followee_count( context, data_dict, context['model'].UserFollowingDataset) def group_followee_count( context: Context, data_dict: DataDict) -> ActionResult.GroupFolloweeCount:
64
64
89
26
38
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
group_followee_count
group_followee_count
2,797
2,810
2,797
2,799
43b3607a595ce842e5b66f5f3233ecd03dfab2be
bigcode/the-stack
train
d063792d4097de524e6346ee
train
function
def package_search(context: Context, data_dict: DataDict) -> ActionResult.PackageSearch: ''' Searches for packages satisfying a given search criteria. This action accepts solr search query parameters (details below), and returns a dictionary of results, including dictized datasets that match the se...
def package_search(context: Context, data_dict: DataDict) -> ActionResult.PackageSearch:
''' Searches for packages satisfying a given search criteria. This action accepts solr search query parameters (details below), and returns a dictionary of results, including dictized datasets that match the search criteria, a search count and also facet information. **Solr Parameters:** ...
limit: the maximum number of groups to return (optional, default: 20) :type limit: int :rtype: a list of group dictionaries each with keys ``'name'``, ``'title'``, and ``'id'`` ''' _check_access('group_autocomplete', context, data_dict) return _group_or_org_autocomplete(context, ...
256
256
2,879
19
237
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
package_search
package_search
1,709
2,015
1,709
1,709
783ce107beb02e1d12ed6e8fc3e7b5c61cf5ddb3
bigcode/the-stack
train
28a9769f4dc3418f28dc65e5
train
function
def group_package_show(context: Context, data_dict: DataDict) -> ActionResult.GroupPackageShow: '''Return the datasets (packages) of a group. :param id: the id or name of the group :type id: string :param limit: the maximum number of datasets to return (optional) :type limit:...
def group_package_show(context: Context, data_dict: DataDict) -> ActionResult.GroupPackageShow:
'''Return the datasets (packages) of a group. :param id: the id or name of the group :type id: string :param limit: the maximum number of datasets to return (optional) :type limit: int :rtype: list of dictionaries ''' model = context['model'] group_id = _get_or_bust(data_dict, 'i...
(optional, default: ``True``) :type include_followers: bool :rtype: dictionary .. note:: Only its first 10 datasets are returned ''' return _group_or_org_show(context, data_dict, is_org=True) def group_package_show(context: Context, data_dict: DataDict) -> ActionRe...
78
78
263
22
56
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
group_package_show
group_package_show
1,323
1,363
1,323
1,324
ce1e41535063bd9c6fc49d275471f266c230e890
bigcode/the-stack
train
bd0cd9a5d7a22929f63f586c
train
function
def dataset_followee_list( context: Context, data_dict: DataDict) -> ActionResult.DatasetFolloweeList: '''Return the list of datasets that are followed by the given user. :param id: the id or name of the user :type id: string :rtype: list of dictionaries ''' _check_access('dat...
def dataset_followee_list( context: Context, data_dict: DataDict) -> ActionResult.DatasetFolloweeList:
'''Return the list of datasets that are followed by the given user. :param id: the id or name of the user :type id: string :rtype: list of dictionaries ''' _check_access('dataset_followee_list', context, data_dict) if not context.get('skip_validation'): schema = context.get('sche...
model.User.get(followee.object_id) for followee in followees] users = [user for user in users if user is not None] # Dictize the list of User objects. return model_dictize.user_list_dictize(users, context) def dataset_followee_list( context: Context, data_dict: DataDict) -> ActionResult.Dat...
80
80
267
26
54
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
dataset_followee_list
dataset_followee_list
2,912
2,944
2,912
2,914
5486ca080de1207812389429f1c011425f4430f8
bigcode/the-stack
train
46d4dbeda131ecead9c42c30
train
function
def dataset_follower_list( context: Context, data_dict: DataDict) -> ActionResult.DatasetFollowerList: '''Return the list of users that are following the given dataset. :param id: the id or name of the dataset :type id: string :rtype: list of dictionaries ''' _check_access('da...
def dataset_follower_list( context: Context, data_dict: DataDict) -> ActionResult.DatasetFollowerList:
'''Return the list of users that are following the given dataset. :param id: the id or name of the dataset :type id: string :rtype: list of dictionaries ''' _check_access('dataset_follower_list', context, data_dict) return _follower_list( context, data_dict, ckan.logic.sch...
_list', context, data_dict) return _follower_list( context, data_dict, ckan.logic.schema.default_follow_user_schema(), context['model'].UserFollowingUser) def dataset_follower_list( context: Context, data_dict: DataDict) -> ActionResult.DatasetFollowerList:
64
64
116
25
39
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
dataset_follower_list
dataset_follower_list
2,600
2,615
2,600
2,602
7244f66229d61e61633ffa39f703af9818d0d18e
bigcode/the-stack
train
db6eab8301bff303b43c6d4a
train
function
def vocabulary_list( context: Context, data_dict: DataDict) -> ActionResult.VocabularyList: '''Return a list of all the site's tag vocabularies. :rtype: list of dictionaries ''' _check_access('vocabulary_list', context, data_dict) model = context['model'] vocabulary_objects = model.Se...
def vocabulary_list( context: Context, data_dict: DataDict) -> ActionResult.VocabularyList:
'''Return a list of all the site's tag vocabularies. :rtype: list of dictionaries ''' _check_access('vocabulary_list', context, data_dict) model = context['model'] vocabulary_objects = model.Session.query(model.Vocabulary).all() return model_dictize.vocabulary_list_dictize(vocabulary_obje...
} if not config.get_value('ckan.hide_version') or authz.is_sysadmin(context['user']): site_info['ckan_version'] = ckan.__version__ return site_info def vocabulary_list( context: Context, data_dict: DataDict) -> ActionResult.VocabularyList:
64
64
96
22
41
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
vocabulary_list
vocabulary_list
2,450
2,461
2,450
2,451
fa56a2d704eb0d4f29695d4b1d7cb0553a12f9be
bigcode/the-stack
train
3b7f70e905201e5b2ed02ac2
train
function
def _group_or_org_followee_list( context: Context, data_dict: DataDict, is_org: bool = False): if not context.get('skip_validation'): schema = context.get('schema', ckan.logic.schema.default_follow_user_schema()) data_dict, errors = _validate(data_dict, schema, ...
def _group_or_org_followee_list( context: Context, data_dict: DataDict, is_org: bool = False):
if not context.get('skip_validation'): schema = context.get('schema', ckan.logic.schema.default_follow_user_schema()) data_dict, errors = _validate(data_dict, schema, context) if errors: raise ValidationError(errors) # Get the list of UserFollowi...
dictionaries ''' _check_access('organization_followee_list', context, data_dict) return _group_or_org_followee_list(context, data_dict, is_org=True) def _group_or_org_followee_list( context: Context, data_dict: DataDict, is_org: bool = False):
64
64
214
27
37
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
_group_or_org_followee_list
_group_or_org_followee_list
2,980
3,001
2,980
2,982
8d1e2b4948abe5bb8c12b86b414d0c16175ca082
bigcode/the-stack
train
26660d71ed096b0184df50b9
train
function
def user_follower_count( context: Context, data_dict: DataDict) -> ActionResult.UserFollowerCount: '''Return the number of followers of a user. :param id: the id or name of the user :type id: string :rtype: int ''' return _follower_count( context, data_dict, ck...
def user_follower_count( context: Context, data_dict: DataDict) -> ActionResult.UserFollowerCount:
'''Return the number of followers of a user. :param id: the id or name of the user :type id: string :rtype: int ''' return _follower_count( context, data_dict, ckan.logic.schema.default_follow_user_schema(), context['model'].UserFollowingUser)
) data_dict, errors = _validate(data_dict, schema, context) if errors: raise ValidationError(errors) return ModelClass.follower_count(data_dict['id']) def user_follower_count( context: Context, data_dict: DataDict) -> ActionResult.UserFollowerCount:
63
64
96
25
38
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
user_follower_count
user_follower_count
2,496
2,510
2,496
2,498
0c96bb9d53969cad8a44ea63bad1a3fac3e77d57
bigcode/the-stack
train
f17f25de091637db78ba0f74
train
function
@logic.validate(ckan.logic.schema.job_list_schema) def job_list(context: Context, data_dict: DataDict) -> ActionResult.JobList: '''List enqueued background jobs. :param list queues: Queues to list jobs from. If not given then the jobs from all queues are listed. :returns: The currently enqueued ba...
@logic.validate(ckan.logic.schema.job_list_schema) def job_list(context: Context, data_dict: DataDict) -> ActionResult.JobList:
'''List enqueued background jobs. :param list queues: Queues to list jobs from. If not given then the jobs from all queues are listed. :returns: The currently enqueued background jobs. :rtype: list .. versionadded:: 2.7 ''' _check_access(u'job_list', context, data_dict) dictiz...
''' _check_access('config_option_list', context, data_dict) schema = ckan.logic.schema.update_configuration_schema() return list(schema.keys()) @logic.validate(ckan.logic.schema.job_list_schema) def job_list(context: Context, data_dict: DataDict) -> ActionResult.JobList:
64
64
193
31
33
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
job_list
job_list
3,133
3,155
3,133
3,134
f48bb04db168f876f019ee5485d5c7f8fb234385
bigcode/the-stack
train
1de70d5c7373f8048e1a995c
train
function
def license_list(context: Context, data_dict: DataDict) -> ActionResult.LicenseList: '''Return the list of licenses available for datasets on the site. :rtype: list of dictionaries ''' model = context["model"] _check_access('license_list', context, data_dict) license_register = model.Package...
def license_list(context: Context, data_dict: DataDict) -> ActionResult.LicenseList:
'''Return the list of licenses available for datasets on the site. :rtype: list of dictionaries ''' model = context["model"] _check_access('license_list', context, data_dict) license_register = model.Package.get_license_register() licenses = license_register.values() licenses = [l.as...
True orgs_list = model_dictize.group_list_dictize(orgs_and_capacities, context, with_package_counts=asbool(data_dict.get('include_dataset_count'))) return orgs_list def license_list(context: Context, data_dict: DataDict) -> ActionResult.LicenseList:
64
64
98
20
43
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
license_list
license_list
749
762
749
749
86e5f54f1a67f7af5893a8fb9c999830a9c93355
bigcode/the-stack
train
9801bf4cb8aef84a9c905adf
train
function
def dataset_follower_count( context: Context, data_dict: DataDict) -> ActionResult.DatasetFollowerCount: '''Return the number of followers of a dataset. :param id: the id or name of the dataset :type id: string :rtype: int ''' return _follower_count( context, data_dict...
def dataset_follower_count( context: Context, data_dict: DataDict) -> ActionResult.DatasetFollowerCount:
'''Return the number of followers of a dataset. :param id: the id or name of the dataset :type id: string :rtype: int ''' return _follower_count( context, data_dict, ckan.logic.schema.default_follow_dataset_schema(), context['model'].UserFollowingDataset)
:rtype: int ''' return _follower_count( context, data_dict, ckan.logic.schema.default_follow_user_schema(), context['model'].UserFollowingUser) def dataset_follower_count( context: Context, data_dict: DataDict) -> ActionResult.DatasetFollowerCount:
64
64
96
25
39
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
dataset_follower_count
dataset_follower_count
2,513
2,527
2,513
2,515
e46af4332e8618b4c6b22e6ca62a28612c5e0c5c
bigcode/the-stack
train
c64d231f44b35a5a54894d66
train
function
def group_followee_list( context: Context, data_dict: DataDict) -> ActionResult.GroupFolloweeList: '''Return the list of groups that are followed by the given user. :param id: the id or name of the user :type id: string :rtype: list of dictionaries ''' _check_access('group_fol...
def group_followee_list( context: Context, data_dict: DataDict) -> ActionResult.GroupFolloweeList:
'''Return the list of groups that are followed by the given user. :param id: the id or name of the user :type id: string :rtype: list of dictionaries ''' _check_access('group_followee_list', context, data_dict) return _group_or_org_followee_list(context, data_dict, is_org=False)
dataset in datasets if dataset is not None] # Dictize the list of Package objects. return [model_dictize.package_dictize(dataset, context) for dataset in datasets] def group_followee_list( context: Context, data_dict: DataDict) -> ActionResult.GroupFolloweeList:
64
64
104
26
38
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
group_followee_list
group_followee_list
2,947
2,960
2,947
2,949
d8a5fe7aef0971a5c0fe00c498f7559a47599131
bigcode/the-stack
train
b7771e1c7c51f1742322fbe6
train
function
@logic.validate(ckan.logic.schema.default_package_list_schema) def current_package_list_with_resources( context: Context, data_dict: DataDict) -> ActionResult.CurrentPackageListWithResources: '''Return a list of the site's datasets (packages) and their resources. The list is sorted most-recently-modifi...
@logic.validate(ckan.logic.schema.default_package_list_schema) def current_package_list_with_resources( context: Context, data_dict: DataDict) -> ActionResult.CurrentPackageListWithResources:
'''Return a list of the site's datasets (packages) and their resources. The list is sorted most-recently-modified first. :param limit: if given, the list of datasets will be broken into pages of at most ``limit`` datasets per page and only one page will be returned at a time (optional) ...
= data_dict.get('limit') if limit: query = query.limit(limit) offset = data_dict.get('offset') if offset: query = query.offset(offset) ## Returns the first field in each result record return [r[0] for r in query.execute() or []] @logic.validate(ckan.logic.schema.default_package_li...
105
105
350
40
65
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
current_package_list_with_resources
current_package_list_with_resources
111
150
111
113
b3e75d03d705f66dd4ef2c66bf1c71f66270419d
bigcode/the-stack
train
99df4f7ecc06b7389ab08738
train
function
def organization_followee_list( context: Context, data_dict: DataDict) -> ActionResult.OrganizationFolloweeList: '''Return the list of organizations that are followed by the given user. :param id: the id or name of the user :type id: string :rtype: list of dictionaries ''' _c...
def organization_followee_list( context: Context, data_dict: DataDict) -> ActionResult.OrganizationFolloweeList:
'''Return the list of organizations that are followed by the given user. :param id: the id or name of the user :type id: string :rtype: list of dictionaries ''' _check_access('organization_followee_list', context, data_dict) return _group_or_org_followee_list(context, data_dict, is_org=...
of dictionaries ''' _check_access('group_followee_list', context, data_dict) return _group_or_org_followee_list(context, data_dict, is_org=False) def organization_followee_list( context: Context, data_dict: DataDict) -> ActionResult.OrganizationFolloweeList:
64
64
104
26
38
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
organization_followee_list
organization_followee_list
2,963
2,977
2,963
2,965
e75407eb3bed6c3b47fc63c63ce1ee177fdde8e1
bigcode/the-stack
train
8ca72429fe31923c1ca1f17a
train
function
@logic.validate(ckan.logic.schema.default_resource_search_schema) def resource_search(context: Context, data_dict: DataDict) -> ActionResult.ResourceSearch: ''' Searches for resources in public Datasets satisfying the search criteria. It returns a dictionary with 2 fields: ``count`` and ``results``. The ...
@logic.validate(ckan.logic.schema.default_resource_search_schema) def resource_search(context: Context, data_dict: DataDict) -> ActionResult.ResourceSearch:
''' Searches for resources in public Datasets satisfying the search criteria. It returns a dictionary with 2 fields: ``count`` and ``results``. The ``count`` field contains the total number of Resources found without the limit or query parameters having an effect. The ``results`` field is a l...
key == 'license_id': license = model.Package.get_license_register().get(key_) if license: new_facet_dict['display_name'] = license.title else: new_facet_dict['display_name'] = key_ else: new_facet_dict['...
256
256
1,348
32
223
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
resource_search
resource_search
2,018
2,177
2,018
2,019
8f29524ed72b9b6329751c4cf31b7d2e6ef773f3
bigcode/the-stack
train
f819fbf138044854afcd8af6
train
function
def vocabulary_show(context: Context, data_dict: DataDict) -> ActionResult.VocabularyShow: '''Return a single tag vocabulary. :param id: the id or name of the vocabulary :type id: string :return: the vocabulary. :rtype: dictionary ''' _check_access('vocabulary_show', context, data_dict) ...
def vocabulary_show(context: Context, data_dict: DataDict) -> ActionResult.VocabularyShow:
'''Return a single tag vocabulary. :param id: the id or name of the vocabulary :type id: string :return: the vocabulary. :rtype: dictionary ''' _check_access('vocabulary_show', context, data_dict) model = context['model'] vocab_id = data_dict.get('id') if not vocab_id: ...
ocabulary_list', context, data_dict) model = context['model'] vocabulary_objects = model.Session.query(model.Vocabulary).all() return model_dictize.vocabulary_list_dictize(vocabulary_objects, context) def vocabulary_show(context: Context, data_dict: DataDict) -> ActionResult.VocabularyShow:
64
64
169
20
44
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
vocabulary_show
vocabulary_show
2,464
2,483
2,464
2,464
26d69dceb6ccee05911ae1ddae2b98af4da6df4c
bigcode/the-stack
train
7589a55e0ae45bc17bf4e787
train
function
def tag_search(context: Context, data_dict: DataDict) -> ActionResult.TagSearch: '''Return a list of tags whose names contain a given string. By default only free tags (tags that don't belong to any vocabulary) are searched. If the ``vocabulary_id`` argument is given then only tags belonging to that vo...
def tag_search(context: Context, data_dict: DataDict) -> ActionResult.TagSearch:
'''Return a list of tags whose names contain a given string. By default only free tags (tags that don't belong to any vocabulary) are searched. If the ``vocabulary_id`` argument is given then only tags belonging to that vocabulary will be searched instead. :param query: the string(s) to search for...
escape='\\') q = q.filter( # type_ignore_reason: incomplete SQLAlchemy types model.Tag.name.ilike('%' + escaped_term + '%')) # type: ignore count = q.count() q = q.offset(offset) q = q.limit(limit) return q.all(), count def tag_search(context: Context, data_dict: DataD...
87
87
292
19
67
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
tag_search
tag_search
2,233
2,267
2,233
2,233
792e53feda11d4c9994d54ab4d6ac4d1e9f6c5a2
bigcode/the-stack
train
b70622af0f0e8b01c460f05f
train
function
def get_site_user(context: Context, data_dict: DataDict) -> ActionResult.GetSiteUser: '''Return the ckan site user :param defer_commit: by default (or if set to false) get_site_user will commit and clean up the current transaction. If set to true, caller is responsible for commiting transaction...
def get_site_user(context: Context, data_dict: DataDict) -> ActionResult.GetSiteUser:
'''Return the ckan site user :param defer_commit: by default (or if set to false) get_site_user will commit and clean up the current transaction. If set to true, caller is responsible for commiting transaction after get_site_user is called. Leaving open connections can cause cli command...
.connection() cursor = conn.execute(q) results: ActionResult.TermTranslationShow = [] for row in cursor: results.append(_table_dictize(row, context)) return results # Only internal services are allowed to call get_site_user. def get_site_user(context: Context, data_dict: DataDict) -> Action...
73
73
245
21
52
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
get_site_user
get_site_user
2,398
2,425
2,398
2,398
5521ead122a4238f421b904e7eea1090288b534c
bigcode/the-stack
train
604804b81ea53a98881954d3
train
function
def _follower_list( context: Context, data_dict: DataDict, default_schema: Schema, FollowerClass: Type["ModelFollowingModel[Any, Any]"]): schema = context.get('schema', default_schema) data_dict, errors = _validate(data_dict, schema, context) if errors: raise ValidationError(errors) ...
def _follower_list( context: Context, data_dict: DataDict, default_schema: Schema, FollowerClass: Type["ModelFollowingModel[Any, Any]"]):
schema = context.get('schema', default_schema) data_dict, errors = _validate(data_dict, schema, context) if errors: raise ValidationError(errors) # Get the list of Follower objects. model = context['model'] object_id = data_dict.get('id') followers = FollowerClass.follower_list(obje...
:type id: string :rtype: int ''' return group_follower_count(context, data_dict) def _follower_list( context: Context, data_dict: DataDict, default_schema: Schema, FollowerClass: Type["ModelFollowingModel[Any, Any]"]):
64
64
185
38
26
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
_follower_list
_follower_list
2,561
2,579
2,561
2,563
419d0cc9c761f85dd3c866f7c3e40a5149233d36
bigcode/the-stack
train
aad44c21bf1f840692ca3961
train
function
def tag_list(context: Context, data_dict: DataDict) -> ActionResult.TagList: '''Return a list of the site's tags. By default only free tags (tags that don't belong to a vocabulary) are returned. If the ``vocabulary_id`` argument is given then only tags belonging to that vocabulary will be ...
def tag_list(context: Context, data_dict: DataDict) -> ActionResult.TagList:
'''Return a list of the site's tags. By default only free tags (tags that don't belong to a vocabulary) are returned. If the ``vocabulary_id`` argument is given then only tags belonging to that vocabulary will be returned instead. :param query: a tag name query to search for, if given only tags wh...
_dict: DataDict) -> ActionResult.LicenseList: '''Return the list of licenses available for datasets on the site. :rtype: list of dictionaries ''' model = context["model"] _check_access('license_list', context, data_dict) license_register = model.Package.get_license_register() licenses = ...
110
110
367
20
89
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
tag_list
tag_list
765
811
765
766
844b927aad15680522fdb9b54c613b5c652e643e
bigcode/the-stack
train
9439a174466c73502a40fc9d
train
function
def config_option_list(context: Context, data_dict: DataDict) -> ActionResult.ConfigOptionList: '''Return a list of runtime-editable config options keys that can be updated with :py:func:`~ckan.logic.action.update.config_option_update`. :returns: A list of config option keys. ...
def config_option_list(context: Context, data_dict: DataDict) -> ActionResult.ConfigOptionList:
'''Return a list of runtime-editable config options keys that can be updated with :py:func:`~ckan.logic.action.update.config_option_update`. :returns: A list of config option keys. :rtype: list ''' _check_access('config_option_list', context, data_dict) schema = ckan.logic.schema.updat...
not in schema: raise ValidationError({ 'message': f"Configuration option '{key}' can not be shown"}) # return the value from config return config.get(key, None) def config_option_list(context: Context, data_dict: DataDict) -> ActionResult.ConfigOptionList:
64
64
106
22
42
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
config_option_list
config_option_list
3,117
3,130
3,117
3,118
81858e033cd56ef07898e72d0e221c2e76866416
bigcode/the-stack
train
a482f7f6bb9cf730cf71e885
train
function
def config_option_show(context: Context, data_dict: DataDict) -> ActionResult.ConfigOptionShow: '''Show the current value of a particular configuration option. Only returns runtime-editable config options (the ones returned by :py:func:`~ckan.logic.action.get.config_option_list`), wh...
def config_option_show(context: Context, data_dict: DataDict) -> ActionResult.ConfigOptionShow:
'''Show the current value of a particular configuration option. Only returns runtime-editable config options (the ones returned by :py:func:`~ckan.logic.action.get.config_option_list`), which can be updated with the :py:func:`~ckan.logic.action.update.config_option_update` action. :param key: The ...
ust(data_dict, 'name') _check_access('help_show', context, data_dict) try: function = logic.get_action(function_name) except KeyError: raise NotFound('Action function not found') return function.__doc__ def config_option_show(context: Context, data_dict: DataDic...
75
76
254
22
53
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
config_option_show
config_option_show
3,084
3,114
3,084
3,085
c7cf605ab5264c8a37c19f7fd25d929fd60e2c8d
bigcode/the-stack
train
471867520ba7926b63a0bab0
train
function
def _unpick_search( sort: str, allowed_fields: Optional['Container[str]'] = None, total: Optional[int] = None) -> list[tuple[str, str]]: ''' This is a helper function that takes a sort string eg 'name asc, last_modified desc' and returns a list of split field order eg [('name', 'asc'...
def _unpick_search( sort: str, allowed_fields: Optional['Container[str]'] = None, total: Optional[int] = None) -> list[tuple[str, str]]:
''' This is a helper function that takes a sort string eg 'name asc, last_modified desc' and returns a list of split field order eg [('name', 'asc'), ('last_modified', 'desc')] allowed_fields can limit which field names are ok. total controls how many sorts can be specifed ''' sorts: list[tuple[...
in groups if group is not None and group.is_organization == is_org] # Dictize the list of Group objects. return [model_dictize.group_dictize(group, context) for group in groups] def _unpick_search( sort: str, allowed_fields: Optional['Container[str]'] = None, total: Optio...
87
87
290
41
46
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
_unpick_search
_unpick_search
3,004
3,033
3,004
3,007
42da4bd06bff872c3a7ff422778d2e2917c6b74a
bigcode/the-stack
train
7b88655be89e491001d69852
train
function
def package_show(context: Context, data_dict: DataDict) -> ActionResult.PackageShow: '''Return the metadata of a dataset (package) and its resources. :param id: the id or name of the dataset :type id: string :param use_default_schema: use default package schema instead of a custom schema define...
def package_show(context: Context, data_dict: DataDict) -> ActionResult.PackageShow:
'''Return the metadata of a dataset (package) and its resources. :param id: the id or name of the dataset :type id: string :param use_default_schema: use default package schema instead of a custom schema defined with an IDatasetForm plugin (default: ``False``) :type use_default_schema: bool...
id' if api == 2 else 'name' pkg1 = model.Package.get(id) pkg2 = None if not pkg1: raise NotFound('First package named in request was not found.') if id2: pkg2 = model.Package.get(id2) if not pkg2: raise NotFound('Second package named in address was not found.') i...
231
231
771
19
211
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
package_show
package_show
976
1,072
976
976
db8725509006177ba2f6d657fd43b5387ca12a28
bigcode/the-stack
train
e766209847f40b6a02e4987b
train
function
def organization_follower_count( context: Context, data_dict: DataDict) -> ActionResult.OrganizationFollowerCount: '''Return the number of followers of an organization. :param id: the id or name of the organization :type id: string :rtype: int ''' return group_follower_count(c...
def organization_follower_count( context: Context, data_dict: DataDict) -> ActionResult.OrganizationFollowerCount:
'''Return the number of followers of an organization. :param id: the id or name of the organization :type id: string :rtype: int ''' return group_follower_count(context, data_dict)
:rtype: int ''' return _follower_count( context, data_dict, ckan.logic.schema.default_follow_group_schema(), context['model'].UserFollowingGroup) def organization_follower_count( context: Context, data_dict: DataDict) -> ActionResult.OrganizationFollowerCount:
64
64
75
25
39
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
organization_follower_count
organization_follower_count
2,547
2,558
2,547
2,549
ccdc09b3407ad80cf4060f2cf01f5e11c50384c3
bigcode/the-stack
train
c863bf008e8ef79d2a50fc12
train
function
def _group_or_org_list( context: Context, data_dict: DataDict, is_org: bool = False): model = context['model'] api = context.get('api_version') groups = data_dict.get('groups') group_type = data_dict.get('type', 'group') ref_group_by = 'id' if api == 2 else 'name' pagination_dict = {} ...
def _group_or_org_list( context: Context, data_dict: DataDict, is_org: bool = False):
model = context['model'] api = context.get('api_version') groups = data_dict.get('groups') group_type = data_dict.get('type', 'group') ref_group_by = 'id' if api == 2 else 'name' pagination_dict = {} limit = data_dict.get('limit') if limit: pagination_dict['limit'] = data_dict['l...
_permission('allow_dataset_collaborators'): raise ValidationError({ 'message': _('Dataset collaborators not enabled')}) _check_access('package_collaborator_list_for_user', context, data_dict) user = model.User.get(user_id) if not user: raise NotAuthorized(_('Not allowed to retr...
256
256
1,035
25
230
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
_group_or_org_list
_group_or_org_list
320
445
320
321
a20d3d6e62442a68509331013cc680b84deaf74d
bigcode/the-stack
train
43325b389951c7649d1d8f3b
train
function
def task_status_show(context: Context, data_dict: DataDict) -> ActionResult.TaskStatusShow: '''Return a task status. Either the ``id`` parameter *or* the ``entity_id``, ``task_type`` *and* ``key`` parameters must be given. :param id: the id of the task status (optional) :type id: string :param...
def task_status_show(context: Context, data_dict: DataDict) -> ActionResult.TaskStatusShow:
'''Return a task status. Either the ``id`` parameter *or* the ``entity_id``, ``task_type`` *and* ``key`` parameters must be given. :param id: the id of the task status (optional) :type id: string :param entity_id: the entity_id of the task status (optional) :type entity_id: string :par...
, the offset to start returning tags from :type offset: int :rtype: list of strings ''' _check_access('tag_autocomplete', context, data_dict) matching_tags, _count = _tag_search(context, data_dict) if matching_tags: return [tag.name for tag in matching_tags] else: r...
100
101
337
21
79
salsadigitalauorg/ckan
ckan/logic/action/get.py
Python
task_status_show
task_status_show
2,301
2,341
2,301
2,301
009861a6f5473bcec528a44103892572f1ebe274
bigcode/the-stack
train
a5067288542a221b5e48141d
train
function
def stations_level_over_threshold(stations, tol): list = [] tuple_data = [] for station in stations: if station.relative_water_level() != None: if station.relative_water_level() > 0: if station.relative_water_level() >= tol: list += station.name...
def stations_level_over_threshold(stations, tol):
list = [] tuple_data = [] for station in stations: if station.relative_water_level() != None: if station.relative_water_level() > 0: if station.relative_water_level() >= tol: list += station.name, station.relative_water_level() ...
from logging.config import listen from .station import MonitoringStation from .utils import sorted_by_key def stations_level_over_threshold(stations, tol):
31
64
103
10
20
YianWen/Flood-warning-
flood.py
Python
stations_level_over_threshold
stations_level_over_threshold
5
15
5
5
41dddb3a6832a7dd55eaf9634f9ebbc287e3b0c4
bigcode/the-stack
train
8dd28f5f7506efc5af6fef5a
train
function
def stations_highest_rel_level(stations, N): list = [] tuple_data = [] for station in stations: if station.latest_level and station.typical_range != None: x = station.latest_level - station.typical_range[1] list += station.name, x tuple_data = [x for x in z...
def stations_highest_rel_level(stations, N):
list = [] tuple_data = [] for station in stations: if station.latest_level and station.typical_range != None: x = station.latest_level - station.typical_range[1] list += station.name, x tuple_data = [x for x in zip(*[iter(list)]*2)] tuple_data = sorted_...
_water_level() >= tol: list += station.name, station.relative_water_level() tuple_data = [x for x in zip(*[iter(list)]*2)] tuple_data = sorted_by_key(tuple_data, 1) return tuple_data def stations_highest_rel_level(stations, N):
64
64
103
11
52
YianWen/Flood-warning-
flood.py
Python
stations_highest_rel_level
stations_highest_rel_level
17
26
17
17
d726ff89c024741eea558baf2644baab291c7ac9
bigcode/the-stack
train
bfce7e9bac273ae85911092e
train
function
def main(): args = parse_args() cfg = Config.fromfile(args.config) # set cudnn_benchmark if cfg.get('cudnn_benchmark', False): torch.backends.cudnn.benchmark = True # update configs according to CLI args if args.work_dir is not None: cfg.work_dir = args.work_dir if args.resu...
def main():
args = parse_args() cfg = Config.fromfile(args.config) # set cudnn_benchmark if cfg.get('cudnn_benchmark', False): torch.backends.cudnn.benchmark = True # update configs according to CLI args if args.work_dir is not None: cfg.work_dir = args.work_dir if args.resume_from is n...
'(only applicable to non-distributed training)') parser.add_argument('--seed', type=int, default=None, help='random seed') parser.add_argument( '--launcher', choices=['none', 'pytorch', 'slurm', 'mpi'], default='none', help='job launcher') parser.add_argument('--local_rank',...
196
196
654
3
192
ducminhkhoi/FAPIS
tools/train_solov2.py
Python
main
main
102
173
102
102
32cc2f73c5113aab19d178e02b1eea34582a1ecf
bigcode/the-stack
train
73b10f9263ea5f284250074d
train
function
def parse_args(): parser = argparse.ArgumentParser(description='Train a detector') parser.add_argument('config', help='train config file path') parser.add_argument('--work_dir', help='the dir to save logs and models') parser.add_argument( '--resume_from', help='the checkpoint file to resume from...
def parse_args():
parser = argparse.ArgumentParser(description='Train a detector') parser.add_argument('config', help='train config file path') parser.add_argument('--work_dir', help='the dir to save logs and models') parser.add_argument( '--resume_from', help='the checkpoint file to resume from') parser.add_...
from __future__ import division import argparse import os from mmcv import Config from mmdet import __version__ from mmdet.datasets import build_dataset from mmdet.apis import (train_detector, init_dist, get_root_logger, set_random_seed) from mmdet.models import build_detector import torch def...
75
216
723
4
70
ducminhkhoi/FAPIS
tools/train_solov2.py
Python
parse_args
parse_args
15
99
15
15
740c4a616db1c106e452e46a77e4c18725671002
bigcode/the-stack
train
d930e15c134ca3a0834e69d9
train
function
def postprocessing_test_data(test_data, pred_df): """ Args: test_data: original dataframe passed to model inference function, without any encoding Returns: """ data = pd.DataFrame() matches = [] bet_odds = [] events = [] for i in test_data.index: row = t...
def postprocessing_test_data(test_data, pred_df):
""" Args: test_data: original dataframe passed to model inference function, without any encoding Returns: """ data = pd.DataFrame() matches = [] bet_odds = [] events = [] for i in test_data.index: row = test_data.loc[i] team, opponent = row['team...
ictions, thr, true_series=None): pred_df = pd.DataFrame() pred_df['pred'] = list(predictions) if true_series is not None: pred_df['true'] = true_series.values if(thr is not None): pred_df['to_bet'] = pred_df['pred'] >= thr return pred_df def postprocessing_test_data(test_data, pre...
87
87
293
11
75
daniele21/DL_soccer_prediction_v2
scripts/data/postprocessing.py
Python
postprocessing_test_data
postprocessing_test_data
19
62
19
19
290531abd3262a002e65c361ed6f2950c343c3aa
bigcode/the-stack
train
77ff80e84936ebb301e4eed6
train
function
def labeling_predictions(predictions, thr, true_series=None): pred_df = pd.DataFrame() pred_df['pred'] = list(predictions) if true_series is not None: pred_df['true'] = true_series.values if(thr is not None): pred_df['to_bet'] = pred_df['pred'] >= thr return pred_df
def labeling_predictions(predictions, thr, true_series=None):
pred_df = pd.DataFrame() pred_df['pred'] = list(predictions) if true_series is not None: pred_df['true'] = true_series.values if(thr is not None): pred_df['to_bet'] = pred_df['pred'] >= thr return pred_df
# -*- coding: utf-8 -*- import pandas as pd from scripts.constants.configs import AWAY, HOME def labeling_predictions(predictions, thr, true_series=None):
36
64
80
12
23
daniele21/DL_soccer_prediction_v2
scripts/data/postprocessing.py
Python
labeling_predictions
labeling_predictions
7
17
7
7
bf7a6f8190ec718f3531d2d304e98b9525955476
bigcode/the-stack
train
578b4b49284624ec875642c4
train
function
def generate_outcome(matches_df, predictions, thr=None): outcome_df = pd.DataFrame({'match': [], 'home': [], 'away': [], '1X': [], 'pred_1X': [], 'pred_1X_bet':...
def generate_outcome(matches_df, predictions, thr=None):
outcome_df = pd.DataFrame({'match': [], 'home': [], 'away': [], '1X': [], 'pred_1X': [], 'pred_1X_bet': [], 'outcome_1X': [], ...
-bet-WD'] home = row['f-home'] if(home == True): matches.append(f'{team} - {opponent}') events.append('1X') elif(home == False): matches.append(f'{opponent} - {team}') events.append('X2') else: raise ValueError('Wrong Home feat...
208
208
695
12
195
daniele21/DL_soccer_prediction_v2
scripts/data/postprocessing.py
Python
generate_outcome
generate_outcome
64
133
64
65
357a53a703a5b138fcc3c0fdfedc42dcf30bf8db
bigcode/the-stack
train
70d169142ce398f67d773c93
train
function
def feature_importance(model): pass
def feature_importance(model):
pass
_df['outcome_1X'] = outcome_df['outcome_1X'].astype(bool) outcome_df['outcome_X2'] = outcome_df['outcome_X2'].astype(bool) outcome_df = outcome_df.reset_index(drop=True) return outcome_df def feature_importance(model):
64
64
9
6
57
daniele21/DL_soccer_prediction_v2
scripts/data/postprocessing.py
Python
feature_importance
feature_importance
135
136
135
135
d8b61f94bd351b907177b1c691823bc6dcfab35c
bigcode/the-stack
train
42a67540858d1dd082ec3f53
train
function
def setrun(claw_pkg='classic'): #------------------------------ """ Define the parameters used for running Clawpack. INPUT: claw_pkg expected to be "classic" for this setrun. OUTPUT: rundata - object of class ClawRunData """ from clawpack.clawutil import data ...
def setrun(claw_pkg='classic'): #------------------------------
""" Define the parameters used for running Clawpack. INPUT: claw_pkg expected to be "classic" for this setrun. OUTPUT: rundata - object of class ClawRunData """ from clawpack.clawutil import data assert claw_pkg.lower() == 'classic', "Expected claw_...
""" Module to set up run time parameters for Clawpack -- classic code. The values set in the function setrun are then written out to data files that will be read in by the Fortran code. """ import os import numpy as np #------------------------------ def setrun(claw_pkg='classic'): #--------------------------...
71
256
1,715
13
58
amath574w2017/am574-class
sphinx/_static/burgers/setrun.py
Python
setrun
setrun
13
214
13
15
2af241663c091d5a430e2b89e93e71cd866997e4
bigcode/the-stack
train
9c2954fc83daed1edca963c4
train
class
class _Comparable(object): """Rich comparison operators based on __lt__ and __eq__""" __gt__ = lambda self, other: not self < other and not self == other __le__ = lambda self, other: self < other or self == other __ne__ = lambda self, other: not self == other __ge__ = lambda self, other: self > othe...
class _Comparable(object):
"""Rich comparison operators based on __lt__ and __eq__""" __gt__ = lambda self, other: not self < other and not self == other __le__ = lambda self, other: self < other or self == other __ne__ = lambda self, other: not self == other __ge__ = lambda self, other: self > other or self == other
import sys import re if sys.version_info[0] > 2: from itertools import zip_longest else: from itertools import izip_longest as zip_longest class _Comparable(object):
45
64
91
5
39
lel-amri/pysemver
pysemver.py
Python
_Comparable
_Comparable
9
14
9
9
4c6404c309882cf6570cf21d8643625210d929b2
bigcode/the-stack
train
5e5594d23ccd4a26d502acbc
train
class
class VersionError(Exception): pass
class VersionError(Exception):
pass
(s) is str try: return int(s) except ValueError: return s def _make_group(g): return ([] if g is None else list(map( _try_int, [g for g in g.split('.') if g] ))) class VersionError(Exception):
64
64
8
5
59
lel-amri/pysemver
pysemver.py
Python
VersionError
VersionError
73
74
73
73
d6d9d8ad8404eaa4646ba699c692cb848bf96901
bigcode/the-stack
train
091c85900956b30d9ea13feb
train
class
class _Seq(_Comparable): """Container to compare agnostic arrays""" def __init__(self, seq): self.seq = seq def __eq__(self, other): assert set([int, str]) >= set(map(type, self.seq)) if len(self.seq) != len(other.seq): return False for s, o in zip(self.seq, othe...
class _Seq(_Comparable):
"""Container to compare agnostic arrays""" def __init__(self, seq): self.seq = seq def __eq__(self, other): assert set([int, str]) >= set(map(type, self.seq)) if len(self.seq) != len(other.seq): return False for s, o in zip(self.seq, other.seq): if no...
lambda self, other: not self < other and not self == other __le__ = lambda self, other: self < other or self == other __ne__ = lambda self, other: not self == other __ge__ = lambda self, other: self > other or self == other class _Seq(_Comparable):
72
72
242
6
65
lel-amri/pysemver
pysemver.py
Python
_Seq
_Seq
17
46
17
17
15f25aebd08057444ac0c94c8105221e8a231e8e
bigcode/the-stack
train
df5fd565312cf053096ae1ff
train
class
class Version(_Comparable): """Represent a version as defined by `SemVer 2.0.0`_ It gives the ability to easily compare versions and parse them. While the object is flexible for the parsing of its input, it strictly respect the SemVer specification for the output. .. _SemVer 2.0.0: ht...
class Version(_Comparable):
"""Represent a version as defined by `SemVer 2.0.0`_ It gives the ability to easily compare versions and parse them. While the object is flexible for the parsing of its input, it strictly respect the SemVer specification for the output. .. _SemVer 2.0.0: http://semver.org/spec/v2.0.0....
r'([0-9]+)(?:\.([0-9]+)(?:\.([0-9]+))?)?' r'(?:-([0-9A-Za-z-\.]+))?' r'(?:\+([0-9A-Za-z-\.]+))?' r'$' ) def _try_int(s): assert type(s) is str try: return int(s) except ValueError: return s def _make_group(g): return ([] if g is None else list(map( _try_int, ...
151
151
506
5
145
lel-amri/pysemver
pysemver.py
Python
Version
Version
77
134
77
77
2881090f9a7b020d7bf50e3cda55b300641423b5
bigcode/the-stack
train
12113a0b7fe173fa054737b4
train
function
def _make_group(g): return ([] if g is None else list(map( _try_int, [g for g in g.split('.') if g] )))
def _make_group(g):
return ([] if g is None else list(map( _try_int, [g for g in g.split('.') if g] )))
))?' r'(?:\+([0-9A-Za-z-\.]+))?' r'$' ) def _try_int(s): assert type(s) is str try: return int(s) except ValueError: return s def _make_group(g):
64
64
37
6
57
lel-amri/pysemver
pysemver.py
Python
_make_group
_make_group
66
70
66
66
e2a87c19b6abef8be559d8164538d384eca150a9
bigcode/the-stack
train
490634b69cd4dbf2373cf219
train
function
def _try_int(s): assert type(s) is str try: return int(s) except ValueError: return s
def _try_int(s):
assert type(s) is str try: return int(s) except ValueError: return s
0-9]+)(?:\.([0-9]+))?)?' r'(?:-([0-9A-Za-z-\.]+))?' r'(?:\+([0-9A-Za-z-\.]+))?' r'$' ) def _try_int(s):
64
64
31
6
58
lel-amri/pysemver
pysemver.py
Python
_try_int
_try_int
58
63
58
58
5119ba380fa62f1417ce6dab471cc106f40b8c00
bigcode/the-stack
train
ade90ce2c23f6d40cd5c2c37
train
function
def rolling_max_(a, n, axis = 0, data = None, instate = None): """ Equivalent to rolling_max(a) but returns also the state. For full documentation, look at rolling_max.__doc__ """ import bottleneck as bn state = instate or dict(vec = None) return _data_state(['data','vec'],_rolling_win...
def rolling_max_(a, n, axis = 0, data = None, instate = None):
""" Equivalent to rolling_max(a) but returns also the state. For full documentation, look at rolling_max.__doc__ """ import bottleneck as bn state = instate or dict(vec = None) return _data_state(['data','vec'],_rolling_window(a, window = n, min_count = n, func = bn.move_max, **state))...
state = state or dict(vec = None) return first_(_rolling_window(a, window = n, min_count = n, func = bn.move_max, axis = axis, **state)) def rolling_max_(a, n, axis = 0, data = None, instate = None):
64
64
105
22
42
gityoav/pyg-timeseries
src/pyg_timeseries/_max.py
Python
rolling_max_
rolling_max_
68
75
68
68
357c7e5466b930f36221444ae9851de8660ed586
bigcode/the-stack
train
be8d182eb9f59781bae0ef44
train
function
def expanding_max_(a, axis = 0, data = None, instate = None): """ Equivalent to a.expanding().max() but returns the full state: i.e. both data: the expanding().max() m: the current maximum """ state = instate or {} return _data_state(['data','m'], _expanding_max(a, axis = axis, **state))
def expanding_max_(a, axis = 0, data = None, instate = None):
""" Equivalent to a.expanding().max() but returns the full state: i.e. both data: the expanding().max() m: the current maximum """ state = instate or {} return _data_state(['data','m'], _expanding_max(a, axis = axis, **state))
[0]): if np.isnan(a[i]): res[i] = np.nan else: res[i] = m = m if m>a[i] else a[i] return res, m def expanding_max_(a, axis = 0, data = None, instate = None):
64
64
89
20
43
gityoav/pyg-timeseries
src/pyg_timeseries/_max.py
Python
expanding_max_
expanding_max_
99
106
99
99
ee8c937f6f6fece08de61748c422604ea54d35d6
bigcode/the-stack
train
650ff779ee4dbae99831fc1a
train
function
@loop_all @pd2np @compiled def _expanding_max(a, m = np.nan): res = np.empty_like(a) for i0 in range(a.shape[0]): if np.isnan(a[i0]): res[i0] = np.nan else: res[i0] = m = m if m>a[i0] else a[i0] break for i in range(i0+1, a.shape[0]): if np.isnan(a...
@loop_all @pd2np @compiled def _expanding_max(a, m = np.nan):
res = np.empty_like(a) for i0 in range(a.shape[0]): if np.isnan(a[i0]): res[i0] = np.nan else: res[i0] = m = m if m>a[i0] else a[i0] break for i in range(i0+1, a.shape[0]): if np.isnan(a[i]): res[i] = np.nan else: re...
data_state(['data','vec'],_rolling_window(a, window = n, min_count = n, func = bn.move_max, **state)) rolling_max_.output = ['data','state'] @loop_all @pd2np @compiled def _expanding_max(a, m = np.nan):
64
64
142
24
40
gityoav/pyg-timeseries
src/pyg_timeseries/_max.py
Python
_expanding_max
_expanding_max
80
96
80
83
26200450a470cb3c1368d43d9ffd9672198d0d34
bigcode/the-stack
train
80066cbaebf9be2ada900743
train
function
def rolling_max(a, n, axis = 0, data = None, state = None): """ equivalent to pandas a.rolling(n).max(). - works with np.arrays - handles nan without forward filling. - supports state parameters :Parameters: ------------ a : array, pd.Series, pd.DataFrame or list/dict of these ...
def rolling_max(a, n, axis = 0, data = None, state = None):
""" equivalent to pandas a.rolling(n).max(). - works with np.arrays - handles nan without forward filling. - supports state parameters :Parameters: ------------ a : array, pd.Series, pd.DataFrame or list/dict of these timeseries n: int size of rolling window...
from pyg_timeseries._rolling import _rolling_window from pyg_base import pd2np, loop_all from pyg_timeseries._decorators import first_, compiled, _data_state import numpy as np __all__ = ['rolling_max', 'rolling_max_', 'expanding_max', 'expanding_max_'] def rolling_max(a, n, axis = 0, data = None, state = None):
86
194
647
20
66
gityoav/pyg-timeseries
src/pyg_timeseries/_max.py
Python
rolling_max
rolling_max
8
66
8
8
b6fe20532122c9fa7304f4aaf9bb72121fce9374
bigcode/the-stack
train
724d2e276168a3f3a857225e
train
function
def expanding_max(a, axis = 0, data = None, state = None): """ equivalent to pandas a.expanding().max(). - works with np.arrays - handles nan without forward filling. - supports state parameters :Parameters: ------------ a : array, pd.Series, pd.DataFrame or list/dict of these ...
def expanding_max(a, axis = 0, data = None, state = None):
""" equivalent to pandas a.expanding().max(). - works with np.arrays - handles nan without forward filling. - supports state parameters :Parameters: ------------ a : array, pd.Series, pd.DataFrame or list/dict of these timeseries axis : int, optional ...
res[i0] = np.nan else: res[i0] = m = m if m>a[i0] else a[i0] break for i in range(i0+1, a.shape[0]): if np.isnan(a[i]): res[i] = np.nan else: res[i] = m = m if m>a[i] else a[i] return res, m def expanding_max_(a, axis = 0, dat...
209
209
699
18
191
gityoav/pyg-timeseries
src/pyg_timeseries/_max.py
Python
expanding_max
expanding_max
111
178
111
111
8f1f19416f85aa087b9869c7d3aaf8b572152b63
bigcode/the-stack
train
a8a3f09e9dececb717e2cb5f
train
function
def test_query1(): query({ "Menu": { "args": { "barID": "bar_id_here", }, "result": { "barID": "String", "beer": SubMenuQuery, }, }, })
def test_query1():
query({ "Menu": { "args": { "barID": "bar_id_here", }, "result": { "barID": "String", "beer": SubMenuQuery, }, }, })
model.setup_testing_mode() SubMenuQuery = { "image": "String", "menuItems": [{ "id": "String", "name": "String", "images": ["String"], "tags": ["String"], }], } def test_query1():
64
64
57
5
59
sipsop/qdserver
qdserver/test/test_menu.py
Python
test_query1
test_query1
14
25
14
14
c1d50528226d8933887c74ea0aa453e33f35102f
bigcode/the-stack
train
d86541a9a558a5f89c8d3336
train
function
def test_query2(): query({ "fragments": { "SubMenu": SubMenuQuery, }, "Menu": { "args": { "barID": "bar_id_here", }, "result": { "barID": "String", "beer": "SubMenu", "wine": "Su...
def test_query2():
query({ "fragments": { "SubMenu": SubMenuQuery, }, "Menu": { "args": { "barID": "bar_id_here", }, "result": { "barID": "String", "beer": "SubMenu", "wine": "SubMenu", ...
}], } def test_query1(): query({ "Menu": { "args": { "barID": "bar_id_here", }, "result": { "barID": "String", "beer": SubMenuQuery, }, }, }) def test_query2():
64
64
84
5
59
sipsop/qdserver
qdserver/test/test_menu.py
Python
test_query2
test_query2
27
42
27
27
6554335a39b5b2010fb5df427ae1ee72cad0ee5c
bigcode/the-stack
train
d3c03594f1571459db9945f1
train
function
def query(q): result = run_query(q) menu = result['result'] assert menu['barID'] == 'bar_id_here' assert menu['beer']['image'] menuItem = menu['beer']['menuItems'][0] assert menuItem['id'] assert menuItem['name'] assert menuItem['images'] assert menuItem['tags']
def query(q):
result = run_query(q) menu = result['result'] assert menu['barID'] == 'bar_id_here' assert menu['beer']['image'] menuItem = menu['beer']['menuItems'][0] assert menuItem['id'] assert menuItem['name'] assert menuItem['images'] assert menuItem['tags']
}, "Menu": { "args": { "barID": "bar_id_here", }, "result": { "barID": "String", "beer": "SubMenu", "wine": "SubMenu", }, }, }) def query(q):
64
64
80
4
60
sipsop/qdserver
qdserver/test/test_menu.py
Python
query
query
44
54
44
44
80688fd3e49b675196c737b18ed46e63be0d0bad
bigcode/the-stack
train
23cef12546ab157a7485b713
train
class
class ArticleAdmin(admin.ModelAdmin): """ 后台管理配置 """ # 配置文章列表显示字段 list_display = ('title', 'summary', 'pub_date',) # 配置日期过滤器 list_filter = ('pub_date',)
class ArticleAdmin(admin.ModelAdmin):
""" 后台管理配置 """ # 配置文章列表显示字段 list_display = ('title', 'summary', 'pub_date',) # 配置日期过滤器 list_filter = ('pub_date',)
from django.contrib import admin from .models import Article # Register your models here. class ArticleAdmin(admin.ModelAdmin):
25
64
58
7
18
unlzh/Demo_SimpleBlog
blog/admin.py
Python
ArticleAdmin
ArticleAdmin
5
12
5
5
6885ea89cb292eab2c0daa9b83b4df3ef53cdb3b
bigcode/the-stack
train
432e963b9c43a14222a31a13
train
class
class ModifyIpv6AddressesAttributeRequest(AbstractModel): """ModifyIpv6AddressesAttribute请求参数结构体 """ def __init__(self): """ :param NetworkInterfaceId: 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 :type NetworkInterfaceId: str :param Ipv6Addresses: 指定的内网IPv6`地址信息。 :type Ipv6Addres...
class ModifyIpv6AddressesAttributeRequest(AbstractModel):
"""ModifyIpv6AddressesAttribute请求参数结构体 """ def __init__(self): """ :param NetworkInterfaceId: 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 :type NetworkInterfaceId: str :param Ipv6Addresses: 指定的内网IPv6`地址信息。 :type Ipv6Addresses: list of Ipv6Address """ self.NetworkI...
,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyIpv6AddressesAttributeRequest(AbstractModel):
64
64
201
10
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ModifyIpv6AddressesAttributeRequest
ModifyIpv6AddressesAttributeRequest
11,187
11,210
11,187
11,187
af44525100fe26ca4a90fa4a114d626e62cabba6
bigcode/the-stack
train
33f6d7ea092a118d8a3289d7
train
class
class ModifyCustomerGatewayAttributeRequest(AbstractModel): """ModifyCustomerGatewayAttribute请求参数结构体 """ def __init__(self): """ :param CustomerGatewayId: 对端网关ID,例如:cgw-2wqq41m9,可通过DescribeCustomerGateways接口查询对端网关。 :type CustomerGatewayId: str :param CustomerGatewayName: 对端...
class ModifyCustomerGatewayAttributeRequest(AbstractModel):
"""ModifyCustomerGatewayAttribute请求参数结构体 """ def __init__(self): """ :param CustomerGatewayId: 对端网关ID,例如:cgw-2wqq41m9,可通过DescribeCustomerGateways接口查询对端网关。 :type CustomerGatewayId: str :param CustomerGatewayName: 对端网关名称,可任意命名,但不得超过60个字符。 :type CustomerGatewayName: st...
ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyCustomerGatewayAttributeRequest(AbstractModel):
64
64
161
9
55
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ModifyCustomerGatewayAttributeRequest
ModifyCustomerGatewayAttributeRequest
10,806
10,824
10,806
10,806
7ee65e4b8854ae850809f7b8f273fc467845fb15
bigcode/the-stack
train
28a694445f42f80988594630
train
class
class ReplaceSecurityGroupPolicyResponse(AbstractModel): """ReplaceSecurityGroupPolicy返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params)...
class ReplaceSecurityGroupPolicyResponse(AbstractModel):
"""ReplaceSecurityGroupPolicy返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId")
("SecurityGroupPolicySet")) if params.get("OriginalSecurityGroupPolicySet") is not None: self.OriginalSecurityGroupPolicySet = SecurityGroupPolicySet() self.OriginalSecurityGroupPolicySet._deserialize(params.get("OriginalSecurityGroupPolicySet")) class ReplaceSecurityGroupPolicyResponse(...
63
64
96
9
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ReplaceSecurityGroupPolicyResponse
ReplaceSecurityGroupPolicyResponse
13,155
13,169
13,155
13,155
dc11f9305fb9c2de3ff9ad95b8c2c6dd01b81f28
bigcode/the-stack
train
65c481d14be2b64da2289e14
train
class
class ModifyNatGatewayAttributeRequest(AbstractModel): """ModifyNatGatewayAttribute请求参数结构体 """ def __init__(self): """ :param NatGatewayId: NAT网关的ID,形如:`nat-df45454`。 :type NatGatewayId: str :param NatGatewayName: NAT网关的名称,形如:`test_nat`。 :type NatGatewayName: str ...
class ModifyNatGatewayAttributeRequest(AbstractModel):
"""ModifyNatGatewayAttribute请求参数结构体 """ def __init__(self): """ :param NatGatewayId: NAT网关的ID,形如:`nat-df45454`。 :type NatGatewayId: str :param NatGatewayName: NAT网关的名称,形如:`test_nat`。 :type NatGatewayName: str :param InternetMaxBandwidthOut: NAT网关最大外网出带宽(单位:M...
Response(AbstractModel): """ModifyIpv6AddressesAttribute返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = par...
101
101
338
9
92
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ModifyNatGatewayAttributeRequest
ModifyNatGatewayAttributeRequest
11,230
11,260
11,230
11,230
f4af64f65884bbbd408121aa5623fbf77098e3c3
bigcode/the-stack
train
14b460a17a6eb9e9dbc2dfa2
train
class
class CreateSecurityGroupPoliciesRequest(AbstractModel): """CreateSecurityGroupPolicies请求参数结构体 """ def __init__(self): """ :param SecurityGroupId: 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 :type SecurityGroupId: str :param SecurityGroupPolicySet: 安全组规则集合。 :...
class CreateSecurityGroupPoliciesRequest(AbstractModel):
"""CreateSecurityGroupPolicies请求参数结构体 """ def __init__(self): """ :param SecurityGroupId: 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 :type SecurityGroupId: str :param SecurityGroupPolicySet: 安全组规则集合。 :type SecurityGroupPolicySet: :class:`tencentcloud.vpc.v20...
Set") is not None: self.RouteTableSet = [] for item in params.get("RouteTableSet"): obj = RouteTable() obj._deserialize(item) self.RouteTableSet.append(obj) self.RequestId = params.get("RequestId") class CreateSecurityGroupPoliciesRequest(A...
64
64
189
9
55
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
CreateSecurityGroupPoliciesRequest
CreateSecurityGroupPoliciesRequest
3,159
3,179
3,159
3,159
c8b2e1f19b42d22f49463dd494c2e573b8114c3a
bigcode/the-stack
train
82445e78d4a9a6ecfe70bc83
train
class
class ModifyAddressInternetChargeTypeResponse(AbstractModel): """ModifyAddressInternetChargeType返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(sel...
class ModifyAddressInternetChargeTypeResponse(AbstractModel):
"""ModifyAddressInternetChargeType返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId")
BandwidthOut = params.get("InternetMaxBandwidthOut") if params.get("AddressChargePrepaid") is not None: self.AddressChargePrepaid = AddressChargePrepaid() self.AddressChargePrepaid._deserialize(params.get("AddressChargePrepaid")) class ModifyAddressInternetChargeTypeResponse(AbstractMode...
63
64
98
10
53
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ModifyAddressInternetChargeTypeResponse
ModifyAddressInternetChargeTypeResponse
10,481
10,495
10,481
10,481
b5d4c877d15c73af86f5d3c9a77618ce10b9b567
bigcode/the-stack
train
31df2953c75a4e2516d4beaa
train
class
class DisassociateNetworkAclSubnetsRequest(AbstractModel): """DisassociateNetworkAclSubnets请求参数结构体 """ def __init__(self): """ :param NetworkAclId: 网络ACL实例ID。例如:acl-12345678。 :type NetworkAclId: str :param SubnetIds: 子网实例ID数组。例如:[subnet-12345678] :type SubnetIds: li...
class DisassociateNetworkAclSubnetsRequest(AbstractModel):
"""DisassociateNetworkAclSubnets请求参数结构体 """ def __init__(self): """ :param NetworkAclId: 网络ACL实例ID。例如:acl-12345678。 :type NetworkAclId: str :param SubnetIds: 子网实例ID数组。例如:[subnet-12345678] :type SubnetIds: list of str """ self.NetworkAclId = None ...
次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DisassociateNetworkAclSubnetsRequest(AbstractModel):
64
64
146
11
53
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DisassociateNetworkAclSubnetsRequest
DisassociateNetworkAclSubnetsRequest
9,084
9,102
9,084
9,084
01e12be39cdf9bb0702911edda66fce43b13babf
bigcode/the-stack
train
459a78aed53019108144f7a6
train
class
class Tag(AbstractModel): """标签键值对 """ def __init__(self): """ :param Key: 标签键 注意:此字段可能返回 null,表示取不到有效值。 :type Key: str :param Value: 标签值 注意:此字段可能返回 null,表示取不到有效值。 :type Value: str """ self.Key = None self.Value = None def _deserialize(...
class Tag(AbstractModel):
"""标签键值对 """ def __init__(self): """ :param Key: 标签键 注意:此字段可能返回 null,表示取不到有效值。 :type Key: str :param Value: 标签值 注意:此字段可能返回 null,表示取不到有效值。 :type Value: str """ self.Key = None self.Value = None def _deserialize(self, params): sel...
Id = None def _deserialize(self, params): self.CidrBlock = params.get("CidrBlock") self.SubnetName = params.get("SubnetName") self.Zone = params.get("Zone") self.RouteTableId = params.get("RouteTableId") class Tag(AbstractModel):
64
64
121
5
59
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
Tag
Tag
14,248
14,268
14,248
14,248
71e66faccacf7c5a3557d8340c42bea8a10d460f
bigcode/the-stack
train
866d85f720698b422e246ad2
train
class
class MigrateNetworkInterfaceRequest(AbstractModel): """MigrateNetworkInterface请求参数结构体 """ def __init__(self): """ :param NetworkInterfaceId: 弹性网卡实例ID,例如:eni-m6dyj72l。 :type NetworkInterfaceId: str :param SourceInstanceId: 弹性网卡当前绑定的CVM实例ID。形如:ins-r8hr2upy。 :type Sou...
class MigrateNetworkInterfaceRequest(AbstractModel):
"""MigrateNetworkInterface请求参数结构体 """ def __init__(self): """ :param NetworkInterfaceId: 弹性网卡实例ID,例如:eni-m6dyj72l。 :type NetworkInterfaceId: str :param SourceInstanceId: 弹性网卡当前绑定的CVM实例ID。形如:ins-r8hr2upy。 :type SourceInstanceId: str :param DestinationInstance...
def _deserialize(self, params): self.UnitPrice = params.get("UnitPrice") self.ChargeUnit = params.get("ChargeUnit") self.OriginalPrice = params.get("OriginalPrice") self.DiscountPrice = params.get("DiscountPrice") class MigrateNetworkInterfaceRequest(AbstractModel):
64
64
205
9
55
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
MigrateNetworkInterfaceRequest
MigrateNetworkInterfaceRequest
10,324
10,346
10,324
10,324
8f020cbe802aa2d9a6c6fb74751ffe29b03a44fd
bigcode/the-stack
train
6701a6e992f263e6eec9da20
train
class
class DeleteSecurityGroupPoliciesResponse(AbstractModel): """DeleteSecurityGroupPolicies返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, param...
class DeleteSecurityGroupPoliciesResponse(AbstractModel):
"""DeleteSecurityGroupPolicies返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId")
self.SecurityGroupId = params.get("SecurityGroupId") if params.get("SecurityGroupPolicySet") is not None: self.SecurityGroupPolicySet = SecurityGroupPolicySet() self.SecurityGroupPolicySet._deserialize(params.get("SecurityGroupPolicySet")) class DeleteSecurityGroupPoliciesResponse(Abstr...
63
64
96
9
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DeleteSecurityGroupPoliciesResponse
DeleteSecurityGroupPoliciesResponse
4,682
4,696
4,682
4,682
2a219545cbc893c928eb731759679e6c083d7d92
bigcode/the-stack
train
6437c2a8bb69414d02e30420
train
class
class SecurityGroupPolicySet(AbstractModel): """安全组规则集合 """ def __init__(self): """ :param Version: 安全组规则当前版本。用户每次更新安全规则版本会自动加1,防止更新的路由规则已过期,不填不考虑冲突。 :type Version: str :param Egress: 出站规则。 :type Egress: list of SecurityGroupPolicy :param Ingress: 入站规则。 ...
class SecurityGroupPolicySet(AbstractModel):
"""安全组规则集合 """ def __init__(self): """ :param Version: 安全组规则当前版本。用户每次更新安全规则版本会自动加1,防止更新的路由规则已过期,不填不考虑冲突。 :type Version: str :param Egress: 出站规则。 :type Egress: list of SecurityGroupPolicy :param Ingress: 入站规则。 :type Ingress: list of SecurityGroupPolic...
Id") if params.get("AddressTemplate") is not None: self.AddressTemplate = AddressTemplateSpecification() self.AddressTemplate._deserialize(params.get("AddressTemplate")) self.Action = params.get("Action") self.PolicyDescription = params.get("PolicyDescription") se...
75
75
251
8
67
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
SecurityGroupPolicySet
SecurityGroupPolicySet
13,954
13,986
13,954
13,954
0cfcf59b0dbab6c863f78bbc857f671261e1522f
bigcode/the-stack
train
fce53ec21b10392c4b4c2abb
train
class
class CreateDirectConnectGatewayRequest(AbstractModel): """CreateDirectConnectGateway请求参数结构体 """ def __init__(self): """ :param DirectConnectGatewayName: 专线网关名称 :type DirectConnectGatewayName: str :param NetworkType: 关联网络类型,可选值: <li>VPC - 私有网络</li> <li>CCN - 云联网</li> ...
class CreateDirectConnectGatewayRequest(AbstractModel):
"""CreateDirectConnectGateway请求参数结构体 """ def __init__(self): """ :param DirectConnectGatewayName: 专线网关名称 :type DirectConnectGatewayName: str :param NetworkType: 关联网络类型,可选值: <li>VPC - 私有网络</li> <li>CCN - 云联网</li> :type NetworkType: str :param NetworkInstanceI...
obj._deserialize(item) self.Routes.append(obj) class CreateDirectConnectGatewayCcnRoutesResponse(AbstractModel): """CreateDirectConnectGatewayCcnRoutes返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 ...
124
124
414
9
115
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
CreateDirectConnectGatewayRequest
CreateDirectConnectGatewayRequest
2,492
2,527
2,492
2,492
29ae807e04292adfe8740cd59a24a3d8f052e434
bigcode/the-stack
train
eba310aaba5185dab03553ac
train
class
class ModifyVpnGatewayCcnRoutesRequest(AbstractModel): """ModifyVpnGatewayCcnRoutes请求参数结构体 """ def __init__(self): """ :param VpnGatewayId: VPN网关实例ID :type VpnGatewayId: str :param Routes: 云联网路由(IDC网段)列表 :type Routes: list of VpngwCcnRoutes """ self....
class ModifyVpnGatewayCcnRoutesRequest(AbstractModel):
"""ModifyVpnGatewayCcnRoutes请求参数结构体 """ def __init__(self): """ :param VpnGatewayId: VPN网关实例ID :type VpnGatewayId: str :param Routes: 云联网路由(IDC网段)列表 :type Routes: list of VpngwCcnRoutes """ self.VpnGatewayId = None self.Routes = None de...
次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ModifyVpnGatewayCcnRoutesRequest(AbstractModel):
64
64
178
11
53
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ModifyVpnGatewayCcnRoutesRequest
ModifyVpnGatewayCcnRoutesRequest
11,962
11,985
11,962
11,962
c8fd31e5818d66cb2e24e3e2f5b98a1de4490d77
bigcode/the-stack
train
438a8dbe9428774f2fc4ae39
train
class
class ReleaseIp6AddressesBandwidthRequest(AbstractModel): """ReleaseIp6AddressesBandwidth请求参数结构体 """ def __init__(self): """ :param Ip6Addresses: IPV6地址。Ip6Addresses和Ip6AddressIds必须且只能传一个 :type Ip6Addresses: list of str :param Ip6AddressIds: IPV6地址对应的唯一ID,形如eip-xxxxxxxx。Ip6...
class ReleaseIp6AddressesBandwidthRequest(AbstractModel):
"""ReleaseIp6AddressesBandwidth请求参数结构体 """ def __init__(self): """ :param Ip6Addresses: IPV6地址。Ip6Addresses和Ip6AddressIds必须且只能传一个 :type Ip6Addresses: list of str :param Ip6AddressIds: IPV6地址对应的唯一ID,形如eip-xxxxxxxx。Ip6Addresses和Ip6AddressIds必须且只能传一个。 :type Ip6AddressI...
:type RequestId: str """ self.TaskId = None self.RequestId = None def _deserialize(self, params): self.TaskId = params.get("TaskId") self.RequestId = params.get("RequestId") class ReleaseIp6AddressesBandwidthRequest(AbstractModel):
64
64
177
10
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ReleaseIp6AddressesBandwidthRequest
ReleaseIp6AddressesBandwidthRequest
12,800
12,818
12,800
12,800
2953c12a5b7008fcdd565f88ff61c1d3bcdb1b1a
bigcode/the-stack
train
b3306be934865b27714d3d52
train
class
class ModifyDirectConnectGatewayAttributeResponse(AbstractModel): """ModifyDirectConnectGatewayAttribute返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deseria...
class ModifyDirectConnectGatewayAttributeResponse(AbstractModel):
"""ModifyDirectConnectGatewayAttribute返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId...
.DirectConnectGatewayId = params.get("DirectConnectGatewayId") self.DirectConnectGatewayName = params.get("DirectConnectGatewayName") self.CcnRouteType = params.get("CcnRouteType") self.ModeType = params.get("ModeType") class ModifyDirectConnectGatewayAttributeResponse(AbstractModel):
64
64
98
10
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ModifyDirectConnectGatewayAttributeResponse
ModifyDirectConnectGatewayAttributeResponse
10,911
10,925
10,911
10,911
e726f2b7486791b35772fd03630aca8d6e8c5aca
bigcode/the-stack
train
e76bc41f13f3f2d7a04a38bd
train
class
class DescribeCrossBorderComplianceRequest(AbstractModel): """DescribeCrossBorderCompliance请求参数结构体 """ def __init__(self): """ :param ServiceProvider: (精确匹配)服务商,可选值:`UNICOM`。 :type ServiceProvider: str :param ComplianceId: (精确匹配)合规化审批单`ID`。 :type ComplianceId: int ...
class DescribeCrossBorderComplianceRequest(AbstractModel):
"""DescribeCrossBorderCompliance请求参数结构体 """ def __init__(self): """ :param ServiceProvider: (精确匹配)服务商,可选值:`UNICOM`。 :type ServiceProvider: str :param ComplianceId: (精确匹配)合规化审批单`ID`。 :type ComplianceId: int :param Company: (模糊查询)公司名称。 :type Company: s...
DescribeClassicLinkInstances返回参数结构体 """ def __init__(self): """ :param TotalCount: 符合条件的实例数量。 :type TotalCount: int :param ClassicLinkInstanceSet: 私有网络和基础网络互通设备。 :type ClassicLinkInstanceSet: list of ClassicLinkInstance :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要...
235
235
784
9
226
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DescribeCrossBorderComplianceRequest
DescribeCrossBorderComplianceRequest
5,811
5,885
5,811
5,811
b8c92379ac2fad7e79c633af2e136b199ff69d1a
bigcode/the-stack
train
4fbe1533e14c78d92e3bb9f0
train
class
class AddBandwidthPackageResourcesRequest(AbstractModel): """AddBandwidthPackageResources请求参数结构体 """ def __init__(self): """ :param ResourceIds: 资源唯一ID,当前支持EIP资源和LB资源,形如'eip-xxxx', 'lb-xxxx' :type ResourceIds: list of str :param BandwidthPackageId: 带宽包唯一标识ID,形如'bwp-xxxx' ...
class AddBandwidthPackageResourcesRequest(AbstractModel):
"""AddBandwidthPackageResources请求参数结构体 """ def __init__(self): """ :param ResourceIds: 资源唯一ID,当前支持EIP资源和LB资源,形如'eip-xxxx', 'lb-xxxx' :type ResourceIds: list of str :param BandwidthPackageId: 带宽包唯一标识ID,形如'bwp-xxxx' :type BandwidthPackageId: str :param Network...
:param AttributeName: 属性名 :type AttributeName: str :param AttributeValues: 属性值 :type AttributeValues: list of str """ self.AttributeName = None self.AttributeValues = None def _deserialize(self, params): self.AttributeName = params.get("AttributeName...
91
91
305
9
82
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
AddBandwidthPackageResourcesRequest
AddBandwidthPackageResourcesRequest
83
113
83
83
370e0a77772e273bed3988a4a3ad76aa004bb019
bigcode/the-stack
train
cd73e791b3265d7290779d1d
train
class
class InquirePriceCreateDirectConnectGatewayRequest(AbstractModel): """InquirePriceCreateDirectConnectGateway请求参数结构体 """
class InquirePriceCreateDirectConnectGatewayRequest(AbstractModel):
"""InquirePriceCreateDirectConnectGateway请求参数结构体 """
self.IPSECSaLifetimeSeconds = params.get("IPSECSaLifetimeSeconds") self.PfsDhGroup = params.get("PfsDhGroup") self.IPSECSaLifetimeTraffic = params.get("IPSECSaLifetimeTraffic") class InquirePriceCreateDirectConnectGatewayRequest(AbstractModel):
64
64
28
12
52
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
InquirePriceCreateDirectConnectGatewayRequest
InquirePriceCreateDirectConnectGatewayRequest
9,787
9,790
9,787
9,787
4d23c9301129b2a877d91565a75a9ada51f3568e
bigcode/the-stack
train
a2bf69c991aaa20e8ba2052c
train
class
class DescribeVpcResourceDashboardResponse(AbstractModel): """DescribeVpcResourceDashboard返回参数结构体 """ def __init__(self): """ :param ResourceDashboardSet: 资源对象列表。 :type ResourceDashboardSet: list of ResourceDashboard :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 Request...
class DescribeVpcResourceDashboardResponse(AbstractModel):
"""DescribeVpcResourceDashboard返回参数结构体 """ def __init__(self): """ :param ResourceDashboardSet: 资源对象列表。 :type ResourceDashboardSet: list of ResourceDashboard :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.R...
实例ID,例如:vpc-f1xjkw1b。 :type VpcIds: list of str """ self.VpcIds = None def _deserialize(self, params): self.VpcIds = params.get("VpcIds") class DescribeVpcResourceDashboardResponse(AbstractModel):
64
64
179
9
55
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DescribeVpcResourceDashboardResponse
DescribeVpcResourceDashboardResponse
8,199
8,222
8,199
8,199
3b00af6217ecdfc945cfdbacb86424f221351d7b
bigcode/the-stack
train
d09d509e72f3635eee049396
train
class
class ProductQuota(AbstractModel): """描述网络中心每个产品的配额信息 """ def __init__(self): """ :param QuotaId: 产品配额ID :type QuotaId: str :param QuotaName: 产品配额名称 :type QuotaName: str :param QuotaCurrent: 产品当前配额 :type QuotaCurrent: int :param QuotaLimit: 产...
class ProductQuota(AbstractModel):
"""描述网络中心每个产品的配额信息 """ def __init__(self): """ :param QuotaId: 产品配额ID :type QuotaId: str :param QuotaName: 产品配额名称 :type QuotaName: str :param QuotaCurrent: 产品当前配额 :type QuotaCurrent: int :param QuotaLimit: 产品配额上限 :type QuotaLimit: int...
Address") self.Primary = params.get("Primary") self.PublicIpAddress = params.get("PublicIpAddress") self.AddressId = params.get("AddressId") self.Description = params.get("Description") self.IsWanIpBlocked = params.get("IsWanIpBlocked") self.State = params.get("State") cl...
74
74
249
6
68
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ProductQuota
ProductQuota
12,640
12,670
12,640
12,640
78b5feae3d867eddcd5e03f4c11310d9398decad
bigcode/the-stack
train
b5d8de7ad1528044fa722648
train
class
class CreateAddressTemplateRequest(AbstractModel): """CreateAddressTemplate请求参数结构体 """ def __init__(self): """ :param AddressTemplateName: IP地址模版名称 :type AddressTemplateName: str :param Addresses: 地址信息,支持 IP、CIDR、IP 范围。 :type Addresses: list of str """ ...
class CreateAddressTemplateRequest(AbstractModel):
"""CreateAddressTemplate请求参数结构体 """ def __init__(self): """ :param AddressTemplateName: IP地址模版名称 :type AddressTemplateName: str :param Addresses: 地址信息,支持 IP、CIDR、IP 范围。 :type Addresses: list of str """ self.AddressTemplateName = None self.Add...
def _deserialize(self, params): if params.get("AddressTemplateGroup") is not None: self.AddressTemplateGroup = AddressTemplateGroup() self.AddressTemplateGroup._deserialize(params.get("AddressTemplateGroup")) self.RequestId = params.get("RequestId") class CreateAddressTemplat...
64
64
127
8
56
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
CreateAddressTemplateRequest
CreateAddressTemplateRequest
1,947
1,965
1,947
1,947
e38c7ccf4c22e71419727e514883e0b1c5afc390
bigcode/the-stack
train
d20ed3a9e591ef5da016f91f
train
class
class DisassociateDirectConnectGatewayNatGatewayRequest(AbstractModel): """DisassociateDirectConnectGatewayNatGateway请求参数结构体 """ def __init__(self): """ :param VpcId: 专线网关ID。 :type VpcId: str :param NatGatewayId: NAT网关ID。 :type NatGatewayId: str :param Direc...
class DisassociateDirectConnectGatewayNatGatewayRequest(AbstractModel):
"""DisassociateDirectConnectGatewayNatGateway请求参数结构体 """ def __init__(self): """ :param VpcId: 专线网关ID。 :type VpcId: str :param NatGatewayId: NAT网关ID。 :type NatGatewayId: str :param DirectConnectGatewayId: VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 :type ...
请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DisassociateDirectConnectGatewayNatGatewayRequest(AbstractModel):
64
64
193
12
52
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DisassociateDirectConnectGatewayNatGatewayRequest
DisassociateDirectConnectGatewayNatGatewayRequest
9,004
9,026
9,004
9,004
4dc1fcec9d5255ca371ff950fbadf7f70a86d7b2
bigcode/the-stack
train
44349014763864e9eeec0c02
train
class
class DisassociateNatGatewayAddressResponse(AbstractModel): """DisassociateNatGatewayAddress返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, p...
class DisassociateNatGatewayAddressResponse(AbstractModel):
"""DisassociateNatGatewayAddress返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId")
""" self.NatGatewayId = None self.PublicIpAddresses = None def _deserialize(self, params): self.NatGatewayId = params.get("NatGatewayId") self.PublicIpAddresses = params.get("PublicIpAddresses") class DisassociateNatGatewayAddressResponse(AbstractModel):
64
64
98
10
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DisassociateNatGatewayAddressResponse
DisassociateNatGatewayAddressResponse
9,067
9,081
9,067
9,067
5891d85024333e2b8c4ddbc69c1d9a24b3cf2430
bigcode/the-stack
train
070259d049590170c9006b41
train
class
class DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse(AbstractModel): """DescribeNatGatewayDestinationIpPortTranslationNatRules返回参数结构体 """ def __init__(self): """ :param NatGatewayDestinationIpPortTranslationNatRuleSet: NAT网关端口转发规则对象数组。 :type NatGatewayDestinationIpP...
class DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse(AbstractModel):
"""DescribeNatGatewayDestinationIpPortTranslationNatRules返回参数结构体 """ def __init__(self): """ :param NatGatewayDestinationIpPortTranslationNatRuleSet: NAT网关端口转发规则对象数组。 :type NatGatewayDestinationIpPortTranslationNatRuleSet: list of NatGatewayDestinationIpPortTranslationNatRule ...
): self.NatGatewayIds = params.get("NatGatewayIds") if params.get("Filters") is not None: self.Filters = [] for item in params.get("Filters"): obj = Filter() obj._deserialize(item) self.Filters.append(obj) self.Offset = para...
90
90
303
14
76
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse
DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse
6,890
6,917
6,890
6,890
2ee12fad90cd5c4a161bb2f9a13424954047c137
bigcode/the-stack
train
e704743ff0835bb4d9055e99
train
class
class ResetNatGatewayConnectionRequest(AbstractModel): """ResetNatGatewayConnection请求参数结构体 """ def __init__(self): """ :param NatGatewayId: NAT网关ID。 :type NatGatewayId: str :param MaxConcurrentConnection: NAT网关并发连接上限,形如:1000000、3000000、10000000。 :type MaxConcurrentC...
class ResetNatGatewayConnectionRequest(AbstractModel):
"""ResetNatGatewayConnection请求参数结构体 """ def __init__(self): """ :param NatGatewayId: NAT网关ID。 :type NatGatewayId: str :param MaxConcurrentConnection: NAT网关并发连接上限,形如:1000000、3000000、10000000。 :type MaxConcurrentConnection: int """ self.NatGatewayId = ...
ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class ResetNatGatewayConnectionRequest(AbstractModel):
64
64
146
9
55
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ResetNatGatewayConnectionRequest
ResetNatGatewayConnectionRequest
13,219
13,237
13,219
13,219
ae5096e835d9e8ccb6f9606c11f2757d62976b98
bigcode/the-stack
train
6043bafd56d0cc0520c03928
train
class
class DescribeSecurityGroupAssociationStatisticsResponse(AbstractModel): """DescribeSecurityGroupAssociationStatistics返回参数结构体 """ def __init__(self): """ :param SecurityGroupAssociationStatisticsSet: 安全组关联实例统计。 :type SecurityGroupAssociationStatisticsSet: list of SecurityGroupAssoc...
class DescribeSecurityGroupAssociationStatisticsResponse(AbstractModel):
"""DescribeSecurityGroupAssociationStatistics返回参数结构体 """ def __init__(self): """ :param SecurityGroupAssociationStatisticsSet: 安全组关联实例统计。 :type SecurityGroupAssociationStatisticsSet: list of SecurityGroupAssociationStatistics :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求...
33ocnj9n,可通过DescribeSecurityGroups获取。 :type SecurityGroupIds: list of str """ self.SecurityGroupIds = None def _deserialize(self, params): self.SecurityGroupIds = params.get("SecurityGroupIds") class DescribeSecurityGroupAssociationStatisticsResponse(AbstractModel):
64
64
201
10
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DescribeSecurityGroupAssociationStatisticsResponse
DescribeSecurityGroupAssociationStatisticsResponse
7,491
7,514
7,491
7,491
47060a2fa9a5968f09f0154cb8082eea75a88c14
bigcode/the-stack
train
dfcabd5947981d05f491a36c
train
class
class ModifyAddressTemplateGroupAttributeResponse(AbstractModel): """ModifyAddressTemplateGroupAttribute返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deseria...
class ModifyAddressTemplateGroupAttributeResponse(AbstractModel):
"""ModifyAddressTemplateGroupAttribute返回参数结构体 """ def __init__(self): """ :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId...
= None def _deserialize(self, params): self.AddressTemplateGroupId = params.get("AddressTemplateGroupId") self.AddressTemplateGroupName = params.get("AddressTemplateGroupName") self.AddressTemplateIds = params.get("AddressTemplateIds") class ModifyAddressTemplateGroupAttributeResponse(Abs...
64
64
98
10
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
ModifyAddressTemplateGroupAttributeResponse
ModifyAddressTemplateGroupAttributeResponse
10,565
10,579
10,565
10,565
9f47c1ef2be9b3218def6ad52105dd2cdbb51db6
bigcode/the-stack
train
7537e8f8f9239ef922d1e30e
train
class
class AddIp6RulesResponse(AbstractModel): """AddIp6Rules返回参数结构体 """ def __init__(self): """ :param Ip6RuleSet: IPV6转换规则唯一ID数组,形如rule6-xxxxxxxx :type Ip6RuleSet: list of str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """...
class AddIp6RulesResponse(AbstractModel):
"""AddIp6Rules返回参数结构体 """ def __init__(self): """ :param Ip6RuleSet: IPV6转换规则唯一ID数组,形如rule6-xxxxxxxx :type Ip6RuleSet: list of str :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.Ip6RuleSet = None se...
Infos = [] for item in params.get("Ip6RuleInfos"): obj = Ip6RuleInfo() obj._deserialize(item) self.Ip6RuleInfos.append(obj) self.Ip6RuleName = params.get("Ip6RuleName") class AddIp6RulesResponse(AbstractModel):
64
64
157
9
55
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
AddIp6RulesResponse
AddIp6RulesResponse
163
181
163
163
7bdd4fb1b3e936b7e64ab0d3d6f150a9e7612569
bigcode/the-stack
train
b94674167cc68c94929d72eb
train
class
class VpngwCcnRoutes(AbstractModel): """VPN网关云联网路由信息 """ def __init__(self): """ :param RouteId: 路由信息ID :type RouteId: str :param Status: 路由信息是否启用 ENABLE:启用该路由 DISABLE:不启用该路由 :type Status: str """ self.RouteId = None self.Status = None ...
class VpngwCcnRoutes(AbstractModel):
"""VPN网关云联网路由信息 """ def __init__(self): """ :param RouteId: 路由信息ID :type RouteId: str :param Status: 路由信息是否启用 ENABLE:启用该路由 DISABLE:不启用该路由 :type Status: str """ self.RouteId = None self.Status = None def _deserialize(self, params): ...
None self.Cname = None self.Name = None def _deserialize(self, params): self.Bandwidth = params.get("Bandwidth") self.Cname = params.get("Cname") self.Name = params.get("Name") class VpngwCcnRoutes(AbstractModel):
64
64
133
10
54
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
VpngwCcnRoutes
VpngwCcnRoutes
14,853
14,873
14,853
14,853
e0659b1ba84c4e42f622dea4ee1fa653ec438e19
bigcode/the-stack
train
7bf1c6858305d8511f490cac
train
class
class DeleteCustomerGatewayRequest(AbstractModel): """DeleteCustomerGateway请求参数结构体 """ def __init__(self): """ :param CustomerGatewayId: 对端网关ID,例如:cgw-2wqq41m9,可通过DescribeCustomerGateways接口查询对端网关。 :type CustomerGatewayId: str """ self.CustomerGatewayId = None ...
class DeleteCustomerGatewayRequest(AbstractModel):
"""DeleteCustomerGateway请求参数结构体 """ def __init__(self): """ :param CustomerGatewayId: 对端网关ID,例如:cgw-2wqq41m9,可通过DescribeCustomerGateways接口查询对端网关。 :type CustomerGatewayId: str """ self.CustomerGatewayId = None def _deserialize(self, params): self.Custom...
请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self.RequestId = None def _deserialize(self, params): self.RequestId = params.get("RequestId") class DeleteCustomerGatewayRequest(AbstractModel):
64
64
105
8
56
dyllllll/tencentcloud-sdk-python
tencentcloud/vpc/v20170312/models.py
Python
DeleteCustomerGatewayRequest
DeleteCustomerGatewayRequest
4,157
4,171
4,157
4,157
1c3852543cfd955b252fbc3f6a5e0b9d48917a04
bigcode/the-stack
train