repository_name stringlengths 7 54 | func_path_in_repository stringlengths 5 179 | func_name stringlengths 1 109 | whole_func_string stringlengths 100 30.9k | language stringclasses 1
value | func_code_string stringlengths 100 30.9k | func_code_tokens listlengths 20 3.12k | func_documentation_string stringlengths 1 29.9k | func_documentation_tokens listlengths 1 893 | split_name stringclasses 1
value | func_code_url stringlengths 91 272 | formatted_prompt stringlengths 344 61k | input_ids listlengths 512 512 | attention_mask listlengths 512 512 | labels listlengths 512 512 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
zalando/patroni | patroni/postgresql.py | Postgresql.restore_configuration_files | def restore_configuration_files(self):
""" restore a previously saved postgresql.conf """
try:
for f in self._configuration_to_save:
config_file = os.path.join(self._config_dir, f)
backup_file = os.path.join(self._data_dir, f + '.backup')
if no... | python | def restore_configuration_files(self):
""" restore a previously saved postgresql.conf """
try:
for f in self._configuration_to_save:
config_file = os.path.join(self._config_dir, f)
backup_file = os.path.join(self._data_dir, f + '.backup')
if no... | [
"def",
"restore_configuration_files",
"(",
"self",
")",
":",
"try",
":",
"for",
"f",
"in",
"self",
".",
"_configuration_to_save",
":",
"config_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_config_dir",
",",
"f",
")",
"backup_file",
"=",
... | restore a previously saved postgresql.conf | [
"restore",
"a",
"previously",
"saved",
"postgresql",
".",
"conf"
] | train | https://github.com/zalando/patroni/blob/f6d29081c90af52064b981cdd877a07338d86038/patroni/postgresql.py#L1532-L1545 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
restore a previously saved postgresql.conf
### Response:
def restore_configuration_files(self):
""" restore a previous... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
31904,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
31904,
... |
fabioz/PyDev.Debugger | pydevd_attach_to_process/winappdbg/breakpoint.py | _BufferWatchCondition.remove | def remove(self, bw):
"""
Removes a buffer watch identifier.
@type bw: L{BufferWatch}
@param bw:
Buffer watch identifier.
@raise KeyError: The buffer watch identifier was already removed.
"""
try:
self.__ranges.remove(bw)
except ... | python | def remove(self, bw):
"""
Removes a buffer watch identifier.
@type bw: L{BufferWatch}
@param bw:
Buffer watch identifier.
@raise KeyError: The buffer watch identifier was already removed.
"""
try:
self.__ranges.remove(bw)
except ... | [
"def",
"remove",
"(",
"self",
",",
"bw",
")",
":",
"try",
":",
"self",
".",
"__ranges",
".",
"remove",
"(",
"bw",
")",
"except",
"KeyError",
":",
"if",
"not",
"bw",
".",
"oneshot",
":",
"raise"
] | Removes a buffer watch identifier.
@type bw: L{BufferWatch}
@param bw:
Buffer watch identifier.
@raise KeyError: The buffer watch identifier was already removed. | [
"Removes",
"a",
"buffer",
"watch",
"identifier",
"."
] | train | https://github.com/fabioz/PyDev.Debugger/blob/ed9c4307662a5593b8a7f1f3389ecd0e79b8c503/pydevd_attach_to_process/winappdbg/breakpoint.py#L1840-L1854 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Removes a buffer watch identifier.
@type bw: L{BufferWatch}
@param bw:
Buffer watch identifier.
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6728,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6728,
... |
SamLau95/nbinteract | nbinteract/cli.py | yes_or_no | def yes_or_no(question, default="yes"):
"""Ask a yes/no question via input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no" or None (meaning
an answer is requ... | python | def yes_or_no(question, default="yes"):
"""Ask a yes/no question via input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no" or None (meaning
an answer is requ... | [
"def",
"yes_or_no",
"(",
"question",
",",
"default",
"=",
"\"yes\"",
")",
":",
"valid",
"=",
"{",
"\"yes\"",
":",
"True",
",",
"\"y\"",
":",
"True",
",",
"\"ye\"",
":",
"True",
",",
"\"no\"",
":",
"False",
",",
"\"n\"",
":",
"False",
"}",
"if",
"de... | Ask a yes/no question via input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no" or None (meaning
an answer is required of the user).
The "answer" return val... | [
"Ask",
"a",
"yes",
"/",
"no",
"question",
"via",
"input",
"()",
"and",
"return",
"their",
"answer",
"."
] | train | https://github.com/SamLau95/nbinteract/blob/9f346452283831aad3f4416c04879f1d187ec3b7/nbinteract/cli.py#L126-L159 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Ask a yes/no question via input() and return their answer.
"question" is a string that is presented to the user.
"defa... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
27264,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
27264,
... |
jbittel/django-mama-cas | mama_cas/callbacks.py | user_model_attributes | def user_model_attributes(user, service):
"""
Return all fields on the user object that are not in the list
of fields to ignore.
"""
ignore_fields = ['id', 'password']
attributes = {}
for field in user._meta.fields:
if field.name not in ignore_fields:
attributes[field.nam... | python | def user_model_attributes(user, service):
"""
Return all fields on the user object that are not in the list
of fields to ignore.
"""
ignore_fields = ['id', 'password']
attributes = {}
for field in user._meta.fields:
if field.name not in ignore_fields:
attributes[field.nam... | [
"def",
"user_model_attributes",
"(",
"user",
",",
"service",
")",
":",
"ignore_fields",
"=",
"[",
"'id'",
",",
"'password'",
"]",
"attributes",
"=",
"{",
"}",
"for",
"field",
"in",
"user",
".",
"_meta",
".",
"fields",
":",
"if",
"field",
".",
"name",
"... | Return all fields on the user object that are not in the list
of fields to ignore. | [
"Return",
"all",
"fields",
"on",
"the",
"user",
"object",
"that",
"are",
"not",
"in",
"the",
"list",
"of",
"fields",
"to",
"ignore",
"."
] | train | https://github.com/jbittel/django-mama-cas/blob/03935d97442b46d8127ab9e1cd8deb96953fe156/mama_cas/callbacks.py#L10-L20 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Return all fields on the user object that are not in the list
of fields to ignore.
### Response:
def user_model_attributes... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5715,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5715,
... |
sentinel-hub/sentinelhub-py | sentinelhub/download.py | _check_if_must_download | def _check_if_must_download(request_list, redownload):
"""
Updates request.will_download attribute of each request in request_list.
**Note:** the function mutates the elements of the list!
:param request_list: a list of ``DownloadRequest`` instances
:type: list[DownloadRequest]
:param redownlo... | python | def _check_if_must_download(request_list, redownload):
"""
Updates request.will_download attribute of each request in request_list.
**Note:** the function mutates the elements of the list!
:param request_list: a list of ``DownloadRequest`` instances
:type: list[DownloadRequest]
:param redownlo... | [
"def",
"_check_if_must_download",
"(",
"request_list",
",",
"redownload",
")",
":",
"for",
"request",
"in",
"request_list",
":",
"request",
".",
"will_download",
"=",
"(",
"request",
".",
"save_response",
"or",
"request",
".",
"return_data",
")",
"and",
"(",
"... | Updates request.will_download attribute of each request in request_list.
**Note:** the function mutates the elements of the list!
:param request_list: a list of ``DownloadRequest`` instances
:type: list[DownloadRequest]
:param redownload: tells whether to download the data again or not
:type: bool | [
"Updates",
"request",
".",
"will_download",
"attribute",
"of",
"each",
"request",
"in",
"request_list",
"."
] | train | https://github.com/sentinel-hub/sentinelhub-py/blob/08a83b7f1e289187159a643336995d8369860fea/sentinelhub/download.py#L202-L215 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Updates request.will_download attribute of each request in request_list.
**Note:** the function mutates the elements of th... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
38191,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
38191,
... |
Telefonica/toolium | toolium/pageelements/page_element.py | PageElement.web_element | def web_element(self):
"""Find WebElement using element locator
:returns: web element object
:rtype: selenium.webdriver.remote.webelement.WebElement or appium.webdriver.webelement.WebElement
"""
try:
self._find_web_element()
except NoSuchElementException as e... | python | def web_element(self):
"""Find WebElement using element locator
:returns: web element object
:rtype: selenium.webdriver.remote.webelement.WebElement or appium.webdriver.webelement.WebElement
"""
try:
self._find_web_element()
except NoSuchElementException as e... | [
"def",
"web_element",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_find_web_element",
"(",
")",
"except",
"NoSuchElementException",
"as",
"exception",
":",
"parent_msg",
"=",
"\" and parent locator '{}'\"",
".",
"format",
"(",
"self",
".",
"parent",
")",
... | Find WebElement using element locator
:returns: web element object
:rtype: selenium.webdriver.remote.webelement.WebElement or appium.webdriver.webelement.WebElement | [
"Find",
"WebElement",
"using",
"element",
"locator"
] | train | https://github.com/Telefonica/toolium/blob/56847c243b3a98876df74c184b75e43f8810e475/toolium/pageelements/page_element.py#L68-L82 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Find WebElement using element locator
:returns: web element object
:rtype: selenium.webdriver.remote.webelemen... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10086,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10086,
... |
pyviz/imagen | imagen/image.py | GenericImage._process_channels | def _process_channels(self,p,**params_to_override):
"""
Add the channel information to the channel_data attribute.
"""
orig_image = self._image
for i in range(len(self._channel_data)):
self._image = self._original_channel_data[i]
self._channel_data[i] = s... | python | def _process_channels(self,p,**params_to_override):
"""
Add the channel information to the channel_data attribute.
"""
orig_image = self._image
for i in range(len(self._channel_data)):
self._image = self._original_channel_data[i]
self._channel_data[i] = s... | [
"def",
"_process_channels",
"(",
"self",
",",
"p",
",",
"*",
"*",
"params_to_override",
")",
":",
"orig_image",
"=",
"self",
".",
"_image",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_channel_data",
")",
")",
":",
"self",
".",
"_image",
... | Add the channel information to the channel_data attribute. | [
"Add",
"the",
"channel",
"information",
"to",
"the",
"channel_data",
"attribute",
"."
] | train | https://github.com/pyviz/imagen/blob/53c5685c880f54b42795964d8db50b02e8590e88/imagen/image.py#L322-L332 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Add the channel information to the channel_data attribute.
### Response:
def _process_channels(self,p,**params_to_override):
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... |
prometheus/client_python | prometheus_client/metrics_core.py | Metric.add_sample | def add_sample(self, name, labels, value, timestamp=None, exemplar=None):
"""Add a sample to the metric.
Internal-only, do not use."""
self.samples.append(Sample(name, labels, value, timestamp, exemplar)) | python | def add_sample(self, name, labels, value, timestamp=None, exemplar=None):
"""Add a sample to the metric.
Internal-only, do not use."""
self.samples.append(Sample(name, labels, value, timestamp, exemplar)) | [
"def",
"add_sample",
"(",
"self",
",",
"name",
",",
"labels",
",",
"value",
",",
"timestamp",
"=",
"None",
",",
"exemplar",
"=",
"None",
")",
":",
"self",
".",
"samples",
".",
"append",
"(",
"Sample",
"(",
"name",
",",
"labels",
",",
"value",
",",
... | Add a sample to the metric.
Internal-only, do not use. | [
"Add",
"a",
"sample",
"to",
"the",
"metric",
"."
] | train | https://github.com/prometheus/client_python/blob/31f5557e2e84ca4ffa9a03abf6e3f4d0c8b8c3eb/prometheus_client/metrics_core.py#L38-L42 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Add a sample to the metric.
Internal-only, do not use.
### Response:
def add_sample(self, name, labels, value, timest... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... |
GeorgeArgyros/symautomata | symautomata/pythondfa.py | PythonDFA.define | def define(self):
"""If DFA is empty, create a sink state"""
if len(self.states) == 0:
for char in self.alphabet:
self.add_arc(0, 0, char)
self[0].final = False | python | def define(self):
"""If DFA is empty, create a sink state"""
if len(self.states) == 0:
for char in self.alphabet:
self.add_arc(0, 0, char)
self[0].final = False | [
"def",
"define",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"states",
")",
"==",
"0",
":",
"for",
"char",
"in",
"self",
".",
"alphabet",
":",
"self",
".",
"add_arc",
"(",
"0",
",",
"0",
",",
"char",
")",
"self",
"[",
"0",
"]",
".",... | If DFA is empty, create a sink state | [
"If",
"DFA",
"is",
"empty",
"create",
"a",
"sink",
"state"
] | train | https://github.com/GeorgeArgyros/symautomata/blob/f5d66533573b27e155bec3f36b8c00b8e3937cb3/symautomata/pythondfa.py#L160-L165 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
If DFA is empty, create a sink state
### Response:
def define(self):
"""If DFA is empty, create a sink state"""
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2746,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2746,
... |
Robin8Put/pmes | pdms/views.py | PriceHandler.put | async def put(self, cid):
"""Update price of current content
Accepts:
Query string args:
- "cid" - int
Request body params:
- "access_type" - str
- "price" - int
- "coinid" - str
Returns:
dict with following fields:
- "confirmed": None
- "txid" - str
- "description" - str
... | python | async def put(self, cid):
"""Update price of current content
Accepts:
Query string args:
- "cid" - int
Request body params:
- "access_type" - str
- "price" - int
- "coinid" - str
Returns:
dict with following fields:
- "confirmed": None
- "txid" - str
- "description" - str
... | [
"async",
"def",
"put",
"(",
"self",
",",
"cid",
")",
":",
"if",
"settings",
".",
"SIGNATURE_VERIFICATION",
":",
"super",
"(",
")",
".",
"verify",
"(",
")",
"try",
":",
"body",
"=",
"json",
".",
"loads",
"(",
"self",
".",
"request",
".",
"body",
")"... | Update price of current content
Accepts:
Query string args:
- "cid" - int
Request body params:
- "access_type" - str
- "price" - int
- "coinid" - str
Returns:
dict with following fields:
- "confirmed": None
- "txid" - str
- "description" - str
- "content" - str
- "rea... | [
"Update",
"price",
"of",
"current",
"content"
] | train | https://github.com/Robin8Put/pmes/blob/338bec94162098f05b75bad035417317e1252fd2/pdms/views.py#L449-L545 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Update price of current content
Accepts:
Query string args:
- "cid" - int
Request body params:
- "access_type... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4387,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4387,
... |
dcos/shakedown | shakedown/dcos/agent.py | partition_agent | def partition_agent(host):
""" Partition a node from all network traffic except for SSH and loopback
:param hostname: host or IP of the machine to partition from the cluster
"""
network.save_iptables(host)
network.flush_all_rules(host)
network.allow_all_traffic(host)
network.run_iptabl... | python | def partition_agent(host):
""" Partition a node from all network traffic except for SSH and loopback
:param hostname: host or IP of the machine to partition from the cluster
"""
network.save_iptables(host)
network.flush_all_rules(host)
network.allow_all_traffic(host)
network.run_iptabl... | [
"def",
"partition_agent",
"(",
"host",
")",
":",
"network",
".",
"save_iptables",
"(",
"host",
")",
"network",
".",
"flush_all_rules",
"(",
"host",
")",
"network",
".",
"allow_all_traffic",
"(",
"host",
")",
"network",
".",
"run_iptables",
"(",
"host",
",",
... | Partition a node from all network traffic except for SSH and loopback
:param hostname: host or IP of the machine to partition from the cluster | [
"Partition",
"a",
"node",
"from",
"all",
"network",
"traffic",
"except",
"for",
"SSH",
"and",
"loopback"
] | train | https://github.com/dcos/shakedown/blob/e2f9e2382788dbcd29bd18aa058b76e7c3b83b3e/shakedown/dcos/agent.py#L78-L90 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Partition a node from all network traffic except for SSH and loopback
:param hostname: host or IP of the machine to pa... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
51078,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
51078,
... |
cjdrake/pyeda | pyeda/parsing/lex.py | action | def action(toktype):
"""Return a parser action property."""
def outer(func):
"""Return a function that pushes a token onto the token queue."""
def inner(lexer, text):
"""Push a token onto the token queue."""
value = func(lexer, text)
lexer.tokens.append(toktyp... | python | def action(toktype):
"""Return a parser action property."""
def outer(func):
"""Return a function that pushes a token onto the token queue."""
def inner(lexer, text):
"""Push a token onto the token queue."""
value = func(lexer, text)
lexer.tokens.append(toktyp... | [
"def",
"action",
"(",
"toktype",
")",
":",
"def",
"outer",
"(",
"func",
")",
":",
"\"\"\"Return a function that pushes a token onto the token queue.\"\"\"",
"def",
"inner",
"(",
"lexer",
",",
"text",
")",
":",
"\"\"\"Push a token onto the token queue.\"\"\"",
"value",
"... | Return a parser action property. | [
"Return",
"a",
"parser",
"action",
"property",
"."
] | train | https://github.com/cjdrake/pyeda/blob/554ee53aa678f4b61bcd7e07ba2c74ddc749d665/pyeda/parsing/lex.py#L174-L183 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Return a parser action property.
### Response:
def action(toktype):
"""Return a parser action property."""
def outer(f... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5715,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5715,
... |
pandas-dev/pandas | pandas/core/algorithms.py | take_2d_multi | def take_2d_multi(arr, indexer, out=None, fill_value=np.nan, mask_info=None,
allow_fill=True):
"""
Specialized Cython take which sets NaN values in one pass
"""
if indexer is None or (indexer[0] is None and indexer[1] is None):
row_idx = np.arange(arr.shape[0], dtype=np.int64)
... | python | def take_2d_multi(arr, indexer, out=None, fill_value=np.nan, mask_info=None,
allow_fill=True):
"""
Specialized Cython take which sets NaN values in one pass
"""
if indexer is None or (indexer[0] is None and indexer[1] is None):
row_idx = np.arange(arr.shape[0], dtype=np.int64)
... | [
"def",
"take_2d_multi",
"(",
"arr",
",",
"indexer",
",",
"out",
"=",
"None",
",",
"fill_value",
"=",
"np",
".",
"nan",
",",
"mask_info",
"=",
"None",
",",
"allow_fill",
"=",
"True",
")",
":",
"if",
"indexer",
"is",
"None",
"or",
"(",
"indexer",
"[",
... | Specialized Cython take which sets NaN values in one pass | [
"Specialized",
"Cython",
"take",
"which",
"sets",
"NaN",
"values",
"in",
"one",
"pass"
] | train | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/algorithms.py#L1672-L1737 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Specialized Cython take which sets NaN values in one pass
### Response:
def take_2d_multi(arr, indexer, out=None, fill_value=n... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
20989,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
20989,
... |
ulule/django-linguist | linguist/mixins.py | ModelMixin.override_language | def override_language(self, language):
"""
Context manager to override the instance language.
"""
previous_language = self._linguist.language
self._linguist.language = language
yield
self._linguist.language = previous_language | python | def override_language(self, language):
"""
Context manager to override the instance language.
"""
previous_language = self._linguist.language
self._linguist.language = language
yield
self._linguist.language = previous_language | [
"def",
"override_language",
"(",
"self",
",",
"language",
")",
":",
"previous_language",
"=",
"self",
".",
"_linguist",
".",
"language",
"self",
".",
"_linguist",
".",
"language",
"=",
"language",
"yield",
"self",
".",
"_linguist",
".",
"language",
"=",
"pre... | Context manager to override the instance language. | [
"Context",
"manager",
"to",
"override",
"the",
"instance",
"language",
"."
] | train | https://github.com/ulule/django-linguist/blob/d2b95a6ab921039d56d5eeb352badfe5be9e8f77/linguist/mixins.py#L435-L442 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Context manager to override the instance language.
### Response:
def override_language(self, language):
"""
Co... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2014,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2014,
... |
DreamLab/VmShepherd | src/vmshepherd/iaas/openstack_driver.py | OpenStackDriver.initialize | async def initialize(self):
'''
Initialize static data like images and flavores and set it as object property
'''
flavors = await self._list_flavors()
images = await self._list_images()
self.flavors_map = bidict()
self.images_map = bidict()
self.images_d... | python | async def initialize(self):
'''
Initialize static data like images and flavores and set it as object property
'''
flavors = await self._list_flavors()
images = await self._list_images()
self.flavors_map = bidict()
self.images_map = bidict()
self.images_d... | [
"async",
"def",
"initialize",
"(",
"self",
")",
":",
"flavors",
"=",
"await",
"self",
".",
"_list_flavors",
"(",
")",
"images",
"=",
"await",
"self",
".",
"_list_images",
"(",
")",
"self",
".",
"flavors_map",
"=",
"bidict",
"(",
")",
"self",
".",
"imag... | Initialize static data like images and flavores and set it as object property | [
"Initialize",
"static",
"data",
"like",
"images",
"and",
"flavores",
"and",
"set",
"it",
"as",
"object",
"property"
] | train | https://github.com/DreamLab/VmShepherd/blob/709a412c372b897d53808039c5c64a8b69c12c8d/src/vmshepherd/iaas/openstack_driver.py#L54-L79 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Initialize static data like images and flavores and set it as object property
### Response:
async def initialize(self):
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10130,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10130,
... |
MartinThoma/hwrt | hwrt/datasets/inkml.py | read | def read(filepath):
"""
Read a single InkML file
Parameters
----------
filepath : string
path to the (readable) InkML file
Returns
-------
HandwrittenData :
The parsed InkML file as a HandwrittenData object
"""
import xml.etree.ElementTree
root = xml.etree.E... | python | def read(filepath):
"""
Read a single InkML file
Parameters
----------
filepath : string
path to the (readable) InkML file
Returns
-------
HandwrittenData :
The parsed InkML file as a HandwrittenData object
"""
import xml.etree.ElementTree
root = xml.etree.E... | [
"def",
"read",
"(",
"filepath",
")",
":",
"import",
"xml",
".",
"etree",
".",
"ElementTree",
"root",
"=",
"xml",
".",
"etree",
".",
"ElementTree",
".",
"parse",
"(",
"filepath",
")",
".",
"getroot",
"(",
")",
"# Get the raw data",
"recording",
"=",
"[",
... | Read a single InkML file
Parameters
----------
filepath : string
path to the (readable) InkML file
Returns
-------
HandwrittenData :
The parsed InkML file as a HandwrittenData object | [
"Read",
"a",
"single",
"InkML",
"file"
] | train | https://github.com/MartinThoma/hwrt/blob/725c21a3d0f5a30b8492cbc184b3688ceb364e1c/hwrt/datasets/inkml.py#L70-L155 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Read a single InkML file
Parameters
----------
filepath : string
path to the (readable) InkML file
Re... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4518,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4518,
... |
gwastro/pycbc | pycbc/events/coinc.py | LiveCoincTimeslideBackgroundEstimator.add_singles | def add_singles(self, results):
"""Add singles to the bacckground estimate and find candidates
Parameters
----------
results: dict of arrays
Dictionary of dictionaries indexed by ifo and keys such as 'snr',
'chisq', etc. The specific format it determined by the
... | python | def add_singles(self, results):
"""Add singles to the bacckground estimate and find candidates
Parameters
----------
results: dict of arrays
Dictionary of dictionaries indexed by ifo and keys such as 'snr',
'chisq', etc. The specific format it determined by the
... | [
"def",
"add_singles",
"(",
"self",
",",
"results",
")",
":",
"# Let's see how large everything is",
"logging",
".",
"info",
"(",
"'BKG Coincs %s stored %s bytes'",
",",
"len",
"(",
"self",
".",
"coincs",
")",
",",
"self",
".",
"coincs",
".",
"nbytes",
")",
"# ... | Add singles to the bacckground estimate and find candidates
Parameters
----------
results: dict of arrays
Dictionary of dictionaries indexed by ifo and keys such as 'snr',
'chisq', etc. The specific format it determined by the
LiveBatchMatchedFilter class.
... | [
"Add",
"singles",
"to",
"the",
"bacckground",
"estimate",
"and",
"find",
"candidates"
] | train | https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/events/coinc.py#L1097-L1130 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Add singles to the bacckground estimate and find candidates
Parameters
----------
results: dict of arr... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... |
mojaie/chorus | chorus/v2000writer.py | mols_to_file | def mols_to_file(mols, path):
"""Save molecules to the SDFile format file
Args:
mols: list of molecule objects
path: file path to save
"""
with open(path, 'w') as f:
f.write(mols_to_text(mols)) | python | def mols_to_file(mols, path):
"""Save molecules to the SDFile format file
Args:
mols: list of molecule objects
path: file path to save
"""
with open(path, 'w') as f:
f.write(mols_to_text(mols)) | [
"def",
"mols_to_file",
"(",
"mols",
",",
"path",
")",
":",
"with",
"open",
"(",
"path",
",",
"'w'",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"mols_to_text",
"(",
"mols",
")",
")"
] | Save molecules to the SDFile format file
Args:
mols: list of molecule objects
path: file path to save | [
"Save",
"molecules",
"to",
"the",
"SDFile",
"format",
"file"
] | train | https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/v2000writer.py#L130-L138 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Save molecules to the SDFile format file
Args:
mols: list of molecule objects
path: file path to save
###... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
8960,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
8960,
... |
blockstack/blockstack-core | blockstack/lib/atlas.py | atlasdb_init | def atlasdb_init( path, zonefile_dir, db, peer_seeds, peer_blacklist, recover=False, validate=False):
"""
Set up the atlas node:
* create the db if it doesn't exist
* go through all the names and verify that we have the *current* zonefiles
* if we don't, queue them for fetching.
* set up the pee... | python | def atlasdb_init( path, zonefile_dir, db, peer_seeds, peer_blacklist, recover=False, validate=False):
"""
Set up the atlas node:
* create the db if it doesn't exist
* go through all the names and verify that we have the *current* zonefiles
* if we don't, queue them for fetching.
* set up the pee... | [
"def",
"atlasdb_init",
"(",
"path",
",",
"zonefile_dir",
",",
"db",
",",
"peer_seeds",
",",
"peer_blacklist",
",",
"recover",
"=",
"False",
",",
"validate",
"=",
"False",
")",
":",
"global",
"ATLASDB_SQL",
"peer_table",
"=",
"{",
"}",
"if",
"os",
".",
"p... | Set up the atlas node:
* create the db if it doesn't exist
* go through all the names and verify that we have the *current* zonefiles
* if we don't, queue them for fetching.
* set up the peer db
@db should be an instance of BlockstackDB
@initial_peers should be a list of URLs
Return the ne... | [
"Set",
"up",
"the",
"atlas",
"node",
":",
"*",
"create",
"the",
"db",
"if",
"it",
"doesn",
"t",
"exist",
"*",
"go",
"through",
"all",
"the",
"names",
"and",
"verify",
"that",
"we",
"have",
"the",
"*",
"current",
"*",
"zonefiles",
"*",
"if",
"we",
"... | train | https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/blockstack/lib/atlas.py#L1260-L1352 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Set up the atlas node:
* create the db if it doesn't exist
* go through all the names and verify that we have the *curr... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1681,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1681,
... |
matousc89/padasip | padasip/filters/base_filter.py | AdaptiveFilter.init_weights | def init_weights(self, w, n=-1):
"""
This function initialises the adaptive weights of the filter.
**Args:**
* `w` : initial weights of filter. Possible values are:
* array with initial weights (1 dimensional array) of filter size
* "random" : ... | python | def init_weights(self, w, n=-1):
"""
This function initialises the adaptive weights of the filter.
**Args:**
* `w` : initial weights of filter. Possible values are:
* array with initial weights (1 dimensional array) of filter size
* "random" : ... | [
"def",
"init_weights",
"(",
"self",
",",
"w",
",",
"n",
"=",
"-",
"1",
")",
":",
"if",
"n",
"==",
"-",
"1",
":",
"n",
"=",
"self",
".",
"n",
"if",
"type",
"(",
"w",
")",
"==",
"str",
":",
"if",
"w",
"==",
"\"random\"",
":",
"w",
"=",
"np"... | This function initialises the adaptive weights of the filter.
**Args:**
* `w` : initial weights of filter. Possible values are:
* array with initial weights (1 dimensional array) of filter size
* "random" : create random weights
* "zer... | [
"This",
"function",
"initialises",
"the",
"adaptive",
"weights",
"of",
"the",
"filter",
"."
] | train | https://github.com/matousc89/padasip/blob/c969eadd7fa181a84da0554d737fc13c6450d16f/padasip/filters/base_filter.py#L16-L56 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
This function initialises the adaptive weights of the filter.
**Args:**
* `w` : initial weights of filter. Po... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2028,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2028,
... |
google/grr | grr/server/grr_response_server/flow_utils.py | WaitForFlow | def WaitForFlow(flow_urn,
token=None,
timeout=DEFAULT_TIMEOUT,
max_sleep_time=1,
min_sleep_time=0.2,
dampening_multiplier=0.9):
"""Waits for a flow to finish, polling while we wait.
Args:
flow_urn: The urn of the flow to wait for.
... | python | def WaitForFlow(flow_urn,
token=None,
timeout=DEFAULT_TIMEOUT,
max_sleep_time=1,
min_sleep_time=0.2,
dampening_multiplier=0.9):
"""Waits for a flow to finish, polling while we wait.
Args:
flow_urn: The urn of the flow to wait for.
... | [
"def",
"WaitForFlow",
"(",
"flow_urn",
",",
"token",
"=",
"None",
",",
"timeout",
"=",
"DEFAULT_TIMEOUT",
",",
"max_sleep_time",
"=",
"1",
",",
"min_sleep_time",
"=",
"0.2",
",",
"dampening_multiplier",
"=",
"0.9",
")",
":",
"start_time",
"=",
"time",
".",
... | Waits for a flow to finish, polling while we wait.
Args:
flow_urn: The urn of the flow to wait for.
token: The datastore access token.
timeout: How long to wait before giving up, usually because the client has
gone away.
max_sleep_time: The initial and longest time to wait in between polls.
... | [
"Waits",
"for",
"a",
"flow",
"to",
"finish",
"polling",
"while",
"we",
"wait",
"."
] | train | https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/flow_utils.py#L88-L130 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Waits for a flow to finish, polling while we wait.
Args:
flow_urn: The urn of the flow to wait for.
token: The datas... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
54,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
54,
57... |
alefnula/tea | tea/utils/compress.py | unzip | def unzip(archive, destination, filenames=None):
"""Unzip a zip archive into destination directory.
It unzips either the whole archive or specific file(s) from the archive.
Usage:
>>> output = os.path.join(os.getcwd(), 'output')
>>> # Archive can be an instance of a ZipFile class
>... | python | def unzip(archive, destination, filenames=None):
"""Unzip a zip archive into destination directory.
It unzips either the whole archive or specific file(s) from the archive.
Usage:
>>> output = os.path.join(os.getcwd(), 'output')
>>> # Archive can be an instance of a ZipFile class
>... | [
"def",
"unzip",
"(",
"archive",
",",
"destination",
",",
"filenames",
"=",
"None",
")",
":",
"close",
"=",
"False",
"try",
":",
"if",
"not",
"isinstance",
"(",
"archive",
",",
"zipfile",
".",
"ZipFile",
")",
":",
"archive",
"=",
"zipfile",
".",
"ZipFil... | Unzip a zip archive into destination directory.
It unzips either the whole archive or specific file(s) from the archive.
Usage:
>>> output = os.path.join(os.getcwd(), 'output')
>>> # Archive can be an instance of a ZipFile class
>>> archive = zipfile.ZipFile('test.zip', 'r')
>>... | [
"Unzip",
"a",
"zip",
"archive",
"into",
"destination",
"directory",
"."
] | train | https://github.com/alefnula/tea/blob/f5a0a724a425ec4f9dd2c7fe966ef06faf3a15a3/tea/utils/compress.py#L40-L89 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Unzip a zip archive into destination directory.
It unzips either the whole archive or specific file(s) from the archive.
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1844,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1844,
... |
astropy/photutils | photutils/isophote/geometry.py | EllipseGeometry.to_polar | def to_polar(self, x, y):
"""
Return the radius and polar angle in the ellipse coordinate
system given (x, y) pixel image coordinates.
This function takes care of the different definitions for
position angle (PA) and polar angle (phi):
.. math::
-\\pi < PA <... | python | def to_polar(self, x, y):
"""
Return the radius and polar angle in the ellipse coordinate
system given (x, y) pixel image coordinates.
This function takes care of the different definitions for
position angle (PA) and polar angle (phi):
.. math::
-\\pi < PA <... | [
"def",
"to_polar",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"# We split in between a scalar version and a",
"# vectorized version. This is necessary for",
"# now so we don't pay a heavy speed penalty",
"# that is incurred when using vectorized code.",
"# The split in two separate funct... | Return the radius and polar angle in the ellipse coordinate
system given (x, y) pixel image coordinates.
This function takes care of the different definitions for
position angle (PA) and polar angle (phi):
.. math::
-\\pi < PA < \\pi
0 < phi < 2 \\pi
N... | [
"Return",
"the",
"radius",
"and",
"polar",
"angle",
"in",
"the",
"ellipse",
"coordinate",
"system",
"given",
"(",
"x",
"y",
")",
"pixel",
"image",
"coordinates",
"."
] | train | https://github.com/astropy/photutils/blob/cc9bb4534ab76bac98cb5f374a348a2573d10401/photutils/isophote/geometry.py#L385-L424 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Return the radius and polar angle in the ellipse coordinate
system given (x, y) pixel image coordinates.
This ... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5715,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5715,
... |
stbraun/fuzzing | fuzzing/fuzzer.py | FuzzExecutor._execute | def _execute(self, app_, file_):
"""Run app with file as input.
:param app_: application to run.
:param file_: file to run app with.
:return: success True, else False
:rtype: bool
"""
app_name = os.path.basename(app_)
args = [app_]
args.extend(sel... | python | def _execute(self, app_, file_):
"""Run app with file as input.
:param app_: application to run.
:param file_: file to run app with.
:return: success True, else False
:rtype: bool
"""
app_name = os.path.basename(app_)
args = [app_]
args.extend(sel... | [
"def",
"_execute",
"(",
"self",
",",
"app_",
",",
"file_",
")",
":",
"app_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"app_",
")",
"args",
"=",
"[",
"app_",
"]",
"args",
".",
"extend",
"(",
"self",
".",
"args",
"[",
"app_",
"]",
")",
"... | Run app with file as input.
:param app_: application to run.
:param file_: file to run app with.
:return: success True, else False
:rtype: bool | [
"Run",
"app",
"with",
"file",
"as",
"input",
"."
] | train | https://github.com/stbraun/fuzzing/blob/974a64472732d4e40db919d242149bf0856fe199/fuzzing/fuzzer.py#L271-L292 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Run app with file as input.
:param app_: application to run.
:param file_: file to run app with.
:retu... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6869,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6869,
... |
rosenbrockc/fortpy | fortpy/scripts/analyze.py | FortpyShell.do_rmdep | def do_rmdep(self, args):
"""Removes dependent variables currently set for plotting/tabulating etc."""
for arg in args.split():
if arg in self.curargs["dependents"]:
self.curargs["dependents"].remove(arg)
if arg in self.curargs["plottypes"]:
del se... | python | def do_rmdep(self, args):
"""Removes dependent variables currently set for plotting/tabulating etc."""
for arg in args.split():
if arg in self.curargs["dependents"]:
self.curargs["dependents"].remove(arg)
if arg in self.curargs["plottypes"]:
del se... | [
"def",
"do_rmdep",
"(",
"self",
",",
"args",
")",
":",
"for",
"arg",
"in",
"args",
".",
"split",
"(",
")",
":",
"if",
"arg",
"in",
"self",
".",
"curargs",
"[",
"\"dependents\"",
"]",
":",
"self",
".",
"curargs",
"[",
"\"dependents\"",
"]",
".",
"re... | Removes dependent variables currently set for plotting/tabulating etc. | [
"Removes",
"dependent",
"variables",
"currently",
"set",
"for",
"plotting",
"/",
"tabulating",
"etc",
"."
] | train | https://github.com/rosenbrockc/fortpy/blob/1ed0757c52d549e41d9d44bdea68cb89529293a5/fortpy/scripts/analyze.py#L594-L610 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Removes dependent variables currently set for plotting/tabulating etc.
### Response:
def do_rmdep(self, args):
"""Remo... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6728,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6728,
... |
kubernetes-client/python | kubernetes/client/models/runtime_raw_extension.py | RuntimeRawExtension.raw | def raw(self, raw):
"""
Sets the raw of this RuntimeRawExtension.
Raw is the underlying serialization of this object.
:param raw: The raw of this RuntimeRawExtension.
:type: str
"""
if raw is None:
raise ValueError("Invalid value for `raw`, must not b... | python | def raw(self, raw):
"""
Sets the raw of this RuntimeRawExtension.
Raw is the underlying serialization of this object.
:param raw: The raw of this RuntimeRawExtension.
:type: str
"""
if raw is None:
raise ValueError("Invalid value for `raw`, must not b... | [
"def",
"raw",
"(",
"self",
",",
"raw",
")",
":",
"if",
"raw",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for `raw`, must not be `None`\"",
")",
"if",
"raw",
"is",
"not",
"None",
"and",
"not",
"re",
".",
"search",
"(",
"'^(?:[A-Za-z0-9+\\... | Sets the raw of this RuntimeRawExtension.
Raw is the underlying serialization of this object.
:param raw: The raw of this RuntimeRawExtension.
:type: str | [
"Sets",
"the",
"raw",
"of",
"this",
"RuntimeRawExtension",
".",
"Raw",
"is",
"the",
"underlying",
"serialization",
"of",
"this",
"object",
"."
] | train | https://github.com/kubernetes-client/python/blob/5e512ff564c244c50cab780d821542ed56aa965a/kubernetes/client/models/runtime_raw_extension.py#L63-L76 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Sets the raw of this RuntimeRawExtension.
Raw is the underlying serialization of this object.
:param raw: The ... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
31275,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
31275,
... |
juju/charm-helpers | charmhelpers/contrib/database/mysql.py | MySQLHelper.get_allowed_units | def get_allowed_units(self, database, username, relation_id=None):
"""Get list of units with access grants for database with username.
This is typically used to provide shared-db relations with a list of
which units have been granted access to the given database.
"""
self.connec... | python | def get_allowed_units(self, database, username, relation_id=None):
"""Get list of units with access grants for database with username.
This is typically used to provide shared-db relations with a list of
which units have been granted access to the given database.
"""
self.connec... | [
"def",
"get_allowed_units",
"(",
"self",
",",
"database",
",",
"username",
",",
"relation_id",
"=",
"None",
")",
":",
"self",
".",
"connect",
"(",
"password",
"=",
"self",
".",
"get_mysql_root_password",
"(",
")",
")",
"allowed_units",
"=",
"set",
"(",
")"... | Get list of units with access grants for database with username.
This is typically used to provide shared-db relations with a list of
which units have been granted access to the given database. | [
"Get",
"list",
"of",
"units",
"with",
"access",
"grants",
"for",
"database",
"with",
"username",
"."
] | train | https://github.com/juju/charm-helpers/blob/aa785c40c3b7a8c69dbfbc7921d6b9f30142e171/charmhelpers/contrib/database/mysql.py#L387-L426 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Get list of units with access grants for database with username.
This is typically used to provide shared-db relations... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... |
pandas-dev/pandas | pandas/io/stata.py | StataWriter117._update_strl_names | def _update_strl_names(self):
"""Update column names for conversion to strl if they might have been
changed to comply with Stata naming rules"""
# Update convert_strl if names changed
for orig, new in self._converted_names.items():
if orig in self._convert_strl:
... | python | def _update_strl_names(self):
"""Update column names for conversion to strl if they might have been
changed to comply with Stata naming rules"""
# Update convert_strl if names changed
for orig, new in self._converted_names.items():
if orig in self._convert_strl:
... | [
"def",
"_update_strl_names",
"(",
"self",
")",
":",
"# Update convert_strl if names changed",
"for",
"orig",
",",
"new",
"in",
"self",
".",
"_converted_names",
".",
"items",
"(",
")",
":",
"if",
"orig",
"in",
"self",
".",
"_convert_strl",
":",
"idx",
"=",
"s... | Update column names for conversion to strl if they might have been
changed to comply with Stata naming rules | [
"Update",
"column",
"names",
"for",
"conversion",
"to",
"strl",
"if",
"they",
"might",
"have",
"been",
"changed",
"to",
"comply",
"with",
"Stata",
"naming",
"rules"
] | train | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/stata.py#L2948-L2955 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Update column names for conversion to strl if they might have been
changed to comply with Stata naming rules
### Respo... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4387,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4387,
... |
ming060/robotframework-uiautomatorlibrary | uiautomatorlibrary/Mobile.py | Mobile.scroll_to_beginning_vertically | def scroll_to_beginning_vertically(self, steps=10, *args,**selectors):
"""
Scroll the object which has *selectors* attributes to *beginning* vertically.
See `Scroll Forward Vertically` for more details.
"""
return self.device(**selectors).scroll.vert.toBeginning(steps=steps) | python | def scroll_to_beginning_vertically(self, steps=10, *args,**selectors):
"""
Scroll the object which has *selectors* attributes to *beginning* vertically.
See `Scroll Forward Vertically` for more details.
"""
return self.device(**selectors).scroll.vert.toBeginning(steps=steps) | [
"def",
"scroll_to_beginning_vertically",
"(",
"self",
",",
"steps",
"=",
"10",
",",
"*",
"args",
",",
"*",
"*",
"selectors",
")",
":",
"return",
"self",
".",
"device",
"(",
"*",
"*",
"selectors",
")",
".",
"scroll",
".",
"vert",
".",
"toBeginning",
"("... | Scroll the object which has *selectors* attributes to *beginning* vertically.
See `Scroll Forward Vertically` for more details. | [
"Scroll",
"the",
"object",
"which",
"has",
"*",
"selectors",
"*",
"attributes",
"to",
"*",
"beginning",
"*",
"vertically",
"."
] | train | https://github.com/ming060/robotframework-uiautomatorlibrary/blob/b70202b6a8aa68b4efd9d029c2845407fb33451a/uiautomatorlibrary/Mobile.py#L472-L478 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Scroll the object which has *selectors* attributes to *beginning* vertically.
See `Scroll Forward Vertically` for more... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
8591,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
8591,
... |
wearpants/instrument | instrument/output/csv.py | CSVFileMetric.dump | def dump(self):
"""Output all recorded metrics"""
with self.lock:
atexit.unregister(self.dump)
self.fh.close() | python | def dump(self):
"""Output all recorded metrics"""
with self.lock:
atexit.unregister(self.dump)
self.fh.close() | [
"def",
"dump",
"(",
"self",
")",
":",
"with",
"self",
".",
"lock",
":",
"atexit",
".",
"unregister",
"(",
"self",
".",
"dump",
")",
"self",
".",
"fh",
".",
"close",
"(",
")"
] | Output all recorded metrics | [
"Output",
"all",
"recorded",
"metrics"
] | train | https://github.com/wearpants/instrument/blob/a0f6103574ab58a82361a951e5e56b69aedfe294/instrument/output/csv.py#L117-L121 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Output all recorded metrics
### Response:
def dump(self):
"""Output all recorded metrics"""
with self.lock:
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5207,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5207,
... |
ray-project/ray | python/ray/experimental/array/distributed/linalg.py | tsqr | def tsqr(a):
"""Perform a QR decomposition of a tall-skinny matrix.
Args:
a: A distributed matrix with shape MxN (suppose K = min(M, N)).
Returns:
A tuple of q (a DistArray) and r (a numpy array) satisfying the
following.
- If q_full = ray.get(DistArray, q).assemble... | python | def tsqr(a):
"""Perform a QR decomposition of a tall-skinny matrix.
Args:
a: A distributed matrix with shape MxN (suppose K = min(M, N)).
Returns:
A tuple of q (a DistArray) and r (a numpy array) satisfying the
following.
- If q_full = ray.get(DistArray, q).assemble... | [
"def",
"tsqr",
"(",
"a",
")",
":",
"if",
"len",
"(",
"a",
".",
"shape",
")",
"!=",
"2",
":",
"raise",
"Exception",
"(",
"\"tsqr requires len(a.shape) == 2, but a.shape is \"",
"\"{}\"",
".",
"format",
"(",
"a",
".",
"shape",
")",
")",
"if",
"a",
".",
"... | Perform a QR decomposition of a tall-skinny matrix.
Args:
a: A distributed matrix with shape MxN (suppose K = min(M, N)).
Returns:
A tuple of q (a DistArray) and r (a numpy array) satisfying the
following.
- If q_full = ray.get(DistArray, q).assemble(), then
... | [
"Perform",
"a",
"QR",
"decomposition",
"of",
"a",
"tall",
"-",
"skinny",
"matrix",
"."
] | train | https://github.com/ray-project/ray/blob/4eade036a0505e244c976f36aaa2d64386b5129b/python/ray/experimental/array/distributed/linalg.py#L15-L84 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Perform a QR decomposition of a tall-skinny matrix.
Args:
a: A distributed matrix with shape MxN (suppose K = min(... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
48051,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
48051,
... |
steveYeah/PyBomb | pybomb/clients/game_client.py | GameClient.fetch | def fetch(self, id_, return_fields=None):
"""
Wrapper for fetching details of game by ID
:param id_: int
:param return_fields: tuple
:return: pybomb.clients.Response
"""
game_params = {"id": id_}
if return_fields is not None:
self._validate_... | python | def fetch(self, id_, return_fields=None):
"""
Wrapper for fetching details of game by ID
:param id_: int
:param return_fields: tuple
:return: pybomb.clients.Response
"""
game_params = {"id": id_}
if return_fields is not None:
self._validate_... | [
"def",
"fetch",
"(",
"self",
",",
"id_",
",",
"return_fields",
"=",
"None",
")",
":",
"game_params",
"=",
"{",
"\"id\"",
":",
"id_",
"}",
"if",
"return_fields",
"is",
"not",
"None",
":",
"self",
".",
"_validate_return_fields",
"(",
"return_fields",
")",
... | Wrapper for fetching details of game by ID
:param id_: int
:param return_fields: tuple
:return: pybomb.clients.Response | [
"Wrapper",
"for",
"fetching",
"details",
"of",
"game",
"by",
"ID"
] | train | https://github.com/steveYeah/PyBomb/blob/54045d74e642f8a1c4366c24bd6a330ae3da6257/pybomb/clients/game_client.py#L57-L76 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Wrapper for fetching details of game by ID
:param id_: int
:param return_fields: tuple
:return: pybom... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
11803,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
11803,
... |
wonambi-python/wonambi | wonambi/widgets/notes.py | Notes.add_event | def add_event(self, name, time, chan):
"""Action: add a single event."""
self.annot.add_event(name, time, chan=chan)
self.update_annotations() | python | def add_event(self, name, time, chan):
"""Action: add a single event."""
self.annot.add_event(name, time, chan=chan)
self.update_annotations() | [
"def",
"add_event",
"(",
"self",
",",
"name",
",",
"time",
",",
"chan",
")",
":",
"self",
".",
"annot",
".",
"add_event",
"(",
"name",
",",
"time",
",",
"chan",
"=",
"chan",
")",
"self",
".",
"update_annotations",
"(",
")"
] | Action: add a single event. | [
"Action",
":",
"add",
"a",
"single",
"event",
"."
] | train | https://github.com/wonambi-python/wonambi/blob/1d8e3d7e53df8017c199f703bcab582914676e76/wonambi/widgets/notes.py#L1401-L1404 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Action: add a single event.
### Response:
def add_event(self, name, time, chan):
"""Action: add a single event."""
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2573,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2573,
... |
Cadair/jupyter_environment_kernels | environment_kernels/activate_helper.py | escape_windows_cmd_string | def escape_windows_cmd_string(s):
"""Returns a string that is usable by the Windows cmd.exe.
The escaping is based on details here and emperical testing:
http://www.robvanderwoude.com/escapechars.php
"""
for c in '()%!^<>&|"':
s = s.replace(c, '^' + c)
s = s.replace('/?', '/.')
retur... | python | def escape_windows_cmd_string(s):
"""Returns a string that is usable by the Windows cmd.exe.
The escaping is based on details here and emperical testing:
http://www.robvanderwoude.com/escapechars.php
"""
for c in '()%!^<>&|"':
s = s.replace(c, '^' + c)
s = s.replace('/?', '/.')
retur... | [
"def",
"escape_windows_cmd_string",
"(",
"s",
")",
":",
"for",
"c",
"in",
"'()%!^<>&|\"'",
":",
"s",
"=",
"s",
".",
"replace",
"(",
"c",
",",
"'^'",
"+",
"c",
")",
"s",
"=",
"s",
".",
"replace",
"(",
"'/?'",
",",
"'/.'",
")",
"return",
"s"
] | Returns a string that is usable by the Windows cmd.exe.
The escaping is based on details here and emperical testing:
http://www.robvanderwoude.com/escapechars.php | [
"Returns",
"a",
"string",
"that",
"is",
"usable",
"by",
"the",
"Windows",
"cmd",
".",
"exe",
".",
"The",
"escaping",
"is",
"based",
"on",
"details",
"here",
"and",
"emperical",
"testing",
":",
"http",
":",
"//",
"www",
".",
"robvanderwoude",
".",
"com",
... | train | https://github.com/Cadair/jupyter_environment_kernels/blob/3da304550b511bda7d5d39280379b5ca39bb31bc/environment_kernels/activate_helper.py#L158-L166 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Returns a string that is usable by the Windows cmd.exe.
The escaping is based on details here and emperical testing:
ht... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
16851,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
16851,
... |
proycon/clam | clam/common/auth.py | NonceMemory.cleanup | def cleanup(self):
"""Delete expired nonces"""
t = time.time()
for noncefile in glob(self.path + '/*.nonce'):
if os.path.getmtime(noncefile) + self.expiration > t:
os.unlink(noncefile) | python | def cleanup(self):
"""Delete expired nonces"""
t = time.time()
for noncefile in glob(self.path + '/*.nonce'):
if os.path.getmtime(noncefile) + self.expiration > t:
os.unlink(noncefile) | [
"def",
"cleanup",
"(",
"self",
")",
":",
"t",
"=",
"time",
".",
"time",
"(",
")",
"for",
"noncefile",
"in",
"glob",
"(",
"self",
".",
"path",
"+",
"'/*.nonce'",
")",
":",
"if",
"os",
".",
"path",
".",
"getmtime",
"(",
"noncefile",
")",
"+",
"self... | Delete expired nonces | [
"Delete",
"expired",
"nonces"
] | train | https://github.com/proycon/clam/blob/09d15cfc26d7cbe0f5976cdd5424dc446d10dbf3/clam/common/auth.py#L503-L508 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Delete expired nonces
### Response:
def cleanup(self):
"""Delete expired nonces"""
t = time.time()
for... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6571,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6571,
... |
raghakot/keras-vis | vis/utils/utils.py | find_layer_idx | def find_layer_idx(model, layer_name):
"""Looks up the layer index corresponding to `layer_name` from `model`.
Args:
model: The `keras.models.Model` instance.
layer_name: The name of the layer to lookup.
Returns:
The layer index if found. Raises an exception otherwise.
"""
... | python | def find_layer_idx(model, layer_name):
"""Looks up the layer index corresponding to `layer_name` from `model`.
Args:
model: The `keras.models.Model` instance.
layer_name: The name of the layer to lookup.
Returns:
The layer index if found. Raises an exception otherwise.
"""
... | [
"def",
"find_layer_idx",
"(",
"model",
",",
"layer_name",
")",
":",
"layer_idx",
"=",
"None",
"for",
"idx",
",",
"layer",
"in",
"enumerate",
"(",
"model",
".",
"layers",
")",
":",
"if",
"layer",
".",
"name",
"==",
"layer_name",
":",
"layer_idx",
"=",
"... | Looks up the layer index corresponding to `layer_name` from `model`.
Args:
model: The `keras.models.Model` instance.
layer_name: The name of the layer to lookup.
Returns:
The layer index if found. Raises an exception otherwise. | [
"Looks",
"up",
"the",
"layer",
"index",
"corresponding",
"to",
"layer_name",
"from",
"model",
"."
] | train | https://github.com/raghakot/keras-vis/blob/668b0e11dab93f3487f23c17e07f40554a8939e9/vis/utils/utils.py#L136-L154 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Looks up the layer index corresponding to `layer_name` from `model`.
Args:
model: The `keras.models.Model` instanc... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
59844,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
59844,
... |
acutesoftware/AIKIF | scripts/AI_CLI.py | AICLI.cmd_add | def cmd_add(self, txt):
"""
Enter add mode - all text entered now will be
processed as adding information until cancelled
"""
self.show_output('Adding ', txt)
self.raw.add(txt)
print(self.raw)
return 'Added ' + txt | python | def cmd_add(self, txt):
"""
Enter add mode - all text entered now will be
processed as adding information until cancelled
"""
self.show_output('Adding ', txt)
self.raw.add(txt)
print(self.raw)
return 'Added ' + txt | [
"def",
"cmd_add",
"(",
"self",
",",
"txt",
")",
":",
"self",
".",
"show_output",
"(",
"'Adding '",
",",
"txt",
")",
"self",
".",
"raw",
".",
"add",
"(",
"txt",
")",
"print",
"(",
"self",
".",
"raw",
")",
"return",
"'Added '",
"+",
"txt"
] | Enter add mode - all text entered now will be
processed as adding information until cancelled | [
"Enter",
"add",
"mode",
"-",
"all",
"text",
"entered",
"now",
"will",
"be",
"processed",
"as",
"adding",
"information",
"until",
"cancelled"
] | train | https://github.com/acutesoftware/AIKIF/blob/fcf1582dc5f884b9a4fa7c6e20e9de9d94d21d03/scripts/AI_CLI.py#L135-L143 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Enter add mode - all text entered now will be
processed as adding information until cancelled
### Response:
def cmd_a... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6403,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6403,
... |
googleapis/dialogflow-python-client-v2 | samples/knowledge_base_management.py | list_knowledge_bases | def list_knowledge_bases(project_id):
"""Lists the Knowledge bases belonging to a project.
Args:
project_id: The GCP project linked with the agent."""
import dialogflow_v2beta1 as dialogflow
client = dialogflow.KnowledgeBasesClient()
project_path = client.project_path(project_id)
print... | python | def list_knowledge_bases(project_id):
"""Lists the Knowledge bases belonging to a project.
Args:
project_id: The GCP project linked with the agent."""
import dialogflow_v2beta1 as dialogflow
client = dialogflow.KnowledgeBasesClient()
project_path = client.project_path(project_id)
print... | [
"def",
"list_knowledge_bases",
"(",
"project_id",
")",
":",
"import",
"dialogflow_v2beta1",
"as",
"dialogflow",
"client",
"=",
"dialogflow",
".",
"KnowledgeBasesClient",
"(",
")",
"project_path",
"=",
"client",
".",
"project_path",
"(",
"project_id",
")",
"print",
... | Lists the Knowledge bases belonging to a project.
Args:
project_id: The GCP project linked with the agent. | [
"Lists",
"the",
"Knowledge",
"bases",
"belonging",
"to",
"a",
"project",
"."
] | train | https://github.com/googleapis/dialogflow-python-client-v2/blob/8c9c8709222efe427b76c9c8fcc04a0c4a0760b5/samples/knowledge_base_management.py#L35-L47 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Lists the Knowledge bases belonging to a project.
Args:
project_id: The GCP project linked with the agent.
### Re... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
38948,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
38948,
... |
daviddrysdale/python-phonenumbers | python/phonenumbers/phonenumberutil.py | _is_viable_phone_number | def _is_viable_phone_number(number):
"""Checks to see if a string could possibly be a phone number.
At the moment, checks to see that the string begins with at least 2
digits, ignoring any punctuation commonly found in phone numbers. This
method does not require the number to be normalized in advance ... | python | def _is_viable_phone_number(number):
"""Checks to see if a string could possibly be a phone number.
At the moment, checks to see that the string begins with at least 2
digits, ignoring any punctuation commonly found in phone numbers. This
method does not require the number to be normalized in advance ... | [
"def",
"_is_viable_phone_number",
"(",
"number",
")",
":",
"if",
"len",
"(",
"number",
")",
"<",
"_MIN_LENGTH_FOR_NSN",
":",
"return",
"False",
"match",
"=",
"fullmatch",
"(",
"_VALID_PHONE_NUMBER_PATTERN",
",",
"number",
")",
"return",
"bool",
"(",
"match",
"... | Checks to see if a string could possibly be a phone number.
At the moment, checks to see that the string begins with at least 2
digits, ignoring any punctuation commonly found in phone numbers. This
method does not require the number to be normalized in advance - but does
assume that leading non-numbe... | [
"Checks",
"to",
"see",
"if",
"a",
"string",
"could",
"possibly",
"be",
"a",
"phone",
"number",
"."
] | train | https://github.com/daviddrysdale/python-phonenumbers/blob/9cc5bb4ab5e661e70789b4c64bf7a9383c7bdc20/python/phonenumbers/phonenumberutil.py#L545-L563 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Checks to see if a string could possibly be a phone number.
At the moment, checks to see that the string begins with at le... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
50920,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
50920,
... |
saltstack/salt | salt/key.py | Key.finger_all | def finger_all(self, hash_type=None):
'''
Return fingerprints for all keys
'''
if hash_type is None:
hash_type = __opts__['hash_type']
ret = {}
for status, keys in six.iteritems(self.all_keys()):
ret[status] = {}
for key in keys:
... | python | def finger_all(self, hash_type=None):
'''
Return fingerprints for all keys
'''
if hash_type is None:
hash_type = __opts__['hash_type']
ret = {}
for status, keys in six.iteritems(self.all_keys()):
ret[status] = {}
for key in keys:
... | [
"def",
"finger_all",
"(",
"self",
",",
"hash_type",
"=",
"None",
")",
":",
"if",
"hash_type",
"is",
"None",
":",
"hash_type",
"=",
"__opts__",
"[",
"'hash_type'",
"]",
"ret",
"=",
"{",
"}",
"for",
"status",
",",
"keys",
"in",
"six",
".",
"iteritems",
... | Return fingerprints for all keys | [
"Return",
"fingerprints",
"for",
"all",
"keys"
] | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/key.py#L862-L878 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Return fingerprints for all keys
### Response:
def finger_all(self, hash_type=None):
'''
Return fingerprints f... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5715,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5715,
... |
jldantas/libmft | libmft/api.py | Datastream.add_from_datastream | def add_from_datastream(self, source_ds):
'''Add information from another datastream. Verifies if the datastream
added is correct and copy the relevant fields if necessary.'''
if source_ds.name != self.name:
raise DataStreamError("Data from a different stream 'f{source_ds.name}' cann... | python | def add_from_datastream(self, source_ds):
'''Add information from another datastream. Verifies if the datastream
added is correct and copy the relevant fields if necessary.'''
if source_ds.name != self.name:
raise DataStreamError("Data from a different stream 'f{source_ds.name}' cann... | [
"def",
"add_from_datastream",
"(",
"self",
",",
"source_ds",
")",
":",
"if",
"source_ds",
".",
"name",
"!=",
"self",
".",
"name",
":",
"raise",
"DataStreamError",
"(",
"\"Data from a different stream 'f{source_ds.name}' cannot be add to this stream\"",
")",
"if",
"self"... | Add information from another datastream. Verifies if the datastream
added is correct and copy the relevant fields if necessary. | [
"Add",
"information",
"from",
"another",
"datastream",
".",
"Verifies",
"if",
"the",
"datastream",
"added",
"is",
"correct",
"and",
"copy",
"the",
"relevant",
"fields",
"if",
"necessary",
"."
] | train | https://github.com/jldantas/libmft/blob/65a988605fe7663b788bd81dcb52c0a4eaad1549/libmft/api.py#L429-L444 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Add information from another datastream. Verifies if the datastream
added is correct and copy the relevant fields if ne... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... |
jeroyang/cateye | cateye/cateye.py | correct | def correct(tokens, term_freq):
"""
Correct a list of tokens, according to the term_freq
"""
log = []
output = []
for token in tokens:
corrected = _correct(token, term_freq)
if corrected != token:
log.append((token, corrected))
output.append(corrected)
ret... | python | def correct(tokens, term_freq):
"""
Correct a list of tokens, according to the term_freq
"""
log = []
output = []
for token in tokens:
corrected = _correct(token, term_freq)
if corrected != token:
log.append((token, corrected))
output.append(corrected)
ret... | [
"def",
"correct",
"(",
"tokens",
",",
"term_freq",
")",
":",
"log",
"=",
"[",
"]",
"output",
"=",
"[",
"]",
"for",
"token",
"in",
"tokens",
":",
"corrected",
"=",
"_correct",
"(",
"token",
",",
"term_freq",
")",
"if",
"corrected",
"!=",
"token",
":",... | Correct a list of tokens, according to the term_freq | [
"Correct",
"a",
"list",
"of",
"tokens",
"according",
"to",
"the",
"term_freq"
] | train | https://github.com/jeroyang/cateye/blob/8f181d6428d113d2928e3eb31703705ce0779eae/cateye/cateye.py#L248-L259 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Correct a list of tokens, according to the term_freq
### Response:
def correct(tokens, term_freq):
"""
Correct a list ... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
34192,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
34192,
... |
cmbruns/pyopenvr | src/openvr/__init__.py | IVROverlay.getOverlayTransformTrackedDeviceComponent | def getOverlayTransformTrackedDeviceComponent(self, ulOverlayHandle, pchComponentName, unComponentNameSize):
"""Gets the transform information when the overlay is rendering on a component."""
fn = self.function_table.getOverlayTransformTrackedDeviceComponent
punDeviceIndex = TrackedDeviceIndex_... | python | def getOverlayTransformTrackedDeviceComponent(self, ulOverlayHandle, pchComponentName, unComponentNameSize):
"""Gets the transform information when the overlay is rendering on a component."""
fn = self.function_table.getOverlayTransformTrackedDeviceComponent
punDeviceIndex = TrackedDeviceIndex_... | [
"def",
"getOverlayTransformTrackedDeviceComponent",
"(",
"self",
",",
"ulOverlayHandle",
",",
"pchComponentName",
",",
"unComponentNameSize",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getOverlayTransformTrackedDeviceComponent",
"punDeviceIndex",
"=",
"Tracke... | Gets the transform information when the overlay is rendering on a component. | [
"Gets",
"the",
"transform",
"information",
"when",
"the",
"overlay",
"is",
"rendering",
"on",
"a",
"component",
"."
] | train | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L4888-L4894 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Gets the transform information when the overlay is rendering on a component.
### Response:
def getOverlayTransformTrackedDevic... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
50458,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
50458,
... |
lambdamusic/Ontospy | ontospy/ontodocs/misc/scripts/export_all.py | cli_run_viz | def cli_run_viz(source=None, outputpath="", theme="", verbose=False):
"""
This application is a wrapper on the main ontospy-viz script. It generates docs for all models in the local library. Using the Complex-html template..
@todo allow to pass a custom folder ..
> python -m ontospy.viz.scripts.export_all -o ~/Des... | python | def cli_run_viz(source=None, outputpath="", theme="", verbose=False):
"""
This application is a wrapper on the main ontospy-viz script. It generates docs for all models in the local library. Using the Complex-html template..
@todo allow to pass a custom folder ..
> python -m ontospy.viz.scripts.export_all -o ~/Des... | [
"def",
"cli_run_viz",
"(",
"source",
"=",
"None",
",",
"outputpath",
"=",
"\"\"",
",",
"theme",
"=",
"\"\"",
",",
"verbose",
"=",
"False",
")",
":",
"if",
"outputpath",
":",
"if",
"not",
"(",
"os",
".",
"path",
".",
"exists",
"(",
"outputpath",
")",
... | This application is a wrapper on the main ontospy-viz script. It generates docs for all models in the local library. Using the Complex-html template..
@todo allow to pass a custom folder ..
> python -m ontospy.viz.scripts.export_all -o ~/Desktop/test/ --theme random | [
"This",
"application",
"is",
"a",
"wrapper",
"on",
"the",
"main",
"ontospy",
"-",
"viz",
"script",
".",
"It",
"generates",
"docs",
"for",
"all",
"models",
"in",
"the",
"local",
"library",
".",
"Using",
"the",
"Complex",
"-",
"html",
"template",
"..",
"@t... | train | https://github.com/lambdamusic/Ontospy/blob/eb46cb13792b2b87f21babdf976996318eec7571/ontospy/ontodocs/misc/scripts/export_all.py#L37-L142 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
This application is a wrapper on the main ontospy-viz script. It generates docs for all models in the local library. Using the ... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2028,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2028,
... |
bcbio/bcbio-nextgen | bcbio/heterogeneity/bubbletree.py | _is_possible_loh | def _is_possible_loh(rec, vcf_rec, params, somatic_info, use_status=False, max_normal_depth=None):
"""Check if the VCF record is a het in the normal with sufficient support.
Only returns SNPs, since indels tend to have less precise frequency measurements.
"""
if _is_biallelic_snp(rec) and _passes_plus_... | python | def _is_possible_loh(rec, vcf_rec, params, somatic_info, use_status=False, max_normal_depth=None):
"""Check if the VCF record is a het in the normal with sufficient support.
Only returns SNPs, since indels tend to have less precise frequency measurements.
"""
if _is_biallelic_snp(rec) and _passes_plus_... | [
"def",
"_is_possible_loh",
"(",
"rec",
",",
"vcf_rec",
",",
"params",
",",
"somatic_info",
",",
"use_status",
"=",
"False",
",",
"max_normal_depth",
"=",
"None",
")",
":",
"if",
"_is_biallelic_snp",
"(",
"rec",
")",
"and",
"_passes_plus_germline",
"(",
"rec",
... | Check if the VCF record is a het in the normal with sufficient support.
Only returns SNPs, since indels tend to have less precise frequency measurements. | [
"Check",
"if",
"the",
"VCF",
"record",
"is",
"a",
"het",
"in",
"the",
"normal",
"with",
"sufficient",
"support",
"."
] | train | https://github.com/bcbio/bcbio-nextgen/blob/6a9348c0054ccd5baffd22f1bb7d0422f6978b20/bcbio/heterogeneity/bubbletree.py#L358-L378 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Check if the VCF record is a het in the normal with sufficient support.
Only returns SNPs, since indels tend to have less ... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4061,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4061,
... |
kmarekspartz/props | props/__init__.py | one_of | def one_of(*generators):
"""
Generates an arbitrary value of one of the specified generators.
This is a class factory, it makes a class which is a closure around the
specified generators.
"""
class OneOfGenerators(ArbitraryInterface):
"""
A closure class around the generators sp... | python | def one_of(*generators):
"""
Generates an arbitrary value of one of the specified generators.
This is a class factory, it makes a class which is a closure around the
specified generators.
"""
class OneOfGenerators(ArbitraryInterface):
"""
A closure class around the generators sp... | [
"def",
"one_of",
"(",
"*",
"generators",
")",
":",
"class",
"OneOfGenerators",
"(",
"ArbitraryInterface",
")",
":",
"\"\"\"\n A closure class around the generators specified above, which\n generates one of the generators.\n \"\"\"",
"@",
"classmethod",
"def",
"... | Generates an arbitrary value of one of the specified generators.
This is a class factory, it makes a class which is a closure around the
specified generators. | [
"Generates",
"an",
"arbitrary",
"value",
"of",
"one",
"of",
"the",
"specified",
"generators",
".",
"This",
"is",
"a",
"class",
"factory",
"it",
"makes",
"a",
"class",
"which",
"is",
"a",
"closure",
"around",
"the",
"specified",
"generators",
"."
] | train | https://github.com/kmarekspartz/props/blob/a766cdbe6f7be846f602553280770546f124a91d/props/__init__.py#L194-L218 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Generates an arbitrary value of one of the specified generators.
This is a class factory, it makes a class which is a closu... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5648,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5648,
... |
blockstack/blockstack-core | blockstack/lib/nameset/db.py | namedb_get_names_owned_by_address | def namedb_get_names_owned_by_address( cur, address, current_block ):
"""
Get the list of non-expired, non-revoked names owned by an address.
Only works if there is a *singular* address for the name.
"""
unexpired_fragment, unexpired_args = namedb_select_where_unexpired_names( current_block )
... | python | def namedb_get_names_owned_by_address( cur, address, current_block ):
"""
Get the list of non-expired, non-revoked names owned by an address.
Only works if there is a *singular* address for the name.
"""
unexpired_fragment, unexpired_args = namedb_select_where_unexpired_names( current_block )
... | [
"def",
"namedb_get_names_owned_by_address",
"(",
"cur",
",",
"address",
",",
"current_block",
")",
":",
"unexpired_fragment",
",",
"unexpired_args",
"=",
"namedb_select_where_unexpired_names",
"(",
"current_block",
")",
"select_query",
"=",
"\"SELECT name FROM name_records JO... | Get the list of non-expired, non-revoked names owned by an address.
Only works if there is a *singular* address for the name. | [
"Get",
"the",
"list",
"of",
"non",
"-",
"expired",
"non",
"-",
"revoked",
"names",
"owned",
"by",
"an",
"address",
".",
"Only",
"works",
"if",
"there",
"is",
"a",
"*",
"singular",
"*",
"address",
"for",
"the",
"name",
"."
] | train | https://github.com/blockstack/blockstack-core/blob/1dcfdd39b152d29ce13e736a6a1a0981401a0505/blockstack/lib/nameset/db.py#L2245-L2266 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Get the list of non-expired, non-revoked names owned by an address.
Only works if there is a *singular* address for the nam... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... |
IvanMalison/okcupyd | okcupyd/question.py | UserQuestion.get_answer_id_for_question | def get_answer_id_for_question(self, question):
"""Get the answer_id corresponding to the answer given for question
by looking at this :class:`~.UserQuestion`'s answer_options.
The given :class:`~.Question` instance must have the same id as this
:class:`~.UserQuestion`.
That thi... | python | def get_answer_id_for_question(self, question):
"""Get the answer_id corresponding to the answer given for question
by looking at this :class:`~.UserQuestion`'s answer_options.
The given :class:`~.Question` instance must have the same id as this
:class:`~.UserQuestion`.
That thi... | [
"def",
"get_answer_id_for_question",
"(",
"self",
",",
"question",
")",
":",
"assert",
"question",
".",
"id",
"==",
"self",
".",
"id",
"for",
"answer_option",
"in",
"self",
".",
"answer_options",
":",
"if",
"answer_option",
".",
"text",
"==",
"question",
"."... | Get the answer_id corresponding to the answer given for question
by looking at this :class:`~.UserQuestion`'s answer_options.
The given :class:`~.Question` instance must have the same id as this
:class:`~.UserQuestion`.
That this method exists is admittedly somewhat weird. Unfortunately... | [
"Get",
"the",
"answer_id",
"corresponding",
"to",
"the",
"answer",
"given",
"for",
"question",
"by",
"looking",
"at",
"this",
":",
"class",
":",
"~",
".",
"UserQuestion",
"s",
"answer_options",
".",
"The",
"given",
":",
"class",
":",
"~",
".",
"Question",
... | train | https://github.com/IvanMalison/okcupyd/blob/46f4eaa9419098f6c299738ce148af55c64deb64/okcupyd/question.py#L148-L160 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Get the answer_id corresponding to the answer given for question
by looking at this :class:`~.UserQuestion`'s answer_op... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... |
inasafe/inasafe | safe/metadata/utilities.py | serialize_dictionary | def serialize_dictionary(dictionary):
"""Function to stringify a dictionary recursively.
:param dictionary: The dictionary.
:type dictionary: dict
:return: The string.
:rtype: basestring
"""
string_value = {}
for k, v in list(dictionary.items()):
if isinstance(v, QUrl):
... | python | def serialize_dictionary(dictionary):
"""Function to stringify a dictionary recursively.
:param dictionary: The dictionary.
:type dictionary: dict
:return: The string.
:rtype: basestring
"""
string_value = {}
for k, v in list(dictionary.items()):
if isinstance(v, QUrl):
... | [
"def",
"serialize_dictionary",
"(",
"dictionary",
")",
":",
"string_value",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"list",
"(",
"dictionary",
".",
"items",
"(",
")",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"QUrl",
")",
":",
"string_value",
"... | Function to stringify a dictionary recursively.
:param dictionary: The dictionary.
:type dictionary: dict
:return: The string.
:rtype: basestring | [
"Function",
"to",
"stringify",
"a",
"dictionary",
"recursively",
"."
] | train | https://github.com/inasafe/inasafe/blob/831d60abba919f6d481dc94a8d988cc205130724/safe/metadata/utilities.py#L125-L149 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Function to stringify a dictionary recursively.
:param dictionary: The dictionary.
:type dictionary: dict
:return... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5263,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5263,
... |
ethpm/py-ethpm | ethpm/utils/contract.py | validate_minimal_contract_factory_data | def validate_minimal_contract_factory_data(contract_data: Dict[str, str]) -> None:
"""
Validate that contract data in a package contains at least an "abi" and
"deployment_bytecode" necessary to generate a deployable contract factory.
"""
if not all(key in contract_data.keys() for key in ("abi", "dep... | python | def validate_minimal_contract_factory_data(contract_data: Dict[str, str]) -> None:
"""
Validate that contract data in a package contains at least an "abi" and
"deployment_bytecode" necessary to generate a deployable contract factory.
"""
if not all(key in contract_data.keys() for key in ("abi", "dep... | [
"def",
"validate_minimal_contract_factory_data",
"(",
"contract_data",
":",
"Dict",
"[",
"str",
",",
"str",
"]",
")",
"->",
"None",
":",
"if",
"not",
"all",
"(",
"key",
"in",
"contract_data",
".",
"keys",
"(",
")",
"for",
"key",
"in",
"(",
"\"abi\"",
","... | Validate that contract data in a package contains at least an "abi" and
"deployment_bytecode" necessary to generate a deployable contract factory. | [
"Validate",
"that",
"contract",
"data",
"in",
"a",
"package",
"contains",
"at",
"least",
"an",
"abi",
"and",
"deployment_bytecode",
"necessary",
"to",
"generate",
"a",
"deployable",
"contract",
"factory",
"."
] | train | https://github.com/ethpm/py-ethpm/blob/81ed58d7c636fe00c6770edeb0401812b1a5e8fc/ethpm/utils/contract.py#L10-L19 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Validate that contract data in a package contains at least an "abi" and
"deployment_bytecode" necessary to generate a deplo... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
18409,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
18409,
... |
thespacedoctor/astrocalc | astrocalc/distances/converter.py | converter.redshift_to_distance | def redshift_to_distance(
self,
z,
WM=0.3,
WV=0.7,
H0=70.0):
"""*convert redshift to various distance measurements*
**Key Arguments:**
- ``z`` -- redshift measurement.
- ``WM`` -- Omega_matter. Default *0.3*
... | python | def redshift_to_distance(
self,
z,
WM=0.3,
WV=0.7,
H0=70.0):
"""*convert redshift to various distance measurements*
**Key Arguments:**
- ``z`` -- redshift measurement.
- ``WM`` -- Omega_matter. Default *0.3*
... | [
"def",
"redshift_to_distance",
"(",
"self",
",",
"z",
",",
"WM",
"=",
"0.3",
",",
"WV",
"=",
"0.7",
",",
"H0",
"=",
"70.0",
")",
":",
"self",
".",
"log",
".",
"info",
"(",
"'starting the ``redshift_to_distance`` method'",
")",
"# VARIABLE",
"h",
"=",
"H0... | *convert redshift to various distance measurements*
**Key Arguments:**
- ``z`` -- redshift measurement.
- ``WM`` -- Omega_matter. Default *0.3*
- ``WV`` -- Omega_vacuum. Default *0.7*
- ``H0`` -- Hubble constant. (km s-1 Mpc-1) Default *70.0*
**Return:**... | [
"*",
"convert",
"redshift",
"to",
"various",
"distance",
"measurements",
"*"
] | train | https://github.com/thespacedoctor/astrocalc/blob/dfbebf9b86d7b2d2110c48a6a4f4194bf8885b86/astrocalc/distances/converter.py#L113-L265 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
*convert redshift to various distance measurements*
**Key Arguments:**
- ``z`` -- redshift measurement.
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
9,
145... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
9,
145... |
sbg/sevenbridges-python | sevenbridges/http/client.py | config_vars | def config_vars(profiles, advance_access):
"""
Utility method to fetch config vars using ini section profile
:param profiles: profile name.
:param advance_access: advance_access flag.
:return:
"""
for profile in profiles:
try:
config = Config(profile, advance_access=advan... | python | def config_vars(profiles, advance_access):
"""
Utility method to fetch config vars using ini section profile
:param profiles: profile name.
:param advance_access: advance_access flag.
:return:
"""
for profile in profiles:
try:
config = Config(profile, advance_access=advan... | [
"def",
"config_vars",
"(",
"profiles",
",",
"advance_access",
")",
":",
"for",
"profile",
"in",
"profiles",
":",
"try",
":",
"config",
"=",
"Config",
"(",
"profile",
",",
"advance_access",
"=",
"advance_access",
")",
"url",
"=",
"config",
".",
"api_endpoint"... | Utility method to fetch config vars using ini section profile
:param profiles: profile name.
:param advance_access: advance_access flag.
:return: | [
"Utility",
"method",
"to",
"fetch",
"config",
"vars",
"using",
"ini",
"section",
"profile",
":",
"param",
"profiles",
":",
"profile",
"name",
".",
":",
"param",
"advance_access",
":",
"advance_access",
"flag",
".",
":",
"return",
":"
] | train | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/http/client.py#L63-L80 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Utility method to fetch config vars using ini section profile
:param profiles: profile name.
:param advance_access: adv... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
19750,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
19750,
... |
twilio/twilio-python | twilio/rest/video/v1/composition/__init__.py | CompositionList.page | def page(self, status=values.unset, date_created_after=values.unset,
date_created_before=values.unset, room_sid=values.unset,
page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
Retrieve a single page of CompositionInstance records from ... | python | def page(self, status=values.unset, date_created_after=values.unset,
date_created_before=values.unset, room_sid=values.unset,
page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
Retrieve a single page of CompositionInstance records from ... | [
"def",
"page",
"(",
"self",
",",
"status",
"=",
"values",
".",
"unset",
",",
"date_created_after",
"=",
"values",
".",
"unset",
",",
"date_created_before",
"=",
"values",
".",
"unset",
",",
"room_sid",
"=",
"values",
".",
"unset",
",",
"page_token",
"=",
... | Retrieve a single page of CompositionInstance records from the API.
Request is executed immediately
:param CompositionInstance.Status status: Only show Compositions with the given status.
:param datetime date_created_after: Only show Compositions created on or after this ISO8601 date-time with ... | [
"Retrieve",
"a",
"single",
"page",
"of",
"CompositionInstance",
"records",
"from",
"the",
"API",
".",
"Request",
"is",
"executed",
"immediately"
] | train | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/video/v1/composition/__init__.py#L104-L139 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Retrieve a single page of CompositionInstance records from the API.
Request is executed immediately
:param Com... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
88765,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
88765,
... |
nerdvegas/rez | src/rez/vendor/sortedcontainers/sortedset.py | SortedSet.copy | def copy(self):
"""Create a shallow copy of the sorted set."""
return self._fromset(set(self._set), key=self._key) | python | def copy(self):
"""Create a shallow copy of the sorted set."""
return self._fromset(set(self._set), key=self._key) | [
"def",
"copy",
"(",
"self",
")",
":",
"return",
"self",
".",
"_fromset",
"(",
"set",
"(",
"self",
".",
"_set",
")",
",",
"key",
"=",
"self",
".",
"_key",
")"
] | Create a shallow copy of the sorted set. | [
"Create",
"a",
"shallow",
"copy",
"of",
"the",
"sorted",
"set",
"."
] | train | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/sortedcontainers/sortedset.py#L168-L170 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Create a shallow copy of the sorted set.
### Response:
def copy(self):
"""Create a shallow copy of the sorted set."""
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4110,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4110,
... |
SeleniumHQ/selenium | py/selenium/webdriver/remote/webdriver.py | WebDriver.find_element | def find_element(self, by=By.ID, value=None):
"""
Find an element given a By strategy and locator. Prefer the find_element_by_* methods when
possible.
:Usage:
::
element = driver.find_element(By.ID, 'foo')
:rtype: WebElement
"""
if s... | python | def find_element(self, by=By.ID, value=None):
"""
Find an element given a By strategy and locator. Prefer the find_element_by_* methods when
possible.
:Usage:
::
element = driver.find_element(By.ID, 'foo')
:rtype: WebElement
"""
if s... | [
"def",
"find_element",
"(",
"self",
",",
"by",
"=",
"By",
".",
"ID",
",",
"value",
"=",
"None",
")",
":",
"if",
"self",
".",
"w3c",
":",
"if",
"by",
"==",
"By",
".",
"ID",
":",
"by",
"=",
"By",
".",
"CSS_SELECTOR",
"value",
"=",
"'[id=\"%s\"]'",
... | Find an element given a By strategy and locator. Prefer the find_element_by_* methods when
possible.
:Usage:
::
element = driver.find_element(By.ID, 'foo')
:rtype: WebElement | [
"Find",
"an",
"element",
"given",
"a",
"By",
"strategy",
"and",
"locator",
".",
"Prefer",
"the",
"find_element_by_",
"*",
"methods",
"when",
"possible",
"."
] | train | https://github.com/SeleniumHQ/selenium/blob/df40c28b41d4b3953f90eaff84838a9ac052b84a/py/selenium/webdriver/remote/webdriver.py#L988-L1014 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Find an element given a By strategy and locator. Prefer the find_element_by_* methods when
possible.
:Usage:
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10086,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10086,
... |
sanoma/django-arctic | arctic/templatetags/arctic_pagination_tags.py | arctic_paginate | def arctic_paginate(parser, token):
"""
Renders a Page object with pagination bar.
Example::
{% arctic_paginate page_obj paginator=page_obj.paginator range=10 %}
Named Parameters::
range - The size of the pagination bar (ie, if set to 10 then, at most,
10 page numbers wil... | python | def arctic_paginate(parser, token):
"""
Renders a Page object with pagination bar.
Example::
{% arctic_paginate page_obj paginator=page_obj.paginator range=10 %}
Named Parameters::
range - The size of the pagination bar (ie, if set to 10 then, at most,
10 page numbers wil... | [
"def",
"arctic_paginate",
"(",
"parser",
",",
"token",
")",
":",
"bits",
"=",
"token",
".",
"split_contents",
"(",
")",
"if",
"len",
"(",
"bits",
")",
"<",
"2",
":",
"raise",
"TemplateSyntaxError",
"(",
"\"'%s' takes at least one argument\"",
"\" (Page object re... | Renders a Page object with pagination bar.
Example::
{% arctic_paginate page_obj paginator=page_obj.paginator range=10 %}
Named Parameters::
range - The size of the pagination bar (ie, if set to 10 then, at most,
10 page numbers will display at any given time) Defaults to
... | [
"Renders",
"a",
"Page",
"object",
"with",
"pagination",
"bar",
".",
"Example",
"::",
"{",
"%",
"arctic_paginate",
"page_obj",
"paginator",
"=",
"page_obj",
".",
"paginator",
"range",
"=",
"10",
"%",
"}",
"Named",
"Parameters",
"::",
"range",
"-",
"The",
"s... | train | https://github.com/sanoma/django-arctic/blob/c81b092c2643ca220708bf3c586017d9175161f5/arctic/templatetags/arctic_pagination_tags.py#L153-L188 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Renders a Page object with pagination bar.
Example::
{% arctic_paginate page_obj paginator=page_obj.paginator range... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
49,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
49,
14... |
SpamScope/mail-parser | mailparser/mailparser.py | MailParser.from_string | def from_string(cls, s):
"""
Init a new object from a string.
Args:
s (string): raw email
Returns:
Instance of MailParser
"""
log.debug("Parsing email from string")
message = email.message_from_string(s)
return cls(message) | python | def from_string(cls, s):
"""
Init a new object from a string.
Args:
s (string): raw email
Returns:
Instance of MailParser
"""
log.debug("Parsing email from string")
message = email.message_from_string(s)
return cls(message) | [
"def",
"from_string",
"(",
"cls",
",",
"s",
")",
":",
"log",
".",
"debug",
"(",
"\"Parsing email from string\"",
")",
"message",
"=",
"email",
".",
"message_from_string",
"(",
"s",
")",
"return",
"cls",
"(",
"message",
")"
] | Init a new object from a string.
Args:
s (string): raw email
Returns:
Instance of MailParser | [
"Init",
"a",
"new",
"object",
"from",
"a",
"string",
"."
] | train | https://github.com/SpamScope/mail-parser/blob/814b56d0b803feab9dea04f054b802ce138097e2/mailparser/mailparser.py#L207-L220 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Init a new object from a string.
Args:
s (string): raw email
Returns:
Instance of Mai... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
3888,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
3888,
... |
Metatab/metapack | metapack/package/core.py | PackageBuilder.create_nv_link | def create_nv_link(self):
"""After a save(), write a link to the saved file using a non-versioned name"""
from os.path import abspath, islink
from os import unlink, symlink
nv_name = self.doc.as_version(None)
from_path = abspath(self._last_write_path or self.package_path.path)... | python | def create_nv_link(self):
"""After a save(), write a link to the saved file using a non-versioned name"""
from os.path import abspath, islink
from os import unlink, symlink
nv_name = self.doc.as_version(None)
from_path = abspath(self._last_write_path or self.package_path.path)... | [
"def",
"create_nv_link",
"(",
"self",
")",
":",
"from",
"os",
".",
"path",
"import",
"abspath",
",",
"islink",
"from",
"os",
"import",
"unlink",
",",
"symlink",
"nv_name",
"=",
"self",
".",
"doc",
".",
"as_version",
"(",
"None",
")",
"from_path",
"=",
... | After a save(), write a link to the saved file using a non-versioned name | [
"After",
"a",
"save",
"()",
"write",
"a",
"link",
"to",
"the",
"saved",
"file",
"using",
"a",
"non",
"-",
"versioned",
"name"
] | train | https://github.com/Metatab/metapack/blob/8365f221fbeaa3c0be9091f2eaf3447fd8e2e8d6/metapack/package/core.py#L587-L601 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
After a save(), write a link to the saved file using a non-versioned name
### Response:
def create_nv_link(self):
"""A... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6153,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6153,
... |
KnightConan/sspdatatables | src/sspdatatables/templatetags/form_field.py | get_form_bound_field | def get_form_bound_field(form, field_name):
"""
Intends to get the bound field from the form regarding the field name
:param form: Django Form: django form instance
:param field_name: str: name of the field in form instance
:return: Django Form bound field
"""
field = form.fields[field_name... | python | def get_form_bound_field(form, field_name):
"""
Intends to get the bound field from the form regarding the field name
:param form: Django Form: django form instance
:param field_name: str: name of the field in form instance
:return: Django Form bound field
"""
field = form.fields[field_name... | [
"def",
"get_form_bound_field",
"(",
"form",
",",
"field_name",
")",
":",
"field",
"=",
"form",
".",
"fields",
"[",
"field_name",
"]",
"field",
"=",
"field",
".",
"get_bound_field",
"(",
"form",
",",
"field_name",
")",
"return",
"field"
] | Intends to get the bound field from the form regarding the field name
:param form: Django Form: django form instance
:param field_name: str: name of the field in form instance
:return: Django Form bound field | [
"Intends",
"to",
"get",
"the",
"bound",
"field",
"from",
"the",
"form",
"regarding",
"the",
"field",
"name"
] | train | https://github.com/KnightConan/sspdatatables/blob/1179a11358734e5e472e5eee703e8d34fa49e9bf/src/sspdatatables/templatetags/form_field.py#L10-L20 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Intends to get the bound field from the form regarding the field name
:param form: Django Form: django form instance
:... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1090,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1090,
... |
dnanexus/dx-toolkit | src/python/dxpy/bindings/dxjob.py | DXJob.wait_on_done | def wait_on_done(self, interval=2, timeout=3600*24*7, **kwargs):
'''
:param interval: Number of seconds between queries to the job's state
:type interval: integer
:param timeout: Maximum amount of time to wait, in seconds, until the job is done running
:type timeout: integer
... | python | def wait_on_done(self, interval=2, timeout=3600*24*7, **kwargs):
'''
:param interval: Number of seconds between queries to the job's state
:type interval: integer
:param timeout: Maximum amount of time to wait, in seconds, until the job is done running
:type timeout: integer
... | [
"def",
"wait_on_done",
"(",
"self",
",",
"interval",
"=",
"2",
",",
"timeout",
"=",
"3600",
"*",
"24",
"*",
"7",
",",
"*",
"*",
"kwargs",
")",
":",
"elapsed",
"=",
"0",
"while",
"True",
":",
"state",
"=",
"self",
".",
"_get_state",
"(",
"*",
"*",... | :param interval: Number of seconds between queries to the job's state
:type interval: integer
:param timeout: Maximum amount of time to wait, in seconds, until the job is done running
:type timeout: integer
:raises: :exc:`~dxpy.exceptions.DXError` if the timeout is reached before the job... | [
":",
"param",
"interval",
":",
"Number",
"of",
"seconds",
"between",
"queries",
"to",
"the",
"job",
"s",
"state",
":",
"type",
"interval",
":",
"integer",
":",
"param",
"timeout",
":",
"Maximum",
"amount",
"of",
"time",
"to",
"wait",
"in",
"seconds",
"un... | train | https://github.com/dnanexus/dx-toolkit/blob/74befb53ad90fcf902d8983ae6d74580f402d619/src/python/dxpy/bindings/dxjob.py#L262-L291 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
:param interval: Number of seconds between queries to the job's state
:type interval: integer
:param timeout: M... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
68416,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
68416,
... |
googlesamples/assistant-sdk-python | google-assistant-sdk/googlesamples/assistant/grpc/audio_helpers.py | ConversationStream.stop_recording | def stop_recording(self):
"""Stop recording from the audio source."""
self._stop_recording.set()
with self._source_lock:
self._source.stop()
self._recording = False | python | def stop_recording(self):
"""Stop recording from the audio source."""
self._stop_recording.set()
with self._source_lock:
self._source.stop()
self._recording = False | [
"def",
"stop_recording",
"(",
"self",
")",
":",
"self",
".",
"_stop_recording",
".",
"set",
"(",
")",
"with",
"self",
".",
"_source_lock",
":",
"self",
".",
"_source",
".",
"stop",
"(",
")",
"self",
".",
"_recording",
"=",
"False"
] | Stop recording from the audio source. | [
"Stop",
"recording",
"from",
"the",
"audio",
"source",
"."
] | train | https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/audio_helpers.py#L281-L286 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Stop recording from the audio source.
### Response:
def stop_recording(self):
"""Stop recording from the audio source.... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10903,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10903,
... |
PmagPy/PmagPy | SPD/lib/lib_arai_plot_statistics.py | fancy_SCAT | def fancy_SCAT(points, low_bound, high_bound, x_max, y_max):
"""
runs SCAT test and returns 'Pass' or 'Fail'
"""
# iterate through all relevant points and see if any of them fall outside of your SCAT box
# {'points_arai': [(x,y),(x,y)], 'points_ptrm': [(x,y),(x,y)], ...}
SCAT = 'Pass'
SCATs ... | python | def fancy_SCAT(points, low_bound, high_bound, x_max, y_max):
"""
runs SCAT test and returns 'Pass' or 'Fail'
"""
# iterate through all relevant points and see if any of them fall outside of your SCAT box
# {'points_arai': [(x,y),(x,y)], 'points_ptrm': [(x,y),(x,y)], ...}
SCAT = 'Pass'
SCATs ... | [
"def",
"fancy_SCAT",
"(",
"points",
",",
"low_bound",
",",
"high_bound",
",",
"x_max",
",",
"y_max",
")",
":",
"# iterate through all relevant points and see if any of them fall outside of your SCAT box",
"# {'points_arai': [(x,y),(x,y)], 'points_ptrm': [(x,y),(x,y)], ...}",
"SCAT",
... | runs SCAT test and returns 'Pass' or 'Fail' | [
"runs",
"SCAT",
"test",
"and",
"returns",
"Pass",
"or",
"Fail"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L196-L216 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
runs SCAT test and returns 'Pass' or 'Fail'
### Response:
def fancy_SCAT(points, low_bound, high_bound, x_max, y_max):
"""... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
54410,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
54410,
... |
BetterWorks/django-anonymizer | anonymizer/base.py | DjangoFaker.date | def date(self, field=None, val=None):
"""
Like datetime, but truncated to be a date only
"""
return self.datetime(field=field, val=val).date() | python | def date(self, field=None, val=None):
"""
Like datetime, but truncated to be a date only
"""
return self.datetime(field=field, val=val).date() | [
"def",
"date",
"(",
"self",
",",
"field",
"=",
"None",
",",
"val",
"=",
"None",
")",
":",
"return",
"self",
".",
"datetime",
"(",
"field",
"=",
"field",
",",
"val",
"=",
"val",
")",
".",
"date",
"(",
")"
] | Like datetime, but truncated to be a date only | [
"Like",
"datetime",
"but",
"truncated",
"to",
"be",
"a",
"date",
"only"
] | train | https://github.com/BetterWorks/django-anonymizer/blob/2d25bb6e8b5e4230c58031c4b6d10cc536669b3e/anonymizer/base.py#L135-L139 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Like datetime, but truncated to be a date only
### Response:
def date(self, field=None, val=None):
"""
Like da... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
13246,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
13246,
... |
aliyun/aliyun-log-python-sdk | aliyun/log/logclient.py | LogClient.get_begin_cursor | def get_begin_cursor(self, project_name, logstore_name, shard_id):
""" Get begin cursor from log service for batch pull logs
Unsuccessful opertaion will cause an LogException.
:type project_name: string
:param project_name: the Project name
:type logstore_name: string
... | python | def get_begin_cursor(self, project_name, logstore_name, shard_id):
""" Get begin cursor from log service for batch pull logs
Unsuccessful opertaion will cause an LogException.
:type project_name: string
:param project_name: the Project name
:type logstore_name: string
... | [
"def",
"get_begin_cursor",
"(",
"self",
",",
"project_name",
",",
"logstore_name",
",",
"shard_id",
")",
":",
"return",
"self",
".",
"get_cursor",
"(",
"project_name",
",",
"logstore_name",
",",
"shard_id",
",",
"\"begin\"",
")"
] | Get begin cursor from log service for batch pull logs
Unsuccessful opertaion will cause an LogException.
:type project_name: string
:param project_name: the Project name
:type logstore_name: string
:param logstore_name: the logstore name
:type shard_id: int
... | [
"Get",
"begin",
"cursor",
"from",
"log",
"service",
"for",
"batch",
"pull",
"logs",
"Unsuccessful",
"opertaion",
"will",
"cause",
"an",
"LogException",
".",
":",
"type",
"project_name",
":",
"string",
":",
"param",
"project_name",
":",
"the",
"Project",
"name"... | train | https://github.com/aliyun/aliyun-log-python-sdk/blob/ac383db0a16abf1e5ef7df36074374184b43516e/aliyun/log/logclient.py#L749-L766 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Get begin cursor from log service for batch pull logs
Unsuccessful opertaion will cause an LogException.
:t... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... |
apple/turicreate | deps/src/libxml2-2.9.1/python/libxml2.py | xmlNode.newNs | def newNs(self, href, prefix):
"""Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
one present on this node. We use href==None in the case of
an element creation where the namespace was not defined. """
ret... | python | def newNs(self, href, prefix):
"""Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
one present on this node. We use href==None in the case of
an element creation where the namespace was not defined. """
ret... | [
"def",
"newNs",
"(",
"self",
",",
"href",
",",
"prefix",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlNewNs",
"(",
"self",
".",
"_o",
",",
"href",
",",
"prefix",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlNewNs() failed'",
"... | Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
one present on this node. We use href==None in the case of
an element creation where the namespace was not defined. | [
"Creation",
"of",
"a",
"new",
"Namespace",
".",
"This",
"function",
"will",
"refuse",
"to",
"create",
"a",
"namespace",
"with",
"a",
"similar",
"prefix",
"than",
"an",
"existing",
"one",
"present",
"on",
"this",
"node",
".",
"We",
"use",
"href",
"==",
"N... | train | https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L3363-L3371 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Creation of a new Namespace. This function will refuse to
create a namespace with a similar prefix than an existing
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
33801,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
33801,
... |
OSSOS/MOP | src/ossos/core/ossos/gui/models/workload.py | WorkUnitProvider.get_workunit | def get_workunit(self, ignore_list=None):
"""
Gets a new unit of work.
Args:
ignore_list: list(str)
A list of filenames which should be ignored. Defaults to None.
Returns:
new_workunit: WorkUnit
A new unit of work that has not yet been proce... | python | def get_workunit(self, ignore_list=None):
"""
Gets a new unit of work.
Args:
ignore_list: list(str)
A list of filenames which should be ignored. Defaults to None.
Returns:
new_workunit: WorkUnit
A new unit of work that has not yet been proce... | [
"def",
"get_workunit",
"(",
"self",
",",
"ignore_list",
"=",
"None",
")",
":",
"if",
"ignore_list",
"is",
"None",
":",
"ignore_list",
"=",
"[",
"]",
"potential_files",
"=",
"self",
".",
"get_potential_files",
"(",
"ignore_list",
")",
"while",
"len",
"(",
"... | Gets a new unit of work.
Args:
ignore_list: list(str)
A list of filenames which should be ignored. Defaults to None.
Returns:
new_workunit: WorkUnit
A new unit of work that has not yet been processed. A lock on
it has been acquired.
Ra... | [
"Gets",
"a",
"new",
"unit",
"of",
"work",
"."
] | train | https://github.com/OSSOS/MOP/blob/94f91d32ad5ec081d5a1ebd67604a838003465af/src/ossos/core/ossos/gui/models/workload.py#L579-L625 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Gets a new unit of work.
Args:
ignore_list: list(str)
A list of filenames which should be ignore... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
50458,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
50458,
... |
basler/pypylon | scripts/builddoxy2swig/doxy2swig/doxy2swig.py | Doxy2SWIG.handle_typical_memberdefs_no_overload | def handle_typical_memberdefs_no_overload(self, signature, memberdef_nodes):
"""Produce standard documentation for memberdef_nodes."""
for n in memberdef_nodes:
self.add_text(['\n', '%feature("docstring") ', signature, ' "', '\n'])
if self.with_function_signature:
... | python | def handle_typical_memberdefs_no_overload(self, signature, memberdef_nodes):
"""Produce standard documentation for memberdef_nodes."""
for n in memberdef_nodes:
self.add_text(['\n', '%feature("docstring") ', signature, ' "', '\n'])
if self.with_function_signature:
... | [
"def",
"handle_typical_memberdefs_no_overload",
"(",
"self",
",",
"signature",
",",
"memberdef_nodes",
")",
":",
"for",
"n",
"in",
"memberdef_nodes",
":",
"self",
".",
"add_text",
"(",
"[",
"'\\n'",
",",
"'%feature(\"docstring\") '",
",",
"signature",
",",
"' \"'"... | Produce standard documentation for memberdef_nodes. | [
"Produce",
"standard",
"documentation",
"for",
"memberdef_nodes",
"."
] | train | https://github.com/basler/pypylon/blob/d3510fa419b1c2b17f3f0b80a5fbb720c7b84008/scripts/builddoxy2swig/doxy2swig/doxy2swig.py#L431-L438 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Produce standard documentation for memberdef_nodes.
### Response:
def handle_typical_memberdefs_no_overload(self, signature, m... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1360,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1360,
... |
phaethon/kamene | kamene/packet.py | ls | def ls(obj=None):
"""List available layers, or infos on a given layer"""
if obj is None:
import builtins
all = builtins.__dict__.copy()
all.update(globals())
objlst = sorted(conf.layers, key=lambda x:x.__name__)
for o in objlst:
print("%-10s : %s" %(... | python | def ls(obj=None):
"""List available layers, or infos on a given layer"""
if obj is None:
import builtins
all = builtins.__dict__.copy()
all.update(globals())
objlst = sorted(conf.layers, key=lambda x:x.__name__)
for o in objlst:
print("%-10s : %s" %(... | [
"def",
"ls",
"(",
"obj",
"=",
"None",
")",
":",
"if",
"obj",
"is",
"None",
":",
"import",
"builtins",
"all",
"=",
"builtins",
".",
"__dict__",
".",
"copy",
"(",
")",
"all",
".",
"update",
"(",
"globals",
"(",
")",
")",
"objlst",
"=",
"sorted",
"(... | List available layers, or infos on a given layer | [
"List",
"available",
"layers",
"or",
"infos",
"on",
"a",
"given",
"layer"
] | train | https://github.com/phaethon/kamene/blob/11d4064844f4f68ac5d7546f5633ac7d02082914/kamene/packet.py#L1250-L1273 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
List available layers, or infos on a given layer
### Response:
def ls(obj=None):
"""List available layers, or infos on a... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
861,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
861,
2... |
pgmpy/pgmpy | pgmpy/readwrite/XMLBIF.py | XMLBIFWriter.get_definition | def get_definition(self):
"""
Add Definition to XMLBIF
Return
------
dict: dict of type {variable: definition tag}
Examples
--------
>>> writer = XMLBIFWriter(model)
>>> writer.get_definition()
{'hear-bark': <Element DEFINITION at 0x7f1d4... | python | def get_definition(self):
"""
Add Definition to XMLBIF
Return
------
dict: dict of type {variable: definition tag}
Examples
--------
>>> writer = XMLBIFWriter(model)
>>> writer.get_definition()
{'hear-bark': <Element DEFINITION at 0x7f1d4... | [
"def",
"get_definition",
"(",
"self",
")",
":",
"cpds",
"=",
"self",
".",
"model",
".",
"get_cpds",
"(",
")",
"cpds",
".",
"sort",
"(",
"key",
"=",
"lambda",
"x",
":",
"x",
".",
"variable",
")",
"definition_tag",
"=",
"{",
"}",
"for",
"cpd",
"in",
... | Add Definition to XMLBIF
Return
------
dict: dict of type {variable: definition tag}
Examples
--------
>>> writer = XMLBIFWriter(model)
>>> writer.get_definition()
{'hear-bark': <Element DEFINITION at 0x7f1d48977408>,
'family-out': <Element DEFI... | [
"Add",
"Definition",
"to",
"XMLBIF"
] | train | https://github.com/pgmpy/pgmpy/blob/9381a66aba3c3871d3ccd00672b148d17d63239e/pgmpy/readwrite/XMLBIF.py#L372-L399 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Add Definition to XMLBIF
Return
------
dict: dict of type {variable: definition tag}
Examples... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... |
dhermes/bezier | scripts/post_process_journal.py | post_process_travis_macos | def post_process_travis_macos(journal_filename):
"""Post-process a generated journal file on Travis macOS.
Args:
journal_filename (str): The name of the journal file.
"""
travis_build_dir = os.environ.get("TRAVIS_BUILD_DIR", "")
with open(journal_filename, "r") as file_obj:
content ... | python | def post_process_travis_macos(journal_filename):
"""Post-process a generated journal file on Travis macOS.
Args:
journal_filename (str): The name of the journal file.
"""
travis_build_dir = os.environ.get("TRAVIS_BUILD_DIR", "")
with open(journal_filename, "r") as file_obj:
content ... | [
"def",
"post_process_travis_macos",
"(",
"journal_filename",
")",
":",
"travis_build_dir",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"\"TRAVIS_BUILD_DIR\"",
",",
"\"\"",
")",
"with",
"open",
"(",
"journal_filename",
",",
"\"r\"",
")",
"as",
"file_obj",
":",
... | Post-process a generated journal file on Travis macOS.
Args:
journal_filename (str): The name of the journal file. | [
"Post",
"-",
"process",
"a",
"generated",
"journal",
"file",
"on",
"Travis",
"macOS",
"."
] | train | https://github.com/dhermes/bezier/blob/4f941f82637a8e70a5b159a9203132192e23406b/scripts/post_process_journal.py#L23-L34 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Post-process a generated journal file on Travis macOS.
Args:
journal_filename (str): The name of the journal file.... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4226,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4226,
... |
src-d/lookout-sdk | python/lookout/sdk/grpc/log_fields.py | LogFieldsContext.pack_metadata | def pack_metadata(self) -> List[Tuple[str, Any]]:
"""Packs the log fields and the invocation metadata into a new metadata
The log fields are added in the new metadata with the key
`LOG_FIELDS_KEY_META`.
"""
metadata = [(k, v) for k, v in self._invocation_metadata.items()
... | python | def pack_metadata(self) -> List[Tuple[str, Any]]:
"""Packs the log fields and the invocation metadata into a new metadata
The log fields are added in the new metadata with the key
`LOG_FIELDS_KEY_META`.
"""
metadata = [(k, v) for k, v in self._invocation_metadata.items()
... | [
"def",
"pack_metadata",
"(",
"self",
")",
"->",
"List",
"[",
"Tuple",
"[",
"str",
",",
"Any",
"]",
"]",
":",
"metadata",
"=",
"[",
"(",
"k",
",",
"v",
")",
"for",
"k",
",",
"v",
"in",
"self",
".",
"_invocation_metadata",
".",
"items",
"(",
")",
... | Packs the log fields and the invocation metadata into a new metadata
The log fields are added in the new metadata with the key
`LOG_FIELDS_KEY_META`. | [
"Packs",
"the",
"log",
"fields",
"and",
"the",
"invocation",
"metadata",
"into",
"a",
"new",
"metadata"
] | train | https://github.com/src-d/lookout-sdk/blob/2ca64a77b022864fed3bb31d12997712c7e98e6e/python/lookout/sdk/grpc/log_fields.py#L53-L63 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Packs the log fields and the invocation metadata into a new metadata
The log fields are added in the new metadata with... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
47,
79... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
47,
79... |
gwastro/pycbc | pycbc/types/array.py | Array._return | def _return(self, ary):
"""Wrap the ary to return an Array type """
if isinstance(ary, Array):
return ary
return Array(ary, copy=False) | python | def _return(self, ary):
"""Wrap the ary to return an Array type """
if isinstance(ary, Array):
return ary
return Array(ary, copy=False) | [
"def",
"_return",
"(",
"self",
",",
"ary",
")",
":",
"if",
"isinstance",
"(",
"ary",
",",
"Array",
")",
":",
"return",
"ary",
"return",
"Array",
"(",
"ary",
",",
"copy",
"=",
"False",
")"
] | Wrap the ary to return an Array type | [
"Wrap",
"the",
"ary",
"to",
"return",
"an",
"Array",
"type"
] | train | https://github.com/gwastro/pycbc/blob/7a64cdd104d263f1b6ea0b01e6841837d05a4cb3/pycbc/types/array.py#L238-L242 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Wrap the ary to return an Array type
### Response:
def _return(self, ary):
"""Wrap the ary to return an Array type """... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
27885,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
27885,
... |
Kronuz/pyScss | scss/compiler.py | Compilation._at_variables | def _at_variables(self, calculator, rule, scope, block):
"""
Implements @variables and @vars
"""
warn_deprecated(
rule,
"@variables and @vars are deprecated. "
"Just assign variables at top-level.")
_rule = rule.copy()
_rule.unparsed_c... | python | def _at_variables(self, calculator, rule, scope, block):
"""
Implements @variables and @vars
"""
warn_deprecated(
rule,
"@variables and @vars are deprecated. "
"Just assign variables at top-level.")
_rule = rule.copy()
_rule.unparsed_c... | [
"def",
"_at_variables",
"(",
"self",
",",
"calculator",
",",
"rule",
",",
"scope",
",",
"block",
")",
":",
"warn_deprecated",
"(",
"rule",
",",
"\"@variables and @vars are deprecated. \"",
"\"Just assign variables at top-level.\"",
")",
"_rule",
"=",
"rule",
".",
"... | Implements @variables and @vars | [
"Implements"
] | train | https://github.com/Kronuz/pyScss/blob/fb32b317f6e2b4b4aad2b86a74844658ac4aa11e/scss/compiler.py#L1011-L1023 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Implements @variables and @vars
### Response:
def _at_variables(self, calculator, rule, scope, block):
"""
Imp... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1453,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1453,
... |
yamins81/tabular | tabular/io.py | parsetypes | def parsetypes(dtype):
"""
Parse the types from a structured numpy dtype object.
Return list of string representations of types from a structured numpy
dtype object, e.g. ['int', 'float', 'str'].
Used by :func:`tabular.io.saveSV` to write out type information in the
header.
**Parameters... | python | def parsetypes(dtype):
"""
Parse the types from a structured numpy dtype object.
Return list of string representations of types from a structured numpy
dtype object, e.g. ['int', 'float', 'str'].
Used by :func:`tabular.io.saveSV` to write out type information in the
header.
**Parameters... | [
"def",
"parsetypes",
"(",
"dtype",
")",
":",
"return",
"[",
"dtype",
"[",
"i",
"]",
".",
"name",
".",
"strip",
"(",
"'1234567890'",
")",
".",
"rstrip",
"(",
"'ing'",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"dtype",
")",
")",
"]"
] | Parse the types from a structured numpy dtype object.
Return list of string representations of types from a structured numpy
dtype object, e.g. ['int', 'float', 'str'].
Used by :func:`tabular.io.saveSV` to write out type information in the
header.
**Parameters**
**dtype** : numpy dtyp... | [
"Parse",
"the",
"types",
"from",
"a",
"structured",
"numpy",
"dtype",
"object",
"."
] | train | https://github.com/yamins81/tabular/blob/1caf091c8c395960a9ad7078f95158b533cc52dd/tabular/io.py#L1808-L1835 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Parse the types from a structured numpy dtype object.
Return list of string representations of types from a structured num... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
14802,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
14802,
... |
janpipek/physt | physt/plotting/vega.py | _create_axes | def _create_axes(hist: HistogramBase, vega: dict, kwargs: dict):
"""Create axes in the figure."""
xlabel = kwargs.pop("xlabel", hist.axis_names[0])
ylabel = kwargs.pop("ylabel", hist.axis_names[1] if len(hist.axis_names) >= 2 else None)
vega["axes"] = [
{"orient": "bottom", "scale": "xscale", "t... | python | def _create_axes(hist: HistogramBase, vega: dict, kwargs: dict):
"""Create axes in the figure."""
xlabel = kwargs.pop("xlabel", hist.axis_names[0])
ylabel = kwargs.pop("ylabel", hist.axis_names[1] if len(hist.axis_names) >= 2 else None)
vega["axes"] = [
{"orient": "bottom", "scale": "xscale", "t... | [
"def",
"_create_axes",
"(",
"hist",
":",
"HistogramBase",
",",
"vega",
":",
"dict",
",",
"kwargs",
":",
"dict",
")",
":",
"xlabel",
"=",
"kwargs",
".",
"pop",
"(",
"\"xlabel\"",
",",
"hist",
".",
"axis_names",
"[",
"0",
"]",
")",
"ylabel",
"=",
"kwar... | Create axes in the figure. | [
"Create",
"axes",
"in",
"the",
"figure",
"."
] | train | https://github.com/janpipek/physt/blob/6dd441b073514e7728235f50b2352d56aacf38d4/physt/plotting/vega.py#L673-L680 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Create axes in the figure.
### Response:
def _create_axes(hist: HistogramBase, vega: dict, kwargs: dict):
"""Create axes i... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4110,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4110,
... |
sethmlarson/virtualbox-python | virtualbox/library.py | IInternalSessionControl.on_network_adapter_change | def on_network_adapter_change(self, network_adapter, change_adapter):
"""Triggered when settings of a network adapter of the
associated virtual machine have changed.
in network_adapter of type :class:`INetworkAdapter`
in change_adapter of type bool
raises :class:`VBoxErrorInva... | python | def on_network_adapter_change(self, network_adapter, change_adapter):
"""Triggered when settings of a network adapter of the
associated virtual machine have changed.
in network_adapter of type :class:`INetworkAdapter`
in change_adapter of type bool
raises :class:`VBoxErrorInva... | [
"def",
"on_network_adapter_change",
"(",
"self",
",",
"network_adapter",
",",
"change_adapter",
")",
":",
"if",
"not",
"isinstance",
"(",
"network_adapter",
",",
"INetworkAdapter",
")",
":",
"raise",
"TypeError",
"(",
"\"network_adapter can only be an instance of type INe... | Triggered when settings of a network adapter of the
associated virtual machine have changed.
in network_adapter of type :class:`INetworkAdapter`
in change_adapter of type bool
raises :class:`VBoxErrorInvalidVmState`
Session state prevents operation.
raises... | [
"Triggered",
"when",
"settings",
"of",
"a",
"network",
"adapter",
"of",
"the",
"associated",
"virtual",
"machine",
"have",
"changed",
"."
] | train | https://github.com/sethmlarson/virtualbox-python/blob/706c8e3f6e3aee17eb06458e73cbb4bc2d37878b/virtualbox/library.py#L28324-L28344 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Triggered when settings of a network adapter of the
associated virtual machine have changed.
in network_adapte... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
18423,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
18423,
... |
datadotworld/data.world-py | datadotworld/client/_swagger/apis/insights_api.py | InsightsApi.get_insight | def get_insight(self, project_owner, project_id, id, **kwargs):
"""
Retrieve an insight
Retrieve an insight.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the... | python | def get_insight(self, project_owner, project_id, id, **kwargs):
"""
Retrieve an insight
Retrieve an insight.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the... | [
"def",
"get_insight",
"(",
"self",
",",
"project_owner",
",",
"project_id",
",",
"id",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'callback'",
")",
":",
"return",
"sel... | Retrieve an insight
Retrieve an insight.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(respo... | [
"Retrieve",
"an",
"insight",
"Retrieve",
"an",
"insight",
".",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"request",
"by",
"default",
".",
"To",
"make",
"an",
"asynchronous",
"HTTP",
"request",
"please",
"define",
"a",
"callback",
"function",
"to",... | train | https://github.com/datadotworld/data.world-py/blob/ffaeb115f358731ab0b805b0c43b7ff2e3cf0a77/datadotworld/client/_swagger/apis/insights_api.py#L284-L310 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Retrieve an insight
Retrieve an insight.
This method makes a synchronous HTTP request by default. To make an
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
88765,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
88765,
... |
tensorflow/tensor2tensor | tensor2tensor/models/video/next_frame_glow.py | get_cond_latents | def get_cond_latents(all_latents=None, hparams=None):
"""Get z^{cond}_{t} given z^{1..t-1}.
Args:
all_latents: list of list of tensors,
outer-size equals no.of time_steps-1
inner-size equals hparams.n_levels.
hparams: See next_frame_glow_hparams.
Returns:
cond_latent... | python | def get_cond_latents(all_latents=None, hparams=None):
"""Get z^{cond}_{t} given z^{1..t-1}.
Args:
all_latents: list of list of tensors,
outer-size equals no.of time_steps-1
inner-size equals hparams.n_levels.
hparams: See next_frame_glow_hparams.
Returns:
cond_latent... | [
"def",
"get_cond_latents",
"(",
"all_latents",
"=",
"None",
",",
"hparams",
"=",
"None",
")",
":",
"cond_latents",
"=",
"None",
"if",
"hparams",
".",
"gen_mode",
"==",
"\"conditional\"",
":",
"if",
"hparams",
".",
"latent_dist_encoder",
"in",
"[",
"\"conv_net\... | Get z^{cond}_{t} given z^{1..t-1}.
Args:
all_latents: list of list of tensors,
outer-size equals no.of time_steps-1
inner-size equals hparams.n_levels.
hparams: See next_frame_glow_hparams.
Returns:
cond_latents: conditional latents at time-step t. | [
"Get",
"z^",
"{",
"cond",
"}",
"_",
"{",
"t",
"}",
"given",
"z^",
"{",
"1",
"..",
"t",
"-",
"1",
"}",
"."
] | train | https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/video/next_frame_glow.py#L150-L179 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Get z^{cond}_{t} given z^{1..t-1}.
Args:
all_latents: list of list of tensors,
outer-size equals no.of ... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
1991,
... |
openid/python-openid | openid/message.py | Message._fixNS | def _fixNS(self, namespace):
"""Convert an input value into the internally used values of
this object
@param namespace: The string or constant to convert
@type namespace: str or unicode or BARE_NS or OPENID_NS
"""
if namespace == OPENID_NS:
if self._openid_ns... | python | def _fixNS(self, namespace):
"""Convert an input value into the internally used values of
this object
@param namespace: The string or constant to convert
@type namespace: str or unicode or BARE_NS or OPENID_NS
"""
if namespace == OPENID_NS:
if self._openid_ns... | [
"def",
"_fixNS",
"(",
"self",
",",
"namespace",
")",
":",
"if",
"namespace",
"==",
"OPENID_NS",
":",
"if",
"self",
".",
"_openid_ns_uri",
"is",
"None",
":",
"raise",
"UndefinedOpenIDNamespace",
"(",
"'OpenID namespace not set'",
")",
"else",
":",
"namespace",
... | Convert an input value into the internally used values of
this object
@param namespace: The string or constant to convert
@type namespace: str or unicode or BARE_NS or OPENID_NS | [
"Convert",
"an",
"input",
"value",
"into",
"the",
"internally",
"used",
"values",
"of",
"this",
"object"
] | train | https://github.com/openid/python-openid/blob/f7e13536f0d1828d3cef5ae7a7b55cabadff37fc/openid/message.py#L369-L396 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Convert an input value into the internally used values of
this object
@param namespace: The string or constant... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
12281,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
12281,
... |
senaite/senaite.core | bika/lims/setuphandlers.py | setup_handler | def setup_handler(context):
"""SENAITE setup handler
"""
if context.readDataFile("bika.lims_various.txt") is None:
return
logger.info("SENAITE setup handler [BEGIN]")
portal = context.getSite()
# Run Installers
remove_default_content(portal)
hide_navbar_items(portal)
rein... | python | def setup_handler(context):
"""SENAITE setup handler
"""
if context.readDataFile("bika.lims_various.txt") is None:
return
logger.info("SENAITE setup handler [BEGIN]")
portal = context.getSite()
# Run Installers
remove_default_content(portal)
hide_navbar_items(portal)
rein... | [
"def",
"setup_handler",
"(",
"context",
")",
":",
"if",
"context",
".",
"readDataFile",
"(",
"\"bika.lims_various.txt\"",
")",
"is",
"None",
":",
"return",
"logger",
".",
"info",
"(",
"\"SENAITE setup handler [BEGIN]\"",
")",
"portal",
"=",
"context",
".",
"getS... | SENAITE setup handler | [
"SENAITE",
"setup",
"handler"
] | train | https://github.com/senaite/senaite.core/blob/7602ce2ea2f9e81eb34e20ce17b98a3e70713f85/bika/lims/setuphandlers.py#L336-L361 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
SENAITE setup handler
### Response:
def setup_handler(context):
"""SENAITE setup handler
"""
if context.readDataF... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
937,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
937,
7... |
Microsoft/LightGBM | python-package/lightgbm/basic.py | Dataset.__init_from_list_np2d | def __init_from_list_np2d(self, mats, params_str, ref_dataset):
"""Initialize data from a list of 2-D numpy matrices."""
ncol = mats[0].shape[1]
nrow = np.zeros((len(mats),), np.int32)
if mats[0].dtype == np.float64:
ptr_data = (ctypes.POINTER(ctypes.c_double) * len(mats))()
... | python | def __init_from_list_np2d(self, mats, params_str, ref_dataset):
"""Initialize data from a list of 2-D numpy matrices."""
ncol = mats[0].shape[1]
nrow = np.zeros((len(mats),), np.int32)
if mats[0].dtype == np.float64:
ptr_data = (ctypes.POINTER(ctypes.c_double) * len(mats))()
... | [
"def",
"__init_from_list_np2d",
"(",
"self",
",",
"mats",
",",
"params_str",
",",
"ref_dataset",
")",
":",
"ncol",
"=",
"mats",
"[",
"0",
"]",
".",
"shape",
"[",
"1",
"]",
"nrow",
"=",
"np",
".",
"zeros",
"(",
"(",
"len",
"(",
"mats",
")",
",",
"... | Initialize data from a list of 2-D numpy matrices. | [
"Initialize",
"data",
"from",
"a",
"list",
"of",
"2",
"-",
"D",
"numpy",
"matrices",
"."
] | train | https://github.com/Microsoft/LightGBM/blob/8d2ec69f4f685b0ab1c4624d59ee2d3287bb3147/python-package/lightgbm/basic.py#L872-L917 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Initialize data from a list of 2-D numpy matrices.
### Response:
def __init_from_list_np2d(self, mats, params_str, ref_dataset... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10130,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10130,
... |
paylogic/halogen | halogen/types.py | ISOUTCDateTime.format_as_utc | def format_as_utc(self, value):
"""Format UTC times."""
if isinstance(value, datetime.datetime):
if value.tzinfo is not None:
value = value.astimezone(pytz.UTC)
value = value.replace(microsecond=0)
return value.isoformat().replace('+00:00', 'Z') | python | def format_as_utc(self, value):
"""Format UTC times."""
if isinstance(value, datetime.datetime):
if value.tzinfo is not None:
value = value.astimezone(pytz.UTC)
value = value.replace(microsecond=0)
return value.isoformat().replace('+00:00', 'Z') | [
"def",
"format_as_utc",
"(",
"self",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"datetime",
".",
"datetime",
")",
":",
"if",
"value",
".",
"tzinfo",
"is",
"not",
"None",
":",
"value",
"=",
"value",
".",
"astimezone",
"(",
"pytz",
... | Format UTC times. | [
"Format",
"UTC",
"times",
"."
] | train | https://github.com/paylogic/halogen/blob/2dec0a67c506d02d1f51915fa7163f59764a0bde/halogen/types.py#L110-L116 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Format UTC times.
### Response:
def format_as_utc(self, value):
"""Format UTC times."""
if isinstance(value, d... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4152,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
4152,
... |
WZBSocialScienceCenter/tmtoolkit | tmtoolkit/topicmod/visualize.py | plot_topic_word_heatmap | def plot_topic_word_heatmap(fig, ax, topic_word_distrib, vocab,
which_topics=None, which_topic_indices=None,
which_words=None, which_word_indices=None,
xaxislabel=None, yaxislabel=None,
**kwargs):
"""
... | python | def plot_topic_word_heatmap(fig, ax, topic_word_distrib, vocab,
which_topics=None, which_topic_indices=None,
which_words=None, which_word_indices=None,
xaxislabel=None, yaxislabel=None,
**kwargs):
"""
... | [
"def",
"plot_topic_word_heatmap",
"(",
"fig",
",",
"ax",
",",
"topic_word_distrib",
",",
"vocab",
",",
"which_topics",
"=",
"None",
",",
"which_topic_indices",
"=",
"None",
",",
"which_words",
"=",
"None",
",",
"which_word_indices",
"=",
"None",
",",
"xaxislabel... | Plot a heatmap for a topic-word distribution `topic_word_distrib` to a matplotlib Figure `fig` and Axes `ax`
using `vocab` as vocabulary on the x-axis and topics from 1 to `n_topics=doc_topic_distrib.shape[1]` on
the y-axis.
A subset of words from `vocab` can be specified either directly with a sequence `wh... | [
"Plot",
"a",
"heatmap",
"for",
"a",
"topic",
"-",
"word",
"distribution",
"topic_word_distrib",
"to",
"a",
"matplotlib",
"Figure",
"fig",
"and",
"Axes",
"ax",
"using",
"vocab",
"as",
"vocabulary",
"on",
"the",
"x",
"-",
"axis",
"and",
"topics",
"from",
"1"... | train | https://github.com/WZBSocialScienceCenter/tmtoolkit/blob/ca8b9d072e37ccc82b533f47d48bd9755722305b/tmtoolkit/topicmod/visualize.py#L182-L232 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Plot a heatmap for a topic-word distribution `topic_word_distrib` to a matplotlib Figure `fig` and Axes `ax`
using `vocab` ... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
26687,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
26687,
... |
ajk8/microcache | microcache/__init__.py | Microcache.temporarily_disabled | def temporarily_disabled(self):
"""
Temporarily disable the cache (useful for testing)
"""
old_setting = self.options.enabled
self.disable(clear_cache=False)
try:
yield
finally:
self.options.enabled = old_setting | python | def temporarily_disabled(self):
"""
Temporarily disable the cache (useful for testing)
"""
old_setting = self.options.enabled
self.disable(clear_cache=False)
try:
yield
finally:
self.options.enabled = old_setting | [
"def",
"temporarily_disabled",
"(",
"self",
")",
":",
"old_setting",
"=",
"self",
".",
"options",
".",
"enabled",
"self",
".",
"disable",
"(",
"clear_cache",
"=",
"False",
")",
"try",
":",
"yield",
"finally",
":",
"self",
".",
"options",
".",
"enabled",
... | Temporarily disable the cache (useful for testing) | [
"Temporarily",
"disable",
"the",
"cache",
"(",
"useful",
"for",
"testing",
")"
] | train | https://github.com/ajk8/microcache/blob/24876c2c5f8959a806e2701adb7efbf70a87a1ae/microcache/__init__.py#L241-L250 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Temporarily disable the cache (useful for testing)
### Response:
def temporarily_disabled(self):
"""
Temporari... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
12427,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
12427,
... |
tensorflow/tensor2tensor | tensor2tensor/models/evolved_transformer.py | add_evolved_transformer_hparams | def add_evolved_transformer_hparams(hparams):
"""Add Evolved Transformer hparams.
Note: These are for the Adam optimizer, not the Adafactor optimizer used in
the paper.
Args:
hparams: Current hparams.
Returns:
hparams updated with Evolved Transformer values.
"""
# Evolved Transformer "layers" a... | python | def add_evolved_transformer_hparams(hparams):
"""Add Evolved Transformer hparams.
Note: These are for the Adam optimizer, not the Adafactor optimizer used in
the paper.
Args:
hparams: Current hparams.
Returns:
hparams updated with Evolved Transformer values.
"""
# Evolved Transformer "layers" a... | [
"def",
"add_evolved_transformer_hparams",
"(",
"hparams",
")",
":",
"# Evolved Transformer \"layers\" are twice as deep as Transformer, so roughly",
"# halve the number that we use. These numbers are taken from",
"# arxiv.org/abs/1901.11117 .",
"hparams",
".",
"num_encoder_layers",
"=",
"3... | Add Evolved Transformer hparams.
Note: These are for the Adam optimizer, not the Adafactor optimizer used in
the paper.
Args:
hparams: Current hparams.
Returns:
hparams updated with Evolved Transformer values. | [
"Add",
"Evolved",
"Transformer",
"hparams",
"."
] | train | https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/evolved_transformer.py#L704-L733 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Add Evolved Transformer hparams.
Note: These are for the Adam optimizer, not the Adafactor optimizer used in
the paper.
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2261,
... |
orbeckst/RecSQL | recsql/sqlarray.py | KRingbuffer._prune | def _prune(self):
"""Primitive way to keep dict in sync with RB."""
delkeys = [k for k in self.keys() if k not in self.__ringbuffer]
for k in delkeys: # necessary because dict is changed during iterations
super(KRingbuffer,self).__delitem__(k) | python | def _prune(self):
"""Primitive way to keep dict in sync with RB."""
delkeys = [k for k in self.keys() if k not in self.__ringbuffer]
for k in delkeys: # necessary because dict is changed during iterations
super(KRingbuffer,self).__delitem__(k) | [
"def",
"_prune",
"(",
"self",
")",
":",
"delkeys",
"=",
"[",
"k",
"for",
"k",
"in",
"self",
".",
"keys",
"(",
")",
"if",
"k",
"not",
"in",
"self",
".",
"__ringbuffer",
"]",
"for",
"k",
"in",
"delkeys",
":",
"# necessary because dict is changed during ite... | Primitive way to keep dict in sync with RB. | [
"Primitive",
"way",
"to",
"keep",
"dict",
"in",
"sync",
"with",
"RB",
"."
] | train | https://github.com/orbeckst/RecSQL/blob/6acbf821022361719391697c9c2f0822f9f8022a/recsql/sqlarray.py#L692-L696 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Primitive way to keep dict in sync with RB.
### Response:
def _prune(self):
"""Primitive way to keep dict in sync with... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
34413,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
34413,
... |
miguelgrinberg/python-engineio | engineio/asyncio_server.py | AsyncServer.start_background_task | def start_background_task(self, target, *args, **kwargs):
"""Start a background task using the appropriate async model.
This is a utility function that applications can use to start a
background task using the method that is compatible with the
selected async mode.
:param targe... | python | def start_background_task(self, target, *args, **kwargs):
"""Start a background task using the appropriate async model.
This is a utility function that applications can use to start a
background task using the method that is compatible with the
selected async mode.
:param targe... | [
"def",
"start_background_task",
"(",
"self",
",",
"target",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"asyncio",
".",
"ensure_future",
"(",
"target",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | Start a background task using the appropriate async model.
This is a utility function that applications can use to start a
background task using the method that is compatible with the
selected async mode.
:param target: the target function to execute.
:param args: arguments to ... | [
"Start",
"a",
"background",
"task",
"using",
"the",
"appropriate",
"async",
"model",
"."
] | train | https://github.com/miguelgrinberg/python-engineio/blob/261fd67103cb5d9a44369415748e66fdf62de6fb/engineio/asyncio_server.py#L266-L279 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Start a background task using the appropriate async model.
This is a utility function that applications can use to sta... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
3563,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
3563,
... |
lago-project/lago | lago/build.py | Build.normalize_build_spec | def normalize_build_spec(self, build_spec):
"""
Convert a build spec into a list of Command tuples.
After running this command, self.build_cmds should hold all
the commands that should be run on the disk in self.disk_path.
Args:
build_spec (dict): The buildspec part ... | python | def normalize_build_spec(self, build_spec):
"""
Convert a build spec into a list of Command tuples.
After running this command, self.build_cmds should hold all
the commands that should be run on the disk in self.disk_path.
Args:
build_spec (dict): The buildspec part ... | [
"def",
"normalize_build_spec",
"(",
"self",
",",
"build_spec",
")",
":",
"for",
"cmd",
"in",
"build_spec",
":",
"if",
"not",
"cmd",
":",
"continue",
"cmd_name",
"=",
"cmd",
".",
"keys",
"(",
")",
"[",
"0",
"]",
"cmd_options",
"=",
"cmd",
".",
"values",... | Convert a build spec into a list of Command tuples.
After running this command, self.build_cmds should hold all
the commands that should be run on the disk in self.disk_path.
Args:
build_spec (dict): The buildspec part from the init file | [
"Convert",
"a",
"build",
"spec",
"into",
"a",
"list",
"of",
"Command",
"tuples",
".",
"After",
"running",
"this",
"command",
"self",
".",
"build_cmds",
"should",
"hold",
"all",
"the",
"commands",
"that",
"should",
"be",
"run",
"on",
"the",
"disk",
"in",
... | train | https://github.com/lago-project/lago/blob/5b8970f7687e063e4619066d5b8093ca997678c9/lago/build.py#L120-L135 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Convert a build spec into a list of Command tuples.
After running this command, self.build_cmds should hold all
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
12281,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
12281,
... |
exekias/droplet | droplet/commands.py | run | def run(cmd, background=False):
"""
Executes the given command
If background flag is True the command will run in background
and this method will return a :class:`Popen` object
If background is False (default) the command will run in this thread
and this method will return stdout.
A Comma... | python | def run(cmd, background=False):
"""
Executes the given command
If background flag is True the command will run in background
and this method will return a :class:`Popen` object
If background is False (default) the command will run in this thread
and this method will return stdout.
A Comma... | [
"def",
"run",
"(",
"cmd",
",",
"background",
"=",
"False",
")",
":",
"logger",
".",
"debug",
"(",
"'Running command: %s'",
"%",
"cmd",
")",
"if",
"background",
":",
"return",
"subprocess",
".",
"Popen",
"(",
"cmd",
",",
"shell",
"=",
"True",
",",
"clos... | Executes the given command
If background flag is True the command will run in background
and this method will return a :class:`Popen` object
If background is False (default) the command will run in this thread
and this method will return stdout.
A CommandException will be raised if command fails | [
"Executes",
"the",
"given",
"command"
] | train | https://github.com/exekias/droplet/blob/aeac573a2c1c4b774e99d5414a1c79b1bb734941/droplet/commands.py#L37-L65 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Executes the given command
If background flag is True the command will run in background
and this method will return a... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10427,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10427,
... |
hanguokai/youku | youku/youku_schemas.py | YoukuSchemas.playlist_category | def playlist_category(self):
"""doc: http://open.youku.com/docs/doc?id=94
"""
url = 'https://openapi.youku.com/v2/schemas/playlist/category.json'
r = requests.get(url)
check_error(r)
return r.json() | python | def playlist_category(self):
"""doc: http://open.youku.com/docs/doc?id=94
"""
url = 'https://openapi.youku.com/v2/schemas/playlist/category.json'
r = requests.get(url)
check_error(r)
return r.json() | [
"def",
"playlist_category",
"(",
"self",
")",
":",
"url",
"=",
"'https://openapi.youku.com/v2/schemas/playlist/category.json'",
"r",
"=",
"requests",
".",
"get",
"(",
"url",
")",
"check_error",
"(",
"r",
")",
"return",
"r",
".",
"json",
"(",
")"
] | doc: http://open.youku.com/docs/doc?id=94 | [
"doc",
":",
"http",
":",
"//",
"open",
".",
"youku",
".",
"com",
"/",
"docs",
"/",
"doc?id",
"=",
"94"
] | train | https://github.com/hanguokai/youku/blob/b2df060c7dccfad990bcfa289fff68bb77d1e69b/youku/youku_schemas.py#L51-L57 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
doc: http://open.youku.com/docs/doc?id=94
### Response:
def playlist_category(self):
"""doc: http://open.youku.com/doc... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5349,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
5349,
... |
apache/incubator-mxnet | example/gluon/embedding_learning/train.py | train | def train(epochs, ctx):
"""Training function."""
if isinstance(ctx, mx.Context):
ctx = [ctx]
net.initialize(mx.init.Xavier(magnitude=2), ctx=ctx)
opt_options = {'learning_rate': opt.lr, 'wd': opt.wd}
if opt.optimizer == 'sgd':
opt_options['momentum'] = 0.9
if opt.optimizer == 'a... | python | def train(epochs, ctx):
"""Training function."""
if isinstance(ctx, mx.Context):
ctx = [ctx]
net.initialize(mx.init.Xavier(magnitude=2), ctx=ctx)
opt_options = {'learning_rate': opt.lr, 'wd': opt.wd}
if opt.optimizer == 'sgd':
opt_options['momentum'] = 0.9
if opt.optimizer == 'a... | [
"def",
"train",
"(",
"epochs",
",",
"ctx",
")",
":",
"if",
"isinstance",
"(",
"ctx",
",",
"mx",
".",
"Context",
")",
":",
"ctx",
"=",
"[",
"ctx",
"]",
"net",
".",
"initialize",
"(",
"mx",
".",
"init",
".",
"Xavier",
"(",
"magnitude",
"=",
"2",
... | Training function. | [
"Training",
"function",
"."
] | train | https://github.com/apache/incubator-mxnet/blob/1af29e9c060a4c7d60eeaacba32afdb9a7775ba7/example/gluon/embedding_learning/train.py#L169-L250 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Training function.
### Response:
def train(epochs, ctx):
"""Training function."""
if isinstance(ctx, mx.Context):
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
38030,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
38030,
... |
gsi-upm/soil | soil/web/__init__.py | ModularServer.launch | def launch(self, port=None):
""" Run the app. """
if port is not None:
self.port = port
url = 'http://127.0.0.1:{PORT}'.format(PORT=self.port)
print('Interface starting at {url}'.format(url=url))
self.listen(self.port)
# webbrowser.open(url)
t... | python | def launch(self, port=None):
""" Run the app. """
if port is not None:
self.port = port
url = 'http://127.0.0.1:{PORT}'.format(PORT=self.port)
print('Interface starting at {url}'.format(url=url))
self.listen(self.port)
# webbrowser.open(url)
t... | [
"def",
"launch",
"(",
"self",
",",
"port",
"=",
"None",
")",
":",
"if",
"port",
"is",
"not",
"None",
":",
"self",
".",
"port",
"=",
"port",
"url",
"=",
"'http://127.0.0.1:{PORT}'",
".",
"format",
"(",
"PORT",
"=",
"self",
".",
"port",
")",
"print",
... | Run the app. | [
"Run",
"the",
"app",
"."
] | train | https://github.com/gsi-upm/soil/blob/a3ea434f237f039c3cadbc2e0a83ae626d77b818/soil/web/__init__.py#L245-L254 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Run the app.
### Response:
def launch(self, port=None):
""" Run the app. """
if port is not None:
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6869,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6869,
... |
user-cont/conu | conu/backend/k8s/backend.py | K8sBackend.delete_namespace | def delete_namespace(self, name):
"""
Delete namespace with specific name
:param name: str, namespace to delete
:return: None
"""
self.core_api.delete_namespace(name, client.V1DeleteOptions())
logger.info("Deleting namespace: %s", name) | python | def delete_namespace(self, name):
"""
Delete namespace with specific name
:param name: str, namespace to delete
:return: None
"""
self.core_api.delete_namespace(name, client.V1DeleteOptions())
logger.info("Deleting namespace: %s", name) | [
"def",
"delete_namespace",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"core_api",
".",
"delete_namespace",
"(",
"name",
",",
"client",
".",
"V1DeleteOptions",
"(",
")",
")",
"logger",
".",
"info",
"(",
"\"Deleting namespace: %s\"",
",",
"name",
")"
] | Delete namespace with specific name
:param name: str, namespace to delete
:return: None | [
"Delete",
"namespace",
"with",
"specific",
"name",
":",
"param",
"name",
":",
"str",
"namespace",
"to",
"delete",
":",
"return",
":",
"None"
] | train | https://github.com/user-cont/conu/blob/08caae7bb6bdd265b55bb106c3da6a7946a5a352/conu/backend/k8s/backend.py#L169-L177 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Delete namespace with specific name
:param name: str, namespace to delete
:return: None
### Response:
def dele... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6571,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
6571,
... |
quantmind/dynts | dynts/api/timeseries.py | TimeSeries.series | def series(self):
'''Generator of single series data (no dates are included).'''
data = self.values()
if len(data):
for c in range(self.count()):
yield data[:, c]
else:
raise StopIteration | python | def series(self):
'''Generator of single series data (no dates are included).'''
data = self.values()
if len(data):
for c in range(self.count()):
yield data[:, c]
else:
raise StopIteration | [
"def",
"series",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"values",
"(",
")",
"if",
"len",
"(",
"data",
")",
":",
"for",
"c",
"in",
"range",
"(",
"self",
".",
"count",
"(",
")",
")",
":",
"yield",
"data",
"[",
":",
",",
"c",
"]",
"e... | Generator of single series data (no dates are included). | [
"Generator",
"of",
"single",
"series",
"data",
"(",
"no",
"dates",
"are",
"included",
")",
"."
] | train | https://github.com/quantmind/dynts/blob/21ac57c648bfec402fa6b1fe569496cf098fb5e8/dynts/api/timeseries.py#L211-L218 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Generator of single series data (no dates are included).
### Response:
def series(self):
'''Generator of single serie... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
12846,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
12846,
... |
biosignalsnotebooks/biosignalsnotebooks | biosignalsnotebooks/build/lib/biosignalsnotebooks/visualise.py | opensignals_style | def opensignals_style(figure_list, grid_plot=None, toolbar="right"):
"""
-----
Brief
-----
Function used to automatically apply the OpenSignals graphical style to Bokeh plots.
-----------
Description
-----------
OpenSignals has its own graphical style and Bokeh plots function in an ... | python | def opensignals_style(figure_list, grid_plot=None, toolbar="right"):
"""
-----
Brief
-----
Function used to automatically apply the OpenSignals graphical style to Bokeh plots.
-----------
Description
-----------
OpenSignals has its own graphical style and Bokeh plots function in an ... | [
"def",
"opensignals_style",
"(",
"figure_list",
",",
"grid_plot",
"=",
"None",
",",
"toolbar",
"=",
"\"right\"",
")",
":",
"for",
"fig",
"in",
"figure_list",
":",
"fig",
".",
"background_fill_color",
"=",
"(",
"242",
",",
"242",
",",
"242",
")",
"fig",
"... | -----
Brief
-----
Function used to automatically apply the OpenSignals graphical style to Bokeh plots.
-----------
Description
-----------
OpenSignals has its own graphical style and Bokeh plots function in an object oriented way.
This function allows to apply the Opensignals graphical... | [
"-----",
"Brief",
"-----",
"Function",
"used",
"to",
"automatically",
"apply",
"the",
"OpenSignals",
"graphical",
"style",
"to",
"Bokeh",
"plots",
"."
] | train | https://github.com/biosignalsnotebooks/biosignalsnotebooks/blob/aaa01d4125180b3a34f1e26e0d3ff08c23f666d3/biosignalsnotebooks/build/lib/biosignalsnotebooks/visualise.py#L663-L735 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
-----
Brief
-----
Function used to automatically apply the OpenSignals graphical style to Bokeh plots.
-------... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
35864,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
35864,
... |
twilio/twilio-python | twilio/rest/monitor/v1/alert.py | AlertList.page | def page(self, log_level=values.unset, start_date=values.unset,
end_date=values.unset, page_token=values.unset,
page_number=values.unset, page_size=values.unset):
"""
Retrieve a single page of AlertInstance records from the API.
Request is executed immediately
... | python | def page(self, log_level=values.unset, start_date=values.unset,
end_date=values.unset, page_token=values.unset,
page_number=values.unset, page_size=values.unset):
"""
Retrieve a single page of AlertInstance records from the API.
Request is executed immediately
... | [
"def",
"page",
"(",
"self",
",",
"log_level",
"=",
"values",
".",
"unset",
",",
"start_date",
"=",
"values",
".",
"unset",
",",
"end_date",
"=",
"values",
".",
"unset",
",",
"page_token",
"=",
"values",
".",
"unset",
",",
"page_number",
"=",
"values",
... | Retrieve a single page of AlertInstance records from the API.
Request is executed immediately
:param unicode log_level: Only show alerts for this log-level.
:param date start_date: Only show Alerts on or after this date.
:param date end_date: Only show Alerts on or before this date.
... | [
"Retrieve",
"a",
"single",
"page",
"of",
"AlertInstance",
"records",
"from",
"the",
"API",
".",
"Request",
"is",
"executed",
"immediately"
] | train | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/monitor/v1/alert.py#L96-L128 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Retrieve a single page of AlertInstance records from the API.
Request is executed immediately
:param unicode l... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
88765,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
88765,
... |
coderholic/pyradio | pyradio/player.py | VlcPlayer._format_volume_string | def _format_volume_string(self, volume_string):
""" format vlc's volume """
self.actual_volume = int(volume_string.split(self.volume_string)[1].split(',')[0].split()[0])
return '[Vol: {}%] '.format(int(100 * self.actual_volume / self.max_volume)) | python | def _format_volume_string(self, volume_string):
""" format vlc's volume """
self.actual_volume = int(volume_string.split(self.volume_string)[1].split(',')[0].split()[0])
return '[Vol: {}%] '.format(int(100 * self.actual_volume / self.max_volume)) | [
"def",
"_format_volume_string",
"(",
"self",
",",
"volume_string",
")",
":",
"self",
".",
"actual_volume",
"=",
"int",
"(",
"volume_string",
".",
"split",
"(",
"self",
".",
"volume_string",
")",
"[",
"1",
"]",
".",
"split",
"(",
"','",
")",
"[",
"0",
"... | format vlc's volume | [
"format",
"vlc",
"s",
"volume"
] | train | https://github.com/coderholic/pyradio/blob/c5219d350bccbccd49dbd627c1f886a952ea1963/pyradio/player.py#L706-L709 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
format vlc's volume
### Response:
def _format_volume_string(self, volume_string):
""" format vlc's volume """
... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2293,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
2293,
... |
pkgw/pwkit | pwkit/io.py | Path.read_lines | def read_lines (self, mode='rt', noexistok=False, **kwargs):
"""Generate a sequence of lines from the file pointed to by this path, by
opening as a regular file and iterating over it. The lines therefore
contain their newline characters. If *noexistok*, a nonexistent file
will result in ... | python | def read_lines (self, mode='rt', noexistok=False, **kwargs):
"""Generate a sequence of lines from the file pointed to by this path, by
opening as a regular file and iterating over it. The lines therefore
contain their newline characters. If *noexistok*, a nonexistent file
will result in ... | [
"def",
"read_lines",
"(",
"self",
",",
"mode",
"=",
"'rt'",
",",
"noexistok",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"with",
"self",
".",
"open",
"(",
"mode",
"=",
"mode",
",",
"*",
"*",
"kwargs",
")",
"as",
"f",
":",
"for... | Generate a sequence of lines from the file pointed to by this path, by
opening as a regular file and iterating over it. The lines therefore
contain their newline characters. If *noexistok*, a nonexistent file
will result in an empty sequence rather than an exception. *kwargs*
are passed ... | [
"Generate",
"a",
"sequence",
"of",
"lines",
"from",
"the",
"file",
"pointed",
"to",
"by",
"this",
"path",
"by",
"opening",
"as",
"a",
"regular",
"file",
"and",
"iterating",
"over",
"it",
".",
"The",
"lines",
"therefore",
"contain",
"their",
"newline",
"cha... | train | https://github.com/pkgw/pwkit/blob/d40957a1c3d2ea34e7ceac2267ee9635135f2793/pwkit/io.py#L803-L817 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Generate a sequence of lines from the file pointed to by this path, by
opening as a regular file and iterating over it.... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
32215,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
32215,
... |
python-constraint/python-constraint | constraint/__init__.py | Problem.getSolution | def getSolution(self):
"""
Find and return a solution to the problem
Example:
>>> problem = Problem()
>>> problem.getSolution() is None
True
>>> problem.addVariables(["a"], [42])
>>> problem.getSolution()
{'a': 42}
@return: Solution for ... | python | def getSolution(self):
"""
Find and return a solution to the problem
Example:
>>> problem = Problem()
>>> problem.getSolution() is None
True
>>> problem.addVariables(["a"], [42])
>>> problem.getSolution()
{'a': 42}
@return: Solution for ... | [
"def",
"getSolution",
"(",
"self",
")",
":",
"domains",
",",
"constraints",
",",
"vconstraints",
"=",
"self",
".",
"_getArgs",
"(",
")",
"if",
"not",
"domains",
":",
"return",
"None",
"return",
"self",
".",
"_solver",
".",
"getSolution",
"(",
"domains",
... | Find and return a solution to the problem
Example:
>>> problem = Problem()
>>> problem.getSolution() is None
True
>>> problem.addVariables(["a"], [42])
>>> problem.getSolution()
{'a': 42}
@return: Solution for the problem
@rtype: dictionary mapp... | [
"Find",
"and",
"return",
"a",
"solution",
"to",
"the",
"problem"
] | train | https://github.com/python-constraint/python-constraint/blob/e23fe9852cddddf1c3e258e03f2175df24b4c702/constraint/__init__.py#L212-L231 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Find and return a solution to the problem
Example:
>>> problem = Problem()
>>> problem.getSolution() ... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10086,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
10086,
... |
gagneurlab/concise | concise/utils/position.py | extract_landmarks | def extract_landmarks(gtf, landmarks=ALL_LANDMARKS):
"""Given an gene annotation GFF/GTF file,
# Arguments
gtf: File path or a loaded `pd.DataFrame` with columns:
seqname, feature, start, end, strand
landmarks: list or a dictionary of landmark extractors (function or name)
# Note
... | python | def extract_landmarks(gtf, landmarks=ALL_LANDMARKS):
"""Given an gene annotation GFF/GTF file,
# Arguments
gtf: File path or a loaded `pd.DataFrame` with columns:
seqname, feature, start, end, strand
landmarks: list or a dictionary of landmark extractors (function or name)
# Note
... | [
"def",
"extract_landmarks",
"(",
"gtf",
",",
"landmarks",
"=",
"ALL_LANDMARKS",
")",
":",
"if",
"isinstance",
"(",
"gtf",
",",
"str",
")",
":",
"_logger",
".",
"info",
"(",
"\"Reading gtf file..\"",
")",
"gtf",
"=",
"read_gtf",
"(",
"gtf",
")",
"_logger",
... | Given an gene annotation GFF/GTF file,
# Arguments
gtf: File path or a loaded `pd.DataFrame` with columns:
seqname, feature, start, end, strand
landmarks: list or a dictionary of landmark extractors (function or name)
# Note
When landmark extractor names are used, they have to be i... | [
"Given",
"an",
"gene",
"annotation",
"GFF",
"/",
"GTF",
"file"
] | train | https://github.com/gagneurlab/concise/blob/d15262eb1e590008bc96ba31e93bfbdbfa1a9fd4/concise/utils/position.py#L16-L48 | <|startoftext|>
### Instruction:
You are a Senior Software Developer and a helpful AI programming assistant. Generate only Python code without explanations. Respond only in English.
### Task:
Given an gene annotation GFF/GTF file,
# Arguments
gtf: File path or a loaded `pd.DataFrame` with columns:
seq... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
22818,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
128000,
27,
91,
2527,
14450,
428,
91,
397,
14711,
30151,
512,
2675,
527,
264,
19903,
4476,
25922,
323,
264,
11190,
15592,
15840,
18328,
13,
20400,
1193,
13325,
2082,
2085,
41941,
13,
40633,
1193,
304,
6498,
382,
14711,
5546,
512,
22818,
... |
Subsets and Splits
Short Python Functions
Retrieves a limited set of short prompts from the dataset, which provides basic filtering and a glimpse into the dataset's contents but lacks deeper insight.