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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vesoft-inc/nebula | 25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35 | .linters/cpp/cpplint.py | python | _NamespaceInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Check end of namespace comments. | Check end of namespace comments. | [
"Check",
"end",
"of",
"namespace",
"comments",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Check end of namespace comments."""
line = clean_lines.raw_lines[linenum]
# Check how many lines is enclosed in this namespace. Don't issue
# warning for missing namespace comments if there aren't enough
# lines. However, do apply chec... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"raw_lines",
"[",
"linenum",
"]",
"# Check how many lines is enclosed in this namespace. Don't issue",
"# warning for missing n... | https://github.com/vesoft-inc/nebula/blob/25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35/.linters/cpp/cpplint.py#L2573-L2623 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/stats/_multivariate.py | python | multivariate_normal_gen.logcdf | (self, x, mean=None, cov=1, allow_singular=False, maxpts=None,
abseps=1e-5, releps=1e-5) | return out | Log of the multivariate normal cumulative distribution function.
Parameters
----------
x : array_like
Quantiles, with the last axis of `x` denoting the components.
%(_mvn_doc_default_callparams)s
maxpts: integer, optional
The maximum number of points to u... | Log of the multivariate normal cumulative distribution function. | [
"Log",
"of",
"the",
"multivariate",
"normal",
"cumulative",
"distribution",
"function",
"."
] | def logcdf(self, x, mean=None, cov=1, allow_singular=False, maxpts=None,
abseps=1e-5, releps=1e-5):
"""
Log of the multivariate normal cumulative distribution function.
Parameters
----------
x : array_like
Quantiles, with the last axis of `x` denoting ... | [
"def",
"logcdf",
"(",
"self",
",",
"x",
",",
"mean",
"=",
"None",
",",
"cov",
"=",
"1",
",",
"allow_singular",
"=",
"False",
",",
"maxpts",
"=",
"None",
",",
"abseps",
"=",
"1e-5",
",",
"releps",
"=",
"1e-5",
")",
":",
"dim",
",",
"mean",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/_multivariate.py#L557-L594 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html2.py | python | WebView.CanCut | (*args, **kwargs) | return _html2.WebView_CanCut(*args, **kwargs) | CanCut(self) -> bool | CanCut(self) -> bool | [
"CanCut",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanCut(*args, **kwargs):
"""CanCut(self) -> bool"""
return _html2.WebView_CanCut(*args, **kwargs) | [
"def",
"CanCut",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebView_CanCut",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html2.py#L218-L220 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlWindow.HistoryClear | (*args, **kwargs) | return _html.HtmlWindow_HistoryClear(*args, **kwargs) | HistoryClear(self) | HistoryClear(self) | [
"HistoryClear",
"(",
"self",
")"
] | def HistoryClear(*args, **kwargs):
"""HistoryClear(self)"""
return _html.HtmlWindow_HistoryClear(*args, **kwargs) | [
"def",
"HistoryClear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWindow_HistoryClear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1069-L1071 | |
twhui/LiteFlowNet | 00925aebf2db9ac50f4b1666f718688b10dd10d1 | scripts/cpp_lint.py | python | CheckForNonConstReference | (filename, clean_lines, linenum,
nesting_state, error) | Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A... | Check for non-const references. | [
"Check",
"for",
"non",
"-",
"const",
"references",
"."
] | def CheckForNonConstReference(filename, clean_lines, linenum,
nesting_state, error):
"""Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean... | [
"def",
"CheckForNonConstReference",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Do nothing if there is no '&' on current line.",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"'&'",
"n... | https://github.com/twhui/LiteFlowNet/blob/00925aebf2db9ac50f4b1666f718688b10dd10d1/scripts/cpp_lint.py#L4134-L4244 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/preprocessing/label.py | python | label_binarize | (y, classes, neg_label=0, pos_label=1, sparse_output=False) | return Y | Binarize labels in a one-vs-all fashion
Several regression and binary classification algorithms are
available in the scikit. A simple way to extend these algorithms
to the multi-class classification case is to use the so-called
one-vs-all scheme.
This function makes it possible to compute this tra... | Binarize labels in a one-vs-all fashion | [
"Binarize",
"labels",
"in",
"a",
"one",
"-",
"vs",
"-",
"all",
"fashion"
] | def label_binarize(y, classes, neg_label=0, pos_label=1, sparse_output=False):
"""Binarize labels in a one-vs-all fashion
Several regression and binary classification algorithms are
available in the scikit. A simple way to extend these algorithms
to the multi-class classification case is to use the so-... | [
"def",
"label_binarize",
"(",
"y",
",",
"classes",
",",
"neg_label",
"=",
"0",
",",
"pos_label",
"=",
"1",
",",
"sparse_output",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"y",
",",
"list",
")",
":",
"# XXX Workaround that will be removed when l... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/preprocessing/label.py#L388-L542 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/buttonpanel.py | python | ButtonInfo.SetShortHelp | (self, help="") | Sets the help string to be shown in a tooltip.
:param string `help`: the string for the short help. | Sets the help string to be shown in a tooltip. | [
"Sets",
"the",
"help",
"string",
"to",
"be",
"shown",
"in",
"a",
"tooltip",
"."
] | def SetShortHelp(self, help=""):
"""
Sets the help string to be shown in a tooltip.
:param string `help`: the string for the short help.
"""
self._shortHelp = help | [
"def",
"SetShortHelp",
"(",
"self",
",",
"help",
"=",
"\"\"",
")",
":",
"self",
".",
"_shortHelp",
"=",
"help"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/buttonpanel.py#L1738-L1745 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/platform/gfile.py | python | Walk | (top, topdown=1, onerror=None) | return os.walk(top, topdown=topdown, onerror=onerror, followlinks=True) | Recursive directory tree generator.
Args:
top: string, a pathname.
topdown: bool, should traversal be pre-order (True) or post-order (False)
onerror: function, optional callback for errors.
By default, errors that occur when listing a directory are ignored.
(This is the same semantics as Python's os... | Recursive directory tree generator. | [
"Recursive",
"directory",
"tree",
"generator",
"."
] | def Walk(top, topdown=1, onerror=None):
"""Recursive directory tree generator.
Args:
top: string, a pathname.
topdown: bool, should traversal be pre-order (True) or post-order (False)
onerror: function, optional callback for errors.
By default, errors that occur when listing a directory are ignored.... | [
"def",
"Walk",
"(",
"top",
",",
"topdown",
"=",
"1",
",",
"onerror",
"=",
"None",
")",
":",
"return",
"os",
".",
"walk",
"(",
"top",
",",
"topdown",
"=",
"topdown",
",",
"onerror",
"=",
"onerror",
",",
"followlinks",
"=",
"True",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/platform/gfile.py#L385-L405 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextCtrl.BeginItalic | (*args, **kwargs) | return _richtext.RichTextCtrl_BeginItalic(*args, **kwargs) | BeginItalic(self) -> bool
Begin using italic | BeginItalic(self) -> bool | [
"BeginItalic",
"(",
"self",
")",
"-",
">",
"bool"
] | def BeginItalic(*args, **kwargs):
"""
BeginItalic(self) -> bool
Begin using italic
"""
return _richtext.RichTextCtrl_BeginItalic(*args, **kwargs) | [
"def",
"BeginItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_BeginItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L3351-L3357 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/metadata/Television/tvmaze.py | python | main | () | Main executor for MythTV's tvmaze grabber. | Main executor for MythTV's tvmaze grabber. | [
"Main",
"executor",
"for",
"MythTV",
"s",
"tvmaze",
"grabber",
"."
] | def main():
"""
Main executor for MythTV's tvmaze grabber.
"""
parser = OptionParser()
parser.add_option('-v', "--version", action="store_true", default=False,
dest="version", help="Display version and author")
parser.add_option('-t', "--test", action="store_true", defaul... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"OptionParser",
"(",
")",
"parser",
".",
"add_option",
"(",
"'-v'",
",",
"\"--version\"",
",",
"action",
"=",
"\"store_true\"",
",",
"default",
"=",
"False",
",",
"dest",
"=",
"\"version\"",
",",
"help",
"=",
... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/metadata/Television/tvmaze.py#L635-L742 | ||
PyMesh/PyMesh | 384ba882b7558ba6e8653ed263c419226c22bddf | python/pymesh/meshutils/generate_minimal_surface.py | python | generate_minimal_surface | (loop, resolution=10) | return surface | Generate a minimal surface (e.g. soap membrane) to fill the region
bounded by ``loop``.
Args:
loop: (``numpy.ndarray``): A N by dim array of vertices forming a simple
closed loop.
resolution (``int``): (optional) How many times to divide the surface.
Higher resolution means fine... | Generate a minimal surface (e.g. soap membrane) to fill the region
bounded by ``loop``. | [
"Generate",
"a",
"minimal",
"surface",
"(",
"e",
".",
"g",
".",
"soap",
"membrane",
")",
"to",
"fill",
"the",
"region",
"bounded",
"by",
"loop",
"."
] | def generate_minimal_surface(loop, resolution=10):
""" Generate a minimal surface (e.g. soap membrane) to fill the region
bounded by ``loop``.
Args:
loop: (``numpy.ndarray``): A N by dim array of vertices forming a simple
closed loop.
resolution (``int``): (optional) How many times ... | [
"def",
"generate_minimal_surface",
"(",
"loop",
",",
"resolution",
"=",
"10",
")",
":",
"N",
"=",
"len",
"(",
"loop",
")",
"arc_lengths",
"=",
"np",
".",
"zeros",
"(",
"N",
")",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"N",
")",
":",
"arc_lengths"... | https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/meshutils/generate_minimal_surface.py#L32-L74 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/variables.py | python | Variable.count_up_to | (self, limit) | return state_ops.count_up_to(self._variable, limit=limit) | Increments this variable until it reaches `limit`.
When that Op is run it tries to increment the variable by `1`. If
incrementing the variable would bring it above `limit` then the Op raises
the exception `OutOfRangeError`.
If no error is raised, the Op outputs the value of the variable before
the... | Increments this variable until it reaches `limit`. | [
"Increments",
"this",
"variable",
"until",
"it",
"reaches",
"limit",
"."
] | def count_up_to(self, limit):
"""Increments this variable until it reaches `limit`.
When that Op is run it tries to increment the variable by `1`. If
incrementing the variable would bring it above `limit` then the Op raises
the exception `OutOfRangeError`.
If no error is raised, the Op outputs the... | [
"def",
"count_up_to",
"(",
"self",
",",
"limit",
")",
":",
"return",
"state_ops",
".",
"count_up_to",
"(",
"self",
".",
"_variable",
",",
"limit",
"=",
"limit",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/variables.py#L607-L627 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGArrayEditorDialog.OnAddClick | (*args, **kwargs) | return _propgrid.PGArrayEditorDialog_OnAddClick(*args, **kwargs) | OnAddClick(self, CommandEvent event) | OnAddClick(self, CommandEvent event) | [
"OnAddClick",
"(",
"self",
"CommandEvent",
"event",
")"
] | def OnAddClick(*args, **kwargs):
"""OnAddClick(self, CommandEvent event)"""
return _propgrid.PGArrayEditorDialog_OnAddClick(*args, **kwargs) | [
"def",
"OnAddClick",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGArrayEditorDialog_OnAddClick",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L3210-L3212 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/distutils/dist.py | python | DistributionMetadata.write_pkg_info | (self, base_dir) | Write the PKG-INFO file into the release tree. | Write the PKG-INFO file into the release tree. | [
"Write",
"the",
"PKG",
"-",
"INFO",
"file",
"into",
"the",
"release",
"tree",
"."
] | def write_pkg_info (self, base_dir):
"""Write the PKG-INFO file into the release tree.
"""
pkg_info = open( os.path.join(base_dir, 'PKG-INFO'), 'w')
self.write_pkg_file(pkg_info)
pkg_info.close() | [
"def",
"write_pkg_info",
"(",
"self",
",",
"base_dir",
")",
":",
"pkg_info",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"base_dir",
",",
"'PKG-INFO'",
")",
",",
"'w'",
")",
"self",
".",
"write_pkg_file",
"(",
"pkg_info",
")",
"pkg_info",
".... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/dist.py#L1072-L1079 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DataFormats/FWLite/python/__init__.py | python | Handle.__init__ | (self,
typeString,
**kwargs) | Initialize python handle wrapper | Initialize python handle wrapper | [
"Initialize",
"python",
"handle",
"wrapper"
] | def __init__ (self,
typeString,
**kwargs):
"""Initialize python handle wrapper """
# turn off warnings
oldWarningLevel = ROOT.gErrorIgnoreLevel
ROOT.gErrorIgnoreLevel = ROOT.kError
self._nodel = False
if kwargs.get ('noDelete'):
... | [
"def",
"__init__",
"(",
"self",
",",
"typeString",
",",
"*",
"*",
"kwargs",
")",
":",
"# turn off warnings",
"oldWarningLevel",
"=",
"ROOT",
".",
"gErrorIgnoreLevel",
"ROOT",
".",
"gErrorIgnoreLevel",
"=",
"ROOT",
".",
"kError",
"self",
".",
"_nodel",
"=",
"... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DataFormats/FWLite/python/__init__.py#L53-L76 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | Brush.IsHatch | (*args, **kwargs) | return _gdi_.Brush_IsHatch(*args, **kwargs) | IsHatch(self) -> bool
Is the current style a hatch type? | IsHatch(self) -> bool | [
"IsHatch",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsHatch(*args, **kwargs):
"""
IsHatch(self) -> bool
Is the current style a hatch type?
"""
return _gdi_.Brush_IsHatch(*args, **kwargs) | [
"def",
"IsHatch",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Brush_IsHatch",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L572-L578 | |
ideawu/ssdb-rocks | a3cbb322cafb2f493252829c608e2239df98c9ac | deps/cpy/antlr3/tree.py | python | TreeAdaptor.replaceChildren | (self, parent, startChildIndex, stopChildIndex, t) | Replace from start to stop child index of parent with t, which might
be a list. Number of children may be different
after this call.
If parent is null, don't do anything; must be at root of overall tree.
Can't replace whatever points to the parent externally. Do nothing. | Replace from start to stop child index of parent with t, which might
be a list. Number of children may be different
after this call. | [
"Replace",
"from",
"start",
"to",
"stop",
"child",
"index",
"of",
"parent",
"with",
"t",
"which",
"might",
"be",
"a",
"list",
".",
"Number",
"of",
"children",
"may",
"be",
"different",
"after",
"this",
"call",
"."
] | def replaceChildren(self, parent, startChildIndex, stopChildIndex, t):
"""
Replace from start to stop child index of parent with t, which might
be a list. Number of children may be different
after this call.
If parent is null, don't do anything; must be at root of overall tree.... | [
"def",
"replaceChildren",
"(",
"self",
",",
"parent",
",",
"startChildIndex",
",",
"stopChildIndex",
",",
"t",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tree.py#L561-L571 | ||
ucsb-seclab/difuze | bb59a12ff87ad5ae45d9c60e349891bf80d72877 | helper_scripts/post_processing/parse.py | python | build_pointer | (elem, name, offset) | return ptr_elem | pointers are just string elements..
we name them specially so that our post_processor can create
a mapping later. | pointers are just string elements..
we name them specially so that our post_processor can create
a mapping later. | [
"pointers",
"are",
"just",
"string",
"elements",
"..",
"we",
"name",
"them",
"specially",
"so",
"that",
"our",
"post_processor",
"can",
"create",
"a",
"mapping",
"later",
"."
] | def build_pointer(elem, name, offset):
'''
pointers are just string elements..
we name them specially so that our post_processor can create
a mapping later.
'''
# okay, there are a couple things to do here:
# (1) If this is a simple ptr (char, void, int, etc). The depth is 1 and we already know the type
# (2)... | [
"def",
"build_pointer",
"(",
"elem",
",",
"name",
",",
"offset",
")",
":",
"# okay, there are a couple things to do here:",
"# (1) If this is a simple ptr (char, void, int, etc). The depth is 1 and we already know the type",
"# (2) get to the bottom of the pointer to assess pointer depth",
... | https://github.com/ucsb-seclab/difuze/blob/bb59a12ff87ad5ae45d9c60e349891bf80d72877/helper_scripts/post_processing/parse.py#L278-L338 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/memory_inspector/memory_inspector/core/backends.py | python | Register | (backend) | Called by each backend module to register upon initialization. | Called by each backend module to register upon initialization. | [
"Called",
"by",
"each",
"backend",
"module",
"to",
"register",
"upon",
"initialization",
"."
] | def Register(backend):
"""Called by each backend module to register upon initialization."""
assert(isinstance(backend, Backend))
_backends[backend.name] = backend | [
"def",
"Register",
"(",
"backend",
")",
":",
"assert",
"(",
"isinstance",
"(",
"backend",
",",
"Backend",
")",
")",
"_backends",
"[",
"backend",
".",
"name",
"]",
"=",
"backend"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/memory_inspector/memory_inspector/core/backends.py#L8-L11 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/fourwaysplitter.py | python | FourWaySplitter.GetTopRight | (self) | return self.GetWindow(1) | Returns the top right window (window index: 1). | Returns the top right window (window index: 1). | [
"Returns",
"the",
"top",
"right",
"window",
"(",
"window",
"index",
":",
"1",
")",
"."
] | def GetTopRight(self):
""" Returns the top right window (window index: 1). """
return self.GetWindow(1) | [
"def",
"GetTopRight",
"(",
"self",
")",
":",
"return",
"self",
".",
"GetWindow",
"(",
"1",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/fourwaysplitter.py#L507-L510 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/time-needed-to-inform-all-employees.py | python | Solution.numOfMinutes | (self, n, headID, manager, informTime) | return result | :type n: int
:type headID: int
:type manager: List[int]
:type informTime: List[int]
:rtype: int | :type n: int
:type headID: int
:type manager: List[int]
:type informTime: List[int]
:rtype: int | [
":",
"type",
"n",
":",
"int",
":",
"type",
"headID",
":",
"int",
":",
"type",
"manager",
":",
"List",
"[",
"int",
"]",
":",
"type",
"informTime",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"int"
] | def numOfMinutes(self, n, headID, manager, informTime):
"""
:type n: int
:type headID: int
:type manager: List[int]
:type informTime: List[int]
:rtype: int
"""
children = collections.defaultdict(list)
for child, parent in enumerate(manager):
... | [
"def",
"numOfMinutes",
"(",
"self",
",",
"n",
",",
"headID",
",",
"manager",
",",
"informTime",
")",
":",
"children",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"for",
"child",
",",
"parent",
"in",
"enumerate",
"(",
"manager",
")",
":",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/time-needed-to-inform-all-employees.py#L9-L32 | |
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | utils.py | python | get_bool_from_file | (file_path, bool_name, value_if_missing) | Looks for a Python boolean variable called bool_name in the
file specified by file_path and returns its value.
If the file or boolean variable aren't found, this function will
return value_if_missing. | Looks for a Python boolean variable called bool_name in the
file specified by file_path and returns its value. | [
"Looks",
"for",
"a",
"Python",
"boolean",
"variable",
"called",
"bool_name",
"in",
"the",
"file",
"specified",
"by",
"file_path",
"and",
"returns",
"its",
"value",
"."
] | def get_bool_from_file(file_path, bool_name, value_if_missing):
'''Looks for a Python boolean variable called bool_name in the
file specified by file_path and returns its value.
If the file or boolean variable aren't found, this function will
return value_if_missing.
'''
# Read in the file if... | [
"def",
"get_bool_from_file",
"(",
"file_path",
",",
"bool_name",
",",
"value_if_missing",
")",
":",
"# Read in the file if it exists.",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"file_path",
")",
":",
"file_in",
"=",
"open",
"(",
"file_path",
",",
"\"r\"",
... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils.py#L53-L88 | ||
tensorflow/minigo | 6d89c202cdceaf449aefc3149ab2110d44f1a6a4 | bigtable_input.py | python | get_unparsed_moves_from_last_n_games | (games, games_nr, n,
moves=2**21,
shuffle=True,
column_family=TFEXAMPLE,
column='example',
values_only=True) | return ds | Get a dataset of serialized TFExamples from the last N games.
Args:
games, games_nr: GameQueues of the regular selfplay and calibration
(aka 'no resign') games to sample from.
n: an integer indicating how many past games should be sourced.
moves: an integer indicating how many moves sho... | Get a dataset of serialized TFExamples from the last N games. | [
"Get",
"a",
"dataset",
"of",
"serialized",
"TFExamples",
"from",
"the",
"last",
"N",
"games",
"."
] | def get_unparsed_moves_from_last_n_games(games, games_nr, n,
moves=2**21,
shuffle=True,
column_family=TFEXAMPLE,
column='example',
... | [
"def",
"get_unparsed_moves_from_last_n_games",
"(",
"games",
",",
"games_nr",
",",
"n",
",",
"moves",
"=",
"2",
"**",
"21",
",",
"shuffle",
"=",
"True",
",",
"column_family",
"=",
"TFEXAMPLE",
",",
"column",
"=",
"'example'",
",",
"values_only",
"=",
"True",... | https://github.com/tensorflow/minigo/blob/6d89c202cdceaf449aefc3149ab2110d44f1a6a4/bigtable_input.py#L644-L684 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | grc/core/blocks/block.py | python | Block.is_deprecated | (self) | return False | Check whether the block is deprecated.
For now, we just check the category name for presence of "deprecated".
As it might be desirable in the future to have such "tags" be stored
explicitly, we're taking the detour of introducing a property. | Check whether the block is deprecated. | [
"Check",
"whether",
"the",
"block",
"is",
"deprecated",
"."
] | def is_deprecated(self):
"""
Check whether the block is deprecated.
For now, we just check the category name for presence of "deprecated".
As it might be desirable in the future to have such "tags" be stored
explicitly, we're taking the detour of introducing a property.
... | [
"def",
"is_deprecated",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"category",
":",
"return",
"False",
"try",
":",
"return",
"self",
".",
"flags",
".",
"deprecated",
"or",
"any",
"(",
"\"deprecated\"",
".",
"casefold",
"(",
")",
"in",
"cat",
".",... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/blocks/block.py#L560-L577 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/evaluation.py | python | _get_or_create_eval_step | () | Gets or creates the eval step `Tensor`.
Returns:
A `Tensor` representing a counter for the evaluation step.
Raises:
ValueError: If multiple `Tensors` have been added to the
`tf.GraphKeys.EVAL_STEP` collection. | Gets or creates the eval step `Tensor`. | [
"Gets",
"or",
"creates",
"the",
"eval",
"step",
"Tensor",
"."
] | def _get_or_create_eval_step():
"""Gets or creates the eval step `Tensor`.
Returns:
A `Tensor` representing a counter for the evaluation step.
Raises:
ValueError: If multiple `Tensors` have been added to the
`tf.GraphKeys.EVAL_STEP` collection.
"""
graph = ops.get_default_graph()
eval_steps ... | [
"def",
"_get_or_create_eval_step",
"(",
")",
":",
"graph",
"=",
"ops",
".",
"get_default_graph",
"(",
")",
"eval_steps",
"=",
"graph",
".",
"get_collection",
"(",
"ops",
".",
"GraphKeys",
".",
"EVAL_STEP",
")",
"if",
"len",
"(",
"eval_steps",
")",
"==",
"1... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/evaluation.py#L35-L59 | ||
bingwin/MicroChat | 81d9a71a212c1cbca5bba497ec42659a7d25dccf | mars/lint/cpplint.py | python | NestingState.InNamespaceBody | (self) | return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | Check if we are currently one level inside a namespace body. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"namespace",
"body",
"."
] | def InNamespaceBody(self):
"""Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | [
"def",
"InNamespaceBody",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_NamespaceInfo",
")"
] | https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L2239-L2245 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | ppapi/generators/idl_gen_wrapper.py | python | WrapperGen.InterfaceNeedsWrapper | (self, iface, releases) | return True | Return true if the interface has ANY methods that need wrapping. | Return true if the interface has ANY methods that need wrapping. | [
"Return",
"true",
"if",
"the",
"interface",
"has",
"ANY",
"methods",
"that",
"need",
"wrapping",
"."
] | def InterfaceNeedsWrapper(self, iface, releases):
"""Return true if the interface has ANY methods that need wrapping.
"""
return True | [
"def",
"InterfaceNeedsWrapper",
"(",
"self",
",",
"iface",
",",
"releases",
")",
":",
"return",
"True"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/ppapi/generators/idl_gen_wrapper.py#L200-L203 | |
casadi/casadi | 8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff | misc/cpplint.py | python | _SetVerboseLevel | (level) | return _cpplint_state.SetVerboseLevel(level) | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def _SetVerboseLevel(level):
"""Sets the module's verbosity, and returns the previous setting."""
return _cpplint_state.SetVerboseLevel(level) | [
"def",
"_SetVerboseLevel",
"(",
"level",
")",
":",
"return",
"_cpplint_state",
".",
"SetVerboseLevel",
"(",
"level",
")"
] | https://github.com/casadi/casadi/blob/8d0f80a4d0fe2054384bfb9748f7a0f6bae540ff/misc/cpplint.py#L775-L777 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/kvstore.py | python | create | (name='local') | return KVStore(handle) | Creates a new KVStore.
For single machine training, there are two commonly used types:
``local``: Copies all gradients to CPU memory and updates weights there.
``device``: Aggregates gradients and updates weights on GPUs. With this setting,
the KVStore also attempts to use GPU peer-to-peer communicat... | Creates a new KVStore. | [
"Creates",
"a",
"new",
"KVStore",
"."
] | def create(name='local'):
"""Creates a new KVStore.
For single machine training, there are two commonly used types:
``local``: Copies all gradients to CPU memory and updates weights there.
``device``: Aggregates gradients and updates weights on GPUs. With this setting,
the KVStore also attempts t... | [
"def",
"create",
"(",
"name",
"=",
"'local'",
")",
":",
"if",
"not",
"isinstance",
"(",
"name",
",",
"string_types",
")",
":",
"raise",
"TypeError",
"(",
"'name must be a string'",
")",
"handle",
"=",
"KVStoreHandle",
"(",
")",
"check_call",
"(",
"_LIB",
"... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/kvstore.py#L600-L640 | |
davisking/dlib | d665bfb8994a52029bdf56576ad4e982cbc684be | setup.py | python | read_version_from_cmakelists | (cmake_file) | return major + '.' + minor + '.' + patch | Read version information | Read version information | [
"Read",
"version",
"information"
] | def read_version_from_cmakelists(cmake_file):
"""Read version information
"""
major = re.findall("set\(CPACK_PACKAGE_VERSION_MAJOR.*\"(.*)\"", open(cmake_file).read())[0]
minor = re.findall("set\(CPACK_PACKAGE_VERSION_MINOR.*\"(.*)\"", open(cmake_file).read())[0]
patch = re.findall("set\(CPACK_PACKA... | [
"def",
"read_version_from_cmakelists",
"(",
"cmake_file",
")",
":",
"major",
"=",
"re",
".",
"findall",
"(",
"\"set\\(CPACK_PACKAGE_VERSION_MAJOR.*\\\"(.*)\\\"\"",
",",
"open",
"(",
"cmake_file",
")",
".",
"read",
"(",
")",
")",
"[",
"0",
"]",
"minor",
"=",
"r... | https://github.com/davisking/dlib/blob/d665bfb8994a52029bdf56576ad4e982cbc684be/setup.py#L209-L215 | |
fossephate/JoyCon-Driver | 857e4e76e26f05d72400ae5d9f2a22cae88f3548 | joycon-driver/full/wxWidgets-3.0.3/build/bakefiles/wxwin.py | python | mkLibName | (wxid) | return '$(WXNAMEPREFIXGUI)$(WXNAMESUFFIX)_%s$(WXVERSIONTAG)$(HOST_SUFFIX)' % wxid | Returns string that can be used as library name, including name
suffixes, prefixes, version tags etc. This must be kept in sync
with variables defined in common.bkl! | Returns string that can be used as library name, including name
suffixes, prefixes, version tags etc. This must be kept in sync
with variables defined in common.bkl! | [
"Returns",
"string",
"that",
"can",
"be",
"used",
"as",
"library",
"name",
"including",
"name",
"suffixes",
"prefixes",
"version",
"tags",
"etc",
".",
"This",
"must",
"be",
"kept",
"in",
"sync",
"with",
"variables",
"defined",
"in",
"common",
".",
"bkl!"
] | def mkLibName(wxid):
"""Returns string that can be used as library name, including name
suffixes, prefixes, version tags etc. This must be kept in sync
with variables defined in common.bkl!"""
if wxid == 'mono':
return '$(WXNAMEPREFIXGUI)$(WXNAMESUFFIX)$(WXVERSIONTAG)$(HOST_SUFFIX)'
if... | [
"def",
"mkLibName",
"(",
"wxid",
")",
":",
"if",
"wxid",
"==",
"'mono'",
":",
"return",
"'$(WXNAMEPREFIXGUI)$(WXNAMESUFFIX)$(WXVERSIONTAG)$(HOST_SUFFIX)'",
"if",
"wxid",
"==",
"'base'",
":",
"return",
"'$(WXNAMEPREFIX)$(WXNAMESUFFIX)$(WXVERSIONTAG)$(HOST_SUFFIX)'",
"if",
"w... | https://github.com/fossephate/JoyCon-Driver/blob/857e4e76e26f05d72400ae5d9f2a22cae88f3548/joycon-driver/full/wxWidgets-3.0.3/build/bakefiles/wxwin.py#L57-L67 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel.get_side_set_name | (self, side_set_id) | return self.side_sets[side_set_id][0] | Return the name of a side set. | Return the name of a side set. | [
"Return",
"the",
"name",
"of",
"a",
"side",
"set",
"."
] | def get_side_set_name(self, side_set_id):
"""Return the name of a side set."""
[side_set_id] = self._format_side_set_id_list([side_set_id], single=True)
return self.side_sets[side_set_id][0] | [
"def",
"get_side_set_name",
"(",
"self",
",",
"side_set_id",
")",
":",
"[",
"side_set_id",
"]",
"=",
"self",
".",
"_format_side_set_id_list",
"(",
"[",
"side_set_id",
"]",
",",
"single",
"=",
"True",
")",
"return",
"self",
".",
"side_sets",
"[",
"side_set_id... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L3848-L3851 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/config.py | python | DictConfigurator.configure | (self) | Do the configuration. | Do the configuration. | [
"Do",
"the",
"configuration",
"."
] | def configure(self):
"""Do the configuration."""
config = self.config
if 'version' not in config:
raise ValueError("dictionary doesn't specify a version")
if config['version'] != 1:
raise ValueError("Unsupported version: %s" % config['version'])
increment... | [
"def",
"configure",
"(",
"self",
")",
":",
"config",
"=",
"self",
".",
"config",
"if",
"'version'",
"not",
"in",
"config",
":",
"raise",
"ValueError",
"(",
"\"dictionary doesn't specify a version\"",
")",
"if",
"config",
"[",
"'version'",
"]",
"!=",
"1",
":"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/config.py#L504-L661 | ||
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | subprocess_win.py | python | _args_from_interpreter_flags | () | return args | Return a list of command-line arguments reproducing the current
settings in sys.flags and sys.warnoptions. | Return a list of command-line arguments reproducing the current
settings in sys.flags and sys.warnoptions. | [
"Return",
"a",
"list",
"of",
"command",
"-",
"line",
"arguments",
"reproducing",
"the",
"current",
"settings",
"in",
"sys",
".",
"flags",
"and",
"sys",
".",
"warnoptions",
"."
] | def _args_from_interpreter_flags():
"""Return a list of command-line arguments reproducing the current
settings in sys.flags and sys.warnoptions."""
flag_opt_map = {
'debug': 'd',
# 'inspect': 'i',
# 'interactive': 'i',
'optimize': 'O',
'dont_write_bytecode': 'B',
... | [
"def",
"_args_from_interpreter_flags",
"(",
")",
":",
"flag_opt_map",
"=",
"{",
"'debug'",
":",
"'d'",
",",
"# 'inspect': 'i',",
"# 'interactive': 'i',",
"'optimize'",
":",
"'O'",
",",
"'dont_write_bytecode'",
":",
"'B'",
",",
"'no_user_site'",
":",
"'s'",
",",
"'... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/subprocess_win.py#L493-L517 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/cephfs/mount.py | python | CephFSMount.touch | (self, fs_path) | Create a dentry if it doesn't already exist. This python
implementation exists because the usual command line tool doesn't
pass through error codes like EIO.
:param fs_path:
:return: | Create a dentry if it doesn't already exist. This python
implementation exists because the usual command line tool doesn't
pass through error codes like EIO. | [
"Create",
"a",
"dentry",
"if",
"it",
"doesn",
"t",
"already",
"exist",
".",
"This",
"python",
"implementation",
"exists",
"because",
"the",
"usual",
"command",
"line",
"tool",
"doesn",
"t",
"pass",
"through",
"error",
"codes",
"like",
"EIO",
"."
] | def touch(self, fs_path):
"""
Create a dentry if it doesn't already exist. This python
implementation exists because the usual command line tool doesn't
pass through error codes like EIO.
:param fs_path:
:return:
"""
abs_path = os.path.join(self.hostfs_m... | [
"def",
"touch",
"(",
"self",
",",
"fs_path",
")",
":",
"abs_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"hostfs_mntpt",
",",
"fs_path",
")",
"pyscript",
"=",
"dedent",
"(",
"\"\"\"\n import sys\n import errno\n\n ... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/mount.py#L1223-L1244 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/dist.py | python | Distribution._exclude_misc | (self, name, value) | Handle 'exclude()' for list/tuple attrs without a special handler | Handle 'exclude()' for list/tuple attrs without a special handler | [
"Handle",
"exclude",
"()",
"for",
"list",
"/",
"tuple",
"attrs",
"without",
"a",
"special",
"handler"
] | def _exclude_misc(self, name, value):
"""Handle 'exclude()' for list/tuple attrs without a special handler"""
if not isinstance(value, sequence):
raise DistutilsSetupError(
"%s: setting must be a list or tuple (%r)" % (name, value)
)
try:
old =... | [
"def",
"_exclude_misc",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"sequence",
")",
":",
"raise",
"DistutilsSetupError",
"(",
"\"%s: setting must be a list or tuple (%r)\"",
"%",
"(",
"name",
",",
"value",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/dist.py#L838-L855 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/message.py | python | Message.DiscardUnknownFields | (self) | Clears all fields in the :class:`UnknownFieldSet`.
This operation is recursive for nested message. | Clears all fields in the :class:`UnknownFieldSet`. | [
"Clears",
"all",
"fields",
"in",
"the",
":",
"class",
":",
"UnknownFieldSet",
"."
] | def DiscardUnknownFields(self):
"""Clears all fields in the :class:`UnknownFieldSet`.
This operation is recursive for nested message.
"""
raise NotImplementedError | [
"def",
"DiscardUnknownFields",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/message.py#L345-L350 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py3/dist.py | python | run_setup | (*args, **kwargs) | return not _shell.spawn(*argv) | Run setup | Run setup | [
"Run",
"setup"
] | def run_setup(*args, **kwargs):
""" Run setup """
if 'setup' in kwargs:
script = kwargs.get('setup') or 'setup.py'
del kwargs['setup']
else:
script = 'setup.py'
if 'fakeroot' in kwargs:
fakeroot = kwargs['fakeroot']
del kwargs['fakeroot']
else:
fakeroo... | [
"def",
"run_setup",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'setup'",
"in",
"kwargs",
":",
"script",
"=",
"kwargs",
".",
"get",
"(",
"'setup'",
")",
"or",
"'setup.py'",
"del",
"kwargs",
"[",
"'setup'",
"]",
"else",
":",
"script",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py3/dist.py#L32-L51 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/psutil/psutil/__init__.py | python | test | () | List info of all currently running processes emulating ps aux
output. | List info of all currently running processes emulating ps aux
output. | [
"List",
"info",
"of",
"all",
"currently",
"running",
"processes",
"emulating",
"ps",
"aux",
"output",
"."
] | def test():
"""List info of all currently running processes emulating ps aux
output.
"""
import datetime
from psutil._compat import print_
today_day = datetime.date.today()
templ = "%-10s %5s %4s %4s %7s %7s %-13s %5s %7s %s"
attrs = ['pid', 'get_cpu_percent', 'get_memory_percent', 'na... | [
"def",
"test",
"(",
")",
":",
"import",
"datetime",
"from",
"psutil",
".",
"_compat",
"import",
"print_",
"today_day",
"=",
"datetime",
".",
"date",
".",
"today",
"(",
")",
"templ",
"=",
"\"%-10s %5s %4s %4s %7s %7s %-13s %5s %7s %s\"",
"attrs",
"=",
"[",
"'p... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/__init__.py#L1340-L1400 | ||
Netflix/NfWebCrypto | 499faf4eb9f9ccf0b21dc728e974970f54bd6c52 | plugin/ppapi/ppapi/generators/idl_generator.py | python | GeneratorByFile.GenerateFile | (self, filenode, releases, options) | return 0 | Generates an output file from the IDL source.
Returns true if the generated file is different than the previously
generated file. | Generates an output file from the IDL source. | [
"Generates",
"an",
"output",
"file",
"from",
"the",
"IDL",
"source",
"."
] | def GenerateFile(self, filenode, releases, options):
"""Generates an output file from the IDL source.
Returns true if the generated file is different than the previously
generated file.
"""
__pychecker__ = 'unusednames=filenode,releases,options'
self.Error("Undefined release generator.")
re... | [
"def",
"GenerateFile",
"(",
"self",
",",
"filenode",
",",
"releases",
",",
"options",
")",
":",
"__pychecker__",
"=",
"'unusednames=filenode,releases,options'",
"self",
".",
"Error",
"(",
"\"Undefined release generator.\"",
")",
"return",
"0"
] | https://github.com/Netflix/NfWebCrypto/blob/499faf4eb9f9ccf0b21dc728e974970f54bd6c52/plugin/ppapi/ppapi/generators/idl_generator.py#L163-L171 | |
faasm/faasm | b3bc196d887adbd0bb9802bcb93323543bad59cb | faasmcli/faasmcli/tasks/disas.py | python | symbols | (ctx, user, func) | Print out the symbols for this function | Print out the symbols for this function | [
"Print",
"out",
"the",
"symbols",
"for",
"this",
"function"
] | def symbols(ctx, user, func):
"""
Print out the symbols for this function
"""
syms_path = disassemble_function(user, func)
with open(syms_path) as fh:
print(fh.read())
print("\nSymbols written to {}".format(syms_path)) | [
"def",
"symbols",
"(",
"ctx",
",",
"user",
",",
"func",
")",
":",
"syms_path",
"=",
"disassemble_function",
"(",
"user",
",",
"func",
")",
"with",
"open",
"(",
"syms_path",
")",
"as",
"fh",
":",
"print",
"(",
"fh",
".",
"read",
"(",
")",
")",
"prin... | https://github.com/faasm/faasm/blob/b3bc196d887adbd0bb9802bcb93323543bad59cb/faasmcli/faasmcli/tasks/disas.py#L10-L19 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py | python | SysLogHandler.close | (self) | Closes the socket. | Closes the socket. | [
"Closes",
"the",
"socket",
"."
] | def close(self):
"""
Closes the socket.
"""
self.acquire()
try:
self.socket.close()
logging.Handler.close(self)
finally:
self.release() | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"acquire",
"(",
")",
"try",
":",
"self",
".",
"socket",
".",
"close",
"(",
")",
"logging",
".",
"Handler",
".",
"close",
"(",
"self",
")",
"finally",
":",
"self",
".",
"release",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py#L886-L895 | ||
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/stp/rc.py | python | Field.floor_length_m | (self) | return self.__floor_length_m | :return: check on this one | :return: check on this one | [
":",
"return",
":",
"check",
"on",
"this",
"one"
] | def floor_length_m(self) -> float:
"""
:return: check on this one
"""
return self.__floor_length_m | [
"def",
"floor_length_m",
"(",
"self",
")",
"->",
"float",
":",
"return",
"self",
".",
"__floor_length_m"
] | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/stp/rc.py#L385-L389 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/topic_model/topic_model.py | python | TopicModel.evaluate | (self, train_data, test_data=None, metric="perplexity") | return ret | Estimate the model's ability to predict new data. Imagine you have a
corpus of books. One common approach to evaluating topic models is to
train on the first half of all of the books and see how well the model
predicts the second half of each book.
This method returns a metric called pe... | Estimate the model's ability to predict new data. Imagine you have a
corpus of books. One common approach to evaluating topic models is to
train on the first half of all of the books and see how well the model
predicts the second half of each book. | [
"Estimate",
"the",
"model",
"s",
"ability",
"to",
"predict",
"new",
"data",
".",
"Imagine",
"you",
"have",
"a",
"corpus",
"of",
"books",
".",
"One",
"common",
"approach",
"to",
"evaluating",
"topic",
"models",
"is",
"to",
"train",
"on",
"the",
"first",
"... | def evaluate(self, train_data, test_data=None, metric="perplexity"):
"""
Estimate the model's ability to predict new data. Imagine you have a
corpus of books. One common approach to evaluating topic models is to
train on the first half of all of the books and see how well the model
... | [
"def",
"evaluate",
"(",
"self",
",",
"train_data",
",",
"test_data",
"=",
"None",
",",
"metric",
"=",
"\"perplexity\"",
")",
":",
"train_data",
"=",
"_check_input",
"(",
"train_data",
")",
"if",
"test_data",
"is",
"None",
":",
"test_data",
"=",
"train_data",... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/topic_model/topic_model.py#L696-L763 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/train/trainer.py | python | Trainer.model | (self) | return super(Trainer, self).model() | The model that the trainer is training. | The model that the trainer is training. | [
"The",
"model",
"that",
"the",
"trainer",
"is",
"training",
"."
] | def model(self):
'''
The model that the trainer is training.
'''
return super(Trainer, self).model() | [
"def",
"model",
"(",
"self",
")",
":",
"return",
"super",
"(",
"Trainer",
",",
"self",
")",
".",
"model",
"(",
")"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/train/trainer.py#L264-L268 | |
larq/compute-engine | a2611f8e33f5cb9b4d09b7c9aff7053620a24305 | larq_compute_engine/mlir/python/util.py | python | _update_signature_def_tensors | (tensor_maps, map_old_to_new_tensors) | Update the tensors in the SignatureDef's TensorMaps. | Update the tensors in the SignatureDef's TensorMaps. | [
"Update",
"the",
"tensors",
"in",
"the",
"SignatureDef",
"s",
"TensorMaps",
"."
] | def _update_signature_def_tensors(tensor_maps, map_old_to_new_tensors):
"""Update the tensors in the SignatureDef's TensorMaps."""
for i in range(len(tensor_maps)):
if tensor_maps[i].tensorIndex in map_old_to_new_tensors:
tensor_maps[i].tensorIndex = map_old_to_new_tensors[
t... | [
"def",
"_update_signature_def_tensors",
"(",
"tensor_maps",
",",
"map_old_to_new_tensors",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"tensor_maps",
")",
")",
":",
"if",
"tensor_maps",
"[",
"i",
"]",
".",
"tensorIndex",
"in",
"map_old_to_new_tensors",... | https://github.com/larq/compute-engine/blob/a2611f8e33f5cb9b4d09b7c9aff7053620a24305/larq_compute_engine/mlir/python/util.py#L57-L63 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/graph_editor/subgraph.py | python | SubGraphView._assign_from | (self, other) | Assign other to itself.
Args:
other: another subgraph-view.
Returns:
A new instance identical to the original one.
Raises:
TypeError: if other is not an SubGraphView. | Assign other to itself. | [
"Assign",
"other",
"to",
"itself",
"."
] | def _assign_from(self, other):
"""Assign other to itself.
Args:
other: another subgraph-view.
Returns:
A new instance identical to the original one.
Raises:
TypeError: if other is not an SubGraphView.
"""
if not isinstance(other, SubGraphView):
raise TypeError("Expected ... | [
"def",
"_assign_from",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"SubGraphView",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected SubGraphView, got: {}\"",
".",
"format",
"(",
"type",
"(",
"other",
")",
")",
")",
"#... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/subgraph.py#L234-L251 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py3/traitlets/utils/descriptions.py | python | add_article | (name, definite=False, capital=False) | Returns the string with a prepended article.
The input does not need to begin with a charater.
Parameters
----------
name : str
Name to which to prepend an article
definite : bool (default: False)
Whether the article is definite or not.
Indefinite articles being 'a' and 'an... | Returns the string with a prepended article. | [
"Returns",
"the",
"string",
"with",
"a",
"prepended",
"article",
"."
] | def add_article(name, definite=False, capital=False):
"""Returns the string with a prepended article.
The input does not need to begin with a charater.
Parameters
----------
name : str
Name to which to prepend an article
definite : bool (default: False)
Whether the article is d... | [
"def",
"add_article",
"(",
"name",
",",
"definite",
"=",
"False",
",",
"capital",
"=",
"False",
")",
":",
"if",
"definite",
":",
"result",
"=",
"\"the \"",
"+",
"name",
"else",
":",
"first_letters",
"=",
"re",
".",
"compile",
"(",
"r'[\\W_]+'",
")",
".... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/utils/descriptions.py#L133-L161 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/msvc.py | python | msvc_common_flags | (conf) | Setup the flags required for executing the msvc compiler | Setup the flags required for executing the msvc compiler | [
"Setup",
"the",
"flags",
"required",
"for",
"executing",
"the",
"msvc",
"compiler"
] | def msvc_common_flags(conf):
"""
Setup the flags required for executing the msvc compiler
"""
v = conf.env
v['DEST_BINFMT'] = 'pe'
v.append_value('CFLAGS', ['/nologo'])
v.append_value('CXXFLAGS', ['/nologo'])
v['DEFINES_ST'] = '/D%s'
v['CC_SRC_F'] = ''
v['CC_TGT_F'] = ['/c', '/Fo']
v['CXX_SRC_F... | [
"def",
"msvc_common_flags",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"v",
"[",
"'DEST_BINFMT'",
"]",
"=",
"'pe'",
"v",
".",
"append_value",
"(",
"'CFLAGS'",
",",
"[",
"'/nologo'",
"]",
")",
"v",
".",
"append_value",
"(",
"'CXXFLAGS'",
",",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/msvc.py#L778-L839 | ||
dicecco1/fpga_caffe | 7a191704efd7873071cfef35772d7e7bf3e3cfd6 | python/caffe/pycaffe.py | python | _Net_set_input_arrays | (self, data, labels) | return self._set_input_arrays(data, labels) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | [
"Set",
"input",
"arrays",
"of",
"the",
"in",
"-",
"memory",
"MemoryDataLayer",
".",
"(",
"Note",
":",
"this",
"is",
"only",
"for",
"networks",
"declared",
"with",
"the",
"memory",
"data",
"layer",
".",
")"
] | def _Net_set_input_arrays(self, data, labels):
"""
Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.)
"""
if labels.ndim == 1:
labels = np.ascontiguousarray(labels[:, np.newaxis, np.newaxis,
... | [
"def",
"_Net_set_input_arrays",
"(",
"self",
",",
"data",
",",
"labels",
")",
":",
"if",
"labels",
".",
"ndim",
"==",
"1",
":",
"labels",
"=",
"np",
".",
"ascontiguousarray",
"(",
"labels",
"[",
":",
",",
"np",
".",
"newaxis",
",",
"np",
".",
"newaxi... | https://github.com/dicecco1/fpga_caffe/blob/7a191704efd7873071cfef35772d7e7bf3e3cfd6/python/caffe/pycaffe.py#L261-L269 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | SetCursorEvent.SetCursor | (*args, **kwargs) | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) | SetCursor(self, Cursor cursor)
Sets the cursor associated with this event. | SetCursor(self, Cursor cursor) | [
"SetCursor",
"(",
"self",
"Cursor",
"cursor",
")"
] | def SetCursor(*args, **kwargs):
"""
SetCursor(self, Cursor cursor)
Sets the cursor associated with this event.
"""
return _core_.SetCursorEvent_SetCursor(*args, **kwargs) | [
"def",
"SetCursor",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"SetCursorEvent_SetCursor",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L5891-L5897 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/menus.py | python | CompletionsMenuControl.mouse_handler | (self, mouse_event: MouseEvent) | return None | Handle mouse events: clicking and scrolling. | Handle mouse events: clicking and scrolling. | [
"Handle",
"mouse",
"events",
":",
"clicking",
"and",
"scrolling",
"."
] | def mouse_handler(self, mouse_event: MouseEvent) -> "NotImplementedOrNone":
"""
Handle mouse events: clicking and scrolling.
"""
b = get_app().current_buffer
if mouse_event.event_type == MouseEventType.MOUSE_UP:
# Select completion.
b.go_to_completion(mou... | [
"def",
"mouse_handler",
"(",
"self",
",",
"mouse_event",
":",
"MouseEvent",
")",
"->",
"\"NotImplementedOrNone\"",
":",
"b",
"=",
"get_app",
"(",
")",
".",
"current_buffer",
"if",
"mouse_event",
".",
"event_type",
"==",
"MouseEventType",
".",
"MOUSE_UP",
":",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/menus.py#L188-L207 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/png/png.py | python | Reader.read | (self, lenient=False) | return self.width, self.height, pixels, meta | Read the PNG file and decode it. Returns (`width`, `height`,
`pixels`, `metadata`).
May use excessive memory.
`pixels` are returned in boxed row flat pixel format.
If the optional `lenient` argument evaluates to True,
checksum failures will raise warnings rather than exceptio... | Read the PNG file and decode it. Returns (`width`, `height`,
`pixels`, `metadata`). | [
"Read",
"the",
"PNG",
"file",
"and",
"decode",
"it",
".",
"Returns",
"(",
"width",
"height",
"pixels",
"metadata",
")",
"."
] | def read(self, lenient=False):
"""
Read the PNG file and decode it. Returns (`width`, `height`,
`pixels`, `metadata`).
May use excessive memory.
`pixels` are returned in boxed row flat pixel format.
If the optional `lenient` argument evaluates to True,
checksu... | [
"def",
"read",
"(",
"self",
",",
"lenient",
"=",
"False",
")",
":",
"def",
"iteridat",
"(",
")",
":",
"\"\"\"Iterator that yields all the ``IDAT`` chunks as strings.\"\"\"",
"while",
"True",
":",
"try",
":",
"type",
",",
"data",
"=",
"self",
".",
"chunk",
"(",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/png/png.py#L1866-L1936 | |
leela-zero/leela-zero | e3ed6310d33d75078ba74c3adf887d18439fc2e3 | scripts/cpplint.py | python | _CppLintState.AddFilters | (self, filters) | Adds more filters to the existing list of error-message filters. | Adds more filters to the existing list of error-message filters. | [
"Adds",
"more",
"filters",
"to",
"the",
"existing",
"list",
"of",
"error",
"-",
"message",
"filters",
"."
] | def AddFilters(self, filters):
""" Adds more filters to the existing list of error-message filters. """
for filt in filters.split(','):
clean_filt = filt.strip()
if clean_filt:
self.filters.append(clean_filt)
for filt in self.filters:
if not (filt.startswith('+') or filt.startswith... | [
"def",
"AddFilters",
"(",
"self",
",",
"filters",
")",
":",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"clean_filt",
"=",
"filt",
".",
"strip",
"(",
")",
"if",
"clean_filt",
":",
"self",
".",
"filters",
".",
"append",
"(",
... | https://github.com/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/scripts/cpplint.py#L807-L816 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/serialcli.py | python | Serial.dsr | (self) | return self._port_handle.DsrHolding | Read terminal status line: Data Set Ready | Read terminal status line: Data Set Ready | [
"Read",
"terminal",
"status",
"line",
":",
"Data",
"Set",
"Ready"
] | def dsr(self):
"""Read terminal status line: Data Set Ready"""
if not self.is_open:
raise portNotOpenError
return self._port_handle.DsrHolding | [
"def",
"dsr",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"return",
"self",
".",
"_port_handle",
".",
"DsrHolding"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialcli.py#L229-L233 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/core/multiarray.py | python | putmask | (a, mask, values) | return (a, mask, values) | putmask(a, mask, values)
Changes elements of an array based on conditional and input values.
Sets ``a.flat[n] = values[n]`` for each n where ``mask.flat[n]==True``.
If `values` is not the same size as `a` and `mask` then it will repeat.
This gives behavior different from ``a[mask] = values``.
Pa... | putmask(a, mask, values) | [
"putmask",
"(",
"a",
"mask",
"values",
")"
] | def putmask(a, mask, values):
"""
putmask(a, mask, values)
Changes elements of an array based on conditional and input values.
Sets ``a.flat[n] = values[n]`` for each n where ``mask.flat[n]==True``.
If `values` is not the same size as `a` and `mask` then it will repeat.
This gives behavior di... | [
"def",
"putmask",
"(",
"a",
",",
"mask",
",",
"values",
")",
":",
"return",
"(",
"a",
",",
"mask",
",",
"values",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/multiarray.py#L1107-L1148 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/help.py | python | info | () | return {
'platform': platform_info,
'implementation': implementation_info,
'system_ssl': system_ssl_info,
'using_pyopenssl': pyopenssl is not None,
'pyOpenSSL': pyopenssl_info,
'urllib3': urllib3_info,
'chardet': chardet_info,
'cryptography': cryptography_... | Generate information for a bug report. | Generate information for a bug report. | [
"Generate",
"information",
"for",
"a",
"bug",
"report",
"."
] | def info():
"""Generate information for a bug report."""
try:
platform_info = {
'system': platform.system(),
'release': platform.release(),
}
except IOError:
platform_info = {
'system': 'Unknown',
'release': 'Unknown',
}
im... | [
"def",
"info",
"(",
")",
":",
"try",
":",
"platform_info",
"=",
"{",
"'system'",
":",
"platform",
".",
"system",
"(",
")",
",",
"'release'",
":",
"platform",
".",
"release",
"(",
")",
",",
"}",
"except",
"IOError",
":",
"platform_info",
"=",
"{",
"'s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/help.py#L59-L110 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/floatspin.py | python | FloatSpin.GetValue | (self) | return float(self._value) | Returns the :class:`FloatSpin` value. | Returns the :class:`FloatSpin` value. | [
"Returns",
"the",
":",
"class",
":",
"FloatSpin",
"value",
"."
] | def GetValue(self):
""" Returns the :class:`FloatSpin` value. """
return float(self._value) | [
"def",
"GetValue",
"(",
"self",
")",
":",
"return",
"float",
"(",
"self",
".",
"_value",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/floatspin.py#L821-L824 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/machinery.py | python | all_suffixes | () | return SOURCE_SUFFIXES + BYTECODE_SUFFIXES + EXTENSION_SUFFIXES | Returns a list of all recognized module suffixes for this process | Returns a list of all recognized module suffixes for this process | [
"Returns",
"a",
"list",
"of",
"all",
"recognized",
"module",
"suffixes",
"for",
"this",
"process"
] | def all_suffixes():
"""Returns a list of all recognized module suffixes for this process"""
return SOURCE_SUFFIXES + BYTECODE_SUFFIXES + EXTENSION_SUFFIXES | [
"def",
"all_suffixes",
"(",
")",
":",
"return",
"SOURCE_SUFFIXES",
"+",
"BYTECODE_SUFFIXES",
"+",
"EXTENSION_SUFFIXES"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/machinery.py#L19-L21 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Decimal._round_floor | (self, prec) | Rounds down (not towards 0 if negative) | Rounds down (not towards 0 if negative) | [
"Rounds",
"down",
"(",
"not",
"towards",
"0",
"if",
"negative",
")"
] | def _round_floor(self, prec):
"""Rounds down (not towards 0 if negative)"""
if not self._sign:
return self._round_down(prec)
else:
return -self._round_down(prec) | [
"def",
"_round_floor",
"(",
"self",
",",
"prec",
")",
":",
"if",
"not",
"self",
".",
"_sign",
":",
"return",
"self",
".",
"_round_down",
"(",
"prec",
")",
"else",
":",
"return",
"-",
"self",
".",
"_round_down",
"(",
"prec",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L1805-L1810 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py | python | Renderer.report_absolute_cursor_row | (self, row: int) | To be called when we know the absolute cursor position.
(As an answer of a "Cursor Position Request" response.) | To be called when we know the absolute cursor position.
(As an answer of a "Cursor Position Request" response.) | [
"To",
"be",
"called",
"when",
"we",
"know",
"the",
"absolute",
"cursor",
"position",
".",
"(",
"As",
"an",
"answer",
"of",
"a",
"Cursor",
"Position",
"Request",
"response",
".",
")"
] | def report_absolute_cursor_row(self, row: int) -> None:
"""
To be called when we know the absolute cursor position.
(As an answer of a "Cursor Position Request" response.)
"""
self.cpr_support = CPR_Support.SUPPORTED
# Calculate the amount of rows from the cursor positio... | [
"def",
"report_absolute_cursor_row",
"(",
"self",
",",
"row",
":",
"int",
")",
"->",
"None",
":",
"self",
".",
"cpr_support",
"=",
"CPR_Support",
".",
"SUPPORTED",
"# Calculate the amount of rows from the cursor position until the",
"# bottom of the terminal.",
"total_rows"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/renderer.py#L522-L543 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/simple.py | python | GetParaViewVersion | () | return paraview._version(servermanager.vtkSMProxyManager.GetVersionMajor(),
servermanager.vtkSMProxyManager.GetVersionMinor()) | Returns the version of the ParaView build | Returns the version of the ParaView build | [
"Returns",
"the",
"version",
"of",
"the",
"ParaView",
"build"
] | def GetParaViewVersion():
"""Returns the version of the ParaView build"""
return paraview._version(servermanager.vtkSMProxyManager.GetVersionMajor(),
servermanager.vtkSMProxyManager.GetVersionMinor()) | [
"def",
"GetParaViewVersion",
"(",
")",
":",
"return",
"paraview",
".",
"_version",
"(",
"servermanager",
".",
"vtkSMProxyManager",
".",
"GetVersionMajor",
"(",
")",
",",
"servermanager",
".",
"vtkSMProxyManager",
".",
"GetVersionMinor",
"(",
")",
")"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/simple.py#L56-L59 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/perl.py | python | check_perl_version | (self, minver=None) | return res | Check if Perl is installed, and set the variable PERL.
minver is supposed to be a tuple | Check if Perl is installed, and set the variable PERL.
minver is supposed to be a tuple | [
"Check",
"if",
"Perl",
"is",
"installed",
"and",
"set",
"the",
"variable",
"PERL",
".",
"minver",
"is",
"supposed",
"to",
"be",
"a",
"tuple"
] | def check_perl_version(self, minver=None):
"""
Check if Perl is installed, and set the variable PERL.
minver is supposed to be a tuple
"""
res = True
if minver:
cver = '.'.join(map(str,minver))
else:
cver = ''
self.start_msg('Checking for minimum perl version %s' % cver)
perl = getattr(Options.options,... | [
"def",
"check_perl_version",
"(",
"self",
",",
"minver",
"=",
"None",
")",
":",
"res",
"=",
"True",
"if",
"minver",
":",
"cver",
"=",
"'.'",
".",
"join",
"(",
"map",
"(",
"str",
",",
"minver",
")",
")",
"else",
":",
"cver",
"=",
"''",
"self",
"."... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/perl.py#L60-L95 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarFile.list | (self, verbose=True) | Print a table of contents to sys.stdout. If `verbose' is False, only
the names of the members are printed. If it is True, an `ls -l'-like
output is produced. | Print a table of contents to sys.stdout. If `verbose' is False, only
the names of the members are printed. If it is True, an `ls -l'-like
output is produced. | [
"Print",
"a",
"table",
"of",
"contents",
"to",
"sys",
".",
"stdout",
".",
"If",
"verbose",
"is",
"False",
"only",
"the",
"names",
"of",
"the",
"members",
"are",
"printed",
".",
"If",
"it",
"is",
"True",
"an",
"ls",
"-",
"l",
"-",
"like",
"output",
... | def list(self, verbose=True):
"""Print a table of contents to sys.stdout. If `verbose' is False, only
the names of the members are printed. If it is True, an `ls -l'-like
output is produced.
"""
self._check()
for tarinfo in self:
if verbose:
... | [
"def",
"list",
"(",
"self",
",",
"verbose",
"=",
"True",
")",
":",
"self",
".",
"_check",
"(",
")",
"for",
"tarinfo",
"in",
"self",
":",
"if",
"verbose",
":",
"print",
"(",
"filemode",
"(",
"tarinfo",
".",
"mode",
")",
",",
"end",
"=",
"' '",
")"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L2009-L2036 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/mox.py | python | IgnoreArg.equals | (self, unused_rhs) | return True | Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True | Ignores arguments and returns True. | [
"Ignores",
"arguments",
"and",
"returns",
"True",
"."
] | def equals(self, unused_rhs):
"""Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True
"""
return True | [
"def",
"equals",
"(",
"self",
",",
"unused_rhs",
")",
":",
"return",
"True"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/mox.py#L1166-L1176 | |
clementine-player/Clementine | 111379dfd027802b59125829fcf87e3e1d0ad73b | dist/cpplint.py | python | CheckForNonConstReference | (filename, clean_lines, linenum,
nesting_state, error) | Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A... | Check for non-const references. | [
"Check",
"for",
"non",
"-",
"const",
"references",
"."
] | def CheckForNonConstReference(filename, clean_lines, linenum,
nesting_state, error):
"""Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean... | [
"def",
"CheckForNonConstReference",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Do nothing if there is no '&' on current line.",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"'&'",
"n... | https://github.com/clementine-player/Clementine/blob/111379dfd027802b59125829fcf87e3e1d0ad73b/dist/cpplint.py#L4935-L5065 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/math_grad.py | python | _MaxGrad | (op, grad) | return _MinOrMaxGrad(op, grad) | Gradient for Max. | Gradient for Max. | [
"Gradient",
"for",
"Max",
"."
] | def _MaxGrad(op, grad):
"""Gradient for Max."""
return _MinOrMaxGrad(op, grad) | [
"def",
"_MaxGrad",
"(",
"op",
",",
"grad",
")",
":",
"return",
"_MinOrMaxGrad",
"(",
"op",
",",
"grad",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/math_grad.py#L83-L85 | |
reverbrain/elliptics | 4b4f9b8094d7616c1ec50eb8605edb059b9f228e | bindings/python/src/route.py | python | RouteList.get_address_backend_ranges | (self, address, backend_id) | return ranges | Returns id ranges which belong to specified @backend_id at @address\n
ranges = routes.get_address_backend_ranges(
Address.from_host_port_family('host.com:1025:2', 0)) | Returns id ranges which belong to specified | [
"Returns",
"id",
"ranges",
"which",
"belong",
"to",
"specified"
] | def get_address_backend_ranges(self, address, backend_id):
"""
Returns id ranges which belong to specified @backend_id at @address\n
ranges = routes.get_address_backend_ranges(
Address.from_host_port_family('host.com:1025:2', 0))
"""
ranges = []
group = self.g... | [
"def",
"get_address_backend_ranges",
"(",
"self",
",",
"address",
",",
"backend_id",
")",
":",
"ranges",
"=",
"[",
"]",
"group",
"=",
"self",
".",
"get_address_backend_group",
"(",
"address",
",",
"backend_id",
")",
"id",
"=",
"None",
"for",
"route",
"in",
... | https://github.com/reverbrain/elliptics/blob/4b4f9b8094d7616c1ec50eb8605edb059b9f228e/bindings/python/src/route.py#L364-L382 | |
xhzdeng/crpn | a5aef0f80dbe486103123f740c634fb01e6cc9a1 | caffe-fast-rcnn/tools/extra/parse_log.py | python | save_csv_files | (logfile_path, output_dir, train_dict_list, test_dict_list,
delimiter=',', verbose=False) | Save CSV files to output_dir
If the input log file is, e.g., caffe.INFO, the names will be
caffe.INFO.train and caffe.INFO.test | Save CSV files to output_dir | [
"Save",
"CSV",
"files",
"to",
"output_dir"
] | def save_csv_files(logfile_path, output_dir, train_dict_list, test_dict_list,
delimiter=',', verbose=False):
"""Save CSV files to output_dir
If the input log file is, e.g., caffe.INFO, the names will be
caffe.INFO.train and caffe.INFO.test
"""
log_basename = os.path.basename(log... | [
"def",
"save_csv_files",
"(",
"logfile_path",
",",
"output_dir",
",",
"train_dict_list",
",",
"test_dict_list",
",",
"delimiter",
"=",
"','",
",",
"verbose",
"=",
"False",
")",
":",
"log_basename",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"logfile_path",
... | https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/tools/extra/parse_log.py#L141-L154 | ||
aimerykong/Low-Rank-Bilinear-Pooling | 487eb2c857fd9c95357a5166b0c15ad0fe135b28 | caffe-20160312/scripts/cpp_lint.py | python | CheckSpacingForFunctionCall | (filename, line, linenum, error) | Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
line: The text of the line to check.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for the correctness of various spacing around function calls. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"around",
"function",
"calls",
"."
] | def CheckSpacingForFunctionCall(filename, line, linenum, error):
"""Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
line: The text of the line to check.
linenum: The number of the line to check.
error: The function to call with any ... | [
"def",
"CheckSpacingForFunctionCall",
"(",
"filename",
",",
"line",
",",
"linenum",
",",
"error",
")",
":",
"# Since function calls often occur inside if/for/while/switch",
"# expressions - which have their own, more liberal conventions - we",
"# first see if we should be looking inside ... | https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/scripts/cpp_lint.py#L2301-L2366 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py | python | setLoggerClass | (klass) | Set the class to be used when instantiating a logger. The class should
define __init__() such that only a name argument is required, and the
__init__() should call Logger.__init__() | Set the class to be used when instantiating a logger. The class should
define __init__() such that only a name argument is required, and the
__init__() should call Logger.__init__() | [
"Set",
"the",
"class",
"to",
"be",
"used",
"when",
"instantiating",
"a",
"logger",
".",
"The",
"class",
"should",
"define",
"__init__",
"()",
"such",
"that",
"only",
"a",
"name",
"argument",
"is",
"required",
"and",
"the",
"__init__",
"()",
"should",
"call... | def setLoggerClass(klass):
"""
Set the class to be used when instantiating a logger. The class should
define __init__() such that only a name argument is required, and the
__init__() should call Logger.__init__()
"""
if klass != Logger:
if not issubclass(klass, Logger):
raise... | [
"def",
"setLoggerClass",
"(",
"klass",
")",
":",
"if",
"klass",
"!=",
"Logger",
":",
"if",
"not",
"issubclass",
"(",
"klass",
",",
"Logger",
")",
":",
"raise",
"TypeError",
"(",
"\"logger not derived from logging.Logger: \"",
"+",
"klass",
".",
"__name__",
")"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L972-L983 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py | python | PreparedRequest.prepare_method | (self, method) | Prepares the given HTTP method. | Prepares the given HTTP method. | [
"Prepares",
"the",
"given",
"HTTP",
"method",
"."
] | def prepare_method(self, method):
"""Prepares the given HTTP method."""
self.method = method
if self.method is not None:
self.method = to_native_string(self.method.upper()) | [
"def",
"prepare_method",
"(",
"self",
",",
"method",
")",
":",
"self",
".",
"method",
"=",
"method",
"if",
"self",
".",
"method",
"is",
"not",
"None",
":",
"self",
".",
"method",
"=",
"to_native_string",
"(",
"self",
".",
"method",
".",
"upper",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/models.py#L340-L344 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/dummy_thread.py | python | interrupt_main | () | Set _interrupt flag to True to have start_new_thread raise
KeyboardInterrupt upon exiting. | Set _interrupt flag to True to have start_new_thread raise
KeyboardInterrupt upon exiting. | [
"Set",
"_interrupt",
"flag",
"to",
"True",
"to",
"have",
"start_new_thread",
"raise",
"KeyboardInterrupt",
"upon",
"exiting",
"."
] | def interrupt_main():
"""Set _interrupt flag to True to have start_new_thread raise
KeyboardInterrupt upon exiting."""
if _main:
raise KeyboardInterrupt
else:
global _interrupt
_interrupt = True | [
"def",
"interrupt_main",
"(",
")",
":",
"if",
"_main",
":",
"raise",
"KeyboardInterrupt",
"else",
":",
"global",
"_interrupt",
"_interrupt",
"=",
"True"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/dummy_thread.py#L138-L145 | ||
bitconch/bitconch-core | 5537f3215b3e3b76f6720d6f908676a6c34bc5db | deploy-morgan.py | python | prnt_error | (in_text) | Print an error message | Print an error message | [
"Print",
"an",
"error",
"message"
] | def prnt_error(in_text):
"""
Print an error message
"""
print(Fore.RED + "[~]"+in_text)
print(Style.RESET_ALL) | [
"def",
"prnt_error",
"(",
"in_text",
")",
":",
"print",
"(",
"Fore",
".",
"RED",
"+",
"\"[~]\"",
"+",
"in_text",
")",
"print",
"(",
"Style",
".",
"RESET_ALL",
")"
] | https://github.com/bitconch/bitconch-core/blob/5537f3215b3e3b76f6720d6f908676a6c34bc5db/deploy-morgan.py#L68-L73 | ||
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/asan_symbolize.py | python | DarwinSymbolizer.symbolize | (self, addr, binary, offset) | Overrides Symbolizer.symbolize. | Overrides Symbolizer.symbolize. | [
"Overrides",
"Symbolizer",
".",
"symbolize",
"."
] | def symbolize(self, addr, binary, offset):
"""Overrides Symbolizer.symbolize."""
if self.binary != binary:
return None
self.open_atos()
self.write_addr_to_pipe(offset)
self.pipe.stdin.close()
atos_line = self.pipe.stdout.readline().rstrip()
# A well-formed atos response looks like this... | [
"def",
"symbolize",
"(",
"self",
",",
"addr",
",",
"binary",
",",
"offset",
")",
":",
"if",
"self",
".",
"binary",
"!=",
"binary",
":",
"return",
"None",
"self",
".",
"open_atos",
"(",
")",
"self",
".",
"write_addr_to_pipe",
"(",
"offset",
")",
"self",... | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/asan_symbolize.py#L162-L181 | ||
apache/madlib | be297fe6beada0640f93317e8948834032718e32 | src/madpack/upgrade_util.py | python | ViewDependency._detect_direct_view_dependency_udf_uda | (self) | @brief Detect direct view dependencies on MADlib UDFs/UDAs | [] | def _detect_direct_view_dependency_udf_uda(self):
"""
@brief Detect direct view dependencies on MADlib UDFs/UDAs
"""
proisagg_wrapper = "p.proisagg"
if self._portid == 'postgres' and self._dbver > 11:
proisagg_wrapper = "p.prokind = 'a'"
rows = self._run_sql(... | [
"def",
"_detect_direct_view_dependency_udf_uda",
"(",
"self",
")",
":",
"proisagg_wrapper",
"=",
"\"p.proisagg\"",
"if",
"self",
".",
"_portid",
"==",
"'postgres'",
"and",
"self",
".",
"_dbver",
">",
"11",
":",
"proisagg_wrapper",
"=",
"\"p.prokind = 'a'\"",
"rows",... | https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/upgrade_util.py#L493-L535 | |||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | _GenerateMSBuildFiltersFile | (filters_path, source_files,
rule_dependencies, extension_to_rule_name) | Generate the filters file.
This file is used by Visual Studio to organize the presentation of source
files into folders.
Arguments:
filters_path: The path of the file to be created.
source_files: The hierarchical structure of all the sources.
extension_to_rule_name: A dictionary mapping file e... | Generate the filters file. | [
"Generate",
"the",
"filters",
"file",
"."
] | def _GenerateMSBuildFiltersFile(filters_path, source_files,
rule_dependencies, extension_to_rule_name):
"""Generate the filters file.
This file is used by Visual Studio to organize the presentation of source
files into folders.
Arguments:
filters_path: The path of the fil... | [
"def",
"_GenerateMSBuildFiltersFile",
"(",
"filters_path",
",",
"source_files",
",",
"rule_dependencies",
",",
"extension_to_rule_name",
")",
":",
"filter_group",
"=",
"[",
"]",
"source_group",
"=",
"[",
"]",
"_AppendFiltersForMSBuild",
"(",
"''",
",",
"source_files",... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L2021-L2048 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TFltRect.SaveXml | (self, *args) | return _snap.TFltRect_SaveXml(self, *args) | SaveXml(TFltRect self, TSOut SOut, TStr Nm)
Parameters:
SOut: TSOut &
Nm: TStr const & | SaveXml(TFltRect self, TSOut SOut, TStr Nm) | [
"SaveXml",
"(",
"TFltRect",
"self",
"TSOut",
"SOut",
"TStr",
"Nm",
")"
] | def SaveXml(self, *args):
"""
SaveXml(TFltRect self, TSOut SOut, TStr Nm)
Parameters:
SOut: TSOut &
Nm: TStr const &
"""
return _snap.TFltRect_SaveXml(self, *args) | [
"def",
"SaveXml",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TFltRect_SaveXml",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L15187-L15196 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGridInterface.SetValidationFailureBehavior | (*args, **kwargs) | return _propgrid.PropertyGridInterface_SetValidationFailureBehavior(*args, **kwargs) | SetValidationFailureBehavior(self, int vfbFlags) | SetValidationFailureBehavior(self, int vfbFlags) | [
"SetValidationFailureBehavior",
"(",
"self",
"int",
"vfbFlags",
")"
] | def SetValidationFailureBehavior(*args, **kwargs):
"""SetValidationFailureBehavior(self, int vfbFlags)"""
return _propgrid.PropertyGridInterface_SetValidationFailureBehavior(*args, **kwargs) | [
"def",
"SetValidationFailureBehavior",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_SetValidationFailureBehavior",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L1458-L1460 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/poplib.py | python | POP3.rset | (self) | return self._shortcmd('RSET') | Unmark all messages marked for deletion. | Unmark all messages marked for deletion. | [
"Unmark",
"all",
"messages",
"marked",
"for",
"deletion",
"."
] | def rset(self):
"""Unmark all messages marked for deletion."""
return self._shortcmd('RSET') | [
"def",
"rset",
"(",
"self",
")",
":",
"return",
"self",
".",
"_shortcmd",
"(",
"'RSET'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/poplib.py#L272-L274 | |
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/gypi_to_gn.py | python | ReplaceSubstrings | (values, search_for, replace_with) | return values | Recursively replaces substrings in a value.
Replaces all substrings of the "search_for" with "repace_with" for all
strings occurring in "values". This is done by recursively iterating into
lists as well as the keys and values of dictionaries. | Recursively replaces substrings in a value. | [
"Recursively",
"replaces",
"substrings",
"in",
"a",
"value",
"."
] | def ReplaceSubstrings(values, search_for, replace_with):
"""Recursively replaces substrings in a value.
Replaces all substrings of the "search_for" with "repace_with" for all
strings occurring in "values". This is done by recursively iterating into
lists as well as the keys and values of dictionaries."""
if ... | [
"def",
"ReplaceSubstrings",
"(",
"values",
",",
"search_for",
",",
"replace_with",
")",
":",
"if",
"isinstance",
"(",
"values",
",",
"str",
")",
":",
"return",
"values",
".",
"replace",
"(",
"search_for",
",",
"replace_with",
")",
"if",
"isinstance",
"(",
... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/gypi_to_gn.py#L146-L168 | |
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/shell/hkucmd.py | python | HKUShell.do_quit | (self, arg) | return True | Stop recording, and exit: BYE | Stop recording, and exit: BYE | [
"Stop",
"recording",
"and",
"exit",
":",
"BYE"
] | def do_quit(self, arg):
'Stop recording, and exit: BYE'
print('Thank you for using hikyuu.\n')
return True | [
"def",
"do_quit",
"(",
"self",
",",
"arg",
")",
":",
"print",
"(",
"'Thank you for using hikyuu.\\n'",
")",
"return",
"True"
] | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/shell/hkucmd.py#L85-L88 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_cpp.py | python | add_expr | (code) | Adds code to the current expression context. | Adds code to the current expression context. | [
"Adds",
"code",
"to",
"the",
"current",
"expression",
"context",
"."
] | def add_expr(code):
""" Adds code to the current expression context. """
context.expr.write(code) | [
"def",
"add_expr",
"(",
"code",
")",
":",
"context",
".",
"expr",
".",
"write",
"(",
"code",
")"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_cpp.py#L133-L135 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/isapi/install.py | python | UninstallModule | (conf_module_name, params, options, log=lambda *args:None) | Remove the extension | Remove the extension | [
"Remove",
"the",
"extension"
] | def UninstallModule(conf_module_name, params, options, log=lambda *args:None):
"Remove the extension"
loader_dll = GetLoaderModuleName(conf_module_name, False)
_PatchParamsModule(params, loader_dll, False)
Uninstall(params, options)
log(1, "Uninstallation complete.") | [
"def",
"UninstallModule",
"(",
"conf_module_name",
",",
"params",
",",
"options",
",",
"log",
"=",
"lambda",
"*",
"args",
":",
"None",
")",
":",
"loader_dll",
"=",
"GetLoaderModuleName",
"(",
"conf_module_name",
",",
"False",
")",
"_PatchParamsModule",
"(",
"p... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/isapi/install.py#L618-L623 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBValue.GetAddress | (self) | return _lldb.SBValue_GetAddress(self) | GetAddress(self) -> SBAddress | GetAddress(self) -> SBAddress | [
"GetAddress",
"(",
"self",
")",
"-",
">",
"SBAddress"
] | def GetAddress(self):
"""GetAddress(self) -> SBAddress"""
return _lldb.SBValue_GetAddress(self) | [
"def",
"GetAddress",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBValue_GetAddress",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L12211-L12213 | |
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/pychan/widgets/widget.py | python | Widget.findChild | (self,**kwargs) | return None | Find the first contained child widgets by attribute values.
Usage::
closeButton = root_widget.findChild(name='close') | Find the first contained child widgets by attribute values. | [
"Find",
"the",
"first",
"contained",
"child",
"widgets",
"by",
"attribute",
"values",
"."
] | def findChild(self,**kwargs):
""" Find the first contained child widgets by attribute values.
Usage::
closeButton = root_widget.findChild(name='close')
"""
if list(kwargs.keys()) == ["name"]:
return self.findChildByName(kwargs["name"])
children = self.findChildren(**kwargs)
if children:
return c... | [
"def",
"findChild",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"list",
"(",
"kwargs",
".",
"keys",
"(",
")",
")",
"==",
"[",
"\"name\"",
"]",
":",
"return",
"self",
".",
"findChildByName",
"(",
"kwargs",
"[",
"\"name\"",
"]",
")",
"child... | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/widgets/widget.py#L589-L601 | |
openfoamtutorials/OpenFOAM_Tutorials_ | 29e19833aea3f6ee87ecceae3d061b050ee3ed89 | InProgress/MultiElementBiWing/plot.py | python | processForceLine | (line) | return ret | Returns a dictionary of lists:
ret = {time, pressureForce, viscousForce, pressureMoment, viscousMoment}
(porous quantities are ignored) | Returns a dictionary of lists:
ret = {time, pressureForce, viscousForce, pressureMoment, viscousMoment}
(porous quantities are ignored) | [
"Returns",
"a",
"dictionary",
"of",
"lists",
":",
"ret",
"=",
"{",
"time",
"pressureForce",
"viscousForce",
"pressureMoment",
"viscousMoment",
"}",
"(",
"porous",
"quantities",
"are",
"ignored",
")"
] | def processForceLine(line):
"""
Returns a dictionary of lists:
ret = {time, pressureForce, viscousForce, pressureMoment, viscousMoment}
(porous quantities are ignored)
"""
raw = line.split()
ret = {}
ret['time'] = float(cleanString(raw[0]))
ret['pressureForce'] = cleanList(raw[1:4])
ret['viscousForce'] = clea... | [
"def",
"processForceLine",
"(",
"line",
")",
":",
"raw",
"=",
"line",
".",
"split",
"(",
")",
"ret",
"=",
"{",
"}",
"ret",
"[",
"'time'",
"]",
"=",
"float",
"(",
"cleanString",
"(",
"raw",
"[",
"0",
"]",
")",
")",
"ret",
"[",
"'pressureForce'",
"... | https://github.com/openfoamtutorials/OpenFOAM_Tutorials_/blob/29e19833aea3f6ee87ecceae3d061b050ee3ed89/InProgress/MultiElementBiWing/plot.py#L20-L33 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | ConfigBase.GetNumberOfGroups | (*args, **kwargs) | return _misc_.ConfigBase_GetNumberOfGroups(*args, **kwargs) | GetNumberOfGroups(self, bool recursive=False) -> size_t
Get the number of subgroups in the current group, with or without its
subgroups. | GetNumberOfGroups(self, bool recursive=False) -> size_t | [
"GetNumberOfGroups",
"(",
"self",
"bool",
"recursive",
"=",
"False",
")",
"-",
">",
"size_t"
] | def GetNumberOfGroups(*args, **kwargs):
"""
GetNumberOfGroups(self, bool recursive=False) -> size_t
Get the number of subgroups in the current group, with or without its
subgroups.
"""
return _misc_.ConfigBase_GetNumberOfGroups(*args, **kwargs) | [
"def",
"GetNumberOfGroups",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"ConfigBase_GetNumberOfGroups",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3214-L3221 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/model.py | python | FeedForward._init_params | (self, input_shapes, overwrite=False) | return (arg_names, list(param_names), aux_names) | Initialize weight parameters and auxiliary states | Initialize weight parameters and auxiliary states | [
"Initialize",
"weight",
"parameters",
"and",
"auxiliary",
"states"
] | def _init_params(self, input_shapes, overwrite=False):
"""Initialize weight parameters and auxiliary states"""
arg_shapes, _, aux_shapes = self.symbol.infer_shape(**input_shapes)
assert(arg_shapes is not None)
arg_names = self.symbol.list_arguments()
input_names = input_shapes.k... | [
"def",
"_init_params",
"(",
"self",
",",
"input_shapes",
",",
"overwrite",
"=",
"False",
")",
":",
"arg_shapes",
",",
"_",
",",
"aux_shapes",
"=",
"self",
".",
"symbol",
".",
"infer_shape",
"(",
"*",
"*",
"input_shapes",
")",
"assert",
"(",
"arg_shapes",
... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/model.py#L481-L509 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/gluon/block.py | python | Block.load_parameters | (self, filename, ctx=None, allow_missing=False,
ignore_extra=False, cast_dtype=False, dtype_source='current') | Load parameters from file previously saved by `save_parameters`.
Parameters
----------
filename : str
Path to parameter file.
ctx : Context or list of Context, default cpu()
Context(s) to initialize loaded parameters on.
allow_missing : bool, default Fals... | Load parameters from file previously saved by `save_parameters`. | [
"Load",
"parameters",
"from",
"file",
"previously",
"saved",
"by",
"save_parameters",
"."
] | def load_parameters(self, filename, ctx=None, allow_missing=False,
ignore_extra=False, cast_dtype=False, dtype_source='current'):
"""Load parameters from file previously saved by `save_parameters`.
Parameters
----------
filename : str
Path to paramete... | [
"def",
"load_parameters",
"(",
"self",
",",
"filename",
",",
"ctx",
"=",
"None",
",",
"allow_missing",
"=",
"False",
",",
"ignore_extra",
"=",
"False",
",",
"cast_dtype",
"=",
"False",
",",
"dtype_source",
"=",
"'current'",
")",
":",
"loaded",
"=",
"ndarra... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/block.py#L358-L411 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cefbuilds/cef_json_builder.py | python | cef_json_builder.get_versions | (self, platform) | return self._data[platform]['versions'] | Return all versions for the specified |platform|. | Return all versions for the specified |platform|. | [
"Return",
"all",
"versions",
"for",
"the",
"specified",
"|platform|",
"."
] | def get_versions(self, platform):
""" Return all versions for the specified |platform|. """
return self._data[platform]['versions'] | [
"def",
"get_versions",
"(",
"self",
",",
"platform",
")",
":",
"return",
"self",
".",
"_data",
"[",
"platform",
"]",
"[",
"'versions'",
"]"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cefbuilds/cef_json_builder.py#L432-L434 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/utils/extmath.py | python | _deterministic_vector_sign_flip | (u) | return u | Modify the sign of vectors for reproducibility
Flips the sign of elements of all the vectors (rows of u) such that
the absolute maximum element of each vector is positive.
Parameters
----------
u : ndarray
Array with vectors as its rows.
Returns
-------
u_flipped : ndarray wit... | Modify the sign of vectors for reproducibility | [
"Modify",
"the",
"sign",
"of",
"vectors",
"for",
"reproducibility"
] | def _deterministic_vector_sign_flip(u):
"""Modify the sign of vectors for reproducibility
Flips the sign of elements of all the vectors (rows of u) such that
the absolute maximum element of each vector is positive.
Parameters
----------
u : ndarray
Array with vectors as its rows.
... | [
"def",
"_deterministic_vector_sign_flip",
"(",
"u",
")",
":",
"max_abs_rows",
"=",
"np",
".",
"argmax",
"(",
"np",
".",
"abs",
"(",
"u",
")",
",",
"axis",
"=",
"1",
")",
"signs",
"=",
"np",
".",
"sign",
"(",
"u",
"[",
"range",
"(",
"u",
".",
"sha... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/utils/extmath.py#L825-L844 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py | python | IConversion.TextToGroupType | (self, Text) | return self._TextTo('grp', Text) | Returns group type code.
@param Text: Text, one of L{Group type<enums.grpUnknown>}.
@type Text: unicode
@return: Group type.
@rtype: L{Group type<enums.grpUnknown>}
@note: Currently, this method only checks if the given string is one of the allowed ones
and returns it or... | Returns group type code. | [
"Returns",
"group",
"type",
"code",
"."
] | def TextToGroupType(self, Text):
'''Returns group type code.
@param Text: Text, one of L{Group type<enums.grpUnknown>}.
@type Text: unicode
@return: Group type.
@rtype: L{Group type<enums.grpUnknown>}
@note: Currently, this method only checks if the given string is one o... | [
"def",
"TextToGroupType",
"(",
"self",
",",
"Text",
")",
":",
"return",
"self",
".",
"_TextTo",
"(",
"'grp'",
",",
"Text",
")"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py#L317-L327 | |
AojunZhou/Incremental-Network-Quantization | c7f6a609d5817d8424ce224209cf4c50f1e4de50 | scripts/cpp_lint.py | python | ResetNolintSuppressions | () | Resets the set of NOLINT suppressions to empty. | Resets the set of NOLINT suppressions to empty. | [
"Resets",
"the",
"set",
"of",
"NOLINT",
"suppressions",
"to",
"empty",
"."
] | def ResetNolintSuppressions():
"Resets the set of NOLINT suppressions to empty."
_error_suppressions.clear() | [
"def",
"ResetNolintSuppressions",
"(",
")",
":",
"_error_suppressions",
".",
"clear",
"(",
")"
] | https://github.com/AojunZhou/Incremental-Network-Quantization/blob/c7f6a609d5817d8424ce224209cf4c50f1e4de50/scripts/cpp_lint.py#L495-L497 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/base.py | python | BaseContext.get_preferred_array_alignment | (context, ty) | return 32 | Get preferred array alignment for Numba type *ty*. | Get preferred array alignment for Numba type *ty*. | [
"Get",
"preferred",
"array",
"alignment",
"for",
"Numba",
"type",
"*",
"ty",
"*",
"."
] | def get_preferred_array_alignment(context, ty):
"""
Get preferred array alignment for Numba type *ty*.
"""
# AVX prefers 32-byte alignment
return 32 | [
"def",
"get_preferred_array_alignment",
"(",
"context",
",",
"ty",
")",
":",
"# AVX prefers 32-byte alignment",
"return",
"32"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/base.py#L1092-L1097 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | Toolbook.Realize | (*args, **kwargs) | return _controls_.Toolbook_Realize(*args, **kwargs) | Realize(self) | Realize(self) | [
"Realize",
"(",
"self",
")"
] | def Realize(*args, **kwargs):
"""Realize(self)"""
return _controls_.Toolbook_Realize(*args, **kwargs) | [
"def",
"Realize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Toolbook_Realize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3388-L3390 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/profiler/internal/flops_registry.py | python | _neg_flops | (graph, node) | return _unary_op_flops(graph, node) | Compute flops for Neg operation. | Compute flops for Neg operation. | [
"Compute",
"flops",
"for",
"Neg",
"operation",
"."
] | def _neg_flops(graph, node):
"""Compute flops for Neg operation."""
return _unary_op_flops(graph, node) | [
"def",
"_neg_flops",
"(",
"graph",
",",
"node",
")",
":",
"return",
"_unary_op_flops",
"(",
"graph",
",",
"node",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/profiler/internal/flops_registry.py#L93-L95 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/SConf.py | python | SConfBase.Define | (self, name, value = None, comment = None) | Define a pre processor symbol name, with the optional given value in the
current config header.
If value is None (default), then #define name is written. If value is not
none, then #define name value is written.
comment is a string which will be put as a C comment in the header, to exp... | Define a pre processor symbol name, with the optional given value in the
current config header. | [
"Define",
"a",
"pre",
"processor",
"symbol",
"name",
"with",
"the",
"optional",
"given",
"value",
"in",
"the",
"current",
"config",
"header",
"."
] | def Define(self, name, value = None, comment = None):
"""
Define a pre processor symbol name, with the optional given value in the
current config header.
If value is None (default), then #define name is written. If value is not
none, then #define name value is written.
... | [
"def",
"Define",
"(",
"self",
",",
"name",
",",
"value",
"=",
"None",
",",
"comment",
"=",
"None",
")",
":",
"lines",
"=",
"[",
"]",
"if",
"comment",
":",
"comment_str",
"=",
"\"/* %s */\"",
"%",
"comment",
"lines",
".",
"append",
"(",
"comment_str",
... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/SConf.py#L472-L495 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/kde.py | python | gaussian_kde.integrate_box_1d | (self, low, high) | return value | Computes the integral of a 1D pdf between two bounds.
Parameters
----------
low : scalar
Lower bound of integration.
high : scalar
Upper bound of integration.
Returns
-------
value : scalar
The result of the integral.
... | Computes the integral of a 1D pdf between two bounds. | [
"Computes",
"the",
"integral",
"of",
"a",
"1D",
"pdf",
"between",
"two",
"bounds",
"."
] | def integrate_box_1d(self, low, high):
"""
Computes the integral of a 1D pdf between two bounds.
Parameters
----------
low : scalar
Lower bound of integration.
high : scalar
Upper bound of integration.
Returns
-------
valu... | [
"def",
"integrate_box_1d",
"(",
"self",
",",
"low",
",",
"high",
")",
":",
"if",
"self",
".",
"d",
"!=",
"1",
":",
"raise",
"ValueError",
"(",
"\"integrate_box_1d() only handles 1D pdfs\"",
")",
"stdev",
"=",
"ravel",
"(",
"sqrt",
"(",
"self",
".",
"covari... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/kde.py#L279-L311 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/resource_variable_ops.py | python | BaseResourceVariable.device | (self) | return self.handle.device | The device this variable is on. | The device this variable is on. | [
"The",
"device",
"this",
"variable",
"is",
"on",
"."
] | def device(self):
"""The device this variable is on."""
return self.handle.device | [
"def",
"device",
"(",
"self",
")",
":",
"return",
"self",
".",
"handle",
".",
"device"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/resource_variable_ops.py#L559-L561 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.