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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/docs/conf.py | python | cleanup_source | (app, docname, source) | Cleans up source files generated by automodapi. | Cleans up source files generated by automodapi. | [
"Cleans",
"up",
"source",
"files",
"generated",
"by",
"automodapi",
"."
] | def cleanup_source(app, docname, source):
""" Cleans up source files generated by automodapi. """
# Don't cleanup anything beside automodapi-generated sources.
if not automodapi_toctreedirnm in docname:
return
processed = source[0]
# Don't show the list of inheritance info as there is no inhe... | [
"def",
"cleanup_source",
"(",
"app",
",",
"docname",
",",
"source",
")",
":",
"# Don't cleanup anything beside automodapi-generated sources.",
"if",
"not",
"automodapi_toctreedirnm",
"in",
"docname",
":",
"return",
"processed",
"=",
"source",
"[",
"0",
"]",
"# Don't s... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/docs/conf.py#L296-L321 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc.winfo_pathname | (self, id, displayof=0) | return self.tk.call(args) | Return the pathname of the widget given by ID. | Return the pathname of the widget given by ID. | [
"Return",
"the",
"pathname",
"of",
"the",
"widget",
"given",
"by",
"ID",
"."
] | def winfo_pathname(self, id, displayof=0):
"""Return the pathname of the widget given by ID."""
args = ('winfo', 'pathname') \
+ self._displayof(displayof) + (id,)
return self.tk.call(args) | [
"def",
"winfo_pathname",
"(",
"self",
",",
"id",
",",
"displayof",
"=",
"0",
")",
":",
"args",
"=",
"(",
"'winfo'",
",",
"'pathname'",
")",
"+",
"self",
".",
"_displayof",
"(",
"displayof",
")",
"+",
"(",
"id",
",",
")",
"return",
"self",
".",
"tk"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L804-L808 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/python/interpreter.py | python | InterpreterWithCustomOps.__init__ | (self, custom_op_registerers=None, **kwargs) | Constructor.
Args:
custom_op_registerers: List of str (symbol names) or functions that take a
pointer to a MutableOpResolver and register a custom op. When passing
functions, use a pybind function that takes a uintptr_t that can be
recast as a pointer to a MutableOpResolver.
**k... | Constructor. | [
"Constructor",
"."
] | def __init__(self, custom_op_registerers=None, **kwargs):
"""Constructor.
Args:
custom_op_registerers: List of str (symbol names) or functions that take a
pointer to a MutableOpResolver and register a custom op. When passing
functions, use a pybind function that takes a uintptr_t that can... | [
"def",
"__init__",
"(",
"self",
",",
"custom_op_registerers",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_custom_op_registerers",
"=",
"custom_op_registerers",
"or",
"[",
"]",
"super",
"(",
"InterpreterWithCustomOps",
",",
"self",
")",
".",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/interpreter.py#L955-L969 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosmsg/src/rosmsg/__init__.py | python | get_msg_text | (type_, raw=False, rospack=None) | Get .msg file for type_ as text
:param type_: message type, ``str``
:param raw: if True, include comments and whitespace (default False), ``bool``
:returns: text of .msg file, ``str``
:raises :exc:`ROSMsgException` If type_ is unknown | Get .msg file for type_ as text
:param type_: message type, ``str``
:param raw: if True, include comments and whitespace (default False), ``bool``
:returns: text of .msg file, ``str``
:raises :exc:`ROSMsgException` If type_ is unknown | [
"Get",
".",
"msg",
"file",
"for",
"type_",
"as",
"text",
":",
"param",
"type_",
":",
"message",
"type",
"str",
":",
"param",
"raw",
":",
"if",
"True",
"include",
"comments",
"and",
"whitespace",
"(",
"default",
"False",
")",
"bool",
":",
"returns",
":"... | def get_msg_text(type_, raw=False, rospack=None):
"""
Get .msg file for type_ as text
:param type_: message type, ``str``
:param raw: if True, include comments and whitespace (default False), ``bool``
:returns: text of .msg file, ``str``
:raises :exc:`ROSMsgException` If type_ is unknown
"""... | [
"def",
"get_msg_text",
"(",
"type_",
",",
"raw",
"=",
"False",
",",
"rospack",
"=",
"None",
")",
":",
"if",
"rospack",
"is",
"None",
":",
"rospack",
"=",
"rospkg",
".",
"RosPack",
"(",
")",
"search_path",
"=",
"{",
"}",
"for",
"p",
"in",
"rospack",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosmsg/src/rosmsg/__init__.py#L414-L439 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pickle.py | python | Pickler.__init__ | (self, file, protocol=None) | This takes a file-like object for writing a pickle data stream.
The optional protocol argument tells the pickler to use the
given protocol; supported protocols are 0, 1, 2. The default
protocol is 0, to be backwards compatible. (Protocol 0 is the
only protocol that can be written to a... | This takes a file-like object for writing a pickle data stream. | [
"This",
"takes",
"a",
"file",
"-",
"like",
"object",
"for",
"writing",
"a",
"pickle",
"data",
"stream",
"."
] | def __init__(self, file, protocol=None):
"""This takes a file-like object for writing a pickle data stream.
The optional protocol argument tells the pickler to use the
given protocol; supported protocols are 0, 1, 2. The default
protocol is 0, to be backwards compatible. (Protocol 0 i... | [
"def",
"__init__",
"(",
"self",
",",
"file",
",",
"protocol",
"=",
"None",
")",
":",
"if",
"protocol",
"is",
"None",
":",
"protocol",
"=",
"0",
"if",
"protocol",
"<",
"0",
":",
"protocol",
"=",
"HIGHEST_PROTOCOL",
"elif",
"not",
"0",
"<=",
"protocol",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/pickle.py#L173-L207 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetPrecompiledHeader | (self, config, gyp_to_build_path) | return _PchHelper(self, config, gyp_to_build_path) | Returns an object that handles the generation of precompiled header
build steps. | Returns an object that handles the generation of precompiled header
build steps. | [
"Returns",
"an",
"object",
"that",
"handles",
"the",
"generation",
"of",
"precompiled",
"header",
"build",
"steps",
"."
] | def GetPrecompiledHeader(self, config, gyp_to_build_path):
"""Returns an object that handles the generation of precompiled header
build steps."""
config = self._RealConfig(config)
return _PchHelper(self, config, gyp_to_build_path) | [
"def",
"GetPrecompiledHeader",
"(",
"self",
",",
"config",
",",
"gyp_to_build_path",
")",
":",
"config",
"=",
"self",
".",
"_RealConfig",
"(",
"config",
")",
"return",
"_PchHelper",
"(",
"self",
",",
"config",
",",
"gyp_to_build_path",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py#L310-L314 | |
pristineio/webrtc-mirror | 7a5bcdffaab90a05bc1146b2b1ea71c004e54d71 | tools_webrtc/valgrind/memcheck_analyze.py | python | shortenFilePath | (source_dir, directory) | return directory | Returns a string with the string prefix |source_dir| removed from
|directory|. | Returns a string with the string prefix |source_dir| removed from
|directory|. | [
"Returns",
"a",
"string",
"with",
"the",
"string",
"prefix",
"|source_dir|",
"removed",
"from",
"|directory|",
"."
] | def shortenFilePath(source_dir, directory):
'''Returns a string with the string prefix |source_dir| removed from
|directory|.'''
prefixes_to_cut = ["build/src/", "valgrind/coregrind/", "out/Release/../../"]
if source_dir:
prefixes_to_cut.append(source_dir)
for p in prefixes_to_cut:
index = directory... | [
"def",
"shortenFilePath",
"(",
"source_dir",
",",
"directory",
")",
":",
"prefixes_to_cut",
"=",
"[",
"\"build/src/\"",
",",
"\"valgrind/coregrind/\"",
",",
"\"out/Release/../../\"",
"]",
"if",
"source_dir",
":",
"prefixes_to_cut",
".",
"append",
"(",
"source_dir",
... | https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/valgrind/memcheck_analyze.py#L64-L77 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateTime.AddDS | (*args, **kwargs) | return _misc_.DateTime_AddDS(*args, **kwargs) | AddDS(self, DateSpan diff) -> DateTime | AddDS(self, DateSpan diff) -> DateTime | [
"AddDS",
"(",
"self",
"DateSpan",
"diff",
")",
"-",
">",
"DateTime"
] | def AddDS(*args, **kwargs):
"""AddDS(self, DateSpan diff) -> DateTime"""
return _misc_.DateTime_AddDS(*args, **kwargs) | [
"def",
"AddDS",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_AddDS",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4061-L4063 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.GetLineSelEndPosition | (*args, **kwargs) | return _stc.StyledTextCtrl_GetLineSelEndPosition(*args, **kwargs) | GetLineSelEndPosition(self, int line) -> int
Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). | GetLineSelEndPosition(self, int line) -> int | [
"GetLineSelEndPosition",
"(",
"self",
"int",
"line",
")",
"-",
">",
"int"
] | def GetLineSelEndPosition(*args, **kwargs):
"""
GetLineSelEndPosition(self, int line) -> int
Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
"""
return _stc.StyledTextCtrl_GetLineSelEndPosition(*args, **kwargs) | [
"def",
"GetLineSelEndPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetLineSelEndPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5359-L5365 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.GetDefaultCellTextColour | (*args, **kwargs) | return _grid.Grid_GetDefaultCellTextColour(*args, **kwargs) | GetDefaultCellTextColour(self) -> Colour | GetDefaultCellTextColour(self) -> Colour | [
"GetDefaultCellTextColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetDefaultCellTextColour(*args, **kwargs):
"""GetDefaultCellTextColour(self) -> Colour"""
return _grid.Grid_GetDefaultCellTextColour(*args, **kwargs) | [
"def",
"GetDefaultCellTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_GetDefaultCellTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1778-L1780 | |
google/usd_from_gltf | 6d288cce8b68744494a226574ae1d7ba6a9c46eb | tools/ufgbatch/ufgcommon/util.py | python | uhex32 | (value) | return '%s' % ('00000000%X' % (value & 0xffffffff))[-8:] | Convert integer to 32-bit unsigned hex text. | Convert integer to 32-bit unsigned hex text. | [
"Convert",
"integer",
"to",
"32",
"-",
"bit",
"unsigned",
"hex",
"text",
"."
] | def uhex32(value):
"""Convert integer to 32-bit unsigned hex text."""
# Convert to 8 hex characters, padded with leading zeros if necessary.
return '%s' % ('00000000%X' % (value & 0xffffffff))[-8:] | [
"def",
"uhex32",
"(",
"value",
")",
":",
"# Convert to 8 hex characters, padded with leading zeros if necessary.",
"return",
"'%s'",
"%",
"(",
"'00000000%X'",
"%",
"(",
"value",
"&",
"0xffffffff",
")",
")",
"[",
"-",
"8",
":",
"]"
] | https://github.com/google/usd_from_gltf/blob/6d288cce8b68744494a226574ae1d7ba6a9c46eb/tools/ufgbatch/ufgcommon/util.py#L120-L123 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Geometry3D.withinDistance | (self, other: "Geometry3D", tol: "double") | return _robotsim.Geometry3D_withinDistance(self, other, tol) | r"""
withinDistance(Geometry3D self, Geometry3D other, double tol) -> bool
Returns true if this geometry is within distance `tol` to other. | r"""
withinDistance(Geometry3D self, Geometry3D other, double tol) -> bool | [
"r",
"withinDistance",
"(",
"Geometry3D",
"self",
"Geometry3D",
"other",
"double",
"tol",
")",
"-",
">",
"bool"
] | def withinDistance(self, other: "Geometry3D", tol: "double") -> "bool":
r"""
withinDistance(Geometry3D self, Geometry3D other, double tol) -> bool
Returns true if this geometry is within distance `tol` to other.
"""
return _robotsim.Geometry3D_withinDistance(self, other, tol... | [
"def",
"withinDistance",
"(",
"self",
",",
"other",
":",
"\"Geometry3D\"",
",",
"tol",
":",
"\"double\"",
")",
"->",
"\"bool\"",
":",
"return",
"_robotsim",
".",
"Geometry3D_withinDistance",
"(",
"self",
",",
"other",
",",
"tol",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L2468-L2476 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-digital/examples/berawgn.py | python | simulate_ber | (EbN0) | return numpy.sum(fg.sink.data()) | All the work's done here: create flow graph, run, read out BER | All the work's done here: create flow graph, run, read out BER | [
"All",
"the",
"work",
"s",
"done",
"here",
":",
"create",
"flow",
"graph",
"run",
"read",
"out",
"BER"
] | def simulate_ber(EbN0):
""" All the work's done here: create flow graph, run, read out BER """
print("Eb/N0 = %d dB" % EbN0)
fg = BERAWGNSimu(EbN0)
fg.run()
return numpy.sum(fg.sink.data()) | [
"def",
"simulate_ber",
"(",
"EbN0",
")",
":",
"print",
"(",
"\"Eb/N0 = %d dB\"",
"%",
"EbN0",
")",
"fg",
"=",
"BERAWGNSimu",
"(",
"EbN0",
")",
"fg",
".",
"run",
"(",
")",
"return",
"numpy",
".",
"sum",
"(",
"fg",
".",
"sink",
".",
"data",
"(",
")",... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/examples/berawgn.py#L107-L112 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | Error | (filename, linenum, category, confidence, message) | Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
False positives can be suppressed by the use of
"cpplint(categor... | Logs the fact we've found a lint error. | [
"Logs",
"the",
"fact",
"we",
"ve",
"found",
"a",
"lint",
"error",
"."
] | def Error(filename, linenum, category, confidence, message):
"""Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
... | [
"def",
"Error",
"(",
"filename",
",",
"linenum",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"if",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"_cpplint_state",
".",
"IncrementErrorCount",
"(",
"category... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1216-L1248 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PropertyGrid.GetEditorTextCtrl | (*args, **kwargs) | return _propgrid.PropertyGrid_GetEditorTextCtrl(*args, **kwargs) | GetEditorTextCtrl(self) -> wxTextCtrl | GetEditorTextCtrl(self) -> wxTextCtrl | [
"GetEditorTextCtrl",
"(",
"self",
")",
"-",
">",
"wxTextCtrl"
] | def GetEditorTextCtrl(*args, **kwargs):
"""GetEditorTextCtrl(self) -> wxTextCtrl"""
return _propgrid.PropertyGrid_GetEditorTextCtrl(*args, **kwargs) | [
"def",
"GetEditorTextCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GetEditorTextCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L2142-L2144 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/serde.py | python | tuple_of | (*args) | return Optional(TupleSerde(*args)) | Return an optional tuple serde. | Return an optional tuple serde. | [
"Return",
"an",
"optional",
"tuple",
"serde",
"."
] | def tuple_of(*args):
"""
Return an optional tuple serde.
"""
return Optional(TupleSerde(*args)) | [
"def",
"tuple_of",
"(",
"*",
"args",
")",
":",
"return",
"Optional",
"(",
"TupleSerde",
"(",
"*",
"args",
")",
")"
] | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/serde.py#L732-L736 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py | python | Fixed.infer_axes | (self) | return True | infer the axes of my storer
return a boolean indicating if we have a valid storer or not | infer the axes of my storer
return a boolean indicating if we have a valid storer or not | [
"infer",
"the",
"axes",
"of",
"my",
"storer",
"return",
"a",
"boolean",
"indicating",
"if",
"we",
"have",
"a",
"valid",
"storer",
"or",
"not"
] | def infer_axes(self):
""" infer the axes of my storer
return a boolean indicating if we have a valid storer or not """
s = self.storable
if s is None:
return False
self.get_attrs()
return True | [
"def",
"infer_axes",
"(",
"self",
")",
":",
"s",
"=",
"self",
".",
"storable",
"if",
"s",
"is",
"None",
":",
"return",
"False",
"self",
".",
"get_attrs",
"(",
")",
"return",
"True"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py#L2600-L2608 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/saving/saved_model/save.py | python | save | (model, filepath, overwrite, include_optimizer, signatures=None,
options=None, save_traces=True) | Saves a model as a SavedModel to the filepath.
Args:
model: Keras model instance to be saved.
filepath: String path to save the model.
overwrite: whether to overwrite the existing filepath.
include_optimizer: If True, save the model's optimizer state.
signatures: Signatures to save with the Saved... | Saves a model as a SavedModel to the filepath. | [
"Saves",
"a",
"model",
"as",
"a",
"SavedModel",
"to",
"the",
"filepath",
"."
] | def save(model, filepath, overwrite, include_optimizer, signatures=None,
options=None, save_traces=True):
"""Saves a model as a SavedModel to the filepath.
Args:
model: Keras model instance to be saved.
filepath: String path to save the model.
overwrite: whether to overwrite the existing filep... | [
"def",
"save",
"(",
"model",
",",
"filepath",
",",
"overwrite",
",",
"include_optimizer",
",",
"signatures",
"=",
"None",
",",
"options",
"=",
"None",
",",
"save_traces",
"=",
"True",
")",
":",
"# If file exists and should not be overwritten.",
"if",
"not",
"ove... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saved_model/save.py#L42-L100 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/ansic/cparse.py | python | p_function_definition_4 | (t) | function_definition : declaration_specifiers declarator compound_statement | function_definition : declaration_specifiers declarator compound_statement | [
"function_definition",
":",
"declaration_specifiers",
"declarator",
"compound_statement"
] | def p_function_definition_4(t):
'function_definition : declaration_specifiers declarator compound_statement'
pass | [
"def",
"p_function_definition_4",
"(",
"t",
")",
":",
"pass"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L48-L50 | ||
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/core/gradient_maker.py | python | GraphGradientMaker.Make | (cls, forward_ops, targets) | return forward_ops, backward_ops | Make ``BackwardOps`` based on ``ForwardOps``.
Parameters
----------
forward_ops : list of dragon_pb2.OperatorDef
The operators of ``ForwardOp``.
targets : list of str
The solving targets.
Returns
-------
tuple
The ``ForwardOps... | Make ``BackwardOps`` based on ``ForwardOps``. | [
"Make",
"BackwardOps",
"based",
"on",
"ForwardOps",
"."
] | def Make(cls, forward_ops, targets):
"""Make ``BackwardOps`` based on ``ForwardOps``.
Parameters
----------
forward_ops : list of dragon_pb2.OperatorDef
The operators of ``ForwardOp``.
targets : list of str
The solving targets.
Returns
--... | [
"def",
"Make",
"(",
"cls",
",",
"forward_ops",
",",
"targets",
")",
":",
"inputs_to_grads",
"=",
"{",
"}",
"inputs_count",
"=",
"defaultdict",
"(",
"int",
")",
"grads_count",
"=",
"defaultdict",
"(",
"int",
")",
"all_split_grads",
"=",
"set",
"(",
")",
"... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/core/gradient_maker.py#L103-L188 | |
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | caffe/python/caffe/pycaffe.py | python | _Net_batch | (self, blobs) | Batch blob lists according to net's batch size.
Parameters
----------
blobs: Keys blob names and values are lists of blobs (of any length).
Naturally, all the lists should have the same length.
Yields
------
batch: {blob name: list of blobs} dict for a single batch. | Batch blob lists according to net's batch size. | [
"Batch",
"blob",
"lists",
"according",
"to",
"net",
"s",
"batch",
"size",
"."
] | def _Net_batch(self, blobs):
"""
Batch blob lists according to net's batch size.
Parameters
----------
blobs: Keys blob names and values are lists of blobs (of any length).
Naturally, all the lists should have the same length.
Yields
------
batch: {blob name: list of blobs} ... | [
"def",
"_Net_batch",
"(",
"self",
",",
"blobs",
")",
":",
"num",
"=",
"len",
"(",
"six",
".",
"next",
"(",
"six",
".",
"itervalues",
"(",
"blobs",
")",
")",
")",
"batch_size",
"=",
"six",
".",
"next",
"(",
"six",
".",
"itervalues",
"(",
"self",
"... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/caffe/python/caffe/pycaffe.py#L262-L293 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/rfc2217.py | python | Serial._reconfigure_port | (self) | Set communication parameters on opened port. | Set communication parameters on opened port. | [
"Set",
"communication",
"parameters",
"on",
"opened",
"port",
"."
] | def _reconfigure_port(self):
"""Set communication parameters on opened port."""
if self._socket is None:
raise SerialException("Can only operate on open ports")
# if self._timeout != 0 and self._interCharTimeout is not None:
# XXX
if self._write_timeout is not N... | [
"def",
"_reconfigure_port",
"(",
"self",
")",
":",
"if",
"self",
".",
"_socket",
"is",
"None",
":",
"raise",
"SerialException",
"(",
"\"Can only operate on open ports\"",
")",
"# if self._timeout != 0 and self._interCharTimeout is not None:",
"# XXX",
"if",
"self",
".",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/rfc2217.py#L497-L539 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/managers.py | python | BlockManager.rename_axis | (self, mapper, axis, copy=True, level=None) | return obj | Rename one of axes.
Parameters
----------
mapper : unary callable
axis : int
copy : boolean, default True
level : int, default None | Rename one of axes. | [
"Rename",
"one",
"of",
"axes",
"."
] | def rename_axis(self, mapper, axis, copy=True, level=None):
"""
Rename one of axes.
Parameters
----------
mapper : unary callable
axis : int
copy : boolean, default True
level : int, default None
"""
obj = self.copy(deep=copy)
obj.... | [
"def",
"rename_axis",
"(",
"self",
",",
"mapper",
",",
"axis",
",",
"copy",
"=",
"True",
",",
"level",
"=",
"None",
")",
":",
"obj",
"=",
"self",
".",
"copy",
"(",
"deep",
"=",
"copy",
")",
"obj",
".",
"set_axis",
"(",
"axis",
",",
"_transform_inde... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/managers.py#L184-L197 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/examples/imagenet_trainer.py | python | AddImageInput | (
model,
reader,
batch_size,
img_size,
dtype,
is_test,
mean_per_channel=None,
std_per_channel=None,
) | The image input operator loads image and label data from the reader and
applies transformations to the images (random cropping, mirroring, ...). | The image input operator loads image and label data from the reader and
applies transformations to the images (random cropping, mirroring, ...). | [
"The",
"image",
"input",
"operator",
"loads",
"image",
"and",
"label",
"data",
"from",
"the",
"reader",
"and",
"applies",
"transformations",
"to",
"the",
"images",
"(",
"random",
"cropping",
"mirroring",
"...",
")",
"."
] | def AddImageInput(
model,
reader,
batch_size,
img_size,
dtype,
is_test,
mean_per_channel=None,
std_per_channel=None,
):
'''
The image input operator loads image and label data from the reader and
applies transformations to the images (random cropping, mirroring, ...).
'''... | [
"def",
"AddImageInput",
"(",
"model",
",",
"reader",
",",
"batch_size",
",",
"img_size",
",",
"dtype",
",",
"is_test",
",",
"mean_per_channel",
"=",
"None",
",",
"std_per_channel",
"=",
"None",
",",
")",
":",
"data",
",",
"label",
"=",
"brew",
".",
"imag... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/examples/imagenet_trainer.py#L47-L79 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleControl.py | python | CWSCDReductionControl.get_merged_data | (self, exp_number, scan_number, pt_number_list) | return q_space_array, counts_array | Get merged data in format of numpy.ndarray to plot
:param exp_number:
:param scan_number:
:param pt_number_list:
:return: numpy.ndarray. shape = (?, 3) | Get merged data in format of numpy.ndarray to plot
:param exp_number:
:param scan_number:
:param pt_number_list:
:return: numpy.ndarray. shape = (?, 3) | [
"Get",
"merged",
"data",
"in",
"format",
"of",
"numpy",
".",
"ndarray",
"to",
"plot",
":",
"param",
"exp_number",
":",
":",
"param",
"scan_number",
":",
":",
"param",
"pt_number_list",
":",
":",
"return",
":",
"numpy",
".",
"ndarray",
".",
"shape",
"=",
... | def get_merged_data(self, exp_number, scan_number, pt_number_list):
"""
Get merged data in format of numpy.ndarray to plot
:param exp_number:
:param scan_number:
:param pt_number_list:
:return: numpy.ndarray. shape = (?, 3)
"""
# check
assert isins... | [
"def",
"get_merged_data",
"(",
"self",
",",
"exp_number",
",",
"scan_number",
",",
"pt_number_list",
")",
":",
"# check",
"assert",
"isinstance",
"(",
"exp_number",
",",
"int",
")",
"and",
"isinstance",
"(",
"scan_number",
",",
"int",
")",
"assert",
"isinstanc... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleControl.py#L1331-L1354 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py | python | TNavigator.right | (self, angle) | Turn turtle right by angle units.
Aliases: right | rt
Argument:
angle -- a number (integer or float)
Turn turtle right by angle units. (Units are by default degrees,
but can be set via the degrees() and radians() functions.)
Angle orientation depends on mode. (See this... | Turn turtle right by angle units. | [
"Turn",
"turtle",
"right",
"by",
"angle",
"units",
"."
] | def right(self, angle):
"""Turn turtle right by angle units.
Aliases: right | rt
Argument:
angle -- a number (integer or float)
Turn turtle right by angle units. (Units are by default degrees,
but can be set via the degrees() and radians() functions.)
Angle ori... | [
"def",
"right",
"(",
"self",
",",
"angle",
")",
":",
"self",
".",
"_rotate",
"(",
"-",
"angle",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py#L1659-L1678 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xmlrpc/server.py | python | DocXMLRPCRequestHandler.do_GET | (self) | Handles the HTTP GET request.
Interpret all HTTP GET requests as requests for server
documentation. | Handles the HTTP GET request. | [
"Handles",
"the",
"HTTP",
"GET",
"request",
"."
] | def do_GET(self):
"""Handles the HTTP GET request.
Interpret all HTTP GET requests as requests for server
documentation.
"""
# Check that the path is legal
if not self.is_rpc_path_valid():
self.report_404()
return
response = self.server.g... | [
"def",
"do_GET",
"(",
"self",
")",
":",
"# Check that the path is legal",
"if",
"not",
"self",
".",
"is_rpc_path_valid",
"(",
")",
":",
"self",
".",
"report_404",
"(",
")",
"return",
"response",
"=",
"self",
".",
"server",
".",
"generate_html_documentation",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xmlrpc/server.py#L910-L926 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_layers2.py | python | convert_pooling | (
builder, layer, input_names, output_names, keras_layer, respect_train
) | Convert pooling layer from keras to coreml.
Parameters
----------
keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
respect_train: boolean
Ignored. | Convert pooling layer from keras to coreml. | [
"Convert",
"pooling",
"layer",
"from",
"keras",
"to",
"coreml",
"."
] | def convert_pooling(
builder, layer, input_names, output_names, keras_layer, respect_train
):
"""
Convert pooling layer from keras to coreml.
Parameters
----------
keras_layer: layer
A keras layer object.
builder: NeuralNetworkBuilder
A neural network builder object.
re... | [
"def",
"convert_pooling",
"(",
"builder",
",",
"layer",
",",
"input_names",
",",
"output_names",
",",
"keras_layer",
",",
"respect_train",
")",
":",
"_check_data_format",
"(",
"keras_layer",
")",
"# Get input and output names",
"input_name",
",",
"output_name",
"=",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_layers2.py#L802-L913 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/fitfunctions.py | python | CompositeFunctionWrapper.__init__ | (self, *args, **kwargs) | Called when creating an instance
**It should not be called directly**
:param args: names of functions in composite function
:param kwargs: any parameters or attributes that must be passed to the
composite function itself. | Called when creating an instance | [
"Called",
"when",
"creating",
"an",
"instance"
] | def __init__ (self, *args, **kwargs):
"""
Called when creating an instance
**It should not be called directly**
:param args: names of functions in composite function
:param kwargs: any parameters or attributes that must be passed to the
composite functi... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"pureAddition",
"=",
"True",
"self",
".",
"pureMultiplication",
"=",
"False",
"self",
".",
"initByName",
"(",
"\"CompositeFunction\"",
",",
"*",
"args",
","... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/fitfunctions.py#L391-L403 | ||
mavlink/mavros | a32232d57a5e91abf6737e454d4199cae29b369c | mavros/mavros/param.py | python | ParamPlugin.values | (self) | return pm | Provide current state of parameters and allows to change them. | Provide current state of parameters and allows to change them. | [
"Provide",
"current",
"state",
"of",
"parameters",
"and",
"allows",
"to",
"change",
"them",
"."
] | def values(self) -> "ParamDict":
"""Provide current state of parameters and allows to change them."""
if self._parameters is not None:
return self._parameters
pm = ParamDict()
pm._pm = self
# 1. subscribe for parameter updates
self._event_sub = self.subscrib... | [
"def",
"values",
"(",
"self",
")",
"->",
"\"ParamDict\"",
":",
"if",
"self",
".",
"_parameters",
"is",
"not",
"None",
":",
"return",
"self",
".",
"_parameters",
"pm",
"=",
"ParamDict",
"(",
")",
"pm",
".",
"_pm",
"=",
"self",
"# 1. subscribe for parameter ... | https://github.com/mavlink/mavros/blob/a32232d57a5e91abf6737e454d4199cae29b369c/mavros/mavros/param.py#L214-L240 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Scripting.py | python | update | (ctx) | updates the plugins from the *waflib/extras* directory | updates the plugins from the *waflib/extras* directory | [
"updates",
"the",
"plugins",
"from",
"the",
"*",
"waflib",
"/",
"extras",
"*",
"directory"
] | def update(ctx):
'''updates the plugins from the *waflib/extras* directory'''
lst = Options.options.files.split(',')
if not lst:
lst = [x for x in Utils.listdir(Context.waf_dir + '/waflib/extras') if x.endswith('.py')]
for x in lst:
tool = x.replace('.py', '')
try:
Configure.download_tool(tool, force=True,... | [
"def",
"update",
"(",
"ctx",
")",
":",
"lst",
"=",
"Options",
".",
"options",
".",
"files",
".",
"split",
"(",
"','",
")",
"if",
"not",
"lst",
":",
"lst",
"=",
"[",
"x",
"for",
"x",
"in",
"Utils",
".",
"listdir",
"(",
"Context",
".",
"waf_dir",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Scripting.py#L648-L658 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | SimRobotSensor.__init__ | (self, *args) | __init__(SimRobotSensor self, RobotModel robot, SensorBase * sensor) -> SimRobotSensor
__init__(SimRobotSensor self, SimRobotController robot, char const * name, char const * type) -> SimRobotSensor | __init__(SimRobotSensor self, RobotModel robot, SensorBase * sensor) -> SimRobotSensor
__init__(SimRobotSensor self, SimRobotController robot, char const * name, char const * type) -> SimRobotSensor | [
"__init__",
"(",
"SimRobotSensor",
"self",
"RobotModel",
"robot",
"SensorBase",
"*",
"sensor",
")",
"-",
">",
"SimRobotSensor",
"__init__",
"(",
"SimRobotSensor",
"self",
"SimRobotController",
"robot",
"char",
"const",
"*",
"name",
"char",
"const",
"*",
"type",
... | def __init__(self, *args):
"""
__init__(SimRobotSensor self, RobotModel robot, SensorBase * sensor) -> SimRobotSensor
__init__(SimRobotSensor self, SimRobotController robot, char const * name, char const * type) -> SimRobotSensor
"""
this = _robotsim.new_SimRobotSensor(*args)
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"this",
"=",
"_robotsim",
".",
"new_SimRobotSensor",
"(",
"*",
"args",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
"Exception",
":",
"self",
".",
"this",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L7181-L7193 | ||
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_parser.py | python | p_defns_defns_comma_defn | (p) | defns : defns COMMA defn | defns : defns COMMA defn | [
"defns",
":",
"defns",
"COMMA",
"defn"
] | def p_defns_defns_comma_defn(p):
'defns : defns COMMA defn'
p[0] = p[1]
p[0].append(p[3]) | [
"def",
"p_defns_defns_comma_defn",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"p",
"[",
"0",
"]",
".",
"append",
"(",
"p",
"[",
"3",
"]",
")"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L2452-L2455 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/sparse_grad.py | python | _SparseSoftmaxGrad | (op, grad) | return [None, grad_x, None] | Gradients for SparseSoftmax.
The calculation is the same as SoftmaxGrad:
grad_x = grad_softmax * softmax - sum(grad_softmax * softmax) * softmax
where we now only operate on the non-zero values present in the SparseTensors.
Args:
op: the SparseSoftmax op.
grad: the upstream gradient w.r.t. the non... | Gradients for SparseSoftmax. | [
"Gradients",
"for",
"SparseSoftmax",
"."
] | def _SparseSoftmaxGrad(op, grad):
"""Gradients for SparseSoftmax.
The calculation is the same as SoftmaxGrad:
grad_x = grad_softmax * softmax - sum(grad_softmax * softmax) * softmax
where we now only operate on the non-zero values present in the SparseTensors.
Args:
op: the SparseSoftmax op.
gra... | [
"def",
"_SparseSoftmaxGrad",
"(",
"op",
",",
"grad",
")",
":",
"indices",
",",
"shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
",",
"op",
".",
"inputs",
"[",
"2",
"]",
"out_vals",
"=",
"op",
".",
"outputs",
"[",
"0",
"]",
"sp_output",
"=",
"ops... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/sparse_grad.py#L229-L258 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.IsShown | (*args, **kwargs) | return _core_.Window_IsShown(*args, **kwargs) | IsShown(self) -> bool
Returns true if the window is shown, false if it has been hidden. | IsShown(self) -> bool | [
"IsShown",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsShown(*args, **kwargs):
"""
IsShown(self) -> bool
Returns true if the window is shown, false if it has been hidden.
"""
return _core_.Window_IsShown(*args, **kwargs) | [
"def",
"IsShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_IsShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L9978-L9984 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/mac/change_mach_o_flags.py | python | CheckedSeek | (file, offset) | Seeks the file-like object at |file| to offset |offset| and raises a
MachOError if anything funny happens. | Seeks the file-like object at |file| to offset |offset| and raises a
MachOError if anything funny happens. | [
"Seeks",
"the",
"file",
"-",
"like",
"object",
"at",
"|file|",
"to",
"offset",
"|offset|",
"and",
"raises",
"a",
"MachOError",
"if",
"anything",
"funny",
"happens",
"."
] | def CheckedSeek(file, offset):
"""Seeks the file-like object at |file| to offset |offset| and raises a
MachOError if anything funny happens."""
file.seek(offset, os.SEEK_SET)
new_offset = file.tell()
if new_offset != offset:
raise MachOError, \
'seek: expected offset %d, observed %d' % (offset,... | [
"def",
"CheckedSeek",
"(",
"file",
",",
"offset",
")",
":",
"file",
".",
"seek",
"(",
"offset",
",",
"os",
".",
"SEEK_SET",
")",
"new_offset",
"=",
"file",
".",
"tell",
"(",
")",
"if",
"new_offset",
"!=",
"offset",
":",
"raise",
"MachOError",
",",
"'... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/mac/change_mach_o_flags.py#L102-L110 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/timeit.py | python | Timer.__init__ | (self, stmt="pass", setup="pass", timer=default_timer) | Constructor. See class doc string. | Constructor. See class doc string. | [
"Constructor",
".",
"See",
"class",
"doc",
"string",
"."
] | def __init__(self, stmt="pass", setup="pass", timer=default_timer):
"""Constructor. See class doc string."""
self.timer = timer
ns = {}
if isinstance(stmt, basestring):
stmt = reindent(stmt, 8)
if isinstance(setup, basestring):
setup = reindent(se... | [
"def",
"__init__",
"(",
"self",
",",
"stmt",
"=",
"\"pass\"",
",",
"setup",
"=",
"\"pass\"",
",",
"timer",
"=",
"default_timer",
")",
":",
"self",
".",
"timer",
"=",
"timer",
"ns",
"=",
"{",
"}",
"if",
"isinstance",
"(",
"stmt",
",",
"basestring",
")... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/timeit.py#L121-L149 | ||
learnforpractice/pyeos | 4f04eb982c86c1fdb413084af77c713a6fda3070 | libraries/vm/vm_cpython_ss/lib/codecs.py | python | StreamRecoder.__next__ | (self) | return data | Return the next decoded line from the input stream. | Return the next decoded line from the input stream. | [
"Return",
"the",
"next",
"decoded",
"line",
"from",
"the",
"input",
"stream",
"."
] | def __next__(self):
""" Return the next decoded line from the input stream."""
data = next(self.reader)
data, bytesencoded = self.encode(data, self.errors)
return data | [
"def",
"__next__",
"(",
"self",
")",
":",
"data",
"=",
"next",
"(",
"self",
".",
"reader",
")",
"data",
",",
"bytesencoded",
"=",
"self",
".",
"encode",
"(",
"data",
",",
"self",
".",
"errors",
")",
"return",
"data"
] | https://github.com/learnforpractice/pyeos/blob/4f04eb982c86c1fdb413084af77c713a6fda3070/libraries/vm/vm_cpython_ss/lib/codecs.py#L821-L826 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | GBPosition.GetRow | (*args, **kwargs) | return _core_.GBPosition_GetRow(*args, **kwargs) | GetRow(self) -> int | GetRow(self) -> int | [
"GetRow",
"(",
"self",
")",
"-",
">",
"int"
] | def GetRow(*args, **kwargs):
"""GetRow(self) -> int"""
return _core_.GBPosition_GetRow(*args, **kwargs) | [
"def",
"GetRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"GBPosition_GetRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L15576-L15578 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/common/converters.py | python | LookupTable.get_tensor_in_ell_order | (self, uid: str) | return memory_shapes.get_tensor_in_ell_order(original_tensor, order) | Returns a numpy array in ELL order | Returns a numpy array in ELL order | [
"Returns",
"a",
"numpy",
"array",
"in",
"ELL",
"order"
] | def get_tensor_in_ell_order(self, uid: str):
"""
Returns a numpy array in ELL order
"""
if uid not in self.tensors:
raise Exception("Required tensor {} not found".format(uid))
original_tensor, order = self.tensors[uid]
return memory_shapes.get_tensor_in_ell_o... | [
"def",
"get_tensor_in_ell_order",
"(",
"self",
",",
"uid",
":",
"str",
")",
":",
"if",
"uid",
"not",
"in",
"self",
".",
"tensors",
":",
"raise",
"Exception",
"(",
"\"Required tensor {} not found\"",
".",
"format",
"(",
"uid",
")",
")",
"original_tensor",
","... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/common/converters.py#L182-L190 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/xcodeproj_file.py | python | XCConfigurationList.SetBaseConfiguration | (self, value) | Sets the build configuration in all child XCBuildConfiguration objects. | Sets the build configuration in all child XCBuildConfiguration objects. | [
"Sets",
"the",
"build",
"configuration",
"in",
"all",
"child",
"XCBuildConfiguration",
"objects",
"."
] | def SetBaseConfiguration(self, value):
"""Sets the build configuration in all child XCBuildConfiguration objects.
"""
for configuration in self._properties['buildConfigurations']:
configuration.SetBaseConfiguration(value) | [
"def",
"SetBaseConfiguration",
"(",
"self",
",",
"value",
")",
":",
"for",
"configuration",
"in",
"self",
".",
"_properties",
"[",
"'buildConfigurations'",
"]",
":",
"configuration",
".",
"SetBaseConfiguration",
"(",
"value",
")"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/xcodeproj_file.py#L1695-L1700 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.__ror__ | (self, other ) | return other | self | Implementation of | operator when left operand is not a C{L{ParserElement}} | Implementation of | operator when left operand is not a C{L{ParserElement}} | [
"Implementation",
"of",
"|",
"operator",
"when",
"left",
"operand",
"is",
"not",
"a",
"C",
"{",
"L",
"{",
"ParserElement",
"}}"
] | def __ror__(self, other ):
"""
Implementation of | operator when left operand is not a C{L{ParserElement}}
"""
if isinstance( other, basestring ):
other = ParserElement._literalStringClass( other )
if not isinstance( other, ParserElement ):
warnings.warn("... | [
"def",
"__ror__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"ParserElement",
".",
"_literalStringClass",
"(",
"other",
")",
"if",
"not",
"isinstance",
"(",
"other",
",",
"ParserElement... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L1960-L1970 | |
eldar/deepcut-cnn | 928bf2f224fce132f6e4404b4c95fb017297a5e0 | tools/extra/resize_and_crop_images.py | python | PILResizeCrop.resize_and_crop_image | (self, input_file, output_file, output_side_length = 256, fit = True) | Downsample the image. | Downsample the image. | [
"Downsample",
"the",
"image",
"."
] | def resize_and_crop_image(self, input_file, output_file, output_side_length = 256, fit = True):
'''Downsample the image.
'''
img = Image.open(input_file)
box = (output_side_length, output_side_length)
#preresize image with factor 2, 4, 8 and fast algorithm
factor = 1
... | [
"def",
"resize_and_crop_image",
"(",
"self",
",",
"input_file",
",",
"output_file",
",",
"output_side_length",
"=",
"256",
",",
"fit",
"=",
"True",
")",
":",
"img",
"=",
"Image",
".",
"open",
"(",
"input_file",
")",
"box",
"=",
"(",
"output_side_length",
"... | https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/tools/extra/resize_and_crop_images.py#L40-L71 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/model.py | python | load_checkpoint | (prefix, epoch) | return (symbol, arg_params, aux_params) | Load model checkpoint from file.
Parameters
----------
prefix : str
Prefix of model name.
epoch : int
Epoch number of model we would like to load.
Returns
-------
symbol : Symbol
The symbol configuration of computation network.
arg_params : dict of str to NDArra... | Load model checkpoint from file. | [
"Load",
"model",
"checkpoint",
"from",
"file",
"."
] | def load_checkpoint(prefix, epoch):
"""Load model checkpoint from file.
Parameters
----------
prefix : str
Prefix of model name.
epoch : int
Epoch number of model we would like to load.
Returns
-------
symbol : Symbol
The symbol configuration of computation netw... | [
"def",
"load_checkpoint",
"(",
"prefix",
",",
"epoch",
")",
":",
"symbol",
"=",
"sym",
".",
"load",
"(",
"'%s-symbol.json'",
"%",
"prefix",
")",
"arg_params",
",",
"aux_params",
"=",
"load_params",
"(",
"prefix",
",",
"epoch",
")",
"return",
"(",
"symbol",... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/model.py#L238-L264 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/vcs/versioncontrol.py | python | VersionControl.update | (self, dest, url, rev_options) | Update an already-existing repo to the given ``rev_options``.
Args:
rev_options: a RevOptions object. | Update an already-existing repo to the given ``rev_options``. | [
"Update",
"an",
"already",
"-",
"existing",
"repo",
"to",
"the",
"given",
"rev_options",
"."
] | def update(self, dest, url, rev_options):
# type: (str, HiddenText, RevOptions) -> None
"""
Update an already-existing repo to the given ``rev_options``.
Args:
rev_options: a RevOptions object.
"""
raise NotImplementedError | [
"def",
"update",
"(",
"self",
",",
"dest",
",",
"url",
",",
"rev_options",
")",
":",
"# type: (str, HiddenText, RevOptions) -> None",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/vcs/versioncontrol.py#L511-L519 | ||
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | cpplint.py | python | GetHeaderGuardCPPVariable | (filename) | return re.sub(r'[^a-zA-Z0-9]', '_', file_path_from_root).upper() + '_' | Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file. | Returns the CPP variable that should be used as a header guard. | [
"Returns",
"the",
"CPP",
"variable",
"that",
"should",
"be",
"used",
"as",
"a",
"header",
"guard",
"."
] | def GetHeaderGuardCPPVariable(filename):
"""Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file.
"""
# Restores original filename in case that cpplint is... | [
"def",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
":",
"# Restores original filename in case that cpplint is invoked from Emacs's",
"# flymake.",
"filename",
"=",
"re",
".",
"sub",
"(",
"r'_flymake\\.h$'",
",",
"'.h'",
",",
"filename",
")",
"filename",
"=",
"re",
... | https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L1651-L1674 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/from_template.py | python | parse_structure | (astr) | return spanlist | Return a list of tuples for each function or subroutine each
tuple is the start and end of a subroutine or function to be
expanded. | Return a list of tuples for each function or subroutine each
tuple is the start and end of a subroutine or function to be
expanded. | [
"Return",
"a",
"list",
"of",
"tuples",
"for",
"each",
"function",
"or",
"subroutine",
"each",
"tuple",
"is",
"the",
"start",
"and",
"end",
"of",
"a",
"subroutine",
"or",
"function",
"to",
"be",
"expanded",
"."
] | def parse_structure(astr):
""" Return a list of tuples for each function or subroutine each
tuple is the start and end of a subroutine or function to be
expanded.
"""
spanlist = []
ind = 0
while True:
m = routine_start_re.search(astr, ind)
if m is None:
break
... | [
"def",
"parse_structure",
"(",
"astr",
")",
":",
"spanlist",
"=",
"[",
"]",
"ind",
"=",
"0",
"while",
"True",
":",
"m",
"=",
"routine_start_re",
".",
"search",
"(",
"astr",
",",
"ind",
")",
"if",
"m",
"is",
"None",
":",
"break",
"start",
"=",
"m",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/from_template.py#L60-L85 | |
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/__init__.py | python | _hoomd_sys_excepthook | (type, value, traceback) | Override Python's excepthook to abort MPI runs. | Override Python's excepthook to abort MPI runs. | [
"Override",
"Python",
"s",
"excepthook",
"to",
"abort",
"MPI",
"runs",
"."
] | def _hoomd_sys_excepthook(type, value, traceback):
"""Override Python's excepthook to abort MPI runs."""
_default_excepthook(type, value, traceback)
sys.stderr.flush()
_hoomd.abort_mpi(communicator._current_communicator.cpp_mpi_conf, 1) | [
"def",
"_hoomd_sys_excepthook",
"(",
"type",
",",
"value",
",",
"traceback",
")",
":",
"_default_excepthook",
"(",
"type",
",",
"value",
",",
"traceback",
")",
"sys",
".",
"stderr",
".",
"flush",
"(",
")",
"_hoomd",
".",
"abort_mpi",
"(",
"communicator",
"... | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/__init__.py#L65-L69 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/unix_events.py | python | _UnixDefaultEventLoopPolicy.set_event_loop | (self, loop) | Set the event loop.
As a side effect, if a child watcher was set before, then calling
.set_event_loop() from the main thread will call .attach_loop(loop) on
the child watcher. | Set the event loop. | [
"Set",
"the",
"event",
"loop",
"."
] | def set_event_loop(self, loop):
"""Set the event loop.
As a side effect, if a child watcher was set before, then calling
.set_event_loop() from the main thread will call .attach_loop(loop) on
the child watcher.
"""
super().set_event_loop(loop)
if (self._watcher... | [
"def",
"set_event_loop",
"(",
"self",
",",
"loop",
")",
":",
"super",
"(",
")",
".",
"set_event_loop",
"(",
"loop",
")",
"if",
"(",
"self",
".",
"_watcher",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"threading",
".",
"current_thread",
"(",
")",
",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/unix_events.py#L1122-L1134 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/lookup_ops.py | python | MutableHashTable.lookup | (self, keys, name=None) | return values | Looks up `keys` in a table, outputs the corresponding values.
The `default_value` is used for keys not present in the table.
Args:
keys: Keys to look up. Can be a tensor of any shape. Must match the
table's key_dtype.
name: A name for the operation (optional).
Returns:
A tensor ... | Looks up `keys` in a table, outputs the corresponding values. | [
"Looks",
"up",
"keys",
"in",
"a",
"table",
"outputs",
"the",
"corresponding",
"values",
"."
] | def lookup(self, keys, name=None):
"""Looks up `keys` in a table, outputs the corresponding values.
The `default_value` is used for keys not present in the table.
Args:
keys: Keys to look up. Can be a tensor of any shape. Must match the
table's key_dtype.
name: A name for the operation... | [
"def",
"lookup",
"(",
"self",
",",
"keys",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"%s_lookup_table_find\"",
"%",
"self",
".",
"name",
",",
"(",
"self",
".",
"resource_handle",
",",
"keys",
",",
"self",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/lookup_ops.py#L1731-L1754 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | Frame.DoGiveHelp | (*args, **kwargs) | return _windows_.Frame_DoGiveHelp(*args, **kwargs) | DoGiveHelp(self, String text, bool show) | DoGiveHelp(self, String text, bool show) | [
"DoGiveHelp",
"(",
"self",
"String",
"text",
"bool",
"show",
")"
] | def DoGiveHelp(*args, **kwargs):
"""DoGiveHelp(self, String text, bool show)"""
return _windows_.Frame_DoGiveHelp(*args, **kwargs) | [
"def",
"DoGiveHelp",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"Frame_DoGiveHelp",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L661-L663 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/util.py | python | DetectGce | () | return (o.getcode() == http_client.OK and
o.headers.get('metadata-flavor') == 'Google') | Determine whether or not we're running on GCE.
This is based on:
https://cloud.google.com/compute/docs/metadata#runninggce
Returns:
True iff we're running on a GCE instance. | Determine whether or not we're running on GCE. | [
"Determine",
"whether",
"or",
"not",
"we",
"re",
"running",
"on",
"GCE",
"."
] | def DetectGce():
"""Determine whether or not we're running on GCE.
This is based on:
https://cloud.google.com/compute/docs/metadata#runninggce
Returns:
True iff we're running on a GCE instance.
"""
try:
o = urllib_request.build_opener(urllib_request.ProxyHandler({})).open(
... | [
"def",
"DetectGce",
"(",
")",
":",
"try",
":",
"o",
"=",
"urllib_request",
".",
"build_opener",
"(",
"urllib_request",
".",
"ProxyHandler",
"(",
"{",
"}",
")",
")",
".",
"open",
"(",
"urllib_request",
".",
"Request",
"(",
"'http://metadata.google.internal'",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/util.py#L40-L55 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TextAttr.HasLeftIndent | (*args, **kwargs) | return _controls_.TextAttr_HasLeftIndent(*args, **kwargs) | HasLeftIndent(self) -> bool | HasLeftIndent(self) -> bool | [
"HasLeftIndent",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasLeftIndent(*args, **kwargs):
"""HasLeftIndent(self) -> bool"""
return _controls_.TextAttr_HasLeftIndent(*args, **kwargs) | [
"def",
"HasLeftIndent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_HasLeftIndent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1784-L1786 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiNotebook.GetHeightForPageHeight | (*args, **kwargs) | return _aui.AuiNotebook_GetHeightForPageHeight(*args, **kwargs) | GetHeightForPageHeight(self, int pageHeight) -> int | GetHeightForPageHeight(self, int pageHeight) -> int | [
"GetHeightForPageHeight",
"(",
"self",
"int",
"pageHeight",
")",
"-",
">",
"int"
] | def GetHeightForPageHeight(*args, **kwargs):
"""GetHeightForPageHeight(self, int pageHeight) -> int"""
return _aui.AuiNotebook_GetHeightForPageHeight(*args, **kwargs) | [
"def",
"GetHeightForPageHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiNotebook_GetHeightForPageHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1369-L1371 | |
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.layout | (self) | return self.dispatcher._checkResult(Indigo._lib.indigoLayout(self.id)) | Molecule or reaction method calculates layout for the structure
Returns:
int: 1 if there are no errors | Molecule or reaction method calculates layout for the structure | [
"Molecule",
"or",
"reaction",
"method",
"calculates",
"layout",
"for",
"the",
"structure"
] | def layout(self):
"""Molecule or reaction method calculates layout for the structure
Returns:
int: 1 if there are no errors
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResult(Indigo._lib.indigoLayout(self.id)) | [
"def",
"layout",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoLayout",
"(",
"self",
".",
"id",
")",
")"
] | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L3404-L3411 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/layers/normalization.py | python | BatchNormalization._fused_batch_norm | (self, inputs, training) | return output | Returns the output of fused batch norm. | Returns the output of fused batch norm. | [
"Returns",
"the",
"output",
"of",
"fused",
"batch",
"norm",
"."
] | def _fused_batch_norm(self, inputs, training):
"""Returns the output of fused batch norm."""
# TODO(reedwm): Add support for fp16 inputs.
beta = self.beta if self.center else self._beta_const
gamma = self.gamma if self.scale else self._gamma_const
def _fused_batch_norm_training():
return nn.f... | [
"def",
"_fused_batch_norm",
"(",
"self",
",",
"inputs",
",",
"training",
")",
":",
"# TODO(reedwm): Add support for fp16 inputs.",
"beta",
"=",
"self",
".",
"beta",
"if",
"self",
".",
"center",
"else",
"self",
".",
"_beta_const",
"gamma",
"=",
"self",
".",
"ga... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/layers/normalization.py#L357-L412 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py2/traitlets/traitlets.py | python | default | (name) | return DefaultHandler(name) | A decorator which assigns a dynamic default for a Trait on a HasTraits object.
Parameters
----------
name
The str name of the Trait on the object whose default should be generated.
Notes
-----
Unlike observers and validators which are properties of the HasTraits
instance, default v... | A decorator which assigns a dynamic default for a Trait on a HasTraits object. | [
"A",
"decorator",
"which",
"assigns",
"a",
"dynamic",
"default",
"for",
"a",
"Trait",
"on",
"a",
"HasTraits",
"object",
"."
] | def default(name):
""" A decorator which assigns a dynamic default for a Trait on a HasTraits object.
Parameters
----------
name
The str name of the Trait on the object whose default should be generated.
Notes
-----
Unlike observers and validators which are properties of the HasTra... | [
"def",
"default",
"(",
"name",
")",
":",
"if",
"not",
"isinstance",
"(",
"name",
",",
"six",
".",
"string_types",
")",
":",
"raise",
"TypeError",
"(",
"\"Trait name must be a string or All, not %r\"",
"%",
"name",
")",
"return",
"DefaultHandler",
"(",
"name",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/traitlets.py#L855-L895 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/transformer.py | python | Transformer.transform | (self, tree) | return self.compile_node(tree) | Transform an AST into a modified parse tree. | Transform an AST into a modified parse tree. | [
"Transform",
"an",
"AST",
"into",
"a",
"modified",
"parse",
"tree",
"."
] | def transform(self, tree):
"""Transform an AST into a modified parse tree."""
if not (isinstance(tree, tuple) or isinstance(tree, list)):
tree = parser.st2tuple(tree, line_info=1)
return self.compile_node(tree) | [
"def",
"transform",
"(",
"self",
",",
"tree",
")",
":",
"if",
"not",
"(",
"isinstance",
"(",
"tree",
",",
"tuple",
")",
"or",
"isinstance",
"(",
"tree",
",",
"list",
")",
")",
":",
"tree",
"=",
"parser",
".",
"st2tuple",
"(",
"tree",
",",
"line_inf... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/transformer.py#L120-L124 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/xlc.py | python | find_xlc | (conf) | Detects the Aix C compiler | Detects the Aix C compiler | [
"Detects",
"the",
"Aix",
"C",
"compiler"
] | def find_xlc(conf):
"""
Detects the Aix C compiler
"""
cc = conf.find_program(['xlc_r', 'xlc'], var='CC')
conf.get_xlc_version(cc)
conf.env.CC_NAME = 'xlc' | [
"def",
"find_xlc",
"(",
"conf",
")",
":",
"cc",
"=",
"conf",
".",
"find_program",
"(",
"[",
"'xlc_r'",
",",
"'xlc'",
"]",
",",
"var",
"=",
"'CC'",
")",
"conf",
".",
"get_xlc_version",
"(",
"cc",
")",
"conf",
".",
"env",
".",
"CC_NAME",
"=",
"'xlc'"... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/xlc.py#L12-L18 | ||
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | tools/sanitize_source_files.py | python | SanitizeFilesWithModifiers | (directory, file_modifiers, line_modifiers) | Sanitizes source files with the specified file and line modifiers.
Args:
directory: string - The directory which will be recursively traversed to
find source files to apply modifiers to.
file_modifiers: list - file-modification methods which should be applied to
the complete file content (Eg:... | Sanitizes source files with the specified file and line modifiers. | [
"Sanitizes",
"source",
"files",
"with",
"the",
"specified",
"file",
"and",
"line",
"modifiers",
"."
] | def SanitizeFilesWithModifiers(directory, file_modifiers, line_modifiers):
"""Sanitizes source files with the specified file and line modifiers.
Args:
directory: string - The directory which will be recursively traversed to
find source files to apply modifiers to.
file_modifiers: list - file-modifi... | [
"def",
"SanitizeFilesWithModifiers",
"(",
"directory",
",",
"file_modifiers",
",",
"line_modifiers",
")",
":",
"for",
"item",
"in",
"os",
".",
"listdir",
"(",
"directory",
")",
":",
"full_item_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"directory",
","... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/tools/sanitize_source_files.py#L21-L81 | ||
olliw42/storm32bgc | 99d62a6130ae2950514022f50eb669c45a8cc1ba | old/betacopter/old/betacopter36dev-v005/libraries/AP_Math/tools/geodesic_grid/icosahedron.py | python | _Umbrella.component | (self, i, ordered_edge) | return None | Return the i-th component with respect to ordered_edge = (a, b) | Return the i-th component with respect to ordered_edge = (a, b) | [
"Return",
"the",
"i",
"-",
"th",
"component",
"with",
"respect",
"to",
"ordered_edge",
"=",
"(",
"a",
"b",
")"
] | def component(self, i, ordered_edge):
""" Return the i-th component with respect to ordered_edge = (a, b) """
a, b = ordered_edge
if (i, a, b) in self._component_data:
return self._component_data[(i, a, b)]
vi = self.vertex(i, ordered_edge)
vj = self.vertex(i + 1, or... | [
"def",
"component",
"(",
"self",
",",
"i",
",",
"ordered_edge",
")",
":",
"a",
",",
"b",
"=",
"ordered_edge",
"if",
"(",
"i",
",",
"a",
",",
"b",
")",
"in",
"self",
".",
"_component_data",
":",
"return",
"self",
".",
"_component_data",
"[",
"(",
"i... | https://github.com/olliw42/storm32bgc/blob/99d62a6130ae2950514022f50eb669c45a8cc1ba/old/betacopter/old/betacopter36dev-v005/libraries/AP_Math/tools/geodesic_grid/icosahedron.py#L166-L179 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/utilities/workspace_data_utils.py | python | _check_start_x_is_valid | (x_lower: float, x_upper: float, view_start_x: float, view_end_x: float,
model_start_x: float, check_is_equal: bool = True) | return new_start_x, new_end_x | Check that the start x is valid. If it isn't, the exclude range is adjusted to be valid. | Check that the start x is valid. If it isn't, the exclude range is adjusted to be valid. | [
"Check",
"that",
"the",
"start",
"x",
"is",
"valid",
".",
"If",
"it",
"isn",
"t",
"the",
"exclude",
"range",
"is",
"adjusted",
"to",
"be",
"valid",
"."
] | def _check_start_x_is_valid(x_lower: float, x_upper: float, view_start_x: float, view_end_x: float,
model_start_x: float, check_is_equal: bool = True) -> tuple:
"""Check that the start x is valid. If it isn't, the exclude range is adjusted to be valid."""
if view_start_x < x_lower:
... | [
"def",
"_check_start_x_is_valid",
"(",
"x_lower",
":",
"float",
",",
"x_upper",
":",
"float",
",",
"view_start_x",
":",
"float",
",",
"view_end_x",
":",
"float",
",",
"model_start_x",
":",
"float",
",",
"check_is_equal",
":",
"bool",
"=",
"True",
")",
"->",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/utilities/workspace_data_utils.py#L33-L50 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftgeoutils/circles_incomplete.py | python | circleFromCircleLineRadius | (circle, line, radius) | Do nothing. Placeholder function. Needs to be implemented. | Do nothing. Placeholder function. Needs to be implemented. | [
"Do",
"nothing",
".",
"Placeholder",
"function",
".",
"Needs",
"to",
"be",
"implemented",
"."
] | def circleFromCircleLineRadius(circle, line, radius):
"""Do nothing. Placeholder function. Needs to be implemented."""
_wrn("Placeholder function, does nothing.") | [
"def",
"circleFromCircleLineRadius",
"(",
"circle",
",",
"line",
",",
"radius",
")",
":",
"_wrn",
"(",
"\"Placeholder function, does nothing.\"",
")"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftgeoutils/circles_incomplete.py#L105-L107 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/distributions/multinomial.py | python | Multinomial.__init__ | (self,
total_count,
logits=None,
probs=None,
validate_args=False,
allow_nan_stats=True,
name="Multinomial") | Initialize a batch of Multinomial distributions.
Args:
total_count: Non-negative floating point tensor with shape broadcastable
to `[N1,..., Nm]` with `m >= 0`. Defines this as a batch of
`N1 x ... x Nm` different Multinomial distributions. Its components
should be equal to integer va... | Initialize a batch of Multinomial distributions. | [
"Initialize",
"a",
"batch",
"of",
"Multinomial",
"distributions",
"."
] | def __init__(self,
total_count,
logits=None,
probs=None,
validate_args=False,
allow_nan_stats=True,
name="Multinomial"):
"""Initialize a batch of Multinomial distributions.
Args:
total_count: Non-negative floating p... | [
"def",
"__init__",
"(",
"self",
",",
"total_count",
",",
"logits",
"=",
"None",
",",
"probs",
"=",
"None",
",",
"validate_args",
"=",
"False",
",",
"allow_nan_stats",
"=",
"True",
",",
"name",
"=",
"\"Multinomial\"",
")",
":",
"parameters",
"=",
"locals",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/distributions/multinomial.py#L145-L202 | ||
NVIDIA/tensorrt-laboratory | 33b6fdf2935cd49944ae7d16601cc58f6199cd49 | examples/ONNX/resnet50/onnx_utils.py | python | softmax | (x) | return e_x / e_x.sum() | Compute softmax values for each sets of scores in x. | Compute softmax values for each sets of scores in x. | [
"Compute",
"softmax",
"values",
"for",
"each",
"sets",
"of",
"scores",
"in",
"x",
"."
] | def softmax(x):
"""Compute softmax values for each sets of scores in x."""
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum() | [
"def",
"softmax",
"(",
"x",
")",
":",
"e_x",
"=",
"np",
".",
"exp",
"(",
"x",
"-",
"np",
".",
"max",
"(",
"x",
")",
")",
"return",
"e_x",
"/",
"e_x",
".",
"sum",
"(",
")"
] | https://github.com/NVIDIA/tensorrt-laboratory/blob/33b6fdf2935cd49944ae7d16601cc58f6199cd49/examples/ONNX/resnet50/onnx_utils.py#L39-L42 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/ast.py | python | Defined | (location: Location, name: str, arity: int, positive: int) | return AST(p_ast[0]) | Construct an AST node of type `ASTType.Defined`. | Construct an AST node of type `ASTType.Defined`. | [
"Construct",
"an",
"AST",
"node",
"of",
"type",
"ASTType",
".",
"Defined",
"."
] | def Defined(location: Location, name: str, arity: int, positive: int) -> AST:
'''
Construct an AST node of type `ASTType.Defined`.
'''
p_ast = _ffi.new('clingo_ast_t**')
c_location = _c_location(location)
_handle_error(_lib.clingo_ast_build(
_lib.clingo_ast_type_defined, p_ast,
c... | [
"def",
"Defined",
"(",
"location",
":",
"Location",
",",
"name",
":",
"str",
",",
"arity",
":",
"int",
",",
"positive",
":",
"int",
")",
"->",
"AST",
":",
"p_ast",
"=",
"_ffi",
".",
"new",
"(",
"'clingo_ast_t**'",
")",
"c_location",
"=",
"_c_location",... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/ast.py#L1866-L1878 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/json/_json.py | python | FrameWriter._format_axes | (self) | Try to format axes if they are datelike. | Try to format axes if they are datelike. | [
"Try",
"to",
"format",
"axes",
"if",
"they",
"are",
"datelike",
"."
] | def _format_axes(self):
"""
Try to format axes if they are datelike.
"""
if not self.obj.index.is_unique and self.orient in ("index", "columns"):
raise ValueError(
f"DataFrame index must be unique for orient='{self.orient}'."
)
if not self.... | [
"def",
"_format_axes",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"obj",
".",
"index",
".",
"is_unique",
"and",
"self",
".",
"orient",
"in",
"(",
"\"index\"",
",",
"\"columns\"",
")",
":",
"raise",
"ValueError",
"(",
"f\"DataFrame index must be unique ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/json/_json.py#L206-L221 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py | python | _signature_from_builtin | (cls, func, skip_bound_arg=True) | return _signature_fromstr(cls, func, s, skip_bound_arg) | Private helper function to get signature for
builtin callables. | Private helper function to get signature for
builtin callables. | [
"Private",
"helper",
"function",
"to",
"get",
"signature",
"for",
"builtin",
"callables",
"."
] | def _signature_from_builtin(cls, func, skip_bound_arg=True):
"""Private helper function to get signature for
builtin callables.
"""
if not _signature_is_builtin(func):
raise TypeError("{!r} is not a Python builtin "
"function".format(func))
s = getattr(func, "__text... | [
"def",
"_signature_from_builtin",
"(",
"cls",
",",
"func",
",",
"skip_bound_arg",
"=",
"True",
")",
":",
"if",
"not",
"_signature_is_builtin",
"(",
"func",
")",
":",
"raise",
"TypeError",
"(",
"\"{!r} is not a Python builtin \"",
"\"function\"",
".",
"format",
"("... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py#L2101-L2114 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py | python | FitFunctionOptionsView.clear_fit_status | (self) | Clears the fit status and chi squared label. | Clears the fit status and chi squared label. | [
"Clears",
"the",
"fit",
"status",
"and",
"chi",
"squared",
"label",
"."
] | def clear_fit_status(self) -> None:
"""Clears the fit status and chi squared label."""
self.fit_status_success_failure.setText("No Fit")
self.fit_status_success_failure.setStyleSheet("color: black")
self.fit_status_chi_squared.setText(f"Chi squared: 0.0") | [
"def",
"clear_fit_status",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"fit_status_success_failure",
".",
"setText",
"(",
"\"No Fit\"",
")",
"self",
".",
"fit_status_success_failure",
".",
"setStyleSheet",
"(",
"\"color: black\"",
")",
"self",
".",
"fit_stat... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py#L159-L163 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/pexpect.py | python | spawn.__iter__ | (self) | return self | This is to support iterators over a file-like object. | This is to support iterators over a file-like object. | [
"This",
"is",
"to",
"support",
"iterators",
"over",
"a",
"file",
"-",
"like",
"object",
"."
] | def __iter__(self): # File-like object.
"""This is to support iterators over a file-like object.
"""
return self | [
"def",
"__iter__",
"(",
"self",
")",
":",
"# File-like object.",
"return",
"self"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/pexpect.py#L943-L947 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/generateParkingAreaRerouters.py | python | ReroutersGeneration._save_rerouters | (self) | Save the parking lots into a SUMO XML additional file
with threshold visibility set to True. | Save the parking lots into a SUMO XML additional file
with threshold visibility set to True. | [
"Save",
"the",
"parking",
"lots",
"into",
"a",
"SUMO",
"XML",
"additional",
"file",
"with",
"threshold",
"visibility",
"set",
"to",
"True",
"."
] | def _save_rerouters(self):
""" Save the parking lots into a SUMO XML additional file
with threshold visibility set to True. """
print("Creation of {}".format(self._opt.output))
with open(self._opt.output, 'w') as outfile:
sumolib.writeXMLHeader(outfile, "$Id$", "additiona... | [
"def",
"_save_rerouters",
"(",
"self",
")",
":",
"print",
"(",
"\"Creation of {}\"",
".",
"format",
"(",
"self",
".",
"_opt",
".",
"output",
")",
")",
"with",
"open",
"(",
"self",
".",
"_opt",
".",
"output",
",",
"'w'",
")",
"as",
"outfile",
":",
"su... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/generateParkingAreaRerouters.py#L229-L271 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/source/Interpreter/embedded_interpreter.py | python | setquit | () | Redefine builtin functions 'quit()' and 'exit()' to print a message and raise an EOFError exception. | Redefine builtin functions 'quit()' and 'exit()' to print a message and raise an EOFError exception. | [
"Redefine",
"builtin",
"functions",
"quit",
"()",
"and",
"exit",
"()",
"to",
"print",
"a",
"message",
"and",
"raise",
"an",
"EOFError",
"exception",
"."
] | def setquit():
'''Redefine builtin functions 'quit()' and 'exit()' to print a message and raise an EOFError exception.'''
# This function will be called prior to each interactive
# interpreter loop or each single line, so we set the global
# g_builtin_override_called to False so we know if a SystemExit
... | [
"def",
"setquit",
"(",
")",
":",
"# This function will be called prior to each interactive",
"# interpreter loop or each single line, so we set the global",
"# g_builtin_override_called to False so we know if a SystemExit",
"# is thrown, we can catch it and tell the difference between",
"# a call ... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/source/Interpreter/embedded_interpreter.py#L43-L54 | ||
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | elle/drake/src/drake/__init__.py | python | TarballExtractor.install | (self, tmp) | Move the extracted files to the destination. | Move the extracted files to the destination. | [
"Move",
"the",
"extracted",
"files",
"to",
"the",
"destination",
"."
] | def install(self, tmp):
'''Move the extracted files to the destination.'''
for f in _OS.listdir(str(tmp)):
destination = str(drake.path_build(self.destination / f))
if _OS.path.exists(destination):
shutil.rmtree(destination)
shutil.move(str(tmp / f), destination) | [
"def",
"install",
"(",
"self",
",",
"tmp",
")",
":",
"for",
"f",
"in",
"_OS",
".",
"listdir",
"(",
"str",
"(",
"tmp",
")",
")",
":",
"destination",
"=",
"str",
"(",
"drake",
".",
"path_build",
"(",
"self",
".",
"destination",
"/",
"f",
")",
")",
... | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L4316-L4322 | ||
psmoveservice/PSMoveService | 22bbe20e9de53f3f3581137bce7b88e2587a27e7 | misc/python/pypsmove/transformations.py | python | decompose_matrix | (matrix) | return scale, shear, angles, translate, perspective | Return sequence of transformations from transformation matrix.
matrix : array_like
Non-degenerative homogeneous transformation matrix
Return tuple of:
scale : vector of 3 scaling factors
shear : list of shear factors for x-y, x-z, y-z axes
angles : list of Euler angles about st... | Return sequence of transformations from transformation matrix. | [
"Return",
"sequence",
"of",
"transformations",
"from",
"transformation",
"matrix",
"."
] | def decompose_matrix(matrix):
"""Return sequence of transformations from transformation matrix.
matrix : array_like
Non-degenerative homogeneous transformation matrix
Return tuple of:
scale : vector of 3 scaling factors
shear : list of shear factors for x-y, x-z, y-z axes
a... | [
"def",
"decompose_matrix",
"(",
"matrix",
")",
":",
"M",
"=",
"numpy",
".",
"array",
"(",
"matrix",
",",
"dtype",
"=",
"numpy",
".",
"float64",
",",
"copy",
"=",
"True",
")",
".",
"T",
"if",
"abs",
"(",
"M",
"[",
"3",
",",
"3",
"]",
")",
"<",
... | https://github.com/psmoveservice/PSMoveService/blob/22bbe20e9de53f3f3581137bce7b88e2587a27e7/misc/python/pypsmove/transformations.py#L724-L806 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarInfo._apply_pax_info | (self, pax_headers, encoding, errors) | Replace fields with supplemental information from a previous
pax extended or global header. | Replace fields with supplemental information from a previous
pax extended or global header. | [
"Replace",
"fields",
"with",
"supplemental",
"information",
"from",
"a",
"previous",
"pax",
"extended",
"or",
"global",
"header",
"."
] | def _apply_pax_info(self, pax_headers, encoding, errors):
"""Replace fields with supplemental information from a previous
pax extended or global header.
"""
for keyword, value in pax_headers.items():
if keyword == "GNU.sparse.name":
setattr(self, "path", va... | [
"def",
"_apply_pax_info",
"(",
"self",
",",
"pax_headers",
",",
"encoding",
",",
"errors",
")",
":",
"for",
"keyword",
",",
"value",
"in",
"pax_headers",
".",
"items",
"(",
")",
":",
"if",
"keyword",
"==",
"\"GNU.sparse.name\"",
":",
"setattr",
"(",
"self"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L1518-L1539 | ||
zhaoweicai/hwgq | ebc706bee3e2d145de1da4be446ce8de8740738f | python/caffe/pycaffe.py | python | _Net_blob_loss_weights | (self) | return self._blob_loss_weights_dict | An OrderedDict (bottom to top, i.e., input to output) of network
blob loss weights indexed by name | An OrderedDict (bottom to top, i.e., input to output) of network
blob loss weights indexed by name | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"blob",
"loss",
"weights",
"indexed",
"by",
"name"
] | def _Net_blob_loss_weights(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
blob loss weights indexed by name
"""
if not hasattr(self, '_blobs_loss_weights_dict'):
self._blob_loss_weights_dict = OrderedDict(zip(self._blob_names,
... | [
"def",
"_Net_blob_loss_weights",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_blobs_loss_weights_dict'",
")",
":",
"self",
".",
"_blob_loss_weights_dict",
"=",
"OrderedDict",
"(",
"zip",
"(",
"self",
".",
"_blob_names",
",",
"self",
".",... | https://github.com/zhaoweicai/hwgq/blob/ebc706bee3e2d145de1da4be446ce8de8740738f/python/caffe/pycaffe.py#L36-L44 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/factorization/python/ops/clustering_ops.py | python | KMeans._compute_euclidean_distance | (cls, inputs, clusters) | return output | Computes Euclidean distance between each input and each cluster center.
Args:
inputs: list of input Tensors.
clusters: cluster Tensor.
Returns:
list of Tensors, where each element corresponds to each element in inputs.
The value is the distance of each row to all the cluster centers. | Computes Euclidean distance between each input and each cluster center. | [
"Computes",
"Euclidean",
"distance",
"between",
"each",
"input",
"and",
"each",
"cluster",
"center",
"."
] | def _compute_euclidean_distance(cls, inputs, clusters):
"""Computes Euclidean distance between each input and each cluster center.
Args:
inputs: list of input Tensors.
clusters: cluster Tensor.
Returns:
list of Tensors, where each element corresponds to each element in inputs.
The ... | [
"def",
"_compute_euclidean_distance",
"(",
"cls",
",",
"inputs",
",",
"clusters",
")",
":",
"output",
"=",
"[",
"]",
"for",
"inp",
"in",
"inputs",
":",
"with",
"ops",
".",
"colocate_with",
"(",
"inp",
")",
":",
"# Computes Euclidean distance. Note the first and ... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/clustering_ops.py#L114-L137 | |
google/google-api-cpp-client | 3df15df632bef43eb320645ac3329d872aabf5ad | prepare_dependencies.py | python | ConfigInfo.__init__ | (self, abs_root_dir, unused_argv) | return | Initialize Configuration Information.
Args:
abs_root_dir: (sring) The path tot he build root directory.
unused_argv: (string) The program arguments, including argv[0]. | Initialize Configuration Information. | [
"Initialize",
"Configuration",
"Information",
"."
] | def __init__(self, abs_root_dir, unused_argv):
"""Initialize Configuration Information.
Args:
abs_root_dir: (sring) The path tot he build root directory.
unused_argv: (string) The program arguments, including argv[0].
"""
self._abs_root_dir = '%s' % abs_root_dir
self._download_packages ... | [
"def",
"__init__",
"(",
"self",
",",
"abs_root_dir",
",",
"unused_argv",
")",
":",
"self",
".",
"_abs_root_dir",
"=",
"'%s'",
"%",
"abs_root_dir",
"self",
".",
"_download_packages",
"=",
"False",
"self",
".",
"_build_packages",
"=",
"False",
"self",
".",
"_i... | https://github.com/google/google-api-cpp-client/blob/3df15df632bef43eb320645ac3329d872aabf5ad/prepare_dependencies.py#L80-L111 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/externals/loky/backend/resource_tracker.py | python | ResourceTracker.register | (self, name, rtype) | Register a named resource, and increment its refcount. | Register a named resource, and increment its refcount. | [
"Register",
"a",
"named",
"resource",
"and",
"increment",
"its",
"refcount",
"."
] | def register(self, name, rtype):
'''Register a named resource, and increment its refcount.'''
self.ensure_running()
self._send('REGISTER', name, rtype) | [
"def",
"register",
"(",
"self",
",",
"name",
",",
"rtype",
")",
":",
"self",
".",
"ensure_running",
"(",
")",
"self",
".",
"_send",
"(",
"'REGISTER'",
",",
"name",
",",
"rtype",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/externals/loky/backend/resource_tracker.py#L188-L191 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/utils/check_cfc/obj_diff.py | python | compare_object_files | (objfilea, objfileb) | return first_diff(disa, disb, objfilea, objfileb) | Compare disassembly of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the disassembly differs, or None. | Compare disassembly of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the disassembly differs, or None. | [
"Compare",
"disassembly",
"of",
"two",
"different",
"files",
".",
"Allowing",
"unavoidable",
"differences",
"such",
"as",
"filenames",
".",
"Return",
"the",
"first",
"difference",
"if",
"the",
"disassembly",
"differs",
"or",
"None",
"."
] | def compare_object_files(objfilea, objfileb):
"""Compare disassembly of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the disassembly differs, or None.
"""
disa = disassemble(objfilea)
disb = disassemble(objfileb)
return first_... | [
"def",
"compare_object_files",
"(",
"objfilea",
",",
"objfileb",
")",
":",
"disa",
"=",
"disassemble",
"(",
"objfilea",
")",
"disb",
"=",
"disassemble",
"(",
"objfileb",
")",
"return",
"first_diff",
"(",
"disa",
",",
"disb",
",",
"objfilea",
",",
"objfileb",... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/utils/check_cfc/obj_diff.py#L67-L74 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | ItemContainer.HasClientData | (*args, **kwargs) | return _core_.ItemContainer_HasClientData(*args, **kwargs) | HasClientData(self) -> bool | HasClientData(self) -> bool | [
"HasClientData",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasClientData(*args, **kwargs):
"""HasClientData(self) -> bool"""
return _core_.ItemContainer_HasClientData(*args, **kwargs) | [
"def",
"HasClientData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ItemContainer_HasClientData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12937-L12939 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | GridSizer.GetEffectiveRowsCount | (*args, **kwargs) | return _core_.GridSizer_GetEffectiveRowsCount(*args, **kwargs) | GetEffectiveRowsCount(self) -> int | GetEffectiveRowsCount(self) -> int | [
"GetEffectiveRowsCount",
"(",
"self",
")",
"-",
">",
"int"
] | def GetEffectiveRowsCount(*args, **kwargs):
"""GetEffectiveRowsCount(self) -> int"""
return _core_.GridSizer_GetEffectiveRowsCount(*args, **kwargs) | [
"def",
"GetEffectiveRowsCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"GridSizer_GetEffectiveRowsCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L15273-L15275 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/detect_host_arch.py | python | DoMain | (_) | return HostArch() | Hook to be called from gyp without starting a separate python
interpreter. | Hook to be called from gyp without starting a separate python
interpreter. | [
"Hook",
"to",
"be",
"called",
"from",
"gyp",
"without",
"starting",
"a",
"separate",
"python",
"interpreter",
"."
] | def DoMain(_):
"""Hook to be called from gyp without starting a separate python
interpreter."""
return HostArch() | [
"def",
"DoMain",
"(",
"_",
")",
":",
"return",
"HostArch",
"(",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/detect_host_arch.py#L49-L52 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py | python | Pdb.do_clear | (self, arg) | cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]]
With a space separated list of breakpoint numbers, clear
those breakpoints. Without argument, clear all breaks (but
first ask confirmation). With a filename:lineno argument,
clear all breaks at that line in that file. | cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]]
With a space separated list of breakpoint numbers, clear
those breakpoints. Without argument, clear all breaks (but
first ask confirmation). With a filename:lineno argument,
clear all breaks at that line in that file. | [
"cl",
"(",
"ear",
")",
"filename",
":",
"lineno",
"\\",
"ncl",
"(",
"ear",
")",
"[",
"bpnumber",
"[",
"bpnumber",
"...",
"]]",
"With",
"a",
"space",
"separated",
"list",
"of",
"breakpoint",
"numbers",
"clear",
"those",
"breakpoints",
".",
"Without",
"arg... | def do_clear(self, arg):
"""cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]]
With a space separated list of breakpoint numbers, clear
those breakpoints. Without argument, clear all breaks (but
first ask confirmation). With a filename:lineno argument,
clear all breaks a... | [
"def",
"do_clear",
"(",
"self",
",",
"arg",
")",
":",
"if",
"not",
"arg",
":",
"try",
":",
"reply",
"=",
"input",
"(",
"'Clear all breaks? '",
")",
"except",
"EOFError",
":",
"reply",
"=",
"'no'",
"reply",
"=",
"reply",
".",
"strip",
"(",
")",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py#L861-L906 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/traceable_stack.py | python | TraceableStack.push_obj | (self, obj, offset=0) | return traceable_obj.set_filename_and_line_from_caller(offset + 1) | Add object to the stack and record its filename and line information.
Args:
obj: An object to store on the stack.
offset: Integer. If 0, the caller's stack frame is used. If 1,
the caller's caller's stack frame is used.
Returns:
TraceableObject.SUCCESS if appropriate stack inform... | Add object to the stack and record its filename and line information. | [
"Add",
"object",
"to",
"the",
"stack",
"and",
"record",
"its",
"filename",
"and",
"line",
"information",
"."
] | def push_obj(self, obj, offset=0):
"""Add object to the stack and record its filename and line information.
Args:
obj: An object to store on the stack.
offset: Integer. If 0, the caller's stack frame is used. If 1,
the caller's caller's stack frame is used.
Returns:
Traceable... | [
"def",
"push_obj",
"(",
"self",
",",
"obj",
",",
"offset",
"=",
"0",
")",
":",
"traceable_obj",
"=",
"TraceableObject",
"(",
"obj",
")",
"self",
".",
"_stack",
".",
"append",
"(",
"traceable_obj",
")",
"# Offset is defined in \"Args\" as relative to the caller. W... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/traceable_stack.py#L92-L109 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/json_schema_compiler/cpp_util.py | python | OpenNamespace | (namespace) | return c | Get opening root namespace declarations. | Get opening root namespace declarations. | [
"Get",
"opening",
"root",
"namespace",
"declarations",
"."
] | def OpenNamespace(namespace):
"""Get opening root namespace declarations.
"""
c = Code()
# In lieu of GYP supporting None for the namespace variable the '' namespace
# implies there is no root namespace.
if namespace == '':
return c
for component in namespace.split('::'):
c.Append('namespace %s {'... | [
"def",
"OpenNamespace",
"(",
"namespace",
")",
":",
"c",
"=",
"Code",
"(",
")",
"# In lieu of GYP supporting None for the namespace variable the '' namespace",
"# implies there is no root namespace.",
"if",
"namespace",
"==",
"''",
":",
"return",
"c",
"for",
"component",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/cpp_util.py#L109-L119 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/tty.py | python | setcbreak | (fd, when=TCSAFLUSH) | Put terminal into a cbreak mode. | Put terminal into a cbreak mode. | [
"Put",
"terminal",
"into",
"a",
"cbreak",
"mode",
"."
] | def setcbreak(fd, when=TCSAFLUSH):
"""Put terminal into a cbreak mode."""
mode = tcgetattr(fd)
mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON)
mode[CC][VMIN] = 1
mode[CC][VTIME] = 0
tcsetattr(fd, when, mode) | [
"def",
"setcbreak",
"(",
"fd",
",",
"when",
"=",
"TCSAFLUSH",
")",
":",
"mode",
"=",
"tcgetattr",
"(",
"fd",
")",
"mode",
"[",
"LFLAG",
"]",
"=",
"mode",
"[",
"LFLAG",
"]",
"&",
"~",
"(",
"ECHO",
"|",
"ICANON",
")",
"mode",
"[",
"CC",
"]",
"[",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/tty.py#L30-L36 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/utils.py | python | pformat | (obj, verbose=False) | Prettyprint an object. Either use the `pretty` library or the
builtin `pprint`. | Prettyprint an object. Either use the `pretty` library or the
builtin `pprint`. | [
"Prettyprint",
"an",
"object",
".",
"Either",
"use",
"the",
"pretty",
"library",
"or",
"the",
"builtin",
"pprint",
"."
] | def pformat(obj, verbose=False):
"""Prettyprint an object. Either use the `pretty` library or the
builtin `pprint`.
"""
try:
from pretty import pretty
return pretty(obj, verbose=verbose)
except ImportError:
from pprint import pformat
return pformat(obj) | [
"def",
"pformat",
"(",
"obj",
",",
"verbose",
"=",
"False",
")",
":",
"try",
":",
"from",
"pretty",
"import",
"pretty",
"return",
"pretty",
"(",
"obj",
",",
"verbose",
"=",
"verbose",
")",
"except",
"ImportError",
":",
"from",
"pprint",
"import",
"pforma... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/utils.py#L247-L256 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/perf/metrics/histogram_util.py | python | GetHistogram | (histogram_type, histogram_name, tab) | return None | Get a json serialization of a histogram. | Get a json serialization of a histogram. | [
"Get",
"a",
"json",
"serialization",
"of",
"a",
"histogram",
"."
] | def GetHistogram(histogram_type, histogram_name, tab):
"""Get a json serialization of a histogram."""
assert histogram_type in [BROWSER_HISTOGRAM, RENDERER_HISTOGRAM]
function = 'getHistogram'
if histogram_type == BROWSER_HISTOGRAM:
function = 'getBrowserHistogram'
histogram_json = tab.EvaluateJavaScript(... | [
"def",
"GetHistogram",
"(",
"histogram_type",
",",
"histogram_name",
",",
"tab",
")",
":",
"assert",
"histogram_type",
"in",
"[",
"BROWSER_HISTOGRAM",
",",
"RENDERER_HISTOGRAM",
"]",
"function",
"=",
"'getHistogram'",
"if",
"histogram_type",
"==",
"BROWSER_HISTOGRAM",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/perf/metrics/histogram_util.py#L62-L73 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py | python | extract_pandas_data | (data) | Extract data from pandas.DataFrame for predictors.
Given a DataFrame, will extract the values and cast them to float. The
DataFrame is expected to contain values of type int, float or bool.
Args:
data: `pandas.DataFrame` containing the data to be extracted.
Returns:
A numpy `ndarray` of the DataFrame... | Extract data from pandas.DataFrame for predictors. | [
"Extract",
"data",
"from",
"pandas",
".",
"DataFrame",
"for",
"predictors",
"."
] | def extract_pandas_data(data):
"""Extract data from pandas.DataFrame for predictors.
Given a DataFrame, will extract the values and cast them to float. The
DataFrame is expected to contain values of type int, float or bool.
Args:
data: `pandas.DataFrame` containing the data to be extracted.
Returns:
... | [
"def",
"extract_pandas_data",
"(",
"data",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"pd",
".",
"DataFrame",
")",
":",
"return",
"data",
"bad_data",
"=",
"[",
"column",
"for",
"column",
"in",
"data",
"if",
"data",
"[",
"column",
"]",
".",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py#L69-L96 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/graph_editor/util.py | python | make_placeholder_from_dtype_and_shape | (dtype, shape=None, scope=None) | return tf_array_ops.placeholder(
dtype=dtype, shape=shape, name=placeholder_name(scope=scope)) | Create a tf.placeholder for the Graph Editor.
Note that the correct graph scope must be set by the calling function.
The placeholder is named using the function placeholder_name (with no
tensor argument).
Args:
dtype: the tensor type.
shape: the tensor shape (optional).
scope: absolute scope withi... | Create a tf.placeholder for the Graph Editor. | [
"Create",
"a",
"tf",
".",
"placeholder",
"for",
"the",
"Graph",
"Editor",
"."
] | def make_placeholder_from_dtype_and_shape(dtype, shape=None, scope=None):
"""Create a tf.placeholder for the Graph Editor.
Note that the correct graph scope must be set by the calling function.
The placeholder is named using the function placeholder_name (with no
tensor argument).
Args:
dtype: the tenso... | [
"def",
"make_placeholder_from_dtype_and_shape",
"(",
"dtype",
",",
"shape",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"return",
"tf_array_ops",
".",
"placeholder",
"(",
"dtype",
"=",
"dtype",
",",
"shape",
"=",
"shape",
",",
"name",
"=",
"placeholder... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/graph_editor/util.py#L451-L467 | |
qt-creator/qt-creator | c9cd00f2ce590e9b272ad69214dc910e92bf62eb | share/qtcreator/debugger/pdbbridge.py | python | QtcInternalDumper.onecmd | (self, line) | Interpret the argument as though it had been typed in response
to the prompt.
The return value is a flag indicating whether interpretation of
commands by the interpreter should stop. | Interpret the argument as though it had been typed in response
to the prompt. | [
"Interpret",
"the",
"argument",
"as",
"though",
"it",
"had",
"been",
"typed",
"in",
"response",
"to",
"the",
"prompt",
"."
] | def onecmd(self, line):
"""Interpret the argument as though it had been typed in response
to the prompt.
The return value is a flag indicating whether interpretation of
commands by the interpreter should stop.
"""
line = str(line)
print('LINE 0: %s' % line)
... | [
"def",
"onecmd",
"(",
"self",
",",
"line",
")",
":",
"line",
"=",
"str",
"(",
"line",
")",
"print",
"(",
"'LINE 0: %s'",
"%",
"line",
")",
"cmd",
",",
"arg",
",",
"line",
"=",
"self",
".",
"parseline",
"(",
"line",
")",
"print",
"(",
"'LINE 1: %s'"... | https://github.com/qt-creator/qt-creator/blob/c9cd00f2ce590e9b272ad69214dc910e92bf62eb/share/qtcreator/debugger/pdbbridge.py#L703-L725 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | mojo/public/bindings/pylib/parse/mojo_parser.py | python | Parser.p_method | (self, p) | method : VOID NAME LPAREN parameters RPAREN ordinal SEMI | method : VOID NAME LPAREN parameters RPAREN ordinal SEMI | [
"method",
":",
"VOID",
"NAME",
"LPAREN",
"parameters",
"RPAREN",
"ordinal",
"SEMI"
] | def p_method(self, p):
"""method : VOID NAME LPAREN parameters RPAREN ordinal SEMI"""
p[0] = ('METHOD', p[2], p[4], p[6]) | [
"def",
"p_method",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"(",
"'METHOD'",
",",
"p",
"[",
"2",
"]",
",",
"p",
"[",
"4",
"]",
",",
"p",
"[",
"6",
"]",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/mojo/public/bindings/pylib/parse/mojo_parser.py#L133-L135 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/skia/bench/tile_analyze.py | python | GetTileVisCodes | (suffix, matrix) | return [this_js, table_row1, table_row2] | Generates and returns strings of [js_codes, row1, row2] which are codes for
visualizing the benches from the given tile config and matrix data.
row1 is used for the first row of heatmaps; row2 is for corresponding tables.
suffix is only used to avoid name conflicts in the whole html output. | Generates and returns strings of [js_codes, row1, row2] which are codes for
visualizing the benches from the given tile config and matrix data.
row1 is used for the first row of heatmaps; row2 is for corresponding tables.
suffix is only used to avoid name conflicts in the whole html output. | [
"Generates",
"and",
"returns",
"strings",
"of",
"[",
"js_codes",
"row1",
"row2",
"]",
"which",
"are",
"codes",
"for",
"visualizing",
"the",
"benches",
"from",
"the",
"given",
"tile",
"config",
"and",
"matrix",
"data",
".",
"row1",
"is",
"used",
"for",
"the... | def GetTileVisCodes(suffix, matrix):
"""Generates and returns strings of [js_codes, row1, row2] which are codes for
visualizing the benches from the given tile config and matrix data.
row1 is used for the first row of heatmaps; row2 is for corresponding tables.
suffix is only used to avoid name conflicts in the... | [
"def",
"GetTileVisCodes",
"(",
"suffix",
",",
"matrix",
")",
":",
"this_js",
"=",
"'var data_%s=new google.visualization.DataTable();'",
"%",
"suffix",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"matrix",
"[",
"0",
"]",
")",
")",
":",
"this_js",
"+=",
"'dat... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/skia/bench/tile_analyze.py#L160-L181 | |
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/serializers/__init__.py | python | loadImportDir | (loader, path, engine, debug=False) | helper function to call loadImportFile on a directory
@type path: string
@param path: path to import directory
@type debug: bool
@param debug: flag to activate / deactivate print statements | helper function to call loadImportFile on a directory | [
"helper",
"function",
"to",
"call",
"loadImportFile",
"on",
"a",
"directory"
] | def loadImportDir(loader, path, engine, debug=False):
""" helper function to call loadImportFile on a directory
@type path: string
@param path: path to import directory
@type debug: bool
@param debug: flag to activate / deactivate print statements
"""
for _file in [f for f in engine.getVFS().listFiles(path) if... | [
"def",
"loadImportDir",
"(",
"loader",
",",
"path",
",",
"engine",
",",
"debug",
"=",
"False",
")",
":",
"for",
"_file",
"in",
"[",
"f",
"for",
"f",
"in",
"engine",
".",
"getVFS",
"(",
")",
".",
"listFiles",
"(",
"path",
")",
"if",
"f",
".",
"spl... | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/serializers/__init__.py#L121-L130 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_diagnostic_updater.py | python | Updater._check_diagnostic_period | (self) | Recheck the diagnostic_period on the parameter server. | Recheck the diagnostic_period on the parameter server. | [
"Recheck",
"the",
"diagnostic_period",
"on",
"the",
"parameter",
"server",
"."
] | def _check_diagnostic_period(self):
"""Recheck the diagnostic_period on the parameter server."""
# This was getParamCached() call in the cpp code. i.e. it would throttle
# the actual call to the parameter server using a notification of change
# mechanism.
# This is not available... | [
"def",
"_check_diagnostic_period",
"(",
"self",
")",
":",
"# This was getParamCached() call in the cpp code. i.e. it would throttle",
"# the actual call to the parameter server using a notification of change",
"# mechanism.",
"# This is not available in rospy. Hence I throttle the call to the",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_diagnostic_updater.py#L308-L323 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/functions/Lorentz.py | python | Lorentz.functionDeriv1D | (self, xvals, jacobian) | Evaluate the first derivatives
@param xvals: numpy array of q-values
@param jacobian: Jacobian object | Evaluate the first derivatives | [
"Evaluate",
"the",
"first",
"derivatives"
] | def functionDeriv1D(self, xvals, jacobian):
"""
Evaluate the first derivatives
@param xvals: numpy array of q-values
@param jacobian: Jacobian object
"""
i = 0
for x in xvals:
jacobian.set(
i, 0, 1.0 / (1.0 + np.power(x*self... | [
"def",
"functionDeriv1D",
"(",
"self",
",",
"xvals",
",",
"jacobian",
")",
":",
"i",
"=",
"0",
"for",
"x",
"in",
"xvals",
":",
"jacobian",
".",
"set",
"(",
"i",
",",
"0",
",",
"1.0",
"/",
"(",
"1.0",
"+",
"np",
".",
"power",
"(",
"x",
"*",
"s... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/functions/Lorentz.py#L41-L56 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/more-itertools/py3/more_itertools/more.py | python | substrings | (iterable) | Yield all of the substrings of *iterable*.
>>> [''.join(s) for s in substrings('more')]
['m', 'o', 'r', 'e', 'mo', 'or', 're', 'mor', 'ore', 'more']
Note that non-string iterables can also be subdivided.
>>> list(substrings([0, 1, 2]))
[(0,), (1,), (2,), (0, 1), (1, 2), (0, 1, 2)] | Yield all of the substrings of *iterable*. | [
"Yield",
"all",
"of",
"the",
"substrings",
"of",
"*",
"iterable",
"*",
"."
] | def substrings(iterable):
"""Yield all of the substrings of *iterable*.
>>> [''.join(s) for s in substrings('more')]
['m', 'o', 'r', 'e', 'mo', 'or', 're', 'mor', 'ore', 'more']
Note that non-string iterables can also be subdivided.
>>> list(substrings([0, 1, 2]))
[(0,), (1,),... | [
"def",
"substrings",
"(",
"iterable",
")",
":",
"# The length-1 substrings",
"seq",
"=",
"[",
"]",
"for",
"item",
"in",
"iter",
"(",
"iterable",
")",
":",
"seq",
".",
"append",
"(",
"item",
")",
"yield",
"(",
"item",
",",
")",
"seq",
"=",
"tuple",
"(... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py3/more_itertools/more.py#L883-L906 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py2/ext.py | python | ConfTest.__init__ | (self, build, source) | Initialization
:Parameters:
`build` : ``distuils.command.build_ext.build_ext``
builder instance
`source` : ``str``
Source of the file to compile | Initialization | [
"Initialization"
] | def __init__(self, build, source):
"""
Initialization
:Parameters:
`build` : ``distuils.command.build_ext.build_ext``
builder instance
`source` : ``str``
Source of the file to compile
"""
self._tempdir = tempdir = _tempfile.mkdtemp()
... | [
"def",
"__init__",
"(",
"self",
",",
"build",
",",
"source",
")",
":",
"self",
".",
"_tempdir",
"=",
"tempdir",
"=",
"_tempfile",
".",
"mkdtemp",
"(",
")",
"src",
"=",
"_os",
".",
"path",
".",
"join",
"(",
"tempdir",
",",
"'conftest.c'",
")",
"fp",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py2/ext.py#L170-L191 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rospy/src/rospy/impl/tcpros_service.py | python | TCPService.__init__ | (self, resolved_name, service_class, buff_size=DEFAULT_BUFF_SIZE) | ctor.
@param resolved_name: name of service
@type resolved_name: str
@param service_class: Service data type class
@type service_class: Service
@param buff_size int: size of buffer (bytes) to use for reading incoming requests.
@type buff_size: int | ctor. | [
"ctor",
"."
] | def __init__(self, resolved_name, service_class, buff_size=DEFAULT_BUFF_SIZE):
"""
ctor.
@param resolved_name: name of service
@type resolved_name: str
@param service_class: Service data type class
@type service_class: Service
@param buff_size int: size of buffe... | [
"def",
"__init__",
"(",
"self",
",",
"resolved_name",
",",
"service_class",
",",
"buff_size",
"=",
"DEFAULT_BUFF_SIZE",
")",
":",
"super",
"(",
"TCPService",
",",
"self",
")",
".",
"__init__",
"(",
"resolved_name",
",",
"service_class",
".",
"_request_class",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/tcpros_service.py#L258-L269 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.