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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py | python | Telnet.process_rawq | (self) | Transfer from raw queue to cooked queue.
Set self.eof when connection is closed. Don't block unless in
the midst of an IAC sequence. | Transfer from raw queue to cooked queue. | [
"Transfer",
"from",
"raw",
"queue",
"to",
"cooked",
"queue",
"."
] | def process_rawq(self):
"""Transfer from raw queue to cooked queue.
Set self.eof when connection is closed. Don't block unless in
the midst of an IAC sequence.
"""
buf = ['', '']
try:
while self.rawq:
c = self.rawq_getchar()
... | [
"def",
"process_rawq",
"(",
"self",
")",
":",
"buf",
"=",
"[",
"''",
",",
"''",
"]",
"try",
":",
"while",
"self",
".",
"rawq",
":",
"c",
"=",
"self",
".",
"rawq_getchar",
"(",
")",
"if",
"not",
"self",
".",
"iacseq",
":",
"if",
"c",
"==",
"theN... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py#L471-L541 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/scipy/linalg.py | python | eigh | (a, b=None, lower=True, eigvals_only=False, overwrite_a=False,
overwrite_b=False, turbo=True, eigvals=None, _type=1,
check_finite=True) | return eigh_net(a) | Solve a standard or generalized eigenvalue problem for a complex Hermitian or real symmetric matrix.
Find eigenvalues Tensor `w` and optionally eigenvectors Tensor `v` of Tensor `a`,
where `b` is positive definite such that for every eigenvalue `λ` (i-th entry of w) and
its eigenvector `vi` (i-th column of... | Solve a standard or generalized eigenvalue problem for a complex Hermitian or real symmetric matrix. | [
"Solve",
"a",
"standard",
"or",
"generalized",
"eigenvalue",
"problem",
"for",
"a",
"complex",
"Hermitian",
"or",
"real",
"symmetric",
"matrix",
"."
] | def eigh(a, b=None, lower=True, eigvals_only=False, overwrite_a=False,
overwrite_b=False, turbo=True, eigvals=None, _type=1,
check_finite=True):
"""
Solve a standard or generalized eigenvalue problem for a complex Hermitian or real symmetric matrix.
Find eigenvalues Tensor `w` and optiona... | [
"def",
"eigh",
"(",
"a",
",",
"b",
"=",
"None",
",",
"lower",
"=",
"True",
",",
"eigvals_only",
"=",
"False",
",",
"overwrite_a",
"=",
"False",
",",
"overwrite_b",
"=",
"False",
",",
"turbo",
"=",
"True",
",",
"eigvals",
"=",
"None",
",",
"_type",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/scipy/linalg.py#L331-L400 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/ipaddress.py | python | _collapse_addresses_internal | (addresses) | Loops through the addresses, collapsing concurrent netblocks.
Example:
ip1 = IPv4Network('192.0.2.0/26')
ip2 = IPv4Network('192.0.2.64/26')
ip3 = IPv4Network('192.0.2.128/26')
ip4 = IPv4Network('192.0.2.192/26')
_collapse_addresses_internal([ip1, ip2, ip3, ip4]) ->
... | Loops through the addresses, collapsing concurrent netblocks. | [
"Loops",
"through",
"the",
"addresses",
"collapsing",
"concurrent",
"netblocks",
"."
] | def _collapse_addresses_internal(addresses):
"""Loops through the addresses, collapsing concurrent netblocks.
Example:
ip1 = IPv4Network('192.0.2.0/26')
ip2 = IPv4Network('192.0.2.64/26')
ip3 = IPv4Network('192.0.2.128/26')
ip4 = IPv4Network('192.0.2.192/26')
_collapse... | [
"def",
"_collapse_addresses_internal",
"(",
"addresses",
")",
":",
"# First merge",
"to_merge",
"=",
"list",
"(",
"addresses",
")",
"subnets",
"=",
"{",
"}",
"while",
"to_merge",
":",
"net",
"=",
"to_merge",
".",
"pop",
"(",
")",
"supernet",
"=",
"net",
".... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ipaddress.py#L257-L303 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | libcxx/utils/google-benchmark/tools/gbench/util.py | python | remove_benchmark_flags | (prefix, benchmark_flags) | return [f for f in benchmark_flags if not f.startswith(prefix)] | Return a new list containing the specified benchmark_flags except those
with the specified prefix. | Return a new list containing the specified benchmark_flags except those
with the specified prefix. | [
"Return",
"a",
"new",
"list",
"containing",
"the",
"specified",
"benchmark_flags",
"except",
"those",
"with",
"the",
"specified",
"prefix",
"."
] | def remove_benchmark_flags(prefix, benchmark_flags):
"""
Return a new list containing the specified benchmark_flags except those
with the specified prefix.
"""
assert prefix.startswith('--') and prefix.endswith('=')
return [f for f in benchmark_flags if not f.startswith(prefix)] | [
"def",
"remove_benchmark_flags",
"(",
"prefix",
",",
"benchmark_flags",
")",
":",
"assert",
"prefix",
".",
"startswith",
"(",
"'--'",
")",
"and",
"prefix",
".",
"endswith",
"(",
"'='",
")",
"return",
"[",
"f",
"for",
"f",
"in",
"benchmark_flags",
"if",
"no... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/libcxx/utils/google-benchmark/tools/gbench/util.py#L104-L110 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rospy/src/rospy/impl/tcpros_base.py | python | TCPROSTransport.receive_loop | (self, msgs_callback) | Receive messages until shutdown
@param msgs_callback: callback to invoke for new messages received
@type msgs_callback: fn([msg]) | Receive messages until shutdown | [
"Receive",
"messages",
"until",
"shutdown"
] | def receive_loop(self, msgs_callback):
"""
Receive messages until shutdown
@param msgs_callback: callback to invoke for new messages received
@type msgs_callback: fn([msg])
"""
# - use assert here as this would be an internal error, aka bug
logger.debug("rece... | [
"def",
"receive_loop",
"(",
"self",
",",
"msgs_callback",
")",
":",
"# - use assert here as this would be an internal error, aka bug",
"logger",
".",
"debug",
"(",
"\"receive_loop for [%s]\"",
",",
"self",
".",
"name",
")",
"try",
":",
"while",
"not",
"self",
".",
"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/tcpros_base.py#L751-L800 | ||
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/selectionDataModel.py | python | SelectionDataModel._ensureValidPrimPath | (self, path) | return sdfPath | Validate an input path. If it is a string path, convert it to an
Sdf.Path object. | Validate an input path. If it is a string path, convert it to an
Sdf.Path object. | [
"Validate",
"an",
"input",
"path",
".",
"If",
"it",
"is",
"a",
"string",
"path",
"convert",
"it",
"to",
"an",
"Sdf",
".",
"Path",
"object",
"."
] | def _ensureValidPrimPath(self, path):
"""Validate an input path. If it is a string path, convert it to an
Sdf.Path object.
"""
sdfPath = Sdf.Path(str(path))
if not sdfPath.IsAbsoluteRootOrPrimPath():
raise ValueError("Path must be a prim path, got: {}".format(
... | [
"def",
"_ensureValidPrimPath",
"(",
"self",
",",
"path",
")",
":",
"sdfPath",
"=",
"Sdf",
".",
"Path",
"(",
"str",
"(",
"path",
")",
")",
"if",
"not",
"sdfPath",
".",
"IsAbsoluteRootOrPrimPath",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"Path must be a ... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L427-L436 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/EditorLib/RectangleEffect.py | python | RectangleEffectTool.cleanup | (self) | call superclass to clean up actor | call superclass to clean up actor | [
"call",
"superclass",
"to",
"clean",
"up",
"actor"
] | def cleanup(self):
"""
call superclass to clean up actor
"""
super(RectangleEffectTool,self).cleanup() | [
"def",
"cleanup",
"(",
"self",
")",
":",
"super",
"(",
"RectangleEffectTool",
",",
"self",
")",
".",
"cleanup",
"(",
")"
] | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/EditorLib/RectangleEffect.py#L120-L124 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | libcxx/utils/gdb/libcxx/printers.py | python | StdDequePrinter._list_it | (self) | Primary iteration worker. | Primary iteration worker. | [
"Primary",
"iteration",
"worker",
"."
] | def _list_it(self):
"""Primary iteration worker."""
num_emitted = 0
current_addr = self.start_ptr
start_index = self.first_block_start_index
while num_emitted < self.size:
end_index = min(start_index + self.size -
num_emitted, self.block_si... | [
"def",
"_list_it",
"(",
"self",
")",
":",
"num_emitted",
"=",
"0",
"current_addr",
"=",
"self",
".",
"start_ptr",
"start_index",
"=",
"self",
".",
"first_block_start_index",
"while",
"num_emitted",
"<",
"self",
".",
"size",
":",
"end_index",
"=",
"min",
"(",... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/libcxx/utils/gdb/libcxx/printers.py#L463-L476 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/estimators/linear.py | python | LinearClassifier.predict_proba | (self, x=None, input_fn=None, batch_size=None, outputs=None,
as_iterable=False) | return preds[_PROBABILITIES] | Runs inference to determine the class probability predictions. | Runs inference to determine the class probability predictions. | [
"Runs",
"inference",
"to",
"determine",
"the",
"class",
"probability",
"predictions",
"."
] | def predict_proba(self, x=None, input_fn=None, batch_size=None, outputs=None,
as_iterable=False):
"""Runs inference to determine the class probability predictions."""
preds = self._estimator.predict(x=x, input_fn=input_fn,
batch_size=batch_size,
... | [
"def",
"predict_proba",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"outputs",
"=",
"None",
",",
"as_iterable",
"=",
"False",
")",
":",
"preds",
"=",
"self",
".",
"_estimator",
".",
"predict",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/linear.py#L546-L555 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py | python | _addHandlerRef | (handler) | Add a handler to the internal cleanup list using a weak reference. | Add a handler to the internal cleanup list using a weak reference. | [
"Add",
"a",
"handler",
"to",
"the",
"internal",
"cleanup",
"list",
"using",
"a",
"weak",
"reference",
"."
] | def _addHandlerRef(handler):
"""
Add a handler to the internal cleanup list using a weak reference.
"""
_acquireLock()
try:
_handlerList.append(weakref.ref(handler, _removeHandlerRef))
finally:
_releaseLock() | [
"def",
"_addHandlerRef",
"(",
"handler",
")",
":",
"_acquireLock",
"(",
")",
"try",
":",
"_handlerList",
".",
"append",
"(",
"weakref",
".",
"ref",
"(",
"handler",
",",
"_removeHandlerRef",
")",
")",
"finally",
":",
"_releaseLock",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py#L783-L791 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/Direct/dgreduce.py | python | runs_are_equal | (ws1,ws2) | return run_num1==run_num2 | Compare two run numbers, provided either as run numbers,
or as workspaces or as ws names | Compare two run numbers, provided either as run numbers,
or as workspaces or as ws names | [
"Compare",
"two",
"run",
"numbers",
"provided",
"either",
"as",
"run",
"numbers",
"or",
"as",
"workspaces",
"or",
"as",
"ws",
"names"
] | def runs_are_equal(ws1,ws2):
"""Compare two run numbers, provided either as run numbers,
or as workspaces or as ws names"""
if ws1 == ws2:
return True
#-----------------------------------------------
def get_run_num(name_or_ws):
err = None
if isinstance(name_or_ws,api.Ma... | [
"def",
"runs_are_equal",
"(",
"ws1",
",",
"ws2",
")",
":",
"if",
"ws1",
"==",
"ws2",
":",
"return",
"True",
"#-----------------------------------------------",
"def",
"get_run_num",
"(",
"name_or_ws",
")",
":",
"err",
"=",
"None",
"if",
"isinstance",
"(",
"nam... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/dgreduce.py#L161-L190 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/cli/command_parser.py | python | _parse_interval | (interval_str) | return Interval(start=start_item,
start_included=(interval_str[0] == "["),
end=end_item,
end_included=(interval_str[-1] == "]")) | Convert a human-readable interval to a tuple of start and end value.
Args:
interval_str: (`str`) A human-readable str representing an interval
(e.g., "[1M, 2M]", "<100k", ">100ms"). The items following the ">", "<",
">=" and "<=" signs have to start with a number (e.g., 3.0, -2, .98).
The same ... | Convert a human-readable interval to a tuple of start and end value. | [
"Convert",
"a",
"human",
"-",
"readable",
"interval",
"to",
"a",
"tuple",
"of",
"start",
"and",
"end",
"value",
"."
] | def _parse_interval(interval_str):
"""Convert a human-readable interval to a tuple of start and end value.
Args:
interval_str: (`str`) A human-readable str representing an interval
(e.g., "[1M, 2M]", "<100k", ">100ms"). The items following the ">", "<",
">=" and "<=" signs have to start with a numb... | [
"def",
"_parse_interval",
"(",
"interval_str",
")",
":",
"interval_str",
"=",
"interval_str",
".",
"strip",
"(",
")",
"if",
"interval_str",
".",
"startswith",
"(",
"\"<=\"",
")",
":",
"if",
"_NUMBER_PATTERN",
".",
"match",
"(",
"interval_str",
"[",
"2",
":",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/cli/command_parser.py#L342-L405 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/NTableWidget.py | python | NTableWidget.select_row | (self, row_index, status=True) | return | Select a row
:param row_index:
:param status:
:return: | Select a row
:param row_index:
:param status:
:return: | [
"Select",
"a",
"row",
":",
"param",
"row_index",
":",
":",
"param",
"status",
":",
":",
"return",
":"
] | def select_row(self, row_index, status=True):
"""
Select a row
:param row_index:
:param status:
:return:
"""
# get column index
try:
status_col_index = self._myColumnNameList.index(self._statusColName)
except ValueError as e:
... | [
"def",
"select_row",
"(",
"self",
",",
"row_index",
",",
"status",
"=",
"True",
")",
":",
"# get column index",
"try",
":",
"status_col_index",
"=",
"self",
".",
"_myColumnNameList",
".",
"index",
"(",
"self",
".",
"_statusColName",
")",
"except",
"ValueError... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/NTableWidget.py#L398-L420 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py | python | SdcaModel.approximate_duality_gap | (self) | Add operations to compute the approximate duality gap.
Returns:
An Operation that computes the approximate duality gap over all
examples. | Add operations to compute the approximate duality gap. | [
"Add",
"operations",
"to",
"compute",
"the",
"approximate",
"duality",
"gap",
"."
] | def approximate_duality_gap(self):
"""Add operations to compute the approximate duality gap.
Returns:
An Operation that computes the approximate duality gap over all
examples.
"""
with name_scope('sdca/approximate_duality_gap'):
_, values_list = self._hashtable.export_sharded()
... | [
"def",
"approximate_duality_gap",
"(",
"self",
")",
":",
"with",
"name_scope",
"(",
"'sdca/approximate_duality_gap'",
")",
":",
"_",
",",
"values_list",
"=",
"self",
".",
"_hashtable",
".",
"export_sharded",
"(",
")",
"shard_sums",
"=",
"[",
"]",
"for",
"value... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py#L400-L429 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/platform.py | python | popen | (cmd, mode='r', bufsize=None) | Portable popen() interface. | Portable popen() interface. | [
"Portable",
"popen",
"()",
"interface",
"."
] | def popen(cmd, mode='r', bufsize=None):
""" Portable popen() interface.
"""
# Find a working popen implementation preferring win32pipe.popen
# over os.popen over _popen
popen = None
if os.environ.get('OS','') == 'Windows_NT':
# On NT win32pipe should work; on Win9x it hangs due to bugs
... | [
"def",
"popen",
"(",
"cmd",
",",
"mode",
"=",
"'r'",
",",
"bufsize",
"=",
"None",
")",
":",
"# Find a working popen implementation preferring win32pipe.popen",
"# over os.popen over _popen",
"popen",
"=",
"None",
"if",
"os",
".",
"environ",
".",
"get",
"(",
"'OS'"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/platform.py#L421-L452 | ||
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Type.is_restrict_qualified | (self) | return conf.lib.clang_isRestrictQualifiedType(self) | Determine whether a Type has the "restrict" qualifier set.
This does not look through typedefs that may have added "restrict" at
a different level. | Determine whether a Type has the "restrict" qualifier set. | [
"Determine",
"whether",
"a",
"Type",
"has",
"the",
"restrict",
"qualifier",
"set",
"."
] | def is_restrict_qualified(self):
"""Determine whether a Type has the "restrict" qualifier set.
This does not look through typedefs that may have added "restrict" at
a different level.
"""
return conf.lib.clang_isRestrictQualifiedType(self) | [
"def",
"is_restrict_qualified",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isRestrictQualifiedType",
"(",
"self",
")"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1756-L1762 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py | python | StreamHixie75.receive_message | (self) | Receive a WebSocket frame and return its payload an unicode string.
Returns:
payload unicode string in a WebSocket frame.
Raises:
ConnectionTerminatedException: when read returns empty
string.
BadOperationException: when called on a client-terminated... | Receive a WebSocket frame and return its payload an unicode string. | [
"Receive",
"a",
"WebSocket",
"frame",
"and",
"return",
"its",
"payload",
"an",
"unicode",
"string",
"."
] | def receive_message(self):
"""Receive a WebSocket frame and return its payload an unicode string.
Returns:
payload unicode string in a WebSocket frame.
Raises:
ConnectionTerminatedException: when read returns empty
string.
BadOperationExcepti... | [
"def",
"receive_message",
"(",
"self",
")",
":",
"if",
"self",
".",
"_request",
".",
"client_terminated",
":",
"raise",
"BadOperationException",
"(",
"'Requested receive_message after receiving a closing '",
"'handshake'",
")",
"while",
"True",
":",
"# Read 1 byte.",
"#... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py#L115-L174 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/utils/registry.py | python | Registry.__init__ | (self, name) | Creates a new registry. | Creates a new registry. | [
"Creates",
"a",
"new",
"registry",
"."
] | def __init__(self, name):
"""Creates a new registry."""
self._name = name
self._registry = {} | [
"def",
"__init__",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"_name",
"=",
"name",
"self",
".",
"_registry",
"=",
"{",
"}"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_pytorch/nndct_shared/utils/registry.py#L31-L34 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/model.py | python | ResourceModel.get_attributes | (self, shape) | return attributes | Get a dictionary of attribute names to original name and shape
models that represent the attributes of this resource. Looks
like the following:
{
'some_name': ('SomeName', <Shape...>)
}
:type shape: botocore.model.Shape
:param shape: The underlyi... | Get a dictionary of attribute names to original name and shape
models that represent the attributes of this resource. Looks
like the following: | [
"Get",
"a",
"dictionary",
"of",
"attribute",
"names",
"to",
"original",
"name",
"and",
"shape",
"models",
"that",
"represent",
"the",
"attributes",
"of",
"this",
"resource",
".",
"Looks",
"like",
"the",
"following",
":"
] | def get_attributes(self, shape):
"""
Get a dictionary of attribute names to original name and shape
models that represent the attributes of this resource. Looks
like the following:
{
'some_name': ('SomeName', <Shape...>)
}
:type shape: bo... | [
"def",
"get_attributes",
"(",
"self",
",",
"shape",
")",
":",
"attributes",
"=",
"{",
"}",
"identifier_names",
"=",
"[",
"i",
".",
"name",
"for",
"i",
"in",
"self",
".",
"identifiers",
"]",
"for",
"name",
",",
"member",
"in",
"shape",
".",
"members",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/model.py#L391-L418 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/memory_inspector/memory_inspector/core/backends.py | python | Device.ListProcesses | (self) | Returns a sequence of |Process|. | Returns a sequence of |Process|. | [
"Returns",
"a",
"sequence",
"of",
"|Process|",
"."
] | def ListProcesses(self):
"""Returns a sequence of |Process|."""
raise NotImplementedError() | [
"def",
"ListProcesses",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/memory_inspector/memory_inspector/core/backends.py#L96-L98 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/sigparse.py | python | parse_signature | (sig) | return inputs, outputs | Parse generalized ufunc signature.
NOTE: ',' (COMMA) is a delimiter; not separator.
This means trailing comma is legal. | Parse generalized ufunc signature. | [
"Parse",
"generalized",
"ufunc",
"signature",
"."
] | def parse_signature(sig):
'''Parse generalized ufunc signature.
NOTE: ',' (COMMA) is a delimiter; not separator.
This means trailing comma is legal.
'''
def stripws(s):
return ''.join(c for c in s if c not in string.whitespace)
def tokenizer(src):
def readline():
... | [
"def",
"parse_signature",
"(",
"sig",
")",
":",
"def",
"stripws",
"(",
"s",
")",
":",
"return",
"''",
".",
"join",
"(",
"c",
"for",
"c",
"in",
"s",
"if",
"c",
"not",
"in",
"string",
".",
"whitespace",
")",
"def",
"tokenizer",
"(",
"src",
")",
":"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/sigparse.py#L7-L65 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/spectral.py | python | csd | (x, y, fs=1.0, window='hann', nperseg=None, noverlap=None, nfft=None,
detrend='constant', return_onesided=True, scaling='density',
axis=-1, average='mean') | return freqs, Pxy | r"""
Estimate the cross power spectral density, Pxy, using Welch's
method.
Parameters
----------
x : array_like
Time series of measurement values
y : array_like
Time series of measurement values
fs : float, optional
Sampling frequency of the `x` and `y` time series. ... | r"""
Estimate the cross power spectral density, Pxy, using Welch's
method. | [
"r",
"Estimate",
"the",
"cross",
"power",
"spectral",
"density",
"Pxy",
"using",
"Welch",
"s",
"method",
"."
] | def csd(x, y, fs=1.0, window='hann', nperseg=None, noverlap=None, nfft=None,
detrend='constant', return_onesided=True, scaling='density',
axis=-1, average='mean'):
r"""
Estimate the cross power spectral density, Pxy, using Welch's
method.
Parameters
----------
x : array_like
... | [
"def",
"csd",
"(",
"x",
",",
"y",
",",
"fs",
"=",
"1.0",
",",
"window",
"=",
"'hann'",
",",
"nperseg",
"=",
"None",
",",
"noverlap",
"=",
"None",
",",
"nfft",
"=",
"None",
",",
"detrend",
"=",
"'constant'",
",",
"return_onesided",
"=",
"True",
",",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/spectral.py#L460-L601 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/osx_cocoa/gizmos.py | python | TreeListCtrl.SetStateImageList | (*args, **kwargs) | return _gizmos.TreeListCtrl_SetStateImageList(*args, **kwargs) | SetStateImageList(self, ImageList imageList) | SetStateImageList(self, ImageList imageList) | [
"SetStateImageList",
"(",
"self",
"ImageList",
"imageList",
")"
] | def SetStateImageList(*args, **kwargs):
"""SetStateImageList(self, ImageList imageList)"""
return _gizmos.TreeListCtrl_SetStateImageList(*args, **kwargs) | [
"def",
"SetStateImageList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_SetStateImageList",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L535-L537 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewCtrl.GetIndent | (*args, **kwargs) | return _dataview.DataViewCtrl_GetIndent(*args, **kwargs) | GetIndent(self) -> int | GetIndent(self) -> int | [
"GetIndent",
"(",
"self",
")",
"-",
">",
"int"
] | def GetIndent(*args, **kwargs):
"""GetIndent(self) -> int"""
return _dataview.DataViewCtrl_GetIndent(*args, **kwargs) | [
"def",
"GetIndent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewCtrl_GetIndent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1740-L1742 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | bin/single_node_perf_run.py | python | run_workload | (base_dir, workloads, options) | Runs workload with the given options.
Returns the git hash of the current revision to identify the output file. | Runs workload with the given options. | [
"Runs",
"workload",
"with",
"the",
"given",
"options",
"."
] | def run_workload(base_dir, workloads, options):
"""Runs workload with the given options.
Returns the git hash of the current revision to identify the output file.
"""
git_hash = get_git_hash_for_name("HEAD")
run_workload = ["{0}/bin/run-workload.py".format(IMPALA_HOME)]
impalads = ",".join(["localhost:{0... | [
"def",
"run_workload",
"(",
"base_dir",
",",
"workloads",
",",
"options",
")",
":",
"git_hash",
"=",
"get_git_hash_for_name",
"(",
"\"HEAD\"",
")",
"run_workload",
"=",
"[",
"\"{0}/bin/run-workload.py\"",
".",
"format",
"(",
"IMPALA_HOME",
")",
"]",
"impalads",
... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/bin/single_node_perf_run.py#L132-L154 | ||
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/config/ccsession.py | python | ModuleCCSession.send_stopping | (self) | Sends a 'stopping' message to the configuration manager. This
message is just an FYI, and no response is expected. Any errors
when sending this message (for instance if the msgq session has
previously been closed) are logged, but ignored. | Sends a 'stopping' message to the configuration manager. This
message is just an FYI, and no response is expected. Any errors
when sending this message (for instance if the msgq session has
previously been closed) are logged, but ignored. | [
"Sends",
"a",
"stopping",
"message",
"to",
"the",
"configuration",
"manager",
".",
"This",
"message",
"is",
"just",
"an",
"FYI",
"and",
"no",
"response",
"is",
"expected",
".",
"Any",
"errors",
"when",
"sending",
"this",
"message",
"(",
"for",
"instance",
... | def send_stopping(self):
"""Sends a 'stopping' message to the configuration manager. This
message is just an FYI, and no response is expected. Any errors
when sending this message (for instance if the msgq session has
previously been closed) are logged, but ignored."""
#... | [
"def",
"send_stopping",
"(",
"self",
")",
":",
"# create_command could raise an exception as well, but except for",
"# out of memory related errors, these should all be programming",
"# failures and are not caught",
"msg",
"=",
"create_command",
"(",
"COMMAND_MODULE_STOPPING",
",",
"se... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/config/ccsession.py#L246-L262 | ||
unicode-org/icu | 2f8749a026f3ddc8cf54d4622480b7c543bb7fc0 | icu4c/source/python/icutools/databuilder/filtration.py | python | apply_filters | (requests, config, io) | return requests | Runs the filters and returns a new list of requests. | Runs the filters and returns a new list of requests. | [
"Runs",
"the",
"filters",
"and",
"returns",
"a",
"new",
"list",
"of",
"requests",
"."
] | def apply_filters(requests, config, io):
"""Runs the filters and returns a new list of requests."""
requests = _apply_file_filters(requests, config, io)
requests = _apply_resource_filters(requests, config, io)
return requests | [
"def",
"apply_filters",
"(",
"requests",
",",
"config",
",",
"io",
")",
":",
"requests",
"=",
"_apply_file_filters",
"(",
"requests",
",",
"config",
",",
"io",
")",
"requests",
"=",
"_apply_resource_filters",
"(",
"requests",
",",
"config",
",",
"io",
")",
... | https://github.com/unicode-org/icu/blob/2f8749a026f3ddc8cf54d4622480b7c543bb7fc0/icu4c/source/python/icutools/databuilder/filtration.py#L244-L248 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/saved_model/load_v1_in_v2.py | python | load | (export_dir, tags) | return result | Load a v1-style SavedModel as an object. | Load a v1-style SavedModel as an object. | [
"Load",
"a",
"v1",
"-",
"style",
"SavedModel",
"as",
"an",
"object",
"."
] | def load(export_dir, tags):
"""Load a v1-style SavedModel as an object."""
metrics.IncrementReadApi(_LOAD_V1_V2_LABEL)
loader = _EagerSavedModelLoader(export_dir)
result = loader.load(tags=tags)
metrics.IncrementRead(write_version="1")
return result | [
"def",
"load",
"(",
"export_dir",
",",
"tags",
")",
":",
"metrics",
".",
"IncrementReadApi",
"(",
"_LOAD_V1_V2_LABEL",
")",
"loader",
"=",
"_EagerSavedModelLoader",
"(",
"export_dir",
")",
"result",
"=",
"loader",
".",
"load",
"(",
"tags",
"=",
"tags",
")",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/load_v1_in_v2.py#L278-L284 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/_shard/sharded_tensor/api.py | python | ShardedTensor.is_pinned | (self) | return self._metadata.tensor_properties.pin_memory | Returns True if the sharded tensor (each local shard) resides in pinned memory. | Returns True if the sharded tensor (each local shard) resides in pinned memory. | [
"Returns",
"True",
"if",
"the",
"sharded",
"tensor",
"(",
"each",
"local",
"shard",
")",
"resides",
"in",
"pinned",
"memory",
"."
] | def is_pinned(self) -> bool:
"""
Returns True if the sharded tensor (each local shard) resides in pinned memory.
"""
return self._metadata.tensor_properties.pin_memory | [
"def",
"is_pinned",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"_metadata",
".",
"tensor_properties",
".",
"pin_memory"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/_shard/sharded_tensor/api.py#L703-L707 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/framework/python/ops/sampling_ops.py | python | stratified_sample | (tensors, labels, target_probs, batch_size,
init_probs=None, enqueue_many=False, queue_capacity=16,
threads_per_queue=1, name=None) | Stochastically creates batches based on per-class probabilities.
This method discards examples. Internally, it creates one queue to amortize
the cost of disk reads, and one queue to hold the properly-proportioned
batch. See `stratified_sample_unknown_dist` for a function that performs
stratified sampling with ... | Stochastically creates batches based on per-class probabilities. | [
"Stochastically",
"creates",
"batches",
"based",
"on",
"per",
"-",
"class",
"probabilities",
"."
] | def stratified_sample(tensors, labels, target_probs, batch_size,
init_probs=None, enqueue_many=False, queue_capacity=16,
threads_per_queue=1, name=None):
"""Stochastically creates batches based on per-class probabilities.
This method discards examples. Internally, it cre... | [
"def",
"stratified_sample",
"(",
"tensors",
",",
"labels",
",",
"target_probs",
",",
"batch_size",
",",
"init_probs",
"=",
"None",
",",
"enqueue_many",
"=",
"False",
",",
"queue_capacity",
"=",
"16",
",",
"threads_per_queue",
"=",
"1",
",",
"name",
"=",
"Non... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/framework/python/ops/sampling_ops.py#L38-L149 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/managers.py | python | Server.get_methods | (self, c, token) | return tuple(self.id_to_obj[token.id][1]) | Return the methods of the shared object indicated by token | Return the methods of the shared object indicated by token | [
"Return",
"the",
"methods",
"of",
"the",
"shared",
"object",
"indicated",
"by",
"token"
] | def get_methods(self, c, token):
'''
Return the methods of the shared object indicated by token
'''
return tuple(self.id_to_obj[token.id][1]) | [
"def",
"get_methods",
"(",
"self",
",",
"c",
",",
"token",
")",
":",
"return",
"tuple",
"(",
"self",
".",
"id_to_obj",
"[",
"token",
".",
"id",
"]",
"[",
"1",
"]",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/managers.py#L411-L415 | |
rizinorg/cutter | 1b271a0ae8799f99c84c336a88d8c24729e4de63 | docs/apidoc.py | python | create_modules_toc_file | (key, value, destdir) | Create the module's index. | Create the module's index. | [
"Create",
"the",
"module",
"s",
"index",
"."
] | def create_modules_toc_file(key, value, destdir):
"""Create the module's index."""
text = format_heading(1, '%s' % value)
text += '.. toctree::\n'
text += ' :glob:\n\n'
text += ' %s/*\n' % key
write_file('%slist' % key, text, destdir) | [
"def",
"create_modules_toc_file",
"(",
"key",
",",
"value",
",",
"destdir",
")",
":",
"text",
"=",
"format_heading",
"(",
"1",
",",
"'%s'",
"%",
"value",
")",
"text",
"+=",
"'.. toctree::\\n'",
"text",
"+=",
"' :glob:\\n\\n'",
"text",
"+=",
"' %s/*\\n'",
... | https://github.com/rizinorg/cutter/blob/1b271a0ae8799f99c84c336a88d8c24729e4de63/docs/apidoc.py#L59-L66 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/bayesflow/python/ops/stochastic_tensor.py | python | SampleAndReshapeValue.__init__ | (self, n=1, stop_gradient=False) | Sample `n` times and reshape the outer 2 axes so rank does not change.
Args:
n: A python integer or int32 tensor. The number of samples to take.
stop_gradient: If `True`, StochasticTensors' values are wrapped in
`stop_gradient`, to avoid backpropagation through. | Sample `n` times and reshape the outer 2 axes so rank does not change. | [
"Sample",
"n",
"times",
"and",
"reshape",
"the",
"outer",
"2",
"axes",
"so",
"rank",
"does",
"not",
"change",
"."
] | def __init__(self, n=1, stop_gradient=False):
"""Sample `n` times and reshape the outer 2 axes so rank does not change.
Args:
n: A python integer or int32 tensor. The number of samples to take.
stop_gradient: If `True`, StochasticTensors' values are wrapped in
`stop_gradient`, to avoid bac... | [
"def",
"__init__",
"(",
"self",
",",
"n",
"=",
"1",
",",
"stop_gradient",
"=",
"False",
")",
":",
"self",
".",
"_n",
"=",
"n",
"self",
".",
"_stop_gradient",
"=",
"stop_gradient"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/bayesflow/python/ops/stochastic_tensor.py#L231-L240 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/api_key.py | python | APIKey.name | (self) | return self._name | Gets the name of this APIKey. # noqa: E501
:return: The name of this APIKey. # noqa: E501
:rtype: str | Gets the name of this APIKey. # noqa: E501 | [
"Gets",
"the",
"name",
"of",
"this",
"APIKey",
".",
"#",
"noqa",
":",
"E501"
] | def name(self):
"""Gets the name of this APIKey. # noqa: E501
:return: The name of this APIKey. # noqa: E501
:rtype: str
"""
return self._name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_name"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/api_key.py#L136-L143 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py | python | ParserElement.transformString | ( self, instring ) | Extension to C{L{scanString}}, to modify matching text with modified tokens that may
be returned from a parse action. To use C{transformString}, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking C{transformString()} on a target string will then sca... | Extension to C{L{scanString}}, to modify matching text with modified tokens that may
be returned from a parse action. To use C{transformString}, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking C{transformString()} on a target string will then sca... | [
"Extension",
"to",
"C",
"{",
"L",
"{",
"scanString",
"}}",
"to",
"modify",
"matching",
"text",
"with",
"modified",
"tokens",
"that",
"may",
"be",
"returned",
"from",
"a",
"parse",
"action",
".",
"To",
"use",
"C",
"{",
"transformString",
"}",
"define",
"a... | def transformString( self, instring ):
"""
Extension to C{L{scanString}}, to modify matching text with modified tokens that may
be returned from a parse action. To use C{transformString}, define a grammar and
attach a parse action to it that modifies the returned token list.
Inv... | [
"def",
"transformString",
"(",
"self",
",",
"instring",
")",
":",
"out",
"=",
"[",
"]",
"lastE",
"=",
"0",
"# force preservation of <TAB>s, to minimize unwanted transformation of string, and to",
"# keep string locs straight between transformString and scanString",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py#L1729-L1770 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/telnetlib.py | python | Telnet.read_sb_data | (self) | return buf | Return any data available in the SB ... SE queue.
Return '' if no SB ... SE available. Should only be called
after seeing a SB or SE command. When a new SB command is
found, old unread SB data will be discarded. Don't block. | Return any data available in the SB ... SE queue. | [
"Return",
"any",
"data",
"available",
"in",
"the",
"SB",
"...",
"SE",
"queue",
"."
] | def read_sb_data(self):
"""Return any data available in the SB ... SE queue.
Return '' if no SB ... SE available. Should only be called
after seeing a SB or SE command. When a new SB command is
found, old unread SB data will be discarded. Don't block.
"""
buf = self.sbd... | [
"def",
"read_sb_data",
"(",
"self",
")",
":",
"buf",
"=",
"self",
".",
"sbdataq",
"self",
".",
"sbdataq",
"=",
"''",
"return",
"buf"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/telnetlib.py#L455-L465 | |
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/tools/common.py | python | check_tool_aux | (command) | Checks if 'command' can be found either in path
or is a full name to an existing file. | Checks if 'command' can be found either in path
or is a full name to an existing file. | [
"Checks",
"if",
"command",
"can",
"be",
"found",
"either",
"in",
"path",
"or",
"is",
"a",
"full",
"name",
"to",
"an",
"existing",
"file",
"."
] | def check_tool_aux(command):
""" Checks if 'command' can be found either in path
or is a full name to an existing file.
"""
assert isinstance(command, basestring)
dirname = os.path.dirname(command)
if dirname:
if os.path.exists(command):
return command
# Both NT a... | [
"def",
"check_tool_aux",
"(",
"command",
")",
":",
"assert",
"isinstance",
"(",
"command",
",",
"basestring",
")",
"dirname",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"command",
")",
"if",
"dirname",
":",
"if",
"os",
".",
"path",
".",
"exists",
"("... | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/tools/common.py#L404-L422 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/client/timeline.py | python | _ChromeTraceFormatter.emit_tid | (self, name, pid, tid) | Adds a thread metadata event to the trace.
Args:
name: The thread name as a string.
pid: Identifier of the process as an integer.
tid: Identifier of the thread as an integer. | Adds a thread metadata event to the trace. | [
"Adds",
"a",
"thread",
"metadata",
"event",
"to",
"the",
"trace",
"."
] | def emit_tid(self, name, pid, tid):
"""Adds a thread metadata event to the trace.
Args:
name: The thread name as a string.
pid: Identifier of the process as an integer.
tid: Identifier of the thread as an integer.
"""
event = {}
event['name'] = 'thread_name'
event['ph'] = '... | [
"def",
"emit_tid",
"(",
"self",
",",
"name",
",",
"pid",
",",
"tid",
")",
":",
"event",
"=",
"{",
"}",
"event",
"[",
"'name'",
"]",
"=",
"'thread_name'",
"event",
"[",
"'ph'",
"]",
"=",
"'M'",
"event",
"[",
"'pid'",
"]",
"=",
"pid",
"event",
"[",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/client/timeline.py#L105-L119 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/config.py | python | ConfigContext.load_json | (self, path, default=None) | return util.load_json(path, obj) | Reads JSON format data from a file on disk and returns it as dictionary. | Reads JSON format data from a file on disk and returns it as dictionary. | [
"Reads",
"JSON",
"format",
"data",
"from",
"a",
"file",
"on",
"disk",
"and",
"returns",
"it",
"as",
"dictionary",
"."
] | def load_json(self, path, default=None):
"""Reads JSON format data from a file on disk and returns it as dictionary."""
self.context.view.loading_file(path)
obj = default
if not obj:
obj = {}
return util.load_json(path, obj) | [
"def",
"load_json",
"(",
"self",
",",
"path",
",",
"default",
"=",
"None",
")",
":",
"self",
".",
"context",
".",
"view",
".",
"loading_file",
"(",
"path",
")",
"obj",
"=",
"default",
"if",
"not",
"obj",
":",
"obj",
"=",
"{",
"}",
"return",
"util",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/config.py#L159-L165 | |
fenderglass/Flye | 2013acc650356cc934a2a9b82eb90af260c8b52b | flye/repeat_graph/graph_alignment.py | python | iter_alignments | (filename) | Returns alignment generator | Returns alignment generator | [
"Returns",
"alignment",
"generator"
] | def iter_alignments(filename):
"""
Returns alignment generator
"""
#alignments = []
current_chain = []
with open(filename, "r") as f:
for line in f:
if not line: continue
tokens = line.strip().split()
if tokens[0] == "Chain":
if curren... | [
"def",
"iter_alignments",
"(",
"filename",
")",
":",
"#alignments = []",
"current_chain",
"=",
"[",
"]",
"with",
"open",
"(",
"filename",
",",
"\"r\"",
")",
"as",
"f",
":",
"for",
"line",
"in",
"f",
":",
"if",
"not",
"line",
":",
"continue",
"tokens",
... | https://github.com/fenderglass/Flye/blob/2013acc650356cc934a2a9b82eb90af260c8b52b/flye/repeat_graph/graph_alignment.py#L42-L74 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | python | maybe_download | (filename, expected_bytes) | return filename | Download a file if not present, and make sure it's the right size. | Download a file if not present, and make sure it's the right size. | [
"Download",
"a",
"file",
"if",
"not",
"present",
"and",
"make",
"sure",
"it",
"s",
"the",
"right",
"size",
"."
] | def maybe_download(filename, expected_bytes):
"""Download a file if not present, and make sure it's the right size."""
if not os.path.exists(filename):
filename, _ = urllib.request.urlretrieve(url + filename, filename)
statinfo = os.stat(filename)
if statinfo.st_size == expected_bytes:
print('Found and ... | [
"def",
"maybe_download",
"(",
"filename",
",",
"expected_bytes",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"filename",
",",
"_",
"=",
"urllib",
".",
"request",
".",
"urlretrieve",
"(",
"url",
"+",
"filename",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/examples/tutorials/word2vec/word2vec_basic.py#L36-L47 | |
libretro/beetle-psx-libretro | 05f55acf4ea315bcc16a1cbe0b624696ec6fee35 | intl/core_option_translation.py | python | create_non_dupe | (base_name: str, opt_num: int, comparison) | return h | Makes sure base_name is not in comparison, and if it is it's renamed.
:param base_name: Name to check/make unique.
:param opt_num: Number of the option base_name belongs to, used in making it unique.
:param comparison: Dictionary or set to search for base_name in.
:return: Unique name. | Makes sure base_name is not in comparison, and if it is it's renamed. | [
"Makes",
"sure",
"base_name",
"is",
"not",
"in",
"comparison",
"and",
"if",
"it",
"is",
"it",
"s",
"renamed",
"."
] | def create_non_dupe(base_name: str, opt_num: int, comparison) -> str:
"""Makes sure base_name is not in comparison, and if it is it's renamed.
:param base_name: Name to check/make unique.
:param opt_num: Number of the option base_name belongs to, used in making it unique.
:param comparison: Dictionary or s... | [
"def",
"create_non_dupe",
"(",
"base_name",
":",
"str",
",",
"opt_num",
":",
"int",
",",
"comparison",
")",
"->",
"str",
":",
"h",
"=",
"base_name",
"if",
"h",
"in",
"comparison",
":",
"n",
"=",
"0",
"h",
"=",
"h",
"+",
"'_O'",
"+",
"str",
"(",
"... | https://github.com/libretro/beetle-psx-libretro/blob/05f55acf4ea315bcc16a1cbe0b624696ec6fee35/intl/core_option_translation.py#L146-L162 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/engine/training.py | python | _standardize_input_data | (data,
names,
shapes=None,
check_batch_axis=True,
exception_prefix='') | return arrays | Normalizes inputs and targets provided by users.
Users may pass data as a list of arrays, dictionary of arrays,
or as a single array. We normalize this to an ordered list of
arrays (same order as `names`), while checking that the provided
arrays have shapes that match the network's expectations.
Arguments:
... | Normalizes inputs and targets provided by users. | [
"Normalizes",
"inputs",
"and",
"targets",
"provided",
"by",
"users",
"."
] | def _standardize_input_data(data,
names,
shapes=None,
check_batch_axis=True,
exception_prefix=''):
"""Normalizes inputs and targets provided by users.
Users may pass data as a list of arrays, dictionary ... | [
"def",
"_standardize_input_data",
"(",
"data",
",",
"names",
",",
"shapes",
"=",
"None",
",",
"check_batch_axis",
"=",
"True",
",",
"exception_prefix",
"=",
"''",
")",
":",
"if",
"not",
"names",
":",
"return",
"[",
"]",
"if",
"data",
"is",
"None",
":",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/engine/training.py#L40-L144 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/json_format.py | python | _Printer._MessageToJsonObject | (self, message) | return self._RegularMessageToJsonObject(message, js) | Converts message to an object according to Proto3 JSON Specification. | Converts message to an object according to Proto3 JSON Specification. | [
"Converts",
"message",
"to",
"an",
"object",
"according",
"to",
"Proto3",
"JSON",
"Specification",
"."
] | def _MessageToJsonObject(self, message):
"""Converts message to an object according to Proto3 JSON Specification."""
message_descriptor = message.DESCRIPTOR
full_name = message_descriptor.full_name
if _IsWrapperMessage(message_descriptor):
return self._WrapperMessageToJsonObject(message)
if fu... | [
"def",
"_MessageToJsonObject",
"(",
"self",
",",
"message",
")",
":",
"message_descriptor",
"=",
"message",
".",
"DESCRIPTOR",
"full_name",
"=",
"message_descriptor",
".",
"full_name",
"if",
"_IsWrapperMessage",
"(",
"message_descriptor",
")",
":",
"return",
"self",... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/json_format.py#L123-L132 | |
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | python/ola/ClientWrapper.py | python | SelectServer._CheckTimeouts | (self, now) | Execute any expired timeouts. | Execute any expired timeouts. | [
"Execute",
"any",
"expired",
"timeouts",
"."
] | def _CheckTimeouts(self, now):
"""Execute any expired timeouts."""
while len(self._events):
event = self._events[0]
if event.HasExpired(now):
event.Run()
else:
break
heapq.heappop(self._events) | [
"def",
"_CheckTimeouts",
"(",
"self",
",",
"now",
")",
":",
"while",
"len",
"(",
"self",
".",
"_events",
")",
":",
"event",
"=",
"self",
".",
"_events",
"[",
"0",
"]",
"if",
"event",
".",
"HasExpired",
"(",
"now",
")",
":",
"event",
".",
"Run",
"... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/python/ola/ClientWrapper.py#L251-L259 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/decomposition/_pca.py | python | _assess_dimension_ | (spectrum, rank, n_samples, n_features) | return ll | Compute the likelihood of a rank ``rank`` dataset.
The dataset is assumed to be embedded in gaussian noise of shape(n,
dimf) having spectrum ``spectrum``.
Parameters
----------
spectrum : array of shape (n)
Data spectrum.
rank : int
Tested rank value.
n_samples : int
... | Compute the likelihood of a rank ``rank`` dataset. | [
"Compute",
"the",
"likelihood",
"of",
"a",
"rank",
"rank",
"dataset",
"."
] | def _assess_dimension_(spectrum, rank, n_samples, n_features):
"""Compute the likelihood of a rank ``rank`` dataset.
The dataset is assumed to be embedded in gaussian noise of shape(n,
dimf) having spectrum ``spectrum``.
Parameters
----------
spectrum : array of shape (n)
Data spectrum... | [
"def",
"_assess_dimension_",
"(",
"spectrum",
",",
"rank",
",",
"n_samples",
",",
"n_features",
")",
":",
"if",
"rank",
">",
"len",
"(",
"spectrum",
")",
":",
"raise",
"ValueError",
"(",
"\"The tested rank cannot exceed the rank of the\"",
"\" dataset\"",
")",
"pu... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/decomposition/_pca.py#L30-L89 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/p4util/procutil.py | python | plump_qcvar | (val: Union[float, str, List], shape_clue: str, ret: str = 'np') | Prepare serialized QCVariable for set_variable by convert flat arrays into shaped ones and floating strings.
Parameters
----------
val :
flat (?, ) list or scalar or string, probably from JSON storage.
shape_clue
Label that includes (case insensitive) one of the following as
a c... | Prepare serialized QCVariable for set_variable by convert flat arrays into shaped ones and floating strings. | [
"Prepare",
"serialized",
"QCVariable",
"for",
"set_variable",
"by",
"convert",
"flat",
"arrays",
"into",
"shaped",
"ones",
"and",
"floating",
"strings",
"."
] | def plump_qcvar(val: Union[float, str, List], shape_clue: str, ret: str = 'np') -> Union[float, np.ndarray, core.Matrix]:
"""Prepare serialized QCVariable for set_variable by convert flat arrays into shaped ones and floating strings.
Parameters
----------
val :
flat (?, ) list or scalar or stri... | [
"def",
"plump_qcvar",
"(",
"val",
":",
"Union",
"[",
"float",
",",
"str",
",",
"List",
"]",
",",
"shape_clue",
":",
"str",
",",
"ret",
":",
"str",
"=",
"'np'",
")",
"->",
"Union",
"[",
"float",
",",
"np",
".",
"ndarray",
",",
"core",
".",
"Matrix... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/p4util/procutil.py#L592-L634 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | EntryPoint.resolve | (self) | Resolve the entry point from its module and attrs. | [] | def resolve(self):
"""
Resolve the entry point from its module and attrs.
"""
module = __import__(self.module_name, fromlist=['__name__'], level=0)
try:
return functools.reduce(getattr, self.attrs, module)
except AttributeError as exc:
rais... | [
"def",
"resolve",
"(",
"self",
")",
":",
"module",
"=",
"__import__",
"(",
"self",
".",
"module_name",
",",
"fromlist",
"=",
"[",
"'__name__'",
"]",
",",
"level",
"=",
"0",
")",
"try",
":",
"return",
"functools",
".",
"reduce",
"(",
"getattr",
",",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L4889-L4905 | |||
scribusproject/scribus | 41ec7c775a060912cf251682a8b1437f753f80f4 | scribus/plugins/scriptplugin_py2x/scripts/FontSample.py | python | Application.__testUpDownState | (self) | Only enable the up and down buttons when just a single item is selected.
Enable should be applied to up, down or both depending on its
position in the listbox. At all other times disable both. | Only enable the up and down buttons when just a single item is selected. | [
"Only",
"enable",
"the",
"up",
"and",
"down",
"buttons",
"when",
"just",
"a",
"single",
"item",
"is",
"selected",
"."
] | def __testUpDownState(self):
"""Only enable the up and down buttons when just a single item is selected.
Enable should be applied to up, down or both depending on its
position in the listbox. At all other times disable both.
"""
# Get a count of how many items are currently sele... | [
"def",
"__testUpDownState",
"(",
"self",
")",
":",
"# Get a count of how many items are currently selected...",
"selection",
"=",
"list",
"(",
"self",
".",
"listbox2",
".",
"curselection",
"(",
")",
")",
"tcount",
"=",
"0",
"for",
"sel",
"in",
"selection",
":",
... | https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scriptplugin_py2x/scripts/FontSample.py#L1379-L1407 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _DropCommonSuffixes | (filename) | return os.path.splitext(filename)[0] | Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/foo_unusualinternal.h')... | Drops common suffixes like _test.cc or -inl.h from filename. | [
"Drops",
"common",
"suffixes",
"like",
"_test",
".",
"cc",
"or",
"-",
"inl",
".",
"h",
"from",
"filename",
"."
] | def _DropCommonSuffixes(filename):
"""Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCom... | [
"def",
"_DropCommonSuffixes",
"(",
"filename",
")",
":",
"for",
"suffix",
"in",
"(",
"'test.cc'",
",",
"'regtest.cc'",
",",
"'unittest.cc'",
",",
"'inl.h'",
",",
"'impl.h'",
",",
"'internal.h'",
")",
":",
"if",
"(",
"filename",
".",
"endswith",
"(",
"suffix"... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L2913-L2937 | |
kevin-ssy/Optical-Flow-Guided-Feature | 07d4501a29002ee7821c38c1820e4a64c1acf6e8 | lib/caffe-action/scripts/cpp_lint.py | python | CheckForNonStandardConstructs | (filename, clean_lines, linenum,
nesting_state, error) | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
transition to new compilers.
- put storage class first (e.g. "static const" instead of "const stat... | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. | [
"r",
"Logs",
"an",
"error",
"if",
"we",
"see",
"certain",
"non",
"-",
"ANSI",
"constructs",
"ignored",
"by",
"gcc",
"-",
"2",
"."
] | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint ... | [
"def",
"CheckForNonStandardConstructs",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Remove comments from the line, but leave in strings for now.",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"i... | https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/scripts/cpp_lint.py#L2194-L2298 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | python | CalculateGeneratorInputInfo | (params) | Calculate the generator specific info that gets fed to input (called by
gyp). | Calculate the generator specific info that gets fed to input (called by
gyp). | [
"Calculate",
"the",
"generator",
"specific",
"info",
"that",
"gets",
"fed",
"to",
"input",
"(",
"called",
"by",
"gyp",
")",
"."
] | def CalculateGeneratorInputInfo(params):
"""Calculate the generator specific info that gets fed to input (called by
gyp)."""
generator_flags = params.get("generator_flags", {})
if generator_flags.get("adjust_static_libraries", False):
global generator_wants_static_library_dependencies_adjusted
... | [
"def",
"CalculateGeneratorInputInfo",
"(",
"params",
")",
":",
"generator_flags",
"=",
"params",
".",
"get",
"(",
"\"generator_flags\"",
",",
"{",
"}",
")",
"if",
"generator_flags",
".",
"get",
"(",
"\"adjust_static_libraries\"",
",",
"False",
")",
":",
"global"... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py#L69-L75 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/display.py | python | display_svg | (*objs, **kwargs) | Display the SVG representation of an object.
Parameters
----------
objs : tuple of objects
The Python objects to display, or if raw=True raw svg data to
display.
raw : bool
Are the data objects raw data or Python objects that need to be
formatted before display? [default... | Display the SVG representation of an object. | [
"Display",
"the",
"SVG",
"representation",
"of",
"an",
"object",
"."
] | def display_svg(*objs, **kwargs):
"""Display the SVG representation of an object.
Parameters
----------
objs : tuple of objects
The Python objects to display, or if raw=True raw svg data to
display.
raw : bool
Are the data objects raw data or Python objects that need to be
... | [
"def",
"display_svg",
"(",
"*",
"objs",
",",
"*",
"*",
"kwargs",
")",
":",
"_display_mimetype",
"(",
"'image/svg+xml'",
",",
"objs",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/display.py#L453-L467 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_distutils/versionpredicate.py | python | VersionPredicate.satisfied_by | (self, version) | return True | True if version is compatible with all the predicates in self.
The parameter version must be acceptable to the StrictVersion
constructor. It may be either a string or StrictVersion. | True if version is compatible with all the predicates in self.
The parameter version must be acceptable to the StrictVersion
constructor. It may be either a string or StrictVersion. | [
"True",
"if",
"version",
"is",
"compatible",
"with",
"all",
"the",
"predicates",
"in",
"self",
".",
"The",
"parameter",
"version",
"must",
"be",
"acceptable",
"to",
"the",
"StrictVersion",
"constructor",
".",
"It",
"may",
"be",
"either",
"a",
"string",
"or",... | def satisfied_by(self, version):
"""True if version is compatible with all the predicates in self.
The parameter version must be acceptable to the StrictVersion
constructor. It may be either a string or StrictVersion.
"""
for cond, ver in self.pred:
if not compmap[co... | [
"def",
"satisfied_by",
"(",
"self",
",",
"version",
")",
":",
"for",
"cond",
",",
"ver",
"in",
"self",
".",
"pred",
":",
"if",
"not",
"compmap",
"[",
"cond",
"]",
"(",
"version",
",",
"ver",
")",
":",
"return",
"False",
"return",
"True"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/versionpredicate.py#L132-L140 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_dummy_thread.py | python | RLock.acquire | (self, waitflag=None, timeout=-1) | return locked | Aquire the lock, can be called multiple times in succession. | Aquire the lock, can be called multiple times in succession. | [
"Aquire",
"the",
"lock",
"can",
"be",
"called",
"multiple",
"times",
"in",
"succession",
"."
] | def acquire(self, waitflag=None, timeout=-1):
"""Aquire the lock, can be called multiple times in succession.
"""
locked = super().acquire(waitflag, timeout)
if locked:
self._levels += 1
return locked | [
"def",
"acquire",
"(",
"self",
",",
"waitflag",
"=",
"None",
",",
"timeout",
"=",
"-",
"1",
")",
":",
"locked",
"=",
"super",
"(",
")",
".",
"acquire",
"(",
"waitflag",
",",
"timeout",
")",
"if",
"locked",
":",
"self",
".",
"_levels",
"+=",
"1",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_dummy_thread.py#L164-L170 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/operations/install/wheel.py | python | rehash | (path, blocksize=1 << 20) | return (digest, str(length)) | Return (encoded_digest, length) for path using hashlib.sha256() | Return (encoded_digest, length) for path using hashlib.sha256() | [
"Return",
"(",
"encoded_digest",
"length",
")",
"for",
"path",
"using",
"hashlib",
".",
"sha256",
"()"
] | def rehash(path, blocksize=1 << 20):
# type: (str, int) -> Tuple[str, str]
"""Return (encoded_digest, length) for path using hashlib.sha256()"""
h, length = hash_file(path, blocksize)
digest = 'sha256=' + urlsafe_b64encode(
h.digest()
).decode('latin1').rstrip('=')
return (digest,... | [
"def",
"rehash",
"(",
"path",
",",
"blocksize",
"=",
"1",
"<<",
"20",
")",
":",
"# type: (str, int) -> Tuple[str, str]",
"h",
",",
"length",
"=",
"hash_file",
"(",
"path",
",",
"blocksize",
")",
"digest",
"=",
"'sha256='",
"+",
"urlsafe_b64encode",
"(",
"h",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/operations/install/wheel.py#L171-L185 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/series.py | python | Series.round | (self, decimals=0, *args, **kwargs) | return result | Round each value in a Series to the given number of decimals.
Parameters
----------
decimals : int, default 0
Number of decimal places to round to. If decimals is negative,
it specifies the number of positions to the left of the decimal point.
*args, **kwargs
... | Round each value in a Series to the given number of decimals. | [
"Round",
"each",
"value",
"in",
"a",
"Series",
"to",
"the",
"given",
"number",
"of",
"decimals",
"."
] | def round(self, decimals=0, *args, **kwargs) -> Series:
"""
Round each value in a Series to the given number of decimals.
Parameters
----------
decimals : int, default 0
Number of decimal places to round to. If decimals is negative,
it specifies the numbe... | [
"def",
"round",
"(",
"self",
",",
"decimals",
"=",
"0",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"->",
"Series",
":",
"nv",
".",
"validate_round",
"(",
"args",
",",
"kwargs",
")",
"result",
"=",
"self",
".",
"_values",
".",
"round",
"(",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/series.py#L2360-L2398 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/pylib/utils/reraiser_thread.py | python | ReraiserThreadGroup.JoinAll | (self, watcher=watchdog_timer.WatchdogTimer(None)) | Join all threads.
Reraises exceptions raised by the child threads and supports breaking
immediately on exceptions raised on the main thread. Unfinished threads'
stacks will be logged on watchdog timeout.
Args:
watcher: Watchdog object providing timeout, by default waits forever. | Join all threads. | [
"Join",
"all",
"threads",
"."
] | def JoinAll(self, watcher=watchdog_timer.WatchdogTimer(None)):
"""Join all threads.
Reraises exceptions raised by the child threads and supports breaking
immediately on exceptions raised on the main thread. Unfinished threads'
stacks will be logged on watchdog timeout.
Args:
watcher: Watchdo... | [
"def",
"JoinAll",
"(",
"self",
",",
"watcher",
"=",
"watchdog_timer",
".",
"WatchdogTimer",
"(",
"None",
")",
")",
":",
"try",
":",
"self",
".",
"_JoinAll",
"(",
"watcher",
")",
"except",
"TimeoutError",
":",
"for",
"thread",
"in",
"(",
"t",
"for",
"t"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/utils/reraiser_thread.py#L119-L134 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarIter.__next__ | (self) | return tarinfo | Return the next item using TarFile's next() method.
When all members have been read, set TarFile as _loaded. | Return the next item using TarFile's next() method.
When all members have been read, set TarFile as _loaded. | [
"Return",
"the",
"next",
"item",
"using",
"TarFile",
"s",
"next",
"()",
"method",
".",
"When",
"all",
"members",
"have",
"been",
"read",
"set",
"TarFile",
"as",
"_loaded",
"."
] | def __next__(self):
"""Return the next item using TarFile's next() method.
When all members have been read, set TarFile as _loaded.
"""
# Fix for SF #1100429: Under rare circumstances it can
# happen that getmembers() is called during iteration,
# which will cause TarI... | [
"def",
"__next__",
"(",
"self",
")",
":",
"# Fix for SF #1100429: Under rare circumstances it can",
"# happen that getmembers() is called during iteration,",
"# which will cause TarIter to stop prematurely.",
"if",
"not",
"self",
".",
"tarfile",
".",
"_loaded",
":",
"tarinfo",
"=... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L2570-L2588 | |
hszhao/PSPNet | cf7e5a99ba37e46118026e96be5821a9bc63bde0 | python/caffe/detector.py | python | Detector.detect_windows | (self, images_windows) | return detections | Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net.
Parameters
----------
images_windows: (image filename, window list) iterable.
context_crop: size of context border to crop in pixels.
Returns
... | Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net. | [
"Do",
"windowed",
"detection",
"over",
"given",
"images",
"and",
"windows",
".",
"Windows",
"are",
"extracted",
"then",
"warped",
"to",
"the",
"input",
"dimensions",
"of",
"the",
"net",
"."
] | def detect_windows(self, images_windows):
"""
Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net.
Parameters
----------
images_windows: (image filename, window list) iterable.
context_crop: si... | [
"def",
"detect_windows",
"(",
"self",
",",
"images_windows",
")",
":",
"# Extract windows.",
"window_inputs",
"=",
"[",
"]",
"for",
"image_fname",
",",
"windows",
"in",
"images_windows",
":",
"image",
"=",
"caffe",
".",
"io",
".",
"load_image",
"(",
"image_fna... | https://github.com/hszhao/PSPNet/blob/cf7e5a99ba37e46118026e96be5821a9bc63bde0/python/caffe/detector.py#L56-L99 | |
logcabin/logcabin | ee6c55ae9744b82b451becd9707d26c7c1b6bbfb | site_scons/site_tools/protoc.py | python | generate | (env) | Add Builders and construction variables for protoc to an Environment. | Add Builders and construction variables for protoc to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"protoc",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for protoc to an Environment."""
try:
bld = env['BUILDERS']['Protoc']
except KeyError:
bld = ProtocBuilder
env['BUILDERS']['Protoc'] = bld
env['PROTOC'] = env.Detect(protocs) or 'protoc'
env['PROTOCFLAGS'] ... | [
"def",
"generate",
"(",
"env",
")",
":",
"try",
":",
"bld",
"=",
"env",
"[",
"'BUILDERS'",
"]",
"[",
"'Protoc'",
"]",
"except",
"KeyError",
":",
"bld",
"=",
"ProtocBuilder",
"env",
"[",
"'BUILDERS'",
"]",
"[",
"'Protoc'",
"]",
"=",
"bld",
"env",
"[",... | https://github.com/logcabin/logcabin/blob/ee6c55ae9744b82b451becd9707d26c7c1b6bbfb/site_scons/site_tools/protoc.py#L89-L103 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/util/strings.py | python | decode_until_null | (data, encoding='utf-8') | return data.decode(encoding) | decodes a bytes object, aborting at the first \\0 character.
>>> decode_until_null(b"foo\\0bar")
'foo' | decodes a bytes object, aborting at the first \\0 character. | [
"decodes",
"a",
"bytes",
"object",
"aborting",
"at",
"the",
"first",
"\\\\",
"0",
"character",
"."
] | def decode_until_null(data, encoding='utf-8'):
"""
decodes a bytes object, aborting at the first \\0 character.
>>> decode_until_null(b"foo\\0bar")
'foo'
"""
end = data.find(0)
if end != -1:
data = data[:end]
return data.decode(encoding) | [
"def",
"decode_until_null",
"(",
"data",
",",
"encoding",
"=",
"'utf-8'",
")",
":",
"end",
"=",
"data",
".",
"find",
"(",
"0",
")",
"if",
"end",
"!=",
"-",
"1",
":",
"data",
"=",
"data",
"[",
":",
"end",
"]",
"return",
"data",
".",
"decode",
"(",... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/strings.py#L8-L19 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/adapters.py | python | HTTPAdapter.get_connection | (self, url, proxies=None) | return conn | Returns a urllib3 connection for the given URL. This should not be
called from user code, and is only exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
:param url: The URL to connect to.
:param proxies: (optional) A Requests-style dictionary of p... | Returns a urllib3 connection for the given URL. This should not be
called from user code, and is only exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. | [
"Returns",
"a",
"urllib3",
"connection",
"for",
"the",
"given",
"URL",
".",
"This",
"should",
"not",
"be",
"called",
"from",
"user",
"code",
"and",
"is",
"only",
"exposed",
"for",
"use",
"when",
"subclassing",
"the",
":",
"class",
":",
"HTTPAdapter",
"<req... | def get_connection(self, url, proxies=None):
"""Returns a urllib3 connection for the given URL. This should not be
called from user code, and is only exposed for use when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
:param url: The URL to connect to.
:pa... | [
"def",
"get_connection",
"(",
"self",
",",
"url",
",",
"proxies",
"=",
"None",
")",
":",
"proxies",
"=",
"proxies",
"or",
"{",
"}",
"proxy",
"=",
"proxies",
".",
"get",
"(",
"urlparse",
"(",
"url",
".",
"lower",
"(",
")",
")",
".",
"scheme",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/adapters.py#L232-L253 | |
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | reduce_all | (x, axis=[], keepdims=False) | return _F.reduce_all(x, axis, keepdims) | reduce_all(x, axis=[], keepdims=False)
Return the all of nonzero of all/axis.
Parameters
----------
x : var_like, input value, dtype just support int32.
axis : axis_like, input value, just support int32. Default is [], reduce all.
keepdims: bool, input value. Default is False.
Returns
... | reduce_all(x, axis=[], keepdims=False)
Return the all of nonzero of all/axis. | [
"reduce_all",
"(",
"x",
"axis",
"=",
"[]",
"keepdims",
"=",
"False",
")",
"Return",
"the",
"all",
"of",
"nonzero",
"of",
"all",
"/",
"axis",
"."
] | def reduce_all(x, axis=[], keepdims=False):
'''
reduce_all(x, axis=[], keepdims=False)
Return the all of nonzero of all/axis.
Parameters
----------
x : var_like, input value, dtype just support int32.
axis : axis_like, input value, just support int32. Default is [], reduce all.
keepdims... | [
"def",
"reduce_all",
"(",
"x",
",",
"axis",
"=",
"[",
"]",
",",
"keepdims",
"=",
"False",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"if",
"x",
".",
"dtype",
"!=",
"_F",
".",
"int",
":",
"raise",
"ValueError",
"(",
"'MNN.expr.reduce_all just suppo... | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L1410-L1436 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | _is_egg_path | (path) | return path.lower().endswith('.egg') | Determine if given path appears to be an egg. | Determine if given path appears to be an egg. | [
"Determine",
"if",
"given",
"path",
"appears",
"to",
"be",
"an",
"egg",
"."
] | def _is_egg_path(path):
"""
Determine if given path appears to be an egg.
"""
return path.lower().endswith('.egg') | [
"def",
"_is_egg_path",
"(",
"path",
")",
":",
"return",
"path",
".",
"lower",
"(",
")",
".",
"endswith",
"(",
"'.egg'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L2360-L2364 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/function.py | python | _DefinedFunction.stateful_ops | (self) | return self._stateful_ops | Returns the list of stateful ops in function definition.
Returns:
A list of (op.name, op.type) pairs. | Returns the list of stateful ops in function definition. | [
"Returns",
"the",
"list",
"of",
"stateful",
"ops",
"in",
"function",
"definition",
"."
] | def stateful_ops(self):
"""Returns the list of stateful ops in function definition.
Returns:
A list of (op.name, op.type) pairs.
"""
self._create_definition_if_needed()
return self._stateful_ops | [
"def",
"stateful_ops",
"(",
"self",
")",
":",
"self",
".",
"_create_definition_if_needed",
"(",
")",
"return",
"self",
".",
"_stateful_ops"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/function.py#L364-L371 | |
weichengkuo/DeepBox | c4f8c065b6a51cf296540cc453a44f0519aaacc9 | caffe-fast-rcnn/scripts/cpp_lint.py | python | _VerboseLevel | () | return _cpplint_state.verbose_level | Returns the module's verbosity setting. | Returns the module's verbosity setting. | [
"Returns",
"the",
"module",
"s",
"verbosity",
"setting",
"."
] | def _VerboseLevel():
"""Returns the module's verbosity setting."""
return _cpplint_state.verbose_level | [
"def",
"_VerboseLevel",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"verbose_level"
] | https://github.com/weichengkuo/DeepBox/blob/c4f8c065b6a51cf296540cc453a44f0519aaacc9/caffe-fast-rcnn/scripts/cpp_lint.py#L777-L779 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ToggleButton_GetClassDefaultAttributes | (*args, **kwargs) | return _controls_.ToggleButton_GetClassDefaultAttributes(*args, **kwargs) | ToggleButton_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colou... | ToggleButton_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"ToggleButton_GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def ToggleButton_GetClassDefaultAttributes(*args, **kwargs):
"""
ToggleButton_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
con... | [
"def",
"ToggleButton_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ToggleButton_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L3050-L3065 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/symbol/random.py | python | gamma | (alpha=1, beta=1, shape=_Null, dtype=_Null, **kwargs) | return _random_helper(_internal._random_gamma, _internal._sample_gamma,
[alpha, beta], shape, dtype, kwargs) | Draw random samples from a gamma distribution.
Samples are distributed according to a gamma distribution parametrized
by *alpha* (shape) and *beta* (scale).
Parameters
----------
alpha : float or Symbol
The shape of the gamma distribution. Should be greater than zero.
beta : float or S... | Draw random samples from a gamma distribution. | [
"Draw",
"random",
"samples",
"from",
"a",
"gamma",
"distribution",
"."
] | def gamma(alpha=1, beta=1, shape=_Null, dtype=_Null, **kwargs):
"""Draw random samples from a gamma distribution.
Samples are distributed according to a gamma distribution parametrized
by *alpha* (shape) and *beta* (scale).
Parameters
----------
alpha : float or Symbol
The shape of the... | [
"def",
"gamma",
"(",
"alpha",
"=",
"1",
",",
"beta",
"=",
"1",
",",
"shape",
"=",
"_Null",
",",
"dtype",
"=",
"_Null",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_random_helper",
"(",
"_internal",
".",
"_random_gamma",
",",
"_internal",
".",
"_sam... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/random.py#L147-L169 | |
PJunhyuk/people-counting-pose | 8cdaab5281847c296b305643842053d496e2e4e8 | lib/coco/PythonAPI/pycocotools/coco.py | python | COCO.getCatIds | (self, catNms=[], supNms=[], catIds=[]) | return ids | filtering parameters. default skips that filter.
:param catNms (str array) : get cats for given cat names
:param supNms (str array) : get cats for given supercategory names
:param catIds (int array) : get cats for given cat ids
:return: ids (int array) : integer array of cat ids | filtering parameters. default skips that filter.
:param catNms (str array) : get cats for given cat names
:param supNms (str array) : get cats for given supercategory names
:param catIds (int array) : get cats for given cat ids
:return: ids (int array) : integer array of cat ids | [
"filtering",
"parameters",
".",
"default",
"skips",
"that",
"filter",
".",
":",
"param",
"catNms",
"(",
"str",
"array",
")",
":",
"get",
"cats",
"for",
"given",
"cat",
"names",
":",
"param",
"supNms",
"(",
"str",
"array",
")",
":",
"get",
"cats",
"for"... | def getCatIds(self, catNms=[], supNms=[], catIds=[]):
"""
filtering parameters. default skips that filter.
:param catNms (str array) : get cats for given cat names
:param supNms (str array) : get cats for given supercategory names
:param catIds (int array) : get cats for given... | [
"def",
"getCatIds",
"(",
"self",
",",
"catNms",
"=",
"[",
"]",
",",
"supNms",
"=",
"[",
"]",
",",
"catIds",
"=",
"[",
"]",
")",
":",
"catNms",
"=",
"catNms",
"if",
"type",
"(",
"catNms",
")",
"==",
"list",
"else",
"[",
"catNms",
"]",
"supNms",
... | https://github.com/PJunhyuk/people-counting-pose/blob/8cdaab5281847c296b305643842053d496e2e4e8/lib/coco/PythonAPI/pycocotools/coco.py#L152-L172 | |
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/site_packages/jsontemplate/jsontemplate.py | python | _AbstractSection.Append | (self, statement) | Append a statement to this block. | Append a statement to this block. | [
"Append",
"a",
"statement",
"to",
"this",
"block",
"."
] | def Append(self, statement):
"""Append a statement to this block."""
self.current_clause.append(statement) | [
"def",
"Append",
"(",
"self",
",",
"statement",
")",
":",
"self",
".",
"current_clause",
".",
"append",
"(",
"statement",
")"
] | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/jsontemplate/jsontemplate.py#L362-L364 | ||
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | scripts/common.py | python | delayedInterrupts | () | Block SIGINT and SIGTERM temporarily. | Block SIGINT and SIGTERM temporarily. | [
"Block",
"SIGINT",
"and",
"SIGTERM",
"temporarily",
"."
] | def delayedInterrupts():
"""Block SIGINT and SIGTERM temporarily."""
quit = []
def delay(sig, frame):
if quit:
print ('Ctrl-C: Quitting during delayed interrupts section ' +
'because user insisted')
raise KeyboardInterrupt
else:
quit.app... | [
"def",
"delayedInterrupts",
"(",
")",
":",
"quit",
"=",
"[",
"]",
"def",
"delay",
"(",
"sig",
",",
"frame",
")",
":",
"if",
"quit",
":",
"print",
"(",
"'Ctrl-C: Quitting during delayed interrupts section '",
"+",
"'because user insisted'",
")",
"raise",
"Keyboar... | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/scripts/common.py#L236-L256 | ||
FEniCS/dolfinx | 3dfdf038cccdb70962865b58a63bf29c2e55ec6e | python/dolfinx/fem/forms.py | python | FormMetaClass.ufcx_form | (self) | return self._ufcx_form | The compiled ufcx_form object | The compiled ufcx_form object | [
"The",
"compiled",
"ufcx_form",
"object"
] | def ufcx_form(self):
"""The compiled ufcx_form object"""
return self._ufcx_form | [
"def",
"ufcx_form",
"(",
"self",
")",
":",
"return",
"self",
".",
"_ufcx_form"
] | https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/fem/forms.py#L53-L55 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/Direct/DirectEnergyConversion.py | python | DirectEnergyConversion.spectra_masks | (self,value) | return | set up spectra masks | set up spectra masks | [
"set",
"up",
"spectra",
"masks"
] | def spectra_masks(self,value):
""" set up spectra masks """
if value is None:
if hasattr(self,'_spectra_masks') and self._spectra_masks is not None:
if self._spectra_masks in mtd:
DeleteWorkspace(self._spectra_masks)
self._spectra_masks=None
... | [
"def",
"spectra_masks",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"if",
"hasattr",
"(",
"self",
",",
"'_spectra_masks'",
")",
"and",
"self",
".",
"_spectra_masks",
"is",
"not",
"None",
":",
"if",
"self",
".",
"_spectra_masks"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/DirectEnergyConversion.py#L1361-L1378 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | SignResponse.initFromTpm | (self, buf) | TpmMarshaller method | TpmMarshaller method | [
"TpmMarshaller",
"method"
] | def initFromTpm(self, buf):
""" TpmMarshaller method """
signatureSigAlg = buf.readShort()
self.signature = UnionFactory.create('TPMU_SIGNATURE', signatureSigAlg)
self.signature.initFromTpm(buf) | [
"def",
"initFromTpm",
"(",
"self",
",",
"buf",
")",
":",
"signatureSigAlg",
"=",
"buf",
".",
"readShort",
"(",
")",
"self",
".",
"signature",
"=",
"UnionFactory",
".",
"create",
"(",
"'TPMU_SIGNATURE'",
",",
"signatureSigAlg",
")",
"self",
".",
"signature",
... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L13616-L13620 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/superplot/model.py | python | SuperplotModel.get_workspace_color | (self, ws_name) | return None | Get the color of a workspace.
Args:
ws_name (str): workspace name
Returns:
(str): color or None | Get the color of a workspace. | [
"Get",
"the",
"color",
"of",
"a",
"workspace",
"."
] | def get_workspace_color(self, ws_name):
"""
Get the color of a workspace.
Args:
ws_name (str): workspace name
Returns:
(str): color or None
"""
if ws_name in self._ws_colors:
return self._ws_colors[ws_name]
return None | [
"def",
"get_workspace_color",
"(",
"self",
",",
"ws_name",
")",
":",
"if",
"ws_name",
"in",
"self",
".",
"_ws_colors",
":",
"return",
"self",
".",
"_ws_colors",
"[",
"ws_name",
"]",
"return",
"None"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/superplot/model.py#L145-L157 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/pylib/results/flakiness_dashboard/json_results_generator.py | python | JSONResultsGeneratorBase._GetSVNRevision | (self, in_directory) | Returns the svn revision for the given directory.
Args:
in_directory: The directory where svn is to be run. | Returns the svn revision for the given directory. | [
"Returns",
"the",
"svn",
"revision",
"for",
"the",
"given",
"directory",
"."
] | def _GetSVNRevision(self, in_directory):
"""Returns the svn revision for the given directory.
Args:
in_directory: The directory where svn is to be run.
"""
# This is overridden in flakiness_dashboard_results_uploader.py.
raise NotImplementedError() | [
"def",
"_GetSVNRevision",
"(",
"self",
",",
"in_directory",
")",
":",
"# This is overridden in flakiness_dashboard_results_uploader.py.",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/results/flakiness_dashboard/json_results_generator.py#L358-L365 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/config.py | python | ConfigOptionsHandler._parse_packages | (self, value) | return find_packages(**find_kwargs) | Parses `packages` option value.
:param value:
:rtype: list | Parses `packages` option value. | [
"Parses",
"packages",
"option",
"value",
"."
] | def _parse_packages(self, value):
"""Parses `packages` option value.
:param value:
:rtype: list
"""
find_directives = ['find:', 'find_namespace:']
trimmed_value = value.strip()
if trimmed_value not in find_directives:
return self._parse_list(value)
... | [
"def",
"_parse_packages",
"(",
"self",
",",
"value",
")",
":",
"find_directives",
"=",
"[",
"'find:'",
",",
"'find_namespace:'",
"]",
"trimmed_value",
"=",
"value",
".",
"strip",
"(",
")",
"if",
"trimmed_value",
"not",
"in",
"find_directives",
":",
"return",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/config.py#L656-L680 | |
OpenGenus/cosmos | 1a94e8880068e51d571543be179c323936bd0936 | code/data_structures/src/list/singly_linked_list/operations/insertion/insertion_at_front.py | python | SinglyLinkedList.insert_in_front | (self, data) | Inserts New data at the beginning of the Linked List
Takes O(1) time | Inserts New data at the beginning of the Linked List
Takes O(1) time | [
"Inserts",
"New",
"data",
"at",
"the",
"beginning",
"of",
"the",
"Linked",
"List",
"Takes",
"O",
"(",
"1",
")",
"time"
] | def insert_in_front(self, data):
"""
Inserts New data at the beginning of the Linked List
Takes O(1) time
"""
self.head = Node(self, data=data, next=self.head) | [
"def",
"insert_in_front",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"head",
"=",
"Node",
"(",
"self",
",",
"data",
"=",
"data",
",",
"next",
"=",
"self",
".",
"head",
")"
] | https://github.com/OpenGenus/cosmos/blob/1a94e8880068e51d571543be179c323936bd0936/code/data_structures/src/list/singly_linked_list/operations/insertion/insertion_at_front.py#L38-L43 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/syndata.py | python | SyntaxDataBase.SetLexer | (self, lex) | Set the lexer object for this data object | Set the lexer object for this data object | [
"Set",
"the",
"lexer",
"object",
"for",
"this",
"data",
"object"
] | def SetLexer(self, lex):
"""Set the lexer object for this data object"""
self._lexer = lex | [
"def",
"SetLexer",
"(",
"self",
",",
"lex",
")",
":",
"self",
".",
"_lexer",
"=",
"lex"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/syndata.py#L130-L132 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/gaussian_process/_gpc.py | python | _BinaryGaussianProcessClassifierLaplace.log_marginal_likelihood | (self, theta=None, eval_gradient=False,
clone_kernel=True) | return Z, d_Z | Returns log-marginal likelihood of theta for training data.
Parameters
----------
theta : array-like of shape (n_kernel_params,) or None
Kernel hyperparameters for which the log-marginal likelihood is
evaluated. If None, the precomputed log_marginal_likelihood
... | Returns log-marginal likelihood of theta for training data. | [
"Returns",
"log",
"-",
"marginal",
"likelihood",
"of",
"theta",
"for",
"training",
"data",
"."
] | def log_marginal_likelihood(self, theta=None, eval_gradient=False,
clone_kernel=True):
"""Returns log-marginal likelihood of theta for training data.
Parameters
----------
theta : array-like of shape (n_kernel_params,) or None
Kernel hyperpara... | [
"def",
"log_marginal_likelihood",
"(",
"self",
",",
"theta",
"=",
"None",
",",
"eval_gradient",
"=",
"False",
",",
"clone_kernel",
"=",
"True",
")",
":",
"if",
"theta",
"is",
"None",
":",
"if",
"eval_gradient",
":",
"raise",
"ValueError",
"(",
"\"Gradient ca... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/gaussian_process/_gpc.py#L317-L391 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/utils.py | python | read_compile_settings_file | (settings_file, configuration) | return result | Read in a compile settings file and extract the dictionary of known values
:param settings_file:
:param configuration:
:return: | Read in a compile settings file and extract the dictionary of known values
:param settings_file:
:param configuration:
:return: | [
"Read",
"in",
"a",
"compile",
"settings",
"file",
"and",
"extract",
"the",
"dictionary",
"of",
"known",
"values",
":",
"param",
"settings_file",
":",
":",
"param",
"configuration",
":",
":",
"return",
":"
] | def read_compile_settings_file(settings_file, configuration):
"""
Read in a compile settings file and extract the dictionary of known values
:param settings_file:
:param configuration:
:return:
"""
def _read_config_item(config_settings, key, evaluated_keys={}, pending_keys=[]):
if ... | [
"def",
"read_compile_settings_file",
"(",
"settings_file",
",",
"configuration",
")",
":",
"def",
"_read_config_item",
"(",
"config_settings",
",",
"key",
",",
"evaluated_keys",
"=",
"{",
"}",
",",
"pending_keys",
"=",
"[",
"]",
")",
":",
"if",
"key",
"in",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/utils.py#L536-L604 | |
Tencent/TNN | 7acca99f54c55747b415a4c57677403eebc7b706 | third_party/flatbuffers/python/flatbuffers/flexbuffers.py | python | TypedVector.Value | (self) | Returns underlying data as list object. | Returns underlying data as list object. | [
"Returns",
"underlying",
"data",
"as",
"list",
"object",
"."
] | def Value(self):
"""Returns underlying data as list object."""
if not self:
return []
if self._element_type is Type.BOOL:
return [bool(e) for e in _UnpackVector(U, self.Bytes, len(self))]
elif self._element_type is Type.INT:
return list(_UnpackVector(I, self.Bytes, len(self)))
eli... | [
"def",
"Value",
"(",
"self",
")",
":",
"if",
"not",
"self",
":",
"return",
"[",
"]",
"if",
"self",
".",
"_element_type",
"is",
"Type",
".",
"BOOL",
":",
"return",
"[",
"bool",
"(",
"e",
")",
"for",
"e",
"in",
"_UnpackVector",
"(",
"U",
",",
"self... | https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/python/flatbuffers/flexbuffers.py#L479-L497 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xml/sax/handler.py | python | ContentHandler.characters | (self, content) | Receive notification of character data.
The Parser will call this method to report each chunk of
character data. SAX parsers may return all contiguous
character data in a single chunk, or they may split it into
several chunks; however, all of the characters in any single
event m... | Receive notification of character data. | [
"Receive",
"notification",
"of",
"character",
"data",
"."
] | def characters(self, content):
"""Receive notification of character data.
The Parser will call this method to report each chunk of
character data. SAX parsers may return all contiguous
character data in a single chunk, or they may split it into
several chunks; however, all of th... | [
"def",
"characters",
"(",
"self",
",",
"content",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/handler.py#L158-L166 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/cookies.py | python | RequestsCookieJar.iterkeys | (self) | Dict-like iterkeys() that returns an iterator of names of cookies from the jar.
See itervalues() and iteritems(). | Dict-like iterkeys() that returns an iterator of names of cookies from the jar.
See itervalues() and iteritems(). | [
"Dict",
"-",
"like",
"iterkeys",
"()",
"that",
"returns",
"an",
"iterator",
"of",
"names",
"of",
"cookies",
"from",
"the",
"jar",
".",
"See",
"itervalues",
"()",
"and",
"iteritems",
"()",
"."
] | def iterkeys(self):
"""Dict-like iterkeys() that returns an iterator of names of cookies from the jar.
See itervalues() and iteritems()."""
for cookie in iter(self):
yield cookie.name | [
"def",
"iterkeys",
"(",
"self",
")",
":",
"for",
"cookie",
"in",
"iter",
"(",
"self",
")",
":",
"yield",
"cookie",
".",
"name"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/cookies.py#L201-L205 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/ObjectsFem.py | python | makeConstraintSelfWeight | (
doc,
name="ConstraintSelfWeight"
) | return obj | makeConstraintSelfWeight(document, [name]):
creates a self weight object to define a gravity load | makeConstraintSelfWeight(document, [name]):
creates a self weight object to define a gravity load | [
"makeConstraintSelfWeight",
"(",
"document",
"[",
"name",
"]",
")",
":",
"creates",
"a",
"self",
"weight",
"object",
"to",
"define",
"a",
"gravity",
"load"
] | def makeConstraintSelfWeight(
doc,
name="ConstraintSelfWeight"
):
"""makeConstraintSelfWeight(document, [name]):
creates a self weight object to define a gravity load"""
obj = doc.addObject("Fem::ConstraintPython", name)
from femobjects import constraint_selfweight
constraint_selfweight.Cons... | [
"def",
"makeConstraintSelfWeight",
"(",
"doc",
",",
"name",
"=",
"\"ConstraintSelfWeight\"",
")",
":",
"obj",
"=",
"doc",
".",
"addObject",
"(",
"\"Fem::ConstraintPython\"",
",",
"name",
")",
"from",
"femobjects",
"import",
"constraint_selfweight",
"constraint_selfwei... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/ObjectsFem.py#L271-L285 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/data_flow_ops.py | python | ConditionalAccumulator.apply_grad | (self, grad, local_step=0, name=None) | return gen_data_flow_ops.accumulator_apply_gradient(
self._accumulator_ref, local_step=local_step, gradient=grad, name=name) | Attempts to apply a gradient to the accumulator.
The attempt is silently dropped if the gradient is stale, i.e., local_step
is less than the accumulator's global time step.
Args:
grad: The gradient tensor to be applied.
local_step: Time step at which the gradient was computed.
name: Opti... | Attempts to apply a gradient to the accumulator. | [
"Attempts",
"to",
"apply",
"a",
"gradient",
"to",
"the",
"accumulator",
"."
] | def apply_grad(self, grad, local_step=0, name=None):
"""Attempts to apply a gradient to the accumulator.
The attempt is silently dropped if the gradient is stale, i.e., local_step
is less than the accumulator's global time step.
Args:
grad: The gradient tensor to be applied.
local_step: Ti... | [
"def",
"apply_grad",
"(",
"self",
",",
"grad",
",",
"local_step",
"=",
"0",
",",
"name",
"=",
"None",
")",
":",
"grad",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"grad",
",",
"self",
".",
"_dtype",
")",
"grad",
".",
"get_shape",
"(",
")",
".",
"as... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/data_flow_ops.py#L1161-L1182 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/control_flow_ops.py | python | exit | (data, name=None) | Exits the current frame to its parent frame.
Exit makes its input `data` available to the parent frame.
Args:
data: The tensor to be made available to the parent frame.
name: A name for this operation (optional).
Returns:
The same tensor as `data`. | Exits the current frame to its parent frame. | [
"Exits",
"the",
"current",
"frame",
"to",
"its",
"parent",
"frame",
"."
] | def exit(data, name=None):
"""Exits the current frame to its parent frame.
Exit makes its input `data` available to the parent frame.
Args:
data: The tensor to be made available to the parent frame.
name: A name for this operation (optional).
Returns:
The same tensor as `data`.
"""
data = ops... | [
"def",
"exit",
"(",
"data",
",",
"name",
"=",
"None",
")",
":",
"data",
"=",
"ops",
".",
"convert_to_tensor_or_indexed_slices",
"(",
"data",
",",
"as_ref",
"=",
"True",
")",
"if",
"isinstance",
"(",
"data",
",",
"ops",
".",
"Tensor",
")",
":",
"if",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/control_flow_ops.py#L254-L284 | ||
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/prediction/multiple_gpu_estimator/mlp_data.py | python | MlpDataSet.parser | (self, serialized_example) | return image, label | Parses a single tf.Example into image and label tensors. | Parses a single tf.Example into image and label tensors. | [
"Parses",
"a",
"single",
"tf",
".",
"Example",
"into",
"image",
"and",
"label",
"tensors",
"."
] | def parser(self, serialized_example):
"""Parses a single tf.Example into image and label tensors."""
# Dimensions of the images in the CIFAR-10 dataset.
features = tf.parse_single_example(
serialized_example,
features={
'data': tf.FixedLenFeature([62], tf... | [
"def",
"parser",
"(",
"self",
",",
"serialized_example",
")",
":",
"# Dimensions of the images in the CIFAR-10 dataset.",
"features",
"=",
"tf",
".",
"parse_single_example",
"(",
"serialized_example",
",",
"features",
"=",
"{",
"'data'",
":",
"tf",
".",
"FixedLenFeatu... | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/prediction/multiple_gpu_estimator/mlp_data.py#L59-L72 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/metadata/Music/musicbrainzngs/musicbrainz.py | python | search_annotations | (query='', limit=None, offset=None, strict=False, **fields) | return _do_mb_search('annotation', query, fields, limit, offset, strict) | Search for annotations and return a dict with an 'annotation-list' key.
*Available search fields*: {fields} | Search for annotations and return a dict with an 'annotation-list' key. | [
"Search",
"for",
"annotations",
"and",
"return",
"a",
"dict",
"with",
"an",
"annotation",
"-",
"list",
"key",
"."
] | def search_annotations(query='', limit=None, offset=None, strict=False, **fields):
"""Search for annotations and return a dict with an 'annotation-list' key.
*Available search fields*: {fields}"""
return _do_mb_search('annotation', query, fields, limit, offset, strict) | [
"def",
"search_annotations",
"(",
"query",
"=",
"''",
",",
"limit",
"=",
"None",
",",
"offset",
"=",
"None",
",",
"strict",
"=",
"False",
",",
"*",
"*",
"fields",
")",
":",
"return",
"_do_mb_search",
"(",
"'annotation'",
",",
"query",
",",
"fields",
",... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/metadata/Music/musicbrainzngs/musicbrainz.py#L897-L901 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/saver.py | python | Saver.as_saver_def | (self) | return self.saver_def | Generates a `SaverDef` representation of this saver.
Returns:
A `SaverDef` proto. | Generates a `SaverDef` representation of this saver. | [
"Generates",
"a",
"SaverDef",
"representation",
"of",
"this",
"saver",
"."
] | def as_saver_def(self):
"""Generates a `SaverDef` representation of this saver.
Returns:
A `SaverDef` proto.
"""
return self.saver_def | [
"def",
"as_saver_def",
"(",
"self",
")",
":",
"return",
"self",
".",
"saver_def"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/saver.py#L1284-L1290 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/boto3/__init__.py | python | setup_default_session | (**kwargs) | Set up a default session, passing through any parameters to the session
constructor. There is no need to call this unless you wish to pass custom
parameters, because a default session will be created for you. | Set up a default session, passing through any parameters to the session
constructor. There is no need to call this unless you wish to pass custom
parameters, because a default session will be created for you. | [
"Set",
"up",
"a",
"default",
"session",
"passing",
"through",
"any",
"parameters",
"to",
"the",
"session",
"constructor",
".",
"There",
"is",
"no",
"need",
"to",
"call",
"this",
"unless",
"you",
"wish",
"to",
"pass",
"custom",
"parameters",
"because",
"a",
... | def setup_default_session(**kwargs):
"""
Set up a default session, passing through any parameters to the session
constructor. There is no need to call this unless you wish to pass custom
parameters, because a default session will be created for you.
"""
global DEFAULT_SESSION
DEFAULT_SESSION... | [
"def",
"setup_default_session",
"(",
"*",
"*",
"kwargs",
")",
":",
"global",
"DEFAULT_SESSION",
"DEFAULT_SESSION",
"=",
"Session",
"(",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/boto3/__init__.py#L27-L34 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | Table.write_metadata | (self, key: str, values: np.ndarray) | Write out a metadata array to the key as a fixed-format Series.
Parameters
----------
key : str
values : ndarray | Write out a metadata array to the key as a fixed-format Series. | [
"Write",
"out",
"a",
"metadata",
"array",
"to",
"the",
"key",
"as",
"a",
"fixed",
"-",
"format",
"Series",
"."
] | def write_metadata(self, key: str, values: np.ndarray):
"""
Write out a metadata array to the key as a fixed-format Series.
Parameters
----------
key : str
values : ndarray
"""
# error: Incompatible types in assignment (expression has type
# "Seri... | [
"def",
"write_metadata",
"(",
"self",
",",
"key",
":",
"str",
",",
"values",
":",
"np",
".",
"ndarray",
")",
":",
"# error: Incompatible types in assignment (expression has type",
"# \"Series\", variable has type \"ndarray\")",
"values",
"=",
"Series",
"(",
"values",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L3464-L3485 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | Choice.GetCurrentSelection | (*args, **kwargs) | return _controls_.Choice_GetCurrentSelection(*args, **kwargs) | GetCurrentSelection(self) -> int
Unlike `GetSelection` which only returns the accepted selection value,
i.e. the selection in the control once the user closes the dropdown
list, this function returns the current selection. That is, while the
dropdown list is shown, it returns the curre... | GetCurrentSelection(self) -> int | [
"GetCurrentSelection",
"(",
"self",
")",
"-",
">",
"int"
] | def GetCurrentSelection(*args, **kwargs):
"""
GetCurrentSelection(self) -> int
Unlike `GetSelection` which only returns the accepted selection value,
i.e. the selection in the control once the user closes the dropdown
list, this function returns the current selection. That is, ... | [
"def",
"GetCurrentSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Choice_GetCurrentSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L514-L525 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xmlrpc/server.py | python | ServerHTMLDoc.docroutine | (self, object, name, mod=None,
funcs={}, classes={}, methods={}, cl=None) | return '<dl><dt>%s</dt>%s</dl>\n' % (decl, doc) | Produce HTML documentation for a function or method object. | Produce HTML documentation for a function or method object. | [
"Produce",
"HTML",
"documentation",
"for",
"a",
"function",
"or",
"method",
"object",
"."
] | def docroutine(self, object, name, mod=None,
funcs={}, classes={}, methods={}, cl=None):
"""Produce HTML documentation for a function or method object."""
anchor = (cl and cl.__name__ or '') + '-' + name
note = ''
title = '<a name="%s"><strong>%s</strong></a>' % (
... | [
"def",
"docroutine",
"(",
"self",
",",
"object",
",",
"name",
",",
"mod",
"=",
"None",
",",
"funcs",
"=",
"{",
"}",
",",
"classes",
"=",
"{",
"}",
",",
"methods",
"=",
"{",
"}",
",",
"cl",
"=",
"None",
")",
":",
"anchor",
"=",
"(",
"cl",
"and... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xmlrpc/server.py#L765-L792 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlWinParser.GetCharWidth | (*args, **kwargs) | return _html.HtmlWinParser_GetCharWidth(*args, **kwargs) | GetCharWidth(self) -> int | GetCharWidth(self) -> int | [
"GetCharWidth",
"(",
"self",
")",
"-",
">",
"int"
] | def GetCharWidth(*args, **kwargs):
"""GetCharWidth(self) -> int"""
return _html.HtmlWinParser_GetCharWidth(*args, **kwargs) | [
"def",
"GetCharWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWinParser_GetCharWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L256-L258 | |
xieyufei1993/FOTS | 9881966697fd5e2936d2cca8aa04309e4b64f77c | utils/bbox.py | python | Toolbox.resize_image | (im, max_side_len = 2400) | return im, (ratio_h, ratio_w) | resize image to a size multiple of 32 which is required by the network
:param im: the resized image
:param max_side_len: limit of max image size to avoid out of memory in gpu
:return: the resized image and the resize ratio | resize image to a size multiple of 32 which is required by the network
:param im: the resized image
:param max_side_len: limit of max image size to avoid out of memory in gpu
:return: the resized image and the resize ratio | [
"resize",
"image",
"to",
"a",
"size",
"multiple",
"of",
"32",
"which",
"is",
"required",
"by",
"the",
"network",
":",
"param",
"im",
":",
"the",
"resized",
"image",
":",
"param",
"max_side_len",
":",
"limit",
"of",
"max",
"image",
"size",
"to",
"avoid",
... | def resize_image(im, max_side_len = 2400):
'''
resize image to a size multiple of 32 which is required by the network
:param im: the resized image
:param max_side_len: limit of max image size to avoid out of memory in gpu
:return: the resized image and the resize ratio
''... | [
"def",
"resize_image",
"(",
"im",
",",
"max_side_len",
"=",
"2400",
")",
":",
"h",
",",
"w",
",",
"_",
"=",
"im",
".",
"shape",
"resize_w",
"=",
"w",
"resize_h",
"=",
"h",
"# limit the max side",
"if",
"max",
"(",
"resize_h",
",",
"resize_w",
")",
">... | https://github.com/xieyufei1993/FOTS/blob/9881966697fd5e2936d2cca8aa04309e4b64f77c/utils/bbox.py#L136-L163 | |
LisaAnne/lisa-caffe-public | 49b8643ddef23a4f6120017968de30c45e693f59 | scripts/cpp_lint.py | python | CheckCaffeDataLayerSetUp | (filename, clean_lines, linenum, error) | Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
li... | Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
li... | [
"Except",
"the",
"base",
"classes",
"Caffe",
"DataLayer",
"should",
"define",
"DataLayerSetUp",
"instead",
"of",
"LayerSetUp",
".",
"The",
"base",
"DataLayers",
"define",
"common",
"SetUp",
"steps",
"the",
"subclasses",
"should",
"not",
"override",
"them",
".",
... | def CheckCaffeDataLayerSetUp(filename, clean_lines, linenum, error):
"""Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current f... | [
"def",
"CheckCaffeDataLayerSetUp",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"ix",
"=",
"line",
".",
"find",
"(",
"'DataLayer<Dtype>::LayerSetUp'",
")",
"if",
... | https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/scripts/cpp_lint.py#L1595-L1631 | ||
uncrustify/uncrustify | 719cf9d153a9ec14be8d5f01536121ced71d8bc9 | scripts/option_reducer.py | python | same_expected_generated | (formatted_path, unc_bin_path, cfg_file_path,
input_path, lang=None) | return True if formatted_string == expected_string else False | Calls uncrustify and compares its generated output with the content of a
file
Parameters
----------------------------------------------------------------------------
:param formatted_path: str
path to a file containing the expected content
:params unc_bin_path, cfg_file_path, input_path, ... | Calls uncrustify and compares its generated output with the content of a
file | [
"Calls",
"uncrustify",
"and",
"compares",
"its",
"generated",
"output",
"with",
"the",
"content",
"of",
"a",
"file"
] | def same_expected_generated(formatted_path, unc_bin_path, cfg_file_path,
input_path, lang=None):
"""
Calls uncrustify and compares its generated output with the content of a
file
Parameters
----------------------------------------------------------------------------
... | [
"def",
"same_expected_generated",
"(",
"formatted_path",
",",
"unc_bin_path",
",",
"cfg_file_path",
",",
"input_path",
",",
"lang",
"=",
"None",
")",
":",
"expected_string",
"=",
"''",
"with",
"open",
"(",
"formatted_path",
",",
"'rb'",
")",
"as",
"f",
":",
... | https://github.com/uncrustify/uncrustify/blob/719cf9d153a9ec14be8d5f01536121ced71d8bc9/scripts/option_reducer.py#L194-L222 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/rcnn/rcnn/dataset/imdb.py | python | IMDB.rpn_roidb | (self, gt_roidb, append_gt=False) | return roidb | get rpn roidb and ground truth roidb
:param gt_roidb: ground truth roidb
:param append_gt: append ground truth
:return: roidb of rpn | get rpn roidb and ground truth roidb
:param gt_roidb: ground truth roidb
:param append_gt: append ground truth
:return: roidb of rpn | [
"get",
"rpn",
"roidb",
"and",
"ground",
"truth",
"roidb",
":",
"param",
"gt_roidb",
":",
"ground",
"truth",
"roidb",
":",
"param",
"append_gt",
":",
"append",
"ground",
"truth",
":",
"return",
":",
"roidb",
"of",
"rpn"
] | def rpn_roidb(self, gt_roidb, append_gt=False):
"""
get rpn roidb and ground truth roidb
:param gt_roidb: ground truth roidb
:param append_gt: append ground truth
:return: roidb of rpn
"""
if append_gt:
logger.info('%s appending ground truth annotation... | [
"def",
"rpn_roidb",
"(",
"self",
",",
"gt_roidb",
",",
"append_gt",
"=",
"False",
")",
":",
"if",
"append_gt",
":",
"logger",
".",
"info",
"(",
"'%s appending ground truth annotations'",
"%",
"self",
".",
"name",
")",
"rpn_roidb",
"=",
"self",
".",
"load_rpn... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/dataset/imdb.py#L105-L118 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.