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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | ipc/ipdl/ipdl/parser.py | python | p_MessageInParams | (p) | MessageInParams : '(' ParamList ') | MessageInParams : '(' ParamList ') | [
"MessageInParams",
":",
"(",
"ParamList",
")"
] | def p_MessageInParams(p):
"""MessageInParams : '(' ParamList ')'"""
p[0] = p[2] | [
"def",
"p_MessageInParams",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"2",
"]"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/ipc/ipdl/ipdl/parser.py#L530-L532 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_array_ops.py | python | get_bprop_gather_v2 | (self) | return bprop | Generate bprop for GatherV2 | Generate bprop for GatherV2 | [
"Generate",
"bprop",
"for",
"GatherV2"
] | def get_bprop_gather_v2(self):
"""Generate bprop for GatherV2"""
def bprop(x, indices, axis, out, dout):
orig_indices = indices
if F.rank(dout) == 0:
dout = P.ExpandDims()(dout, -1)
if F.rank(indices) == 0:
indices = P.ExpandDims()(indices, -1)
x_shp ... | [
"def",
"get_bprop_gather_v2",
"(",
"self",
")",
":",
"def",
"bprop",
"(",
"x",
",",
"indices",
",",
"axis",
",",
"out",
",",
"dout",
")",
":",
"orig_indices",
"=",
"indices",
"if",
"F",
".",
"rank",
"(",
"dout",
")",
"==",
"0",
":",
"dout",
"=",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_array_ops.py#L447-L476 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/cookies.py | python | merge_cookies | (cookiejar, cookies) | return cookiejar | Add cookies to cookiejar and returns a merged CookieJar.
:param cookiejar: CookieJar object to add the cookies to.
:param cookies: Dictionary or CookieJar object to be added. | Add cookies to cookiejar and returns a merged CookieJar. | [
"Add",
"cookies",
"to",
"cookiejar",
"and",
"returns",
"a",
"merged",
"CookieJar",
"."
] | def merge_cookies(cookiejar, cookies):
"""Add cookies to cookiejar and returns a merged CookieJar.
:param cookiejar: CookieJar object to add the cookies to.
:param cookies: Dictionary or CookieJar object to be added.
"""
if not isinstance(cookiejar, cookielib.CookieJar):
raise ValueError('Y... | [
"def",
"merge_cookies",
"(",
"cookiejar",
",",
"cookies",
")",
":",
"if",
"not",
"isinstance",
"(",
"cookiejar",
",",
"cookielib",
".",
"CookieJar",
")",
":",
"raise",
"ValueError",
"(",
"'You can only merge into CookieJar'",
")",
"if",
"isinstance",
"(",
"cooki... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/cookies.py#L460-L479 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mhlib.py | python | Folder.createmessage | (self, n, txt) | Create a message, with text from the open file txt. | Create a message, with text from the open file txt. | [
"Create",
"a",
"message",
"with",
"text",
"from",
"the",
"open",
"file",
"txt",
"."
] | def createmessage(self, n, txt):
"""Create a message, with text from the open file txt."""
path = self.getmessagefilename(n)
backuppath = self.getmessagefilename(',%d' % n)
try:
os.rename(path, backuppath)
except os.error:
pass
ok = 0
BUFSI... | [
"def",
"createmessage",
"(",
"self",
",",
"n",
",",
"txt",
")",
":",
"path",
"=",
"self",
".",
"getmessagefilename",
"(",
"n",
")",
"backuppath",
"=",
"self",
".",
"getmessagefilename",
"(",
"',%d'",
"%",
"n",
")",
"try",
":",
"os",
".",
"rename",
"(... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mhlib.py#L604-L628 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | TextAreaBase.MarkDirty | (*args, **kwargs) | return _core_.TextAreaBase_MarkDirty(*args, **kwargs) | MarkDirty(self) | MarkDirty(self) | [
"MarkDirty",
"(",
"self",
")"
] | def MarkDirty(*args, **kwargs):
"""MarkDirty(self)"""
return _core_.TextAreaBase_MarkDirty(*args, **kwargs) | [
"def",
"MarkDirty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"TextAreaBase_MarkDirty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13404-L13406 | |
cksystemsgroup/scal | fa2208a97a77d65f4e90f85fef3404c27c1f2ac2 | tools/cpplint.py | python | CheckRedundantOverrideOrFinal | (filename, clean_lines, linenum, error) | Check if line contains a redundant "override" or "final" virt-specifier.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Check if line contains a redundant "override" or "final" virt-specifier. | [
"Check",
"if",
"line",
"contains",
"a",
"redundant",
"override",
"or",
"final",
"virt",
"-",
"specifier",
"."
] | def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error):
"""Check if line contains a redundant "override" or "final" virt-specifier.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
er... | [
"def",
"CheckRedundantOverrideOrFinal",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Look for closing parenthesis nearby. We need one to confirm where",
"# the declarator ends and where the virt-specifier starts to avoid",
"# false positives.",
"line... | https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L5811-L5837 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftviewproviders/view_base.py | python | ViewProviderDraft.getDefaultDisplayMode | (self) | return "Flat Lines" | Return the default mode defined in getDisplayModes.
Override this method to return a string with the default display mode.
By default it returns `'Flat Lines'`.
Returns
-------
str
`'Flat Lines'` | Return the default mode defined in getDisplayModes. | [
"Return",
"the",
"default",
"mode",
"defined",
"in",
"getDisplayModes",
"."
] | def getDefaultDisplayMode(self):
"""Return the default mode defined in getDisplayModes.
Override this method to return a string with the default display mode.
By default it returns `'Flat Lines'`.
Returns
-------
str
`'Flat Lines'`
"""
retu... | [
"def",
"getDefaultDisplayMode",
"(",
"self",
")",
":",
"return",
"\"Flat Lines\""
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftviewproviders/view_base.py#L223-L236 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/io/_fortran.py | python | FortranFile.close | (self) | Closes the file. It is unsupported to call any other methods off this
object after closing it. Note that this class supports the 'with'
statement in modern versions of Python, to call this automatically | Closes the file. It is unsupported to call any other methods off this
object after closing it. Note that this class supports the 'with'
statement in modern versions of Python, to call this automatically | [
"Closes",
"the",
"file",
".",
"It",
"is",
"unsupported",
"to",
"call",
"any",
"other",
"methods",
"off",
"this",
"object",
"after",
"closing",
"it",
".",
"Note",
"that",
"this",
"class",
"supports",
"the",
"with",
"statement",
"in",
"modern",
"versions",
"... | def close(self):
"""
Closes the file. It is unsupported to call any other methods off this
object after closing it. Note that this class supports the 'with'
statement in modern versions of Python, to call this automatically
"""
self._fp.close() | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"_fp",
".",
"close",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/io/_fortran.py#L304-L311 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | PhotoImage.write | (self, filename, format=None, from_coords=None) | Write image to file FILENAME in FORMAT starting from
position FROM_COORDS. | Write image to file FILENAME in FORMAT starting from
position FROM_COORDS. | [
"Write",
"image",
"to",
"file",
"FILENAME",
"in",
"FORMAT",
"starting",
"from",
"position",
"FROM_COORDS",
"."
] | def write(self, filename, format=None, from_coords=None):
"""Write image to file FILENAME in FORMAT starting from
position FROM_COORDS."""
args = (self.name, 'write', filename)
if format:
args = args + ('-format', format)
if from_coords:
args = args + ('-f... | [
"def",
"write",
"(",
"self",
",",
"filename",
",",
"format",
"=",
"None",
",",
"from_coords",
"=",
"None",
")",
":",
"args",
"=",
"(",
"self",
".",
"name",
",",
"'write'",
",",
"filename",
")",
"if",
"format",
":",
"args",
"=",
"args",
"+",
"(",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3349-L3357 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/executor_manager.py | python | DataParallelExecutorManager.param_arrays | (self) | return self.execgrp.param_arrays | Shared parameter arrays. | Shared parameter arrays. | [
"Shared",
"parameter",
"arrays",
"."
] | def param_arrays(self):
"""Shared parameter arrays."""
# param arrays should be shared by all executor groups
return self.execgrp.param_arrays | [
"def",
"param_arrays",
"(",
"self",
")",
":",
"# param arrays should be shared by all executor groups",
"return",
"self",
".",
"execgrp",
".",
"param_arrays"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/executor_manager.py#L396-L399 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/utils/tensorboard/_caffe2_graph.py | python | _try_get_shapes | (nets) | Get missing shapes for all blobs contained in the nets.
Args:
nets: List of core.Net to extract blob shape information from.
Returns:
Dictionary containing blob name to shape/dimensions mapping. The net
is a computation graph that is composed of operators, and the
opera... | Get missing shapes for all blobs contained in the nets. | [
"Get",
"missing",
"shapes",
"for",
"all",
"blobs",
"contained",
"in",
"the",
"nets",
"."
] | def _try_get_shapes(nets):
'''
Get missing shapes for all blobs contained in the nets.
Args:
nets: List of core.Net to extract blob shape information from.
Returns:
Dictionary containing blob name to shape/dimensions mapping. The net
is a computation graph that is composed ... | [
"def",
"_try_get_shapes",
"(",
"nets",
")",
":",
"try",
":",
"# Note: this will inspect the workspace for better or worse.",
"# We don't care about the types, only the shapes",
"shapes",
",",
"_",
"=",
"workspace",
".",
"InferShapesAndTypes",
"(",
"nets",
")",
"return",
"sh... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/tensorboard/_caffe2_graph.py#L734-L753 | ||
HumbleNet/HumbleNet | dcf31b021c2b809c8aee8ef1436ccfb9ce840fb5 | 3rdparty/boringssl/util/bot/vs_toolchain.py | python | SetEnvironmentAndGetRuntimeDllDirs | () | return vs2013_runtime_dll_dirs | Sets up os.environ to use the depot_tools VS toolchain with gyp, and
returns the location of the VS runtime DLLs so they can be copied into
the output directory after gyp generation. | Sets up os.environ to use the depot_tools VS toolchain with gyp, and
returns the location of the VS runtime DLLs so they can be copied into
the output directory after gyp generation. | [
"Sets",
"up",
"os",
".",
"environ",
"to",
"use",
"the",
"depot_tools",
"VS",
"toolchain",
"with",
"gyp",
"and",
"returns",
"the",
"location",
"of",
"the",
"VS",
"runtime",
"DLLs",
"so",
"they",
"can",
"be",
"copied",
"into",
"the",
"output",
"directory",
... | def SetEnvironmentAndGetRuntimeDllDirs():
"""Sets up os.environ to use the depot_tools VS toolchain with gyp, and
returns the location of the VS runtime DLLs so they can be copied into
the output directory after gyp generation.
"""
vs2013_runtime_dll_dirs = None
depot_tools_win_toolchain = \
bool(int(... | [
"def",
"SetEnvironmentAndGetRuntimeDllDirs",
"(",
")",
":",
"vs2013_runtime_dll_dirs",
"=",
"None",
"depot_tools_win_toolchain",
"=",
"bool",
"(",
"int",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'DEPOT_TOOLS_WIN_TOOLCHAIN'",
",",
"'1'",
")",
")",
")",
"if",
... | https://github.com/HumbleNet/HumbleNet/blob/dcf31b021c2b809c8aee8ef1436ccfb9ce840fb5/3rdparty/boringssl/util/bot/vs_toolchain.py#L21-L61 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarFile.add | (self, name, arcname=None, recursive=True, exclude=None, filter=None) | Add the file `name' to the archive. `name' may be any type of file
(directory, fifo, symbolic link, etc.). If given, `arcname'
specifies an alternative name for the file in the archive.
Directories are added recursively by default. This can be avoided by
setting `recursiv... | Add the file `name' to the archive. `name' may be any type of file | [
"Add",
"the",
"file",
"name",
"to",
"the",
"archive",
".",
"name",
"may",
"be",
"any",
"type",
"of",
"file"
] | def add(self, name, arcname=None, recursive=True, exclude=None, filter=None):
"""Add the file `name' to the archive. `name' may be any type of file
(directory, fifo, symbolic link, etc.). If given, `arcname'
specifies an alternative name for the file in the archive.
Director... | [
"def",
"add",
"(",
"self",
",",
"name",
",",
"arcname",
"=",
"None",
",",
"recursive",
"=",
"True",
",",
"exclude",
"=",
"None",
",",
"filter",
"=",
"None",
")",
":",
"self",
".",
"_check",
"(",
"\"aw\"",
")",
"if",
"arcname",
"is",
"None",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L4075-L4195 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/process/win32.py | python | Win32Bus._get_state_event | (self, state) | Return a win32event for the given state (creating it if needed). | Return a win32event for the given state (creating it if needed). | [
"Return",
"a",
"win32event",
"for",
"the",
"given",
"state",
"(",
"creating",
"it",
"if",
"needed",
")",
"."
] | def _get_state_event(self, state):
"""Return a win32event for the given state (creating it if needed)."""
try:
return self.events[state]
except KeyError:
event = win32event.CreateEvent(None, 0, 0,
"WSPBus %s Event (pid=%r)" %
... | [
"def",
"_get_state_event",
"(",
"self",
",",
"state",
")",
":",
"try",
":",
"return",
"self",
".",
"events",
"[",
"state",
"]",
"except",
"KeyError",
":",
"event",
"=",
"win32event",
".",
"CreateEvent",
"(",
"None",
",",
"0",
",",
"0",
",",
"\"WSPBus %... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/process/win32.py#L80-L89 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html2.py | python | WebViewHistoryItem.GetTitle | (*args, **kwargs) | return _html2.WebViewHistoryItem_GetTitle(*args, **kwargs) | GetTitle(self) -> String | GetTitle(self) -> String | [
"GetTitle",
"(",
"self",
")",
"-",
">",
"String"
] | def GetTitle(*args, **kwargs):
"""GetTitle(self) -> String"""
return _html2.WebViewHistoryItem_GetTitle(*args, **kwargs) | [
"def",
"GetTitle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebViewHistoryItem_GetTitle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html2.py#L97-L99 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/examples/python/file_extract.py | python | FileExtract.get_n_sint64 | (self, n, fail_value=0) | Extract "n" int64_t integers from the binary file at the current file position, returns a list of integers | Extract "n" int64_t integers from the binary file at the current file position, returns a list of integers | [
"Extract",
"n",
"int64_t",
"integers",
"from",
"the",
"binary",
"file",
"at",
"the",
"current",
"file",
"position",
"returns",
"a",
"list",
"of",
"integers"
] | def get_n_sint64(self, n, fail_value=0):
'''Extract "n" int64_t integers from the binary file at the current file position, returns a list of integers'''
s = self.read_size(8 * n)
if s:
return struct.unpack(self.byte_order + ("%u" % n) + 'q', s)
else:
return (fail... | [
"def",
"get_n_sint64",
"(",
"self",
",",
"n",
",",
"fail_value",
"=",
"0",
")",
":",
"s",
"=",
"self",
".",
"read_size",
"(",
"8",
"*",
"n",
")",
"if",
"s",
":",
"return",
"struct",
".",
"unpack",
"(",
"self",
".",
"byte_order",
"+",
"(",
"\"%u\"... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/examples/python/file_extract.py#L212-L218 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/tools/grokdump.py | python | InspectionShell.do_display_stack_objects | (self, args) | Find and Print object pointers in the given range.
Print all possible object pointers that are on the stack or in the given
address range.
Usage: dso [START_ADDR,[END_ADDR]] | Find and Print object pointers in the given range. | [
"Find",
"and",
"Print",
"object",
"pointers",
"in",
"the",
"given",
"range",
"."
] | def do_display_stack_objects(self, args):
"""
Find and Print object pointers in the given range.
Print all possible object pointers that are on the stack or in the given
address range.
Usage: dso [START_ADDR,[END_ADDR]]
"""
start = self.reader.StackTop()
end = self.reader.StackBottom()... | [
"def",
"do_display_stack_objects",
"(",
"self",
",",
"args",
")",
":",
"start",
"=",
"self",
".",
"reader",
".",
"StackTop",
"(",
")",
"end",
"=",
"self",
".",
"reader",
".",
"StackBottom",
"(",
")",
"if",
"len",
"(",
"args",
")",
"!=",
"0",
":",
"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/tools/grokdump.py#L3563-L3584 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/ast.py | python | copy_location | (new_node, old_node) | return new_node | Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*. | Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*. | [
"Copy",
"source",
"location",
"(",
"lineno",
"and",
"col_offset",
"attributes",
")",
"from",
"*",
"old_node",
"*",
"to",
"*",
"new_node",
"*",
"if",
"possible",
"and",
"return",
"*",
"new_node",
"*",
"."
] | def copy_location(new_node, old_node):
"""
Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*.
"""
for attr in 'lineno', 'col_offset':
if attr in old_node._attributes and attr in new_node._attributes \
and h... | [
"def",
"copy_location",
"(",
"new_node",
",",
"old_node",
")",
":",
"for",
"attr",
"in",
"'lineno'",
",",
"'col_offset'",
":",
"if",
"attr",
"in",
"old_node",
".",
"_attributes",
"and",
"attr",
"in",
"new_node",
".",
"_attributes",
"and",
"hasattr",
"(",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/ast.py#L101-L110 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/build_py.py | python | build_py._get_platform_patterns | (spec, package, src_dir) | return (
# Each pattern has to be converted to a platform-specific path
os.path.join(src_dir, convert_path(pattern))
for pattern in raw_patterns
) | yield platform-specific path patterns (suitable for glob
or fn_match) from a glob-based spec (such as
self.package_data or self.exclude_package_data)
matching package in src_dir. | yield platform-specific path patterns (suitable for glob
or fn_match) from a glob-based spec (such as
self.package_data or self.exclude_package_data)
matching package in src_dir. | [
"yield",
"platform",
"-",
"specific",
"path",
"patterns",
"(",
"suitable",
"for",
"glob",
"or",
"fn_match",
")",
"from",
"a",
"glob",
"-",
"based",
"spec",
"(",
"such",
"as",
"self",
".",
"package_data",
"or",
"self",
".",
"exclude_package_data",
")",
"mat... | def _get_platform_patterns(spec, package, src_dir):
"""
yield platform-specific path patterns (suitable for glob
or fn_match) from a glob-based spec (such as
self.package_data or self.exclude_package_data)
matching package in src_dir.
"""
raw_patterns = itertools.... | [
"def",
"_get_platform_patterns",
"(",
"spec",
",",
"package",
",",
"src_dir",
")",
":",
"raw_patterns",
"=",
"itertools",
".",
"chain",
"(",
"spec",
".",
"get",
"(",
"''",
",",
"[",
"]",
")",
",",
"spec",
".",
"get",
"(",
"package",
",",
"[",
"]",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/build_py.py#L226-L241 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/ops/loop.py | python | Loop.update_loop_output_ports_type | (loop_node: Node) | Update the data type for Loop output ports.
:param loop_node: The Loop node
:return: None | Update the data type for Loop output ports. | [
"Update",
"the",
"data",
"type",
"for",
"Loop",
"output",
"ports",
"."
] | def update_loop_output_ports_type(loop_node: Node):
"""
Update the data type for Loop output ports.
:param loop_node: The Loop node
:return: None
"""
assert loop_node.soft_get('type') == 'Loop'
for record in loop_node.output_port_map:
body_node = Loop... | [
"def",
"update_loop_output_ports_type",
"(",
"loop_node",
":",
"Node",
")",
":",
"assert",
"loop_node",
".",
"soft_get",
"(",
"'type'",
")",
"==",
"'Loop'",
"for",
"record",
"in",
"loop_node",
".",
"output_port_map",
":",
"body_node",
"=",
"Loop",
".",
"get_bo... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/ops/loop.py#L201-L217 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | PNEANet.AddNode | (self, *args) | return _snap.PNEANet_AddNode(self, *args) | AddNode(PNEANet self, int NId=-1) -> int
Parameters:
NId: int
AddNode(PNEANet self) -> int
AddNode(PNEANet self, TNEANet::TNodeI const & NodeId) -> int
Parameters:
NodeId: TNEANet::TNodeI const & | AddNode(PNEANet self, int NId=-1) -> int | [
"AddNode",
"(",
"PNEANet",
"self",
"int",
"NId",
"=",
"-",
"1",
")",
"-",
">",
"int"
] | def AddNode(self, *args):
"""
AddNode(PNEANet self, int NId=-1) -> int
Parameters:
NId: int
AddNode(PNEANet self) -> int
AddNode(PNEANet self, TNEANet::TNodeI const & NodeId) -> int
Parameters:
NodeId: TNEANet::TNodeI const &
"""
... | [
"def",
"AddNode",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"PNEANet_AddNode",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L23130-L23144 | |
aimerykong/Low-Rank-Bilinear-Pooling | 487eb2c857fd9c95357a5166b0c15ad0fe135b28 | caffe-20160312/python/caffe/pycaffe.py | python | _Net_blobs | (self) | return OrderedDict(zip(self._blob_names, self._blobs)) | An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name | An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"blobs",
"indexed",
"by",
"name"
] | def _Net_blobs(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name
"""
return OrderedDict(zip(self._blob_names, self._blobs)) | [
"def",
"_Net_blobs",
"(",
"self",
")",
":",
"return",
"OrderedDict",
"(",
"zip",
"(",
"self",
".",
"_blob_names",
",",
"self",
".",
"_blobs",
")",
")"
] | https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/python/caffe/pycaffe.py#L25-L30 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/labeled_tensor/python/ops/core.py | python | Axis.index | (self, value) | return self._index[value] | Returns the integer position of the given tick label. | Returns the integer position of the given tick label. | [
"Returns",
"the",
"integer",
"position",
"of",
"the",
"given",
"tick",
"label",
"."
] | def index(self, value):
"""Returns the integer position of the given tick label."""
if self._index is None:
raise ValueError('Axis does not have tick labels')
return self._index[value] | [
"def",
"index",
"(",
"self",
",",
"value",
")",
":",
"if",
"self",
".",
"_index",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Axis does not have tick labels'",
")",
"return",
"self",
".",
"_index",
"[",
"value",
"]"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/labeled_tensor/python/ops/core.py#L167-L171 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/losses/python/losses/loss_ops.py | python | absolute_difference | (predictions, labels=None, weights=1.0, scope=None) | Adds an Absolute Difference loss to the training procedure.
`weights` acts as a coefficient for the loss. If a scalar is provided, then
the loss is simply scaled by the given value. If `weights` is a tensor of size
[batch_size], then the total loss for each sample of the batch is rescaled
by the corresponding ... | Adds an Absolute Difference loss to the training procedure. | [
"Adds",
"an",
"Absolute",
"Difference",
"loss",
"to",
"the",
"training",
"procedure",
"."
] | def absolute_difference(predictions, labels=None, weights=1.0, scope=None):
"""Adds an Absolute Difference loss to the training procedure.
`weights` acts as a coefficient for the loss. If a scalar is provided, then
the loss is simply scaled by the given value. If `weights` is a tensor of size
[batch_size], the... | [
"def",
"absolute_difference",
"(",
"predictions",
",",
"labels",
"=",
"None",
",",
"weights",
"=",
"1.0",
",",
"scope",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"scope",
",",
"\"absolute_difference\"",
",",
"[",
"predictions",
",",
"la... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/losses/python/losses/loss_ops.py#L268-L299 | ||
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/devices.py | python | Device.__getattr__ | (self, key) | return DevMemoryPair(self, memory) | device hierarchy | device hierarchy | [
"device",
"hierarchy"
] | def __getattr__(self, key):
""" device hierarchy """
if key in self.config.keys():
return self.config[key]
memory = self.storage[key]
return DevMemoryPair(self, memory) | [
"def",
"__getattr__",
"(",
"self",
",",
"key",
")",
":",
"if",
"key",
"in",
"self",
".",
"config",
".",
"keys",
"(",
")",
":",
"return",
"self",
".",
"config",
"[",
"key",
"]",
"memory",
"=",
"self",
".",
"storage",
"[",
"key",
"]",
"return",
"De... | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/devices.py#L119-L124 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/attrs/attr/_make.py | python | Attribute.__setstate__ | (self, state) | Play nice with pickle. | Play nice with pickle. | [
"Play",
"nice",
"with",
"pickle",
"."
] | def __setstate__(self, state):
"""
Play nice with pickle.
"""
self._setattrs(zip(self.__slots__, state)) | [
"def",
"__setstate__",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"_setattrs",
"(",
"zip",
"(",
"self",
".",
"__slots__",
",",
"state",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/attrs/attr/_make.py#L2643-L2647 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/cluster/ClusterServer.py | python | ClusterServer.handleNamedMovement | (self, data) | Update cameraJig position to reflect latest position | Update cameraJig position to reflect latest position | [
"Update",
"cameraJig",
"position",
"to",
"reflect",
"latest",
"position"
] | def handleNamedMovement(self, data):
""" Update cameraJig position to reflect latest position """
(name,x, y, z, h, p, r,sx,sy,sz, red, g, b, a, hidden) = data
if name in self.objectMappings:
self.objectMappings[name].setPosHpr(render, x, y, z, h, p, r)
self.objectMapping... | [
"def",
"handleNamedMovement",
"(",
"self",
",",
"data",
")",
":",
"(",
"name",
",",
"x",
",",
"y",
",",
"z",
",",
"h",
",",
"p",
",",
"r",
",",
"sx",
",",
"sy",
",",
"sz",
",",
"red",
",",
"g",
",",
"b",
",",
"a",
",",
"hidden",
")",
"=",... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/cluster/ClusterServer.py#L297-L309 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/compiler/future.py | python | is_future | (stmt) | Return true if statement is a well-formed future statement | Return true if statement is a well-formed future statement | [
"Return",
"true",
"if",
"statement",
"is",
"a",
"well",
"-",
"formed",
"future",
"statement"
] | def is_future(stmt):
"""Return true if statement is a well-formed future statement"""
if not isinstance(stmt, ast.From):
return 0
if stmt.modname == "__future__":
return 1
else:
return 0 | [
"def",
"is_future",
"(",
"stmt",
")",
":",
"if",
"not",
"isinstance",
"(",
"stmt",
",",
"ast",
".",
"From",
")",
":",
"return",
"0",
"if",
"stmt",
".",
"modname",
"==",
"\"__future__\"",
":",
"return",
"1",
"else",
":",
"return",
"0"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/compiler/future.py#L7-L14 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiDockArt.SetColor | (*args, **kwargs) | return _aui.AuiDockArt_SetColor(*args, **kwargs) | SetColor(self, int id, Colour color) | SetColor(self, int id, Colour color) | [
"SetColor",
"(",
"self",
"int",
"id",
"Colour",
"color",
")"
] | def SetColor(*args, **kwargs):
"""SetColor(self, int id, Colour color)"""
return _aui.AuiDockArt_SetColor(*args, **kwargs) | [
"def",
"SetColor",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiDockArt_SetColor",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L994-L996 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.ScrollToStart | (*args, **kwargs) | return _stc.StyledTextCtrl_ScrollToStart(*args, **kwargs) | ScrollToStart(self) | ScrollToStart(self) | [
"ScrollToStart",
"(",
"self",
")"
] | def ScrollToStart(*args, **kwargs):
"""ScrollToStart(self)"""
return _stc.StyledTextCtrl_ScrollToStart(*args, **kwargs) | [
"def",
"ScrollToStart",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_ScrollToStart",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L6377-L6379 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/device_utils.py | python | DeviceUtils.Install | (self, apk, allow_downgrade=False, reinstall=False,
permissions=None, timeout=None, retries=None) | Install an APK.
Noop if an identical APK is already installed.
Args:
apk: An ApkHelper instance or string containing the path to the APK.
allow_downgrade: A boolean indicating if we should allow downgrades.
reinstall: A boolean indicating if we should keep any existing app data.
permis... | Install an APK. | [
"Install",
"an",
"APK",
"."
] | def Install(self, apk, allow_downgrade=False, reinstall=False,
permissions=None, timeout=None, retries=None):
"""Install an APK.
Noop if an identical APK is already installed.
Args:
apk: An ApkHelper instance or string containing the path to the APK.
allow_downgrade: A boolean in... | [
"def",
"Install",
"(",
"self",
",",
"apk",
",",
"allow_downgrade",
"=",
"False",
",",
"reinstall",
"=",
"False",
",",
"permissions",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"retries",
"=",
"None",
")",
":",
"self",
".",
"_InstallInternal",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/device_utils.py#L622-L643 | ||
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/utils/float.py | python | comparable | (
x: Array, *, bin_density: int = 3326400, offset: float = 5413 / 15629
) | return np.asarray(np.rint(np.asarray(x) * bin_density + offset), dtype=int) | Casts a floating point input to integer-indexed bins that are safe to compare
or hash.
Arguments:
x: the float array to be converted
bin_density: the inverse width of each bin. When binning rational numbers,
it's best to use a multiple of all expected denominators `bin_density`.
... | Casts a floating point input to integer-indexed bins that are safe to compare
or hash. | [
"Casts",
"a",
"floating",
"point",
"input",
"to",
"integer",
"-",
"indexed",
"bins",
"that",
"are",
"safe",
"to",
"compare",
"or",
"hash",
"."
] | def comparable(
x: Array, *, bin_density: int = 3326400, offset: float = 5413 / 15629
) -> Array:
"""
Casts a floating point input to integer-indexed bins that are safe to compare
or hash.
Arguments:
x: the float array to be converted
bin_density: the inverse width of each bin. When... | [
"def",
"comparable",
"(",
"x",
":",
"Array",
",",
"*",
",",
"bin_density",
":",
"int",
"=",
"3326400",
",",
"offset",
":",
"float",
"=",
"5413",
"/",
"15629",
")",
"->",
"Array",
":",
"return",
"np",
".",
"asarray",
"(",
"np",
".",
"rint",
"(",
"... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/utils/float.py#L22-L47 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.HitTest | (self, x, y) | return wx.NOT_FOUND, None | HitTest method for a :class:`UltimateListCtrl`.
:param `x`: the mouse `x` position;
:param `y`: the mouse `y` position.
:see: :meth:`~UltimateListMainWindow.HitTestLine` for a list of return flags. | HitTest method for a :class:`UltimateListCtrl`. | [
"HitTest",
"method",
"for",
"a",
":",
"class",
":",
"UltimateListCtrl",
"."
] | def HitTest(self, x, y):
"""
HitTest method for a :class:`UltimateListCtrl`.
:param `x`: the mouse `x` position;
:param `y`: the mouse `y` position.
:see: :meth:`~UltimateListMainWindow.HitTestLine` for a list of return flags.
"""
x, y = self.Ca... | [
"def",
"HitTest",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"x",
",",
"y",
"=",
"self",
".",
"CalcUnscrolledPosition",
"(",
"x",
",",
"y",
")",
"count",
"=",
"self",
".",
"GetItemCount",
"(",
")",
"if",
"self",
".",
"InReportView",
"(",
")",
":"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L10182-L10216 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/expression.py | python | Expression.is_hermitian | (self) | return (self.is_real() and self.is_symmetric()) | Is the expression a Hermitian matrix? | Is the expression a Hermitian matrix? | [
"Is",
"the",
"expression",
"a",
"Hermitian",
"matrix?"
] | def is_hermitian(self) -> bool:
"""Is the expression a Hermitian matrix?
"""
return (self.is_real() and self.is_symmetric()) | [
"def",
"is_hermitian",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"(",
"self",
".",
"is_real",
"(",
")",
"and",
"self",
".",
"is_symmetric",
"(",
")",
")"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/expression.py#L291-L294 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/sliceviewer/adsobsever.py | python | SliceViewerADSObserver.replaceHandle | (self, ws_name, workspace) | Called when the ADS has replaced a workspace with one of the same name.
If this workspace is the same as that of the sliceviewer model, the model
is replaced.
:param ws_name: The name of the workspace.
:param workspace: A reference to the new workspace | Called when the ADS has replaced a workspace with one of the same name.
If this workspace is the same as that of the sliceviewer model, the model
is replaced.
:param ws_name: The name of the workspace.
:param workspace: A reference to the new workspace | [
"Called",
"when",
"the",
"ADS",
"has",
"replaced",
"a",
"workspace",
"with",
"one",
"of",
"the",
"same",
"name",
".",
"If",
"this",
"workspace",
"is",
"the",
"same",
"as",
"that",
"of",
"the",
"sliceviewer",
"model",
"the",
"model",
"is",
"replaced",
"."... | def replaceHandle(self, ws_name, workspace):
"""
Called when the ADS has replaced a workspace with one of the same name.
If this workspace is the same as that of the sliceviewer model, the model
is replaced.
:param ws_name: The name of the workspace.
:param workspace: A r... | [
"def",
"replaceHandle",
"(",
"self",
",",
"ws_name",
",",
"workspace",
")",
":",
"self",
".",
"on_replace_workspace",
"(",
"ws_name",
",",
"workspace",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/adsobsever.py#L63-L71 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/impl/api.py | python | to_code | (entity, recursive=True, experimental_optional_features=None) | return textwrap.dedent(source) | Returns the source code generated by AutoGraph, as a string.
Example usage:
>>> def f(x):
... if x < 0:
... x = -x
... return x
>>> tf.autograph.to_code(f)
"...def tf__f(x):..."
Also see: `tf.autograph.to_graph`.
Note: If a function has been decorated with `tf.function`, pass its
underly... | Returns the source code generated by AutoGraph, as a string. | [
"Returns",
"the",
"source",
"code",
"generated",
"by",
"AutoGraph",
"as",
"a",
"string",
"."
] | def to_code(entity, recursive=True, experimental_optional_features=None):
"""Returns the source code generated by AutoGraph, as a string.
Example usage:
>>> def f(x):
... if x < 0:
... x = -x
... return x
>>> tf.autograph.to_code(f)
"...def tf__f(x):..."
Also see: `tf.autograph.to_graph`.
... | [
"def",
"to_code",
"(",
"entity",
",",
"recursive",
"=",
"True",
",",
"experimental_optional_features",
"=",
"None",
")",
":",
"source",
"=",
"tf_inspect",
".",
"getsource",
"(",
"to_graph",
"(",
"entity",
",",
"recursive",
"=",
"recursive",
",",
"experimental_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/impl/api.py#L904-L945 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlNode.addChild | (self, cur) | return __tmp | Add a new node to @parent, at the end of the child (or
property) list merging adjacent TEXT nodes (in which case
@cur is freed) If the new node is ATTRIBUTE, it is added
into properties instead of children. If there is an
attribute with equal name, it is first destroyed. | Add a new node to | [
"Add",
"a",
"new",
"node",
"to"
] | def addChild(self, cur):
"""Add a new node to @parent, at the end of the child (or
property) list merging adjacent TEXT nodes (in which case
@cur is freed) If the new node is ATTRIBUTE, it is added
into properties instead of children. If there is an
attribute with equal ... | [
"def",
"addChild",
"(",
"self",
",",
"cur",
")",
":",
"if",
"cur",
"is",
"None",
":",
"cur__o",
"=",
"None",
"else",
":",
"cur__o",
"=",
"cur",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlAddChild",
"(",
"self",
".",
"_o",
",",
"cur__o",
")",
"... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L3077-L3088 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py | python | GraphRewriter.rewrite | (self, output_node_names) | return self.output_graph | Triggers rewriting of the float graph.
Args:
output_node_names: A list of names of the nodes that produce the final
results.
Returns:
A quantized version of the float graph. | Triggers rewriting of the float graph. | [
"Triggers",
"rewriting",
"of",
"the",
"float",
"graph",
"."
] | def rewrite(self, output_node_names):
"""Triggers rewriting of the float graph.
Args:
output_node_names: A list of names of the nodes that produce the final
results.
Returns:
A quantized version of the float graph.
"""
self.output_graph = tf.GraphDef()
output_nodes = [self.... | [
"def",
"rewrite",
"(",
"self",
",",
"output_node_names",
")",
":",
"self",
".",
"output_graph",
"=",
"tf",
".",
"GraphDef",
"(",
")",
"output_nodes",
"=",
"[",
"self",
".",
"nodes_map",
"[",
"output_node_name",
"]",
"for",
"output_node_name",
"in",
"output_n... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py#L307-L349 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBLineEntry.SetLine | (self, line) | return _lldb.SBLineEntry_SetLine(self, line) | SetLine(SBLineEntry self, uint32_t line) | SetLine(SBLineEntry self, uint32_t line) | [
"SetLine",
"(",
"SBLineEntry",
"self",
"uint32_t",
"line",
")"
] | def SetLine(self, line):
"""SetLine(SBLineEntry self, uint32_t line)"""
return _lldb.SBLineEntry_SetLine(self, line) | [
"def",
"SetLine",
"(",
"self",
",",
"line",
")",
":",
"return",
"_lldb",
".",
"SBLineEntry_SetLine",
"(",
"self",
",",
"line",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L6740-L6742 | |
DanielSWolf/rhubarb-lip-sync | 5cface0af3b6e4e58c0b829c51561d784fb9f52f | rhubarb/lib/webrtc-8d2248ff/webrtc/video/full_stack_plot.py | python | Data._generate_additional_data | (self) | Calculates sender time, receiver time etc. from the raw data. | Calculates sender time, receiver time etc. from the raw data. | [
"Calculates",
"sender",
"time",
"receiver",
"time",
"etc",
".",
"from",
"the",
"raw",
"data",
"."
] | def _generate_additional_data(self):
"""Calculates sender time, receiver time etc. from the raw data."""
s = self.samples
last_render_time = 0
for field_id in [SENDER_TIME, RECEIVER_TIME, END_TO_END, RENDERED_DELTA]:
s[field_id] = [0] * self.length
for k in range(self.length):
s[SENDER_... | [
"def",
"_generate_additional_data",
"(",
"self",
")",
":",
"s",
"=",
"self",
".",
"samples",
"last_render_time",
"=",
"0",
"for",
"field_id",
"in",
"[",
"SENDER_TIME",
",",
"RECEIVER_TIME",
",",
"END_TO_END",
",",
"RENDERED_DELTA",
"]",
":",
"s",
"[",
"field... | https://github.com/DanielSWolf/rhubarb-lip-sync/blob/5cface0af3b6e4e58c0b829c51561d784fb9f52f/rhubarb/lib/webrtc-8d2248ff/webrtc/video/full_stack_plot.py#L138-L154 | ||
evpo/EncryptPad | 156904860aaba8e7e8729b44e269b2992f9fe9f4 | configure.py | python | CompilerInfo.gen_shared_flags | (self, options) | return ' '.join(list(flag_builder())) | Return the shared library build flags, if any | Return the shared library build flags, if any | [
"Return",
"the",
"shared",
"library",
"build",
"flags",
"if",
"any"
] | def gen_shared_flags(self, options):
"""
Return the shared library build flags, if any
"""
def flag_builder():
return ''
return ' '.join(list(flag_builder())) | [
"def",
"gen_shared_flags",
"(",
"self",
",",
"options",
")",
":",
"def",
"flag_builder",
"(",
")",
":",
"return",
"''",
"return",
"' '",
".",
"join",
"(",
"list",
"(",
"flag_builder",
"(",
")",
")",
")"
] | https://github.com/evpo/EncryptPad/blob/156904860aaba8e7e8729b44e269b2992f9fe9f4/configure.py#L992-L1000 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/operator.py | python | truth | (a) | return True if a else False | Return True if a is true, False otherwise. | Return True if a is true, False otherwise. | [
"Return",
"True",
"if",
"a",
"is",
"true",
"False",
"otherwise",
"."
] | def truth(a):
"Return True if a is true, False otherwise."
return True if a else False | [
"def",
"truth",
"(",
"a",
")",
":",
"return",
"True",
"if",
"a",
"else",
"False"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/operator.py#L57-L59 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/simpleapi.py | python | _translate | () | return new_func_attrs | Loop through the algorithms and register a function call
for each of them
:returns: a list of the name of new function calls | Loop through the algorithms and register a function call
for each of them
:returns: a list of the name of new function calls | [
"Loop",
"through",
"the",
"algorithms",
"and",
"register",
"a",
"function",
"call",
"for",
"each",
"of",
"them",
":",
"returns",
":",
"a",
"list",
"of",
"the",
"name",
"of",
"new",
"function",
"calls"
] | def _translate():
"""
Loop through the algorithms and register a function call
for each of them
:returns: a list of the name of new function calls
"""
from mantid.api import AlgorithmFactory, AlgorithmManager
new_func_attrs = []
# Method names mapped to their algorithm names... | [
"def",
"_translate",
"(",
")",
":",
"from",
"mantid",
".",
"api",
"import",
"AlgorithmFactory",
",",
"AlgorithmManager",
"new_func_attrs",
"=",
"[",
"]",
"# Method names mapped to their algorithm names. Used to detect multiple copies of same method name",
"# on different algorith... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/simpleapi.py#L1210-L1249 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn.py | python | DNNClassifier._get_train_ops | (self, features, targets) | return super(DNNClassifier, self)._get_train_ops(features, targets) | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def _get_train_ops(self, features, targets):
"""See base class."""
self._validate_dnn_feature_columns(features)
return super(DNNClassifier, self)._get_train_ops(features, targets) | [
"def",
"_get_train_ops",
"(",
"self",
",",
"features",
",",
"targets",
")",
":",
"self",
".",
"_validate_dnn_feature_columns",
"(",
"features",
")",
"return",
"super",
"(",
"DNNClassifier",
",",
"self",
")",
".",
"_get_train_ops",
"(",
"features",
",",
"target... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn.py#L181-L184 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/indexes/frozen.py | python | FrozenList.union | (self, other) | return type(self)(super(FrozenList, self).__add__(other)) | Returns a FrozenList with other concatenated to the end of self.
Parameters
----------
other : array-like
The array-like whose elements we are concatenating.
Returns
-------
diff : FrozenList
The collection difference between self and other. | Returns a FrozenList with other concatenated to the end of self. | [
"Returns",
"a",
"FrozenList",
"with",
"other",
"concatenated",
"to",
"the",
"end",
"of",
"self",
"."
] | def union(self, other):
"""
Returns a FrozenList with other concatenated to the end of self.
Parameters
----------
other : array-like
The array-like whose elements we are concatenating.
Returns
-------
diff : FrozenList
The collec... | [
"def",
"union",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"tuple",
")",
":",
"other",
"=",
"list",
"(",
"other",
")",
"return",
"type",
"(",
"self",
")",
"(",
"super",
"(",
"FrozenList",
",",
"self",
")",
".",
"_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/frozen.py#L34-L50 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/estimator/python/estimator/extenders.py | python | _TransformGradients.apply_gradients | (self, grads_and_vars, global_step=None, name=None) | return self._optimizer.apply_gradients(grads_and_vars, global_step, name) | Apply gradients to variables.
Calls `transform_grads_fn`, and then applies the real optimizer.
Args:
grads_and_vars: List of (gradient, variable) pairs as returned by
compute_gradients().
global_step: Optional Variable to increment by one after the
variables have been updated.
... | Apply gradients to variables. | [
"Apply",
"gradients",
"to",
"variables",
"."
] | def apply_gradients(self, grads_and_vars, global_step=None, name=None):
"""Apply gradients to variables.
Calls `transform_grads_fn`, and then applies the real optimizer.
Args:
grads_and_vars: List of (gradient, variable) pairs as returned by
compute_gradients().
global_step: Optional V... | [
"def",
"apply_gradients",
"(",
"self",
",",
"grads_and_vars",
",",
"global_step",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"grads_and_vars",
"=",
"self",
".",
"_transform_grads_fn",
"(",
"grads_and_vars",
")",
"return",
"self",
".",
"_optimizer",
".",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/estimator/python/estimator/extenders.py#L286-L307 | |
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.2/SuperAnimSample/cocos2d/plugin/tools/android-build.py | python | select_toolchain_version | () | Because ndk-r8e uses gcc4.6 as default. gcc4.6 doesn't support c++11. So we should select gcc4.7 when
using ndk-r8e. But gcc4.7 is removed in ndk-r9, so we should determine whether gcc4.7 exist.
Conclution:
ndk-r8e -> use gcc4.7
ndk-r9 -> use gcc4.8 | Because ndk-r8e uses gcc4.6 as default. gcc4.6 doesn't support c++11. So we should select gcc4.7 when
using ndk-r8e. But gcc4.7 is removed in ndk-r9, so we should determine whether gcc4.7 exist.
Conclution:
ndk-r8e -> use gcc4.7
ndk-r9 -> use gcc4.8 | [
"Because",
"ndk",
"-",
"r8e",
"uses",
"gcc4",
".",
"6",
"as",
"default",
".",
"gcc4",
".",
"6",
"doesn",
"t",
"support",
"c",
"++",
"11",
".",
"So",
"we",
"should",
"select",
"gcc4",
".",
"7",
"when",
"using",
"ndk",
"-",
"r8e",
".",
"But",
"gcc4... | def select_toolchain_version():
'''Because ndk-r8e uses gcc4.6 as default. gcc4.6 doesn't support c++11. So we should select gcc4.7 when
using ndk-r8e. But gcc4.7 is removed in ndk-r9, so we should determine whether gcc4.7 exist.
Conclution:
ndk-r8e -> use gcc4.7
ndk-r9 -> use gcc4.8
'''
... | [
"def",
"select_toolchain_version",
"(",
")",
":",
"ndk_root",
"=",
"check_environment_variables",
"(",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"os",
".",
"path",
".",
"join",
"(",
"ndk_root",
",",
"\"toolchains/arm-linux-androideabi-4.8\"",
")",
")",
... | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.2/SuperAnimSample/cocos2d/plugin/tools/android-build.py#L25-L42 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/batch_execution.py | python | create_initial_reduction_packages | (state, workspaces, monitors) | return packages | This provides the initial split of the workspaces.
If the data stems from multi-period data, then we need to split up the workspaces. The state object is valid
for each one of these workspaces. Hence we need to create a deep copy of them for each reduction package.
The way multi-period files are handled o... | This provides the initial split of the workspaces. | [
"This",
"provides",
"the",
"initial",
"split",
"of",
"the",
"workspaces",
"."
] | def create_initial_reduction_packages(state, workspaces, monitors):
"""
This provides the initial split of the workspaces.
If the data stems from multi-period data, then we need to split up the workspaces. The state object is valid
for each one of these workspaces. Hence we need to create a deep copy o... | [
"def",
"create_initial_reduction_packages",
"(",
"state",
",",
"workspaces",
",",
"monitors",
")",
":",
"# For loaded peri0d we create a package",
"packages",
"=",
"[",
"]",
"data_info",
"=",
"state",
".",
"data",
"sample_scatter_period",
"=",
"data_info",
".",
"sampl... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/batch_execution.py#L600-L653 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/framework/dtypes.py | python | DType.min | (self) | Returns the minimum representable value in this data type.
Raises:
TypeError: if this is a non-numeric, unordered, or quantized type. | Returns the minimum representable value in this data type. | [
"Returns",
"the",
"minimum",
"representable",
"value",
"in",
"this",
"data",
"type",
"."
] | def min(self):
"""Returns the minimum representable value in this data type.
Raises:
TypeError: if this is a non-numeric, unordered, or quantized type.
"""
if (self.is_quantized or self.base_dtype in
(bool, string, complex64, complex128)):
raise TypeError("Cannot find minimum value... | [
"def",
"min",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"is_quantized",
"or",
"self",
".",
"base_dtype",
"in",
"(",
"bool",
",",
"string",
",",
"complex64",
",",
"complex128",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"Cannot find minimum value of %... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/dtypes.py#L172-L191 | ||
simsong/bulk_extractor | 738911df22b7066ca9e1662f4131fb44090a4196 | python/dfxml.py | python | registry_value_object.mtime | (self) | return None | Return nothing. Alternatively, we might return mtime of parent key in the future. | Return nothing. Alternatively, we might return mtime of parent key in the future. | [
"Return",
"nothing",
".",
"Alternatively",
"we",
"might",
"return",
"mtime",
"of",
"parent",
"key",
"in",
"the",
"future",
"."
] | def mtime(self):
"""Return nothing. Alternatively, we might return mtime of parent key in the future."""
return None | [
"def",
"mtime",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/dfxml.py#L562-L564 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py | python | pyparsing_common.convertToDate | (fmt="%Y-%m-%d") | return cvt_fn | Helper to create a parse action for converting parsed date string to Python datetime.date
Params -
- fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"})
Example::
date_expr = pyparsing_common.iso8601_date.copy()
date_expr.setParseAction(pyparsing_com... | Helper to create a parse action for converting parsed date string to Python datetime.date | [
"Helper",
"to",
"create",
"a",
"parse",
"action",
"for",
"converting",
"parsed",
"date",
"string",
"to",
"Python",
"datetime",
".",
"date"
] | def convertToDate(fmt="%Y-%m-%d"):
"""
Helper to create a parse action for converting parsed date string to Python datetime.date
Params -
- fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"})
Example::
date_expr = pyparsing_common.iso8601_date.co... | [
"def",
"convertToDate",
"(",
"fmt",
"=",
"\"%Y-%m-%d\"",
")",
":",
"def",
"cvt_fn",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"try",
":",
"return",
"datetime",
".",
"strptime",
"(",
"t",
"[",
"0",
"]",
",",
"fmt",
")",
".",
"date",
"(",
")",
"exc... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py#L5593-L5612 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/queues.py | python | Queue.get_nowait | (self) | return item | Remove and return an item from the queue.
Return an item if one is immediately available, else raise QueueEmpty. | Remove and return an item from the queue. | [
"Remove",
"and",
"return",
"an",
"item",
"from",
"the",
"queue",
"."
] | def get_nowait(self):
"""Remove and return an item from the queue.
Return an item if one is immediately available, else raise QueueEmpty.
"""
if self.empty():
raise QueueEmpty
item = self._get()
self._wakeup_next(self._putters)
return item | [
"def",
"get_nowait",
"(",
"self",
")",
":",
"if",
"self",
".",
"empty",
"(",
")",
":",
"raise",
"QueueEmpty",
"item",
"=",
"self",
".",
"_get",
"(",
")",
"self",
".",
"_wakeup_next",
"(",
"self",
".",
"_putters",
")",
"return",
"item"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/queues.py#L176-L185 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/util.py | python | EventMixin.get_subscribers | (self, event) | return iter(self._subscribers.get(event, ())) | Return an iterator for the subscribers for an event.
:param event: The event to return subscribers for. | Return an iterator for the subscribers for an event.
:param event: The event to return subscribers for. | [
"Return",
"an",
"iterator",
"for",
"the",
"subscribers",
"for",
"an",
"event",
".",
":",
"param",
"event",
":",
"The",
"event",
"to",
"return",
"subscribers",
"for",
"."
] | def get_subscribers(self, event):
"""
Return an iterator for the subscribers for an event.
:param event: The event to return subscribers for.
"""
return iter(self._subscribers.get(event, ())) | [
"def",
"get_subscribers",
"(",
"self",
",",
"event",
")",
":",
"return",
"iter",
"(",
"self",
".",
"_subscribers",
".",
"get",
"(",
"event",
",",
"(",
")",
")",
")"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/util.py#L1020-L1025 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.focus_displayof | (self) | return self._nametowidget(name) | Return the widget which has currently the focus on the
display where this widget is located.
Return None if the application does not have the focus. | Return the widget which has currently the focus on the
display where this widget is located. | [
"Return",
"the",
"widget",
"which",
"has",
"currently",
"the",
"focus",
"on",
"the",
"display",
"where",
"this",
"widget",
"is",
"located",
"."
] | def focus_displayof(self):
"""Return the widget which has currently the focus on the
display where this widget is located.
Return None if the application does not have the focus."""
name = self.tk.call('focus', '-displayof', self._w)
if name == 'none' or not name: return None
... | [
"def",
"focus_displayof",
"(",
"self",
")",
":",
"name",
"=",
"self",
".",
"tk",
".",
"call",
"(",
"'focus'",
",",
"'-displayof'",
",",
"self",
".",
"_w",
")",
"if",
"name",
"==",
"'none'",
"or",
"not",
"name",
":",
"return",
"None",
"return",
"self"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L547-L554 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | Trap | (*args) | return _misc_.Trap(*args) | Trap() | Trap() | [
"Trap",
"()"
] | def Trap(*args):
"""Trap()"""
return _misc_.Trap(*args) | [
"def",
"Trap",
"(",
"*",
"args",
")",
":",
"return",
"_misc_",
".",
"Trap",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L417-L419 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/experimental/ops/resampling.py | python | _calculate_acceptance_probs_with_mixing | (initial_probs, target_probs) | return a_i, m | Calculates the acceptance probabilities and mixing ratio.
In this case, we assume that we can *either* sample from the original data
distribution with probability `m`, or sample from a reshaped distribution
that comes from rejection sampling on the original distribution. This
rejection sampling is done on a pe... | Calculates the acceptance probabilities and mixing ratio. | [
"Calculates",
"the",
"acceptance",
"probabilities",
"and",
"mixing",
"ratio",
"."
] | def _calculate_acceptance_probs_with_mixing(initial_probs, target_probs):
"""Calculates the acceptance probabilities and mixing ratio.
In this case, we assume that we can *either* sample from the original data
distribution with probability `m`, or sample from a reshaped distribution
that comes from rejection s... | [
"def",
"_calculate_acceptance_probs_with_mixing",
"(",
"initial_probs",
",",
"target_probs",
")",
":",
"ratio_l",
"=",
"_get_target_to_initial_ratio",
"(",
"initial_probs",
",",
"target_probs",
")",
"max_ratio",
"=",
"math_ops",
".",
"reduce_max",
"(",
"ratio_l",
")",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/experimental/ops/resampling.py#L221-L295 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/perf/benchmarks/v8.py | python | V8Adword.CreateStorySet | (self, options) | return story_set | Creates the instance of StorySet used to run the benchmark.
Can be overridden by subclasses. | Creates the instance of StorySet used to run the benchmark. | [
"Creates",
"the",
"instance",
"of",
"StorySet",
"used",
"to",
"run",
"the",
"benchmark",
"."
] | def CreateStorySet(self, options):
"""Creates the instance of StorySet used to run the benchmark.
Can be overridden by subclasses.
"""
story_set = story.StorySet(
archive_data_file=os.path.join(
path_util.GetPerfStorySetsDir(), 'data', 'v8_pages.json'),
cloud_storage_bucket=... | [
"def",
"CreateStorySet",
"(",
"self",
",",
"options",
")",
":",
"story_set",
"=",
"story",
".",
"StorySet",
"(",
"archive_data_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"path_util",
".",
"GetPerfStorySetsDir",
"(",
")",
",",
"'data'",
",",
"'v8_page... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/benchmarks/v8.py#L280-L290 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/base64mime.py | python | header_encode | (header, charset='iso-8859-1', keep_eols=False,
maxlinelen=76, eol=NL) | return joiner.join(lines) | Encode a single header line with Base64 encoding in a given charset.
Defined in RFC 2045, this Base64 encoding is identical to normal Base64
encoding, except that each line must be intelligently wrapped (respecting
the Base64 encoding), and subsequent lines must start with a space.
charset names the c... | Encode a single header line with Base64 encoding in a given charset. | [
"Encode",
"a",
"single",
"header",
"line",
"with",
"Base64",
"encoding",
"in",
"a",
"given",
"charset",
"."
] | def header_encode(header, charset='iso-8859-1', keep_eols=False,
maxlinelen=76, eol=NL):
"""Encode a single header line with Base64 encoding in a given charset.
Defined in RFC 2045, this Base64 encoding is identical to normal Base64
encoding, except that each line must be intelligently wr... | [
"def",
"header_encode",
"(",
"header",
",",
"charset",
"=",
"'iso-8859-1'",
",",
"keep_eols",
"=",
"False",
",",
"maxlinelen",
"=",
"76",
",",
"eol",
"=",
"NL",
")",
":",
"# Return empty headers unchanged",
"if",
"not",
"header",
":",
"return",
"header",
"if... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/base64mime.py#L64-L118 | |
EricLYang/courseRepo | 60679ec7ec130fe0cff9d26b704f1e286e5fde13 | 9_class/arcodelocal/build/devel/_setup_util.py | python | find_env_hooks | (environ, cmake_prefix_path) | return lines | Generate shell code with found environment hooks
for the all workspaces. | Generate shell code with found environment hooks
for the all workspaces. | [
"Generate",
"shell",
"code",
"with",
"found",
"environment",
"hooks",
"for",
"the",
"all",
"workspaces",
"."
] | def find_env_hooks(environ, cmake_prefix_path):
'''
Generate shell code with found environment hooks
for the all workspaces.
'''
lines = []
lines.append(comment('found environment hooks in workspaces'))
generic_env_hooks = []
generic_env_hooks_workspace = []
specific_env_hooks = []
... | [
"def",
"find_env_hooks",
"(",
"environ",
",",
"cmake_prefix_path",
")",
":",
"lines",
"=",
"[",
"]",
"lines",
".",
"append",
"(",
"comment",
"(",
"'found environment hooks in workspaces'",
")",
")",
"generic_env_hooks",
"=",
"[",
"]",
"generic_env_hooks_workspace",
... | https://github.com/EricLYang/courseRepo/blob/60679ec7ec130fe0cff9d26b704f1e286e5fde13/9_class/arcodelocal/build/devel/_setup_util.py#L199-L248 | |
alibaba/MNN | c4d9566171d589c3ded23aa18ffb197016995a12 | pymnn/pip_package/MNN/expr/__init__.py | python | argmax | (x, axis=0) | return _F.argmax(x, axis) | argmax(x, axis=0)
Return argmax of `x` along the `axis`.
Parameters
----------
x : var_like, input value.
axis : int, input value. Default is 0.
Returns
-------
c : Var. The argmax of `x` along the `axis`, dtype is int32.
Example:
-------
>>> expr.argmax([[1,2],[3,4]])
... | argmax(x, axis=0)
Return argmax of `x` along the `axis`. | [
"argmax",
"(",
"x",
"axis",
"=",
"0",
")",
"Return",
"argmax",
"of",
"x",
"along",
"the",
"axis",
"."
] | def argmax(x, axis=0):
'''
argmax(x, axis=0)
Return argmax of `x` along the `axis`.
Parameters
----------
x : var_like, input value.
axis : int, input value. Default is 0.
Returns
-------
c : Var. The argmax of `x` along the `axis`, dtype is int32.
Example:
-------
... | [
"def",
"argmax",
"(",
"x",
",",
"axis",
"=",
"0",
")",
":",
"x",
"=",
"_to_var",
"(",
"x",
")",
"axis",
"=",
"_to_int",
"(",
"axis",
")",
"return",
"_F",
".",
"argmax",
"(",
"x",
",",
"axis",
")"
] | https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L1513-L1534 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/frame_filters.py | python | ShowFrameFilterPriority.complete | (self, text, word) | Completion function for both frame filter dictionary, and
frame filter name. | Completion function for both frame filter dictionary, and
frame filter name. | [
"Completion",
"function",
"for",
"both",
"frame",
"filter",
"dictionary",
"and",
"frame",
"filter",
"name",
"."
] | def complete(self, text, word):
"""Completion function for both frame filter dictionary, and
frame filter name."""
if text.count(" ") == 0:
return _complete_frame_filter_list(text, word, False)
else:
printer_list = frame._return_list(text.split()[0].rstrip())
... | [
"def",
"complete",
"(",
"self",
",",
"text",
",",
"word",
")",
":",
"if",
"text",
".",
"count",
"(",
"\" \"",
")",
"==",
"0",
":",
"return",
"_complete_frame_filter_list",
"(",
"text",
",",
"word",
",",
"False",
")",
"else",
":",
"printer_list",
"=",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/frame_filters.py#L435-L443 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/collections.py | python | Counter.update | (self, iterable=None, **kwds) | Like dict.update() but add counts instead of replacing them.
Source can be an iterable, a dictionary, or another Counter instance.
>>> c = Counter('which')
>>> c.update('witch') # add elements from another iterable
>>> d = Counter('watch')
>>> c.update(d) ... | Like dict.update() but add counts instead of replacing them. | [
"Like",
"dict",
".",
"update",
"()",
"but",
"add",
"counts",
"instead",
"of",
"replacing",
"them",
"."
] | def update(self, iterable=None, **kwds):
'''Like dict.update() but add counts instead of replacing them.
Source can be an iterable, a dictionary, or another Counter instance.
>>> c = Counter('which')
>>> c.update('witch') # add elements from another iterable
>>> d = C... | [
"def",
"update",
"(",
"self",
",",
"iterable",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"# The regular dict.update() operation makes no sense here because the",
"# replace behavior results in the some of original untouched counts",
"# being mixed-in with all of the other counts ... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/collections.py#L495-L528 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/third_party/jinja2/debug.py | python | ProcessedTraceback.exc_info | (self) | return self.exc_type, self.exc_value, self.frames[0] | Exception info tuple with a proxy around the frame objects. | Exception info tuple with a proxy around the frame objects. | [
"Exception",
"info",
"tuple",
"with",
"a",
"proxy",
"around",
"the",
"frame",
"objects",
"."
] | def exc_info(self):
"""Exception info tuple with a proxy around the frame objects."""
return self.exc_type, self.exc_value, self.frames[0] | [
"def",
"exc_info",
"(",
"self",
")",
":",
"return",
"self",
".",
"exc_type",
",",
"self",
".",
"exc_value",
",",
"self",
".",
"frames",
"[",
"0",
"]"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/debug.py#L117-L119 | |
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/numpy_interface/dataset_adapter.py | python | VTKNoneArrayMetaClass.__new__ | (mcs, name, parent, attr) | return type.__new__(mcs, name, parent, attr) | Simplify the implementation of the numeric/logical sequence API. | Simplify the implementation of the numeric/logical sequence API. | [
"Simplify",
"the",
"implementation",
"of",
"the",
"numeric",
"/",
"logical",
"sequence",
"API",
"."
] | def __new__(mcs, name, parent, attr):
"""Simplify the implementation of the numeric/logical sequence API."""
def _add_op(attr_name, op):
"""Create an attribute named attr_name that calls
_numeric_op(self, other, op)."""
def closure(self, other):
return... | [
"def",
"__new__",
"(",
"mcs",
",",
"name",
",",
"parent",
",",
"attr",
")",
":",
"def",
"_add_op",
"(",
"attr_name",
",",
"op",
")",
":",
"\"\"\"Create an attribute named attr_name that calls\n _numeric_op(self, other, op).\"\"\"",
"def",
"closure",
"(",
"s... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/numpy_interface/dataset_adapter.py#L339-L385 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/save.py | python | _write_object_proto | (obj, proto, asset_file_def_index) | Saves an object into SavedObject proto. | Saves an object into SavedObject proto. | [
"Saves",
"an",
"object",
"into",
"SavedObject",
"proto",
"."
] | def _write_object_proto(obj, proto, asset_file_def_index):
"""Saves an object into SavedObject proto."""
if isinstance(obj, tracking.TrackableAsset):
proto.asset.SetInParent()
proto.asset.asset_file_def_index = asset_file_def_index[obj]
elif resource_variable_ops.is_resource_variable(obj):
proto.varia... | [
"def",
"_write_object_proto",
"(",
"obj",
",",
"proto",
",",
"asset_file_def_index",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"tracking",
".",
"TrackableAsset",
")",
":",
"proto",
".",
"asset",
".",
"SetInParent",
"(",
")",
"proto",
".",
"asset",
"."... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/save.py#L633-L670 | ||
qt-creator/qt-creator | c9cd00f2ce590e9b272ad69214dc910e92bf62eb | share/qtcreator/debugger/gdbtracepoint.py | python | GDBTracepoint.__init__ | (self, spec, **kwargs) | Constructor | Constructor | [
"Constructor"
] | def __init__(self, spec, **kwargs):
"""
Constructor
"""
kwargs['internal'] = True
super(GDBTracepoint, self).__init__(spec, **kwargs)
self.caps = [] | [
"def",
"__init__",
"(",
"self",
",",
"spec",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'internal'",
"]",
"=",
"True",
"super",
"(",
"GDBTracepoint",
",",
"self",
")",
".",
"__init__",
"(",
"spec",
",",
"*",
"*",
"kwargs",
")",
"self",
".",... | https://github.com/qt-creator/qt-creator/blob/c9cd00f2ce590e9b272ad69214dc910e92bf62eb/share/qtcreator/debugger/gdbtracepoint.py#L81-L87 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py | python | DNNLinearCombinedClassifier.predict | (self, x=None, input_fn=None, batch_size=None, as_iterable=False) | Returns predicted classes for given features.
Args:
x: features.
input_fn: Input function. If set, x must be None.
batch_size: Override default batch size.
as_iterable: If True, return an iterable which keeps yielding predictions
for each example until inputs are exhausted. Note: Th... | Returns predicted classes for given features. | [
"Returns",
"predicted",
"classes",
"for",
"given",
"features",
"."
] | def predict(self, x=None, input_fn=None, batch_size=None, as_iterable=False):
"""Returns predicted classes for given features.
Args:
x: features.
input_fn: Input function. If set, x must be None.
batch_size: Override default batch size.
as_iterable: If True, return an iterable which kee... | [
"def",
"predict",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"as_iterable",
"=",
"False",
")",
":",
"predictions",
"=",
"self",
".",
"predict_proba",
"(",
"x",
"=",
"x",
",",
"input_fn",
"="... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py#L391-L412 | ||
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/common/module.py | python | startJava | (jar, cla) | start the named java class unless it is already running | start the named java class unless it is already running | [
"start",
"the",
"named",
"java",
"class",
"unless",
"it",
"is",
"already",
"running"
] | def startJava(jar, cla):
"""
start the named java class unless it is already running
"""
global opennero_sub_procs
print 'java', jar, cla
if (jar, cla) not in opennero_sub_procs:
subproc = subprocess.Popen(['java', '-classpath', jar, cla])
opennero_sub_procs[(jar, cla)] = subproc... | [
"def",
"startJava",
"(",
"jar",
",",
"cla",
")",
":",
"global",
"opennero_sub_procs",
"print",
"'java'",
",",
"jar",
",",
"cla",
"if",
"(",
"jar",
",",
"cla",
")",
"not",
"in",
"opennero_sub_procs",
":",
"subproc",
"=",
"subprocess",
".",
"Popen",
"(",
... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/common/module.py#L77-L89 | ||
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/service_reflection.py | python | _ServiceStubBuilder.BuildServiceStub | (self, cls) | Constructs the stub class.
Args:
cls: The class that will be constructed. | Constructs the stub class. | [
"Constructs",
"the",
"stub",
"class",
"."
] | def BuildServiceStub(self, cls):
"""Constructs the stub class.
Args:
cls: The class that will be constructed.
"""
def _ServiceStubInit(stub, rpc_channel):
stub.rpc_channel = rpc_channel
self.cls = cls
cls.__init__ = _ServiceStubInit
for method in self.descriptor.methods:
... | [
"def",
"BuildServiceStub",
"(",
"self",
",",
"cls",
")",
":",
"def",
"_ServiceStubInit",
"(",
"stub",
",",
"rpc_channel",
")",
":",
"stub",
".",
"rpc_channel",
"=",
"rpc_channel",
"self",
".",
"cls",
"=",
"cls",
"cls",
".",
"__init__",
"=",
"_ServiceStubIn... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/service_reflection.py#L254-L266 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/inelastic/dgs_diagnose_detectors.py | python | DiagnoseDetectorsWidget.get_state | (self) | return d | Returns an object with the state of the interface | Returns an object with the state of the interface | [
"Returns",
"an",
"object",
"with",
"the",
"state",
"of",
"the",
"interface"
] | def get_state(self):
"""
Returns an object with the state of the interface
"""
d = DiagnoseDetectorsScript(self._instrument_name)
d.high_counts = util._check_and_get_float_line_edit(self._content.high_counts_edit)
d.low_counts = util._check_and_get_float_line_edit(sel... | [
"def",
"get_state",
"(",
"self",
")",
":",
"d",
"=",
"DiagnoseDetectorsScript",
"(",
"self",
".",
"_instrument_name",
")",
"d",
".",
"high_counts",
"=",
"util",
".",
"_check_and_get_float_line_edit",
"(",
"self",
".",
"_content",
".",
"high_counts_edit",
")",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/inelastic/dgs_diagnose_detectors.py#L103-L127 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenuItemGroup.Add | (self, item) | Adds a new item to the group.
:param `item`: an instance of :class:`FlatMenu`. | Adds a new item to the group. | [
"Adds",
"a",
"new",
"item",
"to",
"the",
"group",
"."
] | def Add(self, item):
"""
Adds a new item to the group.
:param `item`: an instance of :class:`FlatMenu`.
"""
if item.IsChecked():
# uncheck all other items
for exitem in self._items:
exitem._bIsChecked = False
self._items.... | [
"def",
"Add",
"(",
"self",
",",
"item",
")",
":",
"if",
"item",
".",
"IsChecked",
"(",
")",
":",
"# uncheck all other items",
"for",
"exitem",
"in",
"self",
".",
"_items",
":",
"exitem",
".",
"_bIsChecked",
"=",
"False",
"self",
".",
"_items",
".",
"ap... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L4145-L4157 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/training_v1.py | python | Model._targets | (self) | return [
e.training_target.target
for e in self._training_endpoints
if e.has_training_target()
] | The output target tensors for the model. | The output target tensors for the model. | [
"The",
"output",
"target",
"tensors",
"for",
"the",
"model",
"."
] | def _targets(self):
"""The output target tensors for the model."""
return [
e.training_target.target
for e in self._training_endpoints
if e.has_training_target()
] | [
"def",
"_targets",
"(",
"self",
")",
":",
"return",
"[",
"e",
".",
"training_target",
".",
"target",
"for",
"e",
"in",
"self",
".",
"_training_endpoints",
"if",
"e",
".",
"has_training_target",
"(",
")",
"]"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training_v1.py#L2692-L2698 | |
facebookresearch/habitat-sim | 63b6c71d9ca8adaefb140b198196f5d0ca1f1e34 | src_python/habitat_sim/utils/compare_profiles.py | python | create_summary_from_events | (events: List[Event]) | return items | From a list of events, group by name and create summary items. Returns a
dictionary of items keyed by name. | From a list of events, group by name and create summary items. Returns a
dictionary of items keyed by name. | [
"From",
"a",
"list",
"of",
"events",
"group",
"by",
"name",
"and",
"create",
"summary",
"items",
".",
"Returns",
"a",
"dictionary",
"of",
"items",
"keyed",
"by",
"name",
"."
] | def create_summary_from_events(events: List[Event]) -> DefaultDict[str, SummaryItem]:
"""From a list of events, group by name and create summary items. Returns a
dictionary of items keyed by name."""
# sort by start time (ascending). For ties, sort by end time (descending). In this way,
# a (shorter) ch... | [
"def",
"create_summary_from_events",
"(",
"events",
":",
"List",
"[",
"Event",
"]",
")",
"->",
"DefaultDict",
"[",
"str",
",",
"SummaryItem",
"]",
":",
"# sort by start time (ascending). For ties, sort by end time (descending). In this way,",
"# a (shorter) child event that sta... | https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/src_python/habitat_sim/utils/compare_profiles.py#L97-L160 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/linalg/linear_operator.py | python | _extract_attrs | (op, keys) | return kwargs | Extract constructor kwargs to reconstruct `op`.
Args:
op: A `LinearOperator` instance.
keys: A Python `tuple` of strings indicating the names of the constructor
kwargs to extract from `op`.
Returns:
kwargs: A Python `dict` of kwargs to `op`'s constructor, keyed by `keys`. | Extract constructor kwargs to reconstruct `op`. | [
"Extract",
"constructor",
"kwargs",
"to",
"reconstruct",
"op",
"."
] | def _extract_attrs(op, keys):
"""Extract constructor kwargs to reconstruct `op`.
Args:
op: A `LinearOperator` instance.
keys: A Python `tuple` of strings indicating the names of the constructor
kwargs to extract from `op`.
Returns:
kwargs: A Python `dict` of kwargs to `op`'s constructor, keyed... | [
"def",
"_extract_attrs",
"(",
"op",
",",
"keys",
")",
":",
"kwargs",
"=",
"{",
"}",
"not_found",
"=",
"object",
"(",
")",
"for",
"k",
"in",
"keys",
":",
"srcs",
"=",
"[",
"getattr",
"(",
"op",
",",
"k",
",",
"not_found",
")",
",",
"getattr",
"(",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/linear_operator.py#L1281-L1316 | |
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | clang/bindings/python/clang/cindex.py | python | Cursor.is_move_constructor | (self) | return conf.lib.clang_CXXConstructor_isMoveConstructor(self) | Returns True if the cursor refers to a C++ move constructor. | Returns True if the cursor refers to a C++ move constructor. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"move",
"constructor",
"."
] | def is_move_constructor(self):
"""Returns True if the cursor refers to a C++ move constructor.
"""
return conf.lib.clang_CXXConstructor_isMoveConstructor(self) | [
"def",
"is_move_constructor",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXConstructor_isMoveConstructor",
"(",
"self",
")"
] | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L1465-L1468 | |
ros-drivers/rosserial | c169ae2173dcfda7cee567d64beae45198459400 | rosserial_python/src/rosserial_python/SerialClient.py | python | Publisher.__init__ | (self, topic_info) | Create a new publisher. | Create a new publisher. | [
"Create",
"a",
"new",
"publisher",
"."
] | def __init__(self, topic_info):
""" Create a new publisher. """
self.topic = topic_info.topic_name
# find message type
package, message = topic_info.message_type.split('/')
self.message = load_message(package, message)
if self.message._md5sum == topic_info.md5sum:
... | [
"def",
"__init__",
"(",
"self",
",",
"topic_info",
")",
":",
"self",
".",
"topic",
"=",
"topic_info",
".",
"topic_name",
"# find message type",
"package",
",",
"message",
"=",
"topic_info",
".",
"message_type",
".",
"split",
"(",
"'/'",
")",
"self",
".",
"... | https://github.com/ros-drivers/rosserial/blob/c169ae2173dcfda7cee567d64beae45198459400/rosserial_python/src/rosserial_python/SerialClient.py#L94-L104 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/tensor/math.py | python | mm | (input, mat2, name=None) | return out | Applies matrix multiplication to two tensors.
Currently, the input tensors' rank can be any, but when the rank of any
inputs is bigger than 3, this two inputs' rank should be equal.
Also note that if the raw tensor :math:`x` or :math:`mat2` is rank-1 and
nontransposed, the prepended or appended dimen... | [] | def mm(input, mat2, name=None):
"""
Applies matrix multiplication to two tensors.
Currently, the input tensors' rank can be any, but when the rank of any
inputs is bigger than 3, this two inputs' rank should be equal.
Also note that if the raw tensor :math:`x` or :math:`mat2` is rank-1 and
n... | [
"def",
"mm",
"(",
"input",
",",
"mat2",
",",
"name",
"=",
"None",
")",
":",
"if",
"in_dygraph_mode",
"(",
")",
":",
"return",
"_C_ops",
".",
"matmul_v2",
"(",
"input",
",",
"mat2",
")",
"def",
"__check_input",
"(",
"x",
",",
"y",
")",
":",
"var_nam... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/math.py#L1099-L1210 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/data/python/ops/dataset_ops.py | python | Dataset.dense_to_sparse_batch | (self, batch_size, row_shape) | return DenseToSparseBatchDataset(self, batch_size, row_shape) | Batches ragged elements of this dataset into `tf.SparseTensor`s.
Like `Dataset.padded_batch()`, this method combines multiple
consecutive elements of this dataset, which might have different
shapes, into a single element. The resulting element has three
components (`indices`, `values`, and `dense_shape... | Batches ragged elements of this dataset into `tf.SparseTensor`s. | [
"Batches",
"ragged",
"elements",
"of",
"this",
"dataset",
"into",
"tf",
".",
"SparseTensor",
"s",
"."
] | def dense_to_sparse_batch(self, batch_size, row_shape):
"""Batches ragged elements of this dataset into `tf.SparseTensor`s.
Like `Dataset.padded_batch()`, this method combines multiple
consecutive elements of this dataset, which might have different
shapes, into a single element. The resulting element ... | [
"def",
"dense_to_sparse_batch",
"(",
"self",
",",
"batch_size",
",",
"row_shape",
")",
":",
"return",
"DenseToSparseBatchDataset",
"(",
"self",
",",
"batch_size",
",",
"row_shape",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/data/python/ops/dataset_ops.py#L880-L920 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/devtools_monitor.py | python | DevToolsConnection.SyncRequestNoResponse | (self, method, params=None) | As SyncRequest, but asserts that no meaningful response was received.
Args:
method: (str) Method.
params: (dict) Optional parameters to the request. | As SyncRequest, but asserts that no meaningful response was received. | [
"As",
"SyncRequest",
"but",
"asserts",
"that",
"no",
"meaningful",
"response",
"was",
"received",
"."
] | def SyncRequestNoResponse(self, method, params=None):
"""As SyncRequest, but asserts that no meaningful response was received.
Args:
method: (str) Method.
params: (dict) Optional parameters to the request.
"""
result = self.SyncRequest(method, params)
if 'error' in result or ('result' i... | [
"def",
"SyncRequestNoResponse",
"(",
"self",
",",
"method",
",",
"params",
"=",
"None",
")",
":",
"result",
"=",
"self",
".",
"SyncRequest",
"(",
"method",
",",
"params",
")",
"if",
"'error'",
"in",
"result",
"or",
"(",
"'result'",
"in",
"result",
"and",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/devtools_monitor.py#L206-L217 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/txtentry.py | python | CommandEntryBase.OnKeyDown | (self, evt) | Handle KeyDown events | Handle KeyDown events | [
"Handle",
"KeyDown",
"events"
] | def OnKeyDown(self, evt):
"""Handle KeyDown events"""
evt.Skip() | [
"def",
"OnKeyDown",
"(",
"self",
",",
"evt",
")",
":",
"evt",
".",
"Skip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/txtentry.py#L78-L80 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_impl.py | python | depthwise_conv2d | (input,
filter,
strides,
padding,
rate=None,
name=None,
data_format=None,
dilations=None) | Depthwise 2-D convolution.
Given a 4D input tensor ('NHWC' or 'NCHW' data formats)
and a filter tensor of shape
`[filter_height, filter_width, in_channels, channel_multiplier]`
containing `in_channels` convolutional filters of depth 1, `depthwise_conv2d`
applies a different filter to each input channel (expa... | Depthwise 2-D convolution. | [
"Depthwise",
"2",
"-",
"D",
"convolution",
"."
] | def depthwise_conv2d(input,
filter,
strides,
padding,
rate=None,
name=None,
data_format=None,
dilations=None):
"""Depthwise 2-D convolution.
Given a 4D input tensor ('N... | [
"def",
"depthwise_conv2d",
"(",
"input",
",",
"filter",
",",
"strides",
",",
"padding",
",",
"rate",
"=",
"None",
",",
"name",
"=",
"None",
",",
"data_format",
"=",
"None",
",",
"dilations",
"=",
"None",
")",
":",
"rate",
"=",
"deprecated_argument_lookup",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_impl.py#L728-L819 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/_parseaddr.py | python | AddrlistClass.gotonext | (self) | return EMPTYSTRING.join(wslist) | Skip white space and extract comments. | Skip white space and extract comments. | [
"Skip",
"white",
"space",
"and",
"extract",
"comments",
"."
] | def gotonext(self):
"""Skip white space and extract comments."""
wslist = []
while self.pos < len(self.field):
if self.field[self.pos] in self.LWS + '\n\r':
if self.field[self.pos] not in '\n\r':
wslist.append(self.field[self.pos])
... | [
"def",
"gotonext",
"(",
"self",
")",
":",
"wslist",
"=",
"[",
"]",
"while",
"self",
".",
"pos",
"<",
"len",
"(",
"self",
".",
"field",
")",
":",
"if",
"self",
".",
"field",
"[",
"self",
".",
"pos",
"]",
"in",
"self",
".",
"LWS",
"+",
"'\\n\\r'"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/_parseaddr.py#L236-L248 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.GetSizeTuple | (*args, **kwargs) | return _core_.Window_GetSizeTuple(*args, **kwargs) | GetSizeTuple() -> (width, height)
Get the window size. | GetSizeTuple() -> (width, height) | [
"GetSizeTuple",
"()",
"-",
">",
"(",
"width",
"height",
")"
] | def GetSizeTuple(*args, **kwargs):
"""
GetSizeTuple() -> (width, height)
Get the window size.
"""
return _core_.Window_GetSizeTuple(*args, **kwargs) | [
"def",
"GetSizeTuple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetSizeTuple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L9509-L9515 | |
ampl/mp | cad8d370089a76507cb9c5518c21a1097f4a504b | support/create-packages.py | python | Package.getfiles | (self, system, versions) | return files | Get the list of files for the given system. | Get the list of files for the given system. | [
"Get",
"the",
"list",
"of",
"files",
"for",
"the",
"given",
"system",
"."
] | def getfiles(self, system, versions):
"""Get the list of files for the given system."""
version = versions[self.version_name].split('-')[0]
files = list(self._files)
if system == 'osx':
files += self._sysfiles.get('osx', [])
elif system.startswith('win'):
files += self._sysfiles.get('win... | [
"def",
"getfiles",
"(",
"self",
",",
"system",
",",
"versions",
")",
":",
"version",
"=",
"versions",
"[",
"self",
".",
"version_name",
"]",
".",
"split",
"(",
"'-'",
")",
"[",
"0",
"]",
"files",
"=",
"list",
"(",
"self",
".",
"_files",
")",
"if",
... | https://github.com/ampl/mp/blob/cad8d370089a76507cb9c5518c21a1097f4a504b/support/create-packages.py#L23-L35 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/contrib/crosstalk/crosstalk_cntk.py | python | CNTKCrosstalk.load_all_params | (self) | Load all parameters from files in working directory | Load all parameters from files in working directory | [
"Load",
"all",
"parameters",
"from",
"files",
"in",
"working",
"directory"
] | def load_all_params(self):
'''
Load all parameters from files in working directory
'''
super(CNTKCrosstalk, self).load([n for n in self.vars.keys() if self.is_param(n)]) | [
"def",
"load_all_params",
"(",
"self",
")",
":",
"super",
"(",
"CNTKCrosstalk",
",",
"self",
")",
".",
"load",
"(",
"[",
"n",
"for",
"n",
"in",
"self",
".",
"vars",
".",
"keys",
"(",
")",
"if",
"self",
".",
"is_param",
"(",
"n",
")",
"]",
")"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/contrib/crosstalk/crosstalk_cntk.py#L237-L241 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/stringold.py | python | find | (s, *args) | return _apply(s.find, args) | find(s, sub [,start [,end]]) -> in
Return the lowest index in s where substring sub is found,
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure. | find(s, sub [,start [,end]]) -> in | [
"find",
"(",
"s",
"sub",
"[",
"start",
"[",
"end",
"]]",
")",
"-",
">",
"in"
] | def find(s, *args):
"""find(s, sub [,start [,end]]) -> in
Return the lowest index in s where substring sub is found,
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
"""
return _apply(s.find, args... | [
"def",
"find",
"(",
"s",
",",
"*",
"args",
")",
":",
"return",
"_apply",
"(",
"s",
".",
"find",
",",
"args",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/stringold.py#L165-L175 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatnotebook.py | python | FNBRendererFancy.DrawTab | (self, pageContainer, dc, posx, tabIdx, tabWidth, tabHeight, btnStatus) | Draws a tab using the `Fancy` style, similar to the `VC71` one but with gradients.
:param `pageContainer`: an instance of :class:`FlatNotebook`;
:param `dc`: an instance of :class:`DC`;
:param `posx`: the x position of the tab;
:param `tabIdx`: the index of the tab;
:param `tabW... | Draws a tab using the `Fancy` style, similar to the `VC71` one but with gradients. | [
"Draws",
"a",
"tab",
"using",
"the",
"Fancy",
"style",
"similar",
"to",
"the",
"VC71",
"one",
"but",
"with",
"gradients",
"."
] | def DrawTab(self, pageContainer, dc, posx, tabIdx, tabWidth, tabHeight, btnStatus):
"""
Draws a tab using the `Fancy` style, similar to the `VC71` one but with gradients.
:param `pageContainer`: an instance of :class:`FlatNotebook`;
:param `dc`: an instance of :class:`DC`;
:para... | [
"def",
"DrawTab",
"(",
"self",
",",
"pageContainer",
",",
"dc",
",",
"posx",
",",
"tabIdx",
",",
"tabWidth",
",",
"tabHeight",
",",
"btnStatus",
")",
":",
"# Fancy tabs - like with VC71 but with the following differences:",
"# - The Selected tab is coloured with gradient co... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L2925-L3024 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py | python | PageElement.findPreviousSibling | (self, name=None, attrs={}, text=None, **kwargs) | return self._findOne(self.findPreviousSiblings, name, attrs, text,
**kwargs) | Returns the closest sibling to this Tag that matches the
given criteria and appears before this Tag in the document. | Returns the closest sibling to this Tag that matches the
given criteria and appears before this Tag in the document. | [
"Returns",
"the",
"closest",
"sibling",
"to",
"this",
"Tag",
"that",
"matches",
"the",
"given",
"criteria",
"and",
"appears",
"before",
"this",
"Tag",
"in",
"the",
"document",
"."
] | def findPreviousSibling(self, name=None, attrs={}, text=None, **kwargs):
"""Returns the closest sibling to this Tag that matches the
given criteria and appears before this Tag in the document."""
return self._findOne(self.findPreviousSiblings, name, attrs, text,
**kw... | [
"def",
"findPreviousSibling",
"(",
"self",
",",
"name",
"=",
"None",
",",
"attrs",
"=",
"{",
"}",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_findOne",
"(",
"self",
".",
"findPreviousSiblings",
",",
"name",
"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L291-L295 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/queue_runner_impl.py | python | start_queue_runners | (sess=None, coord=None, daemon=True, start=True,
collection=ops.GraphKeys.QUEUE_RUNNERS) | return threads | Starts all queue runners collected in the graph.
This is a companion method to `add_queue_runner()`. It just starts
threads for all queue runners collected in the graph. It returns
the list of all threads.
Args:
sess: `Session` used to run the queue ops. Defaults to the
default session.
coord... | Starts all queue runners collected in the graph. | [
"Starts",
"all",
"queue",
"runners",
"collected",
"in",
"the",
"graph",
"."
] | def start_queue_runners(sess=None, coord=None, daemon=True, start=True,
collection=ops.GraphKeys.QUEUE_RUNNERS):
"""Starts all queue runners collected in the graph.
This is a companion method to `add_queue_runner()`. It just starts
threads for all queue runners collected in the graph. I... | [
"def",
"start_queue_runners",
"(",
"sess",
"=",
"None",
",",
"coord",
"=",
"None",
",",
"daemon",
"=",
"True",
",",
"start",
"=",
"True",
",",
"collection",
"=",
"ops",
".",
"GraphKeys",
".",
"QUEUE_RUNNERS",
")",
":",
"if",
"sess",
"is",
"None",
":",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/queue_runner_impl.py#L393-L438 | |
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/ops/audio_ops.py | python | AudioIOTensor.__len__ | (self) | return self._shape[0] | Returns the total number of items of this IOTensor. | Returns the total number of items of this IOTensor. | [
"Returns",
"the",
"total",
"number",
"of",
"items",
"of",
"this",
"IOTensor",
"."
] | def __len__(self):
"""Returns the total number of items of this IOTensor."""
return self._shape[0] | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"self",
".",
"_shape",
"[",
"0",
"]"
] | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/audio_ops.py#L745-L747 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/operator.py | python | add | (a, b) | return a + b | Same as a + b. | Same as a + b. | [
"Same",
"as",
"a",
"+",
"b",
"."
] | def add(a, b):
"Same as a + b."
return a + b | [
"def",
"add",
"(",
"a",
",",
"b",
")",
":",
"return",
"a",
"+",
"b"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/operator.py#L75-L77 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py | python | SpawnBase.expect_loop | (self, searcher, timeout=-1, searchwindowsize=-1) | return exp.expect_loop(timeout) | This is the common loop used inside expect. The 'searcher' should be
an instance of searcher_re or searcher_string, which describes how and
what to search for in the input.
See expect() for other arguments, return value and exceptions. | This is the common loop used inside expect. The 'searcher' should be
an instance of searcher_re or searcher_string, which describes how and
what to search for in the input. | [
"This",
"is",
"the",
"common",
"loop",
"used",
"inside",
"expect",
".",
"The",
"searcher",
"should",
"be",
"an",
"instance",
"of",
"searcher_re",
"or",
"searcher_string",
"which",
"describes",
"how",
"and",
"what",
"to",
"search",
"for",
"in",
"the",
"input"... | def expect_loop(self, searcher, timeout=-1, searchwindowsize=-1):
'''This is the common loop used inside expect. The 'searcher' should be
an instance of searcher_re or searcher_string, which describes how and
what to search for in the input.
See expect() for other arguments, return valu... | [
"def",
"expect_loop",
"(",
"self",
",",
"searcher",
",",
"timeout",
"=",
"-",
"1",
",",
"searchwindowsize",
"=",
"-",
"1",
")",
":",
"exp",
"=",
"Expecter",
"(",
"self",
",",
"searcher",
",",
"searchwindowsize",
")",
"return",
"exp",
".",
"expect_loop",
... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L420-L428 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/WebOb/webob/multidict.py | python | MultiDict.getall | (self, key) | return [v for k, v in self._items if k == key] | Return a list of all values matching the key (may be an empty list) | Return a list of all values matching the key (may be an empty list) | [
"Return",
"a",
"list",
"of",
"all",
"values",
"matching",
"the",
"key",
"(",
"may",
"be",
"an",
"empty",
"list",
")"
] | def getall(self, key):
"""
Return a list of all values matching the key (may be an empty list)
"""
return [v for k, v in self._items if k == key] | [
"def",
"getall",
"(",
"self",
",",
"key",
")",
":",
"return",
"[",
"v",
"for",
"k",
",",
"v",
"in",
"self",
".",
"_items",
"if",
"k",
"==",
"key",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/WebOb/webob/multidict.py#L114-L118 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/stubout.py | python | StubOutForTesting.UnsetAll | (self) | Reverses all the Set() calls, restoring things to their original
definition. Its okay to call UnsetAll() repeatedly, as later calls have
no effect if no Set() calls have been made. | Reverses all the Set() calls, restoring things to their original
definition. Its okay to call UnsetAll() repeatedly, as later calls have
no effect if no Set() calls have been made. | [
"Reverses",
"all",
"the",
"Set",
"()",
"calls",
"restoring",
"things",
"to",
"their",
"original",
"definition",
".",
"Its",
"okay",
"to",
"call",
"UnsetAll",
"()",
"repeatedly",
"as",
"later",
"calls",
"have",
"no",
"effect",
"if",
"no",
"Set",
"()",
"call... | def UnsetAll(self):
"""Reverses all the Set() calls, restoring things to their original
definition. Its okay to call UnsetAll() repeatedly, as later calls have
no effect if no Set() calls have been made.
"""
# Undo calls to Set() in reverse order, in case Set() was called on the
# same argumen... | [
"def",
"UnsetAll",
"(",
"self",
")",
":",
"# Undo calls to Set() in reverse order, in case Set() was called on the",
"# same arguments repeatedly (want the original call to be last one undone)",
"self",
".",
"cache",
".",
"reverse",
"(",
")",
"for",
"(",
"parent",
",",
"old_chi... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/stubout.py#L128-L140 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/mxnet/symbol.py | python | minimum | (left, right) | minimum left and right
Parameters
---------
left: Symbol or Number
right: Symbol or Number
Returns
-------
result: Symbol or Number | minimum left and right | [
"minimum",
"left",
"and",
"right"
] | def minimum(left, right):
""" minimum left and right
Parameters
---------
left: Symbol or Number
right: Symbol or Number
Returns
-------
result: Symbol or Number
"""
if isinstance(left, Symbol) and isinstance(right, Symbol):
return Symbol._Minimum(left, right)
if i... | [
"def",
"minimum",
"(",
"left",
",",
"right",
")",
":",
"if",
"isinstance",
"(",
"left",
",",
"Symbol",
")",
"and",
"isinstance",
"(",
"right",
",",
"Symbol",
")",
":",
"return",
"Symbol",
".",
"_Minimum",
"(",
"left",
",",
"right",
")",
"if",
"isinst... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/symbol.py#L1084-L1105 | ||
yuxng/PoseCNN | 9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04 | lib/setup.py | python | find_in_path | (name, path) | return None | Find a file in a search path | Find a file in a search path | [
"Find",
"a",
"file",
"in",
"a",
"search",
"path"
] | def find_in_path(name, path):
"Find a file in a search path"
#adapted fom http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/
for dir in path.split(os.pathsep):
binpath = pjoin(dir, name)
if os.path.exists(binpath):
return os.path.abspath(binpath)
retur... | [
"def",
"find_in_path",
"(",
"name",
",",
"path",
")",
":",
"#adapted fom http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/",
"for",
"dir",
"in",
"path",
".",
"split",
"(",
"os",
".",
"pathsep",
")",
":",
"binpath",
"=",
"pjoin",
"(",
"dir",
... | https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/setup.py#L15-L22 | |
GeometryCollective/boundary-first-flattening | 8250e5a0e85980ec50b5e8aa8f49dd6519f915cd | deps/nanogui/docs/exhale.py | python | exclaimError | (msg, ansi_fmt="34;1m") | Prints ``msg`` to the console in color with ``(!)`` prepended in color.
Example (uncolorized) output of ``exclaimError("No leading space needed.")``::
(!) No leading space needed.
All messages are written to ``sys.stderr``, and are closed with ``[0m``. The
default color is blue, but can be chang... | Prints ``msg`` to the console in color with ``(!)`` prepended in color. | [
"Prints",
"msg",
"to",
"the",
"console",
"in",
"color",
"with",
"(",
"!",
")",
"prepended",
"in",
"color",
"."
] | def exclaimError(msg, ansi_fmt="34;1m"):
'''
Prints ``msg`` to the console in color with ``(!)`` prepended in color.
Example (uncolorized) output of ``exclaimError("No leading space needed.")``::
(!) No leading space needed.
All messages are written to ``sys.stderr``, and are closed with ``[0... | [
"def",
"exclaimError",
"(",
"msg",
",",
"ansi_fmt",
"=",
"\"34;1m\"",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"\\033[{}(!) {}\\033[0m\\n\"",
".",
"format",
"(",
"ansi_fmt",
",",
"msg",
")",
")"
] | https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/docs/exhale.py#L597-L622 | ||
gwaldron/osgearth | 4c521857d59a69743e4a9cedba00afe570f984e8 | src/third_party/tinygltf/deps/cpplint.py | python | CheckForNonStandardConstructs | (filename, clean_lines, linenum,
nesting_state, error) | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
transition to new compilers.
- put storage class first (e.g. "static const" instead of "const stat... | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. | [
"r",
"Logs",
"an",
"error",
"if",
"we",
"see",
"certain",
"non",
"-",
"ANSI",
"constructs",
"ignored",
"by",
"gcc",
"-",
"2",
"."
] | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint ... | [
"def",
"CheckForNonStandardConstructs",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Remove comments from the line, but leave in strings for now.",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"i... | https://github.com/gwaldron/osgearth/blob/4c521857d59a69743e4a9cedba00afe570f984e8/src/third_party/tinygltf/deps/cpplint.py#L2573-L2734 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/tlslite/tlslite/utils/hmac.py | python | HMAC.update | (self, msg) | Update this hashing object with the string msg. | Update this hashing object with the string msg. | [
"Update",
"this",
"hashing",
"object",
"with",
"the",
"string",
"msg",
"."
] | def update(self, msg):
"""Update this hashing object with the string msg.
"""
self.inner.update(msg) | [
"def",
"update",
"(",
"self",
",",
"msg",
")",
":",
"self",
".",
"inner",
".",
"update",
"(",
"msg",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/utils/hmac.py#L59-L62 | ||
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/tyr/tyr/resources.py | python | _validate_poi_types_json | (poi_types_json) | poi_types configuration must follow some rules so that the binarisation is OK.
It's checked at bina, but tyr must also reject broken config directly so that the user knows. | poi_types configuration must follow some rules so that the binarisation is OK.
It's checked at bina, but tyr must also reject broken config directly so that the user knows. | [
"poi_types",
"configuration",
"must",
"follow",
"some",
"rules",
"so",
"that",
"the",
"binarisation",
"is",
"OK",
".",
"It",
"s",
"checked",
"at",
"bina",
"but",
"tyr",
"must",
"also",
"reject",
"broken",
"config",
"directly",
"so",
"that",
"the",
"user",
... | def _validate_poi_types_json(poi_types_json):
"""
poi_types configuration must follow some rules so that the binarisation is OK.
It's checked at bina, but tyr must also reject broken config directly so that the user knows.
"""
# Check that the conf is a valid json
try:
validate(poi_type... | [
"def",
"_validate_poi_types_json",
"(",
"poi_types_json",
")",
":",
"# Check that the conf is a valid json",
"try",
":",
"validate",
"(",
"poi_types_json",
",",
"poi_type_conf_format",
")",
"except",
"ValidationError",
"as",
"e",
":",
"abort",
"(",
"400",
",",
"status... | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/tyr/tyr/resources.py#L198-L234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.