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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/managers.py | python | BaseManager.start | (self, initializer=None, initargs=()) | Spawn a server process for this manager object | Spawn a server process for this manager object | [
"Spawn",
"a",
"server",
"process",
"for",
"this",
"manager",
"object"
] | def start(self, initializer=None, initargs=()):
'''
Spawn a server process for this manager object
'''
if self._state.value != State.INITIAL:
if self._state.value == State.STARTED:
raise ProcessError("Already started server")
elif self._state.value... | [
"def",
"start",
"(",
"self",
",",
"initializer",
"=",
"None",
",",
"initargs",
"=",
"(",
")",
")",
":",
"if",
"self",
".",
"_state",
".",
"value",
"!=",
"State",
".",
"INITIAL",
":",
"if",
"self",
".",
"_state",
".",
"value",
"==",
"State",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/managers.py#L536-L577 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/shlex.py | python | split | (s, comments=False, posix=True) | return list(lex) | Split the string *s* using shell-like syntax. | Split the string *s* using shell-like syntax. | [
"Split",
"the",
"string",
"*",
"s",
"*",
"using",
"shell",
"-",
"like",
"syntax",
"."
] | def split(s, comments=False, posix=True):
"""Split the string *s* using shell-like syntax."""
lex = shlex(s, posix=posix)
lex.whitespace_split = True
if not comments:
lex.commenters = ''
return list(lex) | [
"def",
"split",
"(",
"s",
",",
"comments",
"=",
"False",
",",
"posix",
"=",
"True",
")",
":",
"lex",
"=",
"shlex",
"(",
"s",
",",
"posix",
"=",
"posix",
")",
"lex",
".",
"whitespace_split",
"=",
"True",
"if",
"not",
"comments",
":",
"lex",
".",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/shlex.py#L304-L310 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/multiprocessing/__init__.py | python | allow_connection_pickling | () | Install support for sending connections and sockets between processes | Install support for sending connections and sockets between processes | [
"Install",
"support",
"for",
"sending",
"connections",
"and",
"sockets",
"between",
"processes"
] | def allow_connection_pickling():
'''
Install support for sending connections and sockets between processes
'''
from multiprocessing import reduction | [
"def",
"allow_connection_pickling",
"(",
")",
":",
"from",
"multiprocessing",
"import",
"reduction"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/multiprocessing/__init__.py#L156-L160 | ||
Tencent/TNN | 7acca99f54c55747b415a4c57677403eebc7b706 | third_party/flatbuffers/python/flatbuffers/flexbuffers.py | python | Builder.TypedVectorFromElements | (self, elements, element_type=None) | Encodes sequence of elements of the same type as typed vector.
Args:
elements: Sequence of elements, they must be of the same type.
element_type: Suggested element type. Setting it to None means determining
correct value automatically based on the given elements. | Encodes sequence of elements of the same type as typed vector. | [
"Encodes",
"sequence",
"of",
"elements",
"of",
"the",
"same",
"type",
"as",
"typed",
"vector",
"."
] | def TypedVectorFromElements(self, elements, element_type=None):
"""Encodes sequence of elements of the same type as typed vector.
Args:
elements: Sequence of elements, they must be of the same type.
element_type: Suggested element type. Setting it to None means determining
correct value aut... | [
"def",
"TypedVectorFromElements",
"(",
"self",
",",
"elements",
",",
"element_type",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"elements",
",",
"array",
".",
"array",
")",
":",
"if",
"elements",
".",
"typecode",
"==",
"'f'",
":",
"self",
".",
"_Wri... | https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/python/flatbuffers/flexbuffers.py#L1341-L1366 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py | python | device_path_to_device_name | (device_dir) | return "/".join([
path_item.replace("device_", "device:").replace("_", ":", 1)
for path_item in path_items]) | Parse device name from device path.
Args:
device_dir: (str) a directory name for the device.
Returns:
(str) parsed device name. | Parse device name from device path. | [
"Parse",
"device",
"name",
"from",
"device",
"path",
"."
] | def device_path_to_device_name(device_dir):
"""Parse device name from device path.
Args:
device_dir: (str) a directory name for the device.
Returns:
(str) parsed device name.
"""
path_items = os.path.basename(device_dir)[
len(METADATA_FILE_PREFIX) + len(DEVICE_TAG):].split(",")
return "/".jo... | [
"def",
"device_path_to_device_name",
"(",
"device_dir",
")",
":",
"path_items",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"device_dir",
")",
"[",
"len",
"(",
"METADATA_FILE_PREFIX",
")",
"+",
"len",
"(",
"DEVICE_TAG",
")",
":",
"]",
".",
"split",
"(",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py#L257-L270 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/_cpchecker.py | python | Checker.check_app_config_brackets | (self) | Check for Application config with extraneous brackets in section names. | Check for Application config with extraneous brackets in section names. | [
"Check",
"for",
"Application",
"config",
"with",
"extraneous",
"brackets",
"in",
"section",
"names",
"."
] | def check_app_config_brackets(self):
"""Check for Application config with extraneous brackets in section names."""
for sn, app in cherrypy.tree.apps.items():
if not isinstance(app, cherrypy.Application):
continue
if not app.config:
continue
... | [
"def",
"check_app_config_brackets",
"(",
"self",
")",
":",
"for",
"sn",
",",
"app",
"in",
"cherrypy",
".",
"tree",
".",
"apps",
".",
"items",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"app",
",",
"cherrypy",
".",
"Application",
")",
":",
"continue... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cpchecker.py#L104-L117 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/fitfunctions.py | python | FunctionWrapper.__getattr__ | (self, item) | __getattr__ invoked when attribute item not found in the instance,
nor in the class, nor its superclasses.
:param item: named attribute
:return: attribute of self.fun instance, or any of the fitting
parameters or function attributes | __getattr__ invoked when attribute item not found in the instance,
nor in the class, nor its superclasses. | [
"__getattr__",
"invoked",
"when",
"attribute",
"item",
"not",
"found",
"in",
"the",
"instance",
"nor",
"in",
"the",
"class",
"nor",
"its",
"superclasses",
"."
] | def __getattr__(self, item):
"""
__getattr__ invoked when attribute item not found in the instance,
nor in the class, nor its superclasses.
:param item: named attribute
:return: attribute of self.fun instance, or any of the fitting
parameters or function attributes
... | [
"def",
"__getattr__",
"(",
"self",
",",
"item",
")",
":",
"if",
"'fun'",
"in",
"self",
".",
"__dict__",
":",
"if",
"hasattr",
"(",
"self",
".",
"fun",
",",
"item",
")",
":",
"return",
"getattr",
"(",
"self",
".",
"fun",
",",
"item",
")",
"else",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/fitfunctions.py#L56-L69 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | uCSIsDingbats | (code) | return ret | Check whether the character is part of Dingbats UCS Block | Check whether the character is part of Dingbats UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Dingbats",
"UCS",
"Block"
] | def uCSIsDingbats(code):
"""Check whether the character is part of Dingbats UCS Block """
ret = libxml2mod.xmlUCSIsDingbats(code)
return ret | [
"def",
"uCSIsDingbats",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsDingbats",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1706-L1709 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/mailbox.py | python | Mailbox.get_file | (self, key) | Return a file-like representation or raise a KeyError. | Return a file-like representation or raise a KeyError. | [
"Return",
"a",
"file",
"-",
"like",
"representation",
"or",
"raise",
"a",
"KeyError",
"."
] | def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
raise NotImplementedError('Method must be implemented by subclass') | [
"def",
"get_file",
"(",
"self",
",",
"key",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Method must be implemented by subclass'",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mailbox.py#L88-L90 | ||
tpfister/caffe-heatmap | 4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e | scripts/cpp_lint.py | python | ProcessFileData | (filename, file_extension, lines, error,
extra_check_functions=[]) | Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
lines: An array of strings, each representing a line of the file, with the
last element being emp... | Performs lint checks and reports any errors to the given error function. | [
"Performs",
"lint",
"checks",
"and",
"reports",
"any",
"errors",
"to",
"the",
"given",
"error",
"function",
"."
] | def ProcessFileData(filename, file_extension, lines, error,
extra_check_functions=[]):
"""Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
... | [
"def",
"ProcessFileData",
"(",
"filename",
",",
"file_extension",
",",
"lines",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"lines",
"=",
"(",
"[",
"'// marker so line numbers and indices both start at 1'",
"]",
"+",
"lines",
"+",
"[",
"... | https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/scripts/cpp_lint.py#L4644-L4687 | ||
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | plugins/wb.admin/backend/wb_admin_user_privileges.py | python | PrivilegeTarget.get_target_type | (self) | return ret_val | Returns the privilege level based on the data.
Note: COLUMN is not considered at this point. | Returns the privilege level based on the data.
Note: COLUMN is not considered at this point. | [
"Returns",
"the",
"privilege",
"level",
"based",
"on",
"the",
"data",
".",
"Note",
":",
"COLUMN",
"is",
"not",
"considered",
"at",
"this",
"point",
"."
] | def get_target_type(self):
"""
Returns the privilege level based on the data.
Note: COLUMN is not considered at this point.
"""
ret_val = ''
if self.schema == '*' and self.object == '*':
ret_val = 'GLOBAL'
elif self.object != '*':
ret_v... | [
"def",
"get_target_type",
"(",
"self",
")",
":",
"ret_val",
"=",
"''",
"if",
"self",
".",
"schema",
"==",
"'*'",
"and",
"self",
".",
"object",
"==",
"'*'",
":",
"ret_val",
"=",
"'GLOBAL'",
"elif",
"self",
".",
"object",
"!=",
"'*'",
":",
"ret_val",
"... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/plugins/wb.admin/backend/wb_admin_user_privileges.py#L73-L86 | |
Caffe-MPI/Caffe-MPI.github.io | df5992af571a2a19981b69635115c393f18d1c76 | scripts/cpp_lint.py | python | _NestingState.InnermostClass | (self) | return None | Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise. | Get class info on the top of the stack. | [
"Get",
"class",
"info",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | def InnermostClass(self):
"""Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise.
"""
for i in range(len(self.stack), 0, -1):
classinfo = self.stack[i - 1]
if isinstance(classinfo, _ClassInfo):
return classinfo
r... | [
"def",
"InnermostClass",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stack",
")",
",",
"0",
",",
"-",
"1",
")",
":",
"classinfo",
"=",
"self",
".",
"stack",
"[",
"i",
"-",
"1",
"]",
"if",
"isinstance",
"(",
... | https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/scripts/cpp_lint.py#L2160-L2170 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/tools/lldb_commands.py | python | job | (debugger, param, *args) | Print a v8 heap object | Print a v8 heap object | [
"Print",
"a",
"v8",
"heap",
"object"
] | def job(debugger, param, *args):
"""Print a v8 heap object"""
ptr_arg_cmd(debugger, 'job', param, "_v8_internal_Print_Object({})") | [
"def",
"job",
"(",
"debugger",
",",
"param",
",",
"*",
"args",
")",
":",
"ptr_arg_cmd",
"(",
"debugger",
",",
"'job'",
",",
"param",
",",
"\"_v8_internal_Print_Object({})\"",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/tools/lldb_commands.py#L37-L39 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py | python | _NestedDescriptorBase.GetTopLevelContainingType | (self) | return desc | Returns the root if this is a nested type, or itself if its the root. | Returns the root if this is a nested type, or itself if its the root. | [
"Returns",
"the",
"root",
"if",
"this",
"is",
"a",
"nested",
"type",
"or",
"itself",
"if",
"its",
"the",
"root",
"."
] | def GetTopLevelContainingType(self):
"""Returns the root if this is a nested type, or itself if its the root."""
desc = self
while desc.containing_type is not None:
desc = desc.containing_type
return desc | [
"def",
"GetTopLevelContainingType",
"(",
"self",
")",
":",
"desc",
"=",
"self",
"while",
"desc",
".",
"containing_type",
"is",
"not",
"None",
":",
"desc",
"=",
"desc",
".",
"containing_type",
"return",
"desc"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L134-L139 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/managers.py | python | Server.debug_info | (self, c) | Return some info --- useful to spot problems with refcounting | Return some info --- useful to spot problems with refcounting | [
"Return",
"some",
"info",
"---",
"useful",
"to",
"spot",
"problems",
"with",
"refcounting"
] | def debug_info(self, c):
'''
Return some info --- useful to spot problems with refcounting
'''
# Perhaps include debug info about 'c'?
with self.mutex:
result = []
keys = list(self.id_to_refcount.keys())
keys.sort()
for ident in key... | [
"def",
"debug_info",
"(",
"self",
",",
"c",
")",
":",
"# Perhaps include debug info about 'c'?",
"with",
"self",
".",
"mutex",
":",
"result",
"=",
"[",
"]",
"keys",
"=",
"list",
"(",
"self",
".",
"id_to_refcount",
".",
"keys",
"(",
")",
")",
"keys",
".",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/managers.py#L318-L332 | ||
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | python/lbann/core/callback.py | python | Callback.export_proto | (self) | return callbacks_pb2.Callback() | Construct and return a protobuf message. | Construct and return a protobuf message. | [
"Construct",
"and",
"return",
"a",
"protobuf",
"message",
"."
] | def export_proto(self):
"""Construct and return a protobuf message."""
return callbacks_pb2.Callback() | [
"def",
"export_proto",
"(",
"self",
")",
":",
"return",
"callbacks_pb2",
".",
"Callback",
"(",
")"
] | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/core/callback.py#L12-L14 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/manifest.py | python | Manifest.process_directive | (self, directive) | Process a directive which either adds some files from ``allfiles`` to
``files``, or removes some files from ``files``.
:param directive: The directive to process. This should be in a format
compatible with distutils ``MANIFEST.in`` files:
http://docs.pyt... | [] | def process_directive(self, directive):
"""
Process a directive which either adds some files from ``allfiles`` to
``files``, or removes some files from ``files``.
:param directive: The directive to process. This should be in a format
compatible with distutils ... | [
"def",
"process_directive",
"(",
"self",
",",
"directive",
")",
":",
"# Parse the line: split it up, make sure the right number of words",
"# is there, and return the relevant words. 'action' is always",
"# defined: it's the first word of the line. Which of the other",
"# three are defined d... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/manifest.py#L259-L405 | |||
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.clear | (self) | return self.dispatcher._checkResult(Indigo._lib.indigoClear(self.id)) | Array, molecule or reaction method clears the object
Returns:
int: 1 if there are no errors | Array, molecule or reaction method clears the object | [
"Array",
"molecule",
"or",
"reaction",
"method",
"clears",
"the",
"object"
] | def clear(self):
"""Array, molecule or reaction method clears the object
Returns:
int: 1 if there are no errors
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResult(Indigo._lib.indigoClear(self.id)) | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoClear",
"(",
"self",
".",
"id",
")",
")"
] | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L3784-L3791 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Node.py | python | Node.path_from | (self, node) | Path of this node seen from the other::
def build(bld):
n1 = bld.path.find_node('foo/bar/xyz.txt')
n2 = bld.path.find_node('foo/stuff/')
n1.path_from(n2) # '../bar/xyz.txt'
:param node: path to use as a reference
:type node: :py:class:`waflib.Node.Node`
:returns: a relative path or an absolute on... | Path of this node seen from the other:: | [
"Path",
"of",
"this",
"node",
"seen",
"from",
"the",
"other",
"::"
] | def path_from(self, node):
"""
Path of this node seen from the other::
def build(bld):
n1 = bld.path.find_node('foo/bar/xyz.txt')
n2 = bld.path.find_node('foo/stuff/')
n1.path_from(n2) # '../bar/xyz.txt'
:param node: path to use as a reference
:type node: :py:class:`waflib.Node.Node`
:returns... | [
"def",
"path_from",
"(",
"self",
",",
"node",
")",
":",
"c1",
"=",
"self",
"c2",
"=",
"node",
"c1h",
"=",
"c1",
".",
"height",
"(",
")",
"c2h",
"=",
"c2",
".",
"height",
"(",
")",
"lst",
"=",
"[",
"]",
"up",
"=",
"0",
"while",
"c1h",
">",
"... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Node.py#L474-L519 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/notificationmgr.py | python | INotificationHandler.notifyDeadListener | (self, pubListener, topicObj) | Called when a listener has been garbage collected.
:param pubListener: the pubsub.core.Listener that wraps GC'd listener.
:param topicObj: the pubsub.core.Topic object it was subscribed to. | Called when a listener has been garbage collected.
:param pubListener: the pubsub.core.Listener that wraps GC'd listener.
:param topicObj: the pubsub.core.Topic object it was subscribed to. | [
"Called",
"when",
"a",
"listener",
"has",
"been",
"garbage",
"collected",
".",
":",
"param",
"pubListener",
":",
"the",
"pubsub",
".",
"core",
".",
"Listener",
"that",
"wraps",
"GC",
"d",
"listener",
".",
":",
"param",
"topicObj",
":",
"the",
"pubsub",
"... | def notifyDeadListener(self, pubListener, topicObj):
"""Called when a listener has been garbage collected.
:param pubListener: the pubsub.core.Listener that wraps GC'd listener.
:param topicObj: the pubsub.core.Topic object it was subscribed to."""
raise NotImplementedError | [
"def",
"notifyDeadListener",
"(",
"self",
",",
"pubListener",
",",
"topicObj",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/notificationmgr.py#L155-L159 | ||
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py | python | Timestamp.ToJsonString | (self) | return result + '.%09dZ' % nanos | Converts Timestamp to RFC 3339 date string format.
Returns:
A string converted from timestamp. The string is always Z-normalized
and uses 3, 6 or 9 fractional digits as required to represent the
exact time. Example of the return format: '1972-01-01T10:00:20.021Z' | Converts Timestamp to RFC 3339 date string format. | [
"Converts",
"Timestamp",
"to",
"RFC",
"3339",
"date",
"string",
"format",
"."
] | def ToJsonString(self):
"""Converts Timestamp to RFC 3339 date string format.
Returns:
A string converted from timestamp. The string is always Z-normalized
and uses 3, 6 or 9 fractional digits as required to represent the
exact time. Example of the return format: '1972-01-01T10:00:20.021Z'
... | [
"def",
"ToJsonString",
"(",
"self",
")",
":",
"nanos",
"=",
"self",
".",
"nanos",
"%",
"_NANOS_PER_SECOND",
"total_sec",
"=",
"self",
".",
"seconds",
"+",
"(",
"self",
".",
"nanos",
"-",
"nanos",
")",
"//",
"_NANOS_PER_SECOND",
"seconds",
"=",
"total_sec",... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py#L100-L126 | |
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/util/slice.py | python | list_getitem | (data, i) | 对C++引出的vector,实现python的切片,
将引入的vector类的__getitem__函数覆盖即可。 | 对C++引出的vector,实现python的切片,
将引入的vector类的__getitem__函数覆盖即可。 | [
"对C",
"++",
"引出的vector,实现python的切片,",
"将引入的vector类的__getitem__函数覆盖即可。"
] | def list_getitem(data, i):
"""对C++引出的vector,实现python的切片,
将引入的vector类的__getitem__函数覆盖即可。
"""
if isinstance(i, int):
length = len(data)
index = length + i if i < 0 else i
if index < 0 or index >= length:
raise IndexError("index out of range: %d" % i)
return d... | [
"def",
"list_getitem",
"(",
"data",
",",
"i",
")",
":",
"if",
"isinstance",
"(",
"i",
",",
"int",
")",
":",
"length",
"=",
"len",
"(",
"data",
")",
"index",
"=",
"length",
"+",
"i",
"if",
"i",
"<",
"0",
"else",
"i",
"if",
"index",
"<",
"0",
"... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/util/slice.py#L28-L43 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | packages/Python/lldbsuite/support/fs.py | python | find_executable | (executable) | return result | Finds the specified executable in the PATH or known good locations. | Finds the specified executable in the PATH or known good locations. | [
"Finds",
"the",
"specified",
"executable",
"in",
"the",
"PATH",
"or",
"known",
"good",
"locations",
"."
] | def find_executable(executable):
"""Finds the specified executable in the PATH or known good locations."""
# Figure out what we're looking for.
if platform.system() == "Windows":
executable = executable + ".exe"
extra_dirs = []
else:
extra_dirs = ["/usr/local/bin"]
# Figure... | [
"def",
"find_executable",
"(",
"executable",
")",
":",
"# Figure out what we're looking for.",
"if",
"platform",
".",
"system",
"(",
")",
"==",
"\"Windows\"",
":",
"executable",
"=",
"executable",
"+",
"\".exe\"",
"extra_dirs",
"=",
"[",
"]",
"else",
":",
"extra... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/packages/Python/lldbsuite/support/fs.py#L34-L64 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/bazel_tools/third_party/py/gflags/gflags_validators.py | python | DictionaryValidator.__init__ | (self, flag_names, checker, message) | Constructor.
Args:
flag_names: [string], containing names of the flags used by checker.
checker: function to verify the validator.
input - dictionary, with keys() being flag_names, and value for each
key being the value of the corresponding flag (string, boolean, etc).
output... | Constructor. | [
"Constructor",
"."
] | def __init__(self, flag_names, checker, message):
"""Constructor.
Args:
flag_names: [string], containing names of the flags used by checker.
checker: function to verify the validator.
input - dictionary, with keys() being flag_names, and value for each
key being the value of the ... | [
"def",
"__init__",
"(",
"self",
",",
"flag_names",
",",
"checker",
",",
"message",
")",
":",
"super",
"(",
"DictionaryValidator",
",",
"self",
")",
".",
"__init__",
"(",
"checker",
",",
"message",
")",
"self",
".",
"flag_names",
"=",
"flag_names"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/gflags_validators.py#L151-L166 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/conversion/aoc/genie_tech.py | python | UnitLineUpgrade.__init__ | (self, tech_id, unit_line_id, upgrade_target_id, full_data_set) | Creates a new Genie line upgrade object.
:param tech_id: The internal tech_id from the .dat file.
:param unit_line_id: The unit line that is upgraded.
:param upgrade_target_id: The unit that is the result of the upgrade.
:param full_data_set: GenieObjectContainer instance that
... | Creates a new Genie line upgrade object. | [
"Creates",
"a",
"new",
"Genie",
"line",
"upgrade",
"object",
"."
] | def __init__(self, tech_id, unit_line_id, upgrade_target_id, full_data_set):
"""
Creates a new Genie line upgrade object.
:param tech_id: The internal tech_id from the .dat file.
:param unit_line_id: The unit line that is upgraded.
:param upgrade_target_id: The unit that is the ... | [
"def",
"__init__",
"(",
"self",
",",
"tech_id",
",",
"unit_line_id",
",",
"upgrade_target_id",
",",
"full_data_set",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"tech_id",
",",
"full_data_set",
")",
"self",
".",
"unit_line_id",
"=",
"unit_line_id",
"s... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_tech.py#L211-L225 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/cr/cr/actions/debugger.py | python | Debugger.Kill | (self, targets, arguments) | Kill the running debugger. | Kill the running debugger. | [
"Kill",
"the",
"running",
"debugger",
"."
] | def Kill(self, targets, arguments):
"""Kill the running debugger."""
cr.Runner.Kill(targets, arguments) | [
"def",
"Kill",
"(",
"self",
",",
"targets",
",",
"arguments",
")",
":",
"cr",
".",
"Runner",
".",
"Kill",
"(",
"targets",
",",
"arguments",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cr/cr/actions/debugger.py#L39-L41 | ||
wy1iu/LargeMargin_Softmax_Loss | c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec | python/caffe/io.py | python | arraylist_to_blobprotovector_str | (arraylist) | return vec.SerializeToString() | Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing. | Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing. | [
"Converts",
"a",
"list",
"of",
"arrays",
"to",
"a",
"serialized",
"blobprotovec",
"which",
"could",
"be",
"then",
"passed",
"to",
"a",
"network",
"for",
"processing",
"."
] | def arraylist_to_blobprotovector_str(arraylist):
"""Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing.
"""
vec = caffe_pb2.BlobProtoVector()
vec.blobs.extend([array_to_blobproto(arr) for arr in arraylist])
return vec.SerializeToString(... | [
"def",
"arraylist_to_blobprotovector_str",
"(",
"arraylist",
")",
":",
"vec",
"=",
"caffe_pb2",
".",
"BlobProtoVector",
"(",
")",
"vec",
".",
"blobs",
".",
"extend",
"(",
"[",
"array_to_blobproto",
"(",
"arr",
")",
"for",
"arr",
"in",
"arraylist",
"]",
")",
... | https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/python/caffe/io.py#L49-L55 | |
psmoveservice/PSMoveService | 22bbe20e9de53f3f3581137bce7b88e2587a27e7 | misc/python/pypsmove/transformations.py | python | random_vector | (size) | return numpy.random.random(size) | Return array of random doubles in the half-open interval [0.0, 1.0).
>>> v = random_vector(10000)
>>> numpy.all(v >= 0) and numpy.all(v < 1)
True
>>> v0 = random_vector(10)
>>> v1 = random_vector(10)
>>> numpy.any(v0 == v1)
False | Return array of random doubles in the half-open interval [0.0, 1.0). | [
"Return",
"array",
"of",
"random",
"doubles",
"in",
"the",
"half",
"-",
"open",
"interval",
"[",
"0",
".",
"0",
"1",
".",
"0",
")",
"."
] | def random_vector(size):
"""Return array of random doubles in the half-open interval [0.0, 1.0).
>>> v = random_vector(10000)
>>> numpy.all(v >= 0) and numpy.all(v < 1)
True
>>> v0 = random_vector(10)
>>> v1 = random_vector(10)
>>> numpy.any(v0 == v1)
False
"""
return numpy.ran... | [
"def",
"random_vector",
"(",
"size",
")",
":",
"return",
"numpy",
".",
"random",
".",
"random",
"(",
"size",
")"
] | https://github.com/psmoveservice/PSMoveService/blob/22bbe20e9de53f3f3581137bce7b88e2587a27e7/misc/python/pypsmove/transformations.py#L1766-L1778 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/console/console_sci.py | python | ShellScintilla.getBytes | (self) | return bytes(bb)[:-1] | Get the text as bytes (utf-8 encoded). This is how
the data is stored internally. | Get the text as bytes (utf-8 encoded). This is how
the data is stored internally. | [
"Get",
"the",
"text",
"as",
"bytes",
"(",
"utf",
"-",
"8",
"encoded",
")",
".",
"This",
"is",
"how",
"the",
"data",
"is",
"stored",
"internally",
"."
] | def getBytes(self):
""" Get the text as bytes (utf-8 encoded). This is how
the data is stored internally. """
len = self.SendScintilla(self.SCI_GETLENGTH) + 1
bb = QByteArray(len, '0')
self.SendScintilla(self.SCI_GETTEXT, len, bb)
return bytes(bb)[:-1] | [
"def",
"getBytes",
"(",
"self",
")",
":",
"len",
"=",
"self",
".",
"SendScintilla",
"(",
"self",
".",
"SCI_GETLENGTH",
")",
"+",
"1",
"bb",
"=",
"QByteArray",
"(",
"len",
",",
"'0'",
")",
"self",
".",
"SendScintilla",
"(",
"self",
".",
"SCI_GETTEXT",
... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/console/console_sci.py#L163-L169 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | doc/doxygen_cxx/build.py | python | _symlink_headers | (*, drake_workspace, temp_dir, modules) | Prepare the input and output folders. We will copy the requested input
file(s) into a temporary scratch directory, so that Doxygen doesn't scan
the drake_workspace directly (which is extremely slow). | Prepare the input and output folders. We will copy the requested input
file(s) into a temporary scratch directory, so that Doxygen doesn't scan
the drake_workspace directly (which is extremely slow). | [
"Prepare",
"the",
"input",
"and",
"output",
"folders",
".",
"We",
"will",
"copy",
"the",
"requested",
"input",
"file",
"(",
"s",
")",
"into",
"a",
"temporary",
"scratch",
"directory",
"so",
"that",
"Doxygen",
"doesn",
"t",
"scan",
"the",
"drake_workspace",
... | def _symlink_headers(*, drake_workspace, temp_dir, modules):
"""Prepare the input and output folders. We will copy the requested input
file(s) into a temporary scratch directory, so that Doxygen doesn't scan
the drake_workspace directly (which is extremely slow).
"""
# Locate the default top-level m... | [
"def",
"_symlink_headers",
"(",
"*",
",",
"drake_workspace",
",",
"temp_dir",
",",
"modules",
")",
":",
"# Locate the default top-level modules.",
"unwanted_top_level_dirs",
"=",
"[",
"\".*\"",
",",
"# There is no C++ code here.",
"\"bazel-*\"",
",",
"# Ignore Bazel build a... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/doc/doxygen_cxx/build.py#L18-L69 | ||
kevinlin311tw/cvpr16-deepbit | c60fb3233d7d534cfcee9d3ed47d77af437ee32a | python/caffe/draw.py | python | get_pydot_graph | (caffe_net, rankdir, label_edges=True) | return pydot_graph | Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is True).
Returns
-------
pydot graph object | Create a data structure which represents the `caffe_net`. | [
"Create",
"a",
"data",
"structure",
"which",
"represents",
"the",
"caffe_net",
"."
] | def get_pydot_graph(caffe_net, rankdir, label_edges=True):
"""Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is Tr... | [
"def",
"get_pydot_graph",
"(",
"caffe_net",
",",
"rankdir",
",",
"label_edges",
"=",
"True",
")",
":",
"pydot_graph",
"=",
"pydot",
".",
"Dot",
"(",
"caffe_net",
".",
"name",
",",
"graph_type",
"=",
"'digraph'",
",",
"rankdir",
"=",
"rankdir",
")",
"pydot_... | https://github.com/kevinlin311tw/cvpr16-deepbit/blob/c60fb3233d7d534cfcee9d3ed47d77af437ee32a/python/caffe/draw.py#L121-L177 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/ndarray.py | python | NDArray.sigmoid | (self, *args, **kwargs) | return op.sigmoid(self, *args, **kwargs) | Convenience fluent method for :py:func:`sigmoid`.
The arguments are the same as for :py:func:`sigmoid`, with
this array as data. | Convenience fluent method for :py:func:`sigmoid`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"sigmoid",
"."
] | def sigmoid(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`sigmoid`.
The arguments are the same as for :py:func:`sigmoid`, with
this array as data.
"""
return op.sigmoid(self, *args, **kwargs) | [
"def",
"sigmoid",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"sigmoid",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L1694-L1700 | |
pirobot/rbx2 | 2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a | rbx2_utils/src/rbx2_utils/srv/_OldLaunchProcess.py | python | OldLaunchProcessRequest.deserialize_numpy | (self, str, numpy) | unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module | unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module | [
"unpack",
"serialized",
"message",
"in",
"str",
"into",
"this",
"message",
"instance",
"using",
"numpy",
"for",
"array",
"types",
":",
"param",
"str",
":",
"byte",
"array",
"of",
"serialized",
"message",
"str",
":",
"param",
"numpy",
":",
"numpy",
"python",
... | def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
end = 0
start = end
end += 4
(length,) = _... | [
"def",
"deserialize_numpy",
"(",
"self",
",",
"str",
",",
"numpy",
")",
":",
"try",
":",
"end",
"=",
"0",
"start",
"=",
"end",
"end",
"+=",
"4",
"(",
"length",
",",
")",
"=",
"_struct_I",
".",
"unpack",
"(",
"str",
"[",
"start",
":",
"end",
"]",
... | https://github.com/pirobot/rbx2/blob/2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a/rbx2_utils/src/rbx2_utils/srv/_OldLaunchProcess.py#L173-L219 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread.py | python | OpenThreadTHCI.__detectZephyr | (self) | Detect if the device is running Zephyr and adapt in that case | Detect if the device is running Zephyr and adapt in that case | [
"Detect",
"if",
"the",
"device",
"is",
"running",
"Zephyr",
"and",
"adapt",
"in",
"that",
"case"
] | def __detectZephyr(self):
"""Detect if the device is running Zephyr and adapt in that case"""
try:
self._lineSepX = re.compile(r'\r\n|\r|\n')
if self.__executeCommand(ZEPHYR_PREFIX + 'thread version')[0].isdigit():
self._cmdPrefix = ZEPHYR_PREFIX
except C... | [
"def",
"__detectZephyr",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_lineSepX",
"=",
"re",
".",
"compile",
"(",
"r'\\r\\n|\\r|\\n'",
")",
"if",
"self",
".",
"__executeCommand",
"(",
"ZEPHYR_PREFIX",
"+",
"'thread version'",
")",
"[",
"0",
"]",
".",
... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L3402-L3410 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus2.in.py | python | ctype_to_numpy | (exo, c_array) | return np_array | Converts a c-type array into a numpy array
Parameters
----------
exo : exodus object
exodus database object initialized with the option array_type = 'numpy'
c_array : c-type array
c-type array to be converted into a numpy array
Returns
-------
np_array : n... | Converts a c-type array into a numpy array | [
"Converts",
"a",
"c",
"-",
"type",
"array",
"into",
"a",
"numpy",
"array"
] | def ctype_to_numpy(exo, c_array):
"""
Converts a c-type array into a numpy array
Parameters
----------
exo : exodus object
exodus database object initialized with the option array_type = 'numpy'
c_array : c-type array
c-type array to be converted into a numpy array
... | [
"def",
"ctype_to_numpy",
"(",
"exo",
",",
"c_array",
")",
":",
"# ctypes currently produce invalid PEP 3118 type codes, which causes numpy",
"# to issue a warning. This is a bug and can be ignored.",
"# http://stackoverflow.com/questions/4964101/pep-3118-warning-when-using-ctypes-array-as-numpy... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L5431-L5456 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/tools/evaluation/tasks/coco_object_detection/preprocess_coco_minival.py | python | _dump_data | (ground_truth_detections, images_folder_path, output_folder_path) | Dumps images & data from ground-truth objects into output_folder_path.
The following are created in output_folder_path:
images/: sub-folder for allowlisted validation images.
ground_truth.pb: A binary proto file containing all ground-truth
object-sets.
Args:
ground_truth_detections: A dict mapping... | Dumps images & data from ground-truth objects into output_folder_path. | [
"Dumps",
"images",
"&",
"data",
"from",
"ground",
"-",
"truth",
"objects",
"into",
"output_folder_path",
"."
] | def _dump_data(ground_truth_detections, images_folder_path, output_folder_path):
"""Dumps images & data from ground-truth objects into output_folder_path.
The following are created in output_folder_path:
images/: sub-folder for allowlisted validation images.
ground_truth.pb: A binary proto file containing ... | [
"def",
"_dump_data",
"(",
"ground_truth_detections",
",",
"images_folder_path",
",",
"output_folder_path",
")",
":",
"# Ensure output folders exist.",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"output_folder_path",
")",
":",
"os",
".",
"makedirs",
"(",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/tools/evaluation/tasks/coco_object_detection/preprocess_coco_minival.py#L141-L183 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | uCSIsLatin1Supplement | (code) | return ret | Check whether the character is part of Latin-1Supplement
UCS Block | Check whether the character is part of Latin-1Supplement
UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Latin",
"-",
"1Supplement",
"UCS",
"Block"
] | def uCSIsLatin1Supplement(code):
"""Check whether the character is part of Latin-1Supplement
UCS Block """
ret = libxml2mod.xmlUCSIsLatin1Supplement(code)
return ret | [
"def",
"uCSIsLatin1Supplement",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsLatin1Supplement",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1882-L1886 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.remove | (self, elem) | Removes an item from the list. Similar to list.remove(). | Removes an item from the list. Similar to list.remove(). | [
"Removes",
"an",
"item",
"from",
"the",
"list",
".",
"Similar",
"to",
"list",
".",
"remove",
"()",
"."
] | def remove(self, elem):
"""Removes an item from the list. Similar to list.remove()."""
self._values.remove(elem)
self._message_listener.Modified() | [
"def",
"remove",
"(",
"self",
",",
"elem",
")",
":",
"self",
".",
"_values",
".",
"remove",
"(",
"elem",
")",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/containers.py#L287-L290 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/eslint.py | python | Repo._get_local_dir | (self, path) | return path | Get a directory path relative to the git root directory | Get a directory path relative to the git root directory | [
"Get",
"a",
"directory",
"path",
"relative",
"to",
"the",
"git",
"root",
"directory"
] | def _get_local_dir(self, path):
"""Get a directory path relative to the git root directory
"""
if os.path.isabs(path):
return os.path.relpath(path, self.root)
return path | [
"def",
"_get_local_dir",
"(",
"self",
",",
"path",
")",
":",
"if",
"os",
".",
"path",
".",
"isabs",
"(",
"path",
")",
":",
"return",
"os",
".",
"path",
".",
"relpath",
"(",
"path",
",",
"self",
".",
"root",
")",
"return",
"path"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/eslint.py#L361-L366 | |
google/filament | d21f092645b8e1e312307cbf89f1484891347c63 | third_party/libassimp/port/PyAssimp/scripts/transformations.py | python | random_vector | (size) | return numpy.random.random(size) | Return array of random doubles in the half-open interval [0.0, 1.0).
>>> v = random_vector(10000)
>>> numpy.all(v >= 0.0) and numpy.all(v < 1.0)
True
>>> v0 = random_vector(10)
>>> v1 = random_vector(10)
>>> numpy.any(v0 == v1)
False | Return array of random doubles in the half-open interval [0.0, 1.0). | [
"Return",
"array",
"of",
"random",
"doubles",
"in",
"the",
"half",
"-",
"open",
"interval",
"[",
"0",
".",
"0",
"1",
".",
"0",
")",
"."
] | def random_vector(size):
"""Return array of random doubles in the half-open interval [0.0, 1.0).
>>> v = random_vector(10000)
>>> numpy.all(v >= 0.0) and numpy.all(v < 1.0)
True
>>> v0 = random_vector(10)
>>> v1 = random_vector(10)
>>> numpy.any(v0 == v1)
False
"""
return numpy... | [
"def",
"random_vector",
"(",
"size",
")",
":",
"return",
"numpy",
".",
"random",
".",
"random",
"(",
"size",
")"
] | https://github.com/google/filament/blob/d21f092645b8e1e312307cbf89f1484891347c63/third_party/libassimp/port/PyAssimp/scripts/transformations.py#L1618-L1630 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBTarget.SetSectionLoadAddress | (self, *args) | return _lldb.SBTarget_SetSectionLoadAddress(self, *args) | SetSectionLoadAddress(self, SBSection section, addr_t section_base_addr) -> SBError | SetSectionLoadAddress(self, SBSection section, addr_t section_base_addr) -> SBError | [
"SetSectionLoadAddress",
"(",
"self",
"SBSection",
"section",
"addr_t",
"section_base_addr",
")",
"-",
">",
"SBError"
] | def SetSectionLoadAddress(self, *args):
"""SetSectionLoadAddress(self, SBSection section, addr_t section_base_addr) -> SBError"""
return _lldb.SBTarget_SetSectionLoadAddress(self, *args) | [
"def",
"SetSectionLoadAddress",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBTarget_SetSectionLoadAddress",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L8914-L8916 | |
eric612/Caffe-YOLOv3-Windows | 6736ca6e16781789b828cc64218ff77cc3454e5d | scripts/cpp_lint.py | python | ProcessFile | (filename, vlevel, extra_check_functions=[]) | Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An array of additional check functions that will be
... | Does google-lint on a single file. | [
"Does",
"google",
"-",
"lint",
"on",
"a",
"single",
"file",
"."
] | def ProcessFile(filename, vlevel, extra_check_functions=[]):
"""Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An ar... | [
"def",
"ProcessFile",
"(",
"filename",
",",
"vlevel",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"_SetVerboseLevel",
"(",
"vlevel",
")",
"try",
":",
"# Support the UNIX convention of using \"-\" for stdin. Note that",
"# we are not opening the file with universal... | https://github.com/eric612/Caffe-YOLOv3-Windows/blob/6736ca6e16781789b828cc64218ff77cc3454e5d/scripts/cpp_lint.py#L4693-L4758 | ||
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | platforms/nuttx/Debug/Nuttx.py | python | NX_task.is_runnable | (self) | return False | tests whether the task is runnable | tests whether the task is runnable | [
"tests",
"whether",
"the",
"task",
"is",
"runnable"
] | def is_runnable(self):
"""tests whether the task is runnable"""
if (self._state_is('TSTATE_TASK_PENDING') or
self._state_is('TSTATE_TASK_READYTORUN') or
self._state_is('TSTATE_TASK_RUNNING')):
return True
return False | [
"def",
"is_runnable",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"_state_is",
"(",
"'TSTATE_TASK_PENDING'",
")",
"or",
"self",
".",
"_state_is",
"(",
"'TSTATE_TASK_READYTORUN'",
")",
"or",
"self",
".",
"_state_is",
"(",
"'TSTATE_TASK_RUNNING'",
")",
")",
... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/platforms/nuttx/Debug/Nuttx.py#L235-L241 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/PostprocessorViewer/plugins/AxisSettingsWidget.py | python | AxisSettingsWidget._callbackScale | (self, value) | Callback for scale toggle. | Callback for scale toggle. | [
"Callback",
"for",
"scale",
"toggle",
"."
] | def _callbackScale(self, value):
"""
Callback for scale toggle.
"""
if value:
try:
self.set('set_{}scale', 'log')
except:
mooseutils.mooseError('Failed to set log axis limits, your data likely crosses zero.')
self.Sc... | [
"def",
"_callbackScale",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
":",
"try",
":",
"self",
".",
"set",
"(",
"'set_{}scale'",
",",
"'log'",
")",
"except",
":",
"mooseutils",
".",
"mooseError",
"(",
"'Failed to set log axis limits, your data likely cros... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/PostprocessorViewer/plugins/AxisSettingsWidget.py#L221-L234 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/bisect-builds.py | python | PathContext.GetOfficialBuildsList | (self) | return final_list | Gets the list of official build numbers between self.good_revision and
self.bad_revision. | Gets the list of official build numbers between self.good_revision and
self.bad_revision. | [
"Gets",
"the",
"list",
"of",
"official",
"build",
"numbers",
"between",
"self",
".",
"good_revision",
"and",
"self",
".",
"bad_revision",
"."
] | def GetOfficialBuildsList(self):
"""Gets the list of official build numbers between self.good_revision and
self.bad_revision."""
# Download the revlist and filter for just the range between good and bad.
minrev = min(self.good_revision, self.bad_revision)
maxrev = max(self.good_revision, self.bad_re... | [
"def",
"GetOfficialBuildsList",
"(",
"self",
")",
":",
"# Download the revlist and filter for just the range between good and bad.",
"minrev",
"=",
"min",
"(",
"self",
".",
"good_revision",
",",
"self",
".",
"bad_revision",
")",
"maxrev",
"=",
"max",
"(",
"self",
".",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect-builds.py#L252-L288 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py | python | Environment.best_match | (
self, req, working_set, installer=None, replace_conflicting=False) | return self.obtain(req, installer) | Find distribution best matching `req` and usable on `working_set`
This calls the ``find(req)`` method of the `working_set` to see if a
suitable distribution is already active. (This may raise
``VersionConflict`` if an unsuitable version of the project is already
active in the specified... | Find distribution best matching `req` and usable on `working_set` | [
"Find",
"distribution",
"best",
"matching",
"req",
"and",
"usable",
"on",
"working_set"
] | def best_match(
self, req, working_set, installer=None, replace_conflicting=False):
"""Find distribution best matching `req` and usable on `working_set`
This calls the ``find(req)`` method of the `working_set` to see if a
suitable distribution is already active. (This may raise
... | [
"def",
"best_match",
"(",
"self",
",",
"req",
",",
"working_set",
",",
"installer",
"=",
"None",
",",
"replace_conflicting",
"=",
"False",
")",
":",
"try",
":",
"dist",
"=",
"working_set",
".",
"find",
"(",
"req",
")",
"except",
"VersionConflict",
":",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py#L1040-L1066 | |
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | tools/clang/bindings/python/clang/cindex.py | python | CursorKind.is_preprocessing | (self) | return conf.lib.clang_isPreprocessing(self) | Test if this is a preprocessing kind. | Test if this is a preprocessing kind. | [
"Test",
"if",
"this",
"is",
"a",
"preprocessing",
"kind",
"."
] | def is_preprocessing(self):
"""Test if this is a preprocessing kind."""
return conf.lib.clang_isPreprocessing(self) | [
"def",
"is_preprocessing",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isPreprocessing",
"(",
"self",
")"
] | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/bindings/python/clang/cindex.py#L604-L606 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewRenderer.SetAttr | (*args, **kwargs) | return _dataview.DataViewRenderer_SetAttr(*args, **kwargs) | SetAttr(self, DataViewItemAttr attr) | SetAttr(self, DataViewItemAttr attr) | [
"SetAttr",
"(",
"self",
"DataViewItemAttr",
"attr",
")"
] | def SetAttr(*args, **kwargs):
"""SetAttr(self, DataViewItemAttr attr)"""
return _dataview.DataViewRenderer_SetAttr(*args, **kwargs) | [
"def",
"SetAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewRenderer_SetAttr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1165-L1167 | |
facebookresearch/faiss | eb8781557f556505ca93f6f21fff932e17f0d9e0 | benchs/bench_gpu_1bn.py | python | dataset_iterator | (x, preproc, bs) | return rate_limited_imap(prepare_block, block_ranges) | iterate over the lines of x in blocks of size bs | iterate over the lines of x in blocks of size bs | [
"iterate",
"over",
"the",
"lines",
"of",
"x",
"in",
"blocks",
"of",
"size",
"bs"
] | def dataset_iterator(x, preproc, bs):
""" iterate over the lines of x in blocks of size bs"""
nb = x.shape[0]
block_ranges = [(i0, min(nb, i0 + bs))
for i0 in range(0, nb, bs)]
def prepare_block(i01):
i0, i1 = i01
xb = sanitize(x[i0:i1])
return i0, preproc.a... | [
"def",
"dataset_iterator",
"(",
"x",
",",
"preproc",
",",
"bs",
")",
":",
"nb",
"=",
"x",
".",
"shape",
"[",
"0",
"]",
"block_ranges",
"=",
"[",
"(",
"i0",
",",
"min",
"(",
"nb",
",",
"i0",
"+",
"bs",
")",
")",
"for",
"i0",
"in",
"range",
"("... | https://github.com/facebookresearch/faiss/blob/eb8781557f556505ca93f6f21fff932e17f0d9e0/benchs/bench_gpu_1bn.py#L166-L178 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/internals/blocks.py | python | DatetimeLikeBlockMixin.get_values | (self, dtype=None) | return self.values | return object dtype as boxed values, such as Timestamps/Timedelta | return object dtype as boxed values, such as Timestamps/Timedelta | [
"return",
"object",
"dtype",
"as",
"boxed",
"values",
"such",
"as",
"Timestamps",
"/",
"Timedelta"
] | def get_values(self, dtype=None):
"""
return object dtype as boxed values, such as Timestamps/Timedelta
"""
if is_object_dtype(dtype):
values = self.values
if self.ndim > 1:
values = values.ravel()
values = lib.map_infer(values, self.... | [
"def",
"get_values",
"(",
"self",
",",
"dtype",
"=",
"None",
")",
":",
"if",
"is_object_dtype",
"(",
"dtype",
")",
":",
"values",
"=",
"self",
".",
"values",
"if",
"self",
".",
"ndim",
">",
"1",
":",
"values",
"=",
"values",
".",
"ravel",
"(",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/internals/blocks.py#L2070-L2086 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/skia_gold_common/skia_gold_session.py | python | SkiaGoldSession._StoreDiffLinks | (self, image_name, output_manager, output_dir) | Stores the local diff files as links.
The ComparisonResults entry for |image_name| should have its *_image fields
filled after this unless corresponding images were not found on disk.
Args:
image_name: A string containing the name of the image that was diffed.
output_manager: An output manager... | Stores the local diff files as links. | [
"Stores",
"the",
"local",
"diff",
"files",
"as",
"links",
"."
] | def _StoreDiffLinks(self, image_name, output_manager, output_dir):
"""Stores the local diff files as links.
The ComparisonResults entry for |image_name| should have its *_image fields
filled after this unless corresponding images were not found on disk.
Args:
image_name: A string containing the ... | [
"def",
"_StoreDiffLinks",
"(",
"self",
",",
"image_name",
",",
"output_manager",
",",
"output_dir",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/skia_gold_common/skia_gold_session.py#L525-L539 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | Dataset.GetTiledVirtualMemArray | (self, eAccess=gdalconst.GF_Read, xoff=0, yoff=0,
xsize=None, ysize=None, tilexsize=256, tileysize=256,
datatype=None, band_list=None, tile_organization=gdalconst.GTO_BSQ,
cache_size = 10 * 1024 * 1024, options=None) | return gdal_array.VirtualMemGetArray( virtualmem ) | Return a NumPy array for the dataset, seen as a virtual memory mapping with
a tile organization.
If there are several bands and tile_organization = gdal.GTO_TIP, an element is
accessed with array[tiley][tilex][y][x][band].
If there are several bands and tile_organization = gd... | Return a NumPy array for the dataset, seen as a virtual memory mapping with
a tile organization.
If there are several bands and tile_organization = gdal.GTO_TIP, an element is
accessed with array[tiley][tilex][y][x][band].
If there are several bands and tile_organization = gd... | [
"Return",
"a",
"NumPy",
"array",
"for",
"the",
"dataset",
"seen",
"as",
"a",
"virtual",
"memory",
"mapping",
"with",
"a",
"tile",
"organization",
".",
"If",
"there",
"are",
"several",
"bands",
"and",
"tile_organization",
"=",
"gdal",
".",
"GTO_TIP",
"an",
... | def GetTiledVirtualMemArray(self, eAccess=gdalconst.GF_Read, xoff=0, yoff=0,
xsize=None, ysize=None, tilexsize=256, tileysize=256,
datatype=None, band_list=None, tile_organization=gdalconst.GTO_BSQ,
cache_size = 10 * 1024 * 1024, options=N... | [
"def",
"GetTiledVirtualMemArray",
"(",
"self",
",",
"eAccess",
"=",
"gdalconst",
".",
"GF_Read",
",",
"xoff",
"=",
"0",
",",
"yoff",
"=",
"0",
",",
"xsize",
"=",
"None",
",",
"ysize",
"=",
"None",
",",
"tilexsize",
"=",
"256",
",",
"tileysize",
"=",
... | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L2465-L2494 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | buildsystem/codecompliance/util.py | python | issue_str | (title, filename, fix=None) | return (title, filename, fix) | Creates a formated (title, text) desciption of an issue.
TODO use this function and issue_str_line for all issues, so the format
can be easily changed (exta text, colors, etc) | Creates a formated (title, text) desciption of an issue. | [
"Creates",
"a",
"formated",
"(",
"title",
"text",
")",
"desciption",
"of",
"an",
"issue",
"."
] | def issue_str(title, filename, fix=None):
"""
Creates a formated (title, text) desciption of an issue.
TODO use this function and issue_str_line for all issues, so the format
can be easily changed (exta text, colors, etc)
"""
return (title, filename, fix) | [
"def",
"issue_str",
"(",
"title",
",",
"filename",
",",
"fix",
"=",
"None",
")",
":",
"return",
"(",
"title",
",",
"filename",
",",
"fix",
")"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/buildsystem/codecompliance/util.py#L88-L95 | |
greenheartgames/greenworks | 3ea4ab490b56676de3f0a237c74bcfdb17323e60 | deps/cpplint/cpplint.py | python | GetIndentLevel | (line) | Return the number of leading spaces in line.
Args:
line: A string to check.
Returns:
An integer count of leading spaces, possibly zero. | Return the number of leading spaces in line. | [
"Return",
"the",
"number",
"of",
"leading",
"spaces",
"in",
"line",
"."
] | def GetIndentLevel(line):
"""Return the number of leading spaces in line.
Args:
line: A string to check.
Returns:
An integer count of leading spaces, possibly zero.
"""
indent = Match(r'^( *)\S', line)
if indent:
return len(indent.group(1))
else:
return 0 | [
"def",
"GetIndentLevel",
"(",
"line",
")",
":",
"indent",
"=",
"Match",
"(",
"r'^( *)\\S'",
",",
"line",
")",
"if",
"indent",
":",
"return",
"len",
"(",
"indent",
".",
"group",
"(",
"1",
")",
")",
"else",
":",
"return",
"0"
] | https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L1742-L1755 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/genericpath.py | python | commonprefix | (m) | return s1 | Given a list of pathnames, returns the longest common leading component | Given a list of pathnames, returns the longest common leading component | [
"Given",
"a",
"list",
"of",
"pathnames",
"returns",
"the",
"longest",
"common",
"leading",
"component"
] | def commonprefix(m):
"Given a list of pathnames, returns the longest common leading component"
if not m: return ''
# Some people pass in a list of pathname parts to operate in an OS-agnostic
# fashion; don't try to translate in that case as that's an abuse of the
# API and they are already doing wha... | [
"def",
"commonprefix",
"(",
"m",
")",
":",
"if",
"not",
"m",
":",
"return",
"''",
"# Some people pass in a list of pathname parts to operate in an OS-agnostic",
"# fashion; don't try to translate in that case as that's an abuse of the",
"# API and they are already doing what they need to... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/genericpath.py#L69-L83 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Menu.__init__ | (self, *args, **kwargs) | __init__(self, String title=EmptyString, long style=0) -> Menu | __init__(self, String title=EmptyString, long style=0) -> Menu | [
"__init__",
"(",
"self",
"String",
"title",
"=",
"EmptyString",
"long",
"style",
"=",
"0",
")",
"-",
">",
"Menu"
] | def __init__(self, *args, **kwargs):
"""__init__(self, String title=EmptyString, long style=0) -> Menu"""
_core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
self._setOORInfo(self) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"Menu_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_Menu",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
"_setOORInfo",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L12001-L12004 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/readline_ui.py | python | ReadlineUI.run_ui | (self,
init_command=None,
title=None,
title_color=None,
enable_mouse_on_start=True) | return exit_token | Run the CLI: See the doc of base_ui.BaseUI.run_ui for more details. | Run the CLI: See the doc of base_ui.BaseUI.run_ui for more details. | [
"Run",
"the",
"CLI",
":",
"See",
"the",
"doc",
"of",
"base_ui",
".",
"BaseUI",
".",
"run_ui",
"for",
"more",
"details",
"."
] | def run_ui(self,
init_command=None,
title=None,
title_color=None,
enable_mouse_on_start=True):
"""Run the CLI: See the doc of base_ui.BaseUI.run_ui for more details."""
print(title)
if init_command is not None:
self._dispatch_command(init_command)
... | [
"def",
"run_ui",
"(",
"self",
",",
"init_command",
"=",
"None",
",",
"title",
"=",
"None",
",",
"title_color",
"=",
"None",
",",
"enable_mouse_on_start",
"=",
"True",
")",
":",
"print",
"(",
"title",
")",
"if",
"init_command",
"is",
"not",
"None",
":",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/readline_ui.py#L53-L70 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | IncrementalSelfTestResponse.initFromTpm | (self, buf) | TpmMarshaller method | TpmMarshaller method | [
"TpmMarshaller",
"method"
] | def initFromTpm(self, buf):
""" TpmMarshaller method """
self.toDoList = buf.readValArr(2) | [
"def",
"initFromTpm",
"(",
"self",
",",
"buf",
")",
":",
"self",
".",
"toDoList",
"=",
"buf",
".",
"readValArr",
"(",
"2",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L9206-L9208 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/monteCarloIndex.py | python | MonteCarloIndex.sampleDimension | (self, *args) | return self.sampler.sampleDimension(*args) | Returns the number of outputs from the sampler.
This is the number of outputs from a single solver of the sampler,
with no information regarding splitting, if any.
Input arguments: same as SampleGenerator.sampleDimension
Output argument:
- sample dimension: integer. See SampleG... | Returns the number of outputs from the sampler.
This is the number of outputs from a single solver of the sampler,
with no information regarding splitting, if any. | [
"Returns",
"the",
"number",
"of",
"outputs",
"from",
"the",
"sampler",
".",
"This",
"is",
"the",
"number",
"of",
"outputs",
"from",
"a",
"single",
"solver",
"of",
"the",
"sampler",
"with",
"no",
"information",
"regarding",
"splitting",
"if",
"any",
"."
] | def sampleDimension(self, *args) -> int:
"""
Returns the number of outputs from the sampler.
This is the number of outputs from a single solver of the sampler,
with no information regarding splitting, if any.
Input arguments: same as SampleGenerator.sampleDimension
Outp... | [
"def",
"sampleDimension",
"(",
"self",
",",
"*",
"args",
")",
"->",
"int",
":",
"return",
"self",
".",
"sampler",
".",
"sampleDimension",
"(",
"*",
"args",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/monteCarloIndex.py#L345-L357 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/tensor_forest/client/random_forest.py | python | TensorForestRunOpAtEndHook.__init__ | (self, op_dict) | Ops is a dict of {name: op} to run before the session is destroyed. | Ops is a dict of {name: op} to run before the session is destroyed. | [
"Ops",
"is",
"a",
"dict",
"of",
"{",
"name",
":",
"op",
"}",
"to",
"run",
"before",
"the",
"session",
"is",
"destroyed",
"."
] | def __init__(self, op_dict):
"""Ops is a dict of {name: op} to run before the session is destroyed."""
self._ops = op_dict | [
"def",
"__init__",
"(",
"self",
",",
"op_dict",
")",
":",
"self",
".",
"_ops",
"=",
"op_dict"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/tensor_forest/client/random_forest.py#L54-L56 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/utils/inputvalue.py | python | Input.pprint | (self, default, indent="", latex = True) | Function to convert arrays and other objects to human-readable strings.
Args:
default: The object that needs to be converted to a string.
indent: The indent at the beginning of a line.
latex: A boolean giving whether the string will be latex-format.
Returns:
A formatted... | Function to convert arrays and other objects to human-readable strings. | [
"Function",
"to",
"convert",
"arrays",
"and",
"other",
"objects",
"to",
"human",
"-",
"readable",
"strings",
"."
] | def pprint(self, default, indent="", latex = True):
"""Function to convert arrays and other objects to human-readable strings.
Args:
default: The object that needs to be converted to a string.
indent: The indent at the beginning of a line.
latex: A boolean giving whether the stri... | [
"def",
"pprint",
"(",
"self",
",",
"default",
",",
"indent",
"=",
"\"\"",
",",
"latex",
"=",
"True",
")",
":",
"if",
"type",
"(",
"default",
")",
"is",
"np",
".",
"ndarray",
":",
"if",
"default",
".",
"shape",
"==",
"(",
"0",
",",
")",
":",
"re... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/utils/inputvalue.py#L511-L548 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/__init__.py | python | Call.details | (self) | Accesses the details sent by the server.
This method blocks until the value is available.
Returns:
The details string of the RPC. | Accesses the details sent by the server. | [
"Accesses",
"the",
"details",
"sent",
"by",
"the",
"server",
"."
] | def details(self):
"""Accesses the details sent by the server.
This method blocks until the value is available.
Returns:
The details string of the RPC.
"""
raise NotImplementedError() | [
"def",
"details",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/__init__.py#L396-L404 | ||
wenwei202/caffe | f54a74abaf6951d8485cbdcfa1d74a4c37839466 | python/caffe/pycaffe.py | python | _Net_batch | (self, blobs) | Batch blob lists according to net's batch size.
Parameters
----------
blobs: Keys blob names and values are lists of blobs (of any length).
Naturally, all the lists should have the same length.
Yields
------
batch: {blob name: list of blobs} dict for a single batch. | Batch blob lists according to net's batch size. | [
"Batch",
"blob",
"lists",
"according",
"to",
"net",
"s",
"batch",
"size",
"."
] | def _Net_batch(self, blobs):
"""
Batch blob lists according to net's batch size.
Parameters
----------
blobs: Keys blob names and values are lists of blobs (of any length).
Naturally, all the lists should have the same length.
Yields
------
batch: {blob name: list of blobs} ... | [
"def",
"_Net_batch",
"(",
"self",
",",
"blobs",
")",
":",
"num",
"=",
"len",
"(",
"six",
".",
"next",
"(",
"six",
".",
"itervalues",
"(",
"blobs",
")",
")",
")",
"batch_size",
"=",
"six",
".",
"next",
"(",
"six",
".",
"itervalues",
"(",
"self",
"... | https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/python/caffe/pycaffe.py#L262-L293 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/internal/sanitize.py | python | sanitize_function | (arg) | return arg | Tries to retrieve a Function from the argument or raises a TypeError if
that's not possible. | Tries to retrieve a Function from the argument or raises a TypeError if
that's not possible. | [
"Tries",
"to",
"retrieve",
"a",
"Function",
"from",
"the",
"argument",
"or",
"raises",
"a",
"TypeError",
"if",
"that",
"s",
"not",
"possible",
"."
] | def sanitize_function(arg):
'''
Tries to retrieve a Function from the argument or raises a TypeError if
that's not possible.
'''
from cntk.ops import combine
if isinstance(arg, cntk_py.Variable):
arg = combine([arg])
if len(arg.outputs) != 1: # BUGBUG: This seems to happen with ... | [
"def",
"sanitize_function",
"(",
"arg",
")",
":",
"from",
"cntk",
".",
"ops",
"import",
"combine",
"if",
"isinstance",
"(",
"arg",
",",
"cntk_py",
".",
"Variable",
")",
":",
"arg",
"=",
"combine",
"(",
"[",
"arg",
"]",
")",
"if",
"len",
"(",
"arg",
... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/internal/sanitize.py#L248-L264 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | build_scripts/build_usd.py | python | RunCMake | (context, force, extraArgs = None) | Invoke CMake to configure, build, and install a library whose
source code is located in the current working directory. | Invoke CMake to configure, build, and install a library whose
source code is located in the current working directory. | [
"Invoke",
"CMake",
"to",
"configure",
"build",
"and",
"install",
"a",
"library",
"whose",
"source",
"code",
"is",
"located",
"in",
"the",
"current",
"working",
"directory",
"."
] | def RunCMake(context, force, extraArgs = None):
"""Invoke CMake to configure, build, and install a library whose
source code is located in the current working directory."""
# Create a directory for out-of-source builds in the build directory
# using the name of the current working directory.
srcDir... | [
"def",
"RunCMake",
"(",
"context",
",",
"force",
",",
"extraArgs",
"=",
"None",
")",
":",
"# Create a directory for out-of-source builds in the build directory",
"# using the name of the current working directory.",
"srcDir",
"=",
"os",
".",
"getcwd",
"(",
")",
"instDir",
... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/build_scripts/build_usd.py#L364-L442 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TNEGraph.GetNIdV | (self, *args) | return _snap.TNEGraph_GetNIdV(self, *args) | GetNIdV(TNEGraph self, TIntV NIdV)
Parameters:
NIdV: TIntV & | GetNIdV(TNEGraph self, TIntV NIdV) | [
"GetNIdV",
"(",
"TNEGraph",
"self",
"TIntV",
"NIdV",
")"
] | def GetNIdV(self, *args):
"""
GetNIdV(TNEGraph self, TIntV NIdV)
Parameters:
NIdV: TIntV &
"""
return _snap.TNEGraph_GetNIdV(self, *args) | [
"def",
"GetNIdV",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TNEGraph_GetNIdV",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L4679-L4687 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/stack.py | python | StackContext.create_using_template | (self, stack_name, template_body, region,
parameters=None,
created_callback=None,
capabilities=None,
tags=None,
timeout_in_minutes=60,
throw... | return res['StackId'] | Create a stack using a new template
See https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudformation.html#CloudFormation.Client.create_stack
:param stack_name: The name of the stack to create
:param template_body: The template body to use to create th... | Create a stack using a new template
See https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudformation.html#CloudFormation.Client.create_stack | [
"Create",
"a",
"stack",
"using",
"a",
"new",
"template",
"See",
"https",
":",
"//",
"boto3",
".",
"amazonaws",
".",
"com",
"/",
"v1",
"/",
"documentation",
"/",
"api",
"/",
"latest",
"/",
"reference",
"/",
"services",
"/",
"cloudformation",
".",
"html#Cl... | def create_using_template(self, stack_name, template_body, region,
parameters=None,
created_callback=None,
capabilities=None,
tags=None,
timeout_in_minutes=60,
... | [
"def",
"create_using_template",
"(",
"self",
",",
"stack_name",
",",
"template_body",
",",
"region",
",",
"parameters",
"=",
"None",
",",
"created_callback",
"=",
"None",
",",
"capabilities",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"timeout_in_minutes",
"=... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/stack.py#L135-L190 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py | python | Set.__ior__ | (self, other) | return self | Update a set with the union of itself and another. | Update a set with the union of itself and another. | [
"Update",
"a",
"set",
"with",
"the",
"union",
"of",
"itself",
"and",
"another",
"."
] | def __ior__(self, other):
"""Update a set with the union of itself and another."""
self._binary_sanity_check(other)
self._data.update(other._data)
return self | [
"def",
"__ior__",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"_binary_sanity_check",
"(",
"other",
")",
"self",
".",
"_data",
".",
"update",
"(",
"other",
".",
"_data",
")",
"return",
"self"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py#L428-L432 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/generator/eclipse.py | python | GetJavaJars | (target_list, target_dicts, toplevel_dir) | Generates a sequence of all .jars used as inputs. | Generates a sequence of all .jars used as inputs. | [
"Generates",
"a",
"sequence",
"of",
"all",
".",
"jars",
"used",
"as",
"inputs",
"."
] | def GetJavaJars(target_list, target_dicts, toplevel_dir):
'''Generates a sequence of all .jars used as inputs.'''
for target_name in target_list:
target = target_dicts[target_name]
for action in target.get('actions', []):
for input_ in action['inputs']:
if os.path.splitext(input_)[1] == '.jar'... | [
"def",
"GetJavaJars",
"(",
"target_list",
",",
"target_dicts",
",",
"toplevel_dir",
")",
":",
"for",
"target_name",
"in",
"target_list",
":",
"target",
"=",
"target_dicts",
"[",
"target_name",
"]",
"for",
"action",
"in",
"target",
".",
"get",
"(",
"'actions'",... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/generator/eclipse.py#L371-L381 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/datetime.py | python | _days_before_year | (year) | return y*365 + y//4 - y//100 + y//400 | year -> number of days before January 1st of year. | year -> number of days before January 1st of year. | [
"year",
"-",
">",
"number",
"of",
"days",
"before",
"January",
"1st",
"of",
"year",
"."
] | def _days_before_year(year):
"year -> number of days before January 1st of year."
y = year - 1
return y*365 + y//4 - y//100 + y//400 | [
"def",
"_days_before_year",
"(",
"year",
")",
":",
"y",
"=",
"year",
"-",
"1",
"return",
"y",
"*",
"365",
"+",
"y",
"//",
"4",
"-",
"y",
"//",
"100",
"+",
"y",
"//",
"400"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/datetime.py#L41-L44 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | ConfigBase.GetFirstGroup | (*args, **kwargs) | return _misc_.ConfigBase_GetFirstGroup(*args, **kwargs) | GetFirstGroup() -> (more, value, index)
Allows enumerating the subgroups in a config object. Returns a tuple
containing a flag indicating there are more items, the name of the
current item, and an index to pass to GetNextGroup to fetch the next
item. | GetFirstGroup() -> (more, value, index) | [
"GetFirstGroup",
"()",
"-",
">",
"(",
"more",
"value",
"index",
")"
] | def GetFirstGroup(*args, **kwargs):
"""
GetFirstGroup() -> (more, value, index)
Allows enumerating the subgroups in a config object. Returns a tuple
containing a flag indicating there are more items, the name of the
current item, and an index to pass to GetNextGroup to fetch th... | [
"def",
"GetFirstGroup",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"ConfigBase_GetFirstGroup",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3161-L3170 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_pyio.py | python | BufferedReader.peek | (self, size=0) | Returns buffered bytes without advancing the position.
The argument indicates a desired minimal number of bytes; we
do at most one raw read to satisfy it. We never return more
than self.buffer_size. | Returns buffered bytes without advancing the position. | [
"Returns",
"buffered",
"bytes",
"without",
"advancing",
"the",
"position",
"."
] | def peek(self, size=0):
"""Returns buffered bytes without advancing the position.
The argument indicates a desired minimal number of bytes; we
do at most one raw read to satisfy it. We never return more
than self.buffer_size.
"""
with self._read_lock:
return... | [
"def",
"peek",
"(",
"self",
",",
"size",
"=",
"0",
")",
":",
"with",
"self",
".",
"_read_lock",
":",
"return",
"self",
".",
"_peek_unlocked",
"(",
"size",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pyio.py#L1077-L1085 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/ShipDesignAI.py | python | ShipDesigner._class_specific_filter | (self, partname_dict) | Add additional filtering to _filter_parts().
To be implemented in subclasses. | Add additional filtering to _filter_parts(). | [
"Add",
"additional",
"filtering",
"to",
"_filter_parts",
"()",
"."
] | def _class_specific_filter(self, partname_dict):
"""Add additional filtering to _filter_parts().
To be implemented in subclasses.
"""
pass | [
"def",
"_class_specific_filter",
"(",
"self",
",",
"partname_dict",
")",
":",
"pass"
] | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/ShipDesignAI.py#L950-L955 | ||
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/style/filter.py | python | FilterConfiguration._filter_from_path | (self, path) | return self._path_to_filter[path] | Return the CategoryFilter associated to a path. | Return the CategoryFilter associated to a path. | [
"Return",
"the",
"CategoryFilter",
"associated",
"to",
"a",
"path",
"."
] | def _filter_from_path(self, path):
"""Return the CategoryFilter associated to a path."""
if path not in self._path_to_filter:
path_rules = self._path_rules_from_path(path)
filter = self._filter_from_path_rules(path_rules)
self._path_to_filter[path] = filter
r... | [
"def",
"_filter_from_path",
"(",
"self",
",",
"path",
")",
":",
"if",
"path",
"not",
"in",
"self",
".",
"_path_to_filter",
":",
"path_rules",
"=",
"self",
".",
"_path_rules_from_path",
"(",
"path",
")",
"filter",
"=",
"self",
".",
"_filter_from_path_rules",
... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/filter.py#L237-L244 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/BERT/helpers/tokenization.py | python | whitespace_tokenize | (text) | return tokens | Runs basic whitespace cleaning and splitting on a piece of text. | Runs basic whitespace cleaning and splitting on a piece of text. | [
"Runs",
"basic",
"whitespace",
"cleaning",
"and",
"splitting",
"on",
"a",
"piece",
"of",
"text",
"."
] | def whitespace_tokenize(text):
"""Runs basic whitespace cleaning and splitting on a piece of text."""
text = text.strip()
if not text:
return []
tokens = text.split()
return tokens | [
"def",
"whitespace_tokenize",
"(",
"text",
")",
":",
"text",
"=",
"text",
".",
"strip",
"(",
")",
"if",
"not",
"text",
":",
"return",
"[",
"]",
"tokens",
"=",
"text",
".",
"split",
"(",
")",
"return",
"tokens"
] | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/BERT/helpers/tokenization.py#L151-L157 | |
pytorch/glow | 15baf2376f7ebff7d4e75ccb094624a9c1e9a089 | utils/compilation_filter.py | python | Transformation.appendRemovedNode | (self, nodeName: str) | Append the removed nodes of this transformation. | Append the removed nodes of this transformation. | [
"Append",
"the",
"removed",
"nodes",
"of",
"this",
"transformation",
"."
] | def appendRemovedNode(self, nodeName: str) -> None:
"""Append the removed nodes of this transformation."""
self.removedNodes_.append(nodeName) | [
"def",
"appendRemovedNode",
"(",
"self",
",",
"nodeName",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"removedNodes_",
".",
"append",
"(",
"nodeName",
")"
] | https://github.com/pytorch/glow/blob/15baf2376f7ebff7d4e75ccb094624a9c1e9a089/utils/compilation_filter.py#L54-L57 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/lib/inputhook.py | python | InputHookManager.current_gui | (self) | return self._current_gui | DEPRECATED since IPython 5.0
Return a string indicating the currently active GUI or None. | DEPRECATED since IPython 5.0 | [
"DEPRECATED",
"since",
"IPython",
"5",
".",
"0"
] | def current_gui(self):
"""DEPRECATED since IPython 5.0
Return a string indicating the currently active GUI or None."""
warn("`current_gui` is deprecated since IPython 5.0 and will be removed in future versions.",
DeprecationWarning, stacklevel=2)
return self._current_gui | [
"def",
"current_gui",
"(",
"self",
")",
":",
"warn",
"(",
"\"`current_gui` is deprecated since IPython 5.0 and will be removed in future versions.\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"return",
"self",
".",
"_current_gui"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/lib/inputhook.py#L239-L245 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py | python | InvokeNvcc | (argv, log=False) | return proc.returncode | Call nvcc with arguments assembled from argv.
Args:
argv: A list of strings, possibly the argv passed to main().
log: True if logging is requested.
Returns:
The return value of calling os.system('nvcc ' + args) | Call nvcc with arguments assembled from argv. | [
"Call",
"nvcc",
"with",
"arguments",
"assembled",
"from",
"argv",
"."
] | def InvokeNvcc(argv, log=False):
"""Call nvcc with arguments assembled from argv.
Args:
argv: A list of strings, possibly the argv passed to main().
log: True if logging is requested.
Returns:
The return value of calling os.system('nvcc ' + args)
"""
src_files = [f for f in argv if
... | [
"def",
"InvokeNvcc",
"(",
"argv",
",",
"log",
"=",
"False",
")",
":",
"src_files",
"=",
"[",
"f",
"for",
"f",
"in",
"argv",
"if",
"re",
".",
"search",
"(",
"'\\.cpp$|\\.cc$|\\.c$|\\.cxx$|\\.C$'",
",",
"f",
")",
"]",
"if",
"len",
"(",
"src_files",
")",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py#L102-L173 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/head.py | python | _BinaryLogisticHead._logits_to_predictions | (self, logits) | Returns a dict of predictions.
Args:
logits: logits `Output` after applying possible centered bias.
Returns:
Dict of prediction `Output` keyed by `PredictionKey`. | Returns a dict of predictions. | [
"Returns",
"a",
"dict",
"of",
"predictions",
"."
] | def _logits_to_predictions(self, logits):
"""Returns a dict of predictions.
Args:
logits: logits `Output` after applying possible centered bias.
Returns:
Dict of prediction `Output` keyed by `PredictionKey`.
"""
with ops.name_scope(None, "predictions", (logits,)):
two_class_logit... | [
"def",
"_logits_to_predictions",
"(",
"self",
",",
"logits",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"None",
",",
"\"predictions\"",
",",
"(",
"logits",
",",
")",
")",
":",
"two_class_logits",
"=",
"_one_class_to_two_class_logits",
"(",
"logits",
")",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/head.py#L890-L916 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | MacroParameter.parsebit | (self, pos) | Parse the parameter: #n. | Parse the parameter: #n. | [
"Parse",
"the",
"parameter",
":",
"#n",
"."
] | def parsebit(self, pos):
"Parse the parameter: #n."
if not pos.checkskip('#'):
Trace.error('Missing parameter start #.')
return
self.number = int(pos.skipcurrent())
self.original = '#' + unicode(self.number)
self.contents = [TaggedBit().constant('#' + unicode(self.number), 'span class="u... | [
"def",
"parsebit",
"(",
"self",
",",
"pos",
")",
":",
"if",
"not",
"pos",
".",
"checkskip",
"(",
"'#'",
")",
":",
"Trace",
".",
"error",
"(",
"'Missing parameter start #.'",
")",
"return",
"self",
".",
"number",
"=",
"int",
"(",
"pos",
".",
"skipcurren... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L5233-L5240 | ||
OpenChemistry/tomviz | 0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a | tomviz/python/LaplaceFilter.py | python | transform | (dataset) | Apply a Laplace filter to dataset. | Apply a Laplace filter to dataset. | [
"Apply",
"a",
"Laplace",
"filter",
"to",
"dataset",
"."
] | def transform(dataset):
"""Apply a Laplace filter to dataset."""
import scipy.ndimage
import numpy as np
array = dataset.active_scalars
# Transform the dataset
result = np.empty_like(array)
scipy.ndimage.filters.laplace(array, output=result)
# Set the result as the new scalars.
da... | [
"def",
"transform",
"(",
"dataset",
")",
":",
"import",
"scipy",
".",
"ndimage",
"import",
"numpy",
"as",
"np",
"array",
"=",
"dataset",
".",
"active_scalars",
"# Transform the dataset",
"result",
"=",
"np",
".",
"empty_like",
"(",
"array",
")",
"scipy",
"."... | https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/LaplaceFilter.py#L1-L13 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/window.py | python | _Window._wrap_result | (self, result, block=None, obj=None) | return result | Wrap a single result. | Wrap a single result. | [
"Wrap",
"a",
"single",
"result",
"."
] | def _wrap_result(self, result, block=None, obj=None):
"""
Wrap a single result.
"""
if obj is None:
obj = self._selected_obj
index = obj.index
if isinstance(result, np.ndarray):
# coerce if necessary
if block is not None:
... | [
"def",
"_wrap_result",
"(",
"self",
",",
"result",
",",
"block",
"=",
"None",
",",
"obj",
"=",
"None",
")",
":",
"if",
"obj",
"is",
"None",
":",
"obj",
"=",
"self",
".",
"_selected_obj",
"index",
"=",
"obj",
".",
"index",
"if",
"isinstance",
"(",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/window.py#L222-L245 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/connections.py | python | _Connection_Pool.acquire | (self) | return conn | Acquire one connection from the pool,
or open a new one if none are available. | Acquire one connection from the pool,
or open a new one if none are available. | [
"Acquire",
"one",
"connection",
"from",
"the",
"pool",
"or",
"open",
"a",
"new",
"one",
"if",
"none",
"are",
"available",
"."
] | def acquire(self):
"""
Acquire one connection from the pool,
or open a new one if none are available.
"""
try:
conn = self._pool.pop(0)
self._inuse[id(conn)] = conn
self.log(self._logmode, MythLog.DEBUG,
'Acquiring c... | [
"def",
"acquire",
"(",
"self",
")",
":",
"try",
":",
"conn",
"=",
"self",
".",
"_pool",
".",
"pop",
"(",
"0",
")",
"self",
".",
"_inuse",
"[",
"id",
"(",
"conn",
")",
"]",
"=",
"conn",
"self",
".",
"log",
"(",
"self",
".",
"_logmode",
",",
"M... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/connections.py#L80-L92 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pytz/pytz/__init__.py | python | timezone | (zone) | return _tzinfo_cache[zone] | r''' Return a datetime.tzinfo implementation for the given timezone
>>> from datetime import datetime, timedelta
>>> utc = timezone('UTC')
>>> eastern = timezone('US/Eastern')
>>> eastern.zone
'US/Eastern'
>>> timezone(unicode('US/Eastern')) is eastern
True
>>> utc_dt = datetime(2002, 1... | r''' Return a datetime.tzinfo implementation for the given timezone | [
"r",
"Return",
"a",
"datetime",
".",
"tzinfo",
"implementation",
"for",
"the",
"given",
"timezone"
] | def timezone(zone):
r''' Return a datetime.tzinfo implementation for the given timezone
>>> from datetime import datetime, timedelta
>>> utc = timezone('UTC')
>>> eastern = timezone('US/Eastern')
>>> eastern.zone
'US/Eastern'
>>> timezone(unicode('US/Eastern')) is eastern
True
>>> u... | [
"def",
"timezone",
"(",
"zone",
")",
":",
"if",
"zone",
"is",
"None",
":",
"raise",
"UnknownTimeZoneError",
"(",
"None",
")",
"if",
"zone",
".",
"upper",
"(",
")",
"==",
"'UTC'",
":",
"return",
"utc",
"try",
":",
"zone",
"=",
"ascii",
"(",
"zone",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pytz/pytz/__init__.py#L130-L190 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewEvent.__init__ | (self, *args, **kwargs) | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> DataViewEvent | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> DataViewEvent | [
"__init__",
"(",
"self",
"EventType",
"commandType",
"=",
"wxEVT_NULL",
"int",
"winid",
"=",
"0",
")",
"-",
">",
"DataViewEvent"
] | def __init__(self, *args, **kwargs):
"""__init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> DataViewEvent"""
_dataview.DataViewEvent_swiginit(self,_dataview.new_DataViewEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_dataview",
".",
"DataViewEvent_swiginit",
"(",
"self",
",",
"_dataview",
".",
"new_DataViewEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1897-L1899 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextPrinting.PreviewFile | (*args, **kwargs) | return _richtext.RichTextPrinting_PreviewFile(*args, **kwargs) | PreviewFile(self, String richTextFile) -> bool | PreviewFile(self, String richTextFile) -> bool | [
"PreviewFile",
"(",
"self",
"String",
"richTextFile",
")",
"-",
">",
"bool"
] | def PreviewFile(*args, **kwargs):
"""PreviewFile(self, String richTextFile) -> bool"""
return _richtext.RichTextPrinting_PreviewFile(*args, **kwargs) | [
"def",
"PreviewFile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextPrinting_PreviewFile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L4496-L4498 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py | python | _infer_structured_outs | (
op_config: LinalgStructuredOpConfig,
in_arg_defs: Sequence[OperandDefConfig], ins: Sequence[Value],
out_arg_defs: Sequence[OperandDefConfig],
outs: Union[Sequence[Value], OpResultList]) | Infers implicit outs and output types.
Respects existing contents of outs if not empty.
Returns:
normalized outs, output types | Infers implicit outs and output types. | [
"Infers",
"implicit",
"outs",
"and",
"output",
"types",
"."
] | def _infer_structured_outs(
op_config: LinalgStructuredOpConfig,
in_arg_defs: Sequence[OperandDefConfig], ins: Sequence[Value],
out_arg_defs: Sequence[OperandDefConfig],
outs: Union[Sequence[Value], OpResultList]) -> Tuple[ValueList, List[Type]]:
"""Infers implicit outs and output types.
Respects e... | [
"def",
"_infer_structured_outs",
"(",
"op_config",
":",
"LinalgStructuredOpConfig",
",",
"in_arg_defs",
":",
"Sequence",
"[",
"OperandDefConfig",
"]",
",",
"ins",
":",
"Sequence",
"[",
"Value",
"]",
",",
"out_arg_defs",
":",
"Sequence",
"[",
"OperandDefConfig",
"]... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py#L373-L390 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Icon.CopyFromBitmap | (*args, **kwargs) | return _gdi_.Icon_CopyFromBitmap(*args, **kwargs) | CopyFromBitmap(self, Bitmap bmp) | CopyFromBitmap(self, Bitmap bmp) | [
"CopyFromBitmap",
"(",
"self",
"Bitmap",
"bmp",
")"
] | def CopyFromBitmap(*args, **kwargs):
"""CopyFromBitmap(self, Bitmap bmp)"""
return _gdi_.Icon_CopyFromBitmap(*args, **kwargs) | [
"def",
"CopyFromBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Icon_CopyFromBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L1357-L1359 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/cluster/birch.py | python | Birch.fit | (self, X, y=None) | return self._fit(X) | Build a CF Tree for the input data.
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Input data. | Build a CF Tree for the input data. | [
"Build",
"a",
"CF",
"Tree",
"for",
"the",
"input",
"data",
"."
] | def fit(self, X, y=None):
"""
Build a CF Tree for the input data.
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Input data.
"""
self.fit_, self.partial_fit_ = True, False
return self._fit(X) | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
")",
":",
"self",
".",
"fit_",
",",
"self",
".",
"partial_fit_",
"=",
"True",
",",
"False",
"return",
"self",
".",
"_fit",
"(",
"X",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/cluster/birch.py#L415-L425 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/telnetlib.py | python | Telnet.read_all | (self) | return buf | Read all data until EOF; block until connection closed. | Read all data until EOF; block until connection closed. | [
"Read",
"all",
"data",
"until",
"EOF",
";",
"block",
"until",
"connection",
"closed",
"."
] | def read_all(self):
"""Read all data until EOF; block until connection closed."""
self.process_rawq()
while not self.eof:
self.fill_rawq()
self.process_rawq()
buf = self.cookedq
self.cookedq = ''
return buf | [
"def",
"read_all",
"(",
"self",
")",
":",
"self",
".",
"process_rawq",
"(",
")",
"while",
"not",
"self",
".",
"eof",
":",
"self",
".",
"fill_rawq",
"(",
")",
"self",
".",
"process_rawq",
"(",
")",
"buf",
"=",
"self",
".",
"cookedq",
"self",
".",
"c... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/telnetlib.py#L321-L329 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/configHandler.py | python | IdleConf.GetOption | (self, configType, section, option, default=None, type=None,
warn_on_default=True, raw=False) | return default | Get an option value for given config type and given general
configuration section/option or return a default. If type is specified,
return as type. Firstly the user configuration is checked, with a
fallback to the default configuration, and a final 'catch all'
fallback to a useable passe... | Get an option value for given config type and given general
configuration section/option or return a default. If type is specified,
return as type. Firstly the user configuration is checked, with a
fallback to the default configuration, and a final 'catch all'
fallback to a useable passe... | [
"Get",
"an",
"option",
"value",
"for",
"given",
"config",
"type",
"and",
"given",
"general",
"configuration",
"section",
"/",
"option",
"or",
"return",
"a",
"default",
".",
"If",
"type",
"is",
"specified",
"return",
"as",
"type",
".",
"Firstly",
"the",
"us... | def GetOption(self, configType, section, option, default=None, type=None,
warn_on_default=True, raw=False):
"""
Get an option value for given config type and given general
configuration section/option or return a default. If type is specified,
return as type. Firstly th... | [
"def",
"GetOption",
"(",
"self",
",",
"configType",
",",
"section",
",",
"option",
",",
"default",
"=",
"None",
",",
"type",
"=",
"None",
",",
"warn_on_default",
"=",
"True",
",",
"raw",
"=",
"False",
")",
":",
"try",
":",
"if",
"self",
".",
"userCfg... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/configHandler.py#L226-L272 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | libcxx/utils/google-benchmark/mingw.py | python | root | (location = None, arch = None, version = None, threading = None,
exceptions = None, revision = None, log = EmptyLogger()) | return root_dir | Returns the root folder of a specific version of the mingw-builds variant
of gcc. Will download the compiler if needed | Returns the root folder of a specific version of the mingw-builds variant
of gcc. Will download the compiler if needed | [
"Returns",
"the",
"root",
"folder",
"of",
"a",
"specific",
"version",
"of",
"the",
"mingw",
"-",
"builds",
"variant",
"of",
"gcc",
".",
"Will",
"download",
"the",
"compiler",
"if",
"needed"
] | def root(location = None, arch = None, version = None, threading = None,
exceptions = None, revision = None, log = EmptyLogger()):
'''
Returns the root folder of a specific version of the mingw-builds variant
of gcc. Will download the compiler if needed
'''
# Get the repository if we don't ... | [
"def",
"root",
"(",
"location",
"=",
"None",
",",
"arch",
"=",
"None",
",",
"version",
"=",
"None",
",",
"threading",
"=",
"None",
",",
"exceptions",
"=",
"None",
",",
"revision",
"=",
"None",
",",
"log",
"=",
"EmptyLogger",
"(",
")",
")",
":",
"# ... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/libcxx/utils/google-benchmark/mingw.py#L172-L246 | |
stitchEm/stitchEm | 0f399501d41ab77933677f2907f41f80ceb704d7 | lib/bindings/samples/server/glfw.py | python | get_input_mode | (window, mode) | return _glfw.glfwGetInputMode(window, mode) | Returns the value of an input option for the specified window.
Wrapper for:
int glfwGetInputMode(GLFWwindow* window, int mode); | Returns the value of an input option for the specified window. | [
"Returns",
"the",
"value",
"of",
"an",
"input",
"option",
"for",
"the",
"specified",
"window",
"."
] | def get_input_mode(window, mode):
"""
Returns the value of an input option for the specified window.
Wrapper for:
int glfwGetInputMode(GLFWwindow* window, int mode);
"""
return _glfw.glfwGetInputMode(window, mode) | [
"def",
"get_input_mode",
"(",
"window",
",",
"mode",
")",
":",
"return",
"_glfw",
".",
"glfwGetInputMode",
"(",
"window",
",",
"mode",
")"
] | https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/glfw.py#L1437-L1444 | |
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/utils/path.py | python | DPPath.is_file | (self) | Check if self is file. | Check if self is file. | [
"Check",
"if",
"self",
"is",
"file",
"."
] | def is_file(self) -> bool:
"""Check if self is file.""" | [
"def",
"is_file",
"(",
"self",
")",
"->",
"bool",
":"
] | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/path.py#L82-L83 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.GetTextRaw | (*args, **kwargs) | return _stc.StyledTextCtrl_GetTextRaw(*args, **kwargs) | GetTextRaw(self) -> wxCharBuffer
Retrieve all the text in the document. The returned value is a utf-8
encoded string in unicode builds of wxPython, or raw 8-bit text
otherwise. | GetTextRaw(self) -> wxCharBuffer | [
"GetTextRaw",
"(",
"self",
")",
"-",
">",
"wxCharBuffer"
] | def GetTextRaw(*args, **kwargs):
"""
GetTextRaw(self) -> wxCharBuffer
Retrieve all the text in the document. The returned value is a utf-8
encoded string in unicode builds of wxPython, or raw 8-bit text
otherwise.
"""
return _stc.StyledTextCtrl_GetTextRaw(*args,... | [
"def",
"GetTextRaw",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetTextRaw",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6758-L6766 | |
limbo018/DREAMPlace | 146c3b9fd003d1acd52c96d9fd02e3f0a05154e4 | dreamplace/ops/weighted_average_wirelength/weighted_average_wirelength.py | python | WeightedAverageWirelengthFunction.forward | (ctx, pos, flat_netpin, netpin_start, pin2net_map, net_weights,
net_mask, pin_mask, inv_gamma) | return output[0] | @param pos pin location (x array, y array), not cell location
@param flat_netpin flat netpin map, length of #pins
@param netpin_start starting index in netpin map for each net, length of #nets+1, the last entry is #pins
@param pin2net_map pin2net map
@param net_weights weight of nets
... | [] | def forward(ctx, pos, flat_netpin, netpin_start, pin2net_map, net_weights,
net_mask, pin_mask, inv_gamma):
"""
@param pos pin location (x array, y array), not cell location
@param flat_netpin flat netpin map, length of #pins
@param netpin_start starting index in netpin ma... | [
"def",
"forward",
"(",
"ctx",
",",
"pos",
",",
"flat_netpin",
",",
"netpin_start",
",",
"pin2net_map",
",",
"net_weights",
",",
"net_mask",
",",
"pin_mask",
",",
"inv_gamma",
")",
":",
"tt",
"=",
"time",
".",
"time",
"(",
")",
"if",
"pos",
".",
"is_cud... | https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/ops/weighted_average_wirelength/weighted_average_wirelength.py#L32-L70 | ||
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.cml | (self) | return self.dispatcher._checkResultString(
Indigo._lib.indigoCml(self.id)
) | Molecule method returns the structure as a string in CML format
Returns:
str: CML string | Molecule method returns the structure as a string in CML format | [
"Molecule",
"method",
"returns",
"the",
"structure",
"as",
"a",
"string",
"in",
"CML",
"format"
] | def cml(self):
"""Molecule method returns the structure as a string in CML format
Returns:
str: CML string
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResultString(
Indigo._lib.indigoCml(self.id)
) | [
"def",
"cml",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResultString",
"(",
"Indigo",
".",
"_lib",
".",
"indigoCml",
"(",
"self",
".",
"id",
")",
")"
] | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L316-L325 | |
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/google/protobuf/descriptor.py | python | Descriptor.fields_by_camelcase_name | (self) | return self._fields_by_camelcase_name | Same FieldDescriptor objects as in :attr:`fields`, but indexed by
:attr:`FieldDescriptor.camelcase_name`. | Same FieldDescriptor objects as in :attr:`fields`, but indexed by
:attr:`FieldDescriptor.camelcase_name`. | [
"Same",
"FieldDescriptor",
"objects",
"as",
"in",
":",
"attr",
":",
"fields",
"but",
"indexed",
"by",
":",
"attr",
":",
"FieldDescriptor",
".",
"camelcase_name",
"."
] | def fields_by_camelcase_name(self):
"""Same FieldDescriptor objects as in :attr:`fields`, but indexed by
:attr:`FieldDescriptor.camelcase_name`.
"""
if self._fields_by_camelcase_name is None:
self._fields_by_camelcase_name = dict(
(f.camelcase_name, f) for f in self.fields)
return se... | [
"def",
"fields_by_camelcase_name",
"(",
"self",
")",
":",
"if",
"self",
".",
"_fields_by_camelcase_name",
"is",
"None",
":",
"self",
".",
"_fields_by_camelcase_name",
"=",
"dict",
"(",
"(",
"f",
".",
"camelcase_name",
",",
"f",
")",
"for",
"f",
"in",
"self",... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/descriptor.py#L372-L379 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/environment.py | python | Environment.overlay | (self, block_start_string=missing, block_end_string=missing,
variable_start_string=missing, variable_end_string=missing,
comment_start_string=missing, comment_end_string=missing,
line_statement_prefix=missing, line_comment_prefix=missing,
trim_blocks=missi... | return _environment_sanity_check(rv) | Create a new overlay environment that shares all the data with the
current environment except of cache and the overridden attributes.
Extensions cannot be removed for an overlayed environment. An overlayed
environment automatically gets all the extensions of the environment it
is linked... | Create a new overlay environment that shares all the data with the
current environment except of cache and the overridden attributes.
Extensions cannot be removed for an overlayed environment. An overlayed
environment automatically gets all the extensions of the environment it
is linked... | [
"Create",
"a",
"new",
"overlay",
"environment",
"that",
"shares",
"all",
"the",
"data",
"with",
"the",
"current",
"environment",
"except",
"of",
"cache",
"and",
"the",
"overridden",
"attributes",
".",
"Extensions",
"cannot",
"be",
"removed",
"for",
"an",
"over... | def overlay(self, block_start_string=missing, block_end_string=missing,
variable_start_string=missing, variable_end_string=missing,
comment_start_string=missing, comment_end_string=missing,
line_statement_prefix=missing, line_comment_prefix=missing,
trim_b... | [
"def",
"overlay",
"(",
"self",
",",
"block_start_string",
"=",
"missing",
",",
"block_end_string",
"=",
"missing",
",",
"variable_start_string",
"=",
"missing",
",",
"variable_end_string",
"=",
"missing",
",",
"comment_start_string",
"=",
"missing",
",",
"comment_en... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/environment.py#L299-L341 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/urllib/request.py | python | URLopener.open_data | (self, url, data=None) | return addinfourl(f, headers, url) | Use "data" URL. | Use "data" URL. | [
"Use",
"data",
"URL",
"."
] | def open_data(self, url, data=None):
"""Use "data" URL."""
if not isinstance(url, str):
raise URLError('data error: proxy support for data protocol currently not implemented')
# ignore POSTed data
#
# syntax of data URLs:
# dataurl := "data:" [ mediatype ] [... | [
"def",
"open_data",
"(",
"self",
",",
"url",
",",
"data",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"url",
",",
"str",
")",
":",
"raise",
"URLError",
"(",
"'data error: proxy support for data protocol currently not implemented'",
")",
"# ignore POSTed... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/urllib/request.py#L2099-L2138 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.