partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | Bitbucket.set_tag | Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param repository:
:param tag_name:
:param commit_revision: commit has... | atlassian/bitbucket.py | def set_tag(self, project, repository, tag_name, commit_revision, description=None):
"""
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:para... | def set_tag(self, project, repository, tag_name, commit_revision, description=None):
"""
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:para... | [
"Creates",
"a",
"tag",
"using",
"the",
"information",
"provided",
"in",
"the",
"{"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L515-L535 | [
"def",
"set_tag",
"(",
"self",
",",
"project",
",",
"repository",
",",
"tag_name",
",",
"commit_revision",
",",
"description",
"=",
"None",
")",
":",
"url",
"=",
"'rest/api/1.0/projects/{project}/repos/{repository}/tags'",
".",
"format",
"(",
"project",
"=",
"proj... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.delete_tag | Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param repository:
:param tag_name:
:return: | atlassian/bitbucket.py | def delete_tag(self, project, repository, tag_name):
"""
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param reposi... | def delete_tag(self, project, repository, tag_name):
"""
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param reposi... | [
"Creates",
"a",
"tag",
"using",
"the",
"information",
"provided",
"in",
"the",
"{"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L537-L549 | [
"def",
"delete_tag",
"(",
"self",
",",
"project",
",",
"repository",
",",
"tag_name",
")",
":",
"url",
"=",
"'rest/git/1.0/projects/{project}/repos/{repository}/tags/{tag}'",
".",
"format",
"(",
"project",
"=",
"project",
",",
"repository",
"=",
"repository",
",",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.get_commits | Get commit list from repo
:param project:
:param repository:
:param hash_oldest:
:param hash_newest:
:param limit: OPTIONAL: The limit of the number of commits to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:retu... | atlassian/bitbucket.py | def get_commits(self, project, repository, hash_oldest, hash_newest, limit=99999):
"""
Get commit list from repo
:param project:
:param repository:
:param hash_oldest:
:param hash_newest:
:param limit: OPTIONAL: The limit of the number of commits to return, this m... | def get_commits(self, project, repository, hash_oldest, hash_newest, limit=99999):
"""
Get commit list from repo
:param project:
:param repository:
:param hash_oldest:
:param hash_newest:
:param limit: OPTIONAL: The limit of the number of commits to return, this m... | [
"Get",
"commit",
"list",
"from",
"repo",
":",
"param",
"project",
":",
":",
"param",
"repository",
":",
":",
"param",
"hash_oldest",
":",
":",
"param",
"hash_newest",
":",
":",
"param",
"limit",
":",
"OPTIONAL",
":",
"The",
"limit",
"of",
"the",
"number"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L562-L582 | [
"def",
"get_commits",
"(",
"self",
",",
"project",
",",
"repository",
",",
"hash_oldest",
",",
"hash_newest",
",",
"limit",
"=",
"99999",
")",
":",
"url",
"=",
"'rest/api/1.0/projects/{project}/repos/{repository}/commits'",
".",
"format",
"(",
"project",
"=",
"pro... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.get_commit_info | Retrieve a single commit identified by its ID>. In general, that ID is a SHA1.
From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
... | atlassian/bitbucket.py | def get_commit_info(self, project, repository, commit, path=None):
"""
Retrieve a single commit identified by its ID>. In general, that ID is a SHA1.
From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permissi... | def get_commit_info(self, project, repository, commit, path=None):
"""
Retrieve a single commit identified by its ID>. In general, that ID is a SHA1.
From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permissi... | [
"Retrieve",
"a",
"single",
"commit",
"identified",
"by",
"its",
"ID",
">",
".",
"In",
"general",
"that",
"ID",
"is",
"a",
"SHA1",
".",
"From",
"2",
".",
"11",
"ref",
"names",
"like",
"refs",
"/",
"heads",
"/",
"master",
"are",
"no",
"longer",
"accept... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L584-L604 | [
"def",
"get_commit_info",
"(",
"self",
",",
"project",
",",
"repository",
",",
"commit",
",",
"path",
"=",
"None",
")",
":",
"url",
"=",
"'rest/api/1.0/projects/{project}/repos/{repository}/commits/{commitId}'",
".",
"format",
"(",
"project",
"=",
"project",
",",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.get_changelog | Get change log between 2 refs
:param project:
:param repository:
:param ref_from:
:param ref_to:
:param limit: OPTIONAL: The limit of the number of changes to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:return: | atlassian/bitbucket.py | def get_changelog(self, project, repository, ref_from, ref_to, limit=99999):
"""
Get change log between 2 refs
:param project:
:param repository:
:param ref_from:
:param ref_to:
:param limit: OPTIONAL: The limit of the number of changes to return, this may be rest... | def get_changelog(self, project, repository, ref_from, ref_to, limit=99999):
"""
Get change log between 2 refs
:param project:
:param repository:
:param ref_from:
:param ref_to:
:param limit: OPTIONAL: The limit of the number of changes to return, this may be rest... | [
"Get",
"change",
"log",
"between",
"2",
"refs",
":",
"param",
"project",
":",
":",
"param",
"repository",
":",
":",
"param",
"ref_from",
":",
":",
"param",
"ref_to",
":",
":",
"param",
"limit",
":",
"OPTIONAL",
":",
"The",
"limit",
"of",
"the",
"number... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L613-L633 | [
"def",
"get_changelog",
"(",
"self",
",",
"project",
",",
"repository",
",",
"ref_from",
",",
"ref_to",
",",
"limit",
"=",
"99999",
")",
":",
"url",
"=",
"'rest/api/1.0/projects/{project}/repos/{repository}/compare/commits'",
".",
"format",
"(",
"project",
"=",
"p... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.get_file_list | Retrieve a page of files from particular directory of a repository.
The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param pr... | atlassian/bitbucket.py | def get_file_list(self, project, repository, query, limit=100000):
"""
Retrieve a page of files from particular directory of a repository.
The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REP... | def get_file_list(self, project, repository, query, limit=100000):
"""
Retrieve a page of files from particular directory of a repository.
The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REP... | [
"Retrieve",
"a",
"page",
"of",
"files",
"from",
"particular",
"directory",
"of",
"a",
"repository",
".",
"The",
"search",
"is",
"done",
"recursively",
"so",
"all",
"files",
"from",
"any",
"sub",
"-",
"directory",
"of",
"the",
"specified",
"directory",
"will"... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L635-L654 | [
"def",
"get_file_list",
"(",
"self",
",",
"project",
",",
"repository",
",",
"query",
",",
"limit",
"=",
"100000",
")",
":",
"url",
"=",
"'rest/api/1.0/projects/{project}/repos/{repository}/files'",
".",
"format",
"(",
"project",
"=",
"project",
",",
"repository",... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.get_content_of_file | Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
:param repository:
:param filename:
:param at: OPTIONAL ref string
:param markup: i... | atlassian/bitbucket.py | def get_content_of_file(self, project, repository, filename, at=None, markup=None):
"""
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
:par... | def get_content_of_file(self, project, repository, filename, at=None, markup=None):
"""
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
:par... | [
"Retrieve",
"the",
"raw",
"content",
"for",
"a",
"file",
"path",
"at",
"a",
"specified",
"revision",
".",
"The",
"authenticated",
"user",
"must",
"have",
"REPO_READ",
"permission",
"for",
"the",
"specified",
"repository",
"to",
"call",
"this",
"resource",
".",... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L656-L678 | [
"def",
"get_content_of_file",
"(",
"self",
",",
"project",
",",
"repository",
",",
"filename",
",",
"at",
"=",
"None",
",",
"markup",
"=",
"None",
")",
":",
"headers",
"=",
"self",
".",
"form_token_headers",
"url",
"=",
"'projects/{project}/repos/{repository}/ra... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.get_branches_permissions | Get branches permissions from a given repo
:param project:
:param repository:
:param limit:
:return: | atlassian/bitbucket.py | def get_branches_permissions(self, project, repository, limit=25):
"""
Get branches permissions from a given repo
:param project:
:param repository:
:param limit:
:return:
"""
url = 'rest/branch-permissions/2.0/projects/{project}/repos/{repository}/restric... | def get_branches_permissions(self, project, repository, limit=25):
"""
Get branches permissions from a given repo
:param project:
:param repository:
:param limit:
:return:
"""
url = 'rest/branch-permissions/2.0/projects/{project}/repos/{repository}/restric... | [
"Get",
"branches",
"permissions",
"from",
"a",
"given",
"repo",
":",
"param",
"project",
":",
":",
"param",
"repository",
":",
":",
"param",
"limit",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L680-L693 | [
"def",
"get_branches_permissions",
"(",
"self",
",",
"project",
",",
"repository",
",",
"limit",
"=",
"25",
")",
":",
"url",
"=",
"'rest/branch-permissions/2.0/projects/{project}/repos/{repository}/restrictions'",
".",
"format",
"(",
"project",
"=",
"project",
",",
"r... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.reindex_repo_dev_panel | Reindex all of the Jira issues related to this repository, including branches and pull requests.
This automatically happens as part of an upgrade, and calling this manually should only be required
if something unforeseen happens and the index becomes out of sync.
The authenticated user must have... | atlassian/bitbucket.py | def reindex_repo_dev_panel(self, project, repository):
"""
Reindex all of the Jira issues related to this repository, including branches and pull requests.
This automatically happens as part of an upgrade, and calling this manually should only be required
if something unforeseen happens ... | def reindex_repo_dev_panel(self, project, repository):
"""
Reindex all of the Jira issues related to this repository, including branches and pull requests.
This automatically happens as part of an upgrade, and calling this manually should only be required
if something unforeseen happens ... | [
"Reindex",
"all",
"of",
"the",
"Jira",
"issues",
"related",
"to",
"this",
"repository",
"including",
"branches",
"and",
"pull",
"requests",
".",
"This",
"automatically",
"happens",
"as",
"part",
"of",
"an",
"upgrade",
"and",
"calling",
"this",
"manually",
"sho... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L714-L726 | [
"def",
"reindex_repo_dev_panel",
"(",
"self",
",",
"project",
",",
"repository",
")",
":",
"url",
"=",
"'rest/jira-dev/1.0/projects/{projectKey}/repos/{repositorySlug}/reindex'",
".",
"format",
"(",
"projectKey",
"=",
"project",
",",
"repositorySlug",
"=",
"repository",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.fork_repository | Forks a repository within the same project.
:param project:
:param repository:
:param new_repository:
:return: | atlassian/bitbucket.py | def fork_repository(self, project, repository, new_repository):
"""
Forks a repository within the same project.
:param project:
:param repository:
:param new_repository:
:return:
"""
url = 'rest/api/1.0/projects/{project}/repos/{repository}'.format(project... | def fork_repository(self, project, repository, new_repository):
"""
Forks a repository within the same project.
:param project:
:param repository:
:param new_repository:
:return:
"""
url = 'rest/api/1.0/projects/{project}/repos/{repository}'.format(project... | [
"Forks",
"a",
"repository",
"within",
"the",
"same",
"project",
".",
":",
"param",
"project",
":",
":",
"param",
"repository",
":",
":",
"param",
"new_repository",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L736-L751 | [
"def",
"fork_repository",
"(",
"self",
",",
"project",
",",
"repository",
",",
"new_repository",
")",
":",
"url",
"=",
"'rest/api/1.0/projects/{project}/repos/{repository}'",
".",
"format",
"(",
"project",
"=",
"project",
",",
"repository",
"=",
"repository",
")",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.get_branching_model | Get branching model
:param project:
:param repository:
:return: | atlassian/bitbucket.py | def get_branching_model(self, project, repository):
"""
Get branching model
:param project:
:param repository:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
project=project,
... | def get_branching_model(self, project, repository):
"""
Get branching model
:param project:
:param repository:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
project=project,
... | [
"Get",
"branching",
"model",
":",
"param",
"project",
":",
":",
"param",
"repository",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L813-L823 | [
"def",
"get_branching_model",
"(",
"self",
",",
"project",
",",
"repository",
")",
":",
"url",
"=",
"'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'",
".",
"format",
"(",
"project",
"=",
"project",
",",
"repository",
"=",
"repositor... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.set_branching_model | Set branching model
:param project:
:param repository:
:param data:
:return: | atlassian/bitbucket.py | def set_branching_model(self, project, repository, data):
"""
Set branching model
:param project:
:param repository:
:param data:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
... | def set_branching_model(self, project, repository, data):
"""
Set branching model
:param project:
:param repository:
:param data:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
... | [
"Set",
"branching",
"model",
":",
"param",
"project",
":",
":",
"param",
"repository",
":",
":",
"param",
"data",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L825-L836 | [
"def",
"set_branching_model",
"(",
"self",
",",
"project",
",",
"repository",
",",
"data",
")",
":",
"url",
"=",
"'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'",
".",
"format",
"(",
"project",
"=",
"project",
",",
"repository",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.enable_branching_model | Enable branching model by setting it with default configuration
:param project:
:param repository:
:return: | atlassian/bitbucket.py | def enable_branching_model(self, project, repository):
"""
Enable branching model by setting it with default configuration
:param project:
:param repository:
:return:
"""
default_model_data = {'development': {'refId': None, 'useDefault': True},
... | def enable_branching_model(self, project, repository):
"""
Enable branching model by setting it with default configuration
:param project:
:param repository:
:return:
"""
default_model_data = {'development': {'refId': None, 'useDefault': True},
... | [
"Enable",
"branching",
"model",
"by",
"setting",
"it",
"with",
"default",
"configuration",
":",
"param",
"project",
":",
":",
"param",
"repository",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L838-L864 | [
"def",
"enable_branching_model",
"(",
"self",
",",
"project",
",",
"repository",
")",
":",
"default_model_data",
"=",
"{",
"'development'",
":",
"{",
"'refId'",
":",
"None",
",",
"'useDefault'",
":",
"True",
"}",
",",
"'types'",
":",
"[",
"{",
"'displayName'... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | Bitbucket.disable_branching_model | Disable branching model
:param project:
:param repository:
:return: | atlassian/bitbucket.py | def disable_branching_model(self, project, repository):
"""
Disable branching model
:param project:
:param repository:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
project=project,
... | def disable_branching_model(self, project, repository):
"""
Disable branching model
:param project:
:param repository:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'.format(
project=project,
... | [
"Disable",
"branching",
"model",
":",
"param",
"project",
":",
":",
"param",
"repository",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/bitbucket.py#L866-L876 | [
"def",
"disable_branching_model",
"(",
"self",
",",
"project",
",",
"repository",
")",
":",
"url",
"=",
"'rest/branch-utils/1.0/projects/{project}/repos/{repository}/branchmodel/configuration'",
".",
"format",
"(",
"project",
"=",
"project",
",",
"repository",
"=",
"repos... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | AtlassianRestAPI.get | Get request based on the python-requests module. You can override headers, and also, get not json response
:param path:
:param data:
:param flags:
:param params:
:param headers:
:param not_json_response: OPTIONAL: For get content from raw requests packet
:return: | atlassian/rest_client.py | def get(self, path, data=None, flags=None, params=None, headers=None, not_json_response=None):
"""
Get request based on the python-requests module. You can override headers, and also, get not json response
:param path:
:param data:
:param flags:
:param params:
:pa... | def get(self, path, data=None, flags=None, params=None, headers=None, not_json_response=None):
"""
Get request based on the python-requests module. You can override headers, and also, get not json response
:param path:
:param data:
:param flags:
:param params:
:pa... | [
"Get",
"request",
"based",
"on",
"the",
"python",
"-",
"requests",
"module",
".",
"You",
"can",
"override",
"headers",
"and",
"also",
"get",
"not",
"json",
"response",
":",
"param",
"path",
":",
":",
"param",
"data",
":",
":",
"param",
"flags",
":",
":... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/rest_client.py#L125-L144 | [
"def",
"get",
"(",
"self",
",",
"path",
",",
"data",
"=",
"None",
",",
"flags",
"=",
"None",
",",
"params",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"not_json_response",
"=",
"None",
")",
":",
"answer",
"=",
"self",
".",
"request",
"(",
"'GET... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | AtlassianRestAPI.delete | Deletes resources at given paths.
:rtype: dict
:return: Empty dictionary to have consistent interface.
Some of Atlassian REST resources don't return any content. | atlassian/rest_client.py | def delete(self, path, data=None, headers=None, params=None):
"""
Deletes resources at given paths.
:rtype: dict
:return: Empty dictionary to have consistent interface.
Some of Atlassian REST resources don't return any content.
"""
self.request('DELETE', path=path... | def delete(self, path, data=None, headers=None, params=None):
"""
Deletes resources at given paths.
:rtype: dict
:return: Empty dictionary to have consistent interface.
Some of Atlassian REST resources don't return any content.
"""
self.request('DELETE', path=path... | [
"Deletes",
"resources",
"at",
"given",
"paths",
".",
":",
"rtype",
":",
"dict",
":",
"return",
":",
"Empty",
"dictionary",
"to",
"have",
"consistent",
"interface",
".",
"Some",
"of",
"Atlassian",
"REST",
"resources",
"don",
"t",
"return",
"any",
"content",
... | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/atlassian/rest_client.py#L160-L167 | [
"def",
"delete",
"(",
"self",
",",
"path",
",",
"data",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"self",
".",
"request",
"(",
"'DELETE'",
",",
"path",
"=",
"path",
",",
"data",
"=",
"data",
",",
"headers",
"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | check_unknown_attachment_in_space | Detect errors in space
:param confluence:
:param space_key:
:return: | examples/confluence-check-unknown-attachment-error.py | def check_unknown_attachment_in_space(confluence, space_key):
"""
Detect errors in space
:param confluence:
:param space_key:
:return:
"""
page_ids = get_all_pages_ids(confluence, space_key)
print("Start review pages {} in {}".format(len(page_ids), space_key))
for page_id in... | def check_unknown_attachment_in_space(confluence, space_key):
"""
Detect errors in space
:param confluence:
:param space_key:
:return:
"""
page_ids = get_all_pages_ids(confluence, space_key)
print("Start review pages {} in {}".format(len(page_ids), space_key))
for page_id in... | [
"Detect",
"errors",
"in",
"space",
":",
"param",
"confluence",
":",
":",
"param",
"space_key",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/examples/confluence-check-unknown-attachment-error.py#L32-L44 | [
"def",
"check_unknown_attachment_in_space",
"(",
"confluence",
",",
"space_key",
")",
":",
"page_ids",
"=",
"get_all_pages_ids",
"(",
"confluence",
",",
"space_key",
")",
"print",
"(",
"\"Start review pages {} in {}\"",
".",
"format",
"(",
"len",
"(",
"page_ids",
")... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | search_word | Get all found pages with order by created date
:param confluence:
:param word:
:return: json answer | examples/confluence-search-cql.py | def search_word(confluence, word):
"""
Get all found pages with order by created date
:param confluence:
:param word:
:return: json answer
"""
cql = "siteSearch ~ {} order by created".format(word)
answers = confluence.cql(cql)
for answer in answers.get('results'):
p... | def search_word(confluence, word):
"""
Get all found pages with order by created date
:param confluence:
:param word:
:return: json answer
"""
cql = "siteSearch ~ {} order by created".format(word)
answers = confluence.cql(cql)
for answer in answers.get('results'):
p... | [
"Get",
"all",
"found",
"pages",
"with",
"order",
"by",
"created",
"date",
":",
"param",
"confluence",
":",
":",
"param",
"word",
":",
":",
"return",
":",
"json",
"answer"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/examples/confluence-search-cql.py#L16-L26 | [
"def",
"search_word",
"(",
"confluence",
",",
"word",
")",
":",
"cql",
"=",
"\"siteSearch ~ {} order by created\"",
".",
"format",
"(",
"word",
")",
"answers",
"=",
"confluence",
".",
"cql",
"(",
"cql",
")",
"for",
"answer",
"in",
"answers",
".",
"get",
"(... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | search_word_in_space | Get all found pages with order by created date
:param confluence:
:param space
:param word:
:return: json answer | examples/confluence-search-cql.py | def search_word_in_space(confluence, space, word):
"""
Get all found pages with order by created date
:param confluence:
:param space
:param word:
:return: json answer
"""
cql = "space.key={} and (text ~ {})".format(space, word)
answers = confluence.cql(cql, expand='space,bo... | def search_word_in_space(confluence, space, word):
"""
Get all found pages with order by created date
:param confluence:
:param space
:param word:
:return: json answer
"""
cql = "space.key={} and (text ~ {})".format(space, word)
answers = confluence.cql(cql, expand='space,bo... | [
"Get",
"all",
"found",
"pages",
"with",
"order",
"by",
"created",
"date",
":",
"param",
"confluence",
":",
":",
"param",
"space",
":",
"param",
"word",
":",
":",
"return",
":",
"json",
"answer"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/examples/confluence-search-cql.py#L29-L40 | [
"def",
"search_word_in_space",
"(",
"confluence",
",",
"space",
",",
"word",
")",
":",
"cql",
"=",
"\"space.key={} and (text ~ {})\"",
".",
"format",
"(",
"space",
",",
"word",
")",
"answers",
"=",
"confluence",
".",
"cql",
"(",
"cql",
",",
"expand",
"=",
... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | clean_pages_from_space | Remove all pages from trash for related space
:param limit:
:param confluence:
:param space_key:
:return: | examples/confluence-trash-cleaner.py | def clean_pages_from_space(confluence, space_key, limit=500):
"""
Remove all pages from trash for related space
:param limit:
:param confluence:
:param space_key:
:return:
"""
flag = True
while flag:
values = confluence.get_all_pages_from_space_trash(space=space_key, start=0,... | def clean_pages_from_space(confluence, space_key, limit=500):
"""
Remove all pages from trash for related space
:param limit:
:param confluence:
:param space_key:
:return:
"""
flag = True
while flag:
values = confluence.get_all_pages_from_space_trash(space=space_key, start=0,... | [
"Remove",
"all",
"pages",
"from",
"trash",
"for",
"related",
"space",
":",
"param",
"limit",
":",
":",
"param",
"confluence",
":",
":",
"param",
"space_key",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/examples/confluence-trash-cleaner.py#L12-L30 | [
"def",
"clean_pages_from_space",
"(",
"confluence",
",",
"space_key",
",",
"limit",
"=",
"500",
")",
":",
"flag",
"=",
"True",
"while",
"flag",
":",
"values",
"=",
"confluence",
".",
"get_all_pages_from_space_trash",
"(",
"space",
"=",
"space_key",
",",
"start... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | clean_all_trash_pages_from_all_spaces | Main function for retrieve space keys and provide space for cleaner
:param confluence:
:return: | examples/confluence-trash-cleaner.py | def clean_all_trash_pages_from_all_spaces(confluence):
"""
Main function for retrieve space keys and provide space for cleaner
:param confluence:
:return:
"""
limit = 50
flag = True
i = 0
while flag:
space_lists = confluence.get_all_spaces(start=i * limit, limit=limit)
... | def clean_all_trash_pages_from_all_spaces(confluence):
"""
Main function for retrieve space keys and provide space for cleaner
:param confluence:
:return:
"""
limit = 50
flag = True
i = 0
while flag:
space_lists = confluence.get_all_spaces(start=i * limit, limit=limit)
... | [
"Main",
"function",
"for",
"retrieve",
"space",
"keys",
"and",
"provide",
"space",
"for",
"cleaner",
":",
"param",
"confluence",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/examples/confluence-trash-cleaner.py#L33-L51 | [
"def",
"clean_all_trash_pages_from_all_spaces",
"(",
"confluence",
")",
":",
"limit",
"=",
"50",
"flag",
"=",
"True",
"i",
"=",
"0",
"while",
"flag",
":",
"space_lists",
"=",
"confluence",
".",
"get_all_spaces",
"(",
"start",
"=",
"i",
"*",
"limit",
",",
"... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | get_all_page_ids_from_space | :param confluence:
:param space_key:
:return: | examples/confluence-page-versions-cleaner.py | def get_all_page_ids_from_space(confluence, space_key):
"""
:param confluence:
:param space_key:
:return:
"""
limit = 500
flag = True
step = 0
page_ids = []
while flag:
values = confluence.get_all_pages_from_space(space=space_key, start=limit * step, limit=limit)
... | def get_all_page_ids_from_space(confluence, space_key):
"""
:param confluence:
:param space_key:
:return:
"""
limit = 500
flag = True
step = 0
page_ids = []
while flag:
values = confluence.get_all_pages_from_space(space=space_key, start=limit * step, limit=limit)
... | [
":",
"param",
"confluence",
":",
":",
"param",
"space_key",
":",
":",
"return",
":"
] | atlassian-api/atlassian-python-api | python | https://github.com/atlassian-api/atlassian-python-api/blob/540d269905c3e7547b666fe30c647b2d512cf358/examples/confluence-page-versions-cleaner.py#L22-L44 | [
"def",
"get_all_page_ids_from_space",
"(",
"confluence",
",",
"space_key",
")",
":",
"limit",
"=",
"500",
"flag",
"=",
"True",
"step",
"=",
"0",
"page_ids",
"=",
"[",
"]",
"while",
"flag",
":",
"values",
"=",
"confluence",
".",
"get_all_pages_from_space",
"(... | 540d269905c3e7547b666fe30c647b2d512cf358 |
train | SpamCheck.threshold | Threshold used to determine if your content qualifies as spam.
On a scale from 1 to 10, with 10 being most strict, or most likely to
be considered as spam.
:param value: Threshold used to determine if your content qualifies as
spam.
On a scale from 1 ... | sendgrid/helpers/mail/spam_check.py | def threshold(self, value):
"""Threshold used to determine if your content qualifies as spam.
On a scale from 1 to 10, with 10 being most strict, or most likely to
be considered as spam.
:param value: Threshold used to determine if your content qualifies as
spam.
... | def threshold(self, value):
"""Threshold used to determine if your content qualifies as spam.
On a scale from 1 to 10, with 10 being most strict, or most likely to
be considered as spam.
:param value: Threshold used to determine if your content qualifies as
spam.
... | [
"Threshold",
"used",
"to",
"determine",
"if",
"your",
"content",
"qualifies",
"as",
"spam",
".",
"On",
"a",
"scale",
"from",
"1",
"to",
"10",
"with",
"10",
"being",
"most",
"strict",
"or",
"most",
"likely",
"to",
"be",
"considered",
"as",
"spam",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/spam_check.py#L57-L71 | [
"def",
"threshold",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"SpamThreshold",
")",
":",
"self",
".",
"_threshold",
"=",
"value",
"else",
":",
"self",
".",
"_threshold",
"=",
"SpamThreshold",
"(",
"value",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | SpamCheck.post_to_url | An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:param value: An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:type value: string | sendgrid/helpers/mail/spam_check.py | def post_to_url(self, value):
"""An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:param value: An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent ... | def post_to_url(self, value):
"""An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:param value: An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent ... | [
"An",
"Inbound",
"Parse",
"URL",
"to",
"send",
"a",
"copy",
"of",
"your",
"email",
".",
"If",
"defined",
"a",
"copy",
"of",
"your",
"email",
"and",
"its",
"spam",
"report",
"will",
"be",
"sent",
"here",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/spam_check.py#L83-L94 | [
"def",
"post_to_url",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"SpamUrl",
")",
":",
"self",
".",
"_post_to_url",
"=",
"value",
"else",
":",
"self",
".",
"_post_to_url",
"=",
"SpamUrl",
"(",
"value",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | SpamCheck.get | Get a JSON-ready representation of this SpamCheck.
:returns: This SpamCheck, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/spam_check.py | def get(self):
"""
Get a JSON-ready representation of this SpamCheck.
:returns: This SpamCheck, ready for use in a request body.
:rtype: dict
"""
spam_check = {}
if self.enable is not None:
spam_check["enable"] = self.enable
if self.threshold... | def get(self):
"""
Get a JSON-ready representation of this SpamCheck.
:returns: This SpamCheck, ready for use in a request body.
:rtype: dict
"""
spam_check = {}
if self.enable is not None:
spam_check["enable"] = self.enable
if self.threshold... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"SpamCheck",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/spam_check.py#L96-L112 | [
"def",
"get",
"(",
"self",
")",
":",
"spam_check",
"=",
"{",
"}",
"if",
"self",
".",
"enable",
"is",
"not",
"None",
":",
"spam_check",
"[",
"\"enable\"",
"]",
"=",
"self",
".",
"enable",
"if",
"self",
".",
"threshold",
"is",
"not",
"None",
":",
"sp... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | HtmlContent.content | The actual HTML content.
:param value: The actual HTML content.
:type value: string | sendgrid/helpers/mail/html_content.py | def content(self, value):
"""The actual HTML content.
:param value: The actual HTML content.
:type value: string
"""
self._validator.validate_message_dict(value)
self._content = value | def content(self, value):
"""The actual HTML content.
:param value: The actual HTML content.
:type value: string
"""
self._validator.validate_message_dict(value)
self._content = value | [
"The",
"actual",
"HTML",
"content",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/html_content.py#L37-L44 | [
"def",
"content",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_validator",
".",
"validate_message_dict",
"(",
"value",
")",
"self",
".",
"_content",
"=",
"value"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | HtmlContent.get | Get a JSON-ready representation of this HtmlContent.
:returns: This HtmlContent, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/html_content.py | def get(self):
"""
Get a JSON-ready representation of this HtmlContent.
:returns: This HtmlContent, ready for use in a request body.
:rtype: dict
"""
content = {}
if self.mime_type is not None:
content["type"] = self.mime_type
if self.content... | def get(self):
"""
Get a JSON-ready representation of this HtmlContent.
:returns: This HtmlContent, ready for use in a request body.
:rtype: dict
"""
content = {}
if self.mime_type is not None:
content["type"] = self.mime_type
if self.content... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"HtmlContent",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/html_content.py#L46-L59 | [
"def",
"get",
"(",
"self",
")",
":",
"content",
"=",
"{",
"}",
"if",
"self",
".",
"mime_type",
"is",
"not",
"None",
":",
"content",
"[",
"\"type\"",
"]",
"=",
"self",
".",
"mime_type",
"if",
"self",
".",
"content",
"is",
"not",
"None",
":",
"conten... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | BccSettings.get | Get a JSON-ready representation of this BCCSettings.
:returns: This BCCSettings, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/bcc_settings.py | def get(self):
"""
Get a JSON-ready representation of this BCCSettings.
:returns: This BCCSettings, ready for use in a request body.
:rtype: dict
"""
bcc_settings = {}
if self.enable is not None:
bcc_settings["enable"] = self.enable
if self.e... | def get(self):
"""
Get a JSON-ready representation of this BCCSettings.
:returns: This BCCSettings, ready for use in a request body.
:rtype: dict
"""
bcc_settings = {}
if self.enable is not None:
bcc_settings["enable"] = self.enable
if self.e... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"BCCSettings",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/bcc_settings.py#L59-L72 | [
"def",
"get",
"(",
"self",
")",
":",
"bcc_settings",
"=",
"{",
"}",
"if",
"self",
".",
"enable",
"is",
"not",
"None",
":",
"bcc_settings",
"[",
"\"enable\"",
"]",
"=",
"self",
".",
"enable",
"if",
"self",
".",
"email",
"is",
"not",
"None",
":",
"bc... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | SendGridAPIClient._default_headers | Set the default header for a Twilio SendGrid v3 API call | sendgrid/sendgrid.py | def _default_headers(self):
"""Set the default header for a Twilio SendGrid v3 API call"""
headers = {
"Authorization": 'Bearer {}'.format(self.api_key),
"User-agent": self.useragent,
"Accept": 'application/json'
}
if self.impersonate_subuser:
... | def _default_headers(self):
"""Set the default header for a Twilio SendGrid v3 API call"""
headers = {
"Authorization": 'Bearer {}'.format(self.api_key),
"User-agent": self.useragent,
"Accept": 'application/json'
}
if self.impersonate_subuser:
... | [
"Set",
"the",
"default",
"header",
"for",
"a",
"Twilio",
"SendGrid",
"v3",
"API",
"call"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/sendgrid.py#L71-L81 | [
"def",
"_default_headers",
"(",
"self",
")",
":",
"headers",
"=",
"{",
"\"Authorization\"",
":",
"'Bearer {}'",
".",
"format",
"(",
"self",
".",
"api_key",
")",
",",
"\"User-agent\"",
":",
"self",
".",
"useragent",
",",
"\"Accept\"",
":",
"'application/json'",... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | SendGridAPIClient.send | Make a Twilio SendGrid v3 API request with the request body generated by
the Mail object
:param message: The Twilio SendGrid v3 API request body generated by the Mail
object
:type message: Mail | sendgrid/sendgrid.py | def send(self, message):
"""Make a Twilio SendGrid v3 API request with the request body generated by
the Mail object
:param message: The Twilio SendGrid v3 API request body generated by the Mail
object
:type message: Mail
"""
if isinsta... | def send(self, message):
"""Make a Twilio SendGrid v3 API request with the request body generated by
the Mail object
:param message: The Twilio SendGrid v3 API request body generated by the Mail
object
:type message: Mail
"""
if isinsta... | [
"Make",
"a",
"Twilio",
"SendGrid",
"v3",
"API",
"request",
"with",
"the",
"request",
"body",
"generated",
"by",
"the",
"Mail",
"object",
":",
"param",
"message",
":",
"The",
"Twilio",
"SendGrid",
"v3",
"API",
"request",
"body",
"generated",
"by",
"the",
"M... | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/sendgrid.py#L87-L99 | [
"def",
"send",
"(",
"self",
",",
"message",
")",
":",
"if",
"isinstance",
"(",
"message",
",",
"dict",
")",
":",
"response",
"=",
"self",
".",
"client",
".",
"mail",
".",
"send",
".",
"post",
"(",
"request_body",
"=",
"message",
")",
"else",
":",
"... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail._ensure_append | Ensure an item is appended to a list or create a new empty list
:param new_items: the item(s) to append
:type new_items: list(obj)
:param append_to: the list on which to append the items
:type append_to: list()
:param index: index of the list on which to append the items
... | sendgrid/helpers/mail/mail.py | def _ensure_append(self, new_items, append_to, index=0):
"""Ensure an item is appended to a list or create a new empty list
:param new_items: the item(s) to append
:type new_items: list(obj)
:param append_to: the list on which to append the items
:type append_to: list()
... | def _ensure_append(self, new_items, append_to, index=0):
"""Ensure an item is appended to a list or create a new empty list
:param new_items: the item(s) to append
:type new_items: list(obj)
:param append_to: the list on which to append the items
:type append_to: list()
... | [
"Ensure",
"an",
"item",
"is",
"appended",
"to",
"a",
"list",
"or",
"create",
"a",
"new",
"empty",
"list"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L85-L97 | [
"def",
"_ensure_append",
"(",
"self",
",",
"new_items",
",",
"append_to",
",",
"index",
"=",
"0",
")",
":",
"append_to",
"=",
"append_to",
"or",
"[",
"]",
"append_to",
".",
"insert",
"(",
"index",
",",
"new_items",
")",
"return",
"append_to"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail._ensure_insert | Ensure an item is inserted to a list or create a new empty list
:param new_items: the item(s) to insert
:type new_items: list(obj)
:param insert_to: the list on which to insert the items at index 0
:type insert_to: list() | sendgrid/helpers/mail/mail.py | def _ensure_insert(self, new_items, insert_to):
"""Ensure an item is inserted to a list or create a new empty list
:param new_items: the item(s) to insert
:type new_items: list(obj)
:param insert_to: the list on which to insert the items at index 0
:type insert_to: list()
... | def _ensure_insert(self, new_items, insert_to):
"""Ensure an item is inserted to a list or create a new empty list
:param new_items: the item(s) to insert
:type new_items: list(obj)
:param insert_to: the list on which to insert the items at index 0
:type insert_to: list()
... | [
"Ensure",
"an",
"item",
"is",
"inserted",
"to",
"a",
"list",
"or",
"create",
"a",
"new",
"empty",
"list"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L99-L109 | [
"def",
"_ensure_insert",
"(",
"self",
",",
"new_items",
",",
"insert_to",
")",
":",
"insert_to",
"=",
"insert_to",
"or",
"[",
"]",
"insert_to",
".",
"insert",
"(",
"0",
",",
"new_items",
")",
"return",
"insert_to"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail._flatten_dicts | Flatten a dict
:param dicts: Flatten a dict
:type dicts: list(dict) | sendgrid/helpers/mail/mail.py | def _flatten_dicts(self, dicts):
"""Flatten a dict
:param dicts: Flatten a dict
:type dicts: list(dict)
"""
d = dict()
list_of_dicts = [d.get() for d in dicts or []]
return {k: v for d in list_of_dicts for k, v in d.items()} | def _flatten_dicts(self, dicts):
"""Flatten a dict
:param dicts: Flatten a dict
:type dicts: list(dict)
"""
d = dict()
list_of_dicts = [d.get() for d in dicts or []]
return {k: v for d in list_of_dicts for k, v in d.items()} | [
"Flatten",
"a",
"dict"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L111-L119 | [
"def",
"_flatten_dicts",
"(",
"self",
",",
"dicts",
")",
":",
"d",
"=",
"dict",
"(",
")",
"list_of_dicts",
"=",
"[",
"d",
".",
"get",
"(",
")",
"for",
"d",
"in",
"dicts",
"or",
"[",
"]",
"]",
"return",
"{",
"k",
":",
"v",
"for",
"d",
"in",
"l... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail._set_emails | Adds emails to the Personalization object
:param emails: An Email or list of Email objects
:type emails: Email, list(Email)
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization f... | sendgrid/helpers/mail/mail.py | def _set_emails(
self, emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds emails to the Personalization object
:param emails: An Email or list of Email objects
:type emails: Email, list(Email)
:param global_substitutions: A dict of substitutions for all reci... | def _set_emails(
self, emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds emails to the Personalization object
:param emails: An Email or list of Email objects
:type emails: Email, list(Email)
:param global_substitutions: A dict of substitutions for all reci... | [
"Adds",
"emails",
"to",
"the",
"Personalization",
"object"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L130-L185 | [
"def",
"_set_emails",
"(",
"self",
",",
"emails",
",",
"global_substitutions",
"=",
"None",
",",
"is_multiple",
"=",
"False",
",",
"p",
"=",
"0",
")",
":",
"# Send multiple emails to multiple recipients",
"if",
"is_multiple",
"is",
"True",
":",
"if",
"isinstance... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_personalization | Add a Personaliztion object
:param personalizations: Add a Personalization object
:type personalizations: Personalization
:param index: The index where to add the Personalization
:type index: int | sendgrid/helpers/mail/mail.py | def add_personalization(self, personalization, index=0):
"""Add a Personaliztion object
:param personalizations: Add a Personalization object
:type personalizations: Personalization
:param index: The index where to add the Personalization
:type index: int
"""
sel... | def add_personalization(self, personalization, index=0):
"""Add a Personaliztion object
:param personalizations: Add a Personalization object
:type personalizations: Personalization
:param index: The index where to add the Personalization
:type index: int
"""
sel... | [
"Add",
"a",
"Personaliztion",
"object"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L195-L204 | [
"def",
"add_personalization",
"(",
"self",
",",
"personalization",
",",
"index",
"=",
"0",
")",
":",
"self",
".",
"_personalizations",
"=",
"self",
".",
"_ensure_append",
"(",
"personalization",
",",
"self",
".",
"_personalizations",
",",
"index",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.to | Adds To objects to the Personalization object
:param to_emails: An To or list of To objects
:type to_emails: To, list(To), str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personi... | sendgrid/helpers/mail/mail.py | def to(self, to_emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds To objects to the Personalization object
:param to_emails: An To or list of To objects
:type to_emails: To, list(To), str, tuple
:param global_substitutions: A dict of substitutions for all recipients
... | def to(self, to_emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds To objects to the Personalization object
:param to_emails: An To or list of To objects
:type to_emails: To, list(To), str, tuple
:param global_substitutions: A dict of substitutions for all recipients
... | [
"Adds",
"To",
"objects",
"to",
"the",
"Personalization",
"object"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L211-L236 | [
"def",
"to",
"(",
"self",
",",
"to_emails",
",",
"global_substitutions",
"=",
"None",
",",
"is_multiple",
"=",
"False",
",",
"p",
"=",
"0",
")",
":",
"if",
"isinstance",
"(",
"to_emails",
",",
"list",
")",
":",
"for",
"email",
"in",
"to_emails",
":",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_to | Adds a To object to the Personalization object
:param to_emails: A To object
:type to_emails: To, str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipie... | sendgrid/helpers/mail/mail.py | def add_to(
self, to_email, global_substitutions=None, is_multiple=False, p=0):
"""Adds a To object to the Personalization object
:param to_emails: A To object
:type to_emails: To, str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:ty... | def add_to(
self, to_email, global_substitutions=None, is_multiple=False, p=0):
"""Adds a To object to the Personalization object
:param to_emails: A To object
:type to_emails: To, str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:ty... | [
"Adds",
"a",
"To",
"object",
"to",
"the",
"Personalization",
"object"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L238-L267 | [
"def",
"add_to",
"(",
"self",
",",
"to_email",
",",
"global_substitutions",
"=",
"None",
",",
"is_multiple",
"=",
"False",
",",
"p",
"=",
"0",
")",
":",
"if",
"isinstance",
"(",
"to_email",
",",
"list",
")",
":",
"for",
"email",
"in",
"to_email",
":",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.cc | Adds Cc objects to the Personalization object
:param cc_emails: An Cc or list of Cc objects
:type cc_emails: Cc, list(Cc), tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilizat... | sendgrid/helpers/mail/mail.py | def cc(self, cc_emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds Cc objects to the Personalization object
:param cc_emails: An Cc or list of Cc objects
:type cc_emails: Cc, list(Cc), tuple
:param global_substitutions: A dict of substitutions for all recipients
... | def cc(self, cc_emails, global_substitutions=None, is_multiple=False, p=0):
"""Adds Cc objects to the Personalization object
:param cc_emails: An Cc or list of Cc objects
:type cc_emails: Cc, list(Cc), tuple
:param global_substitutions: A dict of substitutions for all recipients
... | [
"Adds",
"Cc",
"objects",
"to",
"the",
"Personalization",
"object"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L274-L299 | [
"def",
"cc",
"(",
"self",
",",
"cc_emails",
",",
"global_substitutions",
"=",
"None",
",",
"is_multiple",
"=",
"False",
",",
"p",
"=",
"0",
")",
":",
"if",
"isinstance",
"(",
"cc_emails",
",",
"list",
")",
":",
"for",
"email",
"in",
"cc_emails",
":",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_cc | Adds a Cc object to the Personalization object
:param to_emails: An Cc object
:type to_emails: Cc
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipient
... | sendgrid/helpers/mail/mail.py | def add_cc(
self, cc_email, global_substitutions=None, is_multiple=False, p=0):
"""Adds a Cc object to the Personalization object
:param to_emails: An Cc object
:type to_emails: Cc
:param global_substitutions: A dict of substitutions for all recipients
:type global_s... | def add_cc(
self, cc_email, global_substitutions=None, is_multiple=False, p=0):
"""Adds a Cc object to the Personalization object
:param to_emails: An Cc object
:type to_emails: Cc
:param global_substitutions: A dict of substitutions for all recipients
:type global_s... | [
"Adds",
"a",
"Cc",
"object",
"to",
"the",
"Personalization",
"object"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L301-L322 | [
"def",
"add_cc",
"(",
"self",
",",
"cc_email",
",",
"global_substitutions",
"=",
"None",
",",
"is_multiple",
"=",
"False",
",",
"p",
"=",
"0",
")",
":",
"if",
"isinstance",
"(",
"cc_email",
",",
"str",
")",
":",
"cc_email",
"=",
"Cc",
"(",
"cc_email",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.bcc | Adds Bcc objects to the Personalization object
:param bcc_emails: An Bcc or list of Bcc objects
:type bcc_emails: Bcc, list(Bcc), tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new perso... | sendgrid/helpers/mail/mail.py | def bcc(
self,
bcc_emails,
global_substitutions=None,
is_multiple=False,
p=0):
"""Adds Bcc objects to the Personalization object
:param bcc_emails: An Bcc or list of Bcc objects
:type bcc_emails: Bcc, list(Bcc), tuple
:param gl... | def bcc(
self,
bcc_emails,
global_substitutions=None,
is_multiple=False,
p=0):
"""Adds Bcc objects to the Personalization object
:param bcc_emails: An Bcc or list of Bcc objects
:type bcc_emails: Bcc, list(Bcc), tuple
:param gl... | [
"Adds",
"Bcc",
"objects",
"to",
"the",
"Personalization",
"object"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L329-L359 | [
"def",
"bcc",
"(",
"self",
",",
"bcc_emails",
",",
"global_substitutions",
"=",
"None",
",",
"is_multiple",
"=",
"False",
",",
"p",
"=",
"0",
")",
":",
"if",
"isinstance",
"(",
"bcc_emails",
",",
"list",
")",
":",
"for",
"email",
"in",
"bcc_emails",
":... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_bcc | Adds a Bcc object to the Personalization object
:param to_emails: An Bcc object
:type to_emails: Bcc
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipient
... | sendgrid/helpers/mail/mail.py | def add_bcc(
self,
bcc_email,
global_substitutions=None,
is_multiple=False,
p=0):
"""Adds a Bcc object to the Personalization object
:param to_emails: An Bcc object
:type to_emails: Bcc
:param global_substitutions: A dict of su... | def add_bcc(
self,
bcc_email,
global_substitutions=None,
is_multiple=False,
p=0):
"""Adds a Bcc object to the Personalization object
:param to_emails: An Bcc object
:type to_emails: Bcc
:param global_substitutions: A dict of su... | [
"Adds",
"a",
"Bcc",
"object",
"to",
"the",
"Personalization",
"object"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L361-L389 | [
"def",
"add_bcc",
"(",
"self",
",",
"bcc_email",
",",
"global_substitutions",
"=",
"None",
",",
"is_multiple",
"=",
"False",
",",
"p",
"=",
"0",
")",
":",
"if",
"isinstance",
"(",
"bcc_email",
",",
"str",
")",
":",
"bcc_email",
"=",
"Bcc",
"(",
"bcc_em... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.subject | The subject of the email(s)
:param value: The subject of the email(s)
:type value: Subject, string | sendgrid/helpers/mail/mail.py | def subject(self, value):
"""The subject of the email(s)
:param value: The subject of the email(s)
:type value: Subject, string
"""
if isinstance(value, Subject):
if value.personalization is not None:
try:
personalization = \
... | def subject(self, value):
"""The subject of the email(s)
:param value: The subject of the email(s)
:type value: Subject, string
"""
if isinstance(value, Subject):
if value.personalization is not None:
try:
personalization = \
... | [
"The",
"subject",
"of",
"the",
"email",
"(",
"s",
")"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L400-L424 | [
"def",
"subject",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"Subject",
")",
":",
"if",
"value",
".",
"personalization",
"is",
"not",
"None",
":",
"try",
":",
"personalization",
"=",
"self",
".",
"_personalizations",
"[",... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.header | Add headers to the email
:param value: A list of Header objects or a dict of header key/values
:type value: Header, list(Header), dict | sendgrid/helpers/mail/mail.py | def header(self, headers):
"""Add headers to the email
:param value: A list of Header objects or a dict of header key/values
:type value: Header, list(Header), dict
"""
if isinstance(headers, list):
for h in headers:
self.add_header(h)
else:
... | def header(self, headers):
"""Add headers to the email
:param value: A list of Header objects or a dict of header key/values
:type value: Header, list(Header), dict
"""
if isinstance(headers, list):
for h in headers:
self.add_header(h)
else:
... | [
"Add",
"headers",
"to",
"the",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L439-L449 | [
"def",
"header",
"(",
"self",
",",
"headers",
")",
":",
"if",
"isinstance",
"(",
"headers",
",",
"list",
")",
":",
"for",
"h",
"in",
"headers",
":",
"self",
".",
"add_header",
"(",
"h",
")",
"else",
":",
"self",
".",
"add_header",
"(",
"headers",
"... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_header | Add headers to the email globaly or to a specific Personalization
:param value: A Header object or a dict of header key/values
:type value: Header, dict | sendgrid/helpers/mail/mail.py | def add_header(self, header):
"""Add headers to the email globaly or to a specific Personalization
:param value: A Header object or a dict of header key/values
:type value: Header, dict
"""
if header.personalization is not None:
try:
personalization =... | def add_header(self, header):
"""Add headers to the email globaly or to a specific Personalization
:param value: A Header object or a dict of header key/values
:type value: Header, dict
"""
if header.personalization is not None:
try:
personalization =... | [
"Add",
"headers",
"to",
"the",
"email",
"globaly",
"or",
"to",
"a",
"specific",
"Personalization"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L451-L481 | [
"def",
"add_header",
"(",
"self",
",",
"header",
")",
":",
"if",
"header",
".",
"personalization",
"is",
"not",
"None",
":",
"try",
":",
"personalization",
"=",
"self",
".",
"_personalizations",
"[",
"header",
".",
"personalization",
"]",
"has_internal_persona... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.substitution | Add substitutions to the email
:param value: Add substitutions to the email
:type value: Substitution, list(Substitution) | sendgrid/helpers/mail/mail.py | def substitution(self, substitution):
"""Add substitutions to the email
:param value: Add substitutions to the email
:type value: Substitution, list(Substitution)
"""
if isinstance(substitution, list):
for s in substitution:
self.add_substitution(s)
... | def substitution(self, substitution):
"""Add substitutions to the email
:param value: Add substitutions to the email
:type value: Substitution, list(Substitution)
"""
if isinstance(substitution, list):
for s in substitution:
self.add_substitution(s)
... | [
"Add",
"substitutions",
"to",
"the",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L488-L498 | [
"def",
"substitution",
"(",
"self",
",",
"substitution",
")",
":",
"if",
"isinstance",
"(",
"substitution",
",",
"list",
")",
":",
"for",
"s",
"in",
"substitution",
":",
"self",
".",
"add_substitution",
"(",
"s",
")",
"else",
":",
"self",
".",
"add_subst... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_substitution | Add a substitution to the email
:param value: Add a substitution to the email
:type value: Substitution | sendgrid/helpers/mail/mail.py | def add_substitution(self, substitution):
"""Add a substitution to the email
:param value: Add a substitution to the email
:type value: Substitution
"""
if substitution.personalization:
try:
personalization = \
self._personalizatio... | def add_substitution(self, substitution):
"""Add a substitution to the email
:param value: Add a substitution to the email
:type value: Substitution
"""
if substitution.personalization:
try:
personalization = \
self._personalizatio... | [
"Add",
"a",
"substitution",
"to",
"the",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L500-L526 | [
"def",
"add_substitution",
"(",
"self",
",",
"substitution",
")",
":",
"if",
"substitution",
".",
"personalization",
":",
"try",
":",
"personalization",
"=",
"self",
".",
"_personalizations",
"[",
"substitution",
".",
"personalization",
"]",
"has_internal_personaliz... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.custom_arg | Add custom args to the email
:param value: A list of CustomArg objects or a dict of custom arg
key/values
:type value: CustomArg, list(CustomArg), dict | sendgrid/helpers/mail/mail.py | def custom_arg(self, custom_arg):
"""Add custom args to the email
:param value: A list of CustomArg objects or a dict of custom arg
key/values
:type value: CustomArg, list(CustomArg), dict
"""
if isinstance(custom_arg, list):
for c in custom_arg... | def custom_arg(self, custom_arg):
"""Add custom args to the email
:param value: A list of CustomArg objects or a dict of custom arg
key/values
:type value: CustomArg, list(CustomArg), dict
"""
if isinstance(custom_arg, list):
for c in custom_arg... | [
"Add",
"custom",
"args",
"to",
"the",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L541-L552 | [
"def",
"custom_arg",
"(",
"self",
",",
"custom_arg",
")",
":",
"if",
"isinstance",
"(",
"custom_arg",
",",
"list",
")",
":",
"for",
"c",
"in",
"custom_arg",
":",
"self",
".",
"add_custom_arg",
"(",
"c",
")",
"else",
":",
"self",
".",
"add_custom_arg",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_custom_arg | Add custom args to the email globaly or to a specific Personalization
:param value: A CustomArg object or a dict of custom arg key/values
:type value: CustomArg, dict | sendgrid/helpers/mail/mail.py | def add_custom_arg(self, custom_arg):
"""Add custom args to the email globaly or to a specific Personalization
:param value: A CustomArg object or a dict of custom arg key/values
:type value: CustomArg, dict
"""
if custom_arg.personalization is not None:
try:
... | def add_custom_arg(self, custom_arg):
"""Add custom args to the email globaly or to a specific Personalization
:param value: A CustomArg object or a dict of custom arg key/values
:type value: CustomArg, dict
"""
if custom_arg.personalization is not None:
try:
... | [
"Add",
"custom",
"args",
"to",
"the",
"email",
"globaly",
"or",
"to",
"a",
"specific",
"Personalization"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L554-L584 | [
"def",
"add_custom_arg",
"(",
"self",
",",
"custom_arg",
")",
":",
"if",
"custom_arg",
".",
"personalization",
"is",
"not",
"None",
":",
"try",
":",
"personalization",
"=",
"self",
".",
"_personalizations",
"[",
"custom_arg",
".",
"personalization",
"]",
"has_... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.send_at | A unix timestamp specifying when your email should
be delivered.
:param value: A unix timestamp specifying when your email should
be delivered.
:type value: SendAt, int | sendgrid/helpers/mail/mail.py | def send_at(self, value):
"""A unix timestamp specifying when your email should
be delivered.
:param value: A unix timestamp specifying when your email should
be delivered.
:type value: SendAt, int
"""
if isinstance(value, SendAt):
if value.personaliz... | def send_at(self, value):
"""A unix timestamp specifying when your email should
be delivered.
:param value: A unix timestamp specifying when your email should
be delivered.
:type value: SendAt, int
"""
if isinstance(value, SendAt):
if value.personaliz... | [
"A",
"unix",
"timestamp",
"specifying",
"when",
"your",
"email",
"should",
"be",
"delivered",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L595-L620 | [
"def",
"send_at",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"SendAt",
")",
":",
"if",
"value",
".",
"personalization",
"is",
"not",
"None",
":",
"try",
":",
"personalization",
"=",
"self",
".",
"_personalizations",
"[",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.dynamic_template_data | Data for a transactional template
:param value: Data for a transactional template
:type value: DynamicTemplateData, a JSON-serializeable structure | sendgrid/helpers/mail/mail.py | def dynamic_template_data(self, value):
"""Data for a transactional template
:param value: Data for a transactional template
:type value: DynamicTemplateData, a JSON-serializeable structure
"""
if not isinstance(value, DynamicTemplateData):
value = DynamicTemplateDat... | def dynamic_template_data(self, value):
"""Data for a transactional template
:param value: Data for a transactional template
:type value: DynamicTemplateData, a JSON-serializeable structure
"""
if not isinstance(value, DynamicTemplateData):
value = DynamicTemplateDat... | [
"Data",
"for",
"a",
"transactional",
"template"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L627-L645 | [
"def",
"dynamic_template_data",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"DynamicTemplateData",
")",
":",
"value",
"=",
"DynamicTemplateData",
"(",
"value",
")",
"try",
":",
"personalization",
"=",
"self",
".",
"_per... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.from_email | The email address of the sender
:param value: The email address of the sender
:type value: From, str, tuple | sendgrid/helpers/mail/mail.py | def from_email(self, value):
"""The email address of the sender
:param value: The email address of the sender
:type value: From, str, tuple
"""
if isinstance(value, str):
value = From(value, None)
if isinstance(value, tuple):
value = From(value[0]... | def from_email(self, value):
"""The email address of the sender
:param value: The email address of the sender
:type value: From, str, tuple
"""
if isinstance(value, str):
value = From(value, None)
if isinstance(value, tuple):
value = From(value[0]... | [
"The",
"email",
"address",
"of",
"the",
"sender"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L656-L666 | [
"def",
"from_email",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"value",
"=",
"From",
"(",
"value",
",",
"None",
")",
"if",
"isinstance",
"(",
"value",
",",
"tuple",
")",
":",
"value",
"=",
"From",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.reply_to | The reply to email address
:param value: The reply to email address
:type value: ReplyTo, str, tuple | sendgrid/helpers/mail/mail.py | def reply_to(self, value):
"""The reply to email address
:param value: The reply to email address
:type value: ReplyTo, str, tuple
"""
if isinstance(value, str):
value = ReplyTo(value, None)
if isinstance(value, tuple):
value = ReplyTo(value[0], v... | def reply_to(self, value):
"""The reply to email address
:param value: The reply to email address
:type value: ReplyTo, str, tuple
"""
if isinstance(value, str):
value = ReplyTo(value, None)
if isinstance(value, tuple):
value = ReplyTo(value[0], v... | [
"The",
"reply",
"to",
"email",
"address"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L677-L687 | [
"def",
"reply_to",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"value",
"=",
"ReplyTo",
"(",
"value",
",",
"None",
")",
"if",
"isinstance",
"(",
"value",
",",
"tuple",
")",
":",
"value",
"=",
"ReplyT... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.content | The content(s) of the email
:param contents: The content(s) of the email
:type contents: Content, list(Content) | sendgrid/helpers/mail/mail.py | def content(self, contents):
"""The content(s) of the email
:param contents: The content(s) of the email
:type contents: Content, list(Content)
"""
if isinstance(contents, list):
for c in contents:
self.add_content(c)
else:
self.ad... | def content(self, contents):
"""The content(s) of the email
:param contents: The content(s) of the email
:type contents: Content, list(Content)
"""
if isinstance(contents, list):
for c in contents:
self.add_content(c)
else:
self.ad... | [
"The",
"content",
"(",
"s",
")",
"of",
"the",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L702-L712 | [
"def",
"content",
"(",
"self",
",",
"contents",
")",
":",
"if",
"isinstance",
"(",
"contents",
",",
"list",
")",
":",
"for",
"c",
"in",
"contents",
":",
"self",
".",
"add_content",
"(",
"c",
")",
"else",
":",
"self",
".",
"add_content",
"(",
"content... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_content | Add content to the email
:param contents: Content to be added to the email
:type contents: Content
:param mime_type: Override the mime type
:type mime_type: MimeType, str | sendgrid/helpers/mail/mail.py | def add_content(self, content, mime_type=None):
"""Add content to the email
:param contents: Content to be added to the email
:type contents: Content
:param mime_type: Override the mime type
:type mime_type: MimeType, str
"""
if isinstance(content, str):
... | def add_content(self, content, mime_type=None):
"""Add content to the email
:param contents: Content to be added to the email
:type contents: Content
:param mime_type: Override the mime type
:type mime_type: MimeType, str
"""
if isinstance(content, str):
... | [
"Add",
"content",
"to",
"the",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L714-L733 | [
"def",
"add_content",
"(",
"self",
",",
"content",
",",
"mime_type",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"content",
",",
"str",
")",
":",
"content",
"=",
"Content",
"(",
"mime_type",
",",
"content",
")",
"# Content of mime type text/plain must alwa... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.attachment | Add attachment(s) to this email
:param attachment: Add attachment(s) to this email
:type attachment: Attachment, list(Attachment) | sendgrid/helpers/mail/mail.py | def attachment(self, attachment):
"""Add attachment(s) to this email
:param attachment: Add attachment(s) to this email
:type attachment: Attachment, list(Attachment)
"""
if isinstance(attachment, list):
for a in attachment:
self.add_attachment(a)
... | def attachment(self, attachment):
"""Add attachment(s) to this email
:param attachment: Add attachment(s) to this email
:type attachment: Attachment, list(Attachment)
"""
if isinstance(attachment, list):
for a in attachment:
self.add_attachment(a)
... | [
"Add",
"attachment",
"(",
"s",
")",
"to",
"this",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L748-L758 | [
"def",
"attachment",
"(",
"self",
",",
"attachment",
")",
":",
"if",
"isinstance",
"(",
"attachment",
",",
"list",
")",
":",
"for",
"a",
"in",
"attachment",
":",
"self",
".",
"add_attachment",
"(",
"a",
")",
"else",
":",
"self",
".",
"add_attachment",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_attachment | Add an attachment to this email
:param attachment: Add an attachment to this email
:type attachment: Attachment | sendgrid/helpers/mail/mail.py | def add_attachment(self, attachment):
"""Add an attachment to this email
:param attachment: Add an attachment to this email
:type attachment: Attachment
"""
self._attachments = self._ensure_append(attachment, self._attachments) | def add_attachment(self, attachment):
"""Add an attachment to this email
:param attachment: Add an attachment to this email
:type attachment: Attachment
"""
self._attachments = self._ensure_append(attachment, self._attachments) | [
"Add",
"an",
"attachment",
"to",
"this",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L760-L766 | [
"def",
"add_attachment",
"(",
"self",
",",
"attachment",
")",
":",
"self",
".",
"_attachments",
"=",
"self",
".",
"_ensure_append",
"(",
"attachment",
",",
"self",
".",
"_attachments",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.template_id | The transactional template id for this email
:param value: The transactional template id for this email
:type value: TemplateId | sendgrid/helpers/mail/mail.py | def template_id(self, value):
"""The transactional template id for this email
:param value: The transactional template id for this email
:type value: TemplateId
"""
if isinstance(value, TemplateId):
self._template_id = value
else:
self._template_i... | def template_id(self, value):
"""The transactional template id for this email
:param value: The transactional template id for this email
:type value: TemplateId
"""
if isinstance(value, TemplateId):
self._template_id = value
else:
self._template_i... | [
"The",
"transactional",
"template",
"id",
"for",
"this",
"email"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L777-L786 | [
"def",
"template_id",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"TemplateId",
")",
":",
"self",
".",
"_template_id",
"=",
"value",
"else",
":",
"self",
".",
"_template_id",
"=",
"TemplateId",
"(",
"value",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.section | The block sections of code to be used as substitutions
:rtype: Section, list(Section) | sendgrid/helpers/mail/mail.py | def section(self, section):
"""The block sections of code to be used as substitutions
:rtype: Section, list(Section)
"""
if isinstance(section, list):
for h in section:
self.add_section(h)
else:
self.add_section(section) | def section(self, section):
"""The block sections of code to be used as substitutions
:rtype: Section, list(Section)
"""
if isinstance(section, list):
for h in section:
self.add_section(h)
else:
self.add_section(section) | [
"The",
"block",
"sections",
"of",
"code",
"to",
"be",
"used",
"as",
"substitutions"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L801-L810 | [
"def",
"section",
"(",
"self",
",",
"section",
")",
":",
"if",
"isinstance",
"(",
"section",
",",
"list",
")",
":",
"for",
"h",
"in",
"section",
":",
"self",
".",
"add_section",
"(",
"h",
")",
"else",
":",
"self",
".",
"add_section",
"(",
"section",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_section | A block section of code to be used as substitutions
:param section: A block section of code to be used as substitutions
:type section: Section | sendgrid/helpers/mail/mail.py | def add_section(self, section):
"""A block section of code to be used as substitutions
:param section: A block section of code to be used as substitutions
:type section: Section
"""
self._sections = self._ensure_append(section, self._sections) | def add_section(self, section):
"""A block section of code to be used as substitutions
:param section: A block section of code to be used as substitutions
:type section: Section
"""
self._sections = self._ensure_append(section, self._sections) | [
"A",
"block",
"section",
"of",
"code",
"to",
"be",
"used",
"as",
"substitutions"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L812-L818 | [
"def",
"add_section",
"(",
"self",
",",
"section",
")",
":",
"self",
".",
"_sections",
"=",
"self",
".",
"_ensure_append",
"(",
"section",
",",
"self",
".",
"_sections",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.category | Add categories assigned to this message
:rtype: list(Category) | sendgrid/helpers/mail/mail.py | def category(self, categories):
"""Add categories assigned to this message
:rtype: list(Category)
"""
if isinstance(categories, list):
for c in categories:
self.add_category(c)
else:
self.add_category(categories) | def category(self, categories):
"""Add categories assigned to this message
:rtype: list(Category)
"""
if isinstance(categories, list):
for c in categories:
self.add_category(c)
else:
self.add_category(categories) | [
"Add",
"categories",
"assigned",
"to",
"this",
"message"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L833-L842 | [
"def",
"category",
"(",
"self",
",",
"categories",
")",
":",
"if",
"isinstance",
"(",
"categories",
",",
"list",
")",
":",
"for",
"c",
"in",
"categories",
":",
"self",
".",
"add_category",
"(",
"c",
")",
"else",
":",
"self",
".",
"add_category",
"(",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.add_category | Add a category assigned to this message
:rtype: Category | sendgrid/helpers/mail/mail.py | def add_category(self, category):
"""Add a category assigned to this message
:rtype: Category
"""
self._categories = self._ensure_append(category, self._categories) | def add_category(self, category):
"""Add a category assigned to this message
:rtype: Category
"""
self._categories = self._ensure_append(category, self._categories) | [
"Add",
"a",
"category",
"assigned",
"to",
"this",
"message"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L844-L849 | [
"def",
"add_category",
"(",
"self",
",",
"category",
")",
":",
"self",
".",
"_categories",
"=",
"self",
".",
"_ensure_append",
"(",
"category",
",",
"self",
".",
"_categories",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.get | Get a JSON-ready representation of this Mail object.
:returns: This Mail object, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/mail.py | def get(self):
"""
Get a JSON-ready representation of this Mail object.
:returns: This Mail object, ready for use in a request body.
:rtype: dict
"""
mail = {
'from': self._get_or_none(self.from_email),
'subject': self._get_or_none(self.subject),
... | def get(self):
"""
Get a JSON-ready representation of this Mail object.
:returns: This Mail object, ready for use in a request body.
:rtype: dict
"""
mail = {
'from': self._get_or_none(self.from_email),
'subject': self._get_or_none(self.subject),
... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"Mail",
"object",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L936-L964 | [
"def",
"get",
"(",
"self",
")",
":",
"mail",
"=",
"{",
"'from'",
":",
"self",
".",
"_get_or_none",
"(",
"self",
".",
"from_email",
")",
",",
"'subject'",
":",
"self",
".",
"_get_or_none",
"(",
"self",
".",
"subject",
")",
",",
"'personalizations'",
":"... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Mail.from_EmailMessage | Create a Mail object from an instance of
email.message.EmailMessage.
:type message: email.message.EmailMessage
:rtype: Mail | sendgrid/helpers/mail/mail.py | def from_EmailMessage(cls, message):
"""Create a Mail object from an instance of
email.message.EmailMessage.
:type message: email.message.EmailMessage
:rtype: Mail
"""
mail = cls(
from_email=Email(message.get('From')),
subject=message.get('Subject... | def from_EmailMessage(cls, message):
"""Create a Mail object from an instance of
email.message.EmailMessage.
:type message: email.message.EmailMessage
:rtype: Mail
"""
mail = cls(
from_email=Email(message.get('From')),
subject=message.get('Subject... | [
"Create",
"a",
"Mail",
"object",
"from",
"an",
"instance",
"of",
"email",
".",
"message",
".",
"EmailMessage",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail.py#L967-L990 | [
"def",
"from_EmailMessage",
"(",
"cls",
",",
"message",
")",
":",
"mail",
"=",
"cls",
"(",
"from_email",
"=",
"Email",
"(",
"message",
".",
"get",
"(",
"'From'",
")",
")",
",",
"subject",
"=",
"message",
".",
"get",
"(",
"'Subject'",
")",
",",
"to_em... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Ganalytics.get | Get a JSON-ready representation of this Ganalytics.
:returns: This Ganalytics, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/ganalytics.py | def get(self):
"""
Get a JSON-ready representation of this Ganalytics.
:returns: This Ganalytics, ready for use in a request body.
:rtype: dict
"""
keys = ["enable", "utm_source", "utm_medium", "utm_term",
"utm_content", "utm_campaign"]
ganalytic... | def get(self):
"""
Get a JSON-ready representation of this Ganalytics.
:returns: This Ganalytics, ready for use in a request body.
:rtype: dict
"""
keys = ["enable", "utm_source", "utm_medium", "utm_term",
"utm_content", "utm_campaign"]
ganalytic... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"Ganalytics",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/ganalytics.py#L156-L176 | [
"def",
"get",
"(",
"self",
")",
":",
"keys",
"=",
"[",
"\"enable\"",
",",
"\"utm_source\"",
",",
"\"utm_medium\"",
",",
"\"utm_term\"",
",",
"\"utm_content\"",
",",
"\"utm_campaign\"",
"]",
"ganalytics",
"=",
"{",
"}",
"for",
"key",
"in",
"keys",
":",
"val... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | FooterSettings.get | Get a JSON-ready representation of this FooterSettings.
:returns: This FooterSettings, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/footer_settings.py | def get(self):
"""
Get a JSON-ready representation of this FooterSettings.
:returns: This FooterSettings, ready for use in a request body.
:rtype: dict
"""
footer_settings = {}
if self.enable is not None:
footer_settings["enable"] = self.enable
... | def get(self):
"""
Get a JSON-ready representation of this FooterSettings.
:returns: This FooterSettings, ready for use in a request body.
:rtype: dict
"""
footer_settings = {}
if self.enable is not None:
footer_settings["enable"] = self.enable
... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"FooterSettings",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/footer_settings.py#L78-L94 | [
"def",
"get",
"(",
"self",
")",
":",
"footer_settings",
"=",
"{",
"}",
"if",
"self",
".",
"enable",
"is",
"not",
"None",
":",
"footer_settings",
"[",
"\"enable\"",
"]",
"=",
"self",
".",
"enable",
"if",
"self",
".",
"text",
"is",
"not",
"None",
":",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Email.name | Name associated with this email.
:param value: Name associated with this email.
:type value: string | sendgrid/helpers/mail/email.py | def name(self, value):
"""Name associated with this email.
:param value: Name associated with this email.
:type value: string
"""
if not (value is None or isinstance(value, str)):
raise TypeError('name must be of type string.')
# Escape common CSV delimiters... | def name(self, value):
"""Name associated with this email.
:param value: Name associated with this email.
:type value: string
"""
if not (value is None or isinstance(value, str)):
raise TypeError('name must be of type string.')
# Escape common CSV delimiters... | [
"Name",
"associated",
"with",
"this",
"email",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/email.py#L79-L93 | [
"def",
"name",
"(",
"self",
",",
"value",
")",
":",
"if",
"not",
"(",
"value",
"is",
"None",
"or",
"isinstance",
"(",
"value",
",",
"str",
")",
")",
":",
"raise",
"TypeError",
"(",
"'name must be of type string.'",
")",
"# Escape common CSV delimiters as worka... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Email.parse_email | Allows passing emails as "Example Name <example@example.com>"
:param email_info: Allows passing emails as
"Example Name <example@example.com>"
:type email_info: string | sendgrid/helpers/mail/email.py | def parse_email(self, email_info):
"""Allows passing emails as "Example Name <example@example.com>"
:param email_info: Allows passing emails as
"Example Name <example@example.com>"
:type email_info: string
"""
name, email = rfc822.parseaddr(email_info)... | def parse_email(self, email_info):
"""Allows passing emails as "Example Name <example@example.com>"
:param email_info: Allows passing emails as
"Example Name <example@example.com>"
:type email_info: string
"""
name, email = rfc822.parseaddr(email_info)... | [
"Allows",
"passing",
"emails",
"as",
"Example",
"Name",
"<example@example",
".",
"com",
">"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/email.py#L187-L209 | [
"def",
"parse_email",
"(",
"self",
",",
"email_info",
")",
":",
"name",
",",
"email",
"=",
"rfc822",
".",
"parseaddr",
"(",
"email_info",
")",
"# more than likely a string was passed here instead of an email address",
"if",
"\"@\"",
"not",
"in",
"email",
":",
"name"... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Email.get | Get a JSON-ready representation of this Email.
:returns: This Email, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/email.py | def get(self):
"""
Get a JSON-ready representation of this Email.
:returns: This Email, ready for use in a request body.
:rtype: dict
"""
email = {}
if self.name is not None:
email["name"] = self.name
if self.email is not None:
em... | def get(self):
"""
Get a JSON-ready representation of this Email.
:returns: This Email, ready for use in a request body.
:rtype: dict
"""
email = {}
if self.name is not None:
email["name"] = self.name
if self.email is not None:
em... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"Email",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/email.py#L211-L224 | [
"def",
"get",
"(",
"self",
")",
":",
"email",
"=",
"{",
"}",
"if",
"self",
".",
"name",
"is",
"not",
"None",
":",
"email",
"[",
"\"name\"",
"]",
"=",
"self",
".",
"name",
"if",
"self",
".",
"email",
"is",
"not",
"None",
":",
"email",
"[",
"\"em... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | GroupsToDisplay.groups_to_display | An array containing the unsubscribe groups that you would like to be
displayed on the unsubscribe preferences page.
:param value: An array containing the unsubscribe groups that you
would like to be displayed on the unsubscribe
preferences page.
:type... | sendgrid/helpers/mail/groups_to_display.py | def groups_to_display(self, value):
"""An array containing the unsubscribe groups that you would like to be
displayed on the unsubscribe preferences page.
:param value: An array containing the unsubscribe groups that you
would like to be displayed on the unsubscribe
... | def groups_to_display(self, value):
"""An array containing the unsubscribe groups that you would like to be
displayed on the unsubscribe preferences page.
:param value: An array containing the unsubscribe groups that you
would like to be displayed on the unsubscribe
... | [
"An",
"array",
"containing",
"the",
"unsubscribe",
"groups",
"that",
"you",
"would",
"like",
"to",
"be",
"displayed",
"on",
"the",
"unsubscribe",
"preferences",
"page",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/groups_to_display.py#L28-L39 | [
"def",
"groups_to_display",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"is",
"not",
"None",
"and",
"len",
"(",
"value",
")",
">",
"25",
":",
"raise",
"ValueError",
"(",
"\"New groups_to_display exceeds max length of 25.\"",
")",
"self",
".",
"_groups_... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Asm.group_id | The unsubscribe group to associate with this email.
:param value: ID of an unsubscribe group
:type value: GroupId, int, required | sendgrid/helpers/mail/asm.py | def group_id(self, value):
"""The unsubscribe group to associate with this email.
:param value: ID of an unsubscribe group
:type value: GroupId, int, required
"""
if isinstance(value, GroupId):
self._group_id = value
else:
self._group_id = GroupId... | def group_id(self, value):
"""The unsubscribe group to associate with this email.
:param value: ID of an unsubscribe group
:type value: GroupId, int, required
"""
if isinstance(value, GroupId):
self._group_id = value
else:
self._group_id = GroupId... | [
"The",
"unsubscribe",
"group",
"to",
"associate",
"with",
"this",
"email",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/asm.py#L34-L43 | [
"def",
"group_id",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"GroupId",
")",
":",
"self",
".",
"_group_id",
"=",
"value",
"else",
":",
"self",
".",
"_group_id",
"=",
"GroupId",
"(",
"value",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Asm.groups_to_display | An array containing the unsubscribe groups that you would like to
be displayed on the unsubscribe preferences page. Max of 25 groups.
:param groups_to_display: Unsubscribe groups to display
:type groups_to_display: GroupsToDisplay, list(int), optional | sendgrid/helpers/mail/asm.py | def groups_to_display(self, value):
"""An array containing the unsubscribe groups that you would like to
be displayed on the unsubscribe preferences page. Max of 25 groups.
:param groups_to_display: Unsubscribe groups to display
:type groups_to_display: GroupsToDisplay, list(int), optio... | def groups_to_display(self, value):
"""An array containing the unsubscribe groups that you would like to
be displayed on the unsubscribe preferences page. Max of 25 groups.
:param groups_to_display: Unsubscribe groups to display
:type groups_to_display: GroupsToDisplay, list(int), optio... | [
"An",
"array",
"containing",
"the",
"unsubscribe",
"groups",
"that",
"you",
"would",
"like",
"to",
"be",
"displayed",
"on",
"the",
"unsubscribe",
"preferences",
"page",
".",
"Max",
"of",
"25",
"groups",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/asm.py#L55-L65 | [
"def",
"groups_to_display",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"GroupsToDisplay",
")",
":",
"self",
".",
"_groups_to_display",
"=",
"value",
"else",
":",
"self",
".",
"_groups_to_display",
"=",
"GroupsToDisplay",
"(",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Asm.get | Get a JSON-ready representation of this ASM object.
:returns: This ASM object, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/asm.py | def get(self):
"""
Get a JSON-ready representation of this ASM object.
:returns: This ASM object, ready for use in a request body.
:rtype: dict
"""
asm = {}
if self.group_id is not None:
asm["group_id"] = self.group_id.get()
if self.groups_to... | def get(self):
"""
Get a JSON-ready representation of this ASM object.
:returns: This ASM object, ready for use in a request body.
:rtype: dict
"""
asm = {}
if self.group_id is not None:
asm["group_id"] = self.group_id.get()
if self.groups_to... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"ASM",
"object",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/asm.py#L67-L80 | [
"def",
"get",
"(",
"self",
")",
":",
"asm",
"=",
"{",
"}",
"if",
"self",
".",
"group_id",
"is",
"not",
"None",
":",
"asm",
"[",
"\"group_id\"",
"]",
"=",
"self",
".",
"group_id",
".",
"get",
"(",
")",
"if",
"self",
".",
"groups_to_display",
"is",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | ValidateApiKey.validate_message_dict | With the JSON dict that will be sent to SendGrid's API,
check the content for SendGrid API keys - throw exception if found.
:param request_body: The JSON dict that will be sent to SendGrid's
API.
:type request_body: JSON serializable structure
... | sendgrid/helpers/mail/validators.py | def validate_message_dict(self, request_body):
"""With the JSON dict that will be sent to SendGrid's API,
check the content for SendGrid API keys - throw exception if found.
:param request_body: The JSON dict that will be sent to SendGrid's
API.
... | def validate_message_dict(self, request_body):
"""With the JSON dict that will be sent to SendGrid's API,
check the content for SendGrid API keys - throw exception if found.
:param request_body: The JSON dict that will be sent to SendGrid's
API.
... | [
"With",
"the",
"JSON",
"dict",
"that",
"will",
"be",
"sent",
"to",
"SendGrid",
"s",
"API",
"check",
"the",
"content",
"for",
"SendGrid",
"API",
"keys",
"-",
"throw",
"exception",
"if",
"found",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/validators.py#L30-L55 | [
"def",
"validate_message_dict",
"(",
"self",
",",
"request_body",
")",
":",
"# Handle string in edge-case",
"if",
"isinstance",
"(",
"request_body",
",",
"str",
")",
":",
"self",
".",
"validate_message_text",
"(",
"request_body",
")",
"# Default param",
"elif",
"isi... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | ValidateApiKey.validate_message_text | With a message string, check to see if it contains a SendGrid API Key
If a key is found, throw an exception
:param message_string: message that will be sent
:type message_string: string
:raises ApiKeyIncludedException: If message_string matches a regex
... | sendgrid/helpers/mail/validators.py | def validate_message_text(self, message_string):
"""With a message string, check to see if it contains a SendGrid API Key
If a key is found, throw an exception
:param message_string: message that will be sent
:type message_string: string
:raises ApiKeyIncludedExcept... | def validate_message_text(self, message_string):
"""With a message string, check to see if it contains a SendGrid API Key
If a key is found, throw an exception
:param message_string: message that will be sent
:type message_string: string
:raises ApiKeyIncludedExcept... | [
"With",
"a",
"message",
"string",
"check",
"to",
"see",
"if",
"it",
"contains",
"a",
"SendGrid",
"API",
"Key",
"If",
"a",
"key",
"is",
"found",
"throw",
"an",
"exception"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/validators.py#L57-L69 | [
"def",
"validate_message_text",
"(",
"self",
",",
"message_string",
")",
":",
"if",
"isinstance",
"(",
"message_string",
",",
"str",
")",
":",
"for",
"regex",
"in",
"self",
".",
"regexes",
":",
"if",
"regex",
".",
"match",
"(",
"message_string",
")",
"is",... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | get_mock_personalization_dict | Get a dict of personalization mock. | examples/helpers/mail_example.py | def get_mock_personalization_dict():
"""Get a dict of personalization mock."""
mock_pers = dict()
mock_pers['to_list'] = [To("test1@example.com",
"Example User"),
To("test2@example.com",
"Example User")]
mo... | def get_mock_personalization_dict():
"""Get a dict of personalization mock."""
mock_pers = dict()
mock_pers['to_list'] = [To("test1@example.com",
"Example User"),
To("test2@example.com",
"Example User")]
mo... | [
"Get",
"a",
"dict",
"of",
"personalization",
"mock",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/examples/helpers/mail_example.py#L49-L79 | [
"def",
"get_mock_personalization_dict",
"(",
")",
":",
"mock_pers",
"=",
"dict",
"(",
")",
"mock_pers",
"[",
"'to_list'",
"]",
"=",
"[",
"To",
"(",
"\"test1@example.com\"",
",",
"\"Example User\"",
")",
",",
"To",
"(",
"\"test2@example.com\"",
",",
"\"Example Us... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | build_attachment1 | Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content.
Another example: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/attachment.md | examples/helpers/mail_example.py | def build_attachment1():
"""Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content.
Another example: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/attachment.md"""
attachment = Attachment()
attachment.content = ("TG9yZW0gaXBzdW0gZG9sb3I... | def build_attachment1():
"""Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content.
Another example: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/attachment.md"""
attachment = Attachment()
attachment.content = ("TG9yZW0gaXBzdW0gZG9sb3I... | [
"Build",
"attachment",
"mock",
".",
"Make",
"sure",
"your",
"content",
"is",
"base64",
"encoded",
"before",
"passing",
"into",
"attachment",
".",
"content",
".",
"Another",
"example",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"sendgrid",
"/",
"se... | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/examples/helpers/mail_example.py#L82-L92 | [
"def",
"build_attachment1",
"(",
")",
":",
"attachment",
"=",
"Attachment",
"(",
")",
"attachment",
".",
"content",
"=",
"(",
"\"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl\"",
"\"Y3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gQ3JhcyBwdW12\"",
")",
"attachment",
".",
"type",
"=",
"\"ap... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | build_attachment2 | Build attachment mock. | examples/helpers/mail_example.py | def build_attachment2():
"""Build attachment mock."""
attachment = Attachment()
attachment.content = "BwdW"
attachment.type = "image/png"
attachment.filename = "banner.png"
attachment.disposition = "inline"
attachment.content_id = "Banner"
return attachment | def build_attachment2():
"""Build attachment mock."""
attachment = Attachment()
attachment.content = "BwdW"
attachment.type = "image/png"
attachment.filename = "banner.png"
attachment.disposition = "inline"
attachment.content_id = "Banner"
return attachment | [
"Build",
"attachment",
"mock",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/examples/helpers/mail_example.py#L95-L103 | [
"def",
"build_attachment2",
"(",
")",
":",
"attachment",
"=",
"Attachment",
"(",
")",
"attachment",
".",
"content",
"=",
"\"BwdW\"",
"attachment",
".",
"type",
"=",
"\"image/png\"",
"attachment",
".",
"filename",
"=",
"\"banner.png\"",
"attachment",
".",
"dispos... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | build_kitchen_sink | All settings set | examples/helpers/mail_example.py | def build_kitchen_sink():
"""All settings set"""
from sendgrid.helpers.mail import (
Mail, From, To, Cc, Bcc, Subject, PlainTextContent,
HtmlContent, SendGridException, Substitution,
Header, CustomArg, SendAt, Content, MimeType, Attachment,
FileName, FileContent, FileType, Disp... | def build_kitchen_sink():
"""All settings set"""
from sendgrid.helpers.mail import (
Mail, From, To, Cc, Bcc, Subject, PlainTextContent,
HtmlContent, SendGridException, Substitution,
Header, CustomArg, SendAt, Content, MimeType, Attachment,
FileName, FileContent, FileType, Disp... | [
"All",
"settings",
"set"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/examples/helpers/mail_example.py#L105-L309 | [
"def",
"build_kitchen_sink",
"(",
")",
":",
"from",
"sendgrid",
".",
"helpers",
".",
"mail",
"import",
"(",
"Mail",
",",
"From",
",",
"To",
",",
"Cc",
",",
"Bcc",
",",
"Subject",
",",
"PlainTextContent",
",",
"HtmlContent",
",",
"SendGridException",
",",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Config.init_environment | Allow variables assigned in .env available using
os.environ.get('VAR_NAME') | sendgrid/helpers/inbound/config.py | def init_environment():
"""Allow variables assigned in .env available using
os.environ.get('VAR_NAME')"""
base_path = os.path.abspath(os.path.dirname(__file__))
env_path = '{0}/.env'.format(base_path)
if os.path.exists(env_path):
with open(env_path) as f:
... | def init_environment():
"""Allow variables assigned in .env available using
os.environ.get('VAR_NAME')"""
base_path = os.path.abspath(os.path.dirname(__file__))
env_path = '{0}/.env'.format(base_path)
if os.path.exists(env_path):
with open(env_path) as f:
... | [
"Allow",
"variables",
"assigned",
"in",
".",
"env",
"available",
"using",
"os",
".",
"environ",
".",
"get",
"(",
"VAR_NAME",
")"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/inbound/config.py#L27-L38 | [
"def",
"init_environment",
"(",
")",
":",
"base_path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
")",
"env_path",
"=",
"'{0}/.env'",
".",
"format",
"(",
"base_path",
")",
"if",
"os",
".",
"p... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | MailSettings.get | Get a JSON-ready representation of this MailSettings.
:returns: This MailSettings, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/mail_settings.py | def get(self):
"""
Get a JSON-ready representation of this MailSettings.
:returns: This MailSettings, ready for use in a request body.
:rtype: dict
"""
mail_settings = {}
if self.bcc_settings is not None:
mail_settings["bcc"] = self.bcc_settings.get()... | def get(self):
"""
Get a JSON-ready representation of this MailSettings.
:returns: This MailSettings, ready for use in a request body.
:rtype: dict
"""
mail_settings = {}
if self.bcc_settings is not None:
mail_settings["bcc"] = self.bcc_settings.get()... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"MailSettings",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/mail_settings.py#L133-L156 | [
"def",
"get",
"(",
"self",
")",
":",
"mail_settings",
"=",
"{",
"}",
"if",
"self",
".",
"bcc_settings",
"is",
"not",
"None",
":",
"mail_settings",
"[",
"\"bcc\"",
"]",
"=",
"self",
".",
"bcc_settings",
".",
"get",
"(",
")",
"if",
"self",
".",
"bypass... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Substitution.get | Get a JSON-ready representation of this Substitution.
:returns: This Substitution, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/substitution.py | def get(self):
"""
Get a JSON-ready representation of this Substitution.
:returns: This Substitution, ready for use in a request body.
:rtype: dict
"""
substitution = {}
if self.key is not None and self.value is not None:
substitution[self.key] = self... | def get(self):
"""
Get a JSON-ready representation of this Substitution.
:returns: This Substitution, ready for use in a request body.
:rtype: dict
"""
substitution = {}
if self.key is not None and self.value is not None:
substitution[self.key] = self... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"Substitution",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/substitution.py#L80-L90 | [
"def",
"get",
"(",
"self",
")",
":",
"substitution",
"=",
"{",
"}",
"if",
"self",
".",
"key",
"is",
"not",
"None",
"and",
"self",
".",
"value",
"is",
"not",
"None",
":",
"substitution",
"[",
"self",
".",
"key",
"]",
"=",
"self",
".",
"value",
"re... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Header.get | Get a JSON-ready representation of this Header.
:returns: This Header, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/header.py | def get(self):
"""
Get a JSON-ready representation of this Header.
:returns: This Header, ready for use in a request body.
:rtype: dict
"""
header = {}
if self.key is not None and self.value is not None:
header[self.key] = self.value
return he... | def get(self):
"""
Get a JSON-ready representation of this Header.
:returns: This Header, ready for use in a request body.
:rtype: dict
"""
header = {}
if self.key is not None and self.value is not None:
header[self.key] = self.value
return he... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"Header",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/header.py#L84-L94 | [
"def",
"get",
"(",
"self",
")",
":",
"header",
"=",
"{",
"}",
"if",
"self",
".",
"key",
"is",
"not",
"None",
"and",
"self",
".",
"value",
"is",
"not",
"None",
":",
"header",
"[",
"self",
".",
"key",
"]",
"=",
"self",
".",
"value",
"return",
"he... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Parse.key_values | Return a dictionary of key/values in the payload received from
the webhook | sendgrid/helpers/inbound/parse.py | def key_values(self):
"""
Return a dictionary of key/values in the payload received from
the webhook
"""
key_values = {}
for key in self.keys:
if key in self.payload:
key_values[key] = self.payload[key]
return key_values | def key_values(self):
"""
Return a dictionary of key/values in the payload received from
the webhook
"""
key_values = {}
for key in self.keys:
if key in self.payload:
key_values[key] = self.payload[key]
return key_values | [
"Return",
"a",
"dictionary",
"of",
"key",
"/",
"values",
"in",
"the",
"payload",
"received",
"from",
"the",
"webhook"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/inbound/parse.py#L18-L27 | [
"def",
"key_values",
"(",
"self",
")",
":",
"key_values",
"=",
"{",
"}",
"for",
"key",
"in",
"self",
".",
"keys",
":",
"if",
"key",
"in",
"self",
".",
"payload",
":",
"key_values",
"[",
"key",
"]",
"=",
"self",
".",
"payload",
"[",
"key",
"]",
"r... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Parse.get_raw_email | This only applies to raw payloads:
https://sendgrid.com/docs/Classroom/Basics/Inbound_Parse_Webhook/setting_up_the_inbound_parse_webhook.html#-Raw-Parameters | sendgrid/helpers/inbound/parse.py | def get_raw_email(self):
"""
This only applies to raw payloads:
https://sendgrid.com/docs/Classroom/Basics/Inbound_Parse_Webhook/setting_up_the_inbound_parse_webhook.html#-Raw-Parameters
"""
if 'email' in self.payload:
raw_email = email.message_from_string(self.payloa... | def get_raw_email(self):
"""
This only applies to raw payloads:
https://sendgrid.com/docs/Classroom/Basics/Inbound_Parse_Webhook/setting_up_the_inbound_parse_webhook.html#-Raw-Parameters
"""
if 'email' in self.payload:
raw_email = email.message_from_string(self.payloa... | [
"This",
"only",
"applies",
"to",
"raw",
"payloads",
":",
"https",
":",
"//",
"sendgrid",
".",
"com",
"/",
"docs",
"/",
"Classroom",
"/",
"Basics",
"/",
"Inbound_Parse_Webhook",
"/",
"setting_up_the_inbound_parse_webhook",
".",
"html#",
"-",
"Raw",
"-",
"Parame... | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/inbound/parse.py#L29-L38 | [
"def",
"get_raw_email",
"(",
"self",
")",
":",
"if",
"'email'",
"in",
"self",
".",
"payload",
":",
"raw_email",
"=",
"email",
".",
"message_from_string",
"(",
"self",
".",
"payload",
"[",
"'email'",
"]",
")",
"return",
"raw_email",
"else",
":",
"return",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Parse.attachments | Returns an object with:
type = file content type
file_name = the name of the file
contents = base64 encoded file contents | sendgrid/helpers/inbound/parse.py | def attachments(self):
"""Returns an object with:
type = file content type
file_name = the name of the file
contents = base64 encoded file contents"""
attachments = None
if 'attachment-info' in self.payload:
attachments = self._get_attachments(self.request)
... | def attachments(self):
"""Returns an object with:
type = file content type
file_name = the name of the file
contents = base64 encoded file contents"""
attachments = None
if 'attachment-info' in self.payload:
attachments = self._get_attachments(self.request)
... | [
"Returns",
"an",
"object",
"with",
":",
"type",
"=",
"file",
"content",
"type",
"file_name",
"=",
"the",
"name",
"of",
"the",
"file",
"contents",
"=",
"base64",
"encoded",
"file",
"contents"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/inbound/parse.py#L40-L52 | [
"def",
"attachments",
"(",
"self",
")",
":",
"attachments",
"=",
"None",
"if",
"'attachment-info'",
"in",
"self",
".",
"payload",
":",
"attachments",
"=",
"self",
".",
"_get_attachments",
"(",
"self",
".",
"request",
")",
"# Check if we have a raw message",
"raw... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | format_ret | decouple, allow for modifications to return type
returns a list of ip addresses in object or json form | sendgrid/helpers/endpoints/ip/unassigned.py | def format_ret(return_set, as_json=False):
""" decouple, allow for modifications to return type
returns a list of ip addresses in object or json form """
ret_list = list()
for item in return_set:
d = {"ip": item}
ret_list.append(d)
if as_json:
return json.dumps(ret_list)... | def format_ret(return_set, as_json=False):
""" decouple, allow for modifications to return type
returns a list of ip addresses in object or json form """
ret_list = list()
for item in return_set:
d = {"ip": item}
ret_list.append(d)
if as_json:
return json.dumps(ret_list)... | [
"decouple",
"allow",
"for",
"modifications",
"to",
"return",
"type",
"returns",
"a",
"list",
"of",
"ip",
"addresses",
"in",
"object",
"or",
"json",
"form"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/endpoints/ip/unassigned.py#L4-L15 | [
"def",
"format_ret",
"(",
"return_set",
",",
"as_json",
"=",
"False",
")",
":",
"ret_list",
"=",
"list",
"(",
")",
"for",
"item",
"in",
"return_set",
":",
"d",
"=",
"{",
"\"ip\"",
":",
"item",
"}",
"ret_list",
".",
"append",
"(",
"d",
")",
"if",
"a... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | unassigned | https://sendgrid.com/docs/API_Reference/api_v3.html#ip-addresses
The /ips rest endpoint returns information about the IP addresses
and the usernames assigned to an IP
unassigned returns a listing of the IP addresses that are allocated
but have 0 users assigned
data (response.b... | sendgrid/helpers/endpoints/ip/unassigned.py | def unassigned(data, as_json=False):
""" https://sendgrid.com/docs/API_Reference/api_v3.html#ip-addresses
The /ips rest endpoint returns information about the IP addresses
and the usernames assigned to an IP
unassigned returns a listing of the IP addresses that are allocated
but hav... | def unassigned(data, as_json=False):
""" https://sendgrid.com/docs/API_Reference/api_v3.html#ip-addresses
The /ips rest endpoint returns information about the IP addresses
and the usernames assigned to an IP
unassigned returns a listing of the IP addresses that are allocated
but hav... | [
"https",
":",
"//",
"sendgrid",
".",
"com",
"/",
"docs",
"/",
"API_Reference",
"/",
"api_v3",
".",
"html#ip",
"-",
"addresses",
"The",
"/",
"ips",
"rest",
"endpoint",
"returns",
"information",
"about",
"the",
"IP",
"addresses",
"and",
"the",
"usernames",
"... | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/endpoints/ip/unassigned.py#L18-L59 | [
"def",
"unassigned",
"(",
"data",
",",
"as_json",
"=",
"False",
")",
":",
"no_subusers",
"=",
"set",
"(",
")",
"if",
"not",
"isinstance",
"(",
"data",
",",
"list",
")",
":",
"return",
"format_ret",
"(",
"no_subusers",
",",
"as_json",
"=",
"as_json",
")... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Personalization.add_to | Add a single recipient to this Personalization.
:type email: Email | sendgrid/helpers/mail/personalization.py | def add_to(self, email):
"""Add a single recipient to this Personalization.
:type email: Email
"""
if email.substitutions:
if isinstance(email.substitutions, list):
for substitution in email.substitutions:
self.add_substitution(substitutio... | def add_to(self, email):
"""Add a single recipient to this Personalization.
:type email: Email
"""
if email.substitutions:
if isinstance(email.substitutions, list):
for substitution in email.substitutions:
self.add_substitution(substitutio... | [
"Add",
"a",
"single",
"recipient",
"to",
"this",
"Personalization",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/personalization.py#L43-L59 | [
"def",
"add_to",
"(",
"self",
",",
"email",
")",
":",
"if",
"email",
".",
"substitutions",
":",
"if",
"isinstance",
"(",
"email",
".",
"substitutions",
",",
"list",
")",
":",
"for",
"substitution",
"in",
"email",
".",
"substitutions",
":",
"self",
".",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Personalization.add_substitution | Add a new Substitution to this Personalization.
:type substitution: Substitution | sendgrid/helpers/mail/personalization.py | def add_substitution(self, substitution):
"""Add a new Substitution to this Personalization.
:type substitution: Substitution
"""
if isinstance(substitution, dict):
self._substitutions.append(substitution)
else:
self._substitutions.append(substitution.get... | def add_substitution(self, substitution):
"""Add a new Substitution to this Personalization.
:type substitution: Substitution
"""
if isinstance(substitution, dict):
self._substitutions.append(substitution)
else:
self._substitutions.append(substitution.get... | [
"Add",
"a",
"new",
"Substitution",
"to",
"this",
"Personalization",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/personalization.py#L147-L155 | [
"def",
"add_substitution",
"(",
"self",
",",
"substitution",
")",
":",
"if",
"isinstance",
"(",
"substitution",
",",
"dict",
")",
":",
"self",
".",
"_substitutions",
".",
"append",
"(",
"substitution",
")",
"else",
":",
"self",
".",
"_substitutions",
".",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Personalization.get | Get a JSON-ready representation of this Personalization.
:returns: This Personalization, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/personalization.py | def get(self):
"""
Get a JSON-ready representation of this Personalization.
:returns: This Personalization, ready for use in a request body.
:rtype: dict
"""
personalization = {}
for key in ['tos', 'ccs', 'bccs']:
value = getattr(self, key)
... | def get(self):
"""
Get a JSON-ready representation of this Personalization.
:returns: This Personalization, ready for use in a request body.
:rtype: dict
"""
personalization = {}
for key in ['tos', 'ccs', 'bccs']:
value = getattr(self, key)
... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"Personalization",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/personalization.py#L203-L230 | [
"def",
"get",
"(",
"self",
")",
":",
"personalization",
"=",
"{",
"}",
"for",
"key",
"in",
"[",
"'tos'",
",",
"'ccs'",
",",
"'bccs'",
"]",
":",
"value",
"=",
"getattr",
"(",
"self",
",",
"key",
")",
"if",
"value",
":",
"personalization",
"[",
"key"... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | CustomArg.get | Get a JSON-ready representation of this CustomArg.
:returns: This CustomArg, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/custom_arg.py | def get(self):
"""
Get a JSON-ready representation of this CustomArg.
:returns: This CustomArg, ready for use in a request body.
:rtype: dict
"""
custom_arg = {}
if self.key is not None and self.value is not None:
custom_arg[self.key] = self.value
... | def get(self):
"""
Get a JSON-ready representation of this CustomArg.
:returns: This CustomArg, ready for use in a request body.
:rtype: dict
"""
custom_arg = {}
if self.key is not None and self.value is not None:
custom_arg[self.key] = self.value
... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"CustomArg",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/custom_arg.py#L84-L94 | [
"def",
"get",
"(",
"self",
")",
":",
"custom_arg",
"=",
"{",
"}",
"if",
"self",
".",
"key",
"is",
"not",
"None",
"and",
"self",
".",
"value",
"is",
"not",
"None",
":",
"custom_arg",
"[",
"self",
".",
"key",
"]",
"=",
"self",
".",
"value",
"return... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Section.get | Get a JSON-ready representation of this Section.
:returns: This Section, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/section.py | def get(self):
"""
Get a JSON-ready representation of this Section.
:returns: This Section, ready for use in a request body.
:rtype: dict
"""
section = {}
if self.key is not None and self.value is not None:
section[self.key] = self.value
retur... | def get(self):
"""
Get a JSON-ready representation of this Section.
:returns: This Section, ready for use in a request body.
:rtype: dict
"""
section = {}
if self.key is not None and self.value is not None:
section[self.key] = self.value
retur... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"Section",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/section.py#L54-L64 | [
"def",
"get",
"(",
"self",
")",
":",
"section",
"=",
"{",
"}",
"if",
"self",
".",
"key",
"is",
"not",
"None",
"and",
"self",
".",
"value",
"is",
"not",
"None",
":",
"section",
"[",
"self",
".",
"key",
"]",
"=",
"self",
".",
"value",
"return",
"... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | ClickTracking.get | Get a JSON-ready representation of this ClickTracking.
:returns: This ClickTracking, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/click_tracking.py | def get(self):
"""
Get a JSON-ready representation of this ClickTracking.
:returns: This ClickTracking, ready for use in a request body.
:rtype: dict
"""
click_tracking = {}
if self.enable is not None:
click_tracking["enable"] = self.enable
i... | def get(self):
"""
Get a JSON-ready representation of this ClickTracking.
:returns: This ClickTracking, ready for use in a request body.
:rtype: dict
"""
click_tracking = {}
if self.enable is not None:
click_tracking["enable"] = self.enable
i... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"ClickTracking",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/click_tracking.py#L58-L71 | [
"def",
"get",
"(",
"self",
")",
":",
"click_tracking",
"=",
"{",
"}",
"if",
"self",
".",
"enable",
"is",
"not",
"None",
":",
"click_tracking",
"[",
"\"enable\"",
"]",
"=",
"self",
".",
"enable",
"if",
"self",
".",
"enable_text",
"is",
"not",
"None",
... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | SubscriptionTracking.get | Get a JSON-ready representation of this SubscriptionTracking.
:returns: This SubscriptionTracking, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/subscription_tracking.py | def get(self):
"""
Get a JSON-ready representation of this SubscriptionTracking.
:returns: This SubscriptionTracking, ready for use in a request body.
:rtype: dict
"""
subscription_tracking = {}
if self.enable is not None:
subscription_tracking["enabl... | def get(self):
"""
Get a JSON-ready representation of this SubscriptionTracking.
:returns: This SubscriptionTracking, ready for use in a request body.
:rtype: dict
"""
subscription_tracking = {}
if self.enable is not None:
subscription_tracking["enabl... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"SubscriptionTracking",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/subscription_tracking.py#L122-L142 | [
"def",
"get",
"(",
"self",
")",
":",
"subscription_tracking",
"=",
"{",
"}",
"if",
"self",
".",
"enable",
"is",
"not",
"None",
":",
"subscription_tracking",
"[",
"\"enable\"",
"]",
"=",
"self",
".",
"enable",
"if",
"self",
".",
"text",
"is",
"not",
"No... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | TrackingSettings.get | Get a JSON-ready representation of this TrackingSettings.
:returns: This TrackingSettings, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/tracking_settings.py | def get(self):
"""
Get a JSON-ready representation of this TrackingSettings.
:returns: This TrackingSettings, ready for use in a request body.
:rtype: dict
"""
tracking_settings = {}
if self.click_tracking is not None:
tracking_settings["click_trackin... | def get(self):
"""
Get a JSON-ready representation of this TrackingSettings.
:returns: This TrackingSettings, ready for use in a request body.
:rtype: dict
"""
tracking_settings = {}
if self.click_tracking is not None:
tracking_settings["click_trackin... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"TrackingSettings",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/tracking_settings.py#L117-L134 | [
"def",
"get",
"(",
"self",
")",
":",
"tracking_settings",
"=",
"{",
"}",
"if",
"self",
".",
"click_tracking",
"is",
"not",
"None",
":",
"tracking_settings",
"[",
"\"click_tracking\"",
"]",
"=",
"self",
".",
"click_tracking",
".",
"get",
"(",
")",
"if",
"... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | OpenTracking.get | Get a JSON-ready representation of this OpenTracking.
:returns: This OpenTracking, ready for use in a request body.
:rtype: dict | sendgrid/helpers/mail/open_tracking.py | def get(self):
"""
Get a JSON-ready representation of this OpenTracking.
:returns: This OpenTracking, ready for use in a request body.
:rtype: dict
"""
open_tracking = {}
if self.enable is not None:
open_tracking["enable"] = self.enable
if se... | def get(self):
"""
Get a JSON-ready representation of this OpenTracking.
:returns: This OpenTracking, ready for use in a request body.
:rtype: dict
"""
open_tracking = {}
if self.enable is not None:
open_tracking["enable"] = self.enable
if se... | [
"Get",
"a",
"JSON",
"-",
"ready",
"representation",
"of",
"this",
"OpenTracking",
"."
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/open_tracking.py#L67-L80 | [
"def",
"get",
"(",
"self",
")",
":",
"open_tracking",
"=",
"{",
"}",
"if",
"self",
".",
"enable",
"is",
"not",
"None",
":",
"open_tracking",
"[",
"\"enable\"",
"]",
"=",
"self",
".",
"enable",
"if",
"self",
".",
"substitution_tag",
"is",
"not",
"None",... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | CategoryStats.get | :return: response stats dict | sendgrid/helpers/stats/stats.py | def get(self):
"""
:return: response stats dict
"""
stats = {}
if self.start_date is not None:
stats["start_date"] = self.start_date
if self.end_date is not None:
stats["end_date"] = self.end_date
if self.aggregated_by is not None:
... | def get(self):
"""
:return: response stats dict
"""
stats = {}
if self.start_date is not None:
stats["start_date"] = self.start_date
if self.end_date is not None:
stats["end_date"] = self.end_date
if self.aggregated_by is not None:
... | [
":",
"return",
":",
"response",
"stats",
"dict"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/stats/stats.py#L108-L130 | [
"def",
"get",
"(",
"self",
")",
":",
"stats",
"=",
"{",
"}",
"if",
"self",
".",
"start_date",
"is",
"not",
"None",
":",
"stats",
"[",
"\"start_date\"",
"]",
"=",
"self",
".",
"start_date",
"if",
"self",
".",
"end_date",
"is",
"not",
"None",
":",
"s... | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Attachment.file_content | The Base64 encoded content of the attachment
:param value: The Base64 encoded content of the attachment
:type value: FileContent, string | sendgrid/helpers/mail/attachment.py | def file_content(self, value):
"""The Base64 encoded content of the attachment
:param value: The Base64 encoded content of the attachment
:type value: FileContent, string
"""
if isinstance(value, FileContent):
self._file_content = value
else:
self... | def file_content(self, value):
"""The Base64 encoded content of the attachment
:param value: The Base64 encoded content of the attachment
:type value: FileContent, string
"""
if isinstance(value, FileContent):
self._file_content = value
else:
self... | [
"The",
"Base64",
"encoded",
"content",
"of",
"the",
"attachment"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/attachment.py#L73-L82 | [
"def",
"file_content",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"FileContent",
")",
":",
"self",
".",
"_file_content",
"=",
"value",
"else",
":",
"self",
".",
"_file_content",
"=",
"FileContent",
"(",
"value",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Attachment.file_name | The filename of the attachment
:param file_name: The filename of the attachment
:type file_name: FileName, string | sendgrid/helpers/mail/attachment.py | def file_name(self, value):
"""The filename of the attachment
:param file_name: The filename of the attachment
:type file_name: FileName, string
"""
if isinstance(value, FileName):
self._file_name = value
else:
self._file_name = FileName(value) | def file_name(self, value):
"""The filename of the attachment
:param file_name: The filename of the attachment
:type file_name: FileName, string
"""
if isinstance(value, FileName):
self._file_name = value
else:
self._file_name = FileName(value) | [
"The",
"filename",
"of",
"the",
"attachment"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/attachment.py#L93-L102 | [
"def",
"file_name",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"FileName",
")",
":",
"self",
".",
"_file_name",
"=",
"value",
"else",
":",
"self",
".",
"_file_name",
"=",
"FileName",
"(",
"value",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
train | Attachment.file_type | The MIME type of the content you are attaching
:param file_type: The MIME type of the content you are attaching
:type file_type FileType, string, optional | sendgrid/helpers/mail/attachment.py | def file_type(self, value):
"""The MIME type of the content you are attaching
:param file_type: The MIME type of the content you are attaching
:type file_type FileType, string, optional
"""
if isinstance(value, FileType):
self._file_type = value
else:
... | def file_type(self, value):
"""The MIME type of the content you are attaching
:param file_type: The MIME type of the content you are attaching
:type file_type FileType, string, optional
"""
if isinstance(value, FileType):
self._file_type = value
else:
... | [
"The",
"MIME",
"type",
"of",
"the",
"content",
"you",
"are",
"attaching"
] | sendgrid/sendgrid-python | python | https://github.com/sendgrid/sendgrid-python/blob/266c2abde7a35dfcce263e06bedc6a0bbdebeac9/sendgrid/helpers/mail/attachment.py#L113-L122 | [
"def",
"file_type",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"FileType",
")",
":",
"self",
".",
"_file_type",
"=",
"value",
"else",
":",
"self",
".",
"_file_type",
"=",
"FileType",
"(",
"value",
")"
] | 266c2abde7a35dfcce263e06bedc6a0bbdebeac9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.