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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
scanner-research/scanner | 04a0c4b4196341995985acd729c0788aab823e1c | python/scannerpy/kernel.py | python | Kernel.__init__ | (self, config: KernelConfig, init_parameter = None) | r"""
Parameters
----------
config
Contains the configuration settings for this instance of the kernel.
init_parameter
An example init parameter. Any parameters defined in the __init__ method
of a Kernel can be set when creating an instance of the correspon... | r""" | [
"r"
] | def __init__(self, config: KernelConfig, init_parameter = None):
r"""
Parameters
----------
config
Contains the configuration settings for this instance of the kernel.
init_parameter
An example init parameter. Any parameters defined in the __init__ method
... | [
"def",
"__init__",
"(",
"self",
",",
"config",
":",
"KernelConfig",
",",
"init_parameter",
"=",
"None",
")",
":",
"self",
".",
"config",
"=",
"config"
] | https://github.com/scanner-research/scanner/blob/04a0c4b4196341995985acd729c0788aab823e1c/python/scannerpy/kernel.py#L16-L31 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/project.py | python | __get_common_stack_parameters | (context, uploader=None) | return params | Generate common CloudFormation stack parameters | Generate common CloudFormation stack parameters | [
"Generate",
"common",
"CloudFormation",
"stack",
"parameters"
] | def __get_common_stack_parameters(context, uploader=None):
"""Generate common CloudFormation stack parameters"""
project_stack_id = context.config.project_stack_id
params = {
'ConfigurationKey': uploader.key if uploader else None,
'ProjectName': util.get_stack_name_from_arn(project_stack_id)... | [
"def",
"__get_common_stack_parameters",
"(",
"context",
",",
"uploader",
"=",
"None",
")",
":",
"project_stack_id",
"=",
"context",
".",
"config",
".",
"project_stack_id",
"params",
"=",
"{",
"'ConfigurationKey'",
":",
"uploader",
".",
"key",
"if",
"uploader",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/project.py#L354-L361 | |
xbmc/xbmc | 091211a754589fc40a2a1f239b0ce9f4ee138268 | addons/service.xbmc.versioncheck/resources/lib/version_check/json_interface.py | python | get_version_file_list | () | return version_query | Retrieve version lists from supplied version file (resources/versions.txt)
:return: all provided versions
:rtype: dict | Retrieve version lists from supplied version file (resources/versions.txt) | [
"Retrieve",
"version",
"lists",
"from",
"supplied",
"version",
"file",
"(",
"resources",
"/",
"versions",
".",
"txt",
")"
] | def get_version_file_list():
""" Retrieve version lists from supplied version file (resources/versions.txt)
:return: all provided versions
:rtype: dict
"""
version_file = os.path.join(ADDON_PATH, 'resources/versions.txt')
with closing(xbmcvfs.File(version_file)) as open_file:
data = ope... | [
"def",
"get_version_file_list",
"(",
")",
":",
"version_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"ADDON_PATH",
",",
"'resources/versions.txt'",
")",
"with",
"closing",
"(",
"xbmcvfs",
".",
"File",
"(",
"version_file",
")",
")",
"as",
"open_file",
":"... | https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/service.xbmc.versioncheck/resources/lib/version_check/json_interface.py#L52-L67 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py | python | line | ( loc, strg ) | Returns the line of text containing loc within a string, counting newlines as line separators. | Returns the line of text containing loc within a string, counting newlines as line separators. | [
"Returns",
"the",
"line",
"of",
"text",
"containing",
"loc",
"within",
"a",
"string",
"counting",
"newlines",
"as",
"line",
"separators",
"."
] | def line( loc, strg ):
"""Returns the line of text containing loc within a string, counting newlines as line separators.
"""
lastCR = strg.rfind("\n", 0, loc)
nextCR = strg.find("\n", loc)
if nextCR >= 0:
return strg[lastCR+1:nextCR]
else:
return strg[lastCR+1:] | [
"def",
"line",
"(",
"loc",
",",
"strg",
")",
":",
"lastCR",
"=",
"strg",
".",
"rfind",
"(",
"\"\\n\"",
",",
"0",
",",
"loc",
")",
"nextCR",
"=",
"strg",
".",
"find",
"(",
"\"\\n\"",
",",
"loc",
")",
"if",
"nextCR",
">=",
"0",
":",
"return",
"st... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py#L993-L1001 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | Gauge.SetRange | (*args, **kwargs) | return _controls_.Gauge_SetRange(*args, **kwargs) | SetRange(self, int range) | SetRange(self, int range) | [
"SetRange",
"(",
"self",
"int",
"range",
")"
] | def SetRange(*args, **kwargs):
"""SetRange(self, int range)"""
return _controls_.Gauge_SetRange(*args, **kwargs) | [
"def",
"SetRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Gauge_SetRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L747-L749 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ntpath.py | python | dirname | (p) | return split(p)[0] | Returns the directory component of a pathname | Returns the directory component of a pathname | [
"Returns",
"the",
"directory",
"component",
"of",
"a",
"pathname"
] | def dirname(p):
"""Returns the directory component of a pathname"""
return split(p)[0] | [
"def",
"dirname",
"(",
"p",
")",
":",
"return",
"split",
"(",
"p",
")",
"[",
"0",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ntpath.py#L213-L215 | |
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/constraint_solver/doc/routing_svg.py | python | DataModel.starts | (self) | return self._starts | Gets the start nodes indices. | Gets the start nodes indices. | [
"Gets",
"the",
"start",
"nodes",
"indices",
"."
] | def starts(self):
"""Gets the start nodes indices."""
return self._starts | [
"def",
"starts",
"(",
"self",
")",
":",
"return",
"self",
".",
"_starts"
] | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/doc/routing_svg.py#L239-L241 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/fixer_base.py | python | BaseFix.finish_tree | (self, tree, filename) | Some fixers need to maintain tree-wide state.
This method is called once, at the conclusion of tree fix-up.
tree - the root node of the tree to be processed.
filename - the name of the file the tree came from. | Some fixers need to maintain tree-wide state.
This method is called once, at the conclusion of tree fix-up. | [
"Some",
"fixers",
"need",
"to",
"maintain",
"tree",
"-",
"wide",
"state",
".",
"This",
"method",
"is",
"called",
"once",
"at",
"the",
"conclusion",
"of",
"tree",
"fix",
"-",
"up",
"."
] | def finish_tree(self, tree, filename):
"""Some fixers need to maintain tree-wide state.
This method is called once, at the conclusion of tree fix-up.
tree - the root node of the tree to be processed.
filename - the name of the file the tree came from.
"""
pass | [
"def",
"finish_tree",
"(",
"self",
",",
"tree",
",",
"filename",
")",
":",
"pass"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/fixer_base.py#L162-L169 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/_jit_internal.py | python | _extract_tensors | (obj) | return tensors | r"""
This function is exclusively called from C++.
See ``torch/csrc/jit/python/python_ivalue.h``.
It extracts the tensors contained in the given object, through pickling. | r"""
This function is exclusively called from C++.
See ``torch/csrc/jit/python/python_ivalue.h``. | [
"r",
"This",
"function",
"is",
"exclusively",
"called",
"from",
"C",
"++",
".",
"See",
"torch",
"/",
"csrc",
"/",
"jit",
"/",
"python",
"/",
"python_ivalue",
".",
"h",
"."
] | def _extract_tensors(obj):
r"""
This function is exclusively called from C++.
See ``torch/csrc/jit/python/python_ivalue.h``.
It extracts the tensors contained in the given object, through pickling.
"""
tensors: List[torch.Tensor] = []
extractor = _TensorExtractor(io.BytesIO(), protocol=-1, ... | [
"def",
"_extract_tensors",
"(",
"obj",
")",
":",
"tensors",
":",
"List",
"[",
"torch",
".",
"Tensor",
"]",
"=",
"[",
"]",
"extractor",
"=",
"_TensorExtractor",
"(",
"io",
".",
"BytesIO",
"(",
")",
",",
"protocol",
"=",
"-",
"1",
",",
"tensors",
"=",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/_jit_internal.py#L1254-L1264 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/msvs_emulation.py | python | GenerateEnvironmentFiles | (toplevel_build_dir, generator_flags,
system_includes, open_out) | return cl_paths | It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers within the same build (to support
msvs_target_platform hackery). Different architectures require a different
compiler binary,... | It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers within the same build (to support
msvs_target_platform hackery). Different architectures require a different
compiler binary,... | [
"It",
"s",
"not",
"sufficient",
"to",
"have",
"the",
"absolute",
"path",
"to",
"the",
"compiler",
"linker",
"etc",
".",
"on",
"Windows",
"as",
"those",
"tools",
"rely",
"on",
".",
"dlls",
"being",
"in",
"the",
"PATH",
".",
"We",
"also",
"need",
"to",
... | def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags,
system_includes, open_out):
"""It's not sufficient to have the absolute path to the compiler, linker,
etc. on Windows, as those tools rely on .dlls being in the PATH. We also
need to support both x86 and x64 compilers w... | [
"def",
"GenerateEnvironmentFiles",
"(",
"toplevel_build_dir",
",",
"generator_flags",
",",
"system_includes",
",",
"open_out",
")",
":",
"archs",
"=",
"(",
"'x86'",
",",
"'x64'",
")",
"if",
"generator_flags",
".",
"get",
"(",
"'ninja_use_custom_environment_files'",
... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/msvs_emulation.py#L991-L1042 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py | python | greedy_upper_triangulation | (H, verbose=0) | This function performs row/column permutations to bring
H into approximate upper triangular form via greedy
upper triangulation method outlined in Modern Coding
Theory Appendix 1, Section A.2 | This function performs row/column permutations to bring
H into approximate upper triangular form via greedy
upper triangulation method outlined in Modern Coding
Theory Appendix 1, Section A.2 | [
"This",
"function",
"performs",
"row",
"/",
"column",
"permutations",
"to",
"bring",
"H",
"into",
"approximate",
"upper",
"triangular",
"form",
"via",
"greedy",
"upper",
"triangulation",
"method",
"outlined",
"in",
"Modern",
"Coding",
"Theory",
"Appendix",
"1",
... | def greedy_upper_triangulation(H, verbose=0):
"""
This function performs row/column permutations to bring
H into approximate upper triangular form via greedy
upper triangulation method outlined in Modern Coding
Theory Appendix 1, Section A.2
"""
H_t = H.copy()
# Per email from Dr. Urban... | [
"def",
"greedy_upper_triangulation",
"(",
"H",
",",
"verbose",
"=",
"0",
")",
":",
"H_t",
"=",
"H",
".",
"copy",
"(",
")",
"# Per email from Dr. Urbanke, author of this textbook, this",
"# algorithm requires H to be full rank",
"if",
"linalg",
".",
"matrix_rank",
"(",
... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py#L204-L425 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | tools/tempfiles.py | python | TempFiles.get_dir | (self) | return directory | Returns a named temp directory with the given prefix. | Returns a named temp directory with the given prefix. | [
"Returns",
"a",
"named",
"temp",
"directory",
"with",
"the",
"given",
"prefix",
"."
] | def get_dir(self):
"""Returns a named temp directory with the given prefix."""
directory = tempfile.mkdtemp(dir=self.tmpdir)
self.note(directory)
return directory | [
"def",
"get_dir",
"(",
"self",
")",
":",
"directory",
"=",
"tempfile",
".",
"mkdtemp",
"(",
"dir",
"=",
"self",
".",
"tmpdir",
")",
"self",
".",
"note",
"(",
"directory",
")",
"return",
"directory"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/tools/tempfiles.py#L91-L95 | |
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/aio/_server.py | python | Server.stop | (self, grace: Optional[float]) | Stops this Server.
This method immediately stops the server from servicing new RPCs in
all cases.
If a grace period is specified, this method returns immediately and all
RPCs active at the end of the grace period are aborted. If a grace
period is not specified (by passing None ... | Stops this Server. | [
"Stops",
"this",
"Server",
"."
] | async def stop(self, grace: Optional[float]) -> None:
"""Stops this Server.
This method immediately stops the server from servicing new RPCs in
all cases.
If a grace period is specified, this method returns immediately and all
RPCs active at the end of the grace period are abor... | [
"async",
"def",
"stop",
"(",
"self",
",",
"grace",
":",
"Optional",
"[",
"float",
"]",
")",
"->",
"None",
":",
"await",
"self",
".",
"_server",
".",
"shutdown",
"(",
"grace",
")"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/aio/_server.py#L114-L136 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PGCell.SetFont | (*args, **kwargs) | return _propgrid.PGCell_SetFont(*args, **kwargs) | SetFont(self, Font font) | SetFont(self, Font font) | [
"SetFont",
"(",
"self",
"Font",
"font",
")"
] | def SetFont(*args, **kwargs):
"""SetFont(self, Font font)"""
return _propgrid.PGCell_SetFont(*args, **kwargs) | [
"def",
"SetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGCell_SetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L163-L165 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | NDArray._drop_int_axes | (indexed_shape, int_axes) | return tuple(bcast_shape) | drop the axis of indexed_shape corresponding to int axes | drop the axis of indexed_shape corresponding to int axes | [
"drop",
"the",
"axis",
"of",
"indexed_shape",
"corresponding",
"to",
"int",
"axes"
] | def _drop_int_axes(indexed_shape, int_axes):
"""drop the axis of indexed_shape corresponding to int axes"""
bcast_shape = []
for i, size in enumerate(indexed_shape):
if i not in int_axes:
bcast_shape.append(size)
if not bcast_shape:
bcast_shape = [... | [
"def",
"_drop_int_axes",
"(",
"indexed_shape",
",",
"int_axes",
")",
":",
"bcast_shape",
"=",
"[",
"]",
"for",
"i",
",",
"size",
"in",
"enumerate",
"(",
"indexed_shape",
")",
":",
"if",
"i",
"not",
"in",
"int_axes",
":",
"bcast_shape",
".",
"append",
"("... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L959-L967 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html.py | python | HtmlWindow.GetClassDefaultAttributes | (*args, **kwargs) | return _html.HtmlWindow_GetClassDefaultAttributes(*args, **kwargs) | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
co... | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control... | [
"def",
"GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWindow_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L1154-L1169 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.ScrollToColumn | (*args, **kwargs) | return _stc.StyledTextCtrl_ScrollToColumn(*args, **kwargs) | ScrollToColumn(self, int column)
Scroll enough to make the given column visible | ScrollToColumn(self, int column) | [
"ScrollToColumn",
"(",
"self",
"int",
"column",
")"
] | def ScrollToColumn(*args, **kwargs):
"""
ScrollToColumn(self, int column)
Scroll enough to make the given column visible
"""
return _stc.StyledTextCtrl_ScrollToColumn(*args, **kwargs) | [
"def",
"ScrollToColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_ScrollToColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6613-L6619 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/sliceshell.py | python | SlicesShell.Cut | (self) | Remove selection and place it on the clipboard. | Remove selection and place it on the clipboard. | [
"Remove",
"selection",
"and",
"place",
"it",
"on",
"the",
"clipboard",
"."
] | def Cut(self):
"""Remove selection and place it on the clipboard."""
if self.CanCut() and self.CanCopy():
if self.AutoCompActive():
self.AutoCompCancel()
if self.CallTipActive():
self.CallTipCancel()
self.Copy()
self.Replace... | [
"def",
"Cut",
"(",
"self",
")",
":",
"if",
"self",
".",
"CanCut",
"(",
")",
"and",
"self",
".",
"CanCopy",
"(",
")",
":",
"if",
"self",
".",
"AutoCompActive",
"(",
")",
":",
"self",
".",
"AutoCompCancel",
"(",
")",
"if",
"self",
".",
"CallTipActive... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/sliceshell.py#L3362-L3370 | ||
olliw42/storm32bgc | 99d62a6130ae2950514022f50eb669c45a8cc1ba | old/betacopter/old/betacopter36dev-v005/modules/uavcan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py | python | Parser._parse_sub | (self, parsetree, text, fpos=0) | Parse substitutions, and append them to the parse-tree.
Additionally, remove comments. | Parse substitutions, and append them to the parse-tree. | [
"Parse",
"substitutions",
"and",
"append",
"them",
"to",
"the",
"parse",
"-",
"tree",
"."
] | def _parse_sub(self, parsetree, text, fpos=0):
"""Parse substitutions, and append them to the parse-tree.
Additionally, remove comments.
"""
curr = 0
for match in self._reSubstitution.finditer(text):
start = match.start()
if start > curr:
... | [
"def",
"_parse_sub",
"(",
"self",
",",
"parsetree",
",",
"text",
",",
"fpos",
"=",
"0",
")",
":",
"curr",
"=",
"0",
"for",
"match",
"in",
"self",
".",
"_reSubstitution",
".",
"finditer",
"(",
"text",
")",
":",
"start",
"=",
"match",
".",
"start",
"... | https://github.com/olliw42/storm32bgc/blob/99d62a6130ae2950514022f50eb669c45a8cc1ba/old/betacopter/old/betacopter36dev-v005/modules/uavcan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py#L567-L597 | ||
kristjankorjus/Replicating-DeepMind | 68539394e792b34a4d6b430a2eb73b8b8f91d8db | Hybrid/src/ai/layers.py | python | MultiRotMergeLayer.__init__ | (self, input_layer, num_views) | num_views is the number of different input representations that were merged. | num_views is the number of different input representations that were merged. | [
"num_views",
"is",
"the",
"number",
"of",
"different",
"input",
"representations",
"that",
"were",
"merged",
"."
] | def __init__(self, input_layer, num_views):
"""
num_views is the number of different input representations that were merged.
"""
self.input_layer = input_layer
self.num_views = num_views
self.params = []
self.bias_params = []
self.mb_size = self.input_laye... | [
"def",
"__init__",
"(",
"self",
",",
"input_layer",
",",
"num_views",
")",
":",
"self",
".",
"input_layer",
"=",
"input_layer",
"self",
".",
"num_views",
"=",
"num_views",
"self",
".",
"params",
"=",
"[",
"]",
"self",
".",
"bias_params",
"=",
"[",
"]",
... | https://github.com/kristjankorjus/Replicating-DeepMind/blob/68539394e792b34a4d6b430a2eb73b8b8f91d8db/Hybrid/src/ai/layers.py#L1391-L1399 | ||
NeoGeographyToolkit/StereoPipeline | eedf54a919fb5cce1ab0e280bb0df4050763aa11 | src/asp/IceBridge/pleiades_manager.py | python | generateBatchList | (run, options, listPath, logger) | Generate a list of all the processing batches required for a run | Generate a list of all the processing batches required for a run | [
"Generate",
"a",
"list",
"of",
"all",
"the",
"processing",
"batches",
"required",
"for",
"a",
"run"
] | def generateBatchList(run, options, listPath, logger):
'''Generate a list of all the processing batches required for a run'''
logger.info("Generate batch list: " + listPath)
refDemName = icebridge_common.getReferenceDemName(run.site)
refDemPath = os.path.join(options.refDemFolder, refDemName)
... | [
"def",
"generateBatchList",
"(",
"run",
",",
"options",
",",
"listPath",
",",
"logger",
")",
":",
"logger",
".",
"info",
"(",
"\"Generate batch list: \"",
"+",
"listPath",
")",
"refDemName",
"=",
"icebridge_common",
".",
"getReferenceDemName",
"(",
"run",
".",
... | https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/pleiades_manager.py#L480-L517 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/Chop.py | python | chbmts | (a, b, c, m, x) | return out | ! Essentially CHEBEV of "Numerical Recipes" | ! Essentially CHEBEV of "Numerical Recipes" | [
"!",
"Essentially",
"CHEBEV",
"of",
"Numerical",
"Recipes"
] | def chbmts(a, b, c, m, x):
"""
! Essentially CHEBEV of "Numerical Recipes"
"""
d = 0.0
ddd = 0.0
y = (2.0*x-a-b)/(b-a)
for j in range(m-1, 0, -1):
sv = d
d = 2.*y*d - ddd + c[j]
ddd = sv
out = y * d - ddd + 0.5*c[0]
return out | [
"def",
"chbmts",
"(",
"a",
",",
"b",
",",
"c",
",",
"m",
",",
"x",
")",
":",
"d",
"=",
"0.0",
"ddd",
"=",
"0.0",
"y",
"=",
"(",
"2.0",
"*",
"x",
"-",
"a",
"-",
"b",
")",
"/",
"(",
"b",
"-",
"a",
")",
"for",
"j",
"in",
"range",
"(",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/Chop.py#L432-L444 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/combo.py | python | ComboPopup.FindItem | (*args, **kwargs) | return _combo.ComboPopup_FindItem(*args, **kwargs) | FindItem(self, String item) -> bool | FindItem(self, String item) -> bool | [
"FindItem",
"(",
"self",
"String",
"item",
")",
"-",
">",
"bool"
] | def FindItem(*args, **kwargs):
"""FindItem(self, String item) -> bool"""
return _combo.ComboPopup_FindItem(*args, **kwargs) | [
"def",
"FindItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"ComboPopup_FindItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L695-L697 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | adodbapi/apibase.py | python | TimeConverter.Date | (self, year, month, day) | This function constructs an object holding a date value. | This function constructs an object holding a date value. | [
"This",
"function",
"constructs",
"an",
"object",
"holding",
"a",
"date",
"value",
"."
] | def Date(self, year, month, day):
"This function constructs an object holding a date value."
raise NotImplementedError | [
"def",
"Date",
"(",
"self",
",",
"year",
",",
"month",
",",
"day",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/adodbapi/apibase.py#L210-L212 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/sorting.py | python | get_flattened_list | (
comp_ids: np.ndarray, # np.ndarray[np.intp]
ngroups: int,
levels: Iterable[Index],
labels: Iterable[np.ndarray],
) | return [tuple(array) for array in arrays.values()] | Map compressed group id -> key tuple. | Map compressed group id -> key tuple. | [
"Map",
"compressed",
"group",
"id",
"-",
">",
"key",
"tuple",
"."
] | def get_flattened_list(
comp_ids: np.ndarray, # np.ndarray[np.intp]
ngroups: int,
levels: Iterable[Index],
labels: Iterable[np.ndarray],
) -> list[tuple]:
"""Map compressed group id -> key tuple."""
comp_ids = comp_ids.astype(np.int64, copy=False)
arrays: DefaultDict[int, list[int]] = defau... | [
"def",
"get_flattened_list",
"(",
"comp_ids",
":",
"np",
".",
"ndarray",
",",
"# np.ndarray[np.intp]",
"ngroups",
":",
"int",
",",
"levels",
":",
"Iterable",
"[",
"Index",
"]",
",",
"labels",
":",
"Iterable",
"[",
"np",
".",
"ndarray",
"]",
",",
")",
"->... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/sorting.py#L554-L568 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/misc.py | python | get_installed_version | (dist_name, working_set=None) | return dist.version if dist else None | Get the installed version of dist_name avoiding pkg_resources cache | Get the installed version of dist_name avoiding pkg_resources cache | [
"Get",
"the",
"installed",
"version",
"of",
"dist_name",
"avoiding",
"pkg_resources",
"cache"
] | def get_installed_version(dist_name, working_set=None):
"""Get the installed version of dist_name avoiding pkg_resources cache"""
# Create a requirement that we'll look for inside of setuptools.
req = pkg_resources.Requirement.parse(dist_name)
if working_set is None:
# We want to avoid having t... | [
"def",
"get_installed_version",
"(",
"dist_name",
",",
"working_set",
"=",
"None",
")",
":",
"# Create a requirement that we'll look for inside of setuptools.",
"req",
"=",
"pkg_resources",
".",
"Requirement",
".",
"parse",
"(",
"dist_name",
")",
"if",
"working_set",
"i... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/misc.py#L636-L651 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/ast.py | python | GenericReplyFieldList.get_should_forward_name | (self) | return "shouldForwardFromShards" | Get the name of the shard-forwarding rule for a generic reply field. | Get the name of the shard-forwarding rule for a generic reply field. | [
"Get",
"the",
"name",
"of",
"the",
"shard",
"-",
"forwarding",
"rule",
"for",
"a",
"generic",
"reply",
"field",
"."
] | def get_should_forward_name(self):
# type: () -> str
"""Get the name of the shard-forwarding rule for a generic reply field."""
return "shouldForwardFromShards" | [
"def",
"get_should_forward_name",
"(",
"self",
")",
":",
"# type: () -> str",
"return",
"\"shouldForwardFromShards\""
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/ast.py#L308-L311 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | distrib/wx_conv.py | python | wxconvert | (pathname) | Scan each line of text in pathname. Replace each occurrence of any key in wx._newnames
dictionary with the content stored under that key | Scan each line of text in pathname. Replace each occurrence of any key in wx._newnames
dictionary with the content stored under that key | [
"Scan",
"each",
"line",
"of",
"text",
"in",
"pathname",
".",
"Replace",
"each",
"occurrence",
"of",
"any",
"key",
"in",
"wx",
".",
"_newnames",
"dictionary",
"with",
"the",
"content",
"stored",
"under",
"that",
"key"
] | def wxconvert(pathname):
""" Scan each line of text in pathname. Replace each occurrence of any key in wx._newnames
dictionary with the content stored under that key
"""
global numfiles
afile = AFile(other_subs)
infile = open(pathname, 'r')
linelist = infile.readlines()
infile.close(... | [
"def",
"wxconvert",
"(",
"pathname",
")",
":",
"global",
"numfiles",
"afile",
"=",
"AFile",
"(",
"other_subs",
")",
"infile",
"=",
"open",
"(",
"pathname",
",",
"'r'",
")",
"linelist",
"=",
"infile",
".",
"readlines",
"(",
")",
"infile",
".",
"close",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/distrib/wx_conv.py#L104-L139 | ||
cocos-creator/engine-native | 984c4c9f5838253313b44ccd429bd8fac4ec8a6a | tools/bindings-generator/clang/cindex.py | python | Cursor.walk_preorder | (self) | Depth-first preorder walk over the cursor and its descendants.
Yields cursors. | Depth-first preorder walk over the cursor and its descendants. | [
"Depth",
"-",
"first",
"preorder",
"walk",
"over",
"the",
"cursor",
"and",
"its",
"descendants",
"."
] | def walk_preorder(self):
"""Depth-first preorder walk over the cursor and its descendants.
Yields cursors.
"""
yield self
for child in self.get_children():
for descendant in child.walk_preorder():
yield descendant | [
"def",
"walk_preorder",
"(",
"self",
")",
":",
"yield",
"self",
"for",
"child",
"in",
"self",
".",
"get_children",
"(",
")",
":",
"for",
"descendant",
"in",
"child",
".",
"walk_preorder",
"(",
")",
":",
"yield",
"descendant"
] | https://github.com/cocos-creator/engine-native/blob/984c4c9f5838253313b44ccd429bd8fac4ec8a6a/tools/bindings-generator/clang/cindex.py#L1845-L1853 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/distutils/lib2def.py | python | output_def | (dlist, flist, header, file = sys.stdout) | Outputs the final DEF file to a file defaulting to stdout.
output_def(dlist, flist, header, file = sys.stdout) | Outputs the final DEF file to a file defaulting to stdout. | [
"Outputs",
"the",
"final",
"DEF",
"file",
"to",
"a",
"file",
"defaulting",
"to",
"stdout",
"."
] | def output_def(dlist, flist, header, file = sys.stdout):
"""Outputs the final DEF file to a file defaulting to stdout.
output_def(dlist, flist, header, file = sys.stdout)"""
for data_sym in dlist:
header = header + '\t%s DATA\n' % data_sym
header = header + '\n' # blank line
for func_sym in fli... | [
"def",
"output_def",
"(",
"dlist",
",",
"flist",
",",
"header",
",",
"file",
"=",
"sys",
".",
"stdout",
")",
":",
"for",
"data_sym",
"in",
"dlist",
":",
"header",
"=",
"header",
"+",
"'\\t%s DATA\\n'",
"%",
"data_sym",
"header",
"=",
"header",
"+",
"'\... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/distutils/lib2def.py#L94-L103 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py | python | Context.set_default_verify_paths | (self) | Specify that the platform provided CA certificates are to be used for
verification purposes. This method has some caveats related to the
binary wheels that cryptography (pyOpenSSL's primary dependency) ships:
* macOS will only load certificates using this method if the user has
th... | Specify that the platform provided CA certificates are to be used for
verification purposes. This method has some caveats related to the
binary wheels that cryptography (pyOpenSSL's primary dependency) ships: | [
"Specify",
"that",
"the",
"platform",
"provided",
"CA",
"certificates",
"are",
"to",
"be",
"used",
"for",
"verification",
"purposes",
".",
"This",
"method",
"has",
"some",
"caveats",
"related",
"to",
"the",
"binary",
"wheels",
"that",
"cryptography",
"(",
"pyO... | def set_default_verify_paths(self):
"""
Specify that the platform provided CA certificates are to be used for
verification purposes. This method has some caveats related to the
binary wheels that cryptography (pyOpenSSL's primary dependency) ships:
* macOS will only load certi... | [
"def",
"set_default_verify_paths",
"(",
"self",
")",
":",
"# SSL_CTX_set_default_verify_paths will attempt to load certs from",
"# both a cafile and capath that are set at compile time. However,",
"# it will first check environment variables and, if present, load",
"# those paths instead",
"set_... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py#L829-L876 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_menu.py | python | EdMenuBar.ResetIcons | (self) | Walk through each menu item in all of the bars menu and
reapply icons where possible.
@note: Don't use, sort of works on mac, does nothing on gtk, and causes
graphical glitches on msw. | Walk through each menu item in all of the bars menu and
reapply icons where possible.
@note: Don't use, sort of works on mac, does nothing on gtk, and causes
graphical glitches on msw. | [
"Walk",
"through",
"each",
"menu",
"item",
"in",
"all",
"of",
"the",
"bars",
"menu",
"and",
"reapply",
"icons",
"where",
"possible",
".",
"@note",
":",
"Don",
"t",
"use",
"sort",
"of",
"works",
"on",
"mac",
"does",
"nothing",
"on",
"gtk",
"and",
"cause... | def ResetIcons(self):
"""Walk through each menu item in all of the bars menu and
reapply icons where possible.
@note: Don't use, sort of works on mac, does nothing on gtk, and causes
graphical glitches on msw.
"""
for menu in self.GetMenus():
WalkAndSe... | [
"def",
"ResetIcons",
"(",
"self",
")",
":",
"for",
"menu",
"in",
"self",
".",
"GetMenus",
"(",
")",
":",
"WalkAndSetBitmaps",
"(",
"menu",
"[",
"0",
"]",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_menu.py#L1025-L1033 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/generic.py | python | NDFrame.sample | (self, n=None, frac=None, replace=False, weights=None,
random_state=None, axis=None) | return self.take(locs, axis=axis, is_copy=False) | Return a random sample of items from an axis of object.
You can use `random_state` for reproducibility.
Parameters
----------
n : int, optional
Number of items from axis to return. Cannot be used with `frac`.
Default = 1 if `frac` = None.
frac : float, o... | Return a random sample of items from an axis of object. | [
"Return",
"a",
"random",
"sample",
"of",
"items",
"from",
"an",
"axis",
"of",
"object",
"."
] | def sample(self, n=None, frac=None, replace=False, weights=None,
random_state=None, axis=None):
"""
Return a random sample of items from an axis of object.
You can use `random_state` for reproducibility.
Parameters
----------
n : int, optional
... | [
"def",
"sample",
"(",
"self",
",",
"n",
"=",
"None",
",",
"frac",
"=",
"None",
",",
"replace",
"=",
"False",
",",
"weights",
"=",
"None",
",",
"random_state",
"=",
"None",
",",
"axis",
"=",
"None",
")",
":",
"if",
"axis",
"is",
"None",
":",
"axis... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/generic.py#L4705-L4866 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/third_party/py/concurrent/futures/_compat.py | python | namedtuple | (typename, field_names) | return result | Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', 'x y')
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexabl... | Returns a new subclass of tuple with named fields. | [
"Returns",
"a",
"new",
"subclass",
"of",
"tuple",
"with",
"named",
"fields",
"."
] | def namedtuple(typename, field_names):
"""Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', 'x y')
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
... | [
"def",
"namedtuple",
"(",
"typename",
",",
"field_names",
")",
":",
"# Parse and validate the field names. Validation serves two purposes,",
"# generating informative error messages and preventing template injection attacks.",
"if",
"isinstance",
"(",
"field_names",
",",
"basestring",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/third_party/py/concurrent/futures/_compat.py#L6-L101 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/_pydecimal.py | python | Decimal.__divmod__ | (self, other, context=None) | return quotient, remainder | Return (self // other, self % other) | Return (self // other, self % other) | [
"Return",
"(",
"self",
"//",
"other",
"self",
"%",
"other",
")"
] | def __divmod__(self, other, context=None):
"""
Return (self // other, self % other)
"""
other = _convert_other(other)
if other is NotImplemented:
return other
if context is None:
context = getcontext()
ans = self._check_nans(other, contex... | [
"def",
"__divmod__",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
")",
"if",
"other",
"is",
"NotImplemented",
":",
"return",
"other",
"if",
"context",
"is",
"None",
":",
"context",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pydecimal.py#L1423-L1457 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armoryengine/PyBtcWalletRecovery.py | python | PyBtcWalletRecovery.ProcessWallet | (self, WalletPath=None, Wallet=None, Passphrase=None,
Mode=RECOVERMODE.Stripped, prgAt=None,
returnError=False, Progress=emptyFunc) | address entries may not be saved sequentially. To check the address
chain is valid, all addresses will be unserialized and saved by
chainIndex in addrDict. Then all addresses will be checked for
consistency and proper chaining. Imported private keys and comments
will be added at the tail of ... | address entries may not be saved sequentially. To check the address
chain is valid, all addresses will be unserialized and saved by
chainIndex in addrDict. Then all addresses will be checked for
consistency and proper chaining. Imported private keys and comments
will be added at the tail of ... | [
"address",
"entries",
"may",
"not",
"be",
"saved",
"sequentially",
".",
"To",
"check",
"the",
"address",
"chain",
"is",
"valid",
"all",
"addresses",
"will",
"be",
"unserialized",
"and",
"saved",
"by",
"chainIndex",
"in",
"addrDict",
".",
"Then",
"all",
"addr... | def ProcessWallet(self, WalletPath=None, Wallet=None, Passphrase=None,
Mode=RECOVERMODE.Stripped, prgAt=None,
returnError=False, Progress=emptyFunc):
self.__init__()
if not WalletPath:
if not Wallet: return -1
WalletPath = Wallet.walletPa... | [
"def",
"ProcessWallet",
"(",
"self",
",",
"WalletPath",
"=",
"None",
",",
"Wallet",
"=",
"None",
",",
"Passphrase",
"=",
"None",
",",
"Mode",
"=",
"RECOVERMODE",
".",
"Stripped",
",",
"prgAt",
"=",
"None",
",",
"returnError",
"=",
"False",
",",
"Progress... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/PyBtcWalletRecovery.py#L392-L1260 | ||
luliyucoordinate/Leetcode | 96afcdc54807d1d184e881a075d1dbf3371e31fb | src/0173-Binary-Search-Tree-Iterator/0173.py | python | BSTIterator.__init__ | (self, root) | :type root: TreeNode | :type root: TreeNode | [
":",
"type",
"root",
":",
"TreeNode"
] | def __init__(self, root):
"""
:type root: TreeNode
"""
self.stack = list()
self.pushLeft(root) | [
"def",
"__init__",
"(",
"self",
",",
"root",
")",
":",
"self",
".",
"stack",
"=",
"list",
"(",
")",
"self",
".",
"pushLeft",
"(",
"root",
")"
] | https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0173-Binary-Search-Tree-Iterator/0173.py#L2-L7 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events.not_ | (self, _object, _attributes={}, **_arguments) | not: Logical negation
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | not: Logical negation
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | [
"not",
":",
"Logical",
"negation",
"Required",
"argument",
":",
"an",
"AE",
"object",
"reference",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"anything"
] | def not_(self, _object, _attributes={}, **_arguments):
"""not: Logical negation
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything
"""
_code = 'ascr'
_subcode = 'NOT '
if _arguments: r... | [
"def",
"not_",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'NOT '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_ar... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L538-L557 | ||
skriegman/reconfigurable_organisms | 9a5d685c2f26259122683d304e1ac98d54bac805 | softbot.py | python | Genotype.__getitem__ | (self, n) | return self.networks[n] | Return network n. Use the expression 'network[n]'. | Return network n. Use the expression 'network[n]'. | [
"Return",
"network",
"n",
".",
"Use",
"the",
"expression",
"network",
"[",
"n",
"]",
"."
] | def __getitem__(self, n):
"""Return network n. Use the expression 'network[n]'."""
return self.networks[n] | [
"def",
"__getitem__",
"(",
"self",
",",
"n",
")",
":",
"return",
"self",
".",
"networks",
"[",
"n",
"]"
] | https://github.com/skriegman/reconfigurable_organisms/blob/9a5d685c2f26259122683d304e1ac98d54bac805/softbot.py#L38-L40 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | utils/vim-lldb/python-vim-lldb/lldb_controller.py | python | LLDBController.doLaunch | (self, stop_at_entry, args) | Handle process launch. | Handle process launch. | [
"Handle",
"process",
"launch",
"."
] | def doLaunch(self, stop_at_entry, args):
""" Handle process launch. """
error = lldb.SBError()
fs = self.target.GetExecutable()
exe = os.path.join(fs.GetDirectory(), fs.GetFilename())
if self.process is not None and self.process.IsValid():
pid = self.process.GetProc... | [
"def",
"doLaunch",
"(",
"self",
",",
"stop_at_entry",
",",
"args",
")",
":",
"error",
"=",
"lldb",
".",
"SBError",
"(",
")",
"fs",
"=",
"self",
".",
"target",
".",
"GetExecutable",
"(",
")",
"exe",
"=",
"os",
".",
"path",
".",
"join",
"(",
"fs",
... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/vim-lldb/python-vim-lldb/lldb_controller.py#L178-L206 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/decoder.py | python | MessageDecoder | (field_number, is_repeated, is_packed, key, new_default) | Returns a decoder for a message field. | Returns a decoder for a message field. | [
"Returns",
"a",
"decoder",
"for",
"a",
"message",
"field",
"."
] | def MessageDecoder(field_number, is_repeated, is_packed, key, new_default):
"""Returns a decoder for a message field."""
local_DecodeVarint = _DecodeVarint
assert not is_packed
if is_repeated:
tag_bytes = encoder.TagBytes(field_number,
wire_format.WIRETYPE_LENGTH_DELIMITED... | [
"def",
"MessageDecoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
",",
"key",
",",
"new_default",
")",
":",
"local_DecodeVarint",
"=",
"_DecodeVarint",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
":",
"tag_bytes",
"=",
"encoder",
".",
"T... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/decoder.py#L591-L638 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Alignment/OfflineValidation/python/TkAlAllInOneTool/betterConfigParser.py | python | BetterConfigParser.write | (self, fp) | Write an .ini-format representation of the configuration state. | Write an .ini-format representation of the configuration state. | [
"Write",
"an",
".",
"ini",
"-",
"format",
"representation",
"of",
"the",
"configuration",
"state",
"."
] | def write(self, fp):
"""Write an .ini-format representation of the configuration state."""
for section in self._sections:
fp.write("[%s]\n" % section)
for (key, value) in self._sections[section].items():
if key == "__name__" or not isinstance(value, (str, unicode)... | [
"def",
"write",
"(",
"self",
",",
"fp",
")",
":",
"for",
"section",
"in",
"self",
".",
"_sections",
":",
"fp",
".",
"write",
"(",
"\"[%s]\\n\"",
"%",
"section",
")",
"for",
"(",
"key",
",",
"value",
")",
"in",
"self",
".",
"_sections",
"[",
"sectio... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/OfflineValidation/python/TkAlAllInOneTool/betterConfigParser.py#L230-L240 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool._CopyXIBFile | (self, source, dest) | return ibtoolout.returncode | Compiles a XIB file with ibtool into a binary plist in the bundle. | Compiles a XIB file with ibtool into a binary plist in the bundle. | [
"Compiles",
"a",
"XIB",
"file",
"with",
"ibtool",
"into",
"a",
"binary",
"plist",
"in",
"the",
"bundle",
"."
] | def _CopyXIBFile(self, source, dest):
"""Compiles a XIB file with ibtool into a binary plist in the bundle."""
# ibtool sometimes crashes with relative paths. See crbug.com/314728.
base = os.path.dirname(os.path.realpath(__file__))
if os.path.relpath(source):
source = os.path.join(base, source)
... | [
"def",
"_CopyXIBFile",
"(",
"self",
",",
"source",
",",
"dest",
")",
":",
"# ibtool sometimes crashes with relative paths. See crbug.com/314728.",
"base",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"__file__",
")",
")",... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/mac_tool.py#L69-L93 | |
openweave/openweave-core | 11ceb6b7efd39fe05de7f79229247a5774d56766 | src/tools/factory-prov-tool/WeaveTLV.py | python | TLVWriter.putNull | (self, tag) | Write a TLV null with the specified TLV tag. | Write a TLV null with the specified TLV tag. | [
"Write",
"a",
"TLV",
"null",
"with",
"the",
"specified",
"TLV",
"tag",
"."
] | def putNull(self, tag):
'''Write a TLV null with the specified TLV tag.'''
controlAndTag = self._encodeControlAndTag(TLVType_Null, tag)
self._encoding.extend(controlAndTag) | [
"def",
"putNull",
"(",
"self",
",",
"tag",
")",
":",
"controlAndTag",
"=",
"self",
".",
"_encodeControlAndTag",
"(",
"TLVType_Null",
",",
"tag",
")",
"self",
".",
"_encoding",
".",
"extend",
"(",
"controlAndTag",
")"
] | https://github.com/openweave/openweave-core/blob/11ceb6b7efd39fe05de7f79229247a5774d56766/src/tools/factory-prov-tool/WeaveTLV.py#L219-L222 | ||
google/skia | 82d65d0487bd72f5f7332d002429ec2dc61d2463 | infra/bots/recipes/perf_skottiewasm_lottieweb.py | python | parse_trace | (trace_json, lottie_filename, api, renderer) | return output | parse_trace parses the specified trace JSON.
Parses the trace JSON and calculates the time of a single frame.
A dictionary is returned that has the following structure:
{
'frame_max_us': 100,
'frame_min_us': 90,
'frame_avg_us': 95,
} | parse_trace parses the specified trace JSON. | [
"parse_trace",
"parses",
"the",
"specified",
"trace",
"JSON",
"."
] | def parse_trace(trace_json, lottie_filename, api, renderer):
"""parse_trace parses the specified trace JSON.
Parses the trace JSON and calculates the time of a single frame.
A dictionary is returned that has the following structure:
{
'frame_max_us': 100,
'frame_min_us': 90,
'frame_avg_us': 95,
}... | [
"def",
"parse_trace",
"(",
"trace_json",
",",
"lottie_filename",
",",
"api",
",",
"renderer",
")",
":",
"step_result",
"=",
"api",
".",
"run",
"(",
"api",
".",
"python",
".",
"inline",
",",
"'parse %s trace'",
"%",
"lottie_filename",
",",
"program",
"=",
"... | https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/recipes/perf_skottiewasm_lottieweb.py#L205-L345 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/server_lib.py | python | Server.target | (self) | return self._server.target() | Returns the target for a `tf.Session` to connect to this server.
To create a
@{tf.Session} that
connects to this server, use the following snippet:
```python
server = tf.train.Server(...)
with tf.Session(server.target):
# ...
```
Returns:
A string containing a session targ... | Returns the target for a `tf.Session` to connect to this server. | [
"Returns",
"the",
"target",
"for",
"a",
"tf",
".",
"Session",
"to",
"connect",
"to",
"this",
"server",
"."
] | def target(self):
"""Returns the target for a `tf.Session` to connect to this server.
To create a
@{tf.Session} that
connects to this server, use the following snippet:
```python
server = tf.train.Server(...)
with tf.Session(server.target):
# ...
```
Returns:
A string ... | [
"def",
"target",
"(",
"self",
")",
":",
"return",
"self",
".",
"_server",
".",
"target",
"(",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/server_lib.py#L182-L198 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/base.py | python | _init_op_module | (root_namespace, module_name, make_op_func) | Registers op functions created by `make_op_func` under
`root_namespace.module_name.[submodule_name]`,
where `submodule_name` is one of `_OP_SUBMODULE_NAME_LIST`.
Parameters
----------
root_namespace : str
Top level module name, `mxnet` in the current cases.
module_name : str
Sec... | Registers op functions created by `make_op_func` under
`root_namespace.module_name.[submodule_name]`,
where `submodule_name` is one of `_OP_SUBMODULE_NAME_LIST`. | [
"Registers",
"op",
"functions",
"created",
"by",
"make_op_func",
"under",
"root_namespace",
".",
"module_name",
".",
"[",
"submodule_name",
"]",
"where",
"submodule_name",
"is",
"one",
"of",
"_OP_SUBMODULE_NAME_LIST",
"."
] | def _init_op_module(root_namespace, module_name, make_op_func):
"""
Registers op functions created by `make_op_func` under
`root_namespace.module_name.[submodule_name]`,
where `submodule_name` is one of `_OP_SUBMODULE_NAME_LIST`.
Parameters
----------
root_namespace : str
Top level ... | [
"def",
"_init_op_module",
"(",
"root_namespace",
",",
"module_name",
",",
"make_op_func",
")",
":",
"plist",
"=",
"ctypes",
".",
"POINTER",
"(",
"ctypes",
".",
"c_char_p",
")",
"(",
")",
"size",
"=",
"ctypes",
".",
"c_uint",
"(",
")",
"check_call",
"(",
... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/base.py#L467-L530 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/minimize-rounding-error-to-meet-target.py | python | Solution.minimizeError | (self, prices, target) | return "{:.3f}".format(result) | :type prices: List[str]
:type target: int
:rtype: str | :type prices: List[str]
:type target: int
:rtype: str | [
":",
"type",
"prices",
":",
"List",
"[",
"str",
"]",
":",
"type",
"target",
":",
"int",
":",
"rtype",
":",
"str"
] | def minimizeError(self, prices, target):
"""
:type prices: List[str]
:type target: int
:rtype: str
"""
def kthElement(nums, k, compare=lambda a, b: a < b):
def PartitionAroundPivot(left, right, pivot_idx, nums, compare):
new_pivot_idx = left
... | [
"def",
"minimizeError",
"(",
"self",
",",
"prices",
",",
"target",
")",
":",
"def",
"kthElement",
"(",
"nums",
",",
"k",
",",
"compare",
"=",
"lambda",
"a",
",",
"b",
":",
"a",
"<",
"b",
")",
":",
"def",
"PartitionAroundPivot",
"(",
"left",
",",
"r... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimize-rounding-error-to-meet-target.py#L9-L56 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/ConfigSet.py | python | ConfigSet.load | (self, filename) | Retrieve the :py:class:`ConfigSet` data from a file. See :py:meth:`ConfigSet.store` for writing such files
:param filename: file to use
:type filename: string | Retrieve the :py:class:`ConfigSet` data from a file. See :py:meth:`ConfigSet.store` for writing such files | [
"Retrieve",
"the",
":",
"py",
":",
"class",
":",
"ConfigSet",
"data",
"from",
"a",
"file",
".",
"See",
":",
"py",
":",
"meth",
":",
"ConfigSet",
".",
"store",
"for",
"writing",
"such",
"files"
] | def load(self, filename):
"""
Retrieve the :py:class:`ConfigSet` data from a file. See :py:meth:`ConfigSet.store` for writing such files
:param filename: file to use
:type filename: string
"""
tbl = self.table
code = Utils.readf(filename, m='rU')
for m in re_imp.finditer(code):
g = m.group
tbl[g(... | [
"def",
"load",
"(",
"self",
",",
"filename",
")",
":",
"tbl",
"=",
"self",
".",
"table",
"code",
"=",
"Utils",
".",
"readf",
"(",
"filename",
",",
"m",
"=",
"'rU'",
")",
"for",
"m",
"in",
"re_imp",
".",
"finditer",
"(",
"code",
")",
":",
"g",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/ConfigSet.py#L293-L305 | ||
vmtk/vmtk | 927331ad752265199390eabbbf2e07cdc2b4bcc6 | vmtkScripts/contrib/vmtknumpytomesh.py | python | vmtkNumpyToMesh._ConvertListToFlatCellsArray | (self, cellPointIdsList) | return cells, cellLocations | convert a list of numpy arrays defining each cell into a flat array defining cells.
This function is the inverse of vmtk.meshtonumpy._ConvertFlatCellsArrayToList(cells, cellLocations)
arguments:
- cellPointIdsList: list of numpy arrays (in same order defined in cells), wh... | convert a list of numpy arrays defining each cell into a flat array defining cells.
This function is the inverse of vmtk.meshtonumpy._ConvertFlatCellsArrayToList(cells, cellLocations)
arguments:
- cellPointIdsList: list of numpy arrays (in same order defined in cells), wh... | [
"convert",
"a",
"list",
"of",
"numpy",
"arrays",
"defining",
"each",
"cell",
"into",
"a",
"flat",
"array",
"defining",
"cells",
".",
"This",
"function",
"is",
"the",
"inverse",
"of",
"vmtk",
".",
"meshtonumpy",
".",
"_ConvertFlatCellsArrayToList",
"(",
"cells"... | def _ConvertListToFlatCellsArray(self, cellPointIdsList):
'''convert a list of numpy arrays defining each cell into a flat array defining cells.
This function is the inverse of vmtk.meshtonumpy._ConvertFlatCellsArrayToList(cells, cellLocations)
arguments:
- cellPo... | [
"def",
"_ConvertListToFlatCellsArray",
"(",
"self",
",",
"cellPointIdsList",
")",
":",
"cellArrayList",
"=",
"[",
"]",
"cellLocationsList",
"=",
"[",
"np",
".",
"array",
"(",
"[",
"0",
"]",
")",
"]",
"cellIndex",
"=",
"0",
"for",
"cellPointIdArray",
"in",
... | https://github.com/vmtk/vmtk/blob/927331ad752265199390eabbbf2e07cdc2b4bcc6/vmtkScripts/contrib/vmtknumpytomesh.py#L53-L89 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/extensions/reveal.py | python | make_extension | (**kwargs) | return RevealExtension(**kwargs) | Create an instance of the Extension object. | Create an instance of the Extension object. | [
"Create",
"an",
"instance",
"of",
"the",
"Extension",
"object",
"."
] | def make_extension(**kwargs):
"""Create an instance of the Extension object."""
return RevealExtension(**kwargs) | [
"def",
"make_extension",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"RevealExtension",
"(",
"*",
"*",
"kwargs",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/reveal.py#L18-L20 | |
xbmc/xbmc | 091211a754589fc40a2a1f239b0ce9f4ee138268 | addons/metadata.tvshows.themoviedb.org.python/libs/actions.py | python | get_show_id_from_nfo | (nfo) | Get show ID by NFO file contents
This function is called first instead of find_show
if a NFO file is found in a TV show folder.
:param nfo: the contents of a NFO file | Get show ID by NFO file contents | [
"Get",
"show",
"ID",
"by",
"NFO",
"file",
"contents"
] | def get_show_id_from_nfo(nfo):
# type: (Text) -> None
"""
Get show ID by NFO file contents
This function is called first instead of find_show
if a NFO file is found in a TV show folder.
:param nfo: the contents of a NFO file
"""
if isinstance(nfo, bytes):
nfo = nfo.decode('utf-... | [
"def",
"get_show_id_from_nfo",
"(",
"nfo",
")",
":",
"# type: (Text) -> None",
"if",
"isinstance",
"(",
"nfo",
",",
"bytes",
")",
":",
"nfo",
"=",
"nfo",
".",
"decode",
"(",
"'utf-8'",
",",
"'replace'",
")",
"logger",
".",
"debug",
"(",
"'Parsing NFO file:\\... | https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/metadata.tvshows.themoviedb.org.python/libs/actions.py#L61-L89 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/site_compare/command_line.py | python | Command.GetHelpString | (self, width=80) | return "\n".join([arg.GetHelpString(width) for arg in sorted_args]) | Returns a list of help strings for all this command's arguments. | Returns a list of help strings for all this command's arguments. | [
"Returns",
"a",
"list",
"of",
"help",
"strings",
"for",
"all",
"this",
"command",
"s",
"arguments",
"."
] | def GetHelpString(self, width=80):
"""Returns a list of help strings for all this command's arguments."""
sorted_args = self.args[:]
sorted_args.sort(self.SortArgs())
return "\n".join([arg.GetHelpString(width) for arg in sorted_args]) | [
"def",
"GetHelpString",
"(",
"self",
",",
"width",
"=",
"80",
")",
":",
"sorted_args",
"=",
"self",
".",
"args",
"[",
":",
"]",
"sorted_args",
".",
"sort",
"(",
"self",
".",
"SortArgs",
"(",
")",
")",
"return",
"\"\\n\"",
".",
"join",
"(",
"[",
"ar... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/site_compare/command_line.py#L486-L491 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/bin/cfgmgr/plugins/datasrc_config_plugin.py | python | check | (config) | return None | Check the configuration. | Check the configuration. | [
"Check",
"the",
"configuration",
"."
] | def check(config):
"""
Check the configuration.
"""
# Check the data layout first
errors=[]
if not spec.validate_config(False, config, errors):
return ' '.join(errors)
classes = config.get('classes')
# Nothing passed here
if classes is None:
return None
for rr_c... | [
"def",
"check",
"(",
"config",
")",
":",
"# Check the data layout first",
"errors",
"=",
"[",
"]",
"if",
"not",
"spec",
".",
"validate_config",
"(",
"False",
",",
"config",
",",
"errors",
")",
":",
"return",
"' '",
".",
"join",
"(",
"errors",
")",
"class... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/bin/cfgmgr/plugins/datasrc_config_plugin.py#L27-L77 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py | python | get_build_platform | () | return plat | Return this platform's string for platform-specific distributions
XXX Currently this is the same as ``distutils.util.get_platform()``, but it
needs some hacks for Linux and macOS. | Return this platform's string for platform-specific distributions | [
"Return",
"this",
"platform",
"s",
"string",
"for",
"platform",
"-",
"specific",
"distributions"
] | def get_build_platform():
"""Return this platform's string for platform-specific distributions
XXX Currently this is the same as ``distutils.util.get_platform()``, but it
needs some hacks for Linux and macOS.
"""
from sysconfig import get_platform
plat = get_platform()
if sys.platform == "... | [
"def",
"get_build_platform",
"(",
")",
":",
"from",
"sysconfig",
"import",
"get_platform",
"plat",
"=",
"get_platform",
"(",
")",
"if",
"sys",
".",
"platform",
"==",
"\"darwin\"",
"and",
"not",
"plat",
".",
"startswith",
"(",
"'macosx-'",
")",
":",
"try",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py#L388-L409 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/polynomial/hermite_e.py | python | hermeval | (x, cs) | return c0 + c1*x | Evaluate a Hermite series.
If `cs` is of length `n`, this function returns :
``p(x) = cs[0]*P_0(x) + cs[1]*P_1(x) + ... + cs[n-1]*P_{n-1}(x)``
If x is a sequence or array then p(x) will have the same shape as x.
If r is a ring_like object that supports multiplication and addition
by the values in... | Evaluate a Hermite series. | [
"Evaluate",
"a",
"Hermite",
"series",
"."
] | def hermeval(x, cs):
"""Evaluate a Hermite series.
If `cs` is of length `n`, this function returns :
``p(x) = cs[0]*P_0(x) + cs[1]*P_1(x) + ... + cs[n-1]*P_{n-1}(x)``
If x is a sequence or array then p(x) will have the same shape as x.
If r is a ring_like object that supports multiplication and a... | [
"def",
"hermeval",
"(",
"x",
",",
"cs",
")",
":",
"# cs is a trimmed copy",
"[",
"cs",
"]",
"=",
"pu",
".",
"as_series",
"(",
"[",
"cs",
"]",
")",
"if",
"isinstance",
"(",
"x",
",",
"tuple",
")",
"or",
"isinstance",
"(",
"x",
",",
"list",
")",
":... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/polynomial/hermite_e.py#L795-L861 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ribbon/bar.py | python | RibbonBar.SetActivePage | (self, page) | return self.SetActivePageByPage(page) | See comments on :meth:`~RibbonBar.SetActivePageByIndex` and :meth:`~RibbonBar.SetActivePageByPage`. | See comments on :meth:`~RibbonBar.SetActivePageByIndex` and :meth:`~RibbonBar.SetActivePageByPage`. | [
"See",
"comments",
"on",
":",
"meth",
":",
"~RibbonBar",
".",
"SetActivePageByIndex",
"and",
":",
"meth",
":",
"~RibbonBar",
".",
"SetActivePageByPage",
"."
] | def SetActivePage(self, page):
""" See comments on :meth:`~RibbonBar.SetActivePageByIndex` and :meth:`~RibbonBar.SetActivePageByPage`. """
if isinstance(page, types.IntType):
return self.SetActivePageByIndex(page)
return self.SetActivePageByPage(page) | [
"def",
"SetActivePage",
"(",
"self",
",",
"page",
")",
":",
"if",
"isinstance",
"(",
"page",
",",
"types",
".",
"IntType",
")",
":",
"return",
"self",
".",
"SetActivePageByIndex",
"(",
"page",
")",
"return",
"self",
".",
"SetActivePageByPage",
"(",
"page",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/bar.py#L599-L605 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py | python | MaskedArray.__new__ | (cls, data=None, mask=nomask, dtype=None, copy=False,
subok=True, ndmin=0, fill_value=None, keep_mask=True,
hard_mask=None, shrink=True, order=None, **options) | return _data | Create a new masked array from scratch.
Notes
-----
A masked array can also be created by taking a .view(MaskedArray). | Create a new masked array from scratch. | [
"Create",
"a",
"new",
"masked",
"array",
"from",
"scratch",
"."
] | def __new__(cls, data=None, mask=nomask, dtype=None, copy=False,
subok=True, ndmin=0, fill_value=None, keep_mask=True,
hard_mask=None, shrink=True, order=None, **options):
"""
Create a new masked array from scratch.
Notes
-----
A masked array can ... | [
"def",
"__new__",
"(",
"cls",
",",
"data",
"=",
"None",
",",
"mask",
"=",
"nomask",
",",
"dtype",
"=",
"None",
",",
"copy",
"=",
"False",
",",
"subok",
"=",
"True",
",",
"ndmin",
"=",
"0",
",",
"fill_value",
"=",
"None",
",",
"keep_mask",
"=",
"T... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L2782-L2909 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/supervisor.py | python | Supervisor.should_stop | (self) | return self._coord.should_stop() | Check if the coordinator was told to stop.
See `Coordinator.should_stop()`.
Returns:
True if the coordinator was told to stop, False otherwise. | Check if the coordinator was told to stop. | [
"Check",
"if",
"the",
"coordinator",
"was",
"told",
"to",
"stop",
"."
] | def should_stop(self):
"""Check if the coordinator was told to stop.
See `Coordinator.should_stop()`.
Returns:
True if the coordinator was told to stop, False otherwise.
"""
return self._coord.should_stop() | [
"def",
"should_stop",
"(",
"self",
")",
":",
"return",
"self",
".",
"_coord",
".",
"should_stop",
"(",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/supervisor.py#L822-L830 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | Group.GetName | (self, *args) | return _gdal.Group_GetName(self, *args) | r"""GetName(Group self) -> char const * | r"""GetName(Group self) -> char const * | [
"r",
"GetName",
"(",
"Group",
"self",
")",
"-",
">",
"char",
"const",
"*"
] | def GetName(self, *args):
r"""GetName(Group self) -> char const *"""
return _gdal.Group_GetName(self, *args) | [
"def",
"GetName",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"Group_GetName",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L2583-L2585 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_distutils/ccompiler.py | python | CCompiler.define_macro | (self, name, value=None) | Define a preprocessor macro for all compilations driven by this
compiler object. The optional parameter 'value' should be a
string; if it is not supplied, then the macro will be defined
without an explicit value and the exact outcome depends on the
compiler used (XXX true? does ANSI say... | Define a preprocessor macro for all compilations driven by this
compiler object. The optional parameter 'value' should be a
string; if it is not supplied, then the macro will be defined
without an explicit value and the exact outcome depends on the
compiler used (XXX true? does ANSI say... | [
"Define",
"a",
"preprocessor",
"macro",
"for",
"all",
"compilations",
"driven",
"by",
"this",
"compiler",
"object",
".",
"The",
"optional",
"parameter",
"value",
"should",
"be",
"a",
"string",
";",
"if",
"it",
"is",
"not",
"supplied",
"then",
"the",
"macro",... | def define_macro(self, name, value=None):
"""Define a preprocessor macro for all compilations driven by this
compiler object. The optional parameter 'value' should be a
string; if it is not supplied, then the macro will be defined
without an explicit value and the exact outcome depends ... | [
"def",
"define_macro",
"(",
"self",
",",
"name",
",",
"value",
"=",
"None",
")",
":",
"# Delete from the list of macro definitions/undefinitions if",
"# already there (so that this one will take precedence).",
"i",
"=",
"self",
".",
"_find_macro",
"(",
"name",
")",
"if",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/ccompiler.py#L184-L197 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings._ConvertConditionalKeys | (self, configname) | Converts or warns on conditional keys. Xcode supports conditional keys,
such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation
with some keys converted while the rest force a warning. | Converts or warns on conditional keys. Xcode supports conditional keys,
such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation
with some keys converted while the rest force a warning. | [
"Converts",
"or",
"warns",
"on",
"conditional",
"keys",
".",
"Xcode",
"supports",
"conditional",
"keys",
"such",
"as",
"CODE_SIGN_IDENTITY",
"[",
"sdk",
"=",
"iphoneos",
"*",
"]",
".",
"This",
"is",
"a",
"partial",
"implementation",
"with",
"some",
"keys",
"... | def _ConvertConditionalKeys(self, configname):
"""Converts or warns on conditional keys. Xcode supports conditional keys,
such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation
with some keys converted while the rest force a warning."""
settings = self.xcode_settings[configname]
... | [
"def",
"_ConvertConditionalKeys",
"(",
"self",
",",
"configname",
")",
":",
"settings",
"=",
"self",
".",
"xcode_settings",
"[",
"configname",
"]",
"conditional_keys",
"=",
"[",
"key",
"for",
"key",
"in",
"settings",
"if",
"key",
".",
"endswith",
"(",
"']'",... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L184-L199 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | net/tools/dafsa/make_dafsa.py | python | to_words | (node) | return [(node[0] + word) for child in node[1] for word in to_words(child)] | Generates a word list from all paths starting from an internal node. | Generates a word list from all paths starting from an internal node. | [
"Generates",
"a",
"word",
"list",
"from",
"all",
"paths",
"starting",
"from",
"an",
"internal",
"node",
"."
] | def to_words(node):
"""Generates a word list from all paths starting from an internal node."""
if not node:
return ['']
return [(node[0] + word) for child in node[1] for word in to_words(child)] | [
"def",
"to_words",
"(",
"node",
")",
":",
"if",
"not",
"node",
":",
"return",
"[",
"''",
"]",
"return",
"[",
"(",
"node",
"[",
"0",
"]",
"+",
"word",
")",
"for",
"child",
"in",
"node",
"[",
"1",
"]",
"for",
"word",
"in",
"to_words",
"(",
"child... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/net/tools/dafsa/make_dafsa.py#L219-L223 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/ops/__init__.py | python | element_not | (x, name='') | return element_not(x, name) | Computes the element-wise logic NOT of ``x`` and ``y``.
Example:
>>> C.element_not([1, 1, 0, 0]).eval()
array([ 0., 0., 1., 1.], dtype=float32)
Args:
x, y: numpy array or any :class:`~cntk.ops.functions.Function` that outputs a tensor
name (str, optional): the name of the Fu... | Computes the element-wise logic NOT of ``x`` and ``y``. | [
"Computes",
"the",
"element",
"-",
"wise",
"logic",
"NOT",
"of",
"x",
"and",
"y",
"."
] | def element_not(x, name=''):
'''
Computes the element-wise logic NOT of ``x`` and ``y``.
Example:
>>> C.element_not([1, 1, 0, 0]).eval()
array([ 0., 0., 1., 1.], dtype=float32)
Args:
x, y: numpy array or any :class:`~cntk.ops.functions.Function` that outputs a tensor
... | [
"def",
"element_not",
"(",
"x",
",",
"name",
"=",
"''",
")",
":",
"from",
"cntk",
".",
"cntk_py",
"import",
"element_not",
"x",
"=",
"sanitize_input",
"(",
"x",
")",
"return",
"element_not",
"(",
"x",
",",
"name",
")"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/__init__.py#L2165-L2181 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemPlayerAccount/AWS/resource-manager-code/pa_service_api.py | python | command_remove_player_ban | (context, args) | Unban a given player | Unban a given player | [
"Unban",
"a",
"given",
"player"
] | def command_remove_player_ban(context, args) -> None:
"""
Unban a given player
"""
__set_ban_status(context, args, False) | [
"def",
"command_remove_player_ban",
"(",
"context",
",",
"args",
")",
"->",
"None",
":",
"__set_ban_status",
"(",
"context",
",",
"args",
",",
"False",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemPlayerAccount/AWS/resource-manager-code/pa_service_api.py#L147-L151 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/pylib/base/output_manager.py | python | ArchivedFile.Archive | (self) | Archives file. | Archives file. | [
"Archives",
"file",
"."
] | def Archive(self):
"""Archives file."""
if not self._ready_to_archive:
raise Exception('File is not ready to archive. Be sure you are not '
'writing to the file and PrepareArchive has been called')
self._Archive() | [
"def",
"Archive",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_ready_to_archive",
":",
"raise",
"Exception",
"(",
"'File is not ready to archive. Be sure you are not '",
"'writing to the file and PrepareArchive has been called'",
")",
"self",
".",
"_Archive",
"(",
"... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/base/output_manager.py#L148-L153 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | PseudoDC.DrawIdToDC | (*args, **kwargs) | return _gdi_.PseudoDC_DrawIdToDC(*args, **kwargs) | DrawIdToDC(self, int id, DC dc)
Draw recorded operations of id to dc. | DrawIdToDC(self, int id, DC dc) | [
"DrawIdToDC",
"(",
"self",
"int",
"id",
"DC",
"dc",
")"
] | def DrawIdToDC(*args, **kwargs):
"""
DrawIdToDC(self, int id, DC dc)
Draw recorded operations of id to dc.
"""
return _gdi_.PseudoDC_DrawIdToDC(*args, **kwargs) | [
"def",
"DrawIdToDC",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_DrawIdToDC",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L7849-L7855 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | FontMapper_GetSupportedEncodingsCount | (*args) | return _gdi_.FontMapper_GetSupportedEncodingsCount(*args) | FontMapper_GetSupportedEncodingsCount() -> size_t | FontMapper_GetSupportedEncodingsCount() -> size_t | [
"FontMapper_GetSupportedEncodingsCount",
"()",
"-",
">",
"size_t"
] | def FontMapper_GetSupportedEncodingsCount(*args):
"""FontMapper_GetSupportedEncodingsCount() -> size_t"""
return _gdi_.FontMapper_GetSupportedEncodingsCount(*args) | [
"def",
"FontMapper_GetSupportedEncodingsCount",
"(",
"*",
"args",
")",
":",
"return",
"_gdi_",
".",
"FontMapper_GetSupportedEncodingsCount",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2181-L2183 | |
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | cnn_sphere_register/src/network2d.py | python | sample | (args) | return z | sample from a normal distribution | sample from a normal distribution | [
"sample",
"from",
"a",
"normal",
"distribution"
] | def sample(args):
"""
sample from a normal distribution
"""
mu = args[0]
log_sigma = args[1]
noise = tf.random_normal(tf.shape(mu), 0, 1, dtype=tf.float32)
z = mu + tf.exp(log_sigma/2.0) * noise
return z | [
"def",
"sample",
"(",
"args",
")",
":",
"mu",
"=",
"args",
"[",
"0",
"]",
"log_sigma",
"=",
"args",
"[",
"1",
"]",
"noise",
"=",
"tf",
".",
"random_normal",
"(",
"tf",
".",
"shape",
"(",
"mu",
")",
",",
"0",
",",
"1",
",",
"dtype",
"=",
"tf",... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/cnn_sphere_register/src/network2d.py#L218-L226 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/xgboost/python-package/xgboost/core.py | python | DMatrix.feature_names | (self, feature_names) | Set feature names (column labels).
Parameters
----------
feature_names : list or None
Labels for features. None will reset existing feature names | Set feature names (column labels). | [
"Set",
"feature",
"names",
"(",
"column",
"labels",
")",
"."
] | def feature_names(self, feature_names):
"""Set feature names (column labels).
Parameters
----------
feature_names : list or None
Labels for features. None will reset existing feature names
"""
if not feature_names is None:
# validate feature name
... | [
"def",
"feature_names",
"(",
"self",
",",
"feature_names",
")",
":",
"if",
"not",
"feature_names",
"is",
"None",
":",
"# validate feature name",
"if",
"not",
"isinstance",
"(",
"feature_names",
",",
"list",
")",
":",
"feature_names",
"=",
"list",
"(",
"feature... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/xgboost/python-package/xgboost/core.py#L506-L530 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetExecutablePath | (self) | Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium. | Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium. | [
"Returns",
"the",
"directory",
"name",
"of",
"the",
"bundle",
"represented",
"by",
"this",
"target",
".",
"E",
".",
"g",
".",
"Chromium",
".",
"app",
"/",
"Contents",
"/",
"MacOS",
"/",
"Chromium",
"."
] | def GetExecutablePath(self):
"""Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium."""
if self._IsBundle():
return self._GetBundleBinaryPath()
else:
return self._GetStandaloneBinaryPath() | [
"def",
"GetExecutablePath",
"(",
"self",
")",
":",
"if",
"self",
".",
"_IsBundle",
"(",
")",
":",
"return",
"self",
".",
"_GetBundleBinaryPath",
"(",
")",
"else",
":",
"return",
"self",
".",
"_GetStandaloneBinaryPath",
"(",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L416-L422 | ||
v8/v8 | fee3bf095260bf657a3eea4d3d41f90c42c6c857 | tools/run_perf.py | python | ResultTracker.HasEnoughRuns | (self, graph_config, confidence_level) | return confidence_level * avg_stderr < avg / 1000.0 | Checks if the mean of the results for a given trace config is within
0.1% of the true value with the specified confidence level.
This assumes Gaussian distribution of the noise and based on
https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule.
Args:
graph_config: An instance of GraphCon... | Checks if the mean of the results for a given trace config is within
0.1% of the true value with the specified confidence level. | [
"Checks",
"if",
"the",
"mean",
"of",
"the",
"results",
"for",
"a",
"given",
"trace",
"config",
"is",
"within",
"0",
".",
"1%",
"of",
"the",
"true",
"value",
"with",
"the",
"specified",
"confidence",
"level",
"."
] | def HasEnoughRuns(self, graph_config, confidence_level):
"""Checks if the mean of the results for a given trace config is within
0.1% of the true value with the specified confidence level.
This assumes Gaussian distribution of the noise and based on
https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%939... | [
"def",
"HasEnoughRuns",
"(",
"self",
",",
"graph_config",
",",
"confidence_level",
")",
":",
"if",
"not",
"isinstance",
"(",
"graph_config",
",",
"TraceConfig",
")",
":",
"return",
"all",
"(",
"self",
".",
"HasEnoughRuns",
"(",
"child",
",",
"confidence_level"... | https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/run_perf.py#L245-L280 | |
shogun-toolbox/shogun | 9b8d856971af5a295dd6ad70623ae45647a6334c | examples/undocumented/python/graphical/eigenfaces.py | python | EigenFaces.getMean | (self) | return self.pca.get_mean() | Return the mean vector | Return the mean vector | [
"Return",
"the",
"mean",
"vector"
] | def getMean(self):
"""
Return the mean vector
"""
return self.pca.get_mean() | [
"def",
"getMean",
"(",
"self",
")",
":",
"return",
"self",
".",
"pca",
".",
"get_mean",
"(",
")"
] | https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/examples/undocumented/python/graphical/eigenfaces.py#L112-L116 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/sparse_ops.py | python | sparse_to_indicator | (sp_input, vocab_size, name=None) | Converts a `SparseTensor` of ids into a dense bool indicator tensor.
The last dimension of `sp_input.indices` is discarded and replaced with
the values of `sp_input`. If `sp_input.shape = [D0, D1, ..., Dn, K]`, then
`output.shape = [D0, D1, ..., Dn, vocab_size]`, where
output[d_0, d_1, ..., d_n, sp_input... | Converts a `SparseTensor` of ids into a dense bool indicator tensor. | [
"Converts",
"a",
"SparseTensor",
"of",
"ids",
"into",
"a",
"dense",
"bool",
"indicator",
"tensor",
"."
] | def sparse_to_indicator(sp_input, vocab_size, name=None):
"""Converts a `SparseTensor` of ids into a dense bool indicator tensor.
The last dimension of `sp_input.indices` is discarded and replaced with
the values of `sp_input`. If `sp_input.shape = [D0, D1, ..., Dn, K]`, then
`output.shape = [D0, D1, ..., Dn,... | [
"def",
"sparse_to_indicator",
"(",
"sp_input",
",",
"vocab_size",
",",
"name",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"sp_input",
",",
"ops",
".",
"SparseTensor",
")",
":",
"raise",
"TypeError",
"(",
"\"Input must be a SparseTensor\"",
")",
"wi... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/sparse_ops.py#L714-L775 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | FileSystem.FindNext | (*args, **kwargs) | return _core_.FileSystem_FindNext(*args, **kwargs) | FindNext(self) -> String | FindNext(self) -> String | [
"FindNext",
"(",
"self",
")",
"-",
">",
"String"
] | def FindNext(*args, **kwargs):
"""FindNext(self) -> String"""
return _core_.FileSystem_FindNext(*args, **kwargs) | [
"def",
"FindNext",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"FileSystem_FindNext",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L2432-L2434 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/collections/__init__.py | python | OrderedDict.popitem | (self, last=True) | return key, value | Remove and return a (key, value) pair from the dictionary.
Pairs are returned in LIFO order if last is true or FIFO order if false. | Remove and return a (key, value) pair from the dictionary. | [
"Remove",
"and",
"return",
"a",
"(",
"key",
"value",
")",
"pair",
"from",
"the",
"dictionary",
"."
] | def popitem(self, last=True):
'''Remove and return a (key, value) pair from the dictionary.
Pairs are returned in LIFO order if last is true or FIFO order if false.
'''
if not self:
raise KeyError('dictionary is empty')
root = self.__root
if last:
... | [
"def",
"popitem",
"(",
"self",
",",
"last",
"=",
"True",
")",
":",
"if",
"not",
"self",
":",
"raise",
"KeyError",
"(",
"'dictionary is empty'",
")",
"root",
"=",
"self",
".",
"__root",
"if",
"last",
":",
"link",
"=",
"root",
".",
"prev",
"link_prev",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/collections/__init__.py#L167-L188 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py | python | Image.getcolors | (self, maxcolors=256) | return self.im.getcolors(maxcolors) | Returns a list of colors used in this image.
:param maxcolors: Maximum number of colors. If this number is
exceeded, this method returns None. The default limit is
256 colors.
:returns: An unsorted list of (count, pixel) values. | Returns a list of colors used in this image. | [
"Returns",
"a",
"list",
"of",
"colors",
"used",
"in",
"this",
"image",
"."
] | def getcolors(self, maxcolors=256):
"""
Returns a list of colors used in this image.
:param maxcolors: Maximum number of colors. If this number is
exceeded, this method returns None. The default limit is
256 colors.
:returns: An unsorted list of (count, pixel) va... | [
"def",
"getcolors",
"(",
"self",
",",
"maxcolors",
"=",
"256",
")",
":",
"self",
".",
"load",
"(",
")",
"if",
"self",
".",
"mode",
"in",
"(",
"\"1\"",
",",
"\"L\"",
",",
"\"P\"",
")",
":",
"h",
"=",
"self",
".",
"im",
".",
"histogram",
"(",
")"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py#L1237-L1257 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | libcxx/utils/libcxx/util.py | python | mkdir_p | (path) | mkdir_p(path) - Make the "path" directory, if it does not exist; this
will also make directories for any missing parent directories. | mkdir_p(path) - Make the "path" directory, if it does not exist; this
will also make directories for any missing parent directories. | [
"mkdir_p",
"(",
"path",
")",
"-",
"Make",
"the",
"path",
"directory",
"if",
"it",
"does",
"not",
"exist",
";",
"this",
"will",
"also",
"make",
"directories",
"for",
"any",
"missing",
"parent",
"directories",
"."
] | def mkdir_p(path):
"""mkdir_p(path) - Make the "path" directory, if it does not exist; this
will also make directories for any missing parent directories."""
if not path or os.path.exists(path):
return
parent = os.path.dirname(path)
if parent != path:
mkdir_p(parent)
try:
... | [
"def",
"mkdir_p",
"(",
"path",
")",
":",
"if",
"not",
"path",
"or",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"return",
"parent",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"path",
")",
"if",
"parent",
"!=",
"path",
":",
"mkdir_p... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/libcxx/utils/libcxx/util.py#L145-L161 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/io/matlab/mio4.py | python | VarReader4.read_sparse_array | (self, hdr) | return scipy.sparse.coo_matrix((V,(I,J)), dims) | Read and return sparse matrix type
Parameters
----------
hdr : ``VarHeader4`` instance
Returns
-------
arr : ``scipy.sparse.coo_matrix``
with dtype ``float`` and shape read from the sparse matrix data
Notes
-----
MATLAB 4 real sparse... | Read and return sparse matrix type | [
"Read",
"and",
"return",
"sparse",
"matrix",
"type"
] | def read_sparse_array(self, hdr):
''' Read and return sparse matrix type
Parameters
----------
hdr : ``VarHeader4`` instance
Returns
-------
arr : ``scipy.sparse.coo_matrix``
with dtype ``float`` and shape read from the sparse matrix data
No... | [
"def",
"read_sparse_array",
"(",
"self",
",",
"hdr",
")",
":",
"res",
"=",
"self",
".",
"read_sub_array",
"(",
"hdr",
")",
"tmp",
"=",
"res",
"[",
":",
"-",
"1",
",",
":",
"]",
"dims",
"=",
"res",
"[",
"-",
"1",
",",
"0",
":",
"2",
"]",
"I",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/io/matlab/mio4.py#L227-L266 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/array_ops.py | python | InvertPermutation.__init__ | (self) | Initialize InvertPermutation | Initialize InvertPermutation | [
"Initialize",
"InvertPermutation"
] | def __init__(self):
"""Initialize InvertPermutation"""
self.set_const_prim(True) | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"set_const_prim",
"(",
"True",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/array_ops.py#L1642-L1644 | ||
KhronosGroup/Vulkan-Headers | b32da5329b50e3cb96229aaecba9ded032fe29cc | registry/reg.py | python | Registry.generateFeature | (self, fname, ftype, dictionary) | Generate a single type / enum group / enum / command,
and all its dependencies as needed.
- fname - name of feature (`<type>`/`<enum>`/`<command>`)
- ftype - type of feature, 'type' | 'enum' | 'command'
- dictionary - of *Info objects - self.{type|enum|cmd}dict | Generate a single type / enum group / enum / command,
and all its dependencies as needed. | [
"Generate",
"a",
"single",
"type",
"/",
"enum",
"group",
"/",
"enum",
"/",
"command",
"and",
"all",
"its",
"dependencies",
"as",
"needed",
"."
] | def generateFeature(self, fname, ftype, dictionary):
"""Generate a single type / enum group / enum / command,
and all its dependencies as needed.
- fname - name of feature (`<type>`/`<enum>`/`<command>`)
- ftype - type of feature, 'type' | 'enum' | 'command'
- dictionary - of *I... | [
"def",
"generateFeature",
"(",
"self",
",",
"fname",
",",
"ftype",
",",
"dictionary",
")",
":",
"self",
".",
"gen",
".",
"logMsg",
"(",
"'diag'",
",",
"'generateFeature: generating'",
",",
"ftype",
",",
"fname",
")",
"f",
"=",
"self",
".",
"lookupElementIn... | https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/reg.py#L1073-L1244 | ||
asLody/whale | 6a661b27cc4cf83b7b5a3b02451597ee1ac7f264 | whale/cpplint.py | python | FindNextMultiLineCommentStart | (lines, lineix) | return len(lines) | Find the beginning marker for a multiline comment. | Find the beginning marker for a multiline comment. | [
"Find",
"the",
"beginning",
"marker",
"for",
"a",
"multiline",
"comment",
"."
] | def FindNextMultiLineCommentStart(lines, lineix):
"""Find the beginning marker for a multiline comment."""
while lineix < len(lines):
if lines[lineix].strip().startswith('/*'):
# Only return this marker if the comment goes beyond this line
if lines[lineix].strip().find('*/', 2) < 0:
return l... | [
"def",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
":",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"if",
"lines",
"[",
"lineix",
"]",
".",
"strip",
"(",
")",
".",
"startswith",
"(",
"'/*'",
")",
":",
"# Only return this... | https://github.com/asLody/whale/blob/6a661b27cc4cf83b7b5a3b02451597ee1ac7f264/whale/cpplint.py#L1364-L1372 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGrid.ChangePropertyValue | (*args, **kwargs) | return _propgrid.PropertyGrid_ChangePropertyValue(*args, **kwargs) | ChangePropertyValue(self, PGPropArg id, wxVariant newValue) -> bool | ChangePropertyValue(self, PGPropArg id, wxVariant newValue) -> bool | [
"ChangePropertyValue",
"(",
"self",
"PGPropArg",
"id",
"wxVariant",
"newValue",
")",
"-",
">",
"bool"
] | def ChangePropertyValue(*args, **kwargs):
"""ChangePropertyValue(self, PGPropArg id, wxVariant newValue) -> bool"""
return _propgrid.PropertyGrid_ChangePropertyValue(*args, **kwargs) | [
"def",
"ChangePropertyValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_ChangePropertyValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L1996-L1998 | |
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | libs/python/pyste/src/Pyste/declarations.py | python | Class.Constructors | (self, publics_only=True) | return constructors | Returns a list of the constructors for this class.
@rtype: list | Returns a list of the constructors for this class. | [
"Returns",
"a",
"list",
"of",
"the",
"constructors",
"for",
"this",
"class",
"."
] | def Constructors(self, publics_only=True):
'''Returns a list of the constructors for this class.
@rtype: list
'''
constructors = []
for member in self:
if isinstance(member, Constructor):
if publics_only and member.visibility != Scope.public:
... | [
"def",
"Constructors",
"(",
"self",
",",
"publics_only",
"=",
"True",
")",
":",
"constructors",
"=",
"[",
"]",
"for",
"member",
"in",
"self",
":",
"if",
"isinstance",
"(",
"member",
",",
"Constructor",
")",
":",
"if",
"publics_only",
"and",
"member",
"."... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/libs/python/pyste/src/Pyste/declarations.py#L95-L105 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/text/embedding.py | python | _TokenEmbedding._set_idx_to_vec_by_embeddings | (self, token_embeddings, vocab_len, vocab_idx_to_token) | Sets the mapping between token indices and token embedding vectors.
Parameters
----------
token_embeddings : instance or list `mxnet.contrib.text.embedding._TokenEmbedding`
One or multiple pre-trained token embeddings to load. If it is a list of multiple
embeddings, the... | Sets the mapping between token indices and token embedding vectors. | [
"Sets",
"the",
"mapping",
"between",
"token",
"indices",
"and",
"token",
"embedding",
"vectors",
"."
] | def _set_idx_to_vec_by_embeddings(self, token_embeddings, vocab_len, vocab_idx_to_token):
"""Sets the mapping between token indices and token embedding vectors.
Parameters
----------
token_embeddings : instance or list `mxnet.contrib.text.embedding._TokenEmbedding`
One or m... | [
"def",
"_set_idx_to_vec_by_embeddings",
"(",
"self",
",",
"token_embeddings",
",",
"vocab_len",
",",
"vocab_idx_to_token",
")",
":",
"new_vec_len",
"=",
"sum",
"(",
"embed",
".",
"vec_len",
"for",
"embed",
"in",
"token_embeddings",
")",
"new_idx_to_vec",
"=",
"nd"... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/text/embedding.py#L314-L343 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/ops.py | python | get_collection_ref | (key) | return get_default_graph().get_collection_ref(key) | Wrapper for `Graph.get_collection_ref()` using the default graph.
See @{tf.Graph.get_collection_ref}
for more details.
Args:
key: The key for the collection. For example, the `GraphKeys` class
contains many standard names for collections.
Returns:
The list of values in the collection with the g... | Wrapper for `Graph.get_collection_ref()` using the default graph. | [
"Wrapper",
"for",
"Graph",
".",
"get_collection_ref",
"()",
"using",
"the",
"default",
"graph",
"."
] | def get_collection_ref(key):
"""Wrapper for `Graph.get_collection_ref()` using the default graph.
See @{tf.Graph.get_collection_ref}
for more details.
Args:
key: The key for the collection. For example, the `GraphKeys` class
contains many standard names for collections.
Returns:
The list of v... | [
"def",
"get_collection_ref",
"(",
"key",
")",
":",
"return",
"get_default_graph",
"(",
")",
".",
"get_collection_ref",
"(",
"key",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L4949-L4965 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pytree.py | python | Leaf.__unicode__ | (self) | return self.prefix + str(self.value) | Return a pretty string representation.
This reproduces the input source exactly. | Return a pretty string representation. | [
"Return",
"a",
"pretty",
"string",
"representation",
"."
] | def __unicode__(self):
"""
Return a pretty string representation.
This reproduces the input source exactly.
"""
return self.prefix + str(self.value) | [
"def",
"__unicode__",
"(",
"self",
")",
":",
"return",
"self",
".",
"prefix",
"+",
"str",
"(",
"self",
".",
"value",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pytree.py#L351-L357 | |
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/util/regex.py | python | replace | (s, pattern, replacement) | return re.sub(pattern, _replacement, s) | Replaces occurrences of a match string in a given
string and returns the new string. The match string
can be a regex expression.
Args:
s (str): the string to modify
pattern (str): the search expression
replacement (str): the string to replace each match with | Replaces occurrences of a match string in a given
string and returns the new string. The match string
can be a regex expression. | [
"Replaces",
"occurrences",
"of",
"a",
"match",
"string",
"in",
"a",
"given",
"string",
"and",
"returns",
"the",
"new",
"string",
".",
"The",
"match",
"string",
"can",
"be",
"a",
"regex",
"expression",
"."
] | def replace(s, pattern, replacement):
"""Replaces occurrences of a match string in a given
string and returns the new string. The match string
can be a regex expression.
Args:
s (str): the string to modify
pattern (str): the search expression
replacement (str): the... | [
"def",
"replace",
"(",
"s",
",",
"pattern",
",",
"replacement",
")",
":",
"# the replacement string may contain invalid backreferences (like \\1 or \\g)",
"# which will cause python's regex to blow up. Since this should emulate",
"# the jam version exactly and the jam version didn't support"... | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/util/regex.py#L31-L50 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/summary_op_util.py | python | summary_scope | (name, family=None, default_name=None, values=None) | Enters a scope used for the summary and yields both the name and tag.
To ensure that the summary tag name is always unique, we create a name scope
based on `name` and use the full scope name in the tag.
If `family` is set, then the tag name will be '<family>/<scope_name>', where
`scope_name` is `<outer_scope>... | Enters a scope used for the summary and yields both the name and tag. | [
"Enters",
"a",
"scope",
"used",
"for",
"the",
"summary",
"and",
"yields",
"both",
"the",
"name",
"and",
"tag",
"."
] | def summary_scope(name, family=None, default_name=None, values=None):
"""Enters a scope used for the summary and yields both the name and tag.
To ensure that the summary tag name is always unique, we create a name scope
based on `name` and use the full scope name in the tag.
If `family` is set, then the tag n... | [
"def",
"summary_scope",
"(",
"name",
",",
"family",
"=",
"None",
",",
"default_name",
"=",
"None",
",",
"values",
"=",
"None",
")",
":",
"name",
"=",
"clean_tag",
"(",
"name",
")",
"family",
"=",
"clean_tag",
"(",
"family",
")",
"# Use family name in the s... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/summary_op_util.py#L72-L107 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/plugin.py | python | ExtensionPoint.Extensions | (self, component) | return filter(None, [component[cls] for cls in extensions]) | The exensions that extend this extention point
@param component: The component to get the exensions for
@return: a list of plugins that declare to impliment the
given extension point. | The exensions that extend this extention point
@param component: The component to get the exensions for
@return: a list of plugins that declare to impliment the
given extension point. | [
"The",
"exensions",
"that",
"extend",
"this",
"extention",
"point",
"@param",
"component",
":",
"The",
"component",
"to",
"get",
"the",
"exensions",
"for",
"@return",
":",
"a",
"list",
"of",
"plugins",
"that",
"declare",
"to",
"impliment",
"the",
"given",
"e... | def Extensions(self, component):
"""The exensions that extend this extention point
@param component: The component to get the exensions for
@return: a list of plugins that declare to impliment the
given extension point.
"""
component = wx.GetApp().GetPluginManager()
... | [
"def",
"Extensions",
"(",
"self",
",",
"component",
")",
":",
"component",
"=",
"wx",
".",
"GetApp",
"(",
")",
".",
"GetPluginManager",
"(",
")",
"extensions",
"=",
"PluginMeta",
".",
"_registry",
".",
"get",
"(",
"self",
".",
"interface",
",",
"[",
"]... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugin.py#L123-L132 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/utils/hipify/hipify_python.py | python | get_hip_file_path | (filepath, is_pytorch_extension=False) | return os.path.join(dirpath, root + ext) | Returns the new name of the hipified file | Returns the new name of the hipified file | [
"Returns",
"the",
"new",
"name",
"of",
"the",
"hipified",
"file"
] | def get_hip_file_path(filepath, is_pytorch_extension=False):
"""
Returns the new name of the hipified file
"""
# At the moment, some PyTorch source files are HIPified in place. The predicate
# is_out_of_place tells us if this is the case or not.
if not is_pytorch_extension and not is_out_of_pla... | [
"def",
"get_hip_file_path",
"(",
"filepath",
",",
"is_pytorch_extension",
"=",
"False",
")",
":",
"# At the moment, some PyTorch source files are HIPified in place. The predicate",
"# is_out_of_place tells us if this is the case or not.",
"if",
"not",
"is_pytorch_extension",
"and",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/hipify/hipify_python.py#L547-L614 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/perf/profile_creators/cookie_profile_extender.py | python | CookieProfileExtender._CookieCountInDB | (db_path) | return cookie_count | The number of cookies in the db at |db_path|. | The number of cookies in the db at |db_path|. | [
"The",
"number",
"of",
"cookies",
"in",
"the",
"db",
"at",
"|db_path|",
"."
] | def _CookieCountInDB(db_path):
"""The number of cookies in the db at |db_path|."""
connection = sqlite3.connect(db_path)
try:
cursor = connection.cursor()
cursor.execute("select count(*) from cookies")
cookie_count = cursor.fetchone()[0]
except:
raise
finally:
connectio... | [
"def",
"_CookieCountInDB",
"(",
"db_path",
")",
":",
"connection",
"=",
"sqlite3",
".",
"connect",
"(",
"db_path",
")",
"try",
":",
"cursor",
"=",
"connection",
".",
"cursor",
"(",
")",
"cursor",
".",
"execute",
"(",
"\"select count(*) from cookies\"",
")",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/profile_creators/cookie_profile_extender.py#L68-L79 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | uCSIsCatPc | (code) | return ret | Check whether the character is part of Pc UCS Category | Check whether the character is part of Pc UCS Category | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Pc",
"UCS",
"Category"
] | def uCSIsCatPc(code):
"""Check whether the character is part of Pc UCS Category """
ret = libxml2mod.xmlUCSIsCatPc(code)
return ret | [
"def",
"uCSIsCatPc",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsCatPc",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2344-L2347 | |
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/get.py | python | OptionChainAnalyticalGetter.get_underlying_price | (self) | return clib.get_val(self._abi('GetUnderlyingPrice'), c_double,
self._obj) | Returns underlying price(for calculations) being used. | Returns underlying price(for calculations) being used. | [
"Returns",
"underlying",
"price",
"(",
"for",
"calculations",
")",
"being",
"used",
"."
] | def get_underlying_price(self):
"""Returns underlying price(for calculations) being used."""
return clib.get_val(self._abi('GetUnderlyingPrice'), c_double,
self._obj) | [
"def",
"get_underlying_price",
"(",
"self",
")",
":",
"return",
"clib",
".",
"get_val",
"(",
"self",
".",
"_abi",
"(",
"'GetUnderlyingPrice'",
")",
",",
"c_double",
",",
"self",
".",
"_obj",
")"
] | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L1031-L1034 | |
microsoft/BlingFire | 7634ad43b521ee6a596266d82c3f0c46cd43e222 | ldbsrc/bert_base_tok/tokenization.py | python | BasicTokenizer.tokenize | (self, text) | return output_tokens | Tokenizes a piece of text. | Tokenizes a piece of text. | [
"Tokenizes",
"a",
"piece",
"of",
"text",
"."
] | def tokenize(self, text):
"""Tokenizes a piece of text."""
text = convert_to_unicode(text)
text = self._clean_text(text)
# This was added on November 1st, 2018 for the multilingual and Chinese
# models. This is also applied to the English models now, but it doesn't
# matter since the English mo... | [
"def",
"tokenize",
"(",
"self",
",",
"text",
")",
":",
"text",
"=",
"convert_to_unicode",
"(",
"text",
")",
"text",
"=",
"self",
".",
"_clean_text",
"(",
"text",
")",
"# This was added on November 1st, 2018 for the multilingual and Chinese",
"# models. This is also appl... | https://github.com/microsoft/BlingFire/blob/7634ad43b521ee6a596266d82c3f0c46cd43e222/ldbsrc/bert_base_tok/tokenization.py#L196-L218 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/types/containers.py | python | UniTuple.unify | (self, typingctx, other) | Unify UniTuples with their dtype | Unify UniTuples with their dtype | [
"Unify",
"UniTuples",
"with",
"their",
"dtype"
] | def unify(self, typingctx, other):
"""
Unify UniTuples with their dtype
"""
if isinstance(other, UniTuple) and len(self) == len(other):
dtype = typingctx.unify_pairs(self.dtype, other.dtype)
if dtype is not None:
return UniTuple(dtype=dtype, count=... | [
"def",
"unify",
"(",
"self",
",",
"typingctx",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"UniTuple",
")",
"and",
"len",
"(",
"self",
")",
"==",
"len",
"(",
"other",
")",
":",
"dtype",
"=",
"typingctx",
".",
"unify_pairs",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/types/containers.py#L218-L225 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/tlslite/utils/cipherfactory.py | python | createAES | (key, IV, implList=None) | Create a new AES object.
@type key: str
@param key: A 16, 24, or 32 byte string.
@type IV: str
@param IV: A 16 byte string
@rtype: L{tlslite.utils.AES}
@return: An AES object. | Create a new AES object. | [
"Create",
"a",
"new",
"AES",
"object",
"."
] | def createAES(key, IV, implList=None):
"""Create a new AES object.
@type key: str
@param key: A 16, 24, or 32 byte string.
@type IV: str
@param IV: A 16 byte string
@rtype: L{tlslite.utils.AES}
@return: An AES object.
"""
if implList == None:
implList = ["cryptlib", "opens... | [
"def",
"createAES",
"(",
"key",
",",
"IV",
",",
"implList",
"=",
"None",
")",
":",
"if",
"implList",
"==",
"None",
":",
"implList",
"=",
"[",
"\"cryptlib\"",
",",
"\"openssl\"",
",",
"\"pycrypto\"",
",",
"\"python\"",
"]",
"for",
"impl",
"in",
"implList"... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/tlslite/utils/cipherfactory.py#L34-L58 | ||
garbear/kodi-steamlink | 3f8e5970b01607cdb3c2688fbaa78e08f2d9c561 | tools/EventClients/lib/python/xbmcclient.py | python | XBMCClient.send_remote_button | (self, button=None) | Send a remote control event to XBMC
Keyword Arguments:
button -- name of the remote control button to send (same as in Keymap.xml) | Send a remote control event to XBMC
Keyword Arguments:
button -- name of the remote control button to send (same as in Keymap.xml) | [
"Send",
"a",
"remote",
"control",
"event",
"to",
"XBMC",
"Keyword",
"Arguments",
":",
"button",
"--",
"name",
"of",
"the",
"remote",
"control",
"button",
"to",
"send",
"(",
"same",
"as",
"in",
"Keymap",
".",
"xml",
")"
] | def send_remote_button(self, button=None):
"""Send a remote control event to XBMC
Keyword Arguments:
button -- name of the remote control button to send (same as in Keymap.xml)
"""
if not button:
return
self.send_button(map="R1", button=button) | [
"def",
"send_remote_button",
"(",
"self",
",",
"button",
"=",
"None",
")",
":",
"if",
"not",
"button",
":",
"return",
"self",
".",
"send_button",
"(",
"map",
"=",
"\"R1\"",
",",
"button",
"=",
"button",
")"
] | https://github.com/garbear/kodi-steamlink/blob/3f8e5970b01607cdb3c2688fbaa78e08f2d9c561/tools/EventClients/lib/python/xbmcclient.py#L543-L550 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/misc/doccer.py | python | filldoc | (docdict, unindent_params=True) | return decorate | Return docstring decorator using docdict variable dictionary
Parameters
----------
docdict : dictionary
dictionary containing name, docstring fragment pairs
unindent_params : {False, True}, boolean, optional
If True, strip common indentation from all parameters in
docdict
R... | Return docstring decorator using docdict variable dictionary | [
"Return",
"docstring",
"decorator",
"using",
"docdict",
"variable",
"dictionary"
] | def filldoc(docdict, unindent_params=True):
''' Return docstring decorator using docdict variable dictionary
Parameters
----------
docdict : dictionary
dictionary containing name, docstring fragment pairs
unindent_params : {False, True}, boolean, optional
If True, strip common inden... | [
"def",
"filldoc",
"(",
"docdict",
",",
"unindent_params",
"=",
"True",
")",
":",
"if",
"unindent_params",
":",
"docdict",
"=",
"unindent_dict",
"(",
"docdict",
")",
"def",
"decorate",
"(",
"f",
")",
":",
"f",
".",
"__doc__",
"=",
"docformat",
"(",
"f",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/misc/doccer.py#L153-L176 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | ppapi/generators/idl_generator.py | python | GeneratorByFile.GenerateFile | (self, filenode, releases, options) | return 0 | Generates an output file from the IDL source.
Returns true if the generated file is different than the previously
generated file. | Generates an output file from the IDL source. | [
"Generates",
"an",
"output",
"file",
"from",
"the",
"IDL",
"source",
"."
] | def GenerateFile(self, filenode, releases, options):
"""Generates an output file from the IDL source.
Returns true if the generated file is different than the previously
generated file.
"""
__pychecker__ = 'unusednames=filenode,releases,options'
self.Error("Undefined release generator.")
re... | [
"def",
"GenerateFile",
"(",
"self",
",",
"filenode",
",",
"releases",
",",
"options",
")",
":",
"__pychecker__",
"=",
"'unusednames=filenode,releases,options'",
"self",
".",
"Error",
"(",
"\"Undefined release generator.\"",
")",
"return",
"0"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_generator.py#L163-L171 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.