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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/__init__.py | python | _call_linker_cb | (env, callback, args, result = None) | return result | Returns the result of env['LINKCALLBACKS'][callback](*args)
if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback]
is callable. If these conditions are not met, return the value provided as
the *result* argument. This function is mainly used for generating library
info such as versio... | Returns the result of env['LINKCALLBACKS'][callback](*args)
if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback]
is callable. If these conditions are not met, return the value provided as
the *result* argument. This function is mainly used for generating library
info such as versio... | [
"Returns",
"the",
"result",
"of",
"env",
"[",
"LINKCALLBACKS",
"]",
"[",
"callback",
"]",
"(",
"*",
"args",
")",
"if",
"env",
"[",
"LINKCALLBACKS",
"]",
"is",
"a",
"dictionary",
"and",
"env",
"[",
"LINKCALLBACKS",
"]",
"[",
"callback",
"]",
"is",
"call... | def _call_linker_cb(env, callback, args, result = None):
"""Returns the result of env['LINKCALLBACKS'][callback](*args)
if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback]
is callable. If these conditions are not met, return the value provided as
the *result* argument. This functi... | [
"def",
"_call_linker_cb",
"(",
"env",
",",
"callback",
",",
"args",
",",
"result",
"=",
"None",
")",
":",
"Verbose",
"=",
"False",
"if",
"Verbose",
":",
"print",
"'_call_linker_cb: args=%r'",
"%",
"args",
"print",
"'_call_linker_cb: callback=%r'",
"%",
"callback... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/__init__.py#L246-L274 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/statistics.py | python | pvariance | (data, mu=None) | return _convert(ss/n, T) | Return the population variance of ``data``.
data should be an iterable of Real-valued numbers, with at least one
value. The optional argument mu, if given, should be the mean of
the data. If it is missing or None, the mean is automatically calculated.
Use this function to calculate the variance from t... | Return the population variance of ``data``. | [
"Return",
"the",
"population",
"variance",
"of",
"data",
"."
] | def pvariance(data, mu=None):
"""Return the population variance of ``data``.
data should be an iterable of Real-valued numbers, with at least one
value. The optional argument mu, if given, should be the mean of
the data. If it is missing or None, the mean is automatically calculated.
Use this func... | [
"def",
"pvariance",
"(",
"data",
",",
"mu",
"=",
"None",
")",
":",
"if",
"iter",
"(",
"data",
")",
"is",
"data",
":",
"data",
"=",
"list",
"(",
"data",
")",
"n",
"=",
"len",
"(",
"data",
")",
"if",
"n",
"<",
"1",
":",
"raise",
"StatisticsError"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/statistics.py#L592-L637 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.AddChild | (*args, **kwargs) | return _core_.Window_AddChild(*args, **kwargs) | AddChild(self, Window child)
Adds a child window. This is called automatically by window creation
functions so should not be required by the application programmer. | AddChild(self, Window child) | [
"AddChild",
"(",
"self",
"Window",
"child",
")"
] | def AddChild(*args, **kwargs):
"""
AddChild(self, Window child)
Adds a child window. This is called automatically by window creation
functions so should not be required by the application programmer.
"""
return _core_.Window_AddChild(*args, **kwargs) | [
"def",
"AddChild",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_AddChild",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10312-L10319 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py | python | Globe.HasImagery | (self) | return self.has_imagery_ | Returns whether glx has imagery. | Returns whether glx has imagery. | [
"Returns",
"whether",
"glx",
"has",
"imagery",
"."
] | def HasImagery(self):
"""Returns whether glx has imagery."""
return self.has_imagery_ | [
"def",
"HasImagery",
"(",
"self",
")",
":",
"return",
"self",
".",
"has_imagery_"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py#L91-L93 | |
DanielSWolf/rhubarb-lip-sync | 5cface0af3b6e4e58c0b829c51561d784fb9f52f | rhubarb/lib/webrtc-8d2248ff/webrtc/tools/barcode_tools/barcode_decoder.py | python | decode_frames | (input_directory, zxing_path) | return helper_functions.perform_action_on_all_files(
directory=input_directory, file_pattern='frame_',
file_extension='png', start_number=1, action=_decode_barcode_in_file,
command_line_decoder=zxing_path) | Decodes the barcodes overlaid in each frame.
The function uses the Zxing command-line tool from the Zxing C++ distribution
to decode the barcode in every PNG frame from the input directory. The frames
should be named frame_xxxx.png, where xxxx is the frame number. The frame
numbers should be consecutive and sh... | Decodes the barcodes overlaid in each frame. | [
"Decodes",
"the",
"barcodes",
"overlaid",
"in",
"each",
"frame",
"."
] | def decode_frames(input_directory, zxing_path):
"""Decodes the barcodes overlaid in each frame.
The function uses the Zxing command-line tool from the Zxing C++ distribution
to decode the barcode in every PNG frame from the input directory. The frames
should be named frame_xxxx.png, where xxxx is the frame num... | [
"def",
"decode_frames",
"(",
"input_directory",
",",
"zxing_path",
")",
":",
"if",
"not",
"zxing_path",
":",
"zxing_path",
"=",
"'zxing.exe'",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
"else",
"'zxing'",
"print",
"'Decoding barcodes from PNG files with %s...'",
... | https://github.com/DanielSWolf/rhubarb-lip-sync/blob/5cface0af3b6e4e58c0b829c51561d784fb9f52f/rhubarb/lib/webrtc-8d2248ff/webrtc/tools/barcode_tools/barcode_decoder.py#L64-L89 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/utils/benchmark/tools/gbench/report.py | python | color_format | (use_color, fmt_str, *args, **kwargs) | return fmt_str.format(*args, **kwargs) | Return the result of 'fmt_str.format(*args, **kwargs)' after transforming
'args' and 'kwargs' according to the value of 'use_color'. If 'use_color'
is False then all color codes in 'args' and 'kwargs' are replaced with
the empty string. | Return the result of 'fmt_str.format(*args, **kwargs)' after transforming
'args' and 'kwargs' according to the value of 'use_color'. If 'use_color'
is False then all color codes in 'args' and 'kwargs' are replaced with
the empty string. | [
"Return",
"the",
"result",
"of",
"fmt_str",
".",
"format",
"(",
"*",
"args",
"**",
"kwargs",
")",
"after",
"transforming",
"args",
"and",
"kwargs",
"according",
"to",
"the",
"value",
"of",
"use_color",
".",
"If",
"use_color",
"is",
"False",
"then",
"all",
... | def color_format(use_color, fmt_str, *args, **kwargs):
"""
Return the result of 'fmt_str.format(*args, **kwargs)' after transforming
'args' and 'kwargs' according to the value of 'use_color'. If 'use_color'
is False then all color codes in 'args' and 'kwargs' are replaced with
the empty string.
... | [
"def",
"color_format",
"(",
"use_color",
",",
"fmt_str",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"assert",
"use_color",
"is",
"True",
"or",
"use_color",
"is",
"False",
"if",
"not",
"use_color",
":",
"args",
"=",
"[",
"arg",
"if",
"not",
... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/utils/benchmark/tools/gbench/report.py#L32-L45 | |
AutoRally/autorally | 48bae14fe4b2d56e5ca11fd2fec3d7dfac7a0e75 | autorally_gazebo/nodes/autorally_controller.py | python | AutoRallyCtrlr.spin | (self) | Control the vehicle. | Control the vehicle. | [
"Control",
"the",
"vehicle",
"."
] | def spin(self):
"""Control the vehicle."""
last_time = rospy.get_time()
while not rospy.is_shutdown():
t = rospy.get_time()
delta_t = t - last_time
last_time = t
frontBrake = 0.0;
speed = 0.0;
chassisSt = chassisState()
chassisSt.runstopMotionEnabled = self.getru... | [
"def",
"spin",
"(",
"self",
")",
":",
"last_time",
"=",
"rospy",
".",
"get_time",
"(",
")",
"while",
"not",
"rospy",
".",
"is_shutdown",
"(",
")",
":",
"t",
"=",
"rospy",
".",
"get_time",
"(",
")",
"delta_t",
"=",
"t",
"-",
"last_time",
"last_time",
... | https://github.com/AutoRally/autorally/blob/48bae14fe4b2d56e5ca11fd2fec3d7dfac7a0e75/autorally_gazebo/nodes/autorally_controller.py#L314-L417 | ||
MegaGlest/megaglest-source | e3af470288a3c9cc179f63b5a1eb414a669e3772 | mk/linux/symbolstore.py | python | Dumper.GlobalInit | (cls, module=multiprocessing) | Initialize the class globals for the multiprocessing setup; must
be called before any Dumper instances are created and used. Test cases
may pass in a different module to supply Manager and Pool objects,
usually multiprocessing.dummy. | Initialize the class globals for the multiprocessing setup; must
be called before any Dumper instances are created and used. Test cases
may pass in a different module to supply Manager and Pool objects,
usually multiprocessing.dummy. | [
"Initialize",
"the",
"class",
"globals",
"for",
"the",
"multiprocessing",
"setup",
";",
"must",
"be",
"called",
"before",
"any",
"Dumper",
"instances",
"are",
"created",
"and",
"used",
".",
"Test",
"cases",
"may",
"pass",
"in",
"a",
"different",
"module",
"t... | def GlobalInit(cls, module=multiprocessing):
"""Initialize the class globals for the multiprocessing setup; must
be called before any Dumper instances are created and used. Test cases
may pass in a different module to supply Manager and Pool objects,
usually multiprocessing.dummy."""
... | [
"def",
"GlobalInit",
"(",
"cls",
",",
"module",
"=",
"multiprocessing",
")",
":",
"num_cpus",
"=",
"module",
".",
"cpu_count",
"(",
")",
"if",
"num_cpus",
"is",
"None",
":",
"# assume a dual core machine if we can't find out for some reason",
"# probably better on singl... | https://github.com/MegaGlest/megaglest-source/blob/e3af470288a3c9cc179f63b5a1eb414a669e3772/mk/linux/symbolstore.py#L369-L384 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py | python | Treeview.move | (self, item, parent, index) | Moves item to position index in parent's list of children.
It is illegal to move an item under one of its descendants. If
index is less than or equal to zero, item is moved to the
beginning, if greater than or equal to the number of children,
it is moved to the end. If item was detached... | Moves item to position index in parent's list of children. | [
"Moves",
"item",
"to",
"position",
"index",
"in",
"parent",
"s",
"list",
"of",
"children",
"."
] | def move(self, item, parent, index):
"""Moves item to position index in parent's list of children.
It is illegal to move an item under one of its descendants. If
index is less than or equal to zero, item is moved to the
beginning, if greater than or equal to the number of children,
... | [
"def",
"move",
"(",
"self",
",",
"item",
",",
"parent",
",",
"index",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"move\"",
",",
"item",
",",
"parent",
",",
"index",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L1352-L1359 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/command.py | python | FbCmd.do_help | (self, input) | Print out help | Print out help | [
"Print",
"out",
"help"
] | def do_help(self, input):
"""Print out help"""
args = input.strip().split()
if len(args) > 0:
arg = args[0]
try:
func = self.ctx.lookup_helpfunction(arg)
func()
except AttributeError:
pass
try:
... | [
"def",
"do_help",
"(",
"self",
",",
"input",
")",
":",
"args",
"=",
"input",
".",
"strip",
"(",
")",
".",
"split",
"(",
")",
"if",
"len",
"(",
"args",
")",
">",
"0",
":",
"arg",
"=",
"args",
"[",
"0",
"]",
"try",
":",
"func",
"=",
"self",
"... | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/command.py#L371-L396 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/geodesy/utm.py | python | UTMPoint.toPoint | (self) | return pt | :returns: corresponding `geometry_msgs/Point`_ message.
:todo: clamp message longitude to [-180..180] | :returns: corresponding `geometry_msgs/Point`_ message.
:todo: clamp message longitude to [-180..180] | [
":",
"returns",
":",
"corresponding",
"geometry_msgs",
"/",
"Point",
"_",
"message",
".",
":",
"todo",
":",
"clamp",
"message",
"longitude",
"to",
"[",
"-",
"180",
"..",
"180",
"]"
] | def toPoint(self):
""":returns: corresponding `geometry_msgs/Point`_ message.
:todo: clamp message longitude to [-180..180]
"""
if not self.valid():
raise ValueError('invalid UTM point: ' + str(self))
pt = Point(x = self.easting, y = self.northing)
if not self... | [
"def",
"toPoint",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"valid",
"(",
")",
":",
"raise",
"ValueError",
"(",
"'invalid UTM point: '",
"+",
"str",
"(",
"self",
")",
")",
"pt",
"=",
"Point",
"(",
"x",
"=",
"self",
".",
"easting",
",",
"y",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geodesy/utm.py#L102-L111 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimelike.py | python | AttributesMixin._check_compatible_with | (
self, other: Union[Period, Timestamp, Timedelta, NaTType], setitem: bool = False
) | Verify that `self` and `other` are compatible.
* DatetimeArray verifies that the timezones (if any) match
* PeriodArray verifies that the freq matches
* Timedelta has no verification
In each case, NaT is considered compatible.
Parameters
----------
other
... | Verify that `self` and `other` are compatible. | [
"Verify",
"that",
"self",
"and",
"other",
"are",
"compatible",
"."
] | def _check_compatible_with(
self, other: Union[Period, Timestamp, Timedelta, NaTType], setitem: bool = False
) -> None:
"""
Verify that `self` and `other` are compatible.
* DatetimeArray verifies that the timezones (if any) match
* PeriodArray verifies that the freq matches
... | [
"def",
"_check_compatible_with",
"(",
"self",
",",
"other",
":",
"Union",
"[",
"Period",
",",
"Timestamp",
",",
"Timedelta",
",",
"NaTType",
"]",
",",
"setitem",
":",
"bool",
"=",
"False",
")",
"->",
"None",
":",
"raise",
"AbstractMethodError",
"(",
"self"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimelike.py#L186-L209 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/runtime.py | python | Undefined._undefined_message | (self) | return (
f"{object_type_repr(self._undefined_obj)!r} has no"
f" attribute {self._undefined_name!r}"
) | Build a message about the undefined value based on how it was
accessed. | Build a message about the undefined value based on how it was
accessed. | [
"Build",
"a",
"message",
"about",
"the",
"undefined",
"value",
"based",
"on",
"how",
"it",
"was",
"accessed",
"."
] | def _undefined_message(self) -> str:
"""Build a message about the undefined value based on how it was
accessed.
"""
if self._undefined_hint:
return self._undefined_hint
if self._undefined_obj is missing:
return f"{self._undefined_name!r} is undefined"
... | [
"def",
"_undefined_message",
"(",
"self",
")",
"->",
"str",
":",
"if",
"self",
".",
"_undefined_hint",
":",
"return",
"self",
".",
"_undefined_hint",
"if",
"self",
".",
"_undefined_obj",
"is",
"missing",
":",
"return",
"f\"{self._undefined_name!r} is undefined\"",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/runtime.py#L875-L894 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/datamodel/manager.py | python | DataModelManager.register | (self, fetypecls, handler) | Register the datamodel factory corresponding to a frontend-type class | Register the datamodel factory corresponding to a frontend-type class | [
"Register",
"the",
"datamodel",
"factory",
"corresponding",
"to",
"a",
"frontend",
"-",
"type",
"class"
] | def register(self, fetypecls, handler):
"""Register the datamodel factory corresponding to a frontend-type class
"""
assert issubclass(fetypecls, types.Type)
self._handlers[fetypecls] = handler | [
"def",
"register",
"(",
"self",
",",
"fetypecls",
",",
"handler",
")",
":",
"assert",
"issubclass",
"(",
"fetypecls",
",",
"types",
".",
"Type",
")",
"self",
".",
"_handlers",
"[",
"fetypecls",
"]",
"=",
"handler"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/datamodel/manager.py#L18-L22 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/ert/ertScheme.py | python | DataSchemeBase.addInverse | (self, addInverse=False) | Add inverse value to create a full dataset. | Add inverse value to create a full dataset. | [
"Add",
"inverse",
"value",
"to",
"create",
"a",
"full",
"dataset",
"."
] | def addInverse(self, addInverse=False):
"""
Add inverse value to create a full dataset.
"""
self.addInverse_ = addInverse | [
"def",
"addInverse",
"(",
"self",
",",
"addInverse",
"=",
"False",
")",
":",
"self",
".",
"addInverse_",
"=",
"addInverse"
] | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/ert/ertScheme.py#L310-L314 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/variable_scope.py | python | _PartitionInfo.single_slice_dim | (self, shape) | return slice_dim | Returns the slice dim when the variable is partitioned only in one dim.
Args:
shape: Tuple or list of `int` indicating the shape of one specific
variable partition.
Returns:
`int` representing the dimension that the variable is partitioned in, or
`None` if the variable doesn't seem t... | Returns the slice dim when the variable is partitioned only in one dim. | [
"Returns",
"the",
"slice",
"dim",
"when",
"the",
"variable",
"is",
"partitioned",
"only",
"in",
"one",
"dim",
"."
] | def single_slice_dim(self, shape):
"""Returns the slice dim when the variable is partitioned only in one dim.
Args:
shape: Tuple or list of `int` indicating the shape of one specific
variable partition.
Returns:
`int` representing the dimension that the variable is partitioned in, or
... | [
"def",
"single_slice_dim",
"(",
"self",
",",
"shape",
")",
":",
"if",
"not",
"isinstance",
"(",
"shape",
",",
"collections_lib",
".",
"Sequence",
")",
"or",
"isinstance",
"(",
"shape",
",",
"six",
".",
"string_types",
")",
":",
"raise",
"TypeError",
"(",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/variable_scope.py#L126-L172 | |
Illumina/hap.py | 84011695b2ff2406c16a335106db6831fb67fdfe | src/python/Somatic/Strelka.py | python | extractStrelkaIndelFeatures | (vcfname, tag, avg_depth=None) | return df | Return a data frame with features collected from the given VCF, tagged by given type
:param vcfname: name of the VCF file
:param tag: type of variants
:param avg_depth: average chromosome depths from BAM file | Return a data frame with features collected from the given VCF, tagged by given type
:param vcfname: name of the VCF file
:param tag: type of variants
:param avg_depth: average chromosome depths from BAM file | [
"Return",
"a",
"data",
"frame",
"with",
"features",
"collected",
"from",
"the",
"given",
"VCF",
"tagged",
"by",
"given",
"type",
":",
"param",
"vcfname",
":",
"name",
"of",
"the",
"VCF",
"file",
":",
"param",
"tag",
":",
"type",
"of",
"variants",
":",
... | def extractStrelkaIndelFeatures(vcfname, tag, avg_depth=None):
""" Return a data frame with features collected from the given VCF, tagged by given type
:param vcfname: name of the VCF file
:param tag: type of variants
:param avg_depth: average chromosome depths from BAM file
"""
features = ["CHR... | [
"def",
"extractStrelkaIndelFeatures",
"(",
"vcfname",
",",
"tag",
",",
"avg_depth",
"=",
"None",
")",
":",
"features",
"=",
"[",
"\"CHROM\"",
",",
"\"POS\"",
",",
"\"REF\"",
",",
"\"ALT\"",
",",
"\"FILTER\"",
",",
"\"I.NT\"",
",",
"\"I.SOMATIC\"",
",",
"\"I.... | https://github.com/Illumina/hap.py/blob/84011695b2ff2406c16a335106db6831fb67fdfe/src/python/Somatic/Strelka.py#L267-L507 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pycc/platform.py | python | Toolchain.get_python_library_dirs | (self) | return list(self._py_lib_dirs) + self._math_info['library_dirs'] | Get the library directories necessary to link with Python. | Get the library directories necessary to link with Python. | [
"Get",
"the",
"library",
"directories",
"necessary",
"to",
"link",
"with",
"Python",
"."
] | def get_python_library_dirs(self):
"""
Get the library directories necessary to link with Python.
"""
return list(self._py_lib_dirs) + self._math_info['library_dirs'] | [
"def",
"get_python_library_dirs",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"_py_lib_dirs",
")",
"+",
"self",
".",
"_math_info",
"[",
"'library_dirs'",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pycc/platform.py#L173-L177 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiTabCtrl.OnEraseBackground | (self, event) | Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`AuiTabCtrl`.
:param `event`: a :class:`EraseEvent` event to be processed.
:note: This is intentionally empty, to reduce flicker. | Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`AuiTabCtrl`. | [
"Handles",
"the",
"wx",
".",
"EVT_ERASE_BACKGROUND",
"event",
"for",
":",
"class",
":",
"AuiTabCtrl",
"."
] | def OnEraseBackground(self, event):
"""
Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`AuiTabCtrl`.
:param `event`: a :class:`EraseEvent` event to be processed.
:note: This is intentionally empty, to reduce flicker.
"""
pass | [
"def",
"OnEraseBackground",
"(",
"self",
",",
"event",
")",
":",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L1851-L1860 | ||
facebook/proxygen | a9ca025af207787815cb01eee1971cd572c7a81e | build/fbcode_builder/shell_quoting.py | python | shell_quote | (s) | return (
s
if isinstance(s, ShellQuoted)
else ShellQuoted("'" + str(s).replace("'", "'\\''") + "'")
) | Quotes a string if it is not already quoted | Quotes a string if it is not already quoted | [
"Quotes",
"a",
"string",
"if",
"it",
"is",
"not",
"already",
"quoted"
] | def shell_quote(s):
"Quotes a string if it is not already quoted"
return (
s
if isinstance(s, ShellQuoted)
else ShellQuoted("'" + str(s).replace("'", "'\\''") + "'")
) | [
"def",
"shell_quote",
"(",
"s",
")",
":",
"return",
"(",
"s",
"if",
"isinstance",
"(",
"s",
",",
"ShellQuoted",
")",
"else",
"ShellQuoted",
"(",
"\"'\"",
"+",
"str",
"(",
"s",
")",
".",
"replace",
"(",
"\"'\"",
",",
"\"'\\\\''\"",
")",
"+",
"\"'\"",
... | https://github.com/facebook/proxygen/blob/a9ca025af207787815cb01eee1971cd572c7a81e/build/fbcode_builder/shell_quoting.py#L68-L74 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintsbasisset.py | python | BasisSet.zero_ao_basis_set | () | return BasisSet() | Returns an empty basis set object.
Returns a BasisSet object that actually has a single s-function
at the origin with an exponent of 0.0 and contraction of 1.0.
* @return A new empty BasisSet object. | Returns an empty basis set object.
Returns a BasisSet object that actually has a single s-function
at the origin with an exponent of 0.0 and contraction of 1.0.
* @return A new empty BasisSet object. | [
"Returns",
"an",
"empty",
"basis",
"set",
"object",
".",
"Returns",
"a",
"BasisSet",
"object",
"that",
"actually",
"has",
"a",
"single",
"s",
"-",
"function",
"at",
"the",
"origin",
"with",
"an",
"exponent",
"of",
"0",
".",
"0",
"and",
"contraction",
"of... | def zero_ao_basis_set():
"""Returns an empty basis set object.
Returns a BasisSet object that actually has a single s-function
at the origin with an exponent of 0.0 and contraction of 1.0.
* @return A new empty BasisSet object.
"""
# In the new implementation, we simply... | [
"def",
"zero_ao_basis_set",
"(",
")",
":",
"# In the new implementation, we simply call the default constructor",
"return",
"BasisSet",
"(",
")"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsbasisset.py#L494-L502 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/examples/python/crashlog.py | python | Interactive.do_quit | (self, line) | return True | Quit command | Quit command | [
"Quit",
"command"
] | def do_quit(self, line):
'''Quit command'''
return True | [
"def",
"do_quit",
"(",
"self",
",",
"line",
")",
":",
"return",
"True"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/examples/python/crashlog.py#L582-L584 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/mixture/_bayesian_mixture.py | python | BayesianGaussianMixture._estimate_wishart_tied | (self, nk, xk, sk) | Estimate the tied Wishart distribution parameters.
Parameters
----------
X : array-like, shape (n_samples, n_features)
nk : array-like, shape (n_components,)
xk : array-like, shape (n_components, n_features)
sk : array-like, shape (n_features, n_features) | Estimate the tied Wishart distribution parameters. | [
"Estimate",
"the",
"tied",
"Wishart",
"distribution",
"parameters",
"."
] | def _estimate_wishart_tied(self, nk, xk, sk):
"""Estimate the tied Wishart distribution parameters.
Parameters
----------
X : array-like, shape (n_samples, n_features)
nk : array-like, shape (n_components,)
xk : array-like, shape (n_components, n_features)
sk ... | [
"def",
"_estimate_wishart_tied",
"(",
"self",
",",
"nk",
",",
"xk",
",",
"sk",
")",
":",
"_",
",",
"n_features",
"=",
"xk",
".",
"shape",
"# Warning : in some Bishop book, there is a typo on the formula 10.63",
"# `degrees_of_freedom_k = degrees_of_freedom_0 + Nk`",
"# is t... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/mixture/_bayesian_mixture.py#L562-L590 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | MenuItem.GetFont | (*args, **kwargs) | return _core_.MenuItem_GetFont(*args, **kwargs) | GetFont(self) -> Font | GetFont(self) -> Font | [
"GetFont",
"(",
"self",
")",
"-",
">",
"Font"
] | def GetFont(*args, **kwargs):
"""GetFont(self) -> Font"""
return _core_.MenuItem_GetFont(*args, **kwargs) | [
"def",
"GetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_GetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12561-L12563 | |
eclipse/omr | 056e7c9ce9d503649190bc5bd9931fac30b4e4bc | jitbuilder/apigen/cppgen.py | python | CppGenerator.get_impl_class_name | (self, c) | return "TR::{}".format(self.get_class_name(c)) | Returns the name of a given class in the JitBuilder implementation,
prefixed with the name of all containing classes. | Returns the name of a given class in the JitBuilder implementation,
prefixed with the name of all containing classes. | [
"Returns",
"the",
"name",
"of",
"a",
"given",
"class",
"in",
"the",
"JitBuilder",
"implementation",
"prefixed",
"with",
"the",
"name",
"of",
"all",
"containing",
"classes",
"."
] | def get_impl_class_name(self, c):
"""
Returns the name of a given class in the JitBuilder implementation,
prefixed with the name of all containing classes.
"""
return "TR::{}".format(self.get_class_name(c)) | [
"def",
"get_impl_class_name",
"(",
"self",
",",
"c",
")",
":",
"return",
"\"TR::{}\"",
".",
"format",
"(",
"self",
".",
"get_class_name",
"(",
"c",
")",
")"
] | https://github.com/eclipse/omr/blob/056e7c9ce9d503649190bc5bd9931fac30b4e4bc/jitbuilder/apigen/cppgen.py#L140-L145 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pathlib2/pathlib2/__init__.py | python | Path.write_text | (self, data, encoding=None, errors=None) | Open the file in text mode, write to it, and close the file. | Open the file in text mode, write to it, and close the file. | [
"Open",
"the",
"file",
"in",
"text",
"mode",
"write",
"to",
"it",
"and",
"close",
"the",
"file",
"."
] | def write_text(self, data, encoding=None, errors=None):
"""
Open the file in text mode, write to it, and close the file.
"""
if not isinstance(data, six.text_type):
raise TypeError(
'data must be %s, not %s' %
(six.text_type.__name__, data.__cl... | [
"def",
"write_text",
"(",
"self",
",",
"data",
",",
"encoding",
"=",
"None",
",",
"errors",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"six",
".",
"text_type",
")",
":",
"raise",
"TypeError",
"(",
"'data must be %s, not %s'",
"%"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pathlib2/pathlib2/__init__.py#L1504-L1513 | ||
google-coral/edgetpu | 5020de9386ff370dcc1f63291a2d0f98eeb98adb | edgetpu/learn/imprinting/engine.py | python | ImprintingEngine.__init__ | (self, model_path, keep_classes=False) | Args:
model_path (str): Path to the model you want to retrain. This model must be a ``.tflite``
file output by the ``join_tflite_models`` tool. For more information about how to create a
compatible model, read `Retrain an image classification model on-device
<https://coral.ai/docs/edgetpu/... | Args:
model_path (str): Path to the model you want to retrain. This model must be a ``.tflite``
file output by the ``join_tflite_models`` tool. For more information about how to create a
compatible model, read `Retrain an image classification model on-device
<https://coral.ai/docs/edgetpu/... | [
"Args",
":",
"model_path",
"(",
"str",
")",
":",
"Path",
"to",
"the",
"model",
"you",
"want",
"to",
"retrain",
".",
"This",
"model",
"must",
"be",
"a",
".",
"tflite",
"file",
"output",
"by",
"the",
"join_tflite_models",
"tool",
".",
"For",
"more",
"inf... | def __init__(self, model_path, keep_classes=False):
"""
Args:
model_path (str): Path to the model you want to retrain. This model must be a ``.tflite``
file output by the ``join_tflite_models`` tool. For more information about how to create a
compatible model, read `Retrain an image classi... | [
"def",
"__init__",
"(",
"self",
",",
"model_path",
",",
"keep_classes",
"=",
"False",
")",
":",
"self",
".",
"_engine",
"=",
"ImprintingEnginePythonWrapper",
".",
"CreateFromFile",
"(",
"model_path",
",",
"keep_classes",
")",
"self",
".",
"_num_classes",
"=",
... | https://github.com/google-coral/edgetpu/blob/5020de9386ff370dcc1f63291a2d0f98eeb98adb/edgetpu/learn/imprinting/engine.py#L54-L71 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBDebugger.GetFormatForType | (self, *args) | return _lldb.SBDebugger_GetFormatForType(self, *args) | GetFormatForType(self, SBTypeNameSpecifier arg0) -> SBTypeFormat | GetFormatForType(self, SBTypeNameSpecifier arg0) -> SBTypeFormat | [
"GetFormatForType",
"(",
"self",
"SBTypeNameSpecifier",
"arg0",
")",
"-",
">",
"SBTypeFormat"
] | def GetFormatForType(self, *args):
"""GetFormatForType(self, SBTypeNameSpecifier arg0) -> SBTypeFormat"""
return _lldb.SBDebugger_GetFormatForType(self, *args) | [
"def",
"GetFormatForType",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_GetFormatForType",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L3507-L3509 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/externals/_pep562.py | python | Pep562.__getattr__ | (self, name) | Attempt to retrieve the attribute from the module, and if missing, use the overridden function if present. | Attempt to retrieve the attribute from the module, and if missing, use the overridden function if present. | [
"Attempt",
"to",
"retrieve",
"the",
"attribute",
"from",
"the",
"module",
"and",
"if",
"missing",
"use",
"the",
"overridden",
"function",
"if",
"present",
"."
] | def __getattr__(self, name):
"""Attempt to retrieve the attribute from the module, and if missing, use the overridden function if present."""
try:
return getattr(self._module, name)
except AttributeError:
if self._get_attr:
return self._get_attr(name)
... | [
"def",
"__getattr__",
"(",
"self",
",",
"name",
")",
":",
"try",
":",
"return",
"getattr",
"(",
"self",
".",
"_module",
",",
"name",
")",
"except",
"AttributeError",
":",
"if",
"self",
".",
"_get_attr",
":",
"return",
"self",
".",
"_get_attr",
"(",
"na... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/externals/_pep562.py#L50-L58 | ||
s9xie/hed | 94fb22f10cbfec8d84fbc0642b224022014b6bd6 | scripts/cpp_lint.py | python | _NestingState.InNamespaceBody | (self) | return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | Check if we are currently one level inside a namespace body. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"namespace",
"body",
"."
] | def InNamespaceBody(self):
"""Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | [
"def",
"InNamespaceBody",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_NamespaceInfo",
")"
] | https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/scripts/cpp_lint.py#L1940-L1946 | |
deepmind/reverb | ef3c8f0be1b720a741d2dee335e15e44668c291a | reverb/trajectory_dataset.py | python | TrajectoryDataset.from_table_signature | (cls,
server_address: str,
table: str,
max_in_flight_samples_per_worker: int,
num_workers_per_iterator: int = -1,
max_samples_per_stream: int = -1,
rate_limit... | return cls(
server_address=server_address,
table=table,
shapes=shapes,
dtypes=dtypes,
max_in_flight_samples_per_worker=max_in_flight_samples_per_worker,
num_workers_per_iterator=num_workers_per_iterator,
max_samples_per_stream=max_samples_per_stream,
rate_... | Constructs a TrajectoryDataset using the table's signature to infer specs.
Note: The target `Table` must specify a signature which represent the entire
trajectory (as opposed to a single timestep). See `Table.__init__`
(./server.py) for more details.
Args:
server_address: Address of gRPC Rev... | Constructs a TrajectoryDataset using the table's signature to infer specs. | [
"Constructs",
"a",
"TrajectoryDataset",
"using",
"the",
"table",
"s",
"signature",
"to",
"infer",
"specs",
"."
] | def from_table_signature(cls,
server_address: str,
table: str,
max_in_flight_samples_per_worker: int,
num_workers_per_iterator: int = -1,
max_samples_per_stream: int = -1,
... | [
"def",
"from_table_signature",
"(",
"cls",
",",
"server_address",
":",
"str",
",",
"table",
":",
"str",
",",
"max_in_flight_samples_per_worker",
":",
"int",
",",
"num_workers_per_iterator",
":",
"int",
"=",
"-",
"1",
",",
"max_samples_per_stream",
":",
"int",
"=... | https://github.com/deepmind/reverb/blob/ef3c8f0be1b720a741d2dee335e15e44668c291a/reverb/trajectory_dataset.py#L149-L210 | |
wujixiu/helmet-detection | 8eff5c59ddfba5a29e0b76aeb48babcb49246178 | old-version/ssd_vgg.py | python | CaffeDetection.detect | (self, image_file, conf_thresh=0.2, topn=20) | return result | SSD detection | SSD detection | [
"SSD",
"detection"
] | def detect(self, image_file, conf_thresh=0.2, topn=20):
'''
SSD detection
'''
# set net to batch size of 1
# image_resize = 300
image = caffe.io.load_image(image_file)
self.net.blobs['data'].reshape(1, 3, self.image_resize, self.image_resize)
#Run the net... | [
"def",
"detect",
"(",
"self",
",",
"image_file",
",",
"conf_thresh",
"=",
"0.2",
",",
"topn",
"=",
"20",
")",
":",
"# set net to batch size of 1",
"# image_resize = 300",
"image",
"=",
"caffe",
".",
"io",
".",
"load_image",
"(",
"image_file",
")",
"self",
".... | https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/old-version/ssd_vgg.py#L66-L112 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/eslint.py | python | _lint_files | (eslint, files) | return True | Lint a list of files with ESLint | Lint a list of files with ESLint | [
"Lint",
"a",
"list",
"of",
"files",
"with",
"ESLint"
] | def _lint_files(eslint, files):
"""Lint a list of files with ESLint
"""
eslint = ESLint(eslint, _get_build_dir())
lint_clean = parallel.parallel_process([os.path.abspath(f) for f in files], eslint.lint)
if not lint_clean:
print("ERROR: ESLint found errors. Run ESLint manually to see errors... | [
"def",
"_lint_files",
"(",
"eslint",
",",
"files",
")",
":",
"eslint",
"=",
"ESLint",
"(",
"eslint",
",",
"_get_build_dir",
"(",
")",
")",
"lint_clean",
"=",
"parallel",
".",
"parallel_process",
"(",
"[",
"os",
".",
"path",
".",
"abspath",
"(",
"f",
")... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/eslint.py#L203-L215 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/multi.py | python | MultiIndex._is_memory_usage_qualified | (self) | return any(f(level) for level in self._inferred_type_levels) | return a boolean if we need a qualified .info display | return a boolean if we need a qualified .info display | [
"return",
"a",
"boolean",
"if",
"we",
"need",
"a",
"qualified",
".",
"info",
"display"
] | def _is_memory_usage_qualified(self) -> bool:
"""return a boolean if we need a qualified .info display"""
def f(level):
return "mixed" in level or "string" in level or "unicode" in level
return any(f(level) for level in self._inferred_type_levels) | [
"def",
"_is_memory_usage_qualified",
"(",
"self",
")",
"->",
"bool",
":",
"def",
"f",
"(",
"level",
")",
":",
"return",
"\"mixed\"",
"in",
"level",
"or",
"\"string\"",
"in",
"level",
"or",
"\"unicode\"",
"in",
"level",
"return",
"any",
"(",
"f",
"(",
"le... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/multi.py#L1228-L1234 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/syndata.py | python | SyntaxDataBase.GetProperties | (self) | return list() | Get the Properties List
@return: list of tuples [('fold', '1'),] | Get the Properties List
@return: list of tuples [('fold', '1'),] | [
"Get",
"the",
"Properties",
"List",
"@return",
":",
"list",
"of",
"tuples",
"[",
"(",
"fold",
"1",
")",
"]"
] | def GetProperties(self):
"""Get the Properties List
@return: list of tuples [('fold', '1'),]
"""
return list() | [
"def",
"GetProperties",
"(",
"self",
")",
":",
"return",
"list",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/syndata.py#L96-L101 | |
may0324/DeepCompression-caffe | 0aff6c1287bda4cfc7f378ed8a16524e1afabd8c | scripts/cpp_lint.py | python | _CppLintState.SetVerboseLevel | (self, level) | return last_verbose_level | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def SetVerboseLevel(self, level):
"""Sets the module's verbosity, and returns the previous setting."""
last_verbose_level = self.verbose_level
self.verbose_level = level
return last_verbose_level | [
"def",
"SetVerboseLevel",
"(",
"self",
",",
"level",
")",
":",
"last_verbose_level",
"=",
"self",
".",
"verbose_level",
"self",
".",
"verbose_level",
"=",
"level",
"return",
"last_verbose_level"
] | https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L707-L711 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/layer/normalization.py | python | _BatchNorm.__init__ | (self,
num_features,
eps=1e-5,
momentum=0.9,
affine=True,
gamma_init='ones',
beta_init='zeros',
moving_mean_init='zeros',
moving_var_init='ones',
use_batch_statistics=... | Initialize _BatchNorm. | Initialize _BatchNorm. | [
"Initialize",
"_BatchNorm",
"."
] | def __init__(self,
num_features,
eps=1e-5,
momentum=0.9,
affine=True,
gamma_init='ones',
beta_init='zeros',
moving_mean_init='zeros',
moving_var_init='ones',
use_batch... | [
"def",
"__init__",
"(",
"self",
",",
"num_features",
",",
"eps",
"=",
"1e-5",
",",
"momentum",
"=",
"0.9",
",",
"affine",
"=",
"True",
",",
"gamma_init",
"=",
"'ones'",
",",
"beta_init",
"=",
"'zeros'",
",",
"moving_mean_init",
"=",
"'zeros'",
",",
"movi... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/layer/normalization.py#L47-L160 | ||
Tencent/TNN | 7acca99f54c55747b415a4c57677403eebc7b706 | third_party/flatbuffers/python/flatbuffers/builder.py | python | Builder.Place | (self, x, flags) | Place prepends a value specified by `flags` to the Builder,
without checking for available space. | Place prepends a value specified by `flags` to the Builder,
without checking for available space. | [
"Place",
"prepends",
"a",
"value",
"specified",
"by",
"flags",
"to",
"the",
"Builder",
"without",
"checking",
"for",
"available",
"space",
"."
] | def Place(self, x, flags):
"""
Place prepends a value specified by `flags` to the Builder,
without checking for available space.
"""
N.enforce_number(x, flags)
self.head = self.head - flags.bytewidth
encode.Write(flags.packer_type, self.Bytes, self.Head(), x) | [
"def",
"Place",
"(",
"self",
",",
"x",
",",
"flags",
")",
":",
"N",
".",
"enforce_number",
"(",
"x",
",",
"flags",
")",
"self",
".",
"head",
"=",
"self",
".",
"head",
"-",
"flags",
".",
"bytewidth",
"encode",
".",
"Write",
"(",
"flags",
".",
"pac... | https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/python/flatbuffers/builder.py#L720-L728 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozbuild/makeutil.py | python | Rule.dump | (self, fh) | Dump the rule to the given file handle. | Dump the rule to the given file handle. | [
"Dump",
"the",
"rule",
"to",
"the",
"given",
"file",
"handle",
"."
] | def dump(self, fh):
'''
Dump the rule to the given file handle.
'''
if not self._targets:
return
fh.write('%s:' % ' '.join(self._targets))
if self._dependencies:
fh.write(' %s' % ' '.join(self.dependencies()))
fh.write('\n')
for cmd... | [
"def",
"dump",
"(",
"self",
",",
"fh",
")",
":",
"if",
"not",
"self",
".",
"_targets",
":",
"return",
"fh",
".",
"write",
"(",
"'%s:'",
"%",
"' '",
".",
"join",
"(",
"self",
".",
"_targets",
")",
")",
"if",
"self",
".",
"_dependencies",
":",
"fh"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/makeutil.py#L134-L145 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py | python | TurtleScreenBase._drawimage | (self, item, (x, y), image) | Configure image item as to draw image object
at position (x,y) on canvas) | Configure image item as to draw image object
at position (x,y) on canvas) | [
"Configure",
"image",
"item",
"as",
"to",
"draw",
"image",
"object",
"at",
"position",
"(",
"x",
"y",
")",
"on",
"canvas",
")"
] | def _drawimage(self, item, (x, y), image):
"""Configure image item as to draw image object
at position (x,y) on canvas)
"""
self.cv.coords(item, (x * self.xscale, -y * self.yscale))
self.cv.itemconfig(item, image=image) | [
"def",
"_drawimage",
"(",
"self",
",",
"item",
",",
"(",
"x",
",",
"y",
")",
",",
"image",
")",
":",
"self",
".",
"cv",
".",
"coords",
"(",
"item",
",",
"(",
"x",
"*",
"self",
".",
"xscale",
",",
"-",
"y",
"*",
"self",
".",
"yscale",
")",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py#L731-L736 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/frontend/context.py | python | SourcePath.translated | (self) | return mozpath.normpath(ret) | Returns the corresponding path in the objdir.
Ideally, we wouldn't need this function, but the fact that both source
path under topsrcdir and the external source dir end up mixed in the
objdir (aka pseudo-rework), this is needed. | Returns the corresponding path in the objdir. | [
"Returns",
"the",
"corresponding",
"path",
"in",
"the",
"objdir",
"."
] | def translated(self):
"""Returns the corresponding path in the objdir.
Ideally, we wouldn't need this function, but the fact that both source
path under topsrcdir and the external source dir end up mixed in the
objdir (aka pseudo-rework), this is needed.
"""
if self.valu... | [
"def",
"translated",
"(",
"self",
")",
":",
"if",
"self",
".",
"value",
".",
"startswith",
"(",
"'/'",
")",
":",
"ret",
"=",
"mozpath",
".",
"join",
"(",
"self",
".",
"context",
".",
"config",
".",
"topobjdir",
",",
"self",
".",
"value",
"[",
"1",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/frontend/context.py#L329-L340 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/SANSUtility.py | python | CummulativeTimeSeriesPropertyAdder.extract_sample_logs_from_workspace | (self, lhs, rhs) | When adding specific logs, we need to make sure that the values are added correctly.
:param lhs: the lhs workspace
:param rhs: the rhs workspace | When adding specific logs, we need to make sure that the values are added correctly.
:param lhs: the lhs workspace
:param rhs: the rhs workspace | [
"When",
"adding",
"specific",
"logs",
"we",
"need",
"to",
"make",
"sure",
"that",
"the",
"values",
"are",
"added",
"correctly",
".",
":",
"param",
"lhs",
":",
"the",
"lhs",
"workspace",
":",
"param",
"rhs",
":",
"the",
"rhs",
"workspace"
] | def extract_sample_logs_from_workspace(self, lhs, rhs):
"""
When adding specific logs, we need to make sure that the values are added correctly.
:param lhs: the lhs workspace
:param rhs: the rhs workspace
"""
run_lhs = lhs.getRun()
run_rhs = rhs.getRun()
#... | [
"def",
"extract_sample_logs_from_workspace",
"(",
"self",
",",
"lhs",
",",
"rhs",
")",
":",
"run_lhs",
"=",
"lhs",
".",
"getRun",
"(",
")",
"run_rhs",
"=",
"rhs",
".",
"getRun",
"(",
")",
"# Get the cumulative time s",
"for",
"element",
"in",
"self",
".",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/SANSUtility.py#L1287-L1326 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py | python | IRBuilder.block | (self) | return self._block | The current basic block. | The current basic block. | [
"The",
"current",
"basic",
"block",
"."
] | def block(self):
"""
The current basic block.
"""
return self._block | [
"def",
"block",
"(",
"self",
")",
":",
"return",
"self",
".",
"_block"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py#L176-L180 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/json_schema_compiler/idl_schema.py | python | Main | () | Dump a json serialization of parse result for the IDL files whose names
were passed in on the command line. | Dump a json serialization of parse result for the IDL files whose names
were passed in on the command line. | [
"Dump",
"a",
"json",
"serialization",
"of",
"parse",
"result",
"for",
"the",
"IDL",
"files",
"whose",
"names",
"were",
"passed",
"in",
"on",
"the",
"command",
"line",
"."
] | def Main():
'''
Dump a json serialization of parse result for the IDL files whose names
were passed in on the command line.
'''
if len(sys.argv) > 1:
for filename in sys.argv[1:]:
schema = Load(filename)
print json.dumps(schema, indent=2)
else:
contents = sys.stdin.read()
idl = idl_p... | [
"def",
"Main",
"(",
")",
":",
"if",
"len",
"(",
"sys",
".",
"argv",
")",
">",
"1",
":",
"for",
"filename",
"in",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
":",
"schema",
"=",
"Load",
"(",
"filename",
")",
"print",
"json",
".",
"dumps",
"(",
"sc... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/idl_schema.py#L543-L556 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/support/layer1.py | python | SupportConnection.describe_trusted_advisor_check_summaries | (self, check_ids) | return self.make_request(action='DescribeTrustedAdvisorCheckSummaries',
body=json.dumps(params)) | Returns the summaries of the results of the Trusted Advisor
checks that have the specified check IDs. Check IDs can be
obtained by calling DescribeTrustedAdvisorChecks.
The response contains an array of TrustedAdvisorCheckSummary
objects.
:type check_ids: list
:param ch... | Returns the summaries of the results of the Trusted Advisor
checks that have the specified check IDs. Check IDs can be
obtained by calling DescribeTrustedAdvisorChecks. | [
"Returns",
"the",
"summaries",
"of",
"the",
"results",
"of",
"the",
"Trusted",
"Advisor",
"checks",
"that",
"have",
"the",
"specified",
"check",
"IDs",
".",
"Check",
"IDs",
"can",
"be",
"obtained",
"by",
"calling",
"DescribeTrustedAdvisorChecks",
"."
] | def describe_trusted_advisor_check_summaries(self, check_ids):
"""
Returns the summaries of the results of the Trusted Advisor
checks that have the specified check IDs. Check IDs can be
obtained by calling DescribeTrustedAdvisorChecks.
The response contains an array of TrustedAd... | [
"def",
"describe_trusted_advisor_check_summaries",
"(",
"self",
",",
"check_ids",
")",
":",
"params",
"=",
"{",
"'checkIds'",
":",
"check_ids",
",",
"}",
"return",
"self",
".",
"make_request",
"(",
"action",
"=",
"'DescribeTrustedAdvisorCheckSummaries'",
",",
"body"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/support/layer1.py#L574-L589 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/dev/riscv/HiFive.py | python | HiFive.attachPlic | (self) | Count number of PLIC interrupt sources | Count number of PLIC interrupt sources | [
"Count",
"number",
"of",
"PLIC",
"interrupt",
"sources"
] | def attachPlic(self):
"""Count number of PLIC interrupt sources
"""
plic_srcs = [self.uart_int_id]
for device in self._off_chip_devices():
if hasattr(device, "interrupt_id"):
plic_srcs.append(device.interrupt_id)
self.plic.n_src = max(plic_srcs) + 1 | [
"def",
"attachPlic",
"(",
"self",
")",
":",
"plic_srcs",
"=",
"[",
"self",
".",
"uart_int_id",
"]",
"for",
"device",
"in",
"self",
".",
"_off_chip_devices",
"(",
")",
":",
"if",
"hasattr",
"(",
"device",
",",
"\"interrupt_id\"",
")",
":",
"plic_srcs",
".... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/dev/riscv/HiFive.py#L151-L158 | ||
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/pyratemp.py | python | escape | (s, format=HTML) | return unicode(s) | Replace special characters by their escape sequence.
:Parameters:
- `s`: string or unicode-string to escape
- `format`:
- `NONE`: nothing is replaced
- `HTML`: replace &<>'" by &...;
- `LATEX`: replace \#$%&_{} (TODO! - this is very incomplete!)
:Returns:
... | Replace special characters by their escape sequence. | [
"Replace",
"special",
"characters",
"by",
"their",
"escape",
"sequence",
"."
] | def escape(s, format=HTML):
"""Replace special characters by their escape sequence.
:Parameters:
- `s`: string or unicode-string to escape
- `format`:
- `NONE`: nothing is replaced
- `HTML`: replace &<>'" by &...;
- `LATEX`: replace \#$%&_{} (TODO! - this i... | [
"def",
"escape",
"(",
"s",
",",
"format",
"=",
"HTML",
")",
":",
"#Note: If you have to make sure that every character gets replaced",
"# only once (and if you cannot achieve this with the following code),",
"# use something like u\"\".join([replacedict.get(c,c) for c in s])",
"#... | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/pyratemp.py#L253-L298 | |
ideawu/ssdb | f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4 | deps/cpy/antlr3/streams.py | python | CharStream.getCharPositionInLine | (self) | The index of the character relative to the beginning of the line 0..n-1 | The index of the character relative to the beginning of the line 0..n-1 | [
"The",
"index",
"of",
"the",
"character",
"relative",
"to",
"the",
"beginning",
"of",
"the",
"line",
"0",
"..",
"n",
"-",
"1"
] | def getCharPositionInLine(self):
"""
The index of the character relative to the beginning of the line 0..n-1
"""
raise NotImplementedError | [
"def",
"getCharPositionInLine",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/ideawu/ssdb/blob/f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4/deps/cpy/antlr3/streams.py#L231-L236 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.ConvertDialogSizeToPixels | (*args, **kwargs) | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) | ConvertDialogSizeToPixels(self, Size sz) -> Size
Converts a point or size from dialog units to pixels. Dialog units
are used for maintaining a dialog's proportions even if the font
changes. For the x dimension, the dialog units are multiplied by the
average character width and then div... | ConvertDialogSizeToPixels(self, Size sz) -> Size | [
"ConvertDialogSizeToPixels",
"(",
"self",
"Size",
"sz",
")",
"-",
">",
"Size"
] | def ConvertDialogSizeToPixels(*args, **kwargs):
"""
ConvertDialogSizeToPixels(self, Size sz) -> Size
Converts a point or size from dialog units to pixels. Dialog units
are used for maintaining a dialog's proportions even if the font
changes. For the x dimension, the dialog unit... | [
"def",
"ConvertDialogSizeToPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_ConvertDialogSizeToPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L10561-L10572 | |
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/addins/c.py | python | CAddin.generateHeader | (self, func, suffix) | return CAddin.BUFFER_FUNCDEC % {
'func_name' : func.name(),
'func_dec' : functionDeclaration,
'func_ret' : self.functionReturnType_.apply(func.returnValue()),
'suffix' : suffix } | Generate source for prototype of given function. | Generate source for prototype of given function. | [
"Generate",
"source",
"for",
"prototype",
"of",
"given",
"function",
"."
] | def generateHeader(self, func, suffix):
"""Generate source for prototype of given function."""
functionDeclaration = func.parameterList().generate(self.functionDeclaration_)
if functionDeclaration: functionDeclaration += ','
return CAddin.BUFFER_FUNCDEC % {
'func_name' : func... | [
"def",
"generateHeader",
"(",
"self",
",",
"func",
",",
"suffix",
")",
":",
"functionDeclaration",
"=",
"func",
".",
"parameterList",
"(",
")",
".",
"generate",
"(",
"self",
".",
"functionDeclaration_",
")",
"if",
"functionDeclaration",
":",
"functionDeclaration... | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/addins/c.py#L71-L79 | |
HKUST-Aerial-Robotics/Teach-Repeat-Replan | 98505a7f74b13c8b501176ff838a38423dbef536 | utils/quadrotor_msgs/src/quadrotor_msgs/msg/_Serial.py | python | Serial.serialize | (self, buff) | serialize message into buffer
:param buff: buffer, ``StringIO`` | serialize message into buffer
:param buff: buffer, ``StringIO`` | [
"serialize",
"message",
"into",
"buffer",
":",
"param",
"buff",
":",
"buffer",
"StringIO"
] | def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
_x = self.header.frame_id
length = len(_x)
if python3 or type(_x) ==... | [
"def",
"serialize",
"(",
"self",
",",
"buff",
")",
":",
"try",
":",
"_x",
"=",
"self",
"buff",
".",
"write",
"(",
"_struct_3I",
".",
"pack",
"(",
"_x",
".",
"header",
".",
"seq",
",",
"_x",
".",
"header",
".",
"stamp",
".",
"secs",
",",
"_x",
"... | https://github.com/HKUST-Aerial-Robotics/Teach-Repeat-Replan/blob/98505a7f74b13c8b501176ff838a38423dbef536/utils/quadrotor_msgs/src/quadrotor_msgs/msg/_Serial.py#L94-L121 | ||
zerollzeng/tiny-tensorrt | e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2 | third_party/pybind11/tools/clang/cindex.py | python | Type.get_ref_qualifier | (self) | return RefQualifierKind.from_id(
conf.lib.clang_Type_getCXXRefQualifier(self)) | Retrieve the ref-qualifier of the type. | Retrieve the ref-qualifier of the type. | [
"Retrieve",
"the",
"ref",
"-",
"qualifier",
"of",
"the",
"type",
"."
] | def get_ref_qualifier(self):
"""
Retrieve the ref-qualifier of the type.
"""
return RefQualifierKind.from_id(
conf.lib.clang_Type_getCXXRefQualifier(self)) | [
"def",
"get_ref_qualifier",
"(",
"self",
")",
":",
"return",
"RefQualifierKind",
".",
"from_id",
"(",
"conf",
".",
"lib",
".",
"clang_Type_getCXXRefQualifier",
"(",
"self",
")",
")"
] | https://github.com/zerollzeng/tiny-tensorrt/blob/e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2/third_party/pybind11/tools/clang/cindex.py#L2101-L2106 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armoryengine/PyBtcWallet.py | python | PyBtcWallet.detectHighestUsedIndex | (self, startFrom=0, writeResultToWallet=False, fullscan=False) | return highestIndex | This method is used to find the highestUsedChainIndex value of the
wallet WITHIN its address pool. It will NOT extend its address pool
in this search, because it is assumed that the wallet couldn't have
used any addresses it had not calculated yet.
If you have a wallet IMPORT, though, or a wa... | This method is used to find the highestUsedChainIndex value of the
wallet WITHIN its address pool. It will NOT extend its address pool
in this search, because it is assumed that the wallet couldn't have
used any addresses it had not calculated yet. | [
"This",
"method",
"is",
"used",
"to",
"find",
"the",
"highestUsedChainIndex",
"value",
"of",
"the",
"wallet",
"WITHIN",
"its",
"address",
"pool",
".",
"It",
"will",
"NOT",
"extend",
"its",
"address",
"pool",
"in",
"this",
"search",
"because",
"it",
"is",
"... | def detectHighestUsedIndex(self, startFrom=0, writeResultToWallet=False, fullscan=False):
"""
This method is used to find the highestUsedChainIndex value of the
wallet WITHIN its address pool. It will NOT extend its address pool
in this search, because it is assumed that the wallet couldn't ha... | [
"def",
"detectHighestUsedIndex",
"(",
"self",
",",
"startFrom",
"=",
"0",
",",
"writeResultToWallet",
"=",
"False",
",",
"fullscan",
"=",
"False",
")",
":",
"if",
"fullscan",
":",
"startFrom",
"=",
"0",
"highestIndex",
"=",
"max",
"(",
"self",
".",
"highes... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/PyBtcWallet.py#L1074-L1107 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | v8_4_5/build/landmine_utils.py | python | memoize | (default=None) | return memoizer | This decorator caches the return value of a parameterless pure function | This decorator caches the return value of a parameterless pure function | [
"This",
"decorator",
"caches",
"the",
"return",
"value",
"of",
"a",
"parameterless",
"pure",
"function"
] | def memoize(default=None):
"""This decorator caches the return value of a parameterless pure function"""
def memoizer(func):
val = []
@functools.wraps(func)
def inner():
if not val:
ret = func()
val.append(ret if ret is not None else default)
if logging.getLogger().isEnable... | [
"def",
"memoize",
"(",
"default",
"=",
"None",
")",
":",
"def",
"memoizer",
"(",
"func",
")",
":",
"val",
"=",
"[",
"]",
"@",
"functools",
".",
"wraps",
"(",
"func",
")",
"def",
"inner",
"(",
")",
":",
"if",
"not",
"val",
":",
"ret",
"=",
"func... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_4_5/build/landmine_utils.py#L13-L26 | |
Project-OSRM/osrm-backend | f2e284623e25b5570dd2a5e6985abcb3790fd348 | third_party/flatbuffers/python/flatbuffers/builder.py | python | Builder.PlaceUOffsetT | (self, x) | PlaceUOffsetT prepends a UOffsetT to the Builder, without checking
for space. | PlaceUOffsetT prepends a UOffsetT to the Builder, without checking
for space. | [
"PlaceUOffsetT",
"prepends",
"a",
"UOffsetT",
"to",
"the",
"Builder",
"without",
"checking",
"for",
"space",
"."
] | def PlaceUOffsetT(self, x):
"""PlaceUOffsetT prepends a UOffsetT to the Builder, without checking
for space.
"""
N.enforce_number(x, N.UOffsetTFlags)
self.head = self.head - N.UOffsetTFlags.bytewidth
encode.Write(packer.uoffset, self.Bytes, self.Head(), x) | [
"def",
"PlaceUOffsetT",
"(",
"self",
",",
"x",
")",
":",
"N",
".",
"enforce_number",
"(",
"x",
",",
"N",
".",
"UOffsetTFlags",
")",
"self",
".",
"head",
"=",
"self",
".",
"head",
"-",
"N",
".",
"UOffsetTFlags",
".",
"bytewidth",
"encode",
".",
"Write... | https://github.com/Project-OSRM/osrm-backend/blob/f2e284623e25b5570dd2a5e6985abcb3790fd348/third_party/flatbuffers/python/flatbuffers/builder.py#L725-L731 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/llvm/bindings/python/llvm/disassembler.py | python | Disassembler.get_instructions | (self, source, pc=0) | Obtain multiple instructions from an input source.
This is like get_instruction() except it is a generator for all
instructions within the source. It starts at the beginning of the
source and reads instructions until no more can be read.
This generator returns 3-tuple of:
lo... | Obtain multiple instructions from an input source. | [
"Obtain",
"multiple",
"instructions",
"from",
"an",
"input",
"source",
"."
] | def get_instructions(self, source, pc=0):
"""Obtain multiple instructions from an input source.
This is like get_instruction() except it is a generator for all
instructions within the source. It starts at the beginning of the
source and reads instructions until no more can be read.
... | [
"def",
"get_instructions",
"(",
"self",
",",
"source",
",",
"pc",
"=",
"0",
")",
":",
"source_bytes",
"=",
"c_char_p",
"(",
"source",
")",
"out_str",
"=",
"cast",
"(",
"(",
"c_byte",
"*",
"255",
")",
"(",
")",
",",
"c_char_p",
")",
"# This could probab... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/llvm/bindings/python/llvm/disassembler.py#L109-L142 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | is_bv_value | (a) | return is_bv(a) and _is_numeral(a.ctx, a.as_ast()) | Return `True` if `a` is a Z3 bit-vector numeral value.
>>> b = BitVec('b', 32)
>>> is_bv_value(b)
False
>>> b = BitVecVal(10, 32)
>>> b
10
>>> is_bv_value(b)
True | Return `True` if `a` is a Z3 bit-vector numeral value. | [
"Return",
"True",
"if",
"a",
"is",
"a",
"Z3",
"bit",
"-",
"vector",
"numeral",
"value",
"."
] | def is_bv_value(a):
"""Return `True` if `a` is a Z3 bit-vector numeral value.
>>> b = BitVec('b', 32)
>>> is_bv_value(b)
False
>>> b = BitVecVal(10, 32)
>>> b
10
>>> is_bv_value(b)
True
"""
return is_bv(a) and _is_numeral(a.ctx, a.as_ast()) | [
"def",
"is_bv_value",
"(",
"a",
")",
":",
"return",
"is_bv",
"(",
"a",
")",
"and",
"_is_numeral",
"(",
"a",
".",
"ctx",
",",
"a",
".",
"as_ast",
"(",
")",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L3923-L3935 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/util/cloudpickle.py | python | CloudPickler.save_inst | (self, obj) | Inner logic to save instance. Based off pickle.save_inst
Supports __transient__ | Inner logic to save instance. Based off pickle.save_inst
Supports __transient__ | [
"Inner",
"logic",
"to",
"save",
"instance",
".",
"Based",
"off",
"pickle",
".",
"save_inst",
"Supports",
"__transient__"
] | def save_inst(self, obj):
"""Inner logic to save instance. Based off pickle.save_inst
Supports __transient__"""
cls = obj.__class__
memo = self.memo
write = self.write
save = self.save
if hasattr(obj, '__getinitargs__'):
args = obj.__getinitargs__()
... | [
"def",
"save_inst",
"(",
"self",
",",
"obj",
")",
":",
"cls",
"=",
"obj",
".",
"__class__",
"memo",
"=",
"self",
".",
"memo",
"write",
"=",
"self",
".",
"write",
"save",
"=",
"self",
".",
"save",
"if",
"hasattr",
"(",
"obj",
",",
"'__getinitargs__'",... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/util/cloudpickle.py#L394-L439 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py | python | _SkipFixed64 | (buffer, pos, end) | return pos | Skip a fixed64 value. Returns the new position. | Skip a fixed64 value. Returns the new position. | [
"Skip",
"a",
"fixed64",
"value",
".",
"Returns",
"the",
"new",
"position",
"."
] | def _SkipFixed64(buffer, pos, end):
"""Skip a fixed64 value. Returns the new position."""
pos += 8
if pos > end:
raise _DecodeError('Truncated message.')
return pos | [
"def",
"_SkipFixed64",
"(",
"buffer",
",",
"pos",
",",
"end",
")",
":",
"pos",
"+=",
"8",
"if",
"pos",
">",
"end",
":",
"raise",
"_DecodeError",
"(",
"'Truncated message.'",
")",
"return",
"pos"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py#L563-L569 | |
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | orttraining/orttraining/python/training/_utils.py | python | state_dict_original_dimension_key | () | return 'original_dim' | Returns the original dimension key name in the state dictionary | Returns the original dimension key name in the state dictionary | [
"Returns",
"the",
"original",
"dimension",
"key",
"name",
"in",
"the",
"state",
"dictionary"
] | def state_dict_original_dimension_key():
"""Returns the original dimension key name in the state dictionary"""
return 'original_dim' | [
"def",
"state_dict_original_dimension_key",
"(",
")",
":",
"return",
"'original_dim'"
] | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/_utils.py#L241-L244 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py | python | easy_install.expand_dirs | (self) | Calls `os.path.expanduser` on install dirs. | Calls `os.path.expanduser` on install dirs. | [
"Calls",
"os",
".",
"path",
".",
"expanduser",
"on",
"install",
"dirs",
"."
] | def expand_dirs(self):
"""Calls `os.path.expanduser` on install dirs."""
dirs = [
'install_purelib',
'install_platlib',
'install_lib',
'install_headers',
'install_scripts',
'install_data',
]
self._expand_attrs(dirs) | [
"def",
"expand_dirs",
"(",
"self",
")",
":",
"dirs",
"=",
"[",
"'install_purelib'",
",",
"'install_platlib'",
",",
"'install_lib'",
",",
"'install_headers'",
",",
"'install_scripts'",
",",
"'install_data'",
",",
"]",
"self",
".",
"_expand_attrs",
"(",
"dirs",
")... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py#L395-L405 | ||
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/lineeditor/history.py | python | LineHistory.next_history | (self, current) | Move forward through the history list, fetching the next command. | Move forward through the history list, fetching the next command. | [
"Move",
"forward",
"through",
"the",
"history",
"list",
"fetching",
"the",
"next",
"command",
"."
] | def next_history(self, current): # (C-n)
'''Move forward through the history list, fetching the next command. '''
if self.history_cursor < len(self.history) - 1:
self.history_cursor += 1
current.set_line(self.history[self.history_cursor].get_line_text()) | [
"def",
"next_history",
"(",
"self",
",",
"current",
")",
":",
"# (C-n)",
"if",
"self",
".",
"history_cursor",
"<",
"len",
"(",
"self",
".",
"history",
")",
"-",
"1",
":",
"self",
".",
"history_cursor",
"+=",
"1",
"current",
".",
"set_line",
"(",
"self"... | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/lineeditor/history.py#L129-L133 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | ext/ply/example/BASIC/basparse.py | python | p_number | (p) | number : INTEGER
| FLOAT | number : INTEGER
| FLOAT | [
"number",
":",
"INTEGER",
"|",
"FLOAT"
] | def p_number(p):
'''number : INTEGER
| FLOAT'''
p[0] = eval(p[1]) | [
"def",
"p_number",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"eval",
"(",
"p",
"[",
"1",
"]",
")"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/BASIC/basparse.py#L358-L361 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/array_ops.py | python | zeros | (shape, dtype=dtypes.float32, name=None) | return output | Creates a tensor with all elements set to zero.
This operation returns a tensor of type `dtype` with shape `shape` and
all elements set to zero.
For example:
```python
tf.zeros([3, 4], int32) ==> [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
```
Args:
shape: Either a list of integers, or a 1-D `Tenso... | Creates a tensor with all elements set to zero. | [
"Creates",
"a",
"tensor",
"with",
"all",
"elements",
"set",
"to",
"zero",
"."
] | def zeros(shape, dtype=dtypes.float32, name=None):
"""Creates a tensor with all elements set to zero.
This operation returns a tensor of type `dtype` with shape `shape` and
all elements set to zero.
For example:
```python
tf.zeros([3, 4], int32) ==> [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
```
Arg... | [
"def",
"zeros",
"(",
"shape",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"shape",
"]",
",",
"name",
",",
"\"zeros\"",
")",
"as",
"name",
":",
"try",
":",
"shape",
"="... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/array_ops.py#L1046-L1074 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Image.Copy | (*args, **kwargs) | return _core_.Image_Copy(*args, **kwargs) | Copy(self) -> Image
Returns an identical copy of the image. | Copy(self) -> Image | [
"Copy",
"(",
"self",
")",
"-",
">",
"Image"
] | def Copy(*args, **kwargs):
"""
Copy(self) -> Image
Returns an identical copy of the image.
"""
return _core_.Image_Copy(*args, **kwargs) | [
"def",
"Copy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_Copy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L3340-L3346 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/interpolate/fitpack2.py | python | UnivariateSpline.get_coeffs | (self) | return data[9][:n-k-1] | Return spline coefficients. | Return spline coefficients. | [
"Return",
"spline",
"coefficients",
"."
] | def get_coeffs(self):
"""Return spline coefficients."""
data = self._data
k, n = data[5], data[7]
return data[9][:n-k-1] | [
"def",
"get_coeffs",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"_data",
"k",
",",
"n",
"=",
"data",
"[",
"5",
"]",
",",
"data",
"[",
"7",
"]",
"return",
"data",
"[",
"9",
"]",
"[",
":",
"n",
"-",
"k",
"-",
"1",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/interpolate/fitpack2.py#L323-L327 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextBuffer.SetStyleSheet | (*args, **kwargs) | return _richtext.RichTextBuffer_SetStyleSheet(*args, **kwargs) | SetStyleSheet(self, wxRichTextStyleSheet styleSheet) | SetStyleSheet(self, wxRichTextStyleSheet styleSheet) | [
"SetStyleSheet",
"(",
"self",
"wxRichTextStyleSheet",
"styleSheet",
")"
] | def SetStyleSheet(*args, **kwargs):
"""SetStyleSheet(self, wxRichTextStyleSheet styleSheet)"""
return _richtext.RichTextBuffer_SetStyleSheet(*args, **kwargs) | [
"def",
"SetStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_SetStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2213-L2215 | |
MtnViewJohn/context-free | 757d7bde9742f201cec61bd195dda98093edd1e8 | src-scintilla/scripts/FileGenerator.py | python | GenerateFile | (inpath, outpath, commentPrefix, retainDefs, *lists) | Generate 'outpath' from 'inpath'. | Generate 'outpath' from 'inpath'. | [
"Generate",
"outpath",
"from",
"inpath",
"."
] | def GenerateFile(inpath, outpath, commentPrefix, retainDefs, *lists):
"""Generate 'outpath' from 'inpath'.
"""
try:
with codecs.open(inpath, "r", "UTF-8") as infile:
original = infile.read()
updated = CopyWithInsertion(original, commentPrefix,
retainDefs, lists)
... | [
"def",
"GenerateFile",
"(",
"inpath",
",",
"outpath",
",",
"commentPrefix",
",",
"retainDefs",
",",
"*",
"lists",
")",
":",
"try",
":",
"with",
"codecs",
".",
"open",
"(",
"inpath",
",",
"\"r\"",
",",
"\"UTF-8\"",
")",
"as",
"infile",
":",
"original",
... | https://github.com/MtnViewJohn/context-free/blob/757d7bde9742f201cec61bd195dda98093edd1e8/src-scintilla/scripts/FileGenerator.py#L117-L128 | ||
esa/pagmo | 80281d549c8f1b470e1489a5d37c8f06b2e429c0 | PyGMO/topology/__init__.py | python | _to_networkx | (self) | return retval | Export topology as a networkx DiGraph. | Export topology as a networkx DiGraph. | [
"Export",
"topology",
"as",
"a",
"networkx",
"DiGraph",
"."
] | def _to_networkx(self):
"""
Export topology as a networkx DiGraph.
"""
try:
import networkx as nx
except ImportError:
raise ImportError('Could not import the networkx module.')
retval = nx.DiGraph()
for i in range(self.number_of_vertices):
if self.get_num_adjacent_ver... | [
"def",
"_to_networkx",
"(",
"self",
")",
":",
"try",
":",
"import",
"networkx",
"as",
"nx",
"except",
"ImportError",
":",
"raise",
"ImportError",
"(",
"'Could not import the networkx module.'",
")",
"retval",
"=",
"nx",
".",
"DiGraph",
"(",
")",
"for",
"i",
... | https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/topology/__init__.py#L6-L21 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Conv.py | python | TransposedConv3D.filter_size | (self) | return self._internal.get_filter_height(), self._internal.get_filter_width(), self._internal.get_filter_depth() | Gets the filter size. | Gets the filter size. | [
"Gets",
"the",
"filter",
"size",
"."
] | def filter_size(self):
"""Gets the filter size.
"""
return self._internal.get_filter_height(), self._internal.get_filter_width(), self._internal.get_filter_depth() | [
"def",
"filter_size",
"(",
"self",
")",
":",
"return",
"self",
".",
"_internal",
".",
"get_filter_height",
"(",
")",
",",
"self",
".",
"_internal",
".",
"get_filter_width",
"(",
")",
",",
"self",
".",
"_internal",
".",
"get_filter_depth",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Conv.py#L502-L505 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py | python | SpawnBase.expect_list | (self, pattern_list, timeout=-1, searchwindowsize=-1,
async_=False, **kw) | This takes a list of compiled regular expressions and returns the
index into the pattern_list that matched the child output. The list may
also contain EOF or TIMEOUT(which are not compiled regular
expressions). This method is similar to the expect() method except that
expect_list() does ... | This takes a list of compiled regular expressions and returns the
index into the pattern_list that matched the child output. The list may
also contain EOF or TIMEOUT(which are not compiled regular
expressions). This method is similar to the expect() method except that
expect_list() does ... | [
"This",
"takes",
"a",
"list",
"of",
"compiled",
"regular",
"expressions",
"and",
"returns",
"the",
"index",
"into",
"the",
"pattern_list",
"that",
"matched",
"the",
"child",
"output",
".",
"The",
"list",
"may",
"also",
"contain",
"EOF",
"or",
"TIMEOUT",
"(",... | def expect_list(self, pattern_list, timeout=-1, searchwindowsize=-1,
async_=False, **kw):
'''This takes a list of compiled regular expressions and returns the
index into the pattern_list that matched the child output. The list may
also contain EOF or TIMEOUT(which are not com... | [
"def",
"expect_list",
"(",
"self",
",",
"pattern_list",
",",
"timeout",
"=",
"-",
"1",
",",
"searchwindowsize",
"=",
"-",
"1",
",",
"async_",
"=",
"False",
",",
"*",
"*",
"kw",
")",
":",
"if",
"timeout",
"==",
"-",
"1",
":",
"timeout",
"=",
"self",... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L343-L369 | ||
HKUST-Aerial-Robotics/Teach-Repeat-Replan | 98505a7f74b13c8b501176ff838a38423dbef536 | utils/quadrotor_msgs/src/quadrotor_msgs/msg/_AuxCommand.py | python | AuxCommand.serialize_numpy | (self, buff, numpy) | serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module | serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module | [
"serialize",
"message",
"with",
"numpy",
"array",
"types",
"into",
"buffer",
":",
"param",
"buff",
":",
"buffer",
"StringIO",
":",
"param",
"numpy",
":",
"numpy",
"python",
"module"
] | def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self
buff.write(_struct_2d.pack(_x.current_yaw, _x.kf_correction))
buff.write(self.angle_correction... | [
"def",
"serialize_numpy",
"(",
"self",
",",
"buff",
",",
"numpy",
")",
":",
"try",
":",
"_x",
"=",
"self",
"buff",
".",
"write",
"(",
"_struct_2d",
".",
"pack",
"(",
"_x",
".",
"current_yaw",
",",
"_x",
".",
"kf_correction",
")",
")",
"buff",
".",
... | https://github.com/HKUST-Aerial-Robotics/Teach-Repeat-Replan/blob/98505a7f74b13c8b501176ff838a38423dbef536/utils/quadrotor_msgs/src/quadrotor_msgs/msg/_AuxCommand.py#L101-L114 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/distributions/python/ops/binomial.py | python | Binomial.logits | (self) | return self._logits | Log-odds of drawing a `1`. | Log-odds of drawing a `1`. | [
"Log",
"-",
"odds",
"of",
"drawing",
"a",
"1",
"."
] | def logits(self):
"""Log-odds of drawing a `1`."""
return self._logits | [
"def",
"logits",
"(",
"self",
")",
":",
"return",
"self",
".",
"_logits"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/distributions/python/ops/binomial.py#L193-L195 | |
ARM-software/armnn | 5e9965cae1cc6162649910f423ebd86001fc1931 | python/pyarmnn/examples/speech_recognition/preprocess.py | python | MFCC.mel_scale | (self, freq, use_htk_method) | return mel | Gets the mel scale for a particular sample frequency.
Args:
freq: The sampling frequency.
use_htk_method: Boolean to set whether to use HTK method or not.
Returns:
the mel scale | Gets the mel scale for a particular sample frequency. | [
"Gets",
"the",
"mel",
"scale",
"for",
"a",
"particular",
"sample",
"frequency",
"."
] | def mel_scale(self, freq, use_htk_method):
"""
Gets the mel scale for a particular sample frequency.
Args:
freq: The sampling frequency.
use_htk_method: Boolean to set whether to use HTK method or not.
Returns:
the mel scale
"""
if us... | [
"def",
"mel_scale",
"(",
"self",
",",
"freq",
",",
"use_htk_method",
")",
":",
"if",
"use_htk_method",
":",
"return",
"1127.0",
"*",
"np",
".",
"log",
"(",
"1.0",
"+",
"freq",
"/",
"700.0",
")",
"else",
":",
"mel",
"=",
"freq",
"/",
"self",
".",
"F... | https://github.com/ARM-software/armnn/blob/5e9965cae1cc6162649910f423ebd86001fc1931/python/pyarmnn/examples/speech_recognition/preprocess.py#L47-L65 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py | python | ParseResults.append | ( self, item ) | Add single element to end of ParseResults list of elements.
Example::
print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
# use a parse action to compute the sum of the parsed integers, and add it to the end
def append_sum(tokens):
... | Add single element to end of ParseResults list of elements. | [
"Add",
"single",
"element",
"to",
"end",
"of",
"ParseResults",
"list",
"of",
"elements",
"."
] | def append( self, item ):
"""
Add single element to end of ParseResults list of elements.
Example::
print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
# use a parse action to compute the sum of the parsed integers, and add it to t... | [
"def",
"append",
"(",
"self",
",",
"item",
")",
":",
"self",
".",
"__toklist",
".",
"append",
"(",
"item",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L605-L617 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/encoders.py | python | encode_quopri | (msg) | Encode the message's payload in quoted-printable.
Also, add an appropriate Content-Transfer-Encoding header. | Encode the message's payload in quoted-printable. | [
"Encode",
"the",
"message",
"s",
"payload",
"in",
"quoted",
"-",
"printable",
"."
] | def encode_quopri(msg):
"""Encode the message's payload in quoted-printable.
Also, add an appropriate Content-Transfer-Encoding header.
"""
orig = msg.get_payload(decode=True)
encdata = _qencode(orig)
msg.set_payload(encdata)
msg['Content-Transfer-Encoding'] = 'quoted-printable' | [
"def",
"encode_quopri",
"(",
"msg",
")",
":",
"orig",
"=",
"msg",
".",
"get_payload",
"(",
"decode",
"=",
"True",
")",
"encdata",
"=",
"_qencode",
"(",
"orig",
")",
"msg",
".",
"set_payload",
"(",
"encdata",
")",
"msg",
"[",
"'Content-Transfer-Encoding'",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/encoders.py#L38-L46 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/nvmspi.py | python | NvmAccessProviderCmsisDapSpi.write | (self, memory_info, offset, data) | Write the memory with data
:param memory_info: dictionary for the memory as provided by the DeviceMemoryInfo class
:param offset: relative offset within the memory type
:param data: the data to program
:return: None | Write the memory with data | [
"Write",
"the",
"memory",
"with",
"data"
] | def write(self, memory_info, offset, data):
"""
Write the memory with data
:param memory_info: dictionary for the memory as provided by the DeviceMemoryInfo class
:param offset: relative offset within the memory type
:param data: the data to program
:return: None
... | [
"def",
"write",
"(",
"self",
",",
"memory_info",
",",
"offset",
",",
"data",
")",
":",
"# Make sure the data is aligned to a memory page",
"data_aligned",
",",
"offset_aligned",
"=",
"utils",
".",
"pagealign",
"(",
"data",
",",
"offset",
",",
"memory_info",
"[",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/nvmspi.py#L55-L84 | ||
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/build/feature.py | python | subfeature | (feature_name, value_string, subfeature, subvalues, attributes = []) | Declares a subfeature.
feature_name: Root feature that is not a subfeature.
value_string: An optional value-string specifying which feature or
subfeature values this subfeature is specific to,
if any.
subfeature: The name of the subfeature ... | Declares a subfeature.
feature_name: Root feature that is not a subfeature.
value_string: An optional value-string specifying which feature or
subfeature values this subfeature is specific to,
if any.
subfeature: The name of the subfeature ... | [
"Declares",
"a",
"subfeature",
".",
"feature_name",
":",
"Root",
"feature",
"that",
"is",
"not",
"a",
"subfeature",
".",
"value_string",
":",
"An",
"optional",
"value",
"-",
"string",
"specifying",
"which",
"feature",
"or",
"subfeature",
"values",
"this",
"sub... | def subfeature (feature_name, value_string, subfeature, subvalues, attributes = []):
""" Declares a subfeature.
feature_name: Root feature that is not a subfeature.
value_string: An optional value-string specifying which feature or
subfeature values this subfeature is spe... | [
"def",
"subfeature",
"(",
"feature_name",
",",
"value_string",
",",
"subfeature",
",",
"subvalues",
",",
"attributes",
"=",
"[",
"]",
")",
":",
"parent_feature",
"=",
"validate_feature",
"(",
"feature_name",
")",
"# Add grist to the subfeature name if a value-string was... | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/feature.py#L482-L509 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/index/package_finder.py | python | CandidateEvaluator.sort_best_candidate | (
self,
candidates, # type: List[InstallationCandidate]
) | return best_candidate | Return the best candidate per the instance's sort order, or None if
no candidate is acceptable. | Return the best candidate per the instance's sort order, or None if
no candidate is acceptable. | [
"Return",
"the",
"best",
"candidate",
"per",
"the",
"instance",
"s",
"sort",
"order",
"or",
"None",
"if",
"no",
"candidate",
"is",
"acceptable",
"."
] | def sort_best_candidate(
self,
candidates, # type: List[InstallationCandidate]
):
# type: (...) -> Optional[InstallationCandidate]
"""
Return the best candidate per the instance's sort order, or None if
no candidate is acceptable.
"""
if not candida... | [
"def",
"sort_best_candidate",
"(",
"self",
",",
"candidates",
",",
"# type: List[InstallationCandidate]",
")",
":",
"# type: (...) -> Optional[InstallationCandidate]",
"if",
"not",
"candidates",
":",
"return",
"None",
"best_candidate",
"=",
"max",
"(",
"candidates",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/index/package_finder.py#L542-L554 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/packages/six.py | python | _SixMetaPathImporter.get_code | (self, fullname) | return None | Return None
Required, if is_package is implemented | Return None | [
"Return",
"None"
] | def get_code(self, fullname):
"""Return None
Required, if is_package is implemented"""
self.__get_module(fullname) # eventually raises ImportError
return None | [
"def",
"get_code",
"(",
"self",
",",
"fullname",
")",
":",
"self",
".",
"__get_module",
"(",
"fullname",
")",
"# eventually raises ImportError",
"return",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/packages/six.py#L218-L223 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/io/idl.py | python | _read_int64 | (f) | return np.int64(struct.unpack('>q', f.read(8))[0]) | Read a signed 64-bit integer | Read a signed 64-bit integer | [
"Read",
"a",
"signed",
"64",
"-",
"bit",
"integer"
] | def _read_int64(f):
'''Read a signed 64-bit integer'''
return np.int64(struct.unpack('>q', f.read(8))[0]) | [
"def",
"_read_int64",
"(",
"f",
")",
":",
"return",
"np",
".",
"int64",
"(",
"struct",
".",
"unpack",
"(",
"'>q'",
",",
"f",
".",
"read",
"(",
"8",
")",
")",
"[",
"0",
"]",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/io/idl.py#L116-L118 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/tools/scan-build-py/libscanbuild/arguments.py | python | create_intercept_parser | () | return parser | Creates a parser for command-line arguments to 'intercept'. | Creates a parser for command-line arguments to 'intercept'. | [
"Creates",
"a",
"parser",
"for",
"command",
"-",
"line",
"arguments",
"to",
"intercept",
"."
] | def create_intercept_parser():
""" Creates a parser for command-line arguments to 'intercept'. """
parser = create_default_parser()
parser_add_cdb(parser)
parser_add_prefer_wrapper(parser)
parser_add_compilers(parser)
advanced = parser.add_argument_group('advanced options')
group = advanc... | [
"def",
"create_intercept_parser",
"(",
")",
":",
"parser",
"=",
"create_default_parser",
"(",
")",
"parser_add_cdb",
"(",
"parser",
")",
"parser_add_prefer_wrapper",
"(",
"parser",
")",
"parser_add_compilers",
"(",
"parser",
")",
"advanced",
"=",
"parser",
".",
"a... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/tools/scan-build-py/libscanbuild/arguments.py#L143-L164 | |
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetCompilerPdbName | (self, config, expand_special) | return pdbname | Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified. | Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified. | [
"Get",
"the",
"pdb",
"file",
"name",
"that",
"should",
"be",
"used",
"for",
"compiler",
"invocations",
"or",
"None",
"if",
"there",
"s",
"no",
"explicit",
"name",
"specified",
"."
] | def GetCompilerPdbName(self, config, expand_special):
"""Get the pdb file name that should be used for compiler invocations, or
None if there's no explicit name specified."""
config = self._TargetConfig(config)
pdbname = self._Setting(
('VCCLCompilerTool', 'ProgramDataBaseFileName'), config)
... | [
"def",
"GetCompilerPdbName",
"(",
"self",
",",
"config",
",",
"expand_special",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"pdbname",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'VCCLCompilerTool'",
",",
"'ProgramDataBaseFileName'",
... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/msvs_emulation.py#L363-L371 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/formats/latex.py | python | RowStringConverter._compose_cline | (self, i: int, icol: int) | return "".join(lst) | Create clines after multirow-blocks are finished. | Create clines after multirow-blocks are finished. | [
"Create",
"clines",
"after",
"multirow",
"-",
"blocks",
"are",
"finished",
"."
] | def _compose_cline(self, i: int, icol: int) -> str:
"""
Create clines after multirow-blocks are finished.
"""
lst = []
for cl in self.clinebuf:
if cl[0] == i:
lst.append(f"\n\\cline{{{cl[1]:d}-{icol:d}}}")
# remove entries that have bee... | [
"def",
"_compose_cline",
"(",
"self",
",",
"i",
":",
"int",
",",
"icol",
":",
"int",
")",
"->",
"str",
":",
"lst",
"=",
"[",
"]",
"for",
"cl",
"in",
"self",
".",
"clinebuf",
":",
"if",
"cl",
"[",
"0",
"]",
"==",
"i",
":",
"lst",
".",
"append"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/latex.py#L263-L273 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/utils.py | python | _brief_print_list | (lst, limit=7) | return ', '.join(["'%s'"%str(i) for i in lst]) | Print at most `limit` elements of list. | Print at most `limit` elements of list. | [
"Print",
"at",
"most",
"limit",
"elements",
"of",
"list",
"."
] | def _brief_print_list(lst, limit=7):
"""Print at most `limit` elements of list."""
lst = list(lst)
if len(lst) > limit:
return _brief_print_list(lst[:limit//2], limit) + ', ..., ' + \
_brief_print_list(lst[-limit//2:], limit)
return ', '.join(["'%s'"%str(i) for i in lst]) | [
"def",
"_brief_print_list",
"(",
"lst",
",",
"limit",
"=",
"7",
")",
":",
"lst",
"=",
"list",
"(",
"lst",
")",
"if",
"len",
"(",
"lst",
")",
">",
"limit",
":",
"return",
"_brief_print_list",
"(",
"lst",
"[",
":",
"limit",
"//",
"2",
"]",
",",
"li... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/utils.py#L389-L395 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | PyApp_GetMacAboutMenuItemId | (*args) | return _core_.PyApp_GetMacAboutMenuItemId(*args) | PyApp_GetMacAboutMenuItemId() -> long | PyApp_GetMacAboutMenuItemId() -> long | [
"PyApp_GetMacAboutMenuItemId",
"()",
"-",
">",
"long"
] | def PyApp_GetMacAboutMenuItemId(*args):
"""PyApp_GetMacAboutMenuItemId() -> long"""
return _core_.PyApp_GetMacAboutMenuItemId(*args) | [
"def",
"PyApp_GetMacAboutMenuItemId",
"(",
"*",
"args",
")",
":",
"return",
"_core_",
".",
"PyApp_GetMacAboutMenuItemId",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L8278-L8280 | |
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | panreas_hnn/hed-globalweight/scripts/cpp_lint.py | python | _SetOutputFormat | (output_format) | Sets the module's output format. | Sets the module's output format. | [
"Sets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _SetOutputFormat(output_format):
"""Sets the module's output format."""
_cpplint_state.SetOutputFormat(output_format) | [
"def",
"_SetOutputFormat",
"(",
"output_format",
")",
":",
"_cpplint_state",
".",
"SetOutputFormat",
"(",
"output_format",
")"
] | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/scripts/cpp_lint.py#L772-L774 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/toasterbox.py | python | ToasterBox.GetUseFocus | (self) | return self._usefocus | Returns whether :class:`ToasterBox` will steal the focus from the parent application. | Returns whether :class:`ToasterBox` will steal the focus from the parent application. | [
"Returns",
"whether",
":",
"class",
":",
"ToasterBox",
"will",
"steal",
"the",
"focus",
"from",
"the",
"parent",
"application",
"."
] | def GetUseFocus(self):
""" Returns whether :class:`ToasterBox` will steal the focus from the parent application. """
return self._usefocus | [
"def",
"GetUseFocus",
"(",
"self",
")",
":",
"return",
"self",
".",
"_usefocus"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/toasterbox.py#L597-L600 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGridInterface.GetSelectedProperties | (*args, **kwargs) | return _propgrid.PropertyGridInterface_GetSelectedProperties(*args, **kwargs) | GetSelectedProperties(self) -> wxArrayPGProperty | GetSelectedProperties(self) -> wxArrayPGProperty | [
"GetSelectedProperties",
"(",
"self",
")",
"-",
">",
"wxArrayPGProperty"
] | def GetSelectedProperties(*args, **kwargs):
"""GetSelectedProperties(self) -> wxArrayPGProperty"""
return _propgrid.PropertyGridInterface_GetSelectedProperties(*args, **kwargs) | [
"def",
"GetSelectedProperties",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_GetSelectedProperties",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L1280-L1282 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/sparse_ops.py | python | _convert_to_sparse_tensor | (sp_input) | return sp_input | Convert `sp_input` to `SparseTensor` and return it.
Args:
sp_input: `SparseTensor` or `SparseTensorValue`.
Returns:
`sp_input` converted to `SparseTensor`.
Raises:
ValueError: if `sp_input` is neither `SparseTensor` nor `SparseTensorValue`. | Convert `sp_input` to `SparseTensor` and return it. | [
"Convert",
"sp_input",
"to",
"SparseTensor",
"and",
"return",
"it",
"."
] | def _convert_to_sparse_tensor(sp_input):
"""Convert `sp_input` to `SparseTensor` and return it.
Args:
sp_input: `SparseTensor` or `SparseTensorValue`.
Returns:
`sp_input` converted to `SparseTensor`.
Raises:
ValueError: if `sp_input` is neither `SparseTensor` nor `SparseTensorValue`.
"""
if i... | [
"def",
"_convert_to_sparse_tensor",
"(",
"sp_input",
")",
":",
"if",
"isinstance",
"(",
"sp_input",
",",
"sparse_tensor",
".",
"SparseTensorValue",
")",
":",
"return",
"sparse_tensor",
".",
"SparseTensor",
".",
"from_value",
"(",
"sp_input",
")",
"if",
"not",
"i... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/sparse_ops.py#L52-L68 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/python/google/httpd_utils.py | python | ApacheHttpd.__init__ | (self, start_command, stop_command, port_list,
cygserver_path=None) | Args:
start_command: command list to call to start the httpd
stop_command: command list to call to stop the httpd if one has been
started. May kill all httpd processes running on the machine.
port_list: list of ports expected to respond on the local machine when
the serv... | Args:
start_command: command list to call to start the httpd
stop_command: command list to call to stop the httpd if one has been
started. May kill all httpd processes running on the machine.
port_list: list of ports expected to respond on the local machine when
the serv... | [
"Args",
":",
"start_command",
":",
"command",
"list",
"to",
"call",
"to",
"start",
"the",
"httpd",
"stop_command",
":",
"command",
"list",
"to",
"call",
"to",
"stop",
"the",
"httpd",
"if",
"one",
"has",
"been",
"started",
".",
"May",
"kill",
"all",
"http... | def __init__(self, start_command, stop_command, port_list,
cygserver_path=None):
"""Args:
start_command: command list to call to start the httpd
stop_command: command list to call to stop the httpd if one has been
started. May kill all httpd processes running on the machi... | [
"def",
"__init__",
"(",
"self",
",",
"start_command",
",",
"stop_command",
",",
"port_list",
",",
"cygserver_path",
"=",
"None",
")",
":",
"self",
".",
"_http_server_proc",
"=",
"None",
"self",
".",
"_start_command",
"=",
"start_command",
"self",
".",
"_stop_c... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/python/google/httpd_utils.py#L118-L133 | ||
continental/ecal | 204dab80a24fe01abca62541133b311bf0c09608 | lang/python/core/ecal/core/core.py | python | subscriber.set_qos_reliability | (self, qpolicy) | return sub_set_qos_reliability(self.thandle, qpolicy) | set quality of service reliability mode
:param qpolicy: 0 = best_effort_reliability_qos, 1 = reliable_reliability_qos
:type qpolicy: int | set quality of service reliability mode | [
"set",
"quality",
"of",
"service",
"reliability",
"mode"
] | def set_qos_reliability(self, qpolicy):
""" set quality of service reliability mode
:param qpolicy: 0 = best_effort_reliability_qos, 1 = reliable_reliability_qos
:type qpolicy: int
"""
return sub_set_qos_reliability(self.thandle, qpolicy) | [
"def",
"set_qos_reliability",
"(",
"self",
",",
"qpolicy",
")",
":",
"return",
"sub_set_qos_reliability",
"(",
"self",
".",
"thandle",
",",
"qpolicy",
")"
] | https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/lang/python/core/ecal/core/core.py#L672-L680 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/base64.py | python | encodestring | (s) | return "".join(pieces) | Encode a string into multiple lines of base-64 data. | Encode a string into multiple lines of base-64 data. | [
"Encode",
"a",
"string",
"into",
"multiple",
"lines",
"of",
"base",
"-",
"64",
"data",
"."
] | def encodestring(s):
"""Encode a string into multiple lines of base-64 data."""
pieces = []
for i in range(0, len(s), MAXBINSIZE):
chunk = s[i : i + MAXBINSIZE]
pieces.append(binascii.b2a_base64(chunk))
return "".join(pieces) | [
"def",
"encodestring",
"(",
"s",
")",
":",
"pieces",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"s",
")",
",",
"MAXBINSIZE",
")",
":",
"chunk",
"=",
"s",
"[",
"i",
":",
"i",
"+",
"MAXBINSIZE",
"]",
"pieces",
".",
"ap... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/base64.py#L310-L316 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/models/image/cifar10/cifar10_input.py | python | read_cifar10 | (filename_queue) | return result | Reads and parses examples from CIFAR10 data files.
Recommendation: if you want N-way read parallelism, call this function
N times. This will give you N independent Readers reading different
files & positions within those files, which will give better mixing of
examples.
Args:
filename_queue: A queue of... | Reads and parses examples from CIFAR10 data files. | [
"Reads",
"and",
"parses",
"examples",
"from",
"CIFAR10",
"data",
"files",
"."
] | def read_cifar10(filename_queue):
"""Reads and parses examples from CIFAR10 data files.
Recommendation: if you want N-way read parallelism, call this function
N times. This will give you N independent Readers reading different
files & positions within those files, which will give better mixing of
examples.
... | [
"def",
"read_cifar10",
"(",
"filename_queue",
")",
":",
"class",
"CIFAR10Record",
"(",
"object",
")",
":",
"pass",
"result",
"=",
"CIFAR10Record",
"(",
")",
"# Dimensions of the images in the CIFAR-10 dataset.",
"# See http://www.cs.toronto.edu/~kriz/cifar.html for a descriptio... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/models/image/cifar10/cifar10_input.py#L38-L96 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/diffraction/diffraction_adv_setup_script.py | python | AdvancedSetupScript.to_script | (self) | return script | 'Public' method to save the current GUI to string via str() and general class ReductionScript | 'Public' method to save the current GUI to string via str() and general class ReductionScript | [
"Public",
"method",
"to",
"save",
"the",
"current",
"GUI",
"to",
"string",
"via",
"str",
"()",
"and",
"general",
"class",
"ReductionScript"
] | def to_script(self):
""" 'Public' method to save the current GUI to string via str() and general class ReductionScript
"""
# 1. Form (partial) script
parnamevaluedict = self.buildParameterDict()
script = ""
for parname in self.parnamelist:
parvalue = parname... | [
"def",
"to_script",
"(",
"self",
")",
":",
"# 1. Form (partial) script",
"parnamevaluedict",
"=",
"self",
".",
"buildParameterDict",
"(",
")",
"script",
"=",
"\"\"",
"for",
"parname",
"in",
"self",
".",
"parnamelist",
":",
"parvalue",
"=",
"parnamevaluedict",
"[... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/diffraction/diffraction_adv_setup_script.py#L138-L157 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/configdialog.py | python | VarTrace.clear | (self) | Clear lists (for tests). | Clear lists (for tests). | [
"Clear",
"lists",
"(",
"for",
"tests",
")",
"."
] | def clear(self):
"Clear lists (for tests)."
# Call after all tests in a module to avoid memory leaks.
self.untraced.clear()
self.traced.clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"# Call after all tests in a module to avoid memory leaks.",
"self",
".",
"untraced",
".",
"clear",
"(",
")",
"self",
".",
"traced",
".",
"clear",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/configdialog.py#L2212-L2216 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/importIFClegacy.py | python | IfcSchema.readTypes | (self) | return types | Parse all the possible types from the schema,
returns a dictionary Name -> Type | Parse all the possible types from the schema,
returns a dictionary Name -> Type | [
"Parse",
"all",
"the",
"possible",
"types",
"from",
"the",
"schema",
"returns",
"a",
"dictionary",
"Name",
"-",
">",
"Type"
] | def readTypes(self):
"""
Parse all the possible types from the schema,
returns a dictionary Name -> Type
"""
types = {}
for m in re.finditer("TYPE (.*) = (.*);", self.data):
typename, typetype = m.groups()
if typetype in self.SIMPLETYPES:
... | [
"def",
"readTypes",
"(",
"self",
")",
":",
"types",
"=",
"{",
"}",
"for",
"m",
"in",
"re",
".",
"finditer",
"(",
"\"TYPE (.*) = (.*);\"",
",",
"self",
".",
"data",
")",
":",
"typename",
",",
"typetype",
"=",
"m",
".",
"groups",
"(",
")",
"if",
"typ... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importIFClegacy.py#L1423-L1436 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/dos/load_euphonic.py | python | euphonic_calculate_modes | (filename: str, cutoff: float = 20.,
gamma: bool = True,
acoustic_sum_rule: Optional[str] = 'reciprocal') | return modes | Read force constants file with Euphonic and sample frequencies/modes
:param filename: Input data
:param cutoff:
Sampling density of Brillouin-zone. Specified as real-space length
cutoff in Angstrom.
:param gamma:
Shift sampling grid to include the Gamma-point.
:param acoustic_su... | Read force constants file with Euphonic and sample frequencies/modes | [
"Read",
"force",
"constants",
"file",
"with",
"Euphonic",
"and",
"sample",
"frequencies",
"/",
"modes"
] | def euphonic_calculate_modes(filename: str, cutoff: float = 20.,
gamma: bool = True,
acoustic_sum_rule: Optional[str] = 'reciprocal'):
"""
Read force constants file with Euphonic and sample frequencies/modes
:param filename: Input data
:param cu... | [
"def",
"euphonic_calculate_modes",
"(",
"filename",
":",
"str",
",",
"cutoff",
":",
"float",
"=",
"20.",
",",
"gamma",
":",
"bool",
"=",
"True",
",",
"acoustic_sum_rule",
":",
"Optional",
"[",
"str",
"]",
"=",
"'reciprocal'",
")",
":",
"from",
"math",
"i... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/dos/load_euphonic.py#L28-L71 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/xrc.py | python | XmlNode.AddPropertyName | (*args, **kwargs) | return _xrc.XmlNode_AddPropertyName(*args, **kwargs) | AddPropertyName(self, String name, String value) | AddPropertyName(self, String name, String value) | [
"AddPropertyName",
"(",
"self",
"String",
"name",
"String",
"value",
")"
] | def AddPropertyName(*args, **kwargs):
"""AddPropertyName(self, String name, String value)"""
return _xrc.XmlNode_AddPropertyName(*args, **kwargs) | [
"def",
"AddPropertyName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlNode_AddPropertyName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/xrc.py#L378-L380 | |
ArduPilot/ardupilot | 6e684b3496122b8158ac412b609d00004b7ac306 | libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | python | write_ROMFS | (outdir) | create ROMFS embedded header | create ROMFS embedded header | [
"create",
"ROMFS",
"embedded",
"header"
] | def write_ROMFS(outdir):
'''create ROMFS embedded header'''
romfs_list = []
for k in romfs.keys():
romfs_list.append((k, romfs[k]))
env_vars['ROMFS_FILES'] = romfs_list | [
"def",
"write_ROMFS",
"(",
"outdir",
")",
":",
"romfs_list",
"=",
"[",
"]",
"for",
"k",
"in",
"romfs",
".",
"keys",
"(",
")",
":",
"romfs_list",
".",
"append",
"(",
"(",
"k",
",",
"romfs",
"[",
"k",
"]",
")",
")",
"env_vars",
"[",
"'ROMFS_FILES'",
... | https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py#L2083-L2088 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.