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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/training/saver.py | python | BaseSaverBuilder._AddRestoreOps | (self,
filename_tensor,
vars_to_save,
restore_sequentially,
reshape,
preferred_shard=-1,
name="restore_all") | return control_flow_ops.group(*assign_ops, name=name) | Add operations to restore vars_to_save.
Args:
filename_tensor: Tensor for the path of the file to load.
vars_to_save: A list of _VarToSave objects.
restore_sequentially: True if we want to restore variables sequentially
within a shard.
reshape: True if we want to reshape loaded tens... | Add operations to restore vars_to_save. | [
"Add",
"operations",
"to",
"restore",
"vars_to_save",
"."
] | def _AddRestoreOps(self,
filename_tensor,
vars_to_save,
restore_sequentially,
reshape,
preferred_shard=-1,
name="restore_all"):
"""Add operations to restore vars_to_save.
Args:
fi... | [
"def",
"_AddRestoreOps",
"(",
"self",
",",
"filename_tensor",
",",
"vars_to_save",
",",
"restore_sequentially",
",",
"reshape",
",",
"preferred_shard",
"=",
"-",
"1",
",",
"name",
"=",
"\"restore_all\"",
")",
":",
"assign_ops",
"=",
"[",
"]",
"for",
"vs",
"i... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/saver.py#L240-L285 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | GraphicsRenderer.CreateBitmap | (*args, **kwargs) | return _gdi_.GraphicsRenderer_CreateBitmap(*args, **kwargs) | CreateBitmap(self, Bitmap bitmap) -> GraphicsBitmap | CreateBitmap(self, Bitmap bitmap) -> GraphicsBitmap | [
"CreateBitmap",
"(",
"self",
"Bitmap",
"bitmap",
")",
"-",
">",
"GraphicsBitmap"
] | def CreateBitmap(*args, **kwargs):
"""CreateBitmap(self, Bitmap bitmap) -> GraphicsBitmap"""
return _gdi_.GraphicsRenderer_CreateBitmap(*args, **kwargs) | [
"def",
"CreateBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsRenderer_CreateBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6813-L6815 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/decoder.py | python | MessageDecoder | (field_number, is_repeated, is_packed, key, new_default) | Returns a decoder for a message field. | Returns a decoder for a message field. | [
"Returns",
"a",
"decoder",
"for",
"a",
"message",
"field",
"."
] | def MessageDecoder(field_number, is_repeated, is_packed, key, new_default):
"""Returns a decoder for a message field."""
local_DecodeVarint = _DecodeVarint
assert not is_packed
if is_repeated:
tag_bytes = encoder.TagBytes(field_number,
wire_format.WIRETYPE_LENGTH_DELIMITED... | [
"def",
"MessageDecoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
",",
"key",
",",
"new_default",
")",
":",
"local_DecodeVarint",
"=",
"_DecodeVarint",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
":",
"tag_bytes",
"=",
"encoder",
".",
"T... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/decoder.py#L684-L731 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/ecmametadatapass.py | python | EcmaMetaData.__init__ | (self) | Initializes a token metadata object. | Initializes a token metadata object. | [
"Initializes",
"a",
"token",
"metadata",
"object",
"."
] | def __init__(self):
"""Initializes a token metadata object."""
self.last_code = None
self.context = None
self.operator_type = None
self.is_implied_semicolon = False
self.is_implied_block = False
self.is_implied_block_close = False
self.aliased_symbol = None
self.is_alias_definition =... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"last_code",
"=",
"None",
"self",
".",
"context",
"=",
"None",
"self",
".",
"operator_type",
"=",
"None",
"self",
".",
"is_implied_semicolon",
"=",
"False",
"self",
".",
"is_implied_block",
"=",
"False... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/ecmametadatapass.py#L202-L211 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tix.py | python | CheckList.getselection | (self, mode='on') | return self.tk.splitlist(c) | Returns a list of items whose status matches status. If status is
not specified, the list of items in the "on" status will be returned.
Mode can be on, off, default | Returns a list of items whose status matches status. If status is
not specified, the list of items in the "on" status will be returned.
Mode can be on, off, default | [
"Returns",
"a",
"list",
"of",
"items",
"whose",
"status",
"matches",
"status",
".",
"If",
"status",
"is",
"not",
"specified",
"the",
"list",
"of",
"items",
"in",
"the",
"on",
"status",
"will",
"be",
"returned",
".",
"Mode",
"can",
"be",
"on",
"off",
"d... | def getselection(self, mode='on'):
'''Returns a list of items whose status matches status. If status is
not specified, the list of items in the "on" status will be returned.
Mode can be on, off, default'''
c = self.tk.split(self.tk.call(self._w, 'getselection', mode))
return self.tk.sp... | [
"def",
"getselection",
"(",
"self",
",",
"mode",
"=",
"'on'",
")",
":",
"c",
"=",
"self",
".",
"tk",
".",
"split",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'getselection'",
",",
"mode",
")",
")",
"return",
"self",
".",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tix.py#L1601-L1606 | |
apache/trafodion | 8455c839ad6b6d7b6e04edda5715053095b78046 | core/sqf/src/seatrans/hbase-trx/src/main/python/thrift1/gen-py/hbase/Hbase.py | python | Client.majorCompact | (self, tableNameOrRegionName) | Parameters:
- tableNameOrRegionName | Parameters:
- tableNameOrRegionName | [
"Parameters",
":",
"-",
"tableNameOrRegionName"
] | def majorCompact(self, tableNameOrRegionName):
"""
Parameters:
- tableNameOrRegionName
"""
self.send_majorCompact(tableNameOrRegionName)
self.recv_majorCompact() | [
"def",
"majorCompact",
"(",
"self",
",",
"tableNameOrRegionName",
")",
":",
"self",
".",
"send_majorCompact",
"(",
"tableNameOrRegionName",
")",
"self",
".",
"recv_majorCompact",
"(",
")"
] | https://github.com/apache/trafodion/blob/8455c839ad6b6d7b6e04edda5715053095b78046/core/sqf/src/seatrans/hbase-trx/src/main/python/thrift1/gen-py/hbase/Hbase.py#L751-L757 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | CustomDataObject.GetSize | (*args, **kwargs) | return _misc_.CustomDataObject_GetSize(*args, **kwargs) | GetSize(self) -> size_t
Get the size of the data. | GetSize(self) -> size_t | [
"GetSize",
"(",
"self",
")",
"-",
">",
"size_t"
] | def GetSize(*args, **kwargs):
"""
GetSize(self) -> size_t
Get the size of the data.
"""
return _misc_.CustomDataObject_GetSize(*args, **kwargs) | [
"def",
"GetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"CustomDataObject_GetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L5390-L5396 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/common/extensions/PRESUBMIT.py | python | StaticDocBuilt | (static_file, input_api) | return _ChangesMatch(generated_file, static_file) | Return True if the generated doc that corresponds to the |static_file|
is also in this change. Both files must also contain matching changes. | Return True if the generated doc that corresponds to the |static_file|
is also in this change. Both files must also contain matching changes. | [
"Return",
"True",
"if",
"the",
"generated",
"doc",
"that",
"corresponds",
"to",
"the",
"|static_file|",
"is",
"also",
"in",
"this",
"change",
".",
"Both",
"files",
"must",
"also",
"contain",
"matching",
"changes",
"."
] | def StaticDocBuilt(static_file, input_api):
"""Return True if the generated doc that corresponds to the |static_file|
is also in this change. Both files must also contain matching changes.
"""
generated_file = _FindFileInAlternateDir(static_file, DOC_DIR, input_api)
return _ChangesMatch(generated_file, static... | [
"def",
"StaticDocBuilt",
"(",
"static_file",
",",
"input_api",
")",
":",
"generated_file",
"=",
"_FindFileInAlternateDir",
"(",
"static_file",
",",
"DOC_DIR",
",",
"input_api",
")",
"return",
"_ChangesMatch",
"(",
"generated_file",
",",
"static_file",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/common/extensions/PRESUBMIT.py#L141-L146 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenuBar.GetMoreMenuButtonRect | (self) | return rect | Returns a rectangle region, as an instance of :class:`Rect`, surrounding the menu button. | Returns a rectangle region, as an instance of :class:`Rect`, surrounding the menu button. | [
"Returns",
"a",
"rectangle",
"region",
"as",
"an",
"instance",
"of",
":",
"class",
":",
"Rect",
"surrounding",
"the",
"menu",
"button",
"."
] | def GetMoreMenuButtonRect(self):
""" Returns a rectangle region, as an instance of :class:`Rect`, surrounding the menu button. """
clientRect = self.GetClientRect()
rect = wx.Rect(*clientRect)
rect.SetWidth(DROP_DOWN_ARROW_WIDTH)
rect.SetX(clientRect.GetWidth() + rect.GetX() - D... | [
"def",
"GetMoreMenuButtonRect",
"(",
"self",
")",
":",
"clientRect",
"=",
"self",
".",
"GetClientRect",
"(",
")",
"rect",
"=",
"wx",
".",
"Rect",
"(",
"*",
"clientRect",
")",
"rect",
".",
"SetWidth",
"(",
"DROP_DOWN_ARROW_WIDTH",
")",
"rect",
".",
"SetX",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L2779-L2789 | |
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Type.element_type | (self) | return result | Retrieve the Type of elements within this Type.
If accessed on a type that is not an array, complex, or vector type, an
exception will be raised. | Retrieve the Type of elements within this Type. | [
"Retrieve",
"the",
"Type",
"of",
"elements",
"within",
"this",
"Type",
"."
] | def element_type(self):
"""Retrieve the Type of elements within this Type.
If accessed on a type that is not an array, complex, or vector type, an
exception will be raised.
"""
result = conf.lib.clang_getElementType(self)
if result.kind == TypeKind.INVALID:
r... | [
"def",
"element_type",
"(",
"self",
")",
":",
"result",
"=",
"conf",
".",
"lib",
".",
"clang_getElementType",
"(",
"self",
")",
"if",
"result",
".",
"kind",
"==",
"TypeKind",
".",
"INVALID",
":",
"raise",
"Exception",
"(",
"'Element type not available on this ... | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1504-L1514 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | InfoBar.ShowMessage | (*args, **kwargs) | return _controls_.InfoBar_ShowMessage(*args, **kwargs) | ShowMessage(self, String msg, int flags=ICON_INFORMATION) | ShowMessage(self, String msg, int flags=ICON_INFORMATION) | [
"ShowMessage",
"(",
"self",
"String",
"msg",
"int",
"flags",
"=",
"ICON_INFORMATION",
")"
] | def ShowMessage(*args, **kwargs):
"""ShowMessage(self, String msg, int flags=ICON_INFORMATION)"""
return _controls_.InfoBar_ShowMessage(*args, **kwargs) | [
"def",
"ShowMessage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"InfoBar_ShowMessage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L7761-L7763 | |
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | PointerArgument.WriteValidationCode | (self, f, func) | Overridden from Argument. | Overridden from Argument. | [
"Overridden",
"from",
"Argument",
"."
] | def WriteValidationCode(self, f, func):
"""Overridden from Argument."""
if self.optional:
return
f.write(" if (%s == NULL) {\n" % self.name)
f.write(" return error::kOutOfBounds;\n")
f.write(" }\n") | [
"def",
"WriteValidationCode",
"(",
"self",
",",
"f",
",",
"func",
")",
":",
"if",
"self",
".",
"optional",
":",
"return",
"f",
".",
"write",
"(",
"\" if (%s == NULL) {\\n\"",
"%",
"self",
".",
"name",
")",
"f",
".",
"write",
"(",
"\" return error::kOut... | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L8973-L8979 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/plugins/filebrowser/filebrowser/browser.py | python | FileBrowser2.OnConfig | (self, msg) | Handle updates for filebrowser preference updates | Handle updates for filebrowser preference updates | [
"Handle",
"updates",
"for",
"filebrowser",
"preference",
"updates"
] | def OnConfig(self, msg):
"""Handle updates for filebrowser preference updates"""
# TODO: refresh tree for hidden files on/off
pass | [
"def",
"OnConfig",
"(",
"self",
",",
"msg",
")",
":",
"# TODO: refresh tree for hidden files on/off",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/filebrowser/filebrowser/browser.py#L903-L906 | ||
may0324/DeepCompression-caffe | 0aff6c1287bda4cfc7f378ed8a16524e1afabd8c | scripts/cpp_lint.py | python | CheckForCopyright | (filename, lines, error) | Logs an error if a Copyright message appears at the top of the file. | Logs an error if a Copyright message appears at the top of the file. | [
"Logs",
"an",
"error",
"if",
"a",
"Copyright",
"message",
"appears",
"at",
"the",
"top",
"of",
"the",
"file",
"."
] | def CheckForCopyright(filename, lines, error):
"""Logs an error if a Copyright message appears at the top of the file."""
# We'll check up to line 10. Don't forget there's a
# dummy line at the front.
for line in xrange(1, min(len(lines), 11)):
if _RE_COPYRIGHT.search(lines[line], re.I):
error(filena... | [
"def",
"CheckForCopyright",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# We'll check up to line 10. Don't forget there's a",
"# dummy line at the front.",
"for",
"line",
"in",
"xrange",
"(",
"1",
",",
"min",
"(",
"len",
"(",
"lines",
")",
",",
"11",
... | https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L1372-L1381 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | python | CalculateGeneratorInputInfo | (params) | Called by __init__ to initialize generator values based on params. | Called by __init__ to initialize generator values based on params. | [
"Called",
"by",
"__init__",
"to",
"initialize",
"generator",
"values",
"based",
"on",
"params",
"."
] | def CalculateGeneratorInputInfo(params):
"""Called by __init__ to initialize generator values based on params."""
# E.g. "out/gypfiles"
toplevel = params['options'].toplevel_dir
qualified_out_dir = os.path.normpath(os.path.join(
toplevel, ComputeOutputDir(params), 'gypfiles'))
global generator_filelist... | [
"def",
"CalculateGeneratorInputInfo",
"(",
"params",
")",
":",
"# E.g. \"out/gypfiles\"",
"toplevel",
"=",
"params",
"[",
"'options'",
"]",
".",
"toplevel_dir",
"qualified_out_dir",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"os",
".",
"path",
".",
"join",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L1663-L1674 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/SHA224.py | python | SHA224Hash.update | (self, data) | Continue hashing of a message by consuming the next chunk of data.
Args:
data (byte string/byte array/memoryview): The next chunk of the message being hashed. | Continue hashing of a message by consuming the next chunk of data. | [
"Continue",
"hashing",
"of",
"a",
"message",
"by",
"consuming",
"the",
"next",
"chunk",
"of",
"data",
"."
] | def update(self, data):
"""Continue hashing of a message by consuming the next chunk of data.
Args:
data (byte string/byte array/memoryview): The next chunk of the message being hashed.
"""
result = _raw_sha224_lib.SHA224_update(self._state.get(),
... | [
"def",
"update",
"(",
"self",
",",
"data",
")",
":",
"result",
"=",
"_raw_sha224_lib",
".",
"SHA224_update",
"(",
"self",
".",
"_state",
".",
"get",
"(",
")",
",",
"c_uint8_ptr",
"(",
"data",
")",
",",
"c_size_t",
"(",
"len",
"(",
"data",
")",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/SHA224.py#L83-L95 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/imaplib.py | python | IMAP4.append | (self, mailbox, flags, date_time, message) | return self._simple_command(name, mailbox, flags, date_time) | Append message to named mailbox.
(typ, [data]) = <instance>.append(mailbox, flags, date_time, message)
All args except `message' can be None. | Append message to named mailbox. | [
"Append",
"message",
"to",
"named",
"mailbox",
"."
] | def append(self, mailbox, flags, date_time, message):
"""Append message to named mailbox.
(typ, [data]) = <instance>.append(mailbox, flags, date_time, message)
All args except `message' can be None.
"""
name = 'APPEND'
if not mailbox:
mailbox = 'INBO... | [
"def",
"append",
"(",
"self",
",",
"mailbox",
",",
"flags",
",",
"date_time",
",",
"message",
")",
":",
"name",
"=",
"'APPEND'",
"if",
"not",
"mailbox",
":",
"mailbox",
"=",
"'INBOX'",
"if",
"flags",
":",
"if",
"(",
"flags",
"[",
"0",
"]",
",",
"fl... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/imaplib.py#L380-L403 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | MenuItem.SetCheckable | (*args, **kwargs) | return _core_.MenuItem_SetCheckable(*args, **kwargs) | SetCheckable(self, bool checkable) | SetCheckable(self, bool checkable) | [
"SetCheckable",
"(",
"self",
"bool",
"checkable",
")"
] | def SetCheckable(*args, **kwargs):
"""SetCheckable(self, bool checkable)"""
return _core_.MenuItem_SetCheckable(*args, **kwargs) | [
"def",
"SetCheckable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_SetCheckable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12489-L12491 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/affine/diag.py | python | diag_mat.graph_implementation | (
self, arg_objs, shape: Tuple[int, ...], data=None
) | return (lu.diag_mat(arg_objs[0]), []) | Extracts the diagonal of a matrix.
Parameters
----------
arg_objs : list
LinExpr for each argument.
shape : tuple
The shape of the resulting expression.
data :
Additional data required by the atom.
Returns
-------
tupl... | Extracts the diagonal of a matrix. | [
"Extracts",
"the",
"diagonal",
"of",
"a",
"matrix",
"."
] | def graph_implementation(
self, arg_objs, shape: Tuple[int, ...], data=None
) -> Tuple[lo.LinOp, List[Constraint]]:
"""Extracts the diagonal of a matrix.
Parameters
----------
arg_objs : list
LinExpr for each argument.
shape : tuple
The shape ... | [
"def",
"graph_implementation",
"(",
"self",
",",
"arg_objs",
",",
"shape",
":",
"Tuple",
"[",
"int",
",",
"...",
"]",
",",
"data",
"=",
"None",
")",
"->",
"Tuple",
"[",
"lo",
".",
"LinOp",
",",
"List",
"[",
"Constraint",
"]",
"]",
":",
"return",
"(... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/diag.py#L154-L173 | |
RegrowthStudios/SoACode-Public | c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe | utils/git-hooks/pep8.py | python | BaseReport.get_file_results | (self) | return self.file_errors | Return the count of errors and warnings for this file. | Return the count of errors and warnings for this file. | [
"Return",
"the",
"count",
"of",
"errors",
"and",
"warnings",
"for",
"this",
"file",
"."
] | def get_file_results(self):
"""Return the count of errors and warnings for this file."""
return self.file_errors | [
"def",
"get_file_results",
"(",
"self",
")",
":",
"return",
"self",
".",
"file_errors"
] | https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/pep8.py#L1465-L1467 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Tools/Scripts/patchcheck.py | python | docs_modified | (file_paths) | return bool(file_paths) | Report if any file in the Doc directory has been changed. | Report if any file in the Doc directory has been changed. | [
"Report",
"if",
"any",
"file",
"in",
"the",
"Doc",
"directory",
"has",
"been",
"changed",
"."
] | def docs_modified(file_paths):
"""Report if any file in the Doc directory has been changed."""
return bool(file_paths) | [
"def",
"docs_modified",
"(",
"file_paths",
")",
":",
"return",
"bool",
"(",
"file_paths",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Tools/Scripts/patchcheck.py#L139-L141 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/utils.py | python | add_dict_to_cookiejar | (cj, cookie_dict) | return cj | Returns a CookieJar from a key/value dictionary.
:param cj: CookieJar to insert cookies into.
:param cookie_dict: Dict of key/values to insert into CookieJar. | Returns a CookieJar from a key/value dictionary. | [
"Returns",
"a",
"CookieJar",
"from",
"a",
"key",
"/",
"value",
"dictionary",
"."
] | def add_dict_to_cookiejar(cj, cookie_dict):
"""Returns a CookieJar from a key/value dictionary.
:param cj: CookieJar to insert cookies into.
:param cookie_dict: Dict of key/values to insert into CookieJar.
"""
cj2 = cookiejar_from_dict(cookie_dict)
cj.update(cj2)
return cj | [
"def",
"add_dict_to_cookiejar",
"(",
"cj",
",",
"cookie_dict",
")",
":",
"cj2",
"=",
"cookiejar_from_dict",
"(",
"cookie_dict",
")",
"cj",
".",
"update",
"(",
"cj2",
")",
"return",
"cj"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/utils.py#L276-L285 | |
numworks/epsilon | 8952d2f8b1de1c3f064eec8ffcea804c5594ba4c | build/device/dfu.py | python | main | () | Test program for verifying this files functionality. | Test program for verifying this files functionality. | [
"Test",
"program",
"for",
"verifying",
"this",
"files",
"functionality",
"."
] | def main():
"""Test program for verifying this files functionality."""
global __verbose
# Parse CMD args
parser = argparse.ArgumentParser(description='DFU Python Util')
#parser.add_argument("path", help="file path")
parser.add_argument(
"-l", "--list",
help="List currently attach... | [
"def",
"main",
"(",
")",
":",
"global",
"__verbose",
"# Parse CMD args",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'DFU Python Util'",
")",
"#parser.add_argument(\"path\", help=\"file path\")",
"parser",
".",
"add_argument",
"(",
"\"-l\... | https://github.com/numworks/epsilon/blob/8952d2f8b1de1c3f064eec8ffcea804c5594ba4c/build/device/dfu.py#L559-L640 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/frame.py | python | extract_vars | (*names,**kw) | return dict((k,callerNS[k]) for k in names) | Extract a set of variables by name from another frame.
Parameters
----------
*names : str
One or more variable names which will be extracted from the caller's
frame.
depth : integer, optional
How many frames in the stack to walk when looking for your variables.
The defa... | Extract a set of variables by name from another frame. | [
"Extract",
"a",
"set",
"of",
"variables",
"by",
"name",
"from",
"another",
"frame",
"."
] | def extract_vars(*names,**kw):
"""Extract a set of variables by name from another frame.
Parameters
----------
*names : str
One or more variable names which will be extracted from the caller's
frame.
depth : integer, optional
How many frames in the stack to walk when lookin... | [
"def",
"extract_vars",
"(",
"*",
"names",
",",
"*",
"*",
"kw",
")",
":",
"depth",
"=",
"kw",
".",
"get",
"(",
"'depth'",
",",
"0",
")",
"callerNS",
"=",
"sys",
".",
"_getframe",
"(",
"depth",
"+",
"1",
")",
".",
"f_locals",
"return",
"dict",
"(",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/frame.py#L26-L56 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | _ensure_term | (where, scope_level: int) | return where if where is None or len(where) else None | Ensure that the where is a Term or a list of Term.
This makes sure that we are capturing the scope of variables that are
passed create the terms here with a frame_level=2 (we are 2 levels down) | Ensure that the where is a Term or a list of Term. | [
"Ensure",
"that",
"the",
"where",
"is",
"a",
"Term",
"or",
"a",
"list",
"of",
"Term",
"."
] | def _ensure_term(where, scope_level: int):
"""
Ensure that the where is a Term or a list of Term.
This makes sure that we are capturing the scope of variables that are
passed create the terms here with a frame_level=2 (we are 2 levels down)
"""
# only consider list/tuple here as an ndarray is a... | [
"def",
"_ensure_term",
"(",
"where",
",",
"scope_level",
":",
"int",
")",
":",
"# only consider list/tuple here as an ndarray is automatically a coordinate",
"# list",
"level",
"=",
"scope_level",
"+",
"1",
"if",
"isinstance",
"(",
"where",
",",
"(",
"list",
",",
"t... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L147-L165 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/stata.py | python | StataStrLWriter.generate_table | (self) | return gso_table, gso_df | Generates the GSO lookup table for the DataFrame
Returns
-------
gso_table : dict
Ordered dictionary using the string found as keys
and their lookup position (v,o) as values
gso_df : DataFrame
DataFrame where strl columns have been converted to
... | Generates the GSO lookup table for the DataFrame | [
"Generates",
"the",
"GSO",
"lookup",
"table",
"for",
"the",
"DataFrame"
] | def generate_table(self):
"""
Generates the GSO lookup table for the DataFrame
Returns
-------
gso_table : dict
Ordered dictionary using the string found as keys
and their lookup position (v,o) as values
gso_df : DataFrame
DataFrame wh... | [
"def",
"generate_table",
"(",
"self",
")",
":",
"gso_table",
"=",
"self",
".",
"_gso_table",
"gso_df",
"=",
"self",
".",
"df",
"columns",
"=",
"list",
"(",
"gso_df",
".",
"columns",
")",
"selected",
"=",
"gso_df",
"[",
"self",
".",
"columns",
"]",
"col... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/stata.py#L2698-L2748 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/lib/profiling.py | python | AggregateProfile.__init__ | (self, profile_datum) | Constructor.
Args:
profile_datum: (`ProfileDatum`) an instance of `ProfileDatum` to
initialize this object with. | Constructor. | [
"Constructor",
"."
] | def __init__(self, profile_datum):
"""Constructor.
Args:
profile_datum: (`ProfileDatum`) an instance of `ProfileDatum` to
initialize this object with.
"""
self.total_op_time = profile_datum.op_time
self.total_exec_time = profile_datum.exec_time
device_and_node = "%s:%s" % (profil... | [
"def",
"__init__",
"(",
"self",
",",
"profile_datum",
")",
":",
"self",
".",
"total_op_time",
"=",
"profile_datum",
".",
"op_time",
"self",
".",
"total_exec_time",
"=",
"profile_datum",
".",
"exec_time",
"device_and_node",
"=",
"\"%s:%s\"",
"%",
"(",
"profile_da... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/profiling.py#L64-L76 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/AutoDiff.py | python | abs | (a) | return Blob(PythonWrapper.blob_abs(a._internal)) | Takes absolute value of each blob element. | Takes absolute value of each blob element. | [
"Takes",
"absolute",
"value",
"of",
"each",
"blob",
"element",
"."
] | def abs(a):
"""Takes absolute value of each blob element.
"""
if not type(a) is Blob:
raise ValueError('`a` should be neoml.Blob.')
if a.size == 0:
raise ValueError("The blob shouldn't be empty.")
return Blob(PythonWrapper.blob_abs(a._internal)) | [
"def",
"abs",
"(",
"a",
")",
":",
"if",
"not",
"type",
"(",
"a",
")",
"is",
"Blob",
":",
"raise",
"ValueError",
"(",
"'`a` should be neoml.Blob.'",
")",
"if",
"a",
".",
"size",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"The blob shouldn't be empty.\"",... | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/AutoDiff.py#L143-L152 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/credentials.py | python | CredentialResolver.remove | (self, name) | Removes a given ``Credentials`` instance from the chain.
:param name: The short name of the credentials instance to remove.
:type name: string | Removes a given ``Credentials`` instance from the chain. | [
"Removes",
"a",
"given",
"Credentials",
"instance",
"from",
"the",
"chain",
"."
] | def remove(self, name):
"""
Removes a given ``Credentials`` instance from the chain.
:param name: The short name of the credentials instance to remove.
:type name: string
"""
available_methods = [p.METHOD for p in self.providers]
if name not in available_methods:... | [
"def",
"remove",
"(",
"self",
",",
"name",
")",
":",
"available_methods",
"=",
"[",
"p",
".",
"METHOD",
"for",
"p",
"in",
"self",
".",
"providers",
"]",
"if",
"name",
"not",
"in",
"available_methods",
":",
"# It's not present. Fail silently.",
"return",
"off... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/credentials.py#L1907-L1920 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/ao/ns/_numeric_suite.py | python | compare_model_outputs | (
float_model: nn.Module,
q_model: nn.Module,
*data,
logger_cls=OutputLogger,
allow_list=None
) | return act_compare_dict | r"""Compare output activations between float and quantized models at
corresponding locations for the same input. Return a dict with key corresponding
to quantized module names and each entry being a dictionary with two keys
'float' and 'quantized', containing the activations of quantized model and
float... | r"""Compare output activations between float and quantized models at
corresponding locations for the same input. Return a dict with key corresponding
to quantized module names and each entry being a dictionary with two keys
'float' and 'quantized', containing the activations of quantized model and
float... | [
"r",
"Compare",
"output",
"activations",
"between",
"float",
"and",
"quantized",
"models",
"at",
"corresponding",
"locations",
"for",
"the",
"same",
"input",
".",
"Return",
"a",
"dict",
"with",
"key",
"corresponding",
"to",
"quantized",
"module",
"names",
"and",... | def compare_model_outputs(
float_model: nn.Module,
q_model: nn.Module,
*data,
logger_cls=OutputLogger,
allow_list=None
) -> Dict[str, Dict[str, torch.Tensor]]:
r"""Compare output activations between float and quantized models at
corresponding locations for the same input. Return a dict with ... | [
"def",
"compare_model_outputs",
"(",
"float_model",
":",
"nn",
".",
"Module",
",",
"q_model",
":",
"nn",
".",
"Module",
",",
"*",
"data",
",",
"logger_cls",
"=",
"OutputLogger",
",",
"allow_list",
"=",
"None",
")",
"->",
"Dict",
"[",
"str",
",",
"Dict",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/ns/_numeric_suite.py#L478-L523 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/state_ops.py | python | scatter_nd_sub | (ref, indices, updates, use_locking=False, name=None) | return ref._lazy_read(gen_state_ops.resource_scatter_nd_sub( # pylint: disable=protected-access
ref.handle, indices, ops.convert_to_tensor(updates, ref.dtype),
name=name)) | r"""Applies sparse subtraction to individual values or slices in a Variable.
`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`.
It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`.
The innermost dimension of `in... | r"""Applies sparse subtraction to individual values or slices in a Variable. | [
"r",
"Applies",
"sparse",
"subtraction",
"to",
"individual",
"values",
"or",
"slices",
"in",
"a",
"Variable",
"."
] | def scatter_nd_sub(ref, indices, updates, use_locking=False, name=None):
r"""Applies sparse subtraction to individual values or slices in a Variable.
`ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`.
`indices` must be integer tensor, containing indices into `ref`.
It must be shape `[d... | [
"def",
"scatter_nd_sub",
"(",
"ref",
",",
"indices",
",",
"updates",
",",
"use_locking",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"if",
"ref",
".",
"dtype",
".",
"_is_ref_dtype",
":",
"return",
"gen_state_ops",
".",
"scatter_nd_sub",
"(",
"ref",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/state_ops.py#L541-L601 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Alignment/OfflineValidation/python/TkAlAllInOneTool/betterConfigParser.py | python | AdaptedDict.__setitem__ | (self, key, value, dict_setitem=collections.OrderedDict.__setitem__) | od.__setitem__(i, y) <==> od[i]=y
Updating an existing key appends the new value to the old value
instead of replacing it.
Arguments:
- `key`: key part of the key-value pair
- `value`: value part of the key-value pair
- `dict_item`: method which is used for finally setti... | od.__setitem__(i, y) <==> od[i]=y
Updating an existing key appends the new value to the old value
instead of replacing it. | [
"od",
".",
"__setitem__",
"(",
"i",
"y",
")",
"<",
"==",
">",
"od",
"[",
"i",
"]",
"=",
"y",
"Updating",
"an",
"existing",
"key",
"appends",
"the",
"new",
"value",
"to",
"the",
"old",
"value",
"instead",
"of",
"replacing",
"it",
"."
] | def __setitem__(self, key, value, dict_setitem=collections.OrderedDict.__setitem__):
"""
od.__setitem__(i, y) <==> od[i]=y
Updating an existing key appends the new value to the old value
instead of replacing it.
Arguments:
- `key`: key part of the key-value pair
... | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"value",
",",
"dict_setitem",
"=",
"collections",
".",
"OrderedDict",
".",
"__setitem__",
")",
":",
"if",
"key",
"!=",
"\"__name__\"",
"and",
"\"__name__\"",
"in",
"self",
"and",
"self",
"[",
"\"__name__\""... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/OfflineValidation/python/TkAlAllInOneTool/betterConfigParser.py#L28-L48 | ||
ROCmSoftwarePlatform/hipCaffe | 4ec5d482515cce532348553b6db6d00d015675d5 | python/caffe/io.py | python | array_to_blobproto | (arr, diff=None) | return blob | Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check. | Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check. | [
"Converts",
"a",
"N",
"-",
"dimensional",
"array",
"to",
"blob",
"proto",
".",
"If",
"diff",
"is",
"given",
"also",
"convert",
"the",
"diff",
".",
"You",
"need",
"to",
"make",
"sure",
"that",
"arr",
"and",
"diff",
"have",
"the",
"same",
"shape",
"and",... | def array_to_blobproto(arr, diff=None):
"""Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check.
"""
blob = caffe_pb2.BlobProto()
blob.shape.dim.extend(arr.sh... | [
"def",
"array_to_blobproto",
"(",
"arr",
",",
"diff",
"=",
"None",
")",
":",
"blob",
"=",
"caffe_pb2",
".",
"BlobProto",
"(",
")",
"blob",
".",
"shape",
".",
"dim",
".",
"extend",
"(",
"arr",
".",
"shape",
")",
"blob",
".",
"data",
".",
"extend",
"... | https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/python/caffe/io.py#L36-L46 | |
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | lesion_detector_3DCE/rcnn/pycocotools/coco.py | python | COCO.annToMask | (self, ann) | return m | Convert annotation which can be polygons, uncompressed RLE, or RLE to binary mask.
:return: binary mask (numpy 2D array) | Convert annotation which can be polygons, uncompressed RLE, or RLE to binary mask.
:return: binary mask (numpy 2D array) | [
"Convert",
"annotation",
"which",
"can",
"be",
"polygons",
"uncompressed",
"RLE",
"or",
"RLE",
"to",
"binary",
"mask",
".",
":",
"return",
":",
"binary",
"mask",
"(",
"numpy",
"2D",
"array",
")"
] | def annToMask(self, ann):
"""
Convert annotation which can be polygons, uncompressed RLE, or RLE to binary mask.
:return: binary mask (numpy 2D array)
"""
rle = self.annToRLE(ann)
m = maskUtils.decode(rle)
return m | [
"def",
"annToMask",
"(",
"self",
",",
"ann",
")",
":",
"rle",
"=",
"self",
".",
"annToRLE",
"(",
"ann",
")",
"m",
"=",
"maskUtils",
".",
"decode",
"(",
"rle",
")",
"return",
"m"
] | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/lesion_detector_3DCE/rcnn/pycocotools/coco.py#L421-L428 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/adidas_utils/solvers/symmetric/pg.py | python | Solver.exploitability | (self, params, payoff_matrices) | return np.NaN | Policy gradient does not minimize any exploitability so return NaN.
Args:
params: tuple of params (dist,)
payoff_matrices: (>=2 x A x A) np.array, payoffs for each joint action
Returns:
np.NaN | Policy gradient does not minimize any exploitability so return NaN. | [
"Policy",
"gradient",
"does",
"not",
"minimize",
"any",
"exploitability",
"so",
"return",
"NaN",
"."
] | def exploitability(self, params, payoff_matrices):
"""Policy gradient does not minimize any exploitability so return NaN.
Args:
params: tuple of params (dist,)
payoff_matrices: (>=2 x A x A) np.array, payoffs for each joint action
Returns:
np.NaN
"""
return np.NaN | [
"def",
"exploitability",
"(",
"self",
",",
"params",
",",
"payoff_matrices",
")",
":",
"return",
"np",
".",
"NaN"
] | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/adidas_utils/solvers/symmetric/pg.py#L49-L58 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/message.py | python | Message.MergeFrom | (self, other_msg) | Merges the contents of the specified message into current message.
This method merges the contents of the specified message into the current
message. Singular fields that are set in the specified message overwrite
the corresponding fields in the current message. Repeated fields are
appended. Singular s... | Merges the contents of the specified message into current message. | [
"Merges",
"the",
"contents",
"of",
"the",
"specified",
"message",
"into",
"current",
"message",
"."
] | def MergeFrom(self, other_msg):
"""Merges the contents of the specified message into current message.
This method merges the contents of the specified message into the current
message. Singular fields that are set in the specified message overwrite
the corresponding fields in the current message. Repea... | [
"def",
"MergeFrom",
"(",
"self",
",",
"other_msg",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/message.py#L94-L105 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib.py | python | URLopener.open | (self, fullurl, data=None) | Use URLopener().open(file) instead of open(file, 'r'). | Use URLopener().open(file) instead of open(file, 'r'). | [
"Use",
"URLopener",
"()",
".",
"open",
"(",
"file",
")",
"instead",
"of",
"open",
"(",
"file",
"r",
")",
"."
] | def open(self, fullurl, data=None):
"""Use URLopener().open(file) instead of open(file, 'r')."""
fullurl = unwrap(toBytes(fullurl))
# percent encode url, fixing lame server errors for e.g, like space
# within url paths.
fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]|")
... | [
"def",
"open",
"(",
"self",
",",
"fullurl",
",",
"data",
"=",
"None",
")",
":",
"fullurl",
"=",
"unwrap",
"(",
"toBytes",
"(",
"fullurl",
")",
")",
"# percent encode url, fixing lame server errors for e.g, like space",
"# within url paths.",
"fullurl",
"=",
"quote",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib.py#L178-L212 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Descriptors/CompoundDescriptors.py | python | CompoundDescriptorCalculator.ProcessCompoundList | (self) | Adds entries from the _compoundList_ to the list of _requiredDescriptors_
Each compound descriptor is surveyed. Any atomic descriptors it requires
are added to the list of _requiredDescriptors_ to be pulled from the database. | Adds entries from the _compoundList_ to the list of _requiredDescriptors_ | [
"Adds",
"entries",
"from",
"the",
"_compoundList_",
"to",
"the",
"list",
"of",
"_requiredDescriptors_"
] | def ProcessCompoundList(self):
""" Adds entries from the _compoundList_ to the list of _requiredDescriptors_
Each compound descriptor is surveyed. Any atomic descriptors it requires
are added to the list of _requiredDescriptors_ to be pulled from the database.
"""
# add in the atomic descript... | [
"def",
"ProcessCompoundList",
"(",
"self",
")",
":",
"# add in the atomic descriptors we will need",
"for",
"entry",
"in",
"self",
".",
"compoundList",
":",
"for",
"atomicDesc",
"in",
"entry",
"[",
"1",
"]",
":",
"if",
"atomicDesc",
"!=",
"''",
"and",
"atomicDes... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Descriptors/CompoundDescriptors.py#L239-L250 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/dtypes/cast.py | python | astype_nansafe | (
arr: np.ndarray, dtype: DtypeObj, copy: bool = True, skipna: bool = False
) | return arr.astype(dtype, copy=copy) | Cast the elements of an array to a given dtype a nan-safe manner.
Parameters
----------
arr : ndarray
dtype : np.dtype or ExtensionDtype
copy : bool, default True
If False, a view will be attempted but may fail, if
e.g. the item sizes don't align.
skipna: bool, default False
... | Cast the elements of an array to a given dtype a nan-safe manner. | [
"Cast",
"the",
"elements",
"of",
"an",
"array",
"to",
"a",
"given",
"dtype",
"a",
"nan",
"-",
"safe",
"manner",
"."
] | def astype_nansafe(
arr: np.ndarray, dtype: DtypeObj, copy: bool = True, skipna: bool = False
) -> ArrayLike:
"""
Cast the elements of an array to a given dtype a nan-safe manner.
Parameters
----------
arr : ndarray
dtype : np.dtype or ExtensionDtype
copy : bool, default True
If... | [
"def",
"astype_nansafe",
"(",
"arr",
":",
"np",
".",
"ndarray",
",",
"dtype",
":",
"DtypeObj",
",",
"copy",
":",
"bool",
"=",
"True",
",",
"skipna",
":",
"bool",
"=",
"False",
")",
"->",
"ArrayLike",
":",
"if",
"arr",
".",
"ndim",
">",
"1",
":",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/dtypes/cast.py#L1072-L1203 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/series.py | python | Series._set_axis | (self, axis: int, labels, fastpath: bool = False) | Override generic, we want to set the _typ here.
This is called from the cython code when we set the `index` attribute
directly, e.g. `series.index = [1, 2, 3]`. | Override generic, we want to set the _typ here. | [
"Override",
"generic",
"we",
"want",
"to",
"set",
"the",
"_typ",
"here",
"."
] | def _set_axis(self, axis: int, labels, fastpath: bool = False) -> None:
"""
Override generic, we want to set the _typ here.
This is called from the cython code when we set the `index` attribute
directly, e.g. `series.index = [1, 2, 3]`.
"""
if not fastpath:
l... | [
"def",
"_set_axis",
"(",
"self",
",",
"axis",
":",
"int",
",",
"labels",
",",
"fastpath",
":",
"bool",
"=",
"False",
")",
"->",
"None",
":",
"if",
"not",
"fastpath",
":",
"labels",
"=",
"ensure_index",
"(",
"labels",
")",
"if",
"labels",
".",
"_is_al... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/series.py#L528-L559 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py | python | Index.is_ | (self, other) | return self._id is getattr(other, "_id", Ellipsis) and self._id is not None | More flexible, faster check like ``is`` but that works through views.
Note: this is *not* the same as ``Index.identical()``, which checks
that metadata is also the same.
Parameters
----------
other : object
other object to compare against.
Returns
-... | More flexible, faster check like ``is`` but that works through views. | [
"More",
"flexible",
"faster",
"check",
"like",
"is",
"but",
"that",
"works",
"through",
"views",
"."
] | def is_(self, other) -> bool:
"""
More flexible, faster check like ``is`` but that works through views.
Note: this is *not* the same as ``Index.identical()``, which checks
that metadata is also the same.
Parameters
----------
other : object
other obj... | [
"def",
"is_",
"(",
"self",
",",
"other",
")",
"->",
"bool",
":",
"# use something other than None to be clearer",
"return",
"self",
".",
"_id",
"is",
"getattr",
"(",
"other",
",",
"\"_id\"",
",",
"Ellipsis",
")",
"and",
"self",
".",
"_id",
"is",
"not",
"No... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py#L573-L590 | |
opencv/opencv | 76aff8478883858f0e46746044348ebb16dc3c67 | samples/python/dft.py | python | shift_dft | (src, dst=None) | return dst | Rearrange the quadrants of Fourier image so that the origin is at
the image center. Swaps quadrant 1 with 3, and 2 with 4.
src and dst arrays must be equal size & type | Rearrange the quadrants of Fourier image so that the origin is at
the image center. Swaps quadrant 1 with 3, and 2 with 4. | [
"Rearrange",
"the",
"quadrants",
"of",
"Fourier",
"image",
"so",
"that",
"the",
"origin",
"is",
"at",
"the",
"image",
"center",
".",
"Swaps",
"quadrant",
"1",
"with",
"3",
"and",
"2",
"with",
"4",
"."
] | def shift_dft(src, dst=None):
'''
Rearrange the quadrants of Fourier image so that the origin is at
the image center. Swaps quadrant 1 with 3, and 2 with 4.
src and dst arrays must be equal size & type
'''
if dst is None:
dst = np.empty(src.shape, src.dtype)
elif src.sh... | [
"def",
"shift_dft",
"(",
"src",
",",
"dst",
"=",
"None",
")",
":",
"if",
"dst",
"is",
"None",
":",
"dst",
"=",
"np",
".",
"empty",
"(",
"src",
".",
"shape",
",",
"src",
".",
"dtype",
")",
"elif",
"src",
".",
"shape",
"!=",
"dst",
".",
"shape",
... | https://github.com/opencv/opencv/blob/76aff8478883858f0e46746044348ebb16dc3c67/samples/python/dft.py#L20-L64 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | sqrt | (x, name=None) | Computes square root of x element-wise.
I.e., \\(y = \sqrt{x} = x^{1/2}\\).
Args:
x: A `Tensor` or `SparseTensor`. Must be one of the following types: `half`,
`float32`, `float64`, `complex64`, `complex128`.
name: A name for the operation (optional).
Returns:
A `Tensor` or `SparseTensor`, res... | Computes square root of x element-wise. | [
"Computes",
"square",
"root",
"of",
"x",
"element",
"-",
"wise",
"."
] | def sqrt(x, name=None):
"""Computes square root of x element-wise.
I.e., \\(y = \sqrt{x} = x^{1/2}\\).
Args:
x: A `Tensor` or `SparseTensor`. Must be one of the following types: `half`,
`float32`, `float64`, `complex64`, `complex128`.
name: A name for the operation (optional).
Returns:
A `T... | [
"def",
"sqrt",
"(",
"x",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"x",
"]",
",",
"name",
",",
"\"Sqrt\"",
")",
"as",
"name",
":",
"if",
"isinstance",
"(",
"x",
",",
"ops",
".",
"SparseTensor",
")",
":",
"x_s... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L348-L366 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | MDArray.GetAttribute | (self, *args) | return _gdal.MDArray_GetAttribute(self, *args) | r"""GetAttribute(MDArray self, char const * name) -> Attribute | r"""GetAttribute(MDArray self, char const * name) -> Attribute | [
"r",
"GetAttribute",
"(",
"MDArray",
"self",
"char",
"const",
"*",
"name",
")",
"-",
">",
"Attribute"
] | def GetAttribute(self, *args):
r"""GetAttribute(MDArray self, char const * name) -> Attribute"""
return _gdal.MDArray_GetAttribute(self, *args) | [
"def",
"GetAttribute",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"MDArray_GetAttribute",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L2747-L2749 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/sparse/extract.py | python | find | (A) | return A.row[nz_mask], A.col[nz_mask], A.data[nz_mask] | Return the indices and values of the nonzero elements of a matrix
Parameters
----------
A : dense or sparse matrix
Matrix whose nonzero elements are desired.
Returns
-------
(I,J,V) : tuple of arrays
I,J, and V contain the row indices, column indices, and values
of the ... | Return the indices and values of the nonzero elements of a matrix | [
"Return",
"the",
"indices",
"and",
"values",
"of",
"the",
"nonzero",
"elements",
"of",
"a",
"matrix"
] | def find(A):
"""Return the indices and values of the nonzero elements of a matrix
Parameters
----------
A : dense or sparse matrix
Matrix whose nonzero elements are desired.
Returns
-------
(I,J,V) : tuple of arrays
I,J, and V contain the row indices, column indices, and va... | [
"def",
"find",
"(",
"A",
")",
":",
"A",
"=",
"coo_matrix",
"(",
"A",
",",
"copy",
"=",
"True",
")",
"A",
".",
"sum_duplicates",
"(",
")",
"# remove explicit zeros",
"nz_mask",
"=",
"A",
".",
"data",
"!=",
"0",
"return",
"A",
".",
"row",
"[",
"nz_ma... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/sparse/extract.py#L14-L42 | |
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/stubout.py | python | StubOutForTesting.SmartUnsetAll | (self) | Reverses all the SmartSet() calls, restoring things to their original
definition. Its okay to call SmartUnsetAll() repeatedly, as later calls
have no effect if no SmartSet() calls have been made. | Reverses all the SmartSet() calls, restoring things to their original
definition. Its okay to call SmartUnsetAll() repeatedly, as later calls
have no effect if no SmartSet() calls have been made. | [
"Reverses",
"all",
"the",
"SmartSet",
"()",
"calls",
"restoring",
"things",
"to",
"their",
"original",
"definition",
".",
"Its",
"okay",
"to",
"call",
"SmartUnsetAll",
"()",
"repeatedly",
"as",
"later",
"calls",
"have",
"no",
"effect",
"if",
"no",
"SmartSet",
... | def SmartUnsetAll(self):
"""Reverses all the SmartSet() calls, restoring things to their original
definition. Its okay to call SmartUnsetAll() repeatedly, as later calls
have no effect if no SmartSet() calls have been made.
"""
self.stubs.reverse()
for args in self.stubs:
setattr(*args)... | [
"def",
"SmartUnsetAll",
"(",
"self",
")",
":",
"self",
".",
"stubs",
".",
"reverse",
"(",
")",
"for",
"args",
"in",
"self",
".",
"stubs",
":",
"setattr",
"(",
"*",
"args",
")",
"self",
".",
"stubs",
"=",
"[",
"]"
] | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/stubout.py#L96-L107 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | Examples/Text/LightRNN/LightRNN/train.py | python | create_criterion | (network) | return (label_ce, label_pe) | Create the criterion for model | Create the criterion for model | [
"Create",
"the",
"criterion",
"for",
"model"
] | def create_criterion(network):
'''Create the criterion for model'''
model, label1, label2 = network['model'], network['row_label'], network['col_label']
label1_ce = C.cross_entropy_with_softmax(model.outputs[0], label1)
label2_ce = C.cross_entropy_with_softmax(model.outputs[1], label2)
label1_pe = C... | [
"def",
"create_criterion",
"(",
"network",
")",
":",
"model",
",",
"label1",
",",
"label2",
"=",
"network",
"[",
"'model'",
"]",
",",
"network",
"[",
"'row_label'",
"]",
",",
"network",
"[",
"'col_label'",
"]",
"label1_ce",
"=",
"C",
".",
"cross_entropy_wi... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/Examples/Text/LightRNN/LightRNN/train.py#L173-L182 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGridInterface.RegisterAdditionalEditors | (*args, **kwargs) | return _propgrid.PropertyGridInterface_RegisterAdditionalEditors(*args, **kwargs) | RegisterAdditionalEditors() | RegisterAdditionalEditors() | [
"RegisterAdditionalEditors",
"()"
] | def RegisterAdditionalEditors(*args, **kwargs):
"""RegisterAdditionalEditors()"""
return _propgrid.PropertyGridInterface_RegisterAdditionalEditors(*args, **kwargs) | [
"def",
"RegisterAdditionalEditors",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_RegisterAdditionalEditors",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1340-L1342 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | examples/onnx/bert/run_onnx_squad.py | python | read_squad_examples | (input_file) | return examples | Read a SQuAD json file into a list of SquadExample. | Read a SQuAD json file into a list of SquadExample. | [
"Read",
"a",
"SQuAD",
"json",
"file",
"into",
"a",
"list",
"of",
"SquadExample",
"."
] | def read_squad_examples(input_file):
"""Read a SQuAD json file into a list of SquadExample."""
with open(input_file, "r") as f:
input_data = json.load(f)["data"]
def is_whitespace(c):
if c == " " or c == "\t" or c == "\r" or c == "\n" or ord(c) == 0x202F:
return True
ret... | [
"def",
"read_squad_examples",
"(",
"input_file",
")",
":",
"with",
"open",
"(",
"input_file",
",",
"\"r\"",
")",
"as",
"f",
":",
"input_data",
"=",
"json",
".",
"load",
"(",
"f",
")",
"[",
"\"data\"",
"]",
"def",
"is_whitespace",
"(",
"c",
")",
":",
... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/examples/onnx/bert/run_onnx_squad.py#L213-L254 | |
whai362/PSENet | 4d95395658662f2223805c36dcd573d9e190ce26 | eval/ic15/rrc_evaluation_funcs.py | python | get_tl_line_values_from_file_contents | (content,CRLF=True,LTRB=True,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0,sort_by_confidences=True) | return pointsList,confidencesList,transcriptionsList | Returns all points, confindences and transcriptions of a file in lists. Valid line formats:
xmin,ymin,xmax,ymax,[confidence],[transcription]
x1,y1,x2,y2,x3,y3,x4,y4,[confidence],[transcription] | Returns all points, confindences and transcriptions of a file in lists. Valid line formats:
xmin,ymin,xmax,ymax,[confidence],[transcription]
x1,y1,x2,y2,x3,y3,x4,y4,[confidence],[transcription] | [
"Returns",
"all",
"points",
"confindences",
"and",
"transcriptions",
"of",
"a",
"file",
"in",
"lists",
".",
"Valid",
"line",
"formats",
":",
"xmin",
"ymin",
"xmax",
"ymax",
"[",
"confidence",
"]",
"[",
"transcription",
"]",
"x1",
"y1",
"x2",
"y2",
"x3",
... | def get_tl_line_values_from_file_contents(content,CRLF=True,LTRB=True,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0,sort_by_confidences=True):
"""
Returns all points, confindences and transcriptions of a file in lists. Valid line formats:
xmin,ymin,xmax,ymax,[confidence],[transcription]
... | [
"def",
"get_tl_line_values_from_file_contents",
"(",
"content",
",",
"CRLF",
"=",
"True",
",",
"LTRB",
"=",
"True",
",",
"withTranscription",
"=",
"False",
",",
"withConfidence",
"=",
"False",
",",
"imWidth",
"=",
"0",
",",
"imHeight",
"=",
"0",
",",
"sort_b... | https://github.com/whai362/PSENet/blob/4d95395658662f2223805c36dcd573d9e190ce26/eval/ic15/rrc_evaluation_funcs.py#L257-L283 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextFileHandler.SetEncoding | (*args, **kwargs) | return _richtext.RichTextFileHandler_SetEncoding(*args, **kwargs) | SetEncoding(self, String encoding) | SetEncoding(self, String encoding) | [
"SetEncoding",
"(",
"self",
"String",
"encoding",
")"
] | def SetEncoding(*args, **kwargs):
"""SetEncoding(self, String encoding)"""
return _richtext.RichTextFileHandler_SetEncoding(*args, **kwargs) | [
"def",
"SetEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextFileHandler_SetEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2824-L2826 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py | python | Integral.__rand__ | (self, other) | other & self | other & self | [
"other",
"&",
"self"
] | def __rand__(self, other):
"""other & self"""
raise NotImplementedError | [
"def",
"__rand__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py#L346-L348 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | ThirdParty/cinema/paraview/tpl/cinema_python/adaptors/paraview/cinemareader.py | python | FileStoreAPI.get_control_values | (self, controlparametername, sort=True) | return values | returns sorted list of available values for a control parameter | returns sorted list of available values for a control parameter | [
"returns",
"sorted",
"list",
"of",
"available",
"values",
"for",
"a",
"control",
"parameter"
] | def get_control_values(self, controlparametername, sort=True):
"""returns sorted list of available values for a control parameter"""
info = self.fs.get_parameter(controlparametername)
values = info["values"]
if sort:
values.sort()
return values | [
"def",
"get_control_values",
"(",
"self",
",",
"controlparametername",
",",
"sort",
"=",
"True",
")",
":",
"info",
"=",
"self",
".",
"fs",
".",
"get_parameter",
"(",
"controlparametername",
")",
"values",
"=",
"info",
"[",
"\"values\"",
"]",
"if",
"sort",
... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/adaptors/paraview/cinemareader.py#L93-L99 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/mailbox.py | python | mbox.__init__ | (self, path, factory=None, create=True) | Initialize an mbox mailbox. | Initialize an mbox mailbox. | [
"Initialize",
"an",
"mbox",
"mailbox",
"."
] | def __init__(self, path, factory=None, create=True):
"""Initialize an mbox mailbox."""
self._message_factory = mboxMessage
_mboxMMDF.__init__(self, path, factory, create) | [
"def",
"__init__",
"(",
"self",
",",
"path",
",",
"factory",
"=",
"None",
",",
"create",
"=",
"True",
")",
":",
"self",
".",
"_message_factory",
"=",
"mboxMessage",
"_mboxMMDF",
".",
"__init__",
"(",
"self",
",",
"path",
",",
"factory",
",",
"create",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mailbox.py#L734-L737 | ||
nodejs/nan | 8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62 | cpplint.py | python | _CppLintState.SetCountingStyle | (self, counting_style) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def SetCountingStyle(self, counting_style):
"""Sets the module's counting options."""
self.counting = counting_style | [
"def",
"SetCountingStyle",
"(",
"self",
",",
"counting_style",
")",
":",
"self",
".",
"counting",
"=",
"counting_style"
] | https://github.com/nodejs/nan/blob/8db8c8f544f2b6ce1b0859ef6ecdd0a3873a9e62/cpplint.py#L1046-L1048 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/symsrc/pefile.py | python | UnicodeStringWrapperPostProcessor.__str__ | (self) | return '' | Return the escaped ASCII representation of the string. | Return the escaped ASCII representation of the string. | [
"Return",
"the",
"escaped",
"ASCII",
"representation",
"of",
"the",
"string",
"."
] | def __str__(self):
"""Return the escaped ASCII representation of the string."""
def convert_char(char):
if char in string.printable:
return char
else:
return r'\x%02x' % ord(char)
if self.string:
return ''.... | [
"def",
"__str__",
"(",
"self",
")",
":",
"def",
"convert_char",
"(",
"char",
")",
":",
"if",
"char",
"in",
"string",
".",
"printable",
":",
"return",
"char",
"else",
":",
"return",
"r'\\x%02x'",
"%",
"ord",
"(",
"char",
")",
"if",
"self",
".",
"strin... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/symsrc/pefile.py#L504-L516 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | MenuItem.SetBitmap | (*args, **kwargs) | return _core_.MenuItem_SetBitmap(*args, **kwargs) | SetBitmap(self, Bitmap bitmap) | SetBitmap(self, Bitmap bitmap) | [
"SetBitmap",
"(",
"self",
"Bitmap",
"bitmap",
")"
] | def SetBitmap(*args, **kwargs):
"""SetBitmap(self, Bitmap bitmap)"""
return _core_.MenuItem_SetBitmap(*args, **kwargs) | [
"def",
"SetBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_SetBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12549-L12551 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | MaskedArray.unshare_mask | (self) | return self | Copy the mask and set the sharedmask flag to False.
Whether the mask is shared between masked arrays can be seen from
the `sharedmask` property. `unshare_mask` ensures the mask is not shared.
A copy of the mask is only made if it was shared.
See Also
--------
sharedmask | Copy the mask and set the sharedmask flag to False. | [
"Copy",
"the",
"mask",
"and",
"set",
"the",
"sharedmask",
"flag",
"to",
"False",
"."
] | def unshare_mask(self):
"""
Copy the mask and set the sharedmask flag to False.
Whether the mask is shared between masked arrays can be seen from
the `sharedmask` property. `unshare_mask` ensures the mask is not shared.
A copy of the mask is only made if it was shared.
... | [
"def",
"unshare_mask",
"(",
"self",
")",
":",
"if",
"self",
".",
"_sharedmask",
":",
"self",
".",
"_mask",
"=",
"self",
".",
"_mask",
".",
"copy",
"(",
")",
"self",
".",
"_sharedmask",
"=",
"False",
"return",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L3534-L3550 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/framework/op_def_library.py | python | _Restructure | (l, structure) | Returns the elements of list l structured according to the given structure.
A structure is represented by a list whose elements are either
`None` or a non-negative integer. `None` corresponds to a single
element in the output list, and an integer N corresponds to a nested
list of length N.
The function retu... | Returns the elements of list l structured according to the given structure. | [
"Returns",
"the",
"elements",
"of",
"list",
"l",
"structured",
"according",
"to",
"the",
"given",
"structure",
"."
] | def _Restructure(l, structure):
"""Returns the elements of list l structured according to the given structure.
A structure is represented by a list whose elements are either
`None` or a non-negative integer. `None` corresponds to a single
element in the output list, and an integer N corresponds to a nested
l... | [
"def",
"_Restructure",
"(",
"l",
",",
"structure",
")",
":",
"result",
"=",
"[",
"]",
"current_index",
"=",
"0",
"for",
"element",
"in",
"structure",
":",
"if",
"element",
"is",
"None",
":",
"result",
".",
"append",
"(",
"l",
"[",
"current_index",
"]",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/op_def_library.py#L91-L137 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/distutils/command/install.py | python | install.run | (self) | Runs the command. | Runs the command. | [
"Runs",
"the",
"command",
"."
] | def run(self):
"""Runs the command."""
# Obviously have to build before we can install
if not self.skip_build:
self.run_command('build')
# If we built for any other platform, we can't install.
build_plat = self.distribution.get_command_obj('build').plat_name
... | [
"def",
"run",
"(",
"self",
")",
":",
"# Obviously have to build before we can install",
"if",
"not",
"self",
".",
"skip_build",
":",
"self",
".",
"run_command",
"(",
"'build'",
")",
"# If we built for any other platform, we can't install.",
"build_plat",
"=",
"self",
".... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/command/install.py#L541-L583 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/formats/style.py | python | Styler._bar | (s, align, colors, width=100, vmin=None, vmax=None) | Draw bar chart in dataframe cells. | Draw bar chart in dataframe cells. | [
"Draw",
"bar",
"chart",
"in",
"dataframe",
"cells",
"."
] | def _bar(s, align, colors, width=100, vmin=None, vmax=None):
"""
Draw bar chart in dataframe cells.
"""
# Get input value range.
smin = np.nanmin(s.to_numpy()) if vmin is None else vmin
smax = np.nanmax(s.to_numpy()) if vmax is None else vmax
if align == "mid":
... | [
"def",
"_bar",
"(",
"s",
",",
"align",
",",
"colors",
",",
"width",
"=",
"100",
",",
"vmin",
"=",
"None",
",",
"vmax",
"=",
"None",
")",
":",
"# Get input value range.",
"smin",
"=",
"np",
".",
"nanmin",
"(",
"s",
".",
"to_numpy",
"(",
")",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/formats/style.py#L1160-L1210 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/models/alert.py | python | _GetTestSuiteFromKey | (test_key) | return pairs[2][1] | Gets test suite from |test_key|, None if not found. | Gets test suite from |test_key|, None if not found. | [
"Gets",
"test",
"suite",
"from",
"|test_key|",
"None",
"if",
"not",
"found",
"."
] | def _GetTestSuiteFromKey(test_key):
"""Gets test suite from |test_key|, None if not found."""
pairs = test_key.pairs()
if len(pairs) < 3:
return None
return pairs[2][1] | [
"def",
"_GetTestSuiteFromKey",
"(",
"test_key",
")",
":",
"pairs",
"=",
"test_key",
".",
"pairs",
"(",
")",
"if",
"len",
"(",
"pairs",
")",
"<",
"3",
":",
"return",
"None",
"return",
"pairs",
"[",
"2",
"]",
"[",
"1",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/models/alert.py#L144-L149 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/regions.py | python | BaseEndpointResolver.get_available_partitions | (self) | Lists the partitions available to the endpoint resolver.
:return: Returns a list of partition names (e.g., ["aws", "aws-cn"]). | Lists the partitions available to the endpoint resolver. | [
"Lists",
"the",
"partitions",
"available",
"to",
"the",
"endpoint",
"resolver",
"."
] | def get_available_partitions(self):
"""Lists the partitions available to the endpoint resolver.
:return: Returns a list of partition names (e.g., ["aws", "aws-cn"]).
"""
raise NotImplementedError | [
"def",
"get_available_partitions",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/regions.py#L60-L65 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/rsa/rsa/util.py | python | private_to_public | () | Reads a private key and outputs the corresponding public key. | Reads a private key and outputs the corresponding public key. | [
"Reads",
"a",
"private",
"key",
"and",
"outputs",
"the",
"corresponding",
"public",
"key",
"."
] | def private_to_public():
'''Reads a private key and outputs the corresponding public key.'''
# Parse the CLI options
parser = OptionParser(usage='usage: %prog [options]',
description='Reads a private key and outputs the '
'corresponding public key. Both private and public keys use '... | [
"def",
"private_to_public",
"(",
")",
":",
"# Parse the CLI options",
"parser",
"=",
"OptionParser",
"(",
"usage",
"=",
"'usage: %prog [options]'",
",",
"description",
"=",
"'Reads a private key and outputs the '",
"'corresponding public key. Both private and public keys use '",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/rsa/rsa/util.py#L26-L79 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py | python | Metrowerks_Shell_Suite_Events.Set_Project_File | (self, _object, _attributes={}, **_arguments) | Set Project File: Changes the settings for a given file in the project.
Required argument: The name of the file
Keyword argument to: The new settings for the file
Keyword argument _attributes: AppleEvent attribute dictionary | Set Project File: Changes the settings for a given file in the project.
Required argument: The name of the file
Keyword argument to: The new settings for the file
Keyword argument _attributes: AppleEvent attribute dictionary | [
"Set",
"Project",
"File",
":",
"Changes",
"the",
"settings",
"for",
"a",
"given",
"file",
"in",
"the",
"project",
".",
"Required",
"argument",
":",
"The",
"name",
"of",
"the",
"file",
"Keyword",
"argument",
"to",
":",
"The",
"new",
"settings",
"for",
"th... | def Set_Project_File(self, _object, _attributes={}, **_arguments):
"""Set Project File: Changes the settings for a given file in the project.
Required argument: The name of the file
Keyword argument to: The new settings for the file
Keyword argument _attributes: AppleEvent attribute dict... | [
"def",
"Set_Project_File",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MMPR'",
"_subcode",
"=",
"'SFil'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L700-L719 | ||
vtraag/leidenalg | b53366829360e10922a2dbf57eb405a516c23bc9 | src/leidenalg/Optimiser.py | python | Optimiser.refine_consider_comms | (self) | return _c_leiden._Optimiser_get_refine_consider_comms(self._optimiser) | Determine how alternative communities are considered for moving
a node when *refining* a partition.
Nodes will only move to alternative communities that improve the given
quality function.
Notes
-------
This attribute should be set to one of the following values
* :attr:`leidenalg.ALL_NEI... | Determine how alternative communities are considered for moving
a node when *refining* a partition. | [
"Determine",
"how",
"alternative",
"communities",
"are",
"considered",
"for",
"moving",
"a",
"node",
"when",
"*",
"refining",
"*",
"a",
"partition",
"."
] | def refine_consider_comms(self):
""" Determine how alternative communities are considered for moving
a node when *refining* a partition.
Nodes will only move to alternative communities that improve the given
quality function.
Notes
-------
This attribute should be set to one of the followi... | [
"def",
"refine_consider_comms",
"(",
"self",
")",
":",
"return",
"_c_leiden",
".",
"_Optimiser_get_refine_consider_comms",
"(",
"self",
".",
"_optimiser",
")"
] | https://github.com/vtraag/leidenalg/blob/b53366829360e10922a2dbf57eb405a516c23bc9/src/leidenalg/Optimiser.py#L115-L143 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/distribute/multi_worker_training_state.py | python | MultiWorkerTrainingState.delete_backup | (self) | Delete the backup directories.
Delete the backup directories which should not exist after `fit()`
successfully finishes. | Delete the backup directories. | [
"Delete",
"the",
"backup",
"directories",
"."
] | def delete_backup(self):
"""Delete the backup directories.
Delete the backup directories which should not exist after `fit()`
successfully finishes.
"""
self._assert_in_multi_worker_mode()
tracking.AutoTrackable.__delattr__(self._model, CKPT_SAVED_EPOCH)
if multi_worker_util.should_save_che... | [
"def",
"delete_backup",
"(",
"self",
")",
":",
"self",
".",
"_assert_in_multi_worker_mode",
"(",
")",
"tracking",
".",
"AutoTrackable",
".",
"__delattr__",
"(",
"self",
".",
"_model",
",",
"CKPT_SAVED_EPOCH",
")",
"if",
"multi_worker_util",
".",
"should_save_check... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/distribute/multi_worker_training_state.py#L154-L165 | ||
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/encoder.py | python | GroupSizer | (field_number, is_repeated, is_packed) | Returns a sizer for a group field. | Returns a sizer for a group field. | [
"Returns",
"a",
"sizer",
"for",
"a",
"group",
"field",
"."
] | def GroupSizer(field_number, is_repeated, is_packed):
"""Returns a sizer for a group field."""
tag_size = _TagSize(field_number) * 2
assert not is_packed
if is_repeated:
def RepeatedFieldSize(value):
result = tag_size * len(value)
for element in value:
result += element.ByteSize()
... | [
"def",
"GroupSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"*",
"2",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
":",
"def",
"RepeatedFieldSize",
"(",
"value",
")",
... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/encoder.py#L272-L287 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/optimizer.py | python | PipelineOptimizer._mv_head_recv | (self, program) | A pass to move the recv op to the beginning of
the forward/backward phase | A pass to move the recv op to the beginning of
the forward/backward phase | [
"A",
"pass",
"to",
"move",
"the",
"recv",
"op",
"to",
"the",
"beginning",
"of",
"the",
"forward",
"/",
"backward",
"phase"
] | def _mv_head_recv(self, program):
"""
A pass to move the recv op to the beginning of
the forward/backward phase
"""
forward_insert_index = 0
backward_insert_index = None
block = program.global_block()
num_ops = len(program.global_block().ops)
for i... | [
"def",
"_mv_head_recv",
"(",
"self",
",",
"program",
")",
":",
"forward_insert_index",
"=",
"0",
"backward_insert_index",
"=",
"None",
"block",
"=",
"program",
".",
"global_block",
"(",
")",
"num_ops",
"=",
"len",
"(",
"program",
".",
"global_block",
"(",
")... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/optimizer.py#L5860-L5907 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel.get_element_block_dimension | (self, element_block_id) | Return the dimension of elements within this element block.
If this cannot be determined, return -1. | Return the dimension of elements within this element block. | [
"Return",
"the",
"dimension",
"of",
"elements",
"within",
"this",
"element",
"block",
"."
] | def get_element_block_dimension(self, element_block_id):
"""
Return the dimension of elements within this element block.
If this cannot be determined, return -1.
"""
[element_block_id] = self._format_element_block_id_list(
[element_block_id],
single=True)... | [
"def",
"get_element_block_dimension",
"(",
"self",
",",
"element_block_id",
")",
":",
"[",
"element_block_id",
"]",
"=",
"self",
".",
"_format_element_block_id_list",
"(",
"[",
"element_block_id",
"]",
",",
"single",
"=",
"True",
")",
"element_type",
"=",
"self",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L1977-L1992 | ||
rsocket/rsocket-cpp | 45ed594ebd6701f40795c31ec922d784ec7fc921 | build/fbcode_builder/getdeps/dyndeps.py | python | WinDeps.compute_dependency_paths | (self, build_dir) | return sorted(dep_dirs) | Return a list of all directories that need to be added to $PATH to ensure
that library dependencies can be found correctly. This is computed by scanning
binaries to determine exactly the right list of dependencies.
The compute_dependency_paths_fast() is a alternative function that runs faster
... | Return a list of all directories that need to be added to $PATH to ensure
that library dependencies can be found correctly. This is computed by scanning
binaries to determine exactly the right list of dependencies. | [
"Return",
"a",
"list",
"of",
"all",
"directories",
"that",
"need",
"to",
"be",
"added",
"to",
"$PATH",
"to",
"ensure",
"that",
"library",
"dependencies",
"can",
"be",
"found",
"correctly",
".",
"This",
"is",
"computed",
"by",
"scanning",
"binaries",
"to",
... | def compute_dependency_paths(self, build_dir):
"""Return a list of all directories that need to be added to $PATH to ensure
that library dependencies can be found correctly. This is computed by scanning
binaries to determine exactly the right list of dependencies.
The compute_dependenc... | [
"def",
"compute_dependency_paths",
"(",
"self",
",",
"build_dir",
")",
":",
"dep_dirs",
"=",
"set",
"(",
")",
"# Find paths by scanning the binaries.",
"for",
"dep",
"in",
"self",
".",
"find_all_dependencies",
"(",
"build_dir",
")",
":",
"dep_dirs",
".",
"add",
... | https://github.com/rsocket/rsocket-cpp/blob/45ed594ebd6701f40795c31ec922d784ec7fc921/build/fbcode_builder/getdeps/dyndeps.py#L251-L265 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/managers.py | python | BaseProxy._callmethod | (self, methodname, args=(), kwds={}) | Try to call a method of the referrent and return a copy of the result | Try to call a method of the referrent and return a copy of the result | [
"Try",
"to",
"call",
"a",
"method",
"of",
"the",
"referrent",
"and",
"return",
"a",
"copy",
"of",
"the",
"result"
] | def _callmethod(self, methodname, args=(), kwds={}):
'''
Try to call a method of the referrent and return a copy of the result
'''
try:
conn = self._tls.connection
except AttributeError:
util.debug('thread %r does not own a connection',
... | [
"def",
"_callmethod",
"(",
"self",
",",
"methodname",
",",
"args",
"=",
"(",
")",
",",
"kwds",
"=",
"{",
"}",
")",
":",
"try",
":",
"conn",
"=",
"self",
".",
"_tls",
".",
"connection",
"except",
"AttributeError",
":",
"util",
".",
"debug",
"(",
"'t... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/managers.py#L746-L773 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlDoc.docEntity | (self, name) | return __tmp | Do an entity lookup in the document entity hash table and | Do an entity lookup in the document entity hash table and | [
"Do",
"an",
"entity",
"lookup",
"in",
"the",
"document",
"entity",
"hash",
"table",
"and"
] | def docEntity(self, name):
"""Do an entity lookup in the document entity hash table and """
ret = libxml2mod.xmlGetDocEntity(self._o, name)
if ret is None:raise treeError('xmlGetDocEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp | [
"def",
"docEntity",
"(",
"self",
",",
"name",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlGetDocEntity",
"(",
"self",
".",
"_o",
",",
"name",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlGetDocEntity() failed'",
")",
"__tmp",
"="... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L3329-L3334 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/_abcoll.py | python | Set._from_iterable | (cls, it) | return cls(it) | Construct an instance of the class from any iterable input.
Must override this method if the class constructor signature
does not accept an iterable for an input. | Construct an instance of the class from any iterable input. | [
"Construct",
"an",
"instance",
"of",
"the",
"class",
"from",
"any",
"iterable",
"input",
"."
] | def _from_iterable(cls, it):
'''Construct an instance of the class from any iterable input.
Must override this method if the class constructor signature
does not accept an iterable for an input.
'''
return cls(it) | [
"def",
"_from_iterable",
"(",
"cls",
",",
"it",
")",
":",
"return",
"cls",
"(",
"it",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/_abcoll.py#L189-L195 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/vis/visualization.py | python | debug | (*args,**kwargs) | A super easy way to visualize Klamp't items.
The argument list can be a list of Klamp't items, and can also include
strings or dicts. If a string precedes an item, then it will be labeled
by the string. If a dict follows an item, the dict will specify
attributes for the item. It can also contain th... | A super easy way to visualize Klamp't items. | [
"A",
"super",
"easy",
"way",
"to",
"visualize",
"Klamp",
"t",
"items",
"."
] | def debug(*args,**kwargs):
"""A super easy way to visualize Klamp't items.
The argument list can be a list of Klamp't items, and can also include
strings or dicts. If a string precedes an item, then it will be labeled
by the string. If a dict follows an item, the dict will specify
attributes for... | [
"def",
"debug",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"global",
"_backend",
"_init",
"(",
")",
"oldWindow",
"=",
"getWindow",
"(",
")",
"if",
"oldWindow",
"is",
"None",
":",
"oldWindow",
"=",
"0",
"myWindow",
"=",
"createWindow",
"(",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L713-L878 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/dateutil/parser/_parser.py | python | parserinfo.convertyear | (self, year, century_specified=False) | return year | Converts two-digit years to year within [-50, 49]
range of self._year (current local time) | Converts two-digit years to year within [-50, 49]
range of self._year (current local time) | [
"Converts",
"two",
"-",
"digit",
"years",
"to",
"year",
"within",
"[",
"-",
"50",
"49",
"]",
"range",
"of",
"self",
".",
"_year",
"(",
"current",
"local",
"time",
")"
] | def convertyear(self, year, century_specified=False):
"""
Converts two-digit years to year within [-50, 49]
range of self._year (current local time)
"""
# Function contract is that the year is always positive
assert year >= 0
if year < 100 and not century_specif... | [
"def",
"convertyear",
"(",
"self",
",",
"year",
",",
"century_specified",
"=",
"False",
")",
":",
"# Function contract is that the year is always positive",
"assert",
"year",
">=",
"0",
"if",
"year",
"<",
"100",
"and",
"not",
"century_specified",
":",
"# assume curr... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/dateutil/parser/_parser.py#L366-L384 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/serialcli.py | python | Serial._update_break_state | (self) | Set break: Controls TXD. When active, to transmitting is possible. | Set break: Controls TXD. When active, to transmitting is possible. | [
"Set",
"break",
":",
"Controls",
"TXD",
".",
"When",
"active",
"to",
"transmitting",
"is",
"possible",
"."
] | def _update_break_state(self):
"""
Set break: Controls TXD. When active, to transmitting is possible.
"""
if not self.is_open:
raise portNotOpenError
self._port_handle.BreakState = bool(self._break_state) | [
"def",
"_update_break_state",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"self",
".",
"_port_handle",
".",
"BreakState",
"=",
"bool",
"(",
"self",
".",
"_break_state",
")"
] | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialcli.py#L201-L207 | ||
google/certificate-transparency | 2588562fd306a447958471b6f06c1069619c1641 | python/ct/client/db/sqlite_connection.py | python | SQLiteConnection.__exit__ | (self, exc_type, exc_value, traceback) | return ret | Commit or rollback, and close the connection. | Commit or rollback, and close the connection. | [
"Commit",
"or",
"rollback",
"and",
"close",
"the",
"connection",
"."
] | def __exit__(self, exc_type, exc_value, traceback):
"""Commit or rollback, and close the connection."""
ret = self.__conn.__exit__(exc_type, exc_value, traceback)
if not self.__keepalive:
self.__conn.close()
return ret | [
"def",
"__exit__",
"(",
"self",
",",
"exc_type",
",",
"exc_value",
",",
"traceback",
")",
":",
"ret",
"=",
"self",
".",
"__conn",
".",
"__exit__",
"(",
"exc_type",
",",
"exc_value",
",",
"traceback",
")",
"if",
"not",
"self",
".",
"__keepalive",
":",
"... | https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/client/db/sqlite_connection.py#L42-L47 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/symbol/numpy/_symbol.py | python | hstack | (arrays) | return _npi.hstack(*arrays) | Stack arrays in sequence horizontally (column wise).
This is equivalent to concatenation along the second axis,
except for 1-D arrays where it concatenates along the first axis.
Rebuilds arrays divided by hsplit.
This function makes most sense for arrays with up to 3 dimensions.
For instance, for pi... | Stack arrays in sequence horizontally (column wise).
This is equivalent to concatenation along the second axis,
except for 1-D arrays where it concatenates along the first axis.
Rebuilds arrays divided by hsplit.
This function makes most sense for arrays with up to 3 dimensions.
For instance, for pi... | [
"Stack",
"arrays",
"in",
"sequence",
"horizontally",
"(",
"column",
"wise",
")",
".",
"This",
"is",
"equivalent",
"to",
"concatenation",
"along",
"the",
"second",
"axis",
"except",
"for",
"1",
"-",
"D",
"arrays",
"where",
"it",
"concatenates",
"along",
"the"... | def hstack(arrays):
"""
Stack arrays in sequence horizontally (column wise).
This is equivalent to concatenation along the second axis,
except for 1-D arrays where it concatenates along the first axis.
Rebuilds arrays divided by hsplit.
This function makes most sense for arrays with up to 3 dime... | [
"def",
"hstack",
"(",
"arrays",
")",
":",
"return",
"_npi",
".",
"hstack",
"(",
"*",
"arrays",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L4450-L4485 | |
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | tools/blade/src/blade/dependency_analyzer.py | python | analyze_deps | (related_targets) | return keys_list_sorted | analyze the dependency relationship between targets.
Input: related targets after loading targets from BUILD files.
{(target_path, target_name) : (target_data), ...}
Output:the targets that are expanded and the keys sorted
[all the targets keys] - sorted
{(target_path, target_... | analyze the dependency relationship between targets. | [
"analyze",
"the",
"dependency",
"relationship",
"between",
"targets",
"."
] | def analyze_deps(related_targets):
"""analyze the dependency relationship between targets.
Input: related targets after loading targets from BUILD files.
{(target_path, target_name) : (target_data), ...}
Output:the targets that are expanded and the keys sorted
[all the targets keys] ... | [
"def",
"analyze_deps",
"(",
"related_targets",
")",
":",
"_expand_deps",
"(",
"related_targets",
")",
"keys_list_sorted",
"=",
"_topological_sort",
"(",
"related_targets",
")",
"return",
"keys_list_sorted"
] | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/dependency_analyzer.py#L24-L38 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/_compat.py | python | with_metaclass | (meta, *bases) | return type.__new__(metaclass, 'temporary_class', (), {}) | Create a base class with a metaclass. | Create a base class with a metaclass. | [
"Create",
"a",
"base",
"class",
"with",
"a",
"metaclass",
"."
] | def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instantiation that replaces
# itself with the actual metaclass.
class metaclass(type):
def __new__(cls, nam... | [
"def",
"with_metaclass",
"(",
"meta",
",",
"*",
"bases",
")",
":",
"# This requires a bit of explanation: the basic idea is to make a",
"# dummy metaclass for one level of class instantiation that replaces",
"# itself with the actual metaclass.",
"class",
"metaclass",
"(",
"type",
")... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/_compat.py#L85-L93 | |
desura/desura-app | 4f92740cc6bdf356613a76cc281a4f5d0b22e2f2 | third_party/courgette/tools/patch_util.py | python | PatchInfo.__init__ | (self, stream=None) | parse incoming stream | parse incoming stream | [
"parse",
"incoming",
"stream"
] | def __init__(self, stream=None):
""" parse incoming stream """
# define PatchInfo data members
# table with a row for every source file
#: list of source filenames
self.source=None
self.target=None
#: list of lists of hunks
self.hunks=None
#: file endings statistics for every hunk
... | [
"def",
"__init__",
"(",
"self",
",",
"stream",
"=",
"None",
")",
":",
"# define PatchInfo data members",
"# table with a row for every source file",
"#: list of source filenames",
"self",
".",
"source",
"=",
"None",
"self",
".",
"target",
"=",
"None",
"#: list of lists ... | https://github.com/desura/desura-app/blob/4f92740cc6bdf356613a76cc281a4f5d0b22e2f2/third_party/courgette/tools/patch_util.py#L84-L99 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | uCSIsYiSyllables | (code) | return ret | Check whether the character is part of YiSyllables UCS Block | Check whether the character is part of YiSyllables UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"YiSyllables",
"UCS",
"Block"
] | def uCSIsYiSyllables(code):
"""Check whether the character is part of YiSyllables UCS Block """
ret = libxml2mod.xmlUCSIsYiSyllables(code)
return ret | [
"def",
"uCSIsYiSyllables",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsYiSyllables",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2986-L2989 | |
intel/linux-sgx | 2ee53db4e8fd25437a817612d3bcb94b66a28373 | sdk/debugger_interface/linux/gdb-sgx-plugin/printers.py | python | _typename_with_n_generic_arguments | (gdb_type, n) | return result | Return a string for the type with the first n (1, ...) generic args. | Return a string for the type with the first n (1, ...) generic args. | [
"Return",
"a",
"string",
"for",
"the",
"type",
"with",
"the",
"first",
"n",
"(",
"1",
"...",
")",
"generic",
"args",
"."
] | def _typename_with_n_generic_arguments(gdb_type, n):
"""Return a string for the type with the first n (1, ...) generic args."""
base_type = _remove_generics(_prettify_typename(gdb_type))
arg_list = [base_type]
template = "%s<"
for i in range(n):
arg_list.append(_typename_for_nth_generic_arg... | [
"def",
"_typename_with_n_generic_arguments",
"(",
"gdb_type",
",",
"n",
")",
":",
"base_type",
"=",
"_remove_generics",
"(",
"_prettify_typename",
"(",
"gdb_type",
")",
")",
"arg_list",
"=",
"[",
"base_type",
"]",
"template",
"=",
"\"%s<\"",
"for",
"i",
"in",
... | https://github.com/intel/linux-sgx/blob/2ee53db4e8fd25437a817612d3bcb94b66a28373/sdk/debugger_interface/linux/gdb-sgx-plugin/printers.py#L170-L180 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | GraphicsMatrix.Scale | (*args, **kwargs) | return _gdi_.GraphicsMatrix_Scale(*args, **kwargs) | Scale(self, Double xScale, Double yScale)
Scales this matrix. | Scale(self, Double xScale, Double yScale) | [
"Scale",
"(",
"self",
"Double",
"xScale",
"Double",
"yScale",
")"
] | def Scale(*args, **kwargs):
"""
Scale(self, Double xScale, Double yScale)
Scales this matrix.
"""
return _gdi_.GraphicsMatrix_Scale(*args, **kwargs) | [
"def",
"Scale",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsMatrix_Scale",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L5643-L5649 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/backend.py | python | local_conv1d | (inputs, kernel, kernel_size, strides, data_format=None) | return local_conv(inputs,
kernel,
kernel_size,
strides,
output_shape,
data_format) | Apply 1D conv with un-shared weights.
Args:
inputs: 3D tensor with shape:
(batch_size, steps, input_dim)
if data_format is "channels_last" or
(batch_size, input_dim, steps)
if data_format is "channels_first".
kernel: the unshared weight for convolution,
w... | Apply 1D conv with un-shared weights. | [
"Apply",
"1D",
"conv",
"with",
"un",
"-",
"shared",
"weights",
"."
] | def local_conv1d(inputs, kernel, kernel_size, strides, data_format=None):
"""Apply 1D conv with un-shared weights.
Args:
inputs: 3D tensor with shape:
(batch_size, steps, input_dim)
if data_format is "channels_last" or
(batch_size, input_dim, steps)
if data_format is "... | [
"def",
"local_conv1d",
"(",
"inputs",
",",
"kernel",
",",
"kernel_size",
",",
"strides",
",",
"data_format",
"=",
"None",
")",
":",
"output_shape",
"=",
"(",
"kernel",
".",
"shape",
"[",
"0",
"]",
",",
")",
"return",
"local_conv",
"(",
"inputs",
",",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/backend.py#L5900-L5931 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/contrib/imports/mirobridge/mirobridge/metadata.py | python | MetaData.getMetadata | (self, title) | return ttvdbGraphics | Find existing graphics for a Miro video.
return a dictionary of metadata | Find existing graphics for a Miro video.
return a dictionary of metadata | [
"Find",
"existing",
"graphics",
"for",
"a",
"Miro",
"video",
".",
"return",
"a",
"dictionary",
"of",
"metadata"
] | def getMetadata(self, title):
"""Find existing graphics for a Miro video.
return a dictionary of metadata
"""
ttvdbGraphics = {'inetref': u'', 'coverart': u'', 'banner': u'', 'fanart': u'', } # Initalize dictionary of graphics
# Check for an existing Record Rule for this Miro Ch... | [
"def",
"getMetadata",
"(",
"self",
",",
"title",
")",
":",
"ttvdbGraphics",
"=",
"{",
"'inetref'",
":",
"u''",
",",
"'coverart'",
":",
"u''",
",",
"'banner'",
":",
"u''",
",",
"'fanart'",
":",
"u''",
",",
"}",
"# Initalize dictionary of graphics",
"# Check f... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/contrib/imports/mirobridge/mirobridge/metadata.py#L160-L198 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/xgettext.py | python | _pot_update_emitter | (target, source, env) | return target, source | Emitter function for `POTUpdate` builder | Emitter function for `POTUpdate` builder | [
"Emitter",
"function",
"for",
"POTUpdate",
"builder"
] | def _pot_update_emitter(target, source, env):
""" Emitter function for `POTUpdate` builder """
from SCons.Tool.GettextCommon import _POTargetFactory
import SCons.Util
import SCons.Node.FS
if 'XGETTEXTFROM' in env:
xfrom = env['XGETTEXTFROM']
else:
return target, source
if no... | [
"def",
"_pot_update_emitter",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"from",
"SCons",
".",
"Tool",
".",
"GettextCommon",
"import",
"_POTargetFactory",
"import",
"SCons",
".",
"Util",
"import",
"SCons",
".",
"Node",
".",
"FS",
"if",
"'XGETTEXTFRO... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/xgettext.py#L231-L258 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/__init__.py | python | LoggerAdapter.error | (self, msg, *args, **kwargs) | Delegate an error call to the underlying logger, after adding
contextual information from this adapter instance. | Delegate an error call to the underlying logger, after adding
contextual information from this adapter instance. | [
"Delegate",
"an",
"error",
"call",
"to",
"the",
"underlying",
"logger",
"after",
"adding",
"contextual",
"information",
"from",
"this",
"adapter",
"instance",
"."
] | def error(self, msg, *args, **kwargs):
"""
Delegate an error call to the underlying logger, after adding
contextual information from this adapter instance.
"""
msg, kwargs = self.process(msg, kwargs)
self.logger.error(msg, *args, **kwargs) | [
"def",
"error",
"(",
"self",
",",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"msg",
",",
"kwargs",
"=",
"self",
".",
"process",
"(",
"msg",
",",
"kwargs",
")",
"self",
".",
"logger",
".",
"error",
"(",
"msg",
",",
"*",
"args",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/__init__.py#L1440-L1446 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | mp/src/thirdparty/protobuf-2.3.0/python/mox.py | python | Verify | (*args) | Verify mocks.
Args:
# args is any number of mocks to be verified. | Verify mocks. | [
"Verify",
"mocks",
"."
] | def Verify(*args):
"""Verify mocks.
Args:
# args is any number of mocks to be verified.
"""
for mock in args:
mock._Verify() | [
"def",
"Verify",
"(",
"*",
"args",
")",
":",
"for",
"mock",
"in",
"args",
":",
"mock",
".",
"_Verify",
"(",
")"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/mox.py#L246-L254 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/projectrecovery/projectrecoverysaver.py | python | ProjectRecoverySaver.stop_recovery_thread | (self) | Cancels the recovery thread if it is running | Cancels the recovery thread if it is running | [
"Cancels",
"the",
"recovery",
"thread",
"if",
"it",
"is",
"running"
] | def stop_recovery_thread(self):
"""
Cancels the recovery thread if it is running
"""
if self._timer_thread is not None:
self._timer_thread.cancel()
self.pr.thread_on = False | [
"def",
"stop_recovery_thread",
"(",
"self",
")",
":",
"if",
"self",
".",
"_timer_thread",
"is",
"not",
"None",
":",
"self",
".",
"_timer_thread",
".",
"cancel",
"(",
")",
"self",
".",
"pr",
".",
"thread_on",
"=",
"False"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/projectrecovery/projectrecoverysaver.py#L203-L209 | ||
eric612/MobileNet-YOLO | 69b4441cb3ec8d553fbdef788ad033e246f901bd | scripts/cpp_lint.py | python | FileInfo.RepositoryName | (self) | return fullname | FullName after removing the local path to the repository.
If we have a real absolute path name here we can try to do something smart:
detecting the root of the checkout and truncating /path/to/checkout from
the name so that we get header guards that don't include things like
"C:\Documents and Settings\... | FullName after removing the local path to the repository. | [
"FullName",
"after",
"removing",
"the",
"local",
"path",
"to",
"the",
"repository",
"."
] | def RepositoryName(self):
"""FullName after removing the local path to the repository.
If we have a real absolute path name here we can try to do something smart:
detecting the root of the checkout and truncating /path/to/checkout from
the name so that we get header guards that don't include things lik... | [
"def",
"RepositoryName",
"(",
"self",
")",
":",
"fullname",
"=",
"self",
".",
"FullName",
"(",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"fullname",
")",
":",
"project_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"fullname",
")",
"if",
... | https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/scripts/cpp_lint.py#L889-L932 | |
nasa/trick | 7b85aa66329d62fe8816462627c09a353aac8299 | share/trick/pymods/trick/variable_server.py | python | VariableServer.validate_addresses | (self, validate=True, channel=Channel.BOTH) | Set whether or not addresses are validated.
When bool(validate) is True, variable addresses will be
validated against the memory manager before being read. Those
not known to Trick are considered invalid and their values are
reported as "BAD_REF". This prevents malformed variable
... | Set whether or not addresses are validated. | [
"Set",
"whether",
"or",
"not",
"addresses",
"are",
"validated",
"."
] | def validate_addresses(self, validate=True, channel=Channel.BOTH):
"""
Set whether or not addresses are validated.
When bool(validate) is True, variable addresses will be
validated against the memory manager before being read. Those
not known to Trick are considered invalid and ... | [
"def",
"validate_addresses",
"(",
"self",
",",
"validate",
"=",
"True",
",",
"channel",
"=",
"Channel",
".",
"BOTH",
")",
":",
"self",
".",
"send",
"(",
"'trick.var_validate_address({0})'",
".",
"format",
"(",
"bool",
"(",
"validate",
")",
")",
",",
"chann... | https://github.com/nasa/trick/blob/7b85aa66329d62fe8816462627c09a353aac8299/share/trick/pymods/trick/variable_server.py#L770-L789 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xmlNode.freeNodeList | (self) | Free a node and all its siblings, this is a recursive
behaviour, all the children are freed too. | Free a node and all its siblings, this is a recursive
behaviour, all the children are freed too. | [
"Free",
"a",
"node",
"and",
"all",
"its",
"siblings",
"this",
"is",
"a",
"recursive",
"behaviour",
"all",
"the",
"children",
"are",
"freed",
"too",
"."
] | def freeNodeList(self):
"""Free a node and all its siblings, this is a recursive
behaviour, all the children are freed too. """
libxml2mod.xmlFreeNodeList(self._o) | [
"def",
"freeNodeList",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlFreeNodeList",
"(",
"self",
".",
"_o",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3231-L3234 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/fast_gelu_ds.py | python | _fast_gelu_ds_tbe | () | return | FastGeLU TBE register | FastGeLU TBE register | [
"FastGeLU",
"TBE",
"register"
] | def _fast_gelu_ds_tbe():
"""FastGeLU TBE register"""
return | [
"def",
"_fast_gelu_ds_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/fast_gelu_ds.py#L36-L38 | |
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp3/ctptd.py | python | CtpTd.onRspQryExchangeMarginRate | (self, ExchangeMarginRateField, RspInfoField, requestId, final) | 请求查询交易所保证金率响应 | 请求查询交易所保证金率响应 | [
"请求查询交易所保证金率响应"
] | def onRspQryExchangeMarginRate(self, ExchangeMarginRateField, RspInfoField, requestId, final):
"""请求查询交易所保证金率响应"""
pass | [
"def",
"onRspQryExchangeMarginRate",
"(",
"self",
",",
"ExchangeMarginRateField",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp3/ctptd.py#L274-L276 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/profiler.py | python | Counter.increment | (self, delta=1) | Increment counter value.
Parameters
----------
value_change : int
Amount by which to add to the counter | Increment counter value. | [
"Increment",
"counter",
"value",
"."
] | def increment(self, delta=1):
"""Increment counter value.
Parameters
----------
value_change : int
Amount by which to add to the counter
"""
check_call(_LIB.MXProfileAdjustCounter(self.handle, int(delta))) | [
"def",
"increment",
"(",
"self",
",",
"delta",
"=",
"1",
")",
":",
"check_call",
"(",
"_LIB",
".",
"MXProfileAdjustCounter",
"(",
"self",
".",
"handle",
",",
"int",
"(",
"delta",
")",
")",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/profiler.py#L442-L450 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBThreadPlan.GetStopReason | (self) | return _lldb.SBThreadPlan_GetStopReason(self) | GetStopReason(self) -> StopReason | GetStopReason(self) -> StopReason | [
"GetStopReason",
"(",
"self",
")",
"-",
">",
"StopReason"
] | def GetStopReason(self):
"""GetStopReason(self) -> StopReason"""
return _lldb.SBThreadPlan_GetStopReason(self) | [
"def",
"GetStopReason",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBThreadPlan_GetStopReason",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10053-L10055 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/mox.py | python | MockObject.__init__ | (self, class_to_mock) | Initialize a mock object.
This determines the methods and properties of the class and stores them.
Args:
# class_to_mock: class to be mocked
class_to_mock: class | Initialize a mock object. | [
"Initialize",
"a",
"mock",
"object",
"."
] | def __init__(self, class_to_mock):
"""Initialize a mock object.
This determines the methods and properties of the class and stores them.
Args:
# class_to_mock: class to be mocked
class_to_mock: class
"""
# This is used to hack around the mixin/inheritance of MockAnything, which
# ... | [
"def",
"__init__",
"(",
"self",
",",
"class_to_mock",
")",
":",
"# This is used to hack around the mixin/inheritance of MockAnything, which",
"# is not a proper object (it can be anything. :-)",
"MockAnything",
".",
"__dict__",
"[",
"'__init__'",
"]",
"(",
"self",
")",
"# Get a... | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L362-L384 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/flock_tool.py | python | FlockTool.ExecFlock | (self, lockfile, *cmd_list) | return subprocess.call(cmd_list) | Emulates the most basic behavior of Linux's flock(1). | Emulates the most basic behavior of Linux's flock(1). | [
"Emulates",
"the",
"most",
"basic",
"behavior",
"of",
"Linux",
"s",
"flock",
"(",
"1",
")",
"."
] | def ExecFlock(self, lockfile, *cmd_list):
"""Emulates the most basic behavior of Linux's flock(1)."""
# Rely on exception handling to report errors.
# Note that the stock python on SunOS has a bug
# where fcntl.flock(fd, LOCK_EX) always fails
# with EBADF, that's why we use this F_SETLK
# hack i... | [
"def",
"ExecFlock",
"(",
"self",
",",
"lockfile",
",",
"*",
"cmd_list",
")",
":",
"# Rely on exception handling to report errors.",
"# Note that the stock python on SunOS has a bug",
"# where fcntl.flock(fd, LOCK_EX) always fails",
"# with EBADF, that's why we use this F_SETLK",
"# hac... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/flock_tool.py#L35-L50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.