repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
kislyuk/aegea | aegea/packages/github3/repos/release.py | Release.iter_assets | def iter_assets(self, number=-1, etag=None):
"""Iterate over the assets available for this release.
:param int number: (optional), Number of assets to return
:param str etag: (optional), last ETag header sent
:returns: generator of :class:`Asset <Asset>` objects
"""
url ... | python | def iter_assets(self, number=-1, etag=None):
"""Iterate over the assets available for this release.
:param int number: (optional), Number of assets to return
:param str etag: (optional), last ETag header sent
:returns: generator of :class:`Asset <Asset>` objects
"""
url ... | [
"def",
"iter_assets",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'assets'",
",",
"base_url",
"=",
"self",
".",
"_api",
")",
"return",
"self",
".",
"_iter",
"(",
"numbe... | Iterate over the assets available for this release.
:param int number: (optional), Number of assets to return
:param str etag: (optional), last ETag header sent
:returns: generator of :class:`Asset <Asset>` objects | [
"Iterate",
"over",
"the",
"assets",
"available",
"for",
"this",
"release",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/release.py#L108-L116 | train |
kislyuk/aegea | aegea/packages/github3/repos/release.py | Release.upload_asset | def upload_asset(self, content_type, name, asset):
"""Upload an asset to this release.
All parameters are required.
:param str content_type: The content type of the asset. Wikipedia has
a list of common media types
:param str name: The name of the file
:param asset:... | python | def upload_asset(self, content_type, name, asset):
"""Upload an asset to this release.
All parameters are required.
:param str content_type: The content type of the asset. Wikipedia has
a list of common media types
:param str name: The name of the file
:param asset:... | [
"def",
"upload_asset",
"(",
"self",
",",
"content_type",
",",
"name",
",",
"asset",
")",
":",
"headers",
"=",
"Release",
".",
"CUSTOM_HEADERS",
".",
"copy",
"(",
")",
"headers",
".",
"update",
"(",
"{",
"'Content-Type'",
":",
"content_type",
"}",
")",
"u... | Upload an asset to this release.
All parameters are required.
:param str content_type: The content type of the asset. Wikipedia has
a list of common media types
:param str name: The name of the file
:param asset: The file or bytes object to upload.
:returns: :class:... | [
"Upload",
"an",
"asset",
"to",
"this",
"release",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/release.py#L119-L137 | train |
kislyuk/aegea | aegea/packages/github3/repos/release.py | Asset.download | def download(self, path=''):
"""Download the data for this asset.
:param path: (optional), path where the file should be saved
to, default is the filename provided in the headers and will be
written in the current directory.
it can take a file-like object as well
... | python | def download(self, path=''):
"""Download the data for this asset.
:param path: (optional), path where the file should be saved
to, default is the filename provided in the headers and will be
written in the current directory.
it can take a file-like object as well
... | [
"def",
"download",
"(",
"self",
",",
"path",
"=",
"''",
")",
":",
"headers",
"=",
"{",
"'Accept'",
":",
"'application/octet-stream'",
"}",
"resp",
"=",
"self",
".",
"_get",
"(",
"self",
".",
"_api",
",",
"allow_redirects",
"=",
"False",
",",
"stream",
... | Download the data for this asset.
:param path: (optional), path where the file should be saved
to, default is the filename provided in the headers and will be
written in the current directory.
it can take a file-like object as well
:type path: str, file
:retu... | [
"Download",
"the",
"data",
"for",
"this",
"asset",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/release.py#L169-L197 | train |
kislyuk/aegea | aegea/packages/github3/repos/release.py | Asset.edit | def edit(self, name, label=None):
"""Edit this asset.
:param str name: (required), The file name of the asset
:param str label: (optional), An alternate description of the asset
:returns: boolean
"""
if not name:
return False
edit_data = {'name': name... | python | def edit(self, name, label=None):
"""Edit this asset.
:param str name: (required), The file name of the asset
:param str label: (optional), An alternate description of the asset
:returns: boolean
"""
if not name:
return False
edit_data = {'name': name... | [
"def",
"edit",
"(",
"self",
",",
"name",
",",
"label",
"=",
"None",
")",
":",
"if",
"not",
"name",
":",
"return",
"False",
"edit_data",
"=",
"{",
"'name'",
":",
"name",
",",
"'label'",
":",
"label",
"}",
"self",
".",
"_remove_none",
"(",
"edit_data",... | Edit this asset.
:param str name: (required), The file name of the asset
:param str label: (optional), An alternate description of the asset
:returns: boolean | [
"Edit",
"this",
"asset",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/release.py#L199-L219 | train |
kislyuk/aegea | aegea/deploy.py | ls | def ls(args):
"""
List status of all configured SNS-SQS message buses and instances subscribed to them.
"""
table = []
queues = list(resources.sqs.queues.filter(QueueNamePrefix="github"))
max_age = datetime.now(tzutc()) - timedelta(days=15)
for topic in resources.sns.topics.all():
ac... | python | def ls(args):
"""
List status of all configured SNS-SQS message buses and instances subscribed to them.
"""
table = []
queues = list(resources.sqs.queues.filter(QueueNamePrefix="github"))
max_age = datetime.now(tzutc()) - timedelta(days=15)
for topic in resources.sns.topics.all():
ac... | [
"def",
"ls",
"(",
"args",
")",
":",
"table",
"=",
"[",
"]",
"queues",
"=",
"list",
"(",
"resources",
".",
"sqs",
".",
"queues",
".",
"filter",
"(",
"QueueNamePrefix",
"=",
"\"github\"",
")",
")",
"max_age",
"=",
"datetime",
".",
"now",
"(",
"tzutc",
... | List status of all configured SNS-SQS message buses and instances subscribed to them. | [
"List",
"status",
"of",
"all",
"configured",
"SNS",
"-",
"SQS",
"message",
"buses",
"and",
"instances",
"subscribed",
"to",
"them",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/deploy.py#L93-L125 | train |
kislyuk/aegea | aegea/deploy.py | grant | def grant(args):
"""
Given an IAM role or instance name, attach an IAM policy granting
appropriate permissions to subscribe to deployments. Given a
GitHub repo URL, create and record deployment keys for the repo
and any of its private submodules, making the keys accessible to
the IAM role.
"... | python | def grant(args):
"""
Given an IAM role or instance name, attach an IAM policy granting
appropriate permissions to subscribe to deployments. Given a
GitHub repo URL, create and record deployment keys for the repo
and any of its private submodules, making the keys accessible to
the IAM role.
"... | [
"def",
"grant",
"(",
"args",
")",
":",
"try",
":",
"role",
"=",
"resources",
".",
"iam",
".",
"Role",
"(",
"args",
".",
"iam_role_or_instance",
")",
"role",
".",
"load",
"(",
")",
"except",
"ClientError",
":",
"role",
"=",
"get_iam_role_for_instance",
"(... | Given an IAM role or instance name, attach an IAM policy granting
appropriate permissions to subscribe to deployments. Given a
GitHub repo URL, create and record deployment keys for the repo
and any of its private submodules, making the keys accessible to
the IAM role. | [
"Given",
"an",
"IAM",
"role",
"or",
"instance",
"name",
"attach",
"an",
"IAM",
"policy",
"granting",
"appropriate",
"permissions",
"to",
"subscribe",
"to",
"deployments",
".",
"Given",
"a",
"GitHub",
"repo",
"URL",
"create",
"and",
"record",
"deployment",
"key... | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/deploy.py#L138-L162 | train |
kislyuk/aegea | aegea/packages/github3/repos/contents.py | Contents.delete | def delete(self, message, branch=None, committer=None, author=None):
"""Delete this file.
:param str message: (required), commit message to describe the removal
:param str branch: (optional), branch where the file exists.
Defaults to the default branch of the repository.
:pa... | python | def delete(self, message, branch=None, committer=None, author=None):
"""Delete this file.
:param str message: (required), commit message to describe the removal
:param str branch: (optional), branch where the file exists.
Defaults to the default branch of the repository.
:pa... | [
"def",
"delete",
"(",
"self",
",",
"message",
",",
"branch",
"=",
"None",
",",
"committer",
"=",
"None",
",",
"author",
"=",
"None",
")",
":",
"json",
"=",
"None",
"if",
"message",
":",
"data",
"=",
"{",
"'message'",
":",
"message",
",",
"'sha'",
"... | Delete this file.
:param str message: (required), commit message to describe the removal
:param str branch: (optional), branch where the file exists.
Defaults to the default branch of the repository.
:param dict committer: (optional), if no information is given the
authe... | [
"Delete",
"this",
"file",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/contents.py#L97-L121 | train |
kislyuk/aegea | aegea/packages/github3/repos/contents.py | Contents.update | def update(self, message, content, branch=None, committer=None,
author=None):
"""Update this file.
:param str message: (required), commit message to describe the update
:param str content: (required), content to update the file with
:param str branch: (optional), branch w... | python | def update(self, message, content, branch=None, committer=None,
author=None):
"""Update this file.
:param str message: (required), commit message to describe the update
:param str content: (required), content to update the file with
:param str branch: (optional), branch w... | [
"def",
"update",
"(",
"self",
",",
"message",
",",
"content",
",",
"branch",
"=",
"None",
",",
"committer",
"=",
"None",
",",
"author",
"=",
"None",
")",
":",
"if",
"content",
"and",
"not",
"isinstance",
"(",
"content",
",",
"bytes",
")",
":",
"raise... | Update this file.
:param str message: (required), commit message to describe the update
:param str content: (required), content to update the file with
:param str branch: (optional), branch where the file exists.
Defaults to the default branch of the repository.
:param dict ... | [
"Update",
"this",
"file",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/contents.py#L124-L157 | train |
kislyuk/aegea | aegea/packages/github3/gists/gist.py | Gist.edit | def edit(self, description='', files={}):
"""Edit this gist.
:param str description: (optional), description of the gist
:param dict files: (optional), files that make up this gist; the
key(s) should be the file name(s) and the values should be another
(optional) diction... | python | def edit(self, description='', files={}):
"""Edit this gist.
:param str description: (optional), description of the gist
:param dict files: (optional), files that make up this gist; the
key(s) should be the file name(s) and the values should be another
(optional) diction... | [
"def",
"edit",
"(",
"self",
",",
"description",
"=",
"''",
",",
"files",
"=",
"{",
"}",
")",
":",
"data",
"=",
"{",
"}",
"json",
"=",
"None",
"if",
"description",
":",
"data",
"[",
"'description'",
"]",
"=",
"description",
"if",
"files",
":",
"data... | Edit this gist.
:param str description: (optional), description of the gist
:param dict files: (optional), files that make up this gist; the
key(s) should be the file name(s) and the values should be another
(optional) dictionary with (optional) keys: 'content' and
'... | [
"Edit",
"this",
"gist",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/gists/gist.py#L137-L160 | train |
kislyuk/aegea | aegea/packages/github3/gists/gist.py | Gist.fork | def fork(self):
"""Fork this gist.
:returns: :class:`Gist <Gist>` if successful, ``None`` otherwise
"""
url = self._build_url('forks', base_url=self._api)
json = self._json(self._post(url), 201)
return Gist(json, self) if json else None | python | def fork(self):
"""Fork this gist.
:returns: :class:`Gist <Gist>` if successful, ``None`` otherwise
"""
url = self._build_url('forks', base_url=self._api)
json = self._json(self._post(url), 201)
return Gist(json, self) if json else None | [
"def",
"fork",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'forks'",
",",
"base_url",
"=",
"self",
".",
"_api",
")",
"json",
"=",
"self",
".",
"_json",
"(",
"self",
".",
"_post",
"(",
"url",
")",
",",
"201",
")",
"return",... | Fork this gist.
:returns: :class:`Gist <Gist>` if successful, ``None`` otherwise | [
"Fork",
"this",
"gist",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/gists/gist.py#L163-L171 | train |
kislyuk/aegea | aegea/packages/github3/gists/gist.py | Gist.is_starred | def is_starred(self):
"""Check to see if this gist is starred by the authenticated user.
:returns: bool -- True if it is starred, False otherwise
"""
url = self._build_url('star', base_url=self._api)
return self._boolean(self._get(url), 204, 404) | python | def is_starred(self):
"""Check to see if this gist is starred by the authenticated user.
:returns: bool -- True if it is starred, False otherwise
"""
url = self._build_url('star', base_url=self._api)
return self._boolean(self._get(url), 204, 404) | [
"def",
"is_starred",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'star'",
",",
"base_url",
"=",
"self",
".",
"_api",
")",
"return",
"self",
".",
"_boolean",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"204",
",",
"404",
... | Check to see if this gist is starred by the authenticated user.
:returns: bool -- True if it is starred, False otherwise | [
"Check",
"to",
"see",
"if",
"this",
"gist",
"is",
"starred",
"by",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/gists/gist.py#L182-L189 | train |
kislyuk/aegea | aegea/packages/github3/gists/gist.py | Gist.iter_commits | def iter_commits(self, number=-1, etag=None):
"""Iter over the commits on this gist.
These commits will be requested from the API and should be the same as
what is in ``Gist.history``.
.. versionadded:: 0.6
.. versionchanged:: 0.9
Added param ``etag``.
:p... | python | def iter_commits(self, number=-1, etag=None):
"""Iter over the commits on this gist.
These commits will be requested from the API and should be the same as
what is in ``Gist.history``.
.. versionadded:: 0.6
.. versionchanged:: 0.9
Added param ``etag``.
:p... | [
"def",
"iter_commits",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'commits'",
",",
"base_url",
"=",
"self",
".",
"_api",
")",
"return",
"self",
".",
"_iter",
"(",
"int... | Iter over the commits on this gist.
These commits will be requested from the API and should be the same as
what is in ``Gist.history``.
.. versionadded:: 0.6
.. versionchanged:: 0.9
Added param ``etag``.
:param int number: (optional), number of commits to iterate... | [
"Iter",
"over",
"the",
"commits",
"on",
"this",
"gist",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/gists/gist.py#L205-L227 | train |
kislyuk/aegea | aegea/packages/github3/gists/gist.py | Gist.iter_forks | def iter_forks(self, number=-1, etag=None):
"""Iterator of forks of this gist.
.. versionchanged:: 0.9
Added params ``number`` and ``etag``.
:param int number: (optional), number of forks to iterate over.
Default: -1 will iterate over all forks of this gist.
:p... | python | def iter_forks(self, number=-1, etag=None):
"""Iterator of forks of this gist.
.. versionchanged:: 0.9
Added params ``number`` and ``etag``.
:param int number: (optional), number of forks to iterate over.
Default: -1 will iterate over all forks of this gist.
:p... | [
"def",
"iter_forks",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'forks'",
",",
"base_url",
"=",
"self",
".",
"_api",
")",
"return",
"self",
".",
"_iter",
"(",
"int",
... | Iterator of forks of this gist.
.. versionchanged:: 0.9
Added params ``number`` and ``etag``.
:param int number: (optional), number of forks to iterate over.
Default: -1 will iterate over all forks of this gist.
:param str etag: (optional), ETag from a previous request... | [
"Iterator",
"of",
"forks",
"of",
"this",
"gist",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/gists/gist.py#L237-L252 | train |
kislyuk/aegea | aegea/packages/github3/gists/gist.py | Gist.star | def star(self):
"""Star this gist.
:returns: bool -- True if successful, False otherwise
"""
url = self._build_url('star', base_url=self._api)
return self._boolean(self._put(url), 204, 404) | python | def star(self):
"""Star this gist.
:returns: bool -- True if successful, False otherwise
"""
url = self._build_url('star', base_url=self._api)
return self._boolean(self._put(url), 204, 404) | [
"def",
"star",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'star'",
",",
"base_url",
"=",
"self",
".",
"_api",
")",
"return",
"self",
".",
"_boolean",
"(",
"self",
".",
"_put",
"(",
"url",
")",
",",
"204",
",",
"404",
")"
... | Star this gist.
:returns: bool -- True if successful, False otherwise | [
"Star",
"this",
"gist",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/gists/gist.py#L255-L262 | train |
kislyuk/aegea | aegea/packages/github3/gists/gist.py | Gist.unstar | def unstar(self):
"""Un-star this gist.
:returns: bool -- True if successful, False otherwise
"""
url = self._build_url('star', base_url=self._api)
return self._boolean(self._delete(url), 204, 404) | python | def unstar(self):
"""Un-star this gist.
:returns: bool -- True if successful, False otherwise
"""
url = self._build_url('star', base_url=self._api)
return self._boolean(self._delete(url), 204, 404) | [
"def",
"unstar",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'star'",
",",
"base_url",
"=",
"self",
".",
"_api",
")",
"return",
"self",
".",
"_boolean",
"(",
"self",
".",
"_delete",
"(",
"url",
")",
",",
"204",
",",
"404",
... | Un-star this gist.
:returns: bool -- True if successful, False otherwise | [
"Un",
"-",
"star",
"this",
"gist",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/gists/gist.py#L265-L272 | train |
kislyuk/aegea | aegea/packages/github3/repos/comment.py | RepoComment.update | def update(self, body):
"""Update this comment.
:param str body: (required)
:returns: bool
"""
json = None
if body:
json = self._json(self._post(self._api, data={'body': body}), 200)
if json:
self._update_(json)
return True
... | python | def update(self, body):
"""Update this comment.
:param str body: (required)
:returns: bool
"""
json = None
if body:
json = self._json(self._post(self._api, data={'body': body}), 200)
if json:
self._update_(json)
return True
... | [
"def",
"update",
"(",
"self",
",",
"body",
")",
":",
"json",
"=",
"None",
"if",
"body",
":",
"json",
"=",
"self",
".",
"_json",
"(",
"self",
".",
"_post",
"(",
"self",
".",
"_api",
",",
"data",
"=",
"{",
"'body'",
":",
"body",
"}",
")",
",",
... | Update this comment.
:param str body: (required)
:returns: bool | [
"Update",
"this",
"comment",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/comment.py#L60-L73 | train |
kislyuk/aegea | aegea/ssh.py | scp | def scp(args):
"""
Transfer files to or from EC2 instance.
Use "--" to separate scp args from aegea args:
aegea scp -- -r local_dir instance_name:~/remote_dir
"""
if args.scp_args[0] == "--":
del args.scp_args[0]
user_or_hostname_chars = string.ascii_letters + string.digits
... | python | def scp(args):
"""
Transfer files to or from EC2 instance.
Use "--" to separate scp args from aegea args:
aegea scp -- -r local_dir instance_name:~/remote_dir
"""
if args.scp_args[0] == "--":
del args.scp_args[0]
user_or_hostname_chars = string.ascii_letters + string.digits
... | [
"def",
"scp",
"(",
"args",
")",
":",
"if",
"args",
".",
"scp_args",
"[",
"0",
"]",
"==",
"\"--\"",
":",
"del",
"args",
".",
"scp_args",
"[",
"0",
"]",
"user_or_hostname_chars",
"=",
"string",
".",
"ascii_letters",
"+",
"string",
".",
"digits",
"for",
... | Transfer files to or from EC2 instance.
Use "--" to separate scp args from aegea args:
aegea scp -- -r local_dir instance_name:~/remote_dir | [
"Transfer",
"files",
"to",
"or",
"from",
"EC2",
"instance",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/ssh.py#L61-L83 | train |
kislyuk/aegea | aegea/buckets.py | ls | def ls(args):
"""
List S3 buckets. See also "aws s3 ls". Use "aws s3 ls NAME" to list bucket contents.
"""
table = []
for bucket in filter_collection(resources.s3.buckets, args):
bucket.LocationConstraint = clients.s3.get_bucket_location(Bucket=bucket.name)["LocationConstraint"]
clou... | python | def ls(args):
"""
List S3 buckets. See also "aws s3 ls". Use "aws s3 ls NAME" to list bucket contents.
"""
table = []
for bucket in filter_collection(resources.s3.buckets, args):
bucket.LocationConstraint = clients.s3.get_bucket_location(Bucket=bucket.name)["LocationConstraint"]
clou... | [
"def",
"ls",
"(",
"args",
")",
":",
"table",
"=",
"[",
"]",
"for",
"bucket",
"in",
"filter_collection",
"(",
"resources",
".",
"s3",
".",
"buckets",
",",
"args",
")",
":",
"bucket",
".",
"LocationConstraint",
"=",
"clients",
".",
"s3",
".",
"get_bucket... | List S3 buckets. See also "aws s3 ls". Use "aws s3 ls NAME" to list bucket contents. | [
"List",
"S3",
"buckets",
".",
"See",
"also",
"aws",
"s3",
"ls",
".",
"Use",
"aws",
"s3",
"ls",
"NAME",
"to",
"list",
"bucket",
"contents",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/buckets.py#L21-L43 | train |
kislyuk/aegea | aegea/packages/github3/issues/label.py | Label.update | def update(self, name, color):
"""Update this label.
:param str name: (required), new name of the label
:param str color: (required), color code, e.g., 626262, no leading '#'
:returns: bool
"""
json = None
if name and color:
if color[0] == '#':
... | python | def update(self, name, color):
"""Update this label.
:param str name: (required), new name of the label
:param str color: (required), color code, e.g., 626262, no leading '#'
:returns: bool
"""
json = None
if name and color:
if color[0] == '#':
... | [
"def",
"update",
"(",
"self",
",",
"name",
",",
"color",
")",
":",
"json",
"=",
"None",
"if",
"name",
"and",
"color",
":",
"if",
"color",
"[",
"0",
"]",
"==",
"'#'",
":",
"color",
"=",
"color",
"[",
"1",
":",
"]",
"json",
"=",
"self",
".",
"_... | Update this label.
:param str name: (required), new name of the label
:param str color: (required), color code, e.g., 626262, no leading '#'
:returns: bool | [
"Update",
"this",
"label",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/issues/label.py#L43-L62 | train |
kislyuk/aegea | aegea/packages/github3/session.py | GitHubSession.basic_auth | def basic_auth(self, username, password):
"""Set the Basic Auth credentials on this Session.
:param str username: Your GitHub username
:param str password: Your GitHub password
"""
if not (username and password):
return
self.auth = (username, password)
... | python | def basic_auth(self, username, password):
"""Set the Basic Auth credentials on this Session.
:param str username: Your GitHub username
:param str password: Your GitHub password
"""
if not (username and password):
return
self.auth = (username, password)
... | [
"def",
"basic_auth",
"(",
"self",
",",
"username",
",",
"password",
")",
":",
"if",
"not",
"(",
"username",
"and",
"password",
")",
":",
"return",
"self",
".",
"auth",
"=",
"(",
"username",
",",
"password",
")",
"# Disable token authentication",
"self",
".... | Set the Basic Auth credentials on this Session.
:param str username: Your GitHub username
:param str password: Your GitHub password | [
"Set",
"the",
"Basic",
"Auth",
"credentials",
"on",
"this",
"Session",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/session.py#L36-L48 | train |
kislyuk/aegea | aegea/packages/github3/session.py | GitHubSession.build_url | def build_url(self, *args, **kwargs):
"""Builds a new API url from scratch."""
parts = [kwargs.get('base_url') or self.base_url]
parts.extend(args)
parts = [str(p) for p in parts]
key = tuple(parts)
__logs__.info('Building a url from %s', key)
if not key in __url_... | python | def build_url(self, *args, **kwargs):
"""Builds a new API url from scratch."""
parts = [kwargs.get('base_url') or self.base_url]
parts.extend(args)
parts = [str(p) for p in parts]
key = tuple(parts)
__logs__.info('Building a url from %s', key)
if not key in __url_... | [
"def",
"build_url",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"parts",
"=",
"[",
"kwargs",
".",
"get",
"(",
"'base_url'",
")",
"or",
"self",
".",
"base_url",
"]",
"parts",
".",
"extend",
"(",
"args",
")",
"parts",
"=",
"["... | Builds a new API url from scratch. | [
"Builds",
"a",
"new",
"API",
"url",
"from",
"scratch",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/session.py#L50-L60 | train |
kislyuk/aegea | aegea/packages/github3/session.py | GitHubSession.retrieve_client_credentials | def retrieve_client_credentials(self):
"""Return the client credentials.
:returns: tuple(client_id, client_secret)
"""
client_id = self.params.get('client_id')
client_secret = self.params.get('client_secret')
return (client_id, client_secret) | python | def retrieve_client_credentials(self):
"""Return the client credentials.
:returns: tuple(client_id, client_secret)
"""
client_id = self.params.get('client_id')
client_secret = self.params.get('client_secret')
return (client_id, client_secret) | [
"def",
"retrieve_client_credentials",
"(",
"self",
")",
":",
"client_id",
"=",
"self",
".",
"params",
".",
"get",
"(",
"'client_id'",
")",
"client_secret",
"=",
"self",
".",
"params",
".",
"get",
"(",
"'client_secret'",
")",
"return",
"(",
"client_id",
",",
... | Return the client credentials.
:returns: tuple(client_id, client_secret) | [
"Return",
"the",
"client",
"credentials",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/session.py#L90-L97 | train |
kislyuk/aegea | aegea/packages/github3/session.py | GitHubSession.token_auth | def token_auth(self, token):
"""Use an application token for authentication.
:param str token: Application token retrieved from GitHub's
/authorizations endpoint
"""
if not token:
return
self.headers.update({
'Authorization': 'token {0}'.form... | python | def token_auth(self, token):
"""Use an application token for authentication.
:param str token: Application token retrieved from GitHub's
/authorizations endpoint
"""
if not token:
return
self.headers.update({
'Authorization': 'token {0}'.form... | [
"def",
"token_auth",
"(",
"self",
",",
"token",
")",
":",
"if",
"not",
"token",
":",
"return",
"self",
".",
"headers",
".",
"update",
"(",
"{",
"'Authorization'",
":",
"'token {0}'",
".",
"format",
"(",
"token",
")",
"}",
")",
"# Unset username/password so... | Use an application token for authentication.
:param str token: Application token retrieved from GitHub's
/authorizations endpoint | [
"Use",
"an",
"application",
"token",
"for",
"authentication",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/session.py#L108-L121 | train |
kislyuk/aegea | aegea/packages/github3/session.py | GitHubSession.no_auth | def no_auth(self):
"""Unset authentication temporarily as a context manager."""
old_basic_auth, self.auth = self.auth, None
old_token_auth = self.headers.pop('Authorization', None)
yield
self.auth = old_basic_auth
if old_token_auth:
self.headers['Authorizati... | python | def no_auth(self):
"""Unset authentication temporarily as a context manager."""
old_basic_auth, self.auth = self.auth, None
old_token_auth = self.headers.pop('Authorization', None)
yield
self.auth = old_basic_auth
if old_token_auth:
self.headers['Authorizati... | [
"def",
"no_auth",
"(",
"self",
")",
":",
"old_basic_auth",
",",
"self",
".",
"auth",
"=",
"self",
".",
"auth",
",",
"None",
"old_token_auth",
"=",
"self",
".",
"headers",
".",
"pop",
"(",
"'Authorization'",
",",
"None",
")",
"yield",
"self",
".",
"auth... | Unset authentication temporarily as a context manager. | [
"Unset",
"authentication",
"temporarily",
"as",
"a",
"context",
"manager",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/session.py#L136-L145 | train |
kislyuk/aegea | aegea/packages/github3/repos/hook.py | Hook.edit | def edit(self, config={}, events=[], add_events=[], rm_events=[],
active=True):
"""Edit this hook.
:param dict config: (optional), key-value pairs of settings for this
hook
:param list events: (optional), which events should this be triggered
for
:pa... | python | def edit(self, config={}, events=[], add_events=[], rm_events=[],
active=True):
"""Edit this hook.
:param dict config: (optional), key-value pairs of settings for this
hook
:param list events: (optional), which events should this be triggered
for
:pa... | [
"def",
"edit",
"(",
"self",
",",
"config",
"=",
"{",
"}",
",",
"events",
"=",
"[",
"]",
",",
"add_events",
"=",
"[",
"]",
",",
"rm_events",
"=",
"[",
"]",
",",
"active",
"=",
"True",
")",
":",
"data",
"=",
"{",
"'config'",
":",
"config",
",",
... | Edit this hook.
:param dict config: (optional), key-value pairs of settings for this
hook
:param list events: (optional), which events should this be triggered
for
:param list add_events: (optional), events to be added to the list of
events that this hook trig... | [
"Edit",
"this",
"hook",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/hook.py#L65-L96 | train |
kislyuk/aegea | aegea/packages/github3/repos/hook.py | Hook.ping | def ping(self):
"""Ping this hook.
:returns: bool
"""
url = self._build_url('pings', base_url=self._api)
return self._boolean(self._post(url), 204, 404) | python | def ping(self):
"""Ping this hook.
:returns: bool
"""
url = self._build_url('pings', base_url=self._api)
return self._boolean(self._post(url), 204, 404) | [
"def",
"ping",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'pings'",
",",
"base_url",
"=",
"self",
".",
"_api",
")",
"return",
"self",
".",
"_boolean",
"(",
"self",
".",
"_post",
"(",
"url",
")",
",",
"204",
",",
"404",
")... | Ping this hook.
:returns: bool | [
"Ping",
"this",
"hook",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/repos/hook.py#L99-L105 | train |
kislyuk/aegea | aegea/packages/github3/decorators.py | requires_auth | def requires_auth(func):
"""Decorator to note which object methods require authorization."""
@wraps(func)
def auth_wrapper(self, *args, **kwargs):
auth = False
if hasattr(self, '_session'):
auth = (self._session.auth or
self._session.headers.get('Authorization... | python | def requires_auth(func):
"""Decorator to note which object methods require authorization."""
@wraps(func)
def auth_wrapper(self, *args, **kwargs):
auth = False
if hasattr(self, '_session'):
auth = (self._session.auth or
self._session.headers.get('Authorization... | [
"def",
"requires_auth",
"(",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"auth_wrapper",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"auth",
"=",
"False",
"if",
"hasattr",
"(",
"self",
",",
"'_session'",
")",
":",... | Decorator to note which object methods require authorization. | [
"Decorator",
"to",
"note",
"which",
"object",
"methods",
"require",
"authorization",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/decorators.py#L28-L46 | train |
kislyuk/aegea | aegea/packages/github3/decorators.py | requires_basic_auth | def requires_basic_auth(func):
"""Specific (basic) authentication decorator.
This is used to note which object methods require username/password
authorization and won't work with token based authorization.
"""
@wraps(func)
def auth_wrapper(self, *args, **kwargs):
if hasattr(self, '_ses... | python | def requires_basic_auth(func):
"""Specific (basic) authentication decorator.
This is used to note which object methods require username/password
authorization and won't work with token based authorization.
"""
@wraps(func)
def auth_wrapper(self, *args, **kwargs):
if hasattr(self, '_ses... | [
"def",
"requires_basic_auth",
"(",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"auth_wrapper",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'_session'",
")",
"and",
"self",
".",
... | Specific (basic) authentication decorator.
This is used to note which object methods require username/password
authorization and won't work with token based authorization. | [
"Specific",
"(",
"basic",
")",
"authentication",
"decorator",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/decorators.py#L49-L67 | train |
kislyuk/aegea | aegea/packages/github3/decorators.py | requires_app_credentials | def requires_app_credentials(func):
"""Require client_id and client_secret to be associated.
This is used to note and enforce which methods require a client_id and
client_secret to be used.
"""
@wraps(func)
def auth_wrapper(self, *args, **kwargs):
client_id, client_secret = self._sessi... | python | def requires_app_credentials(func):
"""Require client_id and client_secret to be associated.
This is used to note and enforce which methods require a client_id and
client_secret to be used.
"""
@wraps(func)
def auth_wrapper(self, *args, **kwargs):
client_id, client_secret = self._sessi... | [
"def",
"requires_app_credentials",
"(",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"auth_wrapper",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"client_id",
",",
"client_secret",
"=",
"self",
".",
"_session",
".",
"re... | Require client_id and client_secret to be associated.
This is used to note and enforce which methods require a client_id and
client_secret to be used. | [
"Require",
"client_id",
"and",
"client_secret",
"to",
"be",
"associated",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/decorators.py#L70-L90 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_1_1 | def audit_1_1(self):
"""1.1 Avoid the use of the "root" account (Scored)"""
for row in self.credential_report:
if row["user"] == "<root_account>":
for field in "password_last_used", "access_key_1_last_used_date", "access_key_2_last_used_date":
if row[field... | python | def audit_1_1(self):
"""1.1 Avoid the use of the "root" account (Scored)"""
for row in self.credential_report:
if row["user"] == "<root_account>":
for field in "password_last_used", "access_key_1_last_used_date", "access_key_2_last_used_date":
if row[field... | [
"def",
"audit_1_1",
"(",
"self",
")",
":",
"for",
"row",
"in",
"self",
".",
"credential_report",
":",
"if",
"row",
"[",
"\"user\"",
"]",
"==",
"\"<root_account>\"",
":",
"for",
"field",
"in",
"\"password_last_used\"",
",",
"\"access_key_1_last_used_date\"",
",",... | 1.1 Avoid the use of the "root" account (Scored) | [
"1",
".",
"1",
"Avoid",
"the",
"use",
"of",
"the",
"root",
"account",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L54-L60 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_1_2 | def audit_1_2(self):
"""1.2 Ensure multi-factor authentication (MFA) is enabled for all IAM users that have a console password (Scored)""" # noqa
for row in self.credential_report:
if row["user"] == "<root_account>" or json.loads(row["password_enabled"]):
if not json.loads(r... | python | def audit_1_2(self):
"""1.2 Ensure multi-factor authentication (MFA) is enabled for all IAM users that have a console password (Scored)""" # noqa
for row in self.credential_report:
if row["user"] == "<root_account>" or json.loads(row["password_enabled"]):
if not json.loads(r... | [
"def",
"audit_1_2",
"(",
"self",
")",
":",
"# noqa",
"for",
"row",
"in",
"self",
".",
"credential_report",
":",
"if",
"row",
"[",
"\"user\"",
"]",
"==",
"\"<root_account>\"",
"or",
"json",
".",
"loads",
"(",
"row",
"[",
"\"password_enabled\"",
"]",
")",
... | 1.2 Ensure multi-factor authentication (MFA) is enabled for all IAM users that have a console password (Scored) | [
"1",
".",
"2",
"Ensure",
"multi",
"-",
"factor",
"authentication",
"(",
"MFA",
")",
"is",
"enabled",
"for",
"all",
"IAM",
"users",
"that",
"have",
"a",
"console",
"password",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L62-L67 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_1_3 | def audit_1_3(self):
"""1.3 Ensure credentials unused for 90 days or greater are disabled (Scored)"""
for row in self.credential_report:
for access_key in "1", "2":
if json.loads(row["access_key_{}_active".format(access_key)]):
last_used = row["access_key_... | python | def audit_1_3(self):
"""1.3 Ensure credentials unused for 90 days or greater are disabled (Scored)"""
for row in self.credential_report:
for access_key in "1", "2":
if json.loads(row["access_key_{}_active".format(access_key)]):
last_used = row["access_key_... | [
"def",
"audit_1_3",
"(",
"self",
")",
":",
"for",
"row",
"in",
"self",
".",
"credential_report",
":",
"for",
"access_key",
"in",
"\"1\"",
",",
"\"2\"",
":",
"if",
"json",
".",
"loads",
"(",
"row",
"[",
"\"access_key_{}_active\"",
".",
"format",
"(",
"acc... | 1.3 Ensure credentials unused for 90 days or greater are disabled (Scored) | [
"1",
".",
"3",
"Ensure",
"credentials",
"unused",
"for",
"90",
"days",
"or",
"greater",
"are",
"disabled",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L69-L77 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_1_4 | def audit_1_4(self):
"""1.4 Ensure access keys are rotated every 90 days or less (Scored)"""
for row in self.credential_report:
for access_key in "1", "2":
if json.loads(row["access_key_{}_active".format(access_key)]):
last_rotated = row["access_key_{}_las... | python | def audit_1_4(self):
"""1.4 Ensure access keys are rotated every 90 days or less (Scored)"""
for row in self.credential_report:
for access_key in "1", "2":
if json.loads(row["access_key_{}_active".format(access_key)]):
last_rotated = row["access_key_{}_las... | [
"def",
"audit_1_4",
"(",
"self",
")",
":",
"for",
"row",
"in",
"self",
".",
"credential_report",
":",
"for",
"access_key",
"in",
"\"1\"",
",",
"\"2\"",
":",
"if",
"json",
".",
"loads",
"(",
"row",
"[",
"\"access_key_{}_active\"",
".",
"format",
"(",
"acc... | 1.4 Ensure access keys are rotated every 90 days or less (Scored) | [
"1",
".",
"4",
"Ensure",
"access",
"keys",
"are",
"rotated",
"every",
"90",
"days",
"or",
"less",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L79-L87 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_1_12 | def audit_1_12(self):
"""1.12 Ensure no root account access key exists (Scored)"""
for row in self.credential_report:
if row["user"] == "<root_account>":
self.assertFalse(json.loads(row["access_key_1_active"]))
self.assertFalse(json.loads(row["access_key_2_act... | python | def audit_1_12(self):
"""1.12 Ensure no root account access key exists (Scored)"""
for row in self.credential_report:
if row["user"] == "<root_account>":
self.assertFalse(json.loads(row["access_key_1_active"]))
self.assertFalse(json.loads(row["access_key_2_act... | [
"def",
"audit_1_12",
"(",
"self",
")",
":",
"for",
"row",
"in",
"self",
".",
"credential_report",
":",
"if",
"row",
"[",
"\"user\"",
"]",
"==",
"\"<root_account>\"",
":",
"self",
".",
"assertFalse",
"(",
"json",
".",
"loads",
"(",
"row",
"[",
"\"access_k... | 1.12 Ensure no root account access key exists (Scored) | [
"1",
".",
"12",
"Ensure",
"no",
"root",
"account",
"access",
"key",
"exists",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L117-L122 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_1_13 | def audit_1_13(self):
"""1.13 Ensure hardware MFA is enabled for the "root" account (Scored)"""
for row in self.credential_report:
if row["user"] == "<root_account>":
self.assertTrue(json.loads(row["mfa_active"])) | python | def audit_1_13(self):
"""1.13 Ensure hardware MFA is enabled for the "root" account (Scored)"""
for row in self.credential_report:
if row["user"] == "<root_account>":
self.assertTrue(json.loads(row["mfa_active"])) | [
"def",
"audit_1_13",
"(",
"self",
")",
":",
"for",
"row",
"in",
"self",
".",
"credential_report",
":",
"if",
"row",
"[",
"\"user\"",
"]",
"==",
"\"<root_account>\"",
":",
"self",
".",
"assertTrue",
"(",
"json",
".",
"loads",
"(",
"row",
"[",
"\"mfa_activ... | 1.13 Ensure hardware MFA is enabled for the "root" account (Scored) | [
"1",
".",
"13",
"Ensure",
"hardware",
"MFA",
"is",
"enabled",
"for",
"the",
"root",
"account",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L124-L128 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_1_15 | def audit_1_15(self):
"""1.15 Ensure IAM policies are attached only to groups or roles (Scored)"""
for policy in resources.iam.policies.all():
self.assertEqual(len(list(policy.attached_users.all())), 0, "{} has users attached to it".format(policy)) | python | def audit_1_15(self):
"""1.15 Ensure IAM policies are attached only to groups or roles (Scored)"""
for policy in resources.iam.policies.all():
self.assertEqual(len(list(policy.attached_users.all())), 0, "{} has users attached to it".format(policy)) | [
"def",
"audit_1_15",
"(",
"self",
")",
":",
"for",
"policy",
"in",
"resources",
".",
"iam",
".",
"policies",
".",
"all",
"(",
")",
":",
"self",
".",
"assertEqual",
"(",
"len",
"(",
"list",
"(",
"policy",
".",
"attached_users",
".",
"all",
"(",
")",
... | 1.15 Ensure IAM policies are attached only to groups or roles (Scored) | [
"1",
".",
"15",
"Ensure",
"IAM",
"policies",
"are",
"attached",
"only",
"to",
"groups",
"or",
"roles",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L133-L136 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_2_2 | def audit_2_2(self):
"""2.2 Ensure CloudTrail log file validation is enabled (Scored)"""
self.assertGreater(len(self.trails), 0, "No CloudTrail trails configured")
self.assertTrue(all(trail["LogFileValidationEnabled"] for trail in self.trails),
"Some CloudTrail trails don... | python | def audit_2_2(self):
"""2.2 Ensure CloudTrail log file validation is enabled (Scored)"""
self.assertGreater(len(self.trails), 0, "No CloudTrail trails configured")
self.assertTrue(all(trail["LogFileValidationEnabled"] for trail in self.trails),
"Some CloudTrail trails don... | [
"def",
"audit_2_2",
"(",
"self",
")",
":",
"self",
".",
"assertGreater",
"(",
"len",
"(",
"self",
".",
"trails",
")",
",",
"0",
",",
"\"No CloudTrail trails configured\"",
")",
"self",
".",
"assertTrue",
"(",
"all",
"(",
"trail",
"[",
"\"LogFileValidationEna... | 2.2 Ensure CloudTrail log file validation is enabled (Scored) | [
"2",
".",
"2",
"Ensure",
"CloudTrail",
"log",
"file",
"validation",
"is",
"enabled",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L142-L146 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_2_3 | def audit_2_3(self):
"""2.3 Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored)"""
raise NotImplementedError()
import boto3
s3 = boto3.session.Session(region_name="us-east-1").resource("s3")
# s3 = boto3.resource("s3")
# for trail in self.trails:
... | python | def audit_2_3(self):
"""2.3 Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored)"""
raise NotImplementedError()
import boto3
s3 = boto3.session.Session(region_name="us-east-1").resource("s3")
# s3 = boto3.resource("s3")
# for trail in self.trails:
... | [
"def",
"audit_2_3",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")",
"import",
"boto3",
"s3",
"=",
"boto3",
".",
"session",
".",
"Session",
"(",
"region_name",
"=",
"\"us-east-1\"",
")",
".",
"resource",
"(",
"\"s3\"",
")",
"# s3 = boto3.reso... | 2.3 Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored) | [
"2",
".",
"3",
"Ensure",
"the",
"S3",
"bucket",
"CloudTrail",
"logs",
"to",
"is",
"not",
"publicly",
"accessible",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L148-L167 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_2_4 | def audit_2_4(self):
"""2.4 Ensure CloudTrail trails are integrated with CloudWatch Logs (Scored)"""
for trail in self.trails:
self.assertIn("CloudWatchLogsLogGroupArn", trail)
trail_status = clients.cloudtrail.get_trail_status(Name=trail["TrailARN"])
self.assertGreat... | python | def audit_2_4(self):
"""2.4 Ensure CloudTrail trails are integrated with CloudWatch Logs (Scored)"""
for trail in self.trails:
self.assertIn("CloudWatchLogsLogGroupArn", trail)
trail_status = clients.cloudtrail.get_trail_status(Name=trail["TrailARN"])
self.assertGreat... | [
"def",
"audit_2_4",
"(",
"self",
")",
":",
"for",
"trail",
"in",
"self",
".",
"trails",
":",
"self",
".",
"assertIn",
"(",
"\"CloudWatchLogsLogGroupArn\"",
",",
"trail",
")",
"trail_status",
"=",
"clients",
".",
"cloudtrail",
".",
"get_trail_status",
"(",
"N... | 2.4 Ensure CloudTrail trails are integrated with CloudWatch Logs (Scored) | [
"2",
".",
"4",
"Ensure",
"CloudTrail",
"trails",
"are",
"integrated",
"with",
"CloudWatch",
"Logs",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L169-L175 | train |
kislyuk/aegea | aegea/audit.py | Auditor.audit_2_5 | def audit_2_5(self):
"""2.5 Ensure AWS Config is enabled in all regions (Scored)"""
import boto3
for region in boto3.Session().get_available_regions("config"):
aws_config = boto3.session.Session(region_name=region).client("config")
res = aws_config.describe_configuration_... | python | def audit_2_5(self):
"""2.5 Ensure AWS Config is enabled in all regions (Scored)"""
import boto3
for region in boto3.Session().get_available_regions("config"):
aws_config = boto3.session.Session(region_name=region).client("config")
res = aws_config.describe_configuration_... | [
"def",
"audit_2_5",
"(",
"self",
")",
":",
"import",
"boto3",
"for",
"region",
"in",
"boto3",
".",
"Session",
"(",
")",
".",
"get_available_regions",
"(",
"\"config\"",
")",
":",
"aws_config",
"=",
"boto3",
".",
"session",
".",
"Session",
"(",
"region_name... | 2.5 Ensure AWS Config is enabled in all regions (Scored) | [
"2",
".",
"5",
"Ensure",
"AWS",
"Config",
"is",
"enabled",
"in",
"all",
"regions",
"(",
"Scored",
")"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/audit.py#L177-L183 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.authorization | def authorization(self, id_num):
"""Get information about authorization ``id``.
:param int id_num: (required), unique id of the authorization
:returns: :class:`Authorization <Authorization>`
"""
json = None
if int(id_num) > 0:
url = self._build_url('authoriza... | python | def authorization(self, id_num):
"""Get information about authorization ``id``.
:param int id_num: (required), unique id of the authorization
:returns: :class:`Authorization <Authorization>`
"""
json = None
if int(id_num) > 0:
url = self._build_url('authoriza... | [
"def",
"authorization",
"(",
"self",
",",
"id_num",
")",
":",
"json",
"=",
"None",
"if",
"int",
"(",
"id_num",
")",
">",
"0",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'authorizations'",
",",
"str",
"(",
"id_num",
")",
")",
"json",
"=",
"se... | Get information about authorization ``id``.
:param int id_num: (required), unique id of the authorization
:returns: :class:`Authorization <Authorization>` | [
"Get",
"information",
"about",
"authorization",
"id",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L76-L86 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.authorize | def authorize(self, login, password, scopes=None, note='', note_url='',
client_id='', client_secret=''):
"""Obtain an authorization token from the GitHub API for the GitHub
API.
:param str login: (required)
:param str password: (required)
:param list scopes: (o... | python | def authorize(self, login, password, scopes=None, note='', note_url='',
client_id='', client_secret=''):
"""Obtain an authorization token from the GitHub API for the GitHub
API.
:param str login: (required)
:param str password: (required)
:param list scopes: (o... | [
"def",
"authorize",
"(",
"self",
",",
"login",
",",
"password",
",",
"scopes",
"=",
"None",
",",
"note",
"=",
"''",
",",
"note_url",
"=",
"''",
",",
"client_id",
"=",
"''",
",",
"client_secret",
"=",
"''",
")",
":",
"json",
"=",
"None",
"# TODO: Brea... | Obtain an authorization token from the GitHub API for the GitHub
API.
:param str login: (required)
:param str password: (required)
:param list scopes: (optional), areas you want this token to apply to,
i.e., 'gist', 'user'
:param str note: (optional), note about the ... | [
"Obtain",
"an",
"authorization",
"token",
"from",
"the",
"GitHub",
"API",
"for",
"the",
"GitHub",
"API",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L88-L123 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.check_authorization | def check_authorization(self, access_token):
"""OAuth applications can use this method to check token validity
without hitting normal rate limits because of failed login attempts.
If the token is valid, it will return True, otherwise it will return
False.
:returns: bool
... | python | def check_authorization(self, access_token):
"""OAuth applications can use this method to check token validity
without hitting normal rate limits because of failed login attempts.
If the token is valid, it will return True, otherwise it will return
False.
:returns: bool
... | [
"def",
"check_authorization",
"(",
"self",
",",
"access_token",
")",
":",
"p",
"=",
"self",
".",
"_session",
".",
"params",
"auth",
"=",
"(",
"p",
".",
"get",
"(",
"'client_id'",
")",
",",
"p",
".",
"get",
"(",
"'client_secret'",
")",
")",
"if",
"acc... | OAuth applications can use this method to check token validity
without hitting normal rate limits because of failed login attempts.
If the token is valid, it will return True, otherwise it will return
False.
:returns: bool | [
"OAuth",
"applications",
"can",
"use",
"this",
"method",
"to",
"check",
"token",
"validity",
"without",
"hitting",
"normal",
"rate",
"limits",
"because",
"of",
"failed",
"login",
"attempts",
".",
"If",
"the",
"token",
"is",
"valid",
"it",
"will",
"return",
"... | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L125-L142 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.create_gist | def create_gist(self, description, files, public=True):
"""Create a new gist.
If no login was provided, it will be anonymous.
:param str description: (required), description of gist
:param dict files: (required), file names with associated dictionaries
for content, e.g. ``{... | python | def create_gist(self, description, files, public=True):
"""Create a new gist.
If no login was provided, it will be anonymous.
:param str description: (required), description of gist
:param dict files: (required), file names with associated dictionaries
for content, e.g. ``{... | [
"def",
"create_gist",
"(",
"self",
",",
"description",
",",
"files",
",",
"public",
"=",
"True",
")",
":",
"new_gist",
"=",
"{",
"'description'",
":",
"description",
",",
"'public'",
":",
"public",
",",
"'files'",
":",
"files",
"}",
"url",
"=",
"self",
... | Create a new gist.
If no login was provided, it will be anonymous.
:param str description: (required), description of gist
:param dict files: (required), file names with associated dictionaries
for content, e.g. ``{'spam.txt': {'content': 'File contents
...'}}``
... | [
"Create",
"a",
"new",
"gist",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L144-L160 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.create_issue | def create_issue(self,
owner,
repository,
title,
body=None,
assignee=None,
milestone=None,
labels=[]):
"""Create an issue on the project 'repository' owned by 'owner... | python | def create_issue(self,
owner,
repository,
title,
body=None,
assignee=None,
milestone=None,
labels=[]):
"""Create an issue on the project 'repository' owned by 'owner... | [
"def",
"create_issue",
"(",
"self",
",",
"owner",
",",
"repository",
",",
"title",
",",
"body",
"=",
"None",
",",
"assignee",
"=",
"None",
",",
"milestone",
"=",
"None",
",",
"labels",
"=",
"[",
"]",
")",
":",
"repo",
"=",
"None",
"if",
"owner",
"a... | Create an issue on the project 'repository' owned by 'owner'
with title 'title'.
body, assignee, milestone, labels are all optional.
:param str owner: (required), login of the owner
:param str repository: (required), repository name
:param str title: (required), Title of issue ... | [
"Create",
"an",
"issue",
"on",
"the",
"project",
"repository",
"owned",
"by",
"owner",
"with",
"title",
"title",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L163-L200 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.create_key | def create_key(self, title, key):
"""Create a new key for the authenticated user.
:param str title: (required), key title
:param key: (required), actual key contents, accepts path as a string
or file-like object
:returns: :class:`Key <github3.users.Key>`
"""
... | python | def create_key(self, title, key):
"""Create a new key for the authenticated user.
:param str title: (required), key title
:param key: (required), actual key contents, accepts path as a string
or file-like object
:returns: :class:`Key <github3.users.Key>`
"""
... | [
"def",
"create_key",
"(",
"self",
",",
"title",
",",
"key",
")",
":",
"created",
"=",
"None",
"if",
"title",
"and",
"key",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'keys'",
")",
"req",
"=",
"self",
".",
"_post",
"(",
"url",
... | Create a new key for the authenticated user.
:param str title: (required), key title
:param key: (required), actual key contents, accepts path as a string
or file-like object
:returns: :class:`Key <github3.users.Key>` | [
"Create",
"a",
"new",
"key",
"for",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L203-L219 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.delete_key | def delete_key(self, key_id):
"""Delete user key pointed to by ``key_id``.
:param int key_id: (required), unique id used by Github
:returns: bool
"""
key = self.key(key_id)
if key:
return key.delete()
return False | python | def delete_key(self, key_id):
"""Delete user key pointed to by ``key_id``.
:param int key_id: (required), unique id used by Github
:returns: bool
"""
key = self.key(key_id)
if key:
return key.delete()
return False | [
"def",
"delete_key",
"(",
"self",
",",
"key_id",
")",
":",
"key",
"=",
"self",
".",
"key",
"(",
"key_id",
")",
"if",
"key",
":",
"return",
"key",
".",
"delete",
"(",
")",
"return",
"False"
] | Delete user key pointed to by ``key_id``.
:param int key_id: (required), unique id used by Github
:returns: bool | [
"Delete",
"user",
"key",
"pointed",
"to",
"by",
"key_id",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L262-L271 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.emojis | def emojis(self):
"""Retrieves a dictionary of all of the emojis that GitHub supports.
:returns: dictionary where the key is what would be in between the
colons and the value is the URL to the image, e.g., ::
{
'+1': 'https://github.global.ssl.fastly.net... | python | def emojis(self):
"""Retrieves a dictionary of all of the emojis that GitHub supports.
:returns: dictionary where the key is what would be in between the
colons and the value is the URL to the image, e.g., ::
{
'+1': 'https://github.global.ssl.fastly.net... | [
"def",
"emojis",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'emojis'",
")",
"return",
"self",
".",
"_json",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"200",
")"
] | Retrieves a dictionary of all of the emojis that GitHub supports.
:returns: dictionary where the key is what would be in between the
colons and the value is the URL to the image, e.g., ::
{
'+1': 'https://github.global.ssl.fastly.net/images/...',
... | [
"Retrieves",
"a",
"dictionary",
"of",
"all",
"of",
"the",
"emojis",
"that",
"GitHub",
"supports",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L273-L285 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.feeds | def feeds(self):
"""List GitHub's timeline resources in Atom format.
:returns: dictionary parsed to include URITemplates
"""
url = self._build_url('feeds')
json = self._json(self._get(url), 200)
del json['ETag']
del json['Last-Modified']
urls = [
... | python | def feeds(self):
"""List GitHub's timeline resources in Atom format.
:returns: dictionary parsed to include URITemplates
"""
url = self._build_url('feeds')
json = self._json(self._get(url), 200)
del json['ETag']
del json['Last-Modified']
urls = [
... | [
"def",
"feeds",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'feeds'",
")",
"json",
"=",
"self",
".",
"_json",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"200",
")",
"del",
"json",
"[",
"'ETag'",
"]",
"del",
"json",
... | List GitHub's timeline resources in Atom format.
:returns: dictionary parsed to include URITemplates | [
"List",
"GitHub",
"s",
"timeline",
"resources",
"in",
"Atom",
"format",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L288-L311 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.follow | def follow(self, login):
"""Make the authenticated user follow login.
:param str login: (required), user to follow
:returns: bool
"""
resp = False
if login:
url = self._build_url('user', 'following', login)
resp = self._boolean(self._put(url), 204... | python | def follow(self, login):
"""Make the authenticated user follow login.
:param str login: (required), user to follow
:returns: bool
"""
resp = False
if login:
url = self._build_url('user', 'following', login)
resp = self._boolean(self._put(url), 204... | [
"def",
"follow",
"(",
"self",
",",
"login",
")",
":",
"resp",
"=",
"False",
"if",
"login",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'following'",
",",
"login",
")",
"resp",
"=",
"self",
".",
"_boolean",
"(",
"self",
".",
"_p... | Make the authenticated user follow login.
:param str login: (required), user to follow
:returns: bool | [
"Make",
"the",
"authenticated",
"user",
"follow",
"login",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L314-L324 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.gist | def gist(self, id_num):
"""Gets the gist using the specified id number.
:param int id_num: (required), unique id of the gist
:returns: :class:`Gist <github3.gists.Gist>`
"""
url = self._build_url('gists', str(id_num))
json = self._json(self._get(url), 200)
return... | python | def gist(self, id_num):
"""Gets the gist using the specified id number.
:param int id_num: (required), unique id of the gist
:returns: :class:`Gist <github3.gists.Gist>`
"""
url = self._build_url('gists', str(id_num))
json = self._json(self._get(url), 200)
return... | [
"def",
"gist",
"(",
"self",
",",
"id_num",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'gists'",
",",
"str",
"(",
"id_num",
")",
")",
"json",
"=",
"self",
".",
"_json",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"200",
")",
"ret... | Gets the gist using the specified id number.
:param int id_num: (required), unique id of the gist
:returns: :class:`Gist <github3.gists.Gist>` | [
"Gets",
"the",
"gist",
"using",
"the",
"specified",
"id",
"number",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L326-L334 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.gitignore_template | def gitignore_template(self, language):
"""Returns the template for language.
:returns: str
"""
url = self._build_url('gitignore', 'templates', language)
json = self._json(self._get(url), 200)
if not json:
return ''
return json.get('source', '') | python | def gitignore_template(self, language):
"""Returns the template for language.
:returns: str
"""
url = self._build_url('gitignore', 'templates', language)
json = self._json(self._get(url), 200)
if not json:
return ''
return json.get('source', '') | [
"def",
"gitignore_template",
"(",
"self",
",",
"language",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'gitignore'",
",",
"'templates'",
",",
"language",
")",
"json",
"=",
"self",
".",
"_json",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",... | Returns the template for language.
:returns: str | [
"Returns",
"the",
"template",
"for",
"language",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L336-L345 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.gitignore_templates | def gitignore_templates(self):
"""Returns the list of available templates.
:returns: list of template names
"""
url = self._build_url('gitignore', 'templates')
return self._json(self._get(url), 200) or [] | python | def gitignore_templates(self):
"""Returns the list of available templates.
:returns: list of template names
"""
url = self._build_url('gitignore', 'templates')
return self._json(self._get(url), 200) or [] | [
"def",
"gitignore_templates",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'gitignore'",
",",
"'templates'",
")",
"return",
"self",
".",
"_json",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"200",
")",
"or",
"[",
"]"
] | Returns the list of available templates.
:returns: list of template names | [
"Returns",
"the",
"list",
"of",
"available",
"templates",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L347-L353 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.is_following | def is_following(self, login):
"""Check if the authenticated user is following login.
:param str login: (required), login of the user to check if the
authenticated user is checking
:returns: bool
"""
json = False
if login:
url = self._build_url('u... | python | def is_following(self, login):
"""Check if the authenticated user is following login.
:param str login: (required), login of the user to check if the
authenticated user is checking
:returns: bool
"""
json = False
if login:
url = self._build_url('u... | [
"def",
"is_following",
"(",
"self",
",",
"login",
")",
":",
"json",
"=",
"False",
"if",
"login",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'following'",
",",
"login",
")",
"json",
"=",
"self",
".",
"_boolean",
"(",
"self",
".",... | Check if the authenticated user is following login.
:param str login: (required), login of the user to check if the
authenticated user is checking
:returns: bool | [
"Check",
"if",
"the",
"authenticated",
"user",
"is",
"following",
"login",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L356-L367 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.is_subscribed | def is_subscribed(self, login, repo):
"""Check if the authenticated user is subscribed to login/repo.
:param str login: (required), owner of repository
:param str repo: (required), name of repository
:returns: bool
"""
json = False
if login and repo:
... | python | def is_subscribed(self, login, repo):
"""Check if the authenticated user is subscribed to login/repo.
:param str login: (required), owner of repository
:param str repo: (required), name of repository
:returns: bool
"""
json = False
if login and repo:
... | [
"def",
"is_subscribed",
"(",
"self",
",",
"login",
",",
"repo",
")",
":",
"json",
"=",
"False",
"if",
"login",
"and",
"repo",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'subscriptions'",
",",
"login",
",",
"repo",
")",
"json",
"... | Check if the authenticated user is subscribed to login/repo.
:param str login: (required), owner of repository
:param str repo: (required), name of repository
:returns: bool | [
"Check",
"if",
"the",
"authenticated",
"user",
"is",
"subscribed",
"to",
"login",
"/",
"repo",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L384-L395 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.issue | def issue(self, owner, repository, number):
"""Fetch issue #:number: from https://github.com/:owner:/:repository:
:param str owner: (required), owner of the repository
:param str repository: (required), name of the repository
:param int number: (required), issue number
:return: ... | python | def issue(self, owner, repository, number):
"""Fetch issue #:number: from https://github.com/:owner:/:repository:
:param str owner: (required), owner of the repository
:param str repository: (required), name of the repository
:param int number: (required), issue number
:return: ... | [
"def",
"issue",
"(",
"self",
",",
"owner",
",",
"repository",
",",
"number",
")",
":",
"repo",
"=",
"self",
".",
"repository",
"(",
"owner",
",",
"repository",
")",
"if",
"repo",
":",
"return",
"repo",
".",
"issue",
"(",
"number",
")",
"return",
"Non... | Fetch issue #:number: from https://github.com/:owner:/:repository:
:param str owner: (required), owner of the repository
:param str repository: (required), name of the repository
:param int number: (required), issue number
:return: :class:`Issue <github3.issues.Issue>` | [
"Fetch",
"issue",
"#",
":",
"number",
":",
"from",
"https",
":",
"//",
"github",
".",
"com",
"/",
":",
"owner",
":",
"/",
":",
"repository",
":"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L397-L408 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_all_repos | def iter_all_repos(self, number=-1, since=None, etag=None, per_page=None):
"""Iterate over every repository in the order they were created.
:param int number: (optional), number of repositories to return.
Default: -1, returns all of them
:param int since: (optional), last repository... | python | def iter_all_repos(self, number=-1, since=None, etag=None, per_page=None):
"""Iterate over every repository in the order they were created.
:param int number: (optional), number of repositories to return.
Default: -1, returns all of them
:param int since: (optional), last repository... | [
"def",
"iter_all_repos",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"since",
"=",
"None",
",",
"etag",
"=",
"None",
",",
"per_page",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'repositories'",
")",
"return",
"self",
".",... | Iterate over every repository in the order they were created.
:param int number: (optional), number of repositories to return.
Default: -1, returns all of them
:param int since: (optional), last repository id seen (allows
restarting this iteration)
:param str etag: (opti... | [
"Iterate",
"over",
"every",
"repository",
"in",
"the",
"order",
"they",
"were",
"created",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L410-L426 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_all_users | def iter_all_users(self, number=-1, etag=None, per_page=None):
"""Iterate over every user in the order they signed up for GitHub.
:param int number: (optional), number of users to return. Default: -1,
returns all of them
:param str etag: (optional), ETag from a previous request to t... | python | def iter_all_users(self, number=-1, etag=None, per_page=None):
"""Iterate over every user in the order they signed up for GitHub.
:param int number: (optional), number of users to return. Default: -1,
returns all of them
:param str etag: (optional), ETag from a previous request to t... | [
"def",
"iter_all_users",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
",",
"per_page",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'users'",
")",
"return",
"self",
".",
"_iter",
"(",
"int",
"(",
"numb... | Iterate over every user in the order they signed up for GitHub.
:param int number: (optional), number of users to return. Default: -1,
returns all of them
:param str etag: (optional), ETag from a previous request to the same
endpoint
:param int per_page: (optional), numb... | [
"Iterate",
"over",
"every",
"user",
"in",
"the",
"order",
"they",
"signed",
"up",
"for",
"GitHub",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L428-L440 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_authorizations | def iter_authorizations(self, number=-1, etag=None):
"""Iterate over authorizations for the authenticated user. This will
return a 404 if you are using a token for authentication.
:param int number: (optional), number of authorizations to return.
Default: -1 returns all available au... | python | def iter_authorizations(self, number=-1, etag=None):
"""Iterate over authorizations for the authenticated user. This will
return a 404 if you are using a token for authentication.
:param int number: (optional), number of authorizations to return.
Default: -1 returns all available au... | [
"def",
"iter_authorizations",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'authorizations'",
")",
"return",
"self",
".",
"_iter",
"(",
"int",
"(",
"number",
")",
",",
"ur... | Iterate over authorizations for the authenticated user. This will
return a 404 if you are using a token for authentication.
:param int number: (optional), number of authorizations to return.
Default: -1 returns all available authorizations
:param str etag: (optional), ETag from a pr... | [
"Iterate",
"over",
"authorizations",
"for",
"the",
"authenticated",
"user",
".",
"This",
"will",
"return",
"a",
"404",
"if",
"you",
"are",
"using",
"a",
"token",
"for",
"authentication",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L443-L454 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_emails | def iter_emails(self, number=-1, etag=None):
"""Iterate over email addresses for the authenticated user.
:param int number: (optional), number of email addresses to return.
Default: -1 returns all available email addresses
:param str etag: (optional), ETag from a previous request to... | python | def iter_emails(self, number=-1, etag=None):
"""Iterate over email addresses for the authenticated user.
:param int number: (optional), number of email addresses to return.
Default: -1 returns all available email addresses
:param str etag: (optional), ETag from a previous request to... | [
"def",
"iter_emails",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'emails'",
")",
"return",
"self",
".",
"_iter",
"(",
"int",
"(",
"number",
")",
",",
... | Iterate over email addresses for the authenticated user.
:param int number: (optional), number of email addresses to return.
Default: -1 returns all available email addresses
:param str etag: (optional), ETag from a previous request to the same
endpoint
:returns: generat... | [
"Iterate",
"over",
"email",
"addresses",
"for",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L457-L467 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_events | def iter_events(self, number=-1, etag=None):
"""Iterate over public events.
:param int number: (optional), number of events to return. Default: -1
returns all available events
:param str etag: (optional), ETag from a previous request to the same
endpoint
:returns... | python | def iter_events(self, number=-1, etag=None):
"""Iterate over public events.
:param int number: (optional), number of events to return. Default: -1
returns all available events
:param str etag: (optional), ETag from a previous request to the same
endpoint
:returns... | [
"def",
"iter_events",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'events'",
")",
"return",
"self",
".",
"_iter",
"(",
"int",
"(",
"number",
")",
",",
"url",
",",
"Ev... | Iterate over public events.
:param int number: (optional), number of events to return. Default: -1
returns all available events
:param str etag: (optional), ETag from a previous request to the same
endpoint
:returns: generator of :class:`Event <github3.events.Event>`\ s | [
"Iterate",
"over",
"public",
"events",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L469-L479 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_followers | def iter_followers(self, login=None, number=-1, etag=None):
"""If login is provided, iterate over a generator of followers of that
login name; otherwise return a generator of followers of the
authenticated user.
:param str login: (optional), login of the user to check
:param int... | python | def iter_followers(self, login=None, number=-1, etag=None):
"""If login is provided, iterate over a generator of followers of that
login name; otherwise return a generator of followers of the
authenticated user.
:param str login: (optional), login of the user to check
:param int... | [
"def",
"iter_followers",
"(",
"self",
",",
"login",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"if",
"login",
":",
"return",
"self",
".",
"user",
"(",
"login",
")",
".",
"iter_followers",
"(",
")",
"return",
"sel... | If login is provided, iterate over a generator of followers of that
login name; otherwise return a generator of followers of the
authenticated user.
:param str login: (optional), login of the user to check
:param int number: (optional), number of followers to return. Default:
... | [
"If",
"login",
"is",
"provided",
"iterate",
"over",
"a",
"generator",
"of",
"followers",
"of",
"that",
"login",
"name",
";",
"otherwise",
"return",
"a",
"generator",
"of",
"followers",
"of",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L481-L495 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_following | def iter_following(self, login=None, number=-1, etag=None):
"""If login is provided, iterate over a generator of users being
followed by login; otherwise return a generator of people followed by
the authenticated user.
:param str login: (optional), login of the user to check
:pa... | python | def iter_following(self, login=None, number=-1, etag=None):
"""If login is provided, iterate over a generator of users being
followed by login; otherwise return a generator of people followed by
the authenticated user.
:param str login: (optional), login of the user to check
:pa... | [
"def",
"iter_following",
"(",
"self",
",",
"login",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"if",
"login",
":",
"return",
"self",
".",
"user",
"(",
"login",
")",
".",
"iter_following",
"(",
")",
"return",
"sel... | If login is provided, iterate over a generator of users being
followed by login; otherwise return a generator of people followed by
the authenticated user.
:param str login: (optional), login of the user to check
:param int number: (optional), number of people to return. Default: -1
... | [
"If",
"login",
"is",
"provided",
"iterate",
"over",
"a",
"generator",
"of",
"users",
"being",
"followed",
"by",
"login",
";",
"otherwise",
"return",
"a",
"generator",
"of",
"people",
"followed",
"by",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L497-L511 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_gists | def iter_gists(self, username=None, number=-1, etag=None):
"""If no username is specified, GET /gists, otherwise GET
/users/:username/gists
:param str login: (optional), login of the user to check
:param int number: (optional), number of gists to return. Default: -1
returns ... | python | def iter_gists(self, username=None, number=-1, etag=None):
"""If no username is specified, GET /gists, otherwise GET
/users/:username/gists
:param str login: (optional), login of the user to check
:param int number: (optional), number of gists to return. Default: -1
returns ... | [
"def",
"iter_gists",
"(",
"self",
",",
"username",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"if",
"username",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'users'",
",",
"username",
",",
"'gists'",
")",
"e... | If no username is specified, GET /gists, otherwise GET
/users/:username/gists
:param str login: (optional), login of the user to check
:param int number: (optional), number of gists to return. Default: -1
returns all available gists
:param str etag: (optional), ETag from a p... | [
"If",
"no",
"username",
"is",
"specified",
"GET",
"/",
"gists",
"otherwise",
"GET",
"/",
"users",
"/",
":",
"username",
"/",
"gists"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L513-L528 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_notifications | def iter_notifications(self, all=False, participating=False, number=-1,
etag=None):
"""Iterate over the user's notification.
:param bool all: (optional), iterate over all notifications
:param bool participating: (optional), only iterate over notifications
... | python | def iter_notifications(self, all=False, participating=False, number=-1,
etag=None):
"""Iterate over the user's notification.
:param bool all: (optional), iterate over all notifications
:param bool participating: (optional), only iterate over notifications
... | [
"def",
"iter_notifications",
"(",
"self",
",",
"all",
"=",
"False",
",",
"participating",
"=",
"False",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"params",
"=",
"None",
"if",
"all",
":",
"params",
"=",
"{",
"'all'",
":",
"al... | Iterate over the user's notification.
:param bool all: (optional), iterate over all notifications
:param bool participating: (optional), only iterate over notifications
in which the user is participating
:param int number: (optional), how many notifications to return
:param ... | [
"Iterate",
"over",
"the",
"user",
"s",
"notification",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L531-L551 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_org_issues | def iter_org_issues(self, name, filter='', state='', labels='', sort='',
direction='', since=None, number=-1, etag=None):
"""Iterate over the organnization's issues if the authenticated user
belongs to it.
:param str name: (required), name of the organization
:pa... | python | def iter_org_issues(self, name, filter='', state='', labels='', sort='',
direction='', since=None, number=-1, etag=None):
"""Iterate over the organnization's issues if the authenticated user
belongs to it.
:param str name: (required), name of the organization
:pa... | [
"def",
"iter_org_issues",
"(",
"self",
",",
"name",
",",
"filter",
"=",
"''",
",",
"state",
"=",
"''",
",",
"labels",
"=",
"''",
",",
"sort",
"=",
"''",
",",
"direction",
"=",
"''",
",",
"since",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
... | Iterate over the organnization's issues if the authenticated user
belongs to it.
:param str name: (required), name of the organization
:param str filter: accepted values:
('assigned', 'created', 'mentioned', 'subscribed')
api-default: 'assigned'
:param str state:... | [
"Iterate",
"over",
"the",
"organnization",
"s",
"issues",
"if",
"the",
"authenticated",
"user",
"belongs",
"to",
"it",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L554-L584 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_repo_issues | def iter_repo_issues(self, owner, repository, milestone=None,
state=None, assignee=None, mentioned=None,
labels=None, sort=None, direction=None, since=None,
number=-1, etag=None):
"""List issues on owner/repository. Only owner and reposi... | python | def iter_repo_issues(self, owner, repository, milestone=None,
state=None, assignee=None, mentioned=None,
labels=None, sort=None, direction=None, since=None,
number=-1, etag=None):
"""List issues on owner/repository. Only owner and reposi... | [
"def",
"iter_repo_issues",
"(",
"self",
",",
"owner",
",",
"repository",
",",
"milestone",
"=",
"None",
",",
"state",
"=",
"None",
",",
"assignee",
"=",
"None",
",",
"mentioned",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"sort",
"=",
"None",
",",
... | List issues on owner/repository. Only owner and repository are
required.
.. versionchanged:: 0.9.0
- The ``state`` parameter now accepts 'all' in addition to 'open'
and 'closed'.
:param str owner: login of the owner of the repository
:param str repository: na... | [
"List",
"issues",
"on",
"owner",
"/",
"repository",
".",
"Only",
"owner",
"and",
"repository",
"are",
"required",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L659-L699 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_orgs | def iter_orgs(self, login=None, number=-1, etag=None):
"""Iterate over public organizations for login if provided; otherwise
iterate over public and private organizations for the authenticated
user.
:param str login: (optional), user whose orgs you wish to list
:param int number... | python | def iter_orgs(self, login=None, number=-1, etag=None):
"""Iterate over public organizations for login if provided; otherwise
iterate over public and private organizations for the authenticated
user.
:param str login: (optional), user whose orgs you wish to list
:param int number... | [
"def",
"iter_orgs",
"(",
"self",
",",
"login",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"if",
"login",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'users'",
",",
"login",
",",
"'orgs'",
")",
"else",
":"... | Iterate over public organizations for login if provided; otherwise
iterate over public and private organizations for the authenticated
user.
:param str login: (optional), user whose orgs you wish to list
:param int number: (optional), number of organizations to return.
Defau... | [
"Iterate",
"over",
"public",
"organizations",
"for",
"login",
"if",
"provided",
";",
"otherwise",
"iterate",
"over",
"public",
"and",
"private",
"organizations",
"for",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L714-L732 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_repos | def iter_repos(self, type=None, sort=None, direction=None, number=-1,
etag=None):
"""List public repositories for the authenticated user.
.. versionchanged:: 0.6
Removed the login parameter for correctness. Use iter_user_repos
instead
:param str type: (... | python | def iter_repos(self, type=None, sort=None, direction=None, number=-1,
etag=None):
"""List public repositories for the authenticated user.
.. versionchanged:: 0.6
Removed the login parameter for correctness. Use iter_user_repos
instead
:param str type: (... | [
"def",
"iter_repos",
"(",
"self",
",",
"type",
"=",
"None",
",",
"sort",
"=",
"None",
",",
"direction",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'re... | List public repositories for the authenticated user.
.. versionchanged:: 0.6
Removed the login parameter for correctness. Use iter_user_repos
instead
:param str type: (optional), accepted values:
('all', 'owner', 'public', 'private', 'member')
API default:... | [
"List",
"public",
"repositories",
"for",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L735-L769 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_starred | def iter_starred(self, login=None, sort=None, direction=None, number=-1,
etag=None):
"""Iterate over repositories starred by ``login`` or the authenticated
user.
.. versionchanged:: 0.5
Added sort and direction parameters (optional) as per the change in
... | python | def iter_starred(self, login=None, sort=None, direction=None, number=-1,
etag=None):
"""Iterate over repositories starred by ``login`` or the authenticated
user.
.. versionchanged:: 0.5
Added sort and direction parameters (optional) as per the change in
... | [
"def",
"iter_starred",
"(",
"self",
",",
"login",
"=",
"None",
",",
"sort",
"=",
"None",
",",
"direction",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"if",
"login",
":",
"return",
"self",
".",
"user",
"(",
"log... | Iterate over repositories starred by ``login`` or the authenticated
user.
.. versionchanged:: 0.5
Added sort and direction parameters (optional) as per the change in
GitHub's API.
:param str login: (optional), name of user whose stars you want to see
:param str so... | [
"Iterate",
"over",
"repositories",
"starred",
"by",
"login",
"or",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L771-L797 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_subscriptions | def iter_subscriptions(self, login=None, number=-1, etag=None):
"""Iterate over repositories subscribed to by ``login`` or the
authenticated user.
:param str login: (optional), name of user whose subscriptions you want
to see
:param int number: (optional), number of reposito... | python | def iter_subscriptions(self, login=None, number=-1, etag=None):
"""Iterate over repositories subscribed to by ``login`` or the
authenticated user.
:param str login: (optional), name of user whose subscriptions you want
to see
:param int number: (optional), number of reposito... | [
"def",
"iter_subscriptions",
"(",
"self",
",",
"login",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"if",
"login",
":",
"return",
"self",
".",
"user",
"(",
"login",
")",
".",
"iter_subscriptions",
"(",
")",
"url",
... | Iterate over repositories subscribed to by ``login`` or the
authenticated user.
:param str login: (optional), name of user whose subscriptions you want
to see
:param int number: (optional), number of repositories to return.
Default: -1 returns all repositories
:p... | [
"Iterate",
"over",
"repositories",
"subscribed",
"to",
"by",
"login",
"or",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L799-L815 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.iter_user_teams | def iter_user_teams(self, number=-1, etag=None):
"""Gets the authenticated user's teams across all of organizations.
List all of the teams across all of the organizations to which the
authenticated user belongs. This method requires user or repo scope
when authenticating via OAuth.
... | python | def iter_user_teams(self, number=-1, etag=None):
"""Gets the authenticated user's teams across all of organizations.
List all of the teams across all of the organizations to which the
authenticated user belongs. This method requires user or repo scope
when authenticating via OAuth.
... | [
"def",
"iter_user_teams",
"(",
"self",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'teams'",
")",
"return",
"self",
".",
"_iter",
"(",
"int",
"(",
"number",
")",
",",... | Gets the authenticated user's teams across all of organizations.
List all of the teams across all of the organizations to which the
authenticated user belongs. This method requires user or repo scope
when authenticating via OAuth.
:returns: generator of :class:`Team <github3.orgs.Team>... | [
"Gets",
"the",
"authenticated",
"user",
"s",
"teams",
"across",
"all",
"of",
"organizations",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L853-L863 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.login | def login(self, username=None, password=None, token=None,
two_factor_callback=None):
"""Logs the user into GitHub for protected API calls.
:param str username: login name
:param str password: password for the login
:param str token: OAuth token
:param func two_fact... | python | def login(self, username=None, password=None, token=None,
two_factor_callback=None):
"""Logs the user into GitHub for protected API calls.
:param str username: login name
:param str password: password for the login
:param str token: OAuth token
:param func two_fact... | [
"def",
"login",
"(",
"self",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"token",
"=",
"None",
",",
"two_factor_callback",
"=",
"None",
")",
":",
"if",
"username",
"and",
"password",
":",
"self",
".",
"_session",
".",
"basic_auth",
... | Logs the user into GitHub for protected API calls.
:param str username: login name
:param str password: password for the login
:param str token: OAuth token
:param func two_factor_callback: (optional), function you implement to
provide the Two Factor Authentication code to G... | [
"Logs",
"the",
"user",
"into",
"GitHub",
"for",
"protected",
"API",
"calls",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L878-L894 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.markdown | def markdown(self, text, mode='', context='', raw=False):
"""Render an arbitrary markdown document.
:param str text: (required), the text of the document to render
:param str mode: (optional), 'markdown' or 'gfm'
:param str context: (optional), only important when using mode 'gfm',
... | python | def markdown(self, text, mode='', context='', raw=False):
"""Render an arbitrary markdown document.
:param str text: (required), the text of the document to render
:param str mode: (optional), 'markdown' or 'gfm'
:param str context: (optional), only important when using mode 'gfm',
... | [
"def",
"markdown",
"(",
"self",
",",
"text",
",",
"mode",
"=",
"''",
",",
"context",
"=",
"''",
",",
"raw",
"=",
"False",
")",
":",
"data",
"=",
"None",
"json",
"=",
"False",
"headers",
"=",
"{",
"}",
"if",
"raw",
":",
"url",
"=",
"self",
".",
... | Render an arbitrary markdown document.
:param str text: (required), the text of the document to render
:param str mode: (optional), 'markdown' or 'gfm'
:param str context: (optional), only important when using mode 'gfm',
this is the repository to use as the context for the renderin... | [
"Render",
"an",
"arbitrary",
"markdown",
"document",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L896-L932 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.membership_in | def membership_in(self, organization):
"""Retrieve the user's membership in the specified organization."""
url = self._build_url('user', 'memberships', 'orgs',
str(organization))
json = self._json(self._get(url), 200)
return Membership(json, self) | python | def membership_in(self, organization):
"""Retrieve the user's membership in the specified organization."""
url = self._build_url('user', 'memberships', 'orgs',
str(organization))
json = self._json(self._get(url), 200)
return Membership(json, self) | [
"def",
"membership_in",
"(",
"self",
",",
"organization",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'memberships'",
",",
"'orgs'",
",",
"str",
"(",
"organization",
")",
")",
"json",
"=",
"self",
".",
"_json",
"(",
"self",
".... | Retrieve the user's membership in the specified organization. | [
"Retrieve",
"the",
"user",
"s",
"membership",
"in",
"the",
"specified",
"organization",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L935-L940 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.meta | def meta(self):
"""Returns a dictionary with arrays of addresses in CIDR format
specifying theaddresses that the incoming service hooks will originate
from.
.. versionadded:: 0.5
"""
url = self._build_url('meta')
return self._json(self._get(url), 200) | python | def meta(self):
"""Returns a dictionary with arrays of addresses in CIDR format
specifying theaddresses that the incoming service hooks will originate
from.
.. versionadded:: 0.5
"""
url = self._build_url('meta')
return self._json(self._get(url), 200) | [
"def",
"meta",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'meta'",
")",
"return",
"self",
".",
"_json",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"200",
")"
] | Returns a dictionary with arrays of addresses in CIDR format
specifying theaddresses that the incoming service hooks will originate
from.
.. versionadded:: 0.5 | [
"Returns",
"a",
"dictionary",
"with",
"arrays",
"of",
"addresses",
"in",
"CIDR",
"format",
"specifying",
"theaddresses",
"that",
"the",
"incoming",
"service",
"hooks",
"will",
"originate",
"from",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L942-L950 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.octocat | def octocat(self, say=None):
"""Returns an easter egg of the API.
:params str say: (optional), pass in what you'd like Octocat to say
:returns: ascii art of Octocat
"""
url = self._build_url('octocat')
req = self._get(url, params={'s': say})
return req.content if... | python | def octocat(self, say=None):
"""Returns an easter egg of the API.
:params str say: (optional), pass in what you'd like Octocat to say
:returns: ascii art of Octocat
"""
url = self._build_url('octocat')
req = self._get(url, params={'s': say})
return req.content if... | [
"def",
"octocat",
"(",
"self",
",",
"say",
"=",
"None",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'octocat'",
")",
"req",
"=",
"self",
".",
"_get",
"(",
"url",
",",
"params",
"=",
"{",
"'s'",
":",
"say",
"}",
")",
"return",
"req",
... | Returns an easter egg of the API.
:params str say: (optional), pass in what you'd like Octocat to say
:returns: ascii art of Octocat | [
"Returns",
"an",
"easter",
"egg",
"of",
"the",
"API",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L952-L960 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.organization | def organization(self, login):
"""Returns a Organization object for the login name
:param str login: (required), login name of the org
:returns: :class:`Organization <github3.orgs.Organization>`
"""
url = self._build_url('orgs', login)
json = self._json(self._get(url), 2... | python | def organization(self, login):
"""Returns a Organization object for the login name
:param str login: (required), login name of the org
:returns: :class:`Organization <github3.orgs.Organization>`
"""
url = self._build_url('orgs', login)
json = self._json(self._get(url), 2... | [
"def",
"organization",
"(",
"self",
",",
"login",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'orgs'",
",",
"login",
")",
"json",
"=",
"self",
".",
"_json",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"200",
")",
"return",
"Organizat... | Returns a Organization object for the login name
:param str login: (required), login name of the org
:returns: :class:`Organization <github3.orgs.Organization>` | [
"Returns",
"a",
"Organization",
"object",
"for",
"the",
"login",
"name"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L963-L971 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.organization_memberships | def organization_memberships(self, state=None, number=-1, etag=None):
"""List organizations of which the user is a current or pending member.
:param str state: (option), state of the membership, i.e., active,
pending
:returns: iterator of :class:`Membership <github3.orgs.Membership>... | python | def organization_memberships(self, state=None, number=-1, etag=None):
"""List organizations of which the user is a current or pending member.
:param str state: (option), state of the membership, i.e., active,
pending
:returns: iterator of :class:`Membership <github3.orgs.Membership>... | [
"def",
"organization_memberships",
"(",
"self",
",",
"state",
"=",
"None",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"params",
"=",
"None",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'memberships'",
",",
"'orgs'... | List organizations of which the user is a current or pending member.
:param str state: (option), state of the membership, i.e., active,
pending
:returns: iterator of :class:`Membership <github3.orgs.Membership>` | [
"List",
"organizations",
"of",
"which",
"the",
"user",
"is",
"a",
"current",
"or",
"pending",
"member",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L974-L987 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.pubsubhubbub | def pubsubhubbub(self, mode, topic, callback, secret=''):
"""Create/update a pubsubhubbub hook.
:param str mode: (required), accepted values: ('subscribe',
'unsubscribe')
:param str topic: (required), form:
https://github.com/:user/:repo/events/:event
:param str ... | python | def pubsubhubbub(self, mode, topic, callback, secret=''):
"""Create/update a pubsubhubbub hook.
:param str mode: (required), accepted values: ('subscribe',
'unsubscribe')
:param str topic: (required), form:
https://github.com/:user/:repo/events/:event
:param str ... | [
"def",
"pubsubhubbub",
"(",
"self",
",",
"mode",
",",
"topic",
",",
"callback",
",",
"secret",
"=",
"''",
")",
":",
"from",
"re",
"import",
"match",
"m",
"=",
"match",
"(",
"'https?://[\\w\\d\\-\\.\\:]+/\\w+/[\\w\\._-]+/events/\\w+'",
",",
"topic",
")",
"statu... | Create/update a pubsubhubbub hook.
:param str mode: (required), accepted values: ('subscribe',
'unsubscribe')
:param str topic: (required), form:
https://github.com/:user/:repo/events/:event
:param str callback: (required), the URI that receives the updates
:para... | [
"Create",
"/",
"update",
"a",
"pubsubhubbub",
"hook",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L990-L1016 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.pull_request | def pull_request(self, owner, repository, number):
"""Fetch pull_request #:number: from :owner:/:repository
:param str owner: (required), owner of the repository
:param str repository: (required), name of the repository
:param int number: (required), issue number
:return: :class... | python | def pull_request(self, owner, repository, number):
"""Fetch pull_request #:number: from :owner:/:repository
:param str owner: (required), owner of the repository
:param str repository: (required), name of the repository
:param int number: (required), issue number
:return: :class... | [
"def",
"pull_request",
"(",
"self",
",",
"owner",
",",
"repository",
",",
"number",
")",
":",
"r",
"=",
"self",
".",
"repository",
"(",
"owner",
",",
"repository",
")",
"return",
"r",
".",
"pull_request",
"(",
"number",
")",
"if",
"r",
"else",
"None"
] | Fetch pull_request #:number: from :owner:/:repository
:param str owner: (required), owner of the repository
:param str repository: (required), name of the repository
:param int number: (required), issue number
:return: :class:`Issue <github3.issues.Issue>` | [
"Fetch",
"pull_request",
"#",
":",
"number",
":",
"from",
":",
"owner",
":",
"/",
":",
"repository"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1018-L1027 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.rate_limit | def rate_limit(self):
"""Returns a dictionary with information from /rate_limit.
The dictionary has two keys: ``resources`` and ``rate``. In
``resources`` you can access information about ``core`` or ``search``.
Note: the ``rate`` key will be deprecated before version 3 of the
... | python | def rate_limit(self):
"""Returns a dictionary with information from /rate_limit.
The dictionary has two keys: ``resources`` and ``rate``. In
``resources`` you can access information about ``core`` or ``search``.
Note: the ``rate`` key will be deprecated before version 3 of the
... | [
"def",
"rate_limit",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'rate_limit'",
")",
"return",
"self",
".",
"_json",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"200",
")"
] | Returns a dictionary with information from /rate_limit.
The dictionary has two keys: ``resources`` and ``rate``. In
``resources`` you can access information about ``core`` or ``search``.
Note: the ``rate`` key will be deprecated before version 3 of the
GitHub API is finalized. Do not r... | [
"Returns",
"a",
"dictionary",
"with",
"information",
"from",
"/",
"rate_limit",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1029-L1050 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.repository | def repository(self, owner, repository):
"""Returns a Repository object for the specified combination of
owner and repository
:param str owner: (required)
:param str repository: (required)
:returns: :class:`Repository <github3.repos.Repository>`
"""
json = None
... | python | def repository(self, owner, repository):
"""Returns a Repository object for the specified combination of
owner and repository
:param str owner: (required)
:param str repository: (required)
:returns: :class:`Repository <github3.repos.Repository>`
"""
json = None
... | [
"def",
"repository",
"(",
"self",
",",
"owner",
",",
"repository",
")",
":",
"json",
"=",
"None",
"if",
"owner",
"and",
"repository",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'repos'",
",",
"owner",
",",
"repository",
")",
"json",
"=",
"self",... | Returns a Repository object for the specified combination of
owner and repository
:param str owner: (required)
:param str repository: (required)
:returns: :class:`Repository <github3.repos.Repository>` | [
"Returns",
"a",
"Repository",
"object",
"for",
"the",
"specified",
"combination",
"of",
"owner",
"and",
"repository"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1052-L1064 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.revoke_authorization | def revoke_authorization(self, access_token):
"""Revoke specified authorization for an OAuth application.
Revoke all authorization tokens created by your application. This will
only work if you have already called ``set_client_id``.
:param str access_token: (required), the access_token... | python | def revoke_authorization(self, access_token):
"""Revoke specified authorization for an OAuth application.
Revoke all authorization tokens created by your application. This will
only work if you have already called ``set_client_id``.
:param str access_token: (required), the access_token... | [
"def",
"revoke_authorization",
"(",
"self",
",",
"access_token",
")",
":",
"client_id",
",",
"client_secret",
"=",
"self",
".",
"_session",
".",
"retrieve_client_credentials",
"(",
")",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'applications'",
",",
"str",
... | Revoke specified authorization for an OAuth application.
Revoke all authorization tokens created by your application. This will
only work if you have already called ``set_client_id``.
:param str access_token: (required), the access_token to revoke
:returns: bool -- True if successful, ... | [
"Revoke",
"specified",
"authorization",
"for",
"an",
"OAuth",
"application",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1067-L1083 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.search_code | def search_code(self, query, sort=None, order=None, per_page=None,
text_match=False, number=-1, etag=None):
"""Find code via the code search API.
The query can contain any combination of the following supported
qualifiers:
- ``in`` Qualifies which fields are searche... | python | def search_code(self, query, sort=None, order=None, per_page=None,
text_match=False, number=-1, etag=None):
"""Find code via the code search API.
The query can contain any combination of the following supported
qualifiers:
- ``in`` Qualifies which fields are searche... | [
"def",
"search_code",
"(",
"self",
",",
"query",
",",
"sort",
"=",
"None",
",",
"order",
"=",
"None",
",",
"per_page",
"=",
"None",
",",
"text_match",
"=",
"False",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"params",
"=",
... | Find code via the code search API.
The query can contain any combination of the following supported
qualifiers:
- ``in`` Qualifies which fields are searched. With this qualifier you
can restrict the search to just the file contents, the file path, or
both.
- ``langu... | [
"Find",
"code",
"via",
"the",
"code",
"search",
"API",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1103-L1156 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.search_issues | def search_issues(self, query, sort=None, order=None, per_page=None,
text_match=False, number=-1, etag=None):
"""Find issues by state and keyword
The query can contain any combination of the following supported
qualifers:
- ``type`` With this qualifier you can res... | python | def search_issues(self, query, sort=None, order=None, per_page=None,
text_match=False, number=-1, etag=None):
"""Find issues by state and keyword
The query can contain any combination of the following supported
qualifers:
- ``type`` With this qualifier you can res... | [
"def",
"search_issues",
"(",
"self",
",",
"query",
",",
"sort",
"=",
"None",
",",
"order",
"=",
"None",
",",
"per_page",
"=",
"None",
",",
"text_match",
"=",
"False",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"params",
"=",
... | Find issues by state and keyword
The query can contain any combination of the following supported
qualifers:
- ``type`` With this qualifier you can restrict the search to issues
or pull request only.
- ``in`` Qualifies which fields are searched. With this qualifier you
... | [
"Find",
"issues",
"by",
"state",
"and",
"keyword"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1158-L1221 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.search_repositories | def search_repositories(self, query, sort=None, order=None,
per_page=None, text_match=False, number=-1,
etag=None):
"""Find repositories via various criteria.
The query can contain any combination of the following supported
qualifers:
... | python | def search_repositories(self, query, sort=None, order=None,
per_page=None, text_match=False, number=-1,
etag=None):
"""Find repositories via various criteria.
The query can contain any combination of the following supported
qualifers:
... | [
"def",
"search_repositories",
"(",
"self",
",",
"query",
",",
"sort",
"=",
"None",
",",
"order",
"=",
"None",
",",
"per_page",
"=",
"None",
",",
"text_match",
"=",
"False",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"params",
... | Find repositories via various criteria.
The query can contain any combination of the following supported
qualifers:
- ``in`` Qualifies which fields are searched. With this qualifier you
can restrict the search to just the repository name, description,
readme, or any combina... | [
"Find",
"repositories",
"via",
"various",
"criteria",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1223-L1281 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.search_users | def search_users(self, query, sort=None, order=None, per_page=None,
text_match=False, number=-1, etag=None):
"""Find users via the Search API.
The query can contain any combination of the following supported
qualifers:
- ``type`` With this qualifier you can restri... | python | def search_users(self, query, sort=None, order=None, per_page=None,
text_match=False, number=-1, etag=None):
"""Find users via the Search API.
The query can contain any combination of the following supported
qualifers:
- ``type`` With this qualifier you can restri... | [
"def",
"search_users",
"(",
"self",
",",
"query",
",",
"sort",
"=",
"None",
",",
"order",
"=",
"None",
",",
"per_page",
"=",
"None",
",",
"text_match",
"=",
"False",
",",
"number",
"=",
"-",
"1",
",",
"etag",
"=",
"None",
")",
":",
"params",
"=",
... | Find users via the Search API.
The query can contain any combination of the following supported
qualifers:
- ``type`` With this qualifier you can restrict the search to just
personal accounts or just organization accounts.
- ``in`` Qualifies which fields are searched. With t... | [
"Find",
"users",
"via",
"the",
"Search",
"API",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1283-L1340 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.star | def star(self, login, repo):
"""Star to login/repo
:param str login: (required), owner of the repo
:param str repo: (required), name of the repo
:return: bool
"""
resp = False
if login and repo:
url = self._build_url('user', 'starred', login, repo)
... | python | def star(self, login, repo):
"""Star to login/repo
:param str login: (required), owner of the repo
:param str repo: (required), name of the repo
:return: bool
"""
resp = False
if login and repo:
url = self._build_url('user', 'starred', login, repo)
... | [
"def",
"star",
"(",
"self",
",",
"login",
",",
"repo",
")",
":",
"resp",
"=",
"False",
"if",
"login",
"and",
"repo",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'starred'",
",",
"login",
",",
"repo",
")",
"resp",
"=",
"self",
... | Star to login/repo
:param str login: (required), owner of the repo
:param str repo: (required), name of the repo
:return: bool | [
"Star",
"to",
"login",
"/",
"repo"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1364-L1375 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.unfollow | def unfollow(self, login):
"""Make the authenticated user stop following login
:param str login: (required)
:returns: bool
"""
resp = False
if login:
url = self._build_url('user', 'following', login)
resp = self._boolean(self._delete(url), 204, 40... | python | def unfollow(self, login):
"""Make the authenticated user stop following login
:param str login: (required)
:returns: bool
"""
resp = False
if login:
url = self._build_url('user', 'following', login)
resp = self._boolean(self._delete(url), 204, 40... | [
"def",
"unfollow",
"(",
"self",
",",
"login",
")",
":",
"resp",
"=",
"False",
"if",
"login",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'following'",
",",
"login",
")",
"resp",
"=",
"self",
".",
"_boolean",
"(",
"self",
".",
"... | Make the authenticated user stop following login
:param str login: (required)
:returns: bool | [
"Make",
"the",
"authenticated",
"user",
"stop",
"following",
"login"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1392-L1402 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.unstar | def unstar(self, login, repo):
"""Unstar to login/repo
:param str login: (required), owner of the repo
:param str repo: (required), name of the repo
:return: bool
"""
resp = False
if login and repo:
url = self._build_url('user', 'starred', login, repo... | python | def unstar(self, login, repo):
"""Unstar to login/repo
:param str login: (required), owner of the repo
:param str repo: (required), name of the repo
:return: bool
"""
resp = False
if login and repo:
url = self._build_url('user', 'starred', login, repo... | [
"def",
"unstar",
"(",
"self",
",",
"login",
",",
"repo",
")",
":",
"resp",
"=",
"False",
"if",
"login",
"and",
"repo",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'starred'",
",",
"login",
",",
"repo",
")",
"resp",
"=",
"self",... | Unstar to login/repo
:param str login: (required), owner of the repo
:param str repo: (required), name of the repo
:return: bool | [
"Unstar",
"to",
"login",
"/",
"repo"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1405-L1416 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.update_user | def update_user(self, name=None, email=None, blog=None,
company=None, location=None, hireable=False, bio=None):
"""If authenticated as this user, update the information with
the information provided in the parameters. All parameters are
optional.
:param str name: e.g... | python | def update_user(self, name=None, email=None, blog=None,
company=None, location=None, hireable=False, bio=None):
"""If authenticated as this user, update the information with
the information provided in the parameters. All parameters are
optional.
:param str name: e.g... | [
"def",
"update_user",
"(",
"self",
",",
"name",
"=",
"None",
",",
"email",
"=",
"None",
",",
"blog",
"=",
"None",
",",
"company",
"=",
"None",
",",
"location",
"=",
"None",
",",
"hireable",
"=",
"False",
",",
"bio",
"=",
"None",
")",
":",
"user",
... | If authenticated as this user, update the information with
the information provided in the parameters. All parameters are
optional.
:param str name: e.g., 'John Smith', not login name
:param str email: e.g., 'john.smith@example.com'
:param str blog: e.g., 'http://www.example.com... | [
"If",
"authenticated",
"as",
"this",
"user",
"update",
"the",
"information",
"with",
"the",
"information",
"provided",
"in",
"the",
"parameters",
".",
"All",
"parameters",
"are",
"optional",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1433-L1450 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.user | def user(self, login=None):
"""Returns a User object for the specified login name if
provided. If no login name is provided, this will return a User
object for the authenticated user.
:param str login: (optional)
:returns: :class:`User <github3.users.User>`
"""
i... | python | def user(self, login=None):
"""Returns a User object for the specified login name if
provided. If no login name is provided, this will return a User
object for the authenticated user.
:param str login: (optional)
:returns: :class:`User <github3.users.User>`
"""
i... | [
"def",
"user",
"(",
"self",
",",
"login",
"=",
"None",
")",
":",
"if",
"login",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'users'",
",",
"login",
")",
"else",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
")",
"json",
"=",
"s... | Returns a User object for the specified login name if
provided. If no login name is provided, this will return a User
object for the authenticated user.
:param str login: (optional)
:returns: :class:`User <github3.users.User>` | [
"Returns",
"a",
"User",
"object",
"for",
"the",
"specified",
"login",
"name",
"if",
"provided",
".",
"If",
"no",
"login",
"name",
"is",
"provided",
"this",
"will",
"return",
"a",
"User",
"object",
"for",
"the",
"authenticated",
"user",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1452-L1466 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHub.zen | def zen(self):
"""Returns a quote from the Zen of GitHub. Yet another API Easter Egg
:returns: str
"""
url = self._build_url('zen')
resp = self._get(url)
return resp.content if resp.status_code == 200 else '' | python | def zen(self):
"""Returns a quote from the Zen of GitHub. Yet another API Easter Egg
:returns: str
"""
url = self._build_url('zen')
resp = self._get(url)
return resp.content if resp.status_code == 200 else '' | [
"def",
"zen",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'zen'",
")",
"resp",
"=",
"self",
".",
"_get",
"(",
"url",
")",
"return",
"resp",
".",
"content",
"if",
"resp",
".",
"status_code",
"==",
"200",
"else",
"''"
] | Returns a quote from the Zen of GitHub. Yet another API Easter Egg
:returns: str | [
"Returns",
"a",
"quote",
"from",
"the",
"Zen",
"of",
"GitHub",
".",
"Yet",
"another",
"API",
"Easter",
"Egg"
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1468-L1475 | train |
kislyuk/aegea | aegea/packages/github3/github.py | GitHubEnterprise.admin_stats | def admin_stats(self, option):
"""This is a simple way to get statistics about your system.
:param str option: (required), accepted values: ('all', 'repos',
'hooks', 'pages', 'orgs', 'users', 'pulls', 'issues',
'milestones', 'gists', 'comments')
:returns: dict
""... | python | def admin_stats(self, option):
"""This is a simple way to get statistics about your system.
:param str option: (required), accepted values: ('all', 'repos',
'hooks', 'pages', 'orgs', 'users', 'pulls', 'issues',
'milestones', 'gists', 'comments')
:returns: dict
""... | [
"def",
"admin_stats",
"(",
"self",
",",
"option",
")",
":",
"stats",
"=",
"{",
"}",
"if",
"option",
".",
"lower",
"(",
")",
"in",
"(",
"'all'",
",",
"'repos'",
",",
"'hooks'",
",",
"'pages'",
",",
"'orgs'",
",",
"'users'",
",",
"'pulls'",
",",
"'is... | This is a simple way to get statistics about your system.
:param str option: (required), accepted values: ('all', 'repos',
'hooks', 'pages', 'orgs', 'users', 'pulls', 'issues',
'milestones', 'gists', 'comments')
:returns: dict | [
"This",
"is",
"a",
"simple",
"way",
"to",
"get",
"statistics",
"about",
"your",
"system",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/github.py#L1499-L1513 | train |
kislyuk/aegea | aegea/packages/github3/users.py | Key.update | def update(self, title, key):
"""Update this key.
:param str title: (required), title of the key
:param str key: (required), text of the key file
:returns: bool
"""
json = None
if title and key:
data = {'title': title, 'key': key}
json = s... | python | def update(self, title, key):
"""Update this key.
:param str title: (required), title of the key
:param str key: (required), text of the key file
:returns: bool
"""
json = None
if title and key:
data = {'title': title, 'key': key}
json = s... | [
"def",
"update",
"(",
"self",
",",
"title",
",",
"key",
")",
":",
"json",
"=",
"None",
"if",
"title",
"and",
"key",
":",
"data",
"=",
"{",
"'title'",
":",
"title",
",",
"'key'",
":",
"key",
"}",
"json",
"=",
"self",
".",
"_json",
"(",
"self",
"... | Update this key.
:param str title: (required), title of the key
:param str key: (required), text of the key file
:returns: bool | [
"Update",
"this",
"key",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/users.py#L57-L71 | train |
kislyuk/aegea | aegea/packages/github3/users.py | User.add_email_addresses | def add_email_addresses(self, addresses=[]):
"""Add the email addresses in ``addresses`` to the authenticated
user's account.
:param list addresses: (optional), email addresses to be added
:returns: list of email addresses
"""
json = []
if addresses:
... | python | def add_email_addresses(self, addresses=[]):
"""Add the email addresses in ``addresses`` to the authenticated
user's account.
:param list addresses: (optional), email addresses to be added
:returns: list of email addresses
"""
json = []
if addresses:
... | [
"def",
"add_email_addresses",
"(",
"self",
",",
"addresses",
"=",
"[",
"]",
")",
":",
"json",
"=",
"[",
"]",
"if",
"addresses",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'emails'",
")",
"json",
"=",
"self",
".",
"_json",
"(",
... | Add the email addresses in ``addresses`` to the authenticated
user's account.
:param list addresses: (optional), email addresses to be added
:returns: list of email addresses | [
"Add",
"the",
"email",
"addresses",
"in",
"addresses",
"to",
"the",
"authenticated",
"user",
"s",
"account",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/users.py#L200-L211 | train |
kislyuk/aegea | aegea/packages/github3/users.py | User.delete_email_addresses | def delete_email_addresses(self, addresses=[]):
"""Delete the email addresses in ``addresses`` from the
authenticated user's account.
:param list addresses: (optional), email addresses to be removed
:returns: bool
"""
url = self._build_url('user', 'emails')
retur... | python | def delete_email_addresses(self, addresses=[]):
"""Delete the email addresses in ``addresses`` from the
authenticated user's account.
:param list addresses: (optional), email addresses to be removed
:returns: bool
"""
url = self._build_url('user', 'emails')
retur... | [
"def",
"delete_email_addresses",
"(",
"self",
",",
"addresses",
"=",
"[",
"]",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'user'",
",",
"'emails'",
")",
"return",
"self",
".",
"_boolean",
"(",
"self",
".",
"_delete",
"(",
"url",
",",
"data"... | Delete the email addresses in ``addresses`` from the
authenticated user's account.
:param list addresses: (optional), email addresses to be removed
:returns: bool | [
"Delete",
"the",
"email",
"addresses",
"in",
"addresses",
"from",
"the",
"authenticated",
"user",
"s",
"account",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/users.py#L223-L232 | train |
kislyuk/aegea | aegea/packages/github3/users.py | User.is_assignee_on | def is_assignee_on(self, login, repository):
"""Checks if this user can be assigned to issues on login/repository.
:returns: :class:`bool`
"""
url = self._build_url('repos', login, repository, 'assignees',
self.login)
return self._boolean(self._get(... | python | def is_assignee_on(self, login, repository):
"""Checks if this user can be assigned to issues on login/repository.
:returns: :class:`bool`
"""
url = self._build_url('repos', login, repository, 'assignees',
self.login)
return self._boolean(self._get(... | [
"def",
"is_assignee_on",
"(",
"self",
",",
"login",
",",
"repository",
")",
":",
"url",
"=",
"self",
".",
"_build_url",
"(",
"'repos'",
",",
"login",
",",
"repository",
",",
"'assignees'",
",",
"self",
".",
"login",
")",
"return",
"self",
".",
"_boolean"... | Checks if this user can be assigned to issues on login/repository.
:returns: :class:`bool` | [
"Checks",
"if",
"this",
"user",
"can",
"be",
"assigned",
"to",
"issues",
"on",
"login",
"/",
"repository",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/users.py#L234-L241 | train |
kislyuk/aegea | aegea/packages/github3/users.py | User.is_following | def is_following(self, login):
"""Checks if this user is following ``login``.
:param str login: (required)
:returns: bool
"""
url = self.following_urlt.expand(other_user=login)
return self._boolean(self._get(url), 204, 404) | python | def is_following(self, login):
"""Checks if this user is following ``login``.
:param str login: (required)
:returns: bool
"""
url = self.following_urlt.expand(other_user=login)
return self._boolean(self._get(url), 204, 404) | [
"def",
"is_following",
"(",
"self",
",",
"login",
")",
":",
"url",
"=",
"self",
".",
"following_urlt",
".",
"expand",
"(",
"other_user",
"=",
"login",
")",
"return",
"self",
".",
"_boolean",
"(",
"self",
".",
"_get",
"(",
"url",
")",
",",
"204",
",",... | Checks if this user is following ``login``.
:param str login: (required)
:returns: bool | [
"Checks",
"if",
"this",
"user",
"is",
"following",
"login",
"."
] | 94957e9dba036eae3052e2662c208b259c08399a | https://github.com/kislyuk/aegea/blob/94957e9dba036eae3052e2662c208b259c08399a/aegea/packages/github3/users.py#L243-L251 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.