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 | FastlyConnection.get_domain | Get the domain for a particular service and version. | fastly/__init__.py | def get_domain(self, service_id, version_number, name):
"""Get the domain for a particular service and version."""
content = self._fetch("/service/%s/version/%d/domain/%s" % (service_id, version_number, name))
return FastlyDomain(self, content) | def get_domain(self, service_id, version_number, name):
"""Get the domain for a particular service and version."""
content = self._fetch("/service/%s/version/%d/domain/%s" % (service_id, version_number, name))
return FastlyDomain(self, content) | [
"Get",
"the",
"domain",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L417-L420 | [
"def",
"get_domain",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/domain/%s\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")",
")",
"return... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_domain | Update the domain for a particular service and version. | fastly/__init__.py | def update_domain(self, service_id, version_number, name_key, **kwargs):
"""Update the domain for a particular service and version."""
body = self._formdata(kwargs, FastlyDomain.FIELDS)
content = self._fetch("/service/%s/version/%d/domain/%s" % (service_id, version_number, name_key), method="PUT", body=body)
re... | def update_domain(self, service_id, version_number, name_key, **kwargs):
"""Update the domain for a particular service and version."""
body = self._formdata(kwargs, FastlyDomain.FIELDS)
content = self._fetch("/service/%s/version/%d/domain/%s" % (service_id, version_number, name_key), method="PUT", body=body)
re... | [
"Update",
"the",
"domain",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L423-L427 | [
"def",
"update_domain",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name_key",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyDomain",
".",
"FIELDS",
")",
"content",
"=",
"self",
".",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.check_domain | Checks the status of a domain's DNS record. Returns an array of 3 items. The first is the details for the domain. The second is the current CNAME of the domain. The third is a boolean indicating whether or not it has been properly setup to use Fastly. | fastly/__init__.py | def check_domain(self, service_id, version_number, name):
"""Checks the status of a domain's DNS record. Returns an array of 3 items. The first is the details for the domain. The second is the current CNAME of the domain. The third is a boolean indicating whether or not it has been properly setup to use Fastly."""
... | def check_domain(self, service_id, version_number, name):
"""Checks the status of a domain's DNS record. Returns an array of 3 items. The first is the details for the domain. The second is the current CNAME of the domain. The third is a boolean indicating whether or not it has been properly setup to use Fastly."""
... | [
"Checks",
"the",
"status",
"of",
"a",
"domain",
"s",
"DNS",
"record",
".",
"Returns",
"an",
"array",
"of",
"3",
"items",
".",
"The",
"first",
"is",
"the",
"details",
"for",
"the",
"domain",
".",
"The",
"second",
"is",
"the",
"current",
"CNAME",
"of",
... | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L436-L439 | [
"def",
"check_domain",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/domain/%s/check\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")",
")",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.check_domains | Checks the status of all domain DNS records for a Service Version. Returns an array items in the same format as the single domain /check. | fastly/__init__.py | def check_domains(self, service_id, version_number):
"""Checks the status of all domain DNS records for a Service Version. Returns an array items in the same format as the single domain /check."""
content = self._fetch("/service/%s/version/%d/domain/check_all" % (service_id, version_number))
return map(lambda x: ... | def check_domains(self, service_id, version_number):
"""Checks the status of all domain DNS records for a Service Version. Returns an array items in the same format as the single domain /check."""
content = self._fetch("/service/%s/version/%d/domain/check_all" % (service_id, version_number))
return map(lambda x: ... | [
"Checks",
"the",
"status",
"of",
"all",
"domain",
"DNS",
"records",
"for",
"a",
"Service",
"Version",
".",
"Returns",
"an",
"array",
"items",
"in",
"the",
"same",
"format",
"as",
"the",
"single",
"domain",
"/",
"check",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L442-L445 | [
"def",
"check_domains",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/domain/check_all\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"map",
"(",
"la... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_event_log | Get the specified event log. | fastly/__init__.py | def get_event_log(self, object_id):
"""Get the specified event log."""
content = self._fetch("/event_log/%s" % object_id, method="GET")
return FastlyEventLog(self, content) | def get_event_log(self, object_id):
"""Get the specified event log."""
content = self._fetch("/event_log/%s" % object_id, method="GET")
return FastlyEventLog(self, content) | [
"Get",
"the",
"specified",
"event",
"log",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L448-L451 | [
"def",
"get_event_log",
"(",
"self",
",",
"object_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/event_log/%s\"",
"%",
"object_id",
",",
"method",
"=",
"\"GET\"",
")",
"return",
"FastlyEventLog",
"(",
"self",
",",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_headers | Retrieves all Header objects for a particular Version of a Service. | fastly/__init__.py | def list_headers(self, service_id, version_number):
"""Retrieves all Header objects for a particular Version of a Service."""
content = self._fetch("/service/%s/version/%d/header" % (service_id, version_number))
return map(lambda x: FastlyHeader(self, x), content) | def list_headers(self, service_id, version_number):
"""Retrieves all Header objects for a particular Version of a Service."""
content = self._fetch("/service/%s/version/%d/header" % (service_id, version_number))
return map(lambda x: FastlyHeader(self, x), content) | [
"Retrieves",
"all",
"Header",
"objects",
"for",
"a",
"particular",
"Version",
"of",
"a",
"Service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L454-L457 | [
"def",
"list_headers",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/header\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"map",
"(",
"lambda",
"x... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_header | Creates a new Header object. | fastly/__init__.py | def create_header(self, service_id, version_number, name, destination, source, _type=FastlyHeaderType.RESPONSE, action=FastlyHeaderAction.SET, regex=None, substitution=None, ignore_if_set=None, priority=10, response_condition=None, cache_condition=None, request_condition=None):
body = self._formdata({
"name": name... | def create_header(self, service_id, version_number, name, destination, source, _type=FastlyHeaderType.RESPONSE, action=FastlyHeaderAction.SET, regex=None, substitution=None, ignore_if_set=None, priority=10, response_condition=None, cache_condition=None, request_condition=None):
body = self._formdata({
"name": name... | [
"Creates",
"a",
"new",
"Header",
"object",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L460-L477 | [
"def",
"create_header",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
",",
"destination",
",",
"source",
",",
"_type",
"=",
"FastlyHeaderType",
".",
"RESPONSE",
",",
"action",
"=",
"FastlyHeaderAction",
".",
"SET",
",",
"regex",
"=",
"N... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_header | Retrieves a Header object by name. | fastly/__init__.py | def get_header(self, service_id, version_number, name):
"""Retrieves a Header object by name."""
content = self._fetch("/service/%s/version/%d/header/%s" % (service_id, version_number, name))
return FastlyHeader(self, content) | def get_header(self, service_id, version_number, name):
"""Retrieves a Header object by name."""
content = self._fetch("/service/%s/version/%d/header/%s" % (service_id, version_number, name))
return FastlyHeader(self, content) | [
"Retrieves",
"a",
"Header",
"object",
"by",
"name",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L480-L483 | [
"def",
"get_header",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/header/%s\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")",
")",
"return... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_header | Modifies an existing Header object by name. | fastly/__init__.py | def update_header(self, service_id, version_number, name_key, **kwargs):
"""Modifies an existing Header object by name."""
body = self._formdata(kwargs, FastlyHeader.FIELDS)
content = self._fetch("/service/%s/version/%d/header/%s" % (service_id, version_number, name_key), method="PUT", body=body)
return FastlyH... | def update_header(self, service_id, version_number, name_key, **kwargs):
"""Modifies an existing Header object by name."""
body = self._formdata(kwargs, FastlyHeader.FIELDS)
content = self._fetch("/service/%s/version/%d/header/%s" % (service_id, version_number, name_key), method="PUT", body=body)
return FastlyH... | [
"Modifies",
"an",
"existing",
"Header",
"object",
"by",
"name",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L486-L490 | [
"def",
"update_header",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name_key",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyHeader",
".",
"FIELDS",
")",
"content",
"=",
"self",
".",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_healthchecks | List all of the healthchecks for a particular service and version. | fastly/__init__.py | def list_healthchecks(self, service_id, version_number):
"""List all of the healthchecks for a particular service and version."""
content = self._fetch("/service/%s/version/%d/healthcheck" % (service_id, version_number))
return map(lambda x: FastlyHealthCheck(self, x), content) | def list_healthchecks(self, service_id, version_number):
"""List all of the healthchecks for a particular service and version."""
content = self._fetch("/service/%s/version/%d/healthcheck" % (service_id, version_number))
return map(lambda x: FastlyHealthCheck(self, x), content) | [
"List",
"all",
"of",
"the",
"healthchecks",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L499-L502 | [
"def",
"list_healthchecks",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/healthcheck\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"map",
"(",
"lam... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_healthcheck | Create a healthcheck for a particular service and version. | fastly/__init__.py | def create_healthcheck(self,
service_id,
version_number,
name,
host,
method="HEAD",
path="/",
http_version="1.1",
timeout=1000,
check_interval=5000,
expected_response=200,
window=5,
threshold=3,
initial=1):
"""Create a healthcheck for a particular service and version."""
body = self._form... | def create_healthcheck(self,
service_id,
version_number,
name,
host,
method="HEAD",
path="/",
http_version="1.1",
timeout=1000,
check_interval=5000,
expected_response=200,
window=5,
threshold=3,
initial=1):
"""Create a healthcheck for a particular service and version."""
body = self._form... | [
"Create",
"a",
"healthcheck",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L505-L534 | [
"def",
"create_healthcheck",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
",",
"host",
",",
"method",
"=",
"\"HEAD\"",
",",
"path",
"=",
"\"/\"",
",",
"http_version",
"=",
"\"1.1\"",
",",
"timeout",
"=",
"1000",
",",
"check_interval",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_healthcheck | Get the healthcheck for a particular service and version. | fastly/__init__.py | def get_healthcheck(self, service_id, version_number, name):
"""Get the healthcheck for a particular service and version."""
content = self._fetch("/service/%s/version/%d/healthcheck/%s" % (service_id, version_number, name))
return FastlyHealthCheck(self, content) | def get_healthcheck(self, service_id, version_number, name):
"""Get the healthcheck for a particular service and version."""
content = self._fetch("/service/%s/version/%d/healthcheck/%s" % (service_id, version_number, name))
return FastlyHealthCheck(self, content) | [
"Get",
"the",
"healthcheck",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L537-L540 | [
"def",
"get_healthcheck",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/healthcheck/%s\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")",
")",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.purge_url | Purge an individual URL. | fastly/__init__.py | def purge_url(self, host, path):
"""Purge an individual URL."""
content = self._fetch(path, method="PURGE", headers={ "Host": host })
return FastlyPurge(self, content) | def purge_url(self, host, path):
"""Purge an individual URL."""
content = self._fetch(path, method="PURGE", headers={ "Host": host })
return FastlyPurge(self, content) | [
"Purge",
"an",
"individual",
"URL",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L556-L559 | [
"def",
"purge_url",
"(",
"self",
",",
"host",
",",
"path",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"path",
",",
"method",
"=",
"\"PURGE\"",
",",
"headers",
"=",
"{",
"\"Host\"",
":",
"host",
"}",
")",
"return",
"FastlyPurge",
"(",
"self... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.check_purge_status | Get the status and times of a recently completed purge. | fastly/__init__.py | def check_purge_status(self, purge_id):
"""Get the status and times of a recently completed purge."""
content = self._fetch("/purge?id=%s" % purge_id)
return map(lambda x: FastlyPurgeStatus(self, x), content) | def check_purge_status(self, purge_id):
"""Get the status and times of a recently completed purge."""
content = self._fetch("/purge?id=%s" % purge_id)
return map(lambda x: FastlyPurgeStatus(self, x), content) | [
"Get",
"the",
"status",
"and",
"times",
"of",
"a",
"recently",
"completed",
"purge",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L562-L565 | [
"def",
"check_purge_status",
"(",
"self",
",",
"purge_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/purge?id=%s\"",
"%",
"purge_id",
")",
"return",
"map",
"(",
"lambda",
"x",
":",
"FastlyPurgeStatus",
"(",
"self",
",",
"x",
")",
",",
"co... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_request_settings | Returns a list of all Request Settings objects for the given service and version. | fastly/__init__.py | def list_request_settings(self, service_id, version_number):
"""Returns a list of all Request Settings objects for the given service and version."""
content = self._fetch("/service/%s/version/%d/request_settings" % (service_id, version_number))
return map(lambda x: FastlyRequestSetting(self, x), content) | def list_request_settings(self, service_id, version_number):
"""Returns a list of all Request Settings objects for the given service and version."""
content = self._fetch("/service/%s/version/%d/request_settings" % (service_id, version_number))
return map(lambda x: FastlyRequestSetting(self, x), content) | [
"Returns",
"a",
"list",
"of",
"all",
"Request",
"Settings",
"objects",
"for",
"the",
"given",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L568-L571 | [
"def",
"list_request_settings",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/request_settings\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"map",
"(... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_request_setting | Creates a new Request Settings object. | fastly/__init__.py | def create_request_setting(self,
service_id,
version_number,
name,
default_host=None,
force_miss=None,
force_ssl=None,
action=None,
bypass_busy_wait=None,
max_stale_age=None,
hash_keys=None,
xff=None,
timer_support=None,
geo_headers=None,
request_condition=None):
"""Creates a new Request S... | def create_request_setting(self,
service_id,
version_number,
name,
default_host=None,
force_miss=None,
force_ssl=None,
action=None,
bypass_busy_wait=None,
max_stale_age=None,
hash_keys=None,
xff=None,
timer_support=None,
geo_headers=None,
request_condition=None):
"""Creates a new Request S... | [
"Creates",
"a",
"new",
"Request",
"Settings",
"object",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L574-L605 | [
"def",
"create_request_setting",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
",",
"default_host",
"=",
"None",
",",
"force_miss",
"=",
"None",
",",
"force_ssl",
"=",
"None",
",",
"action",
"=",
"None",
",",
"bypass_busy_wait",
"=",
"N... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_request_setting | Gets the specified Request Settings object. | fastly/__init__.py | def get_request_setting(self, service_id, version_number, name):
"""Gets the specified Request Settings object."""
content = self._fetch("/service/%s/version/%d/request_settings/%s" % (service_id, version_number, name))
return FastlyRequestSetting(self, content) | def get_request_setting(self, service_id, version_number, name):
"""Gets the specified Request Settings object."""
content = self._fetch("/service/%s/version/%d/request_settings/%s" % (service_id, version_number, name))
return FastlyRequestSetting(self, content) | [
"Gets",
"the",
"specified",
"Request",
"Settings",
"object",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L608-L611 | [
"def",
"get_request_setting",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/request_settings/%s\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_request_setting | Updates the specified Request Settings object. | fastly/__init__.py | def update_request_setting(self, service_id, version_number, name_key, **kwargs):
"""Updates the specified Request Settings object."""
body = self._formdata(kwargs, FastlyHealthCheck.FIELDS)
content = self._fetch("/service/%s/version/%d/request_settings/%s" % (service_id, version_number, name_key), method="PUT", ... | def update_request_setting(self, service_id, version_number, name_key, **kwargs):
"""Updates the specified Request Settings object."""
body = self._formdata(kwargs, FastlyHealthCheck.FIELDS)
content = self._fetch("/service/%s/version/%d/request_settings/%s" % (service_id, version_number, name_key), method="PUT", ... | [
"Updates",
"the",
"specified",
"Request",
"Settings",
"object",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L614-L618 | [
"def",
"update_request_setting",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name_key",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyHealthCheck",
".",
"FIELDS",
")",
"content",
"=",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_response_objects | Returns all Response Objects for the specified service and version. | fastly/__init__.py | def list_response_objects(self, service_id, version_number):
"""Returns all Response Objects for the specified service and version."""
content = self._fetch("/service/%s/version/%d/response_object" % (service_id, version_number))
return map(lambda x: FastlyResponseObject(self, x), content) | def list_response_objects(self, service_id, version_number):
"""Returns all Response Objects for the specified service and version."""
content = self._fetch("/service/%s/version/%d/response_object" % (service_id, version_number))
return map(lambda x: FastlyResponseObject(self, x), content) | [
"Returns",
"all",
"Response",
"Objects",
"for",
"the",
"specified",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L627-L630 | [
"def",
"list_response_objects",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/response_object\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"map",
"("... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_response_object | Creates a new Response Object. | fastly/__init__.py | def create_response_object(self, service_id, version_number, name, status="200", response="OK", content="", request_condition=None, cache_condition=None):
"""Creates a new Response Object."""
body = self._formdata({
"name": name,
"status": status,
"response": response,
"content": content,
"request_co... | def create_response_object(self, service_id, version_number, name, status="200", response="OK", content="", request_condition=None, cache_condition=None):
"""Creates a new Response Object."""
body = self._formdata({
"name": name,
"status": status,
"response": response,
"content": content,
"request_co... | [
"Creates",
"a",
"new",
"Response",
"Object",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L633-L644 | [
"def",
"create_response_object",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
",",
"status",
"=",
"\"200\"",
",",
"response",
"=",
"\"OK\"",
",",
"content",
"=",
"\"\"",
",",
"request_condition",
"=",
"None",
",",
"cache_condition",
"=",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_response_object | Gets the specified Response Object. | fastly/__init__.py | def get_response_object(self, service_id, version_number, name):
"""Gets the specified Response Object."""
content = self._fetch("/service/%s/version/%d/response_object/%s" % (service_id, version_number, name))
return FastlyResponseObject(self, content) | def get_response_object(self, service_id, version_number, name):
"""Gets the specified Response Object."""
content = self._fetch("/service/%s/version/%d/response_object/%s" % (service_id, version_number, name))
return FastlyResponseObject(self, content) | [
"Gets",
"the",
"specified",
"Response",
"Object",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L647-L650 | [
"def",
"get_response_object",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/response_object/%s\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_response_object | Updates the specified Response Object. | fastly/__init__.py | def update_response_object(self, service_id, version_number, name_key, **kwargs):
"""Updates the specified Response Object."""
body = self._formdata(kwargs, FastlyResponseObject.FIELDS)
content = self._fetch("/service/%s/version/%d/response_object/%s" % (service_id, version_number, name_key), method="PUT", body=b... | def update_response_object(self, service_id, version_number, name_key, **kwargs):
"""Updates the specified Response Object."""
body = self._formdata(kwargs, FastlyResponseObject.FIELDS)
content = self._fetch("/service/%s/version/%d/response_object/%s" % (service_id, version_number, name_key), method="PUT", body=b... | [
"Updates",
"the",
"specified",
"Response",
"Object",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L653-L657 | [
"def",
"update_response_object",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name_key",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyResponseObject",
".",
"FIELDS",
")",
"content",
"=",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_service | Create a service. | fastly/__init__.py | def create_service(self, customer_id, name, publish_key=None, comment=None):
"""Create a service."""
body = self._formdata({
"customer_id": customer_id,
"name": name,
"publish_key": publish_key,
"comment": comment,
}, FastlyService.FIELDS)
content = self._fetch("/service", method="POST", body=body)
... | def create_service(self, customer_id, name, publish_key=None, comment=None):
"""Create a service."""
body = self._formdata({
"customer_id": customer_id,
"name": name,
"publish_key": publish_key,
"comment": comment,
}, FastlyService.FIELDS)
content = self._fetch("/service", method="POST", body=body)
... | [
"Create",
"a",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L666-L675 | [
"def",
"create_service",
"(",
"self",
",",
"customer_id",
",",
"name",
",",
"publish_key",
"=",
"None",
",",
"comment",
"=",
"None",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"{",
"\"customer_id\"",
":",
"customer_id",
",",
"\"name\"",
":",
"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_services | List Services. | fastly/__init__.py | def list_services(self):
"""List Services."""
content = self._fetch("/service")
return map(lambda x: FastlyService(self, x), content) | def list_services(self):
"""List Services."""
content = self._fetch("/service")
return map(lambda x: FastlyService(self, x), content) | [
"List",
"Services",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L678-L681 | [
"def",
"list_services",
"(",
"self",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service\"",
")",
"return",
"map",
"(",
"lambda",
"x",
":",
"FastlyService",
"(",
"self",
",",
"x",
")",
",",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_service | Get a specific service by id. | fastly/__init__.py | def get_service(self, service_id):
"""Get a specific service by id."""
content = self._fetch("/service/%s" % service_id)
return FastlyService(self, content) | def get_service(self, service_id):
"""Get a specific service by id."""
content = self._fetch("/service/%s" % service_id)
return FastlyService(self, content) | [
"Get",
"a",
"specific",
"service",
"by",
"id",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L684-L687 | [
"def",
"get_service",
"(",
"self",
",",
"service_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s\"",
"%",
"service_id",
")",
"return",
"FastlyService",
"(",
"self",
",",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_service_details | List detailed information on a specified service. | fastly/__init__.py | def get_service_details(self, service_id):
"""List detailed information on a specified service."""
content = self._fetch("/service/%s/details" % service_id)
return FastlyService(self, content) | def get_service_details(self, service_id):
"""List detailed information on a specified service."""
content = self._fetch("/service/%s/details" % service_id)
return FastlyService(self, content) | [
"List",
"detailed",
"information",
"on",
"a",
"specified",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L690-L693 | [
"def",
"get_service_details",
"(",
"self",
",",
"service_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/details\"",
"%",
"service_id",
")",
"return",
"FastlyService",
"(",
"self",
",",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_service_by_name | Get a specific service by name. | fastly/__init__.py | def get_service_by_name(self, service_name):
"""Get a specific service by name."""
content = self._fetch("/service/search?name=%s" % service_name)
return FastlyService(self, content) | def get_service_by_name(self, service_name):
"""Get a specific service by name."""
content = self._fetch("/service/search?name=%s" % service_name)
return FastlyService(self, content) | [
"Get",
"a",
"specific",
"service",
"by",
"name",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L696-L699 | [
"def",
"get_service_by_name",
"(",
"self",
",",
"service_name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/search?name=%s\"",
"%",
"service_name",
")",
"return",
"FastlyService",
"(",
"self",
",",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_service | Update a service. | fastly/__init__.py | def update_service(self, service_id, **kwargs):
"""Update a service."""
body = self._formdata(kwargs, FastlyService.FIELDS)
content = self._fetch("/service/%s" % service_id, method="PUT", body=body)
return FastlyService(self, content) | def update_service(self, service_id, **kwargs):
"""Update a service."""
body = self._formdata(kwargs, FastlyService.FIELDS)
content = self._fetch("/service/%s" % service_id, method="PUT", body=body)
return FastlyService(self, content) | [
"Update",
"a",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L702-L706 | [
"def",
"update_service",
"(",
"self",
",",
"service_id",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyService",
".",
"FIELDS",
")",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s\"",
"%"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.delete_service | Delete a service. | fastly/__init__.py | def delete_service(self, service_id):
"""Delete a service."""
content = self._fetch("/service/%s" % service_id, method="DELETE")
return self._status(content) | def delete_service(self, service_id):
"""Delete a service."""
content = self._fetch("/service/%s" % service_id, method="DELETE")
return self._status(content) | [
"Delete",
"a",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L709-L712 | [
"def",
"delete_service",
"(",
"self",
",",
"service_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s\"",
"%",
"service_id",
",",
"method",
"=",
"\"DELETE\"",
")",
"return",
"self",
".",
"_status",
"(",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_domains_by_service | List the domains within a service. | fastly/__init__.py | def list_domains_by_service(self, service_id):
"""List the domains within a service."""
content = self._fetch("/service/%s/domain" % service_id, method="GET")
return map(lambda x: FastlyDomain(self, x), content) | def list_domains_by_service(self, service_id):
"""List the domains within a service."""
content = self._fetch("/service/%s/domain" % service_id, method="GET")
return map(lambda x: FastlyDomain(self, x), content) | [
"List",
"the",
"domains",
"within",
"a",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L715-L718 | [
"def",
"list_domains_by_service",
"(",
"self",
",",
"service_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/domain\"",
"%",
"service_id",
",",
"method",
"=",
"\"GET\"",
")",
"return",
"map",
"(",
"lambda",
"x",
":",
"FastlyDomain",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.purge_service | Purge everything from a service. | fastly/__init__.py | def purge_service(self, service_id):
"""Purge everything from a service."""
content = self._fetch("/service/%s/purge_all" % service_id, method="POST")
return self._status(content) | def purge_service(self, service_id):
"""Purge everything from a service."""
content = self._fetch("/service/%s/purge_all" % service_id, method="POST")
return self._status(content) | [
"Purge",
"everything",
"from",
"a",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L721-L724 | [
"def",
"purge_service",
"(",
"self",
",",
"service_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/purge_all\"",
"%",
"service_id",
",",
"method",
"=",
"\"POST\"",
")",
"return",
"self",
".",
"_status",
"(",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.purge_service_by_key | Purge a particular service by a key. | fastly/__init__.py | def purge_service_by_key(self, service_id, key):
"""Purge a particular service by a key."""
content = self._fetch("/service/%s/purge/%s" % (service_id, key), method="POST")
return self._status(content) | def purge_service_by_key(self, service_id, key):
"""Purge a particular service by a key."""
content = self._fetch("/service/%s/purge/%s" % (service_id, key), method="POST")
return self._status(content) | [
"Purge",
"a",
"particular",
"service",
"by",
"a",
"key",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L727-L730 | [
"def",
"purge_service_by_key",
"(",
"self",
",",
"service_id",
",",
"key",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/purge/%s\"",
"%",
"(",
"service_id",
",",
"key",
")",
",",
"method",
"=",
"\"POST\"",
")",
"return",
"self",
"."... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_settings | Get the settings for a particular service and version. | fastly/__init__.py | def get_settings(self, service_id, version_number):
"""Get the settings for a particular service and version."""
content = self._fetch("/service/%s/version/%d/settings" % (service_id, version_number))
return FastlySettings(self, content) | def get_settings(self, service_id, version_number):
"""Get the settings for a particular service and version."""
content = self._fetch("/service/%s/version/%d/settings" % (service_id, version_number))
return FastlySettings(self, content) | [
"Get",
"the",
"settings",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L733-L736 | [
"def",
"get_settings",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/settings\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"FastlySettings",
"(",
"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_settings | Update the settings for a particular service and version. | fastly/__init__.py | def update_settings(self, service_id, version_number, settings={}):
"""Update the settings for a particular service and version."""
body = urllib.urlencode(settings)
content = self._fetch("/service/%s/version/%d/settings" % (service_id, version_number), method="PUT", body=body)
return FastlySettings(self, conte... | def update_settings(self, service_id, version_number, settings={}):
"""Update the settings for a particular service and version."""
body = urllib.urlencode(settings)
content = self._fetch("/service/%s/version/%d/settings" % (service_id, version_number), method="PUT", body=body)
return FastlySettings(self, conte... | [
"Update",
"the",
"settings",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L739-L743 | [
"def",
"update_settings",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"settings",
"=",
"{",
"}",
")",
":",
"body",
"=",
"urllib",
".",
"urlencode",
"(",
"settings",
")",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/se... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_stats | Get the stats from a service. | fastly/__init__.py | def get_stats(self, service_id, stat_type=FastlyStatsType.ALL):
"""Get the stats from a service."""
content = self._fetch("/service/%s/stats/%s" % (service_id, stat_type))
return content | def get_stats(self, service_id, stat_type=FastlyStatsType.ALL):
"""Get the stats from a service."""
content = self._fetch("/service/%s/stats/%s" % (service_id, stat_type))
return content | [
"Get",
"the",
"stats",
"from",
"a",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L746-L749 | [
"def",
"get_stats",
"(",
"self",
",",
"service_id",
",",
"stat_type",
"=",
"FastlyStatsType",
".",
"ALL",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/stats/%s\"",
"%",
"(",
"service_id",
",",
"stat_type",
")",
")",
"return",
"content... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_syslogs | List all of the Syslogs for a particular service and version. | fastly/__init__.py | def list_syslogs(self, service_id, version_number):
"""List all of the Syslogs for a particular service and version."""
content = self._fetch("/service/%s/version/%d/syslog" % (service_id, version_number))
return map(lambda x: FastlySyslog(self, x), content) | def list_syslogs(self, service_id, version_number):
"""List all of the Syslogs for a particular service and version."""
content = self._fetch("/service/%s/version/%d/syslog" % (service_id, version_number))
return map(lambda x: FastlySyslog(self, x), content) | [
"List",
"all",
"of",
"the",
"Syslogs",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L752-L755 | [
"def",
"list_syslogs",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/syslog\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"map",
"(",
"lambda",
"x... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_syslog | Create a Syslog for a particular service and version. | fastly/__init__.py | def create_syslog(self,
service_id,
version_number,
name,
address,
port=514,
use_tls="0",
tls_ca_cert=None,
token=None,
_format=None,
response_condition=None):
"""Create a Syslog for a particular service and version."""
body = self._formdata({
"name": name,
"address": address,
"port": p... | def create_syslog(self,
service_id,
version_number,
name,
address,
port=514,
use_tls="0",
tls_ca_cert=None,
token=None,
_format=None,
response_condition=None):
"""Create a Syslog for a particular service and version."""
body = self._formdata({
"name": name,
"address": address,
"port": p... | [
"Create",
"a",
"Syslog",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L758-L781 | [
"def",
"create_syslog",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
",",
"address",
",",
"port",
"=",
"514",
",",
"use_tls",
"=",
"\"0\"",
",",
"tls_ca_cert",
"=",
"None",
",",
"token",
"=",
"None",
",",
"_format",
"=",
"None",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_syslog | Get the Syslog for a particular service and version. | fastly/__init__.py | def get_syslog(self, service_id, version_number, name):
"""Get the Syslog for a particular service and version."""
content = self._fetch("/service/%s/version/%d/syslog/%s" % (service_id, version_number, name))
return FastlySyslog(self, content) | def get_syslog(self, service_id, version_number, name):
"""Get the Syslog for a particular service and version."""
content = self._fetch("/service/%s/version/%d/syslog/%s" % (service_id, version_number, name))
return FastlySyslog(self, content) | [
"Get",
"the",
"Syslog",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L784-L787 | [
"def",
"get_syslog",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/syslog/%s\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")",
")",
"return... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_syslog | Update the Syslog for a particular service and version. | fastly/__init__.py | def update_syslog(self, service_id, version_number, name_key, **kwargs):
"""Update the Syslog for a particular service and version."""
body = self._formdata(kwargs, FastlySyslog.FIELDS)
content = self._fetch("/service/%s/version/%d/syslog/%s" % (service_id, version_number, name_key), method="PUT", body=body)
re... | def update_syslog(self, service_id, version_number, name_key, **kwargs):
"""Update the Syslog for a particular service and version."""
body = self._formdata(kwargs, FastlySyslog.FIELDS)
content = self._fetch("/service/%s/version/%d/syslog/%s" % (service_id, version_number, name_key), method="PUT", body=body)
re... | [
"Update",
"the",
"Syslog",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L790-L794 | [
"def",
"update_syslog",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name_key",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlySyslog",
".",
"FIELDS",
")",
"content",
"=",
"self",
".",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.change_password | Update the user's password to a new one. | fastly/__init__.py | def change_password(self, old_password, new_password):
"""Update the user's password to a new one."""
body = self._formdata({
"old_password": old_password,
"password": new_password,
}, ["old_password", "password"])
content = self._fetch("/current_user/password", method="POST", body=body)
return FastlyUs... | def change_password(self, old_password, new_password):
"""Update the user's password to a new one."""
body = self._formdata({
"old_password": old_password,
"password": new_password,
}, ["old_password", "password"])
content = self._fetch("/current_user/password", method="POST", body=body)
return FastlyUs... | [
"Update",
"the",
"user",
"s",
"password",
"to",
"a",
"new",
"one",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L803-L810 | [
"def",
"change_password",
"(",
"self",
",",
"old_password",
",",
"new_password",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"{",
"\"old_password\"",
":",
"old_password",
",",
"\"password\"",
":",
"new_password",
",",
"}",
",",
"[",
"\"old_password\"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_user | Get a specific user. | fastly/__init__.py | def get_user(self, user_id):
"""Get a specific user."""
content = self._fetch("/user/%s" % user_id)
return FastlyUser(self, content) | def get_user(self, user_id):
"""Get a specific user."""
content = self._fetch("/user/%s" % user_id)
return FastlyUser(self, content) | [
"Get",
"a",
"specific",
"user",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L819-L822 | [
"def",
"get_user",
"(",
"self",
",",
"user_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/user/%s\"",
"%",
"user_id",
")",
"return",
"FastlyUser",
"(",
"self",
",",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_user | Create a user. | fastly/__init__.py | def create_user(self, customer_id, name, login, password, role=FastlyRoles.USER, require_new_password=True):
"""Create a user."""
body = self._formdata({
"customer_id": customer_id,
"name": name,
"login": login,
"password": password,
"role": role,
"require_new_password": require_new_password,
},... | def create_user(self, customer_id, name, login, password, role=FastlyRoles.USER, require_new_password=True):
"""Create a user."""
body = self._formdata({
"customer_id": customer_id,
"name": name,
"login": login,
"password": password,
"role": role,
"require_new_password": require_new_password,
},... | [
"Create",
"a",
"user",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L825-L836 | [
"def",
"create_user",
"(",
"self",
",",
"customer_id",
",",
"name",
",",
"login",
",",
"password",
",",
"role",
"=",
"FastlyRoles",
".",
"USER",
",",
"require_new_password",
"=",
"True",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"{",
"\"custo... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_user | Update a user. | fastly/__init__.py | def update_user(self, user_id, **kwargs):
"""Update a user."""
body = self._formdata(kwargs, FastlyUser.FIELDS)
content = self._fetch("/user/%s" % user_id, method="PUT", body=body)
return FastlyUser(self, content) | def update_user(self, user_id, **kwargs):
"""Update a user."""
body = self._formdata(kwargs, FastlyUser.FIELDS)
content = self._fetch("/user/%s" % user_id, method="PUT", body=body)
return FastlyUser(self, content) | [
"Update",
"a",
"user",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L839-L843 | [
"def",
"update_user",
"(",
"self",
",",
"user_id",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyUser",
".",
"FIELDS",
")",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/user/%s\"",
"%",
"user_id... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.delete_user | Delete a user. | fastly/__init__.py | def delete_user(self, user_id):
"""Delete a user."""
content = self._fetch("/user/%s" % user_id, method="DELETE")
return self._status(content) | def delete_user(self, user_id):
"""Delete a user."""
content = self._fetch("/user/%s" % user_id, method="DELETE")
return self._status(content) | [
"Delete",
"a",
"user",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L846-L849 | [
"def",
"delete_user",
"(",
"self",
",",
"user_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/user/%s\"",
"%",
"user_id",
",",
"method",
"=",
"\"DELETE\"",
")",
"return",
"self",
".",
"_status",
"(",
"content",
")"
] | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.request_password_reset | Requests a password reset for the specified user. | fastly/__init__.py | def request_password_reset(self, user_id):
"""Requests a password reset for the specified user."""
content = self._fetch("/user/%s/password/request_reset" % (user_id), method="POST")
return FastlyUser(self, content) | def request_password_reset(self, user_id):
"""Requests a password reset for the specified user."""
content = self._fetch("/user/%s/password/request_reset" % (user_id), method="POST")
return FastlyUser(self, content) | [
"Requests",
"a",
"password",
"reset",
"for",
"the",
"specified",
"user",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L852-L855 | [
"def",
"request_password_reset",
"(",
"self",
",",
"user_id",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/user/%s/password/request_reset\"",
"%",
"(",
"user_id",
")",
",",
"method",
"=",
"\"POST\"",
")",
"return",
"FastlyUser",
"(",
"self",
",",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_vcls | List the uploaded VCLs for a particular service and version. | fastly/__init__.py | def list_vcls(self, service_id, version_number):
"""List the uploaded VCLs for a particular service and version."""
content = self._fetch("/service/%s/version/%d/vcl" % (service_id, version_number))
return map(lambda x: FastlyVCL(self, x), content) | def list_vcls(self, service_id, version_number):
"""List the uploaded VCLs for a particular service and version."""
content = self._fetch("/service/%s/version/%d/vcl" % (service_id, version_number))
return map(lambda x: FastlyVCL(self, x), content) | [
"List",
"the",
"uploaded",
"VCLs",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L858-L861 | [
"def",
"list_vcls",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/vcl\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"map",
"(",
"lambda",
"x",
"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.upload_vcl | Upload a VCL for a particular service and version. | fastly/__init__.py | def upload_vcl(self, service_id, version_number, name, content, main=None, comment=None):
"""Upload a VCL for a particular service and version."""
body = self._formdata({
"name": name,
"content": content,
"comment": comment,
"main": main,
}, FastlyVCL.FIELDS)
content = self._fetch("/service/%s/versi... | def upload_vcl(self, service_id, version_number, name, content, main=None, comment=None):
"""Upload a VCL for a particular service and version."""
body = self._formdata({
"name": name,
"content": content,
"comment": comment,
"main": main,
}, FastlyVCL.FIELDS)
content = self._fetch("/service/%s/versi... | [
"Upload",
"a",
"VCL",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L864-L873 | [
"def",
"upload_vcl",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
",",
"content",
",",
"main",
"=",
"None",
",",
"comment",
"=",
"None",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"{",
"\"name\"",
":",
"name",
",",
"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_vcl | Get the uploaded VCL for a particular service and version. | fastly/__init__.py | def get_vcl(self, service_id, version_number, name, include_content=True):
"""Get the uploaded VCL for a particular service and version."""
content = self._fetch("/service/%s/version/%d/vcl/%s?include_content=%d" % (service_id, version_number, name, int(include_content)))
return FastlyVCL(self, content) | def get_vcl(self, service_id, version_number, name, include_content=True):
"""Get the uploaded VCL for a particular service and version."""
content = self._fetch("/service/%s/version/%d/vcl/%s?include_content=%d" % (service_id, version_number, name, int(include_content)))
return FastlyVCL(self, content) | [
"Get",
"the",
"uploaded",
"VCL",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L882-L885 | [
"def",
"get_vcl",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
",",
"include_content",
"=",
"True",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/vcl/%s?include_content=%d\"",
"%",
"(",
"service_id",
",",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_vcl_html | Get the uploaded VCL for a particular service and version with HTML syntax highlighting. | fastly/__init__.py | def get_vcl_html(self, service_id, version_number, name):
"""Get the uploaded VCL for a particular service and version with HTML syntax highlighting."""
content = self._fetch("/service/%s/version/%d/vcl/%s/content" % (service_id, version_number, name))
return content.get("content", None) | def get_vcl_html(self, service_id, version_number, name):
"""Get the uploaded VCL for a particular service and version with HTML syntax highlighting."""
content = self._fetch("/service/%s/version/%d/vcl/%s/content" % (service_id, version_number, name))
return content.get("content", None) | [
"Get",
"the",
"uploaded",
"VCL",
"for",
"a",
"particular",
"service",
"and",
"version",
"with",
"HTML",
"syntax",
"highlighting",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L888-L891 | [
"def",
"get_vcl_html",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/vcl/%s/content\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")",
")",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_generated_vcl | Display the generated VCL for a particular service and version. | fastly/__init__.py | def get_generated_vcl(self, service_id, version_number):
"""Display the generated VCL for a particular service and version."""
content = self._fetch("/service/%s/version/%d/generated_vcl" % (service_id, version_number))
return FastlyVCL(self, content) | def get_generated_vcl(self, service_id, version_number):
"""Display the generated VCL for a particular service and version."""
content = self._fetch("/service/%s/version/%d/generated_vcl" % (service_id, version_number))
return FastlyVCL(self, content) | [
"Display",
"the",
"generated",
"VCL",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L894-L897 | [
"def",
"get_generated_vcl",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/generated_vcl\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"FastlyVCL",
"("... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_generated_vcl_html | Display the content of generated VCL with HTML syntax highlighting. | fastly/__init__.py | def get_generated_vcl_html(self, service_id, version_number):
"""Display the content of generated VCL with HTML syntax highlighting."""
content = self._fetch("/service/%s/version/%d/generated_vcl/content" % (service_id, version_number))
return content.get("content", None) | def get_generated_vcl_html(self, service_id, version_number):
"""Display the content of generated VCL with HTML syntax highlighting."""
content = self._fetch("/service/%s/version/%d/generated_vcl/content" % (service_id, version_number))
return content.get("content", None) | [
"Display",
"the",
"content",
"of",
"generated",
"VCL",
"with",
"HTML",
"syntax",
"highlighting",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L900-L903 | [
"def",
"get_generated_vcl_html",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/generated_vcl/content\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"cont... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.set_main_vcl | Set the specified VCL as the main. | fastly/__init__.py | def set_main_vcl(self, service_id, version_number, name):
"""Set the specified VCL as the main."""
content = self._fetch("/service/%s/version/%d/vcl/%s/main" % (service_id, version_number, name), method="PUT")
return FastlyVCL(self, content) | def set_main_vcl(self, service_id, version_number, name):
"""Set the specified VCL as the main."""
content = self._fetch("/service/%s/version/%d/vcl/%s/main" % (service_id, version_number, name), method="PUT")
return FastlyVCL(self, content) | [
"Set",
"the",
"specified",
"VCL",
"as",
"the",
"main",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L906-L909 | [
"def",
"set_main_vcl",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/vcl/%s/main\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")",
",",
"me... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_vcl | Update the uploaded VCL for a particular service and version. | fastly/__init__.py | def update_vcl(self, service_id, version_number, name_key, **kwargs):
"""Update the uploaded VCL for a particular service and version."""
body = self._formdata(kwargs, FastlyVCL.FIELDS)
content = self._fetch("/service/%s/version/%d/vcl/%s" % (service_id, version_number, name_key), method="PUT", body=body)
retur... | def update_vcl(self, service_id, version_number, name_key, **kwargs):
"""Update the uploaded VCL for a particular service and version."""
body = self._formdata(kwargs, FastlyVCL.FIELDS)
content = self._fetch("/service/%s/version/%d/vcl/%s" % (service_id, version_number, name_key), method="PUT", body=body)
retur... | [
"Update",
"the",
"uploaded",
"VCL",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L912-L916 | [
"def",
"update_vcl",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name_key",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyVCL",
".",
"FIELDS",
")",
"content",
"=",
"self",
".",
"_f... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_version | Create a version for a particular service. | fastly/__init__.py | def create_version(self, service_id, inherit_service_id=None, comment=None):
"""Create a version for a particular service."""
body = self._formdata({
"service_id": service_id,
"inherit_service_id": inherit_service_id,
"comment": comment,
}, FastlyVersion.FIELDS)
content = self._fetch("/service/%s/versi... | def create_version(self, service_id, inherit_service_id=None, comment=None):
"""Create a version for a particular service."""
body = self._formdata({
"service_id": service_id,
"inherit_service_id": inherit_service_id,
"comment": comment,
}, FastlyVersion.FIELDS)
content = self._fetch("/service/%s/versi... | [
"Create",
"a",
"version",
"for",
"a",
"particular",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L925-L933 | [
"def",
"create_version",
"(",
"self",
",",
"service_id",
",",
"inherit_service_id",
"=",
"None",
",",
"comment",
"=",
"None",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"{",
"\"service_id\"",
":",
"service_id",
",",
"\"inherit_service_id\"",
":",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_version | Get the version for a particular service. | fastly/__init__.py | def get_version(self, service_id, version_number):
"""Get the version for a particular service."""
content = self._fetch("/service/%s/version/%d" % (service_id, version_number))
return FastlyVersion(self, content) | def get_version(self, service_id, version_number):
"""Get the version for a particular service."""
content = self._fetch("/service/%s/version/%d" % (service_id, version_number))
return FastlyVersion(self, content) | [
"Get",
"the",
"version",
"for",
"a",
"particular",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L941-L944 | [
"def",
"get_version",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"FastlyVersion",
"(",
"self",
",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_version | Update a particular version for a particular service. | fastly/__init__.py | def update_version(self, service_id, version_number, **kwargs):
"""Update a particular version for a particular service."""
body = self._formdata(kwargs, FastlyVersion.FIELDS)
content = self._fetch("/service/%s/version/%d/" % (service_id, version_number), method="PUT", body=body)
return FastlyVersion(self, cont... | def update_version(self, service_id, version_number, **kwargs):
"""Update a particular version for a particular service."""
body = self._formdata(kwargs, FastlyVersion.FIELDS)
content = self._fetch("/service/%s/version/%d/" % (service_id, version_number), method="PUT", body=body)
return FastlyVersion(self, cont... | [
"Update",
"a",
"particular",
"version",
"for",
"a",
"particular",
"service",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L946-L950 | [
"def",
"update_version",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyVersion",
".",
"FIELDS",
")",
"content",
"=",
"self",
".",
"_fetch",
"(",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.clone_version | Clone the current configuration into a new version. | fastly/__init__.py | def clone_version(self, service_id, version_number):
"""Clone the current configuration into a new version."""
content = self._fetch("/service/%s/version/%d/clone" % (service_id, version_number), method="PUT")
return FastlyVersion(self, content) | def clone_version(self, service_id, version_number):
"""Clone the current configuration into a new version."""
content = self._fetch("/service/%s/version/%d/clone" % (service_id, version_number), method="PUT")
return FastlyVersion(self, content) | [
"Clone",
"the",
"current",
"configuration",
"into",
"a",
"new",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L953-L956 | [
"def",
"clone_version",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/clone\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
",",
"method",
"=",
"\"PUT\"",
")",
"re... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.activate_version | Activate the current version. | fastly/__init__.py | def activate_version(self, service_id, version_number):
"""Activate the current version."""
content = self._fetch("/service/%s/version/%d/activate" % (service_id, version_number), method="PUT")
return FastlyVersion(self, content) | def activate_version(self, service_id, version_number):
"""Activate the current version."""
content = self._fetch("/service/%s/version/%d/activate" % (service_id, version_number), method="PUT")
return FastlyVersion(self, content) | [
"Activate",
"the",
"current",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L959-L962 | [
"def",
"activate_version",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/activate\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
",",
"method",
"=",
"\"PUT\"",
")",... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.deactivate_version | Deactivate the current version. | fastly/__init__.py | def deactivate_version(self, service_id, version_number):
"""Deactivate the current version."""
content = self._fetch("/service/%s/version/%d/deactivate" % (service_id, version_number), method="PUT")
return FastlyVersion(self, content) | def deactivate_version(self, service_id, version_number):
"""Deactivate the current version."""
content = self._fetch("/service/%s/version/%d/deactivate" % (service_id, version_number), method="PUT")
return FastlyVersion(self, content) | [
"Deactivate",
"the",
"current",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L965-L968 | [
"def",
"deactivate_version",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/deactivate\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
",",
"method",
"=",
"\"PUT\"",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.validate_version | Validate the version for a particular service and version. | fastly/__init__.py | def validate_version(self, service_id, version_number):
"""Validate the version for a particular service and version."""
content = self._fetch("/service/%s/version/%d/validate" % (service_id, version_number))
return self._status(content) | def validate_version(self, service_id, version_number):
"""Validate the version for a particular service and version."""
content = self._fetch("/service/%s/version/%d/validate" % (service_id, version_number))
return self._status(content) | [
"Validate",
"the",
"version",
"for",
"a",
"particular",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L971-L974 | [
"def",
"validate_version",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/validate\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"self",
".",
"_statu... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.lock_version | Locks the specified version. | fastly/__init__.py | def lock_version(self, service_id, version_number):
"""Locks the specified version."""
content = self._fetch("/service/%s/version/%d/lock" % (service_id, version_number))
return self._status(content) | def lock_version(self, service_id, version_number):
"""Locks the specified version."""
content = self._fetch("/service/%s/version/%d/lock" % (service_id, version_number))
return self._status(content) | [
"Locks",
"the",
"specified",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L977-L980 | [
"def",
"lock_version",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/lock\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"self",
".",
"_status",
"(... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.list_wordpressess | Get all of the wordpresses for a specified service and version. | fastly/__init__.py | def list_wordpressess(self, service_id, version_number):
"""Get all of the wordpresses for a specified service and version."""
content = self._fetch("/service/%s/version/%d/wordpress" % (service_id, version_number))
return map(lambda x: FastlyWordpress(self, x), content) | def list_wordpressess(self, service_id, version_number):
"""Get all of the wordpresses for a specified service and version."""
content = self._fetch("/service/%s/version/%d/wordpress" % (service_id, version_number))
return map(lambda x: FastlyWordpress(self, x), content) | [
"Get",
"all",
"of",
"the",
"wordpresses",
"for",
"a",
"specified",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L983-L986 | [
"def",
"list_wordpressess",
"(",
"self",
",",
"service_id",
",",
"version_number",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/wordpress\"",
"%",
"(",
"service_id",
",",
"version_number",
")",
")",
"return",
"map",
"(",
"lambd... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.create_wordpress | Create a wordpress for the specified service and version. | fastly/__init__.py | def create_wordpress(self,
service_id,
version_number,
name,
path,
comment=None):
"""Create a wordpress for the specified service and version."""
body = self._formdata({
"name": name,
"path": path,
"comment": comment,
}, FastlyWordpress.FIELDS)
content = self._fetch("/service/%s/version/%d/wo... | def create_wordpress(self,
service_id,
version_number,
name,
path,
comment=None):
"""Create a wordpress for the specified service and version."""
body = self._formdata({
"name": name,
"path": path,
"comment": comment,
}, FastlyWordpress.FIELDS)
content = self._fetch("/service/%s/version/%d/wo... | [
"Create",
"a",
"wordpress",
"for",
"the",
"specified",
"service",
"and",
"version",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L989-L1002 | [
"def",
"create_wordpress",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
",",
"path",
",",
"comment",
"=",
"None",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"{",
"\"name\"",
":",
"name",
",",
"\"path\"",
":",
"path",
"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.get_wordpress | Get information on a specific wordpress. | fastly/__init__.py | def get_wordpress(self, service_id, version_number, name):
"""Get information on a specific wordpress."""
content = self._fetch("/service/%s/version/%d/wordpress/%s" % (service_id, version_number, name))
return FastlyWordpress(self, content) | def get_wordpress(self, service_id, version_number, name):
"""Get information on a specific wordpress."""
content = self._fetch("/service/%s/version/%d/wordpress/%s" % (service_id, version_number, name))
return FastlyWordpress(self, content) | [
"Get",
"information",
"on",
"a",
"specific",
"wordpress",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L1005-L1008 | [
"def",
"get_wordpress",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name",
")",
":",
"content",
"=",
"self",
".",
"_fetch",
"(",
"\"/service/%s/version/%d/wordpress/%s\"",
"%",
"(",
"service_id",
",",
"version_number",
",",
"name",
")",
")",
"... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FastlyConnection.update_wordpress | Update a specified wordpress. | fastly/__init__.py | def update_wordpress(self, service_id, version_number, name_key, **kwargs):
"""Update a specified wordpress."""
body = self._formdata(kwargs, FastlyWordpress.FIELDS)
content = self._fetch("/service/%s/version/%d/wordpress/%s" % (service_id, version_number, name_key), method="PUT", body=body)
return FastlyWordpr... | def update_wordpress(self, service_id, version_number, name_key, **kwargs):
"""Update a specified wordpress."""
body = self._formdata(kwargs, FastlyWordpress.FIELDS)
content = self._fetch("/service/%s/version/%d/wordpress/%s" % (service_id, version_number, name_key), method="PUT", body=body)
return FastlyWordpr... | [
"Update",
"a",
"specified",
"wordpress",
"."
] | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/fastly/__init__.py#L1011-L1015 | [
"def",
"update_wordpress",
"(",
"self",
",",
"service_id",
",",
"version_number",
",",
"name_key",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"self",
".",
"_formdata",
"(",
"kwargs",
",",
"FastlyWordpress",
".",
"FIELDS",
")",
"content",
"=",
"self",
... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | FinnSyll.annotate | Annotate 'word' for syllabification, stress, weights, and vowels. | finnsyll/syllabifier.py | def annotate(self, word):
'''Annotate 'word' for syllabification, stress, weights, and vowels.'''
info = [] # e.g., [ ('\'nak.su.`tus.ta', 'PUSU', 'HLHL', 'AUUA'), ]
for syllabification, _ in syllabify(self.normalize(word), stress=True):
stresses = ''
weights = ''
... | def annotate(self, word):
'''Annotate 'word' for syllabification, stress, weights, and vowels.'''
info = [] # e.g., [ ('\'nak.su.`tus.ta', 'PUSU', 'HLHL', 'AUUA'), ]
for syllabification, _ in syllabify(self.normalize(word), stress=True):
stresses = ''
weights = ''
... | [
"Annotate",
"word",
"for",
"syllabification",
"stress",
"weights",
"and",
"vowels",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/syllabifier.py#L114-L150 | [
"def",
"annotate",
"(",
"self",
",",
"word",
")",
":",
"info",
"=",
"[",
"]",
"# e.g., [ ('\\'nak.su.`tus.ta', 'PUSU', 'HLHL', 'AUUA'), ]",
"for",
"syllabification",
",",
"_",
"in",
"syllabify",
"(",
"self",
".",
"normalize",
"(",
"word",
")",
",",
"stress",
"... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | SeroSippr.runner | Run the necessary methods in the correct order | serosippr/serosippr.py | def runner(self):
"""
Run the necessary methods in the correct order
"""
logging.info('Starting {} analysis pipeline'.format(self.analysistype))
# Run the analyses
Sippr(self, self.cutoff)
self.serotype_escherichia()
self.serotype_salmonella()
# Cr... | def runner(self):
"""
Run the necessary methods in the correct order
"""
logging.info('Starting {} analysis pipeline'.format(self.analysistype))
# Run the analyses
Sippr(self, self.cutoff)
self.serotype_escherichia()
self.serotype_salmonella()
# Cr... | [
"Run",
"the",
"necessary",
"methods",
"in",
"the",
"correct",
"order"
] | OLC-Bioinformatics/sipprverse | python | https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/serosippr/serosippr.py#L16-L28 | [
"def",
"runner",
"(",
"self",
")",
":",
"logging",
".",
"info",
"(",
"'Starting {} analysis pipeline'",
".",
"format",
"(",
"self",
".",
"analysistype",
")",
")",
"# Run the analyses",
"Sippr",
"(",
"self",
",",
"self",
".",
"cutoff",
")",
"self",
".",
"se... | d4f10cdf8e1a39dac0953db61c21c97efc6006de |
train | SeroSippr.reporter | Creates a report of the results | serosippr/serosippr.py | def reporter(self):
"""
Creates a report of the results
"""
logging.info('Creating {} report'.format(self.analysistype))
# Create the path in which the reports are stored
make_path(self.reportpath)
header = 'Strain,Serotype\n'
data = ''
with open(o... | def reporter(self):
"""
Creates a report of the results
"""
logging.info('Creating {} report'.format(self.analysistype))
# Create the path in which the reports are stored
make_path(self.reportpath)
header = 'Strain,Serotype\n'
data = ''
with open(o... | [
"Creates",
"a",
"report",
"of",
"the",
"results"
] | OLC-Bioinformatics/sipprverse | python | https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/serosippr/serosippr.py#L30-L65 | [
"def",
"reporter",
"(",
"self",
")",
":",
"logging",
".",
"info",
"(",
"'Creating {} report'",
".",
"format",
"(",
"self",
".",
"analysistype",
")",
")",
"# Create the path in which the reports are stored",
"make_path",
"(",
"self",
".",
"reportpath",
")",
"header... | d4f10cdf8e1a39dac0953db61c21c97efc6006de |
train | SeroSippr.serotype_escherichia | Create attributes storing the best results for the O and H types | serosippr/serosippr.py | def serotype_escherichia(self):
"""
Create attributes storing the best results for the O and H types
"""
for sample in self.runmetadata.samples:
# Initialise negative results to be overwritten when necessary
sample[self.analysistype].best_o_pid = '-'
s... | def serotype_escherichia(self):
"""
Create attributes storing the best results for the O and H types
"""
for sample in self.runmetadata.samples:
# Initialise negative results to be overwritten when necessary
sample[self.analysistype].best_o_pid = '-'
s... | [
"Create",
"attributes",
"storing",
"the",
"best",
"results",
"for",
"the",
"O",
"and",
"H",
"types"
] | OLC-Bioinformatics/sipprverse | python | https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/serosippr/serosippr.py#L67-L108 | [
"def",
"serotype_escherichia",
"(",
"self",
")",
":",
"for",
"sample",
"in",
"self",
".",
"runmetadata",
".",
"samples",
":",
"# Initialise negative results to be overwritten when necessary",
"sample",
"[",
"self",
".",
"analysistype",
"]",
".",
"best_o_pid",
"=",
"... | d4f10cdf8e1a39dac0953db61c21c97efc6006de |
train | _syllabify | Syllabify the given word. | finnsyll/prev/v02.py | def _syllabify(word):
'''Syllabify the given word.'''
word = replace_umlauts(word)
word, CONTINUE_VV, CONTINUE_VVV, applied_rules = apply_T1(word)
if CONTINUE_VV:
word, T2 = apply_T2(word)
word, T4 = apply_T4(word)
applied_rules += T2 + T4
if CONTINUE_VVV:
word, T5 ... | def _syllabify(word):
'''Syllabify the given word.'''
word = replace_umlauts(word)
word, CONTINUE_VV, CONTINUE_VVV, applied_rules = apply_T1(word)
if CONTINUE_VV:
word, T2 = apply_T2(word)
word, T4 = apply_T4(word)
applied_rules += T2 + T4
if CONTINUE_VVV:
word, T5 ... | [
"Syllabify",
"the",
"given",
"word",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v02.py#L36-L54 | [
"def",
"_syllabify",
"(",
"word",
")",
":",
"word",
"=",
"replace_umlauts",
"(",
"word",
")",
"word",
",",
"CONTINUE_VV",
",",
"CONTINUE_VVV",
",",
"applied_rules",
"=",
"apply_T1",
"(",
"word",
")",
"if",
"CONTINUE_VV",
":",
"word",
",",
"T2",
"=",
"app... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T1 | There is a syllable boundary in front of every CV-sequence. | finnsyll/prev/v02.py | def apply_T1(word):
'''There is a syllable boundary in front of every CV-sequence.'''
T1 = ' T1'
WORD = _split_consonants_and_vowels(word)
CONTINUE_VV = 0
CONTINUE_VVV = 0
for i, v in enumerate(WORD):
if i == 0 and is_consonant(v[0][0]):
continue
elif is_consonant(... | def apply_T1(word):
'''There is a syllable boundary in front of every CV-sequence.'''
T1 = ' T1'
WORD = _split_consonants_and_vowels(word)
CONTINUE_VV = 0
CONTINUE_VVV = 0
for i, v in enumerate(WORD):
if i == 0 and is_consonant(v[0][0]):
continue
elif is_consonant(... | [
"There",
"is",
"a",
"syllable",
"boundary",
"in",
"front",
"of",
"every",
"CV",
"-",
"sequence",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v02.py#L59-L84 | [
"def",
"apply_T1",
"(",
"word",
")",
":",
"T1",
"=",
"' T1'",
"WORD",
"=",
"_split_consonants_and_vowels",
"(",
"word",
")",
"CONTINUE_VV",
"=",
"0",
"CONTINUE_VVV",
"=",
"0",
"for",
"i",
",",
"v",
"in",
"enumerate",
"(",
"WORD",
")",
":",
"if",
"i",
... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T2 | There is a syllable boundary within a sequence VV of two nonidentical
vowels that are not a genuine diphthong, e.g., [ta.e], [ko.et.taa]. | finnsyll/prev/v02.py | def apply_T2(word):
'''There is a syllable boundary within a sequence VV of two nonidentical
vowels that are not a genuine diphthong, e.g., [ta.e], [ko.et.taa].'''
T2 = ''
WORD = word.split('.')
for i, v in enumerate(WORD):
if not contains_diphthong(v):
VV = contains_VV(v)
... | def apply_T2(word):
'''There is a syllable boundary within a sequence VV of two nonidentical
vowels that are not a genuine diphthong, e.g., [ta.e], [ko.et.taa].'''
T2 = ''
WORD = word.split('.')
for i, v in enumerate(WORD):
if not contains_diphthong(v):
VV = contains_VV(v)
... | [
"There",
"is",
"a",
"syllable",
"boundary",
"within",
"a",
"sequence",
"VV",
"of",
"two",
"nonidentical",
"vowels",
"that",
"are",
"not",
"a",
"genuine",
"diphthong",
"e",
".",
"g",
".",
"[",
"ta",
".",
"e",
"]",
"[",
"ko",
".",
"et",
".",
"taa",
"... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v02.py#L118-L136 | [
"def",
"apply_T2",
"(",
"word",
")",
":",
"T2",
"=",
"''",
"WORD",
"=",
"word",
".",
"split",
"(",
"'.'",
")",
"for",
"i",
",",
"v",
"in",
"enumerate",
"(",
"WORD",
")",
":",
"if",
"not",
"contains_diphthong",
"(",
"v",
")",
":",
"VV",
"=",
"co... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T4 | An agglutination diphthong that ends in /u, y/ usually contains a
syllable boundary when -C# or -CCV follow, e.g., [lau.ka.us],
[va.ka.ut.taa]. | finnsyll/prev/v02.py | def apply_T4(word):
'''An agglutination diphthong that ends in /u, y/ usually contains a
syllable boundary when -C# or -CCV follow, e.g., [lau.ka.us],
[va.ka.ut.taa].'''
T4 = ''
WORD = word.split('.')
for i, v in enumerate(WORD):
# i % 2 != 0 prevents this rule from applying to first, ... | def apply_T4(word):
'''An agglutination diphthong that ends in /u, y/ usually contains a
syllable boundary when -C# or -CCV follow, e.g., [lau.ka.us],
[va.ka.ut.taa].'''
T4 = ''
WORD = word.split('.')
for i, v in enumerate(WORD):
# i % 2 != 0 prevents this rule from applying to first, ... | [
"An",
"agglutination",
"diphthong",
"that",
"ends",
"in",
"/",
"u",
"y",
"/",
"usually",
"contains",
"a",
"syllable",
"boundary",
"when",
"-",
"C#",
"or",
"-",
"CCV",
"follow",
"e",
".",
"g",
".",
"[",
"lau",
".",
"ka",
".",
"us",
"]",
"[",
"va",
... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v02.py#L141-L168 | [
"def",
"apply_T4",
"(",
"word",
")",
":",
"T4",
"=",
"''",
"WORD",
"=",
"word",
".",
"split",
"(",
"'.'",
")",
"for",
"i",
",",
"v",
"in",
"enumerate",
"(",
"WORD",
")",
":",
"# i % 2 != 0 prevents this rule from applying to first, third, etc.",
"# syllables, ... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T5 | If a (V)VVV-sequence contains a VV-sequence that could be an /i/-final
diphthong, there is a syllable boundary between it and the third vowel,
e.g., [raa.ois.sa], [huo.uim.me], [la.eis.sa], [sel.vi.äi.si], [tai.an],
[säi.e], [oi.om.me]. | finnsyll/prev/v02.py | def apply_T5(word): # BROKEN
'''If a (V)VVV-sequence contains a VV-sequence that could be an /i/-final
diphthong, there is a syllable boundary between it and the third vowel,
e.g., [raa.ois.sa], [huo.uim.me], [la.eis.sa], [sel.vi.äi.si], [tai.an],
[säi.e], [oi.om.me].'''
T5 = ''
WORD = word.spl... | def apply_T5(word): # BROKEN
'''If a (V)VVV-sequence contains a VV-sequence that could be an /i/-final
diphthong, there is a syllable boundary between it and the third vowel,
e.g., [raa.ois.sa], [huo.uim.me], [la.eis.sa], [sel.vi.äi.si], [tai.an],
[säi.e], [oi.om.me].'''
T5 = ''
WORD = word.spl... | [
"If",
"a",
"(",
"V",
")",
"VVV",
"-",
"sequence",
"contains",
"a",
"VV",
"-",
"sequence",
"that",
"could",
"be",
"an",
"/",
"i",
"/",
"-",
"final",
"diphthong",
"there",
"is",
"a",
"syllable",
"boundary",
"between",
"it",
"and",
"the",
"third",
"vowe... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v02.py#L176-L193 | [
"def",
"apply_T5",
"(",
"word",
")",
":",
"# BROKEN",
"T5",
"=",
"''",
"WORD",
"=",
"word",
".",
"split",
"(",
"'.'",
")",
"for",
"i",
",",
"v",
"in",
"enumerate",
"(",
"WORD",
")",
":",
"if",
"contains_VVV",
"(",
"v",
")",
"and",
"any",
"(",
"... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T6 | If a VVV-sequence contains a long vowel, there is a syllable boundary
between it and the third vowel, e.g. [kor.ke.aa], [yh.ti.öön], [ruu.an],
[mää.yt.te]. | finnsyll/prev/v02.py | def apply_T6(word):
'''If a VVV-sequence contains a long vowel, there is a syllable boundary
between it and the third vowel, e.g. [kor.ke.aa], [yh.ti.öön], [ruu.an],
[mää.yt.te].'''
T6 = ''
WORD = word.split('.')
for i, v in enumerate(WORD):
if contains_VVV(v):
VV = [v.find... | def apply_T6(word):
'''If a VVV-sequence contains a long vowel, there is a syllable boundary
between it and the third vowel, e.g. [kor.ke.aa], [yh.ti.öön], [ruu.an],
[mää.yt.te].'''
T6 = ''
WORD = word.split('.')
for i, v in enumerate(WORD):
if contains_VVV(v):
VV = [v.find... | [
"If",
"a",
"VVV",
"-",
"sequence",
"contains",
"a",
"long",
"vowel",
"there",
"is",
"a",
"syllable",
"boundary",
"between",
"it",
"and",
"the",
"third",
"vowel",
"e",
".",
"g",
".",
"[",
"kor",
".",
"ke",
".",
"aa",
"]",
"[",
"yh",
".",
"ti",
"."... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v02.py#L201-L226 | [
"def",
"apply_T6",
"(",
"word",
")",
":",
"T6",
"=",
"''",
"WORD",
"=",
"word",
".",
"split",
"(",
"'.'",
")",
"for",
"i",
",",
"v",
"in",
"enumerate",
"(",
"WORD",
")",
":",
"if",
"contains_VVV",
"(",
"v",
")",
":",
"VV",
"=",
"[",
"v",
".",... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T7 | If a VVV-sequence does not contain a potential /i/-final diphthong,
there is a syllable boundary between the second and third vowels, e.g.
[kau.an], [leu.an], [kiu.as]. | finnsyll/prev/v02.py | def apply_T7(word):
'''If a VVV-sequence does not contain a potential /i/-final diphthong,
there is a syllable boundary between the second and third vowels, e.g.
[kau.an], [leu.an], [kiu.as].'''
T7 = ''
WORD = word.split('.')
for i, v in enumerate(WORD):
if contains_VVV(v):
... | def apply_T7(word):
'''If a VVV-sequence does not contain a potential /i/-final diphthong,
there is a syllable boundary between the second and third vowels, e.g.
[kau.an], [leu.an], [kiu.as].'''
T7 = ''
WORD = word.split('.')
for i, v in enumerate(WORD):
if contains_VVV(v):
... | [
"If",
"a",
"VVV",
"-",
"sequence",
"does",
"not",
"contain",
"a",
"potential",
"/",
"i",
"/",
"-",
"final",
"diphthong",
"there",
"is",
"a",
"syllable",
"boundary",
"between",
"the",
"second",
"and",
"third",
"vowels",
"e",
".",
"g",
".",
"[",
"kau",
... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v02.py#L231-L250 | [
"def",
"apply_T7",
"(",
"word",
")",
":",
"T7",
"=",
"''",
"WORD",
"=",
"word",
".",
"split",
"(",
"'.'",
")",
"for",
"i",
",",
"v",
"in",
"enumerate",
"(",
"WORD",
")",
":",
"if",
"contains_VVV",
"(",
"v",
")",
":",
"for",
"I",
",",
"V",
"in... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | main | Upload a vcl file to a fastly service, cloning the current version if
necessary. The uploaded vcl is set as main unless --include is given.
All existing vcl files will be deleted first if --delete is given. | bin/fastly_upload_vcl.py | def main():
"""
Upload a vcl file to a fastly service, cloning the current version if
necessary. The uploaded vcl is set as main unless --include is given.
All existing vcl files will be deleted first if --delete is given.
"""
parser = OptionParser(description=
"Upload ... | def main():
"""
Upload a vcl file to a fastly service, cloning the current version if
necessary. The uploaded vcl is set as main unless --include is given.
All existing vcl files will be deleted first if --delete is given.
"""
parser = OptionParser(description=
"Upload ... | [
"Upload",
"a",
"vcl",
"file",
"to",
"a",
"fastly",
"service",
"cloning",
"the",
"current",
"version",
"if",
"necessary",
".",
"The",
"uploaded",
"vcl",
"is",
"set",
"as",
"main",
"unless",
"--",
"include",
"is",
"given",
".",
"All",
"existing",
"vcl",
"f... | obulpathi/cdn-fastly-python | python | https://github.com/obulpathi/cdn-fastly-python/blob/db2564b047e8af4bce72c3b88d6c27d3d0291425/bin/fastly_upload_vcl.py#L34-L111 | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"OptionParser",
"(",
"description",
"=",
"\"Upload a vcl file (set as main) to a given fastly service. All arguments are required.\"",
")",
"parser",
".",
"add_option",
"(",
"\"-k\"",
",",
"\"--key\"",
",",
"dest",
"=",
"\"ap... | db2564b047e8af4bce72c3b88d6c27d3d0291425 |
train | CustomGenes.main | Run the necessary methods in the correct order | customsippr/customsippr.py | def main(self):
"""
Run the necessary methods in the correct order
"""
self.target_validate()
self.gene_names()
Sippr(inputobject=self,
k=self.kmer_size,
allow_soft_clips=self.allow_soft_clips)
self.report() | def main(self):
"""
Run the necessary methods in the correct order
"""
self.target_validate()
self.gene_names()
Sippr(inputobject=self,
k=self.kmer_size,
allow_soft_clips=self.allow_soft_clips)
self.report() | [
"Run",
"the",
"necessary",
"methods",
"in",
"the",
"correct",
"order"
] | OLC-Bioinformatics/sipprverse | python | https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/customsippr/customsippr.py#L13-L22 | [
"def",
"main",
"(",
"self",
")",
":",
"self",
".",
"target_validate",
"(",
")",
"self",
".",
"gene_names",
"(",
")",
"Sippr",
"(",
"inputobject",
"=",
"self",
",",
"k",
"=",
"self",
".",
"kmer_size",
",",
"allow_soft_clips",
"=",
"self",
".",
"allow_so... | d4f10cdf8e1a39dac0953db61c21c97efc6006de |
train | CustomGenes.gene_names | Extract the names of the user-supplied targets | customsippr/customsippr.py | def gene_names(self):
"""
Extract the names of the user-supplied targets
"""
# Iterate through all the target names in the formatted targets file
for record in SeqIO.parse(self.targets, 'fasta'):
# Append all the gene names to the list of names
self.genes.... | def gene_names(self):
"""
Extract the names of the user-supplied targets
"""
# Iterate through all the target names in the formatted targets file
for record in SeqIO.parse(self.targets, 'fasta'):
# Append all the gene names to the list of names
self.genes.... | [
"Extract",
"the",
"names",
"of",
"the",
"user",
"-",
"supplied",
"targets"
] | OLC-Bioinformatics/sipprverse | python | https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/customsippr/customsippr.py#L32-L39 | [
"def",
"gene_names",
"(",
"self",
")",
":",
"# Iterate through all the target names in the formatted targets file",
"for",
"record",
"in",
"SeqIO",
".",
"parse",
"(",
"self",
".",
"targets",
",",
"'fasta'",
")",
":",
"# Append all the gene names to the list of names",
"se... | d4f10cdf8e1a39dac0953db61c21c97efc6006de |
train | CustomGenes.report | Create the report for the user-supplied targets | customsippr/customsippr.py | def report(self):
"""
Create the report for the user-supplied targets
"""
# Add all the genes to the header
header = 'Sample,'
data = str()
with open(os.path.join(self.reportpath, '{at}.csv'.format(at=self.analysistype)), 'w') as report:
write_header =... | def report(self):
"""
Create the report for the user-supplied targets
"""
# Add all the genes to the header
header = 'Sample,'
data = str()
with open(os.path.join(self.reportpath, '{at}.csv'.format(at=self.analysistype)), 'w') as report:
write_header =... | [
"Create",
"the",
"report",
"for",
"the",
"user",
"-",
"supplied",
"targets"
] | OLC-Bioinformatics/sipprverse | python | https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/customsippr/customsippr.py#L41-L81 | [
"def",
"report",
"(",
"self",
")",
":",
"# Add all the genes to the header",
"header",
"=",
"'Sample,'",
"data",
"=",
"str",
"(",
")",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"reportpath",
",",
"'{at}.csv'",
".",
"format",
... | d4f10cdf8e1a39dac0953db61c21c97efc6006de |
train | Tels.on_add | Convert to pseuso acces | pyDLib/GUI/fields.py | def on_add(self, item):
"""Convert to pseuso acces"""
super(Tels, self).on_add(list_views.PseudoAccesCategorie(item)) | def on_add(self, item):
"""Convert to pseuso acces"""
super(Tels, self).on_add(list_views.PseudoAccesCategorie(item)) | [
"Convert",
"to",
"pseuso",
"acces"
] | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/GUI/fields.py#L70-L72 | [
"def",
"on_add",
"(",
"self",
",",
"item",
")",
":",
"super",
"(",
"Tels",
",",
"self",
")",
".",
"on_add",
"(",
"list_views",
".",
"PseudoAccesCategorie",
"(",
"item",
")",
")"
] | 16be28e99837e40287a63803bbfdf67ac1806b7b |
train | Duree.set_data | we cant to call set_data to manually update | pyDLib/GUI/fields.py | def set_data(self, *args):
"""we cant to call set_data to manually update"""
db = self.begining.get_data() or formats.DATE_DEFAULT
df = self.end.get_data() or formats.DATE_DEFAULT
jours = max((df - db).days + 1, 0)
self.setText(str(jours) + (jours >= 2 and " jours" or " jour")) | def set_data(self, *args):
"""we cant to call set_data to manually update"""
db = self.begining.get_data() or formats.DATE_DEFAULT
df = self.end.get_data() or formats.DATE_DEFAULT
jours = max((df - db).days + 1, 0)
self.setText(str(jours) + (jours >= 2 and " jours" or " jour")) | [
"we",
"cant",
"to",
"call",
"set_data",
"to",
"manually",
"update"
] | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/GUI/fields.py#L95-L100 | [
"def",
"set_data",
"(",
"self",
",",
"*",
"args",
")",
":",
"db",
"=",
"self",
".",
"begining",
".",
"get_data",
"(",
")",
"or",
"formats",
".",
"DATE_DEFAULT",
"df",
"=",
"self",
".",
"end",
".",
"get_data",
"(",
")",
"or",
"formats",
".",
"DATE_D... | 16be28e99837e40287a63803bbfdf67ac1806b7b |
train | GeneSippr.runner | Run the necessary methods in the correct order | genesippr/genesippr.py | def runner(self):
"""
Run the necessary methods in the correct order
"""
logging.info('Starting {} analysis pipeline'.format(self.analysistype))
if not self.pipeline:
general = None
for sample in self.runmetadata.samples:
general = getattr(... | def runner(self):
"""
Run the necessary methods in the correct order
"""
logging.info('Starting {} analysis pipeline'.format(self.analysistype))
if not self.pipeline:
general = None
for sample in self.runmetadata.samples:
general = getattr(... | [
"Run",
"the",
"necessary",
"methods",
"in",
"the",
"correct",
"order"
] | OLC-Bioinformatics/sipprverse | python | https://github.com/OLC-Bioinformatics/sipprverse/blob/d4f10cdf8e1a39dac0953db61c21c97efc6006de/genesippr/genesippr.py#L19-L39 | [
"def",
"runner",
"(",
"self",
")",
":",
"logging",
".",
"info",
"(",
"'Starting {} analysis pipeline'",
".",
"format",
"(",
"self",
".",
"analysistype",
")",
")",
"if",
"not",
"self",
".",
"pipeline",
":",
"general",
"=",
"None",
"for",
"sample",
"in",
"... | d4f10cdf8e1a39dac0953db61c21c97efc6006de |
train | same_syllabic_feature | Return True if ch1 and ch2 are both vowels or both consonants. | finnsyll/prev/v01.py | def same_syllabic_feature(ch1, ch2):
'''Return True if ch1 and ch2 are both vowels or both consonants.'''
if ch1 == '.' or ch2 == '.':
return False
ch1 = 'V' if ch1 in VOWELS else 'C' if ch1 in CONSONANTS else None
ch2 = 'V' if ch2 in VOWELS else 'C' if ch2 in CONSONANTS else None
return c... | def same_syllabic_feature(ch1, ch2):
'''Return True if ch1 and ch2 are both vowels or both consonants.'''
if ch1 == '.' or ch2 == '.':
return False
ch1 = 'V' if ch1 in VOWELS else 'C' if ch1 in CONSONANTS else None
ch2 = 'V' if ch2 in VOWELS else 'C' if ch2 in CONSONANTS else None
return c... | [
"Return",
"True",
"if",
"ch1",
"and",
"ch2",
"are",
"both",
"vowels",
"or",
"both",
"consonants",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v01.py#L14-L22 | [
"def",
"same_syllabic_feature",
"(",
"ch1",
",",
"ch2",
")",
":",
"if",
"ch1",
"==",
"'.'",
"or",
"ch2",
"==",
"'.'",
":",
"return",
"False",
"ch1",
"=",
"'V'",
"if",
"ch1",
"in",
"VOWELS",
"else",
"'C'",
"if",
"ch1",
"in",
"CONSONANTS",
"else",
"Non... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | syllabify | Syllabify the given word. | finnsyll/prev/v01.py | def syllabify(word):
'''Syllabify the given word.'''
word = replace_umlauts(word)
word = apply_T1(word)
word = apply_T2(word)
word = apply_T4(word)
word = apply_T5(word)
word = apply_T6(word)
word = apply_T7(word)
word = replace_umlauts(word, put_back=True)[1:] # FENCEPOST
r... | def syllabify(word):
'''Syllabify the given word.'''
word = replace_umlauts(word)
word = apply_T1(word)
word = apply_T2(word)
word = apply_T4(word)
word = apply_T5(word)
word = apply_T6(word)
word = apply_T7(word)
word = replace_umlauts(word, put_back=True)[1:] # FENCEPOST
r... | [
"Syllabify",
"the",
"given",
"word",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v01.py#L56-L70 | [
"def",
"syllabify",
"(",
"word",
")",
":",
"word",
"=",
"replace_umlauts",
"(",
"word",
")",
"word",
"=",
"apply_T1",
"(",
"word",
")",
"word",
"=",
"apply_T2",
"(",
"word",
")",
"word",
"=",
"apply_T4",
"(",
"word",
")",
"word",
"=",
"apply_T5",
"("... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T1 | There is a syllable boundary in front of every CV-sequence. | finnsyll/prev/v01.py | def apply_T1(word):
'''There is a syllable boundary in front of every CV-sequence.'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if k == 1 and is_consonantal_onset(v):
WORD[k] = '.' + v
elif is_consonant(v[0]) and WORD.get(k + 1, 0):
WO... | def apply_T1(word):
'''There is a syllable boundary in front of every CV-sequence.'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if k == 1 and is_consonantal_onset(v):
WORD[k] = '.' + v
elif is_consonant(v[0]) and WORD.get(k + 1, 0):
WO... | [
"There",
"is",
"a",
"syllable",
"boundary",
"in",
"front",
"of",
"every",
"CV",
"-",
"sequence",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v01.py#L75-L89 | [
"def",
"apply_T1",
"(",
"word",
")",
":",
"WORD",
"=",
"_split_consonants_and_vowels",
"(",
"word",
")",
"for",
"k",
",",
"v",
"in",
"WORD",
".",
"iteritems",
"(",
")",
":",
"if",
"k",
"==",
"1",
"and",
"is_consonantal_onset",
"(",
"v",
")",
":",
"WO... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T2 | There is a syllable boundary within a sequence VV of two nonidentical
that are not a genuine diphthong, e.g., [ta.e], [ko.et.taa]. | finnsyll/prev/v01.py | def apply_T2(word):
'''There is a syllable boundary within a sequence VV of two nonidentical
that are not a genuine diphthong, e.g., [ta.e], [ko.et.taa].'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if is_diphthong(v):
continue
if len(v) == 2 ... | def apply_T2(word):
'''There is a syllable boundary within a sequence VV of two nonidentical
that are not a genuine diphthong, e.g., [ta.e], [ko.et.taa].'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if is_diphthong(v):
continue
if len(v) == 2 ... | [
"There",
"is",
"a",
"syllable",
"boundary",
"within",
"a",
"sequence",
"VV",
"of",
"two",
"nonidentical",
"that",
"are",
"not",
"a",
"genuine",
"diphthong",
"e",
".",
"g",
".",
"[",
"ta",
".",
"e",
"]",
"[",
"ko",
".",
"et",
".",
"taa",
"]",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v01.py#L94-L111 | [
"def",
"apply_T2",
"(",
"word",
")",
":",
"WORD",
"=",
"_split_consonants_and_vowels",
"(",
"word",
")",
"for",
"k",
",",
"v",
"in",
"WORD",
".",
"iteritems",
"(",
")",
":",
"if",
"is_diphthong",
"(",
"v",
")",
":",
"continue",
"if",
"len",
"(",
"v",... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T4 | An agglutination diphthong that ends in /u, y/ usually contains a
syllable boundary when -C# or -CCV follow, e.g., [lau.ka.us],
[va.ka.ut.taa]. | finnsyll/prev/v01.py | def apply_T4(word): # OPTIMIZE
'''An agglutination diphthong that ends in /u, y/ usually contains a
syllable boundary when -C# or -CCV follow, e.g., [lau.ka.us],
[va.ka.ut.taa].'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if len(v) == 2 and v.endswith(('u', ... | def apply_T4(word): # OPTIMIZE
'''An agglutination diphthong that ends in /u, y/ usually contains a
syllable boundary when -C# or -CCV follow, e.g., [lau.ka.us],
[va.ka.ut.taa].'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if len(v) == 2 and v.endswith(('u', ... | [
"An",
"agglutination",
"diphthong",
"that",
"ends",
"in",
"/",
"u",
"y",
"/",
"usually",
"contains",
"a",
"syllable",
"boundary",
"when",
"-",
"C#",
"or",
"-",
"CCV",
"follow",
"e",
".",
"g",
".",
"[",
"lau",
".",
"ka",
".",
"us",
"]",
"[",
"va",
... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v01.py#L116-L141 | [
"def",
"apply_T4",
"(",
"word",
")",
":",
"# OPTIMIZE",
"WORD",
"=",
"_split_consonants_and_vowels",
"(",
"word",
")",
"for",
"k",
",",
"v",
"in",
"WORD",
".",
"iteritems",
"(",
")",
":",
"if",
"len",
"(",
"v",
")",
"==",
"2",
"and",
"v",
".",
"end... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T5 | If a (V)VVV-sequence contains a VV-sequence that could be an /i/-final
diphthong, there is a syllable boundary between it and the third vowel,
e.g., [raa.ois.sa], [huo.uim.me], [la.eis.sa], [sel.vi.äi.si], [tai.an],
[säi.e], [oi.om.me]. | finnsyll/prev/v01.py | def apply_T5(word):
'''If a (V)VVV-sequence contains a VV-sequence that could be an /i/-final
diphthong, there is a syllable boundary between it and the third vowel,
e.g., [raa.ois.sa], [huo.uim.me], [la.eis.sa], [sel.vi.äi.si], [tai.an],
[säi.e], [oi.om.me].'''
WORD = _split_consonants_and_vowels(w... | def apply_T5(word):
'''If a (V)VVV-sequence contains a VV-sequence that could be an /i/-final
diphthong, there is a syllable boundary between it and the third vowel,
e.g., [raa.ois.sa], [huo.uim.me], [la.eis.sa], [sel.vi.äi.si], [tai.an],
[säi.e], [oi.om.me].'''
WORD = _split_consonants_and_vowels(w... | [
"If",
"a",
"(",
"V",
")",
"VVV",
"-",
"sequence",
"contains",
"a",
"VV",
"-",
"sequence",
"that",
"could",
"be",
"an",
"/",
"i",
"/",
"-",
"final",
"diphthong",
"there",
"is",
"a",
"syllable",
"boundary",
"between",
"it",
"and",
"the",
"third",
"vowe... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v01.py#L149-L172 | [
"def",
"apply_T5",
"(",
"word",
")",
":",
"WORD",
"=",
"_split_consonants_and_vowels",
"(",
"word",
")",
"for",
"k",
",",
"v",
"in",
"WORD",
".",
"iteritems",
"(",
")",
":",
"if",
"len",
"(",
"v",
")",
">=",
"3",
"and",
"is_vowel",
"(",
"v",
"[",
... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T6 | If a VVV-sequence contains a long vowel, there is a syllable boundary
between it and the third vowel, e.g. [kor.ke.aa], [yh.ti.öön], [ruu.an],
[mää.yt.te]. | finnsyll/prev/v01.py | def apply_T6(word):
'''If a VVV-sequence contains a long vowel, there is a syllable boundary
between it and the third vowel, e.g. [kor.ke.aa], [yh.ti.öön], [ruu.an],
[mää.yt.te].'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if len(v) == 3 and is_vowel(v[0]):
... | def apply_T6(word):
'''If a VVV-sequence contains a long vowel, there is a syllable boundary
between it and the third vowel, e.g. [kor.ke.aa], [yh.ti.öön], [ruu.an],
[mää.yt.te].'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if len(v) == 3 and is_vowel(v[0]):
... | [
"If",
"a",
"VVV",
"-",
"sequence",
"contains",
"a",
"long",
"vowel",
"there",
"is",
"a",
"syllable",
"boundary",
"between",
"it",
"and",
"the",
"third",
"vowel",
"e",
".",
"g",
".",
"[",
"kor",
".",
"ke",
".",
"aa",
"]",
"[",
"yh",
".",
"ti",
"."... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v01.py#L180-L202 | [
"def",
"apply_T6",
"(",
"word",
")",
":",
"WORD",
"=",
"_split_consonants_and_vowels",
"(",
"word",
")",
"for",
"k",
",",
"v",
"in",
"WORD",
".",
"iteritems",
"(",
")",
":",
"if",
"len",
"(",
"v",
")",
"==",
"3",
"and",
"is_vowel",
"(",
"v",
"[",
... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | apply_T7 | If a VVV-sequence does not contain a potential /i/-final diphthong,
there is a syllable boundary between the second and third vowels, e.g.
[kau.an], [leu.an], [kiu.as]. | finnsyll/prev/v01.py | def apply_T7(word):
'''If a VVV-sequence does not contain a potential /i/-final diphthong,
there is a syllable boundary between the second and third vowels, e.g.
[kau.an], [leu.an], [kiu.as].'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if len(v) == 3 and is_v... | def apply_T7(word):
'''If a VVV-sequence does not contain a potential /i/-final diphthong,
there is a syllable boundary between the second and third vowels, e.g.
[kau.an], [leu.an], [kiu.as].'''
WORD = _split_consonants_and_vowels(word)
for k, v in WORD.iteritems():
if len(v) == 3 and is_v... | [
"If",
"a",
"VVV",
"-",
"sequence",
"does",
"not",
"contain",
"a",
"potential",
"/",
"i",
"/",
"-",
"final",
"diphthong",
"there",
"is",
"a",
"syllable",
"boundary",
"between",
"the",
"second",
"and",
"third",
"vowels",
"e",
".",
"g",
".",
"[",
"kau",
... | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v01.py#L207-L220 | [
"def",
"apply_T7",
"(",
"word",
")",
":",
"WORD",
"=",
"_split_consonants_and_vowels",
"(",
"word",
")",
"for",
"k",
",",
"v",
"in",
"WORD",
".",
"iteritems",
"(",
")",
":",
"if",
"len",
"(",
"v",
")",
"==",
"3",
"and",
"is_vowel",
"(",
"v",
"[",
... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | syllabify | Syllabify the given word, whether simplex or complex. | finnsyll/prev/v12.py | def syllabify(word):
'''Syllabify the given word, whether simplex or complex.'''
compound = not word.isalpha()
syllabify = _syllabify_complex if compound else _syllabify_simplex
syllabifications = list(syllabify(word))
# if variation, order variants from most preferred to least preferred
if len... | def syllabify(word):
'''Syllabify the given word, whether simplex or complex.'''
compound = not word.isalpha()
syllabify = _syllabify_complex if compound else _syllabify_simplex
syllabifications = list(syllabify(word))
# if variation, order variants from most preferred to least preferred
if len... | [
"Syllabify",
"the",
"given",
"word",
"whether",
"simplex",
"or",
"complex",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v12.py#L17-L28 | [
"def",
"syllabify",
"(",
"word",
")",
":",
"compound",
"=",
"not",
"word",
".",
"isalpha",
"(",
")",
"syllabify",
"=",
"_syllabify_complex",
"if",
"compound",
"else",
"_syllabify_simplex",
"syllabifications",
"=",
"list",
"(",
"syllabify",
"(",
"word",
")",
... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | wsp | Return the number of unstressed superheavy syllables. | finnsyll/prev/v12.py | def wsp(word):
'''Return the number of unstressed superheavy syllables.'''
violations = 0
unstressed = []
for w in extract_words(word):
unstressed += w.split('.')[1::2] # even syllables
# include extrametrical odd syllables as potential WSP violations
if w.count('.') % 2 == 0:... | def wsp(word):
'''Return the number of unstressed superheavy syllables.'''
violations = 0
unstressed = []
for w in extract_words(word):
unstressed += w.split('.')[1::2] # even syllables
# include extrametrical odd syllables as potential WSP violations
if w.count('.') % 2 == 0:... | [
"Return",
"the",
"number",
"of",
"unstressed",
"superheavy",
"syllables",
"."
] | tsnaomi/finnsyll | python | https://github.com/tsnaomi/finnsyll/blob/6a42740311688c946a636a3e2304866c7aa041b3/finnsyll/prev/v12.py#L359-L383 | [
"def",
"wsp",
"(",
"word",
")",
":",
"violations",
"=",
"0",
"unstressed",
"=",
"[",
"]",
"for",
"w",
"in",
"extract_words",
"(",
"word",
")",
":",
"unstressed",
"+=",
"w",
".",
"split",
"(",
"'.'",
")",
"[",
"1",
":",
":",
"2",
"]",
"# even syll... | 6a42740311688c946a636a3e2304866c7aa041b3 |
train | abstractAcces.modifie | Store the modification. `value` should be dumped in DB compatible format. | pyDLib/Core/data_model.py | def modifie(self, key: str, value: Any) -> None:
"""Store the modification. `value` should be dumped in DB compatible format."""
if key in self.FIELDS_OPTIONS:
self.modifie_options(key, value)
else:
self.modifications[key] = value | def modifie(self, key: str, value: Any) -> None:
"""Store the modification. `value` should be dumped in DB compatible format."""
if key in self.FIELDS_OPTIONS:
self.modifie_options(key, value)
else:
self.modifications[key] = value | [
"Store",
"the",
"modification",
".",
"value",
"should",
"be",
"dumped",
"in",
"DB",
"compatible",
"format",
"."
] | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/Core/data_model.py#L57-L62 | [
"def",
"modifie",
"(",
"self",
",",
"key",
":",
"str",
",",
"value",
":",
"Any",
")",
"->",
"None",
":",
"if",
"key",
"in",
"self",
".",
"FIELDS_OPTIONS",
":",
"self",
".",
"modifie_options",
"(",
"key",
",",
"value",
")",
"else",
":",
"self",
".",... | 16be28e99837e40287a63803bbfdf67ac1806b7b |
train | abstractAcces.modifie_many | Convenience function which calls modifie on each element of dic | pyDLib/Core/data_model.py | def modifie_many(self, dic: dict):
"""Convenience function which calls modifie on each element of dic"""
for i, v in dic.items():
self.modifie(i, v) | def modifie_many(self, dic: dict):
"""Convenience function which calls modifie on each element of dic"""
for i, v in dic.items():
self.modifie(i, v) | [
"Convenience",
"function",
"which",
"calls",
"modifie",
"on",
"each",
"element",
"of",
"dic"
] | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/Core/data_model.py#L64-L67 | [
"def",
"modifie_many",
"(",
"self",
",",
"dic",
":",
"dict",
")",
":",
"for",
"i",
",",
"v",
"in",
"dic",
".",
"items",
"(",
")",
":",
"self",
".",
"modifie",
"(",
"i",
",",
"v",
")"
] | 16be28e99837e40287a63803bbfdf67ac1806b7b |
train | abstractAcces.save | Prepare a SQL request to save the current modifications.
Returns actually a LIST of requests (which may be of length one).
Note than it can include modifications on other part of the data.
After succes, the base should be updated. | pyDLib/Core/data_model.py | def save(self) -> sql.Executant:
"""Prepare a SQL request to save the current modifications.
Returns actually a LIST of requests (which may be of length one).
Note than it can include modifications on other part of the data.
After succes, the base should be updated.
"""
r... | def save(self) -> sql.Executant:
"""Prepare a SQL request to save the current modifications.
Returns actually a LIST of requests (which may be of length one).
Note than it can include modifications on other part of the data.
After succes, the base should be updated.
"""
r... | [
"Prepare",
"a",
"SQL",
"request",
"to",
"save",
"the",
"current",
"modifications",
".",
"Returns",
"actually",
"a",
"LIST",
"of",
"requests",
"(",
"which",
"may",
"be",
"of",
"length",
"one",
")",
".",
"Note",
"than",
"it",
"can",
"include",
"modifications... | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/Core/data_model.py#L73-L81 | [
"def",
"save",
"(",
"self",
")",
"->",
"sql",
".",
"Executant",
":",
"r",
"=",
"self",
".",
"_dict_to_SQL",
"(",
"self",
".",
"modifications",
")",
"self",
".",
"modifications",
".",
"clear",
"(",
")",
"return",
"r"
] | 16be28e99837e40287a63803bbfdf67ac1806b7b |
train | abstractAcces.modifie_options | Set options in modifications.
All options will be stored since it should be grouped in the DB. | pyDLib/Core/data_model.py | def modifie_options(self, field_option, value):
"""Set options in modifications.
All options will be stored since it should be grouped in the DB."""
options = dict(self["options"] or {}, **{field_option: value})
self.modifications["options"] = options | def modifie_options(self, field_option, value):
"""Set options in modifications.
All options will be stored since it should be grouped in the DB."""
options = dict(self["options"] or {}, **{field_option: value})
self.modifications["options"] = options | [
"Set",
"options",
"in",
"modifications",
".",
"All",
"options",
"will",
"be",
"stored",
"since",
"it",
"should",
"be",
"grouped",
"in",
"the",
"DB",
"."
] | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/Core/data_model.py#L86-L90 | [
"def",
"modifie_options",
"(",
"self",
",",
"field_option",
",",
"value",
")",
":",
"options",
"=",
"dict",
"(",
"self",
"[",
"\"options\"",
"]",
"or",
"{",
"}",
",",
"*",
"*",
"{",
"field_option",
":",
"value",
"}",
")",
"self",
".",
"modifications",
... | 16be28e99837e40287a63803bbfdf67ac1806b7b |
train | abstractDictTable._from_dict_dict | Takes a dict {id : dict_attributes} | pyDLib/Core/data_model.py | def _from_dict_dict(cls, dic):
"""Takes a dict {id : dict_attributes} """
return cls({_convert_id(i): v for i, v in dic.items()}) | def _from_dict_dict(cls, dic):
"""Takes a dict {id : dict_attributes} """
return cls({_convert_id(i): v for i, v in dic.items()}) | [
"Takes",
"a",
"dict",
"{",
"id",
":",
"dict_attributes",
"}"
] | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/Core/data_model.py#L114-L116 | [
"def",
"_from_dict_dict",
"(",
"cls",
",",
"dic",
")",
":",
"return",
"cls",
"(",
"{",
"_convert_id",
"(",
"i",
")",
":",
"v",
"for",
"i",
",",
"v",
"in",
"dic",
".",
"items",
"(",
")",
"}",
")"
] | 16be28e99837e40287a63803bbfdf67ac1806b7b |
train | abstractDictTable._from_list_dict | Takes a list of dict like objects and uses `champ_id` field as Id | pyDLib/Core/data_model.py | def _from_list_dict(cls, list_dic):
"""Takes a list of dict like objects and uses `champ_id` field as Id"""
return cls({_convert_id(dic[cls.CHAMP_ID]): dict(dic) for dic in list_dic}) | def _from_list_dict(cls, list_dic):
"""Takes a list of dict like objects and uses `champ_id` field as Id"""
return cls({_convert_id(dic[cls.CHAMP_ID]): dict(dic) for dic in list_dic}) | [
"Takes",
"a",
"list",
"of",
"dict",
"like",
"objects",
"and",
"uses",
"champ_id",
"field",
"as",
"Id"
] | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/Core/data_model.py#L119-L121 | [
"def",
"_from_list_dict",
"(",
"cls",
",",
"list_dic",
")",
":",
"return",
"cls",
"(",
"{",
"_convert_id",
"(",
"dic",
"[",
"cls",
".",
"CHAMP_ID",
"]",
")",
":",
"dict",
"(",
"dic",
")",
"for",
"dic",
"in",
"list_dic",
"}",
")"
] | 16be28e99837e40287a63803bbfdf67ac1806b7b |
train | abstractDictTable.base_recherche_rapide | Return a collection of access matching `pattern`.
`to_string_hook` is an optionnal callable dict -> str to map record to string. Default to _record_to_string | pyDLib/Core/data_model.py | def base_recherche_rapide(self, base, pattern, to_string_hook=None):
"""
Return a collection of access matching `pattern`.
`to_string_hook` is an optionnal callable dict -> str to map record to string. Default to _record_to_string
"""
Ac = self.ACCES
if pattern == "*":
... | def base_recherche_rapide(self, base, pattern, to_string_hook=None):
"""
Return a collection of access matching `pattern`.
`to_string_hook` is an optionnal callable dict -> str to map record to string. Default to _record_to_string
"""
Ac = self.ACCES
if pattern == "*":
... | [
"Return",
"a",
"collection",
"of",
"access",
"matching",
"pattern",
".",
"to_string_hook",
"is",
"an",
"optionnal",
"callable",
"dict",
"-",
">",
"str",
"to",
"map",
"record",
"to",
"string",
".",
"Default",
"to",
"_record_to_string"
] | benoitkugler/abstractDataLibrary | python | https://github.com/benoitkugler/abstractDataLibrary/blob/16be28e99837e40287a63803bbfdf67ac1806b7b/pyDLib/Core/data_model.py#L141-L167 | [
"def",
"base_recherche_rapide",
"(",
"self",
",",
"base",
",",
"pattern",
",",
"to_string_hook",
"=",
"None",
")",
":",
"Ac",
"=",
"self",
".",
"ACCES",
"if",
"pattern",
"==",
"\"*\"",
":",
"return",
"groups",
".",
"Collection",
"(",
"Ac",
"(",
"base",
... | 16be28e99837e40287a63803bbfdf67ac1806b7b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.