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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/toasterbox.py | python | ToasterBox.SetPopupBitmap | (self, bitmap=None) | Sets the :class:`ToasterBox` background image.
:param `bitmap`: a valid :class:`Bitmap` object or filename. If defaulted
to ``None``, then no background bitmap is used.
:note: Use this method only for a :class:`ToasterBox` created with the ``TB_SIMPLE`` style. | Sets the :class:`ToasterBox` background image. | [
"Sets",
"the",
":",
"class",
":",
"ToasterBox",
"background",
"image",
"."
] | def SetPopupBitmap(self, bitmap=None):
"""
Sets the :class:`ToasterBox` background image.
:param `bitmap`: a valid :class:`Bitmap` object or filename. If defaulted
to ``None``, then no background bitmap is used.
:note: Use this method only for a :class:`ToasterBox` cr... | [
"def",
"SetPopupBitmap",
"(",
"self",
",",
"bitmap",
"=",
"None",
")",
":",
"if",
"bitmap",
"is",
"not",
"None",
":",
"if",
"isinstance",
"(",
"bitmap",
",",
"basestring",
")",
":",
"bitmap",
"=",
"wx",
".",
"Bitmap",
"(",
"bitmap",
")",
"self",
".",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/toasterbox.py#L456-L470 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/lib/inputhook.py | python | InputHookManager.clear_inputhook | (self, app=None) | return original | DEPRECATED since IPython 5.0
Set PyOS_InputHook to NULL and return the previous one.
Parameters
----------
app : optional, ignored
This parameter is allowed only so that clear_inputhook() can be
called with a similar interface as all the ``enable_*`` methods. But
... | DEPRECATED since IPython 5.0 | [
"DEPRECATED",
"since",
"IPython",
"5",
".",
"0"
] | def clear_inputhook(self, app=None):
"""DEPRECATED since IPython 5.0
Set PyOS_InputHook to NULL and return the previous one.
Parameters
----------
app : optional, ignored
This parameter is allowed only so that clear_inputhook() can be
called with a similar i... | [
"def",
"clear_inputhook",
"(",
"self",
",",
"app",
"=",
"None",
")",
":",
"warn",
"(",
"\"`clear_inputhook` is deprecated since IPython 5.0 and will be removed in future versions.\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"pyos_inputhook_ptr",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/lib/inputhook.py#L166-L186 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/PythonUtil.py | python | fitSrcAngle2Dest | (src, dest) | return dest + reduceAngle(src - dest) | given a src and destination angle, returns an equivalent src angle
that is within [-180..180) of dest
examples:
fitSrcAngle2Dest(30, 60) == 30
fitSrcAngle2Dest(60, 30) == 60
fitSrcAngle2Dest(0, 180) == 0
fitSrcAngle2Dest(-1, 180) == 359
fitSrcAngle2Dest(-180, 180) == 180 | given a src and destination angle, returns an equivalent src angle
that is within [-180..180) of dest
examples:
fitSrcAngle2Dest(30, 60) == 30
fitSrcAngle2Dest(60, 30) == 60
fitSrcAngle2Dest(0, 180) == 0
fitSrcAngle2Dest(-1, 180) == 359
fitSrcAngle2Dest(-180, 180) == 180 | [
"given",
"a",
"src",
"and",
"destination",
"angle",
"returns",
"an",
"equivalent",
"src",
"angle",
"that",
"is",
"within",
"[",
"-",
"180",
"..",
"180",
")",
"of",
"dest",
"examples",
":",
"fitSrcAngle2Dest",
"(",
"30",
"60",
")",
"==",
"30",
"fitSrcAngl... | def fitSrcAngle2Dest(src, dest):
"""
given a src and destination angle, returns an equivalent src angle
that is within [-180..180) of dest
examples:
fitSrcAngle2Dest(30, 60) == 30
fitSrcAngle2Dest(60, 30) == 60
fitSrcAngle2Dest(0, 180) == 0
fitSrcAngle2Dest(-1, 180) == 359
fitSrcAngl... | [
"def",
"fitSrcAngle2Dest",
"(",
"src",
",",
"dest",
")",
":",
"return",
"dest",
"+",
"reduceAngle",
"(",
"src",
"-",
"dest",
")"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/PythonUtil.py#L487-L498 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/control-examples/OperationalSpaceController.py | python | LinkTask.__init__ | (self, robot, linkNo, taskType, baseLinkNo=-1) | Supply a robot and link number to control. taskType can be:
-'po' for position and orientation (in concordance with se3, the task variables are a matrix (R,t))
-'position' for position only
-'orientation' for orientation only.
For po and position tasks the localPosition member can be set to
control a specif... | Supply a robot and link number to control. taskType can be:
-'po' for position and orientation (in concordance with se3, the task variables are a matrix (R,t))
-'position' for position only
-'orientation' for orientation only. | [
"Supply",
"a",
"robot",
"and",
"link",
"number",
"to",
"control",
".",
"taskType",
"can",
"be",
":",
"-",
"po",
"for",
"position",
"and",
"orientation",
"(",
"in",
"concordance",
"with",
"se3",
"the",
"task",
"variables",
"are",
"a",
"matrix",
"(",
"R",
... | def __init__(self, robot, linkNo, taskType, baseLinkNo=-1):
"""Supply a robot and link number to control. taskType can be:
-'po' for position and orientation (in concordance with se3, the task variables are a matrix (R,t))
-'position' for position only
-'orientation' for orientation only.
For po and positio... | [
"def",
"__init__",
"(",
"self",
",",
"robot",
",",
"linkNo",
",",
"taskType",
",",
"baseLinkNo",
"=",
"-",
"1",
")",
":",
"Task",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"linkNo",
"=",
"linkNo",
"self",
".",
"link",
"=",
"robot",
".",
"link... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/control-examples/OperationalSpaceController.py#L702-L730 | ||
godlikepanos/anki-3d-engine | e2f65e5045624492571ea8527a4dbf3fad8d2c0a | ThirdParty/Glslang/update_glslang_sources.py | python | GoodCommit.GetUrl | (self) | return '{host}{subrepo}'.format(
host=host,
subrepo=self.subrepo) | Returns the URL for the repository. | Returns the URL for the repository. | [
"Returns",
"the",
"URL",
"for",
"the",
"repository",
"."
] | def GetUrl(self):
"""Returns the URL for the repository."""
host = SITE_TO_HOST[self.site]
return '{host}{subrepo}'.format(
host=host,
subrepo=self.subrepo) | [
"def",
"GetUrl",
"(",
"self",
")",
":",
"host",
"=",
"SITE_TO_HOST",
"[",
"self",
".",
"site",
"]",
"return",
"'{host}{subrepo}'",
".",
"format",
"(",
"host",
"=",
"host",
",",
"subrepo",
"=",
"self",
".",
"subrepo",
")"
] | https://github.com/godlikepanos/anki-3d-engine/blob/e2f65e5045624492571ea8527a4dbf3fad8d2c0a/ThirdParty/Glslang/update_glslang_sources.py#L89-L94 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/math_grad.py | python | _SumGrad | (op, grad) | return [array_ops.tile(grad, tile_scaling), None] | Gradient for Sum. | Gradient for Sum. | [
"Gradient",
"for",
"Sum",
"."
] | def _SumGrad(op, grad):
"""Gradient for Sum."""
# Fast path for when reducing to a scalar and ndims is known: adds only
# Reshape and Tile ops (and possibly a Shape).
if (op.inputs[0].get_shape().ndims is not None and op.inputs[1].op.type ==
"Const"):
rank = op.inputs[0].get_shape().ndims
axes = t... | [
"def",
"_SumGrad",
"(",
"op",
",",
"grad",
")",
":",
"# Fast path for when reducing to a scalar and ndims is known: adds only",
"# Reshape and Tile ops (and possibly a Shape).",
"if",
"(",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"ndims",
"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/math_grad.py#L39-L60 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Window.SetForegroundColour | (*args, **kwargs) | return _core_.Window_SetForegroundColour(*args, **kwargs) | SetForegroundColour(self, Colour colour) -> bool
Sets the foreground colour of the window. Returns True is the colour
was changed. The interpretation of foreground colour is dependent on
the window class; it may be the text colour or other colour, or it may
not be used at all. | SetForegroundColour(self, Colour colour) -> bool | [
"SetForegroundColour",
"(",
"self",
"Colour",
"colour",
")",
"-",
">",
"bool"
] | def SetForegroundColour(*args, **kwargs):
"""
SetForegroundColour(self, Colour colour) -> bool
Sets the foreground colour of the window. Returns True is the colour
was changed. The interpretation of foreground colour is dependent on
the window class; it may be the text colour ... | [
"def",
"SetForegroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_SetForegroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L10869-L10878 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py | python | ParseResults.clear | ( self ) | Clear all elements and results names. | [] | def clear( self ):
"""
Clear all elements and results names.
"""
del self.__toklist[:]
self.__tokdict.clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"del",
"self",
".",
"__toklist",
"[",
":",
"]",
"self",
".",
"__tokdict",
".",
"clear",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L1273-L1283 | |||
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/experimental/mongodb_dataset_ops.py | python | _MongoDBHandler.get_healthy_resource | (self) | return resource | Retrieve the resource which is connected to a healthy node | Retrieve the resource which is connected to a healthy node | [
"Retrieve",
"the",
"resource",
"which",
"is",
"connected",
"to",
"a",
"healthy",
"node"
] | def get_healthy_resource(self):
"""Retrieve the resource which is connected to a healthy node"""
resource = core_ops.io_mongo_db_readable_init(
uri=self.uri,
database=self.database,
collection=self.collection,
)
print(f"Connection successful: {self.ur... | [
"def",
"get_healthy_resource",
"(",
"self",
")",
":",
"resource",
"=",
"core_ops",
".",
"io_mongo_db_readable_init",
"(",
"uri",
"=",
"self",
".",
"uri",
",",
"database",
"=",
"self",
".",
"database",
",",
"collection",
"=",
"self",
".",
"collection",
",",
... | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/mongodb_dataset_ops.py#L33-L42 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py | python | ResourceManager.resource_listdir | (self, package_or_requirement, resource_name) | return get_provider(package_or_requirement).resource_listdir(
resource_name
) | List the contents of the named resource directory | List the contents of the named resource directory | [
"List",
"the",
"contents",
"of",
"the",
"named",
"resource",
"directory"
] | def resource_listdir(self, package_or_requirement, resource_name):
"""List the contents of the named resource directory"""
return get_provider(package_or_requirement).resource_listdir(
resource_name
) | [
"def",
"resource_listdir",
"(",
"self",
",",
"package_or_requirement",
",",
"resource_name",
")",
":",
"return",
"get_provider",
"(",
"package_or_requirement",
")",
".",
"resource_listdir",
"(",
"resource_name",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L1161-L1165 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py | python | SConfBase.TryAction | (self, action, text = None, extension = "") | return (0, "") | Tries to execute the given action with optional source file
contents <text> and optional source file extension <extension>,
Returns the status (0 : failed, 1 : ok) and the contents of the
output file. | Tries to execute the given action with optional source file
contents <text> and optional source file extension <extension>,
Returns the status (0 : failed, 1 : ok) and the contents of the
output file. | [
"Tries",
"to",
"execute",
"the",
"given",
"action",
"with",
"optional",
"source",
"file",
"contents",
"<text",
">",
"and",
"optional",
"source",
"file",
"extension",
"<extension",
">",
"Returns",
"the",
"status",
"(",
"0",
":",
"failed",
"1",
":",
"ok",
")... | def TryAction(self, action, text = None, extension = ""):
"""Tries to execute the given action with optional source file
contents <text> and optional source file extension <extension>,
Returns the status (0 : failed, 1 : ok) and the contents of the
output file.
"""
builde... | [
"def",
"TryAction",
"(",
"self",
",",
"action",
",",
"text",
"=",
"None",
",",
"extension",
"=",
"\"\"",
")",
":",
"builder",
"=",
"SCons",
".",
"Builder",
".",
"Builder",
"(",
"action",
"=",
"action",
")",
"self",
".",
"env",
".",
"Append",
"(",
"... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py#L600-L613 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextFileHandler.GetName | (*args, **kwargs) | return _richtext.RichTextFileHandler_GetName(*args, **kwargs) | GetName(self) -> String | GetName(self) -> String | [
"GetName",
"(",
"self",
")",
"-",
">",
"String"
] | def GetName(*args, **kwargs):
"""GetName(self) -> String"""
return _richtext.RichTextFileHandler_GetName(*args, **kwargs) | [
"def",
"GetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextFileHandler_GetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2792-L2794 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/lldb_controller.py | python | LLDBController.__init__ | (self) | Creates the LLDB SBDebugger object and initializes the UI class. | Creates the LLDB SBDebugger object and initializes the UI class. | [
"Creates",
"the",
"LLDB",
"SBDebugger",
"object",
"and",
"initializes",
"the",
"UI",
"class",
"."
] | def __init__(self):
""" Creates the LLDB SBDebugger object and initializes the UI class. """
self.target = None
self.process = None
self.load_dependent_modules = True
self.dbg = lldb.SBDebugger.Create()
self.commandInterpreter = self.dbg.GetCommandInterpreter()
... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"target",
"=",
"None",
"self",
".",
"process",
"=",
"None",
"self",
".",
"load_dependent_modules",
"=",
"True",
"self",
".",
"dbg",
"=",
"lldb",
".",
"SBDebugger",
".",
"Create",
"(",
")",
"self",
... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/lldb_controller.py#L72-L81 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | RadioBox.SetString | (*args, **kwargs) | return _controls_.RadioBox_SetString(*args, **kwargs) | SetString(self, int n, String label) | SetString(self, int n, String label) | [
"SetString",
"(",
"self",
"int",
"n",
"String",
"label",
")"
] | def SetString(*args, **kwargs):
"""SetString(self, int n, String label)"""
return _controls_.RadioBox_SetString(*args, **kwargs) | [
"def",
"SetString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"RadioBox_SetString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2631-L2633 | |
qt/qt | 0a2f2382541424726168804be2c90b91381608c6 | src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.WriteList | (self, list, variable=None, prefix='', quoter=QuoteIfNecessary) | Write a variable definition that is a list of values.
E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out
foo = blaha blahb
but in a pretty-printed style. | Write a variable definition that is a list of values. | [
"Write",
"a",
"variable",
"definition",
"that",
"is",
"a",
"list",
"of",
"values",
"."
] | def WriteList(self, list, variable=None, prefix='', quoter=QuoteIfNecessary):
"""Write a variable definition that is a list of values.
E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out
foo = blaha blahb
but in a pretty-printed style.
"""
self.fp.write(variable + " := ")
if lis... | [
"def",
"WriteList",
"(",
"self",
",",
"list",
",",
"variable",
"=",
"None",
",",
"prefix",
"=",
"''",
",",
"quoter",
"=",
"QuoteIfNecessary",
")",
":",
"self",
".",
"fp",
".",
"write",
"(",
"variable",
"+",
"\" := \"",
")",
"if",
"list",
":",
"list",... | https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/generator/make.py#L1059-L1070 | ||
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/utils/model_frameworks/base.py | python | framework | (clz) | return clz | Registers a framework and it's wrapper methods to make it
behave like a flax framework. | Registers a framework and it's wrapper methods to make it
behave like a flax framework. | [
"Registers",
"a",
"framework",
"and",
"it",
"s",
"wrapper",
"methods",
"to",
"make",
"it",
"behave",
"like",
"a",
"flax",
"framework",
"."
] | def framework(clz):
"""
Registers a framework and it's wrapper methods to make it
behave like a flax framework.
"""
clz = dataclasses.dataclass(frozen=True)(clz)
registered_frameworks.append(clz)
return clz | [
"def",
"framework",
"(",
"clz",
")",
":",
"clz",
"=",
"dataclasses",
".",
"dataclass",
"(",
"frozen",
"=",
"True",
")",
"(",
"clz",
")",
"registered_frameworks",
".",
"append",
"(",
"clz",
")",
"return",
"clz"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/utils/model_frameworks/base.py#L51-L58 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Rect.SetPosition | (*args, **kwargs) | return _core_.Rect_SetPosition(*args, **kwargs) | SetPosition(self, Point p) | SetPosition(self, Point p) | [
"SetPosition",
"(",
"self",
"Point",
"p",
")"
] | def SetPosition(*args, **kwargs):
"""SetPosition(self, Point p)"""
return _core_.Rect_SetPosition(*args, **kwargs) | [
"def",
"SetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect_SetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1305-L1307 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | NDArray.__iadd__ | (self, other) | x.__iadd__(y) <=> x+=y | x.__iadd__(y) <=> x+=y | [
"x",
".",
"__iadd__",
"(",
"y",
")",
"<",
"=",
">",
"x",
"+",
"=",
"y"
] | def __iadd__(self, other):
"""x.__iadd__(y) <=> x+=y """
if not self.writable:
raise ValueError('trying to add to a readonly NDArray')
if isinstance(other, NDArray):
return op.broadcast_add(self, other, out=self)
elif isinstance(other, numeric_types):
... | [
"def",
"__iadd__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"self",
".",
"writable",
":",
"raise",
"ValueError",
"(",
"'trying to add to a readonly NDArray'",
")",
"if",
"isinstance",
"(",
"other",
",",
"NDArray",
")",
":",
"return",
"op",
".",
"b... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L200-L209 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/tabart.py | python | AuiDefaultTabArt.ShowDropDown | (self, wnd, pages, active_idx) | return -1 | Shows the drop-down window menu on the tab area.
:param `wnd`: a :class:`Window` derived window instance;
:param list `pages`: the pages associated with the tabs;
:param integer `active_idx`: the active tab index. | Shows the drop-down window menu on the tab area. | [
"Shows",
"the",
"drop",
"-",
"down",
"window",
"menu",
"on",
"the",
"tab",
"area",
"."
] | def ShowDropDown(self, wnd, pages, active_idx):
"""
Shows the drop-down window menu on the tab area.
:param `wnd`: a :class:`Window` derived window instance;
:param list `pages`: the pages associated with the tabs;
:param integer `active_idx`: the active tab index.
"""
... | [
"def",
"ShowDropDown",
"(",
"self",
",",
"wnd",
",",
"pages",
",",
"active_idx",
")",
":",
"useImages",
"=",
"self",
".",
"GetAGWFlags",
"(",
")",
"&",
"AUI_NB_USE_IMAGES_DROPDOWN",
"menuPopup",
"=",
"wx",
".",
"Menu",
"(",
")",
"longest",
"=",
"0",
"for... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/tabart.py#L915-L986 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/pot/openvino/tools/pot/engines/ac_engine.py | python | ACEngine.predict | (self, stats_layout=None, sampler=None, stat_aliases=None,
metric_per_sample=False, print_progress=False) | return metrics, accumulated_stats | Performs model inference on specified dataset subset
:param stats_layout: dict of stats collection functions {node_name: {stat_name: fn}} (optional)
:param sampler: entity to make dataset sampling
:param stat_aliases: dict of algorithms collections stats
{algorithm_name: {node... | Performs model inference on specified dataset subset
:param stats_layout: dict of stats collection functions {node_name: {stat_name: fn}} (optional)
:param sampler: entity to make dataset sampling
:param stat_aliases: dict of algorithms collections stats
{algorithm_name: {node... | [
"Performs",
"model",
"inference",
"on",
"specified",
"dataset",
"subset",
":",
"param",
"stats_layout",
":",
"dict",
"of",
"stats",
"collection",
"functions",
"{",
"node_name",
":",
"{",
"stat_name",
":",
"fn",
"}}",
"(",
"optional",
")",
":",
"param",
"samp... | def predict(self, stats_layout=None, sampler=None, stat_aliases=None,
metric_per_sample=False, print_progress=False):
""" Performs model inference on specified dataset subset
:param stats_layout: dict of stats collection functions {node_name: {stat_name: fn}} (optional)
:param ... | [
"def",
"predict",
"(",
"self",
",",
"stats_layout",
"=",
"None",
",",
"sampler",
"=",
"None",
",",
"stat_aliases",
"=",
"None",
",",
"metric_per_sample",
"=",
"False",
",",
"print_progress",
"=",
"False",
")",
":",
"if",
"self",
".",
"_model",
"is",
"Non... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/pot/openvino/tools/pot/engines/ac_engine.py#L104-L220 | |
husixu1/HUST-Homeworks | fbf6ed749eacab6e14bffea83703aadaf9324828 | DataMining/src/userBasedCF.py | python | readData | (path) | return numpy.delete(numpy.array(dataFrame), numpy.s_[:1], axis=1) | read data into 2-dimensional array
:param path: path to the xml data file
:return: pandas data frame | read data into 2-dimensional array
:param path: path to the xml data file
:return: pandas data frame | [
"read",
"data",
"into",
"2",
"-",
"dimensional",
"array",
":",
"param",
"path",
":",
"path",
"to",
"the",
"xml",
"data",
"file",
":",
"return",
":",
"pandas",
"data",
"frame"
] | def readData(path):
"""
read data into 2-dimensional array
:param path: path to the xml data file
:return: pandas data frame
"""
logging.info("reading data file ", path)
dataFrame = pandas.read_csv(path)
logging.info("data file ", path, " read")
return numpy.delete(numpy.array(dataFr... | [
"def",
"readData",
"(",
"path",
")",
":",
"logging",
".",
"info",
"(",
"\"reading data file \"",
",",
"path",
")",
"dataFrame",
"=",
"pandas",
".",
"read_csv",
"(",
"path",
")",
"logging",
".",
"info",
"(",
"\"data file \"",
",",
"path",
",",
"\" read\"",
... | https://github.com/husixu1/HUST-Homeworks/blob/fbf6ed749eacab6e14bffea83703aadaf9324828/DataMining/src/userBasedCF.py#L9-L18 | |
verilog-to-routing/vtr-verilog-to-routing | d9719cf7374821156c3cee31d66991cb85578562 | libs/EXTERNAL/libcatch2/tools/scripts/updateDocumentToC.py | python | dashifyHeadline | (line) | return [stripped_wspace, dashified, level] | Takes a header line from a Markdown document and
returns a tuple of the
'#'-stripped version of the head line,
a string version for <a id=''></a> anchor tags,
and the level of the headline as integer.
E.g.,
>>> dashifyHeadline('### some header lvl3')
('Some header lvl3', 'some-he... | Takes a header line from a Markdown document and
returns a tuple of the
'#'-stripped version of the head line,
a string version for <a id=''></a> anchor tags,
and the level of the headline as integer.
E.g.,
>>> dashifyHeadline('### some header lvl3')
('Some header lvl3', 'some-he... | [
"Takes",
"a",
"header",
"line",
"from",
"a",
"Markdown",
"document",
"and",
"returns",
"a",
"tuple",
"of",
"the",
"#",
"-",
"stripped",
"version",
"of",
"the",
"head",
"line",
"a",
"string",
"version",
"for",
"<a",
"id",
"=",
">",
"<",
"/",
"a",
">",... | def dashifyHeadline(line):
"""
Takes a header line from a Markdown document and
returns a tuple of the
'#'-stripped version of the head line,
a string version for <a id=''></a> anchor tags,
and the level of the headline as integer.
E.g.,
>>> dashifyHeadline('### some header l... | [
"def",
"dashifyHeadline",
"(",
"line",
")",
":",
"stripped_right",
"=",
"line",
".",
"rstrip",
"(",
"'#'",
")",
"stripped_both",
"=",
"stripped_right",
".",
"lstrip",
"(",
"'#'",
")",
"level",
"=",
"len",
"(",
"stripped_right",
")",
"-",
"len",
"(",
"str... | https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/libs/EXTERNAL/libcatch2/tools/scripts/updateDocumentToC.py#L77-L109 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Tool/GettextCommon.py | python | _detect_xgettext | (env) | return None | Detects *xgettext(1)* binary | Detects *xgettext(1)* binary | [
"Detects",
"*",
"xgettext",
"(",
"1",
")",
"*",
"binary"
] | def _detect_xgettext(env):
""" Detects *xgettext(1)* binary """
if 'XGETTEXT' in env:
return env['XGETTEXT']
xgettext = env.Detect('xgettext')
if xgettext:
return xgettext
raise SCons.Errors.StopError(XgettextNotFound, "Could not detect xgettext")
return None | [
"def",
"_detect_xgettext",
"(",
"env",
")",
":",
"if",
"'XGETTEXT'",
"in",
"env",
":",
"return",
"env",
"[",
"'XGETTEXT'",
"]",
"xgettext",
"=",
"env",
".",
"Detect",
"(",
"'xgettext'",
")",
"if",
"xgettext",
":",
"return",
"xgettext",
"raise",
"SCons",
... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/GettextCommon.py#L389-L397 | |
alexozer/jankdrone | c4b403eb254b41b832ab2bdfade12ba59c99e5dc | shm/lib/nanopb/generator/nanopb_generator.py | python | main_cli | () | Main function when invoked directly from the command line. | Main function when invoked directly from the command line. | [
"Main",
"function",
"when",
"invoked",
"directly",
"from",
"the",
"command",
"line",
"."
] | def main_cli():
'''Main function when invoked directly from the command line.'''
options, filenames = optparser.parse_args()
if not filenames:
optparser.print_help()
sys.exit(1)
if options.quiet:
options.verbose = False
if options.output_dir and not os.path.exists(options... | [
"def",
"main_cli",
"(",
")",
":",
"options",
",",
"filenames",
"=",
"optparser",
".",
"parse_args",
"(",
")",
"if",
"not",
"filenames",
":",
"optparser",
".",
"print_help",
"(",
")",
"sys",
".",
"exit",
"(",
"1",
")",
"if",
"options",
".",
"quiet",
"... | https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/shm/lib/nanopb/generator/nanopb_generator.py#L1513-L1547 | ||
facebook/bistro | db9eff7e92f5cedcc917a440d5c88064c7980e40 | build/fbcode_builder/getdeps/manifest.py | python | ManifestParser.is_first_party_project | (self) | return self.shipit_project is not None | returns true if this is an FB first-party project | returns true if this is an FB first-party project | [
"returns",
"true",
"if",
"this",
"is",
"an",
"FB",
"first",
"-",
"party",
"project"
] | def is_first_party_project(self):
"""returns true if this is an FB first-party project"""
return self.shipit_project is not None | [
"def",
"is_first_party_project",
"(",
"self",
")",
":",
"return",
"self",
".",
"shipit_project",
"is",
"not",
"None"
] | https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/getdeps/manifest.py#L354-L356 | |
jainaman224/Algo_Ds_Notes | b0c11a2efe40c827072c63a5c8c4c8994cf4b37b | Binary_Tree_Right_View/Binary_Tree_Right_View.py | python | rightView | (root) | Map mp contains:
[0] -> 1
[1] -> 3
[2] -> 7
[3] -> 9 | Map mp contains:
[0] -> 1
[1] -> 3
[2] -> 7
[3] -> 9 | [
"Map",
"mp",
"contains",
":",
"[",
"0",
"]",
"-",
">",
"1",
"[",
"1",
"]",
"-",
">",
"3",
"[",
"2",
"]",
"-",
">",
"7",
"[",
"3",
"]",
"-",
">",
"9"
] | def rightView(root):
if root is None:
return
# initialising variables
q = queue.Queue()
q.put(root)
root.level = 0
mp = {}
# variable to store level of nodes
level = 0
# asigning level to each node of Binary Tree
# storing first node of same level in a map
# with ... | [
"def",
"rightView",
"(",
"root",
")",
":",
"if",
"root",
"is",
"None",
":",
"return",
"# initialising variables",
"q",
"=",
"queue",
".",
"Queue",
"(",
")",
"q",
".",
"put",
"(",
"root",
")",
"root",
".",
"level",
"=",
"0",
"mp",
"=",
"{",
"}",
"... | https://github.com/jainaman224/Algo_Ds_Notes/blob/b0c11a2efe40c827072c63a5c8c4c8994cf4b37b/Binary_Tree_Right_View/Binary_Tree_Right_View.py#L20-L69 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/io.py | python | load_persistables | (executor, dirname, main_program=None, filename=None) | :api_attr: Static Graph
This API filters out all variables with ``persistable==True`` from the
given ``main_program`` and then tries to load these variables from the
directory ``dirname`` or the file ``filename``.
Use the ``dirname`` to specify the directory where persistable variables
(refer to :... | :api_attr: Static Graph | [
":",
"api_attr",
":",
"Static",
"Graph"
] | def load_persistables(executor, dirname, main_program=None, filename=None):
"""
:api_attr: Static Graph
This API filters out all variables with ``persistable==True`` from the
given ``main_program`` and then tries to load these variables from the
directory ``dirname`` or the file ``filename``.
... | [
"def",
"load_persistables",
"(",
"executor",
",",
"dirname",
",",
"main_program",
"=",
"None",
",",
"filename",
"=",
"None",
")",
":",
"if",
"main_program",
"and",
"main_program",
".",
"_is_distributed",
":",
"_load_distributed_persistables",
"(",
"executor",
",",... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/io.py#L1042-L1094 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py | python | obj_analysis.get_result_ptr_type_prefix | (self) | Returns the *Ptr type prefix. | Returns the *Ptr type prefix. | [
"Returns",
"the",
"*",
"Ptr",
"type",
"prefix",
"."
] | def get_result_ptr_type_prefix(self):
""" Returns the *Ptr type prefix. """
if self.is_result_refptr():
return 'ref'
if self.is_result_ownptr():
return 'own'
if self.is_result_rawptr():
return 'raw'
raise Exception('Not a pointer type') | [
"def",
"get_result_ptr_type_prefix",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_result_refptr",
"(",
")",
":",
"return",
"'ref'",
"if",
"self",
".",
"is_result_ownptr",
"(",
")",
":",
"return",
"'own'",
"if",
"self",
".",
"is_result_rawptr",
"(",
")",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py#L1812-L1820 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewItemAttr.SetBold | (*args, **kwargs) | return _dataview.DataViewItemAttr_SetBold(*args, **kwargs) | SetBold(self, bool set) | SetBold(self, bool set) | [
"SetBold",
"(",
"self",
"bool",
"set",
")"
] | def SetBold(*args, **kwargs):
"""SetBold(self, bool set)"""
return _dataview.DataViewItemAttr_SetBold(*args, **kwargs) | [
"def",
"SetBold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewItemAttr_SetBold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L337-L339 | |
abforce/xposed_art_n | ec3fbe417d74d4664cec053d91dd4e3881176374 | tools/cpplint.py | python | _IncludeState.CheckNextIncludeOrder | (self, header_type) | return '' | Returns a non-empty error message if the next header is out of order.
This function also updates the internal state to be ready to check
the next include.
Args:
header_type: One of the _XXX_HEADER constants defined above.
Returns:
The empty string if the header is in the right order, or a... | Returns a non-empty error message if the next header is out of order. | [
"Returns",
"a",
"non",
"-",
"empty",
"error",
"message",
"if",
"the",
"next",
"header",
"is",
"out",
"of",
"order",
"."
] | def CheckNextIncludeOrder(self, header_type):
"""Returns a non-empty error message if the next header is out of order.
This function also updates the internal state to be ready to check
the next include.
Args:
header_type: One of the _XXX_HEADER constants defined above.
Returns:
The e... | [
"def",
"CheckNextIncludeOrder",
"(",
"self",
",",
"header_type",
")",
":",
"error_message",
"=",
"(",
"'Found %s after %s'",
"%",
"(",
"self",
".",
"_TYPE_NAMES",
"[",
"header_type",
"]",
",",
"self",
".",
"_SECTION_NAMES",
"[",
"self",
".",
"_section",
"]",
... | https://github.com/abforce/xposed_art_n/blob/ec3fbe417d74d4664cec053d91dd4e3881176374/tools/cpplint.py#L501-L552 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/reshape/tile.py | python | _format_labels | (bins, precision, right=True,
include_lowest=False, dtype=None) | return labels | based on the dtype, return our labels | based on the dtype, return our labels | [
"based",
"on",
"the",
"dtype",
"return",
"our",
"labels"
] | def _format_labels(bins, precision, right=True,
include_lowest=False, dtype=None):
""" based on the dtype, return our labels """
closed = 'right' if right else 'left'
if is_datetime64tz_dtype(dtype):
formatter = partial(Timestamp, tz=dtype.tz)
adjust = lambda x: x - Time... | [
"def",
"_format_labels",
"(",
"bins",
",",
"precision",
",",
"right",
"=",
"True",
",",
"include_lowest",
"=",
"False",
",",
"dtype",
"=",
"None",
")",
":",
"closed",
"=",
"'right'",
"if",
"right",
"else",
"'left'",
"if",
"is_datetime64tz_dtype",
"(",
"dty... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/reshape/tile.py#L460-L491 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang-tools-extra/clangd/quality/CompletionModelCodegen.py | python | tree | (t, tree_num, node_num) | return code+false_code+true_code, 1+false_size+true_size | Returns code for inferencing a Decision Tree.
Also returns the size of the decision tree.
A tree starts with its label `t{tree#}`.
A node of the tree starts with label `t{tree#}_n{node#}`.
The tree contains two types of node: Conditional node and Leaf node.
- Conditional node evaluates a conditi... | Returns code for inferencing a Decision Tree.
Also returns the size of the decision tree. | [
"Returns",
"code",
"for",
"inferencing",
"a",
"Decision",
"Tree",
".",
"Also",
"returns",
"the",
"size",
"of",
"the",
"decision",
"tree",
"."
] | def tree(t, tree_num, node_num):
"""Returns code for inferencing a Decision Tree.
Also returns the size of the decision tree.
A tree starts with its label `t{tree#}`.
A node of the tree starts with label `t{tree#}_n{node#}`.
The tree contains two types of node: Conditional node and Leaf node.
... | [
"def",
"tree",
"(",
"t",
",",
"tree_num",
",",
"node_num",
")",
":",
"label",
"=",
"\"t%d_n%d\"",
"%",
"(",
"tree_num",
",",
"node_num",
")",
"code",
"=",
"[",
"]",
"if",
"t",
"[",
"\"operation\"",
"]",
"==",
"\"boost\"",
":",
"code",
".",
"append",
... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang-tools-extra/clangd/quality/CompletionModelCodegen.py#L79-L111 | |
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/data/weight_to_sqlite.py | python | qianlong_import_weight | (connect, src_dir, market) | return total_count | 导入钱龙格式的权息数据 | 导入钱龙格式的权息数据 | [
"导入钱龙格式的权息数据"
] | def qianlong_import_weight(connect, src_dir, market):
"""导入钱龙格式的权息数据"""
cur = connect.cursor()
marketid = cur.execute("select marketid from Market where market='%s'" % market)
marketid = [id[0] for id in marketid]
marketid = marketid[0]
src_path = pathlib.Path(src_dir + '/shase/weight') if mark... | [
"def",
"qianlong_import_weight",
"(",
"connect",
",",
"src_dir",
",",
"market",
")",
":",
"cur",
"=",
"connect",
".",
"cursor",
"(",
")",
"marketid",
"=",
"cur",
".",
"execute",
"(",
"\"select marketid from Market where market='%s'\"",
"%",
"market",
")",
"marke... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/data/weight_to_sqlite.py#L28-L70 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/onnx2mx/_op_translations.py | python | _slice | (attrs, inputs, proto_obj) | return slice_op, new_attrs, inputs | Returns a slice of the input tensor along multiple axes. | Returns a slice of the input tensor along multiple axes. | [
"Returns",
"a",
"slice",
"of",
"the",
"input",
"tensor",
"along",
"multiple",
"axes",
"."
] | def _slice(attrs, inputs, proto_obj):
"""Returns a slice of the input tensor along multiple axes."""
new_attrs = translation_utils._fix_attribute_names(attrs,
{'axes' : 'axis',
'ends' : 'end',
... | [
"def",
"_slice",
"(",
"attrs",
",",
"inputs",
",",
"proto_obj",
")",
":",
"new_attrs",
"=",
"translation_utils",
".",
"_fix_attribute_names",
"(",
"attrs",
",",
"{",
"'axes'",
":",
"'axis'",
",",
"'ends'",
":",
"'end'",
",",
"'starts'",
":",
"'begin'",
"}"... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L500-L515 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html.py | python | HelpControllerBase.DisplayTextPopup | (*args, **kwargs) | return _html.HelpControllerBase_DisplayTextPopup(*args, **kwargs) | DisplayTextPopup(self, String text, Point pos) -> bool | DisplayTextPopup(self, String text, Point pos) -> bool | [
"DisplayTextPopup",
"(",
"self",
"String",
"text",
"Point",
"pos",
")",
"-",
">",
"bool"
] | def DisplayTextPopup(*args, **kwargs):
"""DisplayTextPopup(self, String text, Point pos) -> bool"""
return _html.HelpControllerBase_DisplayTextPopup(*args, **kwargs) | [
"def",
"DisplayTextPopup",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HelpControllerBase_DisplayTextPopup",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L1884-L1886 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/shutil.py | python | _check_unpack_options | (extensions, function, extra_args) | Checks what gets registered as an unpacker. | Checks what gets registered as an unpacker. | [
"Checks",
"what",
"gets",
"registered",
"as",
"an",
"unpacker",
"."
] | def _check_unpack_options(extensions, function, extra_args):
"""Checks what gets registered as an unpacker."""
# first make sure no other unpacker is registered for this extension
existing_extensions = {}
for name, info in _UNPACK_FORMATS.items():
for ext in info[0]:
existing_extensi... | [
"def",
"_check_unpack_options",
"(",
"extensions",
",",
"function",
",",
"extra_args",
")",
":",
"# first make sure no other unpacker is registered for this extension",
"existing_extensions",
"=",
"{",
"}",
"for",
"name",
",",
"info",
"in",
"_UNPACK_FORMATS",
".",
"items"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/shutil.py#L843-L858 | ||
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/freeCamera.py | python | FreeCamera.overrideFar | (self, value) | To remove the override, set to None | To remove the override, set to None | [
"To",
"remove",
"the",
"override",
"set",
"to",
"None"
] | def overrideFar(self, value):
"""To remove the override, set to None"""
self._overrideFar = value | [
"def",
"overrideFar",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_overrideFar",
"=",
"value"
] | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/freeCamera.py#L561-L563 | ||
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/tools/scan-build-py/libscanbuild/clang.py | python | get_checkers | (clang, plugins) | return checkers | Get all the available checkers from default and from the plugins.
:param clang: the compiler we are using
:param plugins: list of plugins which was requested by the user
:return: a dictionary of all available checkers and its status
{<checker name>: (<checker description>, <is active by defau... | Get all the available checkers from default and from the plugins. | [
"Get",
"all",
"the",
"available",
"checkers",
"from",
"default",
"and",
"from",
"the",
"plugins",
"."
] | def get_checkers(clang, plugins):
""" Get all the available checkers from default and from the plugins.
:param clang: the compiler we are using
:param plugins: list of plugins which was requested by the user
:return: a dictionary of all available checkers and its status
{<checker name>: (... | [
"def",
"get_checkers",
"(",
"clang",
",",
"plugins",
")",
":",
"load",
"=",
"[",
"elem",
"for",
"plugin",
"in",
"plugins",
"for",
"elem",
"in",
"[",
"'-load'",
",",
"plugin",
"]",
"]",
"cmd",
"=",
"[",
"clang",
",",
"'-cc1'",
"]",
"+",
"load",
"+",... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/tools/scan-build-py/libscanbuild/clang.py#L138-L161 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.validate | ( self, validateTrace=[] ) | Check defined expressions for valid structure, check for infinite recursive definitions. | [] | def validate( self, validateTrace=[] ):
"""
Check defined expressions for valid structure, check for infinite recursive definitions.
"""
self.checkRecursion( [] ) | [
"def",
"validate",
"(",
"self",
",",
"validateTrace",
"=",
"[",
"]",
")",
":",
"self",
".",
"checkRecursion",
"(",
"[",
"]",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L4333-L4341 | |||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py | python | _LogicalConnection.__init__ | (self, mux_handler, channel_id) | Constructs an instance.
Args:
mux_handler: _MuxHandler instance.
channel_id: channel id of this connection. | Constructs an instance. | [
"Constructs",
"an",
"instance",
"."
] | def __init__(self, mux_handler, channel_id):
"""Constructs an instance.
Args:
mux_handler: _MuxHandler instance.
channel_id: channel id of this connection.
"""
self._mux_handler = mux_handler
self._channel_id = channel_id
self._incoming_data = ''... | [
"def",
"__init__",
"(",
"self",
",",
"mux_handler",
",",
"channel_id",
")",
":",
"self",
".",
"_mux_handler",
"=",
"mux_handler",
"self",
".",
"_channel_id",
"=",
"channel_id",
"self",
".",
"_incoming_data",
"=",
"''",
"# - Protects _waiting_write_completion",
"# ... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py#L536-L554 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | TodoHandler.WriteGLES2ImplementationHeader | (self, func, file) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteGLES2ImplementationHeader(self, func, file):
"""Overrriden from TypeHandler."""
file.Write("%s %s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
file.Write(" // TODO: for now this is a no-op\n")
file.Write(
" SetG... | [
"def",
"WriteGLES2ImplementationHeader",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"file",
".",
"Write",
"(",
"\"%s %s(%s) {\\n\"",
"%",
"(",
"func",
".",
"return_type",
",",
"func",
".",
"original_name",
",",
"func",
".",
"MakeTypedOriginalArgString",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L2396-L2408 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/objpanel.py | python | ObjPanelMixin.add_title | (self, sizer, title=None, id=None, fontsize=12) | Add a title to the option panel.
If no title is given, the titel will be derived from the object name
and id if given. | Add a title to the option panel.
If no title is given, the titel will be derived from the object name
and id if given. | [
"Add",
"a",
"title",
"to",
"the",
"option",
"panel",
".",
"If",
"no",
"title",
"is",
"given",
"the",
"titel",
"will",
"be",
"derived",
"from",
"the",
"object",
"name",
"and",
"id",
"if",
"given",
"."
] | def add_title(self, sizer, title=None, id=None, fontsize=12):
"""
Add a title to the option panel.
If no title is given, the titel will be derived from the object name
and id if given.
"""
# print 'add_title',self.obj.get_name()
if title is None:
fonts... | [
"def",
"add_title",
"(",
"self",
",",
"sizer",
",",
"title",
"=",
"None",
",",
"id",
"=",
"None",
",",
"fontsize",
"=",
"12",
")",
":",
"# print 'add_title',self.obj.get_name()",
"if",
"title",
"is",
"None",
":",
"fontsize",
"=",
"14",
"if",
"id",
"is",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py#L3591-L3615 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/package_index.py | python | find_external_links | (url, page) | Find rel="homepage" and rel="download" links in `page`, yielding URLs | Find rel="homepage" and rel="download" links in `page`, yielding URLs | [
"Find",
"rel",
"=",
"homepage",
"and",
"rel",
"=",
"download",
"links",
"in",
"page",
"yielding",
"URLs"
] | def find_external_links(url, page):
"""Find rel="homepage" and rel="download" links in `page`, yielding URLs"""
for match in REL.finditer(page):
tag, rel = match.groups()
rels = set(map(str.strip, rel.lower().split(',')))
if 'homepage' in rels or 'download' in rels:
for matc... | [
"def",
"find_external_links",
"(",
"url",
",",
"page",
")",
":",
"for",
"match",
"in",
"REL",
".",
"finditer",
"(",
"page",
")",
":",
"tag",
",",
"rel",
"=",
"match",
".",
"groups",
"(",
")",
"rels",
"=",
"set",
"(",
"map",
"(",
"str",
".",
"stri... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/package_index.py#L223-L238 | ||
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | python_packaging/src/gmxapi/simulation/context.py | python | Context.__init__ | (self, work=None, workdir_list=None, communicator=None) | Create manager for computing resources.
Does not initialize resources because Python objects by themselves do
not have a good way to deinitialize resources. Instead, resources are
initialized using the Python context manager protocol when sessions are
entered and exited.
Approp... | Create manager for computing resources. | [
"Create",
"manager",
"for",
"computing",
"resources",
"."
] | def __init__(self, work=None, workdir_list=None, communicator=None):
"""Create manager for computing resources.
Does not initialize resources because Python objects by themselves do
not have a good way to deinitialize resources. Instead, resources are
initialized using the Python contex... | [
"def",
"__init__",
"(",
"self",
",",
"work",
"=",
"None",
",",
"workdir_list",
"=",
"None",
",",
"communicator",
"=",
"None",
")",
":",
"# self.__context_array = list([Context(work_element) for work_element in work])",
"from",
".",
"workflow",
"import",
"WorkSpec",
"#... | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/simulation/context.py#L546-L634 | ||
baoboa/pyqt5 | 11d5f43bc6f213d9d60272f3954a0048569cfc7c | pyuic/uic/driver.py | python | Driver.on_SyntaxError | (self, e) | Handle a SyntaxError exception. | Handle a SyntaxError exception. | [
"Handle",
"a",
"SyntaxError",
"exception",
"."
] | def on_SyntaxError(self, e):
""" Handle a SyntaxError exception. """
sys.stderr.write("Error in input file: %s\n" % e) | [
"def",
"on_SyntaxError",
"(",
"self",
",",
"e",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"Error in input file: %s\\n\"",
"%",
"e",
")"
] | https://github.com/baoboa/pyqt5/blob/11d5f43bc6f213d9d60272f3954a0048569cfc7c/pyuic/uic/driver.py#L117-L120 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/piexif/_common.py | python | merge_segments | (segments, exif=b"") | return b"".join(segments) | Merges Exif with APP0 and APP1 manipulations. | Merges Exif with APP0 and APP1 manipulations. | [
"Merges",
"Exif",
"with",
"APP0",
"and",
"APP1",
"manipulations",
"."
] | def merge_segments(segments, exif=b""):
"""Merges Exif with APP0 and APP1 manipulations.
"""
if segments[1][0:2] == b"\xff\xe0" and \
segments[2][0:2] == b"\xff\xe1" and \
segments[2][4:10] == b"Exif\x00\x00":
if exif:
segments[2] = exif
segments.pop(1)
... | [
"def",
"merge_segments",
"(",
"segments",
",",
"exif",
"=",
"b\"\"",
")",
":",
"if",
"segments",
"[",
"1",
"]",
"[",
"0",
":",
"2",
"]",
"==",
"b\"\\xff\\xe0\"",
"and",
"segments",
"[",
"2",
"]",
"[",
"0",
":",
"2",
"]",
"==",
"b\"\\xff\\xe1\"",
"a... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/piexif/_common.py#L69-L94 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | dictCleanup | () | Free the dictionary mutex. Do not call unless sure the
library is not in use anymore ! | Free the dictionary mutex. Do not call unless sure the
library is not in use anymore ! | [
"Free",
"the",
"dictionary",
"mutex",
".",
"Do",
"not",
"call",
"unless",
"sure",
"the",
"library",
"is",
"not",
"in",
"use",
"anymore",
"!"
] | def dictCleanup():
"""Free the dictionary mutex. Do not call unless sure the
library is not in use anymore ! """
libxml2mod.xmlDictCleanup() | [
"def",
"dictCleanup",
"(",
")",
":",
"libxml2mod",
".",
"xmlDictCleanup",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L307-L310 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Appearance.setTexture2D | (self,format,array) | Sets a 2D texture.
Args:
format (str): describes how the array is specified.
Valid values include:
- '': turn off texture mapping
- 'rgb8': unsigned byte RGB colors with red in the 1st
column, green in the 2nd, blue in the 3rd.
... | Sets a 2D texture. | [
"Sets",
"a",
"2D",
"texture",
"."
] | def setTexture2D(self,format,array):
"""Sets a 2D texture.
Args:
format (str): describes how the array is specified.
Valid values include:
- '': turn off texture mapping
- 'rgb8': unsigned byte RGB colors with red in the 1st
... | [
"def",
"setTexture2D",
"(",
"self",
",",
"format",
",",
"array",
")",
":",
"import",
"numpy",
"array",
"=",
"numpy",
".",
"asarray",
"(",
"array",
")",
"if",
"array",
".",
"shape",
"==",
"2",
":",
"if",
"array",
".",
"dtype",
"==",
"numpy",
".",
"u... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L3176-L3213 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.LocalPathify | (self, path) | return local_path | Convert a subdirectory-relative path into a normalized path which starts
with the make variable $(LOCAL_PATH) (i.e. the top of the project tree).
Absolute paths, or paths that contain variables, are just normalized. | Convert a subdirectory-relative path into a normalized path which starts
with the make variable $(LOCAL_PATH) (i.e. the top of the project tree).
Absolute paths, or paths that contain variables, are just normalized. | [
"Convert",
"a",
"subdirectory",
"-",
"relative",
"path",
"into",
"a",
"normalized",
"path",
"which",
"starts",
"with",
"the",
"make",
"variable",
"$",
"(",
"LOCAL_PATH",
")",
"(",
"i",
".",
"e",
".",
"the",
"top",
"of",
"the",
"project",
"tree",
")",
"... | def LocalPathify(self, path):
"""Convert a subdirectory-relative path into a normalized path which starts
with the make variable $(LOCAL_PATH) (i.e. the top of the project tree).
Absolute paths, or paths that contain variables, are just normalized."""
if '$(' in path or os.path.isabs(path):
# path... | [
"def",
"LocalPathify",
"(",
"self",
",",
"path",
")",
":",
"if",
"'$('",
"in",
"path",
"or",
"os",
".",
"path",
".",
"isabs",
"(",
"path",
")",
":",
"# path is not a file in the project tree in this case, but calling",
"# normpath is still important for trimming trailin... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/android.py#L924-L940 | |
MVIG-SJTU/RMPE | 5188c230ec800c12be7369c3619615bc9b020aa4 | python/caffe/detector.py | python | Detector.detect_selective_search | (self, image_fnames) | return self.detect_windows(zip(image_fnames, windows_list)) | Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net.
Parameters
----------
image_fnames: list
Returns
-------
detections: list of {filename: image filename, window: crop coordinates,
... | Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net. | [
"Do",
"windowed",
"detection",
"over",
"Selective",
"Search",
"proposals",
"by",
"extracting",
"the",
"crop",
"and",
"warping",
"to",
"the",
"input",
"dimensions",
"of",
"the",
"net",
"."
] | def detect_selective_search(self, image_fnames):
"""
Do windowed detection over Selective Search proposals by extracting
the crop and warping to the input dimensions of the net.
Parameters
----------
image_fnames: list
Returns
-------
detections:... | [
"def",
"detect_selective_search",
"(",
"self",
",",
"image_fnames",
")",
":",
"import",
"selective_search_ijcv_with_python",
"as",
"selective_search",
"# Make absolute paths so MATLAB can find the files.",
"image_fnames",
"=",
"[",
"os",
".",
"path",
".",
"abspath",
"(",
... | https://github.com/MVIG-SJTU/RMPE/blob/5188c230ec800c12be7369c3619615bc9b020aa4/python/caffe/detector.py#L101-L123 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tpu/tpu_feed.py | python | InfeedQueue.generate_enqueue_ops | (self,
sharded_inputs,
tpu_ordinal_function=None,
placement_function=None) | return [
self._generate_enqueue_op(
shard,
name_prefix,
index,
tpu_ordinal=tpu_ordinal_function(index),
device=placement_function(index) if placement_function else None)
for (shard, index) in zip(sharded_inputs, range(self.number_of_shards))
... | Generates the host-side Ops to enqueue the shards of a tuple.
sharded_inputs is a list, one for each shard, of lists of
Tensors. sharded_inputs[i] is the tuple of Tensors to use to feed
shard i of the queue. Returns the host-side Ops that must be run to
enqueue the sharded tuple. The Op for shard i is ... | Generates the host-side Ops to enqueue the shards of a tuple. | [
"Generates",
"the",
"host",
"-",
"side",
"Ops",
"to",
"enqueue",
"the",
"shards",
"of",
"a",
"tuple",
"."
] | def generate_enqueue_ops(self,
sharded_inputs,
tpu_ordinal_function=None,
placement_function=None):
"""Generates the host-side Ops to enqueue the shards of a tuple.
sharded_inputs is a list, one for each shard, of lists of
Ten... | [
"def",
"generate_enqueue_ops",
"(",
"self",
",",
"sharded_inputs",
",",
"tpu_ordinal_function",
"=",
"None",
",",
"placement_function",
"=",
"None",
")",
":",
"self",
".",
"set_configuration_from_sharded_input_tensors",
"(",
"sharded_inputs",
")",
"self",
".",
"freeze... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tpu_feed.py#L567-L627 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/pyparse.py | python | Parser._study1 | (self) | Find the line numbers of non-continuation lines.
As quickly as humanly possible <wink>, find the line numbers (0-
based) of the non-continuation lines.
Creates self.{goodlines, continuation}. | Find the line numbers of non-continuation lines. | [
"Find",
"the",
"line",
"numbers",
"of",
"non",
"-",
"continuation",
"lines",
"."
] | def _study1(self):
"""Find the line numbers of non-continuation lines.
As quickly as humanly possible <wink>, find the line numbers (0-
based) of the non-continuation lines.
Creates self.{goodlines, continuation}.
"""
if self.study_level >= 1:
return
... | [
"def",
"_study1",
"(",
"self",
")",
":",
"if",
"self",
".",
"study_level",
">=",
"1",
":",
"return",
"self",
".",
"study_level",
"=",
"1",
"# Map all uninteresting characters to \"x\", all open brackets",
"# to \"(\", all close brackets to \")\", then collapse runs of",
"# ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/pyparse.py#L201-L333 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/servermanager.py | python | DoubleMapProperty.__setitem__ | (self, key, values) | Sets the values for key. | Sets the values for key. | [
"Sets",
"the",
"values",
"for",
"key",
"."
] | def __setitem__(self, key, values):
"""Sets the values for key."""
for i, value in enumerate(values):
self.SMProperty.SetElementComponent(key, i, value)
self._UpdateProperty() | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"values",
")",
":",
"for",
"i",
",",
"value",
"in",
"enumerate",
"(",
"values",
")",
":",
"self",
".",
"SMProperty",
".",
"SetElementComponent",
"(",
"key",
",",
"i",
",",
"value",
")",
"self",
".",... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/servermanager.py#L900-L904 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TreeCtrl_GetClassDefaultAttributes | (*args, **kwargs) | return _controls_.TreeCtrl_GetClassDefaultAttributes(*args, **kwargs) | TreeCtrl_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colours o... | TreeCtrl_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"TreeCtrl_GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def TreeCtrl_GetClassDefaultAttributes(*args, **kwargs):
"""
TreeCtrl_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- ... | [
"def",
"TreeCtrl_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L5609-L5624 | |
OGRECave/ogre-next | 287307980e6de8910f04f3cc0994451b075071fd | Tools/BlenderExport/ogrepkg/gui.py | python | Screen._addButtonAction | (self, action) | return eventNumber | Registers an action for a button event.
@param action Action to execute on receive of the returned button event number.
@return Event number to use for the button that corresponds to that action. | Registers an action for a button event. | [
"Registers",
"an",
"action",
"for",
"a",
"button",
"event",
"."
] | def _addButtonAction(self, action):
"""Registers an action for a button event.
@param action Action to execute on receive of the returned button event number.
@return Event number to use for the button that corresponds to that action.
"""
# workaround for Blender 2.37 event 8 bug:
shiftEvents = 100... | [
"def",
"_addButtonAction",
"(",
"self",
",",
"action",
")",
":",
"# workaround for Blender 2.37 event 8 bug:",
"shiftEvents",
"=",
"100",
"# get a free event number",
"if",
"(",
"len",
"(",
"self",
".",
"buttonEventDict",
")",
"==",
"self",
".",
"nButtonEvent",
")",... | https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/gui.py#L1891-L1907 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/memonger.py | python | _compute_tree_height | (g, root) | Compute the heights of the tree for all nodes
Height of leaves are 0 | Compute the heights of the tree for all nodes
Height of leaves are 0 | [
"Compute",
"the",
"heights",
"of",
"the",
"tree",
"for",
"all",
"nodes",
"Height",
"of",
"leaves",
"are",
"0"
] | def _compute_tree_height(g, root):
''' Compute the heights of the tree for all nodes
Height of leaves are 0
'''
def _get_height(root):
children = list(g.successors(root))
height = 0
if children:
child_heights = [_get_height(x) for x in children]
height... | [
"def",
"_compute_tree_height",
"(",
"g",
",",
"root",
")",
":",
"def",
"_get_height",
"(",
"root",
")",
":",
"children",
"=",
"list",
"(",
"g",
".",
"successors",
"(",
"root",
")",
")",
"height",
"=",
"0",
"if",
"children",
":",
"child_heights",
"=",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/memonger.py#L386-L399 | ||
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | examples/Kaleidoscope/MCJIT/lazy/genk-timing.py | python | KScriptGenerator.setCallWeighting | (self, weight) | Sets the probably of generating a function call | Sets the probably of generating a function call | [
"Sets",
"the",
"probably",
"of",
"generating",
"a",
"function",
"call"
] | def setCallWeighting(self, weight):
""" Sets the probably of generating a function call"""
self.callWeighting = weight | [
"def",
"setCallWeighting",
"(",
"self",
",",
"weight",
")",
":",
"self",
".",
"callWeighting",
"=",
"weight"
] | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py#L80-L82 | ||
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/cpp_wrappers/knowledge_gradient_mcmc.py | python | PosteriorMeanMCMC.compute_posterior_mean_mcmc | (self, force_monte_carlo=False) | return old_div(posterior_mean_mcmc,len(self._gaussian_process_list)) | r"""Compute the knowledge gradient at ``points_to_sample``, with ``points_being_sampled`` concurrent points being sampled.
.. Note:: These comments were copied from
:meth:`moe.optimal_learning.python.interfaces.expected_improvement_interface.ExpectedImprovementInterface.compute_expected_improvement`
... | r"""Compute the knowledge gradient at ``points_to_sample``, with ``points_being_sampled`` concurrent points being sampled. | [
"r",
"Compute",
"the",
"knowledge",
"gradient",
"at",
"points_to_sample",
"with",
"points_being_sampled",
"concurrent",
"points",
"being",
"sampled",
"."
] | def compute_posterior_mean_mcmc(self, force_monte_carlo=False):
r"""Compute the knowledge gradient at ``points_to_sample``, with ``points_being_sampled`` concurrent points being sampled.
.. Note:: These comments were copied from
:meth:`moe.optimal_learning.python.interfaces.expected_improveme... | [
"def",
"compute_posterior_mean_mcmc",
"(",
"self",
",",
"force_monte_carlo",
"=",
"False",
")",
":",
"posterior_mean_mcmc",
"=",
"0",
"for",
"gp",
"in",
"self",
".",
"_gaussian_process_list",
":",
"posterior_mean_mcmc",
"+=",
"C_GP",
".",
"compute_posterior_mean",
"... | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/knowledge_gradient_mcmc.py#L72-L116 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | QueryNewPaletteEvent.__init__ | (self, *args, **kwargs) | __init__(self, int winid=0) -> QueryNewPaletteEvent
Constructor. | __init__(self, int winid=0) -> QueryNewPaletteEvent | [
"__init__",
"(",
"self",
"int",
"winid",
"=",
"0",
")",
"-",
">",
"QueryNewPaletteEvent"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, int winid=0) -> QueryNewPaletteEvent
Constructor.
"""
_core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"QueryNewPaletteEvent_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_QueryNewPaletteEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L7192-L7198 | ||
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/cpplint.py | python | CheckParenthesisSpacing | (filename, clean_lines, linenum, error) | Checks for horizontal spacing around parentheses.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for horizontal spacing around parentheses. | [
"Checks",
"for",
"horizontal",
"spacing",
"around",
"parentheses",
"."
] | def CheckParenthesisSpacing(filename, clean_lines, linenum, error):
"""Checks for horizontal spacing around parentheses.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call wit... | [
"def",
"CheckParenthesisSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# No spaces after an if, while, switch, or for",
"match",
"=",
"Search",
"(",
"r' (if\\(|f... | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L3555-L3590 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/catapult_base/catapult_base/refactor/annotated_symbol/import_statement.py | python | Import.alias | (self) | The alias, if the module is renamed with "as". None otherwise. | The alias, if the module is renamed with "as". None otherwise. | [
"The",
"alias",
"if",
"the",
"module",
"is",
"renamed",
"with",
"as",
".",
"None",
"otherwise",
"."
] | def alias(self):
"""The alias, if the module is renamed with "as". None otherwise."""
raise NotImplementedError() | [
"def",
"alias",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/catapult_base/catapult_base/refactor/annotated_symbol/import_statement.py#L142-L144 | ||
vnpy/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | vnpy/chart/widget.py | python | ChartCursor.move_left | (self) | Move cursor index to left by 1. | Move cursor index to left by 1. | [
"Move",
"cursor",
"index",
"to",
"left",
"by",
"1",
"."
] | def move_left(self) -> None:
"""
Move cursor index to left by 1.
"""
if self._x == 0:
return
self._x -= 1
self._update_after_move() | [
"def",
"move_left",
"(",
"self",
")",
"->",
"None",
":",
"if",
"self",
".",
"_x",
"==",
"0",
":",
"return",
"self",
".",
"_x",
"-=",
"1",
"self",
".",
"_update_after_move",
"(",
")"
] | https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/chart/widget.py#L503-L511 | ||
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usd/bin/usddiff/usddiff.py | python | _findFiles | (args) | Return a 3-tuple of lists: (baseline-only, matching, comparison-only).
baseline-only and comparison-only are lists of individual files, while
matching is a list of corresponding pairs of files. | Return a 3-tuple of lists: (baseline-only, matching, comparison-only).
baseline-only and comparison-only are lists of individual files, while
matching is a list of corresponding pairs of files. | [
"Return",
"a",
"3",
"-",
"tuple",
"of",
"lists",
":",
"(",
"baseline",
"-",
"only",
"matching",
"comparison",
"-",
"only",
")",
".",
"baseline",
"-",
"only",
"and",
"comparison",
"-",
"only",
"are",
"lists",
"of",
"individual",
"files",
"while",
"matchin... | def _findFiles(args):
'''Return a 3-tuple of lists: (baseline-only, matching, comparison-only).
baseline-only and comparison-only are lists of individual files, while
matching is a list of corresponding pairs of files.'''
import os
import stat
from pxr import Ar
join = os.path.join
base... | [
"def",
"_findFiles",
"(",
"args",
")",
":",
"import",
"os",
"import",
"stat",
"from",
"pxr",
"import",
"Ar",
"join",
"=",
"os",
".",
"path",
".",
"join",
"basename",
"=",
"os",
".",
"path",
".",
"basename",
"exists",
"=",
"os",
".",
"path",
".",
"e... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usd/bin/usddiff/usddiff.py#L242-L326 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | PhotoImage.cget | (self, option) | return self.tk.call(self.name, 'cget', '-' + option) | Return the value of OPTION. | Return the value of OPTION. | [
"Return",
"the",
"value",
"of",
"OPTION",
"."
] | def cget(self, option):
"""Return the value of OPTION."""
return self.tk.call(self.name, 'cget', '-' + option) | [
"def",
"cget",
"(",
"self",
",",
"option",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"name",
",",
"'cget'",
",",
"'-'",
"+",
"option",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3549-L3551 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/bindings/python/clang/cindex.py | python | Cursor.result_type | (self) | return self._result_type | Retrieve the Type of the result for this Cursor. | Retrieve the Type of the result for this Cursor. | [
"Retrieve",
"the",
"Type",
"of",
"the",
"result",
"for",
"this",
"Cursor",
"."
] | def result_type(self):
"""Retrieve the Type of the result for this Cursor."""
if not hasattr(self, '_result_type'):
self._result_type = conf.lib.clang_getCursorResultType(self)
return self._result_type | [
"def",
"result_type",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_result_type'",
")",
":",
"self",
".",
"_result_type",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorResultType",
"(",
"self",
")",
"return",
"self",
".",
"_result_typ... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L1668-L1673 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/distutils/ccompiler.py | python | CCompiler.preprocess | (self, source, output_file=None, macros=None,
include_dirs=None, extra_preargs=None, extra_postargs=None) | Preprocess a single C/C++ source file, named in 'source'.
Output will be written to file named 'output_file', or stdout if
'output_file' not supplied. 'macros' is a list of macro
definitions as for 'compile()', which will augment the macros set
with 'define_macro()' and 'undefine_macro(... | Preprocess a single C/C++ source file, named in 'source'.
Output will be written to file named 'output_file', or stdout if
'output_file' not supplied. 'macros' is a list of macro
definitions as for 'compile()', which will augment the macros set
with 'define_macro()' and 'undefine_macro(... | [
"Preprocess",
"a",
"single",
"C",
"/",
"C",
"++",
"source",
"file",
"named",
"in",
"source",
".",
"Output",
"will",
"be",
"written",
"to",
"file",
"named",
"output_file",
"or",
"stdout",
"if",
"output_file",
"not",
"supplied",
".",
"macros",
"is",
"a",
"... | def preprocess(self, source, output_file=None, macros=None,
include_dirs=None, extra_preargs=None, extra_postargs=None):
"""Preprocess a single C/C++ source file, named in 'source'.
Output will be written to file named 'output_file', or stdout if
'output_file' not supplied. '... | [
"def",
"preprocess",
"(",
"self",
",",
"source",
",",
"output_file",
"=",
"None",
",",
"macros",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"extra_preargs",
"=",
"None",
",",
"extra_postargs",
"=",
"None",
")",
":",
"pass"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/ccompiler.py#L498-L509 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/distributions/util.py | python | same_dynamic_shape | (a, b) | return control_flow_ops.cond(
math_ops.equal(array_ops.rank(a), array_ops.rank(b)),
all_shapes_equal, lambda: constant_op.constant(False)) | Returns whether a and b have the same dynamic shape.
Args:
a: `Tensor`
b: `Tensor`
Returns:
`bool` `Tensor` representing if both tensors have the same shape. | Returns whether a and b have the same dynamic shape. | [
"Returns",
"whether",
"a",
"and",
"b",
"have",
"the",
"same",
"dynamic",
"shape",
"."
] | def same_dynamic_shape(a, b):
"""Returns whether a and b have the same dynamic shape.
Args:
a: `Tensor`
b: `Tensor`
Returns:
`bool` `Tensor` representing if both tensors have the same shape.
"""
a = ops.convert_to_tensor(a, name="a")
b = ops.convert_to_tensor(b, name="b")
# Here we can't ju... | [
"def",
"same_dynamic_shape",
"(",
"a",
",",
"b",
")",
":",
"a",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"a",
",",
"name",
"=",
"\"a\"",
")",
"b",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"b",
",",
"name",
"=",
"\"b\"",
")",
"# Here we can't just d... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/distributions/util.py#L104-L132 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/multiprocessing/util.py | python | get_logger | () | return _logger | Returns logger used by multiprocessing | Returns logger used by multiprocessing | [
"Returns",
"logger",
"used",
"by",
"multiprocessing"
] | def get_logger():
'''
Returns logger used by multiprocessing
'''
global _logger
import logging, atexit
logging._acquireLock()
try:
if not _logger:
_logger = logging.getLogger(LOGGER_NAME)
_logger.propagate = 0
logging.addLevelName(SUBDEBUG, 'SUBD... | [
"def",
"get_logger",
"(",
")",
":",
"global",
"_logger",
"import",
"logging",
",",
"atexit",
"logging",
".",
"_acquireLock",
"(",
")",
"try",
":",
"if",
"not",
"_logger",
":",
"_logger",
"=",
"logging",
".",
"getLogger",
"(",
"LOGGER_NAME",
")",
"_logger",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/multiprocessing/util.py#L56-L83 | |
JavierIH/zowi | 830c1284154b8167c9131deb9c45189fd9e67b54 | code/python-client/pyosc_i.py | python | serial_port | (sname = "/dev/ttyUSB0") | Open the serial port | Open the serial port | [
"Open",
"the",
"serial",
"port"
] | def serial_port(sname = "/dev/ttyUSB0"):
"""Open the serial port"""
try:
sp = serial.Serial(sname, 19200)
return sp
except serial.SerialException:
sys.stderr.write("Error opening the port {0}".format(sname))
sys.exit(1) | [
"def",
"serial_port",
"(",
"sname",
"=",
"\"/dev/ttyUSB0\"",
")",
":",
"try",
":",
"sp",
"=",
"serial",
".",
"Serial",
"(",
"sname",
",",
"19200",
")",
"return",
"sp",
"except",
"serial",
".",
"SerialException",
":",
"sys",
".",
"stderr",
".",
"write",
... | https://github.com/JavierIH/zowi/blob/830c1284154b8167c9131deb9c45189fd9e67b54/code/python-client/pyosc_i.py#L24-L33 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xpathContext.registerXPathFunction | (self, name, ns_uri, f) | return ret | Register a Python written function to the XPath interpreter | Register a Python written function to the XPath interpreter | [
"Register",
"a",
"Python",
"written",
"function",
"to",
"the",
"XPath",
"interpreter"
] | def registerXPathFunction(self, name, ns_uri, f):
"""Register a Python written function to the XPath interpreter """
ret = libxml2mod.xmlRegisterXPathFunction(self._o, name, ns_uri, f)
return ret | [
"def",
"registerXPathFunction",
"(",
"self",
",",
"name",
",",
"ns_uri",
",",
"f",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlRegisterXPathFunction",
"(",
"self",
".",
"_o",
",",
"name",
",",
"ns_uri",
",",
"f",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L7307-L7310 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/procrouting/diis.py | python | DIIS.extrapolate | (self, *args, Dnorm = None) | return performed | Perform extrapolation. Must be passed in an error metric to decide how to handle hybrid algorithms. | Perform extrapolation. Must be passed in an error metric to decide how to handle hybrid algorithms. | [
"Perform",
"extrapolation",
".",
"Must",
"be",
"passed",
"in",
"an",
"error",
"metric",
"to",
"decide",
"how",
"to",
"handle",
"hybrid",
"algorithms",
"."
] | def extrapolate(self, *args, Dnorm = None):
""" Perform extrapolation. Must be passed in an error metric to decide how to handle hybrid algorithms. """
if {"adiis", "ediis"}.intersection(self.engines) and Dnorm is None:
raise ValidationError("An extrapolation engine insists you specify the ... | [
"def",
"extrapolate",
"(",
"self",
",",
"*",
"args",
",",
"Dnorm",
"=",
"None",
")",
":",
"if",
"{",
"\"adiis\"",
",",
"\"ediis\"",
"}",
".",
"intersection",
"(",
"self",
".",
"engines",
")",
"and",
"Dnorm",
"is",
"None",
":",
"raise",
"ValidationError... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/diis.py#L345-L398 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/msvc9compiler.py | python | MSVCCompiler.find_exe | (self, exe) | return exe | Return path to an MSVC executable program.
Tries to find the program in several places: first, one of the
MSVC program search paths from the registry; next, the directories
in the PATH environment variable. If any of those work, return an
absolute path that is known to exist. If none ... | Return path to an MSVC executable program. | [
"Return",
"path",
"to",
"an",
"MSVC",
"executable",
"program",
"."
] | def find_exe(self, exe):
"""Return path to an MSVC executable program.
Tries to find the program in several places: first, one of the
MSVC program search paths from the registry; next, the directories
in the PATH environment variable. If any of those work, return an
absolute pa... | [
"def",
"find_exe",
"(",
"self",
",",
"exe",
")",
":",
"for",
"p",
"in",
"self",
".",
"__paths",
":",
"fn",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"p",
")",
",",
"exe",
")",
"if",
"os",
".",
"path",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/msvc9compiler.py#L768-L788 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/dynamodb/table.py | python | TableResource.batch_writer | (self, overwrite_by_pkeys=None) | return BatchWriter(self.name, self.meta.client,
overwrite_by_pkeys=overwrite_by_pkeys) | Create a batch writer object.
This method creates a context manager for writing
objects to Amazon DynamoDB in batch.
The batch writer will automatically handle buffering and sending items
in batches. In addition, the batch writer will also automatically
handle any unprocessed ... | Create a batch writer object. | [
"Create",
"a",
"batch",
"writer",
"object",
"."
] | def batch_writer(self, overwrite_by_pkeys=None):
"""Create a batch writer object.
This method creates a context manager for writing
objects to Amazon DynamoDB in batch.
The batch writer will automatically handle buffering and sending items
in batches. In addition, the batch wr... | [
"def",
"batch_writer",
"(",
"self",
",",
"overwrite_by_pkeys",
"=",
"None",
")",
":",
"return",
"BatchWriter",
"(",
"self",
".",
"name",
",",
"self",
".",
"meta",
".",
"client",
",",
"overwrite_by_pkeys",
"=",
"overwrite_by_pkeys",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/dynamodb/table.py#L32-L60 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/utils.py | python | _create_tuple | (shape, value) | return value | Returns a tuple with given shape and filled with value. | Returns a tuple with given shape and filled with value. | [
"Returns",
"a",
"tuple",
"with",
"given",
"shape",
"and",
"filled",
"with",
"value",
"."
] | def _create_tuple(shape, value):
"""Returns a tuple with given shape and filled with value."""
if shape:
return tuple([_create_tuple(shape[1:], value) for _ in range(shape[0])])
return value | [
"def",
"_create_tuple",
"(",
"shape",
",",
"value",
")",
":",
"if",
"shape",
":",
"return",
"tuple",
"(",
"[",
"_create_tuple",
"(",
"shape",
"[",
"1",
":",
"]",
",",
"value",
")",
"for",
"_",
"in",
"range",
"(",
"shape",
"[",
"0",
"]",
")",
"]",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/utils.py#L127-L131 | |
GeometryCollective/boundary-first-flattening | 8250e5a0e85980ec50b5e8aa8f49dd6519f915cd | deps/nanogui/ext/pybind11/tools/clang/cindex.py | python | TranslationUnit.diagnostics | (self) | return DiagIterator(self) | Return an iterable (and indexable) object containing the diagnostics. | Return an iterable (and indexable) object containing the diagnostics. | [
"Return",
"an",
"iterable",
"(",
"and",
"indexable",
")",
"object",
"containing",
"the",
"diagnostics",
"."
] | def diagnostics(self):
"""
Return an iterable (and indexable) object containing the diagnostics.
"""
class DiagIterator:
def __init__(self, tu):
self.tu = tu
def __len__(self):
return int(conf.lib.clang_getNumDiagnostics(self.tu))
... | [
"def",
"diagnostics",
"(",
"self",
")",
":",
"class",
"DiagIterator",
":",
"def",
"__init__",
"(",
"self",
",",
"tu",
")",
":",
"self",
".",
"tu",
"=",
"tu",
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"int",
"(",
"conf",
".",
"lib",
".",
... | https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L2542-L2559 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Wrapping/Generators/Python/itk/support/extras.py | python | GetVnlVectorFromArray | (arr: ArrayLike, ttype=None) | return _GetVnlObjectFromArray(arr, "GetVnlVectorFromArray", ttype) | Get a vnl vector from a Python array. | Get a vnl vector from a Python array. | [
"Get",
"a",
"vnl",
"vector",
"from",
"a",
"Python",
"array",
"."
] | def GetVnlVectorFromArray(arr: ArrayLike, ttype=None):
"""Get a vnl vector from a Python array."""
return _GetVnlObjectFromArray(arr, "GetVnlVectorFromArray", ttype) | [
"def",
"GetVnlVectorFromArray",
"(",
"arr",
":",
"ArrayLike",
",",
"ttype",
"=",
"None",
")",
":",
"return",
"_GetVnlObjectFromArray",
"(",
"arr",
",",
"\"GetVnlVectorFromArray\"",
",",
"ttype",
")"
] | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Wrapping/Generators/Python/itk/support/extras.py#L572-L574 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/python/lite.py | python | TFLiteFrozenGraphConverterV2.convert | (self) | return super(TFLiteFrozenGraphConverterV2,
self).convert(graph_def, input_tensors, output_tensors) | Converts a TensorFlow GraphDef based on instance variables.
Returns:
The converted data in serialized format.
Raises:
ValueError:
No concrete functions is specified.
Multiple concrete functions are specified.
Input shape is not specified.
Invalid quantization parame... | Converts a TensorFlow GraphDef based on instance variables. | [
"Converts",
"a",
"TensorFlow",
"GraphDef",
"based",
"on",
"instance",
"variables",
"."
] | def convert(self):
"""Converts a TensorFlow GraphDef based on instance variables.
Returns:
The converted data in serialized format.
Raises:
ValueError:
No concrete functions is specified.
Multiple concrete functions are specified.
Input shape is not specified.
I... | [
"def",
"convert",
"(",
"self",
")",
":",
"if",
"self",
".",
"experimental_lower_to_saved_model",
":",
"saved_model_convert_result",
"=",
"self",
".",
"_convert_as_saved_model",
"(",
")",
"if",
"saved_model_convert_result",
":",
"return",
"saved_model_convert_result",
"g... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/lite.py#L1477-L1502 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/internals/blocks.py | python | Block.split_and_operate | (self, func, *args, **kwargs) | return res_blocks | Split the block and apply func column-by-column.
Parameters
----------
func : Block method
*args
**kwargs
Returns
-------
List[Block] | Split the block and apply func column-by-column. | [
"Split",
"the",
"block",
"and",
"apply",
"func",
"column",
"-",
"by",
"-",
"column",
"."
] | def split_and_operate(self, func, *args, **kwargs) -> list[Block]:
"""
Split the block and apply func column-by-column.
Parameters
----------
func : Block method
*args
**kwargs
Returns
-------
List[Block]
"""
assert self.n... | [
"def",
"split_and_operate",
"(",
"self",
",",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"->",
"list",
"[",
"Block",
"]",
":",
"assert",
"self",
".",
"ndim",
"==",
"2",
"and",
"self",
".",
"shape",
"[",
"0",
"]",
"!=",
"1",
"res_bloc... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/blocks.py#L487-L507 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/EditorWindow.py | python | EditorWindow.reset_help_menu_entries | (self) | Update the additional help entries on the Help menu | Update the additional help entries on the Help menu | [
"Update",
"the",
"additional",
"help",
"entries",
"on",
"the",
"Help",
"menu"
] | def reset_help_menu_entries(self):
"Update the additional help entries on the Help menu"
help_list = idleConf.GetAllExtraHelpSourcesList()
helpmenu = self.menudict['help']
# first delete the extra help entries, if any
helpmenu_length = helpmenu.index(END)
if helpmenu_leng... | [
"def",
"reset_help_menu_entries",
"(",
"self",
")",
":",
"help_list",
"=",
"idleConf",
".",
"GetAllExtraHelpSourcesList",
"(",
")",
"helpmenu",
"=",
"self",
".",
"menudict",
"[",
"'help'",
"]",
"# first delete the extra help entries, if any",
"helpmenu_length",
"=",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/EditorWindow.py#L828-L843 | ||
OpenGenus/cosmos | 1a94e8880068e51d571543be179c323936bd0936 | code/data_structures/src/list/singly_linked_list/operations/insertion/insertion_at_end.py | python | Node.__repr__ | (self) | return self.data | Node representation as required | Node representation as required | [
"Node",
"representation",
"as",
"required"
] | def __repr__(self):
""" Node representation as required"""
return self.data | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"self",
".",
"data"
] | https://github.com/OpenGenus/cosmos/blob/1a94e8880068e51d571543be179c323936bd0936/code/data_structures/src/list/singly_linked_list/operations/insertion/insertion_at_end.py#L24-L26 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/transforms.py | python | PassManagerBuilder.slp_vectorize | (self) | return ffi.lib.LLVMPY_PassManagerBuilderGetSLPVectorize(self) | If true, enable the "SLP vectorizer", which uses a different algorithm
from the loop vectorizer. Both may be enabled at the same time. | If true, enable the "SLP vectorizer", which uses a different algorithm
from the loop vectorizer. Both may be enabled at the same time. | [
"If",
"true",
"enable",
"the",
"SLP",
"vectorizer",
"which",
"uses",
"a",
"different",
"algorithm",
"from",
"the",
"loop",
"vectorizer",
".",
"Both",
"may",
"be",
"enabled",
"at",
"the",
"same",
"time",
"."
] | def slp_vectorize(self):
"""
If true, enable the "SLP vectorizer", which uses a different algorithm
from the loop vectorizer. Both may be enabled at the same time.
"""
return ffi.lib.LLVMPY_PassManagerBuilderGetSLPVectorize(self) | [
"def",
"slp_vectorize",
"(",
"self",
")",
":",
"return",
"ffi",
".",
"lib",
".",
"LLVMPY_PassManagerBuilderGetSLPVectorize",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/transforms.py#L76-L81 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozpack/manifests.py | python | InstallManifest.add_required_exists | (self, dest) | Record that a destination file must exist.
This effectively prevents the listed file from being deleted. | Record that a destination file must exist. | [
"Record",
"that",
"a",
"destination",
"file",
"must",
"exist",
"."
] | def add_required_exists(self, dest):
"""Record that a destination file must exist.
This effectively prevents the listed file from being deleted.
"""
self._add_entry(dest, (self.REQUIRED_EXISTS,)) | [
"def",
"add_required_exists",
"(",
"self",
",",
"dest",
")",
":",
"self",
".",
"_add_entry",
"(",
"dest",
",",
"(",
"self",
".",
"REQUIRED_EXISTS",
",",
")",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/manifests.py#L245-L250 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/loss.py | python | sigmoid_cross_entropy_with_logits | (x,
label,
ignore_index=kIgnoreIndex,
name=None,
normalize=False) | return out | ${comment}
Args:
x(Tensor): a 2-D tensor with shape N x D, where N is the batch size and
D is the number of classes. This input is a tensor of logits computed
by the previous operator. Logits are unscaled log probabilities given
as log(p/(1-p)) The data type ... | [] | def sigmoid_cross_entropy_with_logits(x,
label,
ignore_index=kIgnoreIndex,
name=None,
normalize=False):
"""
${comment}
Args:
x(Tensor): a 2-D tens... | [
"def",
"sigmoid_cross_entropy_with_logits",
"(",
"x",
",",
"label",
",",
"ignore_index",
"=",
"kIgnoreIndex",
",",
"name",
"=",
"None",
",",
"normalize",
"=",
"False",
")",
":",
"check_variable_and_dtype",
"(",
"x",
",",
"'input'",
",",
"[",
"'float16'",
",",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/loss.py#L1422-L1475 | ||
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_image.py | python | LcmImageHandler.receive_message | (self, msg) | Receives and decodes `lcmt_image` message into `vtkImageData`. | Receives and decodes `lcmt_image` message into `vtkImageData`. | [
"Receives",
"and",
"decodes",
"lcmt_image",
"message",
"into",
"vtkImageData",
"."
] | def receive_message(self, msg):
"""
Receives and decodes `lcmt_image` message into `vtkImageData`.
"""
# TODO(eric.cousineau): Consider moving decode logic.
with self.lock:
self.utime = msg.header.utime
self._image = decode_lcmt_image(msg, self._image)
... | [
"def",
"receive_message",
"(",
"self",
",",
"msg",
")",
":",
"# TODO(eric.cousineau): Consider moving decode logic.",
"with",
"self",
".",
"lock",
":",
"self",
".",
"utime",
"=",
"msg",
".",
"header",
".",
"utime",
"self",
".",
"_image",
"=",
"decode_lcmt_image"... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_image.py#L403-L412 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_workflow/command_interface.py | python | AppendDataFile | (datafile, workspace=None) | Append a data file in the list of files to be processed.
@param datafile: data file to be processed
@param workspace: optional workspace name for this data file
[Default will be the name of the file] | Append a data file in the list of files to be processed. | [
"Append",
"a",
"data",
"file",
"in",
"the",
"list",
"of",
"files",
"to",
"be",
"processed",
"."
] | def AppendDataFile(datafile, workspace=None):
"""
Append a data file in the list of files to be processed.
@param datafile: data file to be processed
@param workspace: optional workspace name for this data file
[Default will be the name of the file]
"""
ReductionSingleton... | [
"def",
"AppendDataFile",
"(",
"datafile",
",",
"workspace",
"=",
"None",
")",
":",
"ReductionSingleton",
"(",
")",
".",
"append_data_file",
"(",
"datafile",
",",
"workspace",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_workflow/command_interface.py#L103-L110 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/xml.py | python | _XMLFrameParser.parse_data | (self) | Parse xml data.
This method will call the other internal methods to
validate xpath, names, parse and return specific nodes. | Parse xml data. | [
"Parse",
"xml",
"data",
"."
] | def parse_data(self) -> list[dict[str, str | None]]:
"""
Parse xml data.
This method will call the other internal methods to
validate xpath, names, parse and return specific nodes.
"""
raise AbstractMethodError(self) | [
"def",
"parse_data",
"(",
"self",
")",
"->",
"list",
"[",
"dict",
"[",
"str",
",",
"str",
"|",
"None",
"]",
"]",
":",
"raise",
"AbstractMethodError",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/xml.py#L123-L131 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_cmdbar.py | python | PopupList.OnFocus | (self, evt) | Raise and reset the focus to the parent window whenever
we get focus.
@param evt: event that called this handler | Raise and reset the focus to the parent window whenever
we get focus.
@param evt: event that called this handler | [
"Raise",
"and",
"reset",
"the",
"focus",
"to",
"the",
"parent",
"window",
"whenever",
"we",
"get",
"focus",
".",
"@param",
"evt",
":",
"event",
"that",
"called",
"this",
"handler"
] | def OnFocus(self, evt):
"""Raise and reset the focus to the parent window whenever
we get focus.
@param evt: event that called this handler
"""
self.ActivateParent()
self.GetParent().SetFocus()
evt.Skip() | [
"def",
"OnFocus",
"(",
"self",
",",
"evt",
")",
":",
"self",
".",
"ActivateParent",
"(",
")",
"self",
".",
"GetParent",
"(",
")",
".",
"SetFocus",
"(",
")",
"evt",
".",
"Skip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_cmdbar.py#L1161-L1169 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MouseCaptureChangedEvent.__init__ | (self, *args, **kwargs) | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
Constructor | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | [
"__init__",
"(",
"self",
"int",
"winid",
"=",
"0",
"Window",
"gainedCapture",
"=",
"None",
")",
"-",
">",
"MouseCaptureChangedEvent"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
Constructor
"""
_core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"MouseCaptureChangedEvent_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_MouseCaptureChangedEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L7071-L7077 | ||
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | 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/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L5083-L5222 | ||
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | utils/cpplint.py | python | CheckOperatorSpacing | (filename, clean_lines, linenum, error) | Checks for horizontal spacing around operators.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for horizontal spacing around operators. | [
"Checks",
"for",
"horizontal",
"spacing",
"around",
"operators",
"."
] | def CheckOperatorSpacing(filename, clean_lines, linenum, error):
"""Checks for horizontal spacing around operators.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any... | [
"def",
"CheckOperatorSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Don't try to do spacing checks for operator methods. Do this by",
"# replacing the troublesome cha... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/utils/cpplint.py#L3131-L3243 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/copies.py | python | CopyPartTask._main | (self, client, copy_source, bucket, key, upload_id, part_number,
extra_args, callbacks, size) | return {'ETag': etag, 'PartNumber': part_number} | :param client: The client to use when calling PutObject
:param copy_source: The CopySource parameter to use
:param bucket: The name of the bucket to upload to
:param key: The name of the key to upload to
:param upload_id: The id of the upload
:param part_number: The number repres... | :param client: The client to use when calling PutObject
:param copy_source: The CopySource parameter to use
:param bucket: The name of the bucket to upload to
:param key: The name of the key to upload to
:param upload_id: The id of the upload
:param part_number: The number repres... | [
":",
"param",
"client",
":",
"The",
"client",
"to",
"use",
"when",
"calling",
"PutObject",
":",
"param",
"copy_source",
":",
"The",
"CopySource",
"parameter",
"to",
"use",
":",
"param",
"bucket",
":",
"The",
"name",
"of",
"the",
"bucket",
"to",
"upload",
... | def _main(self, client, copy_source, bucket, key, upload_id, part_number,
extra_args, callbacks, size):
"""
:param client: The client to use when calling PutObject
:param copy_source: The CopySource parameter to use
:param bucket: The name of the bucket to upload to
... | [
"def",
"_main",
"(",
"self",
",",
"client",
",",
"copy_source",
",",
"bucket",
",",
"key",
",",
"upload_id",
",",
"part_number",
",",
"extra_args",
",",
"callbacks",
",",
"size",
")",
":",
"response",
"=",
"client",
".",
"upload_part_copy",
"(",
"CopySourc... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/copies.py#L294-L324 | |
NERSC/timemory | 431912b360ff50d1a160d7826e2eea04fbd1037f | timemory/analyze/analyze.py | python | dump_entity | (data, functor, file=None, fext=None) | return files | Dumps data to stdout or file.
file can be file-like or filename. | Dumps data to stdout or file.
file can be file-like or filename. | [
"Dumps",
"data",
"to",
"stdout",
"or",
"file",
".",
"file",
"can",
"be",
"file",
"-",
"like",
"or",
"filename",
"."
] | def dump_entity(data, functor, file=None, fext=None):
"""Dumps data to stdout or file.
file can be file-like or filename.
"""
def _dump_entity(_data, _file=None):
if _file is None:
print(f"{_data}")
return None
elif hasattr(_file, "write"):
_file.writ... | [
"def",
"dump_entity",
"(",
"data",
",",
"functor",
",",
"file",
"=",
"None",
",",
"fext",
"=",
"None",
")",
":",
"def",
"_dump_entity",
"(",
"_data",
",",
"_file",
"=",
"None",
")",
":",
"if",
"_file",
"is",
"None",
":",
"print",
"(",
"f\"{_data}\"",... | https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/timemory/analyze/analyze.py#L384-L438 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cmd.py | python | Cmd.cmdloop | (self, intro=None) | Repeatedly issue a prompt, accept input, parse an initial prefix
off the received input, and dispatch to action methods, passing them
the remainder of the line as argument. | Repeatedly issue a prompt, accept input, parse an initial prefix
off the received input, and dispatch to action methods, passing them
the remainder of the line as argument. | [
"Repeatedly",
"issue",
"a",
"prompt",
"accept",
"input",
"parse",
"an",
"initial",
"prefix",
"off",
"the",
"received",
"input",
"and",
"dispatch",
"to",
"action",
"methods",
"passing",
"them",
"the",
"remainder",
"of",
"the",
"line",
"as",
"argument",
"."
] | def cmdloop(self, intro=None):
"""Repeatedly issue a prompt, accept input, parse an initial prefix
off the received input, and dispatch to action methods, passing them
the remainder of the line as argument.
"""
self.preloop()
if self.use_rawinput and self.completekey:
... | [
"def",
"cmdloop",
"(",
"self",
",",
"intro",
"=",
"None",
")",
":",
"self",
".",
"preloop",
"(",
")",
"if",
"self",
".",
"use_rawinput",
"and",
"self",
".",
"completekey",
":",
"try",
":",
"import",
"readline",
"self",
".",
"old_completer",
"=",
"readl... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cmd.py#L98-L147 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/estimators/head.py | python | _LossOnlyHead.create_model_fn_ops | (self,
features,
mode,
labels=None,
train_op_fn=None,
logits=None,
logits_input=None,
scope=None) | return model_fn.ModelFnOps(
mode=mode,
loss=loss,
train_op=train_op,
predictions={},
eval_metric_ops={}) | See `_Head.create_model_fn_ops`.
Args:
features: Not been used.
mode: Estimator's `ModeKeys`.
labels: Labels `Tensor`, or `dict` of same.
train_op_fn: Function that takes a scalar loss and returns an op to
optimize with the loss.
logits: Not been used.
logits_input: No... | See `_Head.create_model_fn_ops`. | [
"See",
"_Head",
".",
"create_model_fn_ops",
"."
] | def create_model_fn_ops(self,
features,
mode,
labels=None,
train_op_fn=None,
logits=None,
logits_input=None,
scope=None):
"""See `_Hea... | [
"def",
"create_model_fn_ops",
"(",
"self",
",",
"features",
",",
"mode",
",",
"labels",
"=",
"None",
",",
"train_op_fn",
"=",
"None",
",",
"logits",
"=",
"None",
",",
"logits_input",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"_check_mode_valid",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/head.py#L1451-L1504 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/tools/3c/utils/port_tools/generate_ccommands.py | python | getCheckedCArgs | (argument_list) | return (clang_x_args, output_filename) | Adjust the compilation arguments. This is now used only by
expand_macros_before_conversion since 3c takes the arguments directly from
the compilation database. Thus, we no longer use -extra-arg-before here.
:param argument_list: list of compiler argument.
:return: (checked c args, output filename) | Adjust the compilation arguments. This is now used only by
expand_macros_before_conversion since 3c takes the arguments directly from
the compilation database. Thus, we no longer use -extra-arg-before here. | [
"Adjust",
"the",
"compilation",
"arguments",
".",
"This",
"is",
"now",
"used",
"only",
"by",
"expand_macros_before_conversion",
"since",
"3c",
"takes",
"the",
"arguments",
"directly",
"from",
"the",
"compilation",
"database",
".",
"Thus",
"we",
"no",
"longer",
"... | def getCheckedCArgs(argument_list):
"""
Adjust the compilation arguments. This is now used only by
expand_macros_before_conversion since 3c takes the arguments directly from
the compilation database. Thus, we no longer use -extra-arg-before here.
:param argument_list: list of compiler argumen... | [
"def",
"getCheckedCArgs",
"(",
"argument_list",
")",
":",
"# New approach: Rather than keeping only specific flags, try keeping",
"# everything except `-c` (because we will add `-E` if we preprocess the",
"# translation unit) and the source file name (assumed to be the last",
"# argument) because ... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/tools/3c/utils/port_tools/generate_ccommands.py#L58-L95 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibook.py | python | TabTextCtrl.item | (self) | return self._tabEdited | Returns the item currently edited. | Returns the item currently edited. | [
"Returns",
"the",
"item",
"currently",
"edited",
"."
] | def item(self):
""" Returns the item currently edited. """
return self._tabEdited | [
"def",
"item",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tabEdited"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L303-L306 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/qat/modules/conv.py | python | QuantizedConv3d.from_float | (cls, mod, qconfig) | return conv | Create a qat module from a float module.
Args:
mod: A float module of type torch.nn.Conv2d.
qconfig (pytorch_nndct.quantization.quant_aware_training.QConfig):
A qconfig object that saves the quantizers for the module. | Create a qat module from a float module. | [
"Create",
"a",
"qat",
"module",
"from",
"a",
"float",
"module",
"."
] | def from_float(cls, mod, qconfig):
"""Create a qat module from a float module.
Args:
mod: A float module of type torch.nn.Conv2d.
qconfig (pytorch_nndct.quantization.quant_aware_training.QConfig):
A qconfig object that saves the quantizers for the module.
"""
assert qconfig, 'qcon... | [
"def",
"from_float",
"(",
"cls",
",",
"mod",
",",
"qconfig",
")",
":",
"assert",
"qconfig",
",",
"'qconfig must be provided for quantized module'",
"assert",
"type",
"(",
"mod",
")",
"==",
"cls",
".",
"_FLOAT_MODULE",
",",
"' qat.'",
"+",
"cls",
".",
"__name__... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/qat/modules/conv.py#L152-L178 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/lookup/lookup_ops.py | python | LookupInterface.size | (self, name=None) | Compute the number of elements in this table. | Compute the number of elements in this table. | [
"Compute",
"the",
"number",
"of",
"elements",
"in",
"this",
"table",
"."
] | def size(self, name=None):
"""Compute the number of elements in this table."""
raise NotImplementedError | [
"def",
"size",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/lookup/lookup_ops.py#L64-L66 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/data_flow_ops.py | python | Barrier.ready_size | (self, name=None) | return gen_data_flow_ops._barrier_ready_size(self._barrier_ref, name=name) | Compute the number of complete elements in the given barrier.
Args:
name: A name for the operation (optional).
Returns:
A single-element tensor containing the number of complete elements in the
given barrier. | Compute the number of complete elements in the given barrier. | [
"Compute",
"the",
"number",
"of",
"complete",
"elements",
"in",
"the",
"given",
"barrier",
"."
] | def ready_size(self, name=None):
"""Compute the number of complete elements in the given barrier.
Args:
name: A name for the operation (optional).
Returns:
A single-element tensor containing the number of complete elements in the
given barrier.
"""
if name is None:
name = "... | [
"def",
"ready_size",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"\"%s_BarrierReadySize\"",
"%",
"self",
".",
"_name",
"return",
"gen_data_flow_ops",
".",
"_barrier_ready_size",
"(",
"self",
".",
"_barrier_r... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/data_flow_ops.py#L1028-L1040 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/manifest.py | python | Manifest.process_directive | (self, directive) | Process a directive which either adds some files from ``allfiles`` to
``files``, or removes some files from ``files``.
:param directive: The directive to process. This should be in a format
compatible with distutils ``MANIFEST.in`` files:
http://docs.python.or... | Process a directive which either adds some files from ``allfiles`` to
``files``, or removes some files from ``files``. | [
"Process",
"a",
"directive",
"which",
"either",
"adds",
"some",
"files",
"from",
"allfiles",
"to",
"files",
"or",
"removes",
"some",
"files",
"from",
"files",
"."
] | def process_directive(self, directive):
"""
Process a directive which either adds some files from ``allfiles`` to
``files``, or removes some files from ``files``.
:param directive: The directive to process. This should be in a format
compatible with distutils ``MANI... | [
"def",
"process_directive",
"(",
"self",
",",
"directive",
")",
":",
"# Parse the line: split it up, make sure the right number of words",
"# is there, and return the relevant words. 'action' is always",
"# defined: it's the first word of the line. Which of the other",
"# three are defined d... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/manifest.py#L130-L203 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.