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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
test | GitLab.__get_award_emoji | Get award emojis for issue/merge request | perceval/backends/core/gitlab.py | def __get_award_emoji(self, item_type, item_id):
"""Get award emojis for issue/merge request"""
emojis = []
group_emojis = self.client.emojis(item_type, item_id)
for raw_emojis in group_emojis:
for emoji in json.loads(raw_emojis):
emojis.append(emoji)
... | def __get_award_emoji(self, item_type, item_id):
"""Get award emojis for issue/merge request"""
emojis = []
group_emojis = self.client.emojis(item_type, item_id)
for raw_emojis in group_emojis:
for emoji in json.loads(raw_emojis):
emojis.append(emoji)
... | [
"Get",
"award",
"emojis",
"for",
"issue",
"/",
"merge",
"request"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L311-L322 | [
"def",
"__get_award_emoji",
"(",
"self",
",",
"item_type",
",",
"item_id",
")",
":",
"emojis",
"=",
"[",
"]",
"group_emojis",
"=",
"self",
".",
"client",
".",
"emojis",
"(",
"item_type",
",",
"item_id",
")",
"for",
"raw_emojis",
"in",
"group_emojis",
":",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLab.__get_note_award_emoji | Fetch emojis for a note of an issue/merge request | perceval/backends/core/gitlab.py | def __get_note_award_emoji(self, item_type, item_id, note_id):
"""Fetch emojis for a note of an issue/merge request"""
emojis = []
group_emojis = self.client.note_emojis(item_type, item_id, note_id)
try:
for raw_emojis in group_emojis:
for emoji in json.loa... | def __get_note_award_emoji(self, item_type, item_id, note_id):
"""Fetch emojis for a note of an issue/merge request"""
emojis = []
group_emojis = self.client.note_emojis(item_type, item_id, note_id)
try:
for raw_emojis in group_emojis:
for emoji in json.loa... | [
"Fetch",
"emojis",
"for",
"a",
"note",
"of",
"an",
"issue",
"/",
"merge",
"request"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L324-L342 | [
"def",
"__get_note_award_emoji",
"(",
"self",
",",
"item_type",
",",
"item_id",
",",
"note_id",
")",
":",
"emojis",
"=",
"[",
"]",
"group_emojis",
"=",
"self",
".",
"client",
".",
"note_emojis",
"(",
"item_type",
",",
"item_id",
",",
"note_id",
")",
"try",... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.issues | Get the issues from pagination | perceval/backends/core/gitlab.py | def issues(self, from_date=None):
"""Get the issues from pagination"""
payload = {
'state': 'all',
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
if from_date:
payload['updated_after'] = from_date.isoformat()
... | def issues(self, from_date=None):
"""Get the issues from pagination"""
payload = {
'state': 'all',
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
if from_date:
payload['updated_after'] = from_date.isoformat()
... | [
"Get",
"the",
"issues",
"from",
"pagination"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L416-L429 | [
"def",
"issues",
"(",
"self",
",",
"from_date",
"=",
"None",
")",
":",
"payload",
"=",
"{",
"'state'",
":",
"'all'",
",",
"'order_by'",
":",
"'updated_at'",
",",
"'sort'",
":",
"'asc'",
",",
"'per_page'",
":",
"PER_PAGE",
"}",
"if",
"from_date",
":",
"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.merges | Get the merge requests from pagination | perceval/backends/core/gitlab.py | def merges(self, from_date=None):
"""Get the merge requests from pagination"""
payload = {
'state': 'all',
'order_by': 'updated_at',
'sort': 'asc',
'view': 'simple',
'per_page': PER_PAGE
}
if from_date:
payload['up... | def merges(self, from_date=None):
"""Get the merge requests from pagination"""
payload = {
'state': 'all',
'order_by': 'updated_at',
'sort': 'asc',
'view': 'simple',
'per_page': PER_PAGE
}
if from_date:
payload['up... | [
"Get",
"the",
"merge",
"requests",
"from",
"pagination"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L431-L445 | [
"def",
"merges",
"(",
"self",
",",
"from_date",
"=",
"None",
")",
":",
"payload",
"=",
"{",
"'state'",
":",
"'all'",
",",
"'order_by'",
":",
"'updated_at'",
",",
"'sort'",
":",
"'asc'",
",",
"'view'",
":",
"'simple'",
",",
"'per_page'",
":",
"PER_PAGE",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.merge | Get the merge full data | perceval/backends/core/gitlab.py | def merge(self, merge_id):
"""Get the merge full data"""
path = urijoin(self.base_url,
GitLabClient.PROJECTS, self.owner + '%2F' + self.repository,
GitLabClient.MERGES, merge_id)
response = self.fetch(path)
return response.text | def merge(self, merge_id):
"""Get the merge full data"""
path = urijoin(self.base_url,
GitLabClient.PROJECTS, self.owner + '%2F' + self.repository,
GitLabClient.MERGES, merge_id)
response = self.fetch(path)
return response.text | [
"Get",
"the",
"merge",
"full",
"data"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L447-L456 | [
"def",
"merge",
"(",
"self",
",",
"merge_id",
")",
":",
"path",
"=",
"urijoin",
"(",
"self",
".",
"base_url",
",",
"GitLabClient",
".",
"PROJECTS",
",",
"self",
".",
"owner",
"+",
"'%2F'",
"+",
"self",
".",
"repository",
",",
"GitLabClient",
".",
"MERG... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.merge_versions | Get the merge versions from pagination | perceval/backends/core/gitlab.py | def merge_versions(self, merge_id):
"""Get the merge versions from pagination"""
payload = {
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
path = urijoin(GitLabClient.MERGES, str(merge_id), GitLabClient.VERSIONS)
return self... | def merge_versions(self, merge_id):
"""Get the merge versions from pagination"""
payload = {
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
path = urijoin(GitLabClient.MERGES, str(merge_id), GitLabClient.VERSIONS)
return self... | [
"Get",
"the",
"merge",
"versions",
"from",
"pagination"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L458-L468 | [
"def",
"merge_versions",
"(",
"self",
",",
"merge_id",
")",
":",
"payload",
"=",
"{",
"'order_by'",
":",
"'updated_at'",
",",
"'sort'",
":",
"'asc'",
",",
"'per_page'",
":",
"PER_PAGE",
"}",
"path",
"=",
"urijoin",
"(",
"GitLabClient",
".",
"MERGES",
",",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.merge_version | Get merge version detail | perceval/backends/core/gitlab.py | def merge_version(self, merge_id, version_id):
"""Get merge version detail"""
path = urijoin(self.base_url,
GitLabClient.PROJECTS, self.owner + '%2F' + self.repository,
GitLabClient.MERGES, merge_id, GitLabClient.VERSIONS, version_id)
response = se... | def merge_version(self, merge_id, version_id):
"""Get merge version detail"""
path = urijoin(self.base_url,
GitLabClient.PROJECTS, self.owner + '%2F' + self.repository,
GitLabClient.MERGES, merge_id, GitLabClient.VERSIONS, version_id)
response = se... | [
"Get",
"merge",
"version",
"detail"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L470-L479 | [
"def",
"merge_version",
"(",
"self",
",",
"merge_id",
",",
"version_id",
")",
":",
"path",
"=",
"urijoin",
"(",
"self",
".",
"base_url",
",",
"GitLabClient",
".",
"PROJECTS",
",",
"self",
".",
"owner",
"+",
"'%2F'",
"+",
"self",
".",
"repository",
",",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.notes | Get the notes from pagination | perceval/backends/core/gitlab.py | def notes(self, item_type, item_id):
"""Get the notes from pagination"""
payload = {
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
path = urijoin(item_type, str(item_id), GitLabClient.NOTES)
return self.fetch_items(path, pa... | def notes(self, item_type, item_id):
"""Get the notes from pagination"""
payload = {
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
path = urijoin(item_type, str(item_id), GitLabClient.NOTES)
return self.fetch_items(path, pa... | [
"Get",
"the",
"notes",
"from",
"pagination"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L481-L492 | [
"def",
"notes",
"(",
"self",
",",
"item_type",
",",
"item_id",
")",
":",
"payload",
"=",
"{",
"'order_by'",
":",
"'updated_at'",
",",
"'sort'",
":",
"'asc'",
",",
"'per_page'",
":",
"PER_PAGE",
"}",
"path",
"=",
"urijoin",
"(",
"item_type",
",",
"str",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.emojis | Get emojis from pagination | perceval/backends/core/gitlab.py | def emojis(self, item_type, item_id):
"""Get emojis from pagination"""
payload = {
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
path = urijoin(item_type, str(item_id), GitLabClient.EMOJI)
return self.fetch_items(path, payl... | def emojis(self, item_type, item_id):
"""Get emojis from pagination"""
payload = {
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
path = urijoin(item_type, str(item_id), GitLabClient.EMOJI)
return self.fetch_items(path, payl... | [
"Get",
"emojis",
"from",
"pagination"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L494-L505 | [
"def",
"emojis",
"(",
"self",
",",
"item_type",
",",
"item_id",
")",
":",
"payload",
"=",
"{",
"'order_by'",
":",
"'updated_at'",
",",
"'sort'",
":",
"'asc'",
",",
"'per_page'",
":",
"PER_PAGE",
"}",
"path",
"=",
"urijoin",
"(",
"item_type",
",",
"str",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.note_emojis | Get emojis of a note | perceval/backends/core/gitlab.py | def note_emojis(self, item_type, item_id, note_id):
"""Get emojis of a note"""
payload = {
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
path = urijoin(item_type, str(item_id), GitLabClient.NOTES,
str(note_id)... | def note_emojis(self, item_type, item_id, note_id):
"""Get emojis of a note"""
payload = {
'order_by': 'updated_at',
'sort': 'asc',
'per_page': PER_PAGE
}
path = urijoin(item_type, str(item_id), GitLabClient.NOTES,
str(note_id)... | [
"Get",
"emojis",
"of",
"a",
"note"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L507-L519 | [
"def",
"note_emojis",
"(",
"self",
",",
"item_type",
",",
"item_id",
",",
"note_id",
")",
":",
"payload",
"=",
"{",
"'order_by'",
":",
"'updated_at'",
",",
"'sort'",
":",
"'asc'",
",",
"'per_page'",
":",
"PER_PAGE",
"}",
"path",
"=",
"urijoin",
"(",
"ite... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.calculate_time_to_reset | Calculate the seconds to reset the token requests, by obtaining the different
between the current date and the next date when the token is fully regenerated. | perceval/backends/core/gitlab.py | def calculate_time_to_reset(self):
"""Calculate the seconds to reset the token requests, by obtaining the different
between the current date and the next date when the token is fully regenerated.
"""
time_to_reset = self.rate_limit_reset_ts - (datetime_utcnow().replace(microsecond=0).ti... | def calculate_time_to_reset(self):
"""Calculate the seconds to reset the token requests, by obtaining the different
between the current date and the next date when the token is fully regenerated.
"""
time_to_reset = self.rate_limit_reset_ts - (datetime_utcnow().replace(microsecond=0).ti... | [
"Calculate",
"the",
"seconds",
"to",
"reset",
"the",
"token",
"requests",
"by",
"obtaining",
"the",
"different",
"between",
"the",
"current",
"date",
"and",
"the",
"next",
"date",
"when",
"the",
"token",
"is",
"fully",
"regenerated",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L521-L531 | [
"def",
"calculate_time_to_reset",
"(",
"self",
")",
":",
"time_to_reset",
"=",
"self",
".",
"rate_limit_reset_ts",
"-",
"(",
"datetime_utcnow",
"(",
")",
".",
"replace",
"(",
"microsecond",
"=",
"0",
")",
".",
"timestamp",
"(",
")",
"+",
"1",
")",
"if",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.fetch | Fetch the data from a given URL.
:param url: link to the resource
:param payload: payload of the request
:param headers: headers of the request
:param method: type of request call (GET or POST)
:param stream: defer downloading the response body until the response content is avai... | perceval/backends/core/gitlab.py | def fetch(self, url, payload=None, headers=None, method=HttpClient.GET, stream=False):
"""Fetch the data from a given URL.
:param url: link to the resource
:param payload: payload of the request
:param headers: headers of the request
:param method: type of request call (GET or P... | def fetch(self, url, payload=None, headers=None, method=HttpClient.GET, stream=False):
"""Fetch the data from a given URL.
:param url: link to the resource
:param payload: payload of the request
:param headers: headers of the request
:param method: type of request call (GET or P... | [
"Fetch",
"the",
"data",
"from",
"a",
"given",
"URL",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L533-L552 | [
"def",
"fetch",
"(",
"self",
",",
"url",
",",
"payload",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"method",
"=",
"HttpClient",
".",
"GET",
",",
"stream",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"from_archive",
":",
"self",
".",
"sle... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.fetch_items | Return the items from GitLab API using links pagination | perceval/backends/core/gitlab.py | def fetch_items(self, path, payload):
"""Return the items from GitLab API using links pagination"""
page = 0 # current page
last_page = None # last page
url_next = urijoin(self.base_url, GitLabClient.PROJECTS, self.owner + '%2F' + self.repository, path)
logger.debug("Get GitL... | def fetch_items(self, path, payload):
"""Return the items from GitLab API using links pagination"""
page = 0 # current page
last_page = None # last page
url_next = urijoin(self.base_url, GitLabClient.PROJECTS, self.owner + '%2F' + self.repository, path)
logger.debug("Get GitL... | [
"Return",
"the",
"items",
"from",
"GitLab",
"API",
"using",
"links",
"pagination"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L554-L585 | [
"def",
"fetch_items",
"(",
"self",
",",
"path",
",",
"payload",
")",
":",
"page",
"=",
"0",
"# current page",
"last_page",
"=",
"None",
"# last page",
"url_next",
"=",
"urijoin",
"(",
"self",
".",
"base_url",
",",
"GitLabClient",
".",
"PROJECTS",
",",
"sel... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient.sanitize_for_archive | Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:returns url, headers and the sanitized payload | perceval/backends/core/gitlab.py | def sanitize_for_archive(url, headers, payload):
"""Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:r... | def sanitize_for_archive(url, headers, payload):
"""Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:r... | [
"Sanitize",
"payload",
"of",
"a",
"HTTP",
"request",
"by",
"removing",
"the",
"token",
"information",
"before",
"storing",
"/",
"retrieving",
"archived",
"items"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L588-L601 | [
"def",
"sanitize_for_archive",
"(",
"url",
",",
"headers",
",",
"payload",
")",
":",
"if",
"headers",
"and",
"'PRIVATE-TOKEN'",
"in",
"headers",
":",
"headers",
".",
"pop",
"(",
"'PRIVATE-TOKEN'",
",",
"None",
")",
"return",
"url",
",",
"headers",
",",
"pa... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabClient._init_rate_limit | Initialize rate limit information | perceval/backends/core/gitlab.py | def _init_rate_limit(self):
"""Initialize rate limit information"""
url = urijoin(self.base_url, 'projects', self.owner + '%2F' + self.repository)
try:
response = super().fetch(url)
self.update_rate_limit(response)
except requests.exceptions.HTTPError as error:
... | def _init_rate_limit(self):
"""Initialize rate limit information"""
url = urijoin(self.base_url, 'projects', self.owner + '%2F' + self.repository)
try:
response = super().fetch(url)
self.update_rate_limit(response)
except requests.exceptions.HTTPError as error:
... | [
"Initialize",
"rate",
"limit",
"information"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L612-L623 | [
"def",
"_init_rate_limit",
"(",
"self",
")",
":",
"url",
"=",
"urijoin",
"(",
"self",
".",
"base_url",
",",
"'projects'",
",",
"self",
".",
"owner",
"+",
"'%2F'",
"+",
"self",
".",
"repository",
")",
"try",
":",
"response",
"=",
"super",
"(",
")",
".... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GitLabCommand.setup_cmd_parser | Returns the GitLab argument parser. | perceval/backends/core/gitlab.py | def setup_cmd_parser(cls):
"""Returns the GitLab argument parser."""
parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
from_date=True,
token_auth=True,
a... | def setup_cmd_parser(cls):
"""Returns the GitLab argument parser."""
parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
from_date=True,
token_auth=True,
a... | [
"Returns",
"the",
"GitLab",
"argument",
"parser",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gitlab.py#L632-L669 | [
"def",
"setup_cmd_parser",
"(",
"cls",
")",
":",
"parser",
"=",
"BackendCommandArgumentParser",
"(",
"cls",
".",
"BACKEND",
".",
"CATEGORIES",
",",
"from_date",
"=",
"True",
",",
"token_auth",
"=",
"True",
",",
"archive",
"=",
"True",
")",
"# GitLab options",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Slack.fetch | Fetch the messages from the channel.
This method fetches the messages stored on the channel that were
sent since the given date.
:param category: the category of items to fetch
:param from_date: obtain messages sent since this date
:returns: a generator of messages | perceval/backends/core/slack.py | def fetch(self, category=CATEGORY_MESSAGE, from_date=DEFAULT_DATETIME):
"""Fetch the messages from the channel.
This method fetches the messages stored on the channel that were
sent since the given date.
:param category: the category of items to fetch
:param from_date: obtain m... | def fetch(self, category=CATEGORY_MESSAGE, from_date=DEFAULT_DATETIME):
"""Fetch the messages from the channel.
This method fetches the messages stored on the channel that were
sent since the given date.
:param category: the category of items to fetch
:param from_date: obtain m... | [
"Fetch",
"the",
"messages",
"from",
"the",
"channel",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L76-L96 | [
"def",
"fetch",
"(",
"self",
",",
"category",
"=",
"CATEGORY_MESSAGE",
",",
"from_date",
"=",
"DEFAULT_DATETIME",
")",
":",
"if",
"not",
"from_date",
":",
"from_date",
"=",
"DEFAULT_DATETIME",
"from_date",
"=",
"datetime_to_utc",
"(",
"from_date",
")",
"latest",... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Slack.fetch_items | Fetch the messages
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items | perceval/backends/core/slack.py | def fetch_items(self, category, **kwargs):
"""Fetch the messages
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
latest = kwargs['latest']
logger.info("F... | def fetch_items(self, category, **kwargs):
"""Fetch the messages
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
latest = kwargs['latest']
logger.info("F... | [
"Fetch",
"the",
"messages"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L98-L158 | [
"def",
"fetch_items",
"(",
"self",
",",
"category",
",",
"*",
"*",
"kwargs",
")",
":",
"from_date",
"=",
"kwargs",
"[",
"'from_date'",
"]",
"latest",
"=",
"kwargs",
"[",
"'latest'",
"]",
"logger",
".",
"info",
"(",
"\"Fetching messages of '%s' channel from %s\... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Slack.metadata_id | Extracts the identifier from a Slack item.
This identifier will be the mix of two fields because Slack
messages does not have any unique identifier. In this case,
'ts' and 'user' values (or 'bot_id' when the message is sent by a bot)
are combined because there have been cases where two ... | perceval/backends/core/slack.py | def metadata_id(item):
"""Extracts the identifier from a Slack item.
This identifier will be the mix of two fields because Slack
messages does not have any unique identifier. In this case,
'ts' and 'user' values (or 'bot_id' when the message is sent by a bot)
are combined becaus... | def metadata_id(item):
"""Extracts the identifier from a Slack item.
This identifier will be the mix of two fields because Slack
messages does not have any unique identifier. In this case,
'ts' and 'user' values (or 'bot_id' when the message is sent by a bot)
are combined becaus... | [
"Extracts",
"the",
"identifier",
"from",
"a",
"Slack",
"item",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L177-L193 | [
"def",
"metadata_id",
"(",
"item",
")",
":",
"if",
"'user'",
"in",
"item",
":",
"nick",
"=",
"item",
"[",
"'user'",
"]",
"elif",
"'comment'",
"in",
"item",
":",
"nick",
"=",
"item",
"[",
"'comment'",
"]",
"[",
"'user'",
"]",
"else",
":",
"nick",
"=... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Slack._init_client | Init client | perceval/backends/core/slack.py | def _init_client(self, from_archive=False):
"""Init client"""
return SlackClient(self.api_token, self.max_items, self.archive, from_archive) | def _init_client(self, from_archive=False):
"""Init client"""
return SlackClient(self.api_token, self.max_items, self.archive, from_archive) | [
"Init",
"client"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L264-L267 | [
"def",
"_init_client",
"(",
"self",
",",
"from_archive",
"=",
"False",
")",
":",
"return",
"SlackClient",
"(",
"self",
".",
"api_token",
",",
"self",
".",
"max_items",
",",
"self",
".",
"archive",
",",
"from_archive",
")"
] | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | SlackClient.conversation_members | Fetch the number of members in a conversation, which is a supertype for public and
private ones, DM and group DM.
:param conversation: the ID of the conversation | perceval/backends/core/slack.py | def conversation_members(self, conversation):
"""Fetch the number of members in a conversation, which is a supertype for public and
private ones, DM and group DM.
:param conversation: the ID of the conversation
"""
members = 0
resource = self.RCONVERSATION_INFO
... | def conversation_members(self, conversation):
"""Fetch the number of members in a conversation, which is a supertype for public and
private ones, DM and group DM.
:param conversation: the ID of the conversation
"""
members = 0
resource = self.RCONVERSATION_INFO
... | [
"Fetch",
"the",
"number",
"of",
"members",
"in",
"a",
"conversation",
"which",
"is",
"a",
"supertype",
"for",
"public",
"and",
"private",
"ones",
"DM",
"and",
"group",
"DM",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L318-L342 | [
"def",
"conversation_members",
"(",
"self",
",",
"conversation",
")",
":",
"members",
"=",
"0",
"resource",
"=",
"self",
".",
"RCONVERSATION_INFO",
"params",
"=",
"{",
"self",
".",
"PCHANNEL",
":",
"conversation",
",",
"}",
"raw_response",
"=",
"self",
".",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | SlackClient.channel_info | Fetch information about a channel. | perceval/backends/core/slack.py | def channel_info(self, channel):
"""Fetch information about a channel."""
resource = self.RCHANNEL_INFO
params = {
self.PCHANNEL: channel,
}
response = self._fetch(resource, params)
return response | def channel_info(self, channel):
"""Fetch information about a channel."""
resource = self.RCHANNEL_INFO
params = {
self.PCHANNEL: channel,
}
response = self._fetch(resource, params)
return response | [
"Fetch",
"information",
"about",
"a",
"channel",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L344-L355 | [
"def",
"channel_info",
"(",
"self",
",",
"channel",
")",
":",
"resource",
"=",
"self",
".",
"RCHANNEL_INFO",
"params",
"=",
"{",
"self",
".",
"PCHANNEL",
":",
"channel",
",",
"}",
"response",
"=",
"self",
".",
"_fetch",
"(",
"resource",
",",
"params",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | SlackClient.history | Fetch the history of a channel. | perceval/backends/core/slack.py | def history(self, channel, oldest=None, latest=None):
"""Fetch the history of a channel."""
resource = self.RCHANNEL_HISTORY
params = {
self.PCHANNEL: channel,
self.PCOUNT: self.max_items
}
if oldest is not None:
params[self.POLDEST] = oldes... | def history(self, channel, oldest=None, latest=None):
"""Fetch the history of a channel."""
resource = self.RCHANNEL_HISTORY
params = {
self.PCHANNEL: channel,
self.PCOUNT: self.max_items
}
if oldest is not None:
params[self.POLDEST] = oldes... | [
"Fetch",
"the",
"history",
"of",
"a",
"channel",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L357-L374 | [
"def",
"history",
"(",
"self",
",",
"channel",
",",
"oldest",
"=",
"None",
",",
"latest",
"=",
"None",
")",
":",
"resource",
"=",
"self",
".",
"RCHANNEL_HISTORY",
"params",
"=",
"{",
"self",
".",
"PCHANNEL",
":",
"channel",
",",
"self",
".",
"PCOUNT",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | SlackClient.user | Fetch user info. | perceval/backends/core/slack.py | def user(self, user_id):
"""Fetch user info."""
resource = self.RUSER_INFO
params = {
self.PUSER: user_id
}
response = self._fetch(resource, params)
return response | def user(self, user_id):
"""Fetch user info."""
resource = self.RUSER_INFO
params = {
self.PUSER: user_id
}
response = self._fetch(resource, params)
return response | [
"Fetch",
"user",
"info",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L376-L387 | [
"def",
"user",
"(",
"self",
",",
"user_id",
")",
":",
"resource",
"=",
"self",
".",
"RUSER_INFO",
"params",
"=",
"{",
"self",
".",
"PUSER",
":",
"user_id",
"}",
"response",
"=",
"self",
".",
"_fetch",
"(",
"resource",
",",
"params",
")",
"return",
"r... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | SlackClient.sanitize_for_archive | Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:returns url, headers and the sanitized payload | perceval/backends/core/slack.py | def sanitize_for_archive(url, headers, payload):
"""Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:r... | def sanitize_for_archive(url, headers, payload):
"""Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:r... | [
"Sanitize",
"payload",
"of",
"a",
"HTTP",
"request",
"by",
"removing",
"the",
"token",
"information",
"before",
"storing",
"/",
"retrieving",
"archived",
"items"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L390-L403 | [
"def",
"sanitize_for_archive",
"(",
"url",
",",
"headers",
",",
"payload",
")",
":",
"if",
"SlackClient",
".",
"PTOKEN",
"in",
"payload",
":",
"payload",
".",
"pop",
"(",
"SlackClient",
".",
"PTOKEN",
")",
"return",
"url",
",",
"headers",
",",
"payload"
] | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | SlackClient._fetch | Fetch a resource.
:param resource: resource to get
:param params: dict with the HTTP parameters needed to get
the given resource | perceval/backends/core/slack.py | def _fetch(self, resource, params):
"""Fetch a resource.
:param resource: resource to get
:param params: dict with the HTTP parameters needed to get
the given resource
"""
url = self.URL % {'resource': resource}
params[self.PTOKEN] = self.api_token
l... | def _fetch(self, resource, params):
"""Fetch a resource.
:param resource: resource to get
:param params: dict with the HTTP parameters needed to get
the given resource
"""
url = self.URL % {'resource': resource}
params[self.PTOKEN] = self.api_token
l... | [
"Fetch",
"a",
"resource",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L405-L426 | [
"def",
"_fetch",
"(",
"self",
",",
"resource",
",",
"params",
")",
":",
"url",
"=",
"self",
".",
"URL",
"%",
"{",
"'resource'",
":",
"resource",
"}",
"params",
"[",
"self",
".",
"PTOKEN",
"]",
"=",
"self",
".",
"api_token",
"logger",
".",
"debug",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | SlackCommand.setup_cmd_parser | Returns the Slack argument parser. | perceval/backends/core/slack.py | def setup_cmd_parser(cls):
"""Returns the Slack argument parser."""
parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
from_date=True,
token_auth=True,
ar... | def setup_cmd_parser(cls):
"""Returns the Slack argument parser."""
parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
from_date=True,
token_auth=True,
ar... | [
"Returns",
"the",
"Slack",
"argument",
"parser",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/slack.py#L435-L457 | [
"def",
"setup_cmd_parser",
"(",
"cls",
")",
":",
"parser",
"=",
"BackendCommandArgumentParser",
"(",
"cls",
".",
"BACKEND",
".",
"CATEGORIES",
",",
"from_date",
"=",
"True",
",",
"token_auth",
"=",
"True",
",",
"archive",
"=",
"True",
")",
"# Backend token is ... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Bugzilla.fetch_items | Fetch the bugs
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items | perceval/backends/core/bugzilla.py | def fetch_items(self, category, **kwargs):
"""Fetch the bugs
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
logger.info("Looking for bugs: '%s' updated from '%... | def fetch_items(self, category, **kwargs):
"""Fetch the bugs
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
logger.info("Looking for bugs: '%s' updated from '%... | [
"Fetch",
"the",
"bugs"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L99-L132 | [
"def",
"fetch_items",
"(",
"self",
",",
"category",
",",
"*",
"*",
"kwargs",
")",
":",
"from_date",
"=",
"kwargs",
"[",
"'from_date'",
"]",
"logger",
".",
"info",
"(",
"\"Looking for bugs: '%s' updated from '%s'\"",
",",
"self",
".",
"url",
",",
"str",
"(",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Bugzilla.metadata_updated_on | Extracts and coverts the update time from a Bugzilla item.
The timestamp is extracted from 'delta_ts' field. This date is
converted to UNIX timestamp format. Due Bugzilla servers ignore
the timezone on HTTP requests, it will be ignored during the
conversion, too.
:param item: i... | perceval/backends/core/bugzilla.py | def metadata_updated_on(item):
"""Extracts and coverts the update time from a Bugzilla item.
The timestamp is extracted from 'delta_ts' field. This date is
converted to UNIX timestamp format. Due Bugzilla servers ignore
the timezone on HTTP requests, it will be ignored during the
... | def metadata_updated_on(item):
"""Extracts and coverts the update time from a Bugzilla item.
The timestamp is extracted from 'delta_ts' field. This date is
converted to UNIX timestamp format. Due Bugzilla servers ignore
the timezone on HTTP requests, it will be ignored during the
... | [
"Extracts",
"and",
"coverts",
"the",
"update",
"time",
"from",
"a",
"Bugzilla",
"item",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L157-L173 | [
"def",
"metadata_updated_on",
"(",
"item",
")",
":",
"ts",
"=",
"item",
"[",
"'delta_ts'",
"]",
"[",
"0",
"]",
"[",
"'__text__'",
"]",
"ts",
"=",
"str_to_datetime",
"(",
"ts",
")",
"ts",
"=",
"ts",
".",
"replace",
"(",
"tzinfo",
"=",
"dateutil",
".",... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Bugzilla.parse_buglist | Parse a Bugzilla CSV bug list.
The method parses the CSV file and returns an iterator of
dictionaries. Each one of this, contains the summary of a bug.
:param raw_csv: CSV string to parse
:returns: a generator of parsed bugs | perceval/backends/core/bugzilla.py | def parse_buglist(raw_csv):
"""Parse a Bugzilla CSV bug list.
The method parses the CSV file and returns an iterator of
dictionaries. Each one of this, contains the summary of a bug.
:param raw_csv: CSV string to parse
:returns: a generator of parsed bugs
"""
r... | def parse_buglist(raw_csv):
"""Parse a Bugzilla CSV bug list.
The method parses the CSV file and returns an iterator of
dictionaries. Each one of this, contains the summary of a bug.
:param raw_csv: CSV string to parse
:returns: a generator of parsed bugs
"""
r... | [
"Parse",
"a",
"Bugzilla",
"CSV",
"bug",
"list",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L185-L198 | [
"def",
"parse_buglist",
"(",
"raw_csv",
")",
":",
"reader",
"=",
"csv",
".",
"DictReader",
"(",
"raw_csv",
".",
"split",
"(",
"'\\n'",
")",
",",
"delimiter",
"=",
"','",
",",
"quotechar",
"=",
"'\"'",
")",
"for",
"row",
"in",
"reader",
":",
"yield",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Bugzilla.parse_bugs_details | Parse a Bugilla bugs details XML stream.
This method returns a generator which parses the given XML,
producing an iterator of dictionaries. Each dictionary stores
the information related to a parsed bug.
If the given XML is invalid or does not contains any bug, the
method will ... | perceval/backends/core/bugzilla.py | def parse_bugs_details(raw_xml):
"""Parse a Bugilla bugs details XML stream.
This method returns a generator which parses the given XML,
producing an iterator of dictionaries. Each dictionary stores
the information related to a parsed bug.
If the given XML is invalid or does no... | def parse_bugs_details(raw_xml):
"""Parse a Bugilla bugs details XML stream.
This method returns a generator which parses the given XML,
producing an iterator of dictionaries. Each dictionary stores
the information related to a parsed bug.
If the given XML is invalid or does no... | [
"Parse",
"a",
"Bugilla",
"bugs",
"details",
"XML",
"stream",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L201-L225 | [
"def",
"parse_bugs_details",
"(",
"raw_xml",
")",
":",
"bugs",
"=",
"xml_to_dict",
"(",
"raw_xml",
")",
"if",
"'bug'",
"not",
"in",
"bugs",
":",
"cause",
"=",
"\"No bugs found. XML stream seems to be invalid.\"",
"raise",
"ParseError",
"(",
"cause",
"=",
"cause",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Bugzilla.parse_bug_activity | Parse a Bugzilla bug activity HTML stream.
This method extracts the information about activity from the
given HTML stream. The bug activity is stored into a HTML
table. Each parsed activity event is returned into a dictionary.
If the given HTML is invalid, the method will raise a Parse... | perceval/backends/core/bugzilla.py | def parse_bug_activity(raw_html):
"""Parse a Bugzilla bug activity HTML stream.
This method extracts the information about activity from the
given HTML stream. The bug activity is stored into a HTML
table. Each parsed activity event is returned into a dictionary.
If the given H... | def parse_bug_activity(raw_html):
"""Parse a Bugzilla bug activity HTML stream.
This method extracts the information about activity from the
given HTML stream. The bug activity is stored into a HTML
table. Each parsed activity event is returned into a dictionary.
If the given H... | [
"Parse",
"a",
"Bugzilla",
"bug",
"activity",
"HTML",
"stream",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L228-L302 | [
"def",
"parse_bug_activity",
"(",
"raw_html",
")",
":",
"def",
"is_activity_empty",
"(",
"bs",
")",
":",
"EMPTY_ACTIVITY",
"=",
"\"No changes have been made to this (?:bug|issue) yet.\"",
"tag",
"=",
"bs",
".",
"find",
"(",
"text",
"=",
"re",
".",
"compile",
"(",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Bugzilla._init_client | Init client | perceval/backends/core/bugzilla.py | def _init_client(self, from_archive=False):
"""Init client"""
return BugzillaClient(self.url, user=self.user, password=self.password,
max_bugs_csv=self.max_bugs_csv,
archive=self.archive, from_archive=from_archive) | def _init_client(self, from_archive=False):
"""Init client"""
return BugzillaClient(self.url, user=self.user, password=self.password,
max_bugs_csv=self.max_bugs_csv,
archive=self.archive, from_archive=from_archive) | [
"Init",
"client"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L304-L309 | [
"def",
"_init_client",
"(",
"self",
",",
"from_archive",
"=",
"False",
")",
":",
"return",
"BugzillaClient",
"(",
"self",
".",
"url",
",",
"user",
"=",
"self",
".",
"user",
",",
"password",
"=",
"self",
".",
"password",
",",
"max_bugs_csv",
"=",
"self",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | BugzillaClient.login | Authenticate a user in the server.
:param user: Bugzilla user
:param password: user password | perceval/backends/core/bugzilla.py | def login(self, user, password):
"""Authenticate a user in the server.
:param user: Bugzilla user
:param password: user password
"""
url = self.URL % {'base': self.base_url, 'cgi': self.CGI_LOGIN}
payload = {
self.PBUGZILLA_LOGIN: user,
self.PBUG... | def login(self, user, password):
"""Authenticate a user in the server.
:param user: Bugzilla user
:param password: user password
"""
url = self.URL % {'base': self.base_url, 'cgi': self.CGI_LOGIN}
payload = {
self.PBUGZILLA_LOGIN: user,
self.PBUG... | [
"Authenticate",
"a",
"user",
"in",
"the",
"server",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L436-L463 | [
"def",
"login",
"(",
"self",
",",
"user",
",",
"password",
")",
":",
"url",
"=",
"self",
".",
"URL",
"%",
"{",
"'base'",
":",
"self",
".",
"base_url",
",",
"'cgi'",
":",
"self",
".",
"CGI_LOGIN",
"}",
"payload",
"=",
"{",
"self",
".",
"PBUGZILLA_LO... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | BugzillaClient.logout | Logout from the server. | perceval/backends/core/bugzilla.py | def logout(self):
"""Logout from the server."""
params = {
self.PLOGOUT: '1'
}
self.call(self.CGI_LOGIN, params)
self._close_http_session()
logger.debug("Bugzilla user logged out from %s",
self.base_url) | def logout(self):
"""Logout from the server."""
params = {
self.PLOGOUT: '1'
}
self.call(self.CGI_LOGIN, params)
self._close_http_session()
logger.debug("Bugzilla user logged out from %s",
self.base_url) | [
"Logout",
"from",
"the",
"server",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L465-L476 | [
"def",
"logout",
"(",
"self",
")",
":",
"params",
"=",
"{",
"self",
".",
"PLOGOUT",
":",
"'1'",
"}",
"self",
".",
"call",
"(",
"self",
".",
"CGI_LOGIN",
",",
"params",
")",
"self",
".",
"_close_http_session",
"(",
")",
"logger",
".",
"debug",
"(",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | BugzillaClient.metadata | Get metadata information in XML format. | perceval/backends/core/bugzilla.py | def metadata(self):
"""Get metadata information in XML format."""
params = {
self.PCTYPE: self.CTYPE_XML
}
response = self.call(self.CGI_BUG, params)
return response | def metadata(self):
"""Get metadata information in XML format."""
params = {
self.PCTYPE: self.CTYPE_XML
}
response = self.call(self.CGI_BUG, params)
return response | [
"Get",
"metadata",
"information",
"in",
"XML",
"format",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L478-L487 | [
"def",
"metadata",
"(",
"self",
")",
":",
"params",
"=",
"{",
"self",
".",
"PCTYPE",
":",
"self",
".",
"CTYPE_XML",
"}",
"response",
"=",
"self",
".",
"call",
"(",
"self",
".",
"CGI_BUG",
",",
"params",
")",
"return",
"response"
] | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | BugzillaClient.buglist | Get a summary of bugs in CSV format.
:param from_date: retrieve bugs that where updated from that date | perceval/backends/core/bugzilla.py | def buglist(self, from_date=DEFAULT_DATETIME):
"""Get a summary of bugs in CSV format.
:param from_date: retrieve bugs that where updated from that date
"""
if not self.version:
self.version = self.__fetch_version()
if self.version in self.OLD_STYLE_VERSIONS:
... | def buglist(self, from_date=DEFAULT_DATETIME):
"""Get a summary of bugs in CSV format.
:param from_date: retrieve bugs that where updated from that date
"""
if not self.version:
self.version = self.__fetch_version()
if self.version in self.OLD_STYLE_VERSIONS:
... | [
"Get",
"a",
"summary",
"of",
"bugs",
"in",
"CSV",
"format",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L489-L513 | [
"def",
"buglist",
"(",
"self",
",",
"from_date",
"=",
"DEFAULT_DATETIME",
")",
":",
"if",
"not",
"self",
".",
"version",
":",
"self",
".",
"version",
"=",
"self",
".",
"__fetch_version",
"(",
")",
"if",
"self",
".",
"version",
"in",
"self",
".",
"OLD_S... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | BugzillaClient.bugs | Get the information of a list of bugs in XML format.
:param bug_ids: list of bug identifiers | perceval/backends/core/bugzilla.py | def bugs(self, *bug_ids):
"""Get the information of a list of bugs in XML format.
:param bug_ids: list of bug identifiers
"""
params = {
self.PBUG_ID: bug_ids,
self.PCTYPE: self.CTYPE_XML,
self.PEXCLUDE_FIELD: 'attachmentdata'
}
respo... | def bugs(self, *bug_ids):
"""Get the information of a list of bugs in XML format.
:param bug_ids: list of bug identifiers
"""
params = {
self.PBUG_ID: bug_ids,
self.PCTYPE: self.CTYPE_XML,
self.PEXCLUDE_FIELD: 'attachmentdata'
}
respo... | [
"Get",
"the",
"information",
"of",
"a",
"list",
"of",
"bugs",
"in",
"XML",
"format",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L515-L528 | [
"def",
"bugs",
"(",
"self",
",",
"*",
"bug_ids",
")",
":",
"params",
"=",
"{",
"self",
".",
"PBUG_ID",
":",
"bug_ids",
",",
"self",
".",
"PCTYPE",
":",
"self",
".",
"CTYPE_XML",
",",
"self",
".",
"PEXCLUDE_FIELD",
":",
"'attachmentdata'",
"}",
"respons... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | BugzillaClient.bug_activity | Get the activity of a bug in HTML format.
:param bug_id: bug identifier | perceval/backends/core/bugzilla.py | def bug_activity(self, bug_id):
"""Get the activity of a bug in HTML format.
:param bug_id: bug identifier
"""
params = {
self.PBUG_ID: bug_id
}
response = self.call(self.CGI_BUG_ACTIVITY, params)
return response | def bug_activity(self, bug_id):
"""Get the activity of a bug in HTML format.
:param bug_id: bug identifier
"""
params = {
self.PBUG_ID: bug_id
}
response = self.call(self.CGI_BUG_ACTIVITY, params)
return response | [
"Get",
"the",
"activity",
"of",
"a",
"bug",
"in",
"HTML",
"format",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L530-L541 | [
"def",
"bug_activity",
"(",
"self",
",",
"bug_id",
")",
":",
"params",
"=",
"{",
"self",
".",
"PBUG_ID",
":",
"bug_id",
"}",
"response",
"=",
"self",
".",
"call",
"(",
"self",
".",
"CGI_BUG_ACTIVITY",
",",
"params",
")",
"return",
"response"
] | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | BugzillaClient.call | Run an API command.
:param cgi: cgi command to run on the server
:param params: dict with the HTTP parameters needed to run
the given command | perceval/backends/core/bugzilla.py | def call(self, cgi, params):
"""Run an API command.
:param cgi: cgi command to run on the server
:param params: dict with the HTTP parameters needed to run
the given command
"""
url = self.URL % {'base': self.base_url, 'cgi': cgi}
logger.debug("Bugzilla clie... | def call(self, cgi, params):
"""Run an API command.
:param cgi: cgi command to run on the server
:param params: dict with the HTTP parameters needed to run
the given command
"""
url = self.URL % {'base': self.base_url, 'cgi': cgi}
logger.debug("Bugzilla clie... | [
"Run",
"an",
"API",
"command",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L543-L557 | [
"def",
"call",
"(",
"self",
",",
"cgi",
",",
"params",
")",
":",
"url",
"=",
"self",
".",
"URL",
"%",
"{",
"'base'",
":",
"self",
".",
"base_url",
",",
"'cgi'",
":",
"cgi",
"}",
"logger",
".",
"debug",
"(",
"\"Bugzilla client calls command: %s params: %s... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | BugzillaClient.sanitize_for_archive | Sanitize payload of a HTTP request by removing the login and password information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:returns url, headers and the sanitized payload | perceval/backends/core/bugzilla.py | def sanitize_for_archive(url, headers, payload):
"""Sanitize payload of a HTTP request by removing the login and password information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload reques... | def sanitize_for_archive(url, headers, payload):
"""Sanitize payload of a HTTP request by removing the login and password information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload reques... | [
"Sanitize",
"payload",
"of",
"a",
"HTTP",
"request",
"by",
"removing",
"the",
"login",
"and",
"password",
"information",
"before",
"storing",
"/",
"retrieving",
"archived",
"items"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/bugzilla.py#L560-L579 | [
"def",
"sanitize_for_archive",
"(",
"url",
",",
"headers",
",",
"payload",
")",
":",
"if",
"BugzillaClient",
".",
"PBUGZILLA_LOGIN",
"in",
"payload",
":",
"payload",
".",
"pop",
"(",
"BugzillaClient",
".",
"PBUGZILLA_LOGIN",
")",
"if",
"BugzillaClient",
".",
"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Meetup.fetch | Fetch the events from the server.
This method fetches those events of a group stored on the server
that were updated since the given date. Data comments and rsvps
are included within each event.
:param category: the category of items to fetch
:param from_date: obtain events upd... | perceval/backends/core/meetup.py | def fetch(self, category=CATEGORY_EVENT, from_date=DEFAULT_DATETIME, to_date=None,
filter_classified=False):
"""Fetch the events from the server.
This method fetches those events of a group stored on the server
that were updated since the given date. Data comments and rsvps
... | def fetch(self, category=CATEGORY_EVENT, from_date=DEFAULT_DATETIME, to_date=None,
filter_classified=False):
"""Fetch the events from the server.
This method fetches those events of a group stored on the server
that were updated since the given date. Data comments and rsvps
... | [
"Fetch",
"the",
"events",
"from",
"the",
"server",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/meetup.py#L97-L122 | [
"def",
"fetch",
"(",
"self",
",",
"category",
"=",
"CATEGORY_EVENT",
",",
"from_date",
"=",
"DEFAULT_DATETIME",
",",
"to_date",
"=",
"None",
",",
"filter_classified",
"=",
"False",
")",
":",
"if",
"not",
"from_date",
":",
"from_date",
"=",
"DEFAULT_DATETIME",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Meetup.fetch_items | Fetch the events
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items | perceval/backends/core/meetup.py | def fetch_items(self, category, **kwargs):
"""Fetch the events
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
to_date = kwargs['to_date']
logger.info("F... | def fetch_items(self, category, **kwargs):
"""Fetch the events
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
to_date = kwargs['to_date']
logger.info("F... | [
"Fetch",
"the",
"events"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/meetup.py#L124-L168 | [
"def",
"fetch_items",
"(",
"self",
",",
"category",
",",
"*",
"*",
"kwargs",
")",
":",
"from_date",
"=",
"kwargs",
"[",
"'from_date'",
"]",
"to_date",
"=",
"kwargs",
"[",
"'to_date'",
"]",
"logger",
".",
"info",
"(",
"\"Fetching events of '%s' group from %s to... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | MeetupClient.events | Fetch the events pages of a given group. | perceval/backends/core/meetup.py | def events(self, group, from_date=DEFAULT_DATETIME):
"""Fetch the events pages of a given group."""
date = datetime_to_utc(from_date)
date = date.strftime("since:%Y-%m-%dT%H:%M:%S.000Z")
resource = urijoin(group, self.REVENTS)
# Hack required due to Metup API does not support ... | def events(self, group, from_date=DEFAULT_DATETIME):
"""Fetch the events pages of a given group."""
date = datetime_to_utc(from_date)
date = date.strftime("since:%Y-%m-%dT%H:%M:%S.000Z")
resource = urijoin(group, self.REVENTS)
# Hack required due to Metup API does not support ... | [
"Fetch",
"the",
"events",
"pages",
"of",
"a",
"given",
"group",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/meetup.py#L361-L393 | [
"def",
"events",
"(",
"self",
",",
"group",
",",
"from_date",
"=",
"DEFAULT_DATETIME",
")",
":",
"date",
"=",
"datetime_to_utc",
"(",
"from_date",
")",
"date",
"=",
"date",
".",
"strftime",
"(",
"\"since:%Y-%m-%dT%H:%M:%S.000Z\"",
")",
"resource",
"=",
"urijoi... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | MeetupClient.comments | Fetch the comments of a given event. | perceval/backends/core/meetup.py | def comments(self, group, event_id):
"""Fetch the comments of a given event."""
resource = urijoin(group, self.REVENTS, event_id, self.RCOMMENTS)
params = {
self.PPAGE: self.max_items
}
for page in self._fetch(resource, params):
yield page | def comments(self, group, event_id):
"""Fetch the comments of a given event."""
resource = urijoin(group, self.REVENTS, event_id, self.RCOMMENTS)
params = {
self.PPAGE: self.max_items
}
for page in self._fetch(resource, params):
yield page | [
"Fetch",
"the",
"comments",
"of",
"a",
"given",
"event",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/meetup.py#L395-L405 | [
"def",
"comments",
"(",
"self",
",",
"group",
",",
"event_id",
")",
":",
"resource",
"=",
"urijoin",
"(",
"group",
",",
"self",
".",
"REVENTS",
",",
"event_id",
",",
"self",
".",
"RCOMMENTS",
")",
"params",
"=",
"{",
"self",
".",
"PPAGE",
":",
"self"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | MeetupClient.rsvps | Fetch the rsvps of a given event. | perceval/backends/core/meetup.py | def rsvps(self, group, event_id):
"""Fetch the rsvps of a given event."""
resource = urijoin(group, self.REVENTS, event_id, self.RRSVPS)
# Same hack that in 'events' method
fixed_params = '?' + self.PFIELDS + '=' + ','.join(self.VRSVP_FIELDS)
fixed_params += '&' + self.PRESPONS... | def rsvps(self, group, event_id):
"""Fetch the rsvps of a given event."""
resource = urijoin(group, self.REVENTS, event_id, self.RRSVPS)
# Same hack that in 'events' method
fixed_params = '?' + self.PFIELDS + '=' + ','.join(self.VRSVP_FIELDS)
fixed_params += '&' + self.PRESPONS... | [
"Fetch",
"the",
"rsvps",
"of",
"a",
"given",
"event",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/meetup.py#L407-L422 | [
"def",
"rsvps",
"(",
"self",
",",
"group",
",",
"event_id",
")",
":",
"resource",
"=",
"urijoin",
"(",
"group",
",",
"self",
".",
"REVENTS",
",",
"event_id",
",",
"self",
".",
"RRSVPS",
")",
"# Same hack that in 'events' method",
"fixed_params",
"=",
"'?'",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | MeetupClient.sanitize_for_archive | Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:returns url, headers and the sanitized payload | perceval/backends/core/meetup.py | def sanitize_for_archive(url, headers, payload):
"""Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:r... | def sanitize_for_archive(url, headers, payload):
"""Sanitize payload of a HTTP request by removing the token information
before storing/retrieving archived items
:param: url: HTTP url request
:param: headers: HTTP headers request
:param: payload: HTTP payload request
:r... | [
"Sanitize",
"payload",
"of",
"a",
"HTTP",
"request",
"by",
"removing",
"the",
"token",
"information",
"before",
"storing",
"/",
"retrieving",
"archived",
"items"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/meetup.py#L425-L441 | [
"def",
"sanitize_for_archive",
"(",
"url",
",",
"headers",
",",
"payload",
")",
":",
"if",
"MeetupClient",
".",
"PKEY",
"in",
"payload",
":",
"payload",
".",
"pop",
"(",
"MeetupClient",
".",
"PKEY",
")",
"if",
"MeetupClient",
".",
"PSIGN",
"in",
"payload",... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | MeetupClient._fetch | Fetch a resource.
Method to fetch and to iterate over the contents of a
type of resource. The method returns a generator of
pages for that resource and parameters.
:param resource: type of the resource
:param params: parameters to filter
:returns: a generator of pages ... | perceval/backends/core/meetup.py | def _fetch(self, resource, params):
"""Fetch a resource.
Method to fetch and to iterate over the contents of a
type of resource. The method returns a generator of
pages for that resource and parameters.
:param resource: type of the resource
:param params: parameters to ... | def _fetch(self, resource, params):
"""Fetch a resource.
Method to fetch and to iterate over the contents of a
type of resource. The method returns a generator of
pages for that resource and parameters.
:param resource: type of the resource
:param params: parameters to ... | [
"Fetch",
"a",
"resource",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/meetup.py#L443-L483 | [
"def",
"_fetch",
"(",
"self",
",",
"resource",
",",
"params",
")",
":",
"url",
"=",
"urijoin",
"(",
"self",
".",
"base_url",
",",
"resource",
")",
"params",
"[",
"self",
".",
"PKEY",
"]",
"=",
"self",
".",
"api_key",
"params",
"[",
"self",
".",
"PS... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Askbot.fetch_items | Fetch the questions
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items | perceval/backends/core/askbot.py | def fetch_items(self, category, **kwargs):
"""Fetch the questions
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = datetime_to_utc(kwargs['from_date']).timestamp()
questions_groups ... | def fetch_items(self, category, **kwargs):
"""Fetch the questions
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = datetime_to_utc(kwargs['from_date']).timestamp()
questions_groups ... | [
"Fetch",
"the",
"questions"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L87-L112 | [
"def",
"fetch_items",
"(",
"self",
",",
"category",
",",
"*",
"*",
"kwargs",
")",
":",
"from_date",
"=",
"datetime_to_utc",
"(",
"kwargs",
"[",
"'from_date'",
"]",
")",
".",
"timestamp",
"(",
")",
"questions_groups",
"=",
"self",
".",
"client",
".",
"get... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Askbot._init_client | Init client | perceval/backends/core/askbot.py | def _init_client(self, from_archive=False):
"""Init client"""
return AskbotClient(self.url, self.archive, from_archive) | def _init_client(self, from_archive=False):
"""Init client"""
return AskbotClient(self.url, self.archive, from_archive) | [
"Init",
"client"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L159-L162 | [
"def",
"_init_client",
"(",
"self",
",",
"from_archive",
"=",
"False",
")",
":",
"return",
"AskbotClient",
"(",
"self",
".",
"url",
",",
"self",
".",
"archive",
",",
"from_archive",
")"
] | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Askbot.__fetch_question | Fetch an Askbot HTML question body.
The method fetchs the HTML question retrieving the
question body of the item question received
:param question: item with the question itself
:returns: a list of HTML page/s for the question | perceval/backends/core/askbot.py | def __fetch_question(self, question):
"""Fetch an Askbot HTML question body.
The method fetchs the HTML question retrieving the
question body of the item question received
:param question: item with the question itself
:returns: a list of HTML page/s for the question
"... | def __fetch_question(self, question):
"""Fetch an Askbot HTML question body.
The method fetchs the HTML question retrieving the
question body of the item question received
:param question: item with the question itself
:returns: a list of HTML page/s for the question
"... | [
"Fetch",
"an",
"Askbot",
"HTML",
"question",
"body",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L164-L193 | [
"def",
"__fetch_question",
"(",
"self",
",",
"question",
")",
":",
"html_question_items",
"=",
"[",
"]",
"npages",
"=",
"1",
"next_request",
"=",
"True",
"while",
"next_request",
":",
"try",
":",
"html_question",
"=",
"self",
".",
"client",
".",
"get_html_qu... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Askbot.__fetch_comments | Fetch all the comments of an Askbot question and answers.
The method fetchs the list of every comment existing in a question and
its answers.
:param question: item with the question itself
:returns: a list of comments with the ids as hashes | perceval/backends/core/askbot.py | def __fetch_comments(self, question):
"""Fetch all the comments of an Askbot question and answers.
The method fetchs the list of every comment existing in a question and
its answers.
:param question: item with the question itself
:returns: a list of comments with the ids as ha... | def __fetch_comments(self, question):
"""Fetch all the comments of an Askbot question and answers.
The method fetchs the list of every comment existing in a question and
its answers.
:param question: item with the question itself
:returns: a list of comments with the ids as ha... | [
"Fetch",
"all",
"the",
"comments",
"of",
"an",
"Askbot",
"question",
"and",
"answers",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L195-L209 | [
"def",
"__fetch_comments",
"(",
"self",
",",
"question",
")",
":",
"comments",
"=",
"{",
"}",
"comments",
"[",
"question",
"[",
"'id'",
"]",
"]",
"=",
"json",
".",
"loads",
"(",
"self",
".",
"client",
".",
"get_comments",
"(",
"question",
"[",
"'id'",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Askbot.__build_question | Build an Askbot HTML response.
The method puts together all the information regarding a question
:param html_question: array of HTML raw pages
:param question: question object from the API
:param comments: list of comments to add
:returns: a dict item with the parsed question ... | perceval/backends/core/askbot.py | def __build_question(html_question, question, comments):
"""Build an Askbot HTML response.
The method puts together all the information regarding a question
:param html_question: array of HTML raw pages
:param question: question object from the API
:param comments: list of comm... | def __build_question(html_question, question, comments):
"""Build an Askbot HTML response.
The method puts together all the information regarding a question
:param html_question: array of HTML raw pages
:param question: question object from the API
:param comments: list of comm... | [
"Build",
"an",
"Askbot",
"HTML",
"response",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L212-L243 | [
"def",
"__build_question",
"(",
"html_question",
",",
"question",
",",
"comments",
")",
":",
"question_object",
"=",
"{",
"}",
"# Parse the user info from the soup container",
"question_container",
"=",
"AskbotParser",
".",
"parse_question_container",
"(",
"html_question",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | AskbotClient.get_api_questions | Retrieve a question page using the API.
:param page: page to retrieve | perceval/backends/core/askbot.py | def get_api_questions(self, path):
"""Retrieve a question page using the API.
:param page: page to retrieve
"""
npages = 1
next_request = True
path = urijoin(self.base_url, path)
while next_request:
try:
params = {
... | def get_api_questions(self, path):
"""Retrieve a question page using the API.
:param page: page to retrieve
"""
npages = 1
next_request = True
path = urijoin(self.base_url, path)
while next_request:
try:
params = {
... | [
"Retrieve",
"a",
"question",
"page",
"using",
"the",
"API",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L270-L305 | [
"def",
"get_api_questions",
"(",
"self",
",",
"path",
")",
":",
"npages",
"=",
"1",
"next_request",
"=",
"True",
"path",
"=",
"urijoin",
"(",
"self",
".",
"base_url",
",",
"path",
")",
"while",
"next_request",
":",
"try",
":",
"params",
"=",
"{",
"'pag... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | AskbotClient.get_html_question | Retrieve a raw HTML question and all it's information.
:param question_id: question identifier
:param page: page to retrieve | perceval/backends/core/askbot.py | def get_html_question(self, question_id, page=1):
"""Retrieve a raw HTML question and all it's information.
:param question_id: question identifier
:param page: page to retrieve
"""
path = urijoin(self.base_url, self.HTML_QUESTION, question_id)
params = {
'pa... | def get_html_question(self, question_id, page=1):
"""Retrieve a raw HTML question and all it's information.
:param question_id: question identifier
:param page: page to retrieve
"""
path = urijoin(self.base_url, self.HTML_QUESTION, question_id)
params = {
'pa... | [
"Retrieve",
"a",
"raw",
"HTML",
"question",
"and",
"all",
"it",
"s",
"information",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L307-L320 | [
"def",
"get_html_question",
"(",
"self",
",",
"question_id",
",",
"page",
"=",
"1",
")",
":",
"path",
"=",
"urijoin",
"(",
"self",
".",
"base_url",
",",
"self",
".",
"HTML_QUESTION",
",",
"question_id",
")",
"params",
"=",
"{",
"'page'",
":",
"page",
"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | AskbotClient.get_comments | Retrieve a list of comments by a given id.
:param object_id: object identifiere | perceval/backends/core/askbot.py | def get_comments(self, post_id):
"""Retrieve a list of comments by a given id.
:param object_id: object identifiere
"""
path = urijoin(self.base_url, self.COMMENTS if self._use_new_urls else self.COMMENTS_OLD)
params = {
'post_id': post_id,
'post_type': '... | def get_comments(self, post_id):
"""Retrieve a list of comments by a given id.
:param object_id: object identifiere
"""
path = urijoin(self.base_url, self.COMMENTS if self._use_new_urls else self.COMMENTS_OLD)
params = {
'post_id': post_id,
'post_type': '... | [
"Retrieve",
"a",
"list",
"of",
"comments",
"by",
"a",
"given",
"id",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L322-L351 | [
"def",
"get_comments",
"(",
"self",
",",
"post_id",
")",
":",
"path",
"=",
"urijoin",
"(",
"self",
".",
"base_url",
",",
"self",
".",
"COMMENTS",
"if",
"self",
".",
"_use_new_urls",
"else",
"self",
".",
"COMMENTS_OLD",
")",
"params",
"=",
"{",
"'post_id'... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | AskbotParser.parse_question_container | Parse the question info container of a given HTML question.
The method parses the information available in the question information
container. The container can have up to 2 elements: the first one
contains the information related with the user who generated the question
and the date (i... | perceval/backends/core/askbot.py | def parse_question_container(html_question):
"""Parse the question info container of a given HTML question.
The method parses the information available in the question information
container. The container can have up to 2 elements: the first one
contains the information related with the... | def parse_question_container(html_question):
"""Parse the question info container of a given HTML question.
The method parses the information available in the question information
container. The container can have up to 2 elements: the first one
contains the information related with the... | [
"Parse",
"the",
"question",
"info",
"container",
"of",
"a",
"given",
"HTML",
"question",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L362-L390 | [
"def",
"parse_question_container",
"(",
"html_question",
")",
":",
"container_info",
"=",
"{",
"}",
"bs_question",
"=",
"bs4",
".",
"BeautifulSoup",
"(",
"html_question",
",",
"\"html.parser\"",
")",
"question",
"=",
"AskbotParser",
".",
"_find_question_container",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | AskbotParser.parse_answers | Parse the answers of a given HTML question.
The method parses the answers related with a given HTML question,
as well as all the comments related to the answer.
:param html_question: raw HTML question element
:returns: a list with the answers | perceval/backends/core/askbot.py | def parse_answers(html_question):
"""Parse the answers of a given HTML question.
The method parses the answers related with a given HTML question,
as well as all the comments related to the answer.
:param html_question: raw HTML question element
:returns: a list with the answe... | def parse_answers(html_question):
"""Parse the answers of a given HTML question.
The method parses the answers related with a given HTML question,
as well as all the comments related to the answer.
:param html_question: raw HTML question element
:returns: a list with the answe... | [
"Parse",
"the",
"answers",
"of",
"a",
"given",
"HTML",
"question",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L393-L462 | [
"def",
"parse_answers",
"(",
"html_question",
")",
":",
"def",
"parse_answer_container",
"(",
"update_info",
")",
":",
"\"\"\"Parse the answer info container of a given HTML question.\n\n The method parses the information available in the answer information\n container.... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | AskbotParser.parse_number_of_html_pages | Parse number of answer pages to paginate over them.
:param html_question: raw HTML question element
:returns: an integer with the number of pages | perceval/backends/core/askbot.py | def parse_number_of_html_pages(html_question):
"""Parse number of answer pages to paginate over them.
:param html_question: raw HTML question element
:returns: an integer with the number of pages
"""
bs_question = bs4.BeautifulSoup(html_question, "html.parser")
try:
... | def parse_number_of_html_pages(html_question):
"""Parse number of answer pages to paginate over them.
:param html_question: raw HTML question element
:returns: an integer with the number of pages
"""
bs_question = bs4.BeautifulSoup(html_question, "html.parser")
try:
... | [
"Parse",
"number",
"of",
"answer",
"pages",
"to",
"paginate",
"over",
"them",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L465-L478 | [
"def",
"parse_number_of_html_pages",
"(",
"html_question",
")",
":",
"bs_question",
"=",
"bs4",
".",
"BeautifulSoup",
"(",
"html_question",
",",
"\"html.parser\"",
")",
"try",
":",
"bs_question",
".",
"select",
"(",
"'div.paginator'",
")",
"[",
"0",
"]",
"except... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | AskbotParser.parse_user_info | Parse the user information of a given HTML container.
The method parses all the available user information in the container.
If the class "user-info" exists, the method will get all the available
information in the container. If not, if a class "tip" exists, it will be
a wiki post with ... | perceval/backends/core/askbot.py | def parse_user_info(update_info):
"""Parse the user information of a given HTML container.
The method parses all the available user information in the container.
If the class "user-info" exists, the method will get all the available
information in the container. If not, if a class "tip"... | def parse_user_info(update_info):
"""Parse the user information of a given HTML container.
The method parses all the available user information in the container.
If the class "user-info" exists, the method will get all the available
information in the container. If not, if a class "tip"... | [
"Parse",
"the",
"user",
"information",
"of",
"a",
"given",
"HTML",
"container",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/askbot.py#L481-L513 | [
"def",
"parse_user_info",
"(",
"update_info",
")",
":",
"user_info",
"=",
"{",
"}",
"if",
"update_info",
".",
"select",
"(",
"\"div.user-info\"",
")",
":",
"# Get all the <a> elements in the container. First <a> contains the user",
"# information, second one (if exists), the we... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Gerrit.fetch_items | Fetch the reviews
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items | perceval/backends/core/gerrit.py | def fetch_items(self, category, **kwargs):
"""Fetch the reviews
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
if self.client.version[0] == 2 and self.client.ve... | def fetch_items(self, category, **kwargs):
"""Fetch the reviews
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
if self.client.version[0] == 2 and self.client.ve... | [
"Fetch",
"the",
"reviews"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L102-L118 | [
"def",
"fetch_items",
"(",
"self",
",",
"category",
",",
"*",
"*",
"kwargs",
")",
":",
"from_date",
"=",
"kwargs",
"[",
"'from_date'",
"]",
"if",
"self",
".",
"client",
".",
"version",
"[",
"0",
"]",
"==",
"2",
"and",
"self",
".",
"client",
".",
"v... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Gerrit.parse_reviews | Parse a Gerrit reviews list. | perceval/backends/core/gerrit.py | def parse_reviews(raw_data):
"""Parse a Gerrit reviews list."""
# Join isolated reviews in JSON in array for parsing
items_raw = "[" + raw_data.replace("\n", ",") + "]"
items_raw = items_raw.replace(",]", "]")
items = json.loads(items_raw)
reviews = []
for item ... | def parse_reviews(raw_data):
"""Parse a Gerrit reviews list."""
# Join isolated reviews in JSON in array for parsing
items_raw = "[" + raw_data.replace("\n", ",") + "]"
items_raw = items_raw.replace(",]", "]")
items = json.loads(items_raw)
reviews = []
for item ... | [
"Parse",
"a",
"Gerrit",
"reviews",
"list",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L165-L178 | [
"def",
"parse_reviews",
"(",
"raw_data",
")",
":",
"# Join isolated reviews in JSON in array for parsing",
"items_raw",
"=",
"\"[\"",
"+",
"raw_data",
".",
"replace",
"(",
"\"\\n\"",
",",
"\",\"",
")",
"+",
"\"]\"",
"items_raw",
"=",
"items_raw",
".",
"replace",
"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Gerrit._fetch_gerrit28 | Specific fetch for gerrit 2.8 version.
Get open and closed reviews in different queries.
Take the newer review from both lists and iterate. | perceval/backends/core/gerrit.py | def _fetch_gerrit28(self, from_date=DEFAULT_DATETIME):
""" Specific fetch for gerrit 2.8 version.
Get open and closed reviews in different queries.
Take the newer review from both lists and iterate.
"""
# Convert date to Unix time
from_ut = datetime_to_utc(from_date)
... | def _fetch_gerrit28(self, from_date=DEFAULT_DATETIME):
""" Specific fetch for gerrit 2.8 version.
Get open and closed reviews in different queries.
Take the newer review from both lists and iterate.
"""
# Convert date to Unix time
from_ut = datetime_to_utc(from_date)
... | [
"Specific",
"fetch",
"for",
"gerrit",
"2",
".",
"8",
"version",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L186-L236 | [
"def",
"_fetch_gerrit28",
"(",
"self",
",",
"from_date",
"=",
"DEFAULT_DATETIME",
")",
":",
"# Convert date to Unix time",
"from_ut",
"=",
"datetime_to_utc",
"(",
"from_date",
")",
"from_ut",
"=",
"from_ut",
".",
"timestamp",
"(",
")",
"filter_open",
"=",
"\"statu... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GerritClient.version | Return the Gerrit server version. | perceval/backends/core/gerrit.py | def version(self):
"""Return the Gerrit server version."""
if self._version:
return self._version
cmd = self.gerrit_cmd + " %s " % (GerritClient.CMD_VERSION)
logger.debug("Getting version: %s" % (cmd))
raw_data = self.__execute(cmd)
raw_data = str(raw_data,... | def version(self):
"""Return the Gerrit server version."""
if self._version:
return self._version
cmd = self.gerrit_cmd + " %s " % (GerritClient.CMD_VERSION)
logger.debug("Getting version: %s" % (cmd))
raw_data = self.__execute(cmd)
raw_data = str(raw_data,... | [
"Return",
"the",
"Gerrit",
"server",
"version",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L327-L355 | [
"def",
"version",
"(",
"self",
")",
":",
"if",
"self",
".",
"_version",
":",
"return",
"self",
".",
"_version",
"cmd",
"=",
"self",
".",
"gerrit_cmd",
"+",
"\" %s \"",
"%",
"(",
"GerritClient",
".",
"CMD_VERSION",
")",
"logger",
".",
"debug",
"(",
"\"G... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GerritClient.reviews | Get the reviews starting from last_item. | perceval/backends/core/gerrit.py | def reviews(self, last_item, filter_=None):
"""Get the reviews starting from last_item."""
cmd = self._get_gerrit_cmd(last_item, filter_)
logger.debug("Getting reviews with command: %s", cmd)
raw_data = self.__execute(cmd)
raw_data = str(raw_data, "UTF-8")
return raw_d... | def reviews(self, last_item, filter_=None):
"""Get the reviews starting from last_item."""
cmd = self._get_gerrit_cmd(last_item, filter_)
logger.debug("Getting reviews with command: %s", cmd)
raw_data = self.__execute(cmd)
raw_data = str(raw_data, "UTF-8")
return raw_d... | [
"Get",
"the",
"reviews",
"starting",
"from",
"last_item",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L357-L366 | [
"def",
"reviews",
"(",
"self",
",",
"last_item",
",",
"filter_",
"=",
"None",
")",
":",
"cmd",
"=",
"self",
".",
"_get_gerrit_cmd",
"(",
"last_item",
",",
"filter_",
")",
"logger",
".",
"debug",
"(",
"\"Getting reviews with command: %s\"",
",",
"cmd",
")",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GerritClient.next_retrieve_group_item | Return the item to start from in next reviews group. | perceval/backends/core/gerrit.py | def next_retrieve_group_item(self, last_item=None, entry=None):
"""Return the item to start from in next reviews group."""
next_item = None
gerrit_version = self.version
if gerrit_version[0] == 2 and gerrit_version[1] > 9:
if last_item is None:
next_item = ... | def next_retrieve_group_item(self, last_item=None, entry=None):
"""Return the item to start from in next reviews group."""
next_item = None
gerrit_version = self.version
if gerrit_version[0] == 2 and gerrit_version[1] > 9:
if last_item is None:
next_item = ... | [
"Return",
"the",
"item",
"to",
"start",
"from",
"in",
"next",
"reviews",
"group",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L368-L388 | [
"def",
"next_retrieve_group_item",
"(",
"self",
",",
"last_item",
"=",
"None",
",",
"entry",
"=",
"None",
")",
":",
"next_item",
"=",
"None",
"gerrit_version",
"=",
"self",
".",
"version",
"if",
"gerrit_version",
"[",
"0",
"]",
"==",
"2",
"and",
"gerrit_ve... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GerritClient.__execute | Execute gerrit command | perceval/backends/core/gerrit.py | def __execute(self, cmd):
"""Execute gerrit command"""
if self.from_archive:
response = self.__execute_from_archive(cmd)
else:
response = self.__execute_from_remote(cmd)
return response | def __execute(self, cmd):
"""Execute gerrit command"""
if self.from_archive:
response = self.__execute_from_archive(cmd)
else:
response = self.__execute_from_remote(cmd)
return response | [
"Execute",
"gerrit",
"command"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L403-L411 | [
"def",
"__execute",
"(",
"self",
",",
"cmd",
")",
":",
"if",
"self",
".",
"from_archive",
":",
"response",
"=",
"self",
".",
"__execute_from_archive",
"(",
"cmd",
")",
"else",
":",
"response",
"=",
"self",
".",
"__execute_from_remote",
"(",
"cmd",
")",
"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GerritClient.__execute_from_archive | Execute gerrit command against the archive | perceval/backends/core/gerrit.py | def __execute_from_archive(self, cmd):
"""Execute gerrit command against the archive"""
cmd = self.sanitize_for_archive(cmd)
response = self.archive.retrieve(cmd, None, None)
if isinstance(response, RuntimeError):
raise response
return response | def __execute_from_archive(self, cmd):
"""Execute gerrit command against the archive"""
cmd = self.sanitize_for_archive(cmd)
response = self.archive.retrieve(cmd, None, None)
if isinstance(response, RuntimeError):
raise response
return response | [
"Execute",
"gerrit",
"command",
"against",
"the",
"archive"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L413-L422 | [
"def",
"__execute_from_archive",
"(",
"self",
",",
"cmd",
")",
":",
"cmd",
"=",
"self",
".",
"sanitize_for_archive",
"(",
"cmd",
")",
"response",
"=",
"self",
".",
"archive",
".",
"retrieve",
"(",
"cmd",
",",
"None",
",",
"None",
")",
"if",
"isinstance",... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GerritClient.__execute_from_remote | Execute gerrit command with retry if it fails | perceval/backends/core/gerrit.py | def __execute_from_remote(self, cmd):
"""Execute gerrit command with retry if it fails"""
result = None # data result from the cmd execution
retries = 0
while retries < self.MAX_RETRIES:
try:
result = subprocess.check_output(cmd, shell=True)
... | def __execute_from_remote(self, cmd):
"""Execute gerrit command with retry if it fails"""
result = None # data result from the cmd execution
retries = 0
while retries < self.MAX_RETRIES:
try:
result = subprocess.check_output(cmd, shell=True)
... | [
"Execute",
"gerrit",
"command",
"with",
"retry",
"if",
"it",
"fails"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L424-L449 | [
"def",
"__execute_from_remote",
"(",
"self",
",",
"cmd",
")",
":",
"result",
"=",
"None",
"# data result from the cmd execution",
"retries",
"=",
"0",
"while",
"retries",
"<",
"self",
".",
"MAX_RETRIES",
":",
"try",
":",
"result",
"=",
"subprocess",
".",
"chec... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GerritCommand.setup_cmd_parser | Returns the Gerrit argument parser. | perceval/backends/core/gerrit.py | def setup_cmd_parser(cls):
"""Returns the Gerrit argument parser."""
parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
from_date=True,
archive=True)
# Gerrit options
group = parser.p... | def setup_cmd_parser(cls):
"""Returns the Gerrit argument parser."""
parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
from_date=True,
archive=True)
# Gerrit options
group = parser.p... | [
"Returns",
"the",
"Gerrit",
"argument",
"parser",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/gerrit.py#L495-L522 | [
"def",
"setup_cmd_parser",
"(",
"cls",
")",
":",
"parser",
"=",
"BackendCommandArgumentParser",
"(",
"cls",
".",
"BACKEND",
".",
"CATEGORIES",
",",
"from_date",
"=",
"True",
",",
"archive",
"=",
"True",
")",
"# Gerrit options",
"group",
"=",
"parser",
".",
"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Launchpad.fetch_items | Fetch the issues
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items | perceval/backends/core/launchpad.py | def fetch_items(self, category, **kwargs):
"""Fetch the issues
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
logger.info("Fetching issues of '%s' distribution ... | def fetch_items(self, category, **kwargs):
"""Fetch the issues
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
logger.info("Fetching issues of '%s' distribution ... | [
"Fetch",
"the",
"issues"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L102-L121 | [
"def",
"fetch_items",
"(",
"self",
",",
"category",
",",
"*",
"*",
"kwargs",
")",
":",
"from_date",
"=",
"kwargs",
"[",
"'from_date'",
"]",
"logger",
".",
"info",
"(",
"\"Fetching issues of '%s' distribution from %s\"",
",",
"self",
".",
"distribution",
",",
"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Launchpad._init_client | Init client | perceval/backends/core/launchpad.py | def _init_client(self, from_archive=False):
"""Init client"""
return LaunchpadClient(self.distribution, self.package, self.items_per_page,
self.sleep_time, self.archive, from_archive) | def _init_client(self, from_archive=False):
"""Init client"""
return LaunchpadClient(self.distribution, self.package, self.items_per_page,
self.sleep_time, self.archive, from_archive) | [
"Init",
"client"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L172-L176 | [
"def",
"_init_client",
"(",
"self",
",",
"from_archive",
"=",
"False",
")",
":",
"return",
"LaunchpadClient",
"(",
"self",
".",
"distribution",
",",
"self",
".",
"package",
",",
"self",
".",
"items_per_page",
",",
"self",
".",
"sleep_time",
",",
"self",
".... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Launchpad._fetch_issues | Fetch the issues from a project (distribution/package) | perceval/backends/core/launchpad.py | def _fetch_issues(self, from_date):
"""Fetch the issues from a project (distribution/package)"""
issues_groups = self.client.issues(start=from_date)
for raw_issues in issues_groups:
issues = json.loads(raw_issues)['entries']
for issue in issues:
issue =... | def _fetch_issues(self, from_date):
"""Fetch the issues from a project (distribution/package)"""
issues_groups = self.client.issues(start=from_date)
for raw_issues in issues_groups:
issues = json.loads(raw_issues)['entries']
for issue in issues:
issue =... | [
"Fetch",
"the",
"issues",
"from",
"a",
"project",
"(",
"distribution",
"/",
"package",
")"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L192-L219 | [
"def",
"_fetch_issues",
"(",
"self",
",",
"from_date",
")",
":",
"issues_groups",
"=",
"self",
".",
"client",
".",
"issues",
"(",
"start",
"=",
"from_date",
")",
"for",
"raw_issues",
"in",
"issues_groups",
":",
"issues",
"=",
"json",
".",
"loads",
"(",
"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Launchpad.__fetch_issue_data | Get data associated to an issue | perceval/backends/core/launchpad.py | def __fetch_issue_data(self, issue_id):
"""Get data associated to an issue"""
raw_issue = self.client.issue(issue_id)
issue = json.loads(raw_issue)
return issue | def __fetch_issue_data(self, issue_id):
"""Get data associated to an issue"""
raw_issue = self.client.issue(issue_id)
issue = json.loads(raw_issue)
return issue | [
"Get",
"data",
"associated",
"to",
"an",
"issue"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L221-L227 | [
"def",
"__fetch_issue_data",
"(",
"self",
",",
"issue_id",
")",
":",
"raw_issue",
"=",
"self",
".",
"client",
".",
"issue",
"(",
"issue_id",
")",
"issue",
"=",
"json",
".",
"loads",
"(",
"raw_issue",
")",
"return",
"issue"
] | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Launchpad.__fetch_issue_attachments | Get attachments of an issue | perceval/backends/core/launchpad.py | def __fetch_issue_attachments(self, issue_id):
"""Get attachments of an issue"""
for attachments_raw in self.client.issue_collection(issue_id, "attachments"):
attachments = json.loads(attachments_raw)
for attachment in attachments['entries']:
yield attachment | def __fetch_issue_attachments(self, issue_id):
"""Get attachments of an issue"""
for attachments_raw in self.client.issue_collection(issue_id, "attachments"):
attachments = json.loads(attachments_raw)
for attachment in attachments['entries']:
yield attachment | [
"Get",
"attachments",
"of",
"an",
"issue"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L229-L236 | [
"def",
"__fetch_issue_attachments",
"(",
"self",
",",
"issue_id",
")",
":",
"for",
"attachments_raw",
"in",
"self",
".",
"client",
".",
"issue_collection",
"(",
"issue_id",
",",
"\"attachments\"",
")",
":",
"attachments",
"=",
"json",
".",
"loads",
"(",
"attac... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Launchpad.__fetch_issue_messages | Get messages of an issue | perceval/backends/core/launchpad.py | def __fetch_issue_messages(self, issue_id):
"""Get messages of an issue"""
for messages_raw in self.client.issue_collection(issue_id, "messages"):
messages = json.loads(messages_raw)
for msg in messages['entries']:
msg['owner_data'] = self.__fetch_user_data('{OW... | def __fetch_issue_messages(self, issue_id):
"""Get messages of an issue"""
for messages_raw in self.client.issue_collection(issue_id, "messages"):
messages = json.loads(messages_raw)
for msg in messages['entries']:
msg['owner_data'] = self.__fetch_user_data('{OW... | [
"Get",
"messages",
"of",
"an",
"issue"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L238-L246 | [
"def",
"__fetch_issue_messages",
"(",
"self",
",",
"issue_id",
")",
":",
"for",
"messages_raw",
"in",
"self",
".",
"client",
".",
"issue_collection",
"(",
"issue_id",
",",
"\"messages\"",
")",
":",
"messages",
"=",
"json",
".",
"loads",
"(",
"messages_raw",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Launchpad.__fetch_issue_activities | Get activities on an issue | perceval/backends/core/launchpad.py | def __fetch_issue_activities(self, issue_id):
"""Get activities on an issue"""
for activities_raw in self.client.issue_collection(issue_id, "activity"):
activities = json.loads(activities_raw)
for act in activities['entries']:
act['person_data'] = self.__fetch_u... | def __fetch_issue_activities(self, issue_id):
"""Get activities on an issue"""
for activities_raw in self.client.issue_collection(issue_id, "activity"):
activities = json.loads(activities_raw)
for act in activities['entries']:
act['person_data'] = self.__fetch_u... | [
"Get",
"activities",
"on",
"an",
"issue"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L248-L256 | [
"def",
"__fetch_issue_activities",
"(",
"self",
",",
"issue_id",
")",
":",
"for",
"activities_raw",
"in",
"self",
".",
"client",
".",
"issue_collection",
"(",
"issue_id",
",",
"\"activity\"",
")",
":",
"activities",
"=",
"json",
".",
"loads",
"(",
"activities_... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Launchpad.__fetch_user_data | Get data associated to an user | perceval/backends/core/launchpad.py | def __fetch_user_data(self, tag_type, user_link):
"""Get data associated to an user"""
user_name = self.client.user_name(user_link)
user = {}
if not user_name:
return user
user_raw = self.client.user(user_name)
user = json.loads(user_raw)
return u... | def __fetch_user_data(self, tag_type, user_link):
"""Get data associated to an user"""
user_name = self.client.user_name(user_link)
user = {}
if not user_name:
return user
user_raw = self.client.user(user_name)
user = json.loads(user_raw)
return u... | [
"Get",
"data",
"associated",
"to",
"an",
"user"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L258-L271 | [
"def",
"__fetch_user_data",
"(",
"self",
",",
"tag_type",
",",
"user_link",
")",
":",
"user_name",
"=",
"self",
".",
"client",
".",
"user_name",
"(",
"user_link",
")",
"user",
"=",
"{",
"}",
"if",
"not",
"user_name",
":",
"return",
"user",
"user_raw",
"=... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | LaunchpadClient.issues | Get the issues from pagination | perceval/backends/core/launchpad.py | def issues(self, start=None):
"""Get the issues from pagination"""
payload = self.__build_payload(size=self.items_per_page, operation=True, startdate=start)
path = self.__get_url_project()
return self.__fetch_items(path=path, payload=payload) | def issues(self, start=None):
"""Get the issues from pagination"""
payload = self.__build_payload(size=self.items_per_page, operation=True, startdate=start)
path = self.__get_url_project()
return self.__fetch_items(path=path, payload=payload) | [
"Get",
"the",
"issues",
"from",
"pagination"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L300-L305 | [
"def",
"issues",
"(",
"self",
",",
"start",
"=",
"None",
")",
":",
"payload",
"=",
"self",
".",
"__build_payload",
"(",
"size",
"=",
"self",
".",
"items_per_page",
",",
"operation",
"=",
"True",
",",
"startdate",
"=",
"start",
")",
"path",
"=",
"self",... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | LaunchpadClient.user | Get the user data by URL | perceval/backends/core/launchpad.py | def user(self, user_name):
"""Get the user data by URL"""
user = None
if user_name in self._users:
return self._users[user_name]
url_user = self.__get_url("~" + user_name)
logger.info("Getting info for %s" % (url_user))
try:
raw_user = self.__... | def user(self, user_name):
"""Get the user data by URL"""
user = None
if user_name in self._users:
return self._users[user_name]
url_user = self.__get_url("~" + user_name)
logger.info("Getting info for %s" % (url_user))
try:
raw_user = self.__... | [
"Get",
"the",
"user",
"data",
"by",
"URL"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L307-L331 | [
"def",
"user",
"(",
"self",
",",
"user_name",
")",
":",
"user",
"=",
"None",
"if",
"user_name",
"in",
"self",
".",
"_users",
":",
"return",
"self",
".",
"_users",
"[",
"user_name",
"]",
"url_user",
"=",
"self",
".",
"__get_url",
"(",
"\"~\"",
"+",
"u... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | LaunchpadClient.issue | Get the issue data by its ID | perceval/backends/core/launchpad.py | def issue(self, issue_id):
"""Get the issue data by its ID"""
path = urijoin("bugs", str(issue_id))
url_issue = self.__get_url(path)
raw_text = self.__send_request(url_issue)
return raw_text | def issue(self, issue_id):
"""Get the issue data by its ID"""
path = urijoin("bugs", str(issue_id))
url_issue = self.__get_url(path)
raw_text = self.__send_request(url_issue)
return raw_text | [
"Get",
"the",
"issue",
"data",
"by",
"its",
"ID"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L338-L345 | [
"def",
"issue",
"(",
"self",
",",
"issue_id",
")",
":",
"path",
"=",
"urijoin",
"(",
"\"bugs\"",
",",
"str",
"(",
"issue_id",
")",
")",
"url_issue",
"=",
"self",
".",
"__get_url",
"(",
"path",
")",
"raw_text",
"=",
"self",
".",
"__send_request",
"(",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | LaunchpadClient.issue_collection | Get a collection list of a given issue | perceval/backends/core/launchpad.py | def issue_collection(self, issue_id, collection_name):
"""Get a collection list of a given issue"""
path = urijoin("bugs", str(issue_id), collection_name)
url_collection = self.__get_url(path)
payload = {'ws.size': self.items_per_page, 'ws.start': 0, 'order_by': 'date_last_updated'}
... | def issue_collection(self, issue_id, collection_name):
"""Get a collection list of a given issue"""
path = urijoin("bugs", str(issue_id), collection_name)
url_collection = self.__get_url(path)
payload = {'ws.size': self.items_per_page, 'ws.start': 0, 'order_by': 'date_last_updated'}
... | [
"Get",
"a",
"collection",
"list",
"of",
"a",
"given",
"issue"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L347-L356 | [
"def",
"issue_collection",
"(",
"self",
",",
"issue_id",
",",
"collection_name",
")",
":",
"path",
"=",
"urijoin",
"(",
"\"bugs\"",
",",
"str",
"(",
"issue_id",
")",
",",
"collection_name",
")",
"url_collection",
"=",
"self",
".",
"__get_url",
"(",
"path",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | LaunchpadClient.__get_url_project | Build URL project | perceval/backends/core/launchpad.py | def __get_url_project(self):
"""Build URL project"""
if self.package:
url = self.__get_url_distribution_package()
else:
url = self.__get_url_distribution()
return url | def __get_url_project(self):
"""Build URL project"""
if self.package:
url = self.__get_url_distribution_package()
else:
url = self.__get_url_distribution()
return url | [
"Build",
"URL",
"project"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L358-L366 | [
"def",
"__get_url_project",
"(",
"self",
")",
":",
"if",
"self",
".",
"package",
":",
"url",
"=",
"self",
".",
"__get_url_distribution_package",
"(",
")",
"else",
":",
"url",
"=",
"self",
".",
"__get_url_distribution",
"(",
")",
"return",
"url"
] | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | LaunchpadClient.__send_request | Send request | perceval/backends/core/launchpad.py | def __send_request(self, url, params=None):
"""Send request"""
r = self.fetch(url, payload=params)
return r.text | def __send_request(self, url, params=None):
"""Send request"""
r = self.fetch(url, payload=params)
return r.text | [
"Send",
"request"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L390-L394 | [
"def",
"__send_request",
"(",
"self",
",",
"url",
",",
"params",
"=",
"None",
")",
":",
"r",
"=",
"self",
".",
"fetch",
"(",
"url",
",",
"payload",
"=",
"params",
")",
"return",
"r",
".",
"text"
] | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | LaunchpadClient.__build_payload | Build payload | perceval/backends/core/launchpad.py | def __build_payload(self, size, operation=False, startdate=None):
"""Build payload"""
payload = {
'ws.size': size,
'order_by': 'date_last_updated',
'omit_duplicates': 'false',
'status': ["New", "Incomplete", "Opinion", "Invalid", "Won't Fix",
... | def __build_payload(self, size, operation=False, startdate=None):
"""Build payload"""
payload = {
'ws.size': size,
'order_by': 'date_last_updated',
'omit_duplicates': 'false',
'status': ["New", "Incomplete", "Opinion", "Invalid", "Won't Fix",
... | [
"Build",
"payload"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L396-L416 | [
"def",
"__build_payload",
"(",
"self",
",",
"size",
",",
"operation",
"=",
"False",
",",
"startdate",
"=",
"None",
")",
":",
"payload",
"=",
"{",
"'ws.size'",
":",
"size",
",",
"'order_by'",
":",
"'date_last_updated'",
",",
"'omit_duplicates'",
":",
"'false'... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | LaunchpadClient.__fetch_items | Return the items from Launchpad API using pagination | perceval/backends/core/launchpad.py | def __fetch_items(self, path, payload):
"""Return the items from Launchpad API using pagination"""
page = 0 # current page
url_next = path
fetch_data = True
while fetch_data:
logger.debug("Fetching page: %i", page)
try:
raw_content = se... | def __fetch_items(self, path, payload):
"""Return the items from Launchpad API using pagination"""
page = 0 # current page
url_next = path
fetch_data = True
while fetch_data:
logger.debug("Fetching page: %i", page)
try:
raw_content = se... | [
"Return",
"the",
"items",
"from",
"Launchpad",
"API",
"using",
"pagination"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/launchpad.py#L418-L446 | [
"def",
"__fetch_items",
"(",
"self",
",",
"path",
",",
"payload",
")",
":",
"page",
"=",
"0",
"# current page",
"url_next",
"=",
"path",
"fetch_data",
"=",
"True",
"while",
"fetch_data",
":",
"logger",
".",
"debug",
"(",
"\"Fetching page: %i\"",
",",
"page",... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Groupsio.fetch_items | Fetch the messages
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items | perceval/backends/core/groupsio.py | def fetch_items(self, category, **kwargs):
"""Fetch the messages
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
logger.info("Looking for messages from '%s' sinc... | def fetch_items(self, category, **kwargs):
"""Fetch the messages
:param category: the category of items to fetch
:param kwargs: backend arguments
:returns: a generator of items
"""
from_date = kwargs['from_date']
logger.info("Looking for messages from '%s' sinc... | [
"Fetch",
"the",
"messages"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/groupsio.py#L89-L111 | [
"def",
"fetch_items",
"(",
"self",
",",
"category",
",",
"*",
"*",
"kwargs",
")",
":",
"from_date",
"=",
"kwargs",
"[",
"'from_date'",
"]",
"logger",
".",
"info",
"(",
"\"Looking for messages from '%s' since %s\"",
",",
"self",
".",
"uri",
",",
"str",
"(",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GroupsioClient.fetch | Fetch the mbox files from the remote archiver.
Stores the archives in the path given during the initialization
of this object. Those archives which a not valid extension will
be ignored.
Groups.io archives are returned as a .zip file, which contains
one file in mbox format.
... | perceval/backends/core/groupsio.py | def fetch(self):
"""Fetch the mbox files from the remote archiver.
Stores the archives in the path given during the initialization
of this object. Those archives which a not valid extension will
be ignored.
Groups.io archives are returned as a .zip file, which contains
... | def fetch(self):
"""Fetch the mbox files from the remote archiver.
Stores the archives in the path given during the initialization
of this object. Those archives which a not valid extension will
be ignored.
Groups.io archives are returned as a .zip file, which contains
... | [
"Fetch",
"the",
"mbox",
"files",
"from",
"the",
"remote",
"archiver",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/groupsio.py#L154-L180 | [
"def",
"fetch",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"\"Downloading mboxes from '%s'\"",
",",
"self",
".",
"uri",
")",
"logger",
".",
"debug",
"(",
"\"Storing mboxes in '%s'\"",
",",
"self",
".",
"dirpath",
")",
"if",
"not",
"os",
".",
"path"... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GroupsioClient.subscriptions | Fetch the groupsio paginated subscriptions for a given token
:param per_page: number of subscriptions per page
:returns: an iterator of subscriptions | perceval/backends/core/groupsio.py | def subscriptions(self, per_page=PER_PAGE):
"""Fetch the groupsio paginated subscriptions for a given token
:param per_page: number of subscriptions per page
:returns: an iterator of subscriptions
"""
url = urijoin(GROUPSIO_API_URL, self.GET_SUBSCRIPTIONS)
logger.debug(... | def subscriptions(self, per_page=PER_PAGE):
"""Fetch the groupsio paginated subscriptions for a given token
:param per_page: number of subscriptions per page
:returns: an iterator of subscriptions
"""
url = urijoin(GROUPSIO_API_URL, self.GET_SUBSCRIPTIONS)
logger.debug(... | [
"Fetch",
"the",
"groupsio",
"paginated",
"subscriptions",
"for",
"a",
"given",
"token"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/groupsio.py#L182-L207 | [
"def",
"subscriptions",
"(",
"self",
",",
"per_page",
"=",
"PER_PAGE",
")",
":",
"url",
"=",
"urijoin",
"(",
"GROUPSIO_API_URL",
",",
"self",
".",
"GET_SUBSCRIPTIONS",
")",
"logger",
".",
"debug",
"(",
"\"Get groupsio paginated subscriptions from \"",
"+",
"url",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GroupsioClient.__find_group_id | Find the id of a group given its name by iterating on the list of subscriptions | perceval/backends/core/groupsio.py | def __find_group_id(self):
"""Find the id of a group given its name by iterating on the list of subscriptions"""
group_subscriptions = self.subscriptions(self.auth)
for subscriptions in group_subscriptions:
for sub in subscriptions:
if sub['group_name'] == self.grou... | def __find_group_id(self):
"""Find the id of a group given its name by iterating on the list of subscriptions"""
group_subscriptions = self.subscriptions(self.auth)
for subscriptions in group_subscriptions:
for sub in subscriptions:
if sub['group_name'] == self.grou... | [
"Find",
"the",
"id",
"of",
"a",
"group",
"given",
"its",
"name",
"by",
"iterating",
"on",
"the",
"list",
"of",
"subscriptions"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/groupsio.py#L229-L240 | [
"def",
"__find_group_id",
"(",
"self",
")",
":",
"group_subscriptions",
"=",
"self",
".",
"subscriptions",
"(",
"self",
".",
"auth",
")",
"for",
"subscriptions",
"in",
"group_subscriptions",
":",
"for",
"sub",
"in",
"subscriptions",
":",
"if",
"sub",
"[",
"'... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GroupsioClient.__fetch | Fetch requests from groupsio API | perceval/backends/core/groupsio.py | def __fetch(self, url, payload):
"""Fetch requests from groupsio API"""
r = requests.get(url, params=payload, auth=self.auth, verify=self.verify)
try:
r.raise_for_status()
except requests.exceptions.HTTPError as e:
raise e
return r | def __fetch(self, url, payload):
"""Fetch requests from groupsio API"""
r = requests.get(url, params=payload, auth=self.auth, verify=self.verify)
try:
r.raise_for_status()
except requests.exceptions.HTTPError as e:
raise e
return r | [
"Fetch",
"requests",
"from",
"groupsio",
"API"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/groupsio.py#L242-L251 | [
"def",
"__fetch",
"(",
"self",
",",
"url",
",",
"payload",
")",
":",
"r",
"=",
"requests",
".",
"get",
"(",
"url",
",",
"params",
"=",
"payload",
",",
"auth",
"=",
"self",
".",
"auth",
",",
"verify",
"=",
"self",
".",
"verify",
")",
"try",
":",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GroupsioCommand._pre_init | Initialize mailing lists directory path | perceval/backends/core/groupsio.py | def _pre_init(self):
"""Initialize mailing lists directory path"""
if not self.parsed_args.mboxes_path:
base_path = os.path.expanduser('~/.perceval/mailinglists/')
dirpath = os.path.join(base_path, GROUPSIO_URL, 'g', self.parsed_args.group_name)
else:
dirpath... | def _pre_init(self):
"""Initialize mailing lists directory path"""
if not self.parsed_args.mboxes_path:
base_path = os.path.expanduser('~/.perceval/mailinglists/')
dirpath = os.path.join(base_path, GROUPSIO_URL, 'g', self.parsed_args.group_name)
else:
dirpath... | [
"Initialize",
"mailing",
"lists",
"directory",
"path"
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/groupsio.py#L259-L268 | [
"def",
"_pre_init",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"parsed_args",
".",
"mboxes_path",
":",
"base_path",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"'~/.perceval/mailinglists/'",
")",
"dirpath",
"=",
"os",
".",
"path",
".",
"join",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | GroupsioCommand.setup_cmd_parser | Returns the Groupsio argument parser. | perceval/backends/core/groupsio.py | def setup_cmd_parser(cls):
"""Returns the Groupsio argument parser."""
parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
from_date=True,
token_auth=True)
# Backend token is required
... | def setup_cmd_parser(cls):
"""Returns the Groupsio argument parser."""
parser = BackendCommandArgumentParser(cls.BACKEND.CATEGORIES,
from_date=True,
token_auth=True)
# Backend token is required
... | [
"Returns",
"the",
"Groupsio",
"argument",
"parser",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backends/core/groupsio.py#L271-L294 | [
"def",
"setup_cmd_parser",
"(",
"cls",
")",
":",
"parser",
"=",
"BackendCommandArgumentParser",
"(",
"cls",
".",
"BACKEND",
".",
"CATEGORIES",
",",
"from_date",
"=",
"True",
",",
"token_auth",
"=",
"True",
")",
"# Backend token is required",
"action",
"=",
"pars... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | uuid | Generate a UUID based on the given parameters.
The UUID will be the SHA1 of the concatenation of the values
from the list. The separator bewteedn these values is ':'.
Each value must be a non-empty string, otherwise, the function
will raise an exception.
:param *args: list of arguments used to gen... | perceval/backend.py | def uuid(*args):
"""Generate a UUID based on the given parameters.
The UUID will be the SHA1 of the concatenation of the values
from the list. The separator bewteedn these values is ':'.
Each value must be a non-empty string, otherwise, the function
will raise an exception.
:param *args: list ... | def uuid(*args):
"""Generate a UUID based on the given parameters.
The UUID will be the SHA1 of the concatenation of the values
from the list. The separator bewteedn these values is ':'.
Each value must be a non-empty string, otherwise, the function
will raise an exception.
:param *args: list ... | [
"Generate",
"a",
"UUID",
"based",
"on",
"the",
"given",
"parameters",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backend.py#L514-L542 | [
"def",
"uuid",
"(",
"*",
"args",
")",
":",
"def",
"check_value",
"(",
"v",
")",
":",
"if",
"not",
"isinstance",
"(",
"v",
",",
"str",
")",
":",
"raise",
"ValueError",
"(",
"\"%s value is not a string instance\"",
"%",
"str",
"(",
"v",
")",
")",
"elif",... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | fetch | Fetch items using the given backend.
Generator to get items using the given backend class. When
an archive manager is given, this function will store
the fetched items in an `Archive`. If an exception is raised,
this archive will be removed to avoid corrupted archives.
The parameters needed to ini... | perceval/backend.py | def fetch(backend_class, backend_args, category, filter_classified=False,
manager=None):
"""Fetch items using the given backend.
Generator to get items using the given backend class. When
an archive manager is given, this function will store
the fetched items in an `Archive`. If an exception ... | def fetch(backend_class, backend_args, category, filter_classified=False,
manager=None):
"""Fetch items using the given backend.
Generator to get items using the given backend class. When
an archive manager is given, this function will store
the fetched items in an `Archive`. If an exception ... | [
"Fetch",
"items",
"using",
"the",
"given",
"backend",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backend.py#L545-L589 | [
"def",
"fetch",
"(",
"backend_class",
",",
"backend_args",
",",
"category",
",",
"filter_classified",
"=",
"False",
",",
"manager",
"=",
"None",
")",
":",
"init_args",
"=",
"find_signature_parameters",
"(",
"backend_class",
".",
"__init__",
",",
"backend_args",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | fetch_from_archive | Fetch items from an archive manager.
Generator to get the items of a category (previously fetched
by the given backend class) from an archive manager. Only those
items archived after the given date will be returned.
The parameters needed to initialize `backend` and get the
items are given using `b... | perceval/backend.py | def fetch_from_archive(backend_class, backend_args, manager,
category, archived_after):
"""Fetch items from an archive manager.
Generator to get the items of a category (previously fetched
by the given backend class) from an archive manager. Only those
items archived after the gi... | def fetch_from_archive(backend_class, backend_args, manager,
category, archived_after):
"""Fetch items from an archive manager.
Generator to get the items of a category (previously fetched
by the given backend class) from an archive manager. Only those
items archived after the gi... | [
"Fetch",
"items",
"from",
"an",
"archive",
"manager",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backend.py#L592-L628 | [
"def",
"fetch_from_archive",
"(",
"backend_class",
",",
"backend_args",
",",
"manager",
",",
"category",
",",
"archived_after",
")",
":",
"init_args",
"=",
"find_signature_parameters",
"(",
"backend_class",
".",
"__init__",
",",
"backend_args",
")",
"backend",
"=",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | find_backends | Find available backends.
Look for the Perceval backends and commands under `top_package`
and its sub-packages. When `top_package` defines a namespace,
backends under that same namespace will be found too.
:param top_package: package storing backends
:returns: a tuple with two dicts: one with `Bac... | perceval/backend.py | def find_backends(top_package):
"""Find available backends.
Look for the Perceval backends and commands under `top_package`
and its sub-packages. When `top_package` defines a namespace,
backends under that same namespace will be found too.
:param top_package: package storing backends
:returns... | def find_backends(top_package):
"""Find available backends.
Look for the Perceval backends and commands under `top_package`
and its sub-packages. When `top_package` defines a namespace,
backends under that same namespace will be found too.
:param top_package: package storing backends
:returns... | [
"Find",
"available",
"backends",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backend.py#L631-L648 | [
"def",
"find_backends",
"(",
"top_package",
")",
":",
"candidates",
"=",
"pkgutil",
".",
"walk_packages",
"(",
"top_package",
".",
"__path__",
",",
"prefix",
"=",
"top_package",
".",
"__name__",
"+",
"'.'",
")",
"modules",
"=",
"[",
"name",
"for",
"_",
","... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Backend.fetch | Fetch items from the repository.
The method retrieves items from a repository.
To removed classified fields from the resulting items, set
the parameter `filter_classified`. Take into account this
parameter is incompatible with archiving items. Raw client
data are archived befor... | perceval/backend.py | def fetch(self, category, filter_classified=False, **kwargs):
"""Fetch items from the repository.
The method retrieves items from a repository.
To removed classified fields from the resulting items, set
the parameter `filter_classified`. Take into account this
parameter is inco... | def fetch(self, category, filter_classified=False, **kwargs):
"""Fetch items from the repository.
The method retrieves items from a repository.
To removed classified fields from the resulting items, set
the parameter `filter_classified`. Take into account this
parameter is inco... | [
"Fetch",
"items",
"from",
"the",
"repository",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backend.py#L124-L166 | [
"def",
"fetch",
"(",
"self",
",",
"category",
",",
"filter_classified",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"category",
"not",
"in",
"self",
".",
"categories",
":",
"cause",
"=",
"\"%s category not valid for %s\"",
"%",
"(",
"category",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Backend.fetch_from_archive | Fetch the questions from an archive.
It returns the items stored within an archive. If this method is called but
no archive was provided, the method will raise a `ArchiveError` exception.
:returns: a generator of items
:raises ArchiveError: raised when an error occurs accessing an arc... | perceval/backend.py | def fetch_from_archive(self):
"""Fetch the questions from an archive.
It returns the items stored within an archive. If this method is called but
no archive was provided, the method will raise a `ArchiveError` exception.
:returns: a generator of items
:raises ArchiveError: rai... | def fetch_from_archive(self):
"""Fetch the questions from an archive.
It returns the items stored within an archive. If this method is called but
no archive was provided, the method will raise a `ArchiveError` exception.
:returns: a generator of items
:raises ArchiveError: rai... | [
"Fetch",
"the",
"questions",
"from",
"an",
"archive",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backend.py#L168-L184 | [
"def",
"fetch_from_archive",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"archive",
":",
"raise",
"ArchiveError",
"(",
"cause",
"=",
"\"archive instance was not provided\"",
")",
"self",
".",
"client",
"=",
"self",
".",
"_init_client",
"(",
"from_archive",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
test | Backend.filter_classified_data | Remove classified or confidential data from an item.
It removes those fields that contain data considered as classified.
Classified fields are defined in `CLASSIFIED_FIELDS` class attribute.
:param item: fields will be removed from this item
:returns: the same item but with confidenti... | perceval/backend.py | def filter_classified_data(self, item):
"""Remove classified or confidential data from an item.
It removes those fields that contain data considered as classified.
Classified fields are defined in `CLASSIFIED_FIELDS` class attribute.
:param item: fields will be removed from this item
... | def filter_classified_data(self, item):
"""Remove classified or confidential data from an item.
It removes those fields that contain data considered as classified.
Classified fields are defined in `CLASSIFIED_FIELDS` class attribute.
:param item: fields will be removed from this item
... | [
"Remove",
"classified",
"or",
"confidential",
"data",
"from",
"an",
"item",
"."
] | chaoss/grimoirelab-perceval | python | https://github.com/chaoss/grimoirelab-perceval/blob/41c908605e88b7ebc3a536c643fa0f212eaf9e0e/perceval/backend.py#L186-L209 | [
"def",
"filter_classified_data",
"(",
"self",
",",
"item",
")",
":",
"item_uuid",
"=",
"uuid",
"(",
"self",
".",
"origin",
",",
"self",
".",
"metadata_id",
"(",
"item",
")",
")",
"logger",
".",
"debug",
"(",
"\"Filtering classified data for item %s\"",
",",
... | 41c908605e88b7ebc3a536c643fa0f212eaf9e0e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.