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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/platform.py | python | _syscmd_uname | (option,default='') | Interface to the system's uname command. | Interface to the system's uname command. | [
"Interface",
"to",
"the",
"system",
"s",
"uname",
"command",
"."
] | def _syscmd_uname(option,default=''):
""" Interface to the system's uname command.
"""
if sys.platform in ('dos','win32','win16','os2'):
# XXX Others too ?
return default
try:
f = os.popen('uname %s 2> %s' % (option, DEV_NULL))
except (AttributeError,os.error):
retur... | [
"def",
"_syscmd_uname",
"(",
"option",
",",
"default",
"=",
"''",
")",
":",
"if",
"sys",
".",
"platform",
"in",
"(",
"'dos'",
",",
"'win32'",
",",
"'win16'",
",",
"'os2'",
")",
":",
"# XXX Others too ?",
"return",
"default",
"try",
":",
"f",
"=",
"os",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/platform.py#L1000-L1016 | ||
v8/v8 | fee3bf095260bf657a3eea4d3d41f90c42c6c857 | tools/stats-viewer.py | python | CounterCollection.CounterSize | (self) | return 4 + self.max_name_size | Return the size of a single counter. | Return the size of a single counter. | [
"Return",
"the",
"size",
"of",
"a",
"single",
"counter",
"."
] | def CounterSize(self):
"""Return the size of a single counter."""
return 4 + self.max_name_size | [
"def",
"CounterSize",
"(",
"self",
")",
":",
"return",
"4",
"+",
"self",
".",
"max_name_size"
] | https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/stats-viewer.py#L381-L383 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchAxisSystem.py | python | _AxisSystem.getPoints | (self,obj) | return pts | returns the gridpoints of linked axes | returns the gridpoints of linked axes | [
"returns",
"the",
"gridpoints",
"of",
"linked",
"axes"
] | def getPoints(self,obj):
"returns the gridpoints of linked axes"
pts = []
if len(obj.Axes) == 1:
for e in obj.Axes[0].Shape.Edges:
pts.append(e.Vertexes[0].Point)
elif len(obj.Axes) == 2:
set1 = obj.Axes[0].Shape.Edges # X
set2 = obj.... | [
"def",
"getPoints",
"(",
"self",
",",
"obj",
")",
":",
"pts",
"=",
"[",
"]",
"if",
"len",
"(",
"obj",
".",
"Axes",
")",
"==",
"1",
":",
"for",
"e",
"in",
"obj",
".",
"Axes",
"[",
"0",
"]",
".",
"Shape",
".",
"Edges",
":",
"pts",
".",
"appen... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchAxisSystem.py#L145-L175 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/io/io.py | python | DataIter.getlabel | (self) | Get label of the current batch.
Returns
-------
list of NDArray
The label of the current batch. | Get label of the current batch. | [
"Get",
"label",
"of",
"the",
"current",
"batch",
"."
] | def getlabel(self):
"""Get label of the current batch.
Returns
-------
list of NDArray
The label of the current batch.
"""
pass | [
"def",
"getlabel",
"(",
"self",
")",
":",
"pass"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/io/io.py#L252-L260 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/core/jasper_process.py | python | Process.stop | (self, mode=None) | Terminate the process. | Terminate the process. | [
"Terminate",
"the",
"process",
"."
] | def stop(self, mode=None):
"""Terminate the process."""
if mode is None:
mode = fixture_interface.TeardownMode.TERMINATE
if mode == fixture_interface.TeardownMode.KILL:
signal = self.pb.Signals.Value("KILL")
elif mode == fixture_interface.TeardownMode.TERMINATE:
... | [
"def",
"stop",
"(",
"self",
",",
"mode",
"=",
"None",
")",
":",
"if",
"mode",
"is",
"None",
":",
"mode",
"=",
"fixture_interface",
".",
"TeardownMode",
".",
"TERMINATE",
"if",
"mode",
"==",
"fixture_interface",
".",
"TeardownMode",
".",
"KILL",
":",
"sig... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/core/jasper_process.py#L62-L90 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PropertyGridPopulator.SetState | (*args, **kwargs) | return _propgrid.PropertyGridPopulator_SetState(*args, **kwargs) | SetState(self, state) | SetState(self, state) | [
"SetState",
"(",
"self",
"state",
")"
] | def SetState(*args, **kwargs):
"""SetState(self, state)"""
return _propgrid.PropertyGridPopulator_SetState(*args, **kwargs) | [
"def",
"SetState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridPopulator_SetState",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L2578-L2580 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/unix_events.py | python | _UnixSelectorEventLoop._handle_signal | (self, sig) | Internal helper that is the actual signal handler. | Internal helper that is the actual signal handler. | [
"Internal",
"helper",
"that",
"is",
"the",
"actual",
"signal",
"handler",
"."
] | def _handle_signal(self, sig):
"""Internal helper that is the actual signal handler."""
handle = self._signal_handlers.get(sig)
if handle is None:
return # Assume it's some race condition.
if handle._cancelled:
self.remove_signal_handler(sig) # Remove it properl... | [
"def",
"_handle_signal",
"(",
"self",
",",
"sig",
")",
":",
"handle",
"=",
"self",
".",
"_signal_handlers",
".",
"get",
"(",
"sig",
")",
"if",
"handle",
"is",
"None",
":",
"return",
"# Assume it's some race condition.",
"if",
"handle",
".",
"_cancelled",
":"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/unix_events.py#L123-L131 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Image.AdjustChannels | (*args, **kwargs) | return _core_.Image_AdjustChannels(*args, **kwargs) | AdjustChannels(self, double factor_red, double factor_green, double factor_blue,
double factor_alpha=1.0) -> Image
This function muliplies all 4 channels (red, green, blue, alpha) with
a factor (around 1.0). Useful for gamma correction, colour correction
and to add a certain amount... | AdjustChannels(self, double factor_red, double factor_green, double factor_blue,
double factor_alpha=1.0) -> Image | [
"AdjustChannels",
"(",
"self",
"double",
"factor_red",
"double",
"factor_green",
"double",
"factor_blue",
"double",
"factor_alpha",
"=",
"1",
".",
"0",
")",
"-",
">",
"Image"
] | def AdjustChannels(*args, **kwargs):
"""
AdjustChannels(self, double factor_red, double factor_green, double factor_blue,
double factor_alpha=1.0) -> Image
This function muliplies all 4 channels (red, green, blue, alpha) with
a factor (around 1.0). Useful for gamma correcti... | [
"def",
"AdjustChannels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_AdjustChannels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L3680-L3691 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/msvs.py | python | msvs_generator.add_aliases | (self) | Add a specific target that emulates the "make all" necessary for Visual studio when pressing F7
We also add an alias for "make install" (disabled by default) | Add a specific target that emulates the "make all" necessary for Visual studio when pressing F7
We also add an alias for "make install" (disabled by default) | [
"Add",
"a",
"specific",
"target",
"that",
"emulates",
"the",
"make",
"all",
"necessary",
"for",
"Visual",
"studio",
"when",
"pressing",
"F7",
"We",
"also",
"add",
"an",
"alias",
"for",
"make",
"install",
"(",
"disabled",
"by",
"default",
")"
] | def add_aliases(self):
"""
Add a specific target that emulates the "make all" necessary for Visual studio when pressing F7
We also add an alias for "make install" (disabled by default)
"""
base = getattr(self, 'projects_dir', None) or self.tg.path
node_project = base.mak... | [
"def",
"add_aliases",
"(",
"self",
")",
":",
"base",
"=",
"getattr",
"(",
"self",
",",
"'projects_dir'",
",",
"None",
")",
"or",
"self",
".",
"tg",
".",
"path",
"node_project",
"=",
"base",
".",
"make_node",
"(",
"'_WAF_'",
"+",
"self",
".",
"project_e... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/msvs.py#L2141-L2153 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/aoc/nyan_subprocessor.py | python | AoCNyanSubprocessor.ambient_group_to_game_entity | (ambient_group) | Creates raw API objects for an ambient group.
:param ambient_group: Unit line that gets converted to a game entity.
:type ambient_group: ..dataformat.converter_object.ConverterObjectGroup | Creates raw API objects for an ambient group. | [
"Creates",
"raw",
"API",
"objects",
"for",
"an",
"ambient",
"group",
"."
] | def ambient_group_to_game_entity(ambient_group):
"""
Creates raw API objects for an ambient group.
:param ambient_group: Unit line that gets converted to a game entity.
:type ambient_group: ..dataformat.converter_object.ConverterObjectGroup
"""
ambient_unit = ambient_gro... | [
"def",
"ambient_group_to_game_entity",
"(",
"ambient_group",
")",
":",
"ambient_unit",
"=",
"ambient_group",
".",
"get_head_unit",
"(",
")",
"ambient_id",
"=",
"ambient_group",
".",
"get_head_unit_id",
"(",
")",
"dataset",
"=",
"ambient_group",
".",
"data",
"name_lo... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/nyan_subprocessor.py#L518-L606 | ||
vmware/concord-bft | ec036a384b4c81be0423d4b429bd37900b13b864 | scripts/prepare-code-coverage-artifact.py | python | prepare_html_report | (host_llvm_cov, profile, coverage_report_dir, binary) | Function is used to generation of code coverage report. | Function is used to generation of code coverage report. | [
"Function",
"is",
"used",
"to",
"generation",
"of",
"code",
"coverage",
"report",
"."
] | def prepare_html_report(host_llvm_cov, profile, coverage_report_dir, binary):
"""
Function is used to generation of code coverage report.
"""
print('\n:: Preparing html report for {0}...'.format(binary), end='')
sys.stdout.flush()
objects = []
objects.append(binary)
index_page = os.path.... | [
"def",
"prepare_html_report",
"(",
"host_llvm_cov",
",",
"profile",
",",
"coverage_report_dir",
",",
"binary",
")",
":",
"print",
"(",
"'\\n:: Preparing html report for {0}...'",
".",
"format",
"(",
"binary",
")",
",",
"end",
"=",
"''",
")",
"sys",
".",
"stdout"... | https://github.com/vmware/concord-bft/blob/ec036a384b4c81be0423d4b429bd37900b13b864/scripts/prepare-code-coverage-artifact.py#L93-L135 | ||
Genius-x/genius-x | 9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0 | cocos2d/tools/bindings-generator/clang/cindex.py | python | CompileCommand.directory | (self) | return conf.lib.clang_CompileCommand_getDirectory(self.cmd) | Get the working directory for this CompileCommand | Get the working directory for this CompileCommand | [
"Get",
"the",
"working",
"directory",
"for",
"this",
"CompileCommand"
] | def directory(self):
"""Get the working directory for this CompileCommand"""
return conf.lib.clang_CompileCommand_getDirectory(self.cmd) | [
"def",
"directory",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CompileCommand_getDirectory",
"(",
"self",
".",
"cmd",
")"
] | https://github.com/Genius-x/genius-x/blob/9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0/cocos2d/tools/bindings-generator/clang/cindex.py#L2569-L2571 | |
mixxxdj/mixxx | b519aba1d967a39c63b5f5c56cf5c3a95addec28 | tools/make_xone.py | python | get_key_name | (key) | return key | Optionally munge key name if an EQ | Optionally munge key name if an EQ | [
"Optionally",
"munge",
"key",
"name",
"if",
"an",
"EQ"
] | def get_key_name(key):
"""Optionally munge key name if an EQ"""
if key == "filterLow":
return "parameter1"
if key == "filterMid":
return "parameter2"
if key == "filterHigh":
return "parameter3"
if key == "filterLowKill":
return "button_parameter1"
if key == "filte... | [
"def",
"get_key_name",
"(",
"key",
")",
":",
"if",
"key",
"==",
"\"filterLow\"",
":",
"return",
"\"parameter1\"",
"if",
"key",
"==",
"\"filterMid\"",
":",
"return",
"\"parameter2\"",
"if",
"key",
"==",
"\"filterHigh\"",
":",
"return",
"\"parameter3\"",
"if",
"... | https://github.com/mixxxdj/mixxx/blob/b519aba1d967a39c63b5f5c56cf5c3a95addec28/tools/make_xone.py#L429-L443 | |
wujixiu/helmet-detection | 8eff5c59ddfba5a29e0b76aeb48babcb49246178 | hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py | python | IsBlankLine | (line) | return not line or line.isspace() | Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank. | Returns true if the given line is blank. | [
"Returns",
"true",
"if",
"the",
"given",
"line",
"is",
"blank",
"."
] | def IsBlankLine(line):
"""Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank.
"""
return not line or line.isspace() | [
"def",
"IsBlankLine",
"(",
"line",
")",
":",
"return",
"not",
"line",
"or",
"line",
".",
"isspace",
"(",
")"
] | https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/hardhat-wearing-detection/SSD-RPA/scripts/cpp_lint.py#L2373-L2385 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/msvc.py | python | SystemInfo.NetFxSdkVersion | (self) | return (('4.7.2', '4.7.1', '4.7',
'4.6.2', '4.6.1', '4.6',
'4.5.2', '4.5.1', '4.5')
if self.vs_ver >= 14.0 else ()) | Microsoft .NET Framework SDK versions.
Return
------
tuple of str
versions | Microsoft .NET Framework SDK versions. | [
"Microsoft",
".",
"NET",
"Framework",
"SDK",
"versions",
"."
] | def NetFxSdkVersion(self):
"""
Microsoft .NET Framework SDK versions.
Return
------
tuple of str
versions
"""
# Set FxSdk versions for specified VS version
return (('4.7.2', '4.7.1', '4.7',
'4.6.2', '4.6.1', '4.6',
... | [
"def",
"NetFxSdkVersion",
"(",
"self",
")",
":",
"# Set FxSdk versions for specified VS version",
"return",
"(",
"(",
"'4.7.2'",
",",
"'4.7.1'",
",",
"'4.7'",
",",
"'4.6.2'",
",",
"'4.6.1'",
",",
"'4.6'",
",",
"'4.5.2'",
",",
"'4.5.1'",
",",
"'4.5'",
")",
"if"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/msvc.py#L904-L917 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/ops.py | python | Operation.values | (self) | return tuple(self.outputs) | DEPRECATED: Use outputs. | DEPRECATED: Use outputs. | [
"DEPRECATED",
":",
"Use",
"outputs",
"."
] | def values(self):
"""DEPRECATED: Use outputs."""
return tuple(self.outputs) | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"tuple",
"(",
"self",
".",
"outputs",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/ops.py#L1269-L1271 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/linalg/linear_operator.py | python | LinearOperator.add_to_tensor | (self, x, name="add_to_tensor") | Add matrix represented by this operator to `x`. Equivalent to `A + x`.
Args:
x: `Tensor` with same `dtype` and shape broadcastable to `self.shape`.
name: A name to give this `Op`.
Returns:
A `Tensor` with broadcast shape and same `dtype` as `self`. | Add matrix represented by this operator to `x`. Equivalent to `A + x`. | [
"Add",
"matrix",
"represented",
"by",
"this",
"operator",
"to",
"x",
".",
"Equivalent",
"to",
"A",
"+",
"x",
"."
] | def add_to_tensor(self, x, name="add_to_tensor"):
"""Add matrix represented by this operator to `x`. Equivalent to `A + x`.
Args:
x: `Tensor` with same `dtype` and shape broadcastable to `self.shape`.
name: A name to give this `Op`.
Returns:
A `Tensor` with broadcast shape and same `d... | [
"def",
"add_to_tensor",
"(",
"self",
",",
"x",
",",
"name",
"=",
"\"add_to_tensor\"",
")",
":",
"with",
"self",
".",
"_name_scope",
"(",
"name",
",",
"values",
"=",
"[",
"x",
"]",
")",
":",
"x",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"x",
",",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg/linear_operator.py#L919-L932 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/config/configobj.py | python | ConfigObj._write_marker | (self, indent_string, depth, entry, comment) | return '%s%s%s%s%s' % (
indent_string,
self._a_to_u('[' * depth),
self._quote(self._decode_element(entry), multiline=False),
self._a_to_u(']' * depth),
self._decode_element(comment)) | Write a section marker line | Write a section marker line | [
"Write",
"a",
"section",
"marker",
"line"
] | def _write_marker(self, indent_string, depth, entry, comment):
"""Write a section marker line"""
return '%s%s%s%s%s' % (
indent_string,
self._a_to_u('[' * depth),
self._quote(self._decode_element(entry), multiline=False),
self._a_to_u(']' * depth),
... | [
"def",
"_write_marker",
"(",
"self",
",",
"indent_string",
",",
"depth",
",",
"entry",
",",
"comment",
")",
":",
"return",
"'%s%s%s%s%s'",
"%",
"(",
"indent_string",
",",
"self",
".",
"_a_to_u",
"(",
"'['",
"*",
"depth",
")",
",",
"self",
".",
"_quote",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/config/configobj.py#L1871-L1878 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/collections/__init__.py | python | OrderedDict.__reversed__ | (self) | od.__reversed__() <==> reversed(od) | od.__reversed__() <==> reversed(od) | [
"od",
".",
"__reversed__",
"()",
"<",
"==",
">",
"reversed",
"(",
"od",
")"
] | def __reversed__(self):
'od.__reversed__() <==> reversed(od)'
# Traverse the linked list in reverse order.
root = self.__root
curr = root.prev
while curr is not root:
yield curr.key
curr = curr.prev | [
"def",
"__reversed__",
"(",
"self",
")",
":",
"# Traverse the linked list in reverse order.",
"root",
"=",
"self",
".",
"__root",
"curr",
"=",
"root",
".",
"prev",
"while",
"curr",
"is",
"not",
"root",
":",
"yield",
"curr",
".",
"key",
"curr",
"=",
"curr",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/collections/__init__.py#L151-L158 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.ifconfig_down | (self) | Bring down the IPv6 interface. | Bring down the IPv6 interface. | [
"Bring",
"down",
"the",
"IPv6",
"interface",
"."
] | def ifconfig_down(self):
"""Bring down the IPv6 interface."""
self.execute_command('ifconfig down') | [
"def",
"ifconfig_down",
"(",
"self",
")",
":",
"self",
".",
"execute_command",
"(",
"'ifconfig down'",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L189-L191 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/net/tools/truncate_net_log.py | python | get_file_size | (path) | return os.stat(path).st_size | Returns the filesize of |path| in bytes | Returns the filesize of |path| in bytes | [
"Returns",
"the",
"filesize",
"of",
"|path|",
"in",
"bytes"
] | def get_file_size(path):
'''Returns the filesize of |path| in bytes'''
return os.stat(path).st_size | [
"def",
"get_file_size",
"(",
"path",
")",
":",
"return",
"os",
".",
"stat",
"(",
"path",
")",
".",
"st_size"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/net/tools/truncate_net_log.py#L37-L39 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Base/Python/slicer/util.py | python | arrayFromVolume | (volumeNode) | return narray | Return voxel array from volume node as numpy array.
Voxels values are not copied. Voxel values in the volume node can be modified
by changing values in the numpy array.
After all modifications has been completed, call :py:meth:`arrayFromVolumeModified`.
.. warning:: Memory area of the returned array is managed... | Return voxel array from volume node as numpy array.
Voxels values are not copied. Voxel values in the volume node can be modified
by changing values in the numpy array.
After all modifications has been completed, call :py:meth:`arrayFromVolumeModified`. | [
"Return",
"voxel",
"array",
"from",
"volume",
"node",
"as",
"numpy",
"array",
".",
"Voxels",
"values",
"are",
"not",
"copied",
".",
"Voxel",
"values",
"in",
"the",
"volume",
"node",
"can",
"be",
"modified",
"by",
"changing",
"values",
"in",
"the",
"numpy",... | def arrayFromVolume(volumeNode):
"""Return voxel array from volume node as numpy array.
Voxels values are not copied. Voxel values in the volume node can be modified
by changing values in the numpy array.
After all modifications has been completed, call :py:meth:`arrayFromVolumeModified`.
.. warning:: Memory... | [
"def",
"arrayFromVolume",
"(",
"volumeNode",
")",
":",
"scalarTypes",
"=",
"[",
"'vtkMRMLScalarVolumeNode'",
",",
"'vtkMRMLLabelMapVolumeNode'",
"]",
"vectorTypes",
"=",
"[",
"'vtkMRMLVectorVolumeNode'",
",",
"'vtkMRMLMultiVolumeNode'",
",",
"'vtkMRMLDiffusionWeightedVolumeNo... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/slicer/util.py#L948-L981 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | AuiPaneInfo.Centre | (self) | return self | Sets the pane to the center position of the frame.
The centre pane is the space in the middle after all border panes (left, top,
right, bottom) are subtracted from the layout.
:note: This is the same thing as calling :meth:`~AuiPaneInfo.Direction` with ``AUI_DOCK_CENTRE`` as
parameter... | Sets the pane to the center position of the frame. | [
"Sets",
"the",
"pane",
"to",
"the",
"center",
"position",
"of",
"the",
"frame",
"."
] | def Centre(self):
"""
Sets the pane to the center position of the frame.
The centre pane is the space in the middle after all border panes (left, top,
right, bottom) are subtracted from the layout.
:note: This is the same thing as calling :meth:`~AuiPaneInfo.Direction` with ``A... | [
"def",
"Centre",
"(",
"self",
")",
":",
"self",
".",
"dock_direction",
"=",
"AUI_DOCK_CENTRE",
"return",
"self"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L969-L981 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/geodesy/utm.py | python | fromLatLong | (latitude, longitude, altitude=float('nan')) | return UTMPoint(easting=e, northing=n, altitude=altitude, zone=z, band=b) | Generate :class:`UTMPoint` from latitude, longitude and (optional) altitude.
Latitude and longitude are expressed in degrees, relative to the
WGS84 ellipsoid.
:param latitude: [degrees], negative is South.
:param longitude: [degrees], negative is West.
:param altitude: [meters], negative is below ... | Generate :class:`UTMPoint` from latitude, longitude and (optional) altitude. | [
"Generate",
":",
"class",
":",
"UTMPoint",
"from",
"latitude",
"longitude",
"and",
"(",
"optional",
")",
"altitude",
"."
] | def fromLatLong(latitude, longitude, altitude=float('nan')):
"""Generate :class:`UTMPoint` from latitude, longitude and (optional) altitude.
Latitude and longitude are expressed in degrees, relative to the
WGS84 ellipsoid.
:param latitude: [degrees], negative is South.
:param longitude: [degrees],... | [
"def",
"fromLatLong",
"(",
"latitude",
",",
"longitude",
",",
"altitude",
"=",
"float",
"(",
"'nan'",
")",
")",
":",
"z",
",",
"b",
"=",
"gridZone",
"(",
"latitude",
",",
"longitude",
")",
"utm_proj",
"=",
"pyproj",
".",
"Proj",
"(",
"proj",
"=",
"'u... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geodesy/utm.py#L131-L146 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/gzip.py | python | compress | (data, compresslevel=9) | return buf.getvalue() | Compress data in one shot and return the compressed string.
Optional argument is the compression level, in range of 0-9. | Compress data in one shot and return the compressed string.
Optional argument is the compression level, in range of 0-9. | [
"Compress",
"data",
"in",
"one",
"shot",
"and",
"return",
"the",
"compressed",
"string",
".",
"Optional",
"argument",
"is",
"the",
"compression",
"level",
"in",
"range",
"of",
"0",
"-",
"9",
"."
] | def compress(data, compresslevel=9):
"""Compress data in one shot and return the compressed string.
Optional argument is the compression level, in range of 0-9.
"""
buf = io.BytesIO()
with GzipFile(fileobj=buf, mode='wb', compresslevel=compresslevel) as f:
f.write(data)
return buf.getval... | [
"def",
"compress",
"(",
"data",
",",
"compresslevel",
"=",
"9",
")",
":",
"buf",
"=",
"io",
".",
"BytesIO",
"(",
")",
"with",
"GzipFile",
"(",
"fileobj",
"=",
"buf",
",",
"mode",
"=",
"'wb'",
",",
"compresslevel",
"=",
"compresslevel",
")",
"as",
"f"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/gzip.py#L529-L536 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | TextBoxAttr.SetClearMode | (*args, **kwargs) | return _richtext.TextBoxAttr_SetClearMode(*args, **kwargs) | SetClearMode(self, int mode) | SetClearMode(self, int mode) | [
"SetClearMode",
"(",
"self",
"int",
"mode",
")"
] | def SetClearMode(*args, **kwargs):
"""SetClearMode(self, int mode)"""
return _richtext.TextBoxAttr_SetClearMode(*args, **kwargs) | [
"def",
"SetClearMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"TextBoxAttr_SetClearMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L596-L598 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/mturk/connection.py | python | MTurkConnection.create_qualification_type | (self,
name,
description,
status,
keywords=None,
retry_delay=None,
test=None,
answ... | return self._process_request('CreateQualificationType', params,
[('QualificationType',
QualificationType)]) | Create a new Qualification Type.
name: This will be visible to workers and must be unique for a
given requester.
description: description shown to workers. Max 2000 characters.
status: 'Active' or 'Inactive'
keywords: list of keyword strings or comma separated string.
... | Create a new Qualification Type. | [
"Create",
"a",
"new",
"Qualification",
"Type",
"."
] | def create_qualification_type(self,
name,
description,
status,
keywords=None,
retry_delay=None,
test=None,
... | [
"def",
"create_qualification_type",
"(",
"self",
",",
"name",
",",
"description",
",",
"status",
",",
"keywords",
"=",
"None",
",",
"retry_delay",
"=",
"None",
",",
"test",
"=",
"None",
",",
"answer_key",
"=",
"None",
",",
"answer_key_xml",
"=",
"None",
",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/mturk/connection.py#L618-L695 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py | python | ResourceManager.resource_filename | (self, package_or_requirement, resource_name) | return get_provider(package_or_requirement).get_resource_filename(
self, resource_name
) | Return a true filesystem path for specified resource | Return a true filesystem path for specified resource | [
"Return",
"a",
"true",
"filesystem",
"path",
"for",
"specified",
"resource"
] | def resource_filename(self, package_or_requirement, resource_name):
"""Return a true filesystem path for specified resource"""
return get_provider(package_or_requirement).get_resource_filename(
self, resource_name
) | [
"def",
"resource_filename",
"(",
"self",
",",
"package_or_requirement",
",",
"resource_name",
")",
":",
"return",
"get_provider",
"(",
"package_or_requirement",
")",
".",
"get_resource_filename",
"(",
"self",
",",
"resource_name",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L1140-L1144 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftmake/make_wire.py | python | make_wire | (pointslist, closed=False, placement=None, face=None, support=None, bs2wire=False) | return obj | makeWire(pointslist,[closed],[placement])
Creates a Wire object from the given list of vectors. If face is
true (and wire is closed), the wire will appear filled. Instead of
a pointslist, you can also pass a Part Wire.
Parameters
----------
pointslist : [Base.Vector]
List of point... | makeWire(pointslist,[closed],[placement])
Creates a Wire object from the given list of vectors. If face is
true (and wire is closed), the wire will appear filled. Instead of
a pointslist, you can also pass a Part Wire. | [
"makeWire",
"(",
"pointslist",
"[",
"closed",
"]",
"[",
"placement",
"]",
")",
"Creates",
"a",
"Wire",
"object",
"from",
"the",
"given",
"list",
"of",
"vectors",
".",
"If",
"face",
"is",
"true",
"(",
"and",
"wire",
"is",
"closed",
")",
"the",
"wire",
... | def make_wire(pointslist, closed=False, placement=None, face=None, support=None, bs2wire=False):
"""makeWire(pointslist,[closed],[placement])
Creates a Wire object from the given list of vectors. If face is
true (and wire is closed), the wire will appear filled. Instead of
a pointslist, you can al... | [
"def",
"make_wire",
"(",
"pointslist",
",",
"closed",
"=",
"False",
",",
"placement",
"=",
"None",
",",
"face",
"=",
"None",
",",
"support",
"=",
"None",
",",
"bs2wire",
"=",
"False",
")",
":",
"if",
"not",
"App",
".",
"ActiveDocument",
":",
"App",
"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftmake/make_wire.py#L40-L128 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py | python | TNavigator._rotate | (self, angle) | Turn turtle counterclockwise by specified angle if angle > 0. | Turn turtle counterclockwise by specified angle if angle > 0. | [
"Turn",
"turtle",
"counterclockwise",
"by",
"specified",
"angle",
"if",
"angle",
">",
"0",
"."
] | def _rotate(self, angle):
"""Turn turtle counterclockwise by specified angle if angle > 0."""
angle *= self._degreesPerAU
self._orient = self._orient.rotate(angle) | [
"def",
"_rotate",
"(",
"self",
",",
"angle",
")",
":",
"angle",
"*=",
"self",
".",
"_degreesPerAU",
"self",
".",
"_orient",
"=",
"self",
".",
"_orient",
".",
"rotate",
"(",
"angle",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L1607-L1610 | ||
lawy623/SVS | b7c7ae367c82a4797ff4a896a2ff304f02e7f724 | caffe/scripts/cpp_lint.py | python | CheckStyle | (filename, clean_lines, linenum, file_extension, nesting_state,
error) | Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,
tab usage, spaces inside code, etc.
Args:
filename: The name of the current file.
clean_line... | Checks rules from the 'C++ style rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"style",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
error):
"""Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
do what we can. In particular we check for 2-space indents, line lengths,... | [
"def",
"CheckStyle",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want ... | https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L3459-L3563 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Utils.py | python | nogc | (fun) | return f | Decorator: let a function disable the garbage collector during its execution.
It is used in the build context when storing/loading the build cache file (pickle)
:param fun: function to execute
:type fun: function
:return: the return value of the function executed | Decorator: let a function disable the garbage collector during its execution.
It is used in the build context when storing/loading the build cache file (pickle) | [
"Decorator",
":",
"let",
"a",
"function",
"disable",
"the",
"garbage",
"collector",
"during",
"its",
"execution",
".",
"It",
"is",
"used",
"in",
"the",
"build",
"context",
"when",
"storing",
"/",
"loading",
"the",
"build",
"cache",
"file",
"(",
"pickle",
"... | def nogc(fun):
"""
Decorator: let a function disable the garbage collector during its execution.
It is used in the build context when storing/loading the build cache file (pickle)
:param fun: function to execute
:type fun: function
:return: the return value of the function executed
"""
def f(*k, **kw):
try:
... | [
"def",
"nogc",
"(",
"fun",
")",
":",
"def",
"f",
"(",
"*",
"k",
",",
"*",
"*",
"kw",
")",
":",
"try",
":",
"gc",
".",
"disable",
"(",
")",
"ret",
"=",
"fun",
"(",
"*",
"k",
",",
"*",
"*",
"kw",
")",
"finally",
":",
"gc",
".",
"enable",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Utils.py#L678-L695 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Tools/ccroot.py | python | read_shlib | (self, name, paths=[], export_includes=[], export_defines=[]) | return self(name=name, features='fake_lib', lib_paths=paths, lib_type='shlib', export_includes=export_includes, export_defines=export_defines) | Read a system shared library, enabling its use as a local library. Will trigger a rebuild if the file changes::
def build(bld):
bld.read_shlib('m')
bld.program(source='main.c', use='m') | Read a system shared library, enabling its use as a local library. Will trigger a rebuild if the file changes:: | [
"Read",
"a",
"system",
"shared",
"library",
"enabling",
"its",
"use",
"as",
"a",
"local",
"library",
".",
"Will",
"trigger",
"a",
"rebuild",
"if",
"the",
"file",
"changes",
"::"
] | def read_shlib(self, name, paths=[], export_includes=[], export_defines=[]):
"""
Read a system shared library, enabling its use as a local library. Will trigger a rebuild if the file changes::
def build(bld):
bld.read_shlib('m')
bld.program(source='main.c', use='m')
"""
return self(name=name, features='fak... | [
"def",
"read_shlib",
"(",
"self",
",",
"name",
",",
"paths",
"=",
"[",
"]",
",",
"export_includes",
"=",
"[",
"]",
",",
"export_defines",
"=",
"[",
"]",
")",
":",
"return",
"self",
"(",
"name",
"=",
"name",
",",
"features",
"=",
"'fake_lib'",
",",
... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Tools/ccroot.py#L671-L679 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py | python | ParseResults.haskeys | ( self ) | return bool(self.__tokdict) | Since keys() returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names. | Since keys() returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names. | [
"Since",
"keys",
"()",
"returns",
"an",
"iterator",
"this",
"method",
"is",
"helpful",
"in",
"bypassing",
"code",
"that",
"looks",
"for",
"the",
"existence",
"of",
"any",
"defined",
"results",
"names",
"."
] | def haskeys( self ):
"""Since keys() returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names."""
return bool(self.__tokdict) | [
"def",
"haskeys",
"(",
"self",
")",
":",
"return",
"bool",
"(",
"self",
".",
"__tokdict",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py#L506-L509 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py | python | Distribution.load_entry_point | (self, group, name) | return ep.load() | Return the `name` entry point of `group` or raise ImportError | Return the `name` entry point of `group` or raise ImportError | [
"Return",
"the",
"name",
"entry",
"point",
"of",
"group",
"or",
"raise",
"ImportError"
] | def load_entry_point(self, group, name):
"""Return the `name` entry point of `group` or raise ImportError"""
ep = self.get_entry_info(group, name)
if ep is None:
raise ImportError("Entry point %r not found" % ((group, name),))
return ep.load() | [
"def",
"load_entry_point",
"(",
"self",
",",
"group",
",",
"name",
")",
":",
"ep",
"=",
"self",
".",
"get_entry_info",
"(",
"group",
",",
"name",
")",
"if",
"ep",
"is",
"None",
":",
"raise",
"ImportError",
"(",
"\"Entry point %r not found\"",
"%",
"(",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L2655-L2660 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillExportModel.py | python | DrillExportModel._onTaskError | (self, name, msg) | Triggered when the export failed.
Args:
name (str): the task name
msg (str): error msg | Triggered when the export failed. | [
"Triggered",
"when",
"the",
"export",
"failed",
"."
] | def _onTaskError(self, name, msg):
"""
Triggered when the export failed.
Args:
name (str): the task name
msg (str): error msg
"""
name = name.split(':')
wsName = name[0]
filename = name[1]
logger.error("Error while exporting works... | [
"def",
"_onTaskError",
"(",
"self",
",",
"name",
",",
"msg",
")",
":",
"name",
"=",
"name",
".",
"split",
"(",
"':'",
")",
"wsName",
"=",
"name",
"[",
"0",
"]",
"filename",
"=",
"name",
"[",
"1",
"]",
"logger",
".",
"error",
"(",
"\"Error while exp... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillExportModel.py#L182-L201 | ||
triton-inference-server/server | 11a11d9cb1e9734ed9fd305e752da70f07d1992f | qa/common/gen_tag_sigdef.py | python | create_savedmodel | (models_dir,
model_version=1,
dims=16,
model_name="sig_tag",
tag_name="testTag",
signature_def_name="testSigDef") | Creates 4 SavedModels that have different combinations of model_name and tag_name.
The models multiplies the input tensor by a multiplier and the multiplier value is different for each model.
Naming convention and config used:
<model_name>0: tag: "serve", signature_def: "serving_default", multiplier 1... | Creates 4 SavedModels that have different combinations of model_name and tag_name.
The models multiplies the input tensor by a multiplier and the multiplier value is different for each model.
Naming convention and config used:
<model_name>0: tag: "serve", signature_def: "serving_default", multiplier 1... | [
"Creates",
"4",
"SavedModels",
"that",
"have",
"different",
"combinations",
"of",
"model_name",
"and",
"tag_name",
".",
"The",
"models",
"multiplies",
"the",
"input",
"tensor",
"by",
"a",
"multiplier",
"and",
"the",
"multiplier",
"value",
"is",
"different",
"for... | def create_savedmodel(models_dir,
model_version=1,
dims=16,
model_name="sig_tag",
tag_name="testTag",
signature_def_name="testSigDef"):
"""
Creates 4 SavedModels that have different combinations of mode... | [
"def",
"create_savedmodel",
"(",
"models_dir",
",",
"model_version",
"=",
"1",
",",
"dims",
"=",
"16",
",",
"model_name",
"=",
"\"sig_tag\"",
",",
"tag_name",
"=",
"\"testTag\"",
",",
"signature_def_name",
"=",
"\"testSigDef\"",
")",
":",
"model_version_dir",
"=... | https://github.com/triton-inference-server/server/blob/11a11d9cb1e9734ed9fd305e752da70f07d1992f/qa/common/gen_tag_sigdef.py#L43-L144 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/data/experimental/ops/error_ops.py | python | ignore_errors | (log_warning=False) | return _apply_fn | Creates a `Dataset` from another `Dataset` and silently ignores any errors.
Use this transformation to produce a dataset that contains the same elements
as the input, but silently drops any elements that caused an error. For
example:
```python
dataset = tf.data.Dataset.from_tensor_slices([1., 2., 0., 4.])
... | Creates a `Dataset` from another `Dataset` and silently ignores any errors. | [
"Creates",
"a",
"Dataset",
"from",
"another",
"Dataset",
"and",
"silently",
"ignores",
"any",
"errors",
"."
] | def ignore_errors(log_warning=False):
"""Creates a `Dataset` from another `Dataset` and silently ignores any errors.
Use this transformation to produce a dataset that contains the same elements
as the input, but silently drops any elements that caused an error. For
example:
```python
dataset = tf.data.Dat... | [
"def",
"ignore_errors",
"(",
"log_warning",
"=",
"False",
")",
":",
"def",
"_apply_fn",
"(",
"dataset",
")",
":",
"return",
"_IgnoreErrorsDataset",
"(",
"dataset",
",",
"log_warning",
")",
"return",
"_apply_fn"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/experimental/ops/error_ops.py#L22-L52 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rfc822.py | python | parsedate_tz | (data) | return (yy, mm, dd, thh, tmm, tss, 0, 1, 0, tzoffset) | Convert a date string to a time tuple.
Accounts for military timezones. | Convert a date string to a time tuple. | [
"Convert",
"a",
"date",
"string",
"to",
"a",
"time",
"tuple",
"."
] | def parsedate_tz(data):
"""Convert a date string to a time tuple.
Accounts for military timezones.
"""
if not data:
return None
data = data.split()
if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
# There's a dayname here. Skip it
del data[0]
else:
... | [
"def",
"parsedate_tz",
"(",
"data",
")",
":",
"if",
"not",
"data",
":",
"return",
"None",
"data",
"=",
"data",
".",
"split",
"(",
")",
"if",
"data",
"[",
"0",
"]",
"[",
"-",
"1",
"]",
"in",
"(",
"','",
",",
"'.'",
")",
"or",
"data",
"[",
"0",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rfc822.py#L850-L932 | |
gwaldron/osgearth | 4c521857d59a69743e4a9cedba00afe570f984e8 | src/third_party/tinygltf/deps/cpplint.py | python | _BlockInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to... | Run checks that applies to text after the closing brace. | [
"Run",
"checks",
"that",
"applies",
"to",
"text",
"after",
"the",
"closing",
"brace",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
line... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"pass"
] | https://github.com/gwaldron/osgearth/blob/4c521857d59a69743e4a9cedba00afe570f984e8/src/third_party/tinygltf/deps/cpplint.py#L2021-L2032 | ||
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/clang/cindex.py | python | Cursor.lexical_parent | (self) | return self._lexical_parent | Return the lexical parent for this cursor. | Return the lexical parent for this cursor. | [
"Return",
"the",
"lexical",
"parent",
"for",
"this",
"cursor",
"."
] | def lexical_parent(self):
"""Return the lexical parent for this cursor."""
if not hasattr(self, '_lexical_parent'):
self._lexical_parent = conf.lib.clang_getCursorLexicalParent(self)
return self._lexical_parent | [
"def",
"lexical_parent",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_lexical_parent'",
")",
":",
"self",
".",
"_lexical_parent",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorLexicalParent",
"(",
"self",
")",
"return",
"self",
".",
... | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/clang/cindex.py#L1408-L1413 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py | python | BaseMode.forward_char | (self, e) | Move forward a character. | Move forward a character. | [
"Move",
"forward",
"a",
"character",
"."
] | def forward_char(self, e): # (C-f)
'''Move forward a character. '''
self.l_buffer.forward_char(self.argument_reset) | [
"def",
"forward_char",
"(",
"self",
",",
"e",
")",
":",
"# (C-f)",
"self",
".",
"l_buffer",
".",
"forward_char",
"(",
"self",
".",
"argument_reset",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/basemode.py#L245-L247 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/preprocessing/_data.py | python | Binarizer.transform | (self, X, copy=None) | return binarize(X, threshold=self.threshold, copy=copy) | Binarize each element of X
Parameters
----------
X : {array-like, sparse matrix}, shape [n_samples, n_features]
The data to binarize, element by element.
scipy.sparse matrices should be in CSR format to avoid an
un-necessary copy.
copy : bool
... | Binarize each element of X | [
"Binarize",
"each",
"element",
"of",
"X"
] | def transform(self, X, copy=None):
"""Binarize each element of X
Parameters
----------
X : {array-like, sparse matrix}, shape [n_samples, n_features]
The data to binarize, element by element.
scipy.sparse matrices should be in CSR format to avoid an
u... | [
"def",
"transform",
"(",
"self",
",",
"X",
",",
"copy",
"=",
"None",
")",
":",
"copy",
"=",
"copy",
"if",
"copy",
"is",
"not",
"None",
"else",
"self",
".",
"copy",
"return",
"binarize",
"(",
"X",
",",
"threshold",
"=",
"self",
".",
"threshold",
","... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/preprocessing/_data.py#L1951-L1965 | |
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/clang/cindex.py | python | Cursor.hash | (self) | return self._hash | Returns a hash of the cursor as an int. | Returns a hash of the cursor as an int. | [
"Returns",
"a",
"hash",
"of",
"the",
"cursor",
"as",
"an",
"int",
"."
] | def hash(self):
"""Returns a hash of the cursor as an int."""
if not hasattr(self, '_hash'):
self._hash = conf.lib.clang_hashCursor(self)
return self._hash | [
"def",
"hash",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_hash'",
")",
":",
"self",
".",
"_hash",
"=",
"conf",
".",
"lib",
".",
"clang_hashCursor",
"(",
"self",
")",
"return",
"self",
".",
"_hash"
] | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/clang/cindex.py#L1392-L1397 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/metrics/histograms/update_extension_functions.py | python | ReadHistogramValues | (filename) | return result | Returns a list of pairs (label, value) corresponding to HistogramValue.
Reads the extension_functions_histogram_value.h file, locates the
HistogramValue enum definition and returns a pair for each entry. | Returns a list of pairs (label, value) corresponding to HistogramValue. | [
"Returns",
"a",
"list",
"of",
"pairs",
"(",
"label",
"value",
")",
"corresponding",
"to",
"HistogramValue",
"."
] | def ReadHistogramValues(filename):
"""Returns a list of pairs (label, value) corresponding to HistogramValue.
Reads the extension_functions_histogram_value.h file, locates the
HistogramValue enum definition and returns a pair for each entry.
"""
# Read the file as a list of lines
with open(filename) as f:... | [
"def",
"ReadHistogramValues",
"(",
"filename",
")",
":",
"# Read the file as a list of lines",
"with",
"open",
"(",
"filename",
")",
"as",
"f",
":",
"content",
"=",
"f",
".",
"readlines",
"(",
")",
"# Locate the enum definition and collect all entries in it",
"inside_en... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/metrics/histograms/update_extension_functions.py#L45-L75 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | announcefetch.py | python | AnnounceDataFetcher.__runFetchLoop | (self) | All this code runs in a separate thread (your app will freeze if
you don't call this with the async=True argument). It will
periodically check for new announce data, and update members that
are visible to other threads.
By default, it will check once per hour. If you call
self.f... | All this code runs in a separate thread (your app will freeze if
you don't call this with the async=True argument). It will
periodically check for new announce data, and update members that
are visible to other threads. | [
"All",
"this",
"code",
"runs",
"in",
"a",
"separate",
"thread",
"(",
"your",
"app",
"will",
"freeze",
"if",
"you",
"don",
"t",
"call",
"this",
"with",
"the",
"async",
"=",
"True",
"argument",
")",
".",
"It",
"will",
"periodically",
"check",
"for",
"new... | def __runFetchLoop(self):
"""
All this code runs in a separate thread (your app will freeze if
you don't call this with the async=True argument). It will
periodically check for new announce data, and update members that
are visible to other threads.
By default, it will check once... | [
"def",
"__runFetchLoop",
"(",
"self",
")",
":",
"while",
"True",
":",
"try",
":",
"if",
"self",
".",
"isDisabled",
"(",
")",
"or",
"self",
".",
"shutdownFlag",
".",
"isSet",
"(",
")",
":",
"self",
".",
"shutdownFlag",
".",
"clear",
"(",
")",
"break",... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/announcefetch.py#L362-L402 | ||
networkit/networkit | 695b7a786a894a303fa8587597d5ef916e797729 | networkit/stopwatch.py | python | Timer.start_time | (self) | return self.__start | The time at which the Timer instance was created. | The time at which the Timer instance was created. | [
"The",
"time",
"at",
"which",
"the",
"Timer",
"instance",
"was",
"created",
"."
] | def start_time(self):
"""The time at which the Timer instance was created.
"""
return self.__start | [
"def",
"start_time",
"(",
"self",
")",
":",
"return",
"self",
".",
"__start"
] | https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/networkit/stopwatch.py#L59-L62 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | TextUrlEvent.GetURLEnd | (*args, **kwargs) | return _controls_.TextUrlEvent_GetURLEnd(*args, **kwargs) | GetURLEnd(self) -> long | GetURLEnd(self) -> long | [
"GetURLEnd",
"(",
"self",
")",
"-",
">",
"long"
] | def GetURLEnd(*args, **kwargs):
"""GetURLEnd(self) -> long"""
return _controls_.TextUrlEvent_GetURLEnd(*args, **kwargs) | [
"def",
"GetURLEnd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextUrlEvent_GetURLEnd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2116-L2118 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/stringold.py | python | lstrip | (s) | return s.lstrip() | lstrip(s) -> string
Return a copy of the string s with leading whitespace removed. | lstrip(s) -> string | [
"lstrip",
"(",
"s",
")",
"-",
">",
"string"
] | def lstrip(s):
"""lstrip(s) -> string
Return a copy of the string s with leading whitespace removed.
"""
return s.lstrip() | [
"def",
"lstrip",
"(",
"s",
")",
":",
"return",
"s",
".",
"lstrip",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/stringold.py#L84-L90 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/metrics_impl.py | python | precision_at_k | (labels,
predictions,
k,
class_id=None,
weights=None,
metrics_collections=None,
updates_collections=None,
name=None) | Computes precision@k of the predictions with respect to sparse labels.
If `class_id` is specified, we calculate precision by considering only the
entries in the batch for which `class_id` is in the top-k highest
`predictions`, and computing the fraction of them for which `class_id` is
indeed a corr... | Computes precision@k of the predictions with respect to sparse labels. | [
"Computes",
"precision@k",
"of",
"the",
"predictions",
"with",
"respect",
"to",
"sparse",
"labels",
"."
] | def precision_at_k(labels,
predictions,
k,
class_id=None,
weights=None,
metrics_collections=None,
updates_collections=None,
name=None):
"""Computes precision@k of the predictions with r... | [
"def",
"precision_at_k",
"(",
"labels",
",",
"predictions",
",",
"k",
",",
"class_id",
"=",
"None",
",",
"weights",
"=",
"None",
",",
"metrics_collections",
"=",
"None",
",",
"updates_collections",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/metrics_impl.py#L3529-L3619 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextParagraph.GetLines | (*args, **kwargs) | return _richtext.RichTextParagraph_GetLines(*args, **kwargs) | GetLines(self) -> wxRichTextLineList | GetLines(self) -> wxRichTextLineList | [
"GetLines",
"(",
"self",
")",
"-",
">",
"wxRichTextLineList"
] | def GetLines(*args, **kwargs):
"""GetLines(self) -> wxRichTextLineList"""
return _richtext.RichTextParagraph_GetLines(*args, **kwargs) | [
"def",
"GetLines",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraph_GetLines",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1983-L1985 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/stata.py | python | StataValueLabel._encode | (self, s) | return s.encode(self._encoding) | Python 3 compatibility shim | Python 3 compatibility shim | [
"Python",
"3",
"compatibility",
"shim"
] | def _encode(self, s):
"""
Python 3 compatibility shim
"""
return s.encode(self._encoding) | [
"def",
"_encode",
"(",
"self",
",",
"s",
")",
":",
"return",
"s",
".",
"encode",
"(",
"self",
".",
"_encoding",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/stata.py#L655-L659 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/resolve.py | python | Resolver.get_installation_order | (self, req_set) | return order | Create the installation order.
The installation order is topological - requirements are installed
before the requiring thing. We break cycles at an arbitrary point,
and make no other guarantees. | Create the installation order. | [
"Create",
"the",
"installation",
"order",
"."
] | def get_installation_order(self, req_set):
# type: (RequirementSet) -> List[InstallRequirement]
"""Create the installation order.
The installation order is topological - requirements are installed
before the requiring thing. We break cycles at an arbitrary point,
and make no oth... | [
"def",
"get_installation_order",
"(",
"self",
",",
"req_set",
")",
":",
"# type: (RequirementSet) -> List[InstallRequirement]",
"# The current implementation, which we may change at any point",
"# installs the user specified things in the order given, except when",
"# dependencies must come ea... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/resolve.py#L367-L393 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | RegisterId | (*args, **kwargs) | return _misc_.RegisterId(*args, **kwargs) | RegisterId(long id) | RegisterId(long id) | [
"RegisterId",
"(",
"long",
"id",
")"
] | def RegisterId(*args, **kwargs):
"""RegisterId(long id)"""
return _misc_.RegisterId(*args, **kwargs) | [
"def",
"RegisterId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"RegisterId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L286-L288 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/scimath.py | python | arcsin | (x) | return nx.arcsin(x) | Compute the inverse sine of x.
Return the "principal value" (for a description of this, see
`numpy.arcsin`) of the inverse sine of `x`. For real `x` such that
`abs(x) <= 1`, this is a real number in the closed interval
:math:`[-\\pi/2, \\pi/2]`. Otherwise, the complex principle value is
returned.
... | Compute the inverse sine of x. | [
"Compute",
"the",
"inverse",
"sine",
"of",
"x",
"."
] | def arcsin(x):
"""
Compute the inverse sine of x.
Return the "principal value" (for a description of this, see
`numpy.arcsin`) of the inverse sine of `x`. For real `x` such that
`abs(x) <= 1`, this is a real number in the closed interval
:math:`[-\\pi/2, \\pi/2]`. Otherwise, the complex princi... | [
"def",
"arcsin",
"(",
"x",
")",
":",
"x",
"=",
"_fix_real_abs_gt_1",
"(",
"x",
")",
"return",
"nx",
".",
"arcsin",
"(",
"x",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/scimath.py#L510-L552 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_scale.py | python | Scale.Activated | (self) | Execute when the command is called. | Execute when the command is called. | [
"Execute",
"when",
"the",
"command",
"is",
"called",
"."
] | def Activated(self):
"""Execute when the command is called."""
super(Scale, self).Activated(name="Scale")
if not self.ui:
return
self.ghosts = []
self.get_object_selection() | [
"def",
"Activated",
"(",
"self",
")",
":",
"super",
"(",
"Scale",
",",
"self",
")",
".",
"Activated",
"(",
"name",
"=",
"\"Scale\"",
")",
"if",
"not",
"self",
".",
"ui",
":",
"return",
"self",
".",
"ghosts",
"=",
"[",
"]",
"self",
".",
"get_object_... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_scale.py#L74-L80 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | models/AI-Model-Zoo/caffe-xilinx/tools/extra/parse_log.py | python | parse_line_for_net_output | (regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate) | return row_dict_list, row | Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row_dict_list: may be either the current row_dict_list or an augmented
version of the current row_dict_list | Parse a single line for training or test output | [
"Parse",
"a",
"single",
"line",
"for",
"training",
"or",
"test",
"output"
] | def parse_line_for_net_output(regex_obj, row, row_dict_list,
line, iteration, seconds, learning_rate):
"""Parse a single line for training or test output
Returns a a tuple with (row_dict_list, row)
row: may be either a new row or an augmented version of the current row
row... | [
"def",
"parse_line_for_net_output",
"(",
"regex_obj",
",",
"row",
",",
"row_dict_list",
",",
"line",
",",
"iteration",
",",
"seconds",
",",
"learning_rate",
")",
":",
"output_match",
"=",
"regex_obj",
".",
"search",
"(",
"line",
")",
"if",
"output_match",
":",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/tools/extra/parse_log.py#L77-L116 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Runner.py | python | TaskConsumer.__init__ | (self) | Obtain :py:class:`waflib.Task.TaskBase` instances from this queue. | Obtain :py:class:`waflib.Task.TaskBase` instances from this queue. | [
"Obtain",
":",
"py",
":",
"class",
":",
"waflib",
".",
"Task",
".",
"TaskBase",
"instances",
"from",
"this",
"queue",
"."
] | def __init__(self):
Utils.threading.Thread.__init__(self)
self.ready = Queue()
"""
Obtain :py:class:`waflib.Task.TaskBase` instances from this queue.
"""
self.setDaemon(1)
self.start() | [
"def",
"__init__",
"(",
"self",
")",
":",
"Utils",
".",
"threading",
".",
"Thread",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"ready",
"=",
"Queue",
"(",
")",
"self",
".",
"setDaemon",
"(",
"1",
")",
"self",
".",
"start",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Runner.py#L27-L34 | ||
SpaceNetChallenge/BuildingDetectors | 3def3c44b5847c744cd2f3356182892d92496579 | qinhaifang/src/lib/caffeWrapper/SolverWrapper.py | python | SolverWrapper.snapshot | (self) | Take a snapshot of the network after unnormalizing the learned
bounding-box regression weights. This enables easy use at test-time. | Take a snapshot of the network after unnormalizing the learned
bounding-box regression weights. This enables easy use at test-time. | [
"Take",
"a",
"snapshot",
"of",
"the",
"network",
"after",
"unnormalizing",
"the",
"learned",
"bounding",
"-",
"box",
"regression",
"weights",
".",
"This",
"enables",
"easy",
"use",
"at",
"test",
"-",
"time",
"."
] | def snapshot(self):
""" Take a snapshot of the network after unnormalizing the learned
bounding-box regression weights. This enables easy use at test-time.
"""
net = self.solver.net
# I'm wondering whether I still need to keep it if only faster-RCNN is needed
scale_bb... | [
"def",
"snapshot",
"(",
"self",
")",
":",
"net",
"=",
"self",
".",
"solver",
".",
"net",
"# I'm wondering whether I still need to keep it if only faster-RCNN is needed",
"scale_bbox_params",
"=",
"(",
"cfg",
".",
"TRAIN",
".",
"BBOX_REG",
"and",
"cfg",
".",
"TRAIN",... | https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/lib/caffeWrapper/SolverWrapper.py#L70-L124 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | SpinCtrl.SetValue | (*args, **kwargs) | return _controls_.SpinCtrl_SetValue(*args, **kwargs) | SetValue(self, int value) | SetValue(self, int value) | [
"SetValue",
"(",
"self",
"int",
"value",
")"
] | def SetValue(*args, **kwargs):
"""SetValue(self, int value)"""
return _controls_.SpinCtrl_SetValue(*args, **kwargs) | [
"def",
"SetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"SpinCtrl_SetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2368-L2370 | |
nileshkulkarni/csm | 0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc | csm/preprocess/pascal/p3d_uv_to_vertex_id_image.py | python | triangle_direction_intersection | (tri, trg) | Finds where an origin-centered ray going in direction trg intersects a triangle.
Args:
tri: 3 X 3 vertex locations. tri[0, :] is 0th vertex.
Returns:
alpha, beta, gamma | Finds where an origin-centered ray going in direction trg intersects a triangle.
Args:
tri: 3 X 3 vertex locations. tri[0, :] is 0th vertex.
Returns:
alpha, beta, gamma | [
"Finds",
"where",
"an",
"origin",
"-",
"centered",
"ray",
"going",
"in",
"direction",
"trg",
"intersects",
"a",
"triangle",
".",
"Args",
":",
"tri",
":",
"3",
"X",
"3",
"vertex",
"locations",
".",
"tri",
"[",
"0",
":",
"]",
"is",
"0th",
"vertex",
"."... | def triangle_direction_intersection(tri, trg):
'''
Finds where an origin-centered ray going in direction trg intersects a triangle.
Args:
tri: 3 X 3 vertex locations. tri[0, :] is 0th vertex.
Returns:
alpha, beta, gamma
'''
p0 = np.copy(tri[0, :])
# Don't normalize
d1 = n... | [
"def",
"triangle_direction_intersection",
"(",
"tri",
",",
"trg",
")",
":",
"p0",
"=",
"np",
".",
"copy",
"(",
"tri",
"[",
"0",
",",
":",
"]",
")",
"# Don't normalize",
"d1",
"=",
"np",
".",
"copy",
"(",
"tri",
"[",
"1",
",",
":",
"]",
")",
"-",
... | https://github.com/nileshkulkarni/csm/blob/0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc/csm/preprocess/pascal/p3d_uv_to_vertex_id_image.py#L21-L49 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlWindow.SetPage | (*args, **kwargs) | return _html.HtmlWindow_SetPage(*args, **kwargs) | SetPage(self, String source) -> bool | SetPage(self, String source) -> bool | [
"SetPage",
"(",
"self",
"String",
"source",
")",
"-",
">",
"bool"
] | def SetPage(*args, **kwargs):
"""SetPage(self, String source) -> bool"""
return _html.HtmlWindow_SetPage(*args, **kwargs) | [
"def",
"SetPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWindow_SetPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L986-L988 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite_e.py | python | hermeint | (c, m=1, k=[], lbnd=0, scl=1, axis=0) | return c | Integrate a Hermite_e series.
Returns the Hermite_e series coefficients `c` integrated `m` times from
`lbnd` along `axis`. At each iteration the resulting series is
**multiplied** by `scl` and an integration constant, `k`, is added.
The scaling factor is for use in a linear change of variable. ("Buyer... | Integrate a Hermite_e series. | [
"Integrate",
"a",
"Hermite_e",
"series",
"."
] | def hermeint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
"""
Integrate a Hermite_e series.
Returns the Hermite_e series coefficients `c` integrated `m` times from
`lbnd` along `axis`. At each iteration the resulting series is
**multiplied** by `scl` and an integration constant, `k`, is added.
The sca... | [
"def",
"hermeint",
"(",
"c",
",",
"m",
"=",
"1",
",",
"k",
"=",
"[",
"]",
",",
"lbnd",
"=",
"0",
",",
"scl",
"=",
"1",
",",
"axis",
"=",
"0",
")",
":",
"c",
"=",
"np",
".",
"array",
"(",
"c",
",",
"ndmin",
"=",
"1",
",",
"copy",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite_e.py#L653-L772 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/roslib/src/roslib/gentools.py | python | compute_md5_v1 | (get_deps_dict) | return _compute_hash_v1(get_deps_dict, hashlib.md5()) | Compute original V1 md5 hash for message/service. This was replaced with V2 in ROS 0.6.
@param get_deps_dict: dictionary returned by get_dependencies call
@type get_deps_dict: dict
@return: md5 hash
@rtype: str | Compute original V1 md5 hash for message/service. This was replaced with V2 in ROS 0.6. | [
"Compute",
"original",
"V1",
"md5",
"hash",
"for",
"message",
"/",
"service",
".",
"This",
"was",
"replaced",
"with",
"V2",
"in",
"ROS",
"0",
".",
"6",
"."
] | def compute_md5_v1(get_deps_dict):
"""
Compute original V1 md5 hash for message/service. This was replaced with V2 in ROS 0.6.
@param get_deps_dict: dictionary returned by get_dependencies call
@type get_deps_dict: dict
@return: md5 hash
@rtype: str
"""
import hashlib
return _comput... | [
"def",
"compute_md5_v1",
"(",
"get_deps_dict",
")",
":",
"import",
"hashlib",
"return",
"_compute_hash_v1",
"(",
"get_deps_dict",
",",
"hashlib",
".",
"md5",
"(",
")",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/roslib/src/roslib/gentools.py#L200-L209 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/flatnotebook.py | python | FlatNotebook.SetPageShapeAngle | (self, page_index, angle) | Sets the angle associated to a tab. | Sets the angle associated to a tab. | [
"Sets",
"the",
"angle",
"associated",
"to",
"a",
"tab",
"."
] | def SetPageShapeAngle(self, page_index, angle):
""" Sets the angle associated to a tab. """
if page_index < 0 or page_index >= len(self._pages._pagesInfoVec):
return
if angle > 15:
return
self._pages._pagesInfoVec[page_index].SetTabAngle(angle) | [
"def",
"SetPageShapeAngle",
"(",
"self",
",",
"page_index",
",",
"angle",
")",
":",
"if",
"page_index",
"<",
"0",
"or",
"page_index",
">=",
"len",
"(",
"self",
".",
"_pages",
".",
"_pagesInfoVec",
")",
":",
"return",
"if",
"angle",
">",
"15",
":",
"ret... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L3495-L3504 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Point.Set | (*args, **kwargs) | return _core_.Point_Set(*args, **kwargs) | Set(self, long x, long y)
Set both the x and y properties | Set(self, long x, long y) | [
"Set",
"(",
"self",
"long",
"x",
"long",
"y",
")"
] | def Set(*args, **kwargs):
"""
Set(self, long x, long y)
Set both the x and y properties
"""
return _core_.Point_Set(*args, **kwargs) | [
"def",
"Set",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Point_Set",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1219-L1225 | |
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Modules/Scripted/DICOMPlugins/DICOMScalarVolumePlugin.py | python | DICOMScalarVolumePluginClass.compareVolumeNodes | (volumeNode1,volumeNode2) | return comparison | Given two mrml volume nodes, return true of the numpy arrays have identical data
and other metadata matches. Returns empty string on match, otherwise
a string with a list of differences separated by newlines. | Given two mrml volume nodes, return true of the numpy arrays have identical data
and other metadata matches. Returns empty string on match, otherwise
a string with a list of differences separated by newlines. | [
"Given",
"two",
"mrml",
"volume",
"nodes",
"return",
"true",
"of",
"the",
"numpy",
"arrays",
"have",
"identical",
"data",
"and",
"other",
"metadata",
"matches",
".",
"Returns",
"empty",
"string",
"on",
"match",
"otherwise",
"a",
"string",
"with",
"a",
"list"... | def compareVolumeNodes(volumeNode1,volumeNode2):
"""
Given two mrml volume nodes, return true of the numpy arrays have identical data
and other metadata matches. Returns empty string on match, otherwise
a string with a list of differences separated by newlines.
"""
volumesLogic = slicer.modules... | [
"def",
"compareVolumeNodes",
"(",
"volumeNode1",
",",
"volumeNode2",
")",
":",
"volumesLogic",
"=",
"slicer",
".",
"modules",
".",
"volumes",
".",
"logic",
"(",
")",
"comparison",
"=",
"\"\"",
"comparison",
"+=",
"volumesLogic",
".",
"CompareVolumeGeometry",
"("... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/DICOMPlugins/DICOMScalarVolumePlugin.py#L106-L123 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/png/png.py | python | read_pam_header | (infile) | return 'P7', width, height, depth, maxval | Read (the rest of a) PAM header. `infile` should be positioned
immediately after the initial 'P7' line (at the beginning of the
second line). Returns are as for `read_pnm_header`. | Read (the rest of a) PAM header. `infile` should be positioned
immediately after the initial 'P7' line (at the beginning of the
second line). Returns are as for `read_pnm_header`. | [
"Read",
"(",
"the",
"rest",
"of",
"a",
")",
"PAM",
"header",
".",
"infile",
"should",
"be",
"positioned",
"immediately",
"after",
"the",
"initial",
"P7",
"line",
"(",
"at",
"the",
"beginning",
"of",
"the",
"second",
"line",
")",
".",
"Returns",
"are",
... | def read_pam_header(infile):
"""
Read (the rest of a) PAM header. `infile` should be positioned
immediately after the initial 'P7' line (at the beginning of the
second line). Returns are as for `read_pnm_header`.
"""
# Unlike PBM, PGM, and PPM, we can read the header a line at a time.
... | [
"def",
"read_pam_header",
"(",
"infile",
")",
":",
"# Unlike PBM, PGM, and PPM, we can read the header a line at a time.",
"header",
"=",
"dict",
"(",
")",
"while",
"True",
":",
"l",
"=",
"infile",
".",
"readline",
"(",
")",
".",
"strip",
"(",
")",
"if",
"l",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/png/png.py#L3557-L3596 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/gather/interface.py | python | GathererBase.Parse | (self) | Reads and parses the contents of what is being gathered. | Reads and parses the contents of what is being gathered. | [
"Reads",
"and",
"parses",
"the",
"contents",
"of",
"what",
"is",
"being",
"gathered",
"."
] | def Parse(self):
'''Reads and parses the contents of what is being gathered.'''
raise NotImplementedError() | [
"def",
"Parse",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/gather/interface.py#L81-L83 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/utils/lui/lldbutil.py | python | get_caller_symbol | (thread) | Returns the symbol name for the call site of the leaf function. | Returns the symbol name for the call site of the leaf function. | [
"Returns",
"the",
"symbol",
"name",
"for",
"the",
"call",
"site",
"of",
"the",
"leaf",
"function",
"."
] | def get_caller_symbol(thread):
"""
Returns the symbol name for the call site of the leaf function.
"""
depth = thread.GetNumFrames()
if depth <= 1:
return None
caller = thread.GetFrameAtIndex(1).GetSymbol()
if caller:
return caller.GetName()
else:
return None | [
"def",
"get_caller_symbol",
"(",
"thread",
")",
":",
"depth",
"=",
"thread",
".",
"GetNumFrames",
"(",
")",
"if",
"depth",
"<=",
"1",
":",
"return",
"None",
"caller",
"=",
"thread",
".",
"GetFrameAtIndex",
"(",
"1",
")",
".",
"GetSymbol",
"(",
")",
"if... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/utils/lui/lldbutil.py#L690-L701 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/servermanager.py | python | _createInitialize | (group, name) | return aInitialize | Internal method to create an Initialize() method for the sub-classes
of Proxy | Internal method to create an Initialize() method for the sub-classes
of Proxy | [
"Internal",
"method",
"to",
"create",
"an",
"Initialize",
"()",
"method",
"for",
"the",
"sub",
"-",
"classes",
"of",
"Proxy"
] | def _createInitialize(group, name):
"""Internal method to create an Initialize() method for the sub-classes
of Proxy"""
pgroup = group
pname = name
def aInitialize(self, connection=None, update=True):
if not connection:
connection = ActiveConnection
if not connection:
... | [
"def",
"_createInitialize",
"(",
"group",
",",
"name",
")",
":",
"pgroup",
"=",
"group",
"pname",
"=",
"name",
"def",
"aInitialize",
"(",
"self",
",",
"connection",
"=",
"None",
",",
"update",
"=",
"True",
")",
":",
"if",
"not",
"connection",
":",
"con... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/servermanager.py#L2581-L2596 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/floatspin.py | python | FixedPoint.set_precision | (self, precision=DEFAULT_PRECISION) | Change the precision carried by this :class:`FixedPoint` to `precision`.
:param `precision`: must be an int >= 0, and defaults to
``DEFAULT_PRECISION``.
:note: If `precision` is less than this :class:`FixedPoint`'s current precision,
information may be lost to rounding. | Change the precision carried by this :class:`FixedPoint` to `precision`. | [
"Change",
"the",
"precision",
"carried",
"by",
"this",
":",
"class",
":",
"FixedPoint",
"to",
"precision",
"."
] | def set_precision(self, precision=DEFAULT_PRECISION):
"""
Change the precision carried by this :class:`FixedPoint` to `precision`.
:param `precision`: must be an int >= 0, and defaults to
``DEFAULT_PRECISION``.
:note: If `precision` is less than this :class:`FixedPoint`'s curr... | [
"def",
"set_precision",
"(",
"self",
",",
"precision",
"=",
"DEFAULT_PRECISION",
")",
":",
"try",
":",
"p",
"=",
"int",
"(",
"precision",
")",
"except",
":",
"raise",
"TypeError",
"(",
"\"precision not convertable to int: \"",
"+",
"`precision`",
")",
"if",
"p... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/floatspin.py#L1417-L1440 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/code_coverage/coverage_posix.py | python | Coverage.GenerateLcovPosix | (self) | Convert profile data to lcov on Mac or Linux. | Convert profile data to lcov on Mac or Linux. | [
"Convert",
"profile",
"data",
"to",
"lcov",
"on",
"Mac",
"or",
"Linux",
"."
] | def GenerateLcovPosix(self):
"""Convert profile data to lcov on Mac or Linux."""
start_dir = os.getcwd()
logging.info('GenerateLcovPosix: start_dir=' + start_dir)
if self.IsLinux():
# With Linux/make (e.g. the coverage_run target), the current
# directory for this command is .../build/src/ch... | [
"def",
"GenerateLcovPosix",
"(",
"self",
")",
":",
"start_dir",
"=",
"os",
".",
"getcwd",
"(",
")",
"logging",
".",
"info",
"(",
"'GenerateLcovPosix: start_dir='",
"+",
"start_dir",
")",
"if",
"self",
".",
"IsLinux",
"(",
")",
":",
"# With Linux/make (e.g. the... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/code_coverage/coverage_posix.py#L781-L826 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/llvm/utils/lit/lit/LitConfig.py | python | LitConfig.maxIndividualTestTime | (self, value) | Interface for setting maximum time to spend executing
a single test | Interface for setting maximum time to spend executing
a single test | [
"Interface",
"for",
"setting",
"maximum",
"time",
"to",
"spend",
"executing",
"a",
"single",
"test"
] | def maxIndividualTestTime(self, value):
"""
Interface for setting maximum time to spend executing
a single test
"""
self._maxIndividualTestTime = value
if self.maxIndividualTestTime > 0:
# The current implementation needs psutil to set
# a ... | [
"def",
"maxIndividualTestTime",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_maxIndividualTestTime",
"=",
"value",
"if",
"self",
".",
"maxIndividualTestTime",
">",
"0",
":",
"# The current implementation needs psutil to set",
"# a timeout per test. Check it's availab... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/llvm/utils/lit/lit/LitConfig.py#L77-L95 | ||
yuxng/PoseCNN | 9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04 | lib/datasets/ycb.py | python | ycb.label_path_from_index | (self, index) | return label_path | Construct an metadata path from the image's "index" identifier. | Construct an metadata path from the image's "index" identifier. | [
"Construct",
"an",
"metadata",
"path",
"from",
"the",
"image",
"s",
"index",
"identifier",
"."
] | def label_path_from_index(self, index):
"""
Construct an metadata path from the image's "index" identifier.
"""
label_path = os.path.join(self._data_path, index + '-label' + self._image_ext)
assert os.path.exists(label_path), \
'Path does not exist: {}'.format(lab... | [
"def",
"label_path_from_index",
"(",
"self",
",",
"index",
")",
":",
"label_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_data_path",
",",
"index",
"+",
"'-label'",
"+",
"self",
".",
"_image_ext",
")",
"assert",
"os",
".",
"path",
"."... | https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/datasets/ycb.py#L87-L94 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/bayesian-methods/utils.py | python | copy_param | (exe, new_param=None) | return new_param | Create copy of parameters | Create copy of parameters | [
"Create",
"copy",
"of",
"parameters"
] | def copy_param(exe, new_param=None):
"""Create copy of parameters"""
if new_param is None:
new_param = {k: nd.empty(v.shape, ctx=mx.cpu()) for k, v in exe.arg_dict.items()}
for k, v in new_param.items():
exe.arg_dict[k].copyto(v)
return new_param | [
"def",
"copy_param",
"(",
"exe",
",",
"new_param",
"=",
"None",
")",
":",
"if",
"new_param",
"is",
"None",
":",
"new_param",
"=",
"{",
"k",
":",
"nd",
".",
"empty",
"(",
"v",
".",
"shape",
",",
"ctx",
"=",
"mx",
".",
"cpu",
"(",
")",
")",
"for"... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/bayesian-methods/utils.py#L69-L75 | |
eldar/deepcut-cnn | 928bf2f224fce132f6e4404b4c95fb017297a5e0 | python/caffe/io.py | python | datum_to_array | (datum) | Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label. | Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label. | [
"Converts",
"a",
"datum",
"to",
"an",
"array",
".",
"Note",
"that",
"the",
"label",
"is",
"not",
"returned",
"as",
"one",
"can",
"easily",
"get",
"it",
"by",
"calling",
"datum",
".",
"label",
"."
] | def datum_to_array(datum):
"""Converts a datum to an array. Note that the label is not returned,
as one can easily get it by calling datum.label.
"""
if len(datum.data):
return np.fromstring(datum.data, dtype=np.uint8).reshape(
datum.channels, datum.height, datum.width)
else:
... | [
"def",
"datum_to_array",
"(",
"datum",
")",
":",
"if",
"len",
"(",
"datum",
".",
"data",
")",
":",
"return",
"np",
".",
"fromstring",
"(",
"datum",
".",
"data",
",",
"dtype",
"=",
"np",
".",
"uint8",
")",
".",
"reshape",
"(",
"datum",
".",
"channel... | https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/python/caffe/io.py#L83-L92 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/pdbxfile.py | python | PDBxFile.writeModel | (topology, positions, file=sys.stdout, modelIndex=1, keepIds=False) | Write out a model to a PDBx/mmCIF file.
Parameters
----------
topology : Topology
The Topology defining the model to write
positions : list
The list of atomic positions to write
file : file=stdout
A file to write the model to
modelInde... | Write out a model to a PDBx/mmCIF file. | [
"Write",
"out",
"a",
"model",
"to",
"a",
"PDBx",
"/",
"mmCIF",
"file",
"."
] | def writeModel(topology, positions, file=sys.stdout, modelIndex=1, keepIds=False):
"""Write out a model to a PDBx/mmCIF file.
Parameters
----------
topology : Topology
The Topology defining the model to write
positions : list
The list of atomic positions ... | [
"def",
"writeModel",
"(",
"topology",
",",
"positions",
",",
"file",
"=",
"sys",
".",
"stdout",
",",
"modelIndex",
"=",
"1",
",",
"keepIds",
"=",
"False",
")",
":",
"if",
"len",
"(",
"list",
"(",
"topology",
".",
"atoms",
"(",
")",
")",
")",
"!=",
... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/pdbxfile.py#L383-L441 | ||
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | autooptions/__init__.py | python | AutoOption.summarize | (self, conf) | This function displays a result summary with the help text and
the result of the configuration. | This function displays a result summary with the help text and
the result of the configuration. | [
"This",
"function",
"displays",
"a",
"result",
"summary",
"with",
"the",
"help",
"text",
"and",
"the",
"result",
"of",
"the",
"configuration",
"."
] | def summarize(self, conf):
"""
This function displays a result summary with the help text and
the result of the configuration.
"""
if self.help:
if self.enable:
conf.msg(self.help, 'yes', color='GREEN')
else:
conf.msg(self.h... | [
"def",
"summarize",
"(",
"self",
",",
"conf",
")",
":",
"if",
"self",
".",
"help",
":",
"if",
"self",
".",
"enable",
":",
"conf",
".",
"msg",
"(",
"self",
".",
"help",
",",
"'yes'",
",",
"color",
"=",
"'GREEN'",
")",
"else",
":",
"conf",
".",
"... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/autooptions/__init__.py#L275-L284 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/cmd.py | python | Cmd.preloop | (self) | Hook method executed once when the cmdloop() method is called. | Hook method executed once when the cmdloop() method is called. | [
"Hook",
"method",
"executed",
"once",
"when",
"the",
"cmdloop",
"()",
"method",
"is",
"called",
"."
] | def preloop(self):
"""Hook method executed once when the cmdloop() method is called."""
pass | [
"def",
"preloop",
"(",
"self",
")",
":",
"pass"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/cmd.py#L161-L163 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/swagger_spec_validator/validator20.py | python | validate_defaults_in_parameters | (params_spec, deref) | Validates that default values for api parameters are
of the parameter type
:param params_spec: list of parameter objects (#/paths/<path>/<http_verb>/parameters)
:param deref: callable that dereferences $refs
:raises: :py:class:`swagger_spec_validator.SwaggerValidationError` | Validates that default values for api parameters are
of the parameter type | [
"Validates",
"that",
"default",
"values",
"for",
"api",
"parameters",
"are",
"of",
"the",
"parameter",
"type"
] | def validate_defaults_in_parameters(params_spec, deref):
"""
Validates that default values for api parameters are
of the parameter type
:param params_spec: list of parameter objects (#/paths/<path>/<http_verb>/parameters)
:param deref: callable that dereferences $refs
:raises: :py:class:`swagg... | [
"def",
"validate_defaults_in_parameters",
"(",
"params_spec",
",",
"deref",
")",
":",
"# Note: this functions is preserved to avoid public signature updates (it's not used internally)",
"for",
"param_spec",
"in",
"params_spec",
":",
"validate_default_in_parameter",
"(",
"param_spec",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/swagger_spec_validator/validator20.py#L250-L262 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | StdDialogButtonSizer.SetNegativeButton | (*args, **kwargs) | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | SetNegativeButton(self, wxButton button) | SetNegativeButton(self, wxButton button) | [
"SetNegativeButton",
"(",
"self",
"wxButton",
"button",
")"
] | def SetNegativeButton(*args, **kwargs):
"""SetNegativeButton(self, wxButton button)"""
return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | [
"def",
"SetNegativeButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"StdDialogButtonSizer_SetNegativeButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L15516-L15518 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/session_ops.py | python | TensorHandle.eval | (self) | return self._session.run(reader, feed_dict={holder: self._handle}) | Return the value of the tensor represented by this handle. | Return the value of the tensor represented by this handle. | [
"Return",
"the",
"value",
"of",
"the",
"tensor",
"represented",
"by",
"this",
"handle",
"."
] | def eval(self):
"""Return the value of the tensor represented by this handle."""
if not self._auto_gc_enabled:
raise TypeError("Persistent tensor %s may have already been deleted."
% self.handle)
holder, reader = _get_handle_reader(self._session.graph, self._handle,
... | [
"def",
"eval",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_auto_gc_enabled",
":",
"raise",
"TypeError",
"(",
"\"Persistent tensor %s may have already been deleted.\"",
"%",
"self",
".",
"handle",
")",
"holder",
",",
"reader",
"=",
"_get_handle_reader",
"(",... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/session_ops.py#L69-L76 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/layers/convolutional.py | python | separable_conv2d | (inputs,
filters,
kernel_size,
strides=(1, 1),
padding='valid',
data_format='channels_last',
dilation_rate=(1, 1),
depth_multiplier=1,
activation=None,
... | return layer.apply(inputs) | Functional interface for the depthwise separable 2D convolution layer.
This layer performs a depthwise convolution that acts separately on
channels, followed by a pointwise convolution that mixes channels.
If `use_bias` is True and a bias initializer is provided,
it adds a bias vector to the output.
It then ... | Functional interface for the depthwise separable 2D convolution layer. | [
"Functional",
"interface",
"for",
"the",
"depthwise",
"separable",
"2D",
"convolution",
"layer",
"."
] | def separable_conv2d(inputs,
filters,
kernel_size,
strides=(1, 1),
padding='valid',
data_format='channels_last',
dilation_rate=(1, 1),
depth_multiplier=1,
... | [
"def",
"separable_conv2d",
"(",
"inputs",
",",
"filters",
",",
"kernel_size",
",",
"strides",
"=",
"(",
"1",
",",
"1",
")",
",",
"padding",
"=",
"'valid'",
",",
"data_format",
"=",
"'channels_last'",
",",
"dilation_rate",
"=",
"(",
"1",
",",
"1",
")",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/layers/convolutional.py#L1038-L1160 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/tf_upgrade_v2.py | python | _contrib_layers_l1_regularizer_transformer | (
parent, node, full_name, name, logs) | return node | Replace slim l1 regularizer with Keras one.
This entails renaming the 'scale' arg to 'l' and dropping any
provided scope arg. | Replace slim l1 regularizer with Keras one. | [
"Replace",
"slim",
"l1",
"regularizer",
"with",
"Keras",
"one",
"."
] | def _contrib_layers_l1_regularizer_transformer(
parent, node, full_name, name, logs):
"""Replace slim l1 regularizer with Keras one.
This entails renaming the 'scale' arg to 'l' and dropping any
provided scope arg.
"""
# Check if we have a scale or scope keyword arg
scope_keyword = None
for keyword i... | [
"def",
"_contrib_layers_l1_regularizer_transformer",
"(",
"parent",
",",
"node",
",",
"full_name",
",",
"name",
",",
"logs",
")",
":",
"# Check if we have a scale or scope keyword arg",
"scope_keyword",
"=",
"None",
"for",
"keyword",
"in",
"node",
".",
"keywords",
":"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/tf_upgrade_v2.py#L2325-L2361 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/__init__.py | python | IMetadataProvider.get_metadata | (name) | The named metadata resource as a string | The named metadata resource as a string | [
"The",
"named",
"metadata",
"resource",
"as",
"a",
"string"
] | def get_metadata(name):
"""The named metadata resource as a string""" | [
"def",
"get_metadata",
"(",
"name",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/__init__.py#L496-L497 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | Joystick.GetManufacturerId | (*args, **kwargs) | return _misc_.Joystick_GetManufacturerId(*args, **kwargs) | GetManufacturerId(self) -> int | GetManufacturerId(self) -> int | [
"GetManufacturerId",
"(",
"self",
")",
"-",
">",
"int"
] | def GetManufacturerId(*args, **kwargs):
"""GetManufacturerId(self) -> int"""
return _misc_.Joystick_GetManufacturerId(*args, **kwargs) | [
"def",
"GetManufacturerId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Joystick_GetManufacturerId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2174-L2176 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/linalg/matfuncs.py | python | cosm | (A) | Compute the matrix cosine.
This routine uses expm to compute the matrix exponentials.
Parameters
----------
A : (N, N) array_like
Input array
Returns
-------
cosm : (N, N) ndarray
Matrix cosine of A
Examples
--------
>>> from scipy.linalg import expm, sinm, co... | Compute the matrix cosine. | [
"Compute",
"the",
"matrix",
"cosine",
"."
] | def cosm(A):
"""
Compute the matrix cosine.
This routine uses expm to compute the matrix exponentials.
Parameters
----------
A : (N, N) array_like
Input array
Returns
-------
cosm : (N, N) ndarray
Matrix cosine of A
Examples
--------
>>> from scipy.lin... | [
"def",
"cosm",
"(",
"A",
")",
":",
"A",
"=",
"_asarray_square",
"(",
"A",
")",
"if",
"np",
".",
"iscomplexobj",
"(",
"A",
")",
":",
"return",
"0.5",
"*",
"(",
"expm",
"(",
"1j",
"*",
"A",
")",
"+",
"expm",
"(",
"-",
"1j",
"*",
"A",
")",
")"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/matfuncs.py#L259-L295 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm.py | python | GMM.score | (self, x, batch_size=None) | return np.sum(self.evaluate(x=x, batch_size=batch_size)[GMM.SCORES]) | Predict total sum of distances to nearest clusters.
Args:
x: 2-D matrix or iterator.
batch_size: size to use for batching up x for querying the model.
Returns:
Total score. | Predict total sum of distances to nearest clusters. | [
"Predict",
"total",
"sum",
"of",
"distances",
"to",
"nearest",
"clusters",
"."
] | def score(self, x, batch_size=None):
"""Predict total sum of distances to nearest clusters.
Args:
x: 2-D matrix or iterator.
batch_size: size to use for batching up x for querying the model.
Returns:
Total score.
"""
return np.sum(self.evaluate(x=x, batch_size=batch_size)[GMM.SCO... | [
"def",
"score",
"(",
"self",
",",
"x",
",",
"batch_size",
"=",
"None",
")",
":",
"return",
"np",
".",
"sum",
"(",
"self",
".",
"evaluate",
"(",
"x",
"=",
"x",
",",
"batch_size",
"=",
"batch_size",
")",
"[",
"GMM",
".",
"SCORES",
"]",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm.py#L129-L139 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/rnn.py | python | _infer_state_dtype | (explicit_dtype, state) | Infer the dtype of an RNN state.
Args:
explicit_dtype: explicitly declared dtype or None.
state: RNN's hidden state. Must be a Tensor or a nested iterable containing
Tensors.
Returns:
dtype: inferred dtype of hidden state.
Raises:
ValueError: if `state` has heterogeneous dtypes or is empt... | Infer the dtype of an RNN state. | [
"Infer",
"the",
"dtype",
"of",
"an",
"RNN",
"state",
"."
] | def _infer_state_dtype(explicit_dtype, state):
"""Infer the dtype of an RNN state.
Args:
explicit_dtype: explicitly declared dtype or None.
state: RNN's hidden state. Must be a Tensor or a nested iterable containing
Tensors.
Returns:
dtype: inferred dtype of hidden state.
Raises:
ValueE... | [
"def",
"_infer_state_dtype",
"(",
"explicit_dtype",
",",
"state",
")",
":",
"if",
"explicit_dtype",
"is",
"not",
"None",
":",
"return",
"explicit_dtype",
"elif",
"nest",
".",
"is_sequence",
"(",
"state",
")",
":",
"inferred_dtypes",
"=",
"[",
"element",
".",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/rnn.py#L43-L70 | ||
facebook/pyre2 | 053612cd79dab923444454d0035835422e99a632 | re2.py | python | fullmatch | (pattern, string) | return _compile(pattern, error).fullmatch(string) | Try to apply the pattern to the entire string, returning
a match object, or None if no match was found. | Try to apply the pattern to the entire string, returning
a match object, or None if no match was found. | [
"Try",
"to",
"apply",
"the",
"pattern",
"to",
"the",
"entire",
"string",
"returning",
"a",
"match",
"object",
"or",
"None",
"if",
"no",
"match",
"was",
"found",
"."
] | def fullmatch(pattern, string):
"""Try to apply the pattern to the entire string, returning
a match object, or None if no match was found."""
return _compile(pattern, error).fullmatch(string) | [
"def",
"fullmatch",
"(",
"pattern",
",",
"string",
")",
":",
"return",
"_compile",
"(",
"pattern",
",",
"error",
")",
".",
"fullmatch",
"(",
"string",
")"
] | https://github.com/facebook/pyre2/blob/053612cd79dab923444454d0035835422e99a632/re2.py#L68-L71 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py | python | CCompiler._fix_compile_args | (self, output_dir, macros, include_dirs) | return output_dir, macros, include_dirs | Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it with 'self.macros'; ensures that
'include_dirs' is a list, and au... | Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it with 'self.macros'; ensures that
'include_dirs' is a list, and au... | [
"Typecheck",
"and",
"fix",
"-",
"up",
"some",
"of",
"the",
"arguments",
"to",
"the",
"compile",
"()",
"method",
"and",
"return",
"fixed",
"-",
"up",
"values",
".",
"Specifically",
":",
"if",
"output_dir",
"is",
"None",
"replaces",
"it",
"with",
"self",
"... | def _fix_compile_args(self, output_dir, macros, include_dirs):
"""Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it... | [
"def",
"_fix_compile_args",
"(",
"self",
",",
"output_dir",
",",
"macros",
",",
"include_dirs",
")",
":",
"if",
"output_dir",
"is",
"None",
":",
"output_dir",
"=",
"self",
".",
"output_dir",
"elif",
"not",
"isinstance",
"(",
"output_dir",
",",
"str",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py#L376-L406 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/model/coordinates.py | python | Point.localCoordinates | (self) | return self._localCoordinates[:] | Returns the coordinates of this point in its parent Frame | Returns the coordinates of this point in its parent Frame | [
"Returns",
"the",
"coordinates",
"of",
"this",
"point",
"in",
"its",
"parent",
"Frame"
] | def localCoordinates(self):
"""Returns the coordinates of this point in its parent Frame"""
return self._localCoordinates[:] | [
"def",
"localCoordinates",
"(",
"self",
")",
":",
"return",
"self",
".",
"_localCoordinates",
"[",
":",
"]"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/coordinates.py#L137-L139 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/incubate/fleet/utils/fleet_util.py | python | FleetUtil.get_global_metrics | (self,
scope=fluid.global_scope(),
stat_pos_name="_generated_var_2",
stat_neg_name="_generated_var_3",
sqrerr_name="sqrerr",
abserr_name="abserr",
prob_name="... | return [
auc, bucket_error, mae, rmse, return_actual_ctr, predicted_ctr,
copc, mean_predict_qvalue, int(total_ins_num)
] | r"""
get global metrics, including auc, bucket_error, mae, rmse,
actual_ctr, predicted_ctr, copc, mean_predict_qvalue, total_ins_num.
Args:
scope(Scope): Scope object, default is fluid.global_scope()
stat_pos_name(str): name of auc pos bucket Variable
stat_ne... | r"""
get global metrics, including auc, bucket_error, mae, rmse,
actual_ctr, predicted_ctr, copc, mean_predict_qvalue, total_ins_num. | [
"r",
"get",
"global",
"metrics",
"including",
"auc",
"bucket_error",
"mae",
"rmse",
"actual_ctr",
"predicted_ctr",
"copc",
"mean_predict_qvalue",
"total_ins_num",
"."
] | def get_global_metrics(self,
scope=fluid.global_scope(),
stat_pos_name="_generated_var_2",
stat_neg_name="_generated_var_3",
sqrerr_name="sqrerr",
abserr_name="abserr",
... | [
"def",
"get_global_metrics",
"(",
"self",
",",
"scope",
"=",
"fluid",
".",
"global_scope",
"(",
")",
",",
"stat_pos_name",
"=",
"\"_generated_var_2\"",
",",
"stat_neg_name",
"=",
"\"_generated_var_3\"",
",",
"sqrerr_name",
"=",
"\"sqrerr\"",
",",
"abserr_name",
"=... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/utils/fleet_util.py#L1248-L1435 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/fftpack/pseudo_diffs.py | python | sc_diff | (x, a, b, period=None, _cache=_cache) | return convolve.convolve(tmp,omega,swap_real_imag=1,overwrite_x=overwrite_x) | Return (a,b)-sinh/cosh pseudo-derivative of a periodic sequence x.
If x_j and y_j are Fourier coefficients of periodic functions x
and y, respectively, then::
y_j = sqrt(-1)*sinh(j*a*2*pi/period)/cosh(j*b*2*pi/period) * x_j
y_0 = 0
Parameters
----------
x : array_like
Input ar... | Return (a,b)-sinh/cosh pseudo-derivative of a periodic sequence x. | [
"Return",
"(",
"a",
"b",
")",
"-",
"sinh",
"/",
"cosh",
"pseudo",
"-",
"derivative",
"of",
"a",
"periodic",
"sequence",
"x",
"."
] | def sc_diff(x, a, b, period=None, _cache=_cache):
"""
Return (a,b)-sinh/cosh pseudo-derivative of a periodic sequence x.
If x_j and y_j are Fourier coefficients of periodic functions x
and y, respectively, then::
y_j = sqrt(-1)*sinh(j*a*2*pi/period)/cosh(j*b*2*pi/period) * x_j
y_0 = 0
... | [
"def",
"sc_diff",
"(",
"x",
",",
"a",
",",
"b",
",",
"period",
"=",
"None",
",",
"_cache",
"=",
"_cache",
")",
":",
"tmp",
"=",
"asarray",
"(",
"x",
")",
"if",
"iscomplexobj",
"(",
"tmp",
")",
":",
"return",
"sc_diff",
"(",
"tmp",
".",
"real",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/fftpack/pseudo_diffs.py#L342-L389 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/hmac.py | python | HMAC.digest | (self) | return h.digest() | Return the hash value of this hashing object.
This returns a string containing 8-bit data. The object is
not altered in any way by this function; you can continue
updating the object after calling this function. | Return the hash value of this hashing object. | [
"Return",
"the",
"hash",
"value",
"of",
"this",
"hashing",
"object",
"."
] | def digest(self):
"""Return the hash value of this hashing object.
This returns a string containing 8-bit data. The object is
not altered in any way by this function; you can continue
updating the object after calling this function.
"""
h = self._current()
retur... | [
"def",
"digest",
"(",
"self",
")",
":",
"h",
"=",
"self",
".",
"_current",
"(",
")",
"return",
"h",
".",
"digest",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/hmac.py#L126-L134 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/req/req_uninstall.py | python | StashedUninstallPathSet.rollback | (self) | Undoes the uninstall by moving stashed files back. | Undoes the uninstall by moving stashed files back. | [
"Undoes",
"the",
"uninstall",
"by",
"moving",
"stashed",
"files",
"back",
"."
] | def rollback(self):
# type: () -> None
"""Undoes the uninstall by moving stashed files back."""
for p in self._moves:
logger.info("Moving to %s\n from %s", *p)
for new_path, path in self._moves:
try:
logger.debug('Replacing %s from %s', new_path, ... | [
"def",
"rollback",
"(",
"self",
")",
":",
"# type: () -> None",
"for",
"p",
"in",
"self",
".",
"_moves",
":",
"logger",
".",
"info",
"(",
"\"Moving to %s\\n from %s\"",
",",
"*",
"p",
")",
"for",
"new_path",
",",
"path",
"in",
"self",
".",
"_moves",
":",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/req/req_uninstall.py#L300-L318 | ||
zju3dv/clean-pvnet | 5870c509e3cc205e1bb28910a7b1a9a3c8add9a8 | lib/utils/meshrenderer/pysixd/transform.py | python | scale_matrix | (factor, origin=None, direction=None) | return M | Return matrix to scale by factor around origin in direction.
Use factor -1 for point symmetry.
>>> v = (numpy.random.rand(4, 5) - 0.5) * 20
>>> v[3] = 1
>>> S = scale_matrix(-1.234)
>>> numpy.allclose(numpy.dot(S, v)[:3], -1.234*v[:3])
True
>>> factor = random.random() * 10 - 5
>>> ori... | Return matrix to scale by factor around origin in direction. | [
"Return",
"matrix",
"to",
"scale",
"by",
"factor",
"around",
"origin",
"in",
"direction",
"."
] | def scale_matrix(factor, origin=None, direction=None):
"""Return matrix to scale by factor around origin in direction.
Use factor -1 for point symmetry.
>>> v = (numpy.random.rand(4, 5) - 0.5) * 20
>>> v[3] = 1
>>> S = scale_matrix(-1.234)
>>> numpy.allclose(numpy.dot(S, v)[:3], -1.234*v[:3])
... | [
"def",
"scale_matrix",
"(",
"factor",
",",
"origin",
"=",
"None",
",",
"direction",
"=",
"None",
")",
":",
"if",
"direction",
"is",
"None",
":",
"# uniform scaling",
"M",
"=",
"numpy",
".",
"diag",
"(",
"[",
"factor",
",",
"factor",
",",
"factor",
",",... | https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/meshrenderer/pysixd/transform.py#L386-L417 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/basic_session_run_hooks.py | python | _HookTimer.last_triggered_step | (self) | Returns the last triggered time step or None if never triggered. | Returns the last triggered time step or None if never triggered. | [
"Returns",
"the",
"last",
"triggered",
"time",
"step",
"or",
"None",
"if",
"never",
"triggered",
"."
] | def last_triggered_step(self):
"""Returns the last triggered time step or None if never triggered."""
raise NotImplementedError | [
"def",
"last_triggered_step",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/basic_session_run_hooks.py#L85-L87 | ||
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/settings2.py | python | StateSource._registerChildStateSource | (self, child) | Registers a child StateSource with this source object. | Registers a child StateSource with this source object. | [
"Registers",
"a",
"child",
"StateSource",
"with",
"this",
"source",
"object",
"."
] | def _registerChildStateSource(self, child):
"""Registers a child StateSource with this source object."""
self._childStateSources[child._stateSourceName] = child | [
"def",
"_registerChildStateSource",
"(",
"self",
",",
"child",
")",
":",
"self",
".",
"_childStateSources",
"[",
"child",
".",
"_stateSourceName",
"]",
"=",
"child"
] | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/settings2.py#L52-L54 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.