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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/clang_format.py | python | reformat_branch | (clang_format, commit_prior_to_reformat, commit_after_reformat) | Reformat a branch made before a clang-format run | Reformat a branch made before a clang-format run | [
"Reformat",
"a",
"branch",
"made",
"before",
"a",
"clang",
"-",
"format",
"run"
] | def reformat_branch(clang_format, commit_prior_to_reformat, commit_after_reformat):
"""Reformat a branch made before a clang-format run
"""
clang_format = ClangFormat(clang_format, _get_build_dir())
if os.getcwd() != git.get_base_dir():
raise ValueError("reformat-branch must be run from the rep... | [
"def",
"reformat_branch",
"(",
"clang_format",
",",
"commit_prior_to_reformat",
",",
"commit_after_reformat",
")",
":",
"clang_format",
"=",
"ClangFormat",
"(",
"clang_format",
",",
"_get_build_dir",
"(",
")",
")",
"if",
"os",
".",
"getcwd",
"(",
")",
"!=",
"git... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/clang_format.py#L354-L483 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/split_benchmark.py | python | build_graph | (device, input_shape, output_sizes, axis) | Build a graph containing a sequence of split operations.
Args:
device: string, the device to run on.
input_shape: shape of the input tensor.
output_sizes: size of each output along axis.
axis: axis to be split along.
Returns:
An array of tensors to run() | Build a graph containing a sequence of split operations. | [
"Build",
"a",
"graph",
"containing",
"a",
"sequence",
"of",
"split",
"operations",
"."
] | def build_graph(device, input_shape, output_sizes, axis):
"""Build a graph containing a sequence of split operations.
Args:
device: string, the device to run on.
input_shape: shape of the input tensor.
output_sizes: size of each output along axis.
axis: axis to be split along.
Returns:
An ar... | [
"def",
"build_graph",
"(",
"device",
",",
"input_shape",
",",
"output_sizes",
",",
"axis",
")",
":",
"with",
"ops",
".",
"device",
"(",
"\"/%s:0\"",
"%",
"device",
")",
":",
"inp",
"=",
"array_ops",
".",
"zeros",
"(",
"input_shape",
")",
"outputs",
"=",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/split_benchmark.py#L34-L52 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/gdb/libpython.py | python | _write_instance_repr | (out, visited, name, pyop_attrdict, address) | Shared code for use by all classes:
write a representation to file-like object "out" | Shared code for use by all classes:
write a representation to file-like object "out" | [
"Shared",
"code",
"for",
"use",
"by",
"all",
"classes",
":",
"write",
"a",
"representation",
"to",
"file",
"-",
"like",
"object",
"out"
] | def _write_instance_repr(out, visited, name, pyop_attrdict, address):
'''Shared code for use by all classes:
write a representation to file-like object "out"'''
out.write('<')
out.write(name)
# Write dictionary of instance attributes:
if isinstance(pyop_attrdict, PyDictObjectPtr):
out.w... | [
"def",
"_write_instance_repr",
"(",
"out",
",",
"visited",
",",
"name",
",",
"pyop_attrdict",
",",
"address",
")",
":",
"out",
".",
"write",
"(",
"'<'",
")",
"out",
".",
"write",
"(",
"name",
")",
"# Write dictionary of instance attributes:",
"if",
"isinstance... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/gdb/libpython.py#L440-L458 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/data_flow_ops.py | python | Barrier.incomplete_size | (self, name=None) | return gen_data_flow_ops.barrier_incomplete_size(
self._barrier_ref, name=name) | Compute the number of incomplete elements in the given barrier.
Args:
name: A name for the operation (optional).
Returns:
A single-element tensor containing the number of incomplete elements in
the given barrier. | Compute the number of incomplete elements in the given barrier. | [
"Compute",
"the",
"number",
"of",
"incomplete",
"elements",
"in",
"the",
"given",
"barrier",
"."
] | def incomplete_size(self, name=None):
"""Compute the number of incomplete elements in the given barrier.
Args:
name: A name for the operation (optional).
Returns:
A single-element tensor containing the number of incomplete elements in
the given barrier.
"""
if name is None:
... | [
"def",
"incomplete_size",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"\"%s_BarrierIncompleteSize\"",
"%",
"self",
".",
"_name",
"return",
"gen_data_flow_ops",
".",
"barrier_incomplete_size",
"(",
"self",
".",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/data_flow_ops.py#L1146-L1159 | |
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/service_reflection.py | python | GeneratedServiceStubType.__init__ | (cls, name, bases, dictionary) | Creates a message service stub class.
Args:
name: Name of the class (ignored, here).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
dictionary[_DESCRIPTOR_KEY] must contain a ServiceDescriptor object
describing ... | Creates a message service stub class. | [
"Creates",
"a",
"message",
"service",
"stub",
"class",
"."
] | def __init__(cls, name, bases, dictionary):
"""Creates a message service stub class.
Args:
name: Name of the class (ignored, here).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
dictionary[_DESCRIPTOR_KEY] must con... | [
"def",
"__init__",
"(",
"cls",
",",
"name",
",",
"bases",
",",
"dictionary",
")",
":",
"super",
"(",
"GeneratedServiceStubType",
",",
"cls",
")",
".",
"__init__",
"(",
"name",
",",
"bases",
",",
"dictionary",
")",
"# Don't do anything if this class doesn't have ... | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/service_reflection.py#L94-L111 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | GenericDirCtrl.Create | (*args, **kwargs) | return _controls_.GenericDirCtrl_Create(*args, **kwargs) | Create(self, Window parent, int id=-1, String dir=DirDialogDefaultFolderStr,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=DIRCTRL_3D_INTERNAL,
String filter=EmptyString, int defaultFilter=0,
String name=TreeCtrlNameStr) -> bool | Create(self, Window parent, int id=-1, String dir=DirDialogDefaultFolderStr,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=DIRCTRL_3D_INTERNAL,
String filter=EmptyString, int defaultFilter=0,
String name=TreeCtrlNameStr) -> bool | [
"Create",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"String",
"dir",
"=",
"DirDialogDefaultFolderStr",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"DIRCTRL_3D_INTERNAL",
"String",
"filter",... | def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String dir=DirDialogDefaultFolderStr,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=DIRCTRL_3D_INTERNAL,
String filter=EmptyString, int defaultFilter=0,
String name=... | [
"def",
"Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"GenericDirCtrl_Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5655-L5663 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/specs/python/specs_ops.py | python | Dwm | (n) | return Cm(n, [1, 1]) | Depth-wise convolution + softmax (used after LSTM). | Depth-wise convolution + softmax (used after LSTM). | [
"Depth",
"-",
"wise",
"convolution",
"+",
"softmax",
"(",
"used",
"after",
"LSTM",
")",
"."
] | def Dwm(n):
"""Depth-wise convolution + softmax (used after LSTM)."""
return Cm(n, [1, 1]) | [
"def",
"Dwm",
"(",
"n",
")",
":",
"return",
"Cm",
"(",
"n",
",",
"[",
"1",
",",
"1",
"]",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/specs/python/specs_ops.py#L142-L144 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/linear_model/_base.py | python | _rescale_data | (X, y, sample_weight) | return X, y | Rescale data so as to support sample_weight | Rescale data so as to support sample_weight | [
"Rescale",
"data",
"so",
"as",
"to",
"support",
"sample_weight"
] | def _rescale_data(X, y, sample_weight):
"""Rescale data so as to support sample_weight"""
n_samples = X.shape[0]
sample_weight = np.asarray(sample_weight)
if sample_weight.ndim == 0:
sample_weight = np.full(n_samples, sample_weight,
dtype=sample_weight.dtype)
... | [
"def",
"_rescale_data",
"(",
"X",
",",
"y",
",",
"sample_weight",
")",
":",
"n_samples",
"=",
"X",
".",
"shape",
"[",
"0",
"]",
"sample_weight",
"=",
"np",
".",
"asarray",
"(",
"sample_weight",
")",
"if",
"sample_weight",
".",
"ndim",
"==",
"0",
":",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_base.py#L182-L194 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | CheckForIncludeWhatYouUse | (filename, clean_lines, include_state, error,
io=codecs) | Reports for missing stl includes.
This function will output warnings to make sure you are including the headers
necessary for the stl containers and functions that you use. We only give one
reason to include a header. For example, if you use both equal_to<> and
less<> in a .h file, only one (the latter in the ... | Reports for missing stl includes. | [
"Reports",
"for",
"missing",
"stl",
"includes",
"."
] | def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
io=codecs):
"""Reports for missing stl includes.
This function will output warnings to make sure you are including the headers
necessary for the stl containers and functions that you use. We only give one
r... | [
"def",
"CheckForIncludeWhatYouUse",
"(",
"filename",
",",
"clean_lines",
",",
"include_state",
",",
"error",
",",
"io",
"=",
"codecs",
")",
":",
"required",
"=",
"{",
"}",
"# A map of header name to linenumber and the template entity.",
"# Example of required: { '<functiona... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L3657-L3747 | ||
MhLiao/TextBoxes_plusplus | 39d4898de1504c53a2ed3d67966a57b3595836d0 | python/caffe/detector.py | python | Detector.detect_selective_search | (self, image_fnames) | return self.detect_windows(zip(image_fnames, windows_list)) | Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net.
Parameters
----------
image_fnames: list
Returns
-------
detections: list of {filename: image filename, window: crop coordinates,
... | Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net. | [
"Do",
"windowed",
"detection",
"over",
"Selective",
"Search",
"proposals",
"by",
"extracting",
"the",
"crop",
"and",
"warping",
"to",
"the",
"input",
"dimensions",
"of",
"the",
"net",
"."
] | def detect_selective_search(self, image_fnames):
"""
Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net.
Parameters
----------
image_fnames: list
Returns
-------
detections:... | [
"def",
"detect_selective_search",
"(",
"self",
",",
"image_fnames",
")",
":",
"import",
"selective_search_ijcv_with_python",
"as",
"selective_search",
"# Make absolute paths so MATLAB can find the files.",
"image_fnames",
"=",
"[",
"os",
".",
"path",
".",
"abspath",
"(",
... | https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/python/caffe/detector.py#L101-L123 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_hydroelastic_contact.py | python | HydroelasticContactVisualizer.set_min_pressure | (self) | Slot for dialog widget | Slot for dialog widget | [
"Slot",
"for",
"dialog",
"widget"
] | def set_min_pressure(self):
"""Slot for dialog widget"""
new_value = float(self.dlg.min_pressure.text)
if new_value != self.min_pressure:
self.min_pressure = new_value
self.update_pressure_range()
self.update_visual_data_from_message() | [
"def",
"set_min_pressure",
"(",
"self",
")",
":",
"new_value",
"=",
"float",
"(",
"self",
".",
"dlg",
".",
"min_pressure",
".",
"text",
")",
"if",
"new_value",
"!=",
"self",
".",
"min_pressure",
":",
"self",
".",
"min_pressure",
"=",
"new_value",
"self",
... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_hydroelastic_contact.py#L1005-L1011 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/xcode_emulation.py | python | MacPrefixHeader.GetInclude | (self, lang, arch=None) | Gets the cflags to include the prefix header for language |lang|. | Gets the cflags to include the prefix header for language |lang|. | [
"Gets",
"the",
"cflags",
"to",
"include",
"the",
"prefix",
"header",
"for",
"language",
"|lang|",
"."
] | def GetInclude(self, lang, arch=None):
"""Gets the cflags to include the prefix header for language |lang|."""
if self.compile_headers and lang in self.compiled_headers:
return "-include %s" % self._CompiledHeader(lang, arch)
elif self.header:
return "-include %s" % self.... | [
"def",
"GetInclude",
"(",
"self",
",",
"lang",
",",
"arch",
"=",
"None",
")",
":",
"if",
"self",
".",
"compile_headers",
"and",
"lang",
"in",
"self",
".",
"compiled_headers",
":",
"return",
"\"-include %s\"",
"%",
"self",
".",
"_CompiledHeader",
"(",
"lang... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/xcode_emulation.py#L1435-L1442 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBAddress.__oct__ | (self) | return '%o' % int(self) | Convert the address to an octal string | Convert the address to an octal string | [
"Convert",
"the",
"address",
"to",
"an",
"octal",
"string"
] | def __oct__(self):
'''Convert the address to an octal string'''
return '%o' % int(self) | [
"def",
"__oct__",
"(",
"self",
")",
":",
"return",
"'%o'",
"%",
"int",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1011-L1013 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.SetKeysUnicode | (*args, **kwargs) | return _stc.StyledTextCtrl_SetKeysUnicode(*args, **kwargs) | SetKeysUnicode(self, bool keysUnicode)
Always interpret keyboard input as Unicode | SetKeysUnicode(self, bool keysUnicode) | [
"SetKeysUnicode",
"(",
"self",
"bool",
"keysUnicode",
")"
] | def SetKeysUnicode(*args, **kwargs):
"""
SetKeysUnicode(self, bool keysUnicode)
Always interpret keyboard input as Unicode
"""
return _stc.StyledTextCtrl_SetKeysUnicode(*args, **kwargs) | [
"def",
"SetKeysUnicode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetKeysUnicode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5759-L5765 | |
tensorflow/minigo | 6d89c202cdceaf449aefc3149ab2110d44f1a6a4 | player_interface.py | python | PlayerInterface.initialize_game | (self, position=None) | Initializes a new game.
Args:
position: the board position to copy for the initial game state. If
None, an empty board state is used for the initial position. | Initializes a new game. | [
"Initializes",
"a",
"new",
"game",
"."
] | def initialize_game(self, position=None):
"""Initializes a new game.
Args:
position: the board position to copy for the initial game state. If
None, an empty board state is used for the initial position.
""" | [
"def",
"initialize_game",
"(",
"self",
",",
"position",
"=",
"None",
")",
":"
] | https://github.com/tensorflow/minigo/blob/6d89c202cdceaf449aefc3149ab2110d44f1a6a4/player_interface.py#L40-L46 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathPropertyEditor.py | python | _PropertyEditor.widget | (self, parent) | widget(parent) ... called by the delegate to get a new editor widget.
Must be implemented by subclasses and return the widget. | widget(parent) ... called by the delegate to get a new editor widget.
Must be implemented by subclasses and return the widget. | [
"widget",
"(",
"parent",
")",
"...",
"called",
"by",
"the",
"delegate",
"to",
"get",
"a",
"new",
"editor",
"widget",
".",
"Must",
"be",
"implemented",
"by",
"subclasses",
"and",
"return",
"the",
"widget",
"."
] | def widget(self, parent):
"""widget(parent) ... called by the delegate to get a new editor widget.
Must be implemented by subclasses and return the widget."""
pass | [
"def",
"widget",
"(",
"self",
",",
"parent",
")",
":",
"pass"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathPropertyEditor.py#L49-L52 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/platform.py | python | system | () | return uname()[0] | Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.
An empty string is returned if the value cannot be determined. | Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'. | [
"Returns",
"the",
"system",
"/",
"OS",
"name",
"e",
".",
"g",
".",
"Linux",
"Windows",
"or",
"Java",
"."
] | def system():
""" Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.
An empty string is returned if the value cannot be determined.
"""
return uname()[0] | [
"def",
"system",
"(",
")",
":",
"return",
"uname",
"(",
")",
"[",
"0",
"]"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/platform.py#L1206-L1213 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/seq2seq.py | python | sequence_loss_by_example | (logits, targets, weights,
average_across_timesteps=True,
softmax_loss_function=None, name=None) | return log_perps | Weighted cross-entropy loss for a sequence of logits (per example).
Args:
logits: List of 2D Tensors of shape [batch_size x num_decoder_symbols].
targets: List of 1D batch-sized int32 Tensors of the same length as logits.
weights: List of 1D batch-sized float-Tensors of the same length as logits.
ave... | Weighted cross-entropy loss for a sequence of logits (per example). | [
"Weighted",
"cross",
"-",
"entropy",
"loss",
"for",
"a",
"sequence",
"of",
"logits",
"(",
"per",
"example",
")",
"."
] | def sequence_loss_by_example(logits, targets, weights,
average_across_timesteps=True,
softmax_loss_function=None, name=None):
"""Weighted cross-entropy loss for a sequence of logits (per example).
Args:
logits: List of 2D Tensors of shape [batch_size x ... | [
"def",
"sequence_loss_by_example",
"(",
"logits",
",",
"targets",
",",
"weights",
",",
"average_across_timesteps",
"=",
"True",
",",
"softmax_loss_function",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"len",
"(",
"targets",
")",
"!=",
"len",
"(",... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/seq2seq.py#L897-L940 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/checkperms/checkperms.py | python | get_scm | (dir_path, bare) | return ApiBase(dir_path or cwd, bare) | Returns a properly configured ApiBase instance. | Returns a properly configured ApiBase instance. | [
"Returns",
"a",
"properly",
"configured",
"ApiBase",
"instance",
"."
] | def get_scm(dir_path, bare):
"""Returns a properly configured ApiBase instance."""
cwd = os.getcwd()
root = get_git_root(dir_path or cwd)
if root:
if not bare:
print('Found git repository at %s' % root)
return ApiGit(dir_path or root, bare)
# Returns a non-scm aware checker.
if not bare:
... | [
"def",
"get_scm",
"(",
"dir_path",
",",
"bare",
")",
":",
"cwd",
"=",
"os",
".",
"getcwd",
"(",
")",
"root",
"=",
"get_git_root",
"(",
"dir_path",
"or",
"cwd",
")",
"if",
"root",
":",
"if",
"not",
"bare",
":",
"print",
"(",
"'Found git repository at %s... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/checkperms/checkperms.py#L406-L418 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | ThirdParty/cinemasci/paraview/tpl/cinemasci/cdb/__init__.py | python | cdb.parameter_exists | (self, parameter) | return parameter in self.parameternames | Check if a parameter exists | Check if a parameter exists | [
"Check",
"if",
"a",
"parameter",
"exists"
] | def parameter_exists(self, parameter):
"""Check if a parameter exists
"""
return parameter in self.parameternames | [
"def",
"parameter_exists",
"(",
"self",
",",
"parameter",
")",
":",
"return",
"parameter",
"in",
"self",
".",
"parameternames"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinemasci/paraview/tpl/cinemasci/cdb/__init__.py#L111-L114 | |
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | python/ikfast.py | python | IKFastSolver.SolvePrismaticHingePairVariables | (self, raweqns, var0,var1,othersolvedvars,unknownvars=None) | solves one hinge and one prismatic variable together | solves one hinge and one prismatic variable together | [
"solves",
"one",
"hinge",
"and",
"one",
"prismatic",
"variable",
"together"
] | def SolvePrismaticHingePairVariables(self, raweqns, var0,var1,othersolvedvars,unknownvars=None):
"""solves one hinge and one prismatic variable together
"""
if self.IsPrismatic(var0.name) and self.IsHinge(var1.name):
prismaticSymbol = var0
hingeSymbol = var1
elif ... | [
"def",
"SolvePrismaticHingePairVariables",
"(",
"self",
",",
"raweqns",
",",
"var0",
",",
"var1",
",",
"othersolvedvars",
",",
"unknownvars",
"=",
"None",
")",
":",
"if",
"self",
".",
"IsPrismatic",
"(",
"var0",
".",
"name",
")",
"and",
"self",
".",
"IsHin... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/ikfast.py#L8636-L8691 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/perf_insights/third_party/cloudstorage/rest_api.py | python | _RestApi.__setstate__ | (self, state) | Restore state as part of deserialization/unpickling. | Restore state as part of deserialization/unpickling. | [
"Restore",
"state",
"as",
"part",
"of",
"deserialization",
"/",
"unpickling",
"."
] | def __setstate__(self, state):
"""Restore state as part of deserialization/unpickling."""
self.__init__(state['scopes'],
service_account_id=state['id'],
token_maker=state['a_maker'],
retry_params=state['retry_params'])
self.expiration_headroom = state['e... | [
"def",
"__setstate__",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"__init__",
"(",
"state",
"[",
"'scopes'",
"]",
",",
"service_account_id",
"=",
"state",
"[",
"'id'",
"]",
",",
"token_maker",
"=",
"state",
"[",
"'a_maker'",
"]",
",",
"retry_param... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/perf_insights/third_party/cloudstorage/rest_api.py#L150-L156 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_grad.py | python | _SquaredDifferenceGrad | (op, grad) | return (array_ops.reshape(math_ops.reduce_sum(x_grad, rx), sx),
-array_ops.reshape(math_ops.reduce_sum(x_grad, ry), sy)) | Returns the gradient for (x-y)^2. | Returns the gradient for (x-y)^2. | [
"Returns",
"the",
"gradient",
"for",
"(",
"x",
"-",
"y",
")",
"^2",
"."
] | def _SquaredDifferenceGrad(op, grad):
"""Returns the gradient for (x-y)^2."""
x = op.inputs[0]
y = op.inputs[1]
sx = array_ops.shape(x)
sy = array_ops.shape(y)
# pylint: disable=protected-access
rx, ry = gen_array_ops._broadcast_gradient_args(sx, sy)
# pylint: enable=protected-access
# .op works with ... | [
"def",
"_SquaredDifferenceGrad",
"(",
"op",
",",
"grad",
")",
":",
"x",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"y",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
"sx",
"=",
"array_ops",
".",
"shape",
"(",
"x",
")",
"sy",
"=",
"array_ops",
".",
"sh... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_grad.py#L592-L607 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/roslaunch/src/roslaunch/remoteprocess.py | python | SSHChildROSLaunchProcess.start | (self) | Start the remote process. This will create an SSH connection
to the remote host. | Start the remote process. This will create an SSH connection
to the remote host. | [
"Start",
"the",
"remote",
"process",
".",
"This",
"will",
"create",
"an",
"SSH",
"connection",
"to",
"the",
"remote",
"host",
"."
] | def start(self):
"""
Start the remote process. This will create an SSH connection
to the remote host.
"""
self.started = False #won't set to True until we are finished
self.ssh = self.sshin = self.sshout = self.ssherr = None
with self.lock:
nam... | [
"def",
"start",
"(",
"self",
")",
":",
"self",
".",
"started",
"=",
"False",
"#won't set to True until we are finished",
"self",
".",
"ssh",
"=",
"self",
".",
"sshin",
"=",
"self",
".",
"sshout",
"=",
"self",
".",
"ssherr",
"=",
"None",
"with",
"self",
"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/remoteprocess.py#L217-L239 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/__init__.py | python | register | (name, inputhook) | Register the function *inputhook* as an event loop integration. | Register the function *inputhook* as an event loop integration. | [
"Register",
"the",
"function",
"*",
"inputhook",
"*",
"as",
"an",
"event",
"loop",
"integration",
"."
] | def register(name, inputhook):
"""Register the function *inputhook* as an event loop integration."""
registered[name] = inputhook | [
"def",
"register",
"(",
"name",
",",
"inputhook",
")",
":",
"registered",
"[",
"name",
"]",
"=",
"inputhook"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/terminal/pt_inputhooks/__init__.py#L20-L22 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/third_party/jinja2/utils.py | python | consume | (iterable) | Consumes an iterable without doing anything with it. | Consumes an iterable without doing anything with it. | [
"Consumes",
"an",
"iterable",
"without",
"doing",
"anything",
"with",
"it",
"."
] | def consume(iterable):
"""Consumes an iterable without doing anything with it."""
for event in iterable:
pass | [
"def",
"consume",
"(",
"iterable",
")",
":",
"for",
"event",
"in",
"iterable",
":",
"pass"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/utils.py#L105-L108 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py | python | MessageEncoder | (field_number, is_repeated, is_packed) | Returns an encoder for a message field. | Returns an encoder for a message field. | [
"Returns",
"an",
"encoder",
"for",
"a",
"message",
"field",
"."
] | def MessageEncoder(field_number, is_repeated, is_packed):
"""Returns an encoder for a message field."""
tag = TagBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED)
local_EncodeVarint = _EncodeVarint
assert not is_packed
if is_repeated:
def EncodeRepeatedField(write, value):
for element in v... | [
"def",
"MessageEncoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag",
"=",
"TagBytes",
"(",
"field_number",
",",
"wire_format",
".",
"WIRETYPE_LENGTH_DELIMITED",
")",
"local_EncodeVarint",
"=",
"_EncodeVarint",
"assert",
"not",
"is_pac... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L636-L654 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/common/tensor.py | python | Tensor.abs | (self) | return tensor_operator_registry.get('abs')()(self) | Return absolute value element-wisely.
Returns:
Tensor.
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> from mindspore import Tensor
>>> a = Tensor([1.1, -2.1]).astype("float32")
>>> output = a.abs()
>>> prin... | Return absolute value element-wisely. | [
"Return",
"absolute",
"value",
"element",
"-",
"wisely",
"."
] | def abs(self):
"""
Return absolute value element-wisely.
Returns:
Tensor.
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> from mindspore import Tensor
>>> a = Tensor([1.1, -2.1]).astype("float32")
>>> ou... | [
"def",
"abs",
"(",
"self",
")",
":",
"self",
".",
"_init_check",
"(",
")",
"return",
"tensor_operator_registry",
".",
"get",
"(",
"'abs'",
")",
"(",
")",
"(",
"self",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/common/tensor.py#L625-L643 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/array_algos/take.py | python | _get_take_nd_function | (
ndim: int, arr_dtype: np.dtype, out_dtype: np.dtype, axis: int = 0, mask_info=None
) | return func | Get the appropriate "take" implementation for the given dimension, axis
and dtypes. | Get the appropriate "take" implementation for the given dimension, axis
and dtypes. | [
"Get",
"the",
"appropriate",
"take",
"implementation",
"for",
"the",
"given",
"dimension",
"axis",
"and",
"dtypes",
"."
] | def _get_take_nd_function(
ndim: int, arr_dtype: np.dtype, out_dtype: np.dtype, axis: int = 0, mask_info=None
):
"""
Get the appropriate "take" implementation for the given dimension, axis
and dtypes.
"""
func = None
if ndim <= 2:
# for this part we don't need `mask_info` -> use the ... | [
"def",
"_get_take_nd_function",
"(",
"ndim",
":",
"int",
",",
"arr_dtype",
":",
"np",
".",
"dtype",
",",
"out_dtype",
":",
"np",
".",
"dtype",
",",
"axis",
":",
"int",
"=",
"0",
",",
"mask_info",
"=",
"None",
")",
":",
"func",
"=",
"None",
"if",
"n... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/array_algos/take.py#L301-L321 | |
crawl/crawl | 93358da72bb800e009bbaf8cfb64a27919af7953 | crawl-ref/source/webserver/webtiles/userdb.py | python | register_user | (username, passwd, email) | return None | Returns an error message or None on success. | Returns an error message or None on success. | [
"Returns",
"an",
"error",
"message",
"or",
"None",
"on",
"success",
"."
] | def register_user(username, passwd, email): # type: (str, str, str) -> Optional[str]
"""Returns an error message or None on success."""
if passwd == "":
return "The password can't be empty!"
if email: # validate the email only if it is provided
result = validate_email_address(email)
... | [
"def",
"register_user",
"(",
"username",
",",
"passwd",
",",
"email",
")",
":",
"# type: (str, str, str) -> Optional[str]",
"if",
"passwd",
"==",
"\"\"",
":",
"return",
"\"The password can't be empty!\"",
"if",
"email",
":",
"# validate the email only if it is provided",
... | https://github.com/crawl/crawl/blob/93358da72bb800e009bbaf8cfb64a27919af7953/crawl-ref/source/webserver/webtiles/userdb.py#L196-L228 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py | python | Web_Browser_Suite_Events.Activate | (self, _object=None, _attributes={}, **_arguments) | Activate: Activate Internet Explorer and optionally select window designated by Window Identifier.
Required argument: Window Identifier
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: Window Identifier of window to activate | Activate: Activate Internet Explorer and optionally select window designated by Window Identifier.
Required argument: Window Identifier
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: Window Identifier of window to activate | [
"Activate",
":",
"Activate",
"Internet",
"Explorer",
"and",
"optionally",
"select",
"window",
"designated",
"by",
"Window",
"Identifier",
".",
"Required",
"argument",
":",
"Window",
"Identifier",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
... | def Activate(self, _object=None, _attributes={}, **_arguments):
"""Activate: Activate Internet Explorer and optionally select window designated by Window Identifier.
Required argument: Window Identifier
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: Window Identif... | [
"def",
"Activate",
"(",
"self",
",",
"_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'WWW!'",
"_subcode",
"=",
"'ACTV'",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional ar... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Explorer/Web_Browser_Suite.py#L15-L34 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/io/__init__.py | python | LatticeDeserializer | (lattice_index_file, streams) | Configures a lattice deserializer
Args:
lattice_index_file (str): path to the file containing list of lattice TOC (table of content) files | Configures a lattice deserializer | [
"Configures",
"a",
"lattice",
"deserializer"
] | def LatticeDeserializer(lattice_index_file, streams):
'''
Configures a lattice deserializer
Args:
lattice_index_file (str): path to the file containing list of lattice TOC (table of content) files
'''
if len(streams) != 1:
raise ValueError("LatticeDeserializer only accepts a single ... | [
"def",
"LatticeDeserializer",
"(",
"lattice_index_file",
",",
"streams",
")",
":",
"if",
"len",
"(",
"streams",
")",
"!=",
"1",
":",
"raise",
"ValueError",
"(",
"\"LatticeDeserializer only accepts a single stream\"",
")",
"for",
"stream_name",
",",
"stream",
"in",
... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/io/__init__.py#L850-L862 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/msg/_GeoPose.py | python | GeoPose._get_types | (self) | return self._slot_types | internal API method | internal API method | [
"internal",
"API",
"method"
] | def _get_types(self):
"""
internal API method
"""
return self._slot_types | [
"def",
"_get_types",
"(",
"self",
")",
":",
"return",
"self",
".",
"_slot_types"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/msg/_GeoPose.py#L77-L81 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/codeeditor/interpreter.py | python | EditorIO.save_if_required | (self, prompt_for_confirm=True, force_save=False) | Save the editor's contents to a file. The function has the following options:
- if prompt_for_confirmation is True -> then show the yes/no dialog
- if force_save is True, and prompt_for_confirmation is False -> then save the file anyway
- if prompt_for_confirmation and force_save are both False ... | Save the editor's contents to a file. The function has the following options:
- if prompt_for_confirmation is True -> then show the yes/no dialog
- if force_save is True, and prompt_for_confirmation is False -> then save the file anyway
- if prompt_for_confirmation and force_save are both False ... | [
"Save",
"the",
"editor",
"s",
"contents",
"to",
"a",
"file",
".",
"The",
"function",
"has",
"the",
"following",
"options",
":",
"-",
"if",
"prompt_for_confirmation",
"is",
"True",
"-",
">",
"then",
"show",
"the",
"yes",
"/",
"no",
"dialog",
"-",
"if",
... | def save_if_required(self, prompt_for_confirm=True, force_save=False):
"""
Save the editor's contents to a file. The function has the following options:
- if prompt_for_confirmation is True -> then show the yes/no dialog
- if force_save is True, and prompt_for_confirmation is False -> th... | [
"def",
"save_if_required",
"(",
"self",
",",
"prompt_for_confirm",
"=",
"True",
",",
"force_save",
"=",
"False",
")",
":",
"if",
"prompt_for_confirm",
":",
"button",
"=",
"QMessageBox",
".",
"question",
"(",
"self",
".",
"editor",
",",
"\"\"",
",",
"\"Save c... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/codeeditor/interpreter.py#L51-L82 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/transaction.py | python | DaskTransaction.complete | (self, commit=True) | Finish transaction: commit or discard all deferred files | Finish transaction: commit or discard all deferred files | [
"Finish",
"transaction",
":",
"commit",
"or",
"discard",
"all",
"deferred",
"files"
] | def complete(self, commit=True):
"""Finish transaction: commit or discard all deferred files"""
if commit:
self.files.commit().result()
else:
self.files.discard().result()
self.fs._intrans = False | [
"def",
"complete",
"(",
"self",
",",
"commit",
"=",
"True",
")",
":",
"if",
"commit",
":",
"self",
".",
"files",
".",
"commit",
"(",
")",
".",
"result",
"(",
")",
"else",
":",
"self",
".",
"files",
".",
"discard",
"(",
")",
".",
"result",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/transaction.py#L75-L81 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/platforms/platform_settings_win_x64.py | python | inject_msvs_command | (ctx, vs_version) | Make sure the msvs command is injected into the configuration context | Make sure the msvs command is injected into the configuration context | [
"Make",
"sure",
"the",
"msvs",
"command",
"is",
"injected",
"into",
"the",
"configuration",
"context"
] | def inject_msvs_command(ctx, vs_version):
"""
Make sure the msvs command is injected into the configuration context
"""
vsstring = 'vs{}'.format(vs_version)
if not isinstance(ctx, ConfigurationContext):
return
if not ctx.is_option_true('generate_{}_projects_automatically'.format(vsstring... | [
"def",
"inject_msvs_command",
"(",
"ctx",
",",
"vs_version",
")",
":",
"vsstring",
"=",
"'vs{}'",
".",
"format",
"(",
"vs_version",
")",
"if",
"not",
"isinstance",
"(",
"ctx",
",",
"ConfigurationContext",
")",
":",
"return",
"if",
"not",
"ctx",
".",
"is_op... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/platforms/platform_settings_win_x64.py#L90-L102 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/pylib/constants/host_paths.py | python | ToolPath | (tool, cpu_arch) | return tool_path | Return a fully qualifed path to an arch-specific toolchain program.
Args:
tool: Unprefixed toolchain program name (e.g. 'objdump')
cpu_arch: Target CPU architecture (e.g. 'arm64')
Returns:
Fully qualified path (e.g. ..../aarch64-linux-android-objdump')
Raises:
Exception if the toolchain could not... | Return a fully qualifed path to an arch-specific toolchain program. | [
"Return",
"a",
"fully",
"qualifed",
"path",
"to",
"an",
"arch",
"-",
"specific",
"toolchain",
"program",
"."
] | def ToolPath(tool, cpu_arch):
"""Return a fully qualifed path to an arch-specific toolchain program.
Args:
tool: Unprefixed toolchain program name (e.g. 'objdump')
cpu_arch: Target CPU architecture (e.g. 'arm64')
Returns:
Fully qualified path (e.g. ..../aarch64-linux-android-objdump')
Raises:
E... | [
"def",
"ToolPath",
"(",
"tool",
",",
"cpu_arch",
")",
":",
"tool_path",
"=",
"_cached_tool_paths",
".",
"get",
"(",
"(",
"tool",
",",
"cpu_arch",
")",
")",
"if",
"tool_path",
":",
"return",
"tool_path",
"toolchain_source",
",",
"toolchain_prefix",
"=",
"_TOO... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/constants/host_paths.py#L64-L92 | |
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/openpgp/sap/msg/KeyMsg.py | python | Block.__init__ | (self, primary_id, *args, **kwords) | Initialize a key block.
:Parameters:
- `primary_id`: string primary key ID of key message
:Keywords:
- `idx`: integer, if sent a list of packets as the second
parameter, this is where the block will begin
:Exceptions:
- `BlockSubkeyBindingErro... | Initialize a key block. | [
"Initialize",
"a",
"key",
"block",
"."
] | def __init__(self, primary_id, *args, **kwords):
"""Initialize a key block.
:Parameters:
- `primary_id`: string primary key ID of key message
:Keywords:
- `idx`: integer, if sent a list of packets as the second
parameter, this is where the block will begin... | [
"def",
"__init__",
"(",
"self",
",",
"primary_id",
",",
"*",
"args",
",",
"*",
"*",
"kwords",
")",
":",
"self",
".",
"primary_id",
"=",
"primary_id",
"self",
".",
"leader",
"=",
"None",
"self",
".",
"local_revocs",
",",
"self",
".",
"foreign_revocs",
"... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/openpgp/sap/msg/KeyMsg.py#L350-L410 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/dist.py | python | DistributionMetadata.write_pkg_file | (self, file) | Write the PKG-INFO format data to a file object. | Write the PKG-INFO format data to a file object. | [
"Write",
"the",
"PKG",
"-",
"INFO",
"format",
"data",
"to",
"a",
"file",
"object",
"."
] | def write_pkg_file(self, file):
"""Write the PKG-INFO format data to a file object.
"""
version = '1.0'
if (self.provides or self.requires or self.obsoletes or
self.classifiers or self.download_url):
version = '1.1'
self._write_field(file, 'Metadata-Versi... | [
"def",
"write_pkg_file",
"(",
"self",
",",
"file",
")",
":",
"version",
"=",
"'1.0'",
"if",
"(",
"self",
".",
"provides",
"or",
"self",
".",
"requires",
"or",
"self",
".",
"obsoletes",
"or",
"self",
".",
"classifiers",
"or",
"self",
".",
"download_url",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/dist.py#L1110-L1142 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/cat-and-mouse.py | python | Solution2.catMouseGame | (self, graph) | return color[MOUSE_START, CAT_START, MOUSE] | :type graph: List[List[int]]
:rtype: int | :type graph: List[List[int]]
:rtype: int | [
":",
"type",
"graph",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"int"
] | def catMouseGame(self, graph):
"""
:type graph: List[List[int]]
:rtype: int
"""
HOLE, MOUSE_START, CAT_START = range(3)
DRAW, MOUSE, CAT = range(3)
def parents(m, c, t):
if t == CAT:
for nm in graph[m]:
yield nm, c, ... | [
"def",
"catMouseGame",
"(",
"self",
",",
"graph",
")",
":",
"HOLE",
",",
"MOUSE_START",
",",
"CAT_START",
"=",
"range",
"(",
"3",
")",
"DRAW",
",",
"MOUSE",
",",
"CAT",
"=",
"range",
"(",
"3",
")",
"def",
"parents",
"(",
"m",
",",
"c",
",",
"t",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/cat-and-mouse.py#L62-L121 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/threading.py | python | Condition.wait_for | (self, predicate, timeout=None) | return result | Wait until a condition evaluates to True.
predicate should be a callable which result will be interpreted as a
boolean value. A timeout may be provided giving the maximum time to
wait. | Wait until a condition evaluates to True. | [
"Wait",
"until",
"a",
"condition",
"evaluates",
"to",
"True",
"."
] | def wait_for(self, predicate, timeout=None):
"""Wait until a condition evaluates to True.
predicate should be a callable which result will be interpreted as a
boolean value. A timeout may be provided giving the maximum time to
wait.
"""
endtime = None
waittime ... | [
"def",
"wait_for",
"(",
"self",
",",
"predicate",
",",
"timeout",
"=",
"None",
")",
":",
"endtime",
"=",
"None",
"waittime",
"=",
"timeout",
"result",
"=",
"predicate",
"(",
")",
"while",
"not",
"result",
":",
"if",
"waittime",
"is",
"not",
"None",
":"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/threading.py#L312-L333 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/sql.py | python | execute | (sql, con, cur=None, params=None) | return pandas_sql.execute(*args) | Execute the given SQL query using the provided connection object.
Parameters
----------
sql : string
SQL query to be executed.
con : SQLAlchemy connectable(engine/connection) or sqlite3 connection
Using SQLAlchemy makes it possible to use any DB supported by the
library.
... | Execute the given SQL query using the provided connection object. | [
"Execute",
"the",
"given",
"SQL",
"query",
"using",
"the",
"provided",
"connection",
"object",
"."
] | def execute(sql, con, cur=None, params=None):
"""
Execute the given SQL query using the provided connection object.
Parameters
----------
sql : string
SQL query to be executed.
con : SQLAlchemy connectable(engine/connection) or sqlite3 connection
Using SQLAlchemy makes it possib... | [
"def",
"execute",
"(",
"sql",
",",
"con",
",",
"cur",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"cur",
"is",
"None",
":",
"pandas_sql",
"=",
"pandasSQL_builder",
"(",
"con",
")",
"else",
":",
"pandas_sql",
"=",
"pandasSQL_builder",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/sql.py#L134-L159 | |
lawy623/SVS | b7c7ae367c82a4797ff4a896a2ff304f02e7f724 | caffe/python/caffe/net_spec.py | python | param_name_dict | () | return dict(zip(param_type_names, param_names)) | Find out the correspondence between layer names and parameter names. | Find out the correspondence between layer names and parameter names. | [
"Find",
"out",
"the",
"correspondence",
"between",
"layer",
"names",
"and",
"parameter",
"names",
"."
] | def param_name_dict():
"""Find out the correspondence between layer names and parameter names."""
layer = caffe_pb2.LayerParameter()
# get all parameter names (typically underscore case) and corresponding
# type names (typically camel case), which contain the layer names
# (note that not all parame... | [
"def",
"param_name_dict",
"(",
")",
":",
"layer",
"=",
"caffe_pb2",
".",
"LayerParameter",
"(",
")",
"# get all parameter names (typically underscore case) and corresponding",
"# type names (typically camel case), which contain the layer names",
"# (note that not all parameters correspon... | https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/python/caffe/net_spec.py#L28-L40 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/abinsalgorithm.py | python | AbinsAlgorithm.validate_common_inputs | (self, issues: dict = None) | return issues | Validate inputs common to Abins 1D and 2D versions
Args:
abins: Algorithm instance for validation
issues: Collection of validation issues to append to. (This will be mutated without copying.)
Returns:
issues dict including any new issues | Validate inputs common to Abins 1D and 2D versions | [
"Validate",
"inputs",
"common",
"to",
"Abins",
"1D",
"and",
"2D",
"versions"
] | def validate_common_inputs(self, issues: dict = None) -> Dict[str, str]:
"""Validate inputs common to Abins 1D and 2D versions
Args:
abins: Algorithm instance for validation
issues: Collection of validation issues to append to. (This will be mutated without copying.)
Re... | [
"def",
"validate_common_inputs",
"(",
"self",
",",
"issues",
":",
"dict",
"=",
"None",
")",
"->",
"Dict",
"[",
"str",
",",
"str",
"]",
":",
"if",
"issues",
"is",
"None",
":",
"issues",
"=",
"{",
"}",
"input_file_validators",
"=",
"{",
"\"CASTEP\"",
":"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/abinsalgorithm.py#L163-L210 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/parsers.py | python | PythonParser._check_for_bom | (self, first_row) | Checks whether the file begins with the BOM character.
If it does, remove it. In addition, if there is quoting
in the field subsequent to the BOM, remove it as well
because it technically takes place at the beginning of
the name, not the middle of it. | Checks whether the file begins with the BOM character.
If it does, remove it. In addition, if there is quoting
in the field subsequent to the BOM, remove it as well
because it technically takes place at the beginning of
the name, not the middle of it. | [
"Checks",
"whether",
"the",
"file",
"begins",
"with",
"the",
"BOM",
"character",
".",
"If",
"it",
"does",
"remove",
"it",
".",
"In",
"addition",
"if",
"there",
"is",
"quoting",
"in",
"the",
"field",
"subsequent",
"to",
"the",
"BOM",
"remove",
"it",
"as",... | def _check_for_bom(self, first_row):
"""
Checks whether the file begins with the BOM character.
If it does, remove it. In addition, if there is quoting
in the field subsequent to the BOM, remove it as well
because it technically takes place at the beginning of
the name, n... | [
"def",
"_check_for_bom",
"(",
"self",
",",
"first_row",
")",
":",
"# first_row will be a list, so we need to check",
"# that that list is not empty before proceeding.",
"if",
"not",
"first_row",
":",
"return",
"first_row",
"# The first element of this row is the one that could have t... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/parsers.py#L2736-L2787 | ||
dmlc/decord | 96b750c7221322391969929e855b942d2fdcd06b | python/decord/_ffi/_ctypes/function.py | python | FunctionBase.__init__ | (self, handle, is_global) | Initialize the function with handle
Parameters
----------
handle : FunctionHandle
the handle to the underlying function.
is_global : bool
Whether this is a global function in python | Initialize the function with handle | [
"Initialize",
"the",
"function",
"with",
"handle"
] | def __init__(self, handle, is_global):
"""Initialize the function with handle
Parameters
----------
handle : FunctionHandle
the handle to the underlying function.
is_global : bool
Whether this is a global function in python
"""
self.handl... | [
"def",
"__init__",
"(",
"self",
",",
"handle",
",",
"is_global",
")",
":",
"self",
".",
"handle",
"=",
"handle",
"self",
".",
"is_global",
"=",
"is_global"
] | https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/_ffi/_ctypes/function.py#L145-L157 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/zeros.py | python | TOMS748Solver.start | (self, f, a, b, args=()) | return _EINPROGRESS, sum(self.ab) / 2.0 | r"""Prepare for the iterations. | r"""Prepare for the iterations. | [
"r",
"Prepare",
"for",
"the",
"iterations",
"."
] | def start(self, f, a, b, args=()):
r"""Prepare for the iterations."""
self.function_calls = 0
self.iterations = 0
self.f = f
self.args = args
self.ab[:] = [a, b]
if not np.isfinite(a) or np.imag(a) != 0:
raise ValueError("Invalid x value: %s " % (a))
... | [
"def",
"start",
"(",
"self",
",",
"f",
",",
"a",
",",
"b",
",",
"args",
"=",
"(",
")",
")",
":",
"self",
".",
"function_calls",
"=",
"0",
"self",
".",
"iterations",
"=",
"0",
"self",
".",
"f",
"=",
"f",
"self",
".",
"args",
"=",
"args",
"self... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/zeros.py#L1065-L1094 | |
OkCupid/okws | 1c337392c676ccb4e9a4c92d11d5d2fada6427d2 | contrib/pub3-upgrade.py | python | Pub1Parser.p_switch_case | (self, p) | switch_case : array | switch_case : array | [
"switch_case",
":",
"array"
] | def p_switch_case (self, p):
'''switch_case : array'''
p[0] = p[1] | [
"def",
"p_switch_case",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | https://github.com/OkCupid/okws/blob/1c337392c676ccb4e9a4c92d11d5d2fada6427d2/contrib/pub3-upgrade.py#L922-L924 | ||
llvm-dcpu16/llvm-dcpu16 | ae6b01fecd03219677e391d4421df5d966d80dcf | bindings/python/llvm/object.py | python | Relocation.cache | (self) | Cache all cacheable properties on this instance. | Cache all cacheable properties on this instance. | [
"Cache",
"all",
"cacheable",
"properties",
"on",
"this",
"instance",
"."
] | def cache(self):
"""Cache all cacheable properties on this instance."""
getattr(self, 'address')
getattr(self, 'offset')
getattr(self, 'symbol')
getattr(self, 'type')
getattr(self, 'type_name')
getattr(self, 'value_string') | [
"def",
"cache",
"(",
"self",
")",
":",
"getattr",
"(",
"self",
",",
"'address'",
")",
"getattr",
"(",
"self",
",",
"'offset'",
")",
"getattr",
"(",
"self",
",",
"'symbol'",
")",
"getattr",
"(",
"self",
",",
"'type'",
")",
"getattr",
"(",
"self",
",",... | https://github.com/llvm-dcpu16/llvm-dcpu16/blob/ae6b01fecd03219677e391d4421df5d966d80dcf/bindings/python/llvm/object.py#L427-L434 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/signaltools.py | python | sosfiltfilt | (sos, x, axis=-1, padtype='odd', padlen=None) | return y | A forward-backward digital filter using cascaded second-order sections.
See `filtfilt` for more complete information about this method.
Parameters
----------
sos : array_like
Array of second-order filter coefficients, must have shape
``(n_sections, 6)``. Each row corresponds to a secon... | A forward-backward digital filter using cascaded second-order sections. | [
"A",
"forward",
"-",
"backward",
"digital",
"filter",
"using",
"cascaded",
"second",
"-",
"order",
"sections",
"."
] | def sosfiltfilt(sos, x, axis=-1, padtype='odd', padlen=None):
"""
A forward-backward digital filter using cascaded second-order sections.
See `filtfilt` for more complete information about this method.
Parameters
----------
sos : array_like
Array of second-order filter coefficients, mu... | [
"def",
"sosfiltfilt",
"(",
"sos",
",",
"x",
",",
"axis",
"=",
"-",
"1",
",",
"padtype",
"=",
"'odd'",
",",
"padlen",
"=",
"None",
")",
":",
"sos",
",",
"n_sections",
"=",
"_validate_sos",
"(",
"sos",
")",
"# `method` is \"pad\"...",
"ntaps",
"=",
"2",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/signaltools.py#L3299-L3407 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchSectionPlane.py | python | getSectionData | (source) | return objs,cutplane,onlySolids,clip,direction | Returns some common data from section planes and building parts | Returns some common data from section planes and building parts | [
"Returns",
"some",
"common",
"data",
"from",
"section",
"planes",
"and",
"building",
"parts"
] | def getSectionData(source):
"""Returns some common data from section planes and building parts"""
if hasattr(source,"Objects"):
objs = source.Objects
cutplane = source.Shape
elif hasattr(source,"Group"):
import Part
objs = source.Group
cutplane = Part.makePlane(1000... | [
"def",
"getSectionData",
"(",
"source",
")",
":",
"if",
"hasattr",
"(",
"source",
",",
"\"Objects\"",
")",
":",
"objs",
"=",
"source",
".",
"Objects",
"cutplane",
"=",
"source",
".",
"Shape",
"elif",
"hasattr",
"(",
"source",
",",
"\"Group\"",
")",
":",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchSectionPlane.py#L108-L134 | |
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | python/databases/__init__.py | python | DatabaseGenerator.autogenerateparams | (self,options=None) | Caches parameters for most commonly used robots/objects and starts the generation process for them | Caches parameters for most commonly used robots/objects and starts the generation process for them | [
"Caches",
"parameters",
"for",
"most",
"commonly",
"used",
"robots",
"/",
"objects",
"and",
"starts",
"the",
"generation",
"process",
"for",
"them"
] | def autogenerateparams(self,options=None):
"""Caches parameters for most commonly used robots/objects and starts the generation process for them"""
raise NotImplementedError() | [
"def",
"autogenerateparams",
"(",
"self",
",",
"options",
"=",
"None",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/databases/__init__.py#L125-L127 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_nn_ops.py | python | get_bprop_hswish | (self) | return bprop | Grad definition for `HSwish` operation. | Grad definition for `HSwish` operation. | [
"Grad",
"definition",
"for",
"HSwish",
"operation",
"."
] | def get_bprop_hswish(self):
"""Grad definition for `HSwish` operation."""
input_grad = G.HSwishGrad()
def bprop(x, out, dout):
dx = input_grad(dout, x)
return (dx,)
return bprop | [
"def",
"get_bprop_hswish",
"(",
"self",
")",
":",
"input_grad",
"=",
"G",
".",
"HSwishGrad",
"(",
")",
"def",
"bprop",
"(",
"x",
",",
"out",
",",
"dout",
")",
":",
"dx",
"=",
"input_grad",
"(",
"dout",
",",
"x",
")",
"return",
"(",
"dx",
",",
")"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_nn_ops.py#L478-L486 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/image_ops_impl.py | python | resize_image_with_pad_v1 | (image,
target_height,
target_width,
method=ResizeMethodV1.BILINEAR,
align_corners=False) | return _resize_image_with_pad_common(image, target_height, target_width,
_resize_fn) | Resizes and pads an image to a target width and height.
Resizes an image to a target width and height by keeping
the aspect ratio the same without distortion. If the target
dimensions don't match the image dimensions, the image
is resized and then padded with zeroes to match requested
dimensions.
Args:
... | Resizes and pads an image to a target width and height. | [
"Resizes",
"and",
"pads",
"an",
"image",
"to",
"a",
"target",
"width",
"and",
"height",
"."
] | def resize_image_with_pad_v1(image,
target_height,
target_width,
method=ResizeMethodV1.BILINEAR,
align_corners=False):
"""Resizes and pads an image to a target width and height.
Resizes an image to a... | [
"def",
"resize_image_with_pad_v1",
"(",
"image",
",",
"target_height",
",",
"target_width",
",",
"method",
"=",
"ResizeMethodV1",
".",
"BILINEAR",
",",
"align_corners",
"=",
"False",
")",
":",
"def",
"_resize_fn",
"(",
"im",
",",
"new_size",
")",
":",
"return"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/image_ops_impl.py#L1801-L1839 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Tool/mwcc.py | python | set_vars | (env) | return 1 | Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars
MWCW_VERSIONS is set to a list of objects representing installed versions
MWCW_VERSION is set to the version object that will be used for building.
MWCW_VERSION can be set to a string during Environment
... | Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars | [
"Set",
"MWCW_VERSION",
"MWCW_VERSIONS",
"and",
"some",
"codewarrior",
"environment",
"vars"
] | def set_vars(env):
"""Set MWCW_VERSION, MWCW_VERSIONS, and some codewarrior environment vars
MWCW_VERSIONS is set to a list of objects representing installed versions
MWCW_VERSION is set to the version object that will be used for building.
MWCW_VERSION can be set to a string during Env... | [
"def",
"set_vars",
"(",
"env",
")",
":",
"desired",
"=",
"env",
".",
"get",
"(",
"'MWCW_VERSION'",
",",
"''",
")",
"# return right away if the variables are already set",
"if",
"isinstance",
"(",
"desired",
",",
"MWVersion",
")",
":",
"return",
"1",
"elif",
"d... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/mwcc.py#L40-L84 | |
HKUST-Aerial-Robotics/Fast-Planner | 2ddd7793eecd573dbb5b47e2c985aa06606df3cf | uav_simulator/Utils/multi_map_server/quadrotor_msgs/build/devel/_setup_util.py | python | rollback_env_variables | (environ, env_var_subfolders) | return lines | Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks. | Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks. | [
"Generate",
"shell",
"code",
"to",
"reset",
"environment",
"variables",
"by",
"unrolling",
"modifications",
"based",
"on",
"all",
"workspaces",
"in",
"CMAKE_PREFIX_PATH",
".",
"This",
"does",
"not",
"cover",
"modifications",
"performed",
"by",
"environment",
"hooks"... | def rollback_env_variables(environ, env_var_subfolders):
'''
Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks.
'''
lines = []
unmodified_environ = copy.... | [
"def",
"rollback_env_variables",
"(",
"environ",
",",
"env_var_subfolders",
")",
":",
"lines",
"=",
"[",
"]",
"unmodified_environ",
"=",
"copy",
".",
"copy",
"(",
"environ",
")",
"for",
"key",
"in",
"sorted",
"(",
"env_var_subfolders",
".",
"keys",
"(",
")",... | https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/build/devel/_setup_util.py#L62-L81 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/quaternion.py | python | Quaternion.__truediv__ | (self, scalar) | return Quaternion(self.real / scalar, self.vec / scalar) | scalar division | scalar division | [
"scalar",
"division"
] | def __truediv__(self, scalar):
""" scalar division """
return Quaternion(self.real / scalar, self.vec / scalar) | [
"def",
"__truediv__",
"(",
"self",
",",
"scalar",
")",
":",
"return",
"Quaternion",
"(",
"self",
".",
"real",
"/",
"scalar",
",",
"self",
".",
"vec",
"/",
"scalar",
")"
] | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/quaternion.py#L32-L34 | |
microsoft/O-CNN | 8db64820b428f81aebe2f69f9541c091bc101a4c | pytorch/ocnn/modules.py | python | octree_trilinear | (data, octree, depth, target_depth) | return output | Interpolate data from octree `depth` to `target_depth` | Interpolate data from octree `depth` to `target_depth` | [
"Interpolate",
"data",
"from",
"octree",
"depth",
"to",
"target_depth"
] | def octree_trilinear(data, octree, depth, target_depth):
''' Interpolate data from octree `depth` to `target_depth`
'''
xyz = ocnn.octree_property(octree, 'xyz', target_depth)
xyz = ocnn.octree_decode_key(xyz).float()
scale = 2.0**(depth-target_depth)
xyz += torch.cuda.FloatTensor([0.5, 0.5, 0.5, 0.0])
xy... | [
"def",
"octree_trilinear",
"(",
"data",
",",
"octree",
",",
"depth",
",",
"target_depth",
")",
":",
"xyz",
"=",
"ocnn",
".",
"octree_property",
"(",
"octree",
",",
"'xyz'",
",",
"target_depth",
")",
"xyz",
"=",
"ocnn",
".",
"octree_decode_key",
"(",
"xyz",... | https://github.com/microsoft/O-CNN/blob/8db64820b428f81aebe2f69f9541c091bc101a4c/pytorch/ocnn/modules.py#L278-L287 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | applications/ATOM/eval_atom_wae_enc.py | python | construct_model | (run_args) | return lbann.Model(run_args.num_epochs,
weights=weights,
layers=layers,
objective_function=obj,
callbacks=callbacks) | Construct LBANN model.
Initial model for ATOM molecular VAE | Construct LBANN model. | [
"Construct",
"LBANN",
"model",
"."
] | def construct_model(run_args):
"""Construct LBANN model.
Initial model for ATOM molecular VAE
"""
import lbann
print("Dump model dir ", run_args.dump_model_dir)
assert run_args.dump_model_dir, "evaluate script asssumes a pretrained WAE model"
pad_index = run_args.pad_index
assert pad_... | [
"def",
"construct_model",
"(",
"run_args",
")",
":",
"import",
"lbann",
"print",
"(",
"\"Dump model dir \"",
",",
"run_args",
".",
"dump_model_dir",
")",
"assert",
"run_args",
".",
"dump_model_dir",
",",
"\"evaluate script asssumes a pretrained WAE model\"",
"pad_index",
... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/applications/ATOM/eval_atom_wae_enc.py#L88-L166 | |
esphome/esphome | 40e06c9819f17409615d4f4eec5cfe4dc9a3776d | esphome/cpp_helpers.py | python | setup_entity | (var, config) | Set up generic properties of an Entity | Set up generic properties of an Entity | [
"Set",
"up",
"generic",
"properties",
"of",
"an",
"Entity"
] | async def setup_entity(var, config):
"""Set up generic properties of an Entity"""
add(var.set_name(config[CONF_NAME]))
add(var.set_disabled_by_default(config[CONF_DISABLED_BY_DEFAULT]))
if CONF_INTERNAL in config:
add(var.set_internal(config[CONF_INTERNAL]))
if CONF_ICON in config:
a... | [
"async",
"def",
"setup_entity",
"(",
"var",
",",
"config",
")",
":",
"add",
"(",
"var",
".",
"set_name",
"(",
"config",
"[",
"CONF_NAME",
"]",
")",
")",
"add",
"(",
"var",
".",
"set_disabled_by_default",
"(",
"config",
"[",
"CONF_DISABLED_BY_DEFAULT",
"]",... | https://github.com/esphome/esphome/blob/40e06c9819f17409615d4f4eec5cfe4dc9a3776d/esphome/cpp_helpers.py#L98-L107 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | StopWatch.TimeInMicro | (*args, **kwargs) | return _misc_.StopWatch_TimeInMicro(*args, **kwargs) | TimeInMicro(self) -> wxLongLong | TimeInMicro(self) -> wxLongLong | [
"TimeInMicro",
"(",
"self",
")",
"-",
">",
"wxLongLong"
] | def TimeInMicro(*args, **kwargs):
"""TimeInMicro(self) -> wxLongLong"""
return _misc_.StopWatch_TimeInMicro(*args, **kwargs) | [
"def",
"TimeInMicro",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"StopWatch_TimeInMicro",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L895-L897 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py | python | _DNNLinearCombinedBaseEstimator.linear_weights_ | (self) | return self._linear_model.get_weights(model_dir=self._model_dir) | Returns weights per feature of the linear part. | Returns weights per feature of the linear part. | [
"Returns",
"weights",
"per",
"feature",
"of",
"the",
"linear",
"part",
"."
] | def linear_weights_(self):
"""Returns weights per feature of the linear part."""
return self._linear_model.get_weights(model_dir=self._model_dir) | [
"def",
"linear_weights_",
"(",
"self",
")",
":",
"return",
"self",
".",
"_linear_model",
".",
"get_weights",
"(",
"model_dir",
"=",
"self",
".",
"_model_dir",
")"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py#L134-L136 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/python_message.py | python | _AddPropertiesForNonRepeatedCompositeField | (field, cls) | Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field.
Clients can use this property to get the value of the field, but cannot
assign to the property directly.
Args:
field: A FieldDescriptor for this field.
cls: The class we're co... | Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field. | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"nonrepeated",
"composite",
"protocol",
"message",
"field",
".",
"A",
"composite",
"field",
"is",
"a",
"group",
"or",
"message",
"field",
"."
] | def _AddPropertiesForNonRepeatedCompositeField(field, cls):
"""Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field.
Clients can use this property to get the value of the field, but cannot
assign to the property directly.
Args:
fie... | [
"def",
"_AddPropertiesForNonRepeatedCompositeField",
"(",
"field",
",",
"cls",
")",
":",
"# TODO(robinson): Remove duplication with similar method",
"# for non-repeated scalars.",
"proto_field_name",
"=",
"field",
".",
"name",
"property_name",
"=",
"_PropertyName",
"(",
"proto_... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/python_message.py#L730-L771 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/models/rnn/ptb/reader.py | python | ptb_iterator | (raw_data, batch_size, num_steps) | Iterate on the raw PTB data.
This generates batch_size pointers into the raw PTB data, and allows
minibatch iteration along these pointers.
Args:
raw_data: one of the raw data outputs from ptb_raw_data.
batch_size: int, the batch size.
num_steps: int, the number of unrolls.
Yields:
Pairs of t... | Iterate on the raw PTB data. | [
"Iterate",
"on",
"the",
"raw",
"PTB",
"data",
"."
] | def ptb_iterator(raw_data, batch_size, num_steps):
"""Iterate on the raw PTB data.
This generates batch_size pointers into the raw PTB data, and allows
minibatch iteration along these pointers.
Args:
raw_data: one of the raw data outputs from ptb_raw_data.
batch_size: int, the batch size.
num_step... | [
"def",
"ptb_iterator",
"(",
"raw_data",
",",
"batch_size",
",",
"num_steps",
")",
":",
"raw_data",
"=",
"np",
".",
"array",
"(",
"raw_data",
",",
"dtype",
"=",
"np",
".",
"int32",
")",
"data_len",
"=",
"len",
"(",
"raw_data",
")",
"batch_len",
"=",
"da... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/models/rnn/ptb/reader.py#L82-L117 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/framework/interfaces/base/base.py | python | End.stop | (self, grace) | Stops this object's service of operations.
This object will refuse service of new operations as soon as this method is
called but operations under way at the time of the call may be given a
grace period during which they are allowed to finish.
Args:
grace: A duration of time in seconds to allow ... | Stops this object's service of operations. | [
"Stops",
"this",
"object",
"s",
"service",
"of",
"operations",
"."
] | def stop(self, grace):
"""Stops this object's service of operations.
This object will refuse service of new operations as soon as this method is
called but operations under way at the time of the call may be given a
grace period during which they are allowed to finish.
Args:
grace: A dur... | [
"def",
"stop",
"(",
"self",
",",
"grace",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/framework/interfaces/base/base.py#L250-L271 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/lib/_iotools.py | python | LineSplitter._delimited_splitter | (self, line) | return line.split(self.delimiter) | Chop off comments, strip, and split at delimiter. | Chop off comments, strip, and split at delimiter. | [
"Chop",
"off",
"comments",
"strip",
"and",
"split",
"at",
"delimiter",
"."
] | def _delimited_splitter(self, line):
"""Chop off comments, strip, and split at delimiter. """
if self.comments is not None:
line = line.split(self.comments)[0]
line = line.strip(" \r\n")
if not line:
return []
return line.split(self.delimiter) | [
"def",
"_delimited_splitter",
"(",
"self",
",",
"line",
")",
":",
"if",
"self",
".",
"comments",
"is",
"not",
"None",
":",
"line",
"=",
"line",
".",
"split",
"(",
"self",
".",
"comments",
")",
"[",
"0",
"]",
"line",
"=",
"line",
".",
"strip",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/_iotools.py#L236-L243 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Wm.wm_iconphoto | (self, default=False, *args) | Sets the titlebar icon for this window based on the named photo
images passed through args. If default is True, this is applied to
all future created toplevels as well.
The data in the images is taken as a snapshot at the time of
invocation. If the images are later changed, this is not ... | Sets the titlebar icon for this window based on the named photo
images passed through args. If default is True, this is applied to
all future created toplevels as well. | [
"Sets",
"the",
"titlebar",
"icon",
"for",
"this",
"window",
"based",
"on",
"the",
"named",
"photo",
"images",
"passed",
"through",
"args",
".",
"If",
"default",
"is",
"True",
"this",
"is",
"applied",
"to",
"all",
"future",
"created",
"toplevels",
"as",
"we... | def wm_iconphoto(self, default=False, *args): # new in Tk 8.5
"""Sets the titlebar icon for this window based on the named photo
images passed through args. If default is True, this is applied to
all future created toplevels as well.
The data in the images is taken as a snapshot at the ... | [
"def",
"wm_iconphoto",
"(",
"self",
",",
"default",
"=",
"False",
",",
"*",
"args",
")",
":",
"# new in Tk 8.5",
"if",
"default",
":",
"self",
".",
"tk",
".",
"call",
"(",
"'wm'",
",",
"'iconphoto'",
",",
"self",
".",
"_w",
",",
"\"-default\"",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L1887-L1910 | ||
GeometryCollective/boundary-first-flattening | 8250e5a0e85980ec50b5e8aa8f49dd6519f915cd | deps/nanogui/docs/exhale.py | python | ExhaleNode.toDirectoryView | (self, level, stream, treeView, lastChild=False) | Recursively generates the file view hierarchy using this node and its children,
if it is determined by :func:`exhale.ExhaleNode.inDirectoryView` that this node
should be included.
:Parameters:
``level`` (int)
An integer greater than or equal to 0 representing the ind... | Recursively generates the file view hierarchy using this node and its children,
if it is determined by :func:`exhale.ExhaleNode.inDirectoryView` that this node
should be included. | [
"Recursively",
"generates",
"the",
"file",
"view",
"hierarchy",
"using",
"this",
"node",
"and",
"its",
"children",
"if",
"it",
"is",
"determined",
"by",
":",
"func",
":",
"exhale",
".",
"ExhaleNode",
".",
"inDirectoryView",
"that",
"this",
"node",
"should",
... | def toDirectoryView(self, level, stream, treeView, lastChild=False):
'''
Recursively generates the file view hierarchy using this node and its children,
if it is determined by :func:`exhale.ExhaleNode.inDirectoryView` that this node
should be included.
:Parameters:
`... | [
"def",
"toDirectoryView",
"(",
"self",
",",
"level",
",",
"stream",
",",
"treeView",
",",
"lastChild",
"=",
"False",
")",
":",
"if",
"self",
".",
"inDirectoryView",
"(",
")",
":",
"if",
"not",
"treeView",
":",
"stream",
".",
"write",
"(",
"\"{}- :ref:`{}... | https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/docs/exhale.py#L1121-L1209 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBFileSpecList.__init__ | (self, *args) | __init__(self) -> SBFileSpecList
__init__(self, SBFileSpecList rhs) -> SBFileSpecList | __init__(self) -> SBFileSpecList
__init__(self, SBFileSpecList rhs) -> SBFileSpecList | [
"__init__",
"(",
"self",
")",
"-",
">",
"SBFileSpecList",
"__init__",
"(",
"self",
"SBFileSpecList",
"rhs",
")",
"-",
">",
"SBFileSpecList"
] | def __init__(self, *args):
"""
__init__(self) -> SBFileSpecList
__init__(self, SBFileSpecList rhs) -> SBFileSpecList
"""
this = _lldb.new_SBFileSpecList(*args)
try: self.this.append(this)
except: self.this = this | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"this",
"=",
"_lldb",
".",
"new_SBFileSpecList",
"(",
"*",
"args",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
":",
"self",
".",
"this",
"=",
"this"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L4407-L4414 | ||
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | deprecated/algorithms/sfm/OpenSfM/opensfm/features.py | python | _in_mask | (point, width, height, mask) | return mask[int(v), int(u)] != 0 | Check if a point is inside a binary mask. | Check if a point is inside a binary mask. | [
"Check",
"if",
"a",
"point",
"is",
"inside",
"a",
"binary",
"mask",
"."
] | def _in_mask(point, width, height, mask):
"""Check if a point is inside a binary mask."""
u = mask.shape[1] * (point[0] + 0.5) / width
v = mask.shape[0] * (point[1] + 0.5) / height
return mask[int(v), int(u)] != 0 | [
"def",
"_in_mask",
"(",
"point",
",",
"width",
",",
"height",
",",
"mask",
")",
":",
"u",
"=",
"mask",
".",
"shape",
"[",
"1",
"]",
"*",
"(",
"point",
"[",
"0",
"]",
"+",
"0.5",
")",
"/",
"width",
"v",
"=",
"mask",
".",
"shape",
"[",
"0",
"... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/features.py#L85-L89 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/command/config.py | python | config.check_func | (self, func, headers=None, include_dirs=None,
libraries=None, library_dirs=None, decl=0, call=0) | return self.try_link(body, headers, include_dirs,
libraries, library_dirs) | Determine if function 'func' is available by constructing a
source file that refers to 'func', and compiles and links it.
If everything succeeds, returns true; otherwise returns false.
The constructed source file starts out by including the header
files listed in 'headers'. If 'decl' i... | Determine if function 'func' is available by constructing a
source file that refers to 'func', and compiles and links it.
If everything succeeds, returns true; otherwise returns false. | [
"Determine",
"if",
"function",
"func",
"is",
"available",
"by",
"constructing",
"a",
"source",
"file",
"that",
"refers",
"to",
"func",
"and",
"compiles",
"and",
"links",
"it",
".",
"If",
"everything",
"succeeds",
"returns",
"true",
";",
"otherwise",
"returns",... | def check_func(self, func, headers=None, include_dirs=None,
libraries=None, library_dirs=None, decl=0, call=0):
"""Determine if function 'func' is available by constructing a
source file that refers to 'func', and compiles and links it.
If everything succeeds, returns true; o... | [
"def",
"check_func",
"(",
"self",
",",
"func",
",",
"headers",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"libraries",
"=",
"None",
",",
"library_dirs",
"=",
"None",
",",
"decl",
"=",
"0",
",",
"call",
"=",
"0",
")",
":",
"self",
".",
"_ch... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/command/config.py#L285-L315 | |
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | python-threatexchange/threatexchange/api.py | python | ThreatExchangeAPI.get_threat_privacy_groups_member | (
self,
) | return [ThreatPrivacyGroup.from_graph_api_dict(d) for d in response["data"]] | Returns a non-paginated list of all privacy groups the current app is a
member of. | Returns a non-paginated list of all privacy groups the current app is a
member of. | [
"Returns",
"a",
"non",
"-",
"paginated",
"list",
"of",
"all",
"privacy",
"groups",
"the",
"current",
"app",
"is",
"a",
"member",
"of",
"."
] | def get_threat_privacy_groups_member(
self,
) -> t.List[ThreatPrivacyGroup]:
"""
Returns a non-paginated list of all privacy groups the current app is a
member of.
"""
fields = [
"id",
"members_can_see",
"members_can_use",
... | [
"def",
"get_threat_privacy_groups_member",
"(",
"self",
",",
")",
"->",
"t",
".",
"List",
"[",
"ThreatPrivacyGroup",
"]",
":",
"fields",
"=",
"[",
"\"id\"",
",",
"\"members_can_see\"",
",",
"\"members_can_use\"",
",",
"\"name\"",
",",
"\"description\"",
",",
"\"... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/python-threatexchange/threatexchange/api.py#L315-L336 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/Devices/EFI/Firmware/AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py | python | TextDoc.indent | (self, text, prefix=' ') | return join(lines, '\n') | Indent text by prepending a given prefix to each line. | Indent text by prepending a given prefix to each line. | [
"Indent",
"text",
"by",
"prepending",
"a",
"given",
"prefix",
"to",
"each",
"line",
"."
] | def indent(self, text, prefix=' '):
"""Indent text by prepending a given prefix to each line."""
if not text: return ''
lines = split(text, '\n')
lines = map(lambda line, prefix=prefix: prefix + line, lines)
if lines: lines[-1] = rstrip(lines[-1])
return join(lines, '\... | [
"def",
"indent",
"(",
"self",
",",
"text",
",",
"prefix",
"=",
"' '",
")",
":",
"if",
"not",
"text",
":",
"return",
"''",
"lines",
"=",
"split",
"(",
"text",
",",
"'\\n'",
")",
"lines",
"=",
"map",
"(",
"lambda",
"line",
",",
"prefix",
"=",
"p... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Devices/EFI/Firmware/AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py#L989-L995 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | NativeFontInfo.__str__ | (*args, **kwargs) | return _gdi_.NativeFontInfo___str__(*args, **kwargs) | __str__(self) -> String | __str__(self) -> String | [
"__str__",
"(",
"self",
")",
"-",
">",
"String"
] | def __str__(*args, **kwargs):
"""__str__(self) -> String"""
return _gdi_.NativeFontInfo___str__(*args, **kwargs) | [
"def",
"__str__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativeFontInfo___str__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2046-L2048 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/tools/compatibility/tf_upgrade_v2.py | python | _rename_if_arg_found_and_add_loss_reduction_transformer | (
parent,
node,
full_name,
name,
logs,
arg_names=None,
arg_ok_predicate=None,
remove_if_ok=False,
message=None) | return node | Combination of _rename_if_arg_found and _add_loss_reduction transformers.
Args:
parent: Parent of node.
node: ast.Call node to maybe modify.
full_name: full name of function to modify
name: name of function to modify
logs: list of logs to append to
arg_names: list of names of the argument to ... | Combination of _rename_if_arg_found and _add_loss_reduction transformers. | [
"Combination",
"of",
"_rename_if_arg_found",
"and",
"_add_loss_reduction",
"transformers",
"."
] | def _rename_if_arg_found_and_add_loss_reduction_transformer(
parent,
node,
full_name,
name,
logs,
arg_names=None,
arg_ok_predicate=None,
remove_if_ok=False,
message=None):
"""Combination of _rename_if_arg_found and _add_loss_reduction transformers.
Args:
parent: Parent of no... | [
"def",
"_rename_if_arg_found_and_add_loss_reduction_transformer",
"(",
"parent",
",",
"node",
",",
"full_name",
",",
"name",
",",
"logs",
",",
"arg_names",
"=",
"None",
",",
"arg_ok_predicate",
"=",
"None",
",",
"remove_if_ok",
"=",
"False",
",",
"message",
"=",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/compatibility/tf_upgrade_v2.py#L2166-L2204 | |
mwydmuch/ViZDoom | 674826a01dacbea4d6e000f2297d8fc1a05393e0 | examples/python/learning_pytorch.py | python | preprocess | (img) | return img | Down samples image to resolution | Down samples image to resolution | [
"Down",
"samples",
"image",
"to",
"resolution"
] | def preprocess(img):
"""Down samples image to resolution"""
img = skimage.transform.resize(img, resolution)
img = img.astype(np.float32)
img = np.expand_dims(img, axis=0)
return img | [
"def",
"preprocess",
"(",
"img",
")",
":",
"img",
"=",
"skimage",
".",
"transform",
".",
"resize",
"(",
"img",
",",
"resolution",
")",
"img",
"=",
"img",
".",
"astype",
"(",
"np",
".",
"float32",
")",
"img",
"=",
"np",
".",
"expand_dims",
"(",
"img... | https://github.com/mwydmuch/ViZDoom/blob/674826a01dacbea4d6e000f2297d8fc1a05393e0/examples/python/learning_pytorch.py#L57-L62 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/tensorboard/backend/handler.py | python | TensorboardHandler._query_for_individual_audio | (self, run, tag, index) | return query_string | Builds a URL for accessing the specified audio.
This should be kept in sync with _serve_individual_audio. Note that the URL
is *not* guaranteed to always return the same audio, since audio may be
unloaded from the reservoir as new audio comes in.
Args:
run: The name of the run.
tag: The ta... | Builds a URL for accessing the specified audio. | [
"Builds",
"a",
"URL",
"for",
"accessing",
"the",
"specified",
"audio",
"."
] | def _query_for_individual_audio(self, run, tag, index):
"""Builds a URL for accessing the specified audio.
This should be kept in sync with _serve_individual_audio. Note that the URL
is *not* guaranteed to always return the same audio, since audio may be
unloaded from the reservoir as new audio comes i... | [
"def",
"_query_for_individual_audio",
"(",
"self",
",",
"run",
",",
"tag",
",",
"index",
")",
":",
"query_string",
"=",
"urllib",
".",
"parse",
".",
"urlencode",
"(",
"{",
"'run'",
":",
"run",
",",
"'tag'",
":",
"tag",
",",
"'index'",
":",
"index",
"}"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/tensorboard/backend/handler.py#L458-L479 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py | python | MergeManifests._IsDuplicate | (self, node_to_copy, node) | return False | Is element a duplicate? | Is element a duplicate? | [
"Is",
"element",
"a",
"duplicate?"
] | def _IsDuplicate(self, node_to_copy, node):
"""Is element a duplicate?"""
for merger_node in self._merger_dom.getElementsByTagName(node_to_copy):
if (merger_node.getAttribute(self._ANDROID_NAME) ==
node.getAttribute(self._ANDROID_NAME)):
return True
return False | [
"def",
"_IsDuplicate",
"(",
"self",
",",
"node_to_copy",
",",
"node",
")",
":",
"for",
"merger_node",
"in",
"self",
".",
"_merger_dom",
".",
"getElementsByTagName",
"(",
"node_to_copy",
")",
":",
"if",
"(",
"merger_node",
".",
"getAttribute",
"(",
"self",
".... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py#L212-L218 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | RadioBox.FindString | (*args, **kwargs) | return _controls_.RadioBox_FindString(*args, **kwargs) | FindString(self, String s) -> int | FindString(self, String s) -> int | [
"FindString",
"(",
"self",
"String",
"s",
")",
"-",
">",
"int"
] | def FindString(*args, **kwargs):
"""FindString(self, String s) -> int"""
return _controls_.RadioBox_FindString(*args, **kwargs) | [
"def",
"FindString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"RadioBox_FindString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L2615-L2617 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/analogclock/analogclock.py | python | AnalogClock.SetHandSize | (self, size, target=ALL) | Sets thickness of hands. | Sets thickness of hands. | [
"Sets",
"thickness",
"of",
"hands",
"."
] | def SetHandSize(self, size, target=ALL):
"""Sets thickness of hands."""
self.Hands.SetSize(size, target) | [
"def",
"SetHandSize",
"(",
"self",
",",
"size",
",",
"target",
"=",
"ALL",
")",
":",
"self",
".",
"Hands",
".",
"SetSize",
"(",
"size",
",",
"target",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/analogclock/analogclock.py#L340-L343 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/inline_closurecall.py | python | _inline_arraycall | (func_ir, cfg, visited, loop, swapped, enable_prange=False,
typed=False) | return True | Look for array(list) call in the exit block of a given loop, and turn list operations into
array operations in the loop if the following conditions are met:
1. The exit block contains an array call on the list;
2. The list variable is no longer live after array call;
3. The list is created in the ... | Look for array(list) call in the exit block of a given loop, and turn list operations into
array operations in the loop if the following conditions are met:
1. The exit block contains an array call on the list;
2. The list variable is no longer live after array call;
3. The list is created in the ... | [
"Look",
"for",
"array",
"(",
"list",
")",
"call",
"in",
"the",
"exit",
"block",
"of",
"a",
"given",
"loop",
"and",
"turn",
"list",
"operations",
"into",
"array",
"operations",
"in",
"the",
"loop",
"if",
"the",
"following",
"conditions",
"are",
"met",
":"... | def _inline_arraycall(func_ir, cfg, visited, loop, swapped, enable_prange=False,
typed=False):
"""Look for array(list) call in the exit block of a given loop, and turn list operations into
array operations in the loop if the following conditions are met:
1. The exit block contains an... | [
"def",
"_inline_arraycall",
"(",
"func_ir",
",",
"cfg",
",",
"visited",
",",
"loop",
",",
"swapped",
",",
"enable_prange",
"=",
"False",
",",
"typed",
"=",
"False",
")",
":",
"debug_print",
"=",
"_make_debug_print",
"(",
"\"inline_arraycall\"",
")",
"# There s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/inline_closurecall.py#L636-L882 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"cl... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py#L717-L740 | ||
VladyslavUsenko/basalt-mirror | 6d55fdab9ff2e6901dbcab634cf5025c58ad7371 | python/basalt/experiments.py | python | Experiment.load_all | (specs, config_file, base_path, cache_dir, seq_name_mapping=None) | return exps | Load a set experiments from log files or cache
If there is more than one experiment with the same name, an error is raised.
:param specs: list of experiments specs, e.g. from a experiments config file
:param config_file: experiments config file path (currently unused)
:... | Load a set experiments from log files or cache
If there is more than one experiment with the same name, an error is raised.
:param specs: list of experiments specs, e.g. from a experiments config file
:param config_file: experiments config file path (currently unused)
:... | [
"Load",
"a",
"set",
"experiments",
"from",
"log",
"files",
"or",
"cache",
"If",
"there",
"is",
"more",
"than",
"one",
"experiment",
"with",
"the",
"same",
"name",
"an",
"error",
"is",
"raised",
".",
":",
"param",
"specs",
":",
"list",
"of",
"experiments"... | def load_all(specs, config_file, base_path, cache_dir, seq_name_mapping=None):
"""Load a set experiments from log files or cache
If there is more than one experiment with the same name, an error is raised.
:param specs: list of experiments specs, e.g. from a experiments config ... | [
"def",
"load_all",
"(",
"specs",
",",
"config_file",
",",
"base_path",
",",
"cache_dir",
",",
"seq_name_mapping",
"=",
"None",
")",
":",
"# Note: Seems saving everything to one cache file isn't much faster than the per-experiments cache...",
"use_combined_cache",
"=",
"False",
... | https://github.com/VladyslavUsenko/basalt-mirror/blob/6d55fdab9ff2e6901dbcab634cf5025c58ad7371/python/basalt/experiments.py#L234-L289 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/mailbox.py | python | MMDF.__init__ | (self, path, factory=None, create=True) | Initialize an MMDF mailbox. | Initialize an MMDF mailbox. | [
"Initialize",
"an",
"MMDF",
"mailbox",
"."
] | def __init__(self, path, factory=None, create=True):
"""Initialize an MMDF mailbox."""
self._message_factory = MMDFMessage
_mboxMMDF.__init__(self, path, factory, create) | [
"def",
"__init__",
"(",
"self",
",",
"path",
",",
"factory",
"=",
"None",
",",
"create",
"=",
"True",
")",
":",
"self",
".",
"_message_factory",
"=",
"MMDFMessage",
"_mboxMMDF",
".",
"__init__",
"(",
"self",
",",
"path",
",",
"factory",
",",
"create",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L893-L896 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/function_base.py | python | average | (a, axis=None, weights=None, returned=False) | Compute the weighted average along the specified axis.
Parameters
----------
a : array_like
Array containing data to be averaged. If `a` is not an array, a
conversion is attempted.
axis : int, optional
Axis along which to average `a`. If `None`, averaging is done over
th... | Compute the weighted average along the specified axis. | [
"Compute",
"the",
"weighted",
"average",
"along",
"the",
"specified",
"axis",
"."
] | def average(a, axis=None, weights=None, returned=False):
"""
Compute the weighted average along the specified axis.
Parameters
----------
a : array_like
Array containing data to be averaged. If `a` is not an array, a
conversion is attempted.
axis : int, optional
Axis alo... | [
"def",
"average",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"weights",
"=",
"None",
",",
"returned",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"a",
",",
"np",
".",
"matrix",
")",
":",
"a",
"=",
"np",
".",
"asarray",
"(",
"a",
")",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/function_base.py#L412-L524 | ||
SIPp/sipp | f44d0cf5dec0013eff8fd7b4da885d455aa82e0e | cpplint.py | python | GetPreviousNonBlankLine | (clean_lines, linenum) | return ('', -1) | Return the most recent non-blank line and its line number.
Args:
clean_lines: A CleansedLines instance containing the file contents.
linenum: The number of the line to check.
Returns:
A tuple with two elements. The first element is the contents of the last
non-blank line before the current line, ... | Return the most recent non-blank line and its line number. | [
"Return",
"the",
"most",
"recent",
"non",
"-",
"blank",
"line",
"and",
"its",
"line",
"number",
"."
] | def GetPreviousNonBlankLine(clean_lines, linenum):
"""Return the most recent non-blank line and its line number.
Args:
clean_lines: A CleansedLines instance containing the file contents.
linenum: The number of the line to check.
Returns:
A tuple with two elements. The first element is the contents ... | [
"def",
"GetPreviousNonBlankLine",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"prevlinenum",
"=",
"linenum",
"-",
"1",
"while",
"prevlinenum",
">=",
"0",
":",
"prevline",
"=",
"clean_lines",
".",
"elided",
"[",
"prevlinenum",
"]",
"if",
"not",
"IsBlankLine",... | https://github.com/SIPp/sipp/blob/f44d0cf5dec0013eff8fd7b4da885d455aa82e0e/cpplint.py#L2544-L2564 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/symbol/symbol.py | python | Symbol.log | (self, *args, **kwargs) | return op.log(self, *args, **kwargs) | Convenience fluent method for :py:func:`log`.
The arguments are the same as for :py:func:`log`, with
this array as data. | Convenience fluent method for :py:func:`log`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"log",
"."
] | def log(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`log`.
The arguments are the same as for :py:func:`log`, with
this array as data.
"""
return op.log(self, *args, **kwargs) | [
"def",
"log",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"log",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/symbol.py#L2223-L2229 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ftplib.py | python | FTP.abort | (self) | Abort a file transfer. Uses out-of-band data.
This does not follow the procedure from the RFC to send Telnet
IP and Synch; that doesn't seem to work with the servers I've
tried. Instead, just send the ABOR command as OOB data. | Abort a file transfer. Uses out-of-band data.
This does not follow the procedure from the RFC to send Telnet
IP and Synch; that doesn't seem to work with the servers I've
tried. Instead, just send the ABOR command as OOB data. | [
"Abort",
"a",
"file",
"transfer",
".",
"Uses",
"out",
"-",
"of",
"-",
"band",
"data",
".",
"This",
"does",
"not",
"follow",
"the",
"procedure",
"from",
"the",
"RFC",
"to",
"send",
"Telnet",
"IP",
"and",
"Synch",
";",
"that",
"doesn",
"t",
"seem",
"to... | def abort(self):
'''Abort a file transfer. Uses out-of-band data.
This does not follow the procedure from the RFC to send Telnet
IP and Synch; that doesn't seem to work with the servers I've
tried. Instead, just send the ABOR command as OOB data.'''
line = 'ABOR' + CRLF
... | [
"def",
"abort",
"(",
"self",
")",
":",
"line",
"=",
"'ABOR'",
"+",
"CRLF",
"if",
"self",
".",
"debugging",
">",
"1",
":",
"print",
"'*put urgent*'",
",",
"self",
".",
"sanitize",
"(",
"line",
")",
"self",
".",
"sock",
".",
"sendall",
"(",
"line",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ftplib.py#L236-L246 | ||
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | GLGenerator.AddFunction | (self, func) | Adds a function. | Adds a function. | [
"Adds",
"a",
"function",
"."
] | def AddFunction(self, func):
"""Adds a function."""
self.functions.append(func) | [
"def",
"AddFunction",
"(",
"self",
",",
"func",
")",
":",
"self",
".",
"functions",
".",
"append",
"(",
"func",
")"
] | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L9905-L9907 | ||
chatopera/clause | dee31153d5ffdef33deedb6bff03e7806c296968 | var/assets/clients/gen-py/clause/Serving.py | python | Iface.delUtter | (self, request) | Parameters:
- request | Parameters:
- request | [
"Parameters",
":",
"-",
"request"
] | def delUtter(self, request):
"""
Parameters:
- request
"""
pass | [
"def",
"delUtter",
"(",
"self",
",",
"request",
")",
":",
"pass"
] | https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/var/assets/clients/gen-py/clause/Serving.py#L238-L244 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/internal/well_known_types.py | python | Timestamp.ToJsonString | (self) | return result + '.%09dZ' % nanos | Converts Timestamp to RFC 3339 date string format.
Returns:
A string converted from timestamp. The string is always Z-normalized
and uses 3, 6 or 9 fractional digits as required to represent the
exact time. Example of the return format: '1972-01-01T10:00:20.021Z' | Converts Timestamp to RFC 3339 date string format. | [
"Converts",
"Timestamp",
"to",
"RFC",
"3339",
"date",
"string",
"format",
"."
] | def ToJsonString(self):
"""Converts Timestamp to RFC 3339 date string format.
Returns:
A string converted from timestamp. The string is always Z-normalized
and uses 3, 6 or 9 fractional digits as required to represent the
exact time. Example of the return format: '1972-01-01T10:00:20.021Z'
... | [
"def",
"ToJsonString",
"(",
"self",
")",
":",
"nanos",
"=",
"self",
".",
"nanos",
"%",
"_NANOS_PER_SECOND",
"total_sec",
"=",
"self",
".",
"seconds",
"+",
"(",
"self",
".",
"nanos",
"-",
"nanos",
")",
"//",
"_NANOS_PER_SECOND",
"seconds",
"=",
"total_sec",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/well_known_types.py#L107-L133 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBBreakpointName.__eq__ | (self, rhs) | return _lldb.SBBreakpointName___eq__(self, rhs) | __eq__(SBBreakpointName self, SBBreakpointName rhs) -> bool | __eq__(SBBreakpointName self, SBBreakpointName rhs) -> bool | [
"__eq__",
"(",
"SBBreakpointName",
"self",
"SBBreakpointName",
"rhs",
")",
"-",
">",
"bool"
] | def __eq__(self, rhs):
"""__eq__(SBBreakpointName self, SBBreakpointName rhs) -> bool"""
return _lldb.SBBreakpointName___eq__(self, rhs) | [
"def",
"__eq__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"_lldb",
".",
"SBBreakpointName___eq__",
"(",
"self",
",",
"rhs",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2183-L2185 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/tracking/data_structures.py | python | ListWrapper._check_external_modification | (self) | Checks for any changes to the wrapped list not through the wrapper. | Checks for any changes to the wrapped list not through the wrapper. | [
"Checks",
"for",
"any",
"changes",
"to",
"the",
"wrapped",
"list",
"not",
"through",
"the",
"wrapper",
"."
] | def _check_external_modification(self):
"""Checks for any changes to the wrapped list not through the wrapper."""
if self._external_modification or self._non_append_mutation:
return
if self._storage != self._last_wrapped_list_snapshot:
self._external_modification = True
self._last_wrapped_... | [
"def",
"_check_external_modification",
"(",
"self",
")",
":",
"if",
"self",
".",
"_external_modification",
"or",
"self",
".",
"_non_append_mutation",
":",
"return",
"if",
"self",
".",
"_storage",
"!=",
"self",
".",
"_last_wrapped_list_snapshot",
":",
"self",
".",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/tracking/data_structures.py#L538-L544 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/cli/cli_shared.py | python | format_tensor | (tensor,
tensor_name,
np_printoptions,
print_all=False,
tensor_slicing=None,
highlight_options=None,
include_numeric_summary=False) | return tensor_format.format_tensor(
value,
sliced_name,
include_metadata=True,
include_numeric_summary=include_numeric_summary,
np_printoptions=np_printoptions,
highlight_options=highlight_options) | Generate formatted str to represent a tensor or its slices.
Args:
tensor: (numpy ndarray) The tensor value.
tensor_name: (str) Name of the tensor, e.g., the tensor's debug watch key.
np_printoptions: (dict) Numpy tensor formatting options.
print_all: (bool) Whether the tensor is to be displayed in it... | Generate formatted str to represent a tensor or its slices. | [
"Generate",
"formatted",
"str",
"to",
"represent",
"a",
"tensor",
"or",
"its",
"slices",
"."
] | def format_tensor(tensor,
tensor_name,
np_printoptions,
print_all=False,
tensor_slicing=None,
highlight_options=None,
include_numeric_summary=False):
"""Generate formatted str to represent a tensor or its slice... | [
"def",
"format_tensor",
"(",
"tensor",
",",
"tensor_name",
",",
"np_printoptions",
",",
"print_all",
"=",
"False",
",",
"tensor_slicing",
"=",
"None",
",",
"highlight_options",
"=",
"None",
",",
"include_numeric_summary",
"=",
"False",
")",
":",
"if",
"tensor_sl... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/cli/cli_shared.py#L148-L198 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/framework/python/ops/ops.py | python | get_graph_from_inputs | (op_input_list, graph=None) | return ops._get_graph_from_inputs(op_input_list, graph) | Returns the appropriate graph to use for the given inputs.
1. If `graph` is provided, we validate that all inputs in `op_input_list` are
from the same graph.
2. Otherwise, we attempt to select a graph from the first Operation- or
Tensor-valued input in `op_input_list`, and validate that all other
su... | Returns the appropriate graph to use for the given inputs. | [
"Returns",
"the",
"appropriate",
"graph",
"to",
"use",
"for",
"the",
"given",
"inputs",
"."
] | def get_graph_from_inputs(op_input_list, graph=None):
"""Returns the appropriate graph to use for the given inputs.
1. If `graph` is provided, we validate that all inputs in `op_input_list` are
from the same graph.
2. Otherwise, we attempt to select a graph from the first Operation- or
Tensor-valued in... | [
"def",
"get_graph_from_inputs",
"(",
"op_input_list",
",",
"graph",
"=",
"None",
")",
":",
"# pylint: disable=protected-access",
"return",
"ops",
".",
"_get_graph_from_inputs",
"(",
"op_input_list",
",",
"graph",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/framework/python/ops/ops.py#L27-L54 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py | python | WindowsScriptWriter._adjust_header | (cls, type_, orig_header) | return new_header if cls._use_header(new_header) else orig_header | Make sure 'pythonw' is used for gui and and 'python' is used for
console (regardless of what sys.executable is). | Make sure 'pythonw' is used for gui and and 'python' is used for
console (regardless of what sys.executable is). | [
"Make",
"sure",
"pythonw",
"is",
"used",
"for",
"gui",
"and",
"and",
"python",
"is",
"used",
"for",
"console",
"(",
"regardless",
"of",
"what",
"sys",
".",
"executable",
"is",
")",
"."
] | def _adjust_header(cls, type_, orig_header):
"""
Make sure 'pythonw' is used for gui and and 'python' is used for
console (regardless of what sys.executable is).
"""
pattern = 'pythonw.exe'
repl = 'python.exe'
if type_ == 'gui':
pattern, repl = repl, p... | [
"def",
"_adjust_header",
"(",
"cls",
",",
"type_",
",",
"orig_header",
")",
":",
"pattern",
"=",
"'pythonw.exe'",
"repl",
"=",
"'python.exe'",
"if",
"type_",
"==",
"'gui'",
":",
"pattern",
",",
"repl",
"=",
"repl",
",",
"pattern",
"pattern_ob",
"=",
"re",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py#L2201-L2212 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/geindexcheck/gecheckpublishroot.py | python | DiscoverPublishStreamSpace | () | return stream_space_root | Greps the installed stream_space config for the stream_space path. | Greps the installed stream_space config for the stream_space path. | [
"Greps",
"the",
"installed",
"stream_space",
"config",
"for",
"the",
"stream_space",
"path",
"."
] | def DiscoverPublishStreamSpace():
"""Greps the installed stream_space config for the stream_space path."""
stream_space_conf = STREAM_SPACE_CONF_PATH
match = MatchPattern(stream_space_conf,
r"^Alias\s+/stream_space\s+(.*)")
if not match:
Die("No publish stream_space path found in %s"... | [
"def",
"DiscoverPublishStreamSpace",
"(",
")",
":",
"stream_space_conf",
"=",
"STREAM_SPACE_CONF_PATH",
"match",
"=",
"MatchPattern",
"(",
"stream_space_conf",
",",
"r\"^Alias\\s+/stream_space\\s+(.*)\"",
")",
"if",
"not",
"match",
":",
"Die",
"(",
"\"No publish stream_sp... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/geindexcheck/gecheckpublishroot.py#L92-L106 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/bfs.py | python | _get_bond_tree | (radii, geom, allblocks, blocksize, bond_threshold) | return bond_tree | Create bond tree from atomic coordinates | Create bond tree from atomic coordinates | [
"Create",
"bond",
"tree",
"from",
"atomic",
"coordinates"
] | def _get_bond_tree(radii, geom, allblocks, blocksize, bond_threshold):
"""Create bond tree from atomic coordinates"""
bond_tree = [[] for at in range(geom.shape[0])]
for blk in allblocks:
atom_list = _get_atoms_from_blocks(_get_neighbor_blocks(blk, blocksize, allblocks), allblocks)
for at1 ... | [
"def",
"_get_bond_tree",
"(",
"radii",
",",
"geom",
",",
"allblocks",
",",
"blocksize",
",",
"bond_threshold",
")",
":",
"bond_tree",
"=",
"[",
"[",
"]",
"for",
"at",
"in",
"range",
"(",
"geom",
".",
"shape",
"[",
"0",
"]",
")",
"]",
"for",
"blk",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/bfs.py#L182-L197 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py | python | _invoke | (user_pythonizor, npars, klass, fqn) | Invokes the given user pythonizor function with the right arguments.
Args:
user_pythonizor (function): user pythonizor function.
npars (int): number of parameters of the user pythonizor function.
klass (class type): cppyy proxy of the class to be pythonized.
fqn (string): fully-qual... | Invokes the given user pythonizor function with the right arguments. | [
"Invokes",
"the",
"given",
"user",
"pythonizor",
"function",
"with",
"the",
"right",
"arguments",
"."
] | def _invoke(user_pythonizor, npars, klass, fqn):
'''
Invokes the given user pythonizor function with the right arguments.
Args:
user_pythonizor (function): user pythonizor function.
npars (int): number of parameters of the user pythonizor function.
klass (class type): cppyy proxy of... | [
"def",
"_invoke",
"(",
"user_pythonizor",
",",
"npars",
",",
"klass",
",",
"fqn",
")",
":",
"try",
":",
"if",
"npars",
"==",
"1",
":",
"user_pythonizor",
"(",
"klass",
")",
"else",
":",
"user_pythonizor",
"(",
"klass",
",",
"fqn",
")",
"except",
"Excep... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/pythonizations/python/ROOT/_pythonization/__init__.py#L218-L239 | ||
smartdevicelink/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | src/3rd_party/apr-1.5.0/build/gen-build.py | python | resolve_deps | (header_deps) | Alter the provided dictionary to flatten includes-of-includes. | Alter the provided dictionary to flatten includes-of-includes. | [
"Alter",
"the",
"provided",
"dictionary",
"to",
"flatten",
"includes",
"-",
"of",
"-",
"includes",
"."
] | def resolve_deps(header_deps):
"Alter the provided dictionary to flatten includes-of-includes."
altered = 1
while altered:
altered = 0
for hdr, deps in header_deps.items():
# print hdr, deps
start = len(deps)
for dep in deps.keys():
deps.update(header_deps.get(dep, {}))
if ... | [
"def",
"resolve_deps",
"(",
"header_deps",
")",
":",
"altered",
"=",
"1",
"while",
"altered",
":",
"altered",
"=",
"0",
"for",
"hdr",
",",
"deps",
"in",
"header_deps",
".",
"items",
"(",
")",
":",
"# print hdr, deps",
"start",
"=",
"len",
"(",
"deps",
... | https://github.com/smartdevicelink/sdl_core/blob/68f082169e0a40fccd9eb0db3c83911c28870f07/src/3rd_party/apr-1.5.0/build/gen-build.py#L205-L216 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.