partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | JIRA.project_versions | Get a list of version Resources present on a project.
:param project: ID or key of the project to get versions from
:type project: str
:rtype: List[Version] | jira/client.py | def project_versions(self, project):
"""Get a list of version Resources present on a project.
:param project: ID or key of the project to get versions from
:type project: str
:rtype: List[Version]
"""
r_json = self._get_json('project/' + project + '/versions')
ve... | def project_versions(self, project):
"""Get a list of version Resources present on a project.
:param project: ID or key of the project to get versions from
:type project: str
:rtype: List[Version]
"""
r_json = self._get_json('project/' + project + '/versions')
ve... | [
"Get",
"a",
"list",
"of",
"version",
"Resources",
"present",
"on",
"a",
"project",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2292-L2302 | [
"def",
"project_versions",
"(",
"self",
",",
"project",
")",
":",
"r_json",
"=",
"self",
".",
"_get_json",
"(",
"'project/'",
"+",
"project",
"+",
"'/versions'",
")",
"versions",
"=",
"[",
"Version",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_sess... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.get_project_version_by_name | Get a version Resource by its name present on a project.
:param project: ID or key of the project to get versions from
:type project: str
:param version_name: name of the version to search for
:type version_name: str
:rtype: Optional[Version] | jira/client.py | def get_project_version_by_name(self, project, version_name):
"""Get a version Resource by its name present on a project.
:param project: ID or key of the project to get versions from
:type project: str
:param version_name: name of the version to search for
:type version_name: s... | def get_project_version_by_name(self, project, version_name):
"""Get a version Resource by its name present on a project.
:param project: ID or key of the project to get versions from
:type project: str
:param version_name: name of the version to search for
:type version_name: s... | [
"Get",
"a",
"version",
"Resource",
"by",
"its",
"name",
"present",
"on",
"a",
"project",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2305-L2317 | [
"def",
"get_project_version_by_name",
"(",
"self",
",",
"project",
",",
"version_name",
")",
":",
"versions",
"=",
"self",
".",
"project_versions",
"(",
"project",
")",
"for",
"version",
"in",
"versions",
":",
"if",
"version",
".",
"name",
"==",
"version_name"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.rename_version | Rename a version Resource on a project.
:param project: ID or key of the project to get versions from
:type project: str
:param old_name: old name of the version to rename
:type old_name: str
:param new_name: new name of the version to rename
:type new_name: str
... | jira/client.py | def rename_version(self, project, old_name, new_name):
"""Rename a version Resource on a project.
:param project: ID or key of the project to get versions from
:type project: str
:param old_name: old name of the version to rename
:type old_name: str
:param new_name: new ... | def rename_version(self, project, old_name, new_name):
"""Rename a version Resource on a project.
:param project: ID or key of the project to get versions from
:type project: str
:param old_name: old name of the version to rename
:type old_name: str
:param new_name: new ... | [
"Rename",
"a",
"version",
"Resource",
"on",
"a",
"project",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2320-L2333 | [
"def",
"rename_version",
"(",
"self",
",",
"project",
",",
"old_name",
",",
"new_name",
")",
":",
"version",
"=",
"self",
".",
"get_project_version_by_name",
"(",
"project",
",",
"old_name",
")",
"if",
"version",
":",
"version",
".",
"update",
"(",
"name",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.project_roles | Get a dict of role names to resource locations for a project.
:param project: ID or key of the project to get roles from | jira/client.py | def project_roles(self, project):
"""Get a dict of role names to resource locations for a project.
:param project: ID or key of the project to get roles from
"""
path = 'project/' + project + '/role'
_rolesdict = self._get_json(path)
rolesdict = {}
for k, v in _... | def project_roles(self, project):
"""Get a dict of role names to resource locations for a project.
:param project: ID or key of the project to get roles from
"""
path = 'project/' + project + '/role'
_rolesdict = self._get_json(path)
rolesdict = {}
for k, v in _... | [
"Get",
"a",
"dict",
"of",
"role",
"names",
"to",
"resource",
"locations",
"for",
"a",
"project",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2337-L2351 | [
"def",
"project_roles",
"(",
"self",
",",
"project",
")",
":",
"path",
"=",
"'project/'",
"+",
"project",
"+",
"'/role'",
"_rolesdict",
"=",
"self",
".",
"_get_json",
"(",
"path",
")",
"rolesdict",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"_rolesdict... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.project_role | Get a role Resource.
:param project: ID or key of the project to get the role from
:param id: ID of the role to get | jira/client.py | def project_role(self, project, id):
"""Get a role Resource.
:param project: ID or key of the project to get the role from
:param id: ID of the role to get
"""
if isinstance(id, Number):
id = "%s" % id
return self._find_for_resource(Role, (project, id)) | def project_role(self, project, id):
"""Get a role Resource.
:param project: ID or key of the project to get the role from
:param id: ID of the role to get
"""
if isinstance(id, Number):
id = "%s" % id
return self._find_for_resource(Role, (project, id)) | [
"Get",
"a",
"role",
"Resource",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2355-L2363 | [
"def",
"project_role",
"(",
"self",
",",
"project",
",",
"id",
")",
":",
"if",
"isinstance",
"(",
"id",
",",
"Number",
")",
":",
"id",
"=",
"\"%s\"",
"%",
"id",
"return",
"self",
".",
"_find_for_resource",
"(",
"Role",
",",
"(",
"project",
",",
"id",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.resolutions | Get a list of resolution Resources from the server.
:rtype: List[Resolution] | jira/client.py | def resolutions(self):
"""Get a list of resolution Resources from the server.
:rtype: List[Resolution]
"""
r_json = self._get_json('resolution')
resolutions = [Resolution(
self._options, self._session, raw_res_json) for raw_res_json in r_json]
return resolut... | def resolutions(self):
"""Get a list of resolution Resources from the server.
:rtype: List[Resolution]
"""
r_json = self._get_json('resolution')
resolutions = [Resolution(
self._options, self._session, raw_res_json) for raw_res_json in r_json]
return resolut... | [
"Get",
"a",
"list",
"of",
"resolution",
"Resources",
"from",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2367-L2376 | [
"def",
"resolutions",
"(",
"self",
")",
":",
"r_json",
"=",
"self",
".",
"_get_json",
"(",
"'resolution'",
")",
"resolutions",
"=",
"[",
"Resolution",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
",",
"raw_res_json",
")",
"for",
"raw_res_jso... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.search_issues | Get a :class:`~jira.client.ResultList` of issue Resources matching a JQL search string.
:param jql_str: The JQL search string.
:type jql_str: str
:param startAt: Index of the first issue to return. (Default: 0)
:type startAt: int
:param maxResults: Maximum number of issues to re... | jira/client.py | def search_issues(self,
jql_str,
startAt=0,
maxResults=50,
validate_query=True,
fields=None,
expand=None,
json_result=None,
):
"""Get a ... | def search_issues(self,
jql_str,
startAt=0,
maxResults=50,
validate_query=True,
fields=None,
expand=None,
json_result=None,
):
"""Get a ... | [
"Get",
"a",
":",
"class",
":",
"~jira",
".",
"client",
".",
"ResultList",
"of",
"issue",
"Resources",
"matching",
"a",
"JQL",
"search",
"string",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2389-L2456 | [
"def",
"search_issues",
"(",
"self",
",",
"jql_str",
",",
"startAt",
"=",
"0",
",",
"maxResults",
"=",
"50",
",",
"validate_query",
"=",
"True",
",",
"fields",
"=",
"None",
",",
"expand",
"=",
"None",
",",
"json_result",
"=",
"None",
",",
")",
":",
"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.server_info | Get a dict of server information for this JIRA instance.
:rtype: Dict[str, Any] | jira/client.py | def server_info(self):
"""Get a dict of server information for this JIRA instance.
:rtype: Dict[str, Any]
"""
retry = 0
j = self._get_json('serverInfo')
while not j and retry < 3:
logging.warning("Bug https://jira.atlassian.com/browse/JRA-59676 trying again...... | def server_info(self):
"""Get a dict of server information for this JIRA instance.
:rtype: Dict[str, Any]
"""
retry = 0
j = self._get_json('serverInfo')
while not j and retry < 3:
logging.warning("Bug https://jira.atlassian.com/browse/JRA-59676 trying again...... | [
"Get",
"a",
"dict",
"of",
"server",
"information",
"for",
"this",
"JIRA",
"instance",
".",
":",
"rtype",
":",
"Dict",
"[",
"str",
"Any",
"]"
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2469-L2479 | [
"def",
"server_info",
"(",
"self",
")",
":",
"retry",
"=",
"0",
"j",
"=",
"self",
".",
"_get_json",
"(",
"'serverInfo'",
")",
"while",
"not",
"j",
"and",
"retry",
"<",
"3",
":",
"logging",
".",
"warning",
"(",
"\"Bug https://jira.atlassian.com/browse/JRA-596... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.statuses | Get a list of status Resources from the server.
:rtype: List[Status] | jira/client.py | def statuses(self):
"""Get a list of status Resources from the server.
:rtype: List[Status]
"""
r_json = self._get_json('status')
statuses = [Status(self._options, self._session, raw_stat_json)
for raw_stat_json in r_json]
return statuses | def statuses(self):
"""Get a list of status Resources from the server.
:rtype: List[Status]
"""
r_json = self._get_json('status')
statuses = [Status(self._options, self._session, raw_stat_json)
for raw_stat_json in r_json]
return statuses | [
"Get",
"a",
"list",
"of",
"status",
"Resources",
"from",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2487-L2496 | [
"def",
"statuses",
"(",
"self",
")",
":",
"r_json",
"=",
"self",
".",
"_get_json",
"(",
"'status'",
")",
"statuses",
"=",
"[",
"Status",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
",",
"raw_stat_json",
")",
"for",
"raw_stat_json",
"in",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.statuscategories | Get a list of status category Resources from the server.
:rtype: List[StatusCategory] | jira/client.py | def statuscategories(self):
"""Get a list of status category Resources from the server.
:rtype: List[StatusCategory]
"""
r_json = self._get_json('statuscategory')
statuscategories = [StatusCategory(self._options, self._session, raw_stat_json)
for raw_... | def statuscategories(self):
"""Get a list of status category Resources from the server.
:rtype: List[StatusCategory]
"""
r_json = self._get_json('statuscategory')
statuscategories = [StatusCategory(self._options, self._session, raw_stat_json)
for raw_... | [
"Get",
"a",
"list",
"of",
"status",
"category",
"Resources",
"from",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2508-L2516 | [
"def",
"statuscategories",
"(",
"self",
")",
":",
"r_json",
"=",
"self",
".",
"_get_json",
"(",
"'statuscategory'",
")",
"statuscategories",
"=",
"[",
"StatusCategory",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
",",
"raw_stat_json",
")",
"f... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.user | Get a user Resource from the server.
:param id: ID of the user to get
:param id: str
:param expand: Extra information to fetch inside each resource
:type expand: Optional[Any]
:rtype: User | jira/client.py | def user(self, id, expand=None):
"""Get a user Resource from the server.
:param id: ID of the user to get
:param id: str
:param expand: Extra information to fetch inside each resource
:type expand: Optional[Any]
:rtype: User
"""
user = User(self._options... | def user(self, id, expand=None):
"""Get a user Resource from the server.
:param id: ID of the user to get
:param id: str
:param expand: Extra information to fetch inside each resource
:type expand: Optional[Any]
:rtype: User
"""
user = User(self._options... | [
"Get",
"a",
"user",
"Resource",
"from",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2531-L2546 | [
"def",
"user",
"(",
"self",
",",
"id",
",",
"expand",
"=",
"None",
")",
":",
"user",
"=",
"User",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
")",
"params",
"=",
"{",
"}",
"if",
"expand",
"is",
"not",
"None",
":",
"params",
"[",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.search_assignable_users_for_projects | Get a list of user Resources that match the search string and can be assigned issues for projects.
:param username: A string to match usernames against
:type username: str
:param projectKeys: Comma-separated list of project keys to check for issue assignment permissions
:type projectKey... | jira/client.py | def search_assignable_users_for_projects(self, username, projectKeys, startAt=0, maxResults=50):
"""Get a list of user Resources that match the search string and can be assigned issues for projects.
:param username: A string to match usernames against
:type username: str
:param projectK... | def search_assignable_users_for_projects(self, username, projectKeys, startAt=0, maxResults=50):
"""Get a list of user Resources that match the search string and can be assigned issues for projects.
:param username: A string to match usernames against
:type username: str
:param projectK... | [
"Get",
"a",
"list",
"of",
"user",
"Resources",
"that",
"match",
"the",
"search",
"string",
"and",
"can",
"be",
"assigned",
"issues",
"for",
"projects",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2548-L2567 | [
"def",
"search_assignable_users_for_projects",
"(",
"self",
",",
"username",
",",
"projectKeys",
",",
"startAt",
"=",
"0",
",",
"maxResults",
"=",
"50",
")",
":",
"params",
"=",
"{",
"'username'",
":",
"username",
",",
"'projectKeys'",
":",
"projectKeys",
"}",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.search_assignable_users_for_issues | Get a list of user Resources that match the search string for assigning or creating issues.
This method is intended to find users that are eligible to create issues in a project or be assigned
to an existing issue. When searching for eligible creators, specify a project. When searching for eligible
... | jira/client.py | def search_assignable_users_for_issues(self,
username,
project=None,
issueKey=None,
expand=None,
startAt=... | def search_assignable_users_for_issues(self,
username,
project=None,
issueKey=None,
expand=None,
startAt=... | [
"Get",
"a",
"list",
"of",
"user",
"Resources",
"that",
"match",
"the",
"search",
"string",
"for",
"assigning",
"or",
"creating",
"issues",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2569-L2607 | [
"def",
"search_assignable_users_for_issues",
"(",
"self",
",",
"username",
",",
"project",
"=",
"None",
",",
"issueKey",
"=",
"None",
",",
"expand",
"=",
"None",
",",
"startAt",
"=",
"0",
",",
"maxResults",
"=",
"50",
",",
")",
":",
"params",
"=",
"{",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.create_temp_user_avatar | Register an image file as a user avatar.
The avatar created is temporary and must be confirmed before it can
be used.
Avatar images are specified by a filename, size, and file object. By default, the client will attempt to
autodetect the picture's content type: this mechanism relies on... | jira/client.py | def create_temp_user_avatar(self,
user,
filename,
size,
avatar_img,
contentType=None,
auto_confirm=False,
... | def create_temp_user_avatar(self,
user,
filename,
size,
avatar_img,
contentType=None,
auto_confirm=False,
... | [
"Register",
"an",
"image",
"file",
"as",
"a",
"user",
"avatar",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2617-L2685 | [
"def",
"create_temp_user_avatar",
"(",
"self",
",",
"user",
",",
"filename",
",",
"size",
",",
"avatar_img",
",",
"contentType",
"=",
"None",
",",
"auto_confirm",
"=",
"False",
",",
")",
":",
"size_from_file",
"=",
"os",
".",
"path",
".",
"getsize",
"(",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.confirm_user_avatar | Confirm the temporary avatar image previously uploaded with the specified cropping.
After a successful registry with :py:meth:`create_temp_user_avatar`, use this method to confirm the avatar for
use. The final avatar can be a subarea of the uploaded image, which is customized with the
``croppin... | jira/client.py | def confirm_user_avatar(self, user, cropping_properties):
"""Confirm the temporary avatar image previously uploaded with the specified cropping.
After a successful registry with :py:meth:`create_temp_user_avatar`, use this method to confirm the avatar for
use. The final avatar can be a subarea ... | def confirm_user_avatar(self, user, cropping_properties):
"""Confirm the temporary avatar image previously uploaded with the specified cropping.
After a successful registry with :py:meth:`create_temp_user_avatar`, use this method to confirm the avatar for
use. The final avatar can be a subarea ... | [
"Confirm",
"the",
"temporary",
"avatar",
"image",
"previously",
"uploaded",
"with",
"the",
"specified",
"cropping",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2687-L2705 | [
"def",
"confirm_user_avatar",
"(",
"self",
",",
"user",
",",
"cropping_properties",
")",
":",
"data",
"=",
"cropping_properties",
"url",
"=",
"self",
".",
"_get_url",
"(",
"'user/avatar'",
")",
"r",
"=",
"self",
".",
"_session",
".",
"post",
"(",
"url",
",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.set_user_avatar | Set a user's avatar.
:param username: the user to set the avatar for
:param avatar: ID of the avatar to set | jira/client.py | def set_user_avatar(self, username, avatar):
"""Set a user's avatar.
:param username: the user to set the avatar for
:param avatar: ID of the avatar to set
"""
self._set_avatar(
{'username': username}, self._get_url('user/avatar'), avatar) | def set_user_avatar(self, username, avatar):
"""Set a user's avatar.
:param username: the user to set the avatar for
:param avatar: ID of the avatar to set
"""
self._set_avatar(
{'username': username}, self._get_url('user/avatar'), avatar) | [
"Set",
"a",
"user",
"s",
"avatar",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2707-L2714 | [
"def",
"set_user_avatar",
"(",
"self",
",",
"username",
",",
"avatar",
")",
":",
"self",
".",
"_set_avatar",
"(",
"{",
"'username'",
":",
"username",
"}",
",",
"self",
".",
"_get_url",
"(",
"'user/avatar'",
")",
",",
"avatar",
")"
] | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.delete_user_avatar | Delete a user's avatar.
:param username: the user to delete the avatar from
:param avatar: ID of the avatar to remove | jira/client.py | def delete_user_avatar(self, username, avatar):
"""Delete a user's avatar.
:param username: the user to delete the avatar from
:param avatar: ID of the avatar to remove
"""
params = {'username': username}
url = self._get_url('user/avatar/' + avatar)
return self._... | def delete_user_avatar(self, username, avatar):
"""Delete a user's avatar.
:param username: the user to delete the avatar from
:param avatar: ID of the avatar to remove
"""
params = {'username': username}
url = self._get_url('user/avatar/' + avatar)
return self._... | [
"Delete",
"a",
"user",
"s",
"avatar",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2716-L2724 | [
"def",
"delete_user_avatar",
"(",
"self",
",",
"username",
",",
"avatar",
")",
":",
"params",
"=",
"{",
"'username'",
":",
"username",
"}",
"url",
"=",
"self",
".",
"_get_url",
"(",
"'user/avatar/'",
"+",
"avatar",
")",
"return",
"self",
".",
"_session",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.search_users | Get a list of user Resources that match the specified search string.
:param user: a string to match usernames, name or email against.
:type user: str
:param startAt: index of the first user to return.
:type startAt: int
:param maxResults: maximum number of users to return.
... | jira/client.py | def search_users(self, user, startAt=0, maxResults=50, includeActive=True, includeInactive=False):
"""Get a list of user Resources that match the specified search string.
:param user: a string to match usernames, name or email against.
:type user: str
:param startAt: index of the first ... | def search_users(self, user, startAt=0, maxResults=50, includeActive=True, includeInactive=False):
"""Get a list of user Resources that match the specified search string.
:param user: a string to match usernames, name or email against.
:type user: str
:param startAt: index of the first ... | [
"Get",
"a",
"list",
"of",
"user",
"Resources",
"that",
"match",
"the",
"specified",
"search",
"string",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2726-L2748 | [
"def",
"search_users",
"(",
"self",
",",
"user",
",",
"startAt",
"=",
"0",
",",
"maxResults",
"=",
"50",
",",
"includeActive",
"=",
"True",
",",
"includeInactive",
"=",
"False",
")",
":",
"params",
"=",
"{",
"'username'",
":",
"user",
",",
"'includeActiv... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.search_allowed_users_for_issue | Get a list of user Resources that match a username string and have browse permission for the issue or project.
:param user: a string to match usernames against.
:type user: str
:param issueKey: find users with browse permission for this issue.
:type issueKey: Optional[str]
:para... | jira/client.py | def search_allowed_users_for_issue(self, user, issueKey=None, projectKey=None, startAt=0, maxResults=50):
"""Get a list of user Resources that match a username string and have browse permission for the issue or project.
:param user: a string to match usernames against.
:type user: str
:... | def search_allowed_users_for_issue(self, user, issueKey=None, projectKey=None, startAt=0, maxResults=50):
"""Get a list of user Resources that match a username string and have browse permission for the issue or project.
:param user: a string to match usernames against.
:type user: str
:... | [
"Get",
"a",
"list",
"of",
"user",
"Resources",
"that",
"match",
"a",
"username",
"string",
"and",
"have",
"browse",
"permission",
"for",
"the",
"issue",
"or",
"project",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2750-L2771 | [
"def",
"search_allowed_users_for_issue",
"(",
"self",
",",
"user",
",",
"issueKey",
"=",
"None",
",",
"projectKey",
"=",
"None",
",",
"startAt",
"=",
"0",
",",
"maxResults",
"=",
"50",
")",
":",
"params",
"=",
"{",
"'username'",
":",
"user",
"}",
"if",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.create_version | Create a version in a project and return a Resource for it.
:param name: name of the version to create
:type name: str
:param project: key of the project to create the version in
:type project: str
:param description: a description of the version
:type description: str
... | jira/client.py | def create_version(self,
name,
project,
description=None,
releaseDate=None,
startDate=None,
archived=False,
released=False,
):
"... | def create_version(self,
name,
project,
description=None,
releaseDate=None,
startDate=None,
archived=False,
released=False,
):
"... | [
"Create",
"a",
"version",
"in",
"a",
"project",
"and",
"return",
"a",
"Resource",
"for",
"it",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2776-L2822 | [
"def",
"create_version",
"(",
"self",
",",
"name",
",",
"project",
",",
"description",
"=",
"None",
",",
"releaseDate",
"=",
"None",
",",
"startDate",
"=",
"None",
",",
"archived",
"=",
"False",
",",
"released",
"=",
"False",
",",
")",
":",
"data",
"="... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.move_version | Move a version within a project's ordered version list and return a new version Resource for it.
One, but not both, of ``after`` and ``position`` must be specified.
:param id: ID of the version to move
:param after: the self attribute of a version to place the specified version after (that is,... | jira/client.py | def move_version(self, id, after=None, position=None):
"""Move a version within a project's ordered version list and return a new version Resource for it.
One, but not both, of ``after`` and ``position`` must be specified.
:param id: ID of the version to move
:param after: the self att... | def move_version(self, id, after=None, position=None):
"""Move a version within a project's ordered version list and return a new version Resource for it.
One, but not both, of ``after`` and ``position`` must be specified.
:param id: ID of the version to move
:param after: the self att... | [
"Move",
"a",
"version",
"within",
"a",
"project",
"s",
"ordered",
"version",
"list",
"and",
"return",
"a",
"new",
"version",
"Resource",
"for",
"it",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2824-L2845 | [
"def",
"move_version",
"(",
"self",
",",
"id",
",",
"after",
"=",
"None",
",",
"position",
"=",
"None",
")",
":",
"data",
"=",
"{",
"}",
"if",
"after",
"is",
"not",
"None",
":",
"data",
"[",
"'after'",
"]",
"=",
"after",
"elif",
"position",
"is",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.version | Get a version Resource.
:param id: ID of the version to get
:type id: str
:param expand: extra information to fetch inside each resource
:type expand: Optional[Any]
:rtype: Version | jira/client.py | def version(self, id, expand=None):
"""Get a version Resource.
:param id: ID of the version to get
:type id: str
:param expand: extra information to fetch inside each resource
:type expand: Optional[Any]
:rtype: Version
"""
version = Version(self._option... | def version(self, id, expand=None):
"""Get a version Resource.
:param id: ID of the version to get
:type id: str
:param expand: extra information to fetch inside each resource
:type expand: Optional[Any]
:rtype: Version
"""
version = Version(self._option... | [
"Get",
"a",
"version",
"Resource",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2847-L2862 | [
"def",
"version",
"(",
"self",
",",
"id",
",",
"expand",
"=",
"None",
")",
":",
"version",
"=",
"Version",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
")",
"params",
"=",
"{",
"}",
"if",
"expand",
"is",
"not",
"None",
":",
"params",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.session | Get a dict of the current authenticated user's session information.
:param auth: Tuple of username and password.
:type auth: Optional[Tuple[str,str]]
:rtype: User | jira/client.py | def session(self, auth=None):
"""Get a dict of the current authenticated user's session information.
:param auth: Tuple of username and password.
:type auth: Optional[Tuple[str,str]]
:rtype: User
"""
url = '{server}{auth_url}'.format(**self._options)
if isinst... | def session(self, auth=None):
"""Get a dict of the current authenticated user's session information.
:param auth: Tuple of username and password.
:type auth: Optional[Tuple[str,str]]
:rtype: User
"""
url = '{server}{auth_url}'.format(**self._options)
if isinst... | [
"Get",
"a",
"dict",
"of",
"the",
"current",
"authenticated",
"user",
"s",
"session",
"information",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2882-L2903 | [
"def",
"session",
"(",
"self",
",",
"auth",
"=",
"None",
")",
":",
"url",
"=",
"'{server}{auth_url}'",
".",
"format",
"(",
"*",
"*",
"self",
".",
"_options",
")",
"if",
"isinstance",
"(",
"self",
".",
"_session",
".",
"auth",
",",
"tuple",
")",
"or",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.kill_websudo | Destroy the user's current WebSudo session.
Works only for non-cloud deployments, for others does nothing.
:rtype: Optional[Any] | jira/client.py | def kill_websudo(self):
"""Destroy the user's current WebSudo session.
Works only for non-cloud deployments, for others does nothing.
:rtype: Optional[Any]
"""
if self.deploymentType != 'Cloud':
url = self._options['server'] + '/rest/auth/1/websudo'
retu... | def kill_websudo(self):
"""Destroy the user's current WebSudo session.
Works only for non-cloud deployments, for others does nothing.
:rtype: Optional[Any]
"""
if self.deploymentType != 'Cloud':
url = self._options['server'] + '/rest/auth/1/websudo'
retu... | [
"Destroy",
"the",
"user",
"s",
"current",
"WebSudo",
"session",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2911-L2920 | [
"def",
"kill_websudo",
"(",
"self",
")",
":",
"if",
"self",
".",
"deploymentType",
"!=",
"'Cloud'",
":",
"url",
"=",
"self",
".",
"_options",
"[",
"'server'",
"]",
"+",
"'/rest/auth/1/websudo'",
"return",
"self",
".",
"_session",
".",
"delete",
"(",
"url",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA._create_http_basic_session | Creates a basic http session.
:param username: Username for the session
:type username: str
:param password: Password for the username
:type password: str
:param timeout: If set determines the timeout period for the Session.
:type timeout: Optional[int]
:rtype: ... | jira/client.py | def _create_http_basic_session(self, username, password, timeout=None):
""" Creates a basic http session.
:param username: Username for the session
:type username: str
:param password: Password for the username
:type password: str
:param timeout: If set determines the ti... | def _create_http_basic_session(self, username, password, timeout=None):
""" Creates a basic http session.
:param username: Username for the session
:type username: str
:param password: Password for the username
:type password: str
:param timeout: If set determines the ti... | [
"Creates",
"a",
"basic",
"http",
"session",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L2923-L2939 | [
"def",
"_create_http_basic_session",
"(",
"self",
",",
"username",
",",
"password",
",",
"timeout",
"=",
"None",
")",
":",
"verify",
"=",
"self",
".",
"_options",
"[",
"'verify'",
"]",
"self",
".",
"_session",
"=",
"ResilientSession",
"(",
"timeout",
"=",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA._get_url | Returns the full url based on JIRA base url and the path provided
:param path: The subpath desired.
:type path: str
:param base: The base url which should be prepended to the path
:type base: Optional[str]
:return Fully qualified URL
:rtype: str | jira/client.py | def _get_url(self, path, base=JIRA_BASE_URL):
""" Returns the full url based on JIRA base url and the path provided
:param path: The subpath desired.
:type path: str
:param base: The base url which should be prepended to the path
:type base: Optional[str]
:return Fully ... | def _get_url(self, path, base=JIRA_BASE_URL):
""" Returns the full url based on JIRA base url and the path provided
:param path: The subpath desired.
:type path: str
:param base: The base url which should be prepended to the path
:type base: Optional[str]
:return Fully ... | [
"Returns",
"the",
"full",
"url",
"based",
"on",
"JIRA",
"base",
"url",
"and",
"the",
"path",
"provided"
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3007-L3021 | [
"def",
"_get_url",
"(",
"self",
",",
"path",
",",
"base",
"=",
"JIRA_BASE_URL",
")",
":",
"options",
"=",
"self",
".",
"_options",
".",
"copy",
"(",
")",
"options",
".",
"update",
"(",
"{",
"'path'",
":",
"path",
"}",
")",
"return",
"base",
".",
"f... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA._get_json | Get the json for a given path and params.
:param path: The subpath required
:type path: str
:param params: Parameters to filter the json query.
:type params: Optional[Dict[str, Any]]
:param base: The Base JIRA URL, defaults to the instance base.
:type base: Optional[str]... | jira/client.py | def _get_json(self,
path,
params=None,
base=JIRA_BASE_URL,
):
"""Get the json for a given path and params.
:param path: The subpath required
:type path: str
:param params: Parameters to filter the json query.
... | def _get_json(self,
path,
params=None,
base=JIRA_BASE_URL,
):
"""Get the json for a given path and params.
:param path: The subpath required
:type path: str
:param params: Parameters to filter the json query.
... | [
"Get",
"the",
"json",
"for",
"a",
"given",
"path",
"and",
"params",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3023-L3047 | [
"def",
"_get_json",
"(",
"self",
",",
"path",
",",
"params",
"=",
"None",
",",
"base",
"=",
"JIRA_BASE_URL",
",",
")",
":",
"url",
"=",
"self",
".",
"_get_url",
"(",
"path",
",",
"base",
")",
"r",
"=",
"self",
".",
"_session",
".",
"get",
"(",
"u... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA._get_mime_type | Get the MIME type for a given stream of bytes
:param buff: Stream of bytes
:type buff: bytes
:rtype: str | jira/client.py | def _get_mime_type(self, buff):
"""Get the MIME type for a given stream of bytes
:param buff: Stream of bytes
:type buff: bytes
:rtype: str
"""
if self._magic is not None:
return self._magic.id_buffer(buff)
else:
try:
ret... | def _get_mime_type(self, buff):
"""Get the MIME type for a given stream of bytes
:param buff: Stream of bytes
:type buff: bytes
:rtype: str
"""
if self._magic is not None:
return self._magic.id_buffer(buff)
else:
try:
ret... | [
"Get",
"the",
"MIME",
"type",
"for",
"a",
"given",
"stream",
"of",
"bytes"
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3078-L3095 | [
"def",
"_get_mime_type",
"(",
"self",
",",
"buff",
")",
":",
"if",
"self",
".",
"_magic",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_magic",
".",
"id_buffer",
"(",
"buff",
")",
"else",
":",
"try",
":",
"return",
"mimetypes",
".",
"guess_type",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.rename_user | Rename a JIRA user.
:param old_user: Old username login
:type old_user: str
:param new_user: New username login
:type new_user: str | jira/client.py | def rename_user(self, old_user, new_user):
"""Rename a JIRA user.
:param old_user: Old username login
:type old_user: str
:param new_user: New username login
:type new_user: str
"""
if self._version > (6, 0, 0):
url = self._options['server'] + '/rest... | def rename_user(self, old_user, new_user):
"""Rename a JIRA user.
:param old_user: Old username login
:type old_user: str
:param new_user: New username login
:type new_user: str
"""
if self._version > (6, 0, 0):
url = self._options['server'] + '/rest... | [
"Rename",
"a",
"JIRA",
"user",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3097-L3121 | [
"def",
"rename_user",
"(",
"self",
",",
"old_user",
",",
"new_user",
")",
":",
"if",
"self",
".",
"_version",
">",
"(",
"6",
",",
"0",
",",
"0",
")",
":",
"url",
"=",
"self",
".",
"_options",
"[",
"'server'",
"]",
"+",
"'/rest/api/latest/user'",
"pay... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.delete_user | Deletes a JIRA User.
:param username: Username to delete
:type username: str
:return: Success of user deletion
:rtype: bool | jira/client.py | def delete_user(self, username):
"""Deletes a JIRA User.
:param username: Username to delete
:type username: str
:return: Success of user deletion
:rtype: bool
"""
url = self._options['server'] + '/rest/api/latest/user/?username=%s' % username
r = sel... | def delete_user(self, username):
"""Deletes a JIRA User.
:param username: Username to delete
:type username: str
:return: Success of user deletion
:rtype: bool
"""
url = self._options['server'] + '/rest/api/latest/user/?username=%s' % username
r = sel... | [
"Deletes",
"a",
"JIRA",
"User",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3123-L3141 | [
"def",
"delete_user",
"(",
"self",
",",
"username",
")",
":",
"url",
"=",
"self",
".",
"_options",
"[",
"'server'",
"]",
"+",
"'/rest/api/latest/user/?username=%s'",
"%",
"username",
"r",
"=",
"self",
".",
"_session",
".",
"delete",
"(",
"url",
")",
"if",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.deactivate_user | Disable/deactivate the user.
:param username: User to be deactivated.
:type username: str
:rtype: Union[str, int] | jira/client.py | def deactivate_user(self, username):
"""Disable/deactivate the user.
:param username: User to be deactivated.
:type username: str
:rtype: Union[str, int]
"""
if self.deploymentType == 'Cloud':
# Disabling users now needs cookie auth in the Cloud - see https:... | def deactivate_user(self, username):
"""Disable/deactivate the user.
:param username: User to be deactivated.
:type username: str
:rtype: Union[str, int]
"""
if self.deploymentType == 'Cloud':
# Disabling users now needs cookie auth in the Cloud - see https:... | [
"Disable",
"/",
"deactivate",
"the",
"user",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3143-L3196 | [
"def",
"deactivate_user",
"(",
"self",
",",
"username",
")",
":",
"if",
"self",
".",
"deploymentType",
"==",
"'Cloud'",
":",
"# Disabling users now needs cookie auth in the Cloud - see https://jira.atlassian.com/browse/ID-6230",
"if",
"'authCookie'",
"not",
"in",
"vars",
"(... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.reindex | Start jira re-indexing. Returns True if reindexing is in progress or not needed, or False.
If you call reindex() without any parameters it will perform a background reindex only if JIRA thinks it should do it.
:param force: reindex even if JIRA doesn't say this is needed, False by default.
:pa... | jira/client.py | def reindex(self, force=False, background=True):
"""Start jira re-indexing. Returns True if reindexing is in progress or not needed, or False.
If you call reindex() without any parameters it will perform a background reindex only if JIRA thinks it should do it.
:param force: reindex even if JI... | def reindex(self, force=False, background=True):
"""Start jira re-indexing. Returns True if reindexing is in progress or not needed, or False.
If you call reindex() without any parameters it will perform a background reindex only if JIRA thinks it should do it.
:param force: reindex even if JI... | [
"Start",
"jira",
"re",
"-",
"indexing",
".",
"Returns",
"True",
"if",
"reindexing",
"is",
"in",
"progress",
"or",
"not",
"needed",
"or",
"False",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3198-L3234 | [
"def",
"reindex",
"(",
"self",
",",
"force",
"=",
"False",
",",
"background",
"=",
"True",
")",
":",
"# /secure/admin/IndexAdmin.jspa",
"# /secure/admin/jira/IndexProgress.jspa?taskId=1",
"if",
"background",
":",
"indexingStrategy",
"=",
"'background'",
"else",
":",
"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.backup | Will call jira export to backup as zipped xml. Returning with success does not mean that the backup process finished. | jira/client.py | def backup(self, filename='backup.zip', attachments=False):
"""Will call jira export to backup as zipped xml. Returning with success does not mean that the backup process finished."""
if self.deploymentType == 'Cloud':
url = self._options['server'] + '/rest/backup/1/export/runbackup'
... | def backup(self, filename='backup.zip', attachments=False):
"""Will call jira export to backup as zipped xml. Returning with success does not mean that the backup process finished."""
if self.deploymentType == 'Cloud':
url = self._options['server'] + '/rest/backup/1/export/runbackup'
... | [
"Will",
"call",
"jira",
"export",
"to",
"backup",
"as",
"zipped",
"xml",
".",
"Returning",
"with",
"success",
"does",
"not",
"mean",
"that",
"the",
"backup",
"process",
"finished",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3236-L3254 | [
"def",
"backup",
"(",
"self",
",",
"filename",
"=",
"'backup.zip'",
",",
"attachments",
"=",
"False",
")",
":",
"if",
"self",
".",
"deploymentType",
"==",
"'Cloud'",
":",
"url",
"=",
"self",
".",
"_options",
"[",
"'server'",
"]",
"+",
"'/rest/backup/1/expo... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.backup_progress | Return status of cloud backup as a dict.
Is there a way to get progress for Server version? | jira/client.py | def backup_progress(self):
"""Return status of cloud backup as a dict.
Is there a way to get progress for Server version?
"""
epoch_time = int(time.time() * 1000)
if self.deploymentType == 'Cloud':
url = self._options['server'] + '/rest/obm/1.0/getprogress?_=%i' % ep... | def backup_progress(self):
"""Return status of cloud backup as a dict.
Is there a way to get progress for Server version?
"""
epoch_time = int(time.time() * 1000)
if self.deploymentType == 'Cloud':
url = self._options['server'] + '/rest/obm/1.0/getprogress?_=%i' % ep... | [
"Return",
"status",
"of",
"cloud",
"backup",
"as",
"a",
"dict",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3256-L3284 | [
"def",
"backup_progress",
"(",
"self",
")",
":",
"epoch_time",
"=",
"int",
"(",
"time",
".",
"time",
"(",
")",
"*",
"1000",
")",
"if",
"self",
".",
"deploymentType",
"==",
"'Cloud'",
":",
"url",
"=",
"self",
".",
"_options",
"[",
"'server'",
"]",
"+"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.backup_complete | Return boolean based on 'alternativePercentage' and 'size' returned from backup_progress (cloud only). | jira/client.py | def backup_complete(self):
"""Return boolean based on 'alternativePercentage' and 'size' returned from backup_progress (cloud only)."""
if self.deploymentType != 'Cloud':
logging.warning(
'This functionality is not available in Server version')
return None
... | def backup_complete(self):
"""Return boolean based on 'alternativePercentage' and 'size' returned from backup_progress (cloud only)."""
if self.deploymentType != 'Cloud':
logging.warning(
'This functionality is not available in Server version')
return None
... | [
"Return",
"boolean",
"based",
"on",
"alternativePercentage",
"and",
"size",
"returned",
"from",
"backup_progress",
"(",
"cloud",
"only",
")",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3286-L3296 | [
"def",
"backup_complete",
"(",
"self",
")",
":",
"if",
"self",
".",
"deploymentType",
"!=",
"'Cloud'",
":",
"logging",
".",
"warning",
"(",
"'This functionality is not available in Server version'",
")",
"return",
"None",
"status",
"=",
"self",
".",
"backup_progress... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.backup_download | Download backup file from WebDAV (cloud only). | jira/client.py | def backup_download(self, filename=None):
"""Download backup file from WebDAV (cloud only)."""
if self.deploymentType != 'Cloud':
logging.warning(
'This functionality is not available in Server version')
return None
remote_file = self.backup_progress()['fi... | def backup_download(self, filename=None):
"""Download backup file from WebDAV (cloud only)."""
if self.deploymentType != 'Cloud':
logging.warning(
'This functionality is not available in Server version')
return None
remote_file = self.backup_progress()['fi... | [
"Download",
"backup",
"file",
"from",
"WebDAV",
"(",
"cloud",
"only",
")",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3298-L3323 | [
"def",
"backup_download",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"if",
"self",
".",
"deploymentType",
"!=",
"'Cloud'",
":",
"logging",
".",
"warning",
"(",
"'This functionality is not available in Server version'",
")",
"return",
"None",
"remote_file",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.current_user | Returns the username of the current user.
:rtype: str | jira/client.py | def current_user(self):
"""Returns the username of the current user.
:rtype: str
"""
if not hasattr(self, '_serverInfo') or 'username' not in self._serverInfo:
url = self._get_url('serverInfo')
r = self._session.get(url, headers=self._options['headers'])
... | def current_user(self):
"""Returns the username of the current user.
:rtype: str
"""
if not hasattr(self, '_serverInfo') or 'username' not in self._serverInfo:
url = self._get_url('serverInfo')
r = self._session.get(url, headers=self._options['headers'])
... | [
"Returns",
"the",
"username",
"of",
"the",
"current",
"user",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3325-L3342 | [
"def",
"current_user",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_serverInfo'",
")",
"or",
"'username'",
"not",
"in",
"self",
".",
"_serverInfo",
":",
"url",
"=",
"self",
".",
"_get_url",
"(",
"'serverInfo'",
")",
"r",
"=",
"se... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.delete_project | Delete project from Jira.
:param pid: JIRA projectID or Project or slug
:type pid: str
:return: True if project was deleted
:rtype: bool
:raises JIRAError: If project not found or not enough permissions
:raises ValueError: If pid parameter is not Project, slug or Projec... | jira/client.py | def delete_project(self, pid):
"""Delete project from Jira.
:param pid: JIRA projectID or Project or slug
:type pid: str
:return: True if project was deleted
:rtype: bool
:raises JIRAError: If project not found or not enough permissions
:raises ValueError: If pi... | def delete_project(self, pid):
"""Delete project from Jira.
:param pid: JIRA projectID or Project or slug
:type pid: str
:return: True if project was deleted
:rtype: bool
:raises JIRAError: If project not found or not enough permissions
:raises ValueError: If pi... | [
"Delete",
"project",
"from",
"Jira",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3344-L3389 | [
"def",
"delete_project",
"(",
"self",
",",
"pid",
")",
":",
"# allows us to call it with Project objects",
"if",
"hasattr",
"(",
"pid",
",",
"'id'",
")",
":",
"pid",
"=",
"pid",
".",
"id",
"# Check if pid is a number - then we assume that it is",
"# projectID",
"try",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.create_project | Create a project with the specified parameters.
:param key: Mandatory. Must match JIRA project key requirements, usually only 2-10 uppercase characters.
:type: str
:param name: If not specified it will use the key value.
:type name: Optional[str]
:param assignee: If not specifie... | jira/client.py | def create_project(self, key, name=None, assignee=None, type="Software", template_name=None):
"""Create a project with the specified parameters.
:param key: Mandatory. Must match JIRA project key requirements, usually only 2-10 uppercase characters.
:type: str
:param name: If not specif... | def create_project(self, key, name=None, assignee=None, type="Software", template_name=None):
"""Create a project with the specified parameters.
:param key: Mandatory. Must match JIRA project key requirements, usually only 2-10 uppercase characters.
:type: str
:param name: If not specif... | [
"Create",
"a",
"project",
"with",
"the",
"specified",
"parameters",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3426-L3498 | [
"def",
"create_project",
"(",
"self",
",",
"key",
",",
"name",
"=",
"None",
",",
"assignee",
"=",
"None",
",",
"type",
"=",
"\"Software\"",
",",
"template_name",
"=",
"None",
")",
":",
"if",
"assignee",
"is",
"None",
":",
"assignee",
"=",
"self",
".",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.add_user | Create a new JIRA user.
:param username: the username of the new user
:type username: str
:param email: email address of the new user
:type email: str
:param directoryId: The directory ID the new user should be a part of (Default: 1)
:type directoryId: int
:param... | jira/client.py | def add_user(self,
username,
email,
directoryId=1,
password=None,
fullname=None,
notify=False,
active=True,
ignore_existing=False,
application_keys=None,
... | def add_user(self,
username,
email,
directoryId=1,
password=None,
fullname=None,
notify=False,
active=True,
ignore_existing=False,
application_keys=None,
... | [
"Create",
"a",
"new",
"JIRA",
"user",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3500-L3566 | [
"def",
"add_user",
"(",
"self",
",",
"username",
",",
"email",
",",
"directoryId",
"=",
"1",
",",
"password",
"=",
"None",
",",
"fullname",
"=",
"None",
",",
"notify",
"=",
"False",
",",
"active",
"=",
"True",
",",
"ignore_existing",
"=",
"False",
",",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.add_user_to_group | Add a user to an existing group.
:param username: Username that will be added to specified group.
:type username: str
:param group: Group that the user will be added to.
:type group: str
:return: json response from Jira server for success or a value that evaluates as False in c... | jira/client.py | def add_user_to_group(self, username, group):
"""Add a user to an existing group.
:param username: Username that will be added to specified group.
:type username: str
:param group: Group that the user will be added to.
:type group: str
:return: json response from Jira s... | def add_user_to_group(self, username, group):
"""Add a user to an existing group.
:param username: Username that will be added to specified group.
:type username: str
:param group: Group that the user will be added to.
:type group: str
:return: json response from Jira s... | [
"Add",
"a",
"user",
"to",
"an",
"existing",
"group",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3568-L3589 | [
"def",
"add_user_to_group",
"(",
"self",
",",
"username",
",",
"group",
")",
":",
"url",
"=",
"self",
".",
"_options",
"[",
"'server'",
"]",
"+",
"'/rest/api/latest/group/user'",
"x",
"=",
"{",
"'groupname'",
":",
"group",
"}",
"y",
"=",
"{",
"'name'",
"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.remove_user_from_group | Remove a user from a group.
:param username: The user to remove from the group.
:param groupname: The group that the user will be removed from. | jira/client.py | def remove_user_from_group(self, username, groupname):
"""Remove a user from a group.
:param username: The user to remove from the group.
:param groupname: The group that the user will be removed from.
"""
url = self._options['server'] + '/rest/api/latest/group/user'
x =... | def remove_user_from_group(self, username, groupname):
"""Remove a user from a group.
:param username: The user to remove from the group.
:param groupname: The group that the user will be removed from.
"""
url = self._options['server'] + '/rest/api/latest/group/user'
x =... | [
"Remove",
"a",
"user",
"from",
"a",
"group",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3591-L3603 | [
"def",
"remove_user_from_group",
"(",
"self",
",",
"username",
",",
"groupname",
")",
":",
"url",
"=",
"self",
".",
"_options",
"[",
"'server'",
"]",
"+",
"'/rest/api/latest/group/user'",
"x",
"=",
"{",
"'groupname'",
":",
"groupname",
",",
"'username'",
":",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.boards | Get a list of board resources.
:param startAt: The starting index of the returned boards. Base index: 0.
:param maxResults: The maximum number of boards to return per page. Default: 50
:param type: Filters results to boards of the specified type. Valid values: scrum, kanban.
:param name... | jira/client.py | def boards(self, startAt=0, maxResults=50, type=None, name=None, projectKeyOrID=None):
"""Get a list of board resources.
:param startAt: The starting index of the returned boards. Base index: 0.
:param maxResults: The maximum number of boards to return per page. Default: 50
:param type:... | def boards(self, startAt=0, maxResults=50, type=None, name=None, projectKeyOrID=None):
"""Get a list of board resources.
:param startAt: The starting index of the returned boards. Base index: 0.
:param maxResults: The maximum number of boards to return per page. Default: 50
:param type:... | [
"Get",
"a",
"list",
"of",
"board",
"resources",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3626-L3656 | [
"def",
"boards",
"(",
"self",
",",
"startAt",
"=",
"0",
",",
"maxResults",
"=",
"50",
",",
"type",
"=",
"None",
",",
"name",
"=",
"None",
",",
"projectKeyOrID",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"type",
":",
"params",
"[",
"'t... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.sprints | Get a list of sprint GreenHopperResources.
:param board_id: the board to get sprints from
:param extended: Used only by old GreenHopper API to fetch additional information like
startDate, endDate, completeDate, much slower because it requires an additional requests for each sprint.
... | jira/client.py | def sprints(self, board_id, extended=False, startAt=0, maxResults=50, state=None):
"""Get a list of sprint GreenHopperResources.
:param board_id: the board to get sprints from
:param extended: Used only by old GreenHopper API to fetch additional information like
startDate, endDate, ... | def sprints(self, board_id, extended=False, startAt=0, maxResults=50, state=None):
"""Get a list of sprint GreenHopperResources.
:param board_id: the board to get sprints from
:param extended: Used only by old GreenHopper API to fetch additional information like
startDate, endDate, ... | [
"Get",
"a",
"list",
"of",
"sprint",
"GreenHopperResources",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3659-L3703 | [
"def",
"sprints",
"(",
"self",
",",
"board_id",
",",
"extended",
"=",
"False",
",",
"startAt",
"=",
"0",
",",
"maxResults",
"=",
"50",
",",
"state",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"state",
":",
"params",
"[",
"'state'",
"]",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.incompletedIssuesEstimateSum | Return the total incompleted points this sprint. | jira/client.py | def incompletedIssuesEstimateSum(self, board_id, sprint_id):
"""Return the total incompleted points this sprint."""
return self._get_json('rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s' % (board_id, sprint_id),
base=self.AGILE_BASE_URL)['contents']['incompletedIssues... | def incompletedIssuesEstimateSum(self, board_id, sprint_id):
"""Return the total incompleted points this sprint."""
return self._get_json('rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s' % (board_id, sprint_id),
base=self.AGILE_BASE_URL)['contents']['incompletedIssues... | [
"Return",
"the",
"total",
"incompleted",
"points",
"this",
"sprint",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3733-L3736 | [
"def",
"incompletedIssuesEstimateSum",
"(",
"self",
",",
"board_id",
",",
"sprint_id",
")",
":",
"return",
"self",
".",
"_get_json",
"(",
"'rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s'",
"%",
"(",
"board_id",
",",
"sprint_id",
")",
",",
"base",
"=",
"self",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.removed_issues | Return the completed issues for the sprint. | jira/client.py | def removed_issues(self, board_id, sprint_id):
"""Return the completed issues for the sprint."""
r_json = self._get_json('rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s' % (board_id, sprint_id),
base=self.AGILE_BASE_URL)
issues = [Issue(self._options, self._... | def removed_issues(self, board_id, sprint_id):
"""Return the completed issues for the sprint."""
r_json = self._get_json('rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s' % (board_id, sprint_id),
base=self.AGILE_BASE_URL)
issues = [Issue(self._options, self._... | [
"Return",
"the",
"completed",
"issues",
"for",
"the",
"sprint",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3738-L3745 | [
"def",
"removed_issues",
"(",
"self",
",",
"board_id",
",",
"sprint_id",
")",
":",
"r_json",
"=",
"self",
".",
"_get_json",
"(",
"'rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s'",
"%",
"(",
"board_id",
",",
"sprint_id",
")",
",",
"base",
"=",
"self",
".",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.removedIssuesEstimateSum | Return the total incompleted points this sprint. | jira/client.py | def removedIssuesEstimateSum(self, board_id, sprint_id):
"""Return the total incompleted points this sprint."""
return self._get_json('rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s' % (board_id, sprint_id),
base=self.AGILE_BASE_URL)['contents']['puntedIssuesEstimateS... | def removedIssuesEstimateSum(self, board_id, sprint_id):
"""Return the total incompleted points this sprint."""
return self._get_json('rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s' % (board_id, sprint_id),
base=self.AGILE_BASE_URL)['contents']['puntedIssuesEstimateS... | [
"Return",
"the",
"total",
"incompleted",
"points",
"this",
"sprint",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3747-L3750 | [
"def",
"removedIssuesEstimateSum",
"(",
"self",
",",
"board_id",
",",
"sprint_id",
")",
":",
"return",
"self",
".",
"_get_json",
"(",
"'rapid/charts/sprintreport?rapidViewId=%s&sprintId=%s'",
"%",
"(",
"board_id",
",",
"sprint_id",
")",
",",
"base",
"=",
"self",
"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.sprint_info | Return the information about a sprint.
:param board_id: the board retrieving issues from. Deprecated and ignored.
:param sprint_id: the sprint retrieving issues from | jira/client.py | def sprint_info(self, board_id, sprint_id):
"""Return the information about a sprint.
:param board_id: the board retrieving issues from. Deprecated and ignored.
:param sprint_id: the sprint retrieving issues from
"""
sprint = Sprint(self._options, self._session)
sprint.f... | def sprint_info(self, board_id, sprint_id):
"""Return the information about a sprint.
:param board_id: the board retrieving issues from. Deprecated and ignored.
:param sprint_id: the sprint retrieving issues from
"""
sprint = Sprint(self._options, self._session)
sprint.f... | [
"Return",
"the",
"information",
"about",
"a",
"sprint",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3753-L3761 | [
"def",
"sprint_info",
"(",
"self",
",",
"board_id",
",",
"sprint_id",
")",
":",
"sprint",
"=",
"Sprint",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
")",
"sprint",
".",
"find",
"(",
"sprint_id",
")",
"return",
"sprint",
".",
"raw"
] | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.sprint | Return the information about a sprint.
:param sprint_id: the sprint retrieving issues from
:type sprint_id: int
:rtype: :class:`~jira.resources.Sprint` | jira/client.py | def sprint(self, id):
"""Return the information about a sprint.
:param sprint_id: the sprint retrieving issues from
:type sprint_id: int
:rtype: :class:`~jira.resources.Sprint`
"""
sprint = Sprint(self._options, self._session)
sprint.find(id)
return spr... | def sprint(self, id):
"""Return the information about a sprint.
:param sprint_id: the sprint retrieving issues from
:type sprint_id: int
:rtype: :class:`~jira.resources.Sprint`
"""
sprint = Sprint(self._options, self._session)
sprint.find(id)
return spr... | [
"Return",
"the",
"information",
"about",
"a",
"sprint",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3763-L3774 | [
"def",
"sprint",
"(",
"self",
",",
"id",
")",
":",
"sprint",
"=",
"Sprint",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
")",
"sprint",
".",
"find",
"(",
"id",
")",
"return",
"sprint"
] | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.delete_board | Delete an agile board. | jira/client.py | def delete_board(self, id):
"""Delete an agile board."""
board = Board(self._options, self._session, raw={'id': id})
board.delete() | def delete_board(self, id):
"""Delete an agile board."""
board = Board(self._options, self._session, raw={'id': id})
board.delete() | [
"Delete",
"an",
"agile",
"board",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3777-L3780 | [
"def",
"delete_board",
"(",
"self",
",",
"id",
")",
":",
"board",
"=",
"Board",
"(",
"self",
".",
"_options",
",",
"self",
".",
"_session",
",",
"raw",
"=",
"{",
"'id'",
":",
"id",
"}",
")",
"board",
".",
"delete",
"(",
")"
] | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.create_board | Create a new board for the ``project_ids``.
:param name: name of the board
:type name: str
:param project_ids: the projects to create the board in
:type project_ids: str
:param preset: What preset to use for this board. (Default: "scrum")
:type preset: 'kanban', 'scrum',... | jira/client.py | def create_board(self, name, project_ids, preset="scrum",
location_type='user', location_id=None):
"""Create a new board for the ``project_ids``.
:param name: name of the board
:type name: str
:param project_ids: the projects to create the board in
:type pro... | def create_board(self, name, project_ids, preset="scrum",
location_type='user', location_id=None):
"""Create a new board for the ``project_ids``.
:param name: name of the board
:type name: str
:param project_ids: the projects to create the board in
:type pro... | [
"Create",
"a",
"new",
"board",
"for",
"the",
"project_ids",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3782-L3826 | [
"def",
"create_board",
"(",
"self",
",",
"name",
",",
"project_ids",
",",
"preset",
"=",
"\"scrum\"",
",",
"location_type",
"=",
"'user'",
",",
"location_id",
"=",
"None",
")",
":",
"if",
"self",
".",
"_options",
"[",
"'agile_rest_path'",
"]",
"!=",
"Green... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.create_sprint | Create a new sprint for the ``board_id``.
:param name: Name of the sprint
:type name: str
:param board_id: Which board the sprint should be assigned.
:type board_id: int
:param startDate: Start date for the sprint.
:type startDate: Optional[Any]
:param endDate: E... | jira/client.py | def create_sprint(self, name, board_id, startDate=None, endDate=None):
"""Create a new sprint for the ``board_id``.
:param name: Name of the sprint
:type name: str
:param board_id: Which board the sprint should be assigned.
:type board_id: int
:param startDate: Start dat... | def create_sprint(self, name, board_id, startDate=None, endDate=None):
"""Create a new sprint for the ``board_id``.
:param name: Name of the sprint
:type name: str
:param board_id: Which board the sprint should be assigned.
:type board_id: int
:param startDate: Start dat... | [
"Create",
"a",
"new",
"sprint",
"for",
"the",
"board_id",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3828-L3876 | [
"def",
"create_sprint",
"(",
"self",
",",
"name",
",",
"board_id",
",",
"startDate",
"=",
"None",
",",
"endDate",
"=",
"None",
")",
":",
"payload",
"=",
"{",
"'name'",
":",
"name",
"}",
"if",
"startDate",
":",
"payload",
"[",
"\"startDate\"",
"]",
"=",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.add_issues_to_sprint | Add the issues in ``issue_keys`` to the ``sprint_id``.
The sprint must be started but not completed.
If a sprint was completed, then have to also edit the history of the
issue so that it was added to the sprint before it was completed,
preferably before it started. A completed sprint's... | jira/client.py | def add_issues_to_sprint(self, sprint_id, issue_keys):
"""Add the issues in ``issue_keys`` to the ``sprint_id``.
The sprint must be started but not completed.
If a sprint was completed, then have to also edit the history of the
issue so that it was added to the sprint before it was com... | def add_issues_to_sprint(self, sprint_id, issue_keys):
"""Add the issues in ``issue_keys`` to the ``sprint_id``.
The sprint must be started but not completed.
If a sprint was completed, then have to also edit the history of the
issue so that it was added to the sprint before it was com... | [
"Add",
"the",
"issues",
"in",
"issue_keys",
"to",
"the",
"sprint_id",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3878-L3921 | [
"def",
"add_issues_to_sprint",
"(",
"self",
",",
"sprint_id",
",",
"issue_keys",
")",
":",
"if",
"self",
".",
"_options",
"[",
"'agile_rest_path'",
"]",
"==",
"GreenHopperResource",
".",
"AGILE_BASE_REST_PATH",
":",
"url",
"=",
"self",
".",
"_get_url",
"(",
"'... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.add_issues_to_epic | Add the issues in ``issue_keys`` to the ``epic_id``.
:param epic_id: The ID for the epic where issues should be added.
:type epic_id: int
:param issue_keys: The issues to add to the epic
:type issue_keys: str
:param ignore_epics: ignore any issues listed in ``issue_keys`` that a... | jira/client.py | def add_issues_to_epic(self, epic_id, issue_keys, ignore_epics=True):
"""Add the issues in ``issue_keys`` to the ``epic_id``.
:param epic_id: The ID for the epic where issues should be added.
:type epic_id: int
:param issue_keys: The issues to add to the epic
:type issue_keys: s... | def add_issues_to_epic(self, epic_id, issue_keys, ignore_epics=True):
"""Add the issues in ``issue_keys`` to the ``epic_id``.
:param epic_id: The ID for the epic where issues should be added.
:type epic_id: int
:param issue_keys: The issues to add to the epic
:type issue_keys: s... | [
"Add",
"the",
"issues",
"in",
"issue_keys",
"to",
"the",
"epic_id",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3923-L3944 | [
"def",
"add_issues_to_epic",
"(",
"self",
",",
"epic_id",
",",
"issue_keys",
",",
"ignore_epics",
"=",
"True",
")",
":",
"if",
"self",
".",
"_options",
"[",
"'agile_rest_path'",
"]",
"!=",
"GreenHopperResource",
".",
"GREENHOPPER_REST_PATH",
":",
"# TODO(ssbarnea)... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | JIRA.rank | Rank an issue before another using the default Ranking field, the one named 'Rank'.
:param issue: issue key of the issue to be ranked before the second one.
:param next_issue: issue key of the second issue. | jira/client.py | def rank(self, issue, next_issue):
"""Rank an issue before another using the default Ranking field, the one named 'Rank'.
:param issue: issue key of the issue to be ranked before the second one.
:param next_issue: issue key of the second issue.
"""
if not self._rank:
... | def rank(self, issue, next_issue):
"""Rank an issue before another using the default Ranking field, the one named 'Rank'.
:param issue: issue key of the issue to be ranked before the second one.
:param next_issue: issue key of the second issue.
"""
if not self._rank:
... | [
"Rank",
"an",
"issue",
"before",
"another",
"using",
"the",
"default",
"Ranking",
"field",
"the",
"one",
"named",
"Rank",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/client.py#L3947-L3980 | [
"def",
"rank",
"(",
"self",
",",
"issue",
",",
"next_issue",
")",
":",
"if",
"not",
"self",
".",
"_rank",
":",
"for",
"field",
"in",
"self",
".",
"fields",
"(",
")",
":",
"if",
"field",
"[",
"'name'",
"]",
"==",
"'Rank'",
":",
"if",
"field",
"[",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | dict2resource | Convert a dictionary into a Jira Resource object.
Recursively walks a dict structure, transforming the properties into attributes
on a new ``Resource`` object of the appropriate type (if a ``self`` link is present)
or a ``PropertyHolder`` object (if no ``self`` link is present). | jira/resources.py | def dict2resource(raw, top=None, options=None, session=None):
"""Convert a dictionary into a Jira Resource object.
Recursively walks a dict structure, transforming the properties into attributes
on a new ``Resource`` object of the appropriate type (if a ``self`` link is present)
or a ``PropertyHolder``... | def dict2resource(raw, top=None, options=None, session=None):
"""Convert a dictionary into a Jira Resource object.
Recursively walks a dict structure, transforming the properties into attributes
on a new ``Resource`` object of the appropriate type (if a ``self`` link is present)
or a ``PropertyHolder``... | [
"Convert",
"a",
"dictionary",
"into",
"a",
"Jira",
"Resource",
"object",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L995-L1032 | [
"def",
"dict2resource",
"(",
"raw",
",",
"top",
"=",
"None",
",",
"options",
"=",
"None",
",",
"session",
"=",
"None",
")",
":",
"if",
"top",
"is",
"None",
":",
"top",
"=",
"PropertyHolder",
"(",
"raw",
")",
"seqs",
"=",
"tuple",
",",
"list",
",",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Resource.find | Finds a resource based on the input parameters.
:type id: Union[Tuple[str, str], int, str]
:type params: Optional[Dict[str, str]] | jira/resources.py | def find(self,
id,
params=None,
):
"""Finds a resource based on the input parameters.
:type id: Union[Tuple[str, str], int, str]
:type params: Optional[Dict[str, str]]
"""
if params is None:
params = {}
if isinstance(... | def find(self,
id,
params=None,
):
"""Finds a resource based on the input parameters.
:type id: Union[Tuple[str, str], int, str]
:type params: Optional[Dict[str, str]]
"""
if params is None:
params = {}
if isinstance(... | [
"Finds",
"a",
"resource",
"based",
"on",
"the",
"input",
"parameters",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L218-L237 | [
"def",
"find",
"(",
"self",
",",
"id",
",",
"params",
"=",
"None",
",",
")",
":",
"if",
"params",
"is",
"None",
":",
"params",
"=",
"{",
"}",
"if",
"isinstance",
"(",
"id",
",",
"tuple",
")",
":",
"path",
"=",
"self",
".",
"_resource",
".",
"fo... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Resource._get_url | Gets the url for the specified path.
:type path: str
:rtype: str | jira/resources.py | def _get_url(self, path):
""" Gets the url for the specified path.
:type path: str
:rtype: str
"""
options = self._options.copy()
options.update({'path': path})
return self._base_url.format(**options) | def _get_url(self, path):
""" Gets the url for the specified path.
:type path: str
:rtype: str
"""
options = self._options.copy()
options.update({'path': path})
return self._base_url.format(**options) | [
"Gets",
"the",
"url",
"for",
"the",
"specified",
"path",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L239-L249 | [
"def",
"_get_url",
"(",
"self",
",",
"path",
")",
":",
"options",
"=",
"self",
".",
"_options",
".",
"copy",
"(",
")",
"options",
".",
"update",
"(",
"{",
"'path'",
":",
"path",
"}",
")",
"return",
"self",
".",
"_base_url",
".",
"format",
"(",
"*",... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Resource.update | Update this resource on the server.
Keyword arguments are marshalled into a dict before being sent. If this
resource doesn't support ``PUT``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this method
will only raise errors in case of user error.
:param fields: Field... | jira/resources.py | def update(self, fields=None, async_=None, jira=None, notify=True, **kwargs):
"""Update this resource on the server.
Keyword arguments are marshalled into a dict before being sent. If this
resource doesn't support ``PUT``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this m... | def update(self, fields=None, async_=None, jira=None, notify=True, **kwargs):
"""Update this resource on the server.
Keyword arguments are marshalled into a dict before being sent. If this
resource doesn't support ``PUT``, a :py:exc:`.JIRAError` will be raised; subclasses that specialize this m... | [
"Update",
"this",
"resource",
"on",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L251-L347 | [
"def",
"update",
"(",
"self",
",",
"fields",
"=",
"None",
",",
"async_",
"=",
"None",
",",
"jira",
"=",
"None",
",",
"notify",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"async_",
"is",
"None",
":",
"async_",
"=",
"self",
".",
"_option... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Resource.delete | Delete this resource from the server, passing the specified query parameters.
If this resource doesn't support ``DELETE``, a :py:exc:`.JIRAError`
will be raised; subclasses that specialize this method will only raise errors
in case of user error.
:param params: Parameters for the delet... | jira/resources.py | def delete(self, params=None):
"""Delete this resource from the server, passing the specified query parameters.
If this resource doesn't support ``DELETE``, a :py:exc:`.JIRAError`
will be raised; subclasses that specialize this method will only raise errors
in case of user error.
... | def delete(self, params=None):
"""Delete this resource from the server, passing the specified query parameters.
If this resource doesn't support ``DELETE``, a :py:exc:`.JIRAError`
will be raised; subclasses that specialize this method will only raise errors
in case of user error.
... | [
"Delete",
"this",
"resource",
"from",
"the",
"server",
"passing",
"the",
"specified",
"query",
"parameters",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L349-L367 | [
"def",
"delete",
"(",
"self",
",",
"params",
"=",
"None",
")",
":",
"if",
"self",
".",
"_options",
"[",
"'async'",
"]",
":",
"if",
"not",
"hasattr",
"(",
"self",
".",
"_session",
",",
"'_async_jobs'",
")",
":",
"self",
".",
"_session",
".",
"_async_j... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Resource._load | Load a resource.
:type url: str
:type headers: CaseInsensitiveDict
:type params: Optional[Dict[str,str]]
:type path: Optional[str] | jira/resources.py | def _load(self,
url,
headers=CaseInsensitiveDict(),
params=None,
path=None,
):
""" Load a resource.
:type url: str
:type headers: CaseInsensitiveDict
:type params: Optional[Dict[str,str]]
:type path: Optional[... | def _load(self,
url,
headers=CaseInsensitiveDict(),
params=None,
path=None,
):
""" Load a resource.
:type url: str
:type headers: CaseInsensitiveDict
:type params: Optional[Dict[str,str]]
:type path: Optional[... | [
"Load",
"a",
"resource",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L369-L391 | [
"def",
"_load",
"(",
"self",
",",
"url",
",",
"headers",
"=",
"CaseInsensitiveDict",
"(",
")",
",",
"params",
"=",
"None",
",",
"path",
"=",
"None",
",",
")",
":",
"r",
"=",
"self",
".",
"_session",
".",
"get",
"(",
"url",
",",
"headers",
"=",
"h... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Resource._parse_raw | Parse a raw dictionary to create a resource.
:type raw: Dict[str, Any] | jira/resources.py | def _parse_raw(self, raw):
"""Parse a raw dictionary to create a resource.
:type raw: Dict[str, Any]
"""
self.raw = raw
if not raw:
raise NotImplementedError("We cannot instantiate empty resources: %s" % raw)
dict2resource(raw, self, self._options, self._sess... | def _parse_raw(self, raw):
"""Parse a raw dictionary to create a resource.
:type raw: Dict[str, Any]
"""
self.raw = raw
if not raw:
raise NotImplementedError("We cannot instantiate empty resources: %s" % raw)
dict2resource(raw, self, self._options, self._sess... | [
"Parse",
"a",
"raw",
"dictionary",
"to",
"create",
"a",
"resource",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L393-L401 | [
"def",
"_parse_raw",
"(",
"self",
",",
"raw",
")",
":",
"self",
".",
"raw",
"=",
"raw",
"if",
"not",
"raw",
":",
"raise",
"NotImplementedError",
"(",
"\"We cannot instantiate empty resources: %s\"",
"%",
"raw",
")",
"dict2resource",
"(",
"raw",
",",
"self",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Attachment.get | Return the file content as a string. | jira/resources.py | def get(self):
"""Return the file content as a string."""
r = self._session.get(self.content, headers={'Accept': '*/*'})
return r.content | def get(self):
"""Return the file content as a string."""
r = self._session.get(self.content, headers={'Accept': '*/*'})
return r.content | [
"Return",
"the",
"file",
"content",
"as",
"a",
"string",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L417-L420 | [
"def",
"get",
"(",
"self",
")",
":",
"r",
"=",
"self",
".",
"_session",
".",
"get",
"(",
"self",
".",
"content",
",",
"headers",
"=",
"{",
"'Accept'",
":",
"'*/*'",
"}",
")",
"return",
"r",
".",
"content"
] | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Attachment.iter_content | Return the file content as an iterable stream. | jira/resources.py | def iter_content(self, chunk_size=1024):
"""Return the file content as an iterable stream."""
r = self._session.get(self.content, stream=True)
return r.iter_content(chunk_size) | def iter_content(self, chunk_size=1024):
"""Return the file content as an iterable stream."""
r = self._session.get(self.content, stream=True)
return r.iter_content(chunk_size) | [
"Return",
"the",
"file",
"content",
"as",
"an",
"iterable",
"stream",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L422-L425 | [
"def",
"iter_content",
"(",
"self",
",",
"chunk_size",
"=",
"1024",
")",
":",
"r",
"=",
"self",
".",
"_session",
".",
"get",
"(",
"self",
".",
"content",
",",
"stream",
"=",
"True",
")",
"return",
"r",
".",
"iter_content",
"(",
"chunk_size",
")"
] | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Component.delete | Delete this component from the server.
:param moveIssuesTo: the name of the component to which to move any issues this component is applied | jira/resources.py | def delete(self, moveIssuesTo=None):
"""Delete this component from the server.
:param moveIssuesTo: the name of the component to which to move any issues this component is applied
"""
params = {}
if moveIssuesTo is not None:
params['moveIssuesTo'] = moveIssuesTo
... | def delete(self, moveIssuesTo=None):
"""Delete this component from the server.
:param moveIssuesTo: the name of the component to which to move any issues this component is applied
"""
params = {}
if moveIssuesTo is not None:
params['moveIssuesTo'] = moveIssuesTo
... | [
"Delete",
"this",
"component",
"from",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L436-L445 | [
"def",
"delete",
"(",
"self",
",",
"moveIssuesTo",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"moveIssuesTo",
"is",
"not",
"None",
":",
"params",
"[",
"'moveIssuesTo'",
"]",
"=",
"moveIssuesTo",
"super",
"(",
"Component",
",",
"self",
")",
"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Issue.update | Update this issue on the server.
Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value
is treated as the intended value for that field -- if the fields argument is used, all other keyword arguments
will be ignored.
JIRA projects may ... | jira/resources.py | def update(self, fields=None, update=None, async_=None, jira=None, notify=True, **fieldargs):
"""Update this issue on the server.
Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value
is treated as the intended value for that field -- if the ... | def update(self, fields=None, update=None, async_=None, jira=None, notify=True, **fieldargs):
"""Update this issue on the server.
Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value
is treated as the intended value for that field -- if the ... | [
"Update",
"this",
"issue",
"on",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L506-L559 | [
"def",
"update",
"(",
"self",
",",
"fields",
"=",
"None",
",",
"update",
"=",
"None",
",",
"async_",
"=",
"None",
",",
"jira",
"=",
"None",
",",
"notify",
"=",
"True",
",",
"*",
"*",
"fieldargs",
")",
":",
"data",
"=",
"{",
"}",
"if",
"fields",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Issue.add_field_value | Add a value to a field that supports multiple values, without resetting the existing values.
This should work with: labels, multiple checkbox lists, multiple select
:param field: The field name
:param value: The field's value
:type field: str | jira/resources.py | def add_field_value(self, field, value):
"""Add a value to a field that supports multiple values, without resetting the existing values.
This should work with: labels, multiple checkbox lists, multiple select
:param field: The field name
:param value: The field's value
:type f... | def add_field_value(self, field, value):
"""Add a value to a field that supports multiple values, without resetting the existing values.
This should work with: labels, multiple checkbox lists, multiple select
:param field: The field name
:param value: The field's value
:type f... | [
"Add",
"a",
"value",
"to",
"a",
"field",
"that",
"supports",
"multiple",
"values",
"without",
"resetting",
"the",
"existing",
"values",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L561-L571 | [
"def",
"add_field_value",
"(",
"self",
",",
"field",
",",
"value",
")",
":",
"super",
"(",
"Issue",
",",
"self",
")",
".",
"update",
"(",
"fields",
"=",
"{",
"\"update\"",
":",
"{",
"field",
":",
"[",
"{",
"\"add\"",
":",
"value",
"}",
"]",
"}",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Issue.delete | Delete this issue from the server.
:param deleteSubtasks: if the issue has subtasks, this argument must be set to true for the call to succeed.
:type deleteSubtasks: bool | jira/resources.py | def delete(self, deleteSubtasks=False):
"""Delete this issue from the server.
:param deleteSubtasks: if the issue has subtasks, this argument must be set to true for the call to succeed.
:type deleteSubtasks: bool
"""
super(Issue, self).delete(params={'deleteSubtasks': deleteSu... | def delete(self, deleteSubtasks=False):
"""Delete this issue from the server.
:param deleteSubtasks: if the issue has subtasks, this argument must be set to true for the call to succeed.
:type deleteSubtasks: bool
"""
super(Issue, self).delete(params={'deleteSubtasks': deleteSu... | [
"Delete",
"this",
"issue",
"from",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L573-L580 | [
"def",
"delete",
"(",
"self",
",",
"deleteSubtasks",
"=",
"False",
")",
":",
"super",
"(",
"Issue",
",",
"self",
")",
".",
"delete",
"(",
"params",
"=",
"{",
"'deleteSubtasks'",
":",
"deleteSubtasks",
"}",
")"
] | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | RemoteLink.update | Update a RemoteLink. 'object' is required.
For definitions of the allowable fields for 'object' and the keyword arguments 'globalId', 'application' and
'relationship', see https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+for+Remote+Issue+Links.
:param object: the link details to a... | jira/resources.py | def update(self, object, globalId=None, application=None, relationship=None):
"""Update a RemoteLink. 'object' is required.
For definitions of the allowable fields for 'object' and the keyword arguments 'globalId', 'application' and
'relationship', see https://developer.atlassian.com/display/JI... | def update(self, object, globalId=None, application=None, relationship=None):
"""Update a RemoteLink. 'object' is required.
For definitions of the allowable fields for 'object' and the keyword arguments 'globalId', 'application' and
'relationship', see https://developer.atlassian.com/display/JI... | [
"Update",
"a",
"RemoteLink",
".",
"object",
"is",
"required",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L621-L641 | [
"def",
"update",
"(",
"self",
",",
"object",
",",
"globalId",
"=",
"None",
",",
"application",
"=",
"None",
",",
"relationship",
"=",
"None",
")",
":",
"data",
"=",
"{",
"'object'",
":",
"object",
"}",
"if",
"globalId",
"is",
"not",
"None",
":",
"dat... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Worklog.delete | Delete this worklog entry from its associated issue.
:param adjustEstimate: one of ``new``, ``leave``, ``manual`` or ``auto``.
``auto`` is the default and adjusts the estimate automatically.
``leave`` leaves the estimate unchanged by this deletion.
:param newEstimate: combined w... | jira/resources.py | def delete(self, adjustEstimate=None, newEstimate=None, increaseBy=None):
"""Delete this worklog entry from its associated issue.
:param adjustEstimate: one of ``new``, ``leave``, ``manual`` or ``auto``.
``auto`` is the default and adjusts the estimate automatically.
``leave`` l... | def delete(self, adjustEstimate=None, newEstimate=None, increaseBy=None):
"""Delete this worklog entry from its associated issue.
:param adjustEstimate: one of ``new``, ``leave``, ``manual`` or ``auto``.
``auto`` is the default and adjusts the estimate automatically.
``leave`` l... | [
"Delete",
"this",
"worklog",
"entry",
"from",
"its",
"associated",
"issue",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L682-L699 | [
"def",
"delete",
"(",
"self",
",",
"adjustEstimate",
"=",
"None",
",",
"newEstimate",
"=",
"None",
",",
"increaseBy",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"adjustEstimate",
"is",
"not",
"None",
":",
"params",
"[",
"'adjustEstimate'",
"]"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Role.update | Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified.
:param users: a user or users to add to the role
:type users: string, list or tuple
:param groups: a group or groups to add to the role
:type groups: string, list or tuple | jira/resources.py | def update(self, users=None, groups=None):
"""Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified.
:param users: a user or users to add to the role
:type users: string, list or tuple
:param groups: a group or groups to add to the role... | def update(self, users=None, groups=None):
"""Add the specified users or groups to this project role. One of ``users`` or ``groups`` must be specified.
:param users: a user or users to add to the role
:type users: string, list or tuple
:param groups: a group or groups to add to the role... | [
"Add",
"the",
"specified",
"users",
"or",
"groups",
"to",
"this",
"project",
"role",
".",
"One",
"of",
"users",
"or",
"groups",
"must",
"be",
"specified",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L755-L775 | [
"def",
"update",
"(",
"self",
",",
"users",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"if",
"users",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"users",
",",
"string_types",
")",
":",
"users",
"=",
"(",
"users",
",",
")",
"if",
"groups... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Role.add_user | Add the specified users or groups to this project role.
One of ``users`` or ``groups`` must be specified.
:param users: a user or users to add to the role
:type users: string, list or tuple
:param groups: a group or groups to add to the role
:type groups: string, list or tuple | jira/resources.py | def add_user(self, users=None, groups=None):
"""Add the specified users or groups to this project role.
One of ``users`` or ``groups`` must be specified.
:param users: a user or users to add to the role
:type users: string, list or tuple
:param groups: a group or groups to add ... | def add_user(self, users=None, groups=None):
"""Add the specified users or groups to this project role.
One of ``users`` or ``groups`` must be specified.
:param users: a user or users to add to the role
:type users: string, list or tuple
:param groups: a group or groups to add ... | [
"Add",
"the",
"specified",
"users",
"or",
"groups",
"to",
"this",
"project",
"role",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L777-L795 | [
"def",
"add_user",
"(",
"self",
",",
"users",
"=",
"None",
",",
"groups",
"=",
"None",
")",
":",
"if",
"users",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"users",
",",
"string_types",
")",
":",
"users",
"=",
"(",
"users",
",",
")",
"if",
"grou... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Version.delete | Delete this project version from the server.
If neither of the arguments are specified, the version is
removed from all issues it is attached to.
:param moveFixIssuesTo: in issues for which this version is a fix
version, add this argument version to the fix version list
... | jira/resources.py | def delete(self, moveFixIssuesTo=None, moveAffectedIssuesTo=None):
"""Delete this project version from the server.
If neither of the arguments are specified, the version is
removed from all issues it is attached to.
:param moveFixIssuesTo: in issues for which this version is a fix
... | def delete(self, moveFixIssuesTo=None, moveAffectedIssuesTo=None):
"""Delete this project version from the server.
If neither of the arguments are specified, the version is
removed from all issues it is attached to.
:param moveFixIssuesTo: in issues for which this version is a fix
... | [
"Delete",
"this",
"project",
"version",
"from",
"the",
"server",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L876-L894 | [
"def",
"delete",
"(",
"self",
",",
"moveFixIssuesTo",
"=",
"None",
",",
"moveAffectedIssuesTo",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"moveFixIssuesTo",
"is",
"not",
"None",
":",
"params",
"[",
"'moveFixIssuesTo'",
"]",
"=",
"moveFixIssuesTo"... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | Version.update | Update this project version from the server. It is prior used to archive versions. | jira/resources.py | def update(self, **args):
"""Update this project version from the server. It is prior used to archive versions."""
data = {}
for field in args:
data[field] = args[field]
super(Version, self).update(**data) | def update(self, **args):
"""Update this project version from the server. It is prior used to archive versions."""
data = {}
for field in args:
data[field] = args[field]
super(Version, self).update(**data) | [
"Update",
"this",
"project",
"version",
"from",
"the",
"server",
".",
"It",
"is",
"prior",
"used",
"to",
"archive",
"versions",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/resources.py#L896-L902 | [
"def",
"update",
"(",
"self",
",",
"*",
"*",
"args",
")",
":",
"data",
"=",
"{",
"}",
"for",
"field",
"in",
"args",
":",
"data",
"[",
"field",
"]",
"=",
"args",
"[",
"field",
"]",
"super",
"(",
"Version",
",",
"self",
")",
".",
"update",
"(",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | get_jira | Return a JIRA object by loading the connection details from the `config.ini` file.
:param profile: The name of the section from config.ini file that stores server config url/username/password
:param url: URL of the Jira server
:param username: username to use for authentication
:param password: passwor... | jira/config.py | def get_jira(profile=None, url="http://localhost:2990", username="admin", password="admin", appid=None, autofix=False, verify=True):
"""Return a JIRA object by loading the connection details from the `config.ini` file.
:param profile: The name of the section from config.ini file that stores server config url/u... | def get_jira(profile=None, url="http://localhost:2990", username="admin", password="admin", appid=None, autofix=False, verify=True):
"""Return a JIRA object by loading the connection details from the `config.ini` file.
:param profile: The name of the section from config.ini file that stores server config url/u... | [
"Return",
"a",
"JIRA",
"object",
"by",
"loading",
"the",
"connection",
"details",
"from",
"the",
"config",
".",
"ini",
"file",
"."
] | pycontribs/jira | python | https://github.com/pycontribs/jira/blob/397db5d78441ed6a680a9b7db4c62030ade1fd8a/jira/config.py#L20-L97 | [
"def",
"get_jira",
"(",
"profile",
"=",
"None",
",",
"url",
"=",
"\"http://localhost:2990\"",
",",
"username",
"=",
"\"admin\"",
",",
"password",
"=",
"\"admin\"",
",",
"appid",
"=",
"None",
",",
"autofix",
"=",
"False",
",",
"verify",
"=",
"True",
")",
... | 397db5d78441ed6a680a9b7db4c62030ade1fd8a |
train | make_view | 为一个 BaseRoBot 生成 Flask view。
Usage ::
from werobot import WeRoBot
robot = WeRoBot(token='token')
@robot.handler
def hello(message):
return 'Hello World!'
from flask import Flask
from werobot.contrib.flask import make_view
app = Flask(__name_... | werobot/contrib/flask.py | def make_view(robot):
"""
为一个 BaseRoBot 生成 Flask view。
Usage ::
from werobot import WeRoBot
robot = WeRoBot(token='token')
@robot.handler
def hello(message):
return 'Hello World!'
from flask import Flask
from werobot.contrib.flask import make... | def make_view(robot):
"""
为一个 BaseRoBot 生成 Flask view。
Usage ::
from werobot import WeRoBot
robot = WeRoBot(token='token')
@robot.handler
def hello(message):
return 'Hello World!'
from flask import Flask
from werobot.contrib.flask import make... | [
"为一个",
"BaseRoBot",
"生成",
"Flask",
"view。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/contrib/flask.py#L12-L63 | [
"def",
"make_view",
"(",
"robot",
")",
":",
"def",
"werobot_view",
"(",
")",
":",
"timestamp",
"=",
"request",
".",
"args",
".",
"get",
"(",
"'timestamp'",
",",
"''",
")",
"nonce",
"=",
"request",
".",
"args",
".",
"get",
"(",
"'nonce'",
",",
"''",
... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Config.from_pyfile | 在一个 Python 文件中读取配置。
:param filename: 配置文件的文件名
:return: 如果读取成功,返回 ``True``,如果失败,会抛出错误异常 | werobot/config.py | def from_pyfile(self, filename):
"""
在一个 Python 文件中读取配置。
:param filename: 配置文件的文件名
:return: 如果读取成功,返回 ``True``,如果失败,会抛出错误异常
"""
d = types.ModuleType('config')
d.__file__ = filename
with open(filename) as config_file:
exec(compile(config_file.r... | def from_pyfile(self, filename):
"""
在一个 Python 文件中读取配置。
:param filename: 配置文件的文件名
:return: 如果读取成功,返回 ``True``,如果失败,会抛出错误异常
"""
d = types.ModuleType('config')
d.__file__ = filename
with open(filename) as config_file:
exec(compile(config_file.r... | [
"在一个",
"Python",
"文件中读取配置。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/config.py#L25-L37 | [
"def",
"from_pyfile",
"(",
"self",
",",
"filename",
")",
":",
"d",
"=",
"types",
".",
"ModuleType",
"(",
"'config'",
")",
"d",
".",
"__file__",
"=",
"filename",
"with",
"open",
"(",
"filename",
")",
"as",
"config_file",
":",
"exec",
"(",
"compile",
"("... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | make_handler | 为一个 BaseRoBot 生成 Tornado Handler。
Usage ::
import tornado.ioloop
import tornado.web
from werobot import WeRoBot
from tornado_werobot import make_handler
robot = WeRoBot(token='token')
@robot.handler
def hello(message):
return 'Hello World!'
... | werobot/contrib/tornado.py | def make_handler(robot):
"""
为一个 BaseRoBot 生成 Tornado Handler。
Usage ::
import tornado.ioloop
import tornado.web
from werobot import WeRoBot
from tornado_werobot import make_handler
robot = WeRoBot(token='token')
@robot.handler
def hello(message):... | def make_handler(robot):
"""
为一个 BaseRoBot 生成 Tornado Handler。
Usage ::
import tornado.ioloop
import tornado.web
from werobot import WeRoBot
from tornado_werobot import make_handler
robot = WeRoBot(token='token')
@robot.handler
def hello(message):... | [
"为一个",
"BaseRoBot",
"生成",
"Tornado",
"Handler。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/contrib/tornado.py#L11-L74 | [
"def",
"make_handler",
"(",
"robot",
")",
":",
"class",
"WeRoBotHandler",
"(",
"RequestHandler",
")",
":",
"def",
"prepare",
"(",
"self",
")",
":",
"timestamp",
"=",
"self",
".",
"get_argument",
"(",
"'timestamp'",
",",
"''",
")",
"nonce",
"=",
"self",
"... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | MongoDBStorage.get | 根据 id 获取数据。
:param id: 要获取的数据的 id
:return: 返回取到的数据,如果是空则返回一个空的 ``dict`` 对象 | werobot/session/mongodbstorage.py | def get(self, id):
"""
根据 id 获取数据。
:param id: 要获取的数据的 id
:return: 返回取到的数据,如果是空则返回一个空的 ``dict`` 对象
"""
document = self._get_document(id)
if document:
session_json = document["session"]
return json_loads(session_json)
return {} | def get(self, id):
"""
根据 id 获取数据。
:param id: 要获取的数据的 id
:return: 返回取到的数据,如果是空则返回一个空的 ``dict`` 对象
"""
document = self._get_document(id)
if document:
session_json = document["session"]
return json_loads(session_json)
return {} | [
"根据",
"id",
"获取数据。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/session/mongodbstorage.py#L33-L44 | [
"def",
"get",
"(",
"self",
",",
"id",
")",
":",
"document",
"=",
"self",
".",
"_get_document",
"(",
"id",
")",
"if",
"document",
":",
"session_json",
"=",
"document",
"[",
"\"session\"",
"]",
"return",
"json_loads",
"(",
"session_json",
")",
"return",
"{... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | MongoDBStorage.set | 根据 id 写入数据。
:param id: 要写入的 id
:param value: 要写入的数据,可以是一个 ``dict`` 对象 | werobot/session/mongodbstorage.py | def set(self, id, value):
"""
根据 id 写入数据。
:param id: 要写入的 id
:param value: 要写入的数据,可以是一个 ``dict`` 对象
"""
session = json_dumps(value)
self.collection.replace_one(
{
"wechat_id": id
}, {
"wechat_id": id... | def set(self, id, value):
"""
根据 id 写入数据。
:param id: 要写入的 id
:param value: 要写入的数据,可以是一个 ``dict`` 对象
"""
session = json_dumps(value)
self.collection.replace_one(
{
"wechat_id": id
}, {
"wechat_id": id... | [
"根据",
"id",
"写入数据。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/session/mongodbstorage.py#L46-L62 | [
"def",
"set",
"(",
"self",
",",
"id",
",",
"value",
")",
":",
"session",
"=",
"json_dumps",
"(",
"value",
")",
"self",
".",
"collection",
".",
"replace_one",
"(",
"{",
"\"wechat_id\"",
":",
"id",
"}",
",",
"{",
"\"wechat_id\"",
":",
"id",
",",
"\"ses... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.grant_token | 获取 Access Token。
:return: 返回的 JSON 数据包 | werobot/client.py | def grant_token(self):
"""
获取 Access Token。
:return: 返回的 JSON 数据包
"""
return self.get(
url="https://api.weixin.qq.com/cgi-bin/token",
params={
"grant_type": "client_credential",
"appid": self.appid,
"secret"... | def grant_token(self):
"""
获取 Access Token。
:return: 返回的 JSON 数据包
"""
return self.get(
url="https://api.weixin.qq.com/cgi-bin/token",
params={
"grant_type": "client_credential",
"appid": self.appid,
"secret"... | [
"获取",
"Access",
"Token。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L82-L95 | [
"def",
"grant_token",
"(",
"self",
")",
":",
"return",
"self",
".",
"get",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/token\"",
",",
"params",
"=",
"{",
"\"grant_type\"",
":",
"\"client_credential\"",
",",
"\"appid\"",
":",
"self",
".",
"appid",
",",
... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.get_access_token | 判断现有的token是否过期。
用户需要多进程或者多机部署可以手动重写这个函数
来自定义token的存储,刷新策略。
:return: 返回token | werobot/client.py | def get_access_token(self):
"""
判断现有的token是否过期。
用户需要多进程或者多机部署可以手动重写这个函数
来自定义token的存储,刷新策略。
:return: 返回token
"""
if self._token:
now = time.time()
if self.token_expires_at - now > 60:
return self._token
json = self.g... | def get_access_token(self):
"""
判断现有的token是否过期。
用户需要多进程或者多机部署可以手动重写这个函数
来自定义token的存储,刷新策略。
:return: 返回token
"""
if self._token:
now = time.time()
if self.token_expires_at - now > 60:
return self._token
json = self.g... | [
"判断现有的token是否过期。",
"用户需要多进程或者多机部署可以手动重写这个函数",
"来自定义token的存储,刷新策略。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L97-L112 | [
"def",
"get_access_token",
"(",
"self",
")",
":",
"if",
"self",
".",
"_token",
":",
"now",
"=",
"time",
".",
"time",
"(",
")",
"if",
"self",
".",
"token_expires_at",
"-",
"now",
">",
"60",
":",
"return",
"self",
".",
"_token",
"json",
"=",
"self",
... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.create_custom_menu | 创建个性化菜单::
button = [
{
"type":"click",
"name":"今日歌曲",
"key":"V1001_TODAY_MUSIC"
},
{
"name":"菜单",
"sub_button":[
{
... | werobot/client.py | def create_custom_menu(self, menu_data, matchrule):
"""
创建个性化菜单::
button = [
{
"type":"click",
"name":"今日歌曲",
"key":"V1001_TODAY_MUSIC"
},
{
"name":"菜单",
... | def create_custom_menu(self, menu_data, matchrule):
"""
创建个性化菜单::
button = [
{
"type":"click",
"name":"今日歌曲",
"key":"V1001_TODAY_MUSIC"
},
{
"name":"菜单",
... | [
"创建个性化菜单",
"::"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L188-L238 | [
"def",
"create_custom_menu",
"(",
"self",
",",
"menu_data",
",",
"matchrule",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/menu/addconditional\"",
",",
"data",
"=",
"{",
"\"button\"",
":",
"menu_data",
",",
"\"matc... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.add_custom_service_account | 添加客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包 | werobot/client.py | def add_custom_service_account(self, account, nickname, password):
"""
添加客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/customservice/... | def add_custom_service_account(self, account, nickname, password):
"""
添加客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/customservice/... | [
"添加客服帐号。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L274-L290 | [
"def",
"add_custom_service_account",
"(",
"self",
",",
"account",
",",
"nickname",
",",
"password",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/customservice/kfaccount/add\"",
",",
"data",
"=",
"{",
"\"kf_account\"",
":",
... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.update_custom_service_account | 修改客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包 | werobot/client.py | def update_custom_service_account(self, account, nickname, password):
"""
修改客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/customservi... | def update_custom_service_account(self, account, nickname, password):
"""
修改客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/customservi... | [
"修改客服帐号。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L292-L308 | [
"def",
"update_custom_service_account",
"(",
"self",
",",
"account",
",",
"nickname",
",",
"password",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/customservice/kfaccount/update\"",
",",
"data",
"=",
"{",
"\"kf_account\"",
... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.delete_custom_service_account | 删除客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包 | werobot/client.py | def delete_custom_service_account(self, account, nickname, password):
"""
删除客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/customservi... | def delete_custom_service_account(self, account, nickname, password):
"""
删除客服帐号。
:param account: 客服账号的用户名
:param nickname: 客服账号的昵称
:param password: 客服账号的密码
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/customservi... | [
"删除客服帐号。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L310-L326 | [
"def",
"delete_custom_service_account",
"(",
"self",
",",
"account",
",",
"nickname",
",",
"password",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/customservice/kfaccount/del\"",
",",
"data",
"=",
"{",
"\"kf_account\"",
":"... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.upload_custom_service_account_avatar | 设置客服帐号的头像。
:param account: 客服账号的用户名
:param avatar: 头像文件,必须是 jpg 格式
:return: 返回的 JSON 数据包 | werobot/client.py | def upload_custom_service_account_avatar(self, account, avatar):
"""
设置客服帐号的头像。
:param account: 客服账号的用户名
:param avatar: 头像文件,必须是 jpg 格式
:return: 返回的 JSON 数据包
"""
return self.post(
url=
"http://api.weixin.qq.com/customservice/kfaccount/uplo... | def upload_custom_service_account_avatar(self, account, avatar):
"""
设置客服帐号的头像。
:param account: 客服账号的用户名
:param avatar: 头像文件,必须是 jpg 格式
:return: 返回的 JSON 数据包
"""
return self.post(
url=
"http://api.weixin.qq.com/customservice/kfaccount/uplo... | [
"设置客服帐号的头像。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L328-L344 | [
"def",
"upload_custom_service_account_avatar",
"(",
"self",
",",
"account",
",",
"avatar",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"http://api.weixin.qq.com/customservice/kfaccount/uploadheadimg\"",
",",
"params",
"=",
"{",
"\"access_token\"",
":",
... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.download_media | 下载临时多媒体文件。
:param media_id: 媒体文件 ID
:return: requests 的 Response 实例 | werobot/client.py | def download_media(self, media_id):
"""
下载临时多媒体文件。
:param media_id: 媒体文件 ID
:return: requests 的 Response 实例
"""
return requests.get(
url="https://api.weixin.qq.com/cgi-bin/media/get",
params={
"access_token": self.token,
... | def download_media(self, media_id):
"""
下载临时多媒体文件。
:param media_id: 媒体文件 ID
:return: requests 的 Response 实例
"""
return requests.get(
url="https://api.weixin.qq.com/cgi-bin/media/get",
params={
"access_token": self.token,
... | [
"下载临时多媒体文件。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L383-L396 | [
"def",
"download_media",
"(",
"self",
",",
"media_id",
")",
":",
"return",
"requests",
".",
"get",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/media/get\"",
",",
"params",
"=",
"{",
"\"access_token\"",
":",
"self",
".",
"token",
",",
"\"media_id\"",
":... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.upload_news_picture | 上传图文消息内的图片。
:param file: 要上传的文件,一个 File-object
:return: 返回的 JSON 数据包 | werobot/client.py | def upload_news_picture(self, file):
"""
上传图文消息内的图片。
:param file: 要上传的文件,一个 File-object
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/media/uploadimg",
params={"access_token": self.token},
files={"m... | def upload_news_picture(self, file):
"""
上传图文消息内的图片。
:param file: 要上传的文件,一个 File-object
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/media/uploadimg",
params={"access_token": self.token},
files={"m... | [
"上传图文消息内的图片。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L423-L434 | [
"def",
"upload_news_picture",
"(",
"self",
",",
"file",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/media/uploadimg\"",
",",
"params",
"=",
"{",
"\"access_token\"",
":",
"self",
".",
"token",
"}",
",",
"files",
... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.upload_permanent_media | 上传其他类型永久素材。
:param media_type: 媒体文件类型,分别有图片(image)、语音(voice)和缩略图(thumb)
:param media_file: 要上传的文件,一个 File-object
:return: 返回的 JSON 数据包 | werobot/client.py | def upload_permanent_media(self, media_type, media_file):
"""
上传其他类型永久素材。
:param media_type: 媒体文件类型,分别有图片(image)、语音(voice)和缩略图(thumb)
:param media_file: 要上传的文件,一个 File-object
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/c... | def upload_permanent_media(self, media_type, media_file):
"""
上传其他类型永久素材。
:param media_type: 媒体文件类型,分别有图片(image)、语音(voice)和缩略图(thumb)
:param media_file: 要上传的文件,一个 File-object
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/c... | [
"上传其他类型永久素材。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L436-L451 | [
"def",
"upload_permanent_media",
"(",
"self",
",",
"media_type",
",",
"media_file",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/material/add_material\"",
",",
"params",
"=",
"{",
"\"access_token\"",
":",
"self",
"."... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.upload_permanent_video | 上传永久视频。
:param title: 视频素材的标题
:param introduction: 视频素材的描述
:param video: 要上传的视频,一个 File-object
:return: requests 的 Response 实例 | werobot/client.py | def upload_permanent_video(self, title, introduction, video):
"""
上传永久视频。
:param title: 视频素材的标题
:param introduction: 视频素材的描述
:param video: 要上传的视频,一个 File-object
:return: requests 的 Response 实例
"""
return requests.post(
url="https://api.weixin.... | def upload_permanent_video(self, title, introduction, video):
"""
上传永久视频。
:param title: 视频素材的标题
:param introduction: 视频素材的描述
:param video: 要上传的视频,一个 File-object
:return: requests 的 Response 实例
"""
return requests.post(
url="https://api.weixin.... | [
"上传永久视频。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L453-L478 | [
"def",
"upload_permanent_video",
"(",
"self",
",",
"title",
",",
"introduction",
",",
"video",
")",
":",
"return",
"requests",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/material/add_material\"",
",",
"params",
"=",
"{",
"\"access_token\"",
"... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.download_permanent_media | 获取永久素材。
:param media_id: 媒体文件 ID
:return: requests 的 Response 实例 | werobot/client.py | def download_permanent_media(self, media_id):
"""
获取永久素材。
:param media_id: 媒体文件 ID
:return: requests 的 Response 实例
"""
return requests.post(
url="https://api.weixin.qq.com/cgi-bin/material/get_material",
params={"access_token": self.token},
... | def download_permanent_media(self, media_id):
"""
获取永久素材。
:param media_id: 媒体文件 ID
:return: requests 的 Response 实例
"""
return requests.post(
url="https://api.weixin.qq.com/cgi-bin/material/get_material",
params={"access_token": self.token},
... | [
"获取永久素材。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L480-L493 | [
"def",
"download_permanent_media",
"(",
"self",
",",
"media_id",
")",
":",
"return",
"requests",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/material/get_material\"",
",",
"params",
"=",
"{",
"\"access_token\"",
":",
"self",
".",
"token",
"}",... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.get_media_list | 获取素材列表。
:param media_type: 素材的类型,图片(image)、视频(video)、语音 (voice)、图文(news)
:param offset: 从全部素材的该偏移位置开始返回,0表示从第一个素材返回
:param count: 返回素材的数量,取值在1到20之间
:return: 返回的 JSON 数据包 | werobot/client.py | def get_media_list(self, media_type, offset, count):
"""
获取素材列表。
:param media_type: 素材的类型,图片(image)、视频(video)、语音 (voice)、图文(news)
:param offset: 从全部素材的该偏移位置开始返回,0表示从第一个素材返回
:param count: 返回素材的数量,取值在1到20之间
:return: 返回的 JSON 数据包
"""
return self.post(
... | def get_media_list(self, media_type, offset, count):
"""
获取素材列表。
:param media_type: 素材的类型,图片(image)、视频(video)、语音 (voice)、图文(news)
:param offset: 从全部素材的该偏移位置开始返回,0表示从第一个素材返回
:param count: 返回素材的数量,取值在1到20之间
:return: 返回的 JSON 数据包
"""
return self.post(
... | [
"获取素材列表。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L544-L560 | [
"def",
"get_media_list",
"(",
"self",
",",
"media_type",
",",
"offset",
",",
"count",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/material/batchget_material\"",
",",
"data",
"=",
"{",
"\"type\"",
":",
"media_type"... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.create_group | 创建分组。
:param name: 分组名字(30个字符以内)
:return: 返回的 JSON 数据包 | werobot/client.py | def create_group(self, name):
"""
创建分组。
:param name: 分组名字(30个字符以内)
:return: 返回的 JSON 数据包
"""
name = to_text(name)
return self.post(
url="https://api.weixin.qq.com/cgi-bin/groups/create",
data={"group": {
"name": name
... | def create_group(self, name):
"""
创建分组。
:param name: 分组名字(30个字符以内)
:return: 返回的 JSON 数据包
"""
name = to_text(name)
return self.post(
url="https://api.weixin.qq.com/cgi-bin/groups/create",
data={"group": {
"name": name
... | [
"创建分组。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L562-L576 | [
"def",
"create_group",
"(",
"self",
",",
"name",
")",
":",
"name",
"=",
"to_text",
"(",
"name",
")",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/groups/create\"",
",",
"data",
"=",
"{",
"\"group\"",
":",
"{",
"\"name\... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.update_group | 修改分组名。
:param group_id: 分组 ID,由微信分配
:param name: 分组名字(30个字符以内)
:return: 返回的 JSON 数据包 | werobot/client.py | def update_group(self, group_id, name):
"""
修改分组名。
:param group_id: 分组 ID,由微信分配
:param name: 分组名字(30个字符以内)
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/groups/update",
data={"group": {
... | def update_group(self, group_id, name):
"""
修改分组名。
:param group_id: 分组 ID,由微信分配
:param name: 分组名字(30个字符以内)
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/groups/update",
data={"group": {
... | [
"修改分组名。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L598-L612 | [
"def",
"update_group",
"(",
"self",
",",
"group_id",
",",
"name",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/groups/update\"",
",",
"data",
"=",
"{",
"\"group\"",
":",
"{",
"\"id\"",
":",
"int",
"(",
"group... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.move_users | 批量移动用户分组。
:param user_id_list: 用户 ID 的列表(长度不能超过50)
:param group_id: 分组 ID
:return: 返回的 JSON 数据包 | werobot/client.py | def move_users(self, user_id_list, group_id):
"""
批量移动用户分组。
:param user_id_list: 用户 ID 的列表(长度不能超过50)
:param group_id: 分组 ID
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/groups/members/batchupdate",
dat... | def move_users(self, user_id_list, group_id):
"""
批量移动用户分组。
:param user_id_list: 用户 ID 的列表(长度不能超过50)
:param group_id: 分组 ID
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/groups/members/batchupdate",
dat... | [
"批量移动用户分组。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L630-L644 | [
"def",
"move_users",
"(",
"self",
",",
"user_id_list",
",",
"group_id",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/groups/members/batchupdate\"",
",",
"data",
"=",
"{",
"\"openid_list\"",
":",
"user_id_list",
",",
... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.remark_user | 设置备注名。
:param user_id: 设置备注名的用户 ID
:param remark: 新的备注名,长度必须小于30字符
:return: 返回的 JSON 数据包 | werobot/client.py | def remark_user(self, user_id, remark):
"""
设置备注名。
:param user_id: 设置备注名的用户 ID
:param remark: 新的备注名,长度必须小于30字符
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/user/info/updateremark",
data={
... | def remark_user(self, user_id, remark):
"""
设置备注名。
:param user_id: 设置备注名的用户 ID
:param remark: 新的备注名,长度必须小于30字符
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/user/info/updateremark",
data={
... | [
"设置备注名。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L660-L674 | [
"def",
"remark_user",
"(",
"self",
",",
"user_id",
",",
"remark",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/user/info/updateremark\"",
",",
"data",
"=",
"{",
"\"openid\"",
":",
"user_id",
",",
"\"remark\"",
":... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.get_user_info | 获取用户基本信息。
:param user_id: 用户 ID 。 就是你收到的 `Message` 的 source
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包 | werobot/client.py | def get_user_info(self, user_id, lang="zh_CN"):
"""
获取用户基本信息。
:param user_id: 用户 ID 。 就是你收到的 `Message` 的 source
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包
"""
return self.get(
url="https://api.weixin.qq.com/cgi-bin/user/info... | def get_user_info(self, user_id, lang="zh_CN"):
"""
获取用户基本信息。
:param user_id: 用户 ID 。 就是你收到的 `Message` 的 source
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包
"""
return self.get(
url="https://api.weixin.qq.com/cgi-bin/user/info... | [
"获取用户基本信息。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L676-L691 | [
"def",
"get_user_info",
"(",
"self",
",",
"user_id",
",",
"lang",
"=",
"\"zh_CN\"",
")",
":",
"return",
"self",
".",
"get",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/user/info\"",
",",
"params",
"=",
"{",
"\"access_token\"",
":",
"self",
".",
"toke... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.get_users_info | 批量获取用户基本信息。
:param user_id_list: 用户 ID 的列表
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包 | werobot/client.py | def get_users_info(self, user_id_list, lang="zh_CN"):
"""
批量获取用户基本信息。
:param user_id_list: 用户 ID 的列表
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/user/info/batchget"... | def get_users_info(self, user_id_list, lang="zh_CN"):
"""
批量获取用户基本信息。
:param user_id_list: 用户 ID 的列表
:param lang: 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
:return: 返回的 JSON 数据包
"""
return self.post(
url="https://api.weixin.qq.com/cgi-bin/user/info/batchget"... | [
"批量获取用户基本信息。"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L693-L711 | [
"def",
"get_users_info",
"(",
"self",
",",
"user_id_list",
",",
"lang",
"=",
"\"zh_CN\"",
")",
":",
"return",
"self",
".",
"post",
"(",
"url",
"=",
"\"https://api.weixin.qq.com/cgi-bin/user/info/batchget\"",
",",
"data",
"=",
"{",
"\"user_list\"",
":",
"[",
"{",... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
train | Client.get_followers | 获取关注者列表
详情请参考 http://mp.weixin.qq.com/wiki/index.php?title=获取关注者列表
:param first_user_id: 可选。第一个拉取的OPENID,不填默认从头开始拉取
:return: 返回的 JSON 数据包 | werobot/client.py | def get_followers(self, first_user_id=None):
"""
获取关注者列表
详情请参考 http://mp.weixin.qq.com/wiki/index.php?title=获取关注者列表
:param first_user_id: 可选。第一个拉取的OPENID,不填默认从头开始拉取
:return: 返回的 JSON 数据包
"""
params = {"access_token": self.token}
if first_user_id:
... | def get_followers(self, first_user_id=None):
"""
获取关注者列表
详情请参考 http://mp.weixin.qq.com/wiki/index.php?title=获取关注者列表
:param first_user_id: 可选。第一个拉取的OPENID,不填默认从头开始拉取
:return: 返回的 JSON 数据包
"""
params = {"access_token": self.token}
if first_user_id:
... | [
"获取关注者列表",
"详情请参考",
"http",
":",
"//",
"mp",
".",
"weixin",
".",
"qq",
".",
"com",
"/",
"wiki",
"/",
"index",
".",
"php?title",
"=",
"获取关注者列表"
] | offu/WeRoBot | python | https://github.com/offu/WeRoBot/blob/fd42109105b03f9acf45ebd9dcabb9d5cff98f3c/werobot/client.py#L713-L726 | [
"def",
"get_followers",
"(",
"self",
",",
"first_user_id",
"=",
"None",
")",
":",
"params",
"=",
"{",
"\"access_token\"",
":",
"self",
".",
"token",
"}",
"if",
"first_user_id",
":",
"params",
"[",
"\"next_openid\"",
"]",
"=",
"first_user_id",
"return",
"self... | fd42109105b03f9acf45ebd9dcabb9d5cff98f3c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.