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
zeromake/aiko
aiko/request.py
Request.fresh
def fresh(self) -> bool: """ 检查请求缓存是否“新鲜”,也就是内容没有改变。 此方法用于 If-None-Match / ETag, 和 If-Modified-Since 和 Last-Modified 之间的缓存协商。 在设置一个或多个这些响应头后应该引用它。 """ method_str = self.method if method_str != 'GET' and method_str != 'HEAD': return False s = se...
python
def fresh(self) -> bool: """ 检查请求缓存是否“新鲜”,也就是内容没有改变。 此方法用于 If-None-Match / ETag, 和 If-Modified-Since 和 Last-Modified 之间的缓存协商。 在设置一个或多个这些响应头后应该引用它。 """ method_str = self.method if method_str != 'GET' and method_str != 'HEAD': return False s = se...
[ "def", "fresh", "(", "self", ")", "->", "bool", ":", "method_str", "=", "self", ".", "method", "if", "method_str", "!=", "'GET'", "and", "method_str", "!=", "'HEAD'", ":", "return", "False", "s", "=", "self", ".", "ctx", ".", "status", "if", "(", "s"...
检查请求缓存是否“新鲜”,也就是内容没有改变。 此方法用于 If-None-Match / ETag, 和 If-Modified-Since 和 Last-Modified 之间的缓存协商。 在设置一个或多个这些响应头后应该引用它。
[ "检查请求缓存是否“新鲜”,也就是内容没有改变。", "此方法用于", "If", "-", "None", "-", "Match", "/", "ETag", "和", "If", "-", "Modified", "-", "Since", "和", "Last", "-", "Modified", "之间的缓存协商。", "在设置一个或多个这些响应头后应该引用它。" ]
train
https://github.com/zeromake/aiko/blob/53b246fa88652466a9e38ac3d1a99a6198195b0f/aiko/request.py#L567-L582
<|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-None-Match / ETag, 和 If-Modified-Since 和 Last-Modified 之间的缓存协商。 在设置一个或多个这些响应头后...
[ 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, 118686, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 118686, ...
gem/oq-engine
openquake/hmtk/models.py
SeismicSource.attrib
def attrib(self): """ General XML element attributes for a seismic source, as a dict. """ return dict([ ('id', str(self.id)), ('name', str(self.name)), ('tectonicRegion', str(self.trt)), ])
python
def attrib(self): """ General XML element attributes for a seismic source, as a dict. """ return dict([ ('id', str(self.id)), ('name', str(self.name)), ('tectonicRegion', str(self.trt)), ])
[ "def", "attrib", "(", "self", ")", ":", "return", "dict", "(", "[", "(", "'id'", ",", "str", "(", "self", ".", "id", ")", ")", ",", "(", "'name'", ",", "str", "(", "self", ".", "name", ")", ")", ",", "(", "'tectonicRegion'", ",", "str", "(", ...
General XML element attributes for a seismic source, as a dict.
[ "General", "XML", "element", "attributes", "for", "a", "seismic", "source", "as", "a", "dict", "." ]
train
https://github.com/gem/oq-engine/blob/8294553a0b8aba33fd96437a35065d03547d0040/openquake/hmtk/models.py#L53-L61
<|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: General XML element attributes for a seismic source, as a dict. ### Response: def attrib(self): """ General XM...
[ 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, 15777, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15777, ...
nicolargo/glances
glances/plugins/glances_memswap.py
Plugin.update_views
def update_views(self): """Update stats views.""" # Call the father's method super(Plugin, self).update_views() # Add specifics informations # Alert and log self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
python
def update_views(self): """Update stats views.""" # Call the father's method super(Plugin, self).update_views() # Add specifics informations # Alert and log self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
[ "def", "update_views", "(", "self", ")", ":", "# Call the father's method", "super", "(", "Plugin", ",", "self", ")", ".", "update_views", "(", ")", "# Add specifics informations", "# Alert and log", "self", ".", "views", "[", "'used'", "]", "[", "'decoration'", ...
Update stats views.
[ "Update", "stats", "views", "." ]
train
https://github.com/nicolargo/glances/blob/5bd4d587a736e0d2b03170b56926841d2a3eb7ee/glances/plugins/glances_memswap.py#L130-L137
<|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 stats views. ### Response: def update_views(self): """Update stats views.""" # Call the father's method...
[ 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, ...
SuryaSankar/flask-sqlalchemy-booster
flask_sqlalchemy_booster/model_booster/queryable_mixin.py
QueryableMixin.add
def add(cls, model, commit=True): """Adds a model instance to session and commits the transaction. Args: model: The instance to add. Examples: >>> customer = Customer.new(name="hari", email="hari@gmail.com") >>> Customer.add(customer) ...
python
def add(cls, model, commit=True): """Adds a model instance to session and commits the transaction. Args: model: The instance to add. Examples: >>> customer = Customer.new(name="hari", email="hari@gmail.com") >>> Customer.add(customer) ...
[ "def", "add", "(", "cls", ",", "model", ",", "commit", "=", "True", ")", ":", "if", "not", "isinstance", "(", "model", ",", "cls", ")", ":", "raise", "ValueError", "(", "'%s is not of type %s'", "%", "(", "model", ",", "cls", ")", ")", "cls", ".", ...
Adds a model instance to session and commits the transaction. Args: model: The instance to add. Examples: >>> customer = Customer.new(name="hari", email="hari@gmail.com") >>> Customer.add(customer) hari@gmail.com
[ "Adds", "a", "model", "instance", "to", "session", "and", "commits", "the", "transaction", "." ]
train
https://github.com/SuryaSankar/flask-sqlalchemy-booster/blob/444048d167ab7718f758e943665ef32d101423a5/flask_sqlalchemy_booster/model_booster/queryable_mixin.py#L389-L413
<|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: Adds a model instance to session and commits the transaction. Args: model: The instance to add. ...
[ 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, 73211, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 73211, ...
jbasko/pytest-random-order
random_order/bucket_types.py
bucket_type_key
def bucket_type_key(bucket_type): """ Registers a function that calculates test item key for the specified bucket type. """ def decorator(f): @functools.wraps(f) def wrapped(item, session): key = f(item) if session is not None: for handler in se...
python
def bucket_type_key(bucket_type): """ Registers a function that calculates test item key for the specified bucket type. """ def decorator(f): @functools.wraps(f) def wrapped(item, session): key = f(item) if session is not None: for handler in se...
[ "def", "bucket_type_key", "(", "bucket_type", ")", ":", "def", "decorator", "(", "f", ")", ":", "@", "functools", ".", "wraps", "(", "f", ")", "def", "wrapped", "(", "item", ",", "session", ")", ":", "key", "=", "f", "(", "item", ")", "if", "sessio...
Registers a function that calculates test item key for the specified bucket type.
[ "Registers", "a", "function", "that", "calculates", "test", "item", "key", "for", "the", "specified", "bucket", "type", "." ]
train
https://github.com/jbasko/pytest-random-order/blob/e8ff95fcd097f9f330638cf58cc1b24983fdde15/random_order/bucket_types.py#L8-L28
<|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: Registers a function that calculates test item key for the specified bucket type. ### Response: def bucket_type_key(bucket_typ...
[ 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, 93178, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 93178, ...
python/core-workflow
cherry_picker/cherry_picker/cherry_picker.py
normalize_commit_message
def normalize_commit_message(commit_message): """ Return a tuple of title and body from the commit message """ split_commit_message = commit_message.split("\n") title = split_commit_message[0] body = "\n".join(split_commit_message[1:]) return title, body.lstrip("\n")
python
def normalize_commit_message(commit_message): """ Return a tuple of title and body from the commit message """ split_commit_message = commit_message.split("\n") title = split_commit_message[0] body = "\n".join(split_commit_message[1:]) return title, body.lstrip("\n")
[ "def", "normalize_commit_message", "(", "commit_message", ")", ":", "split_commit_message", "=", "commit_message", ".", "split", "(", "\"\\n\"", ")", "title", "=", "split_commit_message", "[", "0", "]", "body", "=", "\"\\n\"", ".", "join", "(", "split_commit_messa...
Return a tuple of title and body from the commit message
[ "Return", "a", "tuple", "of", "title", "and", "body", "from", "the", "commit", "message" ]
train
https://github.com/python/core-workflow/blob/b93c76195f6db382cfcefee334380fb4c68d4e21/cherry_picker/cherry_picker/cherry_picker.py#L713-L720
<|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 tuple of title and body from the commit message ### Response: def normalize_commit_message(commit_message): """ ...
[ 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, ...
clalancette/pycdlib
pycdlib/pycdlib.py
_yield_children
def _yield_children(rec): # type: (dr.DirectoryRecord) -> Generator ''' An internal function to gather and yield all of the children of a Directory Record. Parameters: rec - The Directory Record to get all of the children from (must be a directory) Yields: Children of this ...
python
def _yield_children(rec): # type: (dr.DirectoryRecord) -> Generator ''' An internal function to gather and yield all of the children of a Directory Record. Parameters: rec - The Directory Record to get all of the children from (must be a directory) Yields: Children of this ...
[ "def", "_yield_children", "(", "rec", ")", ":", "# type: (dr.DirectoryRecord) -> Generator", "if", "not", "rec", ".", "is_dir", "(", ")", ":", "raise", "pycdlibexception", ".", "PyCdlibInvalidInput", "(", "'Record is not a directory!'", ")", "last", "=", "b''", "for...
An internal function to gather and yield all of the children of a Directory Record. Parameters: rec - The Directory Record to get all of the children from (must be a directory) Yields: Children of this Directory Record. Returns: Nothing.
[ "An", "internal", "function", "to", "gather", "and", "yield", "all", "of", "the", "children", "of", "a", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/pycdlib.py#L417-L458
<|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: An internal function to gather and yield all of the children of a Directory Record. Parameters: rec - The Directo...
[ 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, 2127, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2127, ...
monarch-initiative/dipper
dipper/utils/GraphUtils.py
GraphUtils.get_properties_from_graph
def get_properties_from_graph(graph): """ Wrapper for RDFLib.graph.predicates() that returns a unique set :param graph: RDFLib.graph :return: set, set of properties """ # collapse to single list property_set = set() for row in graph.predicates(): ...
python
def get_properties_from_graph(graph): """ Wrapper for RDFLib.graph.predicates() that returns a unique set :param graph: RDFLib.graph :return: set, set of properties """ # collapse to single list property_set = set() for row in graph.predicates(): ...
[ "def", "get_properties_from_graph", "(", "graph", ")", ":", "# collapse to single list", "property_set", "=", "set", "(", ")", "for", "row", "in", "graph", ".", "predicates", "(", ")", ":", "property_set", ".", "add", "(", "row", ")", "return", "property_set" ...
Wrapper for RDFLib.graph.predicates() that returns a unique set :param graph: RDFLib.graph :return: set, set of properties
[ "Wrapper", "for", "RDFLib", ".", "graph", ".", "predicates", "()", "that", "returns", "a", "unique", "set", ":", "param", "graph", ":", "RDFLib", ".", "graph", ":", "return", ":", "set", "set", "of", "properties" ]
train
https://github.com/monarch-initiative/dipper/blob/24cc80db355bbe15776edc5c7b41e0886959ba41/dipper/utils/GraphUtils.py#L49-L60
<|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 RDFLib.graph.predicates() that returns a unique set :param graph: RDFLib.graph :return: set, set 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, 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, ...
NICTA/revrand
revrand/basis_functions.py
FastFoodRBF.grad
def grad(self, X, lenscale=None): r""" Get the gradients of this basis w.r.t.\ the length scale. Parameters ---------- x: ndarray (n, d) array of observations where n is the number of samples, and d is the dimensionality of x. lenscale: scalar or ...
python
def grad(self, X, lenscale=None): r""" Get the gradients of this basis w.r.t.\ the length scale. Parameters ---------- x: ndarray (n, d) array of observations where n is the number of samples, and d is the dimensionality of x. lenscale: scalar or ...
[ "def", "grad", "(", "self", ",", "X", ",", "lenscale", "=", "None", ")", ":", "d", "=", "X", ".", "shape", "[", "1", "]", "lenscale", "=", "self", ".", "_check_dim", "(", "d", ",", "lenscale", ")", "VX", "=", "self", ".", "_makeVX", "(", "X", ...
r""" Get the gradients of this basis w.r.t.\ the length scale. Parameters ---------- x: ndarray (n, d) array of observations where n is the number of samples, and d is the dimensionality of x. lenscale: scalar or ndarray scalar or array of sha...
[ "r", "Get", "the", "gradients", "of", "this", "basis", "w", ".", "r", ".", "t", ".", "\\", "the", "length", "scale", "." ]
train
https://github.com/NICTA/revrand/blob/4c1881b6c1772d2b988518e49dde954f165acfb6/revrand/basis_functions.py#L1292-L1329
<|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: r""" Get the gradients of this basis w.r.t.\ the length scale. Parameters ---------- x: ndarra...
[ 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, 81, 72...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 81, 72...
spyder-ide/spyder
spyder/plugins/outlineexplorer/widgets.py
OutlineExplorerTreeWidget.root_item_selected
def root_item_selected(self, item): """Root item has been selected: expanding it and collapsing others""" if self.show_all_files: return for root_item in self.get_top_level_items(): if root_item is item: self.expandItem(root_item) else: ...
python
def root_item_selected(self, item): """Root item has been selected: expanding it and collapsing others""" if self.show_all_files: return for root_item in self.get_top_level_items(): if root_item is item: self.expandItem(root_item) else: ...
[ "def", "root_item_selected", "(", "self", ",", "item", ")", ":", "if", "self", ".", "show_all_files", ":", "return", "for", "root_item", "in", "self", ".", "get_top_level_items", "(", ")", ":", "if", "root_item", "is", "item", ":", "self", ".", "expandItem...
Root item has been selected: expanding it and collapsing others
[ "Root", "item", "has", "been", "selected", ":", "expanding", "it", "and", "collapsing", "others" ]
train
https://github.com/spyder-ide/spyder/blob/f76836ce1b924bcc4efd3f74f2960d26a4e528e0/spyder/plugins/outlineexplorer/widgets.py#L530-L538
<|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: Root item has been selected: expanding it and collapsing others ### Response: def root_item_selected(self, item): """...
[ 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, 8605, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8605, ...
facelessuser/wcmatch
wcmatch/glob.py
Glob._match_excluded
def _match_excluded(self, filename, patterns): """Call match real directly to skip unnecessary `exists` check.""" return _wcparse._match_real( filename, patterns._include, patterns._exclude, patterns._follow, self.symlinks )
python
def _match_excluded(self, filename, patterns): """Call match real directly to skip unnecessary `exists` check.""" return _wcparse._match_real( filename, patterns._include, patterns._exclude, patterns._follow, self.symlinks )
[ "def", "_match_excluded", "(", "self", ",", "filename", ",", "patterns", ")", ":", "return", "_wcparse", ".", "_match_real", "(", "filename", ",", "patterns", ".", "_include", ",", "patterns", ".", "_exclude", ",", "patterns", ".", "_follow", ",", "self", ...
Call match real directly to skip unnecessary `exists` check.
[ "Call", "match", "real", "directly", "to", "skip", "unnecessary", "exists", "check", "." ]
train
https://github.com/facelessuser/wcmatch/blob/d153e7007cc73b994ae1ba553dc4584039f5c212/wcmatch/glob.py#L142-L147
<|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: Call match real directly to skip unnecessary `exists` check. ### Response: def _match_excluded(self, filename, patterns): ...
[ 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, 7368, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7368, ...
atztogo/phonopy
phonopy/structure/spglib.py
get_pointgroup
def get_pointgroup(rotations): """Return point group in international table symbol and number. The symbols are mapped to the numbers as follows: 1 "1 " 2 "-1 " 3 "2 " 4 "m " 5 "2/m " 6 "222 " 7 "mm2 " 8 "mmm " 9 "4 " 10 "-4 " 11...
python
def get_pointgroup(rotations): """Return point group in international table symbol and number. The symbols are mapped to the numbers as follows: 1 "1 " 2 "-1 " 3 "2 " 4 "m " 5 "2/m " 6 "222 " 7 "mm2 " 8 "mmm " 9 "4 " 10 "-4 " 11...
[ "def", "get_pointgroup", "(", "rotations", ")", ":", "_set_no_error", "(", ")", "# (symbol, pointgroup_number, transformation_matrix)", "pointgroup", "=", "spg", ".", "pointgroup", "(", "np", ".", "array", "(", "rotations", ",", "dtype", "=", "'intc'", ",", "order...
Return point group in international table symbol and number. The symbols are mapped to the numbers as follows: 1 "1 " 2 "-1 " 3 "2 " 4 "m " 5 "2/m " 6 "222 " 7 "mm2 " 8 "mmm " 9 "4 " 10 "-4 " 11 "4/m " 12 "422 " 13 "4mm...
[ "Return", "point", "group", "in", "international", "table", "symbol", "and", "number", "." ]
train
https://github.com/atztogo/phonopy/blob/869cc2ba9e7d495d5f4cf6942415ab3fc9e2a10f/phonopy/structure/spglib.py#L301-L343
<|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 point group in international table symbol and number. The symbols are mapped to the numbers as follows: 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, ...
automl/HpBandSter
hpbandster/core/nameserver.py
NameServer.start
def start(self): """ starts a Pyro4 nameserver in a separate thread Returns ------- tuple (str, int): the host name and the used port """ if self.host is None: if self.nic_name is None: self.host = 'localhost' else: self.host = nic_name_to_host(self.nic_name) uri, self.pyro_ns,...
python
def start(self): """ starts a Pyro4 nameserver in a separate thread Returns ------- tuple (str, int): the host name and the used port """ if self.host is None: if self.nic_name is None: self.host = 'localhost' else: self.host = nic_name_to_host(self.nic_name) uri, self.pyro_ns,...
[ "def", "start", "(", "self", ")", ":", "if", "self", ".", "host", "is", "None", ":", "if", "self", ".", "nic_name", "is", "None", ":", "self", ".", "host", "=", "'localhost'", "else", ":", "self", ".", "host", "=", "nic_name_to_host", "(", "self", ...
starts a Pyro4 nameserver in a separate thread Returns ------- tuple (str, int): the host name and the used port
[ "starts", "a", "Pyro4", "nameserver", "in", "a", "separate", "thread", "Returns", "-------", "tuple", "(", "str", "int", ")", ":", "the", "host", "name", "and", "the", "used", "port" ]
train
https://github.com/automl/HpBandSter/blob/841db4b827f342e5eb7f725723ea6461ac52d45a/hpbandster/core/nameserver.py#L48-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: starts a Pyro4 nameserver in a separate thread Returns ------- tuple (str, int): the host name and the used port ...
[ 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, 66976, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 66976, ...
ploneintranet/ploneintranet.workspace
src/ploneintranet/workspace/utils.py
get_storage
def get_storage(clear=False): """helper function to get annotation storage on the portal :param clear: If true is passed in, annotations will be cleared :returns: portal annotations :rtype: IAnnotations """ portal = getUtility(ISiteRoot) annotations = IAnnotations(portal) if ANNOTATION...
python
def get_storage(clear=False): """helper function to get annotation storage on the portal :param clear: If true is passed in, annotations will be cleared :returns: portal annotations :rtype: IAnnotations """ portal = getUtility(ISiteRoot) annotations = IAnnotations(portal) if ANNOTATION...
[ "def", "get_storage", "(", "clear", "=", "False", ")", ":", "portal", "=", "getUtility", "(", "ISiteRoot", ")", "annotations", "=", "IAnnotations", "(", "portal", ")", "if", "ANNOTATION_KEY", "not", "in", "annotations", "or", "clear", ":", "annotations", "["...
helper function to get annotation storage on the portal :param clear: If true is passed in, annotations will be cleared :returns: portal annotations :rtype: IAnnotations
[ "helper", "function", "to", "get", "annotation", "storage", "on", "the", "portal" ]
train
https://github.com/ploneintranet/ploneintranet.workspace/blob/a4fc7a5c61f9c6d4d4ad25478ff5250f342ffbba/src/ploneintranet/workspace/utils.py#L33-L45
<|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: helper function to get annotation storage on the portal :param clear: If true is passed in, annotations will be cleared ...
[ 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, 19291, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 19291, ...
saltstack/salt
salt/modules/osquery.py
kernel_integrity
def kernel_integrity(attrs=None, where=None): ''' Return kernel_integrity information from osquery CLI Example: .. code-block:: bash salt '*' osquery.kernel_integrity ''' if __grains__['os_family'] in ['RedHat', 'Debian']: return _osquery_cmd(table='kernel_integrity', attrs=at...
python
def kernel_integrity(attrs=None, where=None): ''' Return kernel_integrity information from osquery CLI Example: .. code-block:: bash salt '*' osquery.kernel_integrity ''' if __grains__['os_family'] in ['RedHat', 'Debian']: return _osquery_cmd(table='kernel_integrity', attrs=at...
[ "def", "kernel_integrity", "(", "attrs", "=", "None", ",", "where", "=", "None", ")", ":", "if", "__grains__", "[", "'os_family'", "]", "in", "[", "'RedHat'", ",", "'Debian'", "]", ":", "return", "_osquery_cmd", "(", "table", "=", "'kernel_integrity'", ","...
Return kernel_integrity information from osquery CLI Example: .. code-block:: bash salt '*' osquery.kernel_integrity
[ "Return", "kernel_integrity", "information", "from", "osquery" ]
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/osquery.py#L149-L161
<|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 kernel_integrity information from osquery CLI Example: .. code-block:: bash salt '*' osquery.kernel_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, 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, ...
NLeSC/scriptcwl
scriptcwl/step.py
Step._input_optional
def _input_optional(inp): """Returns True if a step input parameter is optional. Args: inp (dict): a dictionary representation of an input. Raises: ValueError: The inp provided is not valid. """ if 'default' in inp.keys(): return True ...
python
def _input_optional(inp): """Returns True if a step input parameter is optional. Args: inp (dict): a dictionary representation of an input. Raises: ValueError: The inp provided is not valid. """ if 'default' in inp.keys(): return True ...
[ "def", "_input_optional", "(", "inp", ")", ":", "if", "'default'", "in", "inp", ".", "keys", "(", ")", ":", "return", "True", "typ", "=", "inp", ".", "get", "(", "'type'", ")", "if", "isinstance", "(", "typ", ",", "six", ".", "string_types", ")", "...
Returns True if a step input parameter is optional. Args: inp (dict): a dictionary representation of an input. Raises: ValueError: The inp provided is not valid.
[ "Returns", "True", "if", "a", "step", "input", "parameter", "is", "optional", "." ]
train
https://github.com/NLeSC/scriptcwl/blob/33bb847a875379da3a5702c7a98dfa585306b960/scriptcwl/step.py#L131-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: Returns True if a step input parameter is optional. Args: inp (dict): a dictionary representation of an in...
[ 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, ...
saltstack/salt
salt/utils/yast.py
mksls
def mksls(src, dst=None): ''' Convert an AutoYAST file to an SLS file ''' with salt.utils.files.fopen(src, 'r') as fh_: ps_opts = xml.to_dict(ET.fromstring(fh_.read())) if dst is not None: with salt.utils.files.fopen(dst, 'w') as fh_: salt.utils.yaml.safe_dump(ps_opts, f...
python
def mksls(src, dst=None): ''' Convert an AutoYAST file to an SLS file ''' with salt.utils.files.fopen(src, 'r') as fh_: ps_opts = xml.to_dict(ET.fromstring(fh_.read())) if dst is not None: with salt.utils.files.fopen(dst, 'w') as fh_: salt.utils.yaml.safe_dump(ps_opts, f...
[ "def", "mksls", "(", "src", ",", "dst", "=", "None", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "src", ",", "'r'", ")", "as", "fh_", ":", "ps_opts", "=", "xml", ".", "to_dict", "(", "ET", ".", "fromstring", "(", "f...
Convert an AutoYAST file to an SLS file
[ "Convert", "an", "AutoYAST", "file", "to", "an", "SLS", "file" ]
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/yast.py#L14-L25
<|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 AutoYAST file to an SLS file ### Response: def mksls(src, dst=None): ''' Convert an AutoYAST file to an SLS...
[ 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, ...
jwodder/doapi
doapi/doapi.py
doapi.wait_actions
def wait_actions(self, actions, wait_interval=None, wait_time=None): r""" Poll the server periodically until all actions in ``actions`` have either completed or errored out, yielding each `Action`'s final value as it ends. If ``wait_time`` is exceeded, a `WaitTimeoutError` (cont...
python
def wait_actions(self, actions, wait_interval=None, wait_time=None): r""" Poll the server periodically until all actions in ``actions`` have either completed or errored out, yielding each `Action`'s final value as it ends. If ``wait_time`` is exceeded, a `WaitTimeoutError` (cont...
[ "def", "wait_actions", "(", "self", ",", "actions", ",", "wait_interval", "=", "None", ",", "wait_time", "=", "None", ")", ":", "return", "self", ".", "_wait", "(", "map", "(", "self", ".", "_action", ",", "actions", ")", ",", "\"done\"", ",", "True", ...
r""" Poll the server periodically until all actions in ``actions`` have either completed or errored out, yielding each `Action`'s final value as it ends. If ``wait_time`` is exceeded, a `WaitTimeoutError` (containing any remaining in-progress actions) is raised. If a `K...
[ "r", "Poll", "the", "server", "periodically", "until", "all", "actions", "in", "actions", "have", "either", "completed", "or", "errored", "out", "yielding", "each", "Action", "s", "final", "value", "as", "it", "ends", "." ]
train
https://github.com/jwodder/doapi/blob/b1306de86a01d8ae7b9c1fe2699765bb82e4f310/doapi/doapi.py#L493-L522
<|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: r""" Poll the server periodically until all actions in ``actions`` have either completed or errored out, yieldi...
[ 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, 81, 72...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 81, 72...
angr/angr
angr/utils/graph.py
compute_dominance_frontier
def compute_dominance_frontier(graph, domtree): """ Compute a dominance frontier based on the given post-dominator tree. This implementation is based on figure 2 of paper An Efficient Method of Computing Static Single Assignment Form by Ron Cytron, etc. :param graph: The graph where we want to c...
python
def compute_dominance_frontier(graph, domtree): """ Compute a dominance frontier based on the given post-dominator tree. This implementation is based on figure 2 of paper An Efficient Method of Computing Static Single Assignment Form by Ron Cytron, etc. :param graph: The graph where we want to c...
[ "def", "compute_dominance_frontier", "(", "graph", ",", "domtree", ")", ":", "df", "=", "{", "}", "# Perform a post-order search on the dominator tree", "for", "x", "in", "networkx", ".", "dfs_postorder_nodes", "(", "domtree", ")", ":", "if", "x", "not", "in", "...
Compute a dominance frontier based on the given post-dominator tree. This implementation is based on figure 2 of paper An Efficient Method of Computing Static Single Assignment Form by Ron Cytron, etc. :param graph: The graph where we want to compute the dominance frontier. :param domtree: The domin...
[ "Compute", "a", "dominance", "frontier", "based", "on", "the", "given", "post", "-", "dominator", "tree", "." ]
train
https://github.com/angr/angr/blob/4e2f97d56af5419ee73bdb30482c8dd8ff5f3e40/angr/utils/graph.py#L63-L104
<|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: Compute a dominance frontier based on the given post-dominator tree. This implementation is based on figure 2 of paper 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, 47354, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 47354, ...
coin-or/GiMPy
src/gimpy/graph.py
Graph.simplex_determine_leaving_arc
def simplex_determine_leaving_arc(self, t, k, l): ''' API: simplex_determine_leaving_arc(self, t, k, l) Description: Determines and returns the leaving arc. Input: t: current spanning tree solution. k: tail of the entering arc. ...
python
def simplex_determine_leaving_arc(self, t, k, l): ''' API: simplex_determine_leaving_arc(self, t, k, l) Description: Determines and returns the leaving arc. Input: t: current spanning tree solution. k: tail of the entering arc. ...
[ "def", "simplex_determine_leaving_arc", "(", "self", ",", "t", ",", "k", ",", "l", ")", ":", "# k,l are the first two elements of the cycle", "cycle", "=", "self", ".", "simplex_identify_cycle", "(", "t", ",", "k", ",", "l", ")", "flow_kl", "=", "self", ".", ...
API: simplex_determine_leaving_arc(self, t, k, l) Description: Determines and returns the leaving arc. Input: t: current spanning tree solution. k: tail of the entering arc. l: head of the entering arc. Return: Returns the t...
[ "API", ":", "simplex_determine_leaving_arc", "(", "self", "t", "k", "l", ")", "Description", ":", "Determines", "and", "returns", "the", "leaving", "arc", ".", "Input", ":", "t", ":", "current", "spanning", "tree", "solution", ".", "k", ":", "tail", "of", ...
train
https://github.com/coin-or/GiMPy/blob/51853122a50eb6019d06bbdedbfc396a833b5a22/src/gimpy/graph.py#L2349-L2403
<|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: API: simplex_determine_leaving_arc(self, t, k, l) Description: Determines and returns the leavi...
[ 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, 7227, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7227, ...
CamDavidsonPilon/lifelines
lifelines/utils/__init__.py
survival_table_from_events
def survival_table_from_events( death_times, event_observed, birth_times=None, columns=["removed", "observed", "censored", "entrance", "at_risk"], weights=None, collapse=False, intervals=None, ): # pylint: disable=dangerous-default-value,too-many-locals """ Parameters ----------...
python
def survival_table_from_events( death_times, event_observed, birth_times=None, columns=["removed", "observed", "censored", "entrance", "at_risk"], weights=None, collapse=False, intervals=None, ): # pylint: disable=dangerous-default-value,too-many-locals """ Parameters ----------...
[ "def", "survival_table_from_events", "(", "death_times", ",", "event_observed", ",", "birth_times", "=", "None", ",", "columns", "=", "[", "\"removed\"", ",", "\"observed\"", ",", "\"censored\"", ",", "\"entrance\"", ",", "\"at_risk\"", "]", ",", "weights", "=", ...
Parameters ---------- death_times: (n,) array represent the event times event_observed: (n,) array 1 if observed event, 0 is censored event. birth_times: a (n,) array, optional representing when the subject was first observed. A subject's death event is then at [birth times + duration ...
[ "Parameters", "----------", "death_times", ":", "(", "n", ")", "array", "represent", "the", "event", "times", "event_observed", ":", "(", "n", ")", "array", "1", "if", "observed", "event", "0", "is", "censored", "event", ".", "birth_times", ":", "a", "(", ...
train
https://github.com/CamDavidsonPilon/lifelines/blob/bdf6be6f1d10eea4c46365ee0ee6a47d8c30edf8/lifelines/utils/__init__.py#L262-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: Parameters ---------- death_times: (n,) array represent the event times event_observed: (n,) array 1 if...
[ 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, 9905, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9905, ...
sptonkin/fuzzyhashlib
fuzzyhashlib/__init__.py
tlsh.update
def update(self, buf): """Update this hash object's state with the provided string.""" if self._final: raise InvalidOperation("Cannot update finalised tlsh") else: self._buf_len += len(buf) return self._tlsh.update(buf)
python
def update(self, buf): """Update this hash object's state with the provided string.""" if self._final: raise InvalidOperation("Cannot update finalised tlsh") else: self._buf_len += len(buf) return self._tlsh.update(buf)
[ "def", "update", "(", "self", ",", "buf", ")", ":", "if", "self", ".", "_final", ":", "raise", "InvalidOperation", "(", "\"Cannot update finalised tlsh\"", ")", "else", ":", "self", ".", "_buf_len", "+=", "len", "(", "buf", ")", "return", "self", ".", "_...
Update this hash object's state with the provided string.
[ "Update", "this", "hash", "object", "s", "state", "with", "the", "provided", "string", "." ]
train
https://github.com/sptonkin/fuzzyhashlib/blob/61999dcfb0893358a330f51d88e4fa494a91bce2/fuzzyhashlib/__init__.py#L291-L297
<|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 this hash object's state with the provided string. ### Response: def update(self, buf): """Update this hash obj...
[ 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, ...
apetrynet/pyfilemail
pyfilemail/transfer.py
Transfer.is_complete
def is_complete(self): """:rtype: ``bool`` ``True`` if transfer is complete""" if 'status' in self.transfer_info: self._complete = self.transfer_info['status'] == 'STATUS_COMPLETE' return self._complete
python
def is_complete(self): """:rtype: ``bool`` ``True`` if transfer is complete""" if 'status' in self.transfer_info: self._complete = self.transfer_info['status'] == 'STATUS_COMPLETE' return self._complete
[ "def", "is_complete", "(", "self", ")", ":", "if", "'status'", "in", "self", ".", "transfer_info", ":", "self", ".", "_complete", "=", "self", ".", "transfer_info", "[", "'status'", "]", "==", "'STATUS_COMPLETE'", "return", "self", ".", "_complete" ]
:rtype: ``bool`` ``True`` if transfer is complete
[ ":", "rtype", ":", "bool", "True", "if", "transfer", "is", "complete" ]
train
https://github.com/apetrynet/pyfilemail/blob/eb81b0e69ff42f4335d5298833e4769b750bf397/pyfilemail/transfer.py#L400-L406
<|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: :rtype: ``bool`` ``True`` if transfer is complete ### Response: def is_complete(self): """:rtype: ``bool`` ``True`` if...
[ 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, 25, 33...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 25, 33...
sorgerlab/indra
indra/tools/assemble_corpus.py
standardize_names_groundings
def standardize_names_groundings(stmts): """Standardize the names of Concepts with respect to an ontology. NOTE: this function is currently optimized for Influence Statements obtained from Eidos, Hume, Sofia and CWMS. It will possibly yield unexpected results for biology-specific Statements. """ ...
python
def standardize_names_groundings(stmts): """Standardize the names of Concepts with respect to an ontology. NOTE: this function is currently optimized for Influence Statements obtained from Eidos, Hume, Sofia and CWMS. It will possibly yield unexpected results for biology-specific Statements. """ ...
[ "def", "standardize_names_groundings", "(", "stmts", ")", ":", "print", "(", "'Standardize names to groundings'", ")", "for", "stmt", "in", "stmts", ":", "for", "concept", "in", "stmt", ".", "agent_list", "(", ")", ":", "db_ns", ",", "db_id", "=", "concept", ...
Standardize the names of Concepts with respect to an ontology. NOTE: this function is currently optimized for Influence Statements obtained from Eidos, Hume, Sofia and CWMS. It will possibly yield unexpected results for biology-specific Statements.
[ "Standardize", "the", "names", "of", "Concepts", "with", "respect", "to", "an", "ontology", "." ]
train
https://github.com/sorgerlab/indra/blob/79a70415832c5702d7a820c7c9ccc8e25010124b/indra/tools/assemble_corpus.py#L1741-L1762
<|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: Standardize the names of Concepts with respect to an ontology. NOTE: this function is currently optimized for Influence St...
[ 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, 20367, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 20367, ...
ARMmbed/icetea
icetea_lib/Plugin/plugins/LocalAllocator/DutTcp.py
DutTcp.open_connection
def open_connection(self): """ Open connection over TCP socket. :return: Nothing """ self.logger.debug("Open COM %s", self.comport) self.port = socket.socket(socket.AF_INET, socket.SOCK_STREAM) (ip_addr, port) = self.comport.split(':') self.port.connect(ip...
python
def open_connection(self): """ Open connection over TCP socket. :return: Nothing """ self.logger.debug("Open COM %s", self.comport) self.port = socket.socket(socket.AF_INET, socket.SOCK_STREAM) (ip_addr, port) = self.comport.split(':') self.port.connect(ip...
[ "def", "open_connection", "(", "self", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Open COM %s\"", ",", "self", ".", "comport", ")", "self", ".", "port", "=", "socket", ".", "socket", "(", "socket", ".", "AF_INET", ",", "socket", ".", "SOCK_...
Open connection over TCP socket. :return: Nothing
[ "Open", "connection", "over", "TCP", "socket", ".", ":", "return", ":", "Nothing" ]
train
https://github.com/ARMmbed/icetea/blob/b2b97ac607429830cf7d62dae2e3903692c7c778/icetea_lib/Plugin/plugins/LocalAllocator/DutTcp.py#L33-L41
<|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: Open connection over TCP socket. :return: Nothing ### Response: def open_connection(self): """ Open 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, 5109, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5109, ...
anteater/anteater
anteater/src/patch_scan.py
scan_patch
def scan_patch(project, patch_file, binaries, ips, urls, file_audit_list, file_audit_project_list, flag_list, ignore_list, file_ignore, ignore_directories, url_ignore, ip_ignore, apikey): """ Scan actions for each commited file in patch set """ global failure split_pat...
python
def scan_patch(project, patch_file, binaries, ips, urls, file_audit_list, file_audit_project_list, flag_list, ignore_list, file_ignore, ignore_directories, url_ignore, ip_ignore, apikey): """ Scan actions for each commited file in patch set """ global failure split_pat...
[ "def", "scan_patch", "(", "project", ",", "patch_file", ",", "binaries", ",", "ips", ",", "urls", ",", "file_audit_list", ",", "file_audit_project_list", ",", "flag_list", ",", "ignore_list", ",", "file_ignore", ",", "ignore_directories", ",", "url_ignore", ",", ...
Scan actions for each commited file in patch set
[ "Scan", "actions", "for", "each", "commited", "file", "in", "patch", "set" ]
train
https://github.com/anteater/anteater/blob/a980adbed8563ef92494f565acd371e91f50f155/anteater/src/patch_scan.py#L104-L206
<|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: Scan actions for each commited file in patch set ### Response: def scan_patch(project, patch_file, binaries, ips, urls, file_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, 27668, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 27668, ...
google/grr
grr/server/grr_response_server/databases/mysql_flows.py
MySQLDBFlowMixin.CountFlowResultsByType
def CountFlowResultsByType(self, client_id, flow_id, cursor=None): """Returns counts of flow results grouped by result type.""" query = ("SELECT type, COUNT(*) FROM flow_results " "FORCE INDEX (flow_results_by_client_id_flow_id_timestamp) " "WHERE client_id = %s AND flow_id = %s " ...
python
def CountFlowResultsByType(self, client_id, flow_id, cursor=None): """Returns counts of flow results grouped by result type.""" query = ("SELECT type, COUNT(*) FROM flow_results " "FORCE INDEX (flow_results_by_client_id_flow_id_timestamp) " "WHERE client_id = %s AND flow_id = %s " ...
[ "def", "CountFlowResultsByType", "(", "self", ",", "client_id", ",", "flow_id", ",", "cursor", "=", "None", ")", ":", "query", "=", "(", "\"SELECT type, COUNT(*) FROM flow_results \"", "\"FORCE INDEX (flow_results_by_client_id_flow_id_timestamp) \"", "\"WHERE client_id = %s AND...
Returns counts of flow results grouped by result type.
[ "Returns", "counts", "of", "flow", "results", "grouped", "by", "result", "type", "." ]
train
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/server/grr_response_server/databases/mysql_flows.py#L1350-L1360
<|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 counts of flow results grouped by result type. ### Response: def CountFlowResultsByType(self, client_id, flow_id, curs...
[ 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, ...
google/grr
grr/client/grr_response_client/client_actions/artifact_collector.py
ArtifactCollector._ProcessGrepSource
def _ProcessGrepSource(self, source): """Find files fulfilling regex conditions.""" attributes = source.base_source.attributes paths = artifact_utils.InterpolateListKbAttributes( attributes["paths"], self.knowledge_base, self.ignore_interpolation_errors) regex = utils.RegexListDisjunctio...
python
def _ProcessGrepSource(self, source): """Find files fulfilling regex conditions.""" attributes = source.base_source.attributes paths = artifact_utils.InterpolateListKbAttributes( attributes["paths"], self.knowledge_base, self.ignore_interpolation_errors) regex = utils.RegexListDisjunctio...
[ "def", "_ProcessGrepSource", "(", "self", ",", "source", ")", ":", "attributes", "=", "source", ".", "base_source", ".", "attributes", "paths", "=", "artifact_utils", ".", "InterpolateListKbAttributes", "(", "attributes", "[", "\"paths\"", "]", ",", "self", ".",...
Find files fulfilling regex conditions.
[ "Find", "files", "fulfilling", "regex", "conditions", "." ]
train
https://github.com/google/grr/blob/5cef4e8e2f0d5df43ea4877e9c798e0bf60bfe74/grr/client/grr_response_client/client_actions/artifact_collector.py#L208-L225
<|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 files fulfilling regex conditions. ### Response: def _ProcessGrepSource(self, source): """Find files fulfilling regex...
[ 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, ...
F5Networks/f5-common-python
f5/multi_device/cluster/__init__.py
ClusterManager.manage_extant
def manage_extant(self, **kwargs): '''Manage an existing cluster :param kwargs: dict -- keyword args in dict ''' self._check_device_number(kwargs['devices']) self.trust_domain = TrustDomain( devices=kwargs['devices'], partition=kwargs['device_group_parti...
python
def manage_extant(self, **kwargs): '''Manage an existing cluster :param kwargs: dict -- keyword args in dict ''' self._check_device_number(kwargs['devices']) self.trust_domain = TrustDomain( devices=kwargs['devices'], partition=kwargs['device_group_parti...
[ "def", "manage_extant", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_check_device_number", "(", "kwargs", "[", "'devices'", "]", ")", "self", ".", "trust_domain", "=", "TrustDomain", "(", "devices", "=", "kwargs", "[", "'devices'", "]", ...
Manage an existing cluster :param kwargs: dict -- keyword args in dict
[ "Manage", "an", "existing", "cluster" ]
train
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/cluster/__init__.py#L136-L148
<|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: Manage an existing cluster :param kwargs: dict -- keyword args in dict ### Response: def manage_extant(self, **kwargs...
[ 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, 34176, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 34176, ...
woolfson-group/isambard
isambard/ampal/interactions.py
find_covalent_bonds
def find_covalent_bonds(ampal, max_range=2.2, threshold=1.1, tag=True): """Finds all covalent bonds in the AMPAL object. Parameters ---------- ampal : AMPAL Object Any AMPAL object with a `get_atoms` method. max_range : float, optional Used to define the sector size, so interactions...
python
def find_covalent_bonds(ampal, max_range=2.2, threshold=1.1, tag=True): """Finds all covalent bonds in the AMPAL object. Parameters ---------- ampal : AMPAL Object Any AMPAL object with a `get_atoms` method. max_range : float, optional Used to define the sector size, so interactions...
[ "def", "find_covalent_bonds", "(", "ampal", ",", "max_range", "=", "2.2", ",", "threshold", "=", "1.1", ",", "tag", "=", "True", ")", ":", "sectors", "=", "gen_sectors", "(", "ampal", ".", "get_atoms", "(", ")", ",", "max_range", "*", "1.1", ")", "bond...
Finds all covalent bonds in the AMPAL object. Parameters ---------- ampal : AMPAL Object Any AMPAL object with a `get_atoms` method. max_range : float, optional Used to define the sector size, so interactions at longer ranges will not be found. threshold : float, optional ...
[ "Finds", "all", "covalent", "bonds", "in", "the", "AMPAL", "object", "." ]
train
https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/interactions.py#L206-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: Finds all covalent bonds in the AMPAL object. Parameters ---------- ampal : AMPAL Object Any AMPAL object ...
[ 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, 37, 88...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 37, 88...
all-umass/graphs
graphs/mixins/label.py
LabelMixin.classify_nearest
def classify_nearest(self, partial_labels): '''Simple semi-supervised classification, by assigning unlabeled vertices the label of nearest labeled vertex. partial_labels: (n,) array of integer labels, -1 for unlabeled. ''' labels = np.array(partial_labels, copy=True) unlabeled = labels == -1 ...
python
def classify_nearest(self, partial_labels): '''Simple semi-supervised classification, by assigning unlabeled vertices the label of nearest labeled vertex. partial_labels: (n,) array of integer labels, -1 for unlabeled. ''' labels = np.array(partial_labels, copy=True) unlabeled = labels == -1 ...
[ "def", "classify_nearest", "(", "self", ",", "partial_labels", ")", ":", "labels", "=", "np", ".", "array", "(", "partial_labels", ",", "copy", "=", "True", ")", "unlabeled", "=", "labels", "==", "-", "1", "# compute geodesic distances from unlabeled vertices", ...
Simple semi-supervised classification, by assigning unlabeled vertices the label of nearest labeled vertex. partial_labels: (n,) array of integer labels, -1 for unlabeled.
[ "Simple", "semi", "-", "supervised", "classification", "by", "assigning", "unlabeled", "vertices", "the", "label", "of", "nearest", "labeled", "vertex", "." ]
train
https://github.com/all-umass/graphs/blob/4fbeb025dfe33340335f34300f58dd3809228822/graphs/mixins/label.py#L42-L58
<|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: Simple semi-supervised classification, by assigning unlabeled vertices the label of nearest labeled vertex. partial_la...
[ 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, 16778, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16778, ...
llazzaro/django-scheduler
schedule/templatetags/scheduletags.py
_cook_slots
def _cook_slots(period, increment): """ Prepare slots to be displayed on the left hand side calculate dimensions (in px) for each slot. Arguments: period - time period for the whole series increment - slot size in minutes """ tdiff = datetime.timedelta(minutes=increme...
python
def _cook_slots(period, increment): """ Prepare slots to be displayed on the left hand side calculate dimensions (in px) for each slot. Arguments: period - time period for the whole series increment - slot size in minutes """ tdiff = datetime.timedelta(minutes=increme...
[ "def", "_cook_slots", "(", "period", ",", "increment", ")", ":", "tdiff", "=", "datetime", ".", "timedelta", "(", "minutes", "=", "increment", ")", "num", "=", "int", "(", "(", "period", ".", "end", "-", "period", ".", "start", ")", ".", "total_seconds...
Prepare slots to be displayed on the left hand side calculate dimensions (in px) for each slot. Arguments: period - time period for the whole series increment - slot size in minutes
[ "Prepare", "slots", "to", "be", "displayed", "on", "the", "left", "hand", "side", "calculate", "dimensions", "(", "in", "px", ")", "for", "each", "slot", ".", "Arguments", ":", "period", "-", "time", "period", "for", "the", "whole", "series", "increment", ...
train
https://github.com/llazzaro/django-scheduler/blob/0530b74a5fc0b1125645002deaa4da2337ed0f17/schedule/templatetags/scheduletags.py#L245-L261
<|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: Prepare slots to be displayed on the left hand side calculate dimensions (in px) for each slot. Arguments: ...
[ 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, 51690, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 51690, ...
pyviz/param
param/parameterized.py
Parameters.get_value_generator
def get_value_generator(self_,name): # pylint: disable-msg=E0213 """ Return the value or value-generating object of the named attribute. For most parameters, this is simply the parameter's value (i.e. the same as getattr()), but Dynamic parameters have their value-genera...
python
def get_value_generator(self_,name): # pylint: disable-msg=E0213 """ Return the value or value-generating object of the named attribute. For most parameters, this is simply the parameter's value (i.e. the same as getattr()), but Dynamic parameters have their value-genera...
[ "def", "get_value_generator", "(", "self_", ",", "name", ")", ":", "# pylint: disable-msg=E0213", "cls_or_slf", "=", "self_", ".", "self_or_cls", "param_obj", "=", "cls_or_slf", ".", "param", ".", "objects", "(", "'existing'", ")", ".", "get", "(", "name", ")"...
Return the value or value-generating object of the named attribute. For most parameters, this is simply the parameter's value (i.e. the same as getattr()), but Dynamic parameters have their value-generating object returned.
[ "Return", "the", "value", "or", "value", "-", "generating", "object", "of", "the", "named", "attribute", "." ]
train
https://github.com/pyviz/param/blob/8f0dafa78defa883247b40635f96cc6d5c1b3481/param/parameterized.py#L1504-L1537
<|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 value or value-generating object of the named attribute. For most parameters, this is simply the 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, 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, ...
mitsei/dlkit
dlkit/json_/proxy/sessions.py
ProxySession.get_proxy
def get_proxy(self, input_): """Gets a proxy. arg: input (osid.proxy.ProxyCondition): a proxy condition return: (osid.proxy.Proxy) - a proxy raise: NullArgument - ``input`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied - au...
python
def get_proxy(self, input_): """Gets a proxy. arg: input (osid.proxy.ProxyCondition): a proxy condition return: (osid.proxy.Proxy) - a proxy raise: NullArgument - ``input`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied - au...
[ "def", "get_proxy", "(", "self", ",", "input_", ")", ":", "if", "input_", ".", "_http_request", "is", "not", "None", ":", "authentication", "=", "Authentication", "(", ")", "authentication", ".", "set_django_user", "(", "input_", ".", "_http_request", ".", "...
Gets a proxy. arg: input (osid.proxy.ProxyCondition): a proxy condition return: (osid.proxy.Proxy) - a proxy raise: NullArgument - ``input`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure raise: Unsu...
[ "Gets", "a", "proxy", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/proxy/sessions.py#L45-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: Gets a proxy. arg: input (osid.proxy.ProxyCondition): a proxy condition return: (osid.proxy.Proxy) - a prox...
[ 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, ...
DataDog/integrations-core
openstack/datadog_checks/openstack/openstack.py
KeystoneCatalog.get_neutron_endpoint
def get_neutron_endpoint(cls, json_resp): """ Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog """ catalog = json_resp.get('token', {}).get('catalog', [...
python
def get_neutron_endpoint(cls, json_resp): """ Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog """ catalog = json_resp.get('token', {}).get('catalog', [...
[ "def", "get_neutron_endpoint", "(", "cls", ",", "json_resp", ")", ":", "catalog", "=", "json_resp", ".", "get", "(", "'token'", ",", "{", "}", ")", ".", "get", "(", "'catalog'", ",", "[", "]", ")", "match", "=", "'neutron'", "neutron_endpoint", "=", "N...
Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog
[ "Parse", "the", "service", "catalog", "returned", "by", "the", "Identity", "API", "for", "an", "endpoint", "matching", "the", "Neutron", "service", "Sends", "a", "CRITICAL", "service", "check", "when", "none", "are", "found", "registered", "in", "the", "Catalo...
train
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L455-L479
<|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 service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL se...
[ 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, ...
materialsproject/pymatgen
pymatgen/io/abinit/flows.py
Flow.validate_json_schema
def validate_json_schema(self): """Validate the JSON schema. Return list of errors.""" errors = [] for work in self: for task in work: if not task.get_results().validate_json_schema(): errors.append(task) if not work.get_results().vali...
python
def validate_json_schema(self): """Validate the JSON schema. Return list of errors.""" errors = [] for work in self: for task in work: if not task.get_results().validate_json_schema(): errors.append(task) if not work.get_results().vali...
[ "def", "validate_json_schema", "(", "self", ")", ":", "errors", "=", "[", "]", "for", "work", "in", "self", ":", "for", "task", "in", "work", ":", "if", "not", "task", ".", "get_results", "(", ")", ".", "validate_json_schema", "(", ")", ":", "errors", ...
Validate the JSON schema. Return list of errors.
[ "Validate", "the", "JSON", "schema", ".", "Return", "list", "of", "errors", "." ]
train
https://github.com/materialsproject/pymatgen/blob/4ca558cf72f8d5f8a1f21dfdfc0181a971c186da/pymatgen/io/abinit/flows.py#L426-L439
<|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 the JSON schema. Return list of errors. ### Response: def validate_json_schema(self): """Validate the JSON sc...
[ 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, ...
juju/python-libjuju
juju/client/overrides.py
ResourcesFacade.AddPendingResources
async def AddPendingResources(self, application_tag, charm_url, resources): """Fix the calling signature of AddPendingResources. The ResourcesFacade doesn't conform to the standard facade pattern in the Juju source, which leads to the schemagened code not matching up properly with the a...
python
async def AddPendingResources(self, application_tag, charm_url, resources): """Fix the calling signature of AddPendingResources. The ResourcesFacade doesn't conform to the standard facade pattern in the Juju source, which leads to the schemagened code not matching up properly with the a...
[ "async", "def", "AddPendingResources", "(", "self", ",", "application_tag", ",", "charm_url", ",", "resources", ")", ":", "# map input types to rpc msg", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'Resources'", ",", "request", "="...
Fix the calling signature of AddPendingResources. The ResourcesFacade doesn't conform to the standard facade pattern in the Juju source, which leads to the schemagened code not matching up properly with the actual calling convention in the API. There is work planned to fix this in Juju...
[ "Fix", "the", "calling", "signature", "of", "AddPendingResources", "." ]
train
https://github.com/juju/python-libjuju/blob/58f0011f4c57cd68830258952fa952eaadca6b38/juju/client/overrides.py#L65-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: Fix the calling signature of AddPendingResources. The ResourcesFacade doesn't conform to the standard facade pattern 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, 27048, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 27048, ...
inveniosoftware-contrib/invenio-classifier
invenio_classifier/find.py
get_reference_section_beginning
def get_reference_section_beginning(fulltext): """Get start of reference section.""" sect_start = { 'start_line': None, 'end_line': None, 'title_string': None, 'marker_pattern': None, 'marker': None, 'how_found_start': None, } # Find start of refs section...
python
def get_reference_section_beginning(fulltext): """Get start of reference section.""" sect_start = { 'start_line': None, 'end_line': None, 'title_string': None, 'marker_pattern': None, 'marker': None, 'how_found_start': None, } # Find start of refs section...
[ "def", "get_reference_section_beginning", "(", "fulltext", ")", ":", "sect_start", "=", "{", "'start_line'", ":", "None", ",", "'end_line'", ":", "None", ",", "'title_string'", ":", "None", ",", "'marker_pattern'", ":", "None", ",", "'marker'", ":", "None", ",...
Get start of reference section.
[ "Get", "start", "of", "reference", "section", "." ]
train
https://github.com/inveniosoftware-contrib/invenio-classifier/blob/3c758cf34dca6bf0548e7da5de34e5f72e3b255e/invenio_classifier/find.py#L476-L518
<|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 start of reference section. ### Response: def get_reference_section_beginning(fulltext): """Get start of reference sec...
[ 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, ...
ixc/python-edtf
edtf/convert.py
struct_time_to_jd
def struct_time_to_jd(st): """ Return a float number representing the Julian Date for the given `struct_time`. NOTE: extra fields `tm_wday`, `tm_yday`, and `tm_isdst` are ignored. """ year, month, day = st[:3] hours, minutes, seconds = st[3:6] # Convert time of day to fraction of day ...
python
def struct_time_to_jd(st): """ Return a float number representing the Julian Date for the given `struct_time`. NOTE: extra fields `tm_wday`, `tm_yday`, and `tm_isdst` are ignored. """ year, month, day = st[:3] hours, minutes, seconds = st[3:6] # Convert time of day to fraction of day ...
[ "def", "struct_time_to_jd", "(", "st", ")", ":", "year", ",", "month", ",", "day", "=", "st", "[", ":", "3", "]", "hours", ",", "minutes", ",", "seconds", "=", "st", "[", "3", ":", "6", "]", "# Convert time of day to fraction of day", "day", "+=", "jdu...
Return a float number representing the Julian Date for the given `struct_time`. NOTE: extra fields `tm_wday`, `tm_yday`, and `tm_isdst` are ignored.
[ "Return", "a", "float", "number", "representing", "the", "Julian", "Date", "for", "the", "given", "struct_time", "." ]
train
https://github.com/ixc/python-edtf/blob/ec2124d3df75f8dd72571026380ce8dd16f3dd6b/edtf/convert.py#L66-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: Return a float number representing the Julian Date for the given `struct_time`. NOTE: extra fields `tm_wday`, `tm_yday...
[ 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, ...
saltstack/salt
salt/modules/debian_ip.py
_parse_current_network_settings
def _parse_current_network_settings(): ''' Parse /etc/default/networking and return current configuration ''' opts = salt.utils.odict.OrderedDict() opts['networking'] = '' if os.path.isfile(_DEB_NETWORKING_FILE): with salt.utils.files.fopen(_DEB_NETWORKING_FILE) as contents: ...
python
def _parse_current_network_settings(): ''' Parse /etc/default/networking and return current configuration ''' opts = salt.utils.odict.OrderedDict() opts['networking'] = '' if os.path.isfile(_DEB_NETWORKING_FILE): with salt.utils.files.fopen(_DEB_NETWORKING_FILE) as contents: ...
[ "def", "_parse_current_network_settings", "(", ")", ":", "opts", "=", "salt", ".", "utils", ".", "odict", ".", "OrderedDict", "(", ")", "opts", "[", "'networking'", "]", "=", "''", "if", "os", ".", "path", ".", "isfile", "(", "_DEB_NETWORKING_FILE", ")", ...
Parse /etc/default/networking and return current configuration
[ "Parse", "/", "etc", "/", "default", "/", "networking", "and", "return", "current", "configuration" ]
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_ip.py#L263-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: Parse /etc/default/networking and return current configuration ### Response: def _parse_current_network_settings(): ''' ...
[ 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, ...
wandb/client
wandb/__init__.py
log
def log(row=None, commit=True, *args, **kargs): """Log a dict to the global run's history. If commit is false, enables multiple calls before commiting. Eg. wandb.log({'train-loss': 0.5, 'accuracy': 0.9}) """ if run is None: raise ValueError( "You must call `wandb.init` in the ...
python
def log(row=None, commit=True, *args, **kargs): """Log a dict to the global run's history. If commit is false, enables multiple calls before commiting. Eg. wandb.log({'train-loss': 0.5, 'accuracy': 0.9}) """ if run is None: raise ValueError( "You must call `wandb.init` in the ...
[ "def", "log", "(", "row", "=", "None", ",", "commit", "=", "True", ",", "*", "args", ",", "*", "*", "kargs", ")", ":", "if", "run", "is", "None", ":", "raise", "ValueError", "(", "\"You must call `wandb.init` in the same process before calling log\"", ")", "...
Log a dict to the global run's history. If commit is false, enables multiple calls before commiting. Eg. wandb.log({'train-loss': 0.5, 'accuracy': 0.9})
[ "Log", "a", "dict", "to", "the", "global", "run", "s", "history", ".", "If", "commit", "is", "false", "enables", "multiple", "calls", "before", "commiting", "." ]
train
https://github.com/wandb/client/blob/7d08954ed5674fee223cd85ed0d8518fe47266b2/wandb/__init__.py#L465-L481
<|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: Log a dict to the global run's history. If commit is false, enables multiple calls before commiting. Eg. wandb.log({...
[ 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, 2250, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2250, ...
omederos/pyspinner
spinning/spinning.py
override_params
def override_params(opening_char='{', closing_char='}', separator_char='|'): """ Override some character settings @type opening_char: str @param opening_char: Opening character. Default: '{' @type closing_char: str @param closing_char: Closing character. Default: '}' @type separator_char: s...
python
def override_params(opening_char='{', closing_char='}', separator_char='|'): """ Override some character settings @type opening_char: str @param opening_char: Opening character. Default: '{' @type closing_char: str @param closing_char: Closing character. Default: '}' @type separator_char: s...
[ "def", "override_params", "(", "opening_char", "=", "'{'", ",", "closing_char", "=", "'}'", ",", "separator_char", "=", "'|'", ")", ":", "global", "char_separator", ",", "char_opening", ",", "char_closing", "char_separator", "=", "separator_char", "char_opening", ...
Override some character settings @type opening_char: str @param opening_char: Opening character. Default: '{' @type closing_char: str @param closing_char: Closing character. Default: '}' @type separator_char: str @param separator_char: Separator char. Default: '|'
[ "Override", "some", "character", "settings" ]
train
https://github.com/omederos/pyspinner/blob/4615d92e669942c48d5542a23ddf6d40b206d9d5/spinning/spinning.py#L10-L24
<|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: Override some character settings @type opening_char: str @param opening_char: Opening character. Default: '{' @typ...
[ 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, 2226, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2226, ...
saltstack/salt
salt/states/zone.py
detached
def detached(name): ''' Ensure zone is detached name : string name of the zone ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} zones = __salt__['zoneadm.list'](installed=True, configured=True) if name in zones: if zon...
python
def detached(name): ''' Ensure zone is detached name : string name of the zone ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} zones = __salt__['zoneadm.list'](installed=True, configured=True) if name in zones: if zon...
[ "def", "detached", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "zones", "=", "__salt__", "[", "'zoneadm.list'", "]", "(", "installed",...
Ensure zone is detached name : string name of the zone
[ "Ensure", "zone", "is", "detached" ]
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zone.py#L1100-L1138
<|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: Ensure zone is detached name : string name of the zone ### Response: def detached(name): ''' Ensure zone ...
[ 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, 65539, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 65539, ...
onelogin/python3-saml
src/onelogin/saml2/response.py
OneLogin_Saml2_Response.__query
def __query(self, query, tagid=None): """ Extracts nodes that match the query from the Response :param query: Xpath Expresion :type query: String :param tagid: Tag ID :type query: String :returns: The queried nodes :rtype: list """ if se...
python
def __query(self, query, tagid=None): """ Extracts nodes that match the query from the Response :param query: Xpath Expresion :type query: String :param tagid: Tag ID :type query: String :returns: The queried nodes :rtype: list """ if se...
[ "def", "__query", "(", "self", ",", "query", ",", "tagid", "=", "None", ")", ":", "if", "self", ".", "encrypted", ":", "document", "=", "self", ".", "decrypted_document", "else", ":", "document", "=", "self", ".", "document", "return", "OneLogin_Saml2_XML"...
Extracts nodes that match the query from the Response :param query: Xpath Expresion :type query: String :param tagid: Tag ID :type query: String :returns: The queried nodes :rtype: list
[ "Extracts", "nodes", "that", "match", "the", "query", "from", "the", "Response" ]
train
https://github.com/onelogin/python3-saml/blob/064b7275fba1e5f39a9116ba1cdcc5d01fc34daa/src/onelogin/saml2/response.py#L760-L777
<|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: Extracts nodes that match the query from the Response :param query: Xpath Expresion :type query: String ...
[ 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, 30059, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 30059, ...
HiPERCAM/hcam_widgets
hcam_widgets/widgets.py
Windows.enable
def enable(self): """ Enables all settings """ nwin = self.nwin.value() for label, xs, ys, nx, ny in \ zip(self.label[:nwin], self.xs[:nwin], self.ys[:nwin], self.nx[:nwin], self.ny[:nwin]): label.config(state='normal') ...
python
def enable(self): """ Enables all settings """ nwin = self.nwin.value() for label, xs, ys, nx, ny in \ zip(self.label[:nwin], self.xs[:nwin], self.ys[:nwin], self.nx[:nwin], self.ny[:nwin]): label.config(state='normal') ...
[ "def", "enable", "(", "self", ")", ":", "nwin", "=", "self", ".", "nwin", ".", "value", "(", ")", "for", "label", ",", "xs", ",", "ys", ",", "nx", ",", "ny", "in", "zip", "(", "self", ".", "label", "[", ":", "nwin", "]", ",", "self", ".", "...
Enables all settings
[ "Enables", "all", "settings" ]
train
https://github.com/HiPERCAM/hcam_widgets/blob/7219f0d96dd3a8ebe3139c7f542a72c02d02fce8/hcam_widgets/widgets.py#L4229-L4255
<|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: Enables all settings ### Response: def enable(self): """ Enables all settings """ nwin = 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, 1737, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1737, ...
klen/peewee_migrate
peewee_migrate/migrator.py
Migrator.add_default
def add_default(self, model, name, default): """Add default.""" field = model._meta.fields[name] model._meta.defaults[field] = field.default = default self.ops.append(self.migrator.apply_default(model._meta.table_name, name, field)) return model
python
def add_default(self, model, name, default): """Add default.""" field = model._meta.fields[name] model._meta.defaults[field] = field.default = default self.ops.append(self.migrator.apply_default(model._meta.table_name, name, field)) return model
[ "def", "add_default", "(", "self", ",", "model", ",", "name", ",", "default", ")", ":", "field", "=", "model", ".", "_meta", ".", "fields", "[", "name", "]", "model", ".", "_meta", ".", "defaults", "[", "field", "]", "=", "field", ".", "default", "...
Add default.
[ "Add", "default", "." ]
train
https://github.com/klen/peewee_migrate/blob/b77895ab1c9be3121bc127e0c2dfb047eed8b24c/peewee_migrate/migrator.py#L341-L346
<|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 default. ### Response: def add_default(self, model, name, default): """Add default.""" field = model._meta...
[ 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, ...
MartinThoma/mpu
mpu/pd.py
describe
def describe(df, dtype=None): """ Print a description of a Pandas dataframe. Parameters ---------- df : Pandas.DataFrame dtype : dict Maps column names to types """ if dtype is None: dtype = {} print('Number of datapoints: {datapoints}'.format(datapoints=len(df))) ...
python
def describe(df, dtype=None): """ Print a description of a Pandas dataframe. Parameters ---------- df : Pandas.DataFrame dtype : dict Maps column names to types """ if dtype is None: dtype = {} print('Number of datapoints: {datapoints}'.format(datapoints=len(df))) ...
[ "def", "describe", "(", "df", ",", "dtype", "=", "None", ")", ":", "if", "dtype", "is", "None", ":", "dtype", "=", "{", "}", "print", "(", "'Number of datapoints: {datapoints}'", ".", "format", "(", "datapoints", "=", "len", "(", "df", ")", ")", ")", ...
Print a description of a Pandas dataframe. Parameters ---------- df : Pandas.DataFrame dtype : dict Maps column names to types
[ "Print", "a", "description", "of", "a", "Pandas", "dataframe", "." ]
train
https://github.com/MartinThoma/mpu/blob/61bc36d0192ca90c0bcf9b8a5d7d0d8520e20ff6/mpu/pd.py#L49-L85
<|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: Print a description of a Pandas dataframe. Parameters ---------- df : Pandas.DataFrame dtype : dict Ma...
[ 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, 9171, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9171, ...
wummel/linkchecker
linkcheck/checker/__init__.py
get_url_from
def get_url_from (base_url, recursion_level, aggregate, parent_url=None, base_ref=None, line=0, column=0, page=0, name=u"", parent_content_type=None, extern=None): """ Get url data from given base data. @param base_url: base url from a link tag @type base_url: string...
python
def get_url_from (base_url, recursion_level, aggregate, parent_url=None, base_ref=None, line=0, column=0, page=0, name=u"", parent_content_type=None, extern=None): """ Get url data from given base data. @param base_url: base url from a link tag @type base_url: string...
[ "def", "get_url_from", "(", "base_url", ",", "recursion_level", ",", "aggregate", ",", "parent_url", "=", "None", ",", "base_ref", "=", "None", ",", "line", "=", "0", ",", "column", "=", "0", ",", "page", "=", "0", ",", "name", "=", "u\"\"", ",", "pa...
Get url data from given base data. @param base_url: base url from a link tag @type base_url: string or None @param recursion_level: current recursion level @type recursion_level: number @param aggregate: aggregate object @type aggregate: aggregate.Consumer @param parent_url: parent url ...
[ "Get", "url", "data", "from", "given", "base", "data", "." ]
train
https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/checker/__init__.py#L67-L125
<|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 url data from given base data. @param base_url: base url from a link tag @type base_url: string or None @param...
[ 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, ...
yyuu/botornado
boto/gs/bucket.py
Bucket.set_def_acl
def set_def_acl(self, acl_or_str, key_name='', headers=None): """sets or changes a bucket's default object acl""" if isinstance(acl_or_str, Policy): raise InvalidAclError('Attempt to set S3 Policy on GS ACL') elif isinstance(acl_or_str, ACL): self.set_def_xml_acl(acl_or_s...
python
def set_def_acl(self, acl_or_str, key_name='', headers=None): """sets or changes a bucket's default object acl""" if isinstance(acl_or_str, Policy): raise InvalidAclError('Attempt to set S3 Policy on GS ACL') elif isinstance(acl_or_str, ACL): self.set_def_xml_acl(acl_or_s...
[ "def", "set_def_acl", "(", "self", ",", "acl_or_str", ",", "key_name", "=", "''", ",", "headers", "=", "None", ")", ":", "if", "isinstance", "(", "acl_or_str", ",", "Policy", ")", ":", "raise", "InvalidAclError", "(", "'Attempt to set S3 Policy on GS ACL'", ")...
sets or changes a bucket's default object acl
[ "sets", "or", "changes", "a", "bucket", "s", "default", "object", "acl" ]
train
https://github.com/yyuu/botornado/blob/fffb056f5ff2324d1d5c1304014cfb1d899f602e/boto/gs/bucket.py#L53-L60
<|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 or changes a bucket's default object acl ### Response: def set_def_acl(self, acl_or_str, key_name='', headers=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, 5022, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5022, ...
BD2KGenomics/toil-scripts
src/toil_scripts/spladder_pipeline/spladder_pipeline.py
star
def star(job, inputs, r1_cutadapt, r2_cutadapt): """ Performs alignment of fastqs to BAM via STAR :param JobFunctionWrappingJob job: passed by Toil automatically :param Namespace inputs: Stores input arguments (see main) :param str r1_cutadapt: FileStore ID of read 1 fastq :param str r2_cutadap...
python
def star(job, inputs, r1_cutadapt, r2_cutadapt): """ Performs alignment of fastqs to BAM via STAR :param JobFunctionWrappingJob job: passed by Toil automatically :param Namespace inputs: Stores input arguments (see main) :param str r1_cutadapt: FileStore ID of read 1 fastq :param str r2_cutadap...
[ "def", "star", "(", "job", ",", "inputs", ",", "r1_cutadapt", ",", "r2_cutadapt", ")", ":", "job", ".", "fileStore", ".", "logToMaster", "(", "'Aligning with STAR: {}'", ".", "format", "(", "inputs", ".", "uuid", ")", ")", "work_dir", "=", "job", ".", "f...
Performs alignment of fastqs to BAM via STAR :param JobFunctionWrappingJob job: passed by Toil automatically :param Namespace inputs: Stores input arguments (see main) :param str r1_cutadapt: FileStore ID of read 1 fastq :param str r2_cutadapt: FileStore ID of read 2 fastq
[ "Performs", "alignment", "of", "fastqs", "to", "BAM", "via", "STAR" ]
train
https://github.com/BD2KGenomics/toil-scripts/blob/f878d863defcdccaabb7fe06f991451b7a198fb7/src/toil_scripts/spladder_pipeline/spladder_pipeline.py#L180-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: Performs alignment of fastqs to BAM via STAR :param JobFunctionWrappingJob job: passed by Toil automatically :param Na...
[ 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, 3976, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3976, ...
f3at/feat
src/feat/common/manhole.py
Parser.split
def split(self, text): ''' Splits the text with function arguments into the array with first class citizens separated. See the unit tests for clarificatin. ''' # nesting character -> count counters = {"'": False, '(': 0} def reverse(char): def wrappe...
python
def split(self, text): ''' Splits the text with function arguments into the array with first class citizens separated. See the unit tests for clarificatin. ''' # nesting character -> count counters = {"'": False, '(': 0} def reverse(char): def wrappe...
[ "def", "split", "(", "self", ",", "text", ")", ":", "# nesting character -> count", "counters", "=", "{", "\"'\"", ":", "False", ",", "'('", ":", "0", "}", "def", "reverse", "(", "char", ")", ":", "def", "wrapped", "(", ")", ":", "counters", "[", "ch...
Splits the text with function arguments into the array with first class citizens separated. See the unit tests for clarificatin.
[ "Splits", "the", "text", "with", "function", "arguments", "into", "the", "array", "with", "first", "class", "citizens", "separated", ".", "See", "the", "unit", "tests", "for", "clarificatin", "." ]
train
https://github.com/f3at/feat/blob/15da93fc9d6ec8154f52a9172824e25821195ef8/src/feat/common/manhole.py#L155-L233
<|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: Splits the text with function arguments into the array with first class citizens separated. See the unit tests for clar...
[ 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, 50, 40...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 50, 40...
globocom/GloboNetworkAPI-client-python
networkapiclient/Ip.py
Ip.get_available_ip6
def get_available_ip6(self, id_network6): """ Get a available IP in Network ipv6 :param id_network6: Network ipv6 identifier. Integer value and greater than zero. :return: Dictionary with the following structure: :: {'ip6': {'ip6': < available_ip6 >}} :ra...
python
def get_available_ip6(self, id_network6): """ Get a available IP in Network ipv6 :param id_network6: Network ipv6 identifier. Integer value and greater than zero. :return: Dictionary with the following structure: :: {'ip6': {'ip6': < available_ip6 >}} :ra...
[ "def", "get_available_ip6", "(", "self", ",", "id_network6", ")", ":", "if", "not", "is_valid_int_param", "(", "id_network6", ")", ":", "raise", "InvalidParameterError", "(", "u'Network ipv6 identifier is invalid or was not informed.'", ")", "url", "=", "'ip/availableip6/...
Get a available IP in Network ipv6 :param id_network6: Network ipv6 identifier. Integer value and greater than zero. :return: Dictionary with the following structure: :: {'ip6': {'ip6': < available_ip6 >}} :raise IpNotAvailableError: Network dont have available IP. ...
[ "Get", "a", "available", "IP", "in", "Network", "ipv6" ]
train
https://github.com/globocom/GloboNetworkAPI-client-python/blob/cf34f913da48d9abbf750114f5d2ac4b2dde137d/networkapiclient/Ip.py#L275-L304
<|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 a available IP in Network ipv6 :param id_network6: Network ipv6 identifier. Integer value and greater than zero. ...
[ 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, ...
jrigden/pyPodcastParser
pyPodcastParser/Podcast.py
Podcast.set_extended_elements
def set_extended_elements(self): """Parses and sets non required elements""" self.set_creative_commons() self.set_owner() self.set_subtitle() self.set_summary()
python
def set_extended_elements(self): """Parses and sets non required elements""" self.set_creative_commons() self.set_owner() self.set_subtitle() self.set_summary()
[ "def", "set_extended_elements", "(", "self", ")", ":", "self", ".", "set_creative_commons", "(", ")", "self", ".", "set_owner", "(", ")", "self", ".", "set_subtitle", "(", ")", "self", ".", "set_summary", "(", ")" ]
Parses and sets non required elements
[ "Parses", "and", "sets", "non", "required", "elements" ]
train
https://github.com/jrigden/pyPodcastParser/blob/b21e027bb56ec77986d76fc1990f4e420c6de869/pyPodcastParser/Podcast.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: Parses and sets non required elements ### Response: def set_extended_elements(self): """Parses and sets non required e...
[ 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, 15...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15...
nameko/nameko
nameko/cli/shell.py
make_nameko_helper
def make_nameko_helper(config): """Create a fake module that provides some convenient access to nameko standalone functionality for interactive shell usage. """ module = ModuleType('nameko') module.__doc__ = """Nameko shell helper for making rpc calls and dispatching events. Usage: >>> n.rpc.se...
python
def make_nameko_helper(config): """Create a fake module that provides some convenient access to nameko standalone functionality for interactive shell usage. """ module = ModuleType('nameko') module.__doc__ = """Nameko shell helper for making rpc calls and dispatching events. Usage: >>> n.rpc.se...
[ "def", "make_nameko_helper", "(", "config", ")", ":", "module", "=", "ModuleType", "(", "'nameko'", ")", "module", ".", "__doc__", "=", "\"\"\"Nameko shell helper for making rpc calls and dispatching\nevents.\n\nUsage:\n >>> n.rpc.service.method()\n \"reply\"\n\n >>> n.dispa...
Create a fake module that provides some convenient access to nameko standalone functionality for interactive shell usage.
[ "Create", "a", "fake", "module", "that", "provides", "some", "convenient", "access", "to", "nameko", "standalone", "functionality", "for", "interactive", "shell", "usage", "." ]
train
https://github.com/nameko/nameko/blob/88d7e5211de4fcc1c34cd7f84d7c77f0619c5f5d/nameko/cli/shell.py#L58-L77
<|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 fake module that provides some convenient access to nameko standalone functionality for interactive shell 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, 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, ...
pytroll/satpy
satpy/scene.py
Scene.all_same_proj
def all_same_proj(self): """All contained data array are in the same projection.""" all_areas = [x.attrs.get('area', None) for x in self.values()] all_areas = [x for x in all_areas if x is not None] return all(all_areas[0].proj_str == x.proj_str for x in all_areas[1:])
python
def all_same_proj(self): """All contained data array are in the same projection.""" all_areas = [x.attrs.get('area', None) for x in self.values()] all_areas = [x for x in all_areas if x is not None] return all(all_areas[0].proj_str == x.proj_str for x in all_areas[1:])
[ "def", "all_same_proj", "(", "self", ")", ":", "all_areas", "=", "[", "x", ".", "attrs", ".", "get", "(", "'area'", ",", "None", ")", "for", "x", "in", "self", ".", "values", "(", ")", "]", "all_areas", "=", "[", "x", "for", "x", "in", "all_areas...
All contained data array are in the same projection.
[ "All", "contained", "data", "array", "are", "in", "the", "same", "projection", "." ]
train
https://github.com/pytroll/satpy/blob/1f21d20ac686b745fb0da9b4030d139893e066dd/satpy/scene.py#L459-L463
<|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: All contained data array are in the same projection. ### Response: def all_same_proj(self): """All contained data arra...
[ 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, 2460, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2460, ...
jermnelson/flask-fedora-commons
flask_fedora_commons/__init__.py
copy_graph
def copy_graph(subject, existing_graph): """Function takes a subject and an existing graph, returns a new graph with all predicate and objects of the existing graph copied to the new_graph with subject as the new subject Args: subject(rdflib.URIRef): A URIRef subject existing_graph(rdfl...
python
def copy_graph(subject, existing_graph): """Function takes a subject and an existing graph, returns a new graph with all predicate and objects of the existing graph copied to the new_graph with subject as the new subject Args: subject(rdflib.URIRef): A URIRef subject existing_graph(rdfl...
[ "def", "copy_graph", "(", "subject", ",", "existing_graph", ")", ":", "new_graph", "=", "rdflib", ".", "Graph", "(", ")", "for", "predicate", ",", "object_", "in", "existing_graph", ".", "predicate_objects", "(", ")", ":", "new_graph", ".", "add", "(", "("...
Function takes a subject and an existing graph, returns a new graph with all predicate and objects of the existing graph copied to the new_graph with subject as the new subject Args: subject(rdflib.URIRef): A URIRef subject existing_graph(rdflib.Graph): A rdflib.Graph Returns: ...
[ "Function", "takes", "a", "subject", "and", "an", "existing", "graph", "returns", "a", "new", "graph", "with", "all", "predicate", "and", "objects", "of", "the", "existing", "graph", "copied", "to", "the", "new_graph", "with", "subject", "as", "the", "new", ...
train
https://github.com/jermnelson/flask-fedora-commons/blob/81cee0d8c9e79fa2bdd1a101facb9e8c0f307af4/flask_fedora_commons/__init__.py#L81-L96
<|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 takes a subject and an existing graph, returns a new graph with all predicate and objects of the existing graph 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, 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, ...
rduplain/jeni-python
jeni.py
Injector.eager_partial_regardless
def eager_partial_regardless(self, fn, *a, **kw): """Like `eager_partial`, but applies if callable is not annotated.""" if self.has_annotations(fn): return self.eager_partial(fn, *a, **kw) return functools.partial(fn, *a, **kw)
python
def eager_partial_regardless(self, fn, *a, **kw): """Like `eager_partial`, but applies if callable is not annotated.""" if self.has_annotations(fn): return self.eager_partial(fn, *a, **kw) return functools.partial(fn, *a, **kw)
[ "def", "eager_partial_regardless", "(", "self", ",", "fn", ",", "*", "a", ",", "*", "*", "kw", ")", ":", "if", "self", ".", "has_annotations", "(", "fn", ")", ":", "return", "self", ".", "eager_partial", "(", "fn", ",", "*", "a", ",", "*", "*", "...
Like `eager_partial`, but applies if callable is not annotated.
[ "Like", "eager_partial", "but", "applies", "if", "callable", "is", "not", "annotated", "." ]
train
https://github.com/rduplain/jeni-python/blob/feca12ce5e4f0438ae5d7bec59d61826063594f1/jeni.py#L594-L598
<|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 `eager_partial`, but applies if callable is not annotated. ### Response: def eager_partial_regardless(self, fn, *a, **kw)...
[ 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, ...
krukas/Trionyx
trionyx/navigation.py
TabRegister.get_tabs
def get_tabs(self, model_alias, object): """ Get all active tabs for given model :param model_alias: :param object: Object used to filter tabs :return: """ model_alias = self.get_model_alias(model_alias) for item in self.tabs[model_alias]: if ...
python
def get_tabs(self, model_alias, object): """ Get all active tabs for given model :param model_alias: :param object: Object used to filter tabs :return: """ model_alias = self.get_model_alias(model_alias) for item in self.tabs[model_alias]: if ...
[ "def", "get_tabs", "(", "self", ",", "model_alias", ",", "object", ")", ":", "model_alias", "=", "self", ".", "get_model_alias", "(", "model_alias", ")", "for", "item", "in", "self", ".", "tabs", "[", "model_alias", "]", ":", "if", "item", ".", "display_...
Get all active tabs for given model :param model_alias: :param object: Object used to filter tabs :return:
[ "Get", "all", "active", "tabs", "for", "given", "model" ]
train
https://github.com/krukas/Trionyx/blob/edac132cc0797190153f2e60bc7e88cb50e80da6/trionyx/navigation.py#L210-L221
<|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 all active tabs for given model :param model_alias: :param object: Object used to filter tabs :ret...
[ 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, ...
pantsbuild/pants
pants-plugins/src/python/internal_backend/sitegen/tasks/sitegen.py
load_soups
def load_soups(config): """Generate BeautifulSoup AST for each page listed in config.""" soups = {} for page, path in config['sources'].items(): with open(path, 'r') as orig_file: soups[page] = beautiful_soup(orig_file.read(), features='html.parser') return soups
python
def load_soups(config): """Generate BeautifulSoup AST for each page listed in config.""" soups = {} for page, path in config['sources'].items(): with open(path, 'r') as orig_file: soups[page] = beautiful_soup(orig_file.read(), features='html.parser') return soups
[ "def", "load_soups", "(", "config", ")", ":", "soups", "=", "{", "}", "for", "page", ",", "path", "in", "config", "[", "'sources'", "]", ".", "items", "(", ")", ":", "with", "open", "(", "path", ",", "'r'", ")", "as", "orig_file", ":", "soups", "...
Generate BeautifulSoup AST for each page listed in config.
[ "Generate", "BeautifulSoup", "AST", "for", "each", "page", "listed", "in", "config", "." ]
train
https://github.com/pantsbuild/pants/blob/b72e650da0df685824ffdcc71988b8c282d0962d/pants-plugins/src/python/internal_backend/sitegen/tasks/sitegen.py#L79-L85
<|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 BeautifulSoup AST for each page listed in config. ### Response: def load_soups(config): """Generate BeautifulSoup 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, 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, ...
aws/sagemaker-python-sdk
src/sagemaker/predictor.py
RealTimePredictor.delete_model
def delete_model(self): """Deletes the Amazon SageMaker models backing this predictor. """ request_failed = False failed_models = [] for model_name in self._model_names: try: self.sagemaker_session.delete_model(model_name) except Exception...
python
def delete_model(self): """Deletes the Amazon SageMaker models backing this predictor. """ request_failed = False failed_models = [] for model_name in self._model_names: try: self.sagemaker_session.delete_model(model_name) except Exception...
[ "def", "delete_model", "(", "self", ")", ":", "request_failed", "=", "False", "failed_models", "=", "[", "]", "for", "model_name", "in", "self", ".", "_model_names", ":", "try", ":", "self", ".", "sagemaker_session", ".", "delete_model", "(", "model_name", "...
Deletes the Amazon SageMaker models backing this predictor.
[ "Deletes", "the", "Amazon", "SageMaker", "models", "backing", "this", "predictor", "." ]
train
https://github.com/aws/sagemaker-python-sdk/blob/a9e724c7d3f5572b68c3903548c792a59d99799a/src/sagemaker/predictor.py#L131-L146
<|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: Deletes the Amazon SageMaker models backing this predictor. ### Response: def delete_model(self): """Deletes the Amazo...
[ 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, 62417, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 62417, ...
google/mobly
mobly/asserts.py
assert_raises
def assert_raises(expected_exception, extras=None, *args, **kwargs): """Assert that an exception is raised when a function is called. If no exception is raised, test fail. If an exception is raised but not of the expected type, the exception is let through. This should only be used as a context manage...
python
def assert_raises(expected_exception, extras=None, *args, **kwargs): """Assert that an exception is raised when a function is called. If no exception is raised, test fail. If an exception is raised but not of the expected type, the exception is let through. This should only be used as a context manage...
[ "def", "assert_raises", "(", "expected_exception", ",", "extras", "=", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "context", "=", "_AssertRaisesContext", "(", "expected_exception", ",", "extras", "=", "extras", ")", "return", "context" ]
Assert that an exception is raised when a function is called. If no exception is raised, test fail. If an exception is raised but not of the expected type, the exception is let through. This should only be used as a context manager: with assert_raises(Exception): func() Args: ...
[ "Assert", "that", "an", "exception", "is", "raised", "when", "a", "function", "is", "called", "." ]
train
https://github.com/google/mobly/blob/38ba2cf7d29a20e6a2fca1718eecb337df38db26/mobly/asserts.py#L60-L77
<|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: Assert that an exception is raised when a function is called. If no exception is raised, test fail. If an exception is rai...
[ 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, 8702, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8702, ...
titilambert/pyhydroquebec
pyhydroquebec/client.py
HydroQuebecClient._get_monthly_data
def _get_monthly_data(self, p_p_id): """Get monthly data.""" params = {"p_p_id": p_p_id, "p_p_lifecycle": 2, "p_p_resource_id": ("resourceObtenirDonnees" "PeriodesConsommation")} try: raw_res = yield from self....
python
def _get_monthly_data(self, p_p_id): """Get monthly data.""" params = {"p_p_id": p_p_id, "p_p_lifecycle": 2, "p_p_resource_id": ("resourceObtenirDonnees" "PeriodesConsommation")} try: raw_res = yield from self....
[ "def", "_get_monthly_data", "(", "self", ",", "p_p_id", ")", ":", "params", "=", "{", "\"p_p_id\"", ":", "p_p_id", ",", "\"p_p_lifecycle\"", ":", "2", ",", "\"p_p_resource_id\"", ":", "(", "\"resourceObtenirDonnees\"", "\"PeriodesConsommation\"", ")", "}", "try", ...
Get monthly data.
[ "Get", "monthly", "data", "." ]
train
https://github.com/titilambert/pyhydroquebec/blob/4ea1374a63944413889c147d91961eda0605d4fd/pyhydroquebec/client.py#L242-L262
<|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 monthly data. ### Response: def _get_monthly_data(self, p_p_id): """Get monthly data.""" params = {"p_p_id...
[ 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, ...
smarie/python-valid8
valid8/composition.py
failure_raiser
def failure_raiser(*validation_func, # type: ValidationFuncs **kwargs ): # type: (...) -> Callable """ This function is automatically used if you provide a tuple `(<function>, <msg>_or_<Failure_type>)`, to any of the methods in this page or to one of the `valid8` ...
python
def failure_raiser(*validation_func, # type: ValidationFuncs **kwargs ): # type: (...) -> Callable """ This function is automatically used if you provide a tuple `(<function>, <msg>_or_<Failure_type>)`, to any of the methods in this page or to one of the `valid8` ...
[ "def", "failure_raiser", "(", "*", "validation_func", ",", "# type: ValidationFuncs", "*", "*", "kwargs", ")", ":", "# type: (...) -> Callable", "failure_type", ",", "help_msg", "=", "pop_kwargs", "(", "kwargs", ",", "[", "(", "'failure_type'", ",", "None", ")", ...
This function is automatically used if you provide a tuple `(<function>, <msg>_or_<Failure_type>)`, to any of the methods in this page or to one of the `valid8` decorators. It transforms the provided `<function>` into a failure raiser, raising a subclass of `Failure` in case of failure (either not returning `Tr...
[ "This", "function", "is", "automatically", "used", "if", "you", "provide", "a", "tuple", "(", "<function", ">", "<msg", ">", "_or_<Failure_type", ">", ")", "to", "any", "of", "the", "methods", "in", "this", "page", "or", "to", "one", "of", "the", "valid8...
train
https://github.com/smarie/python-valid8/blob/5e15d1de11602933c5114eb9f73277ad91d97800/valid8/composition.py#L473-L498
<|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 is automatically used if you provide a tuple `(<function>, <msg>_or_<Failure_type>)`, to any of the methods 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, 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, ...
jciskey/pygraph
pygraph/functions/planarity/kocay_algorithm.py
S_star
def S_star(u, dfs_data): """The set of all descendants of u, with u added.""" s_u = S(u, dfs_data) if u not in s_u: s_u.append(u) return s_u
python
def S_star(u, dfs_data): """The set of all descendants of u, with u added.""" s_u = S(u, dfs_data) if u not in s_u: s_u.append(u) return s_u
[ "def", "S_star", "(", "u", ",", "dfs_data", ")", ":", "s_u", "=", "S", "(", "u", ",", "dfs_data", ")", "if", "u", "not", "in", "s_u", ":", "s_u", ".", "append", "(", "u", ")", "return", "s_u" ]
The set of all descendants of u, with u added.
[ "The", "set", "of", "all", "descendants", "of", "u", "with", "u", "added", "." ]
train
https://github.com/jciskey/pygraph/blob/037bb2f32503fecb60d62921f9766d54109f15e2/pygraph/functions/planarity/kocay_algorithm.py#L955-L960
<|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: The set of all descendants of u, with u added. ### Response: def S_star(u, dfs_data): """The set of all descendants of u, ...
[ 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, 791, 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, 791, 7...
psss/did
did/utils.py
listed
def listed(items, singular=None, plural=None, max=None, quote=""): """ Convert an iterable into a nice, human readable list or description:: listed(range(1)) .................... 0 listed(range(2)) .................... 0 and 1 listed(range(3), quote='"') ......... "0", "1" and "2" ...
python
def listed(items, singular=None, plural=None, max=None, quote=""): """ Convert an iterable into a nice, human readable list or description:: listed(range(1)) .................... 0 listed(range(2)) .................... 0 and 1 listed(range(3), quote='"') ......... "0", "1" and "2" ...
[ "def", "listed", "(", "items", ",", "singular", "=", "None", ",", "plural", "=", "None", ",", "max", "=", "None", ",", "quote", "=", "\"\"", ")", ":", "# Convert items to list if necessary", "items", "=", "range", "(", "items", ")", "if", "isinstance", "...
Convert an iterable into a nice, human readable list or description:: listed(range(1)) .................... 0 listed(range(2)) .................... 0 and 1 listed(range(3), quote='"') ......... "0", "1" and "2" listed(range(4), max=3) ............. 0, 1, 2 and 1 more listed(rang...
[ "Convert", "an", "iterable", "into", "a", "nice", "human", "readable", "list", "or", "description", "::" ]
train
https://github.com/psss/did/blob/04e4ee6f1aa14c0cae3ba9f9803871f3f98279cb/did/utils.py#L90-L137
<|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 iterable into a nice, human readable list or description:: listed(range(1)) .................... 0 ...
[ 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, ...
SpriteLink/NIPAP
nipap-cli/nipap_cli/nipap_cli.py
get_vrf
def get_vrf(arg = None, default_var = 'default_vrf_rt', abort = False): """ Returns VRF to work in Returns a pynipap.VRF object representing the VRF we are working in. If there is a VRF set globally, return this. If not, fetch the VRF named 'arg'. If 'arg' is None, fetch the default_vrf ...
python
def get_vrf(arg = None, default_var = 'default_vrf_rt', abort = False): """ Returns VRF to work in Returns a pynipap.VRF object representing the VRF we are working in. If there is a VRF set globally, return this. If not, fetch the VRF named 'arg'. If 'arg' is None, fetch the default_vrf ...
[ "def", "get_vrf", "(", "arg", "=", "None", ",", "default_var", "=", "'default_vrf_rt'", ",", "abort", "=", "False", ")", ":", "# yep, global variables are evil", "global", "vrf", "# if there is a VRF set, return it", "if", "vrf", "is", "not", "None", ":", "return"...
Returns VRF to work in Returns a pynipap.VRF object representing the VRF we are working in. If there is a VRF set globally, return this. If not, fetch the VRF named 'arg'. If 'arg' is None, fetch the default_vrf attribute from the config file and return this VRF.
[ "Returns", "VRF", "to", "work", "in" ]
train
https://github.com/SpriteLink/NIPAP/blob/f96069f11ab952d80b13cab06e0528f2d24b3de9/nipap-cli/nipap_cli/nipap_cli.py#L109-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: Returns VRF to work in Returns a pynipap.VRF object representing the VRF we are working in. If there is a VRF ...
[ 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, ...
BD2KGenomics/toil-scripts
src/toil_scripts/adam_kmers/count_kmers.py
download_count_upload
def download_count_upload(job, master_ip, input_file, output_file, kmer_length, spark_conf, memory, sudo): ''' Runs k-mer counting...
python
def download_count_upload(job, master_ip, input_file, output_file, kmer_length, spark_conf, memory, sudo): ''' Runs k-mer counting...
[ "def", "download_count_upload", "(", "job", ",", "master_ip", ",", "input_file", ",", "output_file", ",", "kmer_length", ",", "spark_conf", ",", "memory", ",", "sudo", ")", ":", "if", "master_ip", "is", "not", "None", ":", "hdfs_dir", "=", "\"hdfs://{0}:{1}/\"...
Runs k-mer counting. 1. If the input file is located in S3, the file is copied into HDFS. 2. If the input file is not in Parquet format, the file is converted into Parquet. 3. The k-mers are counted and saved as text. 4. If the output path is an S3 URL, the file is copied back to S3. :param job: T...
[ "Runs", "k", "-", "mer", "counting", "." ]
train
https://github.com/BD2KGenomics/toil-scripts/blob/f878d863defcdccaabb7fe06f991451b7a198fb7/src/toil_scripts/adam_kmers/count_kmers.py#L76-L172
<|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 k-mer counting. 1. If the input file is located in S3, the file is copied into HDFS. 2. If the input file is not ...
[ 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, 75020, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 75020, ...
peterldowns/python-mustache
mustache/utils.py
html_escape
def html_escape(s, encoding='utf-8', encoding_errors='strict'): """ Return the HTML-escaped version of an input. """ return escape(make_unicode(s, encoding, encoding_errors), quote=True)
python
def html_escape(s, encoding='utf-8', encoding_errors='strict'): """ Return the HTML-escaped version of an input. """ return escape(make_unicode(s, encoding, encoding_errors), quote=True)
[ "def", "html_escape", "(", "s", ",", "encoding", "=", "'utf-8'", ",", "encoding_errors", "=", "'strict'", ")", ":", "return", "escape", "(", "make_unicode", "(", "s", ",", "encoding", ",", "encoding_errors", ")", ",", "quote", "=", "True", ")" ]
Return the HTML-escaped version of an input.
[ "Return", "the", "HTML", "-", "escaped", "version", "of", "an", "input", "." ]
train
https://github.com/peterldowns/python-mustache/blob/ea3753696ea9886b6eb39cc5de27db7054adc069/mustache/utils.py#L12-L14
<|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 HTML-escaped version of an input. ### Response: def html_escape(s, encoding='utf-8', encoding_errors='strict'): ...
[ 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, ...
LeKono/pyhgnc
src/pyhgnc/manager/query.py
QueryManager._limit_and_df
def _limit_and_df(self, query, limit, as_df=False): """adds a limit (limit==None := no limit) to any query and allow a return as pandas.DataFrame :param bool as_df: if is set to True results return as pandas.DataFrame :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param i...
python
def _limit_and_df(self, query, limit, as_df=False): """adds a limit (limit==None := no limit) to any query and allow a return as pandas.DataFrame :param bool as_df: if is set to True results return as pandas.DataFrame :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param i...
[ "def", "_limit_and_df", "(", "self", ",", "query", ",", "limit", ",", "as_df", "=", "False", ")", ":", "if", "limit", ":", "if", "isinstance", "(", "limit", ",", "int", ")", ":", "query", "=", "query", ".", "limit", "(", "limit", ")", "if", "isinst...
adds a limit (limit==None := no limit) to any query and allow a return as pandas.DataFrame :param bool as_df: if is set to True results return as pandas.DataFrame :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param int,tuple limit: maximum number of results :return: quer...
[ "adds", "a", "limit", "(", "limit", "==", "None", ":", "=", "no", "limit", ")", "to", "any", "query", "and", "allow", "a", "return", "as", "pandas", ".", "DataFrame" ]
train
https://github.com/LeKono/pyhgnc/blob/1cae20c40874bfb51581b7c5c1481707e942b5d0/src/pyhgnc/manager/query.py#L14-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: adds a limit (limit==None := no limit) to any query and allow a return as pandas.DataFrame :param bool as_df: if is se...
[ 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, 74094, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 74094, ...
cltk/cltk
cltk/prosody/latin/pentameter_scanner.py
PentameterScanner.correct_penultimate_dactyl_chain
def correct_penultimate_dactyl_chain(self, scansion: str) -> str: """ For pentameter the last two feet of the verse are predictable dactyls, and do not regularly allow substitutions. :param scansion: scansion line thus far :return: corrected line of scansion >>> print(P...
python
def correct_penultimate_dactyl_chain(self, scansion: str) -> str: """ For pentameter the last two feet of the verse are predictable dactyls, and do not regularly allow substitutions. :param scansion: scansion line thus far :return: corrected line of scansion >>> print(P...
[ "def", "correct_penultimate_dactyl_chain", "(", "self", ",", "scansion", ":", "str", ")", "->", "str", ":", "mark_list", "=", "string_utils", ".", "mark_list", "(", "scansion", ")", "vals", "=", "list", "(", "scansion", ".", "replace", "(", "\" \"", ",", "...
For pentameter the last two feet of the verse are predictable dactyls, and do not regularly allow substitutions. :param scansion: scansion line thus far :return: corrected line of scansion >>> print(PentameterScanner().correct_penultimate_dactyl_chain( ... "U U U U U U U ...
[ "For", "pentameter", "the", "last", "two", "feet", "of", "the", "verse", "are", "predictable", "dactyls", "and", "do", "not", "regularly", "allow", "substitutions", "." ]
train
https://github.com/cltk/cltk/blob/ed9c025b7ec43c949481173251b70e05e4dffd27/cltk/prosody/latin/pentameter_scanner.py#L207-L226
<|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: For pentameter the last two feet of the verse are predictable dactyls, and do not regularly allow substitutions. ...
[ 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, 2520, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2520, ...
networks-lab/metaknowledge
metaknowledge/proquest/recordProQuest.py
proQuestRecordParser
def proQuestRecordParser(enRecordFile, recNum): """The parser [ProQuestRecords](../classes/ProQuestRecord.html#metaknowledge.proquest.ProQuestRecord) use. This takes an entry from [proQuestParser()](#metaknowledge.proquest.proQuestHandlers.proQuestParser) and parses it a part of the creation of a `ProQuestRecord`. ...
python
def proQuestRecordParser(enRecordFile, recNum): """The parser [ProQuestRecords](../classes/ProQuestRecord.html#metaknowledge.proquest.ProQuestRecord) use. This takes an entry from [proQuestParser()](#metaknowledge.proquest.proQuestHandlers.proQuestParser) and parses it a part of the creation of a `ProQuestRecord`. ...
[ "def", "proQuestRecordParser", "(", "enRecordFile", ",", "recNum", ")", ":", "tagDict", "=", "collections", ".", "OrderedDict", "(", ")", "currentEntry", "=", "'Name'", "while", "True", ":", "lineNum", ",", "line", "=", "next", "(", "enRecordFile", ")", "if"...
The parser [ProQuestRecords](../classes/ProQuestRecord.html#metaknowledge.proquest.ProQuestRecord) use. This takes an entry from [proQuestParser()](#metaknowledge.proquest.proQuestHandlers.proQuestParser) and parses it a part of the creation of a `ProQuestRecord`. # Parameters _enRecordFile_ : `enumerate obje...
[ "The", "parser", "[", "ProQuestRecords", "]", "(", "..", "/", "classes", "/", "ProQuestRecord", ".", "html#metaknowledge", ".", "proquest", ".", "ProQuestRecord", ")", "use", ".", "This", "takes", "an", "entry", "from", "[", "proQuestParser", "()", "]", "(",...
train
https://github.com/networks-lab/metaknowledge/blob/8162bf95e66bb6f9916081338e6e2a6132faff75/metaknowledge/proquest/recordProQuest.py#L70-L108
<|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: The parser [ProQuestRecords](../classes/ProQuestRecord.html#metaknowledge.proquest.ProQuestRecord) use. This takes an entry fro...
[ 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, 791, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 791, 6...
halcy/Mastodon.py
mastodon/Mastodon.py
Mastodon.retrieve_mastodon_version
def retrieve_mastodon_version(self): """ Determine installed mastodon version and set major, minor and patch (not including RC info) accordingly. Returns the version string, possibly including rc info. """ try: version_str = self.__instance()["version"] ...
python
def retrieve_mastodon_version(self): """ Determine installed mastodon version and set major, minor and patch (not including RC info) accordingly. Returns the version string, possibly including rc info. """ try: version_str = self.__instance()["version"] ...
[ "def", "retrieve_mastodon_version", "(", "self", ")", ":", "try", ":", "version_str", "=", "self", ".", "__instance", "(", ")", "[", "\"version\"", "]", "except", ":", "# instance() was added in 1.1.0, so our best guess is 1.0.0.", "version_str", "=", "\"1.0.0\"", "se...
Determine installed mastodon version and set major, minor and patch (not including RC info) accordingly. Returns the version string, possibly including rc info.
[ "Determine", "installed", "mastodon", "version", "and", "set", "major", "minor", "and", "patch", "(", "not", "including", "RC", "info", ")", "accordingly", ".", "Returns", "the", "version", "string", "possibly", "including", "rc", "info", "." ]
train
https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L344-L357
<|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: Determine installed mastodon version and set major, minor and patch (not including RC info) accordingly. Retur...
[ 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, 35, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 35, 25...
evhub/coconut
coconut/compiler/compiler.py
Compiler.destructuring_stmt_handle
def destructuring_stmt_handle(self, original, loc, tokens): """Process match assign blocks.""" internal_assert(len(tokens) == 2, "invalid destructuring assignment tokens", tokens) matches, item = tokens out = match_handle(loc, [matches, "in", item, None]) out += self.pattern_erro...
python
def destructuring_stmt_handle(self, original, loc, tokens): """Process match assign blocks.""" internal_assert(len(tokens) == 2, "invalid destructuring assignment tokens", tokens) matches, item = tokens out = match_handle(loc, [matches, "in", item, None]) out += self.pattern_erro...
[ "def", "destructuring_stmt_handle", "(", "self", ",", "original", ",", "loc", ",", "tokens", ")", ":", "internal_assert", "(", "len", "(", "tokens", ")", "==", "2", ",", "\"invalid destructuring assignment tokens\"", ",", "tokens", ")", "matches", ",", "item", ...
Process match assign blocks.
[ "Process", "match", "assign", "blocks", "." ]
train
https://github.com/evhub/coconut/blob/ff97177344e7604e89a0a98a977a87ed2a56fc6d/coconut/compiler/compiler.py#L1424-L1430
<|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: Process match assign blocks. ### Response: def destructuring_stmt_handle(self, original, loc, tokens): """Process matc...
[ 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, 7575, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7575, ...
taskcluster/taskcluster-client.py
taskcluster/aio/awsprovisioner.py
AwsProvisioner.createWorkerType
async def createWorkerType(self, *args, **kwargs): """ Create new Worker Type Create a worker type. A worker type contains all the configuration needed for the provisioner to manage the instances. Each worker type knows which regions and which instance types are allowed for th...
python
async def createWorkerType(self, *args, **kwargs): """ Create new Worker Type Create a worker type. A worker type contains all the configuration needed for the provisioner to manage the instances. Each worker type knows which regions and which instance types are allowed for th...
[ "async", "def", "createWorkerType", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "await", "self", ".", "_makeApiCall", "(", "self", ".", "funcinfo", "[", "\"createWorkerType\"", "]", ",", "*", "args", ",", "*", "*", "kwar...
Create new Worker Type Create a worker type. A worker type contains all the configuration needed for the provisioner to manage the instances. Each worker type knows which regions and which instance types are allowed for that worker type. Remember that Capacity is the number of concur...
[ "Create", "new", "Worker", "Type" ]
train
https://github.com/taskcluster/taskcluster-client.py/blob/bcc95217f8bf80bed2ae5885a19fa0035da7ebc9/taskcluster/aio/awsprovisioner.py#L67-L102
<|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 new Worker Type Create a worker type. A worker type contains all the configuration needed for the prov...
[ 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, ...
jorgenschaefer/elpy
elpy/server.py
ElpyRPCServer.rpc_get_names
def rpc_get_names(self, filename, source, offset): """Get all possible names """ source = get_source(source) if hasattr(self.backend, "rpc_get_names"): return self.backend.rpc_get_names(filename, source, offset) else: raise Fault("get_names not implemente...
python
def rpc_get_names(self, filename, source, offset): """Get all possible names """ source = get_source(source) if hasattr(self.backend, "rpc_get_names"): return self.backend.rpc_get_names(filename, source, offset) else: raise Fault("get_names not implemente...
[ "def", "rpc_get_names", "(", "self", ",", "filename", ",", "source", ",", "offset", ")", ":", "source", "=", "get_source", "(", "source", ")", "if", "hasattr", "(", "self", ".", "backend", ",", "\"rpc_get_names\"", ")", ":", "return", "self", ".", "backe...
Get all possible names
[ "Get", "all", "possible", "names" ]
train
https://github.com/jorgenschaefer/elpy/blob/ffd982f829b11e53f2be187c7b770423341f29bc/elpy/server.py#L199-L208
<|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 all possible names ### Response: def rpc_get_names(self, filename, source, offset): """Get all possible names ...
[ 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, ...
bartTC/django-attachments
attachments/templatetags/attachments_tags.py
attachment_form
def attachment_form(context, obj): """ Renders a "upload attachment" form. The user must own ``attachments.add_attachment permission`` to add attachments. """ if context['user'].has_perm('attachments.add_attachment'): return { 'form': AttachmentForm(), 'form_url'...
python
def attachment_form(context, obj): """ Renders a "upload attachment" form. The user must own ``attachments.add_attachment permission`` to add attachments. """ if context['user'].has_perm('attachments.add_attachment'): return { 'form': AttachmentForm(), 'form_url'...
[ "def", "attachment_form", "(", "context", ",", "obj", ")", ":", "if", "context", "[", "'user'", "]", ".", "has_perm", "(", "'attachments.add_attachment'", ")", ":", "return", "{", "'form'", ":", "AttachmentForm", "(", ")", ",", "'form_url'", ":", "add_url_fo...
Renders a "upload attachment" form. The user must own ``attachments.add_attachment permission`` to add attachments.
[ "Renders", "a", "upload", "attachment", "form", "." ]
train
https://github.com/bartTC/django-attachments/blob/012b7168f9342e07683a54ceab57696e0072962e/attachments/templatetags/attachments_tags.py#L12-L26
<|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 "upload attachment" form. The user must own ``attachments.add_attachment permission`` to add attachments. #...
[ 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...
F5Networks/f5-common-python
f5/bigip/tm/ltm/pool.py
Members.update
def update(self, **kwargs): """Call this to change the configuration of the service on the device. This method uses HTTP PUT to alter the service state on the device. The attributes of the instance will be packaged as a dictionary. That dictionary will be updated with kwargs. It is t...
python
def update(self, **kwargs): """Call this to change the configuration of the service on the device. This method uses HTTP PUT to alter the service state on the device. The attributes of the instance will be packaged as a dictionary. That dictionary will be updated with kwargs. It is t...
[ "def", "update", "(", "self", ",", "*", "*", "kwargs", ")", ":", "checked", "=", "self", ".", "_check_member_parameters", "(", "*", "*", "kwargs", ")", "return", "super", "(", "Members", ",", "self", ")", ".", "_update", "(", "*", "*", "checked", ")"...
Call this to change the configuration of the service on the device. This method uses HTTP PUT to alter the service state on the device. The attributes of the instance will be packaged as a dictionary. That dictionary will be updated with kwargs. It is then submitted as JSON to the de...
[ "Call", "this", "to", "change", "the", "configuration", "of", "the", "service", "on", "the", "device", "." ]
train
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/pool.py#L144-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: Call this to change the configuration of the service on the device. This method uses HTTP PUT to alter the service 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, 7368, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7368, ...
ethereum/py-evm
eth/estimators/gas.py
binary_gas_search
def binary_gas_search(state: BaseState, transaction: BaseTransaction, tolerance: int=1) -> int: """ Run the transaction with various gas limits, progressively approaching the minimum needed to succeed without an OutOfGas exception. The starting range of possible estimates is: [transaction.intrinsic...
python
def binary_gas_search(state: BaseState, transaction: BaseTransaction, tolerance: int=1) -> int: """ Run the transaction with various gas limits, progressively approaching the minimum needed to succeed without an OutOfGas exception. The starting range of possible estimates is: [transaction.intrinsic...
[ "def", "binary_gas_search", "(", "state", ":", "BaseState", ",", "transaction", ":", "BaseTransaction", ",", "tolerance", ":", "int", "=", "1", ")", "->", "int", ":", "if", "not", "hasattr", "(", "transaction", ",", "'sender'", ")", ":", "raise", "TypeErro...
Run the transaction with various gas limits, progressively approaching the minimum needed to succeed without an OutOfGas exception. The starting range of possible estimates is: [transaction.intrinsic_gas, state.gas_limit]. After the first OutOfGas exception, the range is: (largest_limit_out_of_gas, sta...
[ "Run", "the", "transaction", "with", "various", "gas", "limits", "progressively", "approaching", "the", "minimum", "needed", "to", "succeed", "without", "an", "OutOfGas", "exception", "." ]
train
https://github.com/ethereum/py-evm/blob/58346848f076116381d3274bbcea96b9e2cfcbdf/eth/estimators/gas.py#L28-L78
<|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 transaction with various gas limits, progressively approaching the minimum needed to succeed without an OutOfGas ex...
[ 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, ...
SatelliteQE/nailgun
nailgun/entities.py
ContentViewPuppetModule.read
def read(self, entity=None, attrs=None, ignore=None, params=None): """Provide a default value for ``entity``. By default, ``nailgun.entity_mixins.EntityReadMixin.read provides a default value for ``entity`` like so:: entity = type(self)() However, :class:`ContentViewPuppet...
python
def read(self, entity=None, attrs=None, ignore=None, params=None): """Provide a default value for ``entity``. By default, ``nailgun.entity_mixins.EntityReadMixin.read provides a default value for ``entity`` like so:: entity = type(self)() However, :class:`ContentViewPuppet...
[ "def", "read", "(", "self", ",", "entity", "=", "None", ",", "attrs", "=", "None", ",", "ignore", "=", "None", ",", "params", "=", "None", ")", ":", "# read() should not change the state of the object it's called on, but", "# super() alters the attributes of any entity ...
Provide a default value for ``entity``. By default, ``nailgun.entity_mixins.EntityReadMixin.read provides a default value for ``entity`` like so:: entity = type(self)() However, :class:`ContentViewPuppetModule` requires that an ``content_view`` be provided, so this techniq...
[ "Provide", "a", "default", "value", "for", "entity", "." ]
train
https://github.com/SatelliteQE/nailgun/blob/c36d8c20862e87bf6975bd48ac1ca40a9e634eaa/nailgun/entities.py#L2453-L2480
<|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: Provide a default value for ``entity``. By default, ``nailgun.entity_mixins.EntityReadMixin.read provides a de...
[ 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, 61524, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 61524, ...
taskcluster/json-e
jsone/prattparser.py
ParseContext.attempt
def attempt(self, *kinds): """Try to get the next token if it matches one of the kinds given, otherwise returning None. If no kinds are given, any kind is accepted.""" if self._error: raise self._error token = self.next_token if not token: return N...
python
def attempt(self, *kinds): """Try to get the next token if it matches one of the kinds given, otherwise returning None. If no kinds are given, any kind is accepted.""" if self._error: raise self._error token = self.next_token if not token: return N...
[ "def", "attempt", "(", "self", ",", "*", "kinds", ")", ":", "if", "self", ".", "_error", ":", "raise", "self", ".", "_error", "token", "=", "self", ".", "next_token", "if", "not", "token", ":", "return", "None", "if", "kinds", "and", "token", ".", ...
Try to get the next token if it matches one of the kinds given, otherwise returning None. If no kinds are given, any kind is accepted.
[ "Try", "to", "get", "the", "next", "token", "if", "it", "matches", "one", "of", "the", "kinds", "given", "otherwise", "returning", "None", ".", "If", "no", "kinds", "are", "given", "any", "kind", "is", "accepted", "." ]
train
https://github.com/taskcluster/json-e/blob/ac0c9fba1de3ed619f05a64dae929f6687789cbc/jsone/prattparser.py#L150-L162
<|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: Try to get the next token if it matches one of the kinds given, otherwise returning None. If no kinds are given, any ki...
[ 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, 22170, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 22170, ...
markovmodel/PyEMMA
pyemma/plots/plots2d.py
plot_contour
def plot_contour( xall, yall, zall, ax=None, cmap=None, ncontours=100, vmin=None, vmax=None, levels=None, cbar=True, cax=None, cbar_label=None, cbar_orientation='vertical', norm=None, nbins=100, method='nearest', mask=False, **kwargs): """Plot a two-dimensional contour map by...
python
def plot_contour( xall, yall, zall, ax=None, cmap=None, ncontours=100, vmin=None, vmax=None, levels=None, cbar=True, cax=None, cbar_label=None, cbar_orientation='vertical', norm=None, nbins=100, method='nearest', mask=False, **kwargs): """Plot a two-dimensional contour map by...
[ "def", "plot_contour", "(", "xall", ",", "yall", ",", "zall", ",", "ax", "=", "None", ",", "cmap", "=", "None", ",", "ncontours", "=", "100", ",", "vmin", "=", "None", ",", "vmax", "=", "None", ",", "levels", "=", "None", ",", "cbar", "=", "True"...
Plot a two-dimensional contour map by interpolating scattered data on a grid. Parameters ---------- xall : ndarray(T) Sample x-coordinates. yall : ndarray(T) Sample y-coordinates. zall : ndarray(T) Sample z-coordinates. ax : matplotlib.Axes object, optional, default=...
[ "Plot", "a", "two", "-", "dimensional", "contour", "map", "by", "interpolating", "scattered", "data", "on", "a", "grid", "." ]
train
https://github.com/markovmodel/PyEMMA/blob/5c3124398217de05ba5ce9c8fb01519222481ab8/pyemma/plots/plots2d.py#L686-L815
<|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 two-dimensional contour map by interpolating scattered data on a grid. Parameters ---------- xall : nda...
[ 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, ...
Jaymon/prom
prom/query.py
CacheNamespace.ttl
def ttl(self): """how long you should cache results for cacheable queries""" ret = 3600 cn = self.get_process() if "ttl" in cn: ret = cn["ttl"] return ret
python
def ttl(self): """how long you should cache results for cacheable queries""" ret = 3600 cn = self.get_process() if "ttl" in cn: ret = cn["ttl"] return ret
[ "def", "ttl", "(", "self", ")", ":", "ret", "=", "3600", "cn", "=", "self", ".", "get_process", "(", ")", "if", "\"ttl\"", "in", "cn", ":", "ret", "=", "cn", "[", "\"ttl\"", "]", "return", "ret" ]
how long you should cache results for cacheable queries
[ "how", "long", "you", "should", "cache", "results", "for", "cacheable", "queries" ]
train
https://github.com/Jaymon/prom/blob/b7ad2c259eca198da03e1e4bc7d95014c168c361/prom/query.py#L1440-L1446
<|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: how long you should cache results for cacheable queries ### Response: def ttl(self): """how long you should cache resu...
[ 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, 5269, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5269, ...
INM-6/hybridLFPy
hybridLFPy/gdf.py
GDF.create
def create(self, re='brunel-py-ex-*.gdf', index=True): """ Create db from list of gdf file glob Parameters ---------- re : str File glob to load. index : bool Create index on neurons for speed. Returns ...
python
def create(self, re='brunel-py-ex-*.gdf', index=True): """ Create db from list of gdf file glob Parameters ---------- re : str File glob to load. index : bool Create index on neurons for speed. Returns ...
[ "def", "create", "(", "self", ",", "re", "=", "'brunel-py-ex-*.gdf'", ",", "index", "=", "True", ")", ":", "self", ".", "cursor", ".", "execute", "(", "'CREATE TABLE IF NOT EXISTS spikes (neuron INT UNSIGNED, time REAL)'", ")", "tic", "=", "now", "(", ")", "for"...
Create db from list of gdf file glob Parameters ---------- re : str File glob to load. index : bool Create index on neurons for speed. Returns ------- None See also -------- ...
[ "Create", "db", "from", "list", "of", "gdf", "file", "glob" ]
train
https://github.com/INM-6/hybridLFPy/blob/c38bdf38982c4624c2f70caeb50c40f1d5980abd/hybridLFPy/gdf.py#L133-L178
<|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 db from list of gdf file glob Parameters ---------- re : str File glob to load. ...
[ 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, ...
Esri/ArcREST
src/arcrest/ags/layer.py
FeatureLayer_Depricated._chunks
def _chunks(self, l, n): """ Yield n successive chunks from a list l. """ l.sort() newn = int(1.0 * len(l) / n + 0.5) for i in range(0, n-1): yield l[i*newn:i*newn+newn] yield l[n*newn-newn:]
python
def _chunks(self, l, n): """ Yield n successive chunks from a list l. """ l.sort() newn = int(1.0 * len(l) / n + 0.5) for i in range(0, n-1): yield l[i*newn:i*newn+newn] yield l[n*newn-newn:]
[ "def", "_chunks", "(", "self", ",", "l", ",", "n", ")", ":", "l", ".", "sort", "(", ")", "newn", "=", "int", "(", "1.0", "*", "len", "(", "l", ")", "/", "n", "+", "0.5", ")", "for", "i", "in", "range", "(", "0", ",", "n", "-", "1", ")",...
Yield n successive chunks from a list l.
[ "Yield", "n", "successive", "chunks", "from", "a", "list", "l", "." ]
train
https://github.com/Esri/ArcREST/blob/ab240fde2b0200f61d4a5f6df033516e53f2f416/src/arcrest/ags/layer.py#L512-L519
<|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: Yield n successive chunks from a list l. ### Response: def _chunks(self, l, n): """ Yield n successive chunks from a 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, 56, 82...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 56, 82...
cs50/python-cs50
src/cs50/cs50.py
eprint
def eprint(*args, **kwargs): """ Print an error message to standard error, prefixing it with file name and line number from which method was called. """ end = kwargs.get("end", "\n") sep = kwargs.get("sep", " ") (filename, lineno) = inspect.stack()[1][1:3] print("{}:{}: ".format(filename...
python
def eprint(*args, **kwargs): """ Print an error message to standard error, prefixing it with file name and line number from which method was called. """ end = kwargs.get("end", "\n") sep = kwargs.get("sep", " ") (filename, lineno) = inspect.stack()[1][1:3] print("{}:{}: ".format(filename...
[ "def", "eprint", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "end", "=", "kwargs", ".", "get", "(", "\"end\"", ",", "\"\\n\"", ")", "sep", "=", "kwargs", ".", "get", "(", "\"sep\"", ",", "\" \"", ")", "(", "filename", ",", "lineno", ")",...
Print an error message to standard error, prefixing it with file name and line number from which method was called.
[ "Print", "an", "error", "message", "to", "standard", "error", "prefixing", "it", "with", "file", "name", "and", "line", "number", "from", "which", "method", "was", "called", "." ]
train
https://github.com/cs50/python-cs50/blob/f987e9036bcf1bf60adf50a2827cc2cd5b9fd08a/src/cs50/cs50.py#L35-L44
<|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: Print an error message to standard error, prefixing it with file name and line number from which method was called. ### 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, 9171, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9171, ...
pandas-dev/pandas
pandas/core/generic.py
NDFrame._reindex_axes
def _reindex_axes(self, axes, level, limit, tolerance, method, fill_value, copy): """Perform the reindex for all the axes.""" obj = self for a in self._AXIS_ORDERS: labels = axes[a] if labels is None: continue ax = self._...
python
def _reindex_axes(self, axes, level, limit, tolerance, method, fill_value, copy): """Perform the reindex for all the axes.""" obj = self for a in self._AXIS_ORDERS: labels = axes[a] if labels is None: continue ax = self._...
[ "def", "_reindex_axes", "(", "self", ",", "axes", ",", "level", ",", "limit", ",", "tolerance", ",", "method", ",", "fill_value", ",", "copy", ")", ":", "obj", "=", "self", "for", "a", "in", "self", ".", "_AXIS_ORDERS", ":", "labels", "=", "axes", "[...
Perform the reindex for all the axes.
[ "Perform", "the", "reindex", "for", "all", "the", "axes", "." ]
train
https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/generic.py#L4393-L4411
<|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 the reindex for all the axes. ### Response: def _reindex_axes(self, axes, level, limit, tolerance, method, fill_value,...
[ 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, ...
olt/corsa
corsa/app.py
parse_bind_address
def parse_bind_address(address, default=('localhost', 8080)): """ >>> parse_bind_address('80') ('localhost', 80) >>> parse_bind_address('0.0.0.0') ('0.0.0.0', 8080) >>> parse_bind_address('0.0.0.0:8081') ('0.0.0.0', 8081) """ if ':' in address: host, port = address.split(':',...
python
def parse_bind_address(address, default=('localhost', 8080)): """ >>> parse_bind_address('80') ('localhost', 80) >>> parse_bind_address('0.0.0.0') ('0.0.0.0', 8080) >>> parse_bind_address('0.0.0.0:8081') ('0.0.0.0', 8081) """ if ':' in address: host, port = address.split(':',...
[ "def", "parse_bind_address", "(", "address", ",", "default", "=", "(", "'localhost'", ",", "8080", ")", ")", ":", "if", "':'", "in", "address", ":", "host", ",", "port", "=", "address", ".", "split", "(", "':'", ",", "1", ")", "port", "=", "int", "...
>>> parse_bind_address('80') ('localhost', 80) >>> parse_bind_address('0.0.0.0') ('0.0.0.0', 8080) >>> parse_bind_address('0.0.0.0:8081') ('0.0.0.0', 8081)
[ ">>>", "parse_bind_address", "(", "80", ")", "(", "localhost", "80", ")", ">>>", "parse_bind_address", "(", "0", ".", "0", ".", "0", ".", "0", ")", "(", "0", ".", "0", ".", "0", ".", "0", "8080", ")", ">>>", "parse_bind_address", "(", "0", ".", "...
train
https://github.com/olt/corsa/blob/05de0a95b14d7c07fd61109ba786474a8acca74d/corsa/app.py#L31-L49
<|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_bind_address('80') ('localhost', 80) >>> parse_bind_address('0.0.0.0') ('0.0.0.0', 8080) >>> parse_bi...
[ 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, 20761, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 20761, ...
a1ezzz/wasp-general
wasp_general/task/thread_tracker.py
WSimpleTrackerStorage.register_start
def register_start(self, task, event_details=None): """ :meth:`.WSimpleTrackerStorage.register_start` method implementation """ if self.record_start() is True: record_type = WTrackerEvents.start record = WSimpleTrackerStorage.Record(record_type, task, event_details=event_details) self.__store_record(reco...
python
def register_start(self, task, event_details=None): """ :meth:`.WSimpleTrackerStorage.register_start` method implementation """ if self.record_start() is True: record_type = WTrackerEvents.start record = WSimpleTrackerStorage.Record(record_type, task, event_details=event_details) self.__store_record(reco...
[ "def", "register_start", "(", "self", ",", "task", ",", "event_details", "=", "None", ")", ":", "if", "self", ".", "record_start", "(", ")", "is", "True", ":", "record_type", "=", "WTrackerEvents", ".", "start", "record", "=", "WSimpleTrackerStorage", ".", ...
:meth:`.WSimpleTrackerStorage.register_start` method implementation
[ ":", "meth", ":", ".", "WSimpleTrackerStorage", ".", "register_start", "method", "implementation" ]
train
https://github.com/a1ezzz/wasp-general/blob/1029839d33eb663f8dec76c1c46754d53c1de4a9/wasp_general/task/thread_tracker.py#L406-L412
<|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: :meth:`.WSimpleTrackerStorage.register_start` method implementation ### Response: def register_start(self, task, event_details...
[ 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, 31386, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 31386, ...
ryanmcgrath/twython
twython/streaming/types.py
TwythonStreamerTypes.site
def site(self, **params): """Stream site Accepted params found at: https://dev.twitter.com/docs/api/1.1/get/site """ url = 'https://sitestream.twitter.com/%s/site.json' \ % self.streamer.api_version self.streamer._request(url, params=params)
python
def site(self, **params): """Stream site Accepted params found at: https://dev.twitter.com/docs/api/1.1/get/site """ url = 'https://sitestream.twitter.com/%s/site.json' \ % self.streamer.api_version self.streamer._request(url, params=params)
[ "def", "site", "(", "self", ",", "*", "*", "params", ")", ":", "url", "=", "'https://sitestream.twitter.com/%s/site.json'", "%", "self", ".", "streamer", ".", "api_version", "self", ".", "streamer", ".", "_request", "(", "url", ",", "params", "=", "params", ...
Stream site Accepted params found at: https://dev.twitter.com/docs/api/1.1/get/site
[ "Stream", "site" ]
train
https://github.com/ryanmcgrath/twython/blob/7366de80efcbbdfaf615d3f1fea72546196916fc/twython/streaming/types.py#L33-L41
<|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: Stream site Accepted params found at: https://dev.twitter.com/docs/api/1.1/get/site ### Response: def site(se...
[ 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, 3103, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3103, ...
brocade/pynos
pynos/versions/ver_7/ver_7_1_0/yang/brocade_firmware.py
brocade_firmware.logical_chassis_fwdl_sanity_output_cluster_output_rbridge_id
def logical_chassis_fwdl_sanity_output_cluster_output_rbridge_id(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") logical_chassis_fwdl_sanity = ET.Element("logical_chassis_fwdl_sanity") config = logical_chassis_fwdl_sanity output = ET.SubElement(l...
python
def logical_chassis_fwdl_sanity_output_cluster_output_rbridge_id(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") logical_chassis_fwdl_sanity = ET.Element("logical_chassis_fwdl_sanity") config = logical_chassis_fwdl_sanity output = ET.SubElement(l...
[ "def", "logical_chassis_fwdl_sanity_output_cluster_output_rbridge_id", "(", "self", ",", "*", "*", "kwargs", ")", ":", "config", "=", "ET", ".", "Element", "(", "\"config\"", ")", "logical_chassis_fwdl_sanity", "=", "ET", ".", "Element", "(", "\"logical_chassis_fwdl_s...
Auto Generated Code
[ "Auto", "Generated", "Code" ]
train
https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_firmware.py#L785-L797
<|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: Auto Generated Code ### Response: def logical_chassis_fwdl_sanity_output_cluster_output_rbridge_id(self, **kwargs): ""...
[ 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, 13556, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13556, ...
eyurtsev/FlowCytometryTools
FlowCytometryTools/gui/fc_widget.py
BaseVertex.update_coordinates
def update_coordinates(self, new_coordinates): """ new_coordinates : dict """ for k, v in new_coordinates.items(): if k in self.coordinates: self.coordinates[k] = v for svertex in self.spawn_list: verts = tuple([self.coordinates.get(ch, No...
python
def update_coordinates(self, new_coordinates): """ new_coordinates : dict """ for k, v in new_coordinates.items(): if k in self.coordinates: self.coordinates[k] = v for svertex in self.spawn_list: verts = tuple([self.coordinates.get(ch, No...
[ "def", "update_coordinates", "(", "self", ",", "new_coordinates", ")", ":", "for", "k", ",", "v", "in", "new_coordinates", ".", "items", "(", ")", ":", "if", "k", "in", "self", ".", "coordinates", ":", "self", ".", "coordinates", "[", "k", "]", "=", ...
new_coordinates : dict
[ "new_coordinates", ":", "dict" ]
train
https://github.com/eyurtsev/FlowCytometryTools/blob/4355632508b875273d68c7e2972c17668bcf7b40/FlowCytometryTools/gui/fc_widget.py#L150-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: new_coordinates : dict ### Response: def update_coordinates(self, new_coordinates): """ new_coordinates : dict...
[ 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, 943, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 943, 5...
dropbox/stone
stone/ir/api.py
ApiNamespace.get_namespaces_imported_by_route_io
def get_namespaces_imported_by_route_io(self): # type: () -> typing.List[ApiNamespace] """ Returns a list of Namespace objects. A namespace is a member of this list if it is imported by the current namespace and has a data type from it referenced as an argument, result, or error ...
python
def get_namespaces_imported_by_route_io(self): # type: () -> typing.List[ApiNamespace] """ Returns a list of Namespace objects. A namespace is a member of this list if it is imported by the current namespace and has a data type from it referenced as an argument, result, or error ...
[ "def", "get_namespaces_imported_by_route_io", "(", "self", ")", ":", "# type: () -> typing.List[ApiNamespace]", "namespace_data_types", "=", "sorted", "(", "self", ".", "get_route_io_data_types", "(", ")", ",", "key", "=", "lambda", "dt", ":", "dt", ".", "name", ")"...
Returns a list of Namespace objects. A namespace is a member of this list if it is imported by the current namespace and has a data type from it referenced as an argument, result, or error of a route. Namespaces are in ASCII order by name.
[ "Returns", "a", "list", "of", "Namespace", "objects", ".", "A", "namespace", "is", "a", "member", "of", "this", "list", "if", "it", "is", "imported", "by", "the", "current", "namespace", "and", "has", "a", "data", "type", "from", "it", "referenced", "as"...
train
https://github.com/dropbox/stone/blob/2e95cbcd1c48e05cca68c919fd8d24adec6b0f58/stone/ir/api.py#L323-L337
<|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 list of Namespace objects. A namespace is a member of this list if it is imported by the current namespace 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, 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, ...
vmalloc/dessert
dessert/rewrite.py
_read_pyc
def _read_pyc(source, pyc): """Possibly read a pytest pyc containing rewritten code. Return rewritten code if successful or None if not. """ try: fp = open(pyc, "rb") except IOError: return None try: try: mtime = int(os.stat(source).st_mtime) data...
python
def _read_pyc(source, pyc): """Possibly read a pytest pyc containing rewritten code. Return rewritten code if successful or None if not. """ try: fp = open(pyc, "rb") except IOError: return None try: try: mtime = int(os.stat(source).st_mtime) data...
[ "def", "_read_pyc", "(", "source", ",", "pyc", ")", ":", "try", ":", "fp", "=", "open", "(", "pyc", ",", "\"rb\"", ")", "except", "IOError", ":", "return", "None", "try", ":", "try", ":", "mtime", "=", "int", "(", "os", ".", "stat", "(", "source"...
Possibly read a pytest pyc containing rewritten code. Return rewritten code if successful or None if not.
[ "Possibly", "read", "a", "pytest", "pyc", "containing", "rewritten", "code", "." ]
train
https://github.com/vmalloc/dessert/blob/fa86b39da4853f2c35f0686942db777c7cc57728/dessert/rewrite.py#L338-L363
<|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: Possibly read a pytest pyc containing rewritten code. Return rewritten code if successful or None if not. ### Response: 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, 83729, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 83729, ...
infothrill/python-launchd
launchd/plist.py
write
def write(label, plist, scope=USER): ''' Writes the given property list to the appropriate file on disk and returns the absolute filename. :param plist: dict :param label: string :param scope: oneOf(USER, USER_ADMIN, DAEMON_ADMIN, USER_OS, DAEMON_OS) ''' fname = compute_filename(label, ...
python
def write(label, plist, scope=USER): ''' Writes the given property list to the appropriate file on disk and returns the absolute filename. :param plist: dict :param label: string :param scope: oneOf(USER, USER_ADMIN, DAEMON_ADMIN, USER_OS, DAEMON_OS) ''' fname = compute_filename(label, ...
[ "def", "write", "(", "label", ",", "plist", ",", "scope", "=", "USER", ")", ":", "fname", "=", "compute_filename", "(", "label", ",", "scope", ")", "with", "open", "(", "fname", ",", "\"wb\"", ")", "as", "f", ":", "plistlib", ".", "writePlist", "(", ...
Writes the given property list to the appropriate file on disk and returns the absolute filename. :param plist: dict :param label: string :param scope: oneOf(USER, USER_ADMIN, DAEMON_ADMIN, USER_OS, DAEMON_OS)
[ "Writes", "the", "given", "property", "list", "to", "the", "appropriate", "file", "on", "disk", "and", "returns", "the", "absolute", "filename", "." ]
train
https://github.com/infothrill/python-launchd/blob/2cd50579e808851b116f5a26f9b871a32b65ce0e/launchd/plist.py#L49-L61
<|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: Writes the given property list to the appropriate file on disk and returns the absolute filename. :param plist: dict ...
[ 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, 94738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 94738, ...
pymc-devs/pymc
pymc/Matplot.py
autocorrelation
def autocorrelation( data, name, maxlags=100, format='png', reflected=False, suffix='-acf', path='./', fontmap=None, new=True, last=True, rows=1, columns=1, num=1, verbose=1): """ Generate bar plot of the autocorrelation function for a series (usually an MCMC trace). :Arguments: data: P...
python
def autocorrelation( data, name, maxlags=100, format='png', reflected=False, suffix='-acf', path='./', fontmap=None, new=True, last=True, rows=1, columns=1, num=1, verbose=1): """ Generate bar plot of the autocorrelation function for a series (usually an MCMC trace). :Arguments: data: P...
[ "def", "autocorrelation", "(", "data", ",", "name", ",", "maxlags", "=", "100", ",", "format", "=", "'png'", ",", "reflected", "=", "False", ",", "suffix", "=", "'-acf'", ",", "path", "=", "'./'", ",", "fontmap", "=", "None", ",", "new", "=", "True",...
Generate bar plot of the autocorrelation function for a series (usually an MCMC trace). :Arguments: data: PyMC object, trace or array A trace from an MCMC sample or a PyMC object with one or more traces. name: string The name of the object. maxlags (optional): int ...
[ "Generate", "bar", "plot", "of", "the", "autocorrelation", "function", "for", "a", "series", "(", "usually", "an", "MCMC", "trace", ")", "." ]
train
https://github.com/pymc-devs/pymc/blob/c6e530210bff4c0d7189b35b2c971bc53f93f7cd/pymc/Matplot.py#L899-L997
<|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 bar plot of the autocorrelation function for a series (usually an MCMC trace). :Arguments: data: PyMC obj...
[ 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, ...
specialunderwear/django-easymode
easymode/tree/xml/serializers.py
RecursiveXmlSerializer.serialize
def serialize(self, queryset, **options): """ Serialize a queryset. THE OUTPUT OF THIS SERIALIZER IS NOT MEANT TO BE SERIALIZED BACK INTO THE DB. """ self.options = options self.stream = options.get("stream", StringIO()) self.selected_fields = opt...
python
def serialize(self, queryset, **options): """ Serialize a queryset. THE OUTPUT OF THIS SERIALIZER IS NOT MEANT TO BE SERIALIZED BACK INTO THE DB. """ self.options = options self.stream = options.get("stream", StringIO()) self.selected_fields = opt...
[ "def", "serialize", "(", "self", ",", "queryset", ",", "*", "*", "options", ")", ":", "self", ".", "options", "=", "options", "self", ".", "stream", "=", "options", ".", "get", "(", "\"stream\"", ",", "StringIO", "(", ")", ")", "self", ".", "selected...
Serialize a queryset. THE OUTPUT OF THIS SERIALIZER IS NOT MEANT TO BE SERIALIZED BACK INTO THE DB.
[ "Serialize", "a", "queryset", ".", "THE", "OUTPUT", "OF", "THIS", "SERIALIZER", "IS", "NOT", "MEANT", "TO", "BE", "SERIALIZED", "BACK", "INTO", "THE", "DB", "." ]
train
https://github.com/specialunderwear/django-easymode/blob/92f674b91fb8c54d6e379e2664e2000872d9c95e/easymode/tree/xml/serializers.py#L44-L67
<|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: Serialize a queryset. THE OUTPUT OF THIS SERIALIZER IS NOT MEANT TO BE SERIALIZED BACK INTO THE DB. ### Respon...
[ 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, 16055, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16055, ...
MacHu-GWU/angora-project
angora/text/strtemplate.py
StrTemplate.indented_show
def indented_show(text, howmany=1): """Print a formatted indented text. """ print(StrTemplate.pad_indent(text=text, howmany=howmany))
python
def indented_show(text, howmany=1): """Print a formatted indented text. """ print(StrTemplate.pad_indent(text=text, howmany=howmany))
[ "def", "indented_show", "(", "text", ",", "howmany", "=", "1", ")", ":", "print", "(", "StrTemplate", ".", "pad_indent", "(", "text", "=", "text", ",", "howmany", "=", "howmany", ")", ")" ]
Print a formatted indented text.
[ "Print", "a", "formatted", "indented", "text", "." ]
train
https://github.com/MacHu-GWU/angora-project/blob/689a60da51cd88680ddbe26e28dbe81e6b01d275/angora/text/strtemplate.py#L60-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: Print a formatted indented text. ### Response: def indented_show(text, howmany=1): """Print a formatted indented text....
[ 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, 9171, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9171, ...
houtianze/bypy
bypy/requester.py
UrllibRequester.request
def request(cls, method, url, **kwargs): """ :type method: str """ methodupper = method.upper() hasdata = 'data' in kwargs if methodupper == 'GET': if hasdata: print("ERROR: Can't do HTTP GET when the 'data' parameter presents") assert False resp = ulr.urlopen(url, **kwargs) elif methodupper...
python
def request(cls, method, url, **kwargs): """ :type method: str """ methodupper = method.upper() hasdata = 'data' in kwargs if methodupper == 'GET': if hasdata: print("ERROR: Can't do HTTP GET when the 'data' parameter presents") assert False resp = ulr.urlopen(url, **kwargs) elif methodupper...
[ "def", "request", "(", "cls", ",", "method", ",", "url", ",", "*", "*", "kwargs", ")", ":", "methodupper", "=", "method", ".", "upper", "(", ")", "hasdata", "=", "'data'", "in", "kwargs", "if", "methodupper", "==", "'GET'", ":", "if", "hasdata", ":",...
:type method: str
[ ":", "type", "method", ":", "str" ]
train
https://github.com/houtianze/bypy/blob/c59b6183e2fca45f11138bbcdec6247449b2eaad/bypy/requester.py#L61-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: :type method: str ### Response: def request(cls, method, url, **kwargs): """ :type method: str """ methodupper = metho...
[ 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, 47545, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 47545, ...
Phylliade/ikpy
contrib/transformations.py
pose_to_list
def pose_to_list(pose): """ Convert a Pose or PoseStamped in Python list ((position), (quaternion)) :param pose: geometry_msgs.msg.PoseStamped or geometry_msgs.msg.Pose :return: the equivalent in list ((position), (quaternion)) """ if type(pose) == geometry_msgs.msg.PoseStamped: return [...
python
def pose_to_list(pose): """ Convert a Pose or PoseStamped in Python list ((position), (quaternion)) :param pose: geometry_msgs.msg.PoseStamped or geometry_msgs.msg.Pose :return: the equivalent in list ((position), (quaternion)) """ if type(pose) == geometry_msgs.msg.PoseStamped: return [...
[ "def", "pose_to_list", "(", "pose", ")", ":", "if", "type", "(", "pose", ")", "==", "geometry_msgs", ".", "msg", ".", "PoseStamped", ":", "return", "[", "[", "pose", ".", "pose", ".", "position", ".", "x", ",", "pose", ".", "pose", ".", "position", ...
Convert a Pose or PoseStamped in Python list ((position), (quaternion)) :param pose: geometry_msgs.msg.PoseStamped or geometry_msgs.msg.Pose :return: the equivalent in list ((position), (quaternion))
[ "Convert", "a", "Pose", "or", "PoseStamped", "in", "Python", "list", "((", "position", ")", "(", "quaternion", "))", ":", "param", "pose", ":", "geometry_msgs", ".", "msg", ".", "PoseStamped", "or", "geometry_msgs", ".", "msg", ".", "Pose", ":", "return", ...
train
https://github.com/Phylliade/ikpy/blob/60e36d6163136942bf520d952db17123c658d0b6/contrib/transformations.py#L48-L68
<|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 Pose or PoseStamped in Python list ((position), (quaternion)) :param pose: geometry_msgs.msg.PoseStamped or geome...
[ 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, ...
fmfn/BayesianOptimization
bayes_opt/bayesian_optimization.py
BayesianOptimization.suggest
def suggest(self, utility_function): """Most promissing point to probe next""" if len(self._space) == 0: return self._space.array_to_params(self._space.random_sample()) # Sklearn's GP throws a large number of warnings at times, but # we don't really need to see them here. ...
python
def suggest(self, utility_function): """Most promissing point to probe next""" if len(self._space) == 0: return self._space.array_to_params(self._space.random_sample()) # Sklearn's GP throws a large number of warnings at times, but # we don't really need to see them here. ...
[ "def", "suggest", "(", "self", ",", "utility_function", ")", ":", "if", "len", "(", "self", ".", "_space", ")", "==", "0", ":", "return", "self", ".", "_space", ".", "array_to_params", "(", "self", ".", "_space", ".", "random_sample", "(", ")", ")", ...
Most promissing point to probe next
[ "Most", "promissing", "point", "to", "probe", "next" ]
train
https://github.com/fmfn/BayesianOptimization/blob/8ce2292895137477963cf1bafa4e71fa20b2ce49/bayes_opt/bayesian_optimization.py#L115-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: Most promissing point to probe next ### Response: def suggest(self, utility_function): """Most promissing point to pro...
[ 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, 13622, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13622, ...