partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
ProjectServiceManager.update
Update an object on the server. Args: id: ID of the object to update (can be None if not required) new_data: the update data for the object **kwargs: Extra options to send to the server (e.g. sudo) Returns: dict: The new object data (*not* a RESTObject) ...
gitlab/v4/objects.py
def update(self, id=None, new_data={}, **kwargs): """Update an object on the server. Args: id: ID of the object to update (can be None if not required) new_data: the update data for the object **kwargs: Extra options to send to the server (e.g. sudo) Returns...
def update(self, id=None, new_data={}, **kwargs): """Update an object on the server. Args: id: ID of the object to update (can be None if not required) new_data: the update data for the object **kwargs: Extra options to send to the server (e.g. sudo) Returns...
[ "Update", "an", "object", "on", "the", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3086-L3102
[ "def", "update", "(", "self", ",", "id", "=", "None", ",", "new_data", "=", "{", "}", ",", "*", "*", "kwargs", ")", ":", "super", "(", "ProjectServiceManager", ",", "self", ")", ".", "update", "(", "id", ",", "new_data", ",", "*", "*", "kwargs", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
ProjectExport.download
Download the archive of a project export. Args: streamed (bool): If True the data will be processed by chunks of `chunk_size` and each chunk is passed to `action` for reatment action (callable): Callable responsible of dealing with chunk of ...
gitlab/v4/objects.py
def download(self, streamed=False, action=None, chunk_size=1024, **kwargs): """Download the archive of a project export. Args: streamed (bool): If True the data will be processed by chunks of `chunk_size` and each chunk is passed to `action` for reatment ...
def download(self, streamed=False, action=None, chunk_size=1024, **kwargs): """Download the archive of a project export. Args: streamed (bool): If True the data will be processed by chunks of `chunk_size` and each chunk is passed to `action` for reatment ...
[ "Download", "the", "archive", "of", "a", "project", "export", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3212-L3234
[ "def", "download", "(", "self", ",", "streamed", "=", "False", ",", "action", "=", "None", ",", "chunk_size", "=", "1024", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/export/download'", "%", "self", ".", "project_id", "result", "=", "s...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.repository_tree
Return a list of files in the repository. Args: path (str): Path of the top folder (/ by default) ref (str): Reference to a commit or branch recursive (bool): Whether to get the tree recursively all (bool): If True, return all the items, without pagination ...
gitlab/v4/objects.py
def repository_tree(self, path='', ref='', recursive=False, **kwargs): """Return a list of files in the repository. Args: path (str): Path of the top folder (/ by default) ref (str): Reference to a commit or branch recursive (bool): Whether to get the tree recursivel...
def repository_tree(self, path='', ref='', recursive=False, **kwargs): """Return a list of files in the repository. Args: path (str): Path of the top folder (/ by default) ref (str): Reference to a commit or branch recursive (bool): Whether to get the tree recursivel...
[ "Return", "a", "list", "of", "files", "in", "the", "repository", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3300-L3328
[ "def", "repository_tree", "(", "self", ",", "path", "=", "''", ",", "ref", "=", "''", ",", "recursive", "=", "False", ",", "*", "*", "kwargs", ")", ":", "gl_path", "=", "'/projects/%s/repository/tree'", "%", "self", ".", "get_id", "(", ")", "query_data",...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.repository_blob
Return a file by blob SHA. Args: sha(str): ID of the blob **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server failed to perform the request R...
gitlab/v4/objects.py
def repository_blob(self, sha, **kwargs): """Return a file by blob SHA. Args: sha(str): ID of the blob **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: I...
def repository_blob(self, sha, **kwargs): """Return a file by blob SHA. Args: sha(str): ID of the blob **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: I...
[ "Return", "a", "file", "by", "blob", "SHA", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3332-L3348
[ "def", "repository_blob", "(", "self", ",", "sha", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/repository/blobs/%s'", "%", "(", "self", ".", "get_id", "(", ")", ",", "sha", ")", "return", "self", ".", "manager", ".", "gitlab", ".", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.repository_compare
Return a diff between two branches/commits. Args: from_(str): Source branch/SHA to(str): Destination branch/SHA **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct Gitl...
gitlab/v4/objects.py
def repository_compare(self, from_, to, **kwargs): """Return a diff between two branches/commits. Args: from_(str): Source branch/SHA to(str): Destination branch/SHA **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenti...
def repository_compare(self, from_, to, **kwargs): """Return a diff between two branches/commits. Args: from_(str): Source branch/SHA to(str): Destination branch/SHA **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenti...
[ "Return", "a", "diff", "between", "two", "branches", "/", "commits", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3380-L3398
[ "def", "repository_compare", "(", "self", ",", "from_", ",", "to", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/repository/compare'", "%", "self", ".", "get_id", "(", ")", "query_data", "=", "{", "'from'", ":", "from_", ",", "'to'", ":"...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.repository_contributors
Return a list of contributors for the project. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool): If set to False an...
gitlab/v4/objects.py
def repository_contributors(self, **kwargs): """Return a list of contributors for the project. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts wit...
def repository_contributors(self, **kwargs): """Return a list of contributors for the project. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts wit...
[ "Return", "a", "list", "of", "contributors", "for", "the", "project", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3402-L3421
[ "def", "repository_contributors", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/repository/contributors'", "%", "self", ".", "get_id", "(", ")", "return", "self", ".", "manager", ".", "gitlab", ".", "http_list", "(", "path", ","...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.create_fork_relation
Create a forked from/to relation between existing projects. Args: forked_from_id (int): The ID of the project that was forked from **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
gitlab/v4/objects.py
def create_fork_relation(self, forked_from_id, **kwargs): """Create a forked from/to relation between existing projects. Args: forked_from_id (int): The ID of the project that was forked from **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
def create_fork_relation(self, forked_from_id, **kwargs): """Create a forked from/to relation between existing projects. Args: forked_from_id (int): The ID of the project that was forked from **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
[ "Create", "a", "forked", "from", "/", "to", "relation", "between", "existing", "projects", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3457-L3469
[ "def", "create_fork_relation", "(", "self", ",", "forked_from_id", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/fork/%s'", "%", "(", "self", ".", "get_id", "(", ")", ",", "forked_from_id", ")", "self", ".", "manager", ".", "gitlab", ".", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.delete_fork_relation
Delete a forked relation between existing projects. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server failed to perform the request
gitlab/v4/objects.py
def delete_fork_relation(self, **kwargs): """Delete a forked relation between existing projects. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the ser...
def delete_fork_relation(self, **kwargs): """Delete a forked relation between existing projects. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the ser...
[ "Delete", "a", "forked", "relation", "between", "existing", "projects", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3473-L3484
[ "def", "delete_fork_relation", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/fork'", "%", "self", ".", "get_id", "(", ")", "self", ".", "manager", ".", "gitlab", ".", "http_delete", "(", "path", ",", "*", "*", "kwargs", ")...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.delete_merged_branches
Delete merged branches. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server failed to perform the request
gitlab/v4/objects.py
def delete_merged_branches(self, **kwargs): """Delete merged branches. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server failed to perform the ...
def delete_merged_branches(self, **kwargs): """Delete merged branches. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server failed to perform the ...
[ "Delete", "merged", "branches", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3488-L3499
[ "def", "delete_merged_branches", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/repository/merged_branches'", "%", "self", ".", "get_id", "(", ")", "self", ".", "manager", ".", "gitlab", ".", "http_delete", "(", "path", ",", "*",...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.languages
Get languages used in the project with percentage value. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server failed to perform the request
gitlab/v4/objects.py
def languages(self, **kwargs): """Get languages used in the project with percentage value. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server faile...
def languages(self, **kwargs): """Get languages used in the project with percentage value. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server faile...
[ "Get", "languages", "used", "in", "the", "project", "with", "percentage", "value", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3503-L3514
[ "def", "languages", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/languages'", "%", "self", ".", "get_id", "(", ")", "return", "self", ".", "manager", ".", "gitlab", ".", "http_get", "(", "path", ",", "*", "*", "kwargs", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.share
Share the project with a group. Args: group_id (int): ID of the group. group_access (int): Access level for the group. **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
gitlab/v4/objects.py
def share(self, group_id, group_access, expires_at=None, **kwargs): """Share the project with a group. Args: group_id (int): ID of the group. group_access (int): Access level for the group. **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
def share(self, group_id, group_access, expires_at=None, **kwargs): """Share the project with a group. Args: group_id (int): ID of the group. group_access (int): Access level for the group. **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
[ "Share", "the", "project", "with", "a", "group", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3583-L3599
[ "def", "share", "(", "self", ",", "group_id", ",", "group_access", ",", "expires_at", "=", "None", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/share'", "%", "self", ".", "get_id", "(", ")", "data", "=", "{", "'group_id'", ":", "group...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.unshare
Delete a shared project link within a group. Args: group_id (int): ID of the group. **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server failed to p...
gitlab/v4/objects.py
def unshare(self, group_id, **kwargs): """Delete a shared project link within a group. Args: group_id (int): ID of the group. **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
def unshare(self, group_id, **kwargs): """Delete a shared project link within a group. Args: group_id (int): ID of the group. **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
[ "Delete", "a", "shared", "project", "link", "within", "a", "group", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3603-L3615
[ "def", "unshare", "(", "self", ",", "group_id", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/share/%s'", "%", "(", "self", ".", "get_id", "(", ")", ",", "group_id", ")", "self", ".", "manager", ".", "gitlab", ".", "http_delete", "(", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.trigger_pipeline
Trigger a CI build. See https://gitlab.com/help/ci/triggers/README.md#trigger-a-build Args: ref (str): Commit to build; can be a branch name or a tag token (str): The trigger token variables (dict): Variables passed to the build script **kwargs: Extra op...
gitlab/v4/objects.py
def trigger_pipeline(self, ref, token, variables={}, **kwargs): """Trigger a CI build. See https://gitlab.com/help/ci/triggers/README.md#trigger-a-build Args: ref (str): Commit to build; can be a branch name or a tag token (str): The trigger token variables ...
def trigger_pipeline(self, ref, token, variables={}, **kwargs): """Trigger a CI build. See https://gitlab.com/help/ci/triggers/README.md#trigger-a-build Args: ref (str): Commit to build; can be a branch name or a tag token (str): The trigger token variables ...
[ "Trigger", "a", "CI", "build", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3620-L3639
[ "def", "trigger_pipeline", "(", "self", ",", "ref", ",", "token", ",", "variables", "=", "{", "}", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/trigger/pipeline'", "%", "self", ".", "get_id", "(", ")", "post_data", "=", "{", "'ref'", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.housekeeping
Start the housekeeping task. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabHousekeepingError: If the server failed to perform the request
gitlab/v4/objects.py
def housekeeping(self, **kwargs): """Start the housekeeping task. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabHousekeepingError: If the server failed to perform the...
def housekeeping(self, **kwargs): """Start the housekeeping task. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabHousekeepingError: If the server failed to perform the...
[ "Start", "the", "housekeeping", "task", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3643-L3655
[ "def", "housekeeping", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/housekeeping'", "%", "self", ".", "get_id", "(", ")", "self", ".", "manager", ".", "gitlab", ".", "http_post", "(", "path", ",", "*", "*", "kwargs", ")" ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.upload
Upload the specified file into the project. .. note:: Either ``filedata`` or ``filepath`` *MUST* be specified. Args: filename (str): The name of the file being uploaded filedata (bytes): The raw data of the file being uploaded filepath (str): The path t...
gitlab/v4/objects.py
def upload(self, filename, filedata=None, filepath=None, **kwargs): """Upload the specified file into the project. .. note:: Either ``filedata`` or ``filepath`` *MUST* be specified. Args: filename (str): The name of the file being uploaded filedata (bytes):...
def upload(self, filename, filedata=None, filepath=None, **kwargs): """Upload the specified file into the project. .. note:: Either ``filedata`` or ``filepath`` *MUST* be specified. Args: filename (str): The name of the file being uploaded filedata (bytes):...
[ "Upload", "the", "specified", "file", "into", "the", "project", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3660-L3708
[ "def", "upload", "(", "self", ",", "filename", ",", "filedata", "=", "None", ",", "filepath", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "filepath", "is", "None", "and", "filedata", "is", "None", ":", "raise", "GitlabUploadError", "(", "\"No...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.snapshot
Return a snapshot of the repository. Args: wiki (bool): If True return the wiki repository streamed (bool): If True the data will be processed by chunks of `chunk_size` and each chunk is passed to `action` for treatment. action (callable): Cal...
gitlab/v4/objects.py
def snapshot(self, wiki=False, streamed=False, action=None, chunk_size=1024, **kwargs): """Return a snapshot of the repository. Args: wiki (bool): If True return the wiki repository streamed (bool): If True the data will be processed by chunks of ...
def snapshot(self, wiki=False, streamed=False, action=None, chunk_size=1024, **kwargs): """Return a snapshot of the repository. Args: wiki (bool): If True return the wiki repository streamed (bool): If True the data will be processed by chunks of ...
[ "Return", "a", "snapshot", "of", "the", "repository", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3712-L3736
[ "def", "snapshot", "(", "self", ",", "wiki", "=", "False", ",", "streamed", "=", "False", ",", "action", "=", "None", ",", "chunk_size", "=", "1024", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/snapshot'", "%", "self", ".", "get_id",...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.search
Search the project resources matching the provided string.' Args: scope (str): Scope of the search search (str): Search string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
gitlab/v4/objects.py
def search(self, scope, search, **kwargs): """Search the project resources matching the provided string.' Args: scope (str): Scope of the search search (str): Search string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabA...
def search(self, scope, search, **kwargs): """Search the project resources matching the provided string.' Args: scope (str): Scope of the search search (str): Search string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabA...
[ "Search", "the", "project", "resources", "matching", "the", "provided", "string", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3740-L3757
[ "def", "search", "(", "self", ",", "scope", ",", "search", ",", "*", "*", "kwargs", ")", ":", "data", "=", "{", "'scope'", ":", "scope", ",", "'search'", ":", "search", "}", "path", "=", "'/projects/%s/search'", "%", "self", ".", "get_id", "(", ")", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.mirror_pull
Start the pull mirroring process for the project. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server failed to perform the request
gitlab/v4/objects.py
def mirror_pull(self, **kwargs): """Start the pull mirroring process for the project. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server failed ...
def mirror_pull(self, **kwargs): """Start the pull mirroring process for the project. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabCreateError: If the server failed ...
[ "Start", "the", "pull", "mirroring", "process", "for", "the", "project", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3761-L3772
[ "def", "mirror_pull", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/mirror/pull'", "%", "self", ".", "get_id", "(", ")", "self", ".", "manager", ".", "gitlab", ".", "http_post", "(", "path", ",", "*", "*", "kwargs", ")" ]
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Project.transfer_project
Transfer a project to the given namespace ID Args: to_namespace (str): ID or path of the namespace to transfer the project to **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
gitlab/v4/objects.py
def transfer_project(self, to_namespace, **kwargs): """Transfer a project to the given namespace ID Args: to_namespace (str): ID or path of the namespace to transfer the project to **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
def transfer_project(self, to_namespace, **kwargs): """Transfer a project to the given namespace ID Args: to_namespace (str): ID or path of the namespace to transfer the project to **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
[ "Transfer", "a", "project", "to", "the", "given", "namespace", "ID" ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3776-L3791
[ "def", "transfer_project", "(", "self", ",", "to_namespace", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/projects/%s/transfer'", "%", "(", "self", ".", "id", ",", ")", "self", ".", "manager", ".", "gitlab", ".", "http_put", "(", "path", ",", "po...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
ProjectManager.import_project
Import a project from an archive file. Args: file: Data or file object containing the project path (str): Name and path for the new project namespace (str): The ID or path of the namespace that the project will be imported to overwrite (bool): If ...
gitlab/v4/objects.py
def import_project(self, file, path, namespace=None, overwrite=False, override_params=None, **kwargs): """Import a project from an archive file. Args: file: Data or file object containing the project path (str): Name and path for the new project ...
def import_project(self, file, path, namespace=None, overwrite=False, override_params=None, **kwargs): """Import a project from an archive file. Args: file: Data or file object containing the project path (str): Name and path for the new project ...
[ "Import", "a", "project", "from", "an", "archive", "file", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3824-L3858
[ "def", "import_project", "(", "self", ",", "file", ",", "path", ",", "namespace", "=", "None", ",", "overwrite", "=", "False", ",", "override_params", "=", "None", ",", "*", "*", "kwargs", ")", ":", "files", "=", "{", "'file'", ":", "(", "'file.tar.gz'...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
RunnerManager.all
List all the runners. Args: scope (str): The scope of runners to show, one of: specific, shared, active, paused, online all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int...
gitlab/v4/objects.py
def all(self, scope=None, **kwargs): """List all the runners. Args: scope (str): The scope of runners to show, one of: specific, shared, active, paused, online all (bool): If True, return all the items, without pagination per_page (int): Number of ite...
def all(self, scope=None, **kwargs): """List all the runners. Args: scope (str): The scope of runners to show, one of: specific, shared, active, paused, online all (bool): If True, return all the items, without pagination per_page (int): Number of ite...
[ "List", "all", "the", "runners", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3889-L3913
[ "def", "all", "(", "self", ",", "scope", "=", "None", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/runners/all'", "query_data", "=", "{", "}", "if", "scope", "is", "not", "None", ":", "query_data", "[", "'scope'", "]", "=", "scope", "return", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
RunnerManager.verify
Validates authentication credentials for a registered Runner. Args: token (str): The runner's authentication token **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabVerifyE...
gitlab/v4/objects.py
def verify(self, token, **kwargs): """Validates authentication credentials for a registered Runner. Args: token (str): The runner's authentication token **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
def verify(self, token, **kwargs): """Validates authentication credentials for a registered Runner. Args: token (str): The runner's authentication token **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
[ "Validates", "authentication", "credentials", "for", "a", "registered", "Runner", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3917-L3930
[ "def", "verify", "(", "self", ",", "token", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/runners/verify'", "post_data", "=", "{", "'token'", ":", "token", "}", "self", ".", "gitlab", ".", "http_post", "(", "path", ",", "post_data", "=", "post_dat...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Todo.mark_as_done
Mark the todo as done. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the server failed to perform the request
gitlab/v4/objects.py
def mark_as_done(self, **kwargs): """Mark the todo as done. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the server failed to perform the request ...
def mark_as_done(self, **kwargs): """Mark the todo as done. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the server failed to perform the request ...
[ "Mark", "the", "todo", "as", "done", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3936-L3948
[ "def", "mark_as_done", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s/mark_as_done'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "id", ")", "server_data", "=", "self", ".", "manager", ".", "gitlab", ".", "h...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
TodoManager.mark_all_as_done
Mark all the todos as done. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the server failed to perform the request Returns: int: The number...
gitlab/v4/objects.py
def mark_all_as_done(self, **kwargs): """Mark all the todos as done. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the server failed to perform the requ...
def mark_all_as_done(self, **kwargs): """Mark all the todos as done. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the server failed to perform the requ...
[ "Mark", "all", "the", "todos", "as", "done", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3958-L3975
[ "def", "mark_all_as_done", "(", "self", ",", "*", "*", "kwargs", ")", ":", "result", "=", "self", ".", "gitlab", ".", "http_post", "(", "'/todos/mark_as_done'", ",", "*", "*", "kwargs", ")", "try", ":", "return", "int", "(", "result", ")", "except", "V...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
GeoNode.status
Get the status of the geo node. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server failed to perform the request Returns: dict: The st...
gitlab/v4/objects.py
def status(self, **kwargs): """Get the status of the geo node. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server failed to perform the request ...
def status(self, **kwargs): """Get the status of the geo node. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server failed to perform the request ...
[ "Get", "the", "status", "of", "the", "geo", "node", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/v4/objects.py#L3997-L4011
[ "def", "status", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'/geo_nodes/%s/status'", "%", "self", ".", "get_id", "(", ")", "return", "self", ".", "manager", ".", "gitlab", ".", "http_get", "(", "path", ",", "*", "*", "kwargs", ")" ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
GetMixin.get
Retrieve a single object. Args: id (int or str): ID of the object to retrieve lazy (bool): If True, don't request the server, but create a shallow object giving access to the managers. This is useful if you want to avoid useless calls to...
gitlab/mixins.py
def get(self, id, lazy=False, **kwargs): """Retrieve a single object. Args: id (int or str): ID of the object to retrieve lazy (bool): If True, don't request the server, but create a shallow object giving access to the managers. This is ...
def get(self, id, lazy=False, **kwargs): """Retrieve a single object. Args: id (int or str): ID of the object to retrieve lazy (bool): If True, don't request the server, but create a shallow object giving access to the managers. This is ...
[ "Retrieve", "a", "single", "object", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L27-L50
[ "def", "get", "(", "self", ",", "id", ",", "lazy", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "not", "isinstance", "(", "id", ",", "int", ")", ":", "id", "=", "id", ".", "replace", "(", "'/'", ",", "'%2F'", ")", "path", "=", "'%s/...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
GetWithoutIdMixin.get
Retrieve a single object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Returns: object: The generated RESTObject Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform ...
gitlab/mixins.py
def get(self, id=None, **kwargs): """Retrieve a single object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Returns: object: The generated RESTObject Raises: GitlabAuthenticationError: If authentication is not correct ...
def get(self, id=None, **kwargs): """Retrieve a single object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Returns: object: The generated RESTObject Raises: GitlabAuthenticationError: If authentication is not correct ...
[ "Retrieve", "a", "single", "object", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L55-L71
[ "def", "get", "(", "self", ",", "id", "=", "None", ",", "*", "*", "kwargs", ")", ":", "server_data", "=", "self", ".", "gitlab", ".", "http_get", "(", "self", ".", "path", ",", "*", "*", "kwargs", ")", "if", "server_data", "is", "None", ":", "ret...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
RefreshMixin.refresh
Refresh a single object from server. Args: **kwargs: Extra options to send to the server (e.g. sudo) Returns None (updates the object) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the reque...
gitlab/mixins.py
def refresh(self, **kwargs): """Refresh a single object from server. Args: **kwargs: Extra options to send to the server (e.g. sudo) Returns None (updates the object) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError...
def refresh(self, **kwargs): """Refresh a single object from server. Args: **kwargs: Extra options to send to the server (e.g. sudo) Returns None (updates the object) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError...
[ "Refresh", "a", "single", "object", "from", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L76-L93
[ "def", "refresh", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "_id_attr", ":", "path", "=", "'%s/%s'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "id", ")", "else", ":", "path", "=", "self", ".", "ma...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
ListMixin.list
Retrieve a list of objects. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool): If set to False and no pagination opt...
gitlab/mixins.py
def list(self, **kwargs): """Retrieve a list of objects. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool): ...
def list(self, **kwargs): """Retrieve a list of objects. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool): ...
[ "Retrieve", "a", "list", "of", "objects", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L98-L137
[ "def", "list", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# Duplicate data to avoid messing with what the user sent us", "data", "=", "kwargs", ".", "copy", "(", ")", "if", "self", ".", "gitlab", ".", "per_page", ":", "data", ".", "setdefault", "(", "'...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
CreateMixin.create
Create a new object. Args: data (dict): parameters to send to the server to create the resource **kwargs: Extra options to send to the server (e.g. sudo) Returns: RESTObject: a new instance of the managed object class built with ...
gitlab/mixins.py
def create(self, data, **kwargs): """Create a new object. Args: data (dict): parameters to send to the server to create the resource **kwargs: Extra options to send to the server (e.g. sudo) Returns: RESTObject: a new instance of the...
def create(self, data, **kwargs): """Create a new object. Args: data (dict): parameters to send to the server to create the resource **kwargs: Extra options to send to the server (e.g. sudo) Returns: RESTObject: a new instance of the...
[ "Create", "a", "new", "object", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L165-L205
[ "def", "create", "(", "self", ",", "data", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_check_missing_create_attrs", "(", "data", ")", "files", "=", "{", "}", "# We get the attributes that need some special transformation", "types", "=", "getattr", "(", "se...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
UpdateMixin._get_update_method
Return the HTTP method to use. Returns: object: http_put (default) or http_post
gitlab/mixins.py
def _get_update_method(self): """Return the HTTP method to use. Returns: object: http_put (default) or http_post """ if getattr(self, '_update_uses_post', False): http_method = self.gitlab.http_post else: http_method = self.gitlab.http_put ...
def _get_update_method(self): """Return the HTTP method to use. Returns: object: http_put (default) or http_post """ if getattr(self, '_update_uses_post', False): http_method = self.gitlab.http_post else: http_method = self.gitlab.http_put ...
[ "Return", "the", "HTTP", "method", "to", "use", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L228-L238
[ "def", "_get_update_method", "(", "self", ")", ":", "if", "getattr", "(", "self", ",", "'_update_uses_post'", ",", "False", ")", ":", "http_method", "=", "self", ".", "gitlab", ".", "http_post", "else", ":", "http_method", "=", "self", ".", "gitlab", ".", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
UpdateMixin.update
Update an object on the server. Args: id: ID of the object to update (can be None if not required) new_data: the update data for the object **kwargs: Extra options to send to the server (e.g. sudo) Returns: dict: The new object data (*not* a RESTObject) ...
gitlab/mixins.py
def update(self, id=None, new_data={}, **kwargs): """Update an object on the server. Args: id: ID of the object to update (can be None if not required) new_data: the update data for the object **kwargs: Extra options to send to the server (e.g. sudo) Returns...
def update(self, id=None, new_data={}, **kwargs): """Update an object on the server. Args: id: ID of the object to update (can be None if not required) new_data: the update data for the object **kwargs: Extra options to send to the server (e.g. sudo) Returns...
[ "Update", "an", "object", "on", "the", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L241-L283
[ "def", "update", "(", "self", ",", "id", "=", "None", ",", "new_data", "=", "{", "}", ",", "*", "*", "kwargs", ")", ":", "if", "id", "is", "None", ":", "path", "=", "self", ".", "path", "else", ":", "path", "=", "'%s/%s'", "%", "(", "self", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
SetMixin.set
Create or update the object. Args: key (str): The key of the object to create/update value (str): The value to set for the object **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correc...
gitlab/mixins.py
def set(self, key, value, **kwargs): """Create or update the object. Args: key (str): The key of the object to create/update value (str): The value to set for the object **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuth...
def set(self, key, value, **kwargs): """Create or update the object. Args: key (str): The key of the object to create/update value (str): The value to set for the object **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuth...
[ "Create", "or", "update", "the", "object", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L288-L306
[ "def", "set", "(", "self", ",", "key", ",", "value", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s'", "%", "(", "self", ".", "path", ",", "key", ".", "replace", "(", "'/'", ",", "'%2F'", ")", ")", "data", "=", "{", "'value'", ":", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
DeleteMixin.delete
Delete an object on the server. Args: id: ID of the object to delete **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteError: If the server cannot perform the request
gitlab/mixins.py
def delete(self, id, **kwargs): """Delete an object on the server. Args: id: ID of the object to delete **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteErro...
def delete(self, id, **kwargs): """Delete an object on the server. Args: id: ID of the object to delete **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabDeleteErro...
[ "Delete", "an", "object", "on", "the", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L311-L328
[ "def", "delete", "(", "self", ",", "id", ",", "*", "*", "kwargs", ")", ":", "if", "id", "is", "None", ":", "path", "=", "self", ".", "path", "else", ":", "if", "not", "isinstance", "(", "id", ",", "int", ")", ":", "id", "=", "id", ".", "repla...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
SaveMixin.save
Save the changes made to the object to the server. The object is updated to match what the server returns. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raise: GitlabAuthenticationError: If authentication is not correct GitlabUpdateError: ...
gitlab/mixins.py
def save(self, **kwargs): """Save the changes made to the object to the server. The object is updated to match what the server returns. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raise: GitlabAuthenticationError: If authentication is not co...
def save(self, **kwargs): """Save the changes made to the object to the server. The object is updated to match what the server returns. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raise: GitlabAuthenticationError: If authentication is not co...
[ "Save", "the", "changes", "made", "to", "the", "object", "to", "the", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L352-L373
[ "def", "save", "(", "self", ",", "*", "*", "kwargs", ")", ":", "updated_data", "=", "self", ".", "_get_updated_data", "(", ")", "# Nothing to update. Server fails if sent an empty dict.", "if", "not", "updated_data", ":", "return", "# call the manager", "obj_id", "=...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
UserAgentDetailMixin.user_agent_detail
Get the user agent detail. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request
gitlab/mixins.py
def user_agent_detail(self, **kwargs): """Get the user agent detail. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request ...
def user_agent_detail(self, **kwargs): """Get the user agent detail. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request ...
[ "Get", "the", "user", "agent", "detail", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L394-L405
[ "def", "user_agent_detail", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s/user_agent_detail'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "get_id", "(", ")", ")", "return", "self", ".", "manager", ".", "gitl...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
AccessRequestMixin.approve
Approve an access request. Args: access_level (int): The access level for the user **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabUpdateError: If the server fails to per...
gitlab/mixins.py
def approve(self, access_level=gitlab.DEVELOPER_ACCESS, **kwargs): """Approve an access request. Args: access_level (int): The access level for the user **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
def approve(self, access_level=gitlab.DEVELOPER_ACCESS, **kwargs): """Approve an access request. Args: access_level (int): The access level for the user **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
[ "Approve", "an", "access", "request", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L412-L428
[ "def", "approve", "(", "self", ",", "access_level", "=", "gitlab", ".", "DEVELOPER_ACCESS", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s/approve'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "id", ")", "data", "=", "{...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
TodoMixin.todo
Create a todo associated to the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the todo cannot be set
gitlab/mixins.py
def todo(self, **kwargs): """Create a todo associated to the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the todo cannot be set """ ...
def todo(self, **kwargs): """Create a todo associated to the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTodoError: If the todo cannot be set """ ...
[ "Create", "a", "todo", "associated", "to", "the", "object", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L470-L481
[ "def", "todo", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s/todo'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "get_id", "(", ")", ")", "self", ".", "manager", ".", "gitlab", ".", "http_post", "(", "p...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
TimeTrackingMixin.time_stats
Get time stats for the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tracking update cannot be done
gitlab/mixins.py
def time_stats(self, **kwargs): """Get time stats for the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tracking update cannot ...
def time_stats(self, **kwargs): """Get time stats for the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tracking update cannot ...
[ "Get", "time", "stats", "for", "the", "object", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L487-L503
[ "def", "time_stats", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# Use the existing time_stats attribute if it exist, otherwise make an", "# API call", "if", "'time_stats'", "in", "self", ".", "attributes", ":", "return", "self", ".", "attributes", "[", "'time_st...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
TimeTrackingMixin.time_estimate
Set an estimated time of work for the object. Args: duration (str): Duration in human format (e.g. 3h30) **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError...
gitlab/mixins.py
def time_estimate(self, duration, **kwargs): """Set an estimated time of work for the object. Args: duration (str): Duration in human format (e.g. 3h30) **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
def time_estimate(self, duration, **kwargs): """Set an estimated time of work for the object. Args: duration (str): Duration in human format (e.g. 3h30) **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentic...
[ "Set", "an", "estimated", "time", "of", "work", "for", "the", "object", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L508-L521
[ "def", "time_estimate", "(", "self", ",", "duration", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s/time_estimate'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "get_id", "(", ")", ")", "data", "=", "{", "'duration'", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
TimeTrackingMixin.reset_time_estimate
Resets estimated time for the object to 0 seconds. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tracking update cannot be done
gitlab/mixins.py
def reset_time_estimate(self, **kwargs): """Resets estimated time for the object to 0 seconds. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the...
def reset_time_estimate(self, **kwargs): """Resets estimated time for the object to 0 seconds. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the...
[ "Resets", "estimated", "time", "for", "the", "object", "to", "0", "seconds", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L525-L536
[ "def", "reset_time_estimate", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s/reset_time_estimate'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "get_id", "(", ")", ")", "return", "self", ".", "manager", ".", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
TimeTrackingMixin.reset_spent_time
Resets the time spent working on the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tracking update cannot be done
gitlab/mixins.py
def reset_spent_time(self, **kwargs): """Resets the time spent working on the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tra...
def reset_spent_time(self, **kwargs): """Resets the time spent working on the object. Args: **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabTimeTrackingError: If the time tra...
[ "Resets", "the", "time", "spent", "working", "on", "the", "object", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L558-L569
[ "def", "reset_spent_time", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s/reset_spent_time'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "get_id", "(", ")", ")", "return", "self", ".", "manager", ".", "gitlab...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
ParticipantsMixin.participants
List the participants. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool): If set to False and no pagination option i...
gitlab/mixins.py
def participants(self, **kwargs): """List the participants. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool...
def participants(self, **kwargs): """List the participants. Args: all (bool): If True, return all the items, without pagination per_page (int): Number of items to retrieve per request page (int): ID of the page to return (starts with page 1) as_list (bool...
[ "List", "the", "participants", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L575-L595
[ "def", "participants", "(", "self", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/%s/participants'", "%", "(", "self", ".", "manager", ".", "path", ",", "self", ".", "get_id", "(", ")", ")", "return", "self", ".", "manager", ".", "gitlab", "."...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
BadgeRenderMixin.render
Preview link_url and image_url after interpolation. Args: link_url (str): URL of the badge link image_url (str): URL of the badge image **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not ...
gitlab/mixins.py
def render(self, link_url, image_url, **kwargs): """Preview link_url and image_url after interpolation. Args: link_url (str): URL of the badge link image_url (str): URL of the badge image **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
def render(self, link_url, image_url, **kwargs): """Preview link_url and image_url after interpolation. Args: link_url (str): URL of the badge link image_url (str): URL of the badge image **kwargs: Extra options to send to the server (e.g. sudo) Raises: ...
[ "Preview", "link_url", "and", "image_url", "after", "interpolation", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/mixins.py#L602-L619
[ "def", "render", "(", "self", ",", "link_url", ",", "image_url", ",", "*", "*", "kwargs", ")", ":", "path", "=", "'%s/render'", "%", "self", ".", "path", "data", "=", "{", "'link_url'", ":", "link_url", ",", "'image_url'", ":", "image_url", "}", "retur...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.from_config
Create a Gitlab connection from configuration files. Args: gitlab_id (str): ID of the configuration section. config_files list[str]: List of paths to configuration files. Returns: (gitlab.Gitlab): A Gitlab connection. Raises: gitlab.config.Gitla...
gitlab/__init__.py
def from_config(cls, gitlab_id=None, config_files=None): """Create a Gitlab connection from configuration files. Args: gitlab_id (str): ID of the configuration section. config_files list[str]: List of paths to configuration files. Returns: (gitlab.Gitlab): A...
def from_config(cls, gitlab_id=None, config_files=None): """Create a Gitlab connection from configuration files. Args: gitlab_id (str): ID of the configuration section. config_files list[str]: List of paths to configuration files. Returns: (gitlab.Gitlab): A...
[ "Create", "a", "Gitlab", "connection", "from", "configuration", "files", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L169-L190
[ "def", "from_config", "(", "cls", ",", "gitlab_id", "=", "None", ",", "config_files", "=", "None", ")", ":", "config", "=", "gitlab", ".", "config", ".", "GitlabConfigParser", "(", "gitlab_id", "=", "gitlab_id", ",", "config_files", "=", "config_files", ")",...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.auth
Performs an authentication. Uses either the private token, or the email/password pair. The `user` attribute will hold a `gitlab.objects.CurrentUser` object on success.
gitlab/__init__.py
def auth(self): """Performs an authentication. Uses either the private token, or the email/password pair. The `user` attribute will hold a `gitlab.objects.CurrentUser` object on success. """ if self.private_token or self.oauth_token: self._token_auth() ...
def auth(self): """Performs an authentication. Uses either the private token, or the email/password pair. The `user` attribute will hold a `gitlab.objects.CurrentUser` object on success. """ if self.private_token or self.oauth_token: self._token_auth() ...
[ "Performs", "an", "authentication", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L192-L203
[ "def", "auth", "(", "self", ")", ":", "if", "self", ".", "private_token", "or", "self", ".", "oauth_token", ":", "self", ".", "_token_auth", "(", ")", "else", ":", "self", ".", "_credentials_auth", "(", ")" ]
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.version
Returns the version and revision of the gitlab server. Note that self.version and self.revision will be set on the gitlab object. Returns: tuple (str, str): The server version and server revision. ('unknown', 'unknwown') if the server doesn't ...
gitlab/__init__.py
def version(self): """Returns the version and revision of the gitlab server. Note that self.version and self.revision will be set on the gitlab object. Returns: tuple (str, str): The server version and server revision. ('unknown', 'unknwown') i...
def version(self): """Returns the version and revision of the gitlab server. Note that self.version and self.revision will be set on the gitlab object. Returns: tuple (str, str): The server version and server revision. ('unknown', 'unknwown') i...
[ "Returns", "the", "version", "and", "revision", "of", "the", "gitlab", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L216-L235
[ "def", "version", "(", "self", ")", ":", "if", "self", ".", "_server_version", "is", "None", ":", "try", ":", "data", "=", "self", ".", "http_get", "(", "'/version'", ")", "self", ".", "_server_version", "=", "data", "[", "'version'", "]", "self", ".",...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.lint
Validate a gitlab CI configuration. Args: content (txt): The .gitlab-ci.yml content **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabVerifyError: If the validation could n...
gitlab/__init__.py
def lint(self, content, **kwargs): """Validate a gitlab CI configuration. Args: content (txt): The .gitlab-ci.yml content **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
def lint(self, content, **kwargs): """Validate a gitlab CI configuration. Args: content (txt): The .gitlab-ci.yml content **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
[ "Validate", "a", "gitlab", "CI", "configuration", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L238-L255
[ "def", "lint", "(", "self", ",", "content", ",", "*", "*", "kwargs", ")", ":", "post_data", "=", "{", "'content'", ":", "content", "}", "data", "=", "self", ".", "http_post", "(", "'/ci/lint'", ",", "post_data", "=", "post_data", ",", "*", "*", "kwar...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.markdown
Render an arbitrary Markdown document. Args: text (str): The markdown text to render gfm (bool): Render text using GitLab Flavored Markdown. Default is False project (str): Full path of a project used a context when `gfm` is True *...
gitlab/__init__.py
def markdown(self, text, gfm=False, project=None, **kwargs): """Render an arbitrary Markdown document. Args: text (str): The markdown text to render gfm (bool): Render text using GitLab Flavored Markdown. Default is False project (str): Full path of a...
def markdown(self, text, gfm=False, project=None, **kwargs): """Render an arbitrary Markdown document. Args: text (str): The markdown text to render gfm (bool): Render text using GitLab Flavored Markdown. Default is False project (str): Full path of a...
[ "Render", "an", "arbitrary", "Markdown", "document", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L258-L280
[ "def", "markdown", "(", "self", ",", "text", ",", "gfm", "=", "False", ",", "project", "=", "None", ",", "*", "*", "kwargs", ")", ":", "post_data", "=", "{", "'text'", ":", "text", ",", "'gfm'", ":", "gfm", "}", "if", "project", "is", "not", "Non...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.set_license
Add a new license. Args: license (str): The license string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabPostError: If the server cannot perform the request Re...
gitlab/__init__.py
def set_license(self, license, **kwargs): """Add a new license. Args: license (str): The license string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabPostError:...
def set_license(self, license, **kwargs): """Add a new license. Args: license (str): The license string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct GitlabPostError:...
[ "Add", "a", "new", "license", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L299-L314
[ "def", "set_license", "(", "self", ",", "license", ",", "*", "*", "kwargs", ")", ":", "data", "=", "{", "'license'", ":", "license", "}", "return", "self", ".", "http_post", "(", "'/license'", ",", "post_data", "=", "data", ",", "*", "*", "kwargs", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab._build_url
Returns the full url from path. If path is already a url, return it unchanged. If it's a path, append it to the stored url. Returns: str: The full URL
gitlab/__init__.py
def _build_url(self, path): """Returns the full url from path. If path is already a url, return it unchanged. If it's a path, append it to the stored url. Returns: str: The full URL """ if path.startswith('http://') or path.startswith('https://'): ...
def _build_url(self, path): """Returns the full url from path. If path is already a url, return it unchanged. If it's a path, append it to the stored url. Returns: str: The full URL """ if path.startswith('http://') or path.startswith('https://'): ...
[ "Returns", "the", "full", "url", "from", "path", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L387-L399
[ "def", "_build_url", "(", "self", ",", "path", ")", ":", "if", "path", ".", "startswith", "(", "'http://'", ")", "or", "path", ".", "startswith", "(", "'https://'", ")", ":", "return", "path", "else", ":", "return", "'%s%s'", "%", "(", "self", ".", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.http_request
Make an HTTP request to the Gitlab server. Args: verb (str): The HTTP method to call ('get', 'post', 'put', 'delete') path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Da...
gitlab/__init__.py
def http_request(self, verb, path, query_data={}, post_data=None, streamed=False, files=None, **kwargs): """Make an HTTP request to the Gitlab server. Args: verb (str): The HTTP method to call ('get', 'post', 'put', 'delete') path (st...
def http_request(self, verb, path, query_data={}, post_data=None, streamed=False, files=None, **kwargs): """Make an HTTP request to the Gitlab server. Args: verb (str): The HTTP method to call ('get', 'post', 'put', 'delete') path (st...
[ "Make", "an", "HTTP", "request", "to", "the", "Gitlab", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L421-L531
[ "def", "http_request", "(", "self", ",", "verb", ",", "path", ",", "query_data", "=", "{", "}", ",", "post_data", "=", "None", ",", "streamed", "=", "False", ",", "files", "=", "None", ",", "*", "*", "kwargs", ")", ":", "url", "=", "self", ".", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.http_get
Make a GET request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data to send as query parameters streamed (bool): Whether the data should be streamed ...
gitlab/__init__.py
def http_get(self, path, query_data={}, streamed=False, raw=False, **kwargs): """Make a GET request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Dat...
def http_get(self, path, query_data={}, streamed=False, raw=False, **kwargs): """Make a GET request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Dat...
[ "Make", "a", "GET", "request", "to", "the", "Gitlab", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L533-L566
[ "def", "http_get", "(", "self", ",", "path", ",", "query_data", "=", "{", "}", ",", "streamed", "=", "False", ",", "raw", "=", "False", ",", "*", "*", "kwargs", ")", ":", "result", "=", "self", ".", "http_request", "(", "'get'", ",", "path", ",", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.http_list
Make a GET request to the Gitlab server for list-oriented queries. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data to send as query parameters **kwargs: Extra options to send to the...
gitlab/__init__.py
def http_list(self, path, query_data={}, as_list=None, **kwargs): """Make a GET request to the Gitlab server for list-oriented queries. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data t...
def http_list(self, path, query_data={}, as_list=None, **kwargs): """Make a GET request to the Gitlab server for list-oriented queries. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data t...
[ "Make", "a", "GET", "request", "to", "the", "Gitlab", "server", "for", "list", "-", "oriented", "queries", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L568-L605
[ "def", "http_list", "(", "self", ",", "path", ",", "query_data", "=", "{", "}", ",", "as_list", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# In case we want to change the default behavior at some point", "as_list", "=", "True", "if", "as_list", "is", "No...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.http_post
Make a POST request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data to send as query parameters post_data (dict): Data to send in the body (will be converted t...
gitlab/__init__.py
def http_post(self, path, query_data={}, post_data={}, files=None, **kwargs): """Make a POST request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): D...
def http_post(self, path, query_data={}, post_data={}, files=None, **kwargs): """Make a POST request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): D...
[ "Make", "a", "POST", "request", "to", "the", "Gitlab", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L607-L636
[ "def", "http_post", "(", "self", ",", "path", ",", "query_data", "=", "{", "}", ",", "post_data", "=", "{", "}", ",", "files", "=", "None", ",", "*", "*", "kwargs", ")", ":", "result", "=", "self", ".", "http_request", "(", "'post'", ",", "path", ...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.http_put
Make a PUT request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data to send as query parameters post_data (dict): Data to send in the body (will be converted to...
gitlab/__init__.py
def http_put(self, path, query_data={}, post_data={}, files=None, **kwargs): """Make a PUT request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data...
def http_put(self, path, query_data={}, post_data={}, files=None, **kwargs): """Make a PUT request to the Gitlab server. Args: path (str): Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data (dict): Data...
[ "Make", "a", "PUT", "request", "to", "the", "Gitlab", "server", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L638-L664
[ "def", "http_put", "(", "self", ",", "path", ",", "query_data", "=", "{", "}", ",", "post_data", "=", "{", "}", ",", "files", "=", "None", ",", "*", "*", "kwargs", ")", ":", "result", "=", "self", ".", "http_request", "(", "'put'", ",", "path", "...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Gitlab.search
Search GitLab resources matching the provided string.' Args: scope (str): Scope of the search search (str): Search string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthenticationError: If authentication is not correct ...
gitlab/__init__.py
def search(self, scope, search, **kwargs): """Search GitLab resources matching the provided string.' Args: scope (str): Scope of the search search (str): Search string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthen...
def search(self, scope, search, **kwargs): """Search GitLab resources matching the provided string.' Args: scope (str): Scope of the search search (str): Search string **kwargs: Extra options to send to the server (e.g. sudo) Raises: GitlabAuthen...
[ "Search", "GitLab", "resources", "matching", "the", "provided", "string", "." ]
python-gitlab/python-gitlab
python
https://github.com/python-gitlab/python-gitlab/blob/16de1b03fde3dbbe8f851614dd1d8c09de102fe5/gitlab/__init__.py#L683-L699
[ "def", "search", "(", "self", ",", "scope", ",", "search", ",", "*", "*", "kwargs", ")", ":", "data", "=", "{", "'scope'", ":", "scope", ",", "'search'", ":", "search", "}", "return", "self", ".", "http_list", "(", "'/search'", ",", "query_data", "="...
16de1b03fde3dbbe8f851614dd1d8c09de102fe5
train
Future.run_callback
Calls the callback_func, passing in the two positional arguments, conditionally waiting if the callback function hasn't been set yet. Meant to be run in a threadpool owned by the FutureCollection. Returns: None
validator/sawtooth_validator/networking/future.py
def run_callback(self): """Calls the callback_func, passing in the two positional arguments, conditionally waiting if the callback function hasn't been set yet. Meant to be run in a threadpool owned by the FutureCollection. Returns: None """ if self._callbac...
def run_callback(self): """Calls the callback_func, passing in the two positional arguments, conditionally waiting if the callback function hasn't been set yet. Meant to be run in a threadpool owned by the FutureCollection. Returns: None """ if self._callbac...
[ "Calls", "the", "callback_func", "passing", "in", "the", "two", "positional", "arguments", "conditionally", "waiting", "if", "the", "callback", "function", "hasn", "t", "been", "set", "yet", ".", "Meant", "to", "be", "run", "in", "a", "threadpool", "owned", ...
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/networking/future.py#L69-L83
[ "def", "run_callback", "(", "self", ")", ":", "if", "self", ".", "_callback_func", "is", "not", "None", ":", "try", ":", "self", ".", "_callback_func", "(", "self", ".", "_request", ",", "self", ".", "_result", ")", "except", "Exception", ":", "# pylint:...
8cf473bc2207e51f02bd182d825158a57d72b098
train
Dispatcher.add_send_message
Adds a send_message function to the Dispatcher's dictionary of functions indexed by connection. Args: connection (str): A locally unique identifier provided by the receiver of messages. send_message (fn): The method that should be called by the di...
validator/sawtooth_validator/networking/dispatch.py
def add_send_message(self, connection, send_message): """Adds a send_message function to the Dispatcher's dictionary of functions indexed by connection. Args: connection (str): A locally unique identifier provided by the receiver of messages. send_message...
def add_send_message(self, connection, send_message): """Adds a send_message function to the Dispatcher's dictionary of functions indexed by connection. Args: connection (str): A locally unique identifier provided by the receiver of messages. send_message...
[ "Adds", "a", "send_message", "function", "to", "the", "Dispatcher", "s", "dictionary", "of", "functions", "indexed", "by", "connection", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/networking/dispatch.py#L76-L89
[ "def", "add_send_message", "(", "self", ",", "connection", ",", "send_message", ")", ":", "self", ".", "_send_message", "[", "connection", "]", "=", "send_message", "LOGGER", ".", "debug", "(", "\"Added send_message function \"", "\"for connection %s\"", ",", "conne...
8cf473bc2207e51f02bd182d825158a57d72b098
train
Dispatcher.add_send_last_message
Adds a send_last_message function to the Dispatcher's dictionary of functions indexed by connection. Args: connection (str): A locally unique identifier provided by the receiver of messages. send_last_message (fn): The method that should be called ...
validator/sawtooth_validator/networking/dispatch.py
def add_send_last_message(self, connection, send_last_message): """Adds a send_last_message function to the Dispatcher's dictionary of functions indexed by connection. Args: connection (str): A locally unique identifier provided by the receiver of messages. ...
def add_send_last_message(self, connection, send_last_message): """Adds a send_last_message function to the Dispatcher's dictionary of functions indexed by connection. Args: connection (str): A locally unique identifier provided by the receiver of messages. ...
[ "Adds", "a", "send_last_message", "function", "to", "the", "Dispatcher", "s", "dictionary", "of", "functions", "indexed", "by", "connection", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/networking/dispatch.py#L91-L105
[ "def", "add_send_last_message", "(", "self", ",", "connection", ",", "send_last_message", ")", ":", "self", ".", "_send_last_message", "[", "connection", "]", "=", "send_last_message", "LOGGER", ".", "debug", "(", "\"Added send_last_message function \"", "\"for connecti...
8cf473bc2207e51f02bd182d825158a57d72b098
train
Dispatcher.remove_send_message
Removes a send_message function previously registered with the Dispatcher. Args: connection (str): A locally unique identifier provided by the receiver of messages.
validator/sawtooth_validator/networking/dispatch.py
def remove_send_message(self, connection): """Removes a send_message function previously registered with the Dispatcher. Args: connection (str): A locally unique identifier provided by the receiver of messages. """ if connection in self._send_message:...
def remove_send_message(self, connection): """Removes a send_message function previously registered with the Dispatcher. Args: connection (str): A locally unique identifier provided by the receiver of messages. """ if connection in self._send_message:...
[ "Removes", "a", "send_message", "function", "previously", "registered", "with", "the", "Dispatcher", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/networking/dispatch.py#L107-L123
[ "def", "remove_send_message", "(", "self", ",", "connection", ")", ":", "if", "connection", "in", "self", ".", "_send_message", ":", "del", "self", ".", "_send_message", "[", "connection", "]", "LOGGER", ".", "debug", "(", "\"Removed send_message function \"", "...
8cf473bc2207e51f02bd182d825158a57d72b098
train
Dispatcher.remove_send_last_message
Removes a send_last_message function previously registered with the Dispatcher. Args: connection (str): A locally unique identifier provided by the receiver of messages.
validator/sawtooth_validator/networking/dispatch.py
def remove_send_last_message(self, connection): """Removes a send_last_message function previously registered with the Dispatcher. Args: connection (str): A locally unique identifier provided by the receiver of messages. """ if connection in self._sen...
def remove_send_last_message(self, connection): """Removes a send_last_message function previously registered with the Dispatcher. Args: connection (str): A locally unique identifier provided by the receiver of messages. """ if connection in self._sen...
[ "Removes", "a", "send_last_message", "function", "previously", "registered", "with", "the", "Dispatcher", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/networking/dispatch.py#L125-L141
[ "def", "remove_send_last_message", "(", "self", ",", "connection", ")", ":", "if", "connection", "in", "self", ".", "_send_last_message", ":", "del", "self", ".", "_send_last_message", "[", "connection", "]", "LOGGER", ".", "debug", "(", "\"Removed send_last_messa...
8cf473bc2207e51f02bd182d825158a57d72b098
train
Dispatcher.set_preprocessor
Sets PREPROCESSOR to run on MESSAGE_TYPE in EXECUTOR. PREPROCESSOR: fn(message_content: bytes) -> PreprocessorResult
validator/sawtooth_validator/networking/dispatch.py
def set_preprocessor(self, message_type, preprocessor, executor): ''' Sets PREPROCESSOR to run on MESSAGE_TYPE in EXECUTOR. PREPROCESSOR: fn(message_content: bytes) -> PreprocessorResult ''' self._preprocessors[message_type] = \ _PreprocessorManager( ...
def set_preprocessor(self, message_type, preprocessor, executor): ''' Sets PREPROCESSOR to run on MESSAGE_TYPE in EXECUTOR. PREPROCESSOR: fn(message_content: bytes) -> PreprocessorResult ''' self._preprocessors[message_type] = \ _PreprocessorManager( ...
[ "Sets", "PREPROCESSOR", "to", "run", "on", "MESSAGE_TYPE", "in", "EXECUTOR", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/networking/dispatch.py#L182-L191
[ "def", "set_preprocessor", "(", "self", ",", "message_type", ",", "preprocessor", ",", "executor", ")", ":", "self", ".", "_preprocessors", "[", "message_type", "]", "=", "_PreprocessorManager", "(", "executor", "=", "executor", ",", "preprocessor", "=", "prepro...
8cf473bc2207e51f02bd182d825158a57d72b098
train
ForkGraph.walk
Do a breadth-first walk of the graph, yielding on each node, starting at `head`.
cli/sawtooth_cli/network_command/fork_graph.py
def walk(self, head=None): """Do a breadth-first walk of the graph, yielding on each node, starting at `head`.""" head = head or self._root_node queue = [] queue.insert(0, head) while queue: node = queue.pop() yield node.num, node.previous, node...
def walk(self, head=None): """Do a breadth-first walk of the graph, yielding on each node, starting at `head`.""" head = head or self._root_node queue = [] queue.insert(0, head) while queue: node = queue.pop() yield node.num, node.previous, node...
[ "Do", "a", "breadth", "-", "first", "walk", "of", "the", "graph", "yielding", "on", "each", "node", "starting", "at", "head", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/cli/sawtooth_cli/network_command/fork_graph.py#L82-L97
[ "def", "walk", "(", "self", ",", "head", "=", "None", ")", ":", "head", "=", "head", "or", "self", ".", "_root_node", "queue", "=", "[", "]", "queue", ".", "insert", "(", "0", ",", "head", ")", "while", "queue", ":", "node", "=", "queue", ".", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
_get_config_dir
Returns the sawtooth configuration directory based on the SAWTOOTH_HOME environment variable (if set) or OS defaults.
cli/sawtooth_cli/admin_command/config.py
def _get_config_dir(): """Returns the sawtooth configuration directory based on the SAWTOOTH_HOME environment variable (if set) or OS defaults. """ if 'SAWTOOTH_HOME' in os.environ: return os.path.join(os.environ['SAWTOOTH_HOME'], 'etc') if os.name == 'nt': base_dir = \ ...
def _get_config_dir(): """Returns the sawtooth configuration directory based on the SAWTOOTH_HOME environment variable (if set) or OS defaults. """ if 'SAWTOOTH_HOME' in os.environ: return os.path.join(os.environ['SAWTOOTH_HOME'], 'etc') if os.name == 'nt': base_dir = \ ...
[ "Returns", "the", "sawtooth", "configuration", "directory", "based", "on", "the", "SAWTOOTH_HOME", "environment", "variable", "(", "if", "set", ")", "or", "OS", "defaults", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/cli/sawtooth_cli/admin_command/config.py#L21-L33
[ "def", "_get_config_dir", "(", ")", ":", "if", "'SAWTOOTH_HOME'", "in", "os", ".", "environ", ":", "return", "os", ".", "path", ".", "join", "(", "os", ".", "environ", "[", "'SAWTOOTH_HOME'", "]", ",", "'etc'", ")", "if", "os", ".", "name", "==", "'n...
8cf473bc2207e51f02bd182d825158a57d72b098
train
_get_dir
Determines the directory path based on configuration. Arguments: toml_config_setting (str): The name of the config setting related to the directory which will appear in path.toml. sawtooth_home_dir (str): The directory under the SAWTOOTH_HOME environment variable. For examp...
cli/sawtooth_cli/admin_command/config.py
def _get_dir(toml_config_setting, sawtooth_home_dir, windows_dir, default_dir): """Determines the directory path based on configuration. Arguments: toml_config_setting (str): The name of the config setting related to the directory which will appear in path.toml. sawtooth_home_dir (s...
def _get_dir(toml_config_setting, sawtooth_home_dir, windows_dir, default_dir): """Determines the directory path based on configuration. Arguments: toml_config_setting (str): The name of the config setting related to the directory which will appear in path.toml. sawtooth_home_dir (s...
[ "Determines", "the", "directory", "path", "based", "on", "configuration", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/cli/sawtooth_cli/admin_command/config.py#L36-L68
[ "def", "_get_dir", "(", "toml_config_setting", ",", "sawtooth_home_dir", ",", "windows_dir", ",", "default_dir", ")", ":", "conf_file", "=", "os", ".", "path", ".", "join", "(", "_get_config_dir", "(", ")", ",", "'path.toml'", ")", "if", "os", ".", "path", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
IdentityView.get_role
Get a single Role by name. Args: name (str): The name of the Role. Returns: (:obj:`Role`): The Role that matches the name or None.
validator/sawtooth_validator/state/identity_view.py
def get_role(self, name): """Get a single Role by name. Args: name (str): The name of the Role. Returns: (:obj:`Role`): The Role that matches the name or None. """ address = _create_role_address(name) role_list_bytes = None try: ...
def get_role(self, name): """Get a single Role by name. Args: name (str): The name of the Role. Returns: (:obj:`Role`): The Role that matches the name or None. """ address = _create_role_address(name) role_list_bytes = None try: ...
[ "Get", "a", "single", "Role", "by", "name", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/state/identity_view.py#L85-L109
[ "def", "get_role", "(", "self", ",", "name", ")", ":", "address", "=", "_create_role_address", "(", "name", ")", "role_list_bytes", "=", "None", "try", ":", "role_list_bytes", "=", "self", ".", "_state_view", ".", "get", "(", "address", "=", "address", ")"...
8cf473bc2207e51f02bd182d825158a57d72b098
train
IdentityView.get_roles
Return all the Roles under the Identity namespace. Returns: (list): A list containing all the Roles under the Identity namespace.
validator/sawtooth_validator/state/identity_view.py
def get_roles(self): """Return all the Roles under the Identity namespace. Returns: (list): A list containing all the Roles under the Identity namespace. """ prefix = _IDENTITY_NS + _ROLE_NS rolelist_list = [ _create_from_bytes(d, identit...
def get_roles(self): """Return all the Roles under the Identity namespace. Returns: (list): A list containing all the Roles under the Identity namespace. """ prefix = _IDENTITY_NS + _ROLE_NS rolelist_list = [ _create_from_bytes(d, identit...
[ "Return", "all", "the", "Roles", "under", "the", "Identity", "namespace", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/state/identity_view.py#L111-L128
[ "def", "get_roles", "(", "self", ")", ":", "prefix", "=", "_IDENTITY_NS", "+", "_ROLE_NS", "rolelist_list", "=", "[", "_create_from_bytes", "(", "d", ",", "identity_pb2", ".", "RoleList", ")", "for", "_", ",", "d", "in", "self", ".", "_state_view", ".", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
IdentityView.get_policy
Get a single Policy by name. Args: name (str): The name of the Policy. Returns: (:obj:`Policy`) The Policy that matches the name.
validator/sawtooth_validator/state/identity_view.py
def get_policy(self, name): """Get a single Policy by name. Args: name (str): The name of the Policy. Returns: (:obj:`Policy`) The Policy that matches the name. """ address = _create_policy_address(name) policy_list_bytes = None try: ...
def get_policy(self, name): """Get a single Policy by name. Args: name (str): The name of the Policy. Returns: (:obj:`Policy`) The Policy that matches the name. """ address = _create_policy_address(name) policy_list_bytes = None try: ...
[ "Get", "a", "single", "Policy", "by", "name", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/state/identity_view.py#L130-L154
[ "def", "get_policy", "(", "self", ",", "name", ")", ":", "address", "=", "_create_policy_address", "(", "name", ")", "policy_list_bytes", "=", "None", "try", ":", "policy_list_bytes", "=", "self", ".", "_state_view", ".", "get", "(", "address", "=", "address...
8cf473bc2207e51f02bd182d825158a57d72b098
train
IdentityView.get_policies
Returns all the Policies under the Identity namespace. Returns: (list): A list containing all the Policies under the Identity namespace.
validator/sawtooth_validator/state/identity_view.py
def get_policies(self): """Returns all the Policies under the Identity namespace. Returns: (list): A list containing all the Policies under the Identity namespace. """ prefix = _IDENTITY_NS + _POLICY_NS policylist_list = [ _create_from_by...
def get_policies(self): """Returns all the Policies under the Identity namespace. Returns: (list): A list containing all the Policies under the Identity namespace. """ prefix = _IDENTITY_NS + _POLICY_NS policylist_list = [ _create_from_by...
[ "Returns", "all", "the", "Policies", "under", "the", "Identity", "namespace", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/state/identity_view.py#L156-L173
[ "def", "get_policies", "(", "self", ")", ":", "prefix", "=", "_IDENTITY_NS", "+", "_POLICY_NS", "policylist_list", "=", "[", "_create_from_bytes", "(", "d", ",", "identity_pb2", ".", "PolicyList", ")", "for", "_", ",", "d", "in", "self", ".", "_state_view", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
BlockInfoInjector.block_start
Returns an ordered list of batches to inject at the beginning of the block. Can also return None if no batches should be injected. Args: previous_block (Block): The previous block. Returns: A list of batches to inject.
validator/sawtooth_validator/journal/block_info_injector.py
def block_start(self, previous_block): """Returns an ordered list of batches to inject at the beginning of the block. Can also return None if no batches should be injected. Args: previous_block (Block): The previous block. Returns: A list of batches to inject. ...
def block_start(self, previous_block): """Returns an ordered list of batches to inject at the beginning of the block. Can also return None if no batches should be injected. Args: previous_block (Block): The previous block. Returns: A list of batches to inject. ...
[ "Returns", "an", "ordered", "list", "of", "batches", "to", "inject", "at", "the", "beginning", "of", "the", "block", ".", "Can", "also", "return", "None", "if", "no", "batches", "should", "be", "injected", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/journal/block_info_injector.py#L80-L102
[ "def", "block_start", "(", "self", ",", "previous_block", ")", ":", "previous_header_bytes", "=", "previous_block", ".", "header", "previous_header", "=", "BlockHeader", "(", ")", "previous_header", ".", "ParseFromString", "(", "previous_header_bytes", ")", "block_inf...
8cf473bc2207e51f02bd182d825158a57d72b098
train
enforce_validation_rules
Retrieve the validation rules stored in state and check that the given batches do not violate any of those rules. These rules include: NofX: Only N of transaction type X may be included in a block. XatY: A transaction of type X must be in the list at position Y. local: A transaction must be...
validator/sawtooth_validator/journal/validation_rule_enforcer.py
def enforce_validation_rules(settings_view, expected_signer, batches): """ Retrieve the validation rules stored in state and check that the given batches do not violate any of those rules. These rules include: NofX: Only N of transaction type X may be included in a block. XatY: A transactio...
def enforce_validation_rules(settings_view, expected_signer, batches): """ Retrieve the validation rules stored in state and check that the given batches do not violate any of those rules. These rules include: NofX: Only N of transaction type X may be included in a block. XatY: A transactio...
[ "Retrieve", "the", "validation", "rules", "stored", "in", "state", "and", "check", "that", "the", "given", "batches", "do", "not", "violate", "any", "of", "those", "rules", ".", "These", "rules", "include", ":" ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/journal/validation_rule_enforcer.py#L21-L78
[ "def", "enforce_validation_rules", "(", "settings_view", ",", "expected_signer", ",", "batches", ")", ":", "rules", "=", "settings_view", ".", "get_setting", "(", "\"sawtooth.validator.block_validation_rules\"", ")", "if", "rules", "is", "None", ":", "return", "True",...
8cf473bc2207e51f02bd182d825158a57d72b098
train
_do_nofx
Only N of transaction type X may be included in a block. The first argument must be interpretable as an integer. The second argument is interpreted as the name of a transaction family. For example, the string "NofX:2,intkey" means only allow 2 intkey transactions per block.
validator/sawtooth_validator/journal/validation_rule_enforcer.py
def _do_nofx(transactions, arguments): """ Only N of transaction type X may be included in a block. The first argument must be interpretable as an integer. The second argument is interpreted as the name of a transaction family. For example, the string "NofX:2,intkey" means only allow 2 intkey transa...
def _do_nofx(transactions, arguments): """ Only N of transaction type X may be included in a block. The first argument must be interpretable as an integer. The second argument is interpreted as the name of a transaction family. For example, the string "NofX:2,intkey" means only allow 2 intkey transa...
[ "Only", "N", "of", "transaction", "type", "X", "may", "be", "included", "in", "a", "block", ".", "The", "first", "argument", "must", "be", "interpretable", "as", "an", "integer", ".", "The", "second", "argument", "is", "interpreted", "as", "the", "name", ...
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/journal/validation_rule_enforcer.py#L81-L108
[ "def", "_do_nofx", "(", "transactions", ",", "arguments", ")", ":", "try", ":", "num", ",", "family", "=", "arguments", ".", "split", "(", "','", ")", "limit", "=", "int", "(", "num", ".", "strip", "(", ")", ")", "except", "ValueError", ":", "LOGGER"...
8cf473bc2207e51f02bd182d825158a57d72b098
train
_do_xaty
A transaction of type X must be in the block at position Y. The first argument is interpreted as the name of a transaction family. The second argument must be interpretable as an integer and defines the index of the transaction in the block that must be checked. Negative numbers can be used and count ba...
validator/sawtooth_validator/journal/validation_rule_enforcer.py
def _do_xaty(transactions, arguments): """ A transaction of type X must be in the block at position Y. The first argument is interpreted as the name of a transaction family. The second argument must be interpretable as an integer and defines the index of the transaction in the block that must be che...
def _do_xaty(transactions, arguments): """ A transaction of type X must be in the block at position Y. The first argument is interpreted as the name of a transaction family. The second argument must be interpretable as an integer and defines the index of the transaction in the block that must be che...
[ "A", "transaction", "of", "type", "X", "must", "be", "in", "the", "block", "at", "position", "Y", ".", "The", "first", "argument", "is", "interpreted", "as", "the", "name", "of", "a", "transaction", "family", ".", "The", "second", "argument", "must", "be...
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/journal/validation_rule_enforcer.py#L111-L146
[ "def", "_do_xaty", "(", "transactions", ",", "arguments", ")", ":", "try", ":", "family", ",", "num", "=", "arguments", ".", "split", "(", "','", ")", "position", "=", "int", "(", "num", ".", "strip", "(", ")", ")", "except", "ValueError", ":", "LOGG...
8cf473bc2207e51f02bd182d825158a57d72b098
train
_do_local
A transaction must be signed by the same key as the block. This rule takes a list of transaction indices in the block and enforces the rule on each. This rule is useful in combination with the other rules to ensure a client is not submitting transactions that should only be injected by the winning valid...
validator/sawtooth_validator/journal/validation_rule_enforcer.py
def _do_local(transactions, expected_signer, arguments): """ A transaction must be signed by the same key as the block. This rule takes a list of transaction indices in the block and enforces the rule on each. This rule is useful in combination with the other rules to ensure a client is not submitti...
def _do_local(transactions, expected_signer, arguments): """ A transaction must be signed by the same key as the block. This rule takes a list of transaction indices in the block and enforces the rule on each. This rule is useful in combination with the other rules to ensure a client is not submitti...
[ "A", "transaction", "must", "be", "signed", "by", "the", "same", "key", "as", "the", "block", ".", "This", "rule", "takes", "a", "list", "of", "transaction", "indices", "in", "the", "block", "and", "enforces", "the", "rule", "on", "each", ".", "This", ...
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/journal/validation_rule_enforcer.py#L149-L181
[ "def", "_do_local", "(", "transactions", ",", "expected_signer", ",", "arguments", ")", ":", "indices", "=", "arguments", ".", "split", "(", "\",\"", ")", "txns_len", "=", "len", "(", "transactions", ")", "for", "index", "in", "indices", ":", "try", ":", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
load_toml_validator_config
Returns a ValidatorConfig created by loading a TOML file from the filesystem.
validator/sawtooth_validator/config/validator.py
def load_toml_validator_config(filename): """Returns a ValidatorConfig created by loading a TOML file from the filesystem. """ if not os.path.exists(filename): LOGGER.info( "Skipping validator config loading from non-existent config file:" " %s", filename) return ...
def load_toml_validator_config(filename): """Returns a ValidatorConfig created by loading a TOML file from the filesystem. """ if not os.path.exists(filename): LOGGER.info( "Skipping validator config loading from non-existent config file:" " %s", filename) return ...
[ "Returns", "a", "ValidatorConfig", "created", "by", "loading", "a", "TOML", "file", "from", "the", "filesystem", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/config/validator.py#L48-L134
[ "def", "load_toml_validator_config", "(", "filename", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "filename", ")", ":", "LOGGER", ".", "info", "(", "\"Skipping validator config loading from non-existent config file:\"", "\" %s\"", ",", "filename", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
merge_validator_config
Given a list of ValidatorConfig objects, merges them into a single ValidatorConfig, giving priority in the order of the configs (first has highest priority).
validator/sawtooth_validator/config/validator.py
def merge_validator_config(configs): """ Given a list of ValidatorConfig objects, merges them into a single ValidatorConfig, giving priority in the order of the configs (first has highest priority). """ bind_network = None bind_component = None bind_consensus = None endpoint = None ...
def merge_validator_config(configs): """ Given a list of ValidatorConfig objects, merges them into a single ValidatorConfig, giving priority in the order of the configs (first has highest priority). """ bind_network = None bind_component = None bind_consensus = None endpoint = None ...
[ "Given", "a", "list", "of", "ValidatorConfig", "objects", "merges", "them", "into", "a", "single", "ValidatorConfig", "giving", "priority", "in", "the", "order", "of", "the", "configs", "(", "first", "has", "highest", "priority", ")", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/config/validator.py#L137-L242
[ "def", "merge_validator_config", "(", "configs", ")", ":", "bind_network", "=", "None", "bind_component", "=", "None", "bind_consensus", "=", "None", "endpoint", "=", "None", "peering", "=", "None", "seeds", "=", "None", "peers", "=", "None", "network_public_key...
8cf473bc2207e51f02bd182d825158a57d72b098
train
load_identity_signer
Loads a private key from the key directory, based on a validator's identity. Args: key_dir (str): The path to the key directory. key_name (str): The name of the key to load. Returns: Signer: the cryptographic signer for the key
validator/sawtooth_validator/server/keys.py
def load_identity_signer(key_dir, key_name): """Loads a private key from the key directory, based on a validator's identity. Args: key_dir (str): The path to the key directory. key_name (str): The name of the key to load. Returns: Signer: the cryptographic signer for the key ...
def load_identity_signer(key_dir, key_name): """Loads a private key from the key directory, based on a validator's identity. Args: key_dir (str): The path to the key directory. key_name (str): The name of the key to load. Returns: Signer: the cryptographic signer for the key ...
[ "Loads", "a", "private", "key", "from", "the", "key", "directory", "based", "on", "a", "validator", "s", "identity", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/server/keys.py#L27-L63
[ "def", "load_identity_signer", "(", "key_dir", ",", "key_name", ")", ":", "key_path", "=", "os", ".", "path", ".", "join", "(", "key_dir", ",", "'{}.priv'", ".", "format", "(", "key_name", ")", ")", "if", "not", "os", ".", "path", ".", "exists", "(", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
add_status_parser
Adds argument parser for the status command Args: subparsers: Add parsers to this subparser object parent_parser: The parent argparse.ArgumentParser object
cli/sawtooth_cli/status.py
def add_status_parser(subparsers, parent_parser): """Adds argument parser for the status command Args: subparsers: Add parsers to this subparser object parent_parser: The parent argparse.ArgumentParser object """ parser = subparsers.add_parser( 'status', help...
def add_status_parser(subparsers, parent_parser): """Adds argument parser for the status command Args: subparsers: Add parsers to this subparser object parent_parser: The parent argparse.ArgumentParser object """ parser = subparsers.add_parser( 'status', help...
[ "Adds", "argument", "parser", "for", "the", "status", "command" ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/cli/sawtooth_cli/status.py#L23-L38
[ "def", "add_status_parser", "(", "subparsers", ",", "parent_parser", ")", ":", "parser", "=", "subparsers", ".", "add_parser", "(", "'status'", ",", "help", "=", "'Displays information about validator status'", ",", "description", "=", "\"Provides a subcommand to show a v...
8cf473bc2207e51f02bd182d825158a57d72b098
train
ProcessorManager.get_next_of_type
Get the next available processor of a particular type and increment its occupancy counter. Args: processor_type (ProcessorType): The processor type associated with a zmq identity. Returns: (Processor): Information about the transaction processor
validator/sawtooth_validator/execution/processor_manager.py
def get_next_of_type(self, processor_type): """Get the next available processor of a particular type and increment its occupancy counter. Args: processor_type (ProcessorType): The processor type associated with a zmq identity. Returns: (Processor...
def get_next_of_type(self, processor_type): """Get the next available processor of a particular type and increment its occupancy counter. Args: processor_type (ProcessorType): The processor type associated with a zmq identity. Returns: (Processor...
[ "Get", "the", "next", "available", "processor", "of", "a", "particular", "type", "and", "increment", "its", "occupancy", "counter", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/execution/processor_manager.py#L59-L78
[ "def", "get_next_of_type", "(", "self", ",", "processor_type", ")", ":", "with", "self", ".", "_condition", ":", "if", "processor_type", "not", "in", "self", ":", "self", ".", "wait_for_registration", "(", "processor_type", ")", "try", ":", "processor", "=", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
ProcessorManager.remove
Removes all of the Processors for a particular transaction processor zeromq identity. Args: processor_identity (str): The zeromq identity of the transaction processor.
validator/sawtooth_validator/execution/processor_manager.py
def remove(self, processor_identity): """Removes all of the Processors for a particular transaction processor zeromq identity. Args: processor_identity (str): The zeromq identity of the transaction processor. """ with self._condition: proc...
def remove(self, processor_identity): """Removes all of the Processors for a particular transaction processor zeromq identity. Args: processor_identity (str): The zeromq identity of the transaction processor. """ with self._condition: proc...
[ "Removes", "all", "of", "the", "Processors", "for", "a", "particular", "transaction", "processor", "zeromq", "identity", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/execution/processor_manager.py#L108-L133
[ "def", "remove", "(", "self", ",", "processor_identity", ")", ":", "with", "self", ".", "_condition", ":", "processor_types", "=", "self", ".", "_identities", ".", "get", "(", "processor_identity", ")", "if", "processor_types", "is", "None", ":", "LOGGER", "...
8cf473bc2207e51f02bd182d825158a57d72b098
train
ProcessorManager.wait_for_registration
Waits for a particular processor type to register or until is_cancelled is True. is_cancelled cannot be part of this class since we aren't cancelling all waiting for a processor_type, but just this particular wait. Args: processor_type (ProcessorType): The family, and versio...
validator/sawtooth_validator/execution/processor_manager.py
def wait_for_registration(self, processor_type): """Waits for a particular processor type to register or until is_cancelled is True. is_cancelled cannot be part of this class since we aren't cancelling all waiting for a processor_type, but just this particular wait. Args: ...
def wait_for_registration(self, processor_type): """Waits for a particular processor type to register or until is_cancelled is True. is_cancelled cannot be part of this class since we aren't cancelling all waiting for a processor_type, but just this particular wait. Args: ...
[ "Waits", "for", "a", "particular", "processor", "type", "to", "register", "or", "until", "is_cancelled", "is", "True", ".", "is_cancelled", "cannot", "be", "part", "of", "this", "class", "since", "we", "aren", "t", "cancelling", "all", "waiting", "for", "a",...
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/execution/processor_manager.py#L138-L156
[ "def", "wait_for_registration", "(", "self", ",", "processor_type", ")", ":", "with", "self", ".", "_condition", ":", "self", ".", "_condition", ".", "wait_for", "(", "lambda", ":", "(", "processor_type", "in", "self", "or", "self", ".", "_cancelled_event", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
ProcessorManager.wait_for_vacancy
Waits for a particular processor type to have the capacity to handle additional transactions or until is_cancelled is True. Args: processor_type (ProcessorType): The family, and version of the transaction processor. Returns: Processor
validator/sawtooth_validator/execution/processor_manager.py
def wait_for_vacancy(self, processor_type): """Waits for a particular processor type to have the capacity to handle additional transactions or until is_cancelled is True. Args: processor_type (ProcessorType): The family, and version of the transaction processor. ...
def wait_for_vacancy(self, processor_type): """Waits for a particular processor type to have the capacity to handle additional transactions or until is_cancelled is True. Args: processor_type (ProcessorType): The family, and version of the transaction processor. ...
[ "Waits", "for", "a", "particular", "processor", "type", "to", "have", "the", "capacity", "to", "handle", "additional", "transactions", "or", "until", "is_cancelled", "is", "True", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/execution/processor_manager.py#L158-L177
[ "def", "wait_for_vacancy", "(", "self", ",", "processor_type", ")", ":", "with", "self", ".", "_condition", ":", "self", ".", "_condition", ".", "wait_for", "(", "lambda", ":", "(", "self", ".", "_processor_available", "(", "processor_type", ")", "or", "self...
8cf473bc2207e51f02bd182d825158a57d72b098
train
SettingsView._get_setting
Get the setting stored at the given key. Args: key (str): the setting key default_value (str, optional): The default value, if none is found. Defaults to None. value_type (function, optional): The type of a setting value. Defaults to `str`. ...
validator/sawtooth_validator/state/settings_view.py
def _get_setting(self, key, default_value=None, value_type=str): """Get the setting stored at the given key. Args: key (str): the setting key default_value (str, optional): The default value, if none is found. Defaults to None. value_type (function, o...
def _get_setting(self, key, default_value=None, value_type=str): """Get the setting stored at the given key. Args: key (str): the setting key default_value (str, optional): The default value, if none is found. Defaults to None. value_type (function, o...
[ "Get", "the", "setting", "stored", "at", "the", "given", "key", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/state/settings_view.py#L56-L83
[ "def", "_get_setting", "(", "self", ",", "key", ",", "default_value", "=", "None", ",", "value_type", "=", "str", ")", ":", "try", ":", "state_entry", "=", "self", ".", "_state_view", ".", "get", "(", "SettingsView", ".", "setting_address", "(", "key", "...
8cf473bc2207e51f02bd182d825158a57d72b098
train
SettingsView.get_setting_list
Get the setting stored at the given key and split it to a list. Args: key (str): the setting key default_value (list, optional): The default value, if none is found. Defaults to None. delimiter (list of str, optional): The delimiter to break on. ...
validator/sawtooth_validator/state/settings_view.py
def get_setting_list(self, key, default_value=None, delimiter=',', value_type=str): """Get the setting stored at the given key and split it to a list. Args: key (str): the setting key ...
def get_setting_list(self, key, default_value=None, delimiter=',', value_type=str): """Get the setting stored at the given key and split it to a list. Args: key (str): the setting key ...
[ "Get", "the", "setting", "stored", "at", "the", "given", "key", "and", "split", "it", "to", "a", "list", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/state/settings_view.py#L85-L113
[ "def", "get_setting_list", "(", "self", ",", "key", ",", "default_value", "=", "None", ",", "delimiter", "=", "','", ",", "value_type", "=", "str", ")", ":", "value", "=", "self", ".", "get_setting", "(", "key", ")", "if", "value", "is", "not", "None",...
8cf473bc2207e51f02bd182d825158a57d72b098
train
SettingsView.setting_address
Computes the radix address for the given setting key. Keys are broken into four parts, based on the dots in the string. For example, the key `a.b.c` address is computed based on `a`, `b`, `c` and the empty string. A longer key, for example `a.b.c.d.e`, is still broken into four parts, b...
validator/sawtooth_validator/state/settings_view.py
def setting_address(key): """Computes the radix address for the given setting key. Keys are broken into four parts, based on the dots in the string. For example, the key `a.b.c` address is computed based on `a`, `b`, `c` and the empty string. A longer key, for example `a.b.c.d.e`, is st...
def setting_address(key): """Computes the radix address for the given setting key. Keys are broken into four parts, based on the dots in the string. For example, the key `a.b.c` address is computed based on `a`, `b`, `c` and the empty string. A longer key, for example `a.b.c.d.e`, is st...
[ "Computes", "the", "radix", "address", "for", "the", "given", "setting", "key", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/validator/sawtooth_validator/state/settings_view.py#L117-L142
[ "def", "setting_address", "(", "key", ")", ":", "# split the key into 4 parts, maximum", "key_parts", "=", "key", ".", "split", "(", "'.'", ",", "maxsplit", "=", "_MAX_KEY_PARTS", "-", "1", ")", "# compute the short hash of each part", "addr_parts", "=", "[", "_shor...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.submit_batches
Accepts a binary encoded BatchList and submits it to the validator. Request: body: octet-stream BatchList of one or more Batches Response: status: - 202: Batches submitted and pending link: /batches or /batch_statuses link for submitted batches
rest_api/sawtooth_rest_api/route_handlers.py
async def submit_batches(self, request): """Accepts a binary encoded BatchList and submits it to the validator. Request: body: octet-stream BatchList of one or more Batches Response: status: - 202: Batches submitted and pending link: /batches...
async def submit_batches(self, request): """Accepts a binary encoded BatchList and submits it to the validator. Request: body: octet-stream BatchList of one or more Batches Response: status: - 202: Batches submitted and pending link: /batches...
[ "Accepts", "a", "binary", "encoded", "BatchList", "and", "submits", "it", "to", "the", "validator", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L124-L185
[ "async", "def", "submit_batches", "(", "self", ",", "request", ")", ":", "timer_ctx", "=", "self", ".", "_post_batches_total_time", ".", "time", "(", ")", "self", ".", "_post_batches_count", ".", "inc", "(", ")", "# Parse request", "if", "request", ".", "hea...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.list_statuses
Fetches the committed status of batches by either a POST or GET. Request: body: A JSON array of one or more id strings (if POST) query: - id: A comma separated list of up to 15 ids (if GET) - wait: Request should not return until all batches committed ...
rest_api/sawtooth_rest_api/route_handlers.py
async def list_statuses(self, request): """Fetches the committed status of batches by either a POST or GET. Request: body: A JSON array of one or more id strings (if POST) query: - id: A comma separated list of up to 15 ids (if GET) - wait: Reques...
async def list_statuses(self, request): """Fetches the committed status of batches by either a POST or GET. Request: body: A JSON array of one or more id strings (if POST) query: - id: A comma separated list of up to 15 ids (if GET) - wait: Reques...
[ "Fetches", "the", "committed", "status", "of", "batches", "by", "either", "a", "POST", "or", "GET", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L187-L247
[ "async", "def", "list_statuses", "(", "self", ",", "request", ")", ":", "error_traps", "=", "[", "error_handlers", ".", "StatusResponseMissing", "]", "# Parse batch ids from POST body, or query paramaters", "if", "request", ".", "method", "==", "'POST'", ":", "if", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.list_state
Fetches list of data entries, optionally filtered by address prefix. Request: query: - head: The id of the block to use as the head of the chain - address: Return entries whose addresses begin with this prefix Response: data: An a...
rest_api/sawtooth_rest_api/route_handlers.py
async def list_state(self, request): """Fetches list of data entries, optionally filtered by address prefix. Request: query: - head: The id of the block to use as the head of the chain - address: Return entries whose addresses begin with this ...
async def list_state(self, request): """Fetches list of data entries, optionally filtered by address prefix. Request: query: - head: The id of the block to use as the head of the chain - address: Return entries whose addresses begin with this ...
[ "Fetches", "list", "of", "data", "entries", "optionally", "filtered", "by", "address", "prefix", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L249-L284
[ "async", "def", "list_state", "(", "self", ",", "request", ")", ":", "paging_controls", "=", "self", ".", "_get_paging_controls", "(", "request", ")", "head", ",", "root", "=", "await", "self", ".", "_head_to_root", "(", "request", ".", "url", ".", "query"...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.fetch_state
Fetches data from a specific address in the validator's state tree. Request: query: - head: The id of the block to use as the head of the chain - address: The 70 character address of the data to be fetched Response: data: The base64 encoded binar...
rest_api/sawtooth_rest_api/route_handlers.py
async def fetch_state(self, request): """Fetches data from a specific address in the validator's state tree. Request: query: - head: The id of the block to use as the head of the chain - address: The 70 character address of the data to be fetched Res...
async def fetch_state(self, request): """Fetches data from a specific address in the validator's state tree. Request: query: - head: The id of the block to use as the head of the chain - address: The 70 character address of the data to be fetched Res...
[ "Fetches", "data", "from", "a", "specific", "address", "in", "the", "validator", "s", "state", "tree", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L286-L317
[ "async", "def", "fetch_state", "(", "self", ",", "request", ")", ":", "error_traps", "=", "[", "error_handlers", ".", "InvalidAddressTrap", ",", "error_handlers", ".", "StateNotFoundTrap", "]", "address", "=", "request", ".", "match_info", ".", "get", "(", "'a...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.list_blocks
Fetches list of blocks from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of block ids to include in results Response: data: JSON array of fully expand...
rest_api/sawtooth_rest_api/route_handlers.py
async def list_blocks(self, request): """Fetches list of blocks from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of block ids to include in results Respo...
async def list_blocks(self, request): """Fetches list of blocks from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of block ids to include in results Respo...
[ "Fetches", "list", "of", "blocks", "from", "validator", "optionally", "filtered", "by", "id", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L319-L349
[ "async", "def", "list_blocks", "(", "self", ",", "request", ")", ":", "paging_controls", "=", "self", ".", "_get_paging_controls", "(", "request", ")", "validator_query", "=", "client_block_pb2", ".", "ClientBlockListRequest", "(", "head_id", "=", "self", ".", "...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.fetch_block
Fetches a specific block from the validator, specified by id. Request: path: - block_id: The 128-character id of the block to be fetched Response: data: A JSON object with the data from the fully expanded Block link: The link to this exact query
rest_api/sawtooth_rest_api/route_handlers.py
async def fetch_block(self, request): """Fetches a specific block from the validator, specified by id. Request: path: - block_id: The 128-character id of the block to be fetched Response: data: A JSON object with the data from the fully expanded Block ...
async def fetch_block(self, request): """Fetches a specific block from the validator, specified by id. Request: path: - block_id: The 128-character id of the block to be fetched Response: data: A JSON object with the data from the fully expanded Block ...
[ "Fetches", "a", "specific", "block", "from", "the", "validator", "specified", "by", "id", ".", "Request", ":", "path", ":", "-", "block_id", ":", "The", "128", "-", "character", "id", "of", "the", "block", "to", "be", "fetched" ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L351-L375
[ "async", "def", "fetch_block", "(", "self", ",", "request", ")", ":", "error_traps", "=", "[", "error_handlers", ".", "BlockNotFoundTrap", "]", "block_id", "=", "request", ".", "match_info", ".", "get", "(", "'block_id'", ",", "''", ")", "self", ".", "_val...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.list_batches
Fetches list of batches from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of batch ids to include in results Response: data: JSON array of fully expan...
rest_api/sawtooth_rest_api/route_handlers.py
async def list_batches(self, request): """Fetches list of batches from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of batch ids to include in results Res...
async def list_batches(self, request): """Fetches list of batches from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of batch ids to include in results Res...
[ "Fetches", "list", "of", "batches", "from", "validator", "optionally", "filtered", "by", "id", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L377-L407
[ "async", "def", "list_batches", "(", "self", ",", "request", ")", ":", "paging_controls", "=", "self", ".", "_get_paging_controls", "(", "request", ")", "validator_query", "=", "client_batch_pb2", ".", "ClientBatchListRequest", "(", "head_id", "=", "self", ".", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.fetch_batch
Fetches a specific batch from the validator, specified by id. Request: path: - batch_id: The 128-character id of the batch to be fetched Response: data: A JSON object with the data from the fully expanded Batch link: The link to this exact query
rest_api/sawtooth_rest_api/route_handlers.py
async def fetch_batch(self, request): """Fetches a specific batch from the validator, specified by id. Request: path: - batch_id: The 128-character id of the batch to be fetched Response: data: A JSON object with the data from the fully expanded Batch ...
async def fetch_batch(self, request): """Fetches a specific batch from the validator, specified by id. Request: path: - batch_id: The 128-character id of the batch to be fetched Response: data: A JSON object with the data from the fully expanded Batch ...
[ "Fetches", "a", "specific", "batch", "from", "the", "validator", "specified", "by", "id", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L409-L434
[ "async", "def", "fetch_batch", "(", "self", ",", "request", ")", ":", "error_traps", "=", "[", "error_handlers", ".", "BatchNotFoundTrap", "]", "batch_id", "=", "request", ".", "match_info", ".", "get", "(", "'batch_id'", ",", "''", ")", "self", ".", "_val...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.list_transactions
Fetches list of txns from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of txn ids to include in results Response: data: JSON array of Transaction obje...
rest_api/sawtooth_rest_api/route_handlers.py
async def list_transactions(self, request): """Fetches list of txns from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of txn ids to include in results Res...
async def list_transactions(self, request): """Fetches list of txns from validator, optionally filtered by id. Request: query: - head: The id of the block to use as the head of the chain - id: Comma separated list of txn ids to include in results Res...
[ "Fetches", "list", "of", "txns", "from", "validator", "optionally", "filtered", "by", "id", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L436-L468
[ "async", "def", "list_transactions", "(", "self", ",", "request", ")", ":", "paging_controls", "=", "self", ".", "_get_paging_controls", "(", "request", ")", "validator_query", "=", "client_transaction_pb2", ".", "ClientTransactionListRequest", "(", "head_id", "=", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.fetch_transaction
Fetches a specific transaction from the validator, specified by id. Request: path: - transaction_id: The 128-character id of the txn to be fetched Response: data: A JSON object with the data from the expanded Transaction link: The link to this exact ...
rest_api/sawtooth_rest_api/route_handlers.py
async def fetch_transaction(self, request): """Fetches a specific transaction from the validator, specified by id. Request: path: - transaction_id: The 128-character id of the txn to be fetched Response: data: A JSON object with the data from the expande...
async def fetch_transaction(self, request): """Fetches a specific transaction from the validator, specified by id. Request: path: - transaction_id: The 128-character id of the txn to be fetched Response: data: A JSON object with the data from the expande...
[ "Fetches", "a", "specific", "transaction", "from", "the", "validator", "specified", "by", "id", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L470-L496
[ "async", "def", "fetch_transaction", "(", "self", ",", "request", ")", ":", "error_traps", "=", "[", "error_handlers", ".", "TransactionNotFoundTrap", "]", "txn_id", "=", "request", ".", "match_info", ".", "get", "(", "'transaction_id'", ",", "''", ")", "self"...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.list_receipts
Fetches the receipts for transaction by either a POST or GET. Request: body: A JSON array of one or more transaction id strings (if POST) query: - id: A comma separated list of up to 15 ids (if GET) - wait: Request should return as soon as some receipts a...
rest_api/sawtooth_rest_api/route_handlers.py
async def list_receipts(self, request): """Fetches the receipts for transaction by either a POST or GET. Request: body: A JSON array of one or more transaction id strings (if POST) query: - id: A comma separated list of up to 15 ids (if GET) - wai...
async def list_receipts(self, request): """Fetches the receipts for transaction by either a POST or GET. Request: body: A JSON array of one or more transaction id strings (if POST) query: - id: A comma separated list of up to 15 ids (if GET) - wai...
[ "Fetches", "the", "receipts", "for", "transaction", "by", "either", "a", "POST", "or", "GET", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L498-L560
[ "async", "def", "list_receipts", "(", "self", ",", "request", ")", ":", "error_traps", "=", "[", "error_handlers", ".", "ReceiptNotFoundTrap", "]", "# Parse transaction ids from POST body, or query paramaters", "if", "request", ".", "method", "==", "'POST'", ":", "if"...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.fetch_peers
Fetches the peers from the validator. Request: Response: data: JSON array of peer endpoints link: The link to this exact query
rest_api/sawtooth_rest_api/route_handlers.py
async def fetch_peers(self, request): """Fetches the peers from the validator. Request: Response: data: JSON array of peer endpoints link: The link to this exact query """ response = await self._query_validator( Message.CLIENT_PEERS_GET_REQUE...
async def fetch_peers(self, request): """Fetches the peers from the validator. Request: Response: data: JSON array of peer endpoints link: The link to this exact query """ response = await self._query_validator( Message.CLIENT_PEERS_GET_REQUE...
[ "Fetches", "the", "peers", "from", "the", "validator", ".", "Request", ":" ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L562-L579
[ "async", "def", "fetch_peers", "(", "self", ",", "request", ")", ":", "response", "=", "await", "self", ".", "_query_validator", "(", "Message", ".", "CLIENT_PEERS_GET_REQUEST", ",", "client_peers_pb2", ".", "ClientPeersGetResponse", ",", "client_peers_pb2", ".", ...
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler.fetch_status
Fetches information pertaining to the valiator's status.
rest_api/sawtooth_rest_api/route_handlers.py
async def fetch_status(self, request): '''Fetches information pertaining to the valiator's status.''' response = await self._query_validator( Message.CLIENT_STATUS_GET_REQUEST, client_status_pb2.ClientStatusGetResponse, client_status_pb2.ClientStatusGetRequest()) ...
async def fetch_status(self, request): '''Fetches information pertaining to the valiator's status.''' response = await self._query_validator( Message.CLIENT_STATUS_GET_REQUEST, client_status_pb2.ClientStatusGetResponse, client_status_pb2.ClientStatusGetRequest()) ...
[ "Fetches", "information", "pertaining", "to", "the", "valiator", "s", "status", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L581-L595
[ "async", "def", "fetch_status", "(", "self", ",", "request", ")", ":", "response", "=", "await", "self", ".", "_query_validator", "(", "Message", ".", "CLIENT_STATUS_GET_REQUEST", ",", "client_status_pb2", ".", "ClientStatusGetResponse", ",", "client_status_pb2", "....
8cf473bc2207e51f02bd182d825158a57d72b098
train
RouteHandler._query_validator
Sends a request to the validator and parses the response.
rest_api/sawtooth_rest_api/route_handlers.py
async def _query_validator(self, request_type, response_proto, payload, error_traps=None): """Sends a request to the validator and parses the response. """ LOGGER.debug( 'Sending %s request to validator', self._get_type_name(request_type)) ...
async def _query_validator(self, request_type, response_proto, payload, error_traps=None): """Sends a request to the validator and parses the response. """ LOGGER.debug( 'Sending %s request to validator', self._get_type_name(request_type)) ...
[ "Sends", "a", "request", "to", "the", "validator", "and", "parses", "the", "response", "." ]
hyperledger/sawtooth-core
python
https://github.com/hyperledger/sawtooth-core/blob/8cf473bc2207e51f02bd182d825158a57d72b098/rest_api/sawtooth_rest_api/route_handlers.py#L597-L615
[ "async", "def", "_query_validator", "(", "self", ",", "request_type", ",", "response_proto", ",", "payload", ",", "error_traps", "=", "None", ")", ":", "LOGGER", ".", "debug", "(", "'Sending %s request to validator'", ",", "self", ".", "_get_type_name", "(", "re...
8cf473bc2207e51f02bd182d825158a57d72b098