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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/MSVSProject.py | python | Writer.AddFiles | (self, files) | Adds files to the project.
Args:
files: A list of Filter objects and/or relative paths to files.
This makes a copy of the file/filter tree at the time of this call. If you
later add files to a Filter object which was passed into a previous call
to AddFiles(), it will not be reflected in this pr... | Adds files to the project. | [
"Adds",
"files",
"to",
"the",
"project",
"."
] | def AddFiles(self, files):
"""Adds files to the project.
Args:
files: A list of Filter objects and/or relative paths to files.
This makes a copy of the file/filter tree at the time of this call. If you
later add files to a Filter object which was passed into a previous call
to AddFiles(), i... | [
"def",
"AddFiles",
"(",
"self",
",",
"files",
")",
":",
"self",
".",
"_AddFilesToNode",
"(",
"self",
".",
"files_section",
",",
"files",
")"
] | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/MSVSProject.py#L152-L162 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Import/App/automotive_design.py | python | item_in_context | (item,cntxt,) | return FALSE | :param item
:type item:representation_item
:param cntxt
:type cntxt:representation_context | :param item
:type item:representation_item
:param cntxt
:type cntxt:representation_context | [
":",
"param",
"item",
":",
"type",
"item",
":",
"representation_item",
":",
"param",
"cntxt",
":",
"type",
"cntxt",
":",
"representation_context"
] | def item_in_context(item,cntxt,):
'''
:param item
:type item:representation_item
:param cntxt
:type cntxt:representation_context
'''
if (SIZEOF(USEDIN(item,'AUTOMOTIVE_DESIGN.REPRESENTATION.ITEMS') * cntxt.representations_in_context) > 0):
return TRUE
else:
y = None
if (SIZEOF(y) > 0):
for i in ... | [
"def",
"item_in_context",
"(",
"item",
",",
"cntxt",
",",
")",
":",
"if",
"(",
"SIZEOF",
"(",
"USEDIN",
"(",
"item",
",",
"'AUTOMOTIVE_DESIGN.REPRESENTATION.ITEMS'",
")",
"*",
"cntxt",
".",
"representations_in_context",
")",
">",
"0",
")",
":",
"return",
"TR... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Import/App/automotive_design.py#L40659-L40674 | |
may0324/DeepCompression-caffe | 0aff6c1287bda4cfc7f378ed8a16524e1afabd8c | python/caffe/io.py | python | Transformer.set_mean | (self, in_, mean) | Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable) | Set the mean to subtract for centering the data. | [
"Set",
"the",
"mean",
"to",
"subtract",
"for",
"centering",
"the",
"data",
"."
] | def set_mean(self, in_, mean):
"""
Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable)
"""
self.__check_input(in_)
ms = mean.shape
... | [
"def",
"set_mean",
"(",
"self",
",",
"in_",
",",
"mean",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"ms",
"=",
"mean",
".",
"shape",
"if",
"mean",
".",
"ndim",
"==",
"1",
":",
"# broadcast channels",
"if",
"ms",
"[",
"0",
"]",
"!=",
... | https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/python/caffe/io.py#L236-L260 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/sdist.py | python | walk_revctrl | (dirname='') | Find all files under revision control | Find all files under revision control | [
"Find",
"all",
"files",
"under",
"revision",
"control"
] | def walk_revctrl(dirname=''):
"""Find all files under revision control"""
for ep in pkg_resources.iter_entry_points('setuptools.file_finders'):
for item in ep.load()(dirname):
yield item | [
"def",
"walk_revctrl",
"(",
"dirname",
"=",
"''",
")",
":",
"for",
"ep",
"in",
"pkg_resources",
".",
"iter_entry_points",
"(",
"'setuptools.file_finders'",
")",
":",
"for",
"item",
"in",
"ep",
".",
"load",
"(",
")",
"(",
"dirname",
")",
":",
"yield",
"it... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/sdist.py#L17-L21 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlHelpFrame.GetData | (*args, **kwargs) | return _html.HtmlHelpFrame_GetData(*args, **kwargs) | GetData(self) -> HtmlHelpData | GetData(self) -> HtmlHelpData | [
"GetData",
"(",
"self",
")",
"-",
">",
"HtmlHelpData"
] | def GetData(*args, **kwargs):
"""GetData(self) -> HtmlHelpData"""
return _html.HtmlHelpFrame_GetData(*args, **kwargs) | [
"def",
"GetData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlHelpFrame_GetData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1750-L1752 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/llvm/utils/benchmark/mingw.py | python | find_7zip | (log = EmptyLogger()) | return path[0] | Attempts to find 7zip for unpacking the mingw-build archives | Attempts to find 7zip for unpacking the mingw-build archives | [
"Attempts",
"to",
"find",
"7zip",
"for",
"unpacking",
"the",
"mingw",
"-",
"build",
"archives"
] | def find_7zip(log = EmptyLogger()):
'''
Attempts to find 7zip for unpacking the mingw-build archives
'''
log.info('finding 7zip')
path = find_in_path('7z')
if not path:
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\7-Zip')
path, _ = winreg.QueryValueEx(key, 'Path')
... | [
"def",
"find_7zip",
"(",
"log",
"=",
"EmptyLogger",
"(",
")",
")",
":",
"log",
".",
"info",
"(",
"'finding 7zip'",
")",
"path",
"=",
"find_in_path",
"(",
"'7z'",
")",
"if",
"not",
"path",
":",
"key",
"=",
"winreg",
".",
"OpenKey",
"(",
"winreg",
".",... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/llvm/utils/benchmark/mingw.py#L99-L110 | |
cmu-db/peloton | 484d76df9344cb5c153a2c361c5d5018912d4cf4 | script/helpers.py | python | find_clangformat | () | return path | Finds appropriate clang-format executable. | Finds appropriate clang-format executable. | [
"Finds",
"appropriate",
"clang",
"-",
"format",
"executable",
"."
] | def find_clangformat():
"""Finds appropriate clang-format executable."""
#check for possible clang-format versions
for exe in ["clang-format", "clang-format-3.6", "clang-format-3.7",
"clang-format-3.8"
]:
path = distutils.spawn.find_executable(exe)
if not path ... | [
"def",
"find_clangformat",
"(",
")",
":",
"#check for possible clang-format versions",
"for",
"exe",
"in",
"[",
"\"clang-format\"",
",",
"\"clang-format-3.6\"",
",",
"\"clang-format-3.7\"",
",",
"\"clang-format-3.8\"",
"]",
":",
"path",
"=",
"distutils",
".",
"spawn",
... | https://github.com/cmu-db/peloton/blob/484d76df9344cb5c153a2c361c5d5018912d4cf4/script/helpers.py#L37-L46 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gnm.py | python | Network.CommitTransaction | (self, *args) | return _gnm.Network_CommitTransaction(self, *args) | r"""CommitTransaction(Network self) -> OGRErr | r"""CommitTransaction(Network self) -> OGRErr | [
"r",
"CommitTransaction",
"(",
"Network",
"self",
")",
"-",
">",
"OGRErr"
] | def CommitTransaction(self, *args):
r"""CommitTransaction(Network self) -> OGRErr"""
return _gnm.Network_CommitTransaction(self, *args) | [
"def",
"CommitTransaction",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gnm",
".",
"Network_CommitTransaction",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gnm.py#L176-L178 | |
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/msvs_emulation.py | python | MsvsSettings.GetAsmflags | (self, config) | return asmflags | Returns the flags that need to be added to ml invocations. | Returns the flags that need to be added to ml invocations. | [
"Returns",
"the",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
"ml",
"invocations",
"."
] | def GetAsmflags(self, config):
"""Returns the flags that need to be added to ml invocations."""
config = self._TargetConfig(config)
asmflags = []
safeseh = self._Setting(('MASM', 'UseSafeExceptionHandlers'), config)
if safeseh == 'true':
asmflags.append('/safeseh')
return asmflags | [
"def",
"GetAsmflags",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"asmflags",
"=",
"[",
"]",
"safeseh",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'MASM'",
",",
"'UseSafeExceptionHandlers'",
")",
"... | 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/msvs_emulation.py#L417-L424 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/masked/maskededit.py | python | MaskedEditMixin._adjustPos | (self, pos, key) | return pos | Checks the current insertion point position and adjusts it if
necessary to skip over non-editable characters. | Checks the current insertion point position and adjusts it if
necessary to skip over non-editable characters. | [
"Checks",
"the",
"current",
"insertion",
"point",
"position",
"and",
"adjusts",
"it",
"if",
"necessary",
"to",
"skip",
"over",
"non",
"-",
"editable",
"characters",
"."
] | def _adjustPos(self, pos, key):
"""
Checks the current insertion point position and adjusts it if
necessary to skip over non-editable characters.
"""
## dbg('_adjustPos', pos, key, indent=1)
sel_start, sel_to = self._GetSelection()
# If a numeric or decimal mask, a... | [
"def",
"_adjustPos",
"(",
"self",
",",
"pos",
",",
"key",
")",
":",
"## dbg('_adjustPos', pos, key, indent=1)",
"sel_start",
",",
"sel_to",
"=",
"self",
".",
"_GetSelection",
"(",
")",
"# If a numeric or decimal mask, and negatives allowed, reserve the",
"# first spa... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/maskededit.py#L4325-L4413 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/plugins/prt/wxgui.py | python | WxGui.refresh_widgets | (self) | Check through mainframe what the state of the application is
and reset widgets. For exampe enable/disable widgets
dependent on the availability of data. | Check through mainframe what the state of the application is
and reset widgets. For exampe enable/disable widgets
dependent on the availability of data. | [
"Check",
"through",
"mainframe",
"what",
"the",
"state",
"of",
"the",
"application",
"is",
"and",
"reset",
"widgets",
".",
"For",
"exampe",
"enable",
"/",
"disable",
"widgets",
"dependent",
"on",
"the",
"availability",
"of",
"data",
"."
] | def refresh_widgets(self):
"""
Check through mainframe what the state of the application is
and reset widgets. For exampe enable/disable widgets
dependent on the availability of data.
"""
scenario = self.get_scenario()
print 'prtgui.refresh_widgets', self._simula... | [
"def",
"refresh_widgets",
"(",
"self",
")",
":",
"scenario",
"=",
"self",
".",
"get_scenario",
"(",
")",
"print",
"'prtgui.refresh_widgets'",
",",
"self",
".",
"_simulation",
"!=",
"scenario",
".",
"simulation",
"is_refresh",
"=",
"False",
"if",
"self",
".",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/prt/wxgui.py#L332-L351 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Image.SaveMimeStream | (*args, **kwargs) | return _core_.Image_SaveMimeStream(*args, **kwargs) | SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool
Saves an image in the named file. | SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool | [
"SaveMimeStream",
"(",
"self",
"wxOutputStream",
"stream",
"String",
"mimetype",
")",
"-",
">",
"bool"
] | def SaveMimeStream(*args, **kwargs):
"""
SaveMimeStream(self, wxOutputStream stream, String mimetype) -> bool
Saves an image in the named file.
"""
return _core_.Image_SaveMimeStream(*args, **kwargs) | [
"def",
"SaveMimeStream",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_SaveMimeStream",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L3219-L3225 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/msvs_emulation.py | python | EncodeRspFileList | (args) | return program + ' ' + ' '.join(QuoteForRspFile(arg) for arg in args[1:]) | Process a list of arguments using QuoteCmdExeArgument. | Process a list of arguments using QuoteCmdExeArgument. | [
"Process",
"a",
"list",
"of",
"arguments",
"using",
"QuoteCmdExeArgument",
"."
] | def EncodeRspFileList(args):
"""Process a list of arguments using QuoteCmdExeArgument."""
# Note that the first argument is assumed to be the command. Don't add
# quotes around it because then built-ins like 'echo', etc. won't work.
# Take care to normpath only the path in the case of 'call ../x.bat' because
... | [
"def",
"EncodeRspFileList",
"(",
"args",
")",
":",
"# Note that the first argument is assumed to be the command. Don't add",
"# quotes around it because then built-ins like 'echo', etc. won't work.",
"# Take care to normpath only the path in the case of 'call ../x.bat' because",
"# otherwise the w... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/msvs_emulation.py#L77-L90 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | parserCtxt.handleEntity | (self, entity) | Default handling of defined entities, when should we define
a new input stream ? When do we just handle that as a set
of chars ? OBSOLETE: to be removed at some point. | Default handling of defined entities, when should we define
a new input stream ? When do we just handle that as a set
of chars ? OBSOLETE: to be removed at some point. | [
"Default",
"handling",
"of",
"defined",
"entities",
"when",
"should",
"we",
"define",
"a",
"new",
"input",
"stream",
"?",
"When",
"do",
"we",
"just",
"handle",
"that",
"as",
"a",
"set",
"of",
"chars",
"?",
"OBSOLETE",
":",
"to",
"be",
"removed",
"at",
... | def handleEntity(self, entity):
"""Default handling of defined entities, when should we define
a new input stream ? When do we just handle that as a set
of chars ? OBSOLETE: to be removed at some point. """
if entity is None: entity__o = None
else: entity__o = entity._o
... | [
"def",
"handleEntity",
"(",
"self",
",",
"entity",
")",
":",
"if",
"entity",
"is",
"None",
":",
"entity__o",
"=",
"None",
"else",
":",
"entity__o",
"=",
"entity",
".",
"_o",
"libxml2mod",
".",
"xmlHandleEntity",
"(",
"self",
".",
"_o",
",",
"entity__o",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L5141-L5147 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/multi_worker_util.py | python | should_load_checkpoint | () | return dc_context.get_current_worker_context().experimental_should_init | Returns whether the current worker should load checkpoints.
In multi-worker training, if loading checkpoint is requested by user, or
needed for fault-tolerance, the cluster should load checkpoint but not
necessarily every worker in the cluster should.
Returns:
Whether this particular worker in the clust... | Returns whether the current worker should load checkpoints. | [
"Returns",
"whether",
"the",
"current",
"worker",
"should",
"load",
"checkpoints",
"."
] | def should_load_checkpoint():
"""Returns whether the current worker should load checkpoints.
In multi-worker training, if loading checkpoint is requested by user, or
needed for fault-tolerance, the cluster should load checkpoint but not
necessarily every worker in the cluster should.
Returns:
Whether ... | [
"def",
"should_load_checkpoint",
"(",
")",
":",
"return",
"dc_context",
".",
"get_current_worker_context",
"(",
")",
".",
"experimental_should_init"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/multi_worker_util.py#L282-L292 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/image/image.py | python | RandomGrayAug.__call__ | (self, src) | return src | Augmenter body | Augmenter body | [
"Augmenter",
"body"
] | def __call__(self, src):
"""Augmenter body"""
if random.random() < self.p:
src = nd.dot(src, self.mat)
return src | [
"def",
"__call__",
"(",
"self",
",",
"src",
")",
":",
"if",
"random",
".",
"random",
"(",
")",
"<",
"self",
".",
"p",
":",
"src",
"=",
"nd",
".",
"dot",
"(",
"src",
",",
"self",
".",
"mat",
")",
"return",
"src"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/image/image.py#L1133-L1137 | |
openbabel/openbabel | f3ed2a9a5166dbd3b9ce386e636a176074a6c34c | scripts/python/openbabel/pybel.py | python | Molecule.addh | (self) | Add hydrogens. | Add hydrogens. | [
"Add",
"hydrogens",
"."
] | def addh(self):
"""Add hydrogens."""
self.OBMol.AddHydrogens() | [
"def",
"addh",
"(",
"self",
")",
":",
"self",
".",
"OBMol",
".",
"AddHydrogens",
"(",
")"
] | https://github.com/openbabel/openbabel/blob/f3ed2a9a5166dbd3b9ce386e636a176074a6c34c/scripts/python/openbabel/pybel.py#L608-L610 | ||
musescore/MuseScore | a817fea23e3c2be30847b7fde5b01746222c252e | thirdparty/freetype/src/tools/docmaker/docbeauty.py | python | main | ( argv ) | main program loop | main program loop | [
"main",
"program",
"loop"
] | def main( argv ):
"""main program loop"""
global output_dir
try:
opts, args = getopt.getopt( sys.argv[1:], \
"hb", \
["help", "backup"] )
except getopt.GetoptError:
usage()
sys.exit( 2 )
if ar... | [
"def",
"main",
"(",
"argv",
")",
":",
"global",
"output_dir",
"try",
":",
"opts",
",",
"args",
"=",
"getopt",
".",
"getopt",
"(",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
",",
"\"hb\"",
",",
"[",
"\"help\"",
",",
"\"backup\"",
"]",
")",
"except",
... | https://github.com/musescore/MuseScore/blob/a817fea23e3c2be30847b7fde5b01746222c252e/thirdparty/freetype/src/tools/docmaker/docbeauty.py#L52-L104 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py | python | PythonModuleMakefile.__init__ | (self, configuration, dstdir, srcdir=None, dir=None,
makefile="Makefile", installs=None) | Initialise an instance of a parent Makefile.
dstdir is the name of the directory where the module's Python code will
be installed.
srcdir is the name of the directory (relative to the directory in which
the Makefile will be created) containing the module's Python code. It
defau... | Initialise an instance of a parent Makefile. | [
"Initialise",
"an",
"instance",
"of",
"a",
"parent",
"Makefile",
"."
] | def __init__(self, configuration, dstdir, srcdir=None, dir=None,
makefile="Makefile", installs=None):
"""Initialise an instance of a parent Makefile.
dstdir is the name of the directory where the module's Python code will
be installed.
srcdir is the name of the director... | [
"def",
"__init__",
"(",
"self",
",",
"configuration",
",",
"dstdir",
",",
"srcdir",
"=",
"None",
",",
"dir",
"=",
"None",
",",
"makefile",
"=",
"\"Makefile\"",
",",
"installs",
"=",
"None",
")",
":",
"Makefile",
".",
"__init__",
"(",
"self",
",",
"conf... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L1462-L1483 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/importOCA.py | python | open | (filename) | Open filename and parse.
Parameters
----------
filename : str
The path to the filename to be opened.
Returns
-------
None | Open filename and parse. | [
"Open",
"filename",
"and",
"parse",
"."
] | def open(filename):
"""Open filename and parse.
Parameters
----------
filename : str
The path to the filename to be opened.
Returns
-------
None
"""
docname = os.path.split(filename)[1]
doc = FreeCAD.newDocument(docname)
if docname[-4:] == "gcad":
doc.Label ... | [
"def",
"open",
"(",
"filename",
")",
":",
"docname",
"=",
"os",
".",
"path",
".",
"split",
"(",
"filename",
")",
"[",
"1",
"]",
"doc",
"=",
"FreeCAD",
".",
"newDocument",
"(",
"docname",
")",
"if",
"docname",
"[",
"-",
"4",
":",
"]",
"==",
"\"gca... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/importOCA.py#L367-L386 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateTime.GetYearDay | (*args, **kwargs) | return _misc_.DateTime_GetYearDay(*args, **kwargs) | GetYearDay(self, int yday) -> DateTime | GetYearDay(self, int yday) -> DateTime | [
"GetYearDay",
"(",
"self",
"int",
"yday",
")",
"-",
">",
"DateTime"
] | def GetYearDay(*args, **kwargs):
"""GetYearDay(self, int yday) -> DateTime"""
return _misc_.DateTime_GetYearDay(*args, **kwargs) | [
"def",
"GetYearDay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_GetYearDay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3898-L3900 | |
WenmuZhou/PSENet.pytorch | f760c2f4938726a2d00efaf5e5b28218323c44ca | cal_recall/script.py | python | default_evaluation_params | () | return {
'IOU_CONSTRAINT': 0.5,
'AREA_PRECISION_CONSTRAINT': 0.5,
'GT_SAMPLE_NAME_2_ID': 'gt_img_([0-9]+).txt',
'DET_SAMPLE_NAME_2_ID': 'res_img_([0-9]+).txt',
'LTRB': False, # LTRB:2points(left,top,right,bottom) or 4 points(x1,y1,x2,y2,x3,y3,x4,y4)
'CRLF': False, # Lin... | default_evaluation_params: Default parameters to use for the validation and evaluation. | default_evaluation_params: Default parameters to use for the validation and evaluation. | [
"default_evaluation_params",
":",
"Default",
"parameters",
"to",
"use",
"for",
"the",
"validation",
"and",
"evaluation",
"."
] | def default_evaluation_params():
"""
default_evaluation_params: Default parameters to use for the validation and evaluation.
"""
return {
'IOU_CONSTRAINT': 0.5,
'AREA_PRECISION_CONSTRAINT': 0.5,
'GT_SAMPLE_NAME_2_ID': 'gt_img_([0-9]+).txt',
'DET_SAMPLE_NAME_2_ID': 'res_im... | [
"def",
"default_evaluation_params",
"(",
")",
":",
"return",
"{",
"'IOU_CONSTRAINT'",
":",
"0.5",
",",
"'AREA_PRECISION_CONSTRAINT'",
":",
"0.5",
",",
"'GT_SAMPLE_NAME_2_ID'",
":",
"'gt_img_([0-9]+).txt'",
",",
"'DET_SAMPLE_NAME_2_ID'",
":",
"'res_img_([0-9]+).txt'",
",",... | https://github.com/WenmuZhou/PSENet.pytorch/blob/f760c2f4938726a2d00efaf5e5b28218323c44ca/cal_recall/script.py#L9-L22 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py | python | _infer_structured_outs | (
op_config: LinalgStructuredOpConfig,
in_arg_defs: Sequence[OperandDefConfig], ins: Sequence[Value],
out_arg_defs: Sequence[OperandDefConfig],
outs: Union[Sequence[Value], OpResultList]) | Infers implicit outs and output types.
Respects existing contents of outs if not empty.
Returns:
normalized outs, output types | Infers implicit outs and output types. | [
"Infers",
"implicit",
"outs",
"and",
"output",
"types",
"."
] | def _infer_structured_outs(
op_config: LinalgStructuredOpConfig,
in_arg_defs: Sequence[OperandDefConfig], ins: Sequence[Value],
out_arg_defs: Sequence[OperandDefConfig],
outs: Union[Sequence[Value], OpResultList]) -> Tuple[ValueList, List[Type]]:
"""Infers implicit outs and output types.
Respects e... | [
"def",
"_infer_structured_outs",
"(",
"op_config",
":",
"LinalgStructuredOpConfig",
",",
"in_arg_defs",
":",
"Sequence",
"[",
"OperandDefConfig",
"]",
",",
"ins",
":",
"Sequence",
"[",
"Value",
"]",
",",
"out_arg_defs",
":",
"Sequence",
"[",
"OperandDefConfig",
"]... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py#L373-L390 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/shutil.py | python | get_archive_formats | () | return formats | Returns a list of supported formats for archiving and unarchiving.
Each element of the returned sequence is a tuple (name, description) | Returns a list of supported formats for archiving and unarchiving. | [
"Returns",
"a",
"list",
"of",
"supported",
"formats",
"for",
"archiving",
"and",
"unarchiving",
"."
] | def get_archive_formats():
"""Returns a list of supported formats for archiving and unarchiving.
Each element of the returned sequence is a tuple (name, description)
"""
formats = [(name, registry[2]) for name, registry in
_ARCHIVE_FORMATS.items()]
formats.sort()
return formats | [
"def",
"get_archive_formats",
"(",
")",
":",
"formats",
"=",
"[",
"(",
"name",
",",
"registry",
"[",
"2",
"]",
")",
"for",
"name",
",",
"registry",
"in",
"_ARCHIVE_FORMATS",
".",
"items",
"(",
")",
"]",
"formats",
".",
"sort",
"(",
")",
"return",
"fo... | 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/_vendor/distlib/_backport/shutil.py#L513-L521 | |
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | thirdparty/gflags/gflags.py | python | MultiFlag.Parse | (self, arguments) | Parses one or more arguments with the installed parser.
Args:
arguments: a single argument or a list of arguments (typically a
list of default values); a single argument is converted
internally into a list containing one item. | Parses one or more arguments with the installed parser. | [
"Parses",
"one",
"or",
"more",
"arguments",
"with",
"the",
"installed",
"parser",
"."
] | def Parse(self, arguments):
"""Parses one or more arguments with the installed parser.
Args:
arguments: a single argument or a list of arguments (typically a
list of default values); a single argument is converted
internally into a list containing one item.
"""
if not isinstance(a... | [
"def",
"Parse",
"(",
"self",
",",
"arguments",
")",
":",
"if",
"not",
"isinstance",
"(",
"arguments",
",",
"list",
")",
":",
"# Default value may be a list of values. Most other arguments",
"# will not be, so convert them into a single-item list to make",
"# processing simpler... | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/thirdparty/gflags/gflags.py#L2654-L2681 | ||
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Type.is_pod | (self) | return conf.lib.clang_isPODType(self) | Determine whether this Type represents plain old data (POD). | Determine whether this Type represents plain old data (POD). | [
"Determine",
"whether",
"this",
"Type",
"represents",
"plain",
"old",
"data",
"(",
"POD",
")",
"."
] | def is_pod(self):
"""Determine whether this Type represents plain old data (POD)."""
return conf.lib.clang_isPODType(self) | [
"def",
"is_pod",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isPODType",
"(",
"self",
")"
] | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1770-L1772 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/common/extensions/docs/server2/new_github_file_system.py | python | _GithubZipFile.Read | (self, path) | return self._zipball.read(posixpath.join(self._name_prefix, path)) | Returns the contents of |path|. Raises a KeyError if it doesn't exist. | Returns the contents of |path|. Raises a KeyError if it doesn't exist. | [
"Returns",
"the",
"contents",
"of",
"|path|",
".",
"Raises",
"a",
"KeyError",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | def Read(self, path):
'''Returns the contents of |path|. Raises a KeyError if it doesn't exist.
'''
return self._zipball.read(posixpath.join(self._name_prefix, path)) | [
"def",
"Read",
"(",
"self",
",",
"path",
")",
":",
"return",
"self",
".",
"_zipball",
".",
"read",
"(",
"posixpath",
".",
"join",
"(",
"self",
".",
"_name_prefix",
",",
"path",
")",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/new_github_file_system.py#L89-L92 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewModel.ChangeValue | (*args, **kwargs) | return _dataview.DataViewModel_ChangeValue(*args, **kwargs) | ChangeValue(self, wxVariant variant, DataViewItem item, unsigned int col) -> bool | ChangeValue(self, wxVariant variant, DataViewItem item, unsigned int col) -> bool | [
"ChangeValue",
"(",
"self",
"wxVariant",
"variant",
"DataViewItem",
"item",
"unsigned",
"int",
"col",
")",
"-",
">",
"bool"
] | def ChangeValue(*args, **kwargs):
"""ChangeValue(self, wxVariant variant, DataViewItem item, unsigned int col) -> bool"""
return _dataview.DataViewModel_ChangeValue(*args, **kwargs) | [
"def",
"ChangeValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewModel_ChangeValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L492-L494 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | Bracket.__init__ | (self) | Create a (possibly literal) new bracket | Create a (possibly literal) new bracket | [
"Create",
"a",
"(",
"possibly",
"literal",
")",
"new",
"bracket"
] | def __init__(self):
"Create a (possibly literal) new bracket"
FormulaBit.__init__(self)
self.inner = None | [
"def",
"__init__",
"(",
"self",
")",
":",
"FormulaBit",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"inner",
"=",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L2760-L2763 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/environment.py | python | Environment.parse | (self, source, name=None, filename=None) | Parse the sourcecode and return the abstract syntax tree. This
tree of nodes is used by the compiler to convert the template into
executable source- or bytecode. This is useful for debugging or to
extract information from templates.
If you are :ref:`developing Jinja2 extensions <writi... | Parse the sourcecode and return the abstract syntax tree. This
tree of nodes is used by the compiler to convert the template into
executable source- or bytecode. This is useful for debugging or to
extract information from templates. | [
"Parse",
"the",
"sourcecode",
"and",
"return",
"the",
"abstract",
"syntax",
"tree",
".",
"This",
"tree",
"of",
"nodes",
"is",
"used",
"by",
"the",
"compiler",
"to",
"convert",
"the",
"template",
"into",
"executable",
"source",
"-",
"or",
"bytecode",
".",
"... | def parse(self, source, name=None, filename=None):
"""Parse the sourcecode and return the abstract syntax tree. This
tree of nodes is used by the compiler to convert the template into
executable source- or bytecode. This is useful for debugging or to
extract information from templates.... | [
"def",
"parse",
"(",
"self",
",",
"source",
",",
"name",
"=",
"None",
",",
"filename",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"_parse",
"(",
"source",
",",
"name",
",",
"filename",
")",
"except",
"TemplateSyntaxError",
":",
"exc_info... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/environment.py#L381-L394 | ||
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/boost/tools/build/src/build/generators.py | python | Generator.convert_to_consumable_types | (self, project, name, prop_set, sources, only_one=False) | return consumed | Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert 'source' to only one of source types
if there's more that one possibility, re... | Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert 'source' to only one of source types
if there's more that one possibility, re... | [
"Attempts",
"to",
"convert",
"source",
"to",
"the",
"types",
"that",
"this",
"generator",
"can",
"handle",
".",
"The",
"intention",
"is",
"to",
"produce",
"the",
"set",
"of",
"targets",
"can",
"should",
"be",
"used",
"when",
"generator",
"is",
"run",
".",
... | def convert_to_consumable_types (self, project, name, prop_set, sources, only_one=False):
""" Attempts to convert 'source' to the types that this generator can
handle. The intention is to produce the set of targets can should be
used when generator is run.
only_one: convert... | [
"def",
"convert_to_consumable_types",
"(",
"self",
",",
"project",
",",
"name",
",",
"prop_set",
",",
"sources",
",",
"only_one",
"=",
"False",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
... | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/generators.py#L528-L585 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py | python | run_find_all_symbols | (args, tmpdir, build_path, queue) | Takes filenames out of queue and runs find-all-symbols on them. | Takes filenames out of queue and runs find-all-symbols on them. | [
"Takes",
"filenames",
"out",
"of",
"queue",
"and",
"runs",
"find",
"-",
"all",
"-",
"symbols",
"on",
"them",
"."
] | def run_find_all_symbols(args, tmpdir, build_path, queue):
"""Takes filenames out of queue and runs find-all-symbols on them."""
while True:
name = queue.get()
invocation = [args.binary, name, '-output-dir='+tmpdir, '-p='+build_path]
sys.stdout.write(' '.join(invocation) + '\n')
subprocess.call(invo... | [
"def",
"run_find_all_symbols",
"(",
"args",
",",
"tmpdir",
",",
"build_path",
",",
"queue",
")",
":",
"while",
"True",
":",
"name",
"=",
"queue",
".",
"get",
"(",
")",
"invocation",
"=",
"[",
"args",
".",
"binary",
",",
"name",
",",
"'-output-dir='",
"... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py#L55-L62 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/arrayobj.py | python | _empty_nd_impl | (context, builder, arrtype, shapes) | return ary | Utility function used for allocating a new array during LLVM code
generation (lowering). Given a target context, builder, array
type, and a tuple or list of lowered dimension sizes, returns a
LLVM value pointing at a Numba runtime allocated array. | Utility function used for allocating a new array during LLVM code
generation (lowering). Given a target context, builder, array
type, and a tuple or list of lowered dimension sizes, returns a
LLVM value pointing at a Numba runtime allocated array. | [
"Utility",
"function",
"used",
"for",
"allocating",
"a",
"new",
"array",
"during",
"LLVM",
"code",
"generation",
"(",
"lowering",
")",
".",
"Given",
"a",
"target",
"context",
"builder",
"array",
"type",
"and",
"a",
"tuple",
"or",
"list",
"of",
"lowered",
"... | def _empty_nd_impl(context, builder, arrtype, shapes):
"""Utility function used for allocating a new array during LLVM code
generation (lowering). Given a target context, builder, array
type, and a tuple or list of lowered dimension sizes, returns a
LLVM value pointing at a Numba runtime allocated arra... | [
"def",
"_empty_nd_impl",
"(",
"context",
",",
"builder",
",",
"arrtype",
",",
"shapes",
")",
":",
"arycls",
"=",
"make_array",
"(",
"arrtype",
")",
"ary",
"=",
"arycls",
"(",
"context",
",",
"builder",
")",
"datatype",
"=",
"context",
".",
"get_data_type",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/arrayobj.py#L3335-L3405 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/fitpropertybrowser.py | python | FitPropertyBrowser._set_peak_initial_fwhm | (self, fun, fwhm) | Overwrite fwhm if has not been set already - this is for back to back exponential type funcs
which have had the width parameter (S) as func d-spacing refined for a standard sample (coefs stored in
instrument Paramters.xml) and has already been set.
:param fun: peak function prefix
:param... | Overwrite fwhm if has not been set already - this is for back to back exponential type funcs
which have had the width parameter (S) as func d-spacing refined for a standard sample (coefs stored in
instrument Paramters.xml) and has already been set.
:param fun: peak function prefix
:param... | [
"Overwrite",
"fwhm",
"if",
"has",
"not",
"been",
"set",
"already",
"-",
"this",
"is",
"for",
"back",
"to",
"back",
"exponential",
"type",
"funcs",
"which",
"have",
"had",
"the",
"width",
"parameter",
"(",
"S",
")",
"as",
"func",
"d",
"-",
"spacing",
"r... | def _set_peak_initial_fwhm(self, fun, fwhm):
"""
Overwrite fwhm if has not been set already - this is for back to back exponential type funcs
which have had the width parameter (S) as func d-spacing refined for a standard sample (coefs stored in
instrument Paramters.xml) and has already ... | [
"def",
"_set_peak_initial_fwhm",
"(",
"self",
",",
"fun",
",",
"fwhm",
")",
":",
"if",
"not",
"self",
".",
"getWidthParameterNameOf",
"(",
"fun",
")",
"or",
"not",
"self",
".",
"isParameterExplicitlySetOf",
"(",
"fun",
",",
"self",
".",
"getWidthParameterNameO... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/fitpropertybrowser.py#L166-L176 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/utils/_process_win32.py | python | getoutput | (cmd) | return py3compat.decode(out) | Return standard output of executing cmd in a shell.
Accepts the same arguments as os.system().
Parameters
----------
cmd : str or list
A command to be executed in the system shell.
Returns
-------
stdout : str | Return standard output of executing cmd in a shell. | [
"Return",
"standard",
"output",
"of",
"executing",
"cmd",
"in",
"a",
"shell",
"."
] | def getoutput(cmd):
"""Return standard output of executing cmd in a shell.
Accepts the same arguments as os.system().
Parameters
----------
cmd : str or list
A command to be executed in the system shell.
Returns
-------
stdout : str
"""
with AvoidUNCPath() as path:
... | [
"def",
"getoutput",
"(",
"cmd",
")",
":",
"with",
"AvoidUNCPath",
"(",
")",
"as",
"path",
":",
"if",
"path",
"is",
"not",
"None",
":",
"cmd",
"=",
"'\"pushd %s &&\"%s'",
"%",
"(",
"path",
",",
"cmd",
")",
"out",
"=",
"process_handler",
"(",
"cmd",
",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/utils/_process_win32.py#L147-L169 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/generator/msvs.py | python | _FixPaths | (paths, separator="\\") | return [_FixPath(i, separator) for i in paths] | Fix each of the paths of the list. | Fix each of the paths of the list. | [
"Fix",
"each",
"of",
"the",
"paths",
"of",
"the",
"list",
"."
] | def _FixPaths(paths, separator="\\"):
"""Fix each of the paths of the list."""
return [_FixPath(i, separator) for i in paths] | [
"def",
"_FixPaths",
"(",
"paths",
",",
"separator",
"=",
"\"\\\\\"",
")",
":",
"return",
"[",
"_FixPath",
"(",
"i",
",",
"separator",
")",
"for",
"i",
"in",
"paths",
"]"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/msvs.py#L191-L193 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/arrays/categorical.py | python | Categorical._reverse_indexer | (self) | return result | Compute the inverse of a categorical, returning
a dict of categories -> indexers.
*This is an internal function*
Returns
-------
dict of categories -> indexers
Example
-------
In [1]: c = pd.Categorical(list('aabca'))
In [2]: c
Out[2]:
... | Compute the inverse of a categorical, returning
a dict of categories -> indexers. | [
"Compute",
"the",
"inverse",
"of",
"a",
"categorical",
"returning",
"a",
"dict",
"of",
"categories",
"-",
">",
"indexers",
"."
] | def _reverse_indexer(self):
"""
Compute the inverse of a categorical, returning
a dict of categories -> indexers.
*This is an internal function*
Returns
-------
dict of categories -> indexers
Example
-------
In [1]: c = pd.Categorical(li... | [
"def",
"_reverse_indexer",
"(",
"self",
")",
":",
"categories",
"=",
"self",
".",
"categories",
"r",
",",
"counts",
"=",
"libalgos",
".",
"groupsort_indexer",
"(",
"self",
".",
"codes",
".",
"astype",
"(",
"'int64'",
")",
",",
"categories",
".",
"size",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/arrays/categorical.py#L2128-L2165 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/ltisys.py | python | place_poles | (A, B, poles, method="YT", rtol=1e-3, maxiter=30) | return full_state_feedback | Compute K such that eigenvalues (A - dot(B, K))=poles.
K is the gain matrix such as the plant described by the linear system
``AX+BU`` will have its closed-loop poles, i.e the eigenvalues ``A - B*K``,
as close as possible to those asked for in poles.
SISO, MISO and MIMO systems are supported.
Par... | Compute K such that eigenvalues (A - dot(B, K))=poles. | [
"Compute",
"K",
"such",
"that",
"eigenvalues",
"(",
"A",
"-",
"dot",
"(",
"B",
"K",
"))",
"=",
"poles",
"."
] | def place_poles(A, B, poles, method="YT", rtol=1e-3, maxiter=30):
"""
Compute K such that eigenvalues (A - dot(B, K))=poles.
K is the gain matrix such as the plant described by the linear system
``AX+BU`` will have its closed-loop poles, i.e the eigenvalues ``A - B*K``,
as close as possible to thos... | [
"def",
"place_poles",
"(",
"A",
",",
"B",
",",
"poles",
",",
"method",
"=",
"\"YT\"",
",",
"rtol",
"=",
"1e-3",
",",
"maxiter",
"=",
"30",
")",
":",
"# Move away all the inputs checking, it only adds noise to the code",
"update_loop",
",",
"poles",
"=",
"_valid_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/ltisys.py#L2880-L3228 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/dis.py | python | dis | (x=None) | Disassemble classes, methods, functions, or code.
With no argument, disassemble the last traceback. | Disassemble classes, methods, functions, or code. | [
"Disassemble",
"classes",
"methods",
"functions",
"or",
"code",
"."
] | def dis(x=None):
"""Disassemble classes, methods, functions, or code.
With no argument, disassemble the last traceback.
"""
if x is None:
distb()
return
if isinstance(x, types.InstanceType):
x = x.__class__
if hasattr(x, 'im_func'):
x = x.im_func
if hasattr(... | [
"def",
"dis",
"(",
"x",
"=",
"None",
")",
":",
"if",
"x",
"is",
"None",
":",
"distb",
"(",
")",
"return",
"if",
"isinstance",
"(",
"x",
",",
"types",
".",
"InstanceType",
")",
":",
"x",
"=",
"x",
".",
"__class__",
"if",
"hasattr",
"(",
"x",
","... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/dis.py#L16-L49 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py | python | GraphRewriter.add_eightbit_prologue_nodes | (self, original_node) | return all_input_names | Adds input conversion nodes to handle quantizing the underlying node. | Adds input conversion nodes to handle quantizing the underlying node. | [
"Adds",
"input",
"conversion",
"nodes",
"to",
"handle",
"quantizing",
"the",
"underlying",
"node",
"."
] | def add_eightbit_prologue_nodes(self, original_node):
"""Adds input conversion nodes to handle quantizing the underlying node."""
namespace_prefix = original_node.name + "_eightbit"
reshape_dims_name, reduction_dims_name = self.add_common_quantization_nodes(
namespace_prefix)
input_names = []
... | [
"def",
"add_eightbit_prologue_nodes",
"(",
"self",
",",
"original_node",
")",
":",
"namespace_prefix",
"=",
"original_node",
".",
"name",
"+",
"\"_eightbit\"",
"reshape_dims_name",
",",
"reduction_dims_name",
"=",
"self",
".",
"add_common_quantization_nodes",
"(",
"name... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py#L480-L498 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/tools/scan-build-py/libscanbuild/analyze.py | python | report_failure | (opts) | Create report when analyzer failed.
The major report is the preprocessor output. The output filename generated
randomly. The compiler output also captured into '.stderr.txt' file.
And some more execution context also saved into '.info.txt' file. | Create report when analyzer failed. | [
"Create",
"report",
"when",
"analyzer",
"failed",
"."
] | def report_failure(opts):
""" Create report when analyzer failed.
The major report is the preprocessor output. The output filename generated
randomly. The compiler output also captured into '.stderr.txt' file.
And some more execution context also saved into '.info.txt' file. """
def extension():
... | [
"def",
"report_failure",
"(",
"opts",
")",
":",
"def",
"extension",
"(",
")",
":",
"\"\"\" Generate preprocessor file extension. \"\"\"",
"mapping",
"=",
"{",
"'objective-c++'",
":",
"'.mii'",
",",
"'objective-c'",
":",
"'.mi'",
",",
"'c++'",
":",
"'.ii'",
"}",
... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/tools/scan-build-py/libscanbuild/analyze.py#L461-L514 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/lib/debug_events_writer.py | python | DebugEventsWriter.WriteGraphExecutionTrace | (self, graph_execution_trace) | Write a GraphExecutionTrace proto with the writer.
Args:
graph_execution_trace: A GraphExecutionTrace proto, concerning the value
of an intermediate tensor or a list of intermediate tensors that are
computed during the graph's execution. | Write a GraphExecutionTrace proto with the writer. | [
"Write",
"a",
"GraphExecutionTrace",
"proto",
"with",
"the",
"writer",
"."
] | def WriteGraphExecutionTrace(self, graph_execution_trace):
"""Write a GraphExecutionTrace proto with the writer.
Args:
graph_execution_trace: A GraphExecutionTrace proto, concerning the value
of an intermediate tensor or a list of intermediate tensors that are
computed during the graph's ... | [
"def",
"WriteGraphExecutionTrace",
"(",
"self",
",",
"graph_execution_trace",
")",
":",
"debug_event",
"=",
"debug_event_pb2",
".",
"DebugEvent",
"(",
"graph_execution_trace",
"=",
"graph_execution_trace",
")",
"self",
".",
"_EnsureTimestampAdded",
"(",
"debug_event",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/debug_events_writer.py#L117-L129 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGProperty.EnableCommonValue | (*args, **kwargs) | return _propgrid.PGProperty_EnableCommonValue(*args, **kwargs) | EnableCommonValue(self, bool enable=True) | EnableCommonValue(self, bool enable=True) | [
"EnableCommonValue",
"(",
"self",
"bool",
"enable",
"=",
"True",
")"
] | def EnableCommonValue(*args, **kwargs):
"""EnableCommonValue(self, bool enable=True)"""
return _propgrid.PGProperty_EnableCommonValue(*args, **kwargs) | [
"def",
"EnableCommonValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_EnableCommonValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L453-L455 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/inspect.py | python | formatargvalues | (args, varargs, varkw, locals,
formatarg=str,
formatvarargs=lambda name: '*' + name,
formatvarkw=lambda name: '**' + name,
formatvalue=lambda value: '=' + repr(value),
join=joinseq) | return '(' + string.join(specs, ', ') + ')' | Format an argument spec from the 4 values returned by getargvalues.
The first four arguments are (args, varargs, varkw, locals). The
next four arguments are the corresponding optional formatting functions
that are called to turn names and values into strings. The ninth
argument is an optional functio... | Format an argument spec from the 4 values returned by getargvalues. | [
"Format",
"an",
"argument",
"spec",
"from",
"the",
"4",
"values",
"returned",
"by",
"getargvalues",
"."
] | def formatargvalues(args, varargs, varkw, locals,
formatarg=str,
formatvarargs=lambda name: '*' + name,
formatvarkw=lambda name: '**' + name,
formatvalue=lambda value: '=' + repr(value),
join=joinseq):
"""Format an a... | [
"def",
"formatargvalues",
"(",
"args",
",",
"varargs",
",",
"varkw",
",",
"locals",
",",
"formatarg",
"=",
"str",
",",
"formatvarargs",
"=",
"lambda",
"name",
":",
"'*'",
"+",
"name",
",",
"formatvarkw",
"=",
"lambda",
"name",
":",
"'**'",
"+",
"name",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/inspect.py#L870-L892 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/routing.py | python | RuleRouter.__init__ | (self, rules: Optional[_RuleList] = None) | Constructs a router from an ordered list of rules::
RuleRouter([
Rule(PathMatches("/handler"), Target),
# ... more rules
])
You can also omit explicit `Rule` constructor and use tuples of arguments::
RuleRouter([
(PathMatches... | Constructs a router from an ordered list of rules:: | [
"Constructs",
"a",
"router",
"from",
"an",
"ordered",
"list",
"of",
"rules",
"::"
] | def __init__(self, rules: Optional[_RuleList] = None) -> None:
"""Constructs a router from an ordered list of rules::
RuleRouter([
Rule(PathMatches("/handler"), Target),
# ... more rules
])
You can also omit explicit `Rule` constructor and use tu... | [
"def",
"__init__",
"(",
"self",
",",
"rules",
":",
"Optional",
"[",
"_RuleList",
"]",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"rules",
"=",
"[",
"]",
"# type: List[Rule]",
"if",
"rules",
":",
"self",
".",
"add_rules",
"(",
"rules",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/routing.py#L303-L332 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/ast.py | python | NodeVisitor.visit | (self, node) | return visitor(node) | Visit a node. | Visit a node. | [
"Visit",
"a",
"node",
"."
] | def visit(self, node):
"""Visit a node."""
method = 'visit_' + node.__class__.__name__
visitor = getattr(self, method, self.generic_visit)
return visitor(node) | [
"def",
"visit",
"(",
"self",
",",
"node",
")",
":",
"method",
"=",
"'visit_'",
"+",
"node",
".",
"__class__",
".",
"__name__",
"visitor",
"=",
"getattr",
"(",
"self",
",",
"method",
",",
"self",
".",
"generic_visit",
")",
"return",
"visitor",
"(",
"nod... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/ast.py#L227-L231 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/speedmeter.py | python | SpeedMeter.SetIntervals | (self, intervals=None) | Sets the intervals for :class:`SpeedMeter` (main ticks numeric values).
:param `intervals`: a Python list of main ticks to be displayed. If defaulted
to ``None``, the list `[0, 50, 100]` is used. | Sets the intervals for :class:`SpeedMeter` (main ticks numeric values). | [
"Sets",
"the",
"intervals",
"for",
":",
"class",
":",
"SpeedMeter",
"(",
"main",
"ticks",
"numeric",
"values",
")",
"."
] | def SetIntervals(self, intervals=None):
"""
Sets the intervals for :class:`SpeedMeter` (main ticks numeric values).
:param `intervals`: a Python list of main ticks to be displayed. If defaulted
to ``None``, the list `[0, 50, 100]` is used.
"""
if intervals is None:
... | [
"def",
"SetIntervals",
"(",
"self",
",",
"intervals",
"=",
"None",
")",
":",
"if",
"intervals",
"is",
"None",
":",
"intervals",
"=",
"[",
"0",
",",
"50",
",",
"100",
"]",
"self",
".",
"_intervals",
"=",
"intervals"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/speedmeter.py#L1132-L1143 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/deep_cfr_tf2.py | python | DeepCFRSolver._learn_strategy_network | (self) | return main_loss | Compute the loss over the strategy network.
Returns:
The average loss obtained on the last training batch of transitions
or `None`. | Compute the loss over the strategy network. | [
"Compute",
"the",
"loss",
"over",
"the",
"strategy",
"network",
"."
] | def _learn_strategy_network(self):
"""Compute the loss over the strategy network.
Returns:
The average loss obtained on the last training batch of transitions
or `None`.
"""
@tf.function
def train_step(info_states, action_probs, iterations, masks):
model = self._policy_network
... | [
"def",
"_learn_strategy_network",
"(",
"self",
")",
":",
"@",
"tf",
".",
"function",
"def",
"train_step",
"(",
"info_states",
",",
"action_probs",
",",
"iterations",
",",
"masks",
")",
":",
"model",
"=",
"self",
".",
"_policy_network",
"with",
"tf",
".",
"... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/deep_cfr_tf2.py#L709-L735 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | com/win32com/server/policy.py | python | BasicWrapPolicy._query_interface_ | (self, iid) | return 0 | Called if the object does not provide the requested interface in _com_interfaces_,
and does not provide a _query_interface_ handler.
Returns a result to the COM framework indicating the interface is not supported. | Called if the object does not provide the requested interface in _com_interfaces_,
and does not provide a _query_interface_ handler. | [
"Called",
"if",
"the",
"object",
"does",
"not",
"provide",
"the",
"requested",
"interface",
"in",
"_com_interfaces_",
"and",
"does",
"not",
"provide",
"a",
"_query_interface_",
"handler",
"."
] | def _query_interface_(self, iid):
"""Called if the object does not provide the requested interface in _com_interfaces_,
and does not provide a _query_interface_ handler.
Returns a result to the COM framework indicating the interface is not supported.
"""
return 0 | [
"def",
"_query_interface_",
"(",
"self",
",",
"iid",
")",
":",
"return",
"0"
] | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32com/server/policy.py#L281-L287 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | HelpProvider.RemoveHelp | (*args, **kwargs) | return _controls_.HelpProvider_RemoveHelp(*args, **kwargs) | RemoveHelp(self, Window window)
Removes the association between the window pointer and the help
text. This is called by the wx.Window destructor. Without this, the
table of help strings will fill up and when window pointers are
reused, the wrong help string will be found. | RemoveHelp(self, Window window) | [
"RemoveHelp",
"(",
"self",
"Window",
"window",
")"
] | def RemoveHelp(*args, **kwargs):
"""
RemoveHelp(self, Window window)
Removes the association between the window pointer and the help
text. This is called by the wx.Window destructor. Without this, the
table of help strings will fill up and when window pointers are
reused... | [
"def",
"RemoveHelp",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"HelpProvider_RemoveHelp",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L6294-L6303 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py | python | convert_broadcast_mul | (node, **kwargs) | return create_basic_op_node('Mul', node, kwargs) | Map MXNet's broadcast_mul operator attributes to onnx's Mul operator
and return the created node. | Map MXNet's broadcast_mul operator attributes to onnx's Mul operator
and return the created node. | [
"Map",
"MXNet",
"s",
"broadcast_mul",
"operator",
"attributes",
"to",
"onnx",
"s",
"Mul",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_broadcast_mul(node, **kwargs):
"""Map MXNet's broadcast_mul operator attributes to onnx's Mul operator
and return the created node.
"""
return create_basic_op_node('Mul', node, kwargs) | [
"def",
"convert_broadcast_mul",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"create_basic_op_node",
"(",
"'Mul'",
",",
"node",
",",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py#L1687-L1691 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetCflagsC | (self, config) | return self._GetPchFlags(config, '.c') | Returns the flags that need to be added to .c compilations. | Returns the flags that need to be added to .c compilations. | [
"Returns",
"the",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
".",
"c",
"compilations",
"."
] | def GetCflagsC(self, config):
"""Returns the flags that need to be added to .c compilations."""
config = self._TargetConfig(config)
return self._GetPchFlags(config, '.c') | [
"def",
"GetCflagsC",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"return",
"self",
".",
"_GetPchFlags",
"(",
"config",
",",
"'.c'",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/msvs_emulation.py#L511-L514 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/global_notification.py | python | GlobalNotification.ttl | (self) | return self._ttl | Gets the ttl of this GlobalNotification. # noqa: E501
:return: The ttl of this GlobalNotification. # noqa: E501
:rtype: float | Gets the ttl of this GlobalNotification. # noqa: E501 | [
"Gets",
"the",
"ttl",
"of",
"this",
"GlobalNotification",
".",
"#",
"noqa",
":",
"E501"
] | def ttl(self):
"""Gets the ttl of this GlobalNotification. # noqa: E501
:return: The ttl of this GlobalNotification. # noqa: E501
:rtype: float
"""
return self._ttl | [
"def",
"ttl",
"(",
"self",
")",
":",
"return",
"self",
".",
"_ttl"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/global_notification.py#L182-L189 | |
twtygqyy/caffe-augmentation | c76600d247e5132fa5bd89d87bb5df458341fa84 | scripts/cpp_lint.py | python | _IncludeState.IsInAlphabeticalOrder | (self, clean_lines, linenum, header_path) | return True | Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be checked.
Returns:
Returns true if the header is in alphabetical order. | Check if a header is in alphabetical order with the previous header. | [
"Check",
"if",
"a",
"header",
"is",
"in",
"alphabetical",
"order",
"with",
"the",
"previous",
"header",
"."
] | def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
"""Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be checke... | [
"def",
"IsInAlphabeticalOrder",
"(",
"self",
",",
"clean_lines",
",",
"linenum",
",",
"header_path",
")",
":",
"# If previous section is different from current section, _last_header will",
"# be reset to empty string, so it's always less than current header.",
"#",
"# If previous line ... | https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/scripts/cpp_lint.py#L616-L635 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/ext.py | python | Extension.preprocess | (self, source, name, filename=None) | return source | This method is called before the actual lexing and can be used to
preprocess the source. The `filename` is optional. The return value
must be the preprocessed source. | This method is called before the actual lexing and can be used to
preprocess the source. The `filename` is optional. The return value
must be the preprocessed source. | [
"This",
"method",
"is",
"called",
"before",
"the",
"actual",
"lexing",
"and",
"can",
"be",
"used",
"to",
"preprocess",
"the",
"source",
".",
"The",
"filename",
"is",
"optional",
".",
"The",
"return",
"value",
"must",
"be",
"the",
"preprocessed",
"source",
... | def preprocess(self, source, name, filename=None):
"""This method is called before the actual lexing and can be used to
preprocess the source. The `filename` is optional. The return value
must be the preprocessed source.
"""
return source | [
"def",
"preprocess",
"(",
"self",
",",
"source",
",",
"name",
",",
"filename",
"=",
"None",
")",
":",
"return",
"source"
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/ext.py#L80-L85 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/scripts/analyze_dxp.py | python | has_pairs | (profile) | return len(profile) > 0 and isinstance(profile[0], list) | Returns True if the Python that produced the argument profile
was built with -DDXPAIRS. | Returns True if the Python that produced the argument profile
was built with -DDXPAIRS. | [
"Returns",
"True",
"if",
"the",
"Python",
"that",
"produced",
"the",
"argument",
"profile",
"was",
"built",
"with",
"-",
"DDXPAIRS",
"."
] | def has_pairs(profile):
"""Returns True if the Python that produced the argument profile
was built with -DDXPAIRS."""
return len(profile) > 0 and isinstance(profile[0], list) | [
"def",
"has_pairs",
"(",
"profile",
")",
":",
"return",
"len",
"(",
"profile",
")",
">",
"0",
"and",
"isinstance",
"(",
"profile",
"[",
"0",
"]",
",",
"list",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/scripts/analyze_dxp.py#L39-L43 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Point2D.GetRounded | (*args, **kwargs) | return _core_.Point2D_GetRounded(*args, **kwargs) | GetRounded() -> (x,y)
Convert to integer | GetRounded() -> (x,y) | [
"GetRounded",
"()",
"-",
">",
"(",
"x",
"y",
")"
] | def GetRounded(*args, **kwargs):
"""
GetRounded() -> (x,y)
Convert to integer
"""
return _core_.Point2D_GetRounded(*args, **kwargs) | [
"def",
"GetRounded",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Point2D_GetRounded",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1664-L1670 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/_pyio.py | python | IOBase.tell | (self) | return self.seek(0, 1) | Return current stream position. | Return current stream position. | [
"Return",
"current",
"stream",
"position",
"."
] | def tell(self):
"""Return current stream position."""
return self.seek(0, 1) | [
"def",
"tell",
"(",
"self",
")",
":",
"return",
"self",
".",
"seek",
"(",
"0",
",",
"1",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/_pyio.py#L322-L324 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/summary/summary_iterator.py | python | SummaryWriter.close | (self) | Flushes the event file to disk and close the file.
Call this method when you do not need the summary writer anymore. | Flushes the event file to disk and close the file. | [
"Flushes",
"the",
"event",
"file",
"to",
"disk",
"and",
"close",
"the",
"file",
"."
] | def close(self):
"""Flushes the event file to disk and close the file.
Call this method when you do not need the summary writer anymore.
"""
self.flush()
self._ev_writer.Close()
self._closed = True | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"flush",
"(",
")",
"self",
".",
"_ev_writer",
".",
"Close",
"(",
")",
"self",
".",
"_closed",
"=",
"True"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/summary/summary_iterator.py#L279-L286 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_KeyValue.py | python | KeyValue.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:
_x = self.key
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
if python3:
buff.write(struct.pack('<I%sB... | [
"def",
"serialize",
"(",
"self",
",",
"buff",
")",
":",
"try",
":",
"_x",
"=",
"self",
".",
"key",
"length",
"=",
"len",
"(",
"_x",
")",
"if",
"python3",
"or",
"type",
"(",
"_x",
")",
"==",
"unicode",
":",
"_x",
"=",
"_x",
".",
"encode",
"(",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_KeyValue.py#L56-L81 | ||
TheImagingSource/tiscamera | baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6 | tools/tcam-capture/tcam_capture/TcamView.py | python | TcamView.fire_device_lost | (self) | Notify all callback that our device is gone | Notify all callback that our device is gone | [
"Notify",
"all",
"callback",
"that",
"our",
"device",
"is",
"gone"
] | def fire_device_lost(self):
"""
Notify all callback that our device is gone
"""
for cb in self.device_lost_callbacks:
cb() | [
"def",
"fire_device_lost",
"(",
"self",
")",
":",
"for",
"cb",
"in",
"self",
".",
"device_lost_callbacks",
":",
"cb",
"(",
")"
] | https://github.com/TheImagingSource/tiscamera/blob/baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6/tools/tcam-capture/tcam_capture/TcamView.py#L519-L524 | ||
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | thirdparty/gflags/gflags.py | python | FlagValues.__RenderOurModuleKeyFlags | (self, module, output_lines, prefix="") | Generates a help string for the key flags of a given module.
Args:
module: A module object or a module name (a string).
output_lines: A list of strings. The generated help message
lines will be appended to this list.
prefix: A string that is prepended to each generated help line. | Generates a help string for the key flags of a given module. | [
"Generates",
"a",
"help",
"string",
"for",
"the",
"key",
"flags",
"of",
"a",
"given",
"module",
"."
] | def __RenderOurModuleKeyFlags(self, module, output_lines, prefix=""):
"""Generates a help string for the key flags of a given module.
Args:
module: A module object or a module name (a string).
output_lines: A list of strings. The generated help message
lines will be appended to this list.
... | [
"def",
"__RenderOurModuleKeyFlags",
"(",
"self",
",",
"module",
",",
"output_lines",
",",
"prefix",
"=",
"\"\"",
")",
":",
"key_flags",
"=",
"self",
".",
"_GetKeyFlagsForModule",
"(",
"module",
")",
"if",
"key_flags",
":",
"self",
".",
"__RenderModuleFlags",
"... | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/thirdparty/gflags/gflags.py#L1335-L1346 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/runpy.py | python | _run_code | (code, run_globals, init_globals=None,
mod_name=None, mod_fname=None,
mod_loader=None, pkg_name=None) | return run_globals | Helper for _run_module_code | Helper for _run_module_code | [
"Helper",
"for",
"_run_module_code"
] | def _run_code(code, run_globals, init_globals=None,
mod_name=None, mod_fname=None,
mod_loader=None, pkg_name=None):
"""Helper for _run_module_code"""
if init_globals is not None:
run_globals.update(init_globals)
run_globals.update(__name__ = mod_name,
... | [
"def",
"_run_code",
"(",
"code",
",",
"run_globals",
",",
"init_globals",
"=",
"None",
",",
"mod_name",
"=",
"None",
",",
"mod_fname",
"=",
"None",
",",
"mod_loader",
"=",
"None",
",",
"pkg_name",
"=",
"None",
")",
":",
"if",
"init_globals",
"is",
"not",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/runpy.py#L24-L35 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/WebIDL.py | python | Parser.p_TypeSuffixStartingWithArrayEmpty | (self, p) | TypeSuffixStartingWithArray : | TypeSuffixStartingWithArray : | [
"TypeSuffixStartingWithArray",
":"
] | def p_TypeSuffixStartingWithArrayEmpty(self, p):
"""
TypeSuffixStartingWithArray :
"""
p[0] = [] | [
"def",
"p_TypeSuffixStartingWithArrayEmpty",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"]"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/WebIDL.py#L4816-L4820 | ||
sc0ty/subsync | be5390d00ff475b6543eb0140c7e65b34317d95b | subsync/assets/assetlist.py | python | AssetList.hasUpdate | (self) | return AssetList([ a for a in self if a.hasUpdate() ]) | Get assets that could be updated (as new `AssetList`).
These assets are available on asset server and are not installed locally
or remote version are newer than local (based on version number). | Get assets that could be updated (as new `AssetList`). | [
"Get",
"assets",
"that",
"could",
"be",
"updated",
"(",
"as",
"new",
"AssetList",
")",
"."
] | def hasUpdate(self):
"""Get assets that could be updated (as new `AssetList`).
These assets are available on asset server and are not installed locally
or remote version are newer than local (based on version number).
"""
return AssetList([ a for a in self if a.hasUpdate() ]) | [
"def",
"hasUpdate",
"(",
"self",
")",
":",
"return",
"AssetList",
"(",
"[",
"a",
"for",
"a",
"in",
"self",
"if",
"a",
".",
"hasUpdate",
"(",
")",
"]",
")"
] | https://github.com/sc0ty/subsync/blob/be5390d00ff475b6543eb0140c7e65b34317d95b/subsync/assets/assetlist.py#L20-L26 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TInt.IsEven | (*args) | return _snap.TInt_IsEven(*args) | IsEven(int const & Int) -> bool
Parameters:
Int: int const & | IsEven(int const & Int) -> bool | [
"IsEven",
"(",
"int",
"const",
"&",
"Int",
")",
"-",
">",
"bool"
] | def IsEven(*args):
"""
IsEven(int const & Int) -> bool
Parameters:
Int: int const &
"""
return _snap.TInt_IsEven(*args) | [
"def",
"IsEven",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TInt_IsEven",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L13143-L13151 | |
zhaoweicai/hwgq | ebc706bee3e2d145de1da4be446ce8de8740738f | python/caffe/pycaffe.py | python | _Net_backward | (self, diffs=None, start=None, end=None, **kwargs) | return {out: self.blobs[out].diff for out in outputs} | Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If None, top diffs are taken from forward loss.
start : optional name of layer at w... | Backward pass: prepare diffs and run the net backward. | [
"Backward",
"pass",
":",
"prepare",
"diffs",
"and",
"run",
"the",
"net",
"backward",
"."
] | def _Net_backward(self, diffs=None, start=None, end=None, **kwargs):
"""
Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If Non... | [
"def",
"_Net_backward",
"(",
"self",
",",
"diffs",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"diffs",
"is",
"None",
":",
"diffs",
"=",
"[",
"]",
"if",
"start",
"is",
"not",
"None",
... | https://github.com/zhaoweicai/hwgq/blob/ebc706bee3e2d145de1da4be446ce8de8740738f/python/caffe/pycaffe.py#L127-L172 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/glcanvas.py | python | GLCanvas.SwapBuffers | (*args, **kwargs) | return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs) | SwapBuffers(self) -> bool | SwapBuffers(self) -> bool | [
"SwapBuffers",
"(",
"self",
")",
"-",
">",
"bool"
] | def SwapBuffers(*args, **kwargs):
"""SwapBuffers(self) -> bool"""
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs) | [
"def",
"SwapBuffers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_glcanvas",
".",
"GLCanvas_SwapBuffers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/glcanvas.py#L122-L124 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/validators.py | python | check_to_device_send | (method) | return new_method | Check the input arguments of send function for TransferDataset. | Check the input arguments of send function for TransferDataset. | [
"Check",
"the",
"input",
"arguments",
"of",
"send",
"function",
"for",
"TransferDataset",
"."
] | def check_to_device_send(method):
"""Check the input arguments of send function for TransferDataset."""
@wraps(method)
def new_method(self, *args, **kwargs):
[num_epochs], _ = parse_user_args(method, *args, **kwargs)
if num_epochs is not None:
type_check(num_epochs, (int,), "nu... | [
"def",
"check_to_device_send",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"num_epochs",
"]",
",",
"_",
"=",
"parse_user_args",
"(",
"method",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L1856-L1869 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/onnx2mx/_op_translations.py | python | greater | (attrs, inputs, proto_obj) | return 'broadcast_greater', attrs, inputs | Logical Greater operator with broadcasting. | Logical Greater operator with broadcasting. | [
"Logical",
"Greater",
"operator",
"with",
"broadcasting",
"."
] | def greater(attrs, inputs, proto_obj):
"""Logical Greater operator with broadcasting."""
return 'broadcast_greater', attrs, inputs | [
"def",
"greater",
"(",
"attrs",
",",
"inputs",
",",
"proto_obj",
")",
":",
"return",
"'broadcast_greater'",
",",
"attrs",
",",
"inputs"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L196-L198 | |
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/operators/activation.py | python | LRelu | (inputs, slope=0.2, **kwargs) | return output | Leaky Rectified Linear Unit function.
Parameters
----------
inputs : Tensor
The input tensor.
slope : float
The slope of negative side.
Returns
-------
Tensor
The output tensor, calculated as: |lrelu_function|. | Leaky Rectified Linear Unit function. | [
"Leaky",
"Rectified",
"Linear",
"Unit",
"function",
"."
] | def LRelu(inputs, slope=0.2, **kwargs):
"""Leaky Rectified Linear Unit function.
Parameters
----------
inputs : Tensor
The input tensor.
slope : float
The slope of negative side.
Returns
-------
Tensor
The output tensor, calculated as: |lrelu_function|.
"""... | [
"def",
"LRelu",
"(",
"inputs",
",",
"slope",
"=",
"0.2",
",",
"*",
"*",
"kwargs",
")",
":",
"CheckInputs",
"(",
"inputs",
",",
"1",
")",
"arguments",
"=",
"ParseArguments",
"(",
"locals",
"(",
")",
")",
"output",
"=",
"Tensor",
".",
"CreateOperator",
... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/operators/activation.py#L39-L63 | |
ucbrise/clipper | 9f25e3fc7f8edc891615e81c5b80d3d8aed72608 | clipper_admin/clipper_admin/clipper_admin.py | python | ClipperConnection.unlink_model_from_app | (self, app_name, model_name) | Prevents the model with `model_name` from being used by the app with `app_name`.
The model and app should both be registered with Clipper and a link should
already exist between them.
Parameters
----------
app_name : str
The name of the application
model_name... | Prevents the model with `model_name` from being used by the app with `app_name`.
The model and app should both be registered with Clipper and a link should
already exist between them. | [
"Prevents",
"the",
"model",
"with",
"model_name",
"from",
"being",
"used",
"by",
"the",
"app",
"with",
"app_name",
".",
"The",
"model",
"and",
"app",
"should",
"both",
"be",
"registered",
"with",
"Clipper",
"and",
"a",
"link",
"should",
"already",
"exist",
... | def unlink_model_from_app(self, app_name, model_name):
"""
Prevents the model with `model_name` from being used by the app with `app_name`.
The model and app should both be registered with Clipper and a link should
already exist between them.
Parameters
----------
... | [
"def",
"unlink_model_from_app",
"(",
"self",
",",
"app_name",
",",
"model_name",
")",
":",
"if",
"not",
"self",
".",
"connected",
":",
"raise",
"UnconnectedException",
"(",
")",
"url",
"=",
"\"http://{host}/admin/delete_model_links\"",
".",
"format",
"(",
"host",
... | https://github.com/ucbrise/clipper/blob/9f25e3fc7f8edc891615e81c5b80d3d8aed72608/clipper_admin/clipper_admin/clipper_admin.py#L305-L344 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Point2D.GetVectorAngle | (*args, **kwargs) | return _core_.Point2D_GetVectorAngle(*args, **kwargs) | GetVectorAngle(self) -> double | GetVectorAngle(self) -> double | [
"GetVectorAngle",
"(",
"self",
")",
"-",
">",
"double"
] | def GetVectorAngle(*args, **kwargs):
"""GetVectorAngle(self) -> double"""
return _core_.Point2D_GetVectorAngle(*args, **kwargs) | [
"def",
"GetVectorAngle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Point2D_GetVectorAngle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1676-L1678 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Utilities/Sphinx/sphinx_apidoc.py | python | create_modules_toc_file | (modules, opts, name='modules') | Create the module's index. | Create the module's index. | [
"Create",
"the",
"module",
"s",
"index",
"."
] | def create_modules_toc_file(modules, opts, name='modules'):
"""Create the module's index."""
text = format_heading(1, '%s' % opts.header)
text += '.. toctree::\n'
text += ' :maxdepth: %s\n\n' % opts.maxdepth
modules.sort()
prev_module = ''
for module in modules:
# look if the modu... | [
"def",
"create_modules_toc_file",
"(",
"modules",
",",
"opts",
",",
"name",
"=",
"'modules'",
")",
":",
"text",
"=",
"format_heading",
"(",
"1",
",",
"'%s'",
"%",
"opts",
".",
"header",
")",
"text",
"+=",
"'.. toctree::\\n'",
"text",
"+=",
"' :maxdepth: %s... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Utilities/Sphinx/sphinx_apidoc.py#L241-L256 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel._merge_node_groups | (self, node_groups, suppress_warnings=False) | Merge nodes in the given node groups.
This updates node field and node set field values with the average of
the values at the merged nodes. If they differ, a warning is output in
addition.
Node sets and node set fields are updated accordingly.
Example:
>>> model._merg... | Merge nodes in the given node groups. | [
"Merge",
"nodes",
"in",
"the",
"given",
"node",
"groups",
"."
] | def _merge_node_groups(self, node_groups, suppress_warnings=False):
"""
Merge nodes in the given node groups.
This updates node field and node set field values with the average of
the values at the merged nodes. If they differ, a warning is output in
addition.
Node set... | [
"def",
"_merge_node_groups",
"(",
"self",
",",
"node_groups",
",",
"suppress_warnings",
"=",
"False",
")",
":",
"# ensure slave nodes are not duplicated",
"slave_nodes_set",
"=",
"set",
"(",
")",
"duplicated_slave_nodes",
"=",
"set",
"(",
")",
"for",
"master",
",",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L7003-L7189 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | cmake/tribits/doc/sphinx/sphinx_rst_generator.py | python | SphinxRstGenerator.save_rst | (file_path: str, file_content: str) | Saves .rst file with given pathh and content | Saves .rst file with given pathh and content | [
"Saves",
".",
"rst",
"file",
"with",
"given",
"pathh",
"and",
"content"
] | def save_rst(file_path: str, file_content: str) -> None:
""" Saves .rst file with given pathh and content
"""
with open(file_path, 'w') as dest_file:
dest_file.write(file_content) | [
"def",
"save_rst",
"(",
"file_path",
":",
"str",
",",
"file_content",
":",
"str",
")",
"->",
"None",
":",
"with",
"open",
"(",
"file_path",
",",
"'w'",
")",
"as",
"dest_file",
":",
"dest_file",
".",
"write",
"(",
"file_content",
")"
] | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/cmake/tribits/doc/sphinx/sphinx_rst_generator.py#L161-L165 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/generator.py | python | _CppSourceFileWriter.gen_string_constants_definitions | (self, struct) | Generate a StringData constant for field name in the cpp file. | Generate a StringData constant for field name in the cpp file. | [
"Generate",
"a",
"StringData",
"constant",
"for",
"field",
"name",
"in",
"the",
"cpp",
"file",
"."
] | def gen_string_constants_definitions(self, struct):
# type: (ast.Struct) -> None
# pylint: disable=invalid-name
"""Generate a StringData constant for field name in the cpp file."""
# Generate a sorted list of string constants
sorted_fields = sorted([field for field in struct.fi... | [
"def",
"gen_string_constants_definitions",
"(",
"self",
",",
"struct",
")",
":",
"# type: (ast.Struct) -> None",
"# pylint: disable=invalid-name",
"# Generate a sorted list of string constants",
"sorted_fields",
"=",
"sorted",
"(",
"[",
"field",
"for",
"field",
"in",
"struct"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/generator.py#L1334-L1354 | ||
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/decoder.py | python | _EndGroup | (buffer, pos, end) | return -1 | Skipping an END_GROUP tag returns -1 to tell the parent loop to break. | Skipping an END_GROUP tag returns -1 to tell the parent loop to break. | [
"Skipping",
"an",
"END_GROUP",
"tag",
"returns",
"-",
"1",
"to",
"tell",
"the",
"parent",
"loop",
"to",
"break",
"."
] | def _EndGroup(buffer, pos, end):
"""Skipping an END_GROUP tag returns -1 to tell the parent loop to break."""
return -1 | [
"def",
"_EndGroup",
"(",
"buffer",
",",
"pos",
",",
"end",
")",
":",
"return",
"-",
"1"
] | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/decoder.py#L669-L672 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/execution.py | python | Execution.symbol | (self, symbol) | Sets the symbol of this Execution.
:param symbol: The symbol of this Execution. # noqa: E501
:type: str | Sets the symbol of this Execution. | [
"Sets",
"the",
"symbol",
"of",
"this",
"Execution",
"."
] | def symbol(self, symbol):
"""Sets the symbol of this Execution.
:param symbol: The symbol of this Execution. # noqa: E501
:type: str
"""
self._symbol = symbol | [
"def",
"symbol",
"(",
"self",
",",
"symbol",
")",
":",
"self",
".",
"_symbol",
"=",
"symbol"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/execution.py#L397-L405 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tix.py | python | Grid.entrycget | (self, x, y, option) | return self.tk.call(self, 'entrycget', x, y, option) | Get the option value for cell at (x,y) | Get the option value for cell at (x,y) | [
"Get",
"the",
"option",
"value",
"for",
"cell",
"at",
"(",
"x",
"y",
")"
] | def entrycget(self, x, y, option):
"Get the option value for cell at (x,y)"
if option and option[0] != '-':
option = '-' + option
return self.tk.call(self, 'entrycget', x, y, option) | [
"def",
"entrycget",
"(",
"self",
",",
"x",
",",
"y",
",",
"option",
")",
":",
"if",
"option",
"and",
"option",
"[",
"0",
"]",
"!=",
"'-'",
":",
"option",
"=",
"'-'",
"+",
"option",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
",",
"'e... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tix.py#L1856-L1860 | |
mavlink/mavros | a32232d57a5e91abf6737e454d4199cae29b369c | mavros/mavros/param.py | python | ParamPlugin.cli_pull | (self) | return self.create_client(ParamPull, ("param", "pull")) | Client for ParamPull service. | Client for ParamPull service. | [
"Client",
"for",
"ParamPull",
"service",
"."
] | def cli_pull(self) -> rclpy.node.Client:
"""Client for ParamPull service."""
return self.create_client(ParamPull, ("param", "pull")) | [
"def",
"cli_pull",
"(",
"self",
")",
"->",
"rclpy",
".",
"node",
".",
"Client",
":",
"return",
"self",
".",
"create_client",
"(",
"ParamPull",
",",
"(",
"\"param\"",
",",
"\"pull\"",
")",
")"
] | https://github.com/mavlink/mavros/blob/a32232d57a5e91abf6737e454d4199cae29b369c/mavros/mavros/param.py#L185-L187 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/zipfile.py | python | ZipFile.testzip | (self) | Read all the files and check the CRC. | Read all the files and check the CRC. | [
"Read",
"all",
"the",
"files",
"and",
"check",
"the",
"CRC",
"."
] | def testzip(self):
"""Read all the files and check the CRC."""
chunk_size = 2 ** 20
for zinfo in self.filelist:
try:
# Read by chunks, to avoid an OverflowError or a
# MemoryError with very large embedded files.
with self.open(zinfo.fil... | [
"def",
"testzip",
"(",
"self",
")",
":",
"chunk_size",
"=",
"2",
"**",
"20",
"for",
"zinfo",
"in",
"self",
".",
"filelist",
":",
"try",
":",
"# Read by chunks, to avoid an OverflowError or a",
"# MemoryError with very large embedded files.",
"with",
"self",
".",
"op... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/zipfile.py#L887-L898 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/distutils/fcompiler/pg.py | python | PGroupFlangCompiler.get_library_dirs | (self) | return opt | List of compiler library directories. | List of compiler library directories. | [
"List",
"of",
"compiler",
"library",
"directories",
"."
] | def get_library_dirs(self):
"""List of compiler library directories."""
opt = FCompiler.get_library_dirs(self)
flang_dir = dirname(self.executables['compiler_f77'][0])
opt.append(normpath(join(flang_dir, '..', 'lib')))
return opt | [
"def",
"get_library_dirs",
"(",
"self",
")",
":",
"opt",
"=",
"FCompiler",
".",
"get_library_dirs",
"(",
"self",
")",
"flang_dir",
"=",
"dirname",
"(",
"self",
".",
"executables",
"[",
"'compiler_f77'",
"]",
"[",
"0",
"]",
")",
"opt",
".",
"append",
"(",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/distutils/fcompiler/pg.py#L94-L100 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathSurface.py | python | SetupProperties | () | return [tup[1] for tup in ObjectSurface.opPropertyDefinitions(False)] | SetupProperties() ... Return list of properties required for operation. | SetupProperties() ... Return list of properties required for operation. | [
"SetupProperties",
"()",
"...",
"Return",
"list",
"of",
"properties",
"required",
"for",
"operation",
"."
] | def SetupProperties():
"""SetupProperties() ... Return list of properties required for operation."""
return [tup[1] for tup in ObjectSurface.opPropertyDefinitions(False)] | [
"def",
"SetupProperties",
"(",
")",
":",
"return",
"[",
"tup",
"[",
"1",
"]",
"for",
"tup",
"in",
"ObjectSurface",
".",
"opPropertyDefinitions",
"(",
"False",
")",
"]"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathSurface.py#L2747-L2749 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/models.py | python | Response.raise_for_status | (self) | Raises stored :class:`HTTPError`, if one occurred. | Raises stored :class:`HTTPError`, if one occurred. | [
"Raises",
"stored",
":",
"class",
":",
"HTTPError",
"if",
"one",
"occurred",
"."
] | def raise_for_status(self):
"""Raises stored :class:`HTTPError`, if one occurred."""
http_error_msg = ''
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn'... | [
"def",
"raise_for_status",
"(",
"self",
")",
":",
"http_error_msg",
"=",
"''",
"if",
"isinstance",
"(",
"self",
".",
"reason",
",",
"bytes",
")",
":",
"# We attempt to decode utf-8 first because some servers",
"# choose to localize their reason strings. If the string",
"# i... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/models.py#L918-L941 | ||
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/python_message.py | python | _BytesForNonRepeatedElement | (value, field_number, field_type) | Returns the number of bytes needed to serialize a non-repeated element.
The returned byte count includes space for tag information and any
other additional space associated with serializing value.
Args:
value: Value we're serializing.
field_number: Field number of this value. (Since the field number
... | Returns the number of bytes needed to serialize a non-repeated element.
The returned byte count includes space for tag information and any
other additional space associated with serializing value. | [
"Returns",
"the",
"number",
"of",
"bytes",
"needed",
"to",
"serialize",
"a",
"non",
"-",
"repeated",
"element",
".",
"The",
"returned",
"byte",
"count",
"includes",
"space",
"for",
"tag",
"information",
"and",
"any",
"other",
"additional",
"space",
"associated... | def _BytesForNonRepeatedElement(value, field_number, field_type):
"""Returns the number of bytes needed to serialize a non-repeated element.
The returned byte count includes space for tag information and any
other additional space associated with serializing value.
Args:
value: Value we're serializing.
... | [
"def",
"_BytesForNonRepeatedElement",
"(",
"value",
",",
"field_number",
",",
"field_type",
")",
":",
"try",
":",
"fn",
"=",
"type_checkers",
".",
"TYPE_TO_BYTE_SIZE_FN",
"[",
"field_type",
"]",
"return",
"fn",
"(",
"field_number",
",",
"value",
")",
"except",
... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/python_message.py#L716-L733 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/preprocessor.py | python | Expression.__strip | (self, length) | Remove a given amount of chars from the input and update
the offset. | Remove a given amount of chars from the input and update
the offset. | [
"Remove",
"a",
"given",
"amount",
"of",
"chars",
"from",
"the",
"input",
"and",
"update",
"the",
"offset",
"."
] | def __strip(self, length):
"""
Remove a given amount of chars from the input and update
the offset.
"""
self.content = self.content[length:]
self.offset += length | [
"def",
"__strip",
"(",
"self",
",",
"length",
")",
":",
"self",
".",
"content",
"=",
"self",
".",
"content",
"[",
"length",
":",
"]",
"self",
".",
"offset",
"+=",
"length"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/preprocessor.py#L171-L177 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/platform.py | python | architecture | (executable=sys.executable, bits='', linkage='') | return bits, linkage | Queries the given executable (defaults to the Python interpreter
binary) for various architecture information.
Returns a tuple (bits, linkage) which contains information about
the bit architecture and the linkage format used for the
executable. Both values are returned as strings.
... | Queries the given executable (defaults to the Python interpreter
binary) for various architecture information. | [
"Queries",
"the",
"given",
"executable",
"(",
"defaults",
"to",
"the",
"Python",
"interpreter",
"binary",
")",
"for",
"various",
"architecture",
"information",
"."
] | def architecture(executable=sys.executable, bits='', linkage=''):
""" Queries the given executable (defaults to the Python interpreter
binary) for various architecture information.
Returns a tuple (bits, linkage) which contains information about
the bit architecture and the linkage format ... | [
"def",
"architecture",
"(",
"executable",
"=",
"sys",
".",
"executable",
",",
"bits",
"=",
"''",
",",
"linkage",
"=",
"''",
")",
":",
"# Use the sizeof(pointer) as default number of bits if nothing",
"# else is given as default.",
"if",
"not",
"bits",
":",
"import",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/platform.py#L650-L726 | |
ltcmelo/psychec | 46672204681d73b40772a7bf24137dca23175e81 | cnippet/wrapper/Python/CCompilerFacade.py | python | CCompilerFacade.preprocess | (self, c_file_name, pp_file_name) | Preprocess the file. | Preprocess the file. | [
"Preprocess",
"the",
"file",
"."
] | def preprocess(self, c_file_name, pp_file_name):
"""
Preprocess the file.
"""
cmd = [self.cc,
'-E',
'-x',
'c',
c_file_name,
'-o',
pp_file_name]
cmd += CCompilerFacade.defined_macros('-D')
... | [
"def",
"preprocess",
"(",
"self",
",",
"c_file_name",
",",
"pp_file_name",
")",
":",
"cmd",
"=",
"[",
"self",
".",
"cc",
",",
"'-E'",
",",
"'-x'",
",",
"'c'",
",",
"c_file_name",
",",
"'-o'",
",",
"pp_file_name",
"]",
"cmd",
"+=",
"CCompilerFacade",
".... | https://github.com/ltcmelo/psychec/blob/46672204681d73b40772a7bf24137dca23175e81/cnippet/wrapper/Python/CCompilerFacade.py#L141-L163 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBBreakpoint.SetCondition | (self, *args) | return _lldb.SBBreakpoint_SetCondition(self, *args) | SetCondition(self, str condition)
The breakpoint stops only if the condition expression evaluates to true. | SetCondition(self, str condition) | [
"SetCondition",
"(",
"self",
"str",
"condition",
")"
] | def SetCondition(self, *args):
"""
SetCondition(self, str condition)
The breakpoint stops only if the condition expression evaluates to true.
"""
return _lldb.SBBreakpoint_SetCondition(self, *args) | [
"def",
"SetCondition",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBBreakpoint_SetCondition",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1506-L1512 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/hypertreelist.py | python | TreeListMainWindow.OnEditTimer | (self) | The timer for editing has expired. Start editing. | The timer for editing has expired. Start editing. | [
"The",
"timer",
"for",
"editing",
"has",
"expired",
".",
"Start",
"editing",
"."
] | def OnEditTimer(self):
""" The timer for editing has expired. Start editing. """
self.EditLabel(self._current, self._curColumn) | [
"def",
"OnEditTimer",
"(",
"self",
")",
":",
"self",
".",
"EditLabel",
"(",
"self",
".",
"_current",
",",
"self",
".",
"_curColumn",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hypertreelist.py#L3393-L3396 | ||
OAID/Tengine | 66b2c22ad129d25e2fc6de3b22a608bb54dd90db | tools/optimize/yolov5s-opt.py | python | main | () | main function | main function | [
"main",
"function"
] | def main():
"""
main function
"""
print("---- Tengine YOLOv5 Optimize Tool ----\n")
if args == None or args.input == None:
usage_info()
return None
print("Input model : %s" % (args.input))
print("Output model : %s" % (args.output))
print("Input tensor : %s"... | [
"def",
"main",
"(",
")",
":",
"print",
"(",
"\"---- Tengine YOLOv5 Optimize Tool ----\\n\"",
")",
"if",
"args",
"==",
"None",
"or",
"args",
".",
"input",
"==",
"None",
":",
"usage_info",
"(",
")",
"return",
"None",
"print",
"(",
"\"Input model : %s\"",
"%... | https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/tools/optimize/yolov5s-opt.py#L153-L219 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xpathContext.functionURI | (self) | return ret | Get the current function name URI xpathContext | Get the current function name URI xpathContext | [
"Get",
"the",
"current",
"function",
"name",
"URI",
"xpathContext"
] | def functionURI(self):
"""Get the current function name URI xpathContext """
ret = libxml2mod.xmlXPathGetFunctionURI(self._o)
return ret | [
"def",
"functionURI",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlXPathGetFunctionURI",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L7286-L7289 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py | python | FSM.process | (self, input_symbol) | This is the main method that you call to process input. This may
cause the FSM to change state and call an action. This method calls
get_transition() to find the action and next_state associated with the
input_symbol and current_state. If the action is None then the action
is not called ... | This is the main method that you call to process input. This may
cause the FSM to change state and call an action. This method calls
get_transition() to find the action and next_state associated with the
input_symbol and current_state. If the action is None then the action
is not called ... | [
"This",
"is",
"the",
"main",
"method",
"that",
"you",
"call",
"to",
"process",
"input",
".",
"This",
"may",
"cause",
"the",
"FSM",
"to",
"change",
"state",
"and",
"call",
"an",
"action",
".",
"This",
"method",
"calls",
"get_transition",
"()",
"to",
"find... | def process (self, input_symbol):
'''This is the main method that you call to process input. This may
cause the FSM to change state and call an action. This method calls
get_transition() to find the action and next_state associated with the
input_symbol and current_state. If the action ... | [
"def",
"process",
"(",
"self",
",",
"input_symbol",
")",
":",
"self",
".",
"input_symbol",
"=",
"input_symbol",
"(",
"self",
".",
"action",
",",
"self",
".",
"next_state",
")",
"=",
"self",
".",
"get_transition",
"(",
"self",
".",
"input_symbol",
",",
"s... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/FSM.py#L228-L243 | ||
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | docs/custom_inheritance_diagram/btd/sphinx/inheritance_diagram.py | python | try_import | (objname: str) | Import a object or module using *name* and *currentmodule*.
*name* should be a relative name from *currentmodule* or
a fully-qualified name.
Returns imported object or module. If failed, returns None value. | Import a object or module using *name* and *currentmodule*.
*name* should be a relative name from *currentmodule* or
a fully-qualified name. | [
"Import",
"a",
"object",
"or",
"module",
"using",
"*",
"name",
"*",
"and",
"*",
"currentmodule",
"*",
".",
"*",
"name",
"*",
"should",
"be",
"a",
"relative",
"name",
"from",
"*",
"currentmodule",
"*",
"or",
"a",
"fully",
"-",
"qualified",
"name",
"."
] | def try_import(objname: str) -> Any:
"""Import a object or module using *name* and *currentmodule*.
*name* should be a relative name from *currentmodule* or
a fully-qualified name.
Returns imported object or module. If failed, returns None value.
"""
try:
return import_module(objname)
... | [
"def",
"try_import",
"(",
"objname",
":",
"str",
")",
"->",
"Any",
":",
"try",
":",
"return",
"import_module",
"(",
"objname",
")",
"except",
"TypeError",
":",
"# Relative import",
"return",
"None",
"except",
"ImportError",
":",
"matched",
"=",
"module_sig_re"... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/docs/custom_inheritance_diagram/btd/sphinx/inheritance_diagram.py#L77-L103 | ||
Komnomnomnom/swigibpy | cfd307fdbfaffabc69a2dc037538d7e34a8b8daf | swigibpy.py | python | TagValueList.erase | (self, *args) | return _swigibpy.TagValueList_erase(self, *args) | erase(TagValueList self, std::vector< shared_ptr< TagValue > >::iterator pos) -> std::vector< shared_ptr< TagValue > >::iterator
erase(TagValueList self, std::vector< shared_ptr< TagValue > >::iterator first, std::vector< shared_ptr< TagValue > >::iterator last) -> std::vector< shared_ptr< TagValue > >::iterato... | erase(TagValueList self, std::vector< shared_ptr< TagValue > >::iterator pos) -> std::vector< shared_ptr< TagValue > >::iterator
erase(TagValueList self, std::vector< shared_ptr< TagValue > >::iterator first, std::vector< shared_ptr< TagValue > >::iterator last) -> std::vector< shared_ptr< TagValue > >::iterato... | [
"erase",
"(",
"TagValueList",
"self",
"std",
"::",
"vector<",
"shared_ptr<",
"TagValue",
">",
">",
"::",
"iterator",
"pos",
")",
"-",
">",
"std",
"::",
"vector<",
"shared_ptr<",
"TagValue",
">",
">",
"::",
"iterator",
"erase",
"(",
"TagValueList",
"self",
... | def erase(self, *args):
"""
erase(TagValueList self, std::vector< shared_ptr< TagValue > >::iterator pos) -> std::vector< shared_ptr< TagValue > >::iterator
erase(TagValueList self, std::vector< shared_ptr< TagValue > >::iterator first, std::vector< shared_ptr< TagValue > >::iterator last) -> st... | [
"def",
"erase",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_swigibpy",
".",
"TagValueList_erase",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L814-L819 | |
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | tools/clang/tools/scan-build-py/libscanbuild/analyze.py | python | analyze_build | () | Entry point for analyze-build command. | Entry point for analyze-build command. | [
"Entry",
"point",
"for",
"analyze",
"-",
"build",
"command",
"."
] | def analyze_build():
""" Entry point for analyze-build command. """
args = parse_args_for_analyze_build()
# will re-assign the report directory as new output
with report_directory(args.output, args.keep_empty) as args.output:
# Run the analyzer against a compilation db.
govern_analyzer_... | [
"def",
"analyze_build",
"(",
")",
":",
"args",
"=",
"parse_args_for_analyze_build",
"(",
")",
"# will re-assign the report directory as new output",
"with",
"report_directory",
"(",
"args",
".",
"output",
",",
"args",
".",
"keep_empty",
")",
"as",
"args",
".",
"outp... | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/tools/scan-build-py/libscanbuild/analyze.py#L77-L88 | ||
amd/OpenCL-caffe | 638543108517265366c18ae5821f3096cf5cf34a | python/caffe/io.py | python | Transformer.set_mean | (self, in_, mean) | Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable) | Set the mean to subtract for centering the data. | [
"Set",
"the",
"mean",
"to",
"subtract",
"for",
"centering",
"the",
"data",
"."
] | def set_mean(self, in_, mean):
"""
Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable)
"""
self.__check_input(in_)
ms = mean.shape
... | [
"def",
"set_mean",
"(",
"self",
",",
"in_",
",",
"mean",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"ms",
"=",
"mean",
".",
"shape",
"if",
"mean",
".",
"ndim",
"==",
"1",
":",
"# broadcast channels",
"if",
"ms",
"[",
"0",
"]",
"!=",
... | https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/python/caffe/io.py#L232-L256 | ||
PaddlePaddle/PaddleOCR | b756bf5f8c90142e0d89d3db0163965c686b6ffe | ppstructure/table/table_metric/table_metric.py | python | TEDS.evaluate | (self, pred, true) | Computes TEDS score between the prediction and the ground truth of a
given sample | Computes TEDS score between the prediction and the ground truth of a
given sample | [
"Computes",
"TEDS",
"score",
"between",
"the",
"prediction",
"and",
"the",
"ground",
"truth",
"of",
"a",
"given",
"sample"
] | def evaluate(self, pred, true):
''' Computes TEDS score between the prediction and the ground truth of a
given sample
'''
if (not pred) or (not true):
return 0.0
parser = html.HTMLParser(remove_comments=True, encoding='utf-8')
pred = html.fromstring(pred, ... | [
"def",
"evaluate",
"(",
"self",
",",
"pred",
",",
"true",
")",
":",
"if",
"(",
"not",
"pred",
")",
"or",
"(",
"not",
"true",
")",
":",
"return",
"0.0",
"parser",
"=",
"html",
".",
"HTMLParser",
"(",
"remove_comments",
"=",
"True",
",",
"encoding",
... | https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppstructure/table/table_metric/table_metric.py#L176-L200 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | TimeSpan_Minutes | (*args, **kwargs) | return _misc_.TimeSpan_Minutes(*args, **kwargs) | TimeSpan_Minutes(long min) -> TimeSpan | TimeSpan_Minutes(long min) -> TimeSpan | [
"TimeSpan_Minutes",
"(",
"long",
"min",
")",
"-",
">",
"TimeSpan"
] | def TimeSpan_Minutes(*args, **kwargs):
"""TimeSpan_Minutes(long min) -> TimeSpan"""
return _misc_.TimeSpan_Minutes(*args, **kwargs) | [
"def",
"TimeSpan_Minutes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"TimeSpan_Minutes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4572-L4574 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.