nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/model.py | python | FeedForward._is_data_arg | (name) | return name.endswith('data') or name.endswith('label') | Check if name is a data argument. | Check if name is a data argument. | [
"Check",
"if",
"name",
"is",
"a",
"data",
"argument",
"."
] | def _is_data_arg(name):
"""Check if name is a data argument."""
return name.endswith('data') or name.endswith('label') | [
"def",
"_is_data_arg",
"(",
"name",
")",
":",
"return",
"name",
".",
"endswith",
"(",
"'data'",
")",
"or",
"name",
".",
"endswith",
"(",
"'label'",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/model.py#L541-L543 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozversioncontrol/mozversioncontrol/repoupdate.py | python | update_git_repo | (git, repo, path, revision='origin/master') | Ensure a Git repository exists at a path and is up to date. | Ensure a Git repository exists at a path and is up to date. | [
"Ensure",
"a",
"Git",
"repository",
"exists",
"at",
"a",
"path",
"and",
"is",
"up",
"to",
"date",
"."
] | def update_git_repo(git, repo, path, revision='origin/master'):
"""Ensure a Git repository exists at a path and is up to date."""
if os.path.exists(path):
subprocess.check_call([git, 'fetch', '--all'], cwd=path)
else:
subprocess.check_call([git, 'clone', repo, path])
subprocess.check_ca... | [
"def",
"update_git_repo",
"(",
"git",
",",
"repo",
",",
"path",
",",
"revision",
"=",
"'origin/master'",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"subprocess",
".",
"check_call",
"(",
"[",
"git",
",",
"'fetch'",
",",
"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozversioncontrol/mozversioncontrol/repoupdate.py#L31-L38 | ||
stepcode/stepcode | 2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39 | src/exp2python/python/SCL/Part21.py | python | Parser.p_header_section_with_entity_list | (self, p) | header_section : HEADER_SEC header_entity header_entity header_entity header_entity_list ENDSEC | header_section : HEADER_SEC header_entity header_entity header_entity header_entity_list ENDSEC | [
"header_section",
":",
"HEADER_SEC",
"header_entity",
"header_entity",
"header_entity",
"header_entity_list",
"ENDSEC"
] | def p_header_section_with_entity_list(self, p):
"""header_section : HEADER_SEC header_entity header_entity header_entity header_entity_list ENDSEC"""
p[0] = P21Header(p[2], p[3], p[4])
p[0].extra_headers.extend(p[5]) | [
"def",
"p_header_section_with_entity_list",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"P21Header",
"(",
"p",
"[",
"2",
"]",
",",
"p",
"[",
"3",
"]",
",",
"p",
"[",
"4",
"]",
")",
"p",
"[",
"0",
"]",
".",
"extra_headers",
".",
... | https://github.com/stepcode/stepcode/blob/2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39/src/exp2python/python/SCL/Part21.py#L303-L306 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/kvstore_server.py | python | _init_kvstore_server_module | () | Start server/scheduler. | Start server/scheduler. | [
"Start",
"server",
"/",
"scheduler",
"."
] | def _init_kvstore_server_module():
"""Start server/scheduler."""
is_worker = ctypes.c_int()
check_call(_LIB.MXKVStoreIsWorkerNode(ctypes.byref(is_worker)))
if is_worker.value == 0:
kvstore = create('dist')
server = KVStoreServer(kvstore)
server.run()
sys.exit() | [
"def",
"_init_kvstore_server_module",
"(",
")",
":",
"is_worker",
"=",
"ctypes",
".",
"c_int",
"(",
")",
"check_call",
"(",
"_LIB",
".",
"MXKVStoreIsWorkerNode",
"(",
"ctypes",
".",
"byref",
"(",
"is_worker",
")",
")",
")",
"if",
"is_worker",
".",
"value",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/kvstore_server.py#L75-L83 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/window/rolling.py | python | BaseWindow._resolve_output | (self, out: DataFrame, obj: DataFrame) | return out | Validate and finalize result. | Validate and finalize result. | [
"Validate",
"and",
"finalize",
"result",
"."
] | def _resolve_output(self, out: DataFrame, obj: DataFrame) -> DataFrame:
"""Validate and finalize result."""
if out.shape[1] == 0 and obj.shape[1] > 0:
raise DataError("No numeric types to aggregate")
elif out.shape[1] == 0:
return obj.astype("float64")
self._inse... | [
"def",
"_resolve_output",
"(",
"self",
",",
"out",
":",
"DataFrame",
",",
"obj",
":",
"DataFrame",
")",
"->",
"DataFrame",
":",
"if",
"out",
".",
"shape",
"[",
"1",
"]",
"==",
"0",
"and",
"obj",
".",
"shape",
"[",
"1",
"]",
">",
"0",
":",
"raise"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/window/rolling.py#L368-L376 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/redshift/layer1.py | python | RedshiftConnection.modify_cluster | (self, cluster_identifier, cluster_type=None,
node_type=None, number_of_nodes=None,
cluster_security_groups=None,
vpc_security_group_ids=None,
master_user_password=None,
cluster_parameter_group_name=None,
... | return self._make_request(
action='ModifyCluster',
verb='POST',
path='/', params=params) | Modifies the settings for a cluster. For example, you can add
another security or parameter group, update the preferred
maintenance window, or change the master user password.
Resetting a cluster password or modifying the security groups
associated with a cluster do not need a reboot. Ho... | Modifies the settings for a cluster. For example, you can add
another security or parameter group, update the preferred
maintenance window, or change the master user password.
Resetting a cluster password or modifying the security groups
associated with a cluster do not need a reboot. Ho... | [
"Modifies",
"the",
"settings",
"for",
"a",
"cluster",
".",
"For",
"example",
"you",
"can",
"add",
"another",
"security",
"or",
"parameter",
"group",
"update",
"the",
"preferred",
"maintenance",
"window",
"or",
"change",
"the",
"master",
"user",
"password",
"."... | def modify_cluster(self, cluster_identifier, cluster_type=None,
node_type=None, number_of_nodes=None,
cluster_security_groups=None,
vpc_security_group_ids=None,
master_user_password=None,
cluster_parameter... | [
"def",
"modify_cluster",
"(",
"self",
",",
"cluster_identifier",
",",
"cluster_type",
"=",
"None",
",",
"node_type",
"=",
"None",
",",
"number_of_nodes",
"=",
"None",
",",
"cluster_security_groups",
"=",
"None",
",",
"vpc_security_group_ids",
"=",
"None",
",",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/redshift/layer1.py#L2252-L2489 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pyparsing/py3/pyparsing/results.py | python | ParseResults.pop | (self, *args, **kwargs) | Removes and returns item at specified index (default= ``last``).
Supports both ``list`` and ``dict`` semantics for ``pop()``. If
passed no argument or an integer argument, it will use ``list``
semantics and pop tokens from the list of parsed tokens. If passed
a non-integer argument (most... | Removes and returns item at specified index (default= ``last``).
Supports both ``list`` and ``dict`` semantics for ``pop()``. If
passed no argument or an integer argument, it will use ``list``
semantics and pop tokens from the list of parsed tokens. If passed
a non-integer argument (most... | [
"Removes",
"and",
"returns",
"item",
"at",
"specified",
"index",
"(",
"default",
"=",
"last",
")",
".",
"Supports",
"both",
"list",
"and",
"dict",
"semantics",
"for",
"pop",
"()",
".",
"If",
"passed",
"no",
"argument",
"or",
"an",
"integer",
"argument",
... | def pop(self, *args, **kwargs):
"""
Removes and returns item at specified index (default= ``last``).
Supports both ``list`` and ``dict`` semantics for ``pop()``. If
passed no argument or an integer argument, it will use ``list``
semantics and pop tokens from the list of parsed to... | [
"def",
"pop",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"args",
":",
"args",
"=",
"[",
"-",
"1",
"]",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"if",
"k",
"==",
"\"default\"",
":... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pyparsing/py3/pyparsing/results.py#L268-L324 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/events.py | python | set_event_loop | (loop) | Equivalent to calling get_event_loop_policy().set_event_loop(loop). | Equivalent to calling get_event_loop_policy().set_event_loop(loop). | [
"Equivalent",
"to",
"calling",
"get_event_loop_policy",
"()",
".",
"set_event_loop",
"(",
"loop",
")",
"."
] | def set_event_loop(loop):
"""Equivalent to calling get_event_loop_policy().set_event_loop(loop)."""
get_event_loop_policy().set_event_loop(loop) | [
"def",
"set_event_loop",
"(",
"loop",
")",
":",
"get_event_loop_policy",
"(",
")",
".",
"set_event_loop",
"(",
"loop",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/events.py#L755-L757 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/ceph_manager.py | python | CephManager.get_filepath | (self) | return '/var/lib/ceph/osd/' + self.cluster + '-{id}' | Return path to osd data with {id} needing to be replaced | Return path to osd data with {id} needing to be replaced | [
"Return",
"path",
"to",
"osd",
"data",
"with",
"{",
"id",
"}",
"needing",
"to",
"be",
"replaced"
] | def get_filepath(self):
"""
Return path to osd data with {id} needing to be replaced
"""
return '/var/lib/ceph/osd/' + self.cluster + '-{id}' | [
"def",
"get_filepath",
"(",
"self",
")",
":",
"return",
"'/var/lib/ceph/osd/'",
"+",
"self",
".",
"cluster",
"+",
"'-{id}'"
] | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L3150-L3154 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xpathParserContext.xpathPositionFunction | (self, nargs) | Implement the position() XPath function number position()
The position function returns the position of the context
node in the context node list. The first position is 1, and
so the last position will be equal to last(). | Implement the position() XPath function number position()
The position function returns the position of the context
node in the context node list. The first position is 1, and
so the last position will be equal to last(). | [
"Implement",
"the",
"position",
"()",
"XPath",
"function",
"number",
"position",
"()",
"The",
"position",
"function",
"returns",
"the",
"position",
"of",
"the",
"context",
"node",
"in",
"the",
"context",
"node",
"list",
".",
"The",
"first",
"position",
"is",
... | def xpathPositionFunction(self, nargs):
"""Implement the position() XPath function number position()
The position function returns the position of the context
node in the context node list. The first position is 1, and
so the last position will be equal to last(). """
libx... | [
"def",
"xpathPositionFunction",
"(",
"self",
",",
"nargs",
")",
":",
"libxml2mod",
".",
"xmlXPathPositionFunction",
"(",
"self",
".",
"_o",
",",
"nargs",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L7816-L7821 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Event.ShouldProcessOnlyIn | (*args, **kwargs) | return _core_.Event_ShouldProcessOnlyIn(*args, **kwargs) | ShouldProcessOnlyIn(self, EvtHandler h) -> bool | ShouldProcessOnlyIn(self, EvtHandler h) -> bool | [
"ShouldProcessOnlyIn",
"(",
"self",
"EvtHandler",
"h",
")",
"-",
">",
"bool"
] | def ShouldProcessOnlyIn(*args, **kwargs):
"""ShouldProcessOnlyIn(self, EvtHandler h) -> bool"""
return _core_.Event_ShouldProcessOnlyIn(*args, **kwargs) | [
"def",
"ShouldProcessOnlyIn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Event_ShouldProcessOnlyIn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L5104-L5106 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Window.GetName | (*args, **kwargs) | return _core_.Window_GetName(*args, **kwargs) | GetName(self) -> String
Returns the windows name. This name is not guaranteed to be unique;
it is up to the programmer to supply an appropriate name in the window
constructor or via wx.Window.SetName. | GetName(self) -> String | [
"GetName",
"(",
"self",
")",
"-",
">",
"String"
] | def GetName(*args, **kwargs):
"""
GetName(self) -> String
Returns the windows name. This name is not guaranteed to be unique;
it is up to the programmer to supply an appropriate name in the window
constructor or via wx.Window.SetName.
"""
return _core_.Window_Ge... | [
"def",
"GetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L9231-L9239 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | uCSIsCatCf | (code) | return ret | Check whether the character is part of Cf UCS Category | Check whether the character is part of Cf UCS Category | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Cf",
"UCS",
"Category"
] | def uCSIsCatCf(code):
"""Check whether the character is part of Cf UCS Category """
ret = libxml2mod.xmlUCSIsCatCf(code)
return ret | [
"def",
"uCSIsCatCf",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsCatCf",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1468-L1471 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | docs/scripts/doxy_md_filter.py | python | get_label | (file) | Read lines of a file and try to find a doxygen label.
If the label is not found return None.
Assume the label is in the first line
:return: A doxygen label | Read lines of a file and try to find a doxygen label.
If the label is not found return None.
Assume the label is in the first line
:return: A doxygen label | [
"Read",
"lines",
"of",
"a",
"file",
"and",
"try",
"to",
"find",
"a",
"doxygen",
"label",
".",
"If",
"the",
"label",
"is",
"not",
"found",
"return",
"None",
".",
"Assume",
"the",
"label",
"is",
"in",
"the",
"first",
"line",
":",
"return",
":",
"A",
... | def get_label(file):
"""
Read lines of a file and try to find a doxygen label.
If the label is not found return None.
Assume the label is in the first line
:return: A doxygen label
"""
with open(file, 'r', encoding='utf-8') as f:
line = f.readline()
label = re.search(LABEL_PA... | [
"def",
"get_label",
"(",
"file",
")",
":",
"with",
"open",
"(",
"file",
",",
"'r'",
",",
"encoding",
"=",
"'utf-8'",
")",
"as",
"f",
":",
"line",
"=",
"f",
".",
"readline",
"(",
")",
"label",
"=",
"re",
".",
"search",
"(",
"LABEL_PATTERN",
",",
"... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/docs/scripts/doxy_md_filter.py#L125-L136 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py | python | Misc.winfo_rooty | (self) | return self.tk.getint(
self.tk.call('winfo', 'rooty', self._w)) | Return y coordinate of upper left corner of this widget on the
root window. | Return y coordinate of upper left corner of this widget on the
root window. | [
"Return",
"y",
"coordinate",
"of",
"upper",
"left",
"corner",
"of",
"this",
"widget",
"on",
"the",
"root",
"window",
"."
] | def winfo_rooty(self):
"""Return y coordinate of upper left corner of this widget on the
root window."""
return self.tk.getint(
self.tk.call('winfo', 'rooty', self._w)) | [
"def",
"winfo_rooty",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"getint",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'rooty'",
",",
"self",
".",
"_w",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L1060-L1064 | |
Ewenwan/MVision | 97b394dfa48cb21c82cd003b1a952745e413a17f | vSLAM/矩阵变换python函数.py | python | shear_matrix | (angle, direction, point, normal) | return M | Return matrix to shear by angle along direction vector on shear plane.
The shear plane is defined by a point and normal vector. The direction
vector must be orthogonal to the plane's normal vector.
A point P is transformed by the shear matrix into P" such that
the vector P-P" is parallel to the directio... | Return matrix to shear by angle along direction vector on shear plane.
The shear plane is defined by a point and normal vector. The direction
vector must be orthogonal to the plane's normal vector.
A point P is transformed by the shear matrix into P" such that
the vector P-P" is parallel to the directio... | [
"Return",
"matrix",
"to",
"shear",
"by",
"angle",
"along",
"direction",
"vector",
"on",
"shear",
"plane",
".",
"The",
"shear",
"plane",
"is",
"defined",
"by",
"a",
"point",
"and",
"normal",
"vector",
".",
"The",
"direction",
"vector",
"must",
"be",
"orthog... | def shear_matrix(angle, direction, point, normal):
"""Return matrix to shear by angle along direction vector on shear plane.
The shear plane is defined by a point and normal vector. The direction
vector must be orthogonal to the plane's normal vector.
A point P is transformed by the shear matrix into P"... | [
"def",
"shear_matrix",
"(",
"angle",
",",
"direction",
",",
"point",
",",
"normal",
")",
":",
"normal",
"=",
"unit_vector",
"(",
"normal",
"[",
":",
"3",
"]",
")",
"direction",
"=",
"unit_vector",
"(",
"direction",
"[",
":",
"3",
"]",
")",
"if",
"abs... | https://github.com/Ewenwan/MVision/blob/97b394dfa48cb21c82cd003b1a952745e413a17f/vSLAM/矩阵变换python函数.py#L571-L595 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py | python | AttentionWrapper._item_or_tuple | (self, seq) | Returns `seq` as tuple or the singular element.
Which is returned is determined by how the AttentionMechanism(s) were passed
to the constructor.
Args:
seq: A non-empty sequence of items or generator.
Returns:
Either the values in the sequence as a tuple if AttentionMechanism(s)
we... | Returns `seq` as tuple or the singular element. | [
"Returns",
"seq",
"as",
"tuple",
"or",
"the",
"singular",
"element",
"."
] | def _item_or_tuple(self, seq):
"""Returns `seq` as tuple or the singular element.
Which is returned is determined by how the AttentionMechanism(s) were passed
to the constructor.
Args:
seq: A non-empty sequence of items or generator.
Returns:
Either the values in the sequence as a tu... | [
"def",
"_item_or_tuple",
"(",
"self",
",",
"seq",
")",
":",
"t",
"=",
"tuple",
"(",
"seq",
")",
"if",
"self",
".",
"_is_multi",
":",
"return",
"t",
"else",
":",
"return",
"t",
"[",
"0",
"]"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py#L1163-L1180 | ||
google/iree | 1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76 | integrations/tensorflow/python_projects/iree_tf/iree/tf/support/module_utils.py | python | tf_signature_def_saved_model_to_tflite_module_bytes | (
saved_model_dir: str,
saved_model_tags: Set[str],
exported_name: str,
input_names: Sequence[str],
output_names: Sequence[str],
) | return dict([[exported_name, tflite_module]]) | Compiles a SignatureDef SavedModel signature with TFLite.
Args:
saved_model_dir: Directory of the saved model.
saved_model_tags: Optional set of tags to use when loading the model.
exported_name: A str representing the signature on the saved model to
compile.
input_names: A sequence of kwargs t... | Compiles a SignatureDef SavedModel signature with TFLite. | [
"Compiles",
"a",
"SignatureDef",
"SavedModel",
"signature",
"with",
"TFLite",
"."
] | def tf_signature_def_saved_model_to_tflite_module_bytes(
saved_model_dir: str,
saved_model_tags: Set[str],
exported_name: str,
input_names: Sequence[str],
output_names: Sequence[str],
) -> Dict[str, bytes]:
"""Compiles a SignatureDef SavedModel signature with TFLite.
Args:
saved_model_dir: ... | [
"def",
"tf_signature_def_saved_model_to_tflite_module_bytes",
"(",
"saved_model_dir",
":",
"str",
",",
"saved_model_tags",
":",
"Set",
"[",
"str",
"]",
",",
"exported_name",
":",
"str",
",",
"input_names",
":",
"Sequence",
"[",
"str",
"]",
",",
"output_names",
":"... | https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/integrations/tensorflow/python_projects/iree_tf/iree/tf/support/module_utils.py#L642-L669 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/ftplib.py | python | FTP.connect | (self, host='', port=0, timeout=-999, source_address=None) | return self.welcome | Connect to host. Arguments are:
- host: hostname to connect to (string, default previous host)
- port: port to connect to (integer, default previous port)
- timeout: the timeout to set against the ftp socket(s)
- source_address: a 2-tuple (host, port) for the socket to bind
... | Connect to host. Arguments are:
- host: hostname to connect to (string, default previous host)
- port: port to connect to (integer, default previous port)
- timeout: the timeout to set against the ftp socket(s)
- source_address: a 2-tuple (host, port) for the socket to bind
... | [
"Connect",
"to",
"host",
".",
"Arguments",
"are",
":",
"-",
"host",
":",
"hostname",
"to",
"connect",
"to",
"(",
"string",
"default",
"previous",
"host",
")",
"-",
"port",
":",
"port",
"to",
"connect",
"to",
"(",
"integer",
"default",
"previous",
"port",... | def connect(self, host='', port=0, timeout=-999, source_address=None):
'''Connect to host. Arguments are:
- host: hostname to connect to (string, default previous host)
- port: port to connect to (integer, default previous port)
- timeout: the timeout to set against the ftp socket(s)... | [
"def",
"connect",
"(",
"self",
",",
"host",
"=",
"''",
",",
"port",
"=",
"0",
",",
"timeout",
"=",
"-",
"999",
",",
"source_address",
"=",
"None",
")",
":",
"if",
"host",
"!=",
"''",
":",
"self",
".",
"host",
"=",
"host",
"if",
"port",
">",
"0"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ftplib.py#L139-L163 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events.and_ | (self, _object, _attributes={}, **_arguments) | and: Logical conjunction
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | and: Logical conjunction
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | [
"and",
":",
"Logical",
"conjunction",
"Required",
"argument",
":",
"an",
"AE",
"object",
"reference",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"anything"
] | def and_(self, _object, _attributes={}, **_arguments):
"""and: Logical conjunction
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything
"""
_code = 'ascr'
_subcode = 'AND '
if _arguments... | [
"def",
"and_",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'AND '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_ar... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L282-L301 | ||
OpenXRay/xray-15 | 1390dfb08ed20997d7e8c95147ea8e8cb71f5e86 | cs/sdk/3d_sdk/maya/ver-2008/devkit/plug-ins/scripted/motionTraceCmd.py | python | motionTrace.doIt | (self, args) | This method is called from script when this command is called.
It should set up any class data necessary for redo/undo,
parse any given arguments, and then call redoIt. | This method is called from script when this command is called.
It should set up any class data necessary for redo/undo,
parse any given arguments, and then call redoIt. | [
"This",
"method",
"is",
"called",
"from",
"script",
"when",
"this",
"command",
"is",
"called",
".",
"It",
"should",
"set",
"up",
"any",
"class",
"data",
"necessary",
"for",
"redo",
"/",
"undo",
"parse",
"any",
"given",
"arguments",
"and",
"then",
"call",
... | def doIt(self, args):
"""
This method is called from script when this command is called.
It should set up any class data necessary for redo/undo,
parse any given arguments, and then call redoIt.
"""
argData = OpenMaya.MArgDatabase(self.syntax(), args)
if argData.isFlagSet(kStartFlag):
self.__start = a... | [
"def",
"doIt",
"(",
"self",
",",
"args",
")",
":",
"argData",
"=",
"OpenMaya",
".",
"MArgDatabase",
"(",
"self",
".",
"syntax",
"(",
")",
",",
"args",
")",
"if",
"argData",
".",
"isFlagSet",
"(",
"kStartFlag",
")",
":",
"self",
".",
"__start",
"=",
... | https://github.com/OpenXRay/xray-15/blob/1390dfb08ed20997d7e8c95147ea8e8cb71f5e86/cs/sdk/3d_sdk/maya/ver-2008/devkit/plug-ins/scripted/motionTraceCmd.py#L93-L108 | ||
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/primViewItem.py | python | PrimViewItem._pull | (self) | Extracts and stores prim data. | Extracts and stores prim data. | [
"Extracts",
"and",
"stores",
"prim",
"data",
"."
] | def _pull(self):
"""Extracts and stores prim data."""
if self._needsPull:
# Only do this once.
self._needsPull = False
# Visibility is recursive so the parent must pull before us.
parent = self.parent()
if isinstance(parent, PrimViewItem):
... | [
"def",
"_pull",
"(",
"self",
")",
":",
"if",
"self",
".",
"_needsPull",
":",
"# Only do this once.",
"self",
".",
"_needsPull",
"=",
"False",
"# Visibility is recursive so the parent must pull before us.",
"parent",
"=",
"self",
".",
"parent",
"(",
")",
"if",
"isi... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/primViewItem.py#L80-L97 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events._b3_ | (self, _object, _attributes={}, **_arguments) | \xb3: Greater than or equal to
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | \xb3: Greater than or equal to
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | [
"\\",
"xb3",
":",
"Greater",
"than",
"or",
"equal",
"to",
"Required",
"argument",
":",
"an",
"AE",
"object",
"reference",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"anything"
] | def _b3_(self, _object, _attributes={}, **_arguments):
"""\xb3: Greater than or equal to
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything
"""
_code = 'ascr'
_subcode = '>= '
if _arg... | [
"def",
"_b3_",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'>= '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_ar... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L700-L719 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/parse/standard_method.py | python | dict_bool | (x) | return len(x) != 0 | Implementation of `dict_bool`. | Implementation of `dict_bool`. | [
"Implementation",
"of",
"dict_bool",
"."
] | def dict_bool(x):
"""Implementation of `dict_bool`."""
return len(x) != 0 | [
"def",
"dict_bool",
"(",
"x",
")",
":",
"return",
"len",
"(",
"x",
")",
"!=",
"0"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/standard_method.py#L1710-L1712 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | python | WriteMacros | (out, eclipse_langs, defines) | Write the macros section of a CDT settings export file. | Write the macros section of a CDT settings export file. | [
"Write",
"the",
"macros",
"section",
"of",
"a",
"CDT",
"settings",
"export",
"file",
"."
] | def WriteMacros(out, eclipse_langs, defines):
"""Write the macros section of a CDT settings export file."""
out.write(' <section name="org.eclipse.cdt.internal.ui.wizards.' \
'settingswizards.Macros">\n')
out.write(' <language name="holder for library settings"></language>\n')
for lang in eclip... | [
"def",
"WriteMacros",
"(",
"out",
",",
"eclipse_langs",
",",
"defines",
")",
":",
"out",
".",
"write",
"(",
"' <section name=\"org.eclipse.cdt.internal.ui.wizards.'",
"'settingswizards.Macros\">\\n'",
")",
"out",
".",
"write",
"(",
"' <language name=\"holder for library... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py#L267-L279 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/ansic/cparse.py | python | p_statement | (t) | statement : labeled_statement
| expression_statement
| compound_statement
| selection_statement
| iteration_statement
| jump_statement | statement : labeled_statement
| expression_statement
| compound_statement
| selection_statement
| iteration_statement
| jump_statement | [
"statement",
":",
"labeled_statement",
"|",
"expression_statement",
"|",
"compound_statement",
"|",
"selection_statement",
"|",
"iteration_statement",
"|",
"jump_statement"
] | def p_statement(t):
'''
statement : labeled_statement
| expression_statement
| compound_statement
| selection_statement
| iteration_statement
| jump_statement
'''
pass | [
"def",
"p_statement",
"(",
"t",
")",
":",
"pass"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L453-L462 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/cookies.py | python | create_cookie | (name, value, **kwargs) | return cookielib.Cookie(**result) | Make a cookie from underspecified parameters.
By default, the pair of `name` and `value` will be set for the domain ''
and sent on every request (this is sometimes called a "supercookie"). | Make a cookie from underspecified parameters. | [
"Make",
"a",
"cookie",
"from",
"underspecified",
"parameters",
"."
] | def create_cookie(name, value, **kwargs):
"""Make a cookie from underspecified parameters.
By default, the pair of `name` and `value` will be set for the domain ''
and sent on every request (this is sometimes called a "supercookie").
"""
result = {
'version': 0,
'name': name,
... | [
"def",
"create_cookie",
"(",
"name",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"'version'",
":",
"0",
",",
"'name'",
":",
"name",
",",
"'value'",
":",
"value",
",",
"'port'",
":",
"None",
",",
"'domain'",
":",
"''",
",",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/cookies.py#L441-L474 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/spinn/data.py | python | load_word_vectors | (data_root, vocab) | return word2index, embed | Load GloVe word vectors for words present in the vocabulary.
Args:
data_root: Data root directory. It is assumed that the GloVe file
has been downloaded and extracted at the "glove/" subdirectory of it.
vocab: A `set` of words, representing the vocabulary.
Returns:
1. word2index: A dict from lowe... | Load GloVe word vectors for words present in the vocabulary. | [
"Load",
"GloVe",
"word",
"vectors",
"for",
"words",
"present",
"in",
"the",
"vocabulary",
"."
] | def load_word_vectors(data_root, vocab):
"""Load GloVe word vectors for words present in the vocabulary.
Args:
data_root: Data root directory. It is assumed that the GloVe file
has been downloaded and extracted at the "glove/" subdirectory of it.
vocab: A `set` of words, representing the vocabulary.
... | [
"def",
"load_word_vectors",
"(",
"data_root",
",",
"vocab",
")",
":",
"glove_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"data_root",
",",
"\"glove/glove.42B.300d.txt\"",
")",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"glove_path",
")",
":",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/spinn/data.py#L156-L200 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/urllib.py | python | unquote_plus | (s) | return unquote(s) | unquote('%7e/abc+def') -> '~/abc def | unquote('%7e/abc+def') -> '~/abc def | [
"unquote",
"(",
"%7e",
"/",
"abc",
"+",
"def",
")",
"-",
">",
"~",
"/",
"abc",
"def"
] | def unquote_plus(s):
"""unquote('%7e/abc+def') -> '~/abc def'"""
s = s.replace('+', ' ')
return unquote(s) | [
"def",
"unquote_plus",
"(",
"s",
")",
":",
"s",
"=",
"s",
".",
"replace",
"(",
"'+'",
",",
"' '",
")",
"return",
"unquote",
"(",
"s",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/urllib.py#L1248-L1251 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_NULL_SIGNATURE.GetUnionSelector | (self) | return TPM_ALG_ID.NULL | TpmUnion method | TpmUnion method | [
"TpmUnion",
"method"
] | def GetUnionSelector(self): # TPM_ALG_ID
""" TpmUnion method """
return TPM_ALG_ID.NULL | [
"def",
"GetUnionSelector",
"(",
"self",
")",
":",
"# TPM_ALG_ID",
"return",
"TPM_ALG_ID",
".",
"NULL"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L7744-L7746 | |
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/record_analyzer/common/error_code_analyzer.py | python | ErrorCodeAnalyzer.print_results | (self) | print | print | [
"print"
] | def print_results(self):
"""print"""
DistributionAnalyzer().print_distribution_results(self.error_code_count) | [
"def",
"print_results",
"(",
"self",
")",
":",
"DistributionAnalyzer",
"(",
")",
".",
"print_distribution_results",
"(",
"self",
".",
"error_code_count",
")"
] | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/record_analyzer/common/error_code_analyzer.py#L40-L42 | ||
HyeonwooNoh/caffe | d9e8494a2832d67b25dee37194c7bcb9d52d0e42 | scripts/cpp_lint.py | python | IsBlankLine | (line) | return not line or line.isspace() | Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank. | Returns true if the given line is blank. | [
"Returns",
"true",
"if",
"the",
"given",
"line",
"is",
"blank",
"."
] | def IsBlankLine(line):
"""Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank.
"""
return not line or line.isspace() | [
"def",
"IsBlankLine",
"(",
"line",
")",
":",
"return",
"not",
"line",
"or",
"line",
".",
"isspace",
"(",
")"
] | https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/cpp_lint.py#L2369-L2381 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/mox.py | python | IgnoreArg.equals | (self, unused_rhs) | return True | Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True | Ignores arguments and returns True. | [
"Ignores",
"arguments",
"and",
"returns",
"True",
"."
] | def equals(self, unused_rhs):
"""Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True
"""
return True | [
"def",
"equals",
"(",
"self",
",",
"unused_rhs",
")",
":",
"return",
"True"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/mox.py#L1166-L1176 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mapreduce/mapreduce/context.py | python | _MutationPool.ndb_delete | (self, entity_or_key) | Like delete(), but for NDB entities/keys. | Like delete(), but for NDB entities/keys. | [
"Like",
"delete",
"()",
"but",
"for",
"NDB",
"entities",
"/",
"keys",
"."
] | def ndb_delete(self, entity_or_key):
"""Like delete(), but for NDB entities/keys."""
if ndb is not None and isinstance(entity_or_key, ndb.Model):
key = entity_or_key.key
else:
key = entity_or_key
self.ndb_deletes.append(key) | [
"def",
"ndb_delete",
"(",
"self",
",",
"entity_or_key",
")",
":",
"if",
"ndb",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"entity_or_key",
",",
"ndb",
".",
"Model",
")",
":",
"key",
"=",
"entity_or_key",
".",
"key",
"else",
":",
"key",
"=",
"entity... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/context.py#L276-L282 | ||
lyxok1/Tiny-DSOD | 94d15450699bea0dd3720e75e2d273e476174fba | tools/extra/parse_log.py | python | write_csv | (output_filename, dict_list, delimiter, verbose=False) | Write a CSV file | Write a CSV file | [
"Write",
"a",
"CSV",
"file"
] | def write_csv(output_filename, dict_list, delimiter, verbose=False):
"""Write a CSV file
"""
if not dict_list:
if verbose:
print('Not writing %s; no lines to write' % output_filename)
return
dialect = csv.excel
dialect.delimiter = delimiter
with open(output_filenam... | [
"def",
"write_csv",
"(",
"output_filename",
",",
"dict_list",
",",
"delimiter",
",",
"verbose",
"=",
"False",
")",
":",
"if",
"not",
"dict_list",
":",
"if",
"verbose",
":",
"print",
"(",
"'Not writing %s; no lines to write'",
"%",
"output_filename",
")",
"return... | https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/tools/extra/parse_log.py#L150-L168 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py | python | OpsWorksConnection.update_instance | (self, instance_id, layer_ids=None,
instance_type=None, auto_scaling_type=None,
hostname=None, os=None, ami_id=None,
ssh_key_name=None, architecture=None,
install_updates_on_boot=None, ebs_optimized=None) | return self.make_request(action='UpdateInstance',
body=json.dumps(params)) | Updates a specified instance.
**Required Permissions**: To use this action, an IAM user must
have a Manage permissions level for the stack, or an attached
policy that explicitly grants permissions. For more
information on user permissions, see `Managing User
Permissions`_.
... | Updates a specified instance. | [
"Updates",
"a",
"specified",
"instance",
"."
] | def update_instance(self, instance_id, layer_ids=None,
instance_type=None, auto_scaling_type=None,
hostname=None, os=None, ami_id=None,
ssh_key_name=None, architecture=None,
install_updates_on_boot=None, ebs_optimized=None):... | [
"def",
"update_instance",
"(",
"self",
",",
"instance_id",
",",
"layer_ids",
"=",
"None",
",",
"instance_type",
"=",
"None",
",",
"auto_scaling_type",
"=",
"None",
",",
"hostname",
"=",
"None",
",",
"os",
"=",
"None",
",",
"ami_id",
"=",
"None",
",",
"ss... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py#L2522-L2629 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_dummy_thread.py | python | stack_size | (size=None) | return 0 | Dummy implementation of _thread.stack_size(). | Dummy implementation of _thread.stack_size(). | [
"Dummy",
"implementation",
"of",
"_thread",
".",
"stack_size",
"()",
"."
] | def stack_size(size=None):
"""Dummy implementation of _thread.stack_size()."""
if size is not None:
raise error("setting thread stack size not supported")
return 0 | [
"def",
"stack_size",
"(",
"size",
"=",
"None",
")",
":",
"if",
"size",
"is",
"not",
"None",
":",
"raise",
"error",
"(",
"\"setting thread stack size not supported\"",
")",
"return",
"0"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_dummy_thread.py#L78-L82 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/cond_v2.py | python | _CondGradFuncGraph.xla_intermediates | (self) | return self._xla_intermediates | Raw intermediates captured from the forward graph if XLA is enabled. | Raw intermediates captured from the forward graph if XLA is enabled. | [
"Raw",
"intermediates",
"captured",
"from",
"the",
"forward",
"graph",
"if",
"XLA",
"is",
"enabled",
"."
] | def xla_intermediates(self):
"""Raw intermediates captured from the forward graph if XLA is enabled."""
return self._xla_intermediates | [
"def",
"xla_intermediates",
"(",
"self",
")",
":",
"return",
"self",
".",
"_xla_intermediates"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/cond_v2.py#L803-L805 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/factorization/python/ops/factorization_ops.py | python | WALSModel.__init__ | (self,
input_rows,
input_cols,
n_components,
unobserved_weight=0.1,
regularization=None,
row_init="random",
col_init="random",
num_row_shards=1,
num_col_shards=1,
row_wei... | Creates model for WALS matrix factorization.
Args:
input_rows: total number of rows for input matrix.
input_cols: total number of cols for input matrix.
n_components: number of dimensions to use for the factors.
unobserved_weight: weight given to unobserved entries of matrix.
regulari... | Creates model for WALS matrix factorization. | [
"Creates",
"model",
"for",
"WALS",
"matrix",
"factorization",
"."
] | def __init__(self,
input_rows,
input_cols,
n_components,
unobserved_weight=0.1,
regularization=None,
row_init="random",
col_init="random",
num_row_shards=1,
num_col_shards=1,
... | [
"def",
"__init__",
"(",
"self",
",",
"input_rows",
",",
"input_cols",
",",
"n_components",
",",
"unobserved_weight",
"=",
"0.1",
",",
"regularization",
"=",
"None",
",",
"row_init",
"=",
"\"random\"",
",",
"col_init",
"=",
"\"random\"",
",",
"num_row_shards",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/factorization/python/ops/factorization_ops.py#L186-L271 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/ror/processor.py | python | RoRProcessor._processor | (cls, gamespec, full_data_set) | return full_data_set | Transfer structures used in Genie games to more openage-friendly
Python objects.
:param gamespec: Gamedata from empires.dat file.
:type gamespec: class: ...dataformat.value_members.ArrayMember
:param full_data_set: GenieObjectContainer instance that
contain... | Transfer structures used in Genie games to more openage-friendly
Python objects. | [
"Transfer",
"structures",
"used",
"in",
"Genie",
"games",
"to",
"more",
"openage",
"-",
"friendly",
"Python",
"objects",
"."
] | def _processor(cls, gamespec, full_data_set):
"""
Transfer structures used in Genie games to more openage-friendly
Python objects.
:param gamespec: Gamedata from empires.dat file.
:type gamespec: class: ...dataformat.value_members.ArrayMember
:param full_data_set: GenieO... | [
"def",
"_processor",
"(",
"cls",
",",
"gamespec",
",",
"full_data_set",
")",
":",
"info",
"(",
"\"Creating API-like objects...\"",
")",
"cls",
".",
"create_tech_groups",
"(",
"full_data_set",
")",
"cls",
".",
"create_entity_lines",
"(",
"gamespec",
",",
"full_data... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/ror/processor.py#L101-L136 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatnotebook.py | python | FlatNotebook.SetGradientColours | (self, fr, to, border) | Sets the gradient colours for the tab.
:param `fr`: the first gradient colour, an instance of :class:`Colour`;
:param `to`: the second gradient colour, an instance of :class:`Colour`;
:param `border`: the border colour, an instance of :class:`Colour`. | Sets the gradient colours for the tab. | [
"Sets",
"the",
"gradient",
"colours",
"for",
"the",
"tab",
"."
] | def SetGradientColours(self, fr, to, border):
"""
Sets the gradient colours for the tab.
:param `fr`: the first gradient colour, an instance of :class:`Colour`;
:param `to`: the second gradient colour, an instance of :class:`Colour`;
:param `border`: the border colour, an instan... | [
"def",
"SetGradientColours",
"(",
"self",
",",
"fr",
",",
"to",
",",
"border",
")",
":",
"self",
".",
"_pages",
".",
"_colourFrom",
"=",
"fr",
"self",
".",
"_pages",
".",
"_colourTo",
"=",
"to",
"self",
".",
"_pages",
".",
"_colourBorder",
"=",
"border... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L4870-L4881 | ||
Sigil-Ebook/Sigil | 0d145d3a4874b4a26f7aabd68dbd9d18a2402e52 | src/Resource_Files/plugin_launchers/python/sigil_bs4/element.py | python | PageElement.insert_before | (self, predecessor) | Makes the given element the immediate predecessor of this one.
The two elements will have the same parent, and the given element
will be immediately before this one. | Makes the given element the immediate predecessor of this one. | [
"Makes",
"the",
"given",
"element",
"the",
"immediate",
"predecessor",
"of",
"this",
"one",
"."
] | def insert_before(self, predecessor):
"""Makes the given element the immediate predecessor of this one.
The two elements will have the same parent, and the given element
will be immediately before this one.
"""
if self is predecessor:
raise ValueError("Can't insert a... | [
"def",
"insert_before",
"(",
"self",
",",
"predecessor",
")",
":",
"if",
"self",
"is",
"predecessor",
":",
"raise",
"ValueError",
"(",
"\"Can't insert an element before itself.\"",
")",
"parent",
"=",
"self",
".",
"parent",
"if",
"parent",
"is",
"None",
":",
"... | https://github.com/Sigil-Ebook/Sigil/blob/0d145d3a4874b4a26f7aabd68dbd9d18a2402e52/src/Resource_Files/plugin_launchers/python/sigil_bs4/element.py#L397-L414 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenuItem.SetFont | (self, font=None) | Sets the :class:`FlatMenuItem` font.
:param `font`: an instance of a valid :class:`Font`. | Sets the :class:`FlatMenuItem` font. | [
"Sets",
"the",
":",
"class",
":",
"FlatMenuItem",
"font",
"."
] | def SetFont(self, font=None):
"""
Sets the :class:`FlatMenuItem` font.
:param `font`: an instance of a valid :class:`Font`.
"""
self._font = font
if self._parentMenu:
self._parentMenu.UpdateItem(self) | [
"def",
"SetFont",
"(",
"self",
",",
"font",
"=",
"None",
")",
":",
"self",
".",
"_font",
"=",
"font",
"if",
"self",
".",
"_parentMenu",
":",
"self",
".",
"_parentMenu",
".",
"UpdateItem",
"(",
"self",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L5242-L5252 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/decimal.py | python | Context._ignore_all_flags | (self) | return self._ignore_flags(*_signals) | Ignore all flags, if they are raised | Ignore all flags, if they are raised | [
"Ignore",
"all",
"flags",
"if",
"they",
"are",
"raised"
] | def _ignore_all_flags(self):
"""Ignore all flags, if they are raised"""
return self._ignore_flags(*_signals) | [
"def",
"_ignore_all_flags",
"(",
"self",
")",
":",
"return",
"self",
".",
"_ignore_flags",
"(",
"*",
"_signals",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/decimal.py#L3874-L3876 | |
stereolabs/zed-examples | ed3f068301fbdf3898f7c42de864dc578467e061 | object detection/birds eye viewer/python/batch_system_handler.py | python | BatchSystemHandler.ingest_depth_in_map | (self, ts, depth) | ingest_depth_in_map
Parameters:
ts (sl.Timestamp)
depth (sl.Mat) | ingest_depth_in_map | [
"ingest_depth_in_map"
] | def ingest_depth_in_map(self, ts, depth):
'''
ingest_depth_in_map
Parameters:
ts (sl.Timestamp)
depth (sl.Mat)
'''
self.depth_map_ms[ts.get_milliseconds()] = sl.Mat()
self.depth_map_ms[ts.get_milliseconds()].clone(depth)
for key in list(s... | [
"def",
"ingest_depth_in_map",
"(",
"self",
",",
"ts",
",",
"depth",
")",
":",
"self",
".",
"depth_map_ms",
"[",
"ts",
".",
"get_milliseconds",
"(",
")",
"]",
"=",
"sl",
".",
"Mat",
"(",
")",
"self",
".",
"depth_map_ms",
"[",
"ts",
".",
"get_millisecond... | https://github.com/stereolabs/zed-examples/blob/ed3f068301fbdf3898f7c42de864dc578467e061/object detection/birds eye viewer/python/batch_system_handler.py#L253-L269 | ||
NeoGeographyToolkit/StereoPipeline | eedf54a919fb5cce1ab0e280bb0df4050763aa11 | src/asp/Tools/historical_helper.py | python | computeAngle | (topLeft, topRight) | return degrees | Compute the angle from the top left to the top right of an image.
Positive rotation = clockwise. | Compute the angle from the top left to the top right of an image.
Positive rotation = clockwise. | [
"Compute",
"the",
"angle",
"from",
"the",
"top",
"left",
"to",
"the",
"top",
"right",
"of",
"an",
"image",
".",
"Positive",
"rotation",
"=",
"clockwise",
"."
] | def computeAngle(topLeft, topRight):
'''Compute the angle from the top left to the top right of an image.
Positive rotation = clockwise.'''
horizVec = (1,0)
measuredVec = topRight - topLeft
denom = np.linalg.norm(horizVec)*np.linalg.norm(measuredVec)
angle = np.arccos(np.dot(measuredV... | [
"def",
"computeAngle",
"(",
"topLeft",
",",
"topRight",
")",
":",
"horizVec",
"=",
"(",
"1",
",",
"0",
")",
"measuredVec",
"=",
"topRight",
"-",
"topLeft",
"denom",
"=",
"np",
".",
"linalg",
".",
"norm",
"(",
"horizVec",
")",
"*",
"np",
".",
"linalg"... | https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/Tools/historical_helper.py#L93-L103 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/abinsalgorithm.py | python | AbinsAlgorithm._check_threads | (message_end=None) | Checks number of threads
:param message_end: closing part of the error message. | Checks number of threads
:param message_end: closing part of the error message. | [
"Checks",
"number",
"of",
"threads",
":",
"param",
"message_end",
":",
"closing",
"part",
"of",
"the",
"error",
"message",
"."
] | def _check_threads(message_end=None):
"""
Checks number of threads
:param message_end: closing part of the error message.
"""
try:
import pathos.multiprocessing as mp
threads = abins.parameters.performance['threads']
if not (isinstance(threads... | [
"def",
"_check_threads",
"(",
"message_end",
"=",
"None",
")",
":",
"try",
":",
"import",
"pathos",
".",
"multiprocessing",
"as",
"mp",
"threads",
"=",
"abins",
".",
"parameters",
".",
"performance",
"[",
"'threads'",
"]",
"if",
"not",
"(",
"isinstance",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/abinsalgorithm.py#L887-L900 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | python | get_config_var | (name) | return get_config_vars().get(name) | Return the value of a single variable using the dictionary returned by
'get_config_vars()'.
Equivalent to get_config_vars().get(name) | Return the value of a single variable using the dictionary returned by | [
"Return",
"the",
"value",
"of",
"a",
"single",
"variable",
"using",
"the",
"dictionary",
"returned",
"by"
] | def get_config_var(name):
"""Return the value of a single variable using the dictionary returned by
'get_config_vars()'.
Equivalent to get_config_vars().get(name)
"""
return get_config_vars().get(name) | [
"def",
"get_config_var",
"(",
"name",
")",
":",
"return",
"get_config_vars",
"(",
")",
".",
"get",
"(",
"name",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.py#L1183-L1195 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/rsa/rsa/_version133.py | python | picklechops | (chops) | return encoded.strip() | Pickles and base64encodes it's argument chops | Pickles and base64encodes it's argument chops | [
"Pickles",
"and",
"base64encodes",
"it",
"s",
"argument",
"chops"
] | def picklechops(chops):
"""Pickles and base64encodes it's argument chops"""
value = zlib.compress(dumps(chops))
encoded = base64.encodestring(value)
return encoded.strip() | [
"def",
"picklechops",
"(",
"chops",
")",
":",
"value",
"=",
"zlib",
".",
"compress",
"(",
"dumps",
"(",
"chops",
")",
")",
"encoded",
"=",
"base64",
".",
"encodestring",
"(",
"value",
")",
"return",
"encoded",
".",
"strip",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/rsa/rsa/_version133.py#L361-L366 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/distutils/util.py | python | strtobool | (val) | Convert a string representation of truth to true (1) or false (0).
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
'val' is anything else. | Convert a string representation of truth to true (1) or false (0). | [
"Convert",
"a",
"string",
"representation",
"of",
"truth",
"to",
"true",
"(",
"1",
")",
"or",
"false",
"(",
"0",
")",
"."
] | def strtobool (val):
"""Convert a string representation of truth to true (1) or false (0).
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
'val' is anything else.
"""
val = string.lower(val)
if val in ('... | [
"def",
"strtobool",
"(",
"val",
")",
":",
"val",
"=",
"string",
".",
"lower",
"(",
"val",
")",
"if",
"val",
"in",
"(",
"'y'",
",",
"'yes'",
",",
"'t'",
",",
"'true'",
",",
"'on'",
",",
"'1'",
")",
":",
"return",
"1",
"elif",
"val",
"in",
"(",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/util.py#L412-L425 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.Update | (*args, **kwargs) | return _core_.Window_Update(*args, **kwargs) | Update(self)
Calling this method immediately repaints the invalidated area of the
window instead of waiting for the EVT_PAINT event to happen, (normally
this would usually only happen when the flow of control returns to the
event loop.) Notice that this function doesn't refresh the win... | Update(self) | [
"Update",
"(",
"self",
")"
] | def Update(*args, **kwargs):
"""
Update(self)
Calling this method immediately repaints the invalidated area of the
window instead of waiting for the EVT_PAINT event to happen, (normally
this would usually only happen when the flow of control returns to the
event loop.) ... | [
"def",
"Update",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_Update",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10684-L10696 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py | python | obj_argument.needs_attrib_default_retval | (self) | return not self.type.has_name() and \
self.type.is_result_struct() and \
self.type.is_result_struct_enum() | Returns true if this argument requires a 'default_retval' attribute. | Returns true if this argument requires a 'default_retval' attribute. | [
"Returns",
"true",
"if",
"this",
"argument",
"requires",
"a",
"default_retval",
"attribute",
"."
] | def needs_attrib_default_retval(self):
""" Returns true if this argument requires a 'default_retval' attribute.
"""
# A 'default_retval' attribute is required for enumeration return value
# types.
return not self.type.has_name() and \
self.type.is_result_struct() and ... | [
"def",
"needs_attrib_default_retval",
"(",
"self",
")",
":",
"# A 'default_retval' attribute is required for enumeration return value",
"# types.",
"return",
"not",
"self",
".",
"type",
".",
"has_name",
"(",
")",
"and",
"self",
".",
"type",
".",
"is_result_struct",
"(",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L1358-L1365 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/calibration/presenter.py | python | CalibrationPresenter.load_last_calibration | (self) | Loads the most recently created or loaded calibration into the interface instance. To be used on interface
startup. | Loads the most recently created or loaded calibration into the interface instance. To be used on interface
startup. | [
"Loads",
"the",
"most",
"recently",
"created",
"or",
"loaded",
"calibration",
"into",
"the",
"interface",
"instance",
".",
"To",
"be",
"used",
"on",
"interface",
"startup",
"."
] | def load_last_calibration(self) -> None:
"""
Loads the most recently created or loaded calibration into the interface instance. To be used on interface
startup.
"""
last_cal_path = get_setting(output_settings.INTERFACES_SETTINGS_GROUP, output_settings.ENGINEERING_PREFIX,
... | [
"def",
"load_last_calibration",
"(",
"self",
")",
"->",
"None",
":",
"last_cal_path",
"=",
"get_setting",
"(",
"output_settings",
".",
"INTERFACES_SETTINGS_GROUP",
",",
"output_settings",
".",
"ENGINEERING_PREFIX",
",",
"\"last_calibration_path\"",
")",
"if",
"last_cal_... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/calibration/presenter.py#L104-L113 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py | python | _bypass_ensure_directory | (path) | Sandbox-bypassing version of ensure_directory() | Sandbox-bypassing version of ensure_directory() | [
"Sandbox",
"-",
"bypassing",
"version",
"of",
"ensure_directory",
"()"
] | def _bypass_ensure_directory(path):
"""Sandbox-bypassing version of ensure_directory()"""
if not WRITE_SUPPORT:
raise IOError('"os.mkdir" not supported on this platform.')
dirname, filename = split(path)
if dirname and filename and not isdir(dirname):
_bypass_ensure_directory(dirname)
... | [
"def",
"_bypass_ensure_directory",
"(",
"path",
")",
":",
"if",
"not",
"WRITE_SUPPORT",
":",
"raise",
"IOError",
"(",
"'\"os.mkdir\" not supported on this platform.'",
")",
"dirname",
",",
"filename",
"=",
"split",
"(",
"path",
")",
"if",
"dirname",
"and",
"filena... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L3176-L3186 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/arraypad.py | python | _append_max | (arr, pad_amt, num, axis=-1) | return np.concatenate((arr, max_chunk.repeat(pad_amt, axis=axis)),
axis=axis) | Pad one `axis` of `arr` with the maximum of the last `num` elements.
Parameters
----------
arr : ndarray
Input array of arbitrary shape.
pad_amt : int
Amount of padding to append.
num : int
Depth into `arr` along `axis` to calculate maximum.
Range: [1, `arr.shape[axi... | Pad one `axis` of `arr` with the maximum of the last `num` elements. | [
"Pad",
"one",
"axis",
"of",
"arr",
"with",
"the",
"maximum",
"of",
"the",
"last",
"num",
"elements",
"."
] | def _append_max(arr, pad_amt, num, axis=-1):
"""
Pad one `axis` of `arr` with the maximum of the last `num` elements.
Parameters
----------
arr : ndarray
Input array of arbitrary shape.
pad_amt : int
Amount of padding to append.
num : int
Depth into `arr` along `axis... | [
"def",
"_append_max",
"(",
"arr",
",",
"pad_amt",
",",
"num",
",",
"axis",
"=",
"-",
"1",
")",
":",
"if",
"pad_amt",
"==",
"0",
":",
"return",
"arr",
"# Equivalent to edge padding for single value, so do that instead",
"if",
"num",
"==",
"1",
":",
"return",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/arraypad.py#L375-L428 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/__init__.py | python | Process.nice | (self, value=None) | Get or set process niceness (priority). | Get or set process niceness (priority). | [
"Get",
"or",
"set",
"process",
"niceness",
"(",
"priority",
")",
"."
] | def nice(self, value=None):
"""Get or set process niceness (priority)."""
if value is None:
return self._proc.nice_get()
else:
if not self.is_running():
raise NoSuchProcess(self.pid, self._name)
self._proc.nice_set(value) | [
"def",
"nice",
"(",
"self",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"None",
":",
"return",
"self",
".",
"_proc",
".",
"nice_get",
"(",
")",
"else",
":",
"if",
"not",
"self",
".",
"is_running",
"(",
")",
":",
"raise",
"NoSuchProces... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/__init__.py#L730-L737 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/data/dataset.py | python | Dataset.take | (self, count) | return _SampledDataset(self, SequentialSampler(count)) | Returns a new dataset with at most `count` number of samples in it.
Parameters
----------
count : int or None
A integer representing the number of elements of this dataset that
should be taken to form the new dataset. If count is None, or if count
is greater ... | Returns a new dataset with at most `count` number of samples in it. | [
"Returns",
"a",
"new",
"dataset",
"with",
"at",
"most",
"count",
"number",
"of",
"samples",
"in",
"it",
"."
] | def take(self, count):
"""Returns a new dataset with at most `count` number of samples in it.
Parameters
----------
count : int or None
A integer representing the number of elements of this dataset that
should be taken to form the new dataset. If count is None, o... | [
"def",
"take",
"(",
"self",
",",
"count",
")",
":",
"if",
"count",
"is",
"None",
"or",
"count",
">",
"len",
"(",
"self",
")",
":",
"count",
"=",
"len",
"(",
"self",
")",
"from",
".",
"import",
"SequentialSampler",
"return",
"_SampledDataset",
"(",
"s... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/data/dataset.py#L99-L118 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/sched.py | python | scheduler.__init__ | (self, timefunc, delayfunc) | Initialize a new instance, passing the time and delay
functions | Initialize a new instance, passing the time and delay
functions | [
"Initialize",
"a",
"new",
"instance",
"passing",
"the",
"time",
"and",
"delay",
"functions"
] | def __init__(self, timefunc, delayfunc):
"""Initialize a new instance, passing the time and delay
functions"""
self._queue = []
self.timefunc = timefunc
self.delayfunc = delayfunc | [
"def",
"__init__",
"(",
"self",
",",
"timefunc",
",",
"delayfunc",
")",
":",
"self",
".",
"_queue",
"=",
"[",
"]",
"self",
".",
"timefunc",
"=",
"timefunc",
"self",
".",
"delayfunc",
"=",
"delayfunc"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/sched.py#L39-L44 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/special/orthogonal.py | python | _newton | (n, x_initial, maxit=5) | return x, w | Newton iteration for polishing the asymptotic approximation
to the zeros of the Hermite polynomials.
Parameters
----------
n : int
Quadrature order
x_initial : ndarray
Initial guesses for the roots
maxit : int
Maximal number of Newton iterations.
The default 5 is... | Newton iteration for polishing the asymptotic approximation
to the zeros of the Hermite polynomials. | [
"Newton",
"iteration",
"for",
"polishing",
"the",
"asymptotic",
"approximation",
"to",
"the",
"zeros",
"of",
"the",
"Hermite",
"polynomials",
"."
] | def _newton(n, x_initial, maxit=5):
"""Newton iteration for polishing the asymptotic approximation
to the zeros of the Hermite polynomials.
Parameters
----------
n : int
Quadrature order
x_initial : ndarray
Initial guesses for the roots
maxit : int
Maximal number of ... | [
"def",
"_newton",
"(",
"n",
",",
"x_initial",
",",
"maxit",
"=",
"5",
")",
":",
"# Variable transformation",
"mu",
"=",
"sqrt",
"(",
"2.0",
"*",
"n",
"+",
"1.0",
")",
"t",
"=",
"x_initial",
"/",
"mu",
"theta",
"=",
"arccos",
"(",
"t",
")",
"# Newto... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/special/orthogonal.py#L986-L1030 | |
openweave/openweave-core | 11ceb6b7efd39fe05de7f79229247a5774d56766 | src/device-manager/python/openweave/WeaveBleBase.py | python | WeaveBleBase.WriteBleCharacteristic | (self, connObj, svcId, charId, buffer, length) | return | Called by WeaveDeviceMgr.py to satisfy a request by Weave to transmit a packet over BLE. | Called by WeaveDeviceMgr.py to satisfy a request by Weave to transmit a packet over BLE. | [
"Called",
"by",
"WeaveDeviceMgr",
".",
"py",
"to",
"satisfy",
"a",
"request",
"by",
"Weave",
"to",
"transmit",
"a",
"packet",
"over",
"BLE",
"."
] | def WriteBleCharacteristic(self, connObj, svcId, charId, buffer, length):
""" Called by WeaveDeviceMgr.py to satisfy a request by Weave to transmit a packet over BLE."""
return | [
"def",
"WriteBleCharacteristic",
"(",
"self",
",",
"connObj",
",",
"svcId",
",",
"charId",
",",
"buffer",
",",
"length",
")",
":",
"return"
] | https://github.com/openweave/openweave-core/blob/11ceb6b7efd39fe05de7f79229247a5774d56766/src/device-manager/python/openweave/WeaveBleBase.py#L42-L44 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/flatnotebook.py | python | PageContainer.PopupTabsMenu | (self) | Pops up the menu activated with the drop down arrow in the navigation area. | Pops up the menu activated with the drop down arrow in the navigation area. | [
"Pops",
"up",
"the",
"menu",
"activated",
"with",
"the",
"drop",
"down",
"arrow",
"in",
"the",
"navigation",
"area",
"."
] | def PopupTabsMenu(self):
""" Pops up the menu activated with the drop down arrow in the navigation area. """
popupMenu = wx.Menu()
longest = 0
has_bmp = False
for i in xrange(len(self._pagesInfoVec)):
pi = self._pagesInfoVec[i]
caption = pi.GetCaption()
... | [
"def",
"PopupTabsMenu",
"(",
"self",
")",
":",
"popupMenu",
"=",
"wx",
".",
"Menu",
"(",
")",
"longest",
"=",
"0",
"has_bmp",
"=",
"False",
"for",
"i",
"in",
"xrange",
"(",
"len",
"(",
"self",
".",
"_pagesInfoVec",
")",
")",
":",
"pi",
"=",
"self",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L4847-L4892 | ||
eldar/deepcut-cnn | 928bf2f224fce132f6e4404b4c95fb017297a5e0 | scripts/cpp_lint.py | python | _FunctionState.Count | (self) | Count line in current function body. | Count line in current function body. | [
"Count",
"line",
"in",
"current",
"function",
"body",
"."
] | def Count(self):
"""Count line in current function body."""
if self.in_a_function:
self.lines_in_function += 1 | [
"def",
"Count",
"(",
"self",
")",
":",
"if",
"self",
".",
"in_a_function",
":",
"self",
".",
"lines_in_function",
"+=",
"1"
] | https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/scripts/cpp_lint.py#L831-L834 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/io/loader.py | python | readVector | (text) | return [float(v) for v in items[1:]] | Reads a length-prepended vector from a string 'n v1 ... vn | Reads a length-prepended vector from a string 'n v1 ... vn | [
"Reads",
"a",
"length",
"-",
"prepended",
"vector",
"from",
"a",
"string",
"n",
"v1",
"...",
"vn"
] | def readVector(text):
"""Reads a length-prepended vector from a string 'n v1 ... vn'"""
items = text.split()
if len(items) == 0:
raise ValueError("Empty text")
if int(items[0])+1 != len(items):
raise ValueError("Invalid number of items")
return [float(v) for v in items[1:]] | [
"def",
"readVector",
"(",
"text",
")",
":",
"items",
"=",
"text",
".",
"split",
"(",
")",
"if",
"len",
"(",
"items",
")",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"Empty text\"",
")",
"if",
"int",
"(",
"items",
"[",
"0",
"]",
")",
"+",
"1",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/io/loader.py#L100-L107 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/math_grad.py | python | _RsqrtGradGrad | (op, grad) | Returns backprop gradient for f(a,b) = -0.5 * b * conj(a)^3. | Returns backprop gradient for f(a,b) = -0.5 * b * conj(a)^3. | [
"Returns",
"backprop",
"gradient",
"for",
"f",
"(",
"a",
"b",
")",
"=",
"-",
"0",
".",
"5",
"*",
"b",
"*",
"conj",
"(",
"a",
")",
"^3",
"."
] | def _RsqrtGradGrad(op, grad):
"""Returns backprop gradient for f(a,b) = -0.5 * b * conj(a)^3."""
a = op.inputs[0] # a = x^{-1/2}
b = op.inputs[1] # backprop gradient for a
with ops.control_dependencies([grad.op]):
ca = math_ops.conj(a)
cg = math_ops.conj(grad)
grad_a = -1.5 * cg * b * math_ops.squ... | [
"def",
"_RsqrtGradGrad",
"(",
"op",
",",
"grad",
")",
":",
"a",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"# a = x^{-1/2}",
"b",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
"# backprop gradient for a",
"with",
"ops",
".",
"control_dependencies",
"(",
"[",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/math_grad.py#L298-L308 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/lib/recfunctions.py | python | assign_fields_by_name | (dst, src, zero_unassigned=True) | Assigns values from one structured array to another by field name.
Normally in numpy >= 1.14, assignment of one structured array to another
copies fields "by position", meaning that the first field from the src is
copied to the first field of the dst, and so on, regardless of field name.
This function... | Assigns values from one structured array to another by field name. | [
"Assigns",
"values",
"from",
"one",
"structured",
"array",
"to",
"another",
"by",
"field",
"name",
"."
] | def assign_fields_by_name(dst, src, zero_unassigned=True):
"""
Assigns values from one structured array to another by field name.
Normally in numpy >= 1.14, assignment of one structured array to another
copies fields "by position", meaning that the first field from the src is
copied to the first fi... | [
"def",
"assign_fields_by_name",
"(",
"dst",
",",
"src",
",",
"zero_unassigned",
"=",
"True",
")",
":",
"if",
"dst",
".",
"dtype",
".",
"names",
"is",
"None",
":",
"dst",
"[",
"...",
"]",
"=",
"src",
"return",
"for",
"name",
"in",
"dst",
".",
"dtype",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/recfunctions.py#L1163-L1198 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/urlgrabber/byterange.py | python | range_tuple_normalize | (range_tup) | return (fb,lb) | Normalize a (first_byte,last_byte) range tuple.
Return a tuple whose first element is guaranteed to be an int
and whose second element will be '' (meaning: the last byte) or
an int. Finally, return None if the normalized tuple == (0,'')
as that is equivelant to retrieving the entire file. | Normalize a (first_byte,last_byte) range tuple.
Return a tuple whose first element is guaranteed to be an int
and whose second element will be '' (meaning: the last byte) or
an int. Finally, return None if the normalized tuple == (0,'')
as that is equivelant to retrieving the entire file. | [
"Normalize",
"a",
"(",
"first_byte",
"last_byte",
")",
"range",
"tuple",
".",
"Return",
"a",
"tuple",
"whose",
"first",
"element",
"is",
"guaranteed",
"to",
"be",
"an",
"int",
"and",
"whose",
"second",
"element",
"will",
"be",
"(",
"meaning",
":",
"the",
... | def range_tuple_normalize(range_tup):
"""Normalize a (first_byte,last_byte) range tuple.
Return a tuple whose first element is guaranteed to be an int
and whose second element will be '' (meaning: the last byte) or
an int. Finally, return None if the normalized tuple == (0,'')
as that is equivelant... | [
"def",
"range_tuple_normalize",
"(",
"range_tup",
")",
":",
"if",
"range_tup",
"is",
"None",
":",
"return",
"None",
"# handle first byte",
"fb",
"=",
"range_tup",
"[",
"0",
"]",
"if",
"fb",
"in",
"(",
"None",
",",
"''",
")",
":",
"fb",
"=",
"0",
"else"... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/urlgrabber/byterange.py#L440-L462 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/variable_scope.py | python | _get_partitioned_variable | (name,
shape=None,
dtype=None,
initializer=None,
regularizer=None,
trainable=True,
collections=None,
caching_d... | return scope._get_partitioned_variable(
_get_default_variable_store(),
name,
shape=shape,
dtype=dtype,
initializer=initializer,
regularizer=regularizer,
trainable=trainable,
collections=collections,
caching_device=caching_device,
partitioner=partitioner,
... | Gets or creates a sharded variable list with these parameters.
The `partitioner` must be a callable that accepts a fully defined
`TensorShape` and returns a sequence of integers (the `partitions`).
These integers describe how to partition the given sharded `Variable`
along the given dimension. That is, `parti... | Gets or creates a sharded variable list with these parameters. | [
"Gets",
"or",
"creates",
"a",
"sharded",
"variable",
"list",
"with",
"these",
"parameters",
"."
] | def _get_partitioned_variable(name,
shape=None,
dtype=None,
initializer=None,
regularizer=None,
trainable=True,
collections=None,
... | [
"def",
"_get_partitioned_variable",
"(",
"name",
",",
"shape",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"initializer",
"=",
"None",
",",
"regularizer",
"=",
"None",
",",
"trainable",
"=",
"True",
",",
"collections",
"=",
"None",
",",
"caching_device",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/variable_scope.py#L1822-L1935 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/dom/expatbuilder.py | python | ExpatBuilder.parseFile | (self, file) | return doc | Parse a document from a file object, returning the document
node. | Parse a document from a file object, returning the document
node. | [
"Parse",
"a",
"document",
"from",
"a",
"file",
"object",
"returning",
"the",
"document",
"node",
"."
] | def parseFile(self, file):
"""Parse a document from a file object, returning the document
node."""
parser = self.getParser()
first_buffer = True
try:
while 1:
buffer = file.read(16*1024)
if not buffer:
break
... | [
"def",
"parseFile",
"(",
"self",
",",
"file",
")",
":",
"parser",
"=",
"self",
".",
"getParser",
"(",
")",
"first_buffer",
"=",
"True",
"try",
":",
"while",
"1",
":",
"buffer",
"=",
"file",
".",
"read",
"(",
"16",
"*",
"1024",
")",
"if",
"not",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/dom/expatbuilder.py#L197-L217 | |
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/google/protobuf/text_format.py | python | Tokenizer.ConsumeInteger | (self) | return result | Consumes an integer number.
Returns:
The integer parsed.
Raises:
ParseError: If an integer couldn't be consumed. | Consumes an integer number. | [
"Consumes",
"an",
"integer",
"number",
"."
] | def ConsumeInteger(self):
"""Consumes an integer number.
Returns:
The integer parsed.
Raises:
ParseError: If an integer couldn't be consumed.
"""
try:
result = _ParseAbstractInteger(self.token)
except ValueError as e:
raise self.ParseError(str(e))
self.NextToken()
... | [
"def",
"ConsumeInteger",
"(",
"self",
")",
":",
"try",
":",
"result",
"=",
"_ParseAbstractInteger",
"(",
"self",
".",
"token",
")",
"except",
"ValueError",
"as",
"e",
":",
"raise",
"self",
".",
"ParseError",
"(",
"str",
"(",
"e",
")",
")",
"self",
".",... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/text_format.py#L1390-L1404 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/sources_list.py | python | update_sources_list | (sources_list_dir=None, sources_cache_dir=None,
success_handler=None, error_handler=None) | return retval | Re-downloaded data from remote sources and store in cache. Also
update the cache index based on current sources.
:param sources_list_dir: override source list directory
:param sources_cache_dir: override sources cache directory
:param success_handler: fn(DataSource) to call if a particular
sou... | Re-downloaded data from remote sources and store in cache. Also
update the cache index based on current sources. | [
"Re",
"-",
"downloaded",
"data",
"from",
"remote",
"sources",
"and",
"store",
"in",
"cache",
".",
"Also",
"update",
"the",
"cache",
"index",
"based",
"on",
"current",
"sources",
"."
] | def update_sources_list(sources_list_dir=None, sources_cache_dir=None,
success_handler=None, error_handler=None):
"""
Re-downloaded data from remote sources and store in cache. Also
update the cache index based on current sources.
:param sources_list_dir: override source list d... | [
"def",
"update_sources_list",
"(",
"sources_list_dir",
"=",
"None",
",",
"sources_cache_dir",
"=",
"None",
",",
"success_handler",
"=",
"None",
",",
"error_handler",
"=",
"None",
")",
":",
"if",
"sources_cache_dir",
"is",
"None",
":",
"sources_cache_dir",
"=",
"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/sources_list.py#L417-L486 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/vecutil.py | python | determinant | (mat) | return det | Given 3x3 matrix *mat*, compute the determinat | Given 3x3 matrix *mat*, compute the determinat | [
"Given",
"3x3",
"matrix",
"*",
"mat",
"*",
"compute",
"the",
"determinat"
] | def determinant(mat):
"""Given 3x3 matrix *mat*, compute the determinat
"""
if len(mat) != 3 or len(mat[0]) != 3 or len(mat[1]) != 3 or len(mat[2]) != 3:
raise ValidationError('determinant() only defined for arrays of dimension 3x3\n')
det = mat[0][0] * mat[1][1] * mat[2][2] - mat[0][2] * mat[... | [
"def",
"determinant",
"(",
"mat",
")",
":",
"if",
"len",
"(",
"mat",
")",
"!=",
"3",
"or",
"len",
"(",
"mat",
"[",
"0",
"]",
")",
"!=",
"3",
"or",
"len",
"(",
"mat",
"[",
"1",
"]",
")",
"!=",
"3",
"or",
"len",
"(",
"mat",
"[",
"2",
"]",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/vecutil.py#L175-L185 | |
NERSC/timemory | 431912b360ff50d1a160d7826e2eea04fbd1037f | timemory/plotting/plotting.py | python | timemory_data.__repr__ | (self) | printing data | printing data | [
"printing",
"data"
] | def __repr__(self):
"""printing data"""
print("{}".format(self)) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"print",
"(",
"\"{}\"",
".",
"format",
"(",
"self",
")",
")"
] | https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/timemory/plotting/plotting.py#L310-L312 | ||
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/core.py | python | CherryTree.is_tree_not_empty_or_error | (self) | return True | Returns True if the Tree is Not Empty or False and prompts error dialog | Returns True if the Tree is Not Empty or False and prompts error dialog | [
"Returns",
"True",
"if",
"the",
"Tree",
"is",
"Not",
"Empty",
"or",
"False",
"and",
"prompts",
"error",
"dialog"
] | def is_tree_not_empty_or_error(self):
"""Returns True if the Tree is Not Empty or False and prompts error dialog"""
if self.tree_is_empty():
support.dialog_error(_("The Tree is Empty!"), self.window)
return False
return True | [
"def",
"is_tree_not_empty_or_error",
"(",
"self",
")",
":",
"if",
"self",
".",
"tree_is_empty",
"(",
")",
":",
"support",
".",
"dialog_error",
"(",
"_",
"(",
"\"The Tree is Empty!\"",
")",
",",
"self",
".",
"window",
")",
"return",
"False",
"return",
"True"
... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L4061-L4066 | |
microsoft/EdgeML | ef9f8a77f096acbdeb941014791f8eda1c1bc35b | tf/edgeml_tf/graph/protoNN.py | python | ProtoNN.getModelMatrices | (self) | return self.W, self.B, self.Z, self.gamma | Returns Tensorflow tensors of the model matrices, which
can then be evaluated to obtain corresponding numpy arrays.
These can then be exported as part of other implementations of
ProtonNN, for instance a C++ implementation or pure python
implementation.
Returns
[Proj... | Returns Tensorflow tensors of the model matrices, which
can then be evaluated to obtain corresponding numpy arrays. | [
"Returns",
"Tensorflow",
"tensors",
"of",
"the",
"model",
"matrices",
"which",
"can",
"then",
"be",
"evaluated",
"to",
"obtain",
"corresponding",
"numpy",
"arrays",
"."
] | def getModelMatrices(self):
'''
Returns Tensorflow tensors of the model matrices, which
can then be evaluated to obtain corresponding numpy arrays.
These can then be exported as part of other implementations of
ProtonNN, for instance a C++ implementation or pure python
i... | [
"def",
"getModelMatrices",
"(",
"self",
")",
":",
"return",
"self",
".",
"W",
",",
"self",
".",
"B",
",",
"self",
".",
"Z",
",",
"self",
".",
"gamma"
] | https://github.com/microsoft/EdgeML/blob/ef9f8a77f096acbdeb941014791f8eda1c1bc35b/tf/edgeml_tf/graph/protoNN.py#L101-L113 | |
microsoft/LightGBM | 904b2d5158703c4900b68008617951dd2f9ff21b | python-package/lightgbm/basic.py | python | Booster.eval | (self, data, name, feval=None) | return self.__inner_eval(name, data_idx, feval) | Evaluate for data.
Parameters
----------
data : Dataset
Data for the evaluating.
name : str
Name of the data.
feval : callable or None, optional (default=None)
Customized evaluation function.
Should accept two parameters: preds, ev... | Evaluate for data. | [
"Evaluate",
"for",
"data",
"."
] | def eval(self, data, name, feval=None):
"""Evaluate for data.
Parameters
----------
data : Dataset
Data for the evaluating.
name : str
Name of the data.
feval : callable or None, optional (default=None)
Customized evaluation function.
... | [
"def",
"eval",
"(",
"self",
",",
"data",
",",
"name",
",",
"feval",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"Dataset",
")",
":",
"raise",
"TypeError",
"(",
"\"Can only eval for Dataset instance\"",
")",
"data_idx",
"=",
"-",
"... | https://github.com/microsoft/LightGBM/blob/904b2d5158703c4900b68008617951dd2f9ff21b/python-package/lightgbm/basic.py#L3135-L3185 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Job.py | python | Jobs.run | (self, postfunc=lambda: None) | Run the jobs.
postfunc() will be invoked after the jobs has run. It will be
invoked even if the jobs are interrupted by a keyboard
interrupt (well, in fact by a signal such as either SIGINT,
SIGTERM or SIGHUP). The execution of postfunc() is protected
against keyboard interrupts... | Run the jobs. | [
"Run",
"the",
"jobs",
"."
] | def run(self, postfunc=lambda: None):
"""Run the jobs.
postfunc() will be invoked after the jobs has run. It will be
invoked even if the jobs are interrupted by a keyboard
interrupt (well, in fact by a signal such as either SIGINT,
SIGTERM or SIGHUP). The execution of postfunc()... | [
"def",
"run",
"(",
"self",
",",
"postfunc",
"=",
"lambda",
":",
"None",
")",
":",
"self",
".",
"_setup_sig_handler",
"(",
")",
"try",
":",
"self",
".",
"job",
".",
"start",
"(",
")",
"finally",
":",
"postfunc",
"(",
")",
"self",
".",
"_reset_sig_hand... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Job.py#L100-L114 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntIntVV.Partition | (self, *args) | return _snap.TIntIntVV_Partition(self, *args) | Partition(TIntIntVV self, int const & MnLValN, int const & MxRValN, bool const & Asc) -> int
Parameters:
MnLValN: int const &
MxRValN: int const &
Asc: bool const & | Partition(TIntIntVV self, int const & MnLValN, int const & MxRValN, bool const & Asc) -> int | [
"Partition",
"(",
"TIntIntVV",
"self",
"int",
"const",
"&",
"MnLValN",
"int",
"const",
"&",
"MxRValN",
"bool",
"const",
"&",
"Asc",
")",
"-",
">",
"int"
] | def Partition(self, *args):
"""
Partition(TIntIntVV self, int const & MnLValN, int const & MxRValN, bool const & Asc) -> int
Parameters:
MnLValN: int const &
MxRValN: int const &
Asc: bool const &
"""
return _snap.TIntIntVV_Partition(self, *a... | [
"def",
"Partition",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TIntIntVV_Partition",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L17095-L17105 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/lib/arraypad.py | python | _view_roi | (array, original_area_slice, axis) | return array[sl] | Get a view of the current region of interest during iterative padding.
When padding multiple dimensions iteratively corner values are
unnecessarily overwritten multiple times. This function reduces the
working area for the first dimensions so that corners are excluded.
Parameters
----------
ar... | Get a view of the current region of interest during iterative padding. | [
"Get",
"a",
"view",
"of",
"the",
"current",
"region",
"of",
"interest",
"during",
"iterative",
"padding",
"."
] | def _view_roi(array, original_area_slice, axis):
"""
Get a view of the current region of interest during iterative padding.
When padding multiple dimensions iteratively corner values are
unnecessarily overwritten multiple times. This function reduces the
working area for the first dimensions so tha... | [
"def",
"_view_roi",
"(",
"array",
",",
"original_area_slice",
",",
"axis",
")",
":",
"axis",
"+=",
"1",
"sl",
"=",
"(",
"slice",
"(",
"None",
")",
",",
")",
"*",
"axis",
"+",
"original_area_slice",
"[",
"axis",
":",
"]",
"return",
"array",
"[",
"sl",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/arraypad.py#L58-L83 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/msvc.py | python | EnvironmentInfo._unique_everseen | (iterable, key=None) | List unique elements, preserving order.
Remember all elements ever seen.
_unique_everseen('AAAABBBCCDAABBB') --> A B C D
_unique_everseen('ABBCcAD', str.lower) --> A B C D | List unique elements, preserving order.
Remember all elements ever seen. | [
"List",
"unique",
"elements",
"preserving",
"order",
".",
"Remember",
"all",
"elements",
"ever",
"seen",
"."
] | def _unique_everseen(iterable, key=None):
"""
List unique elements, preserving order.
Remember all elements ever seen.
_unique_everseen('AAAABBBCCDAABBB') --> A B C D
_unique_everseen('ABBCcAD', str.lower) --> A B C D
"""
seen = set()
seen_add = seen.add... | [
"def",
"_unique_everseen",
"(",
"iterable",
",",
"key",
"=",
"None",
")",
":",
"seen",
"=",
"set",
"(",
")",
"seen_add",
"=",
"seen",
".",
"add",
"if",
"key",
"is",
"None",
":",
"for",
"element",
"in",
"filterfalse",
"(",
"seen",
".",
"__contains__",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/msvc.py#L1805-L1825 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/keras_tensor.py | python | KerasTensor.__init__ | (self, type_spec, inferred_value=None, name=None) | Constructs a KerasTensor. | Constructs a KerasTensor. | [
"Constructs",
"a",
"KerasTensor",
"."
] | def __init__(self, type_spec, inferred_value=None, name=None):
"""Constructs a KerasTensor."""
if not isinstance(type_spec, type_spec_module.TypeSpec):
raise ValueError('KerasTensors must be constructed with a `tf.TypeSpec`.')
self._type_spec = type_spec
self._inferred_value = inferred_value
... | [
"def",
"__init__",
"(",
"self",
",",
"type_spec",
",",
"inferred_value",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"type_spec",
",",
"type_spec_module",
".",
"TypeSpec",
")",
":",
"raise",
"ValueError",
"(",
"'KerasTe... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/keras_tensor.py#L120-L127 | ||
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/toolset.py | python | flags | (rule_or_module, variable_name, condition, values = []) | Specifies the flags (variables) that must be set on targets under certain
conditions, described by arguments.
rule_or_module: If contains dot, should be a rule name.
The flags will be applied when that rule is
used to set up build actions.
... | Specifies the flags (variables) that must be set on targets under certain
conditions, described by arguments.
rule_or_module: If contains dot, should be a rule name.
The flags will be applied when that rule is
used to set up build actions.
... | [
"Specifies",
"the",
"flags",
"(",
"variables",
")",
"that",
"must",
"be",
"set",
"on",
"targets",
"under",
"certain",
"conditions",
"described",
"by",
"arguments",
".",
"rule_or_module",
":",
"If",
"contains",
"dot",
"should",
"be",
"a",
"rule",
"name",
".",... | def flags(rule_or_module, variable_name, condition, values = []):
""" Specifies the flags (variables) that must be set on targets under certain
conditions, described by arguments.
rule_or_module: If contains dot, should be a rule name.
The flags will be applied when that ... | [
"def",
"flags",
"(",
"rule_or_module",
",",
"variable_name",
",",
"condition",
",",
"values",
"=",
"[",
"]",
")",
":",
"caller",
"=",
"bjam",
".",
"caller",
"(",
")",
"[",
":",
"-",
"1",
"]",
"if",
"not",
"'.'",
"in",
"rule_or_module",
"and",
"caller... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/toolset.py#L79-L152 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | NDArray.as_in_context | (self, context) | return self.copyto(context) | Returns an array on the target device with the same value as this array.
If the target context is the same as ``self.context``, then ``self`` is
returned. Otherwise, a copy is made.
Parameters
----------
context : Context
The target context.
Returns
... | Returns an array on the target device with the same value as this array. | [
"Returns",
"an",
"array",
"on",
"the",
"target",
"device",
"with",
"the",
"same",
"value",
"as",
"this",
"array",
"."
] | def as_in_context(self, context):
"""Returns an array on the target device with the same value as this array.
If the target context is the same as ``self.context``, then ``self`` is
returned. Otherwise, a copy is made.
Parameters
----------
context : Context
... | [
"def",
"as_in_context",
"(",
"self",
",",
"context",
")",
":",
"if",
"self",
".",
"context",
"==",
"context",
":",
"return",
"self",
"return",
"self",
".",
"copyto",
"(",
"context",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L2847-L2876 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/crash/module.py | python | Module.do_rm | (self, id: str) | return 0, '', '' | Remove a saved crash <id> | Remove a saved crash <id> | [
"Remove",
"a",
"saved",
"crash",
"<id",
">"
] | def do_rm(self, id: str) -> Tuple[int, str, str]:
"""
Remove a saved crash <id>
"""
crashid = id
assert self.crashes is not None
if crashid in self.crashes:
del self.crashes[crashid]
key = 'crash/%s' % crashid
self.set_store(key, None) ... | [
"def",
"do_rm",
"(",
"self",
",",
"id",
":",
"str",
")",
"->",
"Tuple",
"[",
"int",
",",
"str",
",",
"str",
"]",
":",
"crashid",
"=",
"id",
"assert",
"self",
".",
"crashes",
"is",
"not",
"None",
"if",
"crashid",
"in",
"self",
".",
"crashes",
":",... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/crash/module.py#L298-L309 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | python | MakeGuid | (name, seed='msvs_new') | return guid | Returns a GUID for the specified target name.
Args:
name: Target name.
seed: Seed for MD5 hash.
Returns:
A GUID-line string calculated from the name and seed.
This generates something which looks like a GUID, but depends only on the
name and seed. This means the same name/seed will always generat... | Returns a GUID for the specified target name. | [
"Returns",
"a",
"GUID",
"for",
"the",
"specified",
"target",
"name",
"."
] | def MakeGuid(name, seed='msvs_new'):
"""Returns a GUID for the specified target name.
Args:
name: Target name.
seed: Seed for MD5 hash.
Returns:
A GUID-line string calculated from the name and seed.
This generates something which looks like a GUID, but depends only on the
name and seed. This me... | [
"def",
"MakeGuid",
"(",
"name",
",",
"seed",
"=",
"'msvs_new'",
")",
":",
"# Calculate a MD5 signature for the seed and name.",
"d",
"=",
"_new_md5",
"(",
"str",
"(",
"seed",
")",
"+",
"str",
"(",
"name",
")",
")",
".",
"hexdigest",
"(",
")",
".",
"upper",... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py#L37-L57 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | TextCtrl.MacCheckSpelling | (*args, **kwargs) | return _controls_.TextCtrl_MacCheckSpelling(*args, **kwargs) | MacCheckSpelling(self, bool check) | MacCheckSpelling(self, bool check) | [
"MacCheckSpelling",
"(",
"self",
"bool",
"check",
")"
] | def MacCheckSpelling(*args, **kwargs):
"""MacCheckSpelling(self, bool check)"""
return _controls_.TextCtrl_MacCheckSpelling(*args, **kwargs) | [
"def",
"MacCheckSpelling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextCtrl_MacCheckSpelling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L2043-L2045 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py | python | BucketizedColumn.get_dense_tensor | (self, transformation_cache, state_manager) | return self._get_dense_tensor_for_input_tensor(input_tensor) | Returns one hot encoded dense `Tensor`. | Returns one hot encoded dense `Tensor`. | [
"Returns",
"one",
"hot",
"encoded",
"dense",
"Tensor",
"."
] | def get_dense_tensor(self, transformation_cache, state_manager):
"""Returns one hot encoded dense `Tensor`."""
input_tensor = transformation_cache.get(self, state_manager)
return self._get_dense_tensor_for_input_tensor(input_tensor) | [
"def",
"get_dense_tensor",
"(",
"self",
",",
"transformation_cache",
",",
"state_manager",
")",
":",
"input_tensor",
"=",
"transformation_cache",
".",
"get",
"(",
"self",
",",
"state_manager",
")",
"return",
"self",
".",
"_get_dense_tensor_for_input_tensor",
"(",
"i... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L2934-L2937 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_pswindows.py | python | WindowsService.username | (self) | return self._query_config()['username'] | The name of the user that owns this service. | The name of the user that owns this service. | [
"The",
"name",
"of",
"the",
"user",
"that",
"owns",
"this",
"service",
"."
] | def username(self):
"""The name of the user that owns this service."""
return self._query_config()['username'] | [
"def",
"username",
"(",
"self",
")",
":",
"return",
"self",
".",
"_query_config",
"(",
")",
"[",
"'username'",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_pswindows.py#L564-L566 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | NDArray.clip | (self, *args, **kwargs) | return op.clip(self, *args, **kwargs) | Convenience fluent method for :py:func:`clip`.
The arguments are the same as for :py:func:`clip`, with
this array as data. | Convenience fluent method for :py:func:`clip`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"clip",
"."
] | def clip(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`clip`.
The arguments are the same as for :py:func:`clip`, with
this array as data.
"""
return op.clip(self, *args, **kwargs) | [
"def",
"clip",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"clip",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L1734-L1740 | |
ucbrise/confluo | 578883a4f7fbbb4aea78c342d366f5122ef598f7 | pyclient/confluo/rpc/client.py | python | RpcClient.read_raw | (self, offset) | return self.client_.read(self.cur_m_id_, offset, self.cur_schema_.record_size_) | Reads raw data from a specified offset.
Args:
offset: The offset from the log to read from.
Raises:
ValueError.
Returns:
The data at the offset. | Reads raw data from a specified offset. | [
"Reads",
"raw",
"data",
"from",
"a",
"specified",
"offset",
"."
] | def read_raw(self, offset):
""" Reads raw data from a specified offset.
Args:
offset: The offset from the log to read from.
Raises:
ValueError.
Returns:
The data at the offset.
"""
if self.cur_m_id_ == -1:
raise ValueError(... | [
"def",
"read_raw",
"(",
"self",
",",
"offset",
")",
":",
"if",
"self",
".",
"cur_m_id_",
"==",
"-",
"1",
":",
"raise",
"ValueError",
"(",
"\"Must set atomic multilog first.\"",
")",
"return",
"self",
".",
"client_",
".",
"read",
"(",
"self",
".",
"cur_m_id... | https://github.com/ucbrise/confluo/blob/578883a4f7fbbb4aea78c342d366f5122ef598f7/pyclient/confluo/rpc/client.py#L249-L261 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/SerializableVisitor.py | python | SerializableVisitor._get_args_string | (self, obj) | return arg_str | Return a string of (type, name) args, comma separated
for use in templates that generate prototypes. | Return a string of (type, name) args, comma separated
for use in templates that generate prototypes. | [
"Return",
"a",
"string",
"of",
"(",
"type",
"name",
")",
"args",
"comma",
"separated",
"for",
"use",
"in",
"templates",
"that",
"generate",
"prototypes",
"."
] | def _get_args_string(self, obj):
"""
Return a string of (type, name) args, comma separated
for use in templates that generate prototypes.
"""
arg_str = ""
for (name, mtype, size, format, comment) in obj.get_members():
if isinstance(mtype, tuple):
... | [
"def",
"_get_args_string",
"(",
"self",
",",
"obj",
")",
":",
"arg_str",
"=",
"\"\"",
"for",
"(",
"name",
",",
"mtype",
",",
"size",
",",
"format",
",",
"comment",
")",
"in",
"obj",
".",
"get_members",
"(",
")",
":",
"if",
"isinstance",
"(",
"mtype",... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/SerializableVisitor.py#L81-L102 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/ImageQt.py | python | rgb | (r, g, b, a=255) | return qRgba(r, g, b, a) & 0xFFFFFFFF | (Internal) Turns an RGB color into a Qt compatible color integer. | (Internal) Turns an RGB color into a Qt compatible color integer. | [
"(",
"Internal",
")",
"Turns",
"an",
"RGB",
"color",
"into",
"a",
"Qt",
"compatible",
"color",
"integer",
"."
] | def rgb(r, g, b, a=255):
"""(Internal) Turns an RGB color into a Qt compatible color integer."""
# use qRgb to pack the colors, and then turn the resulting long
# into a negative integer with the same bitpattern.
return qRgba(r, g, b, a) & 0xFFFFFFFF | [
"def",
"rgb",
"(",
"r",
",",
"g",
",",
"b",
",",
"a",
"=",
"255",
")",
":",
"# use qRgb to pack the colors, and then turn the resulting long",
"# into a negative integer with the same bitpattern.",
"return",
"qRgba",
"(",
"r",
",",
"g",
",",
"b",
",",
"a",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/ImageQt.py#L46-L50 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/FindUBUtility.py | python | SelectUBMatrixScansDialog.__init__ | (self, parent) | initialization
:param parent: | initialization
:param parent: | [
"initialization",
":",
"param",
"parent",
":"
] | def __init__(self, parent):
"""
initialization
:param parent:
"""
super(SelectUBMatrixScansDialog, self).__init__(parent)
self._myParent = parent
# set ui
ui_path = "UBSelectPeaksDialog.ui"
self.ui = load_ui(__file__, ui_path, baseinstance=self)
... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
")",
":",
"super",
"(",
"SelectUBMatrixScansDialog",
",",
"self",
")",
".",
"__init__",
"(",
"parent",
")",
"self",
".",
"_myParent",
"=",
"parent",
"# set ui",
"ui_path",
"=",
"\"UBSelectPeaksDialog.ui\"",
"self"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/FindUBUtility.py#L126-L142 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/__init__.py | python | RDSConnection.create_dbsnapshot | (self, snapshot_id, dbinstance_id) | return self.get_object('CreateDBSnapshot', params, DBSnapshot) | Create a new DB snapshot.
:type snapshot_id: string
:param snapshot_id: The identifier for the DBSnapshot
:type dbinstance_id: string
:param dbinstance_id: The source identifier for the RDS instance from
which the snapshot is created.
:rtype: :cla... | Create a new DB snapshot. | [
"Create",
"a",
"new",
"DB",
"snapshot",
"."
] | def create_dbsnapshot(self, snapshot_id, dbinstance_id):
"""
Create a new DB snapshot.
:type snapshot_id: string
:param snapshot_id: The identifier for the DBSnapshot
:type dbinstance_id: string
:param dbinstance_id: The source identifier for the RDS instance from
... | [
"def",
"create_dbsnapshot",
"(",
"self",
",",
"snapshot_id",
",",
"dbinstance_id",
")",
":",
"params",
"=",
"{",
"'DBSnapshotIdentifier'",
":",
"snapshot_id",
",",
"'DBInstanceIdentifier'",
":",
"dbinstance_id",
"}",
"return",
"self",
".",
"get_object",
"(",
"'Cre... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/__init__.py#L1164-L1180 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py | python | _SSLPipe.feed_eof | (self) | Send a potentially "ragged" EOF.
This method will raise an SSL_ERROR_EOF exception if the EOF is
unexpected. | Send a potentially "ragged" EOF. | [
"Send",
"a",
"potentially",
"ragged",
"EOF",
"."
] | def feed_eof(self):
"""Send a potentially "ragged" EOF.
This method will raise an SSL_ERROR_EOF exception if the EOF is
unexpected.
"""
self._incoming.write_eof()
ssldata, appdata = self.feed_ssldata(b'')
assert appdata == [] or appdata == [b''] | [
"def",
"feed_eof",
"(",
"self",
")",
":",
"self",
".",
"_incoming",
".",
"write_eof",
"(",
")",
"ssldata",
",",
"appdata",
"=",
"self",
".",
"feed_ssldata",
"(",
"b''",
")",
"assert",
"appdata",
"==",
"[",
"]",
"or",
"appdata",
"==",
"[",
"b''",
"]"
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/sslproto.py#L147-L155 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/control/robotinterface.py | python | RobotInterfaceBase.commandedVelocity | (self) | Retrieves the currently commanded joint velocity. | Retrieves the currently commanded joint velocity. | [
"Retrieves",
"the",
"currently",
"commanded",
"joint",
"velocity",
"."
] | def commandedVelocity(self) -> Vector:
"""Retrieves the currently commanded joint velocity.
"""
raise NotImplementedError() | [
"def",
"commandedVelocity",
"(",
"self",
")",
"->",
"Vector",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterface.py#L449-L452 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/rmsprop.py | python | RMSPropOptimizer.__init__ | (self,
learning_rate,
decay=0.9,
momentum=0.0,
epsilon=1e-10,
use_locking=False,
name="RMSProp") | Construct a new RMSProp optimizer.
Note that in dense implement of this algorithm, m_t and v_t will
update even if g is zero, but in sparse implement, m_t and v_t
will not update in iterations g is zero.
Args:
learning_rate: A Tensor or a floating point value. The learning rate.
decay: ... | Construct a new RMSProp optimizer. | [
"Construct",
"a",
"new",
"RMSProp",
"optimizer",
"."
] | def __init__(self,
learning_rate,
decay=0.9,
momentum=0.0,
epsilon=1e-10,
use_locking=False,
name="RMSProp"):
"""Construct a new RMSProp optimizer.
Note that in dense implement of this algorithm, m_t and v_t will
upd... | [
"def",
"__init__",
"(",
"self",
",",
"learning_rate",
",",
"decay",
"=",
"0.9",
",",
"momentum",
"=",
"0.0",
",",
"epsilon",
"=",
"1e-10",
",",
"use_locking",
"=",
"False",
",",
"name",
"=",
"\"RMSProp\"",
")",
":",
"super",
"(",
"RMSPropOptimizer",
",",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/rmsprop.py#L51-L83 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | FloatProperty_DoValidation | (*args, **kwargs) | return _propgrid.FloatProperty_DoValidation(*args, **kwargs) | FloatProperty_DoValidation(PGProperty property, double value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool | FloatProperty_DoValidation(PGProperty property, double value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool | [
"FloatProperty_DoValidation",
"(",
"PGProperty",
"property",
"double",
"value",
"PGValidationInfo",
"pValidationInfo",
"int",
"mode",
"=",
"PG_PROPERTY_VALIDATION_ERROR_MESSAGE",
")",
"-",
">",
"bool"
] | def FloatProperty_DoValidation(*args, **kwargs):
"""
FloatProperty_DoValidation(PGProperty property, double value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool
"""
return _propgrid.FloatProperty_DoValidation(*args, **kwargs) | [
"def",
"FloatProperty_DoValidation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"FloatProperty_DoValidation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2975-L2980 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/instrument.py | python | Instrument.relist_interval | (self, relist_interval) | Sets the relist_interval of this Instrument.
:param relist_interval: The relist_interval of this Instrument. # noqa: E501
:type: datetime | Sets the relist_interval of this Instrument. | [
"Sets",
"the",
"relist_interval",
"of",
"this",
"Instrument",
"."
] | def relist_interval(self, relist_interval):
"""Sets the relist_interval of this Instrument.
:param relist_interval: The relist_interval of this Instrument. # noqa: E501
:type: datetime
"""
self._relist_interval = relist_interval | [
"def",
"relist_interval",
"(",
"self",
",",
"relist_interval",
")",
":",
"self",
".",
"_relist_interval",
"=",
"relist_interval"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L740-L748 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/boto3/__init__.py | python | client | (*args, **kwargs) | return _get_default_session().client(*args, **kwargs) | Create a low-level service client by name using the default session.
See :py:meth:`boto3.session.Session.client`. | Create a low-level service client by name using the default session. | [
"Create",
"a",
"low",
"-",
"level",
"service",
"client",
"by",
"name",
"using",
"the",
"default",
"session",
"."
] | def client(*args, **kwargs):
"""
Create a low-level service client by name using the default session.
See :py:meth:`boto3.session.Session.client`.
"""
return _get_default_session().client(*args, **kwargs) | [
"def",
"client",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_get_default_session",
"(",
")",
".",
"client",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/boto3/__init__.py#L77-L83 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/core/numeric.py | python | cross | (a, b, axisa=-1, axisb=-1, axisc=-1, axis=None) | return moveaxis(cp, -1, axisc) | Return the cross product of two (arrays of) vectors.
The cross product of `a` and `b` in :math:`R^3` is a vector perpendicular
to both `a` and `b`. If `a` and `b` are arrays of vectors, the vectors
are defined by the last axis of `a` and `b` by default, and these axes
can have dimensions 2 or 3. Wher... | Return the cross product of two (arrays of) vectors. | [
"Return",
"the",
"cross",
"product",
"of",
"two",
"(",
"arrays",
"of",
")",
"vectors",
"."
] | def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
"""
Return the cross product of two (arrays of) vectors.
The cross product of `a` and `b` in :math:`R^3` is a vector perpendicular
to both `a` and `b`. If `a` and `b` are arrays of vectors, the vectors
are defined by the last axis of `a` an... | [
"def",
"cross",
"(",
"a",
",",
"b",
",",
"axisa",
"=",
"-",
"1",
",",
"axisb",
"=",
"-",
"1",
",",
"axisc",
"=",
"-",
"1",
",",
"axis",
"=",
"None",
")",
":",
"if",
"axis",
"is",
"not",
"None",
":",
"axisa",
",",
"axisb",
",",
"axisc",
"=",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/numeric.py#L1479-L1673 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.