nwo
stringlengths
5
106
sha
stringlengths
40
40
path
stringlengths
4
174
language
stringclasses
1 value
identifier
stringlengths
1
140
parameters
stringlengths
0
87.7k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
426k
docstring
stringlengths
0
64.3k
docstring_summary
stringlengths
0
26.3k
docstring_tokens
list
function
stringlengths
18
4.83M
function_tokens
list
url
stringlengths
83
304
CheckPointSW/Karta
b845928487b50a5b41acd532ae0399177a4356aa
src/thumbs_up/analyzers/mips.py
python
MipsAnalyzer.codeTypes
(self)
return 0, 1
Return a tuple of the CPU supported code types. Return Value: collection of supported code types
Return a tuple of the CPU supported code types.
[ "Return", "a", "tuple", "of", "the", "CPU", "supported", "code", "types", "." ]
def codeTypes(self): """Return a tuple of the CPU supported code types. Return Value: collection of supported code types """ return 0, 1
[ "def", "codeTypes", "(", "self", ")", ":", "return", "0", ",", "1" ]
https://github.com/CheckPointSW/Karta/blob/b845928487b50a5b41acd532ae0399177a4356aa/src/thumbs_up/analyzers/mips.py#L165-L171
jazzband/tablib
94ffe67e50eb5bfd99d73a4f010e463478a98928
src/tablib/core.py
python
Dataset._get_headers
(self)
return self.__headers
An *optional* list of strings to be used for header rows and attribute names. This must be set manually. The given list length must equal :attr:`Dataset.width`.
An *optional* list of strings to be used for header rows and attribute names.
[ "An", "*", "optional", "*", "list", "of", "strings", "to", "be", "used", "for", "header", "rows", "and", "attribute", "names", "." ]
def _get_headers(self): """An *optional* list of strings to be used for header rows and attribute names. This must be set manually. The given list length must equal :attr:`Dataset.width`. """ return self.__headers
[ "def", "_get_headers", "(", "self", ")", ":", "return", "self", ".", "__headers" ]
https://github.com/jazzband/tablib/blob/94ffe67e50eb5bfd99d73a4f010e463478a98928/src/tablib/core.py#L291-L297
uqfoundation/multiprocess
028cc73f02655e6451d92e5147d19d8c10aebe50
py3.2/multiprocess/forking.py
python
prepare
(data)
Try to get current process ready to unpickle process object
Try to get current process ready to unpickle process object
[ "Try", "to", "get", "current", "process", "ready", "to", "unpickle", "process", "object" ]
def prepare(data): ''' Try to get current process ready to unpickle process object ''' old_main_modules.append(sys.modules['__main__']) if 'name' in data: process.current_process().name = data['name'] if 'authkey' in data: process.current_process()._authkey = data['authkey'] ...
[ "def", "prepare", "(", "data", ")", ":", "old_main_modules", ".", "append", "(", "sys", ".", "modules", "[", "'__main__'", "]", ")", "if", "'name'", "in", "data", ":", "process", ".", "current_process", "(", ")", ".", "name", "=", "data", "[", "'name'"...
https://github.com/uqfoundation/multiprocess/blob/028cc73f02655e6451d92e5147d19d8c10aebe50/py3.2/multiprocess/forking.py#L449-L527
facebookresearch/SlowFast
39ef35c9a086443209b458cceaec86a02e27b369
slowfast/utils/ava_evaluation/label_map_util.py
python
create_category_index_from_labelmap
(label_map_path)
return create_category_index(categories)
Reads a label map and returns a category index. Args: label_map_path: Path to `StringIntLabelMap` proto text file. Returns: A category index, which is a dictionary that maps integer ids to dicts containing categories, e.g. {1: {'id': 1, 'name': 'dog'}, 2: {'id': 2, 'name': 'cat'}, ...}
Reads a label map and returns a category index.
[ "Reads", "a", "label", "map", "and", "returns", "a", "category", "index", "." ]
def create_category_index_from_labelmap(label_map_path): """Reads a label map and returns a category index. Args: label_map_path: Path to `StringIntLabelMap` proto text file. Returns: A category index, which is a dictionary that maps integer ids to dicts containing categories, e.g. ...
[ "def", "create_category_index_from_labelmap", "(", "label_map_path", ")", ":", "label_map", "=", "load_labelmap", "(", "label_map_path", ")", "max_num_classes", "=", "max", "(", "item", ".", "id", "for", "item", "in", "label_map", ".", "item", ")", "categories", ...
https://github.com/facebookresearch/SlowFast/blob/39ef35c9a086443209b458cceaec86a02e27b369/slowfast/utils/ava_evaluation/label_map_util.py#L168-L182
Chaffelson/nipyapi
d3b186fd701ce308c2812746d98af9120955e810
nipyapi/nifi/models/controller_service_referencing_component_entity.py
python
ControllerServiceReferencingComponentEntity.component
(self)
return self._component
Gets the component of this ControllerServiceReferencingComponentEntity. :return: The component of this ControllerServiceReferencingComponentEntity. :rtype: ControllerServiceReferencingComponentDTO
Gets the component of this ControllerServiceReferencingComponentEntity.
[ "Gets", "the", "component", "of", "this", "ControllerServiceReferencingComponentEntity", "." ]
def component(self): """ Gets the component of this ControllerServiceReferencingComponentEntity. :return: The component of this ControllerServiceReferencingComponentEntity. :rtype: ControllerServiceReferencingComponentDTO """ return self._component
[ "def", "component", "(", "self", ")", ":", "return", "self", ".", "_component" ]
https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/controller_service_referencing_component_entity.py#L253-L260
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/Python-2.7.9/Lib/plat-sunos5/STROPTS.py
python
AS_TYPE_64BIT
(as_)
return
[]
def AS_TYPE_64BIT(as_): return
[ "def", "AS_TYPE_64BIT", "(", "as_", ")", ":", "return" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/Python-2.7.9/Lib/plat-sunos5/STROPTS.py#L1553-L1553
henkelis/sonospy
841f52010fd6e1e932d8f1a8896ad4e5a0667b8a
web2py/gluon/shell.py
python
env
( a, import_models=False, c=None, f=None, dir='', )
return environment
Return web2py execution environment for application (a), controller (c), function (f). If import_models is True the exec all application models into the environment.
Return web2py execution environment for application (a), controller (c), function (f). If import_models is True the exec all application models into the environment.
[ "Return", "web2py", "execution", "environment", "for", "application", "(", "a", ")", "controller", "(", "c", ")", "function", "(", "f", ")", ".", "If", "import_models", "is", "True", "the", "exec", "all", "application", "models", "into", "the", "environment"...
def env( a, import_models=False, c=None, f=None, dir='', ): """ Return web2py execution environment for application (a), controller (c), function (f). If import_models is True the exec all application models into the environment. """ request = Request() response ...
[ "def", "env", "(", "a", ",", "import_models", "=", "False", ",", "c", "=", "None", ",", "f", "=", "None", ",", "dir", "=", "''", ",", ")", ":", "request", "=", "Request", "(", ")", "response", "=", "Response", "(", ")", "session", "=", "Session",...
https://github.com/henkelis/sonospy/blob/841f52010fd6e1e932d8f1a8896ad4e5a0667b8a/web2py/gluon/shell.py#L66-L114
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/site-packages/bokeh-1.4.0-py3.7.egg/bokeh/settings.py
python
PrioritizedSetting.set_value
(self, value)
Specify a value for this setting programmatically. A value set this way takes precedence over all other methods except immediate values. Args: value (str or int or float): A user-set value for this setting Returns: None
Specify a value for this setting programmatically.
[ "Specify", "a", "value", "for", "this", "setting", "programmatically", "." ]
def set_value(self, value): ''' Specify a value for this setting programmatically. A value set this way takes precedence over all other methods except immediate values. Args: value (str or int or float): A user-set value for this setting Returns: ...
[ "def", "set_value", "(", "self", ",", "value", ")", ":", "self", ".", "_user_value", "=", "value" ]
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/bokeh-1.4.0-py3.7.egg/bokeh/settings.py#L334-L347
bitprophet/ssh
e8bdad4c82a50158a749233dca58c29e47c60b76
ssh/client.py
python
SSHClient._auth
(self, username, password, pkey, key_filenames, allow_agent, look_for_keys)
Try, in order: - The key passed in, if one was passed in. - Any key we can find through an SSH agent (if allowed). - Any "id_rsa" or "id_dsa" key discoverable in ~/.ssh/ (if allowed). - Plain username/password auth, if a password was given. (The password might b...
Try, in order:
[ "Try", "in", "order", ":" ]
def _auth(self, username, password, pkey, key_filenames, allow_agent, look_for_keys): """ Try, in order: - The key passed in, if one was passed in. - Any key we can find through an SSH agent (if allowed). - Any "id_rsa" or "id_dsa" key discoverable in ~/.ssh/ (if all...
[ "def", "_auth", "(", "self", ",", "username", ",", "password", ",", "pkey", ",", "key_filenames", ",", "allow_agent", ",", "look_for_keys", ")", ":", "saved_exception", "=", "None", "two_factor", "=", "False", "allowed_types", "=", "[", "]", "if", "pkey", ...
https://github.com/bitprophet/ssh/blob/e8bdad4c82a50158a749233dca58c29e47c60b76/ssh/client.py#L413-L516
kyzhouhzau/NLPGNN
b9ecec2c6df1b3e40a54511366dcb6085cf90c34
nlpgnn/gnn/utils.py
python
coalesce
(index, value, n, sort=True)
return edge_index, value
index = [[row,col],[row,col],[row,col]] value = [v,v,v] n: num_nodes
index = [[row,col],[row,col],[row,col]] value = [v,v,v] n: num_nodes
[ "index", "=", "[[", "row", "col", "]", "[", "row", "col", "]", "[", "row", "col", "]]", "value", "=", "[", "v", "v", "v", "]", "n", ":", "num_nodes" ]
def coalesce(index, value, n, sort=True): """ index = [[row,col],[row,col],[row,col]] value = [v,v,v] n: num_nodes """ # if sort: # index = index[np.argsort(index[:, 0])] # index = np.array(sorted(index.tolist())) row = index[:, 0] col = index[:, 1] idx = np.full((col.size + ...
[ "def", "coalesce", "(", "index", ",", "value", ",", "n", ",", "sort", "=", "True", ")", ":", "# if sort:", "# index = index[np.argsort(index[:, 0])]", "# index = np.array(sorted(index.tolist()))", "row", "=", "index", "[", ":", ",", "0", "]", "col", "=", "index"...
https://github.com/kyzhouhzau/NLPGNN/blob/b9ecec2c6df1b3e40a54511366dcb6085cf90c34/nlpgnn/gnn/utils.py#L64-L89
SeldonIO/alibi
ce961caf995d22648a8338857822c90428af4765
alibi/explainers/backends/cfrl_tabular.py
python
get_numerical_conditional_vector
(X: np.ndarray, condition: Dict[str, List[Union[float, str]]], preprocessor: Callable[[np.ndarray], np.ndarray], feature_names: List[str], category_map: Dict[int, List[str]...
return C
Generates a conditional vector. The condition is expressed a a delta change of the feature. For numerical features, if the `Age` feature is allowed to increase up to 10 more years, the delta change is `[0, 10]`. If the `Hours per week` is allowed to decrease down to `-5` and increases up to `+10`, then the ...
Generates a conditional vector. The condition is expressed a a delta change of the feature. For numerical features, if the `Age` feature is allowed to increase up to 10 more years, the delta change is `[0, 10]`. If the `Hours per week` is allowed to decrease down to `-5` and increases up to `+10`, then the ...
[ "Generates", "a", "conditional", "vector", ".", "The", "condition", "is", "expressed", "a", "a", "delta", "change", "of", "the", "feature", ".", "For", "numerical", "features", "if", "the", "Age", "feature", "is", "allowed", "to", "increase", "up", "to", "...
def get_numerical_conditional_vector(X: np.ndarray, condition: Dict[str, List[Union[float, str]]], preprocessor: Callable[[np.ndarray], np.ndarray], feature_names: List[str], ...
[ "def", "get_numerical_conditional_vector", "(", "X", ":", "np", ".", "ndarray", ",", "condition", ":", "Dict", "[", "str", ",", "List", "[", "Union", "[", "float", ",", "str", "]", "]", "]", ",", "preprocessor", ":", "Callable", "[", "[", "np", ".", ...
https://github.com/SeldonIO/alibi/blob/ce961caf995d22648a8338857822c90428af4765/alibi/explainers/backends/cfrl_tabular.py#L569-L684
nlloyd/SubliminalCollaborator
5c619e17ddbe8acb9eea8996ec038169ddcd50a1
libs/twisted/python/constants.py
python
_flagOp
(op, left, right)
return result
Implement a binary operator for a L{FlagConstant} instance. @param op: A two-argument callable implementing the binary operation. For example, C{operator.or_}. @param left: The left-hand L{FlagConstant} instance. @param right: The right-hand L{FlagConstant} instance. @return: A new L{FlagCon...
Implement a binary operator for a L{FlagConstant} instance.
[ "Implement", "a", "binary", "operator", "for", "a", "L", "{", "FlagConstant", "}", "instance", "." ]
def _flagOp(op, left, right): """ Implement a binary operator for a L{FlagConstant} instance. @param op: A two-argument callable implementing the binary operation. For example, C{operator.or_}. @param left: The left-hand L{FlagConstant} instance. @param right: The right-hand L{FlagConstan...
[ "def", "_flagOp", "(", "op", ",", "left", ",", "right", ")", ":", "value", "=", "op", "(", "left", ".", "value", ",", "right", ".", "value", ")", "names", "=", "op", "(", "left", ".", "names", ",", "right", ".", "names", ")", "result", "=", "Fl...
https://github.com/nlloyd/SubliminalCollaborator/blob/5c619e17ddbe8acb9eea8996ec038169ddcd50a1/libs/twisted/python/constants.py#L252-L269
realpython/book2-exercises
cde325eac8e6d8cff2316601c2e5b36bb46af7d0
py2manager/gluon/contrib/pam.py
python
authenticate
(username, password, service='login')
return retval == 0
Returns True if the given username and password authenticate for the given service. Returns False otherwise ``username``: the username to authenticate ``password``: the password in plain text ``service``: the PAM service to authenticate against. Defaults to 'login
Returns True if the given username and password authenticate for the given service. Returns False otherwise
[ "Returns", "True", "if", "the", "given", "username", "and", "password", "authenticate", "for", "the", "given", "service", ".", "Returns", "False", "otherwise" ]
def authenticate(username, password, service='login'): """Returns True if the given username and password authenticate for the given service. Returns False otherwise ``username``: the username to authenticate ``password``: the password in plain text ``service``: the PAM service to authenticate a...
[ "def", "authenticate", "(", "username", ",", "password", ",", "service", "=", "'login'", ")", ":", "@", "CONV_FUNC", "def", "my_conv", "(", "n_messages", ",", "messages", ",", "p_response", ",", "app_data", ")", ":", "\"\"\"Simple conversation function that respon...
https://github.com/realpython/book2-exercises/blob/cde325eac8e6d8cff2316601c2e5b36bb46af7d0/py2manager/gluon/contrib/pam.py#L90-L124
llimllib/limbo
2e33a11e73f1ab13f24c06c8a76d1c9bfcf81afb
limbo/plugins/github.py
python
github
(server, room, cmd, body, repo)
[]
def github(server, room, cmd, body, repo): # If repo wasn't passed in explicitly, grab it from the database if not repo: repo = get_default_repo(server, room) # If we still couldn't find one in the database, either it's a command to # set it or we can instrcut the user how to do so if not r...
[ "def", "github", "(", "server", ",", "room", ",", "cmd", ",", "body", ",", "repo", ")", ":", "# If repo wasn't passed in explicitly, grab it from the database", "if", "not", "repo", ":", "repo", "=", "get_default_repo", "(", "server", ",", "room", ")", "# If we ...
https://github.com/llimllib/limbo/blob/2e33a11e73f1ab13f24c06c8a76d1c9bfcf81afb/limbo/plugins/github.py#L283-L304
huggingface/transformers
623b4f7c63f60cce917677ee704d6c93ee960b4b
src/transformers/utils/dummy_pt_objects.py
python
ImageGPTModel.forward
(self, *args, **kwargs)
[]
def forward(self, *args, **kwargs): requires_backends(self, ["torch"])
[ "def", "forward", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "requires_backends", "(", "self", ",", "[", "\"torch\"", "]", ")" ]
https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/utils/dummy_pt_objects.py#L2740-L2741
Qirky/FoxDot
76318f9630bede48ff3994146ed644affa27bfa4
FoxDot/lib/SCLang/SCLang.py
python
cls.__init__
(self, name, **kwargs)
[]
def __init__(self, name, **kwargs): self.name = name self.ref = kwargs.get("ref", "")
[ "def", "__init__", "(", "self", ",", "name", ",", "*", "*", "kwargs", ")", ":", "self", ".", "name", "=", "name", "self", ".", "ref", "=", "kwargs", ".", "get", "(", "\"ref\"", ",", "\"\"", ")" ]
https://github.com/Qirky/FoxDot/blob/76318f9630bede48ff3994146ed644affa27bfa4/FoxDot/lib/SCLang/SCLang.py#L17-L19
oracle/graalpython
577e02da9755d916056184ec441c26e00b70145c
graalpython/lib-graalpython/python_cext.py
python
instancemethod.__repr__
(self)
return "<instancemethod {} at ?>".format(self.__func__.__name__)
[]
def __repr__(self): return "<instancemethod {} at ?>".format(self.__func__.__name__)
[ "def", "__repr__", "(", "self", ")", ":", "return", "\"<instancemethod {} at ?>\"", ".", "format", "(", "self", ".", "__func__", ".", "__name__", ")" ]
https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/lib-graalpython/python_cext.py#L137-L138
demisto/content
5c664a65b992ac8ca90ac3f11b1b2cdf11ee9b07
Packs/MicrosoftGraphGroups/Integrations/MicrosoftGraphGroups/MicrosoftGraphGroups.py
python
MsGraphClient.add_member
(self, group_id: str, properties: Dict[str, str])
Add a single member to a group by sending a POST request. Args: group_id: the group id to add the member to. properties: the member properties.
Add a single member to a group by sending a POST request. Args: group_id: the group id to add the member to. properties: the member properties.
[ "Add", "a", "single", "member", "to", "a", "group", "by", "sending", "a", "POST", "request", ".", "Args", ":", "group_id", ":", "the", "group", "id", "to", "add", "the", "member", "to", ".", "properties", ":", "the", "member", "properties", "." ]
def add_member(self, group_id: str, properties: Dict[str, str]): """Add a single member to a group by sending a POST request. Args: group_id: the group id to add the member to. properties: the member properties. """ # If successful, this method returns 204 No Con...
[ "def", "add_member", "(", "self", ",", "group_id", ":", "str", ",", "properties", ":", "Dict", "[", "str", ",", "str", "]", ")", ":", "# If successful, this method returns 204 No Content response code.", "# It does not return anything in the response body.", "# Using res...
https://github.com/demisto/content/blob/5c664a65b992ac8ca90ac3f11b1b2cdf11ee9b07/Packs/MicrosoftGraphGroups/Integrations/MicrosoftGraphGroups/MicrosoftGraphGroups.py#L165-L178
LeapBeyond/scrubadub
ab199f0b3cc3ca11f646aabb05ebe124d2757ea5
scrubadub/filth/phone.py
python
PhoneFilth.generate
(faker: Faker)
return phone_number
Generates an example of this ``Filth`` type, usually using the faker python library. :param faker: The ``Faker`` class from the ``faker`` library :type faker: Faker :return: An example of this ``Filth`` :rtype: str
Generates an example of this ``Filth`` type, usually using the faker python library.
[ "Generates", "an", "example", "of", "this", "Filth", "type", "usually", "using", "the", "faker", "python", "library", "." ]
def generate(faker: Faker) -> str: """Generates an example of this ``Filth`` type, usually using the faker python library. :param faker: The ``Faker`` class from the ``faker`` library :type faker: Faker :return: An example of this ``Filth`` :rtype: str """ phone_...
[ "def", "generate", "(", "faker", ":", "Faker", ")", "->", "str", ":", "phone_number", "=", "''", "language", ",", "region", "=", "utils", ".", "locale_split", "(", "faker", ".", "_locales", "[", "0", "]", ")", "results", "=", "[", "]", "# type: List[ph...
https://github.com/LeapBeyond/scrubadub/blob/ab199f0b3cc3ca11f646aabb05ebe124d2757ea5/scrubadub/filth/phone.py#L15-L32
hatRiot/zarp
2e772350a01c2aeed3f4da9685cd0cc5d6b3ecad
src/lib/scapy/supersocket.py
python
SuperSocket.close
(self)
[]
def close(self): if self.closed: return self.closed=1 if self.ins != self.outs: if self.outs and self.outs.fileno() != -1: self.outs.close() if self.ins and self.ins.fileno() != -1: self.ins.close()
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "closed", ":", "return", "self", ".", "closed", "=", "1", "if", "self", ".", "ins", "!=", "self", ".", "outs", ":", "if", "self", ".", "outs", "and", "self", ".", "outs", ".", "fileno", ...
https://github.com/hatRiot/zarp/blob/2e772350a01c2aeed3f4da9685cd0cc5d6b3ecad/src/lib/scapy/supersocket.py#L34-L42
zhufz/nlp_research
b435319858520edcca7c0320dca3e0013087c276
language_model/bert/run_classifier.py
python
DataProcessor.get_train_examples
(self, data_dir)
Gets a collection of `InputExample`s for the train set.
Gets a collection of `InputExample`s for the train set.
[ "Gets", "a", "collection", "of", "InputExample", "s", "for", "the", "train", "set", "." ]
def get_train_examples(self, data_dir): """Gets a collection of `InputExample`s for the train set.""" raise NotImplementedError()
[ "def", "get_train_examples", "(", "self", ",", "data_dir", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/zhufz/nlp_research/blob/b435319858520edcca7c0320dca3e0013087c276/language_model/bert/run_classifier.py#L180-L182
omz/PythonistaAppTemplate
f560f93f8876d82a21d108977f90583df08d55af
PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/markdown/extensions/fenced_code.py
python
FencedCodeExtension.extendMarkdown
(self, md, md_globals)
Add FencedBlockPreprocessor to the Markdown instance.
Add FencedBlockPreprocessor to the Markdown instance.
[ "Add", "FencedBlockPreprocessor", "to", "the", "Markdown", "instance", "." ]
def extendMarkdown(self, md, md_globals): """ Add FencedBlockPreprocessor to the Markdown instance. """ md.registerExtension(self) md.preprocessors.add('fenced_code_block', FencedBlockPreprocessor(md), "_begin")
[ "def", "extendMarkdown", "(", "self", ",", "md", ",", "md_globals", ")", ":", "md", ".", "registerExtension", "(", "self", ")", "md", ".", "preprocessors", ".", "add", "(", "'fenced_code_block'", ",", "FencedBlockPreprocessor", "(", "md", ")", ",", "\"_begin...
https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/markdown/extensions/fenced_code.py#L91-L97
lovelylain/pyctp
fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d
example/ctp/stock/ApiStruct.py
python
QryBrokerUserFunction.__init__
(self, BrokerID='', UserID='')
[]
def __init__(self, BrokerID='', UserID=''): self.BrokerID = '' #经纪公司代码, char[11] self.UserID = ''
[ "def", "__init__", "(", "self", ",", "BrokerID", "=", "''", ",", "UserID", "=", "''", ")", ":", "self", ".", "BrokerID", "=", "''", "#经纪公司代码, char[11]", "self", ".", "UserID", "=", "''" ]
https://github.com/lovelylain/pyctp/blob/fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d/example/ctp/stock/ApiStruct.py#L2622-L2624
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework
cb692f527e4e819b6c228187c5702d990a180043
external/Scripting Engine/Xenotix Python Scripting Engine/bin/x86/Debug/Lib/mailbox.py
python
_mboxMMDF.get_file
(self, key, from_=False)
return _PartialFile(self._file, self._file.tell(), stop)
Return a file-like representation or raise a KeyError.
Return a file-like representation or raise a KeyError.
[ "Return", "a", "file", "-", "like", "representation", "or", "raise", "a", "KeyError", "." ]
def get_file(self, key, from_=False): """Return a file-like representation or raise a KeyError.""" start, stop = self._lookup(key) self._file.seek(start) if not from_: self._file.readline() return _PartialFile(self._file, self._file.tell(), stop)
[ "def", "get_file", "(", "self", ",", "key", ",", "from_", "=", "False", ")", ":", "start", ",", "stop", "=", "self", ".", "_lookup", "(", "key", ")", "self", ".", "_file", ".", "seek", "(", "start", ")", "if", "not", "from_", ":", "self", ".", ...
https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/Xenotix Python Scripting Engine/bin/x86/Debug/Lib/mailbox.py#L746-L752
amimo/dcc
114326ab5a082a42c7728a375726489e4709ca29
androguard/core/bytecodes/dvm.py
python
TypeItem.get_type_idx
(self)
return self.type_idx
Return the index into the type_ids list :rtype: int
Return the index into the type_ids list
[ "Return", "the", "index", "into", "the", "type_ids", "list" ]
def get_type_idx(self): """ Return the index into the type_ids list :rtype: int """ return self.type_idx
[ "def", "get_type_idx", "(", "self", ")", ":", "return", "self", ".", "type_idx" ]
https://github.com/amimo/dcc/blob/114326ab5a082a42c7728a375726489e4709ca29/androguard/core/bytecodes/dvm.py#L1098-L1104
phonopy/phonopy
816586d0ba8177482ecf40e52f20cbdee2260d51
phonopy/structure/tetrahedron_method.py
python
TetrahedronMethod._J_32
(self)
return ( (1.0 - self._f(0, 3) * self._f(1, 3) * self._f(2, 3) ** 2) / 4 / self._n_3() )
[]
def _J_32(self): return ( (1.0 - self._f(0, 3) * self._f(1, 3) * self._f(2, 3) ** 2) / 4 / self._n_3() )
[ "def", "_J_32", "(", "self", ")", ":", "return", "(", "(", "1.0", "-", "self", ".", "_f", "(", "0", ",", "3", ")", "*", "self", ".", "_f", "(", "1", ",", "3", ")", "*", "self", ".", "_f", "(", "2", ",", "3", ")", "**", "2", ")", "/", ...
https://github.com/phonopy/phonopy/blob/816586d0ba8177482ecf40e52f20cbdee2260d51/phonopy/structure/tetrahedron_method.py#L606-L609
meiqua/6DPose
619be5790448b4cd13290cf7727b35f1265e69e0
pysixd/renderer.py
python
render
(model, im_size, K, R, t, clip_near=100, clip_far=2000, texture=None, surf_color=None, bg_color=(0.0, 0.0, 0.0, 0.0), ambient_weight=0.5, shading='flat', mode='rgb+depth')
[]
def render(model, im_size, K, R, t, clip_near=100, clip_far=2000, texture=None, surf_color=None, bg_color=(0.0, 0.0, 0.0, 0.0), ambient_weight=0.5, shading='flat', mode='rgb+depth'): # Process input data #--------------------------------------------------------------------------- # Ma...
[ "def", "render", "(", "model", ",", "im_size", ",", "K", ",", "R", ",", "t", ",", "clip_near", "=", "100", ",", "clip_far", "=", "2000", ",", "texture", "=", "None", ",", "surf_color", "=", "None", ",", "bg_color", "=", "(", "0.0", ",", "0.0", ",...
https://github.com/meiqua/6DPose/blob/619be5790448b4cd13290cf7727b35f1265e69e0/pysixd/renderer.py#L306-L420
Chaffelson/nipyapi
d3b186fd701ce308c2812746d98af9120955e810
nipyapi/nifi/models/remote_process_group_dto.py
python
RemoteProcessGroupDTO.authorization_issues
(self, authorization_issues)
Sets the authorization_issues of this RemoteProcessGroupDTO. Any remote authorization issues for the remote process group. :param authorization_issues: The authorization_issues of this RemoteProcessGroupDTO. :type: list[str]
Sets the authorization_issues of this RemoteProcessGroupDTO. Any remote authorization issues for the remote process group.
[ "Sets", "the", "authorization_issues", "of", "this", "RemoteProcessGroupDTO", ".", "Any", "remote", "authorization", "issues", "for", "the", "remote", "process", "group", "." ]
def authorization_issues(self, authorization_issues): """ Sets the authorization_issues of this RemoteProcessGroupDTO. Any remote authorization issues for the remote process group. :param authorization_issues: The authorization_issues of this RemoteProcessGroupDTO. :type: list[s...
[ "def", "authorization_issues", "(", "self", ",", "authorization_issues", ")", ":", "self", ".", "_authorization_issues", "=", "authorization_issues" ]
https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/remote_process_group_dto.py#L579-L588
freewym/espresso
6671c507350295269e38add57dbe601dcb8e6ecf
fairseq/modules/rotary_positional_embedding.py
python
RotaryPositionalEmbedding.__init__
(self, dim, base=10000, precision=torch.half)
Rotary positional embedding Reference : https://blog.eleuther.ai/rotary-embeddings/ Paper: https://arxiv.org/pdf/2104.09864.pdf Args: dim: Dimension of embedding base: Base value for exponential precision: precision to use for numerical values
Rotary positional embedding Reference : https://blog.eleuther.ai/rotary-embeddings/ Paper: https://arxiv.org/pdf/2104.09864.pdf Args: dim: Dimension of embedding base: Base value for exponential precision: precision to use for numerical values
[ "Rotary", "positional", "embedding", "Reference", ":", "https", ":", "//", "blog", ".", "eleuther", ".", "ai", "/", "rotary", "-", "embeddings", "/", "Paper", ":", "https", ":", "//", "arxiv", ".", "org", "/", "pdf", "/", "2104", ".", "09864", ".", "...
def __init__(self, dim, base=10000, precision=torch.half): """Rotary positional embedding Reference : https://blog.eleuther.ai/rotary-embeddings/ Paper: https://arxiv.org/pdf/2104.09864.pdf Args: dim: Dimension of embedding base: Base value for exponential ...
[ "def", "__init__", "(", "self", ",", "dim", ",", "base", "=", "10000", ",", "precision", "=", "torch", ".", "half", ")", ":", "super", "(", ")", ".", "__init__", "(", ")", "inv_freq", "=", "1.0", "/", "(", "base", "**", "(", "torch", ".", "arange...
https://github.com/freewym/espresso/blob/6671c507350295269e38add57dbe601dcb8e6ecf/fairseq/modules/rotary_positional_embedding.py#L5-L20
tobegit3hub/deep_image_model
8a53edecd9e00678b278bb10f6fb4bdb1e4ee25e
java_predict_client/src/main/proto/tensorflow/python/ops/data_flow_ops.py
python
ConditionalAccumulatorBase.num_accumulated
(self, name=None)
return gen_data_flow_ops.accumulator_num_accumulated( self._accumulator_ref, name=name)
Number of gradients that have currently been aggregated in accumulator. Args: name: Optional name for the operation. Returns: Number of accumulated gradients currently in accumulator.
Number of gradients that have currently been aggregated in accumulator.
[ "Number", "of", "gradients", "that", "have", "currently", "been", "aggregated", "in", "accumulator", "." ]
def num_accumulated(self, name=None): """Number of gradients that have currently been aggregated in accumulator. Args: name: Optional name for the operation. Returns: Number of accumulated gradients currently in accumulator. """ if name is None: name = "%s_NumAccumulated" % self....
[ "def", "num_accumulated", "(", "self", ",", "name", "=", "None", ")", ":", "if", "name", "is", "None", ":", "name", "=", "\"%s_NumAccumulated\"", "%", "self", ".", "_name", "return", "gen_data_flow_ops", ".", "accumulator_num_accumulated", "(", "self", ".", ...
https://github.com/tobegit3hub/deep_image_model/blob/8a53edecd9e00678b278bb10f6fb4bdb1e4ee25e/java_predict_client/src/main/proto/tensorflow/python/ops/data_flow_ops.py#L1195-L1207
ambakick/Person-Detection-and-Tracking
f925394ac29b5cf321f1ce89a71b193381519a0b
core/preprocessor.py
python
random_jitter_boxes
(boxes, ratio=0.05, seed=None)
Randomly jitter boxes in image. Args: boxes: rank 2 float32 tensor containing the bounding boxes -> [N, 4]. Boxes are in normalized form meaning their coordinates vary between [0, 1]. Each row is in the form of [ymin, xmin, ymax, xmax]. ratio: The ratio of the box width and h...
Randomly jitter boxes in image.
[ "Randomly", "jitter", "boxes", "in", "image", "." ]
def random_jitter_boxes(boxes, ratio=0.05, seed=None): """Randomly jitter boxes in image. Args: boxes: rank 2 float32 tensor containing the bounding boxes -> [N, 4]. Boxes are in normalized form meaning their coordinates vary between [0, 1]. Each row is in the form of [ymin, xm...
[ "def", "random_jitter_boxes", "(", "boxes", ",", "ratio", "=", "0.05", ",", "seed", "=", "None", ")", ":", "def", "random_jitter_box", "(", "box", ",", "ratio", ",", "seed", ")", ":", "\"\"\"Randomly jitter box.\n\n Args:\n box: bounding box [1, 1, 4].\n ...
https://github.com/ambakick/Person-Detection-and-Tracking/blob/f925394ac29b5cf321f1ce89a71b193381519a0b/core/preprocessor.py#L1054-L1103
openstack/swift
b8d7c3dcb817504dcc0959ba52cc4ed2cf66c100
swift/common/constraints.py
python
valid_api_version
(version)
return version in VALID_API_VERSIONS
Checks if the requested version is valid. Currently Swift only supports "v1" and "v1.0".
Checks if the requested version is valid.
[ "Checks", "if", "the", "requested", "version", "is", "valid", "." ]
def valid_api_version(version): """ Checks if the requested version is valid. Currently Swift only supports "v1" and "v1.0". """ global VALID_API_VERSIONS if not isinstance(VALID_API_VERSIONS, list): VALID_API_VERSIONS = [str(VALID_API_VERSIONS)] return version in VALID_API_VERSIONS
[ "def", "valid_api_version", "(", "version", ")", ":", "global", "VALID_API_VERSIONS", "if", "not", "isinstance", "(", "VALID_API_VERSIONS", ",", "list", ")", ":", "VALID_API_VERSIONS", "=", "[", "str", "(", "VALID_API_VERSIONS", ")", "]", "return", "version", "i...
https://github.com/openstack/swift/blob/b8d7c3dcb817504dcc0959ba52cc4ed2cf66c100/swift/common/constraints.py#L431-L440
ytdl-org/youtube-dl
5014bd67c22b421207b2650d4dc874b95b36dda1
youtube_dl/extractor/openload.py
python
PhantomJSwrapper.get
(self, url, html=None, video_id=None, note=None, note2='Executing JS on webpage', headers={}, jscode='saveAndExit();')
return (html, encodeArgument(out))
Downloads webpage (if needed) and executes JS Params: url: website url html: optional, html code of website video_id: video id note: optional, displayed when downloading webpage note2: optional, displayed when executing JS headers: custom ...
Downloads webpage (if needed) and executes JS
[ "Downloads", "webpage", "(", "if", "needed", ")", "and", "executes", "JS" ]
def get(self, url, html=None, video_id=None, note=None, note2='Executing JS on webpage', headers={}, jscode='saveAndExit();'): """ Downloads webpage (if needed) and executes JS Params: url: website url html: optional, html code of website video_id: video id ...
[ "def", "get", "(", "self", ",", "url", ",", "html", "=", "None", ",", "video_id", "=", "None", ",", "note", "=", "None", ",", "note2", "=", "'Executing JS on webpage'", ",", "headers", "=", "{", "}", ",", "jscode", "=", "'saveAndExit();'", ")", ":", ...
https://github.com/ytdl-org/youtube-dl/blob/5014bd67c22b421207b2650d4dc874b95b36dda1/youtube_dl/extractor/openload.py#L163-L238
OpenMDAO/OpenMDAO-Framework
f2e37b7de3edeaaeb2d251b375917adec059db9b
openmdao.main/src/openmdao/main/systems.py
python
AssemblySystem.set_complex_step
(self, complex_step=False)
Toggles complex_step plumbing for this system and all subsystems. Assemblies must prepare their inner system.
Toggles complex_step plumbing for this system and all subsystems. Assemblies must prepare their inner system.
[ "Toggles", "complex_step", "plumbing", "for", "this", "system", "and", "all", "subsystems", ".", "Assemblies", "must", "prepare", "their", "inner", "system", "." ]
def set_complex_step(self, complex_step=False): """ Toggles complex_step plumbing for this system and all subsystems. Assemblies must prepare their inner system.""" self.complex_step = complex_step self._comp._system.set_complex_step(complex_step)
[ "def", "set_complex_step", "(", "self", ",", "complex_step", "=", "False", ")", ":", "self", ".", "complex_step", "=", "complex_step", "self", ".", "_comp", ".", "_system", ".", "set_complex_step", "(", "complex_step", ")" ]
https://github.com/OpenMDAO/OpenMDAO-Framework/blob/f2e37b7de3edeaaeb2d251b375917adec059db9b/openmdao.main/src/openmdao/main/systems.py#L1557-L1562
WikidPad/WikidPad
558109638807bc76b4672922686e416ab2d5f79c
WikidPad/lib/pwiki/Exporters.py
python
MultiPageTextExporter.export
(self, wikiDocument, wordList, exportType, exportDest, compatFilenames, addOpt, progressHandler)
Run export operation. wikiDocument -- WikiDocument object wordList -- Sequence of wiki words to export exportType -- string tag to identify how to export exportDest -- Path to destination directory or file to export to compatFilenames -- Should the filenames be encoded t...
Run export operation. wikiDocument -- WikiDocument object wordList -- Sequence of wiki words to export exportType -- string tag to identify how to export exportDest -- Path to destination directory or file to export to compatFilenames -- Should the filenames be encoded t...
[ "Run", "export", "operation", ".", "wikiDocument", "--", "WikiDocument", "object", "wordList", "--", "Sequence", "of", "wiki", "words", "to", "export", "exportType", "--", "string", "tag", "to", "identify", "how", "to", "export", "exportDest", "--", "Path", "t...
def export(self, wikiDocument, wordList, exportType, exportDest, compatFilenames, addOpt, progressHandler): """ Run export operation. wikiDocument -- WikiDocument object wordList -- Sequence of wiki words to export exportType -- string tag to identify how to ...
[ "def", "export", "(", "self", ",", "wikiDocument", ",", "wordList", ",", "exportType", ",", "exportDest", ",", "compatFilenames", ",", "addOpt", ",", "progressHandler", ")", ":", "self", ".", "wikiDocument", "=", "wikiDocument", "self", ".", "wordList", "=", ...
https://github.com/WikidPad/WikidPad/blob/558109638807bc76b4672922686e416ab2d5f79c/WikidPad/lib/pwiki/Exporters.py#L762-L878
PyMVPA/PyMVPA
76c476b3de8264b0bb849bf226da5674d659564e
mvpa2/misc/fsl/base.py
python
FslEV3.to_events
(self, **kwargs)
return \ [Event(onset=self['onsets'][i], duration=self['durations'][i], features=[self['intensities'][i]], **kwargs) for i in xrange(self.nevs)]
Convert into a list of `Event` instances. Parameters ---------- kwargs Any keyword arugment provided would be replicated, through all the entries. Useful to specify label or even a chunk
Convert into a list of `Event` instances.
[ "Convert", "into", "a", "list", "of", "Event", "instances", "." ]
def to_events(self, **kwargs): """Convert into a list of `Event` instances. Parameters ---------- kwargs Any keyword arugment provided would be replicated, through all the entries. Useful to specify label or even a chunk """ return \ [Even...
[ "def", "to_events", "(", "self", ",", "*", "*", "kwargs", ")", ":", "return", "[", "Event", "(", "onset", "=", "self", "[", "'onsets'", "]", "[", "i", "]", ",", "duration", "=", "self", "[", "'durations'", "]", "[", "i", "]", ",", "features", "="...
https://github.com/PyMVPA/PyMVPA/blob/76c476b3de8264b0bb849bf226da5674d659564e/mvpa2/misc/fsl/base.py#L70-L84
OpenCobolIDE/OpenCobolIDE
c78d0d335378e5fe0a5e74f53c19b68b55e85388
open_cobol_ide/extlibs/future/types/newint.py
python
newint.from_bytes
(cls, mybytes, byteorder='big', signed=False)
return cls(num)
Return the integer represented by the given array of bytes. The mybytes argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol. The byteorder argument determines t...
Return the integer represented by the given array of bytes.
[ "Return", "the", "integer", "represented", "by", "the", "given", "array", "of", "bytes", "." ]
def from_bytes(cls, mybytes, byteorder='big', signed=False): """ Return the integer represented by the given array of bytes. The mybytes argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objec...
[ "def", "from_bytes", "(", "cls", ",", "mybytes", ",", "byteorder", "=", "'big'", ",", "signed", "=", "False", ")", ":", "if", "byteorder", "not", "in", "(", "'little'", ",", "'big'", ")", ":", "raise", "ValueError", "(", "\"byteorder must be either 'little' ...
https://github.com/OpenCobolIDE/OpenCobolIDE/blob/c78d0d335378e5fe0a5e74f53c19b68b55e85388/open_cobol_ide/extlibs/future/types/newint.py#L336-L369
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/kef/media_player.py
python
KefMediaPlayer.source_list
(self)
return self._sources
List of available input sources.
List of available input sources.
[ "List", "of", "available", "input", "sources", "." ]
def source_list(self): """List of available input sources.""" return self._sources
[ "def", "source_list", "(", "self", ")", ":", "return", "self", ".", "_sources" ]
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/kef/media_player.py#L311-L313
triaquae/triaquae
bbabf736b3ba56a0c6498e7f04e16c13b8b8f2b9
TriAquae/models/django/contrib/gis/maps/google/zoom.py
python
GoogleZoom.get_zoom
(self, geom)
return self._nzoom-1
Returns the optimal Zoom level for the given geometry.
Returns the optimal Zoom level for the given geometry.
[ "Returns", "the", "optimal", "Zoom", "level", "for", "the", "given", "geometry", "." ]
def get_zoom(self, geom): "Returns the optimal Zoom level for the given geometry." # Checking the input type. if not isinstance(geom, GEOSGeometry) or geom.srid != 4326: raise TypeError('get_zoom() expects a GEOS Geometry with an SRID of 4326.') # Getting the envelope for th...
[ "def", "get_zoom", "(", "self", ",", "geom", ")", ":", "# Checking the input type.", "if", "not", "isinstance", "(", "geom", ",", "GEOSGeometry", ")", "or", "geom", ".", "srid", "!=", "4326", ":", "raise", "TypeError", "(", "'get_zoom() expects a GEOS Geometry w...
https://github.com/triaquae/triaquae/blob/bbabf736b3ba56a0c6498e7f04e16c13b8b8f2b9/TriAquae/models/django/contrib/gis/maps/google/zoom.py#L124-L148
maiyao1988/ExAndroidNativeEmu
56b592187d744a41191944741e91c66554ae3fb7
androidemu/java/jni_env.py
python
JNIEnv.get_static_field_id
(self, mu, env, clazz_idx, name_ptr, sig_ptr)
return field.jvm_id
Returns the field ID for a static field of a class. The field is specified by its name and signature. The GetStatic<type>Field and SetStatic<type>Field families of accessor functions use field IDs to retrieve static fields.
Returns the field ID for a static field of a class. The field is specified by its name and signature. The GetStatic<type>Field and SetStatic<type>Field families of accessor functions use field IDs to retrieve static fields.
[ "Returns", "the", "field", "ID", "for", "a", "static", "field", "of", "a", "class", ".", "The", "field", "is", "specified", "by", "its", "name", "and", "signature", ".", "The", "GetStatic<type", ">", "Field", "and", "SetStatic<type", ">", "Field", "familie...
def get_static_field_id(self, mu, env, clazz_idx, name_ptr, sig_ptr): """ Returns the field ID for a static field of a class. The field is specified by its name and signature. The GetStatic<type>Field and SetStatic<type>Field families of accessor functions use field IDs to retrieve static ...
[ "def", "get_static_field_id", "(", "self", ",", "mu", ",", "env", ",", "clazz_idx", ",", "name_ptr", ",", "sig_ptr", ")", ":", "name", "=", "memory_helpers", ".", "read_utf8", "(", "mu", ",", "name_ptr", ")", "sig", "=", "memory_helpers", ".", "read_utf8",...
https://github.com/maiyao1988/ExAndroidNativeEmu/blob/56b592187d744a41191944741e91c66554ae3fb7/androidemu/java/jni_env.py#L1412-L1436
tendenci/tendenci
0f2c348cc0e7d41bc56f50b00ce05544b083bf1d
tendenci/apps/forums/feeds.py
python
LastTopics.items
(self, user)
return perms.filter_topics(user, Topic.objects.all()).select_related('forum').order_by('-created', '-id')[:15]
[]
def items(self, user): return perms.filter_topics(user, Topic.objects.all()).select_related('forum').order_by('-created', '-id')[:15]
[ "def", "items", "(", "self", ",", "user", ")", ":", "return", "perms", ".", "filter_topics", "(", "user", ",", "Topic", ".", "objects", ".", "all", "(", ")", ")", ".", "select_related", "(", "'forum'", ")", ".", "order_by", "(", "'-created'", ",", "'...
https://github.com/tendenci/tendenci/blob/0f2c348cc0e7d41bc56f50b00ce05544b083bf1d/tendenci/apps/forums/feeds.py#L53-L54
rembo10/headphones
b3199605be1ebc83a7a8feab6b1e99b64014187c
lib/beets/importer.py
python
ImportTask.chosen_ident
(self)
Returns identifying metadata about the current choice. For albums, this is an (artist, album) pair. For items, this is (artist, title). May only be called when the choice flag is ASIS or RETAG (in which case the data comes from the files' current metadata) or APPLY (data comes from the c...
Returns identifying metadata about the current choice. For albums, this is an (artist, album) pair. For items, this is (artist, title). May only be called when the choice flag is ASIS or RETAG (in which case the data comes from the files' current metadata) or APPLY (data comes from the c...
[ "Returns", "identifying", "metadata", "about", "the", "current", "choice", ".", "For", "albums", "this", "is", "an", "(", "artist", "album", ")", "pair", ".", "For", "items", "this", "is", "(", "artist", "title", ")", ".", "May", "only", "be", "called", ...
def chosen_ident(self): """Returns identifying metadata about the current choice. For albums, this is an (artist, album) pair. For items, this is (artist, title). May only be called when the choice flag is ASIS or RETAG (in which case the data comes from the files' current metada...
[ "def", "chosen_ident", "(", "self", ")", ":", "if", "self", ".", "choice_flag", "in", "(", "action", ".", "ASIS", ",", "action", ".", "RETAG", ")", ":", "return", "(", "self", ".", "cur_artist", ",", "self", ".", "cur_album", ")", "elif", "self", "."...
https://github.com/rembo10/headphones/blob/b3199605be1ebc83a7a8feab6b1e99b64014187c/lib/beets/importer.py#L485-L495
PaulSonOfLars/tgbot
0ece72778b7772725ab214fe0929daaa2fc7d2d1
tg_bot/modules/sql/welcome_sql.py
python
WelcomeButtons.__init__
(self, chat_id, name, url, same_line=False)
[]
def __init__(self, chat_id, name, url, same_line=False): self.chat_id = str(chat_id) self.name = name self.url = url self.same_line = same_line
[ "def", "__init__", "(", "self", ",", "chat_id", ",", "name", ",", "url", ",", "same_line", "=", "False", ")", ":", "self", ".", "chat_id", "=", "str", "(", "chat_id", ")", "self", ".", "name", "=", "name", "self", ".", "url", "=", "url", "self", ...
https://github.com/PaulSonOfLars/tgbot/blob/0ece72778b7772725ab214fe0929daaa2fc7d2d1/tg_bot/modules/sql/welcome_sql.py#L43-L47
mgear-dev/mgear_dist
24477b05a1ea3c615f313dbdfa56710326894fdb
drag_n_drop_install.py
python
InstallUI.on_help_button_clicked
(self)
Help button command.
Help button command.
[ "Help", "button", "command", "." ]
def on_help_button_clicked(self): """Help button command.""" QtGui.QDesktopServices.openUrl(QtCore.QUrl( "http://forum.mgear-framework.com/t/official-installation-support-help"))
[ "def", "on_help_button_clicked", "(", "self", ")", ":", "QtGui", ".", "QDesktopServices", ".", "openUrl", "(", "QtCore", ".", "QUrl", "(", "\"http://forum.mgear-framework.com/t/official-installation-support-help\"", ")", ")" ]
https://github.com/mgear-dev/mgear_dist/blob/24477b05a1ea3c615f313dbdfa56710326894fdb/drag_n_drop_install.py#L151-L155
erevus-cn/pocscan
5fef32b1abe22a9f666ad3aacfd1f99d784cb72d
pocscan/plugins/pocsuite/packages/requests/adapters.py
python
HTTPAdapter.build_response
(self, req, resp)
return response
Builds a :class:`Response <requests.Response>` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>` :param req: The :class:`PreparedRequest <PreparedRequest>` used ...
Builds a :class:`Response <requests.Response>` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`
[ "Builds", "a", ":", "class", ":", "Response", "<requests", ".", "Response", ">", "object", "from", "a", "urllib3", "response", ".", "This", "should", "not", "be", "called", "from", "user", "code", "and", "is", "only", "exposed", "for", "use", "when", "su...
def build_response(self, req, resp): """Builds a :class:`Response <requests.Response>` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>` :param req: The ...
[ "def", "build_response", "(", "self", ",", "req", ",", "resp", ")", ":", "response", "=", "Response", "(", ")", "# Fallback to None if there's no status_code, for whatever reason.", "response", ".", "status_code", "=", "getattr", "(", "resp", ",", "'status'", ",", ...
https://github.com/erevus-cn/pocscan/blob/5fef32b1abe22a9f666ad3aacfd1f99d784cb72d/pocscan/plugins/pocsuite/packages/requests/adapters.py#L158-L192
diefenbach/django-lfs
3bbcb3453d324c181ec68d11d5d35115a60a2fd5
lfs/catalog/models.py
python
DeliveryTimeBase.__add__
(self, other)
return self._get_instance(min=min_new, max=max_new, unit=unit_new)
Adds to delivery times.
Adds to delivery times.
[ "Adds", "to", "delivery", "times", "." ]
def __add__(self, other): """ Adds to delivery times. """ # If necessary we transform both delivery times to the same base (hours) if self.unit != other.unit: a = self.as_hours() b = other.as_hours() unit_new = DELIVERY_TIME_UNIT_HOURS ...
[ "def", "__add__", "(", "self", ",", "other", ")", ":", "# If necessary we transform both delivery times to the same base (hours)", "if", "self", ".", "unit", "!=", "other", ".", "unit", ":", "a", "=", "self", ".", "as_hours", "(", ")", "b", "=", "other", ".", ...
https://github.com/diefenbach/django-lfs/blob/3bbcb3453d324c181ec68d11d5d35115a60a2fd5/lfs/catalog/models.py#L2609-L2628
TencentCloud/tencentcloud-sdk-python
3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2
tencentcloud/cdn/v20180606/models.py
python
RemoteAuthentication.__init__
(self)
r""" :param Switch: 远程鉴权开关; on : 开启; off: 关闭; 注意:此字段可能返回 null,表示取不到有效值。 :type Switch: str :param RemoteAuthenticationRules: 远程鉴权规则配置 注意:此字段可能返回 null,表示取不到有效值。 :type RemoteAuthenticationRules: list of RemoteAuthenticationRule :param Server: 远程鉴权Server 注意:此字段可能返回 null,表示取不到有效值。 ...
r""" :param Switch: 远程鉴权开关; on : 开启; off: 关闭; 注意:此字段可能返回 null,表示取不到有效值。 :type Switch: str :param RemoteAuthenticationRules: 远程鉴权规则配置 注意:此字段可能返回 null,表示取不到有效值。 :type RemoteAuthenticationRules: list of RemoteAuthenticationRule :param Server: 远程鉴权Server 注意:此字段可能返回 null,表示取不到有效值。 ...
[ "r", ":", "param", "Switch", ":", "远程鉴权开关;", "on", ":", "开启", ";", "off", ":", "关闭;", "注意:此字段可能返回", "null,表示取不到有效值。", ":", "type", "Switch", ":", "str", ":", "param", "RemoteAuthenticationRules", ":", "远程鉴权规则配置", "注意:此字段可能返回", "null,表示取不到有效值。", ":", "type", ...
def __init__(self): r""" :param Switch: 远程鉴权开关; on : 开启; off: 关闭; 注意:此字段可能返回 null,表示取不到有效值。 :type Switch: str :param RemoteAuthenticationRules: 远程鉴权规则配置 注意:此字段可能返回 null,表示取不到有效值。 :type RemoteAuthenticationRules: list of RemoteAuthenticationRule :param Server: 远程鉴权Server 注...
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "Switch", "=", "None", "self", ".", "RemoteAuthenticationRules", "=", "None", "self", ".", "Server", "=", "None" ]
https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/cdn/v20180606/models.py#L11293-L11309
khanhnamle1994/natural-language-processing
01d450d5ac002b0156ef4cf93a07cb508c1bcdc5
assignment1/.env/lib/python2.7/site-packages/numpy/lib/function_base.py
python
vectorize._get_ufunc_and_otypes
(self, func, args)
return ufunc, otypes
Return (ufunc, otypes).
Return (ufunc, otypes).
[ "Return", "(", "ufunc", "otypes", ")", "." ]
def _get_ufunc_and_otypes(self, func, args): """Return (ufunc, otypes).""" # frompyfunc will fail if args is empty if not args: raise ValueError('args can not be empty') if self.otypes: otypes = self.otypes nout = len(otypes) # Note logic...
[ "def", "_get_ufunc_and_otypes", "(", "self", ",", "func", ",", "args", ")", ":", "# frompyfunc will fail if args is empty", "if", "not", "args", ":", "raise", "ValueError", "(", "'args can not be empty'", ")", "if", "self", ".", "otypes", ":", "otypes", "=", "se...
https://github.com/khanhnamle1994/natural-language-processing/blob/01d450d5ac002b0156ef4cf93a07cb508c1bcdc5/assignment1/.env/lib/python2.7/site-packages/numpy/lib/function_base.py#L1702-L1756
python/cpython
e13cdca0f5224ec4e23bdd04bb3120506964bc8b
Lib/turtle.py
python
RawTurtle.ondrag
(self, fun, btn=1, add=None)
Bind fun to mouse-move event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. btn -- number of the mouse-button defaults to 1 (left mouse button). Every sequence of mo...
Bind fun to mouse-move event on this turtle on canvas.
[ "Bind", "fun", "to", "mouse", "-", "move", "event", "on", "this", "turtle", "on", "canvas", "." ]
def ondrag(self, fun, btn=1, add=None): """Bind fun to mouse-move event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. btn -- number of the mouse-button defaults to 1...
[ "def", "ondrag", "(", "self", ",", "fun", ",", "btn", "=", "1", ",", "add", "=", "None", ")", ":", "self", ".", "screen", ".", "_ondrag", "(", "self", ".", "turtle", ".", "_item", ",", "fun", ",", "btn", ",", "add", ")" ]
https://github.com/python/cpython/blob/e13cdca0f5224ec4e23bdd04bb3120506964bc8b/Lib/turtle.py#L3587-L3605
sametmax/Django--an-app-at-a-time
99eddf12ead76e6dfbeb09ce0bae61e282e22f8a
ignore_this_directory/django/db/backends/oracle/introspection.py
python
DatabaseIntrospection.get_table_description
(self, cursor, table_name)
return description
Return a description of the table with the DB-API cursor.description interface.
Return a description of the table with the DB-API cursor.description interface.
[ "Return", "a", "description", "of", "the", "table", "with", "the", "DB", "-", "API", "cursor", ".", "description", "interface", "." ]
def get_table_description(self, cursor, table_name): """ Return a description of the table with the DB-API cursor.description interface. """ # user_tab_columns gives data default for columns cursor.execute(""" SELECT column_name, ...
[ "def", "get_table_description", "(", "self", ",", "cursor", ",", "table_name", ")", ":", "# user_tab_columns gives data default for columns", "cursor", ".", "execute", "(", "\"\"\"\n SELECT\n column_name,\n data_default,\n CASE\n ...
https://github.com/sametmax/Django--an-app-at-a-time/blob/99eddf12ead76e6dfbeb09ce0bae61e282e22f8a/ignore_this_directory/django/db/backends/oracle/introspection.py#L67-L104
qutip/qutip
52d01da181a21b810c3407812c670f35fdc647e8
qutip/nonmarkov/bofin_solvers.py
python
HEOMSolver._configure_solver
(self)
Set up the solver.
Set up the solver.
[ "Set", "up", "the", "solver", "." ]
def _configure_solver(self): """ Set up the solver. """ RHSmat = self._rhs(self._L0.data) assert isinstance(RHSmat, sp.csr_matrix) if self._is_timedep: # In the time dependent case, we construct the parameters # for the ODE gradient function _dsuper_list_td under...
[ "def", "_configure_solver", "(", "self", ")", ":", "RHSmat", "=", "self", ".", "_rhs", "(", "self", ".", "_L0", ".", "data", ")", "assert", "isinstance", "(", "RHSmat", ",", "sp", ".", "csr_matrix", ")", "if", "self", ".", "_is_timedep", ":", "# In the...
https://github.com/qutip/qutip/blob/52d01da181a21b810c3407812c670f35fdc647e8/qutip/nonmarkov/bofin_solvers.py#L656-L698
xlwings/xlwings
44395c4d18b46f76249279b7d0965e640291499c
xlwings/main.py
python
load
(index=1, header=1, chunksize=5000)
return values
Loads the selected cell(s) of the active workbook into a pandas DataFrame. If you select a single cell that has adjacent cells, the range is auto-expanded (via current region) and turned into a pandas DataFrame. If you don't have pandas installed, it returns the values as nested lists. .. note:: Only...
Loads the selected cell(s) of the active workbook into a pandas DataFrame. If you select a single cell that has adjacent cells, the range is auto-expanded (via current region) and turned into a pandas DataFrame. If you don't have pandas installed, it returns the values as nested lists.
[ "Loads", "the", "selected", "cell", "(", "s", ")", "of", "the", "active", "workbook", "into", "a", "pandas", "DataFrame", ".", "If", "you", "select", "a", "single", "cell", "that", "has", "adjacent", "cells", "the", "range", "is", "auto", "-", "expanded"...
def load(index=1, header=1, chunksize=5000): """ Loads the selected cell(s) of the active workbook into a pandas DataFrame. If you select a single cell that has adjacent cells, the range is auto-expanded (via current region) and turned into a pandas DataFrame. If you don't have pandas installed, it retu...
[ "def", "load", "(", "index", "=", "1", ",", "header", "=", "1", ",", "chunksize", "=", "5000", ")", ":", "selection", "=", "books", ".", "active", ".", "selection", "if", "selection", ".", "shape", "==", "(", "1", ",", "1", ")", ":", "selection", ...
https://github.com/xlwings/xlwings/blob/44395c4d18b46f76249279b7d0965e640291499c/xlwings/main.py#L4081-L4118
tomplus/kubernetes_asyncio
f028cc793e3a2c519be6a52a49fb77ff0b014c9b
kubernetes_asyncio/client/api/authentication_v1_api.py
python
AuthenticationV1Api.create_token_review_with_http_info
(self, body, **kwargs)
return self.api_client.call_api( '/apis/authentication.k8s.io/v1/tokenreviews', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='V1TokenReview...
create_token_review # noqa: E501 create a TokenReview # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_token_review_with_http_info(body, async_req=True) >>> result = t...
create_token_review # noqa: E501
[ "create_token_review", "#", "noqa", ":", "E501" ]
def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_token_review # noqa: E501 create a TokenReview # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> threa...
[ "def", "create_token_review_with_http_info", "(", "self", ",", "body", ",", "*", "*", "kwargs", ")", ":", "# noqa: E501", "local_var_params", "=", "locals", "(", ")", "all_params", "=", "[", "'body'", ",", "'dry_run'", ",", "'field_manager'", ",", "'pretty'", ...
https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/api/authentication_v1_api.py#L67-L166
google/trax
d6cae2067dedd0490b78d831033607357e975015
trax/data/inputs.py
python
lower_endian_to_number
(l, base)
return sum([d * (base**i) for i, d in enumerate(l)])
Helper function: convert a list of digits in the given base to a number.
Helper function: convert a list of digits in the given base to a number.
[ "Helper", "function", ":", "convert", "a", "list", "of", "digits", "in", "the", "given", "base", "to", "a", "number", "." ]
def lower_endian_to_number(l, base): """Helper function: convert a list of digits in the given base to a number.""" return sum([d * (base**i) for i, d in enumerate(l)])
[ "def", "lower_endian_to_number", "(", "l", ",", "base", ")", ":", "return", "sum", "(", "[", "d", "*", "(", "base", "**", "i", ")", "for", "i", ",", "d", "in", "enumerate", "(", "l", ")", "]", ")" ]
https://github.com/google/trax/blob/d6cae2067dedd0490b78d831033607357e975015/trax/data/inputs.py#L1045-L1047
cea-sec/miasm
09376c524aedc7920a7eda304d6095e12f6958f4
miasm/core/ctypesmngr.py
python
CAstTypes.ast_to_typeid_struct
(self, ast)
return decl
Return the CTypeBase of an Struct ast
Return the CTypeBase of an Struct ast
[ "Return", "the", "CTypeBase", "of", "an", "Struct", "ast" ]
def ast_to_typeid_struct(self, ast): """Return the CTypeBase of an Struct ast""" name = self.gen_uniq_name() if ast.name is None else ast.name args = [] if ast.decls: for arg in ast.decls: if arg.name is None: arg_name = self.gen_anon_name(...
[ "def", "ast_to_typeid_struct", "(", "self", ",", "ast", ")", ":", "name", "=", "self", ".", "gen_uniq_name", "(", ")", "if", "ast", ".", "name", "is", "None", "else", "ast", ".", "name", "args", "=", "[", "]", "if", "ast", ".", "decls", ":", "for",...
https://github.com/cea-sec/miasm/blob/09376c524aedc7920a7eda304d6095e12f6958f4/miasm/core/ctypesmngr.py#L563-L575
LuxCoreRender/BlendLuxCore
bf31ca58501d54c02acd97001b6db7de81da7cbf
utils/render.py
python
update_status_msg
(stats, engine, scene, config, time_until_film_refresh)
Show stats string in UI. This function is only used for final renders, not viewport renders.
Show stats string in UI. This function is only used for final renders, not viewport renders.
[ "Show", "stats", "string", "in", "UI", ".", "This", "function", "is", "only", "used", "for", "final", "renders", "not", "viewport", "renders", "." ]
def update_status_msg(stats, engine, scene, config, time_until_film_refresh): """ Show stats string in UI. This function is only used for final renders, not viewport renders. """ pretty_stats = get_pretty_stats(config, stats, scene) # Update the stats that are shown in the image tools area r...
[ "def", "update_status_msg", "(", "stats", ",", "engine", ",", "scene", ",", "config", ",", "time_until_film_refresh", ")", ":", "pretty_stats", "=", "get_pretty_stats", "(", "config", ",", "stats", ",", "scene", ")", "# Update the stats that are shown in the image too...
https://github.com/LuxCoreRender/BlendLuxCore/blob/bf31ca58501d54c02acd97001b6db7de81da7cbf/utils/render.py#L73-L150
pyserial/pyserial
31fa4807d73ed4eb9891a88a15817b439c4eea2d
serial/urlhandler/protocol_spy.py
python
FormatHexdump.rx
(self, data)
show received data as hex dump
show received data as hex dump
[ "show", "received", "data", "as", "hex", "dump" ]
def rx(self, data): """show received data as hex dump""" if self.color: self.output.write(self.rx_color) if data: for offset, row in hexdump(data): self.write_line(time.time() - self.start_time, 'RX', '{:04X} '.format(offset), row) else: ...
[ "def", "rx", "(", "self", ",", "data", ")", ":", "if", "self", ".", "color", ":", "self", ".", "output", ".", "write", "(", "self", ".", "rx_color", ")", "if", "data", ":", "for", "offset", ",", "row", "in", "hexdump", "(", "data", ")", ":", "s...
https://github.com/pyserial/pyserial/blob/31fa4807d73ed4eb9891a88a15817b439c4eea2d/serial/urlhandler/protocol_spy.py#L132-L140
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework
cb692f527e4e819b6c228187c5702d990a180043
external/Scripting Engine/Xenotix Python Scripting Engine/bin/x86/Debug/Lib/logging/config.py
python
DictConfigurator.add_filters
(self, filterer, filters)
Add filters to a filterer from a list of names.
Add filters to a filterer from a list of names.
[ "Add", "filters", "to", "a", "filterer", "from", "a", "list", "of", "names", "." ]
def add_filters(self, filterer, filters): """Add filters to a filterer from a list of names.""" for f in filters: try: filterer.addFilter(self.config['filters'][f]) except StandardError, e: raise ValueError('Unable to add filter %r: %s' % (f, e))
[ "def", "add_filters", "(", "self", ",", "filterer", ",", "filters", ")", ":", "for", "f", "in", "filters", ":", "try", ":", "filterer", ".", "addFilter", "(", "self", ".", "config", "[", "'filters'", "]", "[", "f", "]", ")", "except", "StandardError", ...
https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/Xenotix Python Scripting Engine/bin/x86/Debug/Lib/logging/config.py#L672-L678
MongoEngine/mongoengine
8af88780370920389a9436682c5029f32d888631
mongoengine/queryset/base.py
python
BaseQuerySet.limit
(self, n)
return queryset
Limit the number of returned documents to `n`. This may also be achieved using array-slicing syntax (e.g. ``User.objects[:5]``). :param n: the maximum number of objects to return if n is greater than 0. When 0 is passed, returns all the documents in the cursor
Limit the number of returned documents to `n`. This may also be achieved using array-slicing syntax (e.g. ``User.objects[:5]``).
[ "Limit", "the", "number", "of", "returned", "documents", "to", "n", ".", "This", "may", "also", "be", "achieved", "using", "array", "-", "slicing", "syntax", "(", "e", ".", "g", ".", "User", ".", "objects", "[", ":", "5", "]", ")", "." ]
def limit(self, n): """Limit the number of returned documents to `n`. This may also be achieved using array-slicing syntax (e.g. ``User.objects[:5]``). :param n: the maximum number of objects to return if n is greater than 0. When 0 is passed, returns all the documents in the cursor ...
[ "def", "limit", "(", "self", ",", "n", ")", ":", "queryset", "=", "self", ".", "clone", "(", ")", "queryset", ".", "_limit", "=", "n", "queryset", ".", "_empty", "=", "False", "# cancels the effect of empty", "# If a cursor object has already been created, apply t...
https://github.com/MongoEngine/mongoengine/blob/8af88780370920389a9436682c5029f32d888631/mongoengine/queryset/base.py#L843-L858
panchunguang/ccks_baidu_entity_link
f6eb5298620b460f2f1222a3b182d15c938c4ea2
code/ER_ner_bert_crf.py
python
get_input
(input_file)
return inputs
[]
def get_input(input_file): data=pd.read_pickle(input_file) inputs=[data['ids'],data['seg'],np.expand_dims(data['labels'],axis=-1)] return inputs
[ "def", "get_input", "(", "input_file", ")", ":", "data", "=", "pd", ".", "read_pickle", "(", "input_file", ")", "inputs", "=", "[", "data", "[", "'ids'", "]", ",", "data", "[", "'seg'", "]", ",", "np", ".", "expand_dims", "(", "data", "[", "'labels'"...
https://github.com/panchunguang/ccks_baidu_entity_link/blob/f6eb5298620b460f2f1222a3b182d15c938c4ea2/code/ER_ner_bert_crf.py#L84-L87
tudelft3d/Random3Dcity
7fbd61bba4685b8a68a51434cb8ce0fb9ede32f5
generateCityGML.py
python
b2s
(exts)
return surfaces
Convert two points of a solid into its bounding box. (Cube-like solid parallel with axes.)
Convert two points of a solid into its bounding box. (Cube-like solid parallel with axes.)
[ "Convert", "two", "points", "of", "a", "solid", "into", "its", "bounding", "box", ".", "(", "Cube", "-", "like", "solid", "parallel", "with", "axes", ".", ")" ]
def b2s(exts): """Convert two points of a solid into its bounding box. (Cube-like solid parallel with axes.) """ p0x = exts[0][0] p0y = exts[0][1] p0 = str(p0x) + ' ' + str(p0y) + ' ' + '0.0' p0T = str(p0x) + ' ' + str(p0y) + ' ' + str(exts[1]) p1x = exts[0][2] p1y = exts[0][3] ...
[ "def", "b2s", "(", "exts", ")", ":", "p0x", "=", "exts", "[", "0", "]", "[", "0", "]", "p0y", "=", "exts", "[", "0", "]", "[", "1", "]", "p0", "=", "str", "(", "p0x", ")", "+", "' '", "+", "str", "(", "p0y", ")", "+", "' '", "+", "'0.0'...
https://github.com/tudelft3d/Random3Dcity/blob/7fbd61bba4685b8a68a51434cb8ce0fb9ede32f5/generateCityGML.py#L4186-L4213
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
ansible/roles/lib_openshift_3.2/library/oc_pvc.py
python
PersistentVolumeClaim.access_modes
(self, data)
access_modes property setter
access_modes property setter
[ "access_modes", "property", "setter" ]
def access_modes(self, data): ''' access_modes property setter''' self._access_modes = data
[ "def", "access_modes", "(", "self", ",", "data", ")", ":", "self", ".", "_access_modes", "=", "data" ]
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/ansible/roles/lib_openshift_3.2/library/oc_pvc.py#L979-L981
deanishe/alfred-workflow
70d04df5bded8e501ce3bb82fa55ecc1f947f240
workflow/update.py
python
Version.tuple
(self)
return (self.major, self.minor, self.patch, self.suffix)
Version number as a tuple of major, minor, patch, pre-release.
Version number as a tuple of major, minor, patch, pre-release.
[ "Version", "number", "as", "a", "tuple", "of", "major", "minor", "patch", "pre", "-", "release", "." ]
def tuple(self): """Version number as a tuple of major, minor, patch, pre-release.""" return (self.major, self.minor, self.patch, self.suffix)
[ "def", "tuple", "(", "self", ")", ":", "return", "(", "self", ".", "major", ",", "self", ".", "minor", ",", "self", ".", "patch", ",", "self", ".", "suffix", ")" ]
https://github.com/deanishe/alfred-workflow/blob/70d04df5bded8e501ce3bb82fa55ecc1f947f240/workflow/update.py#L285-L287
Suor/sublime-reform
605c240501d7ff9e38c38ec4a3a9c37d11561776
funcy.py
python
iffy
(pred, action=EMPTY, default=identity)
[]
def iffy(pred, action=EMPTY, default=identity): if action is EMPTY: return iffy(bool, pred) else: return lambda v: action(v) if pred(v) else \ default(v) if callable(default) else \ default
[ "def", "iffy", "(", "pred", ",", "action", "=", "EMPTY", ",", "default", "=", "identity", ")", ":", "if", "action", "is", "EMPTY", ":", "return", "iffy", "(", "bool", ",", "pred", ")", "else", ":", "return", "lambda", "v", ":", "action", "(", "v", ...
https://github.com/Suor/sublime-reform/blob/605c240501d7ff9e38c38ec4a3a9c37d11561776/funcy.py#L122-L128
fooof-tools/fooof
14d6196e0b60c7e6da95b5cf858b20adcc5fc0ac
fooof/core/strings.py
python
_format
(str_lst, concise)
return output
Format a string for printing. Parameters ---------- str_lst : list of str List containing all elements for the string, each element representing a line. concise : bool, optional, default: False Whether to print the report in a concise mode, or not. Returns ------- output : ...
Format a string for printing.
[ "Format", "a", "string", "for", "printing", "." ]
def _format(str_lst, concise): """Format a string for printing. Parameters ---------- str_lst : list of str List containing all elements for the string, each element representing a line. concise : bool, optional, default: False Whether to print the report in a concise mode, or not. ...
[ "def", "_format", "(", "str_lst", ",", "concise", ")", ":", "# Set centering value - use a smaller value if in concise mode", "center_val", "=", "SCV", "if", "concise", "else", "LCV", "# Expand the section markers to full width", "str_lst", "[", "0", "]", "=", "str_lst", ...
https://github.com/fooof-tools/fooof/blob/14d6196e0b60c7e6da95b5cf858b20adcc5fc0ac/fooof/core/strings.py#L467-L496
huggingface/transformers
623b4f7c63f60cce917677ee704d6c93ee960b4b
src/transformers/models/xlnet/modeling_tf_xlnet.py
python
TFXLNetLayer.call
( self, output_h, output_g, non_tgt_mask, attn_mask, pos_emb, seg_mat, mems, target_mapping, head_mask, output_attentions, training=False, )
return outputs
[]
def call( self, output_h, output_g, non_tgt_mask, attn_mask, pos_emb, seg_mat, mems, target_mapping, head_mask, output_attentions, training=False, ): outputs = self.rel_attn( output_h, out...
[ "def", "call", "(", "self", ",", "output_h", ",", "output_g", ",", "non_tgt_mask", ",", "attn_mask", ",", "pos_emb", ",", "seg_mat", ",", "mems", ",", "target_mapping", ",", "head_mask", ",", "output_attentions", ",", "training", "=", "False", ",", ")", ":...
https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/models/xlnet/modeling_tf_xlnet.py#L363-L397
pupil-labs/pupil
a712f94c9f38afddd64c841362e167b8ce293769
pupil_src/shared_modules/video_overlay/utils/image_manipulation.py
python
HorizontalFlip.apply_to
(self, image, parameter, *, is_fake_frame, **kwargs)
parameter: boolean indicating if image should be flipped
parameter: boolean indicating if image should be flipped
[ "parameter", ":", "boolean", "indicating", "if", "image", "should", "be", "flipped" ]
def apply_to(self, image, parameter, *, is_fake_frame, **kwargs): """parameter: boolean indicating if image should be flipped""" if parameter and not is_fake_frame: return np.fliplr(image) else: return image
[ "def", "apply_to", "(", "self", ",", "image", ",", "parameter", ",", "*", ",", "is_fake_frame", ",", "*", "*", "kwargs", ")", ":", "if", "parameter", "and", "not", "is_fake_frame", ":", "return", "np", ".", "fliplr", "(", "image", ")", "else", ":", "...
https://github.com/pupil-labs/pupil/blob/a712f94c9f38afddd64c841362e167b8ce293769/pupil_src/shared_modules/video_overlay/utils/image_manipulation.py#L40-L45
SteveDoyle2/pyNastran
eda651ac2d4883d95a34951f8a002ff94f642a1a
pyNastran/gui/utils/qt/checks/qlineedit.py
python
check_name_length
(cell)
Verifies that the string has at least 1 non-whitespace character. Parameters ---------- cell : QLineEdit a QLineEdit containing a string.
Verifies that the string has at least 1 non-whitespace character.
[ "Verifies", "that", "the", "string", "has", "at", "least", "1", "non", "-", "whitespace", "character", "." ]
def check_name_length(cell): """ Verifies that the string has at least 1 non-whitespace character. Parameters ---------- cell : QLineEdit a QLineEdit containing a string. """ cell_value = cell.text() text = cell_value.strip() if len(text): cell.setStyleSheet("QLineE...
[ "def", "check_name_length", "(", "cell", ")", ":", "cell_value", "=", "cell", ".", "text", "(", ")", "text", "=", "cell_value", ".", "strip", "(", ")", "if", "len", "(", "text", ")", ":", "cell", ".", "setStyleSheet", "(", "\"QLineEdit{background: white;}\...
https://github.com/SteveDoyle2/pyNastran/blob/eda651ac2d4883d95a34951f8a002ff94f642a1a/pyNastran/gui/utils/qt/checks/qlineedit.py#L176-L193
MalloyDelacroix/DownloaderForReddit
e2547a6d1f119b31642445e64cb21f4568ce4012
DownloaderForReddit/extractors/base_extractor.py
python
BaseExtractor.get_url_key
(cls)
return cls.url_key
Returns the url_key that each subclass must contain. The url_key is used to indicate keywords that are domain specific. The url_key must be so that if the extractor finds the key in a supplied url, the extractor object to which the key belongs can be selected to perform the link extraction. :r...
Returns the url_key that each subclass must contain. The url_key is used to indicate keywords that are domain specific. The url_key must be so that if the extractor finds the key in a supplied url, the extractor object to which the key belongs can be selected to perform the link extraction. :r...
[ "Returns", "the", "url_key", "that", "each", "subclass", "must", "contain", ".", "The", "url_key", "is", "used", "to", "indicate", "keywords", "that", "are", "domain", "specific", ".", "The", "url_key", "must", "be", "so", "that", "if", "the", "extractor", ...
def get_url_key(cls): """ Returns the url_key that each subclass must contain. The url_key is used to indicate keywords that are domain specific. The url_key must be so that if the extractor finds the key in a supplied url, the extractor object to which the key belongs can be selected ...
[ "def", "get_url_key", "(", "cls", ")", ":", "return", "cls", ".", "url_key" ]
https://github.com/MalloyDelacroix/DownloaderForReddit/blob/e2547a6d1f119b31642445e64cb21f4568ce4012/DownloaderForReddit/extractors/base_extractor.py#L70-L78
asyml/texar
a23f021dae289a3d768dc099b220952111da04fd
examples/transformer/utils/preprocess.py
python
get_preprocess_args
()
return config
Data preprocessing options.
Data preprocessing options.
[ "Data", "preprocessing", "options", "." ]
def get_preprocess_args(): """Data preprocessing options.""" class Config(): pass config = Config() parser = argparse.ArgumentParser(description='Preprocessing Options') parser.add_argument('--source_vocab', type=int, default=40000, help='Vocabulary size of source lan...
[ "def", "get_preprocess_args", "(", ")", ":", "class", "Config", "(", ")", ":", "pass", "config", "=", "Config", "(", ")", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Preprocessing Options'", ")", "parser", ".", "add_argument", ...
https://github.com/asyml/texar/blob/a23f021dae289a3d768dc099b220952111da04fd/examples/transformer/utils/preprocess.py#L98-L130
Tautulli/Tautulli
2410eb33805aaac4bd1c5dad0f71e4f15afaf742
lib/pyparsing/core.py
python
MatchFirst.__init__
(self, exprs: IterableType[ParserElement], savelist: bool = False)
[]
def __init__(self, exprs: IterableType[ParserElement], savelist: bool = False): super().__init__(exprs, savelist) if self.exprs: self.mayReturnEmpty = any(e.mayReturnEmpty for e in self.exprs) self.skipWhitespace = all(e.skipWhitespace for e in self.exprs) else: ...
[ "def", "__init__", "(", "self", ",", "exprs", ":", "IterableType", "[", "ParserElement", "]", ",", "savelist", ":", "bool", "=", "False", ")", ":", "super", "(", ")", ".", "__init__", "(", "exprs", ",", "savelist", ")", "if", "self", ".", "exprs", ":...
https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/pyparsing/core.py#L4046-L4052
SymbiFlow/symbiflow-arch-defs
f38793112ff78a06de9f1e3269bd22543e29729f
xc/common/utils/prjxray_form_channels.py
python
traverse_pip
(conn, wire_in_tile_pkey)
return None
Given a generic wire, find (if any) the wire on the other side of a pip. Returns None if no wire or pip connects to this wire.
Given a generic wire, find (if any) the wire on the other side of a pip.
[ "Given", "a", "generic", "wire", "find", "(", "if", "any", ")", "the", "wire", "on", "the", "other", "side", "of", "a", "pip", "." ]
def traverse_pip(conn, wire_in_tile_pkey): """ Given a generic wire, find (if any) the wire on the other side of a pip. Returns None if no wire or pip connects to this wire. """ cur = conn.cursor() cur.execute( """ SELECT src_wire_in_tile_pkey FROM pip_in_tile WHERE is_pseudo = 0 AND ...
[ "def", "traverse_pip", "(", "conn", ",", "wire_in_tile_pkey", ")", ":", "cur", "=", "conn", ".", "cursor", "(", ")", "cur", ".", "execute", "(", "\"\"\"\nSELECT src_wire_in_tile_pkey FROM pip_in_tile WHERE\n is_pseudo = 0 AND\n dest_wire_in_tile_pkey = ?\n ;\"\"\"", ...
https://github.com/SymbiFlow/symbiflow-arch-defs/blob/f38793112ff78a06de9f1e3269bd22543e29729f/xc/common/utils/prjxray_form_channels.py#L1605-L1637
google/qkeras
e0faa69b3a3d99850b06c5793e6831b7d9b83306
qkeras/autoqkeras/autoqkeras_internal.py
python
AutoQKHyperModel._adjust_limit
(self, default)
Makes sure limit has all the fields required.
Makes sure limit has all the fields required.
[ "Makes", "sure", "limit", "has", "all", "the", "fields", "required", "." ]
def _adjust_limit(self, default): """Makes sure limit has all the fields required.""" if isinstance(default, list): assert 3 <= len(default) <= 4 else: default = [default] * 3 # we consider that if name is not there, we will ignore the layer for name in REGISTERED_LAYERS: if name...
[ "def", "_adjust_limit", "(", "self", ",", "default", ")", ":", "if", "isinstance", "(", "default", ",", "list", ")", ":", "assert", "3", "<=", "len", "(", "default", ")", "<=", "4", "else", ":", "default", "=", "[", "default", "]", "*", "3", "# we ...
https://github.com/google/qkeras/blob/e0faa69b3a3d99850b06c5793e6831b7d9b83306/qkeras/autoqkeras/autoqkeras_internal.py#L178-L194
open-cogsci/OpenSesame
c4a3641b097a80a76937edbd8c365f036bcc9705
libqtopensesame/items/feedpad.py
python
feedpad.init_edit_widget
(self)
desc: Initializes the widget.
desc: Initializes the widget.
[ "desc", ":", "Initializes", "the", "widget", "." ]
def init_edit_widget(self): """ desc: Initializes the widget. """ qtplugin.init_edit_widget(self, False) self.canvas = sketchpad_canvas(self) self.sketchpad_widget = sketchpad_widget(self) self.add_widget(self.sketchpad_widget) self.auto_add_widget(self.sketchpad_widget.ui.edit_duration, u'durat...
[ "def", "init_edit_widget", "(", "self", ")", ":", "qtplugin", ".", "init_edit_widget", "(", "self", ",", "False", ")", "self", ".", "canvas", "=", "sketchpad_canvas", "(", "self", ")", "self", ".", "sketchpad_widget", "=", "sketchpad_widget", "(", "self", ")...
https://github.com/open-cogsci/OpenSesame/blob/c4a3641b097a80a76937edbd8c365f036bcc9705/libqtopensesame/items/feedpad.py#L37-L53
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/helpers/script.py
python
trace_action
(hass, script_run, stop, variables)
Trace action execution.
Trace action execution.
[ "Trace", "action", "execution", "." ]
async def trace_action(hass, script_run, stop, variables): """Trace action execution.""" path = trace_path_get() trace_element = action_trace_append(variables, path) trace_stack_push(trace_stack_cv, trace_element) trace_id = trace_id_get() if trace_id: key = trace_id[0] run_id =...
[ "async", "def", "trace_action", "(", "hass", ",", "script_run", ",", "stop", ",", "variables", ")", ":", "path", "=", "trace_path_get", "(", ")", "trace_element", "=", "action_trace_append", "(", "variables", ",", "path", ")", "trace_stack_push", "(", "trace_s...
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/helpers/script.py#L137-L196
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/Python-2.7.9/Lib/optparse.py
python
OptionParser._get_args
(self, args)
[]
def _get_args(self, args): if args is None: return sys.argv[1:] else: return args[:]
[ "def", "_get_args", "(", "self", ",", "args", ")", ":", "if", "args", "is", "None", ":", "return", "sys", ".", "argv", "[", "1", ":", "]", "else", ":", "return", "args", "[", ":", "]" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/Python-2.7.9/Lib/optparse.py#L1362-L1366
mupen64plus/mupen64plus-ui-python
e24679436a93e8aae0aa664dc4b2dea40d8236c1
src/m64py/core/vidext.py
python
Video.quit
(self)
return M64ERR_SUCCESS
Shuts down the video system.
Shuts down the video system.
[ "Shuts", "down", "the", "video", "system", "." ]
def quit(self): """Shuts down the video system.""" if self.glcontext: self.glcontext.doneCurrent() self.glcontext = None return M64ERR_SUCCESS
[ "def", "quit", "(", "self", ")", ":", "if", "self", ".", "glcontext", ":", "self", ".", "glcontext", ".", "doneCurrent", "(", ")", "self", ".", "glcontext", "=", "None", "return", "M64ERR_SUCCESS" ]
https://github.com/mupen64plus/mupen64plus-ui-python/blob/e24679436a93e8aae0aa664dc4b2dea40d8236c1/src/m64py/core/vidext.py#L75-L80
hasegaw/IkaLog
bd476da541fcc296f792d4db76a6b9174c4777ad
ikalog/outputs/twitter.py
python
Twitter.check_import
(self)
[]
def check_import(self): try: from requests_oauthlib import OAuth1Session except: print("モジュール requests_oauthlib がロードできませんでした。 Twitter 投稿ができません。") print("インストールするには以下のコマンドを利用してください。\n pip install requests_oauthlib\n")
[ "def", "check_import", "(", "self", ")", ":", "try", ":", "from", "requests_oauthlib", "import", "OAuth1Session", "except", ":", "print", "(", "\"モジュール requests_oauthlib がロードできませんでした。 Twitter 投稿ができません。\")", "", "print", "(", "\"インストールするには以下のコマンドを利用してください。\\n pip install re...
https://github.com/hasegaw/IkaLog/blob/bd476da541fcc296f792d4db76a6b9174c4777ad/ikalog/outputs/twitter.py#L540-L545
osmr/imgclsmob
f2993d3ce73a2f7ddba05da3891defb08547d504
tensorflow2/tf2cv/models/fastseresnet.py
python
fastseresnet101b
(**kwargs)
return get_fastseresnet(blocks=101, conv1_stride=False, model_name="fastseresnet101b", **kwargs)
Fast-SE-ResNet-101 model with stride at the second convolution in bottleneck block from 'Squeeze-and-Excitation Networks,' https://arxiv.org/abs/1709.01507. Parameters: ---------- pretrained : bool, default False Whether to load the pretrained weights for model. root : str, default '~/.tens...
Fast-SE-ResNet-101 model with stride at the second convolution in bottleneck block from 'Squeeze-and-Excitation Networks,' https://arxiv.org/abs/1709.01507.
[ "Fast", "-", "SE", "-", "ResNet", "-", "101", "model", "with", "stride", "at", "the", "second", "convolution", "in", "bottleneck", "block", "from", "Squeeze", "-", "and", "-", "Excitation", "Networks", "https", ":", "//", "arxiv", ".", "org", "/", "abs",...
def fastseresnet101b(**kwargs): """ Fast-SE-ResNet-101 model with stride at the second convolution in bottleneck block from 'Squeeze-and-Excitation Networks,' https://arxiv.org/abs/1709.01507. Parameters: ---------- pretrained : bool, default False Whether to load the pretrained weights...
[ "def", "fastseresnet101b", "(", "*", "*", "kwargs", ")", ":", "return", "get_fastseresnet", "(", "blocks", "=", "101", ",", "conv1_stride", "=", "False", ",", "model_name", "=", "\"fastseresnet101b\"", ",", "*", "*", "kwargs", ")" ]
https://github.com/osmr/imgclsmob/blob/f2993d3ce73a2f7ddba05da3891defb08547d504/tensorflow2/tf2cv/models/fastseresnet.py#L269-L281
scanlime/coastermelt
dd9a536a6928424a5f479fd9e6b5476e34763c06
backdoor/dump.py
python
read_block
(d, address, size, max_round_trips = None, fast = False, addr_space = 'arm')
return read_word_aligned_block(d, word_address, word_size, max_round_trips=max_round_trips, fast=fast, addr_space=addr_space )[sub_begin:sub_end]
Read a block of memory, return it as a string. Reads using LDR (word-aligned) reads only. The requested block does not need to be aligned. If max_round_trips is set, we stop after that many round-trip commands to the device. This can be used for real-time applications where it may be better to hav...
Read a block of memory, return it as a string.
[ "Read", "a", "block", "of", "memory", "return", "it", "as", "a", "string", "." ]
def read_block(d, address, size, max_round_trips = None, fast = False, addr_space = 'arm'): """Read a block of memory, return it as a string. Reads using LDR (word-aligned) reads only. The requested block does not need to be aligned. If max_round_trips is set, we stop after that many round-trip co...
[ "def", "read_block", "(", "d", ",", "address", ",", "size", ",", "max_round_trips", "=", "None", ",", "fast", "=", "False", ",", "addr_space", "=", "'arm'", ")", ":", "# Convert to half-open interval [address, end)", "# Round beginning of interval down to nearest word",...
https://github.com/scanlime/coastermelt/blob/dd9a536a6928424a5f479fd9e6b5476e34763c06/backdoor/dump.py#L160-L188
aws/aws-sam-cli
2aa7bf01b2e0b0864ef63b1898a8b30577443acc
samcli/lib/providers/sam_stack_provider.py
python
SamLocalStackProvider.get_stacks
( template_file: str, stack_path: str = "", name: str = "", parameter_overrides: Optional[Dict] = None, global_parameter_overrides: Optional[Dict] = None, metadata: Optional[Dict] = None, )
return stacks, remote_stack_full_paths
Recursively extract stacks from a template file. Parameters ---------- template_file: str the file path of the template to extract stacks from stack_path: str the stack path of the parent stack, for root stack, it is "" name: str the name of t...
Recursively extract stacks from a template file.
[ "Recursively", "extract", "stacks", "from", "a", "template", "file", "." ]
def get_stacks( template_file: str, stack_path: str = "", name: str = "", parameter_overrides: Optional[Dict] = None, global_parameter_overrides: Optional[Dict] = None, metadata: Optional[Dict] = None, ) -> Tuple[List[Stack], List[str]]: """ Recursivel...
[ "def", "get_stacks", "(", "template_file", ":", "str", ",", "stack_path", ":", "str", "=", "\"\"", ",", "name", ":", "str", "=", "\"\"", ",", "parameter_overrides", ":", "Optional", "[", "Dict", "]", "=", "None", ",", "global_parameter_overrides", ":", "Op...
https://github.com/aws/aws-sam-cli/blob/2aa7bf01b2e0b0864ef63b1898a8b30577443acc/samcli/lib/providers/sam_stack_provider.py#L194-L259
naftaliharris/tauthon
5587ceec329b75f7caf6d65a036db61ac1bae214
Lib/lib-tk/Tkinter.py
python
Misc.unbind_class
(self, className, sequence)
Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE all functions.
Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE all functions.
[ "Unbind", "for", "all", "widgets", "with", "bindtag", "CLASSNAME", "for", "event", "SEQUENCE", "all", "functions", "." ]
def unbind_class(self, className, sequence): """Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE all functions.""" self.tk.call('bind', className , sequence, '')
[ "def", "unbind_class", "(", "self", ",", "className", ",", "sequence", ")", ":", "self", ".", "tk", ".", "call", "(", "'bind'", ",", "className", ",", "sequence", ",", "''", ")" ]
https://github.com/naftaliharris/tauthon/blob/5587ceec329b75f7caf6d65a036db61ac1bae214/Lib/lib-tk/Tkinter.py#L1129-L1132
home-assistant/core
265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1
homeassistant/components/smartthings/climate.py
python
SmartThingsAirConditioner.current_temperature
(self)
return self._device.status.temperature
Return the current temperature.
Return the current temperature.
[ "Return", "the", "current", "temperature", "." ]
def current_temperature(self): """Return the current temperature.""" return self._device.status.temperature
[ "def", "current_temperature", "(", "self", ")", ":", "return", "self", ".", "_device", ".", "status", ".", "temperature" ]
https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/smartthings/climate.py#L417-L419
openshift/openshift-tools
1188778e728a6e4781acf728123e5b356380fe6f
openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/library/oc_edit.py
python
Utils.cleanup
(files)
Clean up on exit
Clean up on exit
[ "Clean", "up", "on", "exit" ]
def cleanup(files): '''Clean up on exit ''' for sfile in files: if os.path.exists(sfile): if os.path.isdir(sfile): shutil.rmtree(sfile) elif os.path.isfile(sfile): os.remove(sfile)
[ "def", "cleanup", "(", "files", ")", ":", "for", "sfile", "in", "files", ":", "if", "os", ".", "path", ".", "exists", "(", "sfile", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "sfile", ")", ":", "shutil", ".", "rmtree", "(", "sfile", ...
https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/library/oc_edit.py#L1275-L1282
tp4a/teleport
1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad
server/www/packages/packages-windows/x86/tornado/template.py
python
_TemplateReader.remaining
(self)
return len(self.text) - self.pos
[]
def remaining(self) -> int: return len(self.text) - self.pos
[ "def", "remaining", "(", "self", ")", "->", "int", ":", "return", "len", "(", "self", ".", "text", ")", "-", "self", ".", "pos" ]
https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-windows/x86/tornado/template.py#L808-L809
Yelp/Tron
d60b015163418bf66f638e4c12337289ad8c040a
tron/serialize/filehandler.py
python
FileHandleManager.remove
(self, fh_wrapper)
Remove the fh_wrapper from the cache and access_order.
Remove the fh_wrapper from the cache and access_order.
[ "Remove", "the", "fh_wrapper", "from", "the", "cache", "and", "access_order", "." ]
def remove(self, fh_wrapper): """Remove the fh_wrapper from the cache and access_order.""" if fh_wrapper.name in self.cache: del self.cache[fh_wrapper.name]
[ "def", "remove", "(", "self", ",", "fh_wrapper", ")", ":", "if", "fh_wrapper", ".", "name", "in", "self", ".", "cache", ":", "del", "self", ".", "cache", "[", "fh_wrapper", ".", "name", "]" ]
https://github.com/Yelp/Tron/blob/d60b015163418bf66f638e4c12337289ad8c040a/tron/serialize/filehandler.py#L151-L154
tensorflow/tensorboard
61d11d99ef034c30ba20b6a7840c8eededb9031c
tensorboard/plugins/projector/projector_plugin.py
python
ProjectorPlugin.__init__
(self, context)
Instantiates ProjectorPlugin via TensorBoard core. Args: context: A base_plugin.TBContext instance.
Instantiates ProjectorPlugin via TensorBoard core.
[ "Instantiates", "ProjectorPlugin", "via", "TensorBoard", "core", "." ]
def __init__(self, context): """Instantiates ProjectorPlugin via TensorBoard core. Args: context: A base_plugin.TBContext instance. """ self.data_provider = context.data_provider self.logdir = context.logdir self.readers = {} self._run_paths = None ...
[ "def", "__init__", "(", "self", ",", "context", ")", ":", "self", ".", "data_provider", "=", "context", ".", "data_provider", "self", ".", "logdir", "=", "context", ".", "logdir", "self", ".", "readers", "=", "{", "}", "self", ".", "_run_paths", "=", "...
https://github.com/tensorflow/tensorboard/blob/61d11d99ef034c30ba20b6a7840c8eededb9031c/tensorboard/plugins/projector/projector_plugin.py#L238-L259
quodlibet/mutagen
399513b167ed00c4b7a9ef98dfe591a276efb701
mutagen/oggvorbis.py
python
OggVorbisInfo.__init__
(self, fileobj)
Raises ogg.error, IOError
Raises ogg.error, IOError
[ "Raises", "ogg", ".", "error", "IOError" ]
def __init__(self, fileobj): """Raises ogg.error, IOError""" page = OggPage(fileobj) if not page.packets: raise OggVorbisHeaderError("page has not packets") while not page.packets[0].startswith(b"\x01vorbis"): page = OggPage(fileobj) if not page.first: ...
[ "def", "__init__", "(", "self", ",", "fileobj", ")", ":", "page", "=", "OggPage", "(", "fileobj", ")", "if", "not", "page", ".", "packets", ":", "raise", "OggVorbisHeaderError", "(", "\"page has not packets\"", ")", "while", "not", "page", ".", "packets", ...
https://github.com/quodlibet/mutagen/blob/399513b167ed00c4b7a9ef98dfe591a276efb701/mutagen/oggvorbis.py#L54-L87
aiidateam/aiida-core
c743a335480f8bb3a5e4ebd2463a31f9f3b9f9b2
aiida/schedulers/plugins/lsf.py
python
LsfJobResource.accepts_default_mpiprocs_per_machine
(cls)
return False
Return True if this JobResource accepts a 'default_mpiprocs_per_machine' key, False otherwise.
Return True if this JobResource accepts a 'default_mpiprocs_per_machine' key, False otherwise.
[ "Return", "True", "if", "this", "JobResource", "accepts", "a", "default_mpiprocs_per_machine", "key", "False", "otherwise", "." ]
def accepts_default_mpiprocs_per_machine(cls): """ Return True if this JobResource accepts a 'default_mpiprocs_per_machine' key, False otherwise. """ return False
[ "def", "accepts_default_mpiprocs_per_machine", "(", "cls", ")", ":", "return", "False" ]
https://github.com/aiidateam/aiida-core/blob/c743a335480f8bb3a5e4ebd2463a31f9f3b9f9b2/aiida/schedulers/plugins/lsf.py#L162-L167
phantomcyber/playbooks
9e850ecc44cb98c5dde53784744213a1ed5799bd
ip_investigate_and_report.py
python
send_email_bad_domain
(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, **kwargs)
return
[]
def send_email_bad_domain(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, **kwargs): phantom.debug('send_email_bad_domain() called') #phantom.debug('Action: {0} {1}'.format(action['name'], ('SUCCEEDED' if succes...
[ "def", "send_email_bad_domain", "(", "action", "=", "None", ",", "success", "=", "None", ",", "container", "=", "None", ",", "results", "=", "None", ",", "handle", "=", "None", ",", "filtered_artifacts", "=", "None", ",", "filtered_results", "=", "None", "...
https://github.com/phantomcyber/playbooks/blob/9e850ecc44cb98c5dde53784744213a1ed5799bd/ip_investigate_and_report.py#L246-L269
enthought/mayavi
2103a273568b8f0bd62328801aafbd6252543ae8
tvtk/misc.py
python
write_data
(dataset, fname, **kwargs)
Given a TVTK `dataset` this writes the `dataset` to a VTK XML file having file name `fname`. If the given file name has no extension, one is automatically picked based on the dataset and an XML file is written out. If the filename has a '.vtk' extension an old style VTK file is written. If any oth...
Given a TVTK `dataset` this writes the `dataset` to a VTK XML file having file name `fname`.
[ "Given", "a", "TVTK", "dataset", "this", "writes", "the", "dataset", "to", "a", "VTK", "XML", "file", "having", "file", "name", "fname", "." ]
def write_data(dataset, fname, **kwargs): """Given a TVTK `dataset` this writes the `dataset` to a VTK XML file having file name `fname`. If the given file name has no extension, one is automatically picked based on the dataset and an XML file is written out. If the filename has a '.vtk' extension...
[ "def", "write_data", "(", "dataset", ",", "fname", ",", "*", "*", "kwargs", ")", ":", "err_msg", "=", "\"Can only write tvtk.DataSet instances \"", "\"'got %s instead\"", "%", "(", "dataset", ".", "__class__", ".", "__name__", ")", "assert", "isinstance", "(", "...
https://github.com/enthought/mayavi/blob/2103a273568b8f0bd62328801aafbd6252543ae8/tvtk/misc.py#L16-L59
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework
cb692f527e4e819b6c228187c5702d990a180043
external/Scripting Engine/Xenotix Python Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/abc.py
python
abstractmethod
(funcobj)
return funcobj
A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. The abstract methods can be called using any of the normal 'super' call me...
A decorator indicating abstract methods.
[ "A", "decorator", "indicating", "abstract", "methods", "." ]
def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. The abstract methods can be called using a...
[ "def", "abstractmethod", "(", "funcobj", ")", ":", "funcobj", ".", "__isabstractmethod__", "=", "True", "return", "funcobj" ]
https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/Xenotix Python Scripting Engine/packages/IronPython.StdLib.2.7.4/content/Lib/abc.py#L15-L33
dagster-io/dagster
b27d569d5fcf1072543533a0c763815d96f90b8f
python_modules/dagster/dagster/core/execution/results.py
python
SolidExecutionResult.failure_data
(self)
Union[None, StepFailureData]: Any data corresponding to this step's failure, if it failed.
Union[None, StepFailureData]: Any data corresponding to this step's failure, if it failed.
[ "Union", "[", "None", "StepFailureData", "]", ":", "Any", "data", "corresponding", "to", "this", "step", "s", "failure", "if", "it", "failed", "." ]
def failure_data(self): """Union[None, StepFailureData]: Any data corresponding to this step's failure, if it failed.""" for step_event in self.compute_step_events: if step_event.event_type == DagsterEventType.STEP_FAILURE: return step_event.step_failure_data
[ "def", "failure_data", "(", "self", ")", ":", "for", "step_event", "in", "self", ".", "compute_step_events", ":", "if", "step_event", ".", "event_type", "==", "DagsterEventType", ".", "STEP_FAILURE", ":", "return", "step_event", ".", "step_failure_data" ]
https://github.com/dagster-io/dagster/blob/b27d569d5fcf1072543533a0c763815d96f90b8f/python_modules/dagster/dagster/core/execution/results.py#L569-L574
buke/GreenOdoo
3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df
runtime/python/lib/python2.7/logging/__init__.py
python
FileHandler.emit
(self, record)
Emit a record. If the stream was not opened because 'delay' was specified in the constructor, open it before calling the superclass's emit.
Emit a record.
[ "Emit", "a", "record", "." ]
def emit(self, record): """ Emit a record. If the stream was not opened because 'delay' was specified in the constructor, open it before calling the superclass's emit. """ if self.stream is None: self.stream = self._open() StreamHandler.emit(self, rec...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "if", "self", ".", "stream", "is", "None", ":", "self", ".", "stream", "=", "self", ".", "_open", "(", ")", "StreamHandler", ".", "emit", "(", "self", ",", "record", ")" ]
https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/python/lib/python2.7/logging/__init__.py#L930-L939
openhatch/oh-mainline
ce29352a034e1223141dcc2f317030bbc3359a51
vendor/packages/twisted/twisted/internet/_sslverify.py
python
Certificate.loadPEM
(Class, data)
return Class.load(data, crypto.FILETYPE_PEM)
Load a certificate from a PEM-format data string. @rtype: C{Class}
Load a certificate from a PEM-format data string.
[ "Load", "a", "certificate", "from", "a", "PEM", "-", "format", "data", "string", "." ]
def loadPEM(Class, data): """ Load a certificate from a PEM-format data string. @rtype: C{Class} """ return Class.load(data, crypto.FILETYPE_PEM)
[ "def", "loadPEM", "(", "Class", ",", "data", ")", ":", "return", "Class", ".", "load", "(", "data", ",", "crypto", ".", "FILETYPE_PEM", ")" ]
https://github.com/openhatch/oh-mainline/blob/ce29352a034e1223141dcc2f317030bbc3359a51/vendor/packages/twisted/twisted/internet/_sslverify.py#L198-L204
Kismuz/btgym
7fb3316e67f1d7a17c620630fb62fb29428b2cec
btgym/server.py
python
BTgymServer.get_global_time
(self)
return data_server_response['message']['timestamp']
Asks dataserver for current dataset global_time. Returns: POSIX timestamp
Asks dataserver for current dataset global_time.
[ "Asks", "dataserver", "for", "current", "dataset", "global_time", "." ]
def get_global_time(self): """ Asks dataserver for current dataset global_time. Returns: POSIX timestamp """ data_server_response = self._comm_with_timeout( socket=self.data_socket, message={'ctrl': '_get_global_time'} ) if dat...
[ "def", "get_global_time", "(", "self", ")", ":", "data_server_response", "=", "self", ".", "_comm_with_timeout", "(", "socket", "=", "self", ".", "data_socket", ",", "message", "=", "{", "'ctrl'", ":", "'_get_global_time'", "}", ")", "if", "data_server_response"...
https://github.com/Kismuz/btgym/blob/7fb3316e67f1d7a17c620630fb62fb29428b2cec/btgym/server.py#L437-L457
jonathanslenders/asyncio-redis
50d71a53798967f7fdf1be36b8447e322dedc5ee
asyncio_redis/protocol.py
python
RedisProtocol.sinter
(self, tr, keys: ListOf(NativeType))
return self._query(tr, b"sinter", *map(self.encode_from_native, keys))
Intersect multiple sets
Intersect multiple sets
[ "Intersect", "multiple", "sets" ]
def sinter(self, tr, keys: ListOf(NativeType)) -> SetReply: """Intersect multiple sets """ return self._query(tr, b"sinter", *map(self.encode_from_native, keys))
[ "def", "sinter", "(", "self", ",", "tr", ",", "keys", ":", "ListOf", "(", "NativeType", ")", ")", "->", "SetReply", ":", "return", "self", ".", "_query", "(", "tr", ",", "b\"sinter\"", ",", "*", "map", "(", "self", ".", "encode_from_native", ",", "ke...
https://github.com/jonathanslenders/asyncio-redis/blob/50d71a53798967f7fdf1be36b8447e322dedc5ee/asyncio_redis/protocol.py#L1553-L1556
OpenCobolIDE/OpenCobolIDE
c78d0d335378e5fe0a5e74f53c19b68b55e85388
open_cobol_ide/extlibs/keyring/backends/kwallet.py
python
DBusKeyring.__init__
(self, *arg, **kw)
[]
def __init__(self, *arg, **kw): super(DBusKeyring, self).__init__(*arg, **kw) self.handle = -1
[ "def", "__init__", "(", "self", ",", "*", "arg", ",", "*", "*", "kw", ")", ":", "super", "(", "DBusKeyring", ",", "self", ")", ".", "__init__", "(", "*", "arg", ",", "*", "*", "kw", ")", "self", ".", "handle", "=", "-", "1" ]
https://github.com/OpenCobolIDE/OpenCobolIDE/blob/c78d0d335378e5fe0a5e74f53c19b68b55e85388/open_cobol_ide/extlibs/keyring/backends/kwallet.py#L34-L36
webpy/webpy
62245f7da4aab8f8607c192b98d5ef93873f995b
web/utils.py
python
_EmailMessage.default_email_sender
(self, message_text)
[]
def default_email_sender(self, message_text): try: from . import webapi except ImportError: webapi = Storage(config=Storage()) sendmail = webapi.config.get("sendmail_path", "/usr/sbin/sendmail") assert not self.from_address.startswith("-"), "security" f...
[ "def", "default_email_sender", "(", "self", ",", "message_text", ")", ":", "try", ":", "from", ".", "import", "webapi", "except", "ImportError", ":", "webapi", "=", "Storage", "(", "config", "=", "Storage", "(", ")", ")", "sendmail", "=", "webapi", ".", ...
https://github.com/webpy/webpy/blob/62245f7da4aab8f8607c192b98d5ef93873f995b/web/utils.py#L1595-L1613
securesystemslab/zippy
ff0e84ac99442c2c55fe1d285332cfd4e185e089
zippy/benchmarks/src/benchmarks/whoosh/src/whoosh/matching/wrappers.py
python
ConstantScoreWrapperMatcher._replacement
(self, newchild)
return self.__class__(newchild, score=self._score)
[]
def _replacement(self, newchild): return self.__class__(newchild, score=self._score)
[ "def", "_replacement", "(", "self", ",", "newchild", ")", ":", "return", "self", ".", "__class__", "(", "newchild", ",", "score", "=", "self", ".", "_score", ")" ]
https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/whoosh/src/whoosh/matching/wrappers.py#L500-L501