nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/concurrent/futures/_base.py | python | Future.cancelled | (self) | Return True if the future was cancelled. | Return True if the future was cancelled. | [
"Return",
"True",
"if",
"the",
"future",
"was",
"cancelled",
"."
] | def cancelled(self):
"""Return True if the future was cancelled."""
with self._condition:
return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED] | [
"def",
"cancelled",
"(",
"self",
")",
":",
"with",
"self",
".",
"_condition",
":",
"return",
"self",
".",
"_state",
"in",
"[",
"CANCELLED",
",",
"CANCELLED_AND_NOTIFIED",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/concurrent/futures/_base.py#L367-L370 | ||
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/ctemplate/src/htmlparser/generate_fsm.py | python | FSMGenerateC._CreateHeader | (self) | return '\n'.join(out) | Print the include file header. | Print the include file header. | [
"Print",
"the",
"include",
"file",
"header",
"."
] | def _CreateHeader(self):
"""Print the include file header."""
out = []
if self._config.comment:
out.append('/* ' + self._config.comment)
else:
out.append('/* State machine definition for ' + self._config.name)
out.append(' * Auto generated by generate_fsm.py. Please do not edit.')
... | [
"def",
"_CreateHeader",
"(",
"self",
")",
":",
"out",
"=",
"[",
"]",
"if",
"self",
".",
"_config",
".",
"comment",
":",
"out",
".",
"append",
"(",
"'/* '",
"+",
"self",
".",
"_config",
".",
"comment",
")",
"else",
":",
"out",
".",
"append",
"(",
... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/ctemplate/src/htmlparser/generate_fsm.py#L88-L100 | |
qtumproject/qtum | f5a195cc8c62510336ce4f30b7f74b5fdc445ad7 | contrib/devtools/copyright_header.py | python | get_filenames_to_examine | (base_directory) | return sorted([os.path.join(root, filename) for filename in filenames if
applies_to_file(filename)]) | Returns an array of absolute paths to any project files in the base_directory that pass the include/exclude filters | Returns an array of absolute paths to any project files in the base_directory that pass the include/exclude filters | [
"Returns",
"an",
"array",
"of",
"absolute",
"paths",
"to",
"any",
"project",
"files",
"in",
"the",
"base_directory",
"that",
"pass",
"the",
"include",
"/",
"exclude",
"filters"
] | def get_filenames_to_examine(base_directory):
"Returns an array of absolute paths to any project files in the base_directory that pass the include/exclude filters"
root = call_git_toplevel()
filenames = call_git_ls(base_directory)
return sorted([os.path.join(root, filename) for filename in filenames if
... | [
"def",
"get_filenames_to_examine",
"(",
"base_directory",
")",
":",
"root",
"=",
"call_git_toplevel",
"(",
")",
"filenames",
"=",
"call_git_ls",
"(",
"base_directory",
")",
"return",
"sorted",
"(",
"[",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"file... | https://github.com/qtumproject/qtum/blob/f5a195cc8c62510336ce4f30b7f74b5fdc445ad7/contrib/devtools/copyright_header.py#L65-L70 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | Geometry.Intersection | (self, *args) | return _ogr.Geometry_Intersection(self, *args) | r"""
Intersection(Geometry self, Geometry other) -> Geometry
OGRGeometryH
OGR_G_Intersection(OGRGeometryH hThis, OGRGeometryH hOther)
Compute intersection.
Generates a new geometry which is the region of intersection of the
two geometries operated on. The OGR_G_Intersec... | r"""
Intersection(Geometry self, Geometry other) -> Geometry
OGRGeometryH
OGR_G_Intersection(OGRGeometryH hThis, OGRGeometryH hOther) | [
"r",
"Intersection",
"(",
"Geometry",
"self",
"Geometry",
"other",
")",
"-",
">",
"Geometry",
"OGRGeometryH",
"OGR_G_Intersection",
"(",
"OGRGeometryH",
"hThis",
"OGRGeometryH",
"hOther",
")"
] | def Intersection(self, *args):
r"""
Intersection(Geometry self, Geometry other) -> Geometry
OGRGeometryH
OGR_G_Intersection(OGRGeometryH hThis, OGRGeometryH hOther)
Compute intersection.
Generates a new geometry which is the region of intersection of the
two geo... | [
"def",
"Intersection",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"Geometry_Intersection",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L6338-L6372 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py | python | buildTagMap | (default, *args) | return built | Turns a list of maps, lists, or scalars into a single map.
Used to build the SELF_CLOSING_TAGS, NESTABLE_TAGS, and
NESTING_RESET_TAGS maps out of lists and partial maps. | Turns a list of maps, lists, or scalars into a single map.
Used to build the SELF_CLOSING_TAGS, NESTABLE_TAGS, and
NESTING_RESET_TAGS maps out of lists and partial maps. | [
"Turns",
"a",
"list",
"of",
"maps",
"lists",
"or",
"scalars",
"into",
"a",
"single",
"map",
".",
"Used",
"to",
"build",
"the",
"SELF_CLOSING_TAGS",
"NESTABLE_TAGS",
"and",
"NESTING_RESET_TAGS",
"maps",
"out",
"of",
"lists",
"and",
"partial",
"maps",
"."
] | def buildTagMap(default, *args):
"""Turns a list of maps, lists, or scalars into a single map.
Used to build the SELF_CLOSING_TAGS, NESTABLE_TAGS, and
NESTING_RESET_TAGS maps out of lists and partial maps."""
built = {}
for portion in args:
if hasattr(portion, 'items'):
#It's a m... | [
"def",
"buildTagMap",
"(",
"default",
",",
"*",
"args",
")",
":",
"built",
"=",
"{",
"}",
"for",
"portion",
"in",
"args",
":",
"if",
"hasattr",
"(",
"portion",
",",
"'items'",
")",
":",
"#It's a map. Merge it.",
"for",
"k",
",",
"v",
"in",
"portion",
... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L1015-L1032 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/compiler_fc.py | python | options | (opt) | This is how to provide compiler preferences on the command-line::
$ waf configure --check-fortran-compiler=ifort | This is how to provide compiler preferences on the command-line:: | [
"This",
"is",
"how",
"to",
"provide",
"compiler",
"preferences",
"on",
"the",
"command",
"-",
"line",
"::"
] | def options(opt):
"""
This is how to provide compiler preferences on the command-line::
$ waf configure --check-fortran-compiler=ifort
"""
test_for_compiler = default_compilers()
opt.load_special_tools('fc_*.py')
fortran_compiler_opts = opt.add_option_group('Configuration options')
fortran_compiler_opts.add_o... | [
"def",
"options",
"(",
"opt",
")",
":",
"test_for_compiler",
"=",
"default_compilers",
"(",
")",
"opt",
".",
"load_special_tools",
"(",
"'fc_*.py'",
")",
"fortran_compiler_opts",
"=",
"opt",
".",
"add_option_group",
"(",
"'Configuration options'",
")",
"fortran_comp... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/compiler_fc.py#L58-L72 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/path.py/path.py | python | Path.splitall | (self) | return parts | r""" Return a list of the path components in this path.
The first item in the list will be a Path. Its value will be
either :data:`os.curdir`, :data:`os.pardir`, empty, or the root
directory of this path (for example, ``'/'`` or ``'C:\\'``). The
other items in the list will be strings... | r""" Return a list of the path components in this path. | [
"r",
"Return",
"a",
"list",
"of",
"the",
"path",
"components",
"in",
"this",
"path",
"."
] | def splitall(self):
r""" Return a list of the path components in this path.
The first item in the list will be a Path. Its value will be
either :data:`os.curdir`, :data:`os.pardir`, empty, or the root
directory of this path (for example, ``'/'`` or ``'C:\\'``). The
other items... | [
"def",
"splitall",
"(",
"self",
")",
":",
"parts",
"=",
"[",
"]",
"loc",
"=",
"self",
"while",
"loc",
"!=",
"os",
".",
"curdir",
"and",
"loc",
"!=",
"os",
".",
"pardir",
":",
"prev",
"=",
"loc",
"loc",
",",
"child",
"=",
"prev",
".",
"splitpath",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/path.py/path.py#L445-L465 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urlparse.py | python | urlparse | (url, scheme='', allow_fragments=True) | return ParseResult(scheme, netloc, url, params, query, fragment) | Parse a URL into 6 components:
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>
Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) and we don't expand % escapes. | Parse a URL into 6 components:
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>
Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) and we don't expand % escapes. | [
"Parse",
"a",
"URL",
"into",
"6",
"components",
":",
"<scheme",
">",
":",
"//",
"<netloc",
">",
"/",
"<path",
">",
";",
"<params",
">",
"?<query",
">",
"#<fragment",
">",
"Return",
"a",
"6",
"-",
"tuple",
":",
"(",
"scheme",
"netloc",
"path",
"params... | def urlparse(url, scheme='', allow_fragments=True):
"""Parse a URL into 6 components:
<scheme>://<netloc>/<path>;<params>?<query>#<fragment>
Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) ... | [
"def",
"urlparse",
"(",
"url",
",",
"scheme",
"=",
"''",
",",
"allow_fragments",
"=",
"True",
")",
":",
"tuple",
"=",
"urlsplit",
"(",
"url",
",",
"scheme",
",",
"allow_fragments",
")",
"scheme",
",",
"netloc",
",",
"url",
",",
"query",
",",
"fragment"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urlparse.py#L136-L148 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/__init__.py | python | Package | (env, target=None, source=None, **kw) | return targets | Entry point for the package tool. | Entry point for the package tool. | [
"Entry",
"point",
"for",
"the",
"package",
"tool",
"."
] | def Package(env, target=None, source=None, **kw):
""" Entry point for the package tool.
"""
# check if we need to find the source files ourself
if not source:
source = env.FindInstalledFiles()
if len(source)==0:
raise UserError("No source for Package() given")
# decide which ty... | [
"def",
"Package",
"(",
"env",
",",
"target",
"=",
"None",
",",
"source",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"# check if we need to find the source files ourself",
"if",
"not",
"source",
":",
"source",
"=",
"env",
".",
"FindInstalledFiles",
"(",
")",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/__init__.py#L84-L187 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/multipath.py | python | MultiPath.loadXML | (self,tree) | return | Loads a multipath from a multipath xml tree (ElementTree). | Loads a multipath from a multipath xml tree (ElementTree). | [
"Loads",
"a",
"multipath",
"from",
"a",
"multipath",
"xml",
"tree",
"(",
"ElementTree",
")",
"."
] | def loadXML(self,tree):
"""Loads a multipath from a multipath xml tree (ElementTree)."""
from ..io import loader
self.sections = []
self.holdSet = dict()
self.settings = dict()
root = tree.getroot()
for k,v in root.attrib.items():
self.settings[k]=v
... | [
"def",
"loadXML",
"(",
"self",
",",
"tree",
")",
":",
"from",
".",
".",
"io",
"import",
"loader",
"self",
".",
"sections",
"=",
"[",
"]",
"self",
".",
"holdSet",
"=",
"dict",
"(",
")",
"self",
".",
"settings",
"=",
"dict",
"(",
")",
"root",
"=",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/multipath.py#L327-L369 | |
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/generator/msvs.py | python | _FilterActionsFromExcluded | (excluded_sources, actions_to_add) | return [s for s in excluded_sources if s not in must_keep] | Take inputs with actions attached out of the list of exclusions.
Arguments:
excluded_sources: list of source files not to be built.
actions_to_add: dict of actions keyed on source file they're attached to.
Returns:
excluded_sources with files that have actions attached removed. | Take inputs with actions attached out of the list of exclusions. | [
"Take",
"inputs",
"with",
"actions",
"attached",
"out",
"of",
"the",
"list",
"of",
"exclusions",
"."
] | def _FilterActionsFromExcluded(excluded_sources, actions_to_add):
"""Take inputs with actions attached out of the list of exclusions.
Arguments:
excluded_sources: list of source files not to be built.
actions_to_add: dict of actions keyed on source file they're attached to.
Returns:
excluded_sources ... | [
"def",
"_FilterActionsFromExcluded",
"(",
"excluded_sources",
",",
"actions_to_add",
")",
":",
"must_keep",
"=",
"set",
"(",
"_FixPaths",
"(",
"actions_to_add",
".",
"keys",
"(",
")",
")",
")",
"return",
"[",
"s",
"for",
"s",
"in",
"excluded_sources",
"if",
... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/msvs.py#L800-L810 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | ImageHistogram.GetCount | (*args, **kwargs) | return _core_.ImageHistogram_GetCount(*args, **kwargs) | GetCount(self, unsigned long key) -> unsigned long
Returns the pixel count for the given key. Use `MakeKey` to create a
key value from a RGB tripple. | GetCount(self, unsigned long key) -> unsigned long | [
"GetCount",
"(",
"self",
"unsigned",
"long",
"key",
")",
"-",
">",
"unsigned",
"long"
] | def GetCount(*args, **kwargs):
"""
GetCount(self, unsigned long key) -> unsigned long
Returns the pixel count for the given key. Use `MakeKey` to create a
key value from a RGB tripple.
"""
return _core_.ImageHistogram_GetCount(*args, **kwargs) | [
"def",
"GetCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ImageHistogram_GetCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2766-L2773 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/datetime.py | python | timedelta.microseconds | (self) | return self._microseconds | microseconds | microseconds | [
"microseconds"
] | def microseconds(self):
"""microseconds"""
return self._microseconds | [
"def",
"microseconds",
"(",
"self",
")",
":",
"return",
"self",
".",
"_microseconds"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/datetime.py#L617-L619 | |
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/util/path.py | python | root | (path, root) | If 'path' is relative, it is rooted at 'root'. Otherwise, it's unchanged. | If 'path' is relative, it is rooted at 'root'. Otherwise, it's unchanged. | [
"If",
"path",
"is",
"relative",
"it",
"is",
"rooted",
"at",
"root",
".",
"Otherwise",
"it",
"s",
"unchanged",
"."
] | def root (path, root):
""" If 'path' is relative, it is rooted at 'root'. Otherwise, it's unchanged.
"""
if os.path.isabs (path):
return path
else:
return os.path.join (root, path) | [
"def",
"root",
"(",
"path",
",",
"root",
")",
":",
"if",
"os",
".",
"path",
".",
"isabs",
"(",
"path",
")",
":",
"return",
"path",
"else",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"path",
")"
] | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/util/path.py#L28-L34 | ||
TimoSaemann/caffe-segnet-cudnn5 | abcf30dca449245e101bf4ced519f716177f0885 | python/caffe/io.py | python | arraylist_to_blobprotovector_str | (arraylist) | return vec.SerializeToString() | Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing. | Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing. | [
"Converts",
"a",
"list",
"of",
"arrays",
"to",
"a",
"serialized",
"blobprotovec",
"which",
"could",
"be",
"then",
"passed",
"to",
"a",
"network",
"for",
"processing",
"."
] | def arraylist_to_blobprotovector_str(arraylist):
"""Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing.
"""
vec = caffe_pb2.BlobProtoVector()
vec.blobs.extend([array_to_blobproto(arr) for arr in arraylist])
return vec.SerializeToString(... | [
"def",
"arraylist_to_blobprotovector_str",
"(",
"arraylist",
")",
":",
"vec",
"=",
"caffe_pb2",
".",
"BlobProtoVector",
"(",
")",
"vec",
".",
"blobs",
".",
"extend",
"(",
"[",
"array_to_blobproto",
"(",
"arr",
")",
"for",
"arr",
"in",
"arraylist",
"]",
")",
... | https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/python/caffe/io.py#L49-L55 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.DoDragOver | (*args, **kwargs) | return _stc.StyledTextCtrl_DoDragOver(*args, **kwargs) | DoDragOver(self, int x, int y, int def) -> int
Allow for simulating a DnD DragOver. | DoDragOver(self, int x, int y, int def) -> int | [
"DoDragOver",
"(",
"self",
"int",
"x",
"int",
"y",
"int",
"def",
")",
"-",
">",
"int"
] | def DoDragOver(*args, **kwargs):
"""
DoDragOver(self, int x, int y, int def) -> int
Allow for simulating a DnD DragOver.
"""
return _stc.StyledTextCtrl_DoDragOver(*args, **kwargs) | [
"def",
"DoDragOver",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_DoDragOver",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L6653-L6659 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DQM/Integration/scripts/harvesting_tools/cmsHarvester.py | python | CMSHarvester.option_handler_frontier_connection | (self, option, opt_str,
value, parser) | Override the default Frontier connection string.
Please only use this for testing (e.g. when a test payload has
been inserted into cms_orc_off instead of cms_orc_on).
This method gets called for three different command line
options:
- --frontier-connection,
- --frontier... | Override the default Frontier connection string. | [
"Override",
"the",
"default",
"Frontier",
"connection",
"string",
"."
] | def option_handler_frontier_connection(self, option, opt_str,
value, parser):
"""Override the default Frontier connection string.
Please only use this for testing (e.g. when a test payload has
been inserted into cms_orc_off instead of cms_orc_on).
... | [
"def",
"option_handler_frontier_connection",
"(",
"self",
",",
"option",
",",
"opt_str",
",",
"value",
",",
"parser",
")",
":",
"# Figure out with which command line option we've been called.",
"frontier_type",
"=",
"opt_str",
".",
"split",
"(",
"\"-\"",
")",
"[",
"-"... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DQM/Integration/scripts/harvesting_tools/cmsHarvester.py#L823-L899 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth1/rfc5849/endpoints/access_token.py | python | AccessTokenEndpoint.validate_access_token_request | (self, request) | return v, request | Validate an access token request.
:param request: An oauthlib.common.Request object.
:raises: OAuth1Error if the request is invalid.
:returns: A tuple of 2 elements.
1. The validation result (True or False).
2. The request object. | Validate an access token request. | [
"Validate",
"an",
"access",
"token",
"request",
"."
] | def validate_access_token_request(self, request):
"""Validate an access token request.
:param request: An oauthlib.common.Request object.
:raises: OAuth1Error if the request is invalid.
:returns: A tuple of 2 elements.
1. The validation result (True or False).
... | [
"def",
"validate_access_token_request",
"(",
"self",
",",
"request",
")",
":",
"self",
".",
"_check_transport_security",
"(",
"request",
")",
"self",
".",
"_check_mandatory_parameters",
"(",
"request",
")",
"if",
"not",
"request",
".",
"resource_owner_key",
":",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth1/rfc5849/endpoints/access_token.py#L120-L215 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/function_base.py | python | unwrap | (p, discont=pi, axis=-1) | return up | Unwrap by changing deltas between values to 2*pi complement.
Unwrap radian phase `p` by changing absolute jumps greater than
`discont` to their 2*pi complement along the given axis.
Parameters
----------
p : array_like
Input array.
discont : float, optional
Maximum discontinuit... | Unwrap by changing deltas between values to 2*pi complement. | [
"Unwrap",
"by",
"changing",
"deltas",
"between",
"values",
"to",
"2",
"*",
"pi",
"complement",
"."
] | def unwrap(p, discont=pi, axis=-1):
"""
Unwrap by changing deltas between values to 2*pi complement.
Unwrap radian phase `p` by changing absolute jumps greater than
`discont` to their 2*pi complement along the given axis.
Parameters
----------
p : array_like
Input array.
discon... | [
"def",
"unwrap",
"(",
"p",
",",
"discont",
"=",
"pi",
",",
"axis",
"=",
"-",
"1",
")",
":",
"p",
"=",
"asarray",
"(",
"p",
")",
"nd",
"=",
"p",
".",
"ndim",
"dd",
"=",
"diff",
"(",
"p",
",",
"axis",
"=",
"axis",
")",
"slice1",
"=",
"[",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/function_base.py#L1472-L1525 | |
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/internal/wire_format.py | python | ZigZagEncode | (value) | return (value << 1) ^ (~0) | ZigZag Transform: Encodes signed integers so that they can be
effectively used with varint encoding. See wire_format.h for
more details. | ZigZag Transform: Encodes signed integers so that they can be
effectively used with varint encoding. See wire_format.h for
more details. | [
"ZigZag",
"Transform",
":",
"Encodes",
"signed",
"integers",
"so",
"that",
"they",
"can",
"be",
"effectively",
"used",
"with",
"varint",
"encoding",
".",
"See",
"wire_format",
".",
"h",
"for",
"more",
"details",
"."
] | def ZigZagEncode(value):
"""ZigZag Transform: Encodes signed integers so that they can be
effectively used with varint encoding. See wire_format.h for
more details.
"""
if value >= 0:
return value << 1
return (value << 1) ^ (~0) | [
"def",
"ZigZagEncode",
"(",
"value",
")",
":",
"if",
"value",
">=",
"0",
":",
"return",
"value",
"<<",
"1",
"return",
"(",
"value",
"<<",
"1",
")",
"^",
"(",
"~",
"0",
")"
] | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/wire_format.py#L100-L107 | |
alibaba/graph-learn | 54cafee9db3054dc310a28b856be7f97c7d5aee9 | examples/basic/query_examples.py | python | test_truncated_full_edge_sample | (graph) | Iterate buy edges, and sample full neighbors of the dst nodes. | Iterate buy edges, and sample full neighbors of the dst nodes. | [
"Iterate",
"buy",
"edges",
"and",
"sample",
"full",
"neighbors",
"of",
"the",
"dst",
"nodes",
"."
] | def test_truncated_full_edge_sample(graph):
"""Iterate buy edges, and sample full neighbors of the dst nodes.
"""
edges = graph.E("buy").batch(3).shuffle(traverse=True).alias("edges")
dst = edges.inV().alias("dst")
dst.inE("buy").sample(200).by("full").alias("dst_hop1_edges") \
.inV().alias("dst_hop1")
... | [
"def",
"test_truncated_full_edge_sample",
"(",
"graph",
")",
":",
"edges",
"=",
"graph",
".",
"E",
"(",
"\"buy\"",
")",
".",
"batch",
"(",
"3",
")",
".",
"shuffle",
"(",
"traverse",
"=",
"True",
")",
".",
"alias",
"(",
"\"edges\"",
")",
"dst",
"=",
"... | https://github.com/alibaba/graph-learn/blob/54cafee9db3054dc310a28b856be7f97c7d5aee9/examples/basic/query_examples.py#L157-L179 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/combo.py | python | ComboCtrl.SetButtonPosition | (*args, **kwargs) | return _combo.ComboCtrl_SetButtonPosition(*args, **kwargs) | SetButtonPosition(self, int width=-1, int height=-1, int side=RIGHT, int spacingX=0)
Set the position of the dropdown button. | SetButtonPosition(self, int width=-1, int height=-1, int side=RIGHT, int spacingX=0) | [
"SetButtonPosition",
"(",
"self",
"int",
"width",
"=",
"-",
"1",
"int",
"height",
"=",
"-",
"1",
"int",
"side",
"=",
"RIGHT",
"int",
"spacingX",
"=",
"0",
")"
] | def SetButtonPosition(*args, **kwargs):
"""
SetButtonPosition(self, int width=-1, int height=-1, int side=RIGHT, int spacingX=0)
Set the position of the dropdown button.
"""
return _combo.ComboCtrl_SetButtonPosition(*args, **kwargs) | [
"def",
"SetButtonPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"ComboCtrl_SetButtonPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L326-L332 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py | python | AbstractBufferedFile.tell | (self) | return self.loc | Current file location | Current file location | [
"Current",
"file",
"location"
] | def tell(self):
""" Current file location """
return self.loc | [
"def",
"tell",
"(",
"self",
")",
":",
"return",
"self",
".",
"loc"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py#L1099-L1101 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py | python | Base.Ignore | (self, target, dependency) | return tlist | Ignore a dependency. | Ignore a dependency. | [
"Ignore",
"a",
"dependency",
"."
] | def Ignore(self, target, dependency):
"""Ignore a dependency."""
tlist = self.arg2nodes(target, self.fs.Entry)
dlist = self.arg2nodes(dependency, self.fs.Entry)
for t in tlist:
t.add_ignore(dlist)
return tlist | [
"def",
"Ignore",
"(",
"self",
",",
"target",
",",
"dependency",
")",
":",
"tlist",
"=",
"self",
".",
"arg2nodes",
"(",
"target",
",",
"self",
".",
"fs",
".",
"Entry",
")",
"dlist",
"=",
"self",
".",
"arg2nodes",
"(",
"dependency",
",",
"self",
".",
... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py#L2061-L2067 | |
zeakey/DeepSkeleton | dc70170f8fd2ec8ca1157484ce66129981104486 | python/caffe/io.py | python | Transformer.preprocess | (self, in_, data) | return caffe_in | Format input for Caffe:
- convert to single
- resize to input dimensions (preserving number of channels)
- transpose dimensions to K x H x W
- reorder channels (for instance color to BGR)
- scale raw input (e.g. from [0, 1] to [0, 255] for ImageNet models)
- subtract mean... | Format input for Caffe:
- convert to single
- resize to input dimensions (preserving number of channels)
- transpose dimensions to K x H x W
- reorder channels (for instance color to BGR)
- scale raw input (e.g. from [0, 1] to [0, 255] for ImageNet models)
- subtract mean... | [
"Format",
"input",
"for",
"Caffe",
":",
"-",
"convert",
"to",
"single",
"-",
"resize",
"to",
"input",
"dimensions",
"(",
"preserving",
"number",
"of",
"channels",
")",
"-",
"transpose",
"dimensions",
"to",
"K",
"x",
"H",
"x",
"W",
"-",
"reorder",
"channe... | def preprocess(self, in_, data):
"""
Format input for Caffe:
- convert to single
- resize to input dimensions (preserving number of channels)
- transpose dimensions to K x H x W
- reorder channels (for instance color to BGR)
- scale raw input (e.g. from [0, 1] to ... | [
"def",
"preprocess",
"(",
"self",
",",
"in_",
",",
"data",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"caffe_in",
"=",
"data",
".",
"astype",
"(",
"np",
".",
"float32",
",",
"copy",
"=",
"False",
")",
"transpose",
"=",
"self",
".",
"t... | https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/python/caffe/io.py#L118-L158 | |
tpfister/caffe-heatmap | 4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e | scripts/cpp_lint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/scripts/cpp_lint.py#L1254-L1297 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/dist.py | python | Distribution._show_help | (self, parser, global_options=1, display_options=1,
commands=[]) | Show help for the setup script command-line in the form of
several lists of command-line options. 'parser' should be a
FancyGetopt instance; do not expect it to be returned in the
same state, as its option table will be reset to make it
generate the correct help text.
If 'globa... | Show help for the setup script command-line in the form of
several lists of command-line options. 'parser' should be a
FancyGetopt instance; do not expect it to be returned in the
same state, as its option table will be reset to make it
generate the correct help text. | [
"Show",
"help",
"for",
"the",
"setup",
"script",
"command",
"-",
"line",
"in",
"the",
"form",
"of",
"several",
"lists",
"of",
"command",
"-",
"line",
"options",
".",
"parser",
"should",
"be",
"a",
"FancyGetopt",
"instance",
";",
"do",
"not",
"expect",
"i... | def _show_help(self, parser, global_options=1, display_options=1,
commands=[]):
"""Show help for the setup script command-line in the form of
several lists of command-line options. 'parser' should be a
FancyGetopt instance; do not expect it to be returned in the
same ... | [
"def",
"_show_help",
"(",
"self",
",",
"parser",
",",
"global_options",
"=",
"1",
",",
"display_options",
"=",
"1",
",",
"commands",
"=",
"[",
"]",
")",
":",
"# late import because of mutual dependence between these modules",
"from",
"distutils",
".",
"core",
"imp... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/dist.py#L607-L655 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/cuda/__init__.py | python | set_device | (device: _device_t) | r"""Sets the current device.
Usage of this function is discouraged in favor of :any:`device`. In most
cases it's better to use ``CUDA_VISIBLE_DEVICES`` environmental variable.
Args:
device (torch.device or int): selected device. This function is a no-op
if this argument is negative. | r"""Sets the current device. | [
"r",
"Sets",
"the",
"current",
"device",
"."
] | def set_device(device: _device_t) -> None:
r"""Sets the current device.
Usage of this function is discouraged in favor of :any:`device`. In most
cases it's better to use ``CUDA_VISIBLE_DEVICES`` environmental variable.
Args:
device (torch.device or int): selected device. This function is a no-... | [
"def",
"set_device",
"(",
"device",
":",
"_device_t",
")",
"->",
"None",
":",
"device",
"=",
"_get_device_index",
"(",
"device",
")",
"if",
"device",
">=",
"0",
":",
"torch",
".",
"_C",
".",
"_cuda_setDevice",
"(",
"device",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/cuda/__init__.py#L301-L313 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Point2D.__neg__ | (*args, **kwargs) | return _core_.Point2D___neg__(*args, **kwargs) | __neg__(self) -> Point2D
the reflection of this point | __neg__(self) -> Point2D | [
"__neg__",
"(",
"self",
")",
"-",
">",
"Point2D"
] | def __neg__(*args, **kwargs):
"""
__neg__(self) -> Point2D
the reflection of this point
"""
return _core_.Point2D___neg__(*args, **kwargs) | [
"def",
"__neg__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Point2D___neg__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1710-L1716 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/image_ops.py | python | adjust_brightness | (image, delta) | Adjust the brightness of RGB or Grayscale images.
This is a convenience method that converts an RGB image to float
representation, adjusts its brightness, and then converts it back to the
original data type. If several adjustments are chained it is advisable to
minimize the number of redundant conversions.
... | Adjust the brightness of RGB or Grayscale images. | [
"Adjust",
"the",
"brightness",
"of",
"RGB",
"or",
"Grayscale",
"images",
"."
] | def adjust_brightness(image, delta):
"""Adjust the brightness of RGB or Grayscale images.
This is a convenience method that converts an RGB image to float
representation, adjusts its brightness, and then converts it back to the
original data type. If several adjustments are chained it is advisable to
minimiz... | [
"def",
"adjust_brightness",
"(",
"image",
",",
"delta",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"image",
",",
"delta",
"]",
",",
"None",
",",
"'adjust_brightness'",
")",
"as",
"name",
":",
"image",
"=",
"ops",
".",
"convert_to_tensor",
"(",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/image_ops.py#L915-L946 | ||
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/properties/valueKeyframed.py | python | gen_value_Keyframed | (lottie, animated, idx) | Generates the dictionary corresponding to properties/valueKeyframed.json in
lottie documentation
Args:
lottie (dict) : Lottie bezier curve stored in this
animated (lxml.etree._Element) : Synfig format animation
idx (int) : Index of animation
Re... | Generates the dictionary corresponding to properties/valueKeyframed.json in
lottie documentation | [
"Generates",
"the",
"dictionary",
"corresponding",
"to",
"properties",
"/",
"valueKeyframed",
".",
"json",
"in",
"lottie",
"documentation"
] | def gen_value_Keyframed(lottie, animated, idx):
"""
Generates the dictionary corresponding to properties/valueKeyframed.json in
lottie documentation
Args:
lottie (dict) : Lottie bezier curve stored in this
animated (lxml.etree._Element) : Synfig format animation
... | [
"def",
"gen_value_Keyframed",
"(",
"lottie",
",",
"animated",
",",
"idx",
")",
":",
"lottie",
"[",
"\"ix\"",
"]",
"=",
"idx",
"lottie",
"[",
"\"a\"",
"]",
"=",
"1",
"lottie",
"[",
"\"k\"",
"]",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/properties/valueKeyframed.py#L12-L46 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/run-bisect-perf-regression.py | python | Goma._SetupAndStart | (self) | Sets up GOMA and launches it.
Args:
path_to_goma: Path to goma directory.
Returns:
True if successful. | Sets up GOMA and launches it. | [
"Sets",
"up",
"GOMA",
"and",
"launches",
"it",
"."
] | def _SetupAndStart(self):
"""Sets up GOMA and launches it.
Args:
path_to_goma: Path to goma directory.
Returns:
True if successful."""
self._SetupEnvVars()
# Sometimes goma is lingering around if something went bad on a previous
# run. Stop it before starting a new process. Can ig... | [
"def",
"_SetupAndStart",
"(",
"self",
")",
":",
"self",
".",
"_SetupEnvVars",
"(",
")",
"# Sometimes goma is lingering around if something went bad on a previous",
"# run. Stop it before starting a new process. Can ignore the return code",
"# since it will return an error if it wasn't runn... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/run-bisect-perf-regression.py#L70-L86 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/graph_editor/transform.py | python | copy_op_handler | (info, op, copy_shape=True) | return op_, op_.outputs | Copy a `tf.Operation`.
Args:
info: Transform._TmpInfo instance.
op: the `tf.Operation` to be copied.
copy_shape: also copy the shape of the tensor
Returns:
A `(op, op_outputs)` tuple containing the transformed op and its outputs. | Copy a `tf.Operation`. | [
"Copy",
"a",
"tf",
".",
"Operation",
"."
] | def copy_op_handler(info, op, copy_shape=True):
"""Copy a `tf.Operation`.
Args:
info: Transform._TmpInfo instance.
op: the `tf.Operation` to be copied.
copy_shape: also copy the shape of the tensor
Returns:
A `(op, op_outputs)` tuple containing the transformed op and its outputs.
"""
# pylint... | [
"def",
"copy_op_handler",
"(",
"info",
",",
"op",
",",
"copy_shape",
"=",
"True",
")",
":",
"# pylint: disable=protected-access",
"# Clone the node def:",
"node_def_",
"=",
"deepcopy",
"(",
"op",
".",
"_node_def",
")",
"# Transform name:",
"name_",
"=",
"info",
".... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/graph_editor/transform.py#L132-L179 | |
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/generator/android.py | python | AndroidMkWriter.WriteSources | (self, spec, configs, extra_sources) | Write Makefile code for any 'sources' from the gyp input.
These are source files necessary to build the current target.
We need to handle shared_intermediate directory source files as
a special case by copying them to the intermediate directory and
treating them as a genereated sources. Otherwise the An... | Write Makefile code for any 'sources' from the gyp input.
These are source files necessary to build the current target.
We need to handle shared_intermediate directory source files as
a special case by copying them to the intermediate directory and
treating them as a genereated sources. Otherwise the An... | [
"Write",
"Makefile",
"code",
"for",
"any",
"sources",
"from",
"the",
"gyp",
"input",
".",
"These",
"are",
"source",
"files",
"necessary",
"to",
"build",
"the",
"current",
"target",
".",
"We",
"need",
"to",
"handle",
"shared_intermediate",
"directory",
"source"... | def WriteSources(self, spec, configs, extra_sources):
"""Write Makefile code for any 'sources' from the gyp input.
These are source files necessary to build the current target.
We need to handle shared_intermediate directory source files as
a special case by copying them to the intermediate directory an... | [
"def",
"WriteSources",
"(",
"self",
",",
"spec",
",",
"configs",
",",
"extra_sources",
")",
":",
"sources",
"=",
"filter",
"(",
"make",
".",
"Compilable",
",",
"spec",
".",
"get",
"(",
"'sources'",
",",
"[",
"]",
")",
")",
"generated_not_sources",
"=",
... | 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/generator/android.py#L499-L582 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/npyio.py | python | recfromtxt | (fname, **kwargs) | return output | Load ASCII data from a file and return it in a record array.
If ``usemask=False`` a standard `recarray` is returned,
if ``usemask=True`` a MaskedRecords array is returned.
Complete description of all the optional input parameters is available in
the docstring of the `genfromtxt` function.
See Als... | Load ASCII data from a file and return it in a record array. | [
"Load",
"ASCII",
"data",
"from",
"a",
"file",
"and",
"return",
"it",
"in",
"a",
"record",
"array",
"."
] | def recfromtxt(fname, **kwargs):
"""
Load ASCII data from a file and return it in a record array.
If ``usemask=False`` a standard `recarray` is returned,
if ``usemask=True`` a MaskedRecords array is returned.
Complete description of all the optional input parameters is available in
the docstri... | [
"def",
"recfromtxt",
"(",
"fname",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"update",
"(",
"dtype",
"=",
"kwargs",
".",
"get",
"(",
"'dtype'",
",",
"None",
")",
")",
"usemask",
"=",
"kwargs",
".",
"get",
"(",
"'usemask'",
",",
"False",
")"... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/npyio.py#L1724-L1752 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_pyio.py | python | open | (file, mode="r", buffering=-1, encoding=None, errors=None,
newline=None, closefd=True, opener=None) | r"""Open file and return a stream. Raise OSError upon failure.
file is either a text or byte string giving the name (and the path
if the file isn't in the current working directory) of the file to
be opened or an integer file descriptor of the file to be
wrapped. (If a file descriptor is given, it is ... | r"""Open file and return a stream. Raise OSError upon failure. | [
"r",
"Open",
"file",
"and",
"return",
"a",
"stream",
".",
"Raise",
"OSError",
"upon",
"failure",
"."
] | def open(file, mode="r", buffering=-1, encoding=None, errors=None,
newline=None, closefd=True, opener=None):
r"""Open file and return a stream. Raise OSError upon failure.
file is either a text or byte string giving the name (and the path
if the file isn't in the current working directory) of th... | [
"def",
"open",
"(",
"file",
",",
"mode",
"=",
"\"r\"",
",",
"buffering",
"=",
"-",
"1",
",",
"encoding",
"=",
"None",
",",
"errors",
"=",
"None",
",",
"newline",
"=",
"None",
",",
"closefd",
"=",
"True",
",",
"opener",
"=",
"None",
")",
":",
"if"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pyio.py#L37-L246 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/IOBinding.py | python | IOBinding.decode | (self, chars) | return chars | Create a Unicode string
If that fails, let Tcl try its best | Create a Unicode string | [
"Create",
"a",
"Unicode",
"string"
] | def decode(self, chars):
"""Create a Unicode string
If that fails, let Tcl try its best
"""
# Check presence of a UTF-8 signature first
if chars.startswith(BOM_UTF8):
try:
chars = chars[3:].decode("utf-8")
except UnicodeError:
... | [
"def",
"decode",
"(",
"self",
",",
"chars",
")",
":",
"# Check presence of a UTF-8 signature first",
"if",
"chars",
".",
"startswith",
"(",
"BOM_UTF8",
")",
":",
"try",
":",
"chars",
"=",
"chars",
"[",
"3",
":",
"]",
".",
"decode",
"(",
"\"utf-8\"",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/IOBinding.py#L278-L321 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/internal/python_message.py | python | _AddClearExtensionMethod | (cls) | Helper for _AddMessageMethods(). | Helper for _AddMessageMethods(). | [
"Helper",
"for",
"_AddMessageMethods",
"()",
"."
] | def _AddClearExtensionMethod(cls):
"""Helper for _AddMessageMethods()."""
def ClearExtension(self, extension_handle):
_VerifyExtensionHandle(self, extension_handle)
# Similar to ClearField(), above.
if extension_handle in self._fields:
del self._fields[extension_handle]
self._Modified()
cls... | [
"def",
"_AddClearExtensionMethod",
"(",
"cls",
")",
":",
"def",
"ClearExtension",
"(",
"self",
",",
"extension_handle",
")",
":",
"_VerifyExtensionHandle",
"(",
"self",
",",
"extension_handle",
")",
"# Similar to ClearField(), above.",
"if",
"extension_handle",
"in",
... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/python_message.py#L885-L894 | ||
google/clif | cab24d6a105609a65c95a36a1712ae3c20c7b5df | clif/python/gen.py | python | _TypesInitInDependencyOrder | (types_init, raise_if_reordering=False) | Yields type_init items in dependency order: base classes before derived. | Yields type_init items in dependency order: base classes before derived. | [
"Yields",
"type_init",
"items",
"in",
"dependency",
"order",
":",
"base",
"classes",
"before",
"derived",
"."
] | def _TypesInitInDependencyOrder(types_init, raise_if_reordering=False):
"""Yields type_init items in dependency order: base classes before derived."""
cppname_indices = {}
for index, (cppname, _, _, _) in enumerate(types_init):
cppname_indices[cppname] = index
assert len(cppname_indices) == len(types_init)
... | [
"def",
"_TypesInitInDependencyOrder",
"(",
"types_init",
",",
"raise_if_reordering",
"=",
"False",
")",
":",
"cppname_indices",
"=",
"{",
"}",
"for",
"index",
",",
"(",
"cppname",
",",
"_",
",",
"_",
",",
"_",
")",
"in",
"enumerate",
"(",
"types_init",
")"... | https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/gen.py#L197-L227 | ||
google/shaka-player-embedded | dabbeb5b47cc257b37b9a254661546352aaf0afe | shaka/tools/run_configure.py | python | MakeClean | (src_dir) | Runs |make distclean| to clean up old configurations. | Runs |make distclean| to clean up old configurations. | [
"Runs",
"|make",
"distclean|",
"to",
"clean",
"up",
"old",
"configurations",
"."
] | def MakeClean(src_dir):
"""Runs |make distclean| to clean up old configurations."""
# Ignore bad return code (e.g. errors for missing Makefile).
with open(os.devnull, 'w') as null:
subprocess.call(['make', 'clean'], cwd=src_dir, stdout=null, stderr=null)
subprocess.call(['make', 'distclean'], cwd=src_dir,... | [
"def",
"MakeClean",
"(",
"src_dir",
")",
":",
"# Ignore bad return code (e.g. errors for missing Makefile).",
"with",
"open",
"(",
"os",
".",
"devnull",
",",
"'w'",
")",
"as",
"null",
":",
"subprocess",
".",
"call",
"(",
"[",
"'make'",
",",
"'clean'",
"]",
","... | https://github.com/google/shaka-player-embedded/blob/dabbeb5b47cc257b37b9a254661546352aaf0afe/shaka/tools/run_configure.py#L70-L76 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy_extension/_op.py | python | deconvolution | (data=None, weight=None, bias=None, kernel=None, stride=None, dilate=None,
pad=None, adj=None, target_shape=None, num_filter=1, num_group=1,
workspace=1024, no_bias=False, cudnn_tune=None,
cudnn_off=False, layout=None) | r"""Computes 1D, 2D or 3D transposed convolution (aka fractionally strided convolution) of
the input tensor. This operation can be seen as the gradient of Convolution operation
with respect to its input. Convolution usually reduces the size of the input.
Transposed convolution works the other way, going fro... | r"""Computes 1D, 2D or 3D transposed convolution (aka fractionally strided convolution) of
the input tensor. This operation can be seen as the gradient of Convolution operation
with respect to its input. Convolution usually reduces the size of the input.
Transposed convolution works the other way, going fro... | [
"r",
"Computes",
"1D",
"2D",
"or",
"3D",
"transposed",
"convolution",
"(",
"aka",
"fractionally",
"strided",
"convolution",
")",
"of",
"the",
"input",
"tensor",
".",
"This",
"operation",
"can",
"be",
"seen",
"as",
"the",
"gradient",
"of",
"Convolution",
"ope... | def deconvolution(data=None, weight=None, bias=None, kernel=None, stride=None, dilate=None,
pad=None, adj=None, target_shape=None, num_filter=1, num_group=1,
workspace=1024, no_bias=False, cudnn_tune=None,
cudnn_off=False, layout=None):
r"""Computes 1D, 2D or 3D... | [
"def",
"deconvolution",
"(",
"data",
"=",
"None",
",",
"weight",
"=",
"None",
",",
"bias",
"=",
"None",
",",
"kernel",
"=",
"None",
",",
"stride",
"=",
"None",
",",
"dilate",
"=",
"None",
",",
"pad",
"=",
"None",
",",
"adj",
"=",
"None",
",",
"ta... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy_extension/_op.py#L618-L696 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/defchararray.py | python | strip | (a, chars=None) | return _vec_string(a_arr, a_arr.dtype, 'strip', _clean_args(chars)) | For each element in `a`, return a copy with the leading and
trailing characters removed.
Calls `str.strip` element-wise.
Parameters
----------
a : array-like of str or unicode
chars : str or unicode, optional
The `chars` argument is a string specifying the set of
characters to b... | For each element in `a`, return a copy with the leading and
trailing characters removed. | [
"For",
"each",
"element",
"in",
"a",
"return",
"a",
"copy",
"with",
"the",
"leading",
"and",
"trailing",
"characters",
"removed",
"."
] | def strip(a, chars=None):
"""
For each element in `a`, return a copy with the leading and
trailing characters removed.
Calls `str.strip` element-wise.
Parameters
----------
a : array-like of str or unicode
chars : str or unicode, optional
The `chars` argument is a string specif... | [
"def",
"strip",
"(",
"a",
",",
"chars",
"=",
"None",
")",
":",
"a_arr",
"=",
"numpy",
".",
"asarray",
"(",
"a",
")",
"return",
"_vec_string",
"(",
"a_arr",
",",
"a_arr",
".",
"dtype",
",",
"'strip'",
",",
"_clean_args",
"(",
"chars",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/defchararray.py#L1513-L1554 | |
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/xtuner/tuner/db_agent.py | python | check_special_character | (phrase) | This function checks whether a phrase contains invalid characters.
This function is used for security verification to prevent potential security risks.
:param phrase: String type. Phrase to be checked
:raise: Raise SecurityError if security risks exists. | This function checks whether a phrase contains invalid characters.
This function is used for security verification to prevent potential security risks. | [
"This",
"function",
"checks",
"whether",
"a",
"phrase",
"contains",
"invalid",
"characters",
".",
"This",
"function",
"is",
"used",
"for",
"security",
"verification",
"to",
"prevent",
"potential",
"security",
"risks",
"."
] | def check_special_character(phrase):
"""
This function checks whether a phrase contains invalid characters.
This function is used for security verification to prevent potential security risks.
:param phrase: String type. Phrase to be checked
:raise: Raise SecurityError if security risks exists.
... | [
"def",
"check_special_character",
"(",
"phrase",
")",
":",
"check_list",
"=",
"(",
"' '",
",",
"'|'",
",",
"';'",
",",
"'&'",
",",
"'$'",
",",
"'<'",
",",
"'>'",
",",
"'`'",
",",
"'\\\\'",
",",
"'\\''",
",",
"'\"'",
",",
"'{'",
",",
"'}'",
",",
"... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/xtuner/tuner/db_agent.py#L27-L43 | ||
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | urllib3/fields.py | python | RequestField.render_headers | (self) | return '\r\n'.join(lines) | Renders the headers for this request field. | Renders the headers for this request field. | [
"Renders",
"the",
"headers",
"for",
"this",
"request",
"field",
"."
] | def render_headers(self):
"""
Renders the headers for this request field.
"""
lines = []
sort_keys = ['Content-Disposition', 'Content-Type', 'Content-Location']
for sort_key in sort_keys:
if self.headers.get(sort_key, False):
lines.append('%s:... | [
"def",
"render_headers",
"(",
"self",
")",
":",
"lines",
"=",
"[",
"]",
"sort_keys",
"=",
"[",
"'Content-Disposition'",
",",
"'Content-Type'",
",",
"'Content-Location'",
"]",
"for",
"sort_key",
"in",
"sort_keys",
":",
"if",
"self",
".",
"headers",
".",
"get"... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/urllib3/fields.py#L142-L159 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | v8_5_1/tools/grokdump.py | python | InspectionShell.do_s | (self, word) | Search for a given word in available memory regions. The given word
is expanded to full pointer size and searched at aligned as well as
un-aligned memory locations. Use 'sa' to search aligned locations
only. | Search for a given word in available memory regions. The given word
is expanded to full pointer size and searched at aligned as well as
un-aligned memory locations. Use 'sa' to search aligned locations
only. | [
"Search",
"for",
"a",
"given",
"word",
"in",
"available",
"memory",
"regions",
".",
"The",
"given",
"word",
"is",
"expanded",
"to",
"full",
"pointer",
"size",
"and",
"searched",
"at",
"aligned",
"as",
"well",
"as",
"un",
"-",
"aligned",
"memory",
"location... | def do_s(self, word):
"""
Search for a given word in available memory regions. The given word
is expanded to full pointer size and searched at aligned as well as
un-aligned memory locations. Use 'sa' to search aligned locations
only.
"""
try:
word = int(word, 0)
except ValueErr... | [
"def",
"do_s",
"(",
"self",
",",
"word",
")",
":",
"try",
":",
"word",
"=",
"int",
"(",
"word",
",",
"0",
")",
"except",
"ValueError",
":",
"print",
"\"Malformed word, prefix with '0x' to use hexadecimal format.\"",
"return",
"print",
"\"Searching for word %d/0x%s:\... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_5_1/tools/grokdump.py#L3045-L3058 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Font.Smaller | (*args, **kwargs) | return _gdi_.Font_Smaller(*args, **kwargs) | Smaller(self) -> Font | Smaller(self) -> Font | [
"Smaller",
"(",
"self",
")",
"-",
">",
"Font"
] | def Smaller(*args, **kwargs):
"""Smaller(self) -> Font"""
return _gdi_.Font_Smaller(*args, **kwargs) | [
"def",
"Smaller",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_Smaller",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2585-L2587 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/order.py | python | Order.__init__ | (self, order_id=None, cl_ord_id=None, cl_ord_link_id=None, account=None, symbol=None, side=None, simple_order_qty=None, order_qty=None, price=None, display_qty=None, stop_px=None, peg_offset_value=None, peg_price_type=None, currency=None, settl_currency=None, ord_type=None, time_in_force=None, exec_inst=None, contingen... | Order - a model defined in Swagger | Order - a model defined in Swagger | [
"Order",
"-",
"a",
"model",
"defined",
"in",
"Swagger"
] | def __init__(self, order_id=None, cl_ord_id=None, cl_ord_link_id=None, account=None, symbol=None, side=None, simple_order_qty=None, order_qty=None, price=None, display_qty=None, stop_px=None, peg_offset_value=None, peg_price_type=None, currency=None, settl_currency=None, ord_type=None, time_in_force=None, exec_inst=Non... | [
"def",
"__init__",
"(",
"self",
",",
"order_id",
"=",
"None",
",",
"cl_ord_id",
"=",
"None",
",",
"cl_ord_link_id",
"=",
"None",
",",
"account",
"=",
"None",
",",
"symbol",
"=",
"None",
",",
"side",
"=",
"None",
",",
"simple_order_qty",
"=",
"None",
",... | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/order.py#L105-L207 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py | python | Subversion.export | (self, location, url) | Export the svn repository at the url to the destination location | Export the svn repository at the url to the destination location | [
"Export",
"the",
"svn",
"repository",
"at",
"the",
"url",
"to",
"the",
"destination",
"location"
] | def export(self, location, url):
# type: (str, HiddenText) -> None
"""Export the svn repository at the url to the destination location"""
url, rev_options = self.get_url_rev_options(url)
logger.info('Exporting svn repository %s to %s', url, location)
with indent_log():
... | [
"def",
"export",
"(",
"self",
",",
"location",
",",
"url",
")",
":",
"# type: (str, HiddenText) -> None",
"url",
",",
"rev_options",
"=",
"self",
".",
"get_url_rev_options",
"(",
"url",
")",
"logger",
".",
"info",
"(",
"'Exporting svn repository %s to %s'",
",",
... | 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/vcs/subversion.py#L297-L312 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/nn_ops.py | python | conv1d_transpose | (
input, # pylint: disable=redefined-builtin
filters,
output_shape,
strides,
padding="SAME",
data_format="NWC",
dilations=None,
name=None) | The transpose of `conv1d`.
This operation is sometimes called "deconvolution" after
(Zeiler et al., 2010), but is actually the transpose (gradient) of `conv1d`
rather than an actual deconvolution.
Args:
input: A 3-D `Tensor` of type `float` and shape
`[batch, in_width, in_channels]` for `NWC` data f... | The transpose of `conv1d`. | [
"The",
"transpose",
"of",
"conv1d",
"."
] | def conv1d_transpose(
input, # pylint: disable=redefined-builtin
filters,
output_shape,
strides,
padding="SAME",
data_format="NWC",
dilations=None,
name=None):
"""The transpose of `conv1d`.
This operation is sometimes called "deconvolution" after
(Zeiler et al., 2010), but is act... | [
"def",
"conv1d_transpose",
"(",
"input",
",",
"# pylint: disable=redefined-builtin",
"filters",
",",
"output_shape",
",",
"strides",
",",
"padding",
"=",
"\"SAME\"",
",",
"data_format",
"=",
"\"NWC\"",
",",
"dilations",
"=",
"None",
",",
"name",
"=",
"None",
")"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/nn_ops.py#L2134-L2220 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/control/robotinterfaceutils.py | python | RobotInterfaceEmulator.sendToInterface | (self,interface: RobotInterfaceBase, indices = None) | return (desiredControlMode,baseControlMode) | Sends a command to the interface using the highest level interface
as possible.
Returns:
tuple: (desiredControlMode,baseControlMode) indicating which mode was
desired and which was actually achieved. | Sends a command to the interface using the highest level interface
as possible.
Returns:
tuple: (desiredControlMode,baseControlMode) indicating which mode was
desired and which was actually achieved. | [
"Sends",
"a",
"command",
"to",
"the",
"interface",
"using",
"the",
"highest",
"level",
"interface",
"as",
"possible",
".",
"Returns",
":",
"tuple",
":",
"(",
"desiredControlMode",
"baseControlMode",
")",
"indicating",
"which",
"mode",
"was",
"desired",
"and",
... | def sendToInterface(self,interface: RobotInterfaceBase, indices = None) -> Tuple[str,str]:
"""Sends a command to the interface using the highest level interface
as possible.
Returns:
tuple: (desiredControlMode,baseControlMode) indicating which mode was
desired a... | [
"def",
"sendToInterface",
"(",
"self",
",",
"interface",
":",
"RobotInterfaceBase",
",",
"indices",
"=",
"None",
")",
"->",
"Tuple",
"[",
"str",
",",
"str",
"]",
":",
"desiredControlMode",
"=",
"self",
".",
"desiredControlMode",
"(",
"indices",
")",
"baseCon... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterfaceutils.py#L4298-L4402 | |
peteanderson80/Matterport3DSimulator | 589d091b111333f9e9f9d6cfd021b2eb68435925 | tasks/R2R/model.py | python | AttnDecoderLSTM.forward | (self, action, feature, h_0, c_0, ctx, ctx_mask=None) | return h_1,c_1,alpha,logit | Takes a single step in the decoder LSTM (allowing sampling).
action: batch x 1
feature: batch x feature_size
h_0: batch x hidden_size
c_0: batch x hidden_size
ctx: batch x seq_len x dim
ctx_mask: batch x seq_len - indices to be masked | Takes a single step in the decoder LSTM (allowing sampling). | [
"Takes",
"a",
"single",
"step",
"in",
"the",
"decoder",
"LSTM",
"(",
"allowing",
"sampling",
")",
"."
] | def forward(self, action, feature, h_0, c_0, ctx, ctx_mask=None):
''' Takes a single step in the decoder LSTM (allowing sampling).
action: batch x 1
feature: batch x feature_size
h_0: batch x hidden_size
c_0: batch x hidden_size
ctx: batch x seq_len x dim
ctx_mas... | [
"def",
"forward",
"(",
"self",
",",
"action",
",",
"feature",
",",
"h_0",
",",
"c_0",
",",
"ctx",
",",
"ctx_mask",
"=",
"None",
")",
":",
"action_embeds",
"=",
"self",
".",
"embedding",
"(",
"action",
")",
"# (batch, 1, embedding_size)",
"action_embeds",
"... | https://github.com/peteanderson80/Matterport3DSimulator/blob/589d091b111333f9e9f9d6cfd021b2eb68435925/tasks/R2R/model.py#L122-L140 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/poolmanager.py | python | PoolManager._merge_pool_kwargs | (self, override) | return base_pool_kwargs | Merge a dictionary of override values for self.connection_pool_kw.
This does not modify self.connection_pool_kw and returns a new dict.
Any keys in the override dictionary with a value of ``None`` are
removed from the merged dictionary. | Merge a dictionary of override values for self.connection_pool_kw. | [
"Merge",
"a",
"dictionary",
"of",
"override",
"values",
"for",
"self",
".",
"connection_pool_kw",
"."
] | def _merge_pool_kwargs(self, override):
"""
Merge a dictionary of override values for self.connection_pool_kw.
This does not modify self.connection_pool_kw and returns a new dict.
Any keys in the override dictionary with a value of ``None`` are
removed from the merged dictionary... | [
"def",
"_merge_pool_kwargs",
"(",
"self",
",",
"override",
")",
":",
"base_pool_kwargs",
"=",
"self",
".",
"connection_pool_kw",
".",
"copy",
"(",
")",
"if",
"override",
":",
"for",
"key",
",",
"value",
"in",
"override",
".",
"items",
"(",
")",
":",
"if"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/poolmanager.py#L289-L307 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/mwld.py | python | generate | (env) | Add Builders and construction variables for lib to an Environment. | Add Builders and construction variables for lib to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"lib",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for lib to an Environment."""
SCons.Tool.createStaticLibBuilder(env)
SCons.Tool.createSharedLibBuilder(env)
SCons.Tool.createProgBuilder(env)
env['AR'] = 'mwld'
env['ARCOM'] = '$AR $ARFLAGS -library -o $TARGET $SOURCES'
env['LIB... | [
"def",
"generate",
"(",
"env",
")",
":",
"SCons",
".",
"Tool",
".",
"createStaticLibBuilder",
"(",
"env",
")",
"SCons",
".",
"Tool",
".",
"createSharedLibBuilder",
"(",
"env",
")",
"SCons",
".",
"Tool",
".",
"createProgBuilder",
"(",
"env",
")",
"env",
"... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/mwld.py#L38-L59 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py | python | ADOPT_module_key_flags | (module, flag_values=FLAGS) | Declares that all flags key to a module are key to the current module.
Args:
module: A module object.
flag_values: A FlagValues object. This should almost never need
to be overridden.
Raises:
FlagsError: When given an argument that is a module name (a
string), instead of a module object. | Declares that all flags key to a module are key to the current module. | [
"Declares",
"that",
"all",
"flags",
"key",
"to",
"a",
"module",
"are",
"key",
"to",
"the",
"current",
"module",
"."
] | def ADOPT_module_key_flags(module, flag_values=FLAGS):
"""Declares that all flags key to a module are key to the current module.
Args:
module: A module object.
flag_values: A FlagValues object. This should almost never need
to be overridden.
Raises:
FlagsError: When given an argument that is ... | [
"def",
"ADOPT_module_key_flags",
"(",
"module",
",",
"flag_values",
"=",
"FLAGS",
")",
":",
"# NOTE(salcianu): an even better test would be if not",
"# isinstance(module, types.ModuleType) but I didn't want to import",
"# types for such a tiny use.",
"if",
"isinstance",
"(",
"module"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L2270-L2301 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/srv/_UpdateGeographicMap.py | python | UpdateGeographicMapResponse.serialize | (self, buff) | serialize message into buffer
:param buff: buffer, ``StringIO`` | serialize message into buffer
:param buff: buffer, ``StringIO`` | [
"serialize",
"message",
"into",
"buffer",
":",
"param",
"buff",
":",
"buffer",
"StringIO"
] | def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
buff.write(_struct_B.pack(self.success))
_x = self.status
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
... | [
"def",
"serialize",
"(",
"self",
",",
"buff",
")",
":",
"try",
":",
"buff",
".",
"write",
"(",
"_struct_B",
".",
"pack",
"(",
"self",
".",
"success",
")",
")",
"_x",
"=",
"self",
".",
"status",
"length",
"=",
"len",
"(",
"_x",
")",
"if",
"python3... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/srv/_UpdateGeographicMap.py#L852-L869 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSUtil.py | python | _DeepCopySomeKeys | (in_dict, keys) | return d | Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|.
Arguments:
in_dict: The dictionary to copy.
keys: The keys to be copied. If a key is in this list and doesn't exist in
|in_dict| this is not an error.
Returns:
The partially deep-copied dictionary. | Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|. | [
"Performs",
"a",
"partial",
"deep",
"-",
"copy",
"on",
"|in_dict|",
"only",
"copying",
"the",
"keys",
"in",
"|keys|",
"."
] | def _DeepCopySomeKeys(in_dict, keys):
"""Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|.
Arguments:
in_dict: The dictionary to copy.
keys: The keys to be copied. If a key is in this list and doesn't exist in
|in_dict| this is not an error.
Returns:
The partially de... | [
"def",
"_DeepCopySomeKeys",
"(",
"in_dict",
",",
"keys",
")",
":",
"d",
"=",
"{",
"}",
"for",
"key",
"in",
"keys",
":",
"if",
"key",
"not",
"in",
"in_dict",
":",
"continue",
"d",
"[",
"key",
"]",
"=",
"copy",
".",
"deepcopy",
"(",
"in_dict",
"[",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSUtil.py#L30-L45 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/memmgr/builder.py | python | MemorySegmentBuilder.__handle_validate | (self, args) | Handle 'validate' command.
Command arguments are the same 'load' except the last one:
'action': callable without any parameter itself, encapsulating
any segment-specific validation logic. It returns
a result of the validation.
This method simply calls the p... | Handle 'validate' command. | [
"Handle",
"validate",
"command",
"."
] | def __handle_validate(self, args):
"""Handle 'validate' command.
Command arguments are the same 'load' except the last one:
'action': callable without any parameter itself, encapsulating
any segment-specific validation logic. It returns
a result of the valid... | [
"def",
"__handle_validate",
"(",
"self",
",",
"args",
")",
":",
"_",
",",
"dsrc_info",
",",
"rrclass",
",",
"dsrc_name",
",",
"action",
"=",
"args",
"logger",
".",
"debug",
"(",
"logger",
".",
"DBGLVL_TRACE_BASIC",
",",
"LIBMEMMGR_BUILDER_SEGMENT_VALIDATE",
",... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/memmgr/builder.py#L93-L117 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntIntVV.GetSubValV | (self, *args) | return _snap.TIntIntVV_GetSubValV(self, *args) | GetSubValV(TIntIntVV self, int const & BValN, int const & EValN, TIntIntVV ValV)
Parameters:
BValN: int const &
EValN: int const &
ValV: TVec< TVec< TInt,int >,int > & | GetSubValV(TIntIntVV self, int const & BValN, int const & EValN, TIntIntVV ValV) | [
"GetSubValV",
"(",
"TIntIntVV",
"self",
"int",
"const",
"&",
"BValN",
"int",
"const",
"&",
"EValN",
"TIntIntVV",
"ValV",
")"
] | def GetSubValV(self, *args):
"""
GetSubValV(TIntIntVV self, int const & BValN, int const & EValN, TIntIntVV ValV)
Parameters:
BValN: int const &
EValN: int const &
ValV: TVec< TVec< TInt,int >,int > &
"""
return _snap.TIntIntVV_GetSubValV(sel... | [
"def",
"GetSubValV",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TIntIntVV_GetSubValV",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L16933-L16943 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Wrapping/Generators/Python/itk/support/extras.py | python | dict_from_image | (image: "itkt.Image") | return dict(
imageType=imageType,
origin=tuple(image.GetOrigin()),
spacing=tuple(image.GetSpacing()),
size=tuple(image.GetBufferedRegion().GetSize()),
direction=np.asarray(image.GetDirection()),
data=pixel_arr,
) | Serialize a Python itk.Image object to a pickable Python dictionary. | Serialize a Python itk.Image object to a pickable Python dictionary. | [
"Serialize",
"a",
"Python",
"itk",
".",
"Image",
"object",
"to",
"a",
"pickable",
"Python",
"dictionary",
"."
] | def dict_from_image(image: "itkt.Image") -> Dict:
"""Serialize a Python itk.Image object to a pickable Python dictionary."""
import itk
pixel_arr = itk.array_view_from_image(image)
imageType = wasm_type_from_image_type(image)
return dict(
imageType=imageType,
origin=tuple(image.GetO... | [
"def",
"dict_from_image",
"(",
"image",
":",
"\"itkt.Image\"",
")",
"->",
"Dict",
":",
"import",
"itk",
"pixel_arr",
"=",
"itk",
".",
"array_view_from_image",
"(",
"image",
")",
"imageType",
"=",
"wasm_type_from_image_type",
"(",
"image",
")",
"return",
"dict",
... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Wrapping/Generators/Python/itk/support/extras.py#L816-L829 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/framework/common_shapes.py | python | bias_add_grad_shape | (op) | return [output_shape] | Shape function for a BiasAddGrad op. | Shape function for a BiasAddGrad op. | [
"Shape",
"function",
"for",
"a",
"BiasAddGrad",
"op",
"."
] | def bias_add_grad_shape(op):
"""Shape function for a BiasAddGrad op."""
input_shape = op.inputs[0].get_shape().with_rank_at_least(2)
try:
data_format = op.get_attr("data_format")
except ValueError:
data_format = None
if data_format == b"NCHW":
output_shape = input_shape[-3]
else:
output_sha... | [
"def",
"bias_add_grad_shape",
"(",
"op",
")",
":",
"input_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"with_rank_at_least",
"(",
"2",
")",
"try",
":",
"data_format",
"=",
"op",
".",
"get_attr",
"(",
"\"data_format\""... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/common_shapes.py#L121-L134 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetArch | (self, config) | return {'Win32': 'x86', 'x64': 'x64'}.get(platform, 'x86') | Get architecture based on msvs_configuration_platform and
msvs_target_platform. Returns either 'x86' or 'x64'. | Get architecture based on msvs_configuration_platform and
msvs_target_platform. Returns either 'x86' or 'x64'. | [
"Get",
"architecture",
"based",
"on",
"msvs_configuration_platform",
"and",
"msvs_target_platform",
".",
"Returns",
"either",
"x86",
"or",
"x64",
"."
] | def GetArch(self, config):
"""Get architecture based on msvs_configuration_platform and
msvs_target_platform. Returns either 'x86' or 'x64'."""
configuration_platform = self.msvs_configuration_platform.get(config, '')
platform = self.msvs_target_platform.get(config, '')
if not platform: # If no spec... | [
"def",
"GetArch",
"(",
"self",
",",
"config",
")",
":",
"configuration_platform",
"=",
"self",
".",
"msvs_configuration_platform",
".",
"get",
"(",
"config",
",",
"''",
")",
"platform",
"=",
"self",
".",
"msvs_target_platform",
".",
"get",
"(",
"config",
","... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/msvs_emulation.py#L299-L307 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/frame.py | python | Frame.exp | (self) | return self._unaryop("exp") | Get the exponential of all elements, element-wise.
Exponential is the inverse of the log function,
so that x.exp().log() = x
Returns
-------
DataFrame/Series/Index
Result of the element-wise exponential.
Examples
--------
>>> import cudf
... | Get the exponential of all elements, element-wise. | [
"Get",
"the",
"exponential",
"of",
"all",
"elements",
"element",
"-",
"wise",
"."
] | def exp(self):
"""
Get the exponential of all elements, element-wise.
Exponential is the inverse of the log function,
so that x.exp().log() = x
Returns
-------
DataFrame/Series/Index
Result of the element-wise exponential.
Examples
-... | [
"def",
"exp",
"(",
"self",
")",
":",
"return",
"self",
".",
"_unaryop",
"(",
"\"exp\"",
")"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/frame.py#L3008-L3068 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/math_grad.py | python | _SignGrad | (op, _) | return array_ops.zeros(array_ops.shape(x), dtype=x.dtype) | Returns 0. | Returns 0. | [
"Returns",
"0",
"."
] | def _SignGrad(op, _):
"""Returns 0."""
x = op.inputs[0]
return array_ops.zeros(array_ops.shape(x), dtype=x.dtype) | [
"def",
"_SignGrad",
"(",
"op",
",",
"_",
")",
":",
"x",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"return",
"array_ops",
".",
"zeros",
"(",
"array_ops",
".",
"shape",
"(",
"x",
")",
",",
"dtype",
"=",
"x",
".",
"dtype",
")"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/math_grad.py#L415-L418 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xml/sax/handler.py | python | ContentHandler.processingInstruction | (self, target, data) | Receive notification of a processing instruction.
The Parser will invoke this method once for each processing
instruction found: note that processing instructions may occur
before or after the main document element.
A SAX parser should never report an XML declaration (XML 1.0,
... | Receive notification of a processing instruction. | [
"Receive",
"notification",
"of",
"a",
"processing",
"instruction",
"."
] | def processingInstruction(self, target, data):
"""Receive notification of a processing instruction.
The Parser will invoke this method once for each processing
instruction found: note that processing instructions may occur
before or after the main document element.
A SAX parser... | [
"def",
"processingInstruction",
"(",
"self",
",",
"target",
",",
"data",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/handler.py#L182-L191 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/lib2to3/fixer_util.py | python | Comma | () | return Leaf(token.COMMA, u",") | A comma leaf | A comma leaf | [
"A",
"comma",
"leaf"
] | def Comma():
"""A comma leaf"""
return Leaf(token.COMMA, u",") | [
"def",
"Comma",
"(",
")",
":",
"return",
"Leaf",
"(",
"token",
".",
"COMMA",
",",
"u\",\"",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/lib2to3/fixer_util.py#L44-L46 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/variables.py | python | _all_saveable_objects | (scope=None) | return (ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES, scope) +
ops.get_collection(ops.GraphKeys.SAVEABLE_OBJECTS, scope)) | Returns all variables and `SaveableObject`s that must be checkpointed.
Args:
scope: (Optional.) A string. If supplied, the resulting list is filtered
to include only items whose `name` attribute matches `scope` using
`re.match`. Items without a `name` attribute are never returned if a
scope is ... | Returns all variables and `SaveableObject`s that must be checkpointed. | [
"Returns",
"all",
"variables",
"and",
"SaveableObject",
"s",
"that",
"must",
"be",
"checkpointed",
"."
] | def _all_saveable_objects(scope=None):
"""Returns all variables and `SaveableObject`s that must be checkpointed.
Args:
scope: (Optional.) A string. If supplied, the resulting list is filtered
to include only items whose `name` attribute matches `scope` using
`re.match`. Items without a `name` attri... | [
"def",
"_all_saveable_objects",
"(",
"scope",
"=",
"None",
")",
":",
"# TODO(andreasst): make this function public once things are settled.",
"return",
"(",
"ops",
".",
"get_collection",
"(",
"ops",
".",
"GraphKeys",
".",
"GLOBAL_VARIABLES",
",",
"scope",
")",
"+",
"o... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/variables.py#L1261-L1276 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/utils/prng.py | python | Random.get_state | (self) | return self.rng.get_state() | Interface to the standard get_state() function. | Interface to the standard get_state() function. | [
"Interface",
"to",
"the",
"standard",
"get_state",
"()",
"function",
"."
] | def get_state(self):
"""Interface to the standard get_state() function."""
return self.rng.get_state() | [
"def",
"get_state",
"(",
"self",
")",
":",
"return",
"self",
".",
"rng",
".",
"get_state",
"(",
")"
] | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/utils/prng.py#L68-L71 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | buildRelativeURI | (URI, base) | return ret | Expresses the URI of the reference in terms relative to the
base. Some examples of this operation include: base =
"http://site1.com/docs/book1.html" URI input
URI returned docs/pic1.gif pic1.gif
docs/img/pic1.gif img/pic1.gif img/pic1.gif
... | Expresses the URI of the reference in terms relative to the
base. Some examples of this operation include: base =
"http://site1.com/docs/book1.html" URI input
URI returned docs/pic1.gif pic1.gif
docs/img/pic1.gif img/pic1.gif img/pic1.gif
... | [
"Expresses",
"the",
"URI",
"of",
"the",
"reference",
"in",
"terms",
"relative",
"to",
"the",
"base",
".",
"Some",
"examples",
"of",
"this",
"operation",
"include",
":",
"base",
"=",
"http",
":",
"//",
"site1",
".",
"com",
"/",
"docs",
"/",
"book1",
"."... | def buildRelativeURI(URI, base):
"""Expresses the URI of the reference in terms relative to the
base. Some examples of this operation include: base =
"http://site1.com/docs/book1.html" URI input
URI returned docs/pic1.gif pic1.gif
docs/img/pic1.gif ... | [
"def",
"buildRelativeURI",
"(",
"URI",
",",
"base",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlBuildRelativeURI",
"(",
"URI",
",",
"base",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L1705-L1725 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/multi.py | python | MultiIndex._getitem_slice | (self: MultiIndex, slobj: slice) | return type(self)(
levels=self.levels,
codes=new_codes,
names=self._names,
sortorder=sortorder,
verify_integrity=False,
) | Fastpath for __getitem__ when we know we have a slice. | Fastpath for __getitem__ when we know we have a slice. | [
"Fastpath",
"for",
"__getitem__",
"when",
"we",
"know",
"we",
"have",
"a",
"slice",
"."
] | def _getitem_slice(self: MultiIndex, slobj: slice) -> MultiIndex:
"""
Fastpath for __getitem__ when we know we have a slice.
"""
sortorder = None
if slobj.step is None or slobj.step > 0:
sortorder = self.sortorder
new_codes = [level_codes[slobj] for level_cod... | [
"def",
"_getitem_slice",
"(",
"self",
":",
"MultiIndex",
",",
"slobj",
":",
"slice",
")",
"->",
"MultiIndex",
":",
"sortorder",
"=",
"None",
"if",
"slobj",
".",
"step",
"is",
"None",
"or",
"slobj",
".",
"step",
">",
"0",
":",
"sortorder",
"=",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/multi.py#L2070-L2086 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/tensor_shape.py | python | as_dimension | (value) | Converts the given value to a Dimension.
A Dimension input will be returned unmodified.
An input of `None` will be converted to an unknown Dimension.
An integer input will be converted to a Dimension with that value.
Args:
value: The value to be converted.
Returns:
A Dimension corresponding to the ... | Converts the given value to a Dimension. | [
"Converts",
"the",
"given",
"value",
"to",
"a",
"Dimension",
"."
] | def as_dimension(value):
"""Converts the given value to a Dimension.
A Dimension input will be returned unmodified.
An input of `None` will be converted to an unknown Dimension.
An integer input will be converted to a Dimension with that value.
Args:
value: The value to be converted.
Returns:
A D... | [
"def",
"as_dimension",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"Dimension",
")",
":",
"return",
"value",
"else",
":",
"return",
"Dimension",
"(",
"value",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/tensor_shape.py#L381-L397 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/directives/__init__.py | python | positive_int_list | (argument) | return [positive_int(entry) for entry in entries] | Converts a space- or comma-separated list of values into a Python list
of integers.
(Directive option conversion function.)
Raises ValueError for non-positive-integer values. | Converts a space- or comma-separated list of values into a Python list
of integers.
(Directive option conversion function.) | [
"Converts",
"a",
"space",
"-",
"or",
"comma",
"-",
"separated",
"list",
"of",
"values",
"into",
"a",
"Python",
"list",
"of",
"integers",
".",
"(",
"Directive",
"option",
"conversion",
"function",
".",
")"
] | def positive_int_list(argument):
"""
Converts a space- or comma-separated list of values into a Python list
of integers.
(Directive option conversion function.)
Raises ValueError for non-positive-integer values.
"""
if ',' in argument:
entries = argument.split(',')
else:
... | [
"def",
"positive_int_list",
"(",
"argument",
")",
":",
"if",
"','",
"in",
"argument",
":",
"entries",
"=",
"argument",
".",
"split",
"(",
"','",
")",
"else",
":",
"entries",
"=",
"argument",
".",
"split",
"(",
")",
"return",
"[",
"positive_int",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/directives/__init__.py#L351-L363 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32comext/authorization/demos/EditSecurity.py | python | SecurityInformation.GetInheritTypes | (self) | return ((IID_NULL, 0, 'Only current object'),
(IID_NULL, OBJECT_INHERIT_ACE, 'Files inherit permissions'),
(IID_NULL, CONTAINER_INHERIT_ACE, 'Sub Folders inherit permissions'),
(IID_NULL, CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE, 'Files and subfolders'),
... | Specifies which types of ACE inheritance are supported.
Returns a sequence of tuples representing SI_INHERIT_TYPE structs, containing
(object type guid, inheritance flags, display name). Guid is usually only used with
Directory Service objects. | Specifies which types of ACE inheritance are supported.
Returns a sequence of tuples representing SI_INHERIT_TYPE structs, containing
(object type guid, inheritance flags, display name). Guid is usually only used with
Directory Service objects. | [
"Specifies",
"which",
"types",
"of",
"ACE",
"inheritance",
"are",
"supported",
".",
"Returns",
"a",
"sequence",
"of",
"tuples",
"representing",
"SI_INHERIT_TYPE",
"structs",
"containing",
"(",
"object",
"type",
"guid",
"inheritance",
"flags",
"display",
"name",
")... | def GetInheritTypes(self):
"""Specifies which types of ACE inheritance are supported.
Returns a sequence of tuples representing SI_INHERIT_TYPE structs, containing
(object type guid, inheritance flags, display name). Guid is usually only used with
Directory Service objects.
"""
... | [
"def",
"GetInheritTypes",
"(",
"self",
")",
":",
"return",
"(",
"(",
"IID_NULL",
",",
"0",
",",
"'Only current object'",
")",
",",
"(",
"IID_NULL",
",",
"OBJECT_INHERIT_ACE",
",",
"'Files inherit permissions'",
")",
",",
"(",
"IID_NULL",
",",
"CONTAINER_INHERIT_... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32comext/authorization/demos/EditSecurity.py#L105-L115 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/diskprediction_local/predictor.py | python | PSDiskFailurePredictor.__get_best_models | (self, attr_list: AttrNamesT) | return best_models | Find the best model from model list according to given attribute list.
Args:
attr_list: All S.M.A.R.T. attributes used in given disk.
Returns:
modelpath: The best model for the given attribute list.
model_attrlist: 'Ordered' attribute list of the returned model.
... | Find the best model from model list according to given attribute list. | [
"Find",
"the",
"best",
"model",
"from",
"model",
"list",
"according",
"to",
"given",
"attribute",
"list",
"."
] | def __get_best_models(self, attr_list: AttrNamesT) -> Optional[Dict[str, List[str]]]:
"""
Find the best model from model list according to given attribute list.
Args:
attr_list: All S.M.A.R.T. attributes used in given disk.
Returns:
modelpath: The best model for... | [
"def",
"__get_best_models",
"(",
"self",
",",
"attr_list",
":",
"AttrNamesT",
")",
"->",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"List",
"[",
"str",
"]",
"]",
"]",
":",
"models",
"=",
"self",
".",
"model_context",
".",
"keys",
"(",
")",
"scores",
"... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/diskprediction_local/predictor.py#L360-L399 | |
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/boost/tools/build/src/build/property_set.py | python | PropertySet.target_path | (self) | return self.target_path_ | Computes the target path that should be used for
target with these properties.
Returns a tuple of
- the computed path
- if the path is relative to build directory, a value of
'true'. | Computes the target path that should be used for
target with these properties.
Returns a tuple of
- the computed path
- if the path is relative to build directory, a value of
'true'. | [
"Computes",
"the",
"target",
"path",
"that",
"should",
"be",
"used",
"for",
"target",
"with",
"these",
"properties",
".",
"Returns",
"a",
"tuple",
"of",
"-",
"the",
"computed",
"path",
"-",
"if",
"the",
"path",
"is",
"relative",
"to",
"build",
"directory",... | def target_path (self):
""" Computes the target path that should be used for
target with these properties.
Returns a tuple of
- the computed path
- if the path is relative to build directory, a value of
'true'.
"""
if not self.t... | [
"def",
"target_path",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"target_path_",
":",
"# The <location> feature can be used to explicitly",
"# change the location of generated targets",
"l",
"=",
"self",
".",
"get",
"(",
"'<location>'",
")",
"if",
"l",
":",
"c... | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/property_set.py#L395-L439 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathCircularHoleBase.py | python | ObjectOp.opExecute | (self, obj) | opExecute(obj) ... processes all Base features and Locations and collects
them in a list of positions and radii which is then passed to circularHoleExecute(obj, holes).
If no Base geometries and no Locations are present, the job's Base is inspected and all
drillable features are added to Base. I... | opExecute(obj) ... processes all Base features and Locations and collects
them in a list of positions and radii which is then passed to circularHoleExecute(obj, holes).
If no Base geometries and no Locations are present, the job's Base is inspected and all
drillable features are added to Base. I... | [
"opExecute",
"(",
"obj",
")",
"...",
"processes",
"all",
"Base",
"features",
"and",
"Locations",
"and",
"collects",
"them",
"in",
"a",
"list",
"of",
"positions",
"and",
"radii",
"which",
"is",
"then",
"passed",
"to",
"circularHoleExecute",
"(",
"obj",
"holes... | def opExecute(self, obj):
"""opExecute(obj) ... processes all Base features and Locations and collects
them in a list of positions and radii which is then passed to circularHoleExecute(obj, holes).
If no Base geometries and no Locations are present, the job's Base is inspected and all
dr... | [
"def",
"opExecute",
"(",
"self",
",",
"obj",
")",
":",
"PathLog",
".",
"track",
"(",
")",
"def",
"haveLocations",
"(",
"self",
",",
"obj",
")",
":",
"if",
"PathOp",
".",
"FeatureLocations",
"&",
"self",
".",
"opFeatures",
"(",
"obj",
")",
":",
"retur... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathCircularHoleBase.py#L160-L194 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | SingleChoiceDialog.GetStringSelection | (*args, **kwargs) | return _windows_.SingleChoiceDialog_GetStringSelection(*args, **kwargs) | GetStringSelection(self) -> String
Returns the string value of the currently selected item | GetStringSelection(self) -> String | [
"GetStringSelection",
"(",
"self",
")",
"-",
">",
"String"
] | def GetStringSelection(*args, **kwargs):
"""
GetStringSelection(self) -> String
Returns the string value of the currently selected item
"""
return _windows_.SingleChoiceDialog_GetStringSelection(*args, **kwargs) | [
"def",
"GetStringSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"SingleChoiceDialog_GetStringSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L3348-L3354 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transforms/hashes.py | python | HashFast.__init__ | (self, num_buckets) | Initialize `CSVParser`.
Args:
num_buckets: The number of hash buckets to use. | Initialize `CSVParser`. | [
"Initialize",
"CSVParser",
"."
] | def __init__(self, num_buckets):
"""Initialize `CSVParser`.
Args:
num_buckets: The number of hash buckets to use.
"""
# TODO(soergel): allow seed?
super(HashFast, self).__init__()
self._num_buckets = num_buckets | [
"def",
"__init__",
"(",
"self",
",",
"num_buckets",
")",
":",
"# TODO(soergel): allow seed?",
"super",
"(",
"HashFast",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_num_buckets",
"=",
"num_buckets"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transforms/hashes.py#L29-L37 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.WriteRules | (self, rules, extra_sources, extra_outputs,
extra_mac_bundle_resources, part_of_all) | Write Makefile code for any 'rules' from the gyp input.
extra_sources: a list that will be filled in with newly generated source
files, if any
extra_outputs: a list that will be filled in with any outputs of these
rules (used to make other pieces dependent on these rules)
... | Write Makefile code for any 'rules' from the gyp input. | [
"Write",
"Makefile",
"code",
"for",
"any",
"rules",
"from",
"the",
"gyp",
"input",
"."
] | def WriteRules(self, rules, extra_sources, extra_outputs,
extra_mac_bundle_resources, part_of_all):
"""Write Makefile code for any 'rules' from the gyp input.
extra_sources: a list that will be filled in with newly generated source
files, if any
extra_outputs: a list tha... | [
"def",
"WriteRules",
"(",
"self",
",",
"rules",
",",
"extra_sources",
",",
"extra_outputs",
",",
"extra_mac_bundle_resources",
",",
"part_of_all",
")",
":",
"env",
"=",
"self",
".",
"GetSortedXcodeEnv",
"(",
")",
"for",
"rule",
"in",
"rules",
":",
"name",
"=... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/make.py#L989-L1114 | ||
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/field.py | python | Field.set_grad | (self, grad) | Sets corresponding gradient field.
Args:
grad (Field): Corresponding gradient field. | Sets corresponding gradient field. | [
"Sets",
"corresponding",
"gradient",
"field",
"."
] | def set_grad(self, grad):
"""Sets corresponding gradient field.
Args:
grad (Field): Corresponding gradient field.
"""
self.grad = grad | [
"def",
"set_grad",
"(",
"self",
",",
"grad",
")",
":",
"self",
".",
"grad",
"=",
"grad"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/field.py#L85-L91 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py | python | Context.load_verify_locations | (self, cafile, capath=None) | Let SSL know where we can find trusted certificates for the certificate
chain. Note that the certificates have to be in PEM format.
If capath is passed, it must be a directory prepared using the
``c_rehash`` tool included with OpenSSL. Either, but not both, of
*pemfile* or *capath* ma... | Let SSL know where we can find trusted certificates for the certificate
chain. Note that the certificates have to be in PEM format. | [
"Let",
"SSL",
"know",
"where",
"we",
"can",
"find",
"trusted",
"certificates",
"for",
"the",
"certificate",
"chain",
".",
"Note",
"that",
"the",
"certificates",
"have",
"to",
"be",
"in",
"PEM",
"format",
"."
] | def load_verify_locations(self, cafile, capath=None):
"""
Let SSL know where we can find trusted certificates for the certificate
chain. Note that the certificates have to be in PEM format.
If capath is passed, it must be a directory prepared using the
``c_rehash`` tool include... | [
"def",
"load_verify_locations",
"(",
"self",
",",
"cafile",
",",
"capath",
"=",
"None",
")",
":",
"if",
"cafile",
"is",
"None",
":",
"cafile",
"=",
"_ffi",
".",
"NULL",
"else",
":",
"cafile",
"=",
"_path_string",
"(",
"cafile",
")",
"if",
"capath",
"is... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py#L762-L792 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/shape.py | python | _DistributionShape._assert_non_negative_int32_scalar | (self, x) | return x | Helper which ensures that input is a non-negative, int32, scalar. | Helper which ensures that input is a non-negative, int32, scalar. | [
"Helper",
"which",
"ensures",
"that",
"input",
"is",
"a",
"non",
"-",
"negative",
"int32",
"scalar",
"."
] | def _assert_non_negative_int32_scalar(self, x):
"""Helper which ensures that input is a non-negative, int32, scalar."""
x = ops.convert_to_tensor(x, name="x")
if x.dtype.base_dtype != dtypes.int32.base_dtype:
raise TypeError("%s.dtype=%s is not %s" % (x.name, x.dtype, dtypes.int32))
x_value_static... | [
"def",
"_assert_non_negative_int32_scalar",
"(",
"self",
",",
"x",
")",
":",
"x",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"x",
",",
"name",
"=",
"\"x\"",
")",
"if",
"x",
".",
"dtype",
".",
"base_dtype",
"!=",
"dtypes",
".",
"int32",
".",
"base_dtype",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/shape.py#L481-L499 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | Grid.ForceRefresh | (*args, **kwargs) | return _grid.Grid_ForceRefresh(*args, **kwargs) | ForceRefresh(self) | ForceRefresh(self) | [
"ForceRefresh",
"(",
"self",
")"
] | def ForceRefresh(*args, **kwargs):
"""ForceRefresh(self)"""
return _grid.Grid_ForceRefresh(*args, **kwargs) | [
"def",
"ForceRefresh",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_ForceRefresh",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1334-L1336 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Util.py | python | AddMethod | (obj, function, name=None) | Adds either a bound method to an instance or an unbound method to
a class. If name is ommited the name of the specified function
is used by default.
Example:
a = A()
def f(self, x, y):
self.z = x + y
AddMethod(f, A, "add")
a.add(2, 4)
print a.z
AddMethod(lambda se... | Adds either a bound method to an instance or an unbound method to
a class. If name is ommited the name of the specified function
is used by default.
Example:
a = A()
def f(self, x, y):
self.z = x + y
AddMethod(f, A, "add")
a.add(2, 4)
print a.z
AddMethod(lambda se... | [
"Adds",
"either",
"a",
"bound",
"method",
"to",
"an",
"instance",
"or",
"an",
"unbound",
"method",
"to",
"a",
"class",
".",
"If",
"name",
"is",
"ommited",
"the",
"name",
"of",
"the",
"specified",
"function",
"is",
"used",
"by",
"default",
".",
"Example",... | def AddMethod(obj, function, name=None):
"""
Adds either a bound method to an instance or an unbound method to
a class. If name is ommited the name of the specified function
is used by default.
Example:
a = A()
def f(self, x, y):
self.z = x + y
AddMethod(f, A, "add")
... | [
"def",
"AddMethod",
"(",
"obj",
",",
"function",
",",
"name",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"function",
".",
"func_name",
"else",
":",
"function",
"=",
"RenameFunction",
"(",
"function",
",",
"name",
")",
"if",
... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Util.py#L1378-L1403 | ||
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | tools/clang/bindings/python/clang/cindex.py | python | Diagnostic.disable_option | (self) | return _CXString.from_result(disable) | The command-line option that disables this diagnostic. | The command-line option that disables this diagnostic. | [
"The",
"command",
"-",
"line",
"option",
"that",
"disables",
"this",
"diagnostic",
"."
] | def disable_option(self):
"""The command-line option that disables this diagnostic."""
disable = _CXString()
conf.lib.clang_getDiagnosticOption(self, byref(disable))
return _CXString.from_result(disable) | [
"def",
"disable_option",
"(",
"self",
")",
":",
"disable",
"=",
"_CXString",
"(",
")",
"conf",
".",
"lib",
".",
"clang_getDiagnosticOption",
"(",
"self",
",",
"byref",
"(",
"disable",
")",
")",
"return",
"_CXString",
".",
"from_result",
"(",
"disable",
")"... | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/bindings/python/clang/cindex.py#L461-L465 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/tracking/util.py | python | _NameBasedRestoreCoordinator.globally_named_object_attributes | (self, trackable) | Create globally named SaveableObjects from attributes.
If an object's attribute has no global name specified (default construction
for the SaveableObject factory), records the failure in
`self.unused_attributes` (which can then be used to make status assertions
fail; see `NameBasedSaverStatus`).
A... | Create globally named SaveableObjects from attributes. | [
"Create",
"globally",
"named",
"SaveableObjects",
"from",
"attributes",
"."
] | def globally_named_object_attributes(self, trackable):
"""Create globally named SaveableObjects from attributes.
If an object's attribute has no global name specified (default construction
for the SaveableObject factory), records the failure in
`self.unused_attributes` (which can then be used to make s... | [
"def",
"globally_named_object_attributes",
"(",
"self",
",",
"trackable",
")",
":",
"for",
"attribute_name",
",",
"saveable_factory",
"in",
"(",
"trackable",
".",
"_gather_saveables_for_checkpoint",
"(",
")",
".",
"items",
"(",
")",
")",
":",
"# pylint: disable=prot... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/tracking/util.py#L378-L412 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | GetMaxLayer | (docks, dock_direction) | return max_layer | This is an internal function which returns
the highest layer inside the specified dock.
:param `docks`: a list of :class:`AuiDockInfo`;
:param `dock_direction`: the :class:`AuiDockInfo` docking direction to analyze. | This is an internal function which returns
the highest layer inside the specified dock. | [
"This",
"is",
"an",
"internal",
"function",
"which",
"returns",
"the",
"highest",
"layer",
"inside",
"the",
"specified",
"dock",
"."
] | def GetMaxLayer(docks, dock_direction):
"""
This is an internal function which returns
the highest layer inside the specified dock.
:param `docks`: a list of :class:`AuiDockInfo`;
:param `dock_direction`: the :class:`AuiDockInfo` docking direction to analyze.
"""
max_layer = 0
for doc... | [
"def",
"GetMaxLayer",
"(",
"docks",
",",
"dock_direction",
")",
":",
"max_layer",
"=",
"0",
"for",
"dock",
"in",
"docks",
":",
"if",
"dock",
".",
"dock_direction",
"==",
"dock_direction",
"and",
"dock",
".",
"dock_layer",
">",
"max_layer",
"and",
"not",
"d... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L3555-L3570 | |
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/ros_carla_bridge/carla_ego_vehicle/src/carla_ego_vehicle/carla_ego_vehicle.py | python | CarlaEgoVehicle.run | (self) | main loop | main loop | [
"main",
"loop"
] | def run(self):
"""
main loop
"""
# wait for ros-bridge to set up CARLA world
rospy.loginfo("Waiting for CARLA world (topic: /carla/world_info)...")
try:
rospy.wait_for_message("/carla/world_info", CarlaWorldInfo, timeout=10.0)
except rospy.ROSException... | [
"def",
"run",
"(",
"self",
")",
":",
"# wait for ros-bridge to set up CARLA world",
"rospy",
".",
"loginfo",
"(",
"\"Waiting for CARLA world (topic: /carla/world_info)...\"",
")",
"try",
":",
"rospy",
".",
"wait_for_message",
"(",
"\"/carla/world_info\"",
",",
"CarlaWorldIn... | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ego_vehicle/src/carla_ego_vehicle/carla_ego_vehicle.py#L243-L263 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/platform/gfile.py | python | Glob | (glob) | return _glob.glob(glob) | Return a list of filenames matching the glob "glob". | Return a list of filenames matching the glob "glob". | [
"Return",
"a",
"list",
"of",
"filenames",
"matching",
"the",
"glob",
"glob",
"."
] | def Glob(glob): # pylint: disable=invalid-name
"""Return a list of filenames matching the glob "glob"."""
return _glob.glob(glob) | [
"def",
"Glob",
"(",
"glob",
")",
":",
"# pylint: disable=invalid-name",
"return",
"_glob",
".",
"glob",
"(",
"glob",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/platform/gfile.py#L260-L262 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/hotshot/__init__.py | python | Profile.runctx | (self, cmd, globals, locals) | return self | Evaluate an exec-compatible string in a specific
environment.
The string is compiled before profiling begins. | Evaluate an exec-compatible string in a specific
environment. | [
"Evaluate",
"an",
"exec",
"-",
"compatible",
"string",
"in",
"a",
"specific",
"environment",
"."
] | def runctx(self, cmd, globals, locals):
"""Evaluate an exec-compatible string in a specific
environment.
The string is compiled before profiling begins.
"""
code = compile(cmd, "<string>", "exec")
self._prof.runcode(code, globals, locals)
return self | [
"def",
"runctx",
"(",
"self",
",",
"cmd",
",",
"globals",
",",
"locals",
")",
":",
"code",
"=",
"compile",
"(",
"cmd",
",",
"\"<string>\"",
",",
"\"exec\"",
")",
"self",
".",
"_prof",
".",
"runcode",
"(",
"code",
",",
"globals",
",",
"locals",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/hotshot/__init__.py#L60-L68 | |
JavierIH/zowi | 830c1284154b8167c9131deb9c45189fd9e67b54 | code/python-client/Oscillator.py | python | Oscillator.set_A | (self, A) | Set the oscillator amplitude | Set the oscillator amplitude | [
"Set",
"the",
"oscillator",
"amplitude"
] | def set_A(self, A):
"""Set the oscillator amplitude"""
#-- Check that the amplitude in the range [0, 90]
if not (0 <= A <= 90):
raise IncorrectAngle()
return
#-- Build the frame
frame = self.dir + CMD_SET_A + str(A) + CMD_END
#-- Debug
print(frame)
#-- S... | [
"def",
"set_A",
"(",
"self",
",",
"A",
")",
":",
"#-- Check that the amplitude in the range [0, 90] ",
"if",
"not",
"(",
"0",
"<=",
"A",
"<=",
"90",
")",
":",
"raise",
"IncorrectAngle",
"(",
")",
"return",
"#-- Build the frame",
"frame",
"=",
"self",
".",
"d... | https://github.com/JavierIH/zowi/blob/830c1284154b8167c9131deb9c45189fd9e67b54/code/python-client/Oscillator.py#L67-L85 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/websocket-client/websocket.py | python | WebSocket.recv_data | (self) | Recieve data with operation code.
return value: tuple of operation code and string(byte array) value. | Recieve data with operation code. | [
"Recieve",
"data",
"with",
"operation",
"code",
"."
] | def recv_data(self):
"""
Recieve data with operation code.
return value: tuple of operation code and string(byte array) value.
"""
while True:
frame = self.recv_frame()
if not frame:
# handle error:
# 'NoneType' object has... | [
"def",
"recv_data",
"(",
"self",
")",
":",
"while",
"True",
":",
"frame",
"=",
"self",
".",
"recv_frame",
"(",
")",
"if",
"not",
"frame",
":",
"# handle error:",
"# 'NoneType' object has no attribute 'opcode'",
"raise",
"WebSocketException",
"(",
"\"Not a valid fram... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/websocket-client/websocket.py#L599-L627 | ||
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/gtk/GtkGLExtVTKRenderWindowInteractor.py | python | GtkGLExtVTKRenderWindowInteractor.OnEnter | (self, wid, event) | return gtk.TRUE | Entering the vtkRenderWindow. | Entering the vtkRenderWindow. | [
"Entering",
"the",
"vtkRenderWindow",
"."
] | def OnEnter(self, wid, event):
"""Entering the vtkRenderWindow."""
self.grab_focus()
m = self.get_pointer()
ctrl, shift = self._GetCtrlShift(event)
self._Iren.SetEventInformationFlipY(m[0], m[1], ctrl, shift,
chr(0), 0, None)
se... | [
"def",
"OnEnter",
"(",
"self",
",",
"wid",
",",
"event",
")",
":",
"self",
".",
"grab_focus",
"(",
")",
"m",
"=",
"self",
".",
"get_pointer",
"(",
")",
"ctrl",
",",
"shift",
"=",
"self",
".",
"_GetCtrlShift",
"(",
"event",
")",
"self",
".",
"_Iren"... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/gtk/GtkGLExtVTKRenderWindowInteractor.py#L199-L207 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/plotting/markers.py | python | SingleMarker.set_label_visible | (self, is_visible) | Allows for labels to be hidden/shown | Allows for labels to be hidden/shown | [
"Allows",
"for",
"labels",
"to",
"be",
"hidden",
"/",
"shown"
] | def set_label_visible(self, is_visible):
""" Allows for labels to be hidden/shown """
self.remove_all_annotations()
self.label_visible = is_visible
self.add_all_annotations() | [
"def",
"set_label_visible",
"(",
"self",
",",
"is_visible",
")",
":",
"self",
".",
"remove_all_annotations",
"(",
")",
"self",
".",
"label_visible",
"=",
"is_visible",
"self",
".",
"add_all_annotations",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/plotting/markers.py#L716-L720 | ||
su2code/SU2 | 72b2fa977b64b9683a388920f05298a40d39e5c5 | SU2_PY/SU2/eval/design.py | python | Design._eval | (self,eval_func,*args) | return vals | Evaluates an SU2 Design
always adds config and state to the inputs list | Evaluates an SU2 Design
always adds config and state to the inputs list | [
"Evaluates",
"an",
"SU2",
"Design",
"always",
"adds",
"config",
"and",
"state",
"to",
"the",
"inputs",
"list"
] | def _eval(self,eval_func,*args):
""" Evaluates an SU2 Design
always adds config and state to the inputs list
"""
config = self.config
state = self.state
files = self.files
folder = self.folder
filename = self.filename
# ch... | [
"def",
"_eval",
"(",
"self",
",",
"eval_func",
",",
"*",
"args",
")",
":",
"config",
"=",
"self",
".",
"config",
"state",
"=",
"self",
".",
"state",
"files",
"=",
"self",
".",
"files",
"folder",
"=",
"self",
".",
"folder",
"filename",
"=",
"self",
... | https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/eval/design.py#L110-L158 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/nn_impl.py | python | weighted_moments | (x, axes, frequency_weights, name=None, keep_dims=False) | Returns the frequency-weighted mean and variance of `x`.
Args:
x: A tensor.
axes: 1-d tensor of int32 values; these are the axes along which
to compute mean and variance.
frequency_weights: A tensor of positive weights which can be
broadcast with x.
name: Name used to scope the operation.... | Returns the frequency-weighted mean and variance of `x`. | [
"Returns",
"the",
"frequency",
"-",
"weighted",
"mean",
"and",
"variance",
"of",
"x",
"."
] | def weighted_moments(x, axes, frequency_weights, name=None, keep_dims=False):
"""Returns the frequency-weighted mean and variance of `x`.
Args:
x: A tensor.
axes: 1-d tensor of int32 values; these are the axes along which
to compute mean and variance.
frequency_weights: A tensor of positive weigh... | [
"def",
"weighted_moments",
"(",
"x",
",",
"axes",
",",
"frequency_weights",
",",
"name",
"=",
"None",
",",
"keep_dims",
"=",
"False",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"weighted_moments\"",
",",
"[",
"x",
",",
"frequency_weigh... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/nn_impl.py#L677-L745 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/dataset/dataset.py | python | InMemoryDataset._set_parse_ins_id | (self, parse_ins_id) | Set if Dataset need to parse insid
Args:
parse_ins_id(bool): if parse ins_id or not
Examples:
.. code-block:: python
import paddle
paddle.enable_static()
dataset = paddle.distributed.InMemoryDataset()
dataset._set_parse_i... | Set if Dataset need to parse insid | [
"Set",
"if",
"Dataset",
"need",
"to",
"parse",
"insid"
] | def _set_parse_ins_id(self, parse_ins_id):
"""
Set if Dataset need to parse insid
Args:
parse_ins_id(bool): if parse ins_id or not
Examples:
.. code-block:: python
import paddle
paddle.enable_static()
dataset = paddle.d... | [
"def",
"_set_parse_ins_id",
"(",
"self",
",",
"parse_ins_id",
")",
":",
"self",
".",
"parse_ins_id",
"=",
"parse_ins_id"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/dataset/dataset.py#L665-L681 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | Clipboard.Clear | (*args, **kwargs) | return _misc_.Clipboard_Clear(*args, **kwargs) | Clear(self)
Clears data from the clipboard object and also the system's clipboard
if possible. | Clear(self) | [
"Clear",
"(",
"self",
")"
] | def Clear(*args, **kwargs):
"""
Clear(self)
Clears data from the clipboard object and also the system's clipboard
if possible.
"""
return _misc_.Clipboard_Clear(*args, **kwargs) | [
"def",
"Clear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Clipboard_Clear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L5857-L5864 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | KeyEvent.GetKeyCode | (*args, **kwargs) | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) | GetKeyCode(self) -> int
Returns the virtual key code. ASCII events return normal ASCII values,
while non-ASCII events return values such as WXK_LEFT for the left
cursor key. See `wx.KeyEvent` for a full list of the virtual key
codes.
Note that in Unicode build, the returned val... | GetKeyCode(self) -> int | [
"GetKeyCode",
"(",
"self",
")",
"-",
">",
"int"
] | def GetKeyCode(*args, **kwargs):
"""
GetKeyCode(self) -> int
Returns the virtual key code. ASCII events return normal ASCII values,
while non-ASCII events return values such as WXK_LEFT for the left
cursor key. See `wx.KeyEvent` for a full list of the virtual key
codes.
... | [
"def",
"GetKeyCode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"KeyEvent_GetKeyCode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L6001-L6015 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/cli.py | python | __add_bootstrap_args | (parser) | These arguments are used to pre-initialize the context. | These arguments are used to pre-initialize the context. | [
"These",
"arguments",
"are",
"used",
"to",
"pre",
"-",
"initialize",
"the",
"context",
"."
] | def __add_bootstrap_args(parser):
"""These arguments are used to pre-initialize the context."""
parser.add_argument('--root-directory', default=os.getcwd(),
help='Lumberyard install directory and location of bootstrap.cfg file. Default is the current working directory.')
parser.add_a... | [
"def",
"__add_bootstrap_args",
"(",
"parser",
")",
":",
"parser",
".",
"add_argument",
"(",
"'--root-directory'",
",",
"default",
"=",
"os",
".",
"getcwd",
"(",
")",
",",
"help",
"=",
"'Lumberyard install directory and location of bootstrap.cfg file. Default is the curren... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/cli.py#L205-L219 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/protobuf/python/mox.py | python | In.__init__ | (self, key) | Initialize.
Args:
# key is any thing that could be in a list or a key in a dict | Initialize. | [
"Initialize",
"."
] | def __init__(self, key):
"""Initialize.
Args:
# key is any thing that could be in a list or a key in a dict
"""
self._key = key | [
"def",
"__init__",
"(",
"self",
",",
"key",
")",
":",
"self",
".",
"_key",
"=",
"key"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/mox.py#L946-L953 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.