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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/base.py | python | Index._maybe_check_unique | (self) | Check that an Index has no duplicates.
This is typically only called via
`NDFrame.flags.allows_duplicate_labels.setter` when it's set to
True (duplicates aren't allowed).
Raises
------
DuplicateLabelError
When the index is not unique. | Check that an Index has no duplicates. | [
"Check",
"that",
"an",
"Index",
"has",
"no",
"duplicates",
"."
] | def _maybe_check_unique(self) -> None:
"""
Check that an Index has no duplicates.
This is typically only called via
`NDFrame.flags.allows_duplicate_labels.setter` when it's set to
True (duplicates aren't allowed).
Raises
------
DuplicateLabelError
... | [
"def",
"_maybe_check_unique",
"(",
"self",
")",
"->",
"None",
":",
"if",
"not",
"self",
".",
"is_unique",
":",
"msg",
"=",
"\"\"\"Index has duplicates.\"\"\"",
"duplicates",
"=",
"self",
".",
"_format_duplicate_message",
"(",
")",
"msg",
"+=",
"f\"\\n{duplicates}\... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/base.py#L633-L651 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Image.ConvertColourToAlpha | (*args, **kwargs) | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
This method converts an image where the original alpha information is
only available as a shades of a colour (actually shades of grey)
typically when you draw anti-aliased text into a bitmap. The DC
drawing routines draw grey va... | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool | [
"ConvertColourToAlpha",
"(",
"self",
"byte",
"r",
"byte",
"g",
"byte",
"b",
")",
"-",
">",
"bool"
] | def ConvertColourToAlpha(*args, **kwargs):
"""
ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
This method converts an image where the original alpha information is
only available as a shades of a colour (actually shades of grey)
typically when you draw anti-aliased t... | [
"def",
"ConvertColourToAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_ConvertColourToAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L3124-L3136 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/cpp_message.py | python | _IsMessageSetExtension | (field) | return (field.is_extension and
field.containing_type.has_options and
field.containing_type.GetOptions().message_set_wire_format and
field.type == _TYPE_MESSAGE and
field.message_type == field.extension_scope and
field.label == _LABEL_OPTIONAL) | Checks if a field is a message set extension. | Checks if a field is a message set extension. | [
"Checks",
"if",
"a",
"field",
"is",
"a",
"message",
"set",
"extension",
"."
] | def _IsMessageSetExtension(field):
"""Checks if a field is a message set extension."""
return (field.is_extension and
field.containing_type.has_options and
field.containing_type.GetOptions().message_set_wire_format and
field.type == _TYPE_MESSAGE and
field.message_type == fie... | [
"def",
"_IsMessageSetExtension",
"(",
"field",
")",
":",
"return",
"(",
"field",
".",
"is_extension",
"and",
"field",
".",
"containing_type",
".",
"has_options",
"and",
"field",
".",
"containing_type",
".",
"GetOptions",
"(",
")",
".",
"message_set_wire_format",
... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/cpp_message.py#L498-L505 | |
zhaoweicai/mscnn | 534bcac5710a579d60827f192035f7eef6d8c585 | scripts/cpp_lint.py | python | FileInfo.Extension | (self) | return self.Split()[2] | File extension - text following the final period. | File extension - text following the final period. | [
"File",
"extension",
"-",
"text",
"following",
"the",
"final",
"period",
"."
] | def Extension(self):
"""File extension - text following the final period."""
return self.Split()[2] | [
"def",
"Extension",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"2",
"]"
] | https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/scripts/cpp_lint.py#L948-L950 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | EndingList.pop | (self, pos) | return '' | Remove the ending at the current position | Remove the ending at the current position | [
"Remove",
"the",
"ending",
"at",
"the",
"current",
"position"
] | def pop(self, pos):
"Remove the ending at the current position"
if pos.isout():
Trace.error('No ending out of bounds')
return ''
ending = self.findending(pos)
if not ending:
Trace.error('No ending at ' + pos.current())
return ''
for each in reversed(self.endings):
self.... | [
"def",
"pop",
"(",
"self",
",",
"pos",
")",
":",
"if",
"pos",
".",
"isout",
"(",
")",
":",
"Trace",
".",
"error",
"(",
"'No ending out of bounds'",
")",
"return",
"''",
"ending",
"=",
"self",
".",
"findending",
"(",
"pos",
")",
"if",
"not",
"ending",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L1957-L1973 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/py36compat/_dataclasses/dataclasses.py | python | astuple | (obj, *, tuple_factory=tuple) | return _astuple_inner(obj, tuple_factory) | Return the fields of a dataclass instance as a new tuple of field values.
Example usage::
@dataclass
class C:
x: int
y: int
c = C(1, 2)
assert astuple(c) == (1, 2)
If given, 'tuple_factory' will be used instead of built-in tuple.
The function applies recursively t... | Return the fields of a dataclass instance as a new tuple of field values. | [
"Return",
"the",
"fields",
"of",
"a",
"dataclass",
"instance",
"as",
"a",
"new",
"tuple",
"of",
"field",
"values",
"."
] | def astuple(obj, *, tuple_factory=tuple):
"""Return the fields of a dataclass instance as a new tuple of field values.
Example usage::
@dataclass
class C:
x: int
y: int
c = C(1, 2)
assert astuple(c) == (1, 2)
If given, 'tuple_factory' will be used instead of built... | [
"def",
"astuple",
"(",
"obj",
",",
"*",
",",
"tuple_factory",
"=",
"tuple",
")",
":",
"if",
"not",
"_is_dataclass_instance",
"(",
"obj",
")",
":",
"raise",
"TypeError",
"(",
"\"astuple() should be called on dataclass instances\"",
")",
"return",
"_astuple_inner",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/py36compat/_dataclasses/dataclasses.py#L1043-L1064 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/Alias.py | python | Alias.build | (self) | A "builder" for aliases. | A "builder" for aliases. | [
"A",
"builder",
"for",
"aliases",
"."
] | def build(self):
"""A "builder" for aliases."""
pass | [
"def",
"build",
"(",
"self",
")",
":",
"pass"
] | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/Alias.py#L139-L141 | ||
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | script/self_driving/model_server.py | python | ModelServer.cleanup_zmq | (self) | Close the socket when the script exits
:return: | Close the socket when the script exits
:return: | [
"Close",
"the",
"socket",
"when",
"the",
"script",
"exits",
":",
"return",
":"
] | def cleanup_zmq(self):
"""
Close the socket when the script exits
:return:
"""
self.socket.close()
self.context.destroy() | [
"def",
"cleanup_zmq",
"(",
"self",
")",
":",
"self",
".",
"socket",
".",
"close",
"(",
")",
"self",
".",
"context",
".",
"destroy",
"(",
")"
] | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/script/self_driving/model_server.py#L656-L662 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Mazar/MazAr_Admin/apps/smsg_r/smsapp/cache.py | python | is_blacklisted | (name) | return settings.REDIS.sismember(KEY_NAME, name.lower()) | Checks if the app is blacklisted
@param name: app to check
@type name: str
@return: True if blacklisted, False otherwise
@rtype: bool | Checks if the app is blacklisted | [
"Checks",
"if",
"the",
"app",
"is",
"blacklisted"
] | def is_blacklisted(name):
"""
Checks if the app is blacklisted
@param name: app to check
@type name: str
@return: True if blacklisted, False otherwise
@rtype: bool
"""
return settings.REDIS.sismember(KEY_NAME, name.lower()) | [
"def",
"is_blacklisted",
"(",
"name",
")",
":",
"return",
"settings",
".",
"REDIS",
".",
"sismember",
"(",
"KEY_NAME",
",",
"name",
".",
"lower",
"(",
")",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Mazar/MazAr_Admin/apps/smsg_r/smsapp/cache.py#L22-L30 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pathlib.py | python | Path.open | (self, mode='r', buffering=-1, encoding=None,
errors=None, newline=None) | return io.open(self, mode, buffering, encoding, errors, newline,
opener=self._opener) | Open the file pointed by this path and return a file object, as
the built-in open() function does. | Open the file pointed by this path and return a file object, as
the built-in open() function does. | [
"Open",
"the",
"file",
"pointed",
"by",
"this",
"path",
"and",
"return",
"a",
"file",
"object",
"as",
"the",
"built",
"-",
"in",
"open",
"()",
"function",
"does",
"."
] | def open(self, mode='r', buffering=-1, encoding=None,
errors=None, newline=None):
"""
Open the file pointed by this path and return a file object, as
the built-in open() function does.
"""
if self._closed:
self._raise_closed()
return io.open(self,... | [
"def",
"open",
"(",
"self",
",",
"mode",
"=",
"'r'",
",",
"buffering",
"=",
"-",
"1",
",",
"encoding",
"=",
"None",
",",
"errors",
"=",
"None",
",",
"newline",
"=",
"None",
")",
":",
"if",
"self",
".",
"_closed",
":",
"self",
".",
"_raise_closed",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pathlib.py#L1199-L1208 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | utils/vim-lldb/python-vim-lldb/vim_panes.py | python | VimPane.write | (self, msg) | return True | replace buffer with msg | replace buffer with msg | [
"replace",
"buffer",
"with",
"msg"
] | def write(self, msg):
""" replace buffer with msg"""
self.prepare()
msg = str(msg.encode("utf-8", "replace")).split('\n')
try:
self.buffer.append(msg)
vim.command("execute \"normal ggdd\"")
except vim.error:
# cannot update window; happens whe... | [
"def",
"write",
"(",
"self",
",",
"msg",
")",
":",
"self",
".",
"prepare",
"(",
")",
"msg",
"=",
"str",
"(",
"msg",
".",
"encode",
"(",
"\"utf-8\"",
",",
"\"replace\"",
")",
")",
".",
"split",
"(",
"'\\n'",
")",
"try",
":",
"self",
".",
"buffer",... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/vim-lldb/python-vim-lldb/vim_panes.py#L367-L380 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | Font.MakeBold | (*args, **kwargs) | return _gdi_.Font_MakeBold(*args, **kwargs) | MakeBold(self) -> Font | MakeBold(self) -> Font | [
"MakeBold",
"(",
"self",
")",
"-",
">",
"Font"
] | def MakeBold(*args, **kwargs):
"""MakeBold(self) -> Font"""
return _gdi_.Font_MakeBold(*args, **kwargs) | [
"def",
"MakeBold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_MakeBold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L2440-L2442 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/tarfile.py | python | TarFile._extract_member | (self, tarinfo, targetpath, set_attrs=True,
numeric_owner=False) | Extract the TarInfo object tarinfo to a physical
file called targetpath. | Extract the TarInfo object tarinfo to a physical
file called targetpath. | [
"Extract",
"the",
"TarInfo",
"object",
"tarinfo",
"to",
"a",
"physical",
"file",
"called",
"targetpath",
"."
] | def _extract_member(self, tarinfo, targetpath, set_attrs=True,
numeric_owner=False):
"""Extract the TarInfo object tarinfo to a physical
file called targetpath.
"""
# Fetch the TarInfo object for the given name
# and build the destination pathname, repl... | [
"def",
"_extract_member",
"(",
"self",
",",
"tarinfo",
",",
"targetpath",
",",
"set_attrs",
"=",
"True",
",",
"numeric_owner",
"=",
"False",
")",
":",
"# Fetch the TarInfo object for the given name",
"# and build the destination pathname, replacing",
"# forward slashes to pla... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/tarfile.py#L2126-L2168 | ||
pybox2d/pybox2d | 09643321fd363f0850087d1bde8af3f4afd82163 | library/Box2D/examples/empty.py | python | Empty.Step | (self, settings) | Called upon every step.
You should always call
-> super(Your_Test_Class, self).Step(settings)
at the beginning or end of your function.
If placed at the beginning, it will cause the actual physics step to happen first.
If placed at the end, it will cause the physics step to hap... | Called upon every step.
You should always call
-> super(Your_Test_Class, self).Step(settings)
at the beginning or end of your function. | [
"Called",
"upon",
"every",
"step",
".",
"You",
"should",
"always",
"call",
"-",
">",
"super",
"(",
"Your_Test_Class",
"self",
")",
".",
"Step",
"(",
"settings",
")",
"at",
"the",
"beginning",
"or",
"end",
"of",
"your",
"function",
"."
] | def Step(self, settings):
"""Called upon every step.
You should always call
-> super(Your_Test_Class, self).Step(settings)
at the beginning or end of your function.
If placed at the beginning, it will cause the actual physics step to happen first.
If placed at the end, ... | [
"def",
"Step",
"(",
"self",
",",
"settings",
")",
":",
"super",
"(",
"Empty",
",",
"self",
")",
".",
"Step",
"(",
"settings",
")",
"# do stuff",
"# Placed after the physics step, it will draw on top of physics objects",
"self",
".",
"Print",
"(",
"\"*** Base your ow... | https://github.com/pybox2d/pybox2d/blob/09643321fd363f0850087d1bde8af3f4afd82163/library/Box2D/examples/empty.py#L47-L62 | ||
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/boost/tools/build/src/build/scanner.py | python | reset | () | Clear the module state. This is mainly for testing purposes. | Clear the module state. This is mainly for testing purposes. | [
"Clear",
"the",
"module",
"state",
".",
"This",
"is",
"mainly",
"for",
"testing",
"purposes",
"."
] | def reset ():
""" Clear the module state. This is mainly for testing purposes.
"""
global __scanners, __rv_cache, __scanner_cache
# Maps registered scanner classes to relevant properties
__scanners = {}
# A cache of scanners.
# The key is: class_name.properties_tag, where properties_tag is... | [
"def",
"reset",
"(",
")",
":",
"global",
"__scanners",
",",
"__rv_cache",
",",
"__scanner_cache",
"# Maps registered scanner classes to relevant properties",
"__scanners",
"=",
"{",
"}",
"# A cache of scanners.",
"# The key is: class_name.properties_tag, where properties_tag is the... | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/scanner.py#L38-L49 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/internal/type_checkers.py | python | ToShortestFloat | (original) | return rounded | Returns the shortest float that has same value in wire. | Returns the shortest float that has same value in wire. | [
"Returns",
"the",
"shortest",
"float",
"that",
"has",
"same",
"value",
"in",
"wire",
"."
] | def ToShortestFloat(original):
"""Returns the shortest float that has same value in wire."""
# All 4 byte floats have between 6 and 9 significant digits, so we
# start with 6 as the lower bound.
# It has to be iterative because use '.9g' directly can not get rid
# of the noises for most values. For example if... | [
"def",
"ToShortestFloat",
"(",
"original",
")",
":",
"# All 4 byte floats have between 6 and 9 significant digits, so we",
"# start with 6 as the lower bound.",
"# It has to be iterative because use '.9g' directly can not get rid",
"# of the noises for most values. For example if set a float_field... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/type_checkers.py#L75-L87 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiToolBar.GetToolDropDown | (*args, **kwargs) | return _aui.AuiToolBar_GetToolDropDown(*args, **kwargs) | GetToolDropDown(self, int toolId) -> bool | GetToolDropDown(self, int toolId) -> bool | [
"GetToolDropDown",
"(",
"self",
"int",
"toolId",
")",
"-",
">",
"bool"
] | def GetToolDropDown(*args, **kwargs):
"""GetToolDropDown(self, int toolId) -> bool"""
return _aui.AuiToolBar_GetToolDropDown(*args, **kwargs) | [
"def",
"GetToolDropDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_GetToolDropDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L2166-L2168 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/LRScalingFactors.py | python | LRScalingFactors.get_slit_settings | (self, workspace) | return s1h, s1w, s2h, s2w | Return the slit settings
@param workspace: workspace to get the information from | Return the slit settings | [
"Return",
"the",
"slit",
"settings"
] | def get_slit_settings(self, workspace):
"""
Return the slit settings
@param workspace: workspace to get the information from
"""
# Get the slit information
front_slit = self.getProperty("FrontSlitName").value
back_slit = self.getProperty("BackSlitName").va... | [
"def",
"get_slit_settings",
"(",
"self",
",",
"workspace",
")",
":",
"# Get the slit information",
"front_slit",
"=",
"self",
".",
"getProperty",
"(",
"\"FrontSlitName\"",
")",
".",
"value",
"back_slit",
"=",
"self",
".",
"getProperty",
"(",
"\"BackSlitName\"",
")... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/LRScalingFactors.py#L277-L297 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/expressions/expression.py | python | Expression._value_impl | (self) | return self.value | Implementation of .value. | Implementation of .value. | [
"Implementation",
"of",
".",
"value",
"."
] | def _value_impl(self):
"""Implementation of .value.
"""
return self.value | [
"def",
"_value_impl",
"(",
"self",
")",
":",
"return",
"self",
".",
"value"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/expressions/expression.py#L83-L86 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/optimizer/optimizer.py | python | Optimizer.update_multi_precision | (self, index, weight, grad, state) | Updates the given parameter using the corresponding gradient and state.
Mixed precision version.
Parameters
----------
index : int
The unique index of the parameter into the individual learning
rates and weight decays. Learning rates and weight decay
... | Updates the given parameter using the corresponding gradient and state.
Mixed precision version. | [
"Updates",
"the",
"given",
"parameter",
"using",
"the",
"corresponding",
"gradient",
"and",
"state",
".",
"Mixed",
"precision",
"version",
"."
] | def update_multi_precision(self, index, weight, grad, state):
"""Updates the given parameter using the corresponding gradient and state.
Mixed precision version.
Parameters
----------
index : int
The unique index of the parameter into the individual learning
... | [
"def",
"update_multi_precision",
"(",
"self",
",",
"index",
",",
"weight",
",",
"grad",
",",
"state",
")",
":",
"if",
"self",
".",
"multi_precision",
"and",
"weight",
".",
"dtype",
"==",
"numpy",
".",
"float16",
":",
"# Wrapper for mixed precision",
"weight_ma... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/optimizer/optimizer.py#L266-L291 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py | python | MultiIndex.fillna | (self, value=None, downcast=None) | fillna is not implemented for MultiIndex | fillna is not implemented for MultiIndex | [
"fillna",
"is",
"not",
"implemented",
"for",
"MultiIndex"
] | def fillna(self, value=None, downcast=None):
"""
fillna is not implemented for MultiIndex
"""
raise NotImplementedError("isna is not defined for MultiIndex") | [
"def",
"fillna",
"(",
"self",
",",
"value",
"=",
"None",
",",
"downcast",
"=",
"None",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"isna is not defined for MultiIndex\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py#L1454-L1458 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap_external.py | python | SourceLoader.get_code | (self, fullname) | return code_object | Concrete implementation of InspectLoader.get_code.
Reading of bytecode requires path_stats to be implemented. To write
bytecode, set_data must also be implemented. | Concrete implementation of InspectLoader.get_code. | [
"Concrete",
"implementation",
"of",
"InspectLoader",
".",
"get_code",
"."
] | def get_code(self, fullname):
"""Concrete implementation of InspectLoader.get_code.
Reading of bytecode requires path_stats to be implemented. To write
bytecode, set_data must also be implemented.
"""
source_path = self.get_filename(fullname)
source_mtime = None
... | [
"def",
"get_code",
"(",
"self",
",",
"fullname",
")",
":",
"source_path",
"=",
"self",
".",
"get_filename",
"(",
"fullname",
")",
"source_mtime",
"=",
"None",
"source_bytes",
"=",
"None",
"source_hash",
"=",
"None",
"hash_based",
"=",
"False",
"check_source",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap_external.py#L793-L876 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/hang_analyzer.py | python | find_program | (prog, paths) | return None | Finds the specified program in env PATH, or tries a set of paths | Finds the specified program in env PATH, or tries a set of paths | [
"Finds",
"the",
"specified",
"program",
"in",
"env",
"PATH",
"or",
"tries",
"a",
"set",
"of",
"paths"
] | def find_program(prog, paths):
"""Finds the specified program in env PATH, or tries a set of paths """
loc = spawn.find_executable(prog)
if(loc != None):
return loc
for loc in paths:
p = os.path.join(loc, prog)
if os.path.exists(p):
return p
return None | [
"def",
"find_program",
"(",
"prog",
",",
"paths",
")",
":",
"loc",
"=",
"spawn",
".",
"find_executable",
"(",
"prog",
")",
"if",
"(",
"loc",
"!=",
"None",
")",
":",
"return",
"loc",
"for",
"loc",
"in",
"paths",
":",
"p",
"=",
"os",
".",
"path",
"... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/hang_analyzer.py#L77-L89 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/graph_actions.py | python | clear_summary_writers | () | return summary_writer_cache.SummaryWriterCache.clear() | Clear cached summary writers. Currently only used for unit tests. | Clear cached summary writers. Currently only used for unit tests. | [
"Clear",
"cached",
"summary",
"writers",
".",
"Currently",
"only",
"used",
"for",
"unit",
"tests",
"."
] | def clear_summary_writers():
"""Clear cached summary writers. Currently only used for unit tests."""
return summary_writer_cache.SummaryWriterCache.clear() | [
"def",
"clear_summary_writers",
"(",
")",
":",
"return",
"summary_writer_cache",
".",
"SummaryWriterCache",
".",
"clear",
"(",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/graph_actions.py#L60-L62 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/input_lib.py | python | _SingleWorkerOwnedDatasetIterator.__init__ | (self,
dataset=None,
worker=None,
devices=None,
components=None,
element_spec=None,
options=None,
canonicalize_devices=None) | Create iterator for the `dataset` to fetch data to worker's `devices` .
`OwnedMultiDeviceIterator` is used to prefetch input to the devices on the
given worker. The lifetime of this iterator is tied to the encompassing
python object. Once we go out of scope of the python object or return from
a tf.func... | Create iterator for the `dataset` to fetch data to worker's `devices` . | [
"Create",
"iterator",
"for",
"the",
"dataset",
"to",
"fetch",
"data",
"to",
"worker",
"s",
"devices",
"."
] | def __init__(self,
dataset=None,
worker=None,
devices=None,
components=None,
element_spec=None,
options=None,
canonicalize_devices=None):
"""Create iterator for the `dataset` to fetch data to worker's `devices` ... | [
"def",
"__init__",
"(",
"self",
",",
"dataset",
"=",
"None",
",",
"worker",
"=",
"None",
",",
"devices",
"=",
"None",
",",
"components",
"=",
"None",
",",
"element_spec",
"=",
"None",
",",
"options",
"=",
"None",
",",
"canonicalize_devices",
"=",
"None",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/input_lib.py#L1676-L1724 | ||
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/logger.py | python | MegEngineLogFormatter._color_warn | (self, msg) | return "\x1b[1;31m{}\x1b[0m".format(msg) | r"""Sets the color of message as the warning type. | r"""Sets the color of message as the warning type. | [
"r",
"Sets",
"the",
"color",
"of",
"message",
"as",
"the",
"warning",
"type",
"."
] | def _color_warn(self, msg):
r"""Sets the color of message as the warning type."""
return "\x1b[1;31m{}\x1b[0m".format(msg) | [
"def",
"_color_warn",
"(",
"self",
",",
"msg",
")",
":",
"return",
"\"\\x1b[1;31m{}\\x1b[0m\"",
".",
"format",
"(",
"msg",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/logger.py#L46-L48 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | PrintDialogData.SetNoCopies | (*args, **kwargs) | return _windows_.PrintDialogData_SetNoCopies(*args, **kwargs) | SetNoCopies(self, int v) | SetNoCopies(self, int v) | [
"SetNoCopies",
"(",
"self",
"int",
"v",
")"
] | def SetNoCopies(*args, **kwargs):
"""SetNoCopies(self, int v)"""
return _windows_.PrintDialogData_SetNoCopies(*args, **kwargs) | [
"def",
"SetNoCopies",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintDialogData_SetNoCopies",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L5102-L5104 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/user.py | python | User.phone | (self, phone) | Sets the phone of this User.
:param phone: The phone of this User. # noqa: E501
:type: str | Sets the phone of this User. | [
"Sets",
"the",
"phone",
"of",
"this",
"User",
"."
] | def phone(self, phone):
"""Sets the phone of this User.
:param phone: The phone of this User. # noqa: E501
:type: str
"""
self._phone = phone | [
"def",
"phone",
"(",
"self",
",",
"phone",
")",
":",
"self",
".",
"_phone",
"=",
"phone"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user.py#L269-L277 | ||
astra-toolbox/astra-toolbox | 1e7ec8af702e595b76654f2e500f4c00344b273f | python/astra/projector.py | python | delete | (ids) | return p.delete(ids) | Delete a projector object.
:param ids: ID or list of ID's to delete.
:type ids: :class:`int` or :class:`list` | Delete a projector object. | [
"Delete",
"a",
"projector",
"object",
"."
] | def delete(ids):
"""Delete a projector object.
:param ids: ID or list of ID's to delete.
:type ids: :class:`int` or :class:`list`
"""
return p.delete(ids) | [
"def",
"delete",
"(",
"ids",
")",
":",
"return",
"p",
".",
"delete",
"(",
"ids",
")"
] | https://github.com/astra-toolbox/astra-toolbox/blob/1e7ec8af702e595b76654f2e500f4c00344b273f/python/astra/projector.py#L39-L46 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/ExodusViewer/plugins/BackgroundPlugin.py | python | BackgroundPlugin._prefCallbackGradientTopColor | (self, value) | Updates top color when preference saved. | Updates top color when preference saved. | [
"Updates",
"top",
"color",
"when",
"preference",
"saved",
"."
] | def _prefCallbackGradientTopColor(self, value):
"""
Updates top color when preference saved.
"""
self._top = QtGui.QColor(value)
self.updateOptions()
self.windowRequiresUpdate.emit() | [
"def",
"_prefCallbackGradientTopColor",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_top",
"=",
"QtGui",
".",
"QColor",
"(",
"value",
")",
"self",
".",
"updateOptions",
"(",
")",
"self",
".",
"windowRequiresUpdate",
".",
"emit",
"(",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/ExodusViewer/plugins/BackgroundPlugin.py#L90-L96 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_search.py | python | EdFindResults.AllowMultiple | (self) | return True | Find Results allows multiple instances | Find Results allows multiple instances | [
"Find",
"Results",
"allows",
"multiple",
"instances"
] | def AllowMultiple(self):
"""Find Results allows multiple instances"""
return True | [
"def",
"AllowMultiple",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_search.py#L1214-L1216 | |
zerollzeng/tiny-tensorrt | e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2 | third_party/pybind11/tools/clang/cindex.py | python | Index.parse | (self, path, args=None, unsaved_files=None, options = 0) | return TranslationUnit.from_source(path, args, unsaved_files, options,
self) | Load the translation unit from the given source code file by running
clang and generating the AST before loading. Additional command line
parameters can be passed to clang via the args parameter.
In-memory contents for files can be provided by passing a list of pairs
to as unsaved_files... | Load the translation unit from the given source code file by running
clang and generating the AST before loading. Additional command line
parameters can be passed to clang via the args parameter. | [
"Load",
"the",
"translation",
"unit",
"from",
"the",
"given",
"source",
"code",
"file",
"by",
"running",
"clang",
"and",
"generating",
"the",
"AST",
"before",
"loading",
".",
"Additional",
"command",
"line",
"parameters",
"can",
"be",
"passed",
"to",
"clang",
... | def parse(self, path, args=None, unsaved_files=None, options = 0):
"""Load the translation unit from the given source code file by running
clang and generating the AST before loading. Additional command line
parameters can be passed to clang via the args parameter.
In-memory contents fo... | [
"def",
"parse",
"(",
"self",
",",
"path",
",",
"args",
"=",
"None",
",",
"unsaved_files",
"=",
"None",
",",
"options",
"=",
"0",
")",
":",
"return",
"TranslationUnit",
".",
"from_source",
"(",
"path",
",",
"args",
",",
"unsaved_files",
",",
"options",
... | https://github.com/zerollzeng/tiny-tensorrt/blob/e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2/third_party/pybind11/tools/clang/cindex.py#L2405-L2419 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | GLGenerator.WriteCommandIds | (self, filename) | Writes the command buffer format | Writes the command buffer format | [
"Writes",
"the",
"command",
"buffer",
"format"
] | def WriteCommandIds(self, filename):
"""Writes the command buffer format"""
file = CHeaderWriter(filename)
file.Write("#define GLES2_COMMAND_LIST(OP) \\\n")
id = 256
for func in self.functions:
file.Write(" %-60s /* %d */ \\\n" %
("OP(%s)" % func.name, id))
id += 1
... | [
"def",
"WriteCommandIds",
"(",
"self",
",",
"filename",
")",
":",
"file",
"=",
"CHeaderWriter",
"(",
"filename",
")",
"file",
".",
"Write",
"(",
"\"#define GLES2_COMMAND_LIST(OP) \\\\\\n\"",
")",
"id",
"=",
"256",
"for",
"func",
"in",
"self",
".",
"functions",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L7021-L7041 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | PseudoDC.DrawRoundedRectanglePointSize | (*args, **kwargs) | return _gdi_.PseudoDC_DrawRoundedRectanglePointSize(*args, **kwargs) | DrawRoundedRectanglePointSize(self, Point pt, Size sz, double radius)
Draws a rectangle with the given top left corner, and with the given
size. The corners are quarter-circles using the given radius. The
current pen is used for the outline and the current brush for filling
the shape.
... | DrawRoundedRectanglePointSize(self, Point pt, Size sz, double radius) | [
"DrawRoundedRectanglePointSize",
"(",
"self",
"Point",
"pt",
"Size",
"sz",
"double",
"radius",
")"
] | def DrawRoundedRectanglePointSize(*args, **kwargs):
"""
DrawRoundedRectanglePointSize(self, Point pt, Size sz, double radius)
Draws a rectangle with the given top left corner, and with the given
size. The corners are quarter-circles using the given radius. The
current pen is use... | [
"def",
"DrawRoundedRectanglePointSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_DrawRoundedRectanglePointSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L7978-L7994 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py | python | get_capi_name | (cppname, isclassname, prefix = None) | return result | Convert a C++ CamelCaps name to a C API underscore name. | Convert a C++ CamelCaps name to a C API underscore name. | [
"Convert",
"a",
"C",
"++",
"CamelCaps",
"name",
"to",
"a",
"C",
"API",
"underscore",
"name",
"."
] | def get_capi_name(cppname, isclassname, prefix = None):
""" Convert a C++ CamelCaps name to a C API underscore name. """
result = ''
lastchr = ''
for chr in cppname:
# add an underscore if the current character is an upper case letter
# and the last character was a lower case letter
... | [
"def",
"get_capi_name",
"(",
"cppname",
",",
"isclassname",
",",
"prefix",
"=",
"None",
")",
":",
"result",
"=",
"''",
"lastchr",
"=",
"''",
"for",
"chr",
"in",
"cppname",
":",
"# add an underscore if the current character is an upper case letter",
"# and the last cha... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L107-L134 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/sax/xmlreader.py | python | XMLReader.setDTDHandler | (self, handler) | Register an object to receive basic DTD-related events. | Register an object to receive basic DTD-related events. | [
"Register",
"an",
"object",
"to",
"receive",
"basic",
"DTD",
"-",
"related",
"events",
"."
] | def setDTDHandler(self, handler):
"Register an object to receive basic DTD-related events."
self._dtd_handler = handler | [
"def",
"setDTDHandler",
"(",
"self",
",",
"handler",
")",
":",
"self",
".",
"_dtd_handler",
"=",
"handler"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/xml/sax/xmlreader.py#L46-L48 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/nanops.py | python | _get_counts_nanvar | (
value_counts: Tuple[int],
mask: Optional[np.ndarray],
axis: Optional[int],
ddof: int,
dtype=float,
) | return count, d | Get the count of non-null values along an axis, accounting
for degrees of freedom.
Parameters
----------
values_shape : Tuple[int]
shape tuple from values ndarray, used if mask is None
mask : Optional[ndarray[bool]]
locations in values that should be considered missing
axis : Op... | Get the count of non-null values along an axis, accounting
for degrees of freedom. | [
"Get",
"the",
"count",
"of",
"non",
"-",
"null",
"values",
"along",
"an",
"axis",
"accounting",
"for",
"degrees",
"of",
"freedom",
"."
] | def _get_counts_nanvar(
value_counts: Tuple[int],
mask: Optional[np.ndarray],
axis: Optional[int],
ddof: int,
dtype=float,
) -> Tuple[Union[int, np.ndarray], Union[int, np.ndarray]]:
""" Get the count of non-null values along an axis, accounting
for degrees of freedom.
Parameters
--... | [
"def",
"_get_counts_nanvar",
"(",
"value_counts",
":",
"Tuple",
"[",
"int",
"]",
",",
"mask",
":",
"Optional",
"[",
"np",
".",
"ndarray",
"]",
",",
"axis",
":",
"Optional",
"[",
"int",
"]",
",",
"ddof",
":",
"int",
",",
"dtype",
"=",
"float",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/nanops.py#L627-L669 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/games/dynamic_routing_utils.py | python | assign_dictionary_input_to_object | (dict_object: Dict[str, Any],
road_sections: Iterable[str],
default_value: Any) | return dict_object_returned | Check dictionary has road sections has key or return default_value dict. | Check dictionary has road sections has key or return default_value dict. | [
"Check",
"dictionary",
"has",
"road",
"sections",
"has",
"key",
"or",
"return",
"default_value",
"dict",
"."
] | def assign_dictionary_input_to_object(dict_object: Dict[str, Any],
road_sections: Iterable[str],
default_value: Any) -> Dict[str, Any]:
"""Check dictionary has road sections has key or return default_value dict."""
if dict_object:
asser... | [
"def",
"assign_dictionary_input_to_object",
"(",
"dict_object",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
",",
"road_sections",
":",
"Iterable",
"[",
"str",
"]",
",",
"default_value",
":",
"Any",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"if",... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/games/dynamic_routing_utils.py#L43-L54 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pylowering.py | python | PyLower._freeze_string | (self, string) | return self.lower_const(string) | Freeze a Python string object into the code. | Freeze a Python string object into the code. | [
"Freeze",
"a",
"Python",
"string",
"object",
"into",
"the",
"code",
"."
] | def _freeze_string(self, string):
"""
Freeze a Python string object into the code.
"""
return self.lower_const(string) | [
"def",
"_freeze_string",
"(",
"self",
",",
"string",
")",
":",
"return",
"self",
".",
"lower_const",
"(",
"string",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pylowering.py#L628-L632 | |
shedskin/shedskin | ae88dbca7b1d9671cd8be448cb0b497122758936 | examples/amaze.py | python | MazeSolver.printResult | (self) | Print the maze showing the path | Print the maze showing the path | [
"Print",
"the",
"maze",
"showing",
"the",
"path"
] | def printResult(self):
""" Print the maze showing the path """
for x,y in self._path:
self.maze.setItem(x,y,PATH)
self.maze.setItem(self._start[0], self._start[1], START)
self.maze.setItem(self._end[0], self._end[1], EXIT) | [
"def",
"printResult",
"(",
"self",
")",
":",
"for",
"x",
",",
"y",
"in",
"self",
".",
"_path",
":",
"self",
".",
"maze",
".",
"setItem",
"(",
"x",
",",
"y",
",",
"PATH",
")",
"self",
".",
"maze",
".",
"setItem",
"(",
"self",
".",
"_start",
"[",... | https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/amaze.py#L405-L412 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | base/PRESUBMIT.py | python | _CheckNoInterfacesInBase | (input_api, output_api) | return [] | Checks to make sure no files in libbase.a have |@interface|. | Checks to make sure no files in libbase.a have | | [
"Checks",
"to",
"make",
"sure",
"no",
"files",
"in",
"libbase",
".",
"a",
"have",
"|"
] | def _CheckNoInterfacesInBase(input_api, output_api):
"""Checks to make sure no files in libbase.a have |@interface|."""
pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE)
files = []
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
if (f.LocalPath().startswith('base/... | [
"def",
"_CheckNoInterfacesInBase",
"(",
"input_api",
",",
"output_api",
")",
":",
"pattern",
"=",
"input_api",
".",
"re",
".",
"compile",
"(",
"r'^\\s*@interface'",
",",
"input_api",
".",
"re",
".",
"MULTILINE",
")",
"files",
"=",
"[",
"]",
"for",
"f",
"in... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/base/PRESUBMIT.py#L11-L30 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/HyperParser.py | python | HyperParser.set_index | (self, index) | Set the index to which the functions relate. Note that it must be
in the same statement. | Set the index to which the functions relate. Note that it must be
in the same statement. | [
"Set",
"the",
"index",
"to",
"which",
"the",
"functions",
"relate",
".",
"Note",
"that",
"it",
"must",
"be",
"in",
"the",
"same",
"statement",
"."
] | def set_index(self, index):
"""Set the index to which the functions relate. Note that it must be
in the same statement.
"""
indexinrawtext = \
len(self.rawtext) - len(self.text.get(index, self.stopatindex))
if indexinrawtext < 0:
raise ValueError("The inde... | [
"def",
"set_index",
"(",
"self",
",",
"index",
")",
":",
"indexinrawtext",
"=",
"len",
"(",
"self",
".",
"rawtext",
")",
"-",
"len",
"(",
"self",
".",
"text",
".",
"get",
"(",
"index",
",",
"self",
".",
"stopatindex",
")",
")",
"if",
"indexinrawtext"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/HyperParser.py#L72-L89 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/model_utils/export_output.py | python | ClassificationOutput.__init__ | (self, scores=None, classes=None) | Constructor for `ClassificationOutput`.
Args:
scores: A float `Tensor` giving scores (sometimes but not always
interpretable as probabilities) for each class. May be `None`, but
only if `classes` is set. Interpretation varies-- see class doc.
classes: A string `Tensor` giving pred... | Constructor for `ClassificationOutput`. | [
"Constructor",
"for",
"ClassificationOutput",
"."
] | def __init__(self, scores=None, classes=None):
"""Constructor for `ClassificationOutput`.
Args:
scores: A float `Tensor` giving scores (sometimes but not always
interpretable as probabilities) for each class. May be `None`, but
only if `classes` is set. Interpretation varies-- see c... | [
"def",
"__init__",
"(",
"self",
",",
"scores",
"=",
"None",
",",
"classes",
"=",
"None",
")",
":",
"if",
"(",
"scores",
"is",
"not",
"None",
"and",
"not",
"(",
"isinstance",
"(",
"scores",
",",
"ops",
".",
"Tensor",
")",
"and",
"scores",
".",
"dtyp... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/model_utils/export_output.py#L120-L148 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchPanel.py | python | PanelSheet.getTags | (self,obj,transform=False) | return outp | getTags(obj,transform=False): returns a list of compounds whose wires define the
tags (engravings) contained in the panels in this sheet and the sheet intself.
If transform is True, the placement of the sheet will be added to each wire.
Warning, the wires returned by this function may not be clo... | getTags(obj,transform=False): returns a list of compounds whose wires define the
tags (engravings) contained in the panels in this sheet and the sheet intself.
If transform is True, the placement of the sheet will be added to each wire.
Warning, the wires returned by this function may not be clo... | [
"getTags",
"(",
"obj",
"transform",
"=",
"False",
")",
":",
"returns",
"a",
"list",
"of",
"compounds",
"whose",
"wires",
"define",
"the",
"tags",
"(",
"engravings",
")",
"contained",
"in",
"the",
"panels",
"in",
"this",
"sheet",
"and",
"the",
"sheet",
"i... | def getTags(self,obj,transform=False):
"""getTags(obj,transform=False): returns a list of compounds whose wires define the
tags (engravings) contained in the panels in this sheet and the sheet intself.
If transform is True, the placement of the sheet will be added to each wire.
Warning,... | [
"def",
"getTags",
"(",
"self",
",",
"obj",
",",
"transform",
"=",
"False",
")",
":",
"outp",
"=",
"[",
"]",
"for",
"p",
"in",
"obj",
".",
"Group",
":",
"if",
"hasattr",
"(",
"p",
",",
"\"Proxy\"",
")",
":",
"if",
"hasattr",
"(",
"p",
".",
"Prox... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchPanel.py#L1349-L1375 | |
scribusproject/scribus | 41ec7c775a060912cf251682a8b1437f753f80f4 | scribus/plugins/scriptplugin/scripts/FontSample.py | python | draw_selection | (fontList, getSizeOnly) | return pageBlocks | Draws the sample blocks onto the Scribus canvas.
Measure one font sample block including any horizontal lines and extra
vertical spaces.
Get the amount of vertical space available for the text area between the
top line and top of page number area.
Use these two values to calculate how many complete... | Draws the sample blocks onto the Scribus canvas. | [
"Draws",
"the",
"sample",
"blocks",
"onto",
"the",
"Scribus",
"canvas",
"."
] | def draw_selection(fontList, getSizeOnly):
"""Draws the sample blocks onto the Scribus canvas.
Measure one font sample block including any horizontal lines and extra
vertical spaces.
Get the amount of vertical space available for the text area between the
top line and top of page number area.
U... | [
"def",
"draw_selection",
"(",
"fontList",
",",
"getSizeOnly",
")",
":",
"progress",
"=",
"1",
"scribus",
".",
"progressReset",
"(",
")",
"scribus",
".",
"progressTotal",
"(",
"len",
"(",
"fontList",
")",
")",
"tocList",
"=",
"[",
"]",
"pageNum",
"=",
"1"... | https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scriptplugin/scripts/FontSample.py#L679-L767 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/dvips.py | python | DviPsStrFunction | (target = None, source= None, env=None) | return result | A strfunction for dvipdf that returns the appropriate
command string for the no_exec options. | A strfunction for dvipdf that returns the appropriate
command string for the no_exec options. | [
"A",
"strfunction",
"for",
"dvipdf",
"that",
"returns",
"the",
"appropriate",
"command",
"string",
"for",
"the",
"no_exec",
"options",
"."
] | def DviPsStrFunction(target = None, source= None, env=None):
"""A strfunction for dvipdf that returns the appropriate
command string for the no_exec options."""
if env.GetOption("no_exec"):
result = env.subst('$PSCOM',0,target,source)
else:
result = ''
return result | [
"def",
"DviPsStrFunction",
"(",
"target",
"=",
"None",
",",
"source",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"if",
"env",
".",
"GetOption",
"(",
"\"no_exec\"",
")",
":",
"result",
"=",
"env",
".",
"subst",
"(",
"'$PSCOM'",
",",
"0",
",",
"... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/dvips.py#L45-L52 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/mox.py | python | MockMethod.WithSideEffects | (self, side_effects) | return self | Set the side effects that are simulated when this method is called.
Args:
side_effects: A callable which modifies the parameters or other relevant
state which a given test case depends on.
Returns:
Self for chaining with AndReturn and AndRaise. | Set the side effects that are simulated when this method is called. | [
"Set",
"the",
"side",
"effects",
"that",
"are",
"simulated",
"when",
"this",
"method",
"is",
"called",
"."
] | def WithSideEffects(self, side_effects):
"""Set the side effects that are simulated when this method is called.
Args:
side_effects: A callable which modifies the parameters or other relevant
state which a given test case depends on.
Returns:
Self for chaining with AndReturn and AndRais... | [
"def",
"WithSideEffects",
"(",
"self",
",",
"side_effects",
")",
":",
"self",
".",
"_side_effects",
"=",
"side_effects",
"return",
"self"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/mox.py#L738-L749 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/retdec-3.2/scripts/type_extractor/type_extractor/utils.py | python | get_files_with_suffix_from_path | (path, suffix='') | Returns path if it's file. Otherwise recursively walks path and returns all
files with given suffix. | Returns path if it's file. Otherwise recursively walks path and returns all
files with given suffix. | [
"Returns",
"path",
"if",
"it",
"s",
"file",
".",
"Otherwise",
"recursively",
"walks",
"path",
"and",
"returns",
"all",
"files",
"with",
"given",
"suffix",
"."
] | def get_files_with_suffix_from_path(path, suffix=''):
"""Returns path if it's file. Otherwise recursively walks path and returns all
files with given suffix.
"""
if os.path.isfile(path) and path.endswith(suffix):
yield path
else:
for dir_path, _, file_list in os.walk(path):
... | [
"def",
"get_files_with_suffix_from_path",
"(",
"path",
",",
"suffix",
"=",
"''",
")",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
")",
"and",
"path",
".",
"endswith",
"(",
"suffix",
")",
":",
"yield",
"path",
"else",
":",
"for",
"dir_path... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/utils.py#L16-L26 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/descriptor_database.py | python | _ExtractSymbols | (desc_proto, package) | Pulls out all the symbols from a descriptor proto.
Args:
desc_proto: The proto to extract symbols from.
package: The package containing the descriptor type.
Yields:
The fully qualified name found in the descriptor. | Pulls out all the symbols from a descriptor proto. | [
"Pulls",
"out",
"all",
"the",
"symbols",
"from",
"a",
"descriptor",
"proto",
"."
] | def _ExtractSymbols(desc_proto, package):
"""Pulls out all the symbols from a descriptor proto.
Args:
desc_proto: The proto to extract symbols from.
package: The package containing the descriptor type.
Yields:
The fully qualified name found in the descriptor.
"""
message_name = package + '.' + d... | [
"def",
"_ExtractSymbols",
"(",
"desc_proto",
",",
"package",
")",
":",
"message_name",
"=",
"package",
"+",
"'.'",
"+",
"desc_proto",
".",
"name",
"if",
"package",
"else",
"desc_proto",
".",
"name",
"yield",
"message_name",
"for",
"nested_type",
"in",
"desc_pr... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/descriptor_database.py#L161-L177 | ||
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/110.balanced-binary-tree.py | python | Solution.isBalanced | (self, root) | return self.helper(root) != -1 | :type root: TreeNode
:rtype: bool | :type root: TreeNode
:rtype: bool | [
":",
"type",
"root",
":",
"TreeNode",
":",
"rtype",
":",
"bool"
] | def isBalanced(self, root):
"""
:type root: TreeNode
:rtype: bool
"""
return self.helper(root) != -1 | [
"def",
"isBalanced",
"(",
"self",
",",
"root",
")",
":",
"return",
"self",
".",
"helper",
"(",
"root",
")",
"!=",
"-",
"1"
] | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/110.balanced-binary-tree.py#L9-L14 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/mox.py | python | MockObject.__class__ | (self) | return self._class_to_mock | Return the class that is being mocked. | Return the class that is being mocked. | [
"Return",
"the",
"class",
"that",
"is",
"being",
"mocked",
"."
] | def __class__(self):
"""Return the class that is being mocked."""
return self._class_to_mock | [
"def",
"__class__",
"(",
"self",
")",
":",
"return",
"self",
".",
"_class_to_mock"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/mox.py#L504-L507 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/execution.py | python | Execution.currency | (self) | return self._currency | Gets the currency of this Execution. # noqa: E501
:return: The currency of this Execution. # noqa: E501
:rtype: str | Gets the currency of this Execution. # noqa: E501 | [
"Gets",
"the",
"currency",
"of",
"this",
"Execution",
".",
"#",
"noqa",
":",
"E501"
] | def currency(self):
"""Gets the currency of this Execution. # noqa: E501
:return: The currency of this Execution. # noqa: E501
:rtype: str
"""
return self._currency | [
"def",
"currency",
"(",
"self",
")",
":",
"return",
"self",
".",
"_currency"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/execution.py#L681-L688 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Listbox.curselection | (self) | return self._getints(self.tk.call(self._w, 'curselection')) or () | Return the indices of currently selected item. | Return the indices of currently selected item. | [
"Return",
"the",
"indices",
"of",
"currently",
"selected",
"item",
"."
] | def curselection(self):
"""Return the indices of currently selected item."""
return self._getints(self.tk.call(self._w, 'curselection')) or () | [
"def",
"curselection",
"(",
"self",
")",
":",
"return",
"self",
".",
"_getints",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'curselection'",
")",
")",
"or",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2786-L2788 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextObjectList.index | (*args, **kwargs) | return _richtext.RichTextObjectList_index(*args, **kwargs) | index(self, RichTextObject obj) -> int | index(self, RichTextObject obj) -> int | [
"index",
"(",
"self",
"RichTextObject",
"obj",
")",
"-",
">",
"int"
] | def index(*args, **kwargs):
"""index(self, RichTextObject obj) -> int"""
return _richtext.RichTextObjectList_index(*args, **kwargs) | [
"def",
"index",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObjectList_index",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1542-L1544 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py | python | Cursor.enum_type | (self) | return self._enum_type | Return the integer type of an enum declaration.
Returns a Type corresponding to an integer. If the cursor is not for an
enum, this raises. | Return the integer type of an enum declaration. | [
"Return",
"the",
"integer",
"type",
"of",
"an",
"enum",
"declaration",
"."
] | def enum_type(self):
"""Return the integer type of an enum declaration.
Returns a Type corresponding to an integer. If the cursor is not for an
enum, this raises.
"""
if not hasattr(self, '_enum_type'):
assert self.kind == CursorKind.ENUM_DECL
self._enum_... | [
"def",
"enum_type",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_enum_type'",
")",
":",
"assert",
"self",
".",
"kind",
"==",
"CursorKind",
".",
"ENUM_DECL",
"self",
".",
"_enum_type",
"=",
"conf",
".",
"lib",
".",
"clang_getEnumDec... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L1549-L1559 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py | python | obj_header.get_base_class_name | (self, classname) | return None | Returns the base (root) class name for |classname|. | Returns the base (root) class name for |classname|. | [
"Returns",
"the",
"base",
"(",
"root",
")",
"class",
"name",
"for",
"|classname|",
"."
] | def get_base_class_name(self, classname):
""" Returns the base (root) class name for |classname|. """
cur_cls = self.get_class(classname)
while True:
parent_name = cur_cls.get_parent_name()
if is_base_class(parent_name):
return parent_name
else... | [
"def",
"get_base_class_name",
"(",
"self",
",",
"classname",
")",
":",
"cur_cls",
"=",
"self",
".",
"get_class",
"(",
"classname",
")",
"while",
"True",
":",
"parent_name",
"=",
"cur_cls",
".",
"get_parent_name",
"(",
")",
"if",
"is_base_class",
"(",
"parent... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L682-L694 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.LineScrollDown | (*args, **kwargs) | return _stc.StyledTextCtrl_LineScrollDown(*args, **kwargs) | LineScrollDown(self)
Scroll the document down, keeping the caret visible. | LineScrollDown(self) | [
"LineScrollDown",
"(",
"self",
")"
] | def LineScrollDown(*args, **kwargs):
"""
LineScrollDown(self)
Scroll the document down, keeping the caret visible.
"""
return _stc.StyledTextCtrl_LineScrollDown(*args, **kwargs) | [
"def",
"LineScrollDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_LineScrollDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4684-L4690 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/initializer.py | python | Initializer.__call__ | (self, name, arr) | Override () function to do Initialization
Parameters
----------
name : str
name of corrosponding ndarray
arr : NDArray
ndarray to be Initialized | Override () function to do Initialization | [
"Override",
"()",
"function",
"to",
"do",
"Initialization"
] | def __call__(self, name, arr):
"""Override () function to do Initialization
Parameters
----------
name : str
name of corrosponding ndarray
arr : NDArray
ndarray to be Initialized
"""
if not isinstance(name, string_types):
rais... | [
"def",
"__call__",
"(",
"self",
",",
"name",
",",
"arr",
")",
":",
"if",
"not",
"isinstance",
"(",
"name",
",",
"string_types",
")",
":",
"raise",
"TypeError",
"(",
"'name must be string'",
")",
"if",
"not",
"isinstance",
"(",
"arr",
",",
"NDArray",
")",... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/initializer.py#L15-L49 | ||
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/context.py | python | Context.texture | (self, size, components, data=None, *, samples=0, alignment=1,
dtype='f1', internal_format=None) | return res | Create a :py:class:`Texture` object.
.. Warning:: Do not play with ``internal_format`` unless you know exactly
you are doing. This is an override to support sRGB and
compressed textures if needed.
Args:
size (tuple): The width a... | Create a :py:class:`Texture` object. | [
"Create",
"a",
":",
"py",
":",
"class",
":",
"Texture",
"object",
"."
] | def texture(self, size, components, data=None, *, samples=0, alignment=1,
dtype='f1', internal_format=None) -> 'Texture':
'''
Create a :py:class:`Texture` object.
.. Warning:: Do not play with ``internal_format`` unless you know exactly
you are d... | [
"def",
"texture",
"(",
"self",
",",
"size",
",",
"components",
",",
"data",
"=",
"None",
",",
"*",
",",
"samples",
"=",
"0",
",",
"alignment",
"=",
"1",
",",
"dtype",
"=",
"'f1'",
",",
"internal_format",
"=",
"None",
")",
"->",
"'Texture'",
":",
"r... | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/context.py#L1114-L1147 | |
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/google/protobuf/internal/python_message.py | python | _AddPropertiesForNonRepeatedCompositeField | (field, cls) | Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field.
Clients can use this property to get the value of the field, but cannot
assign to the property directly.
Args:
field: A FieldDescriptor for this field.
cls: The class we're co... | Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field. | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"nonrepeated",
"composite",
"protocol",
"message",
"field",
".",
"A",
"composite",
"field",
"is",
"a",
"group",
"or",
"message",
"field",
"."
] | def _AddPropertiesForNonRepeatedCompositeField(field, cls):
"""Adds a public property for a nonrepeated, composite protocol message field.
A composite field is a "group" or "message" field.
Clients can use this property to get the value of the field, but cannot
assign to the property directly.
Args:
fie... | [
"def",
"_AddPropertiesForNonRepeatedCompositeField",
"(",
"field",
",",
"cls",
")",
":",
"# TODO(robinson): Remove duplication with similar method",
"# for non-repeated scalars.",
"proto_field_name",
"=",
"field",
".",
"name",
"property_name",
"=",
"_PropertyName",
"(",
"proto_... | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/python_message.py#L492-L543 | ||
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | thirdparty/gflags/gflags.py | python | Flag._WriteCustomInfoInXMLFormat | (self, outfile, indent) | Writes extra info about this flag, in XML format.
"Extra" means "not already printed by WriteInfoInXMLFormat above."
Args:
outfile: File object we write to.
indent: A string that is prepended to each generated line. | Writes extra info about this flag, in XML format. | [
"Writes",
"extra",
"info",
"about",
"this",
"flag",
"in",
"XML",
"format",
"."
] | def _WriteCustomInfoInXMLFormat(self, outfile, indent):
"""Writes extra info about this flag, in XML format.
"Extra" means "not already printed by WriteInfoInXMLFormat above."
Args:
outfile: File object we write to.
indent: A string that is prepended to each generated line.
"""
# Usual... | [
"def",
"_WriteCustomInfoInXMLFormat",
"(",
"self",
",",
"outfile",
",",
"indent",
")",
":",
"# Usually, the parser knows the extra details about the flag, so",
"# we just forward the call to it.",
"self",
".",
"parser",
".",
"WriteCustomInfoInXMLFormat",
"(",
"outfile",
",",
... | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/thirdparty/gflags/gflags.py#L1889-L1900 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/utils/benchmark/examples/sparse/compare.py | python | generate_coo_data | (size, sparse_dim, nnz, dtype, device) | return indices, values | Parameters
----------
size : tuple
sparse_dim : int
nnz : int
dtype : torch.dtype
device : str
Returns
-------
indices : torch.tensor
values : torch.tensor | Parameters
----------
size : tuple
sparse_dim : int
nnz : int
dtype : torch.dtype
device : str
Returns
-------
indices : torch.tensor
values : torch.tensor | [
"Parameters",
"----------",
"size",
":",
"tuple",
"sparse_dim",
":",
"int",
"nnz",
":",
"int",
"dtype",
":",
"torch",
".",
"dtype",
"device",
":",
"str",
"Returns",
"-------",
"indices",
":",
"torch",
".",
"tensor",
"values",
":",
"torch",
".",
"tensor"
] | def generate_coo_data(size, sparse_dim, nnz, dtype, device):
"""
Parameters
----------
size : tuple
sparse_dim : int
nnz : int
dtype : torch.dtype
device : str
Returns
-------
indices : torch.tensor
values : torch.tensor
"""
if dtype is None:
dtype = 'floa... | [
"def",
"generate_coo_data",
"(",
"size",
",",
"sparse_dim",
",",
"nnz",
",",
"dtype",
",",
"device",
")",
":",
"if",
"dtype",
"is",
"None",
":",
"dtype",
"=",
"'float32'",
"indices",
"=",
"torch",
".",
"rand",
"(",
"sparse_dim",
",",
"nnz",
",",
"devic... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/benchmark/examples/sparse/compare.py#L45-L66 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/mms/moosefunction.py | python | MooseFunctionPrinter._print_Symbol | (self, expr) | Print _u instead of u, following the MOOSE member variable convention. | Print _u instead of u, following the MOOSE member variable convention. | [
"Print",
"_u",
"instead",
"of",
"u",
"following",
"the",
"MOOSE",
"member",
"variable",
"convention",
"."
] | def _print_Symbol(self, expr):
"""
Print _u instead of u, following the MOOSE member variable convention.
"""
s = str(expr)
if s.endswith(('_x', '_y', '_z')):
return '_{}({})'.format(s[:-2], 'xyz'.index(s[-1]))
elif s != 't':
return '_{}'.format(e... | [
"def",
"_print_Symbol",
"(",
"self",
",",
"expr",
")",
":",
"s",
"=",
"str",
"(",
"expr",
")",
"if",
"s",
".",
"endswith",
"(",
"(",
"'_x'",
",",
"'_y'",
",",
"'_z'",
")",
")",
":",
"return",
"'_{}({})'",
".",
"format",
"(",
"s",
"[",
":",
"-",... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/mms/moosefunction.py#L25-L37 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/value_object/read/value_members.py | python | ContainerMember.__init__ | (self, name, submembers) | :param submembers: Stored members as a list or dict
:type submembers: list, dict | :param submembers: Stored members as a list or dict
:type submembers: list, dict | [
":",
"param",
"submembers",
":",
"Stored",
"members",
"as",
"a",
"list",
"or",
"dict",
":",
"type",
"submembers",
":",
"list",
"dict"
] | def __init__(self, name, submembers):
"""
:param submembers: Stored members as a list or dict
:type submembers: list, dict
"""
super().__init__(name)
self.value = {}
# submembers is a list of members
if not isinstance(submembers, dict):
self.... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"submembers",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"name",
")",
"self",
".",
"value",
"=",
"{",
"}",
"# submembers is a list of members",
"if",
"not",
"isinstance",
"(",
"submembers",
",",
"... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/value_object/read/value_members.py#L301-L315 | ||
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | benchmarks/util/big_query_utils.py | python | create_big_query | () | return discovery.build(
'bigquery', 'v2', credentials=creds, cache_discovery=False) | Authenticates with cloud platform and gets a BiqQuery service object | Authenticates with cloud platform and gets a BiqQuery service object | [
"Authenticates",
"with",
"cloud",
"platform",
"and",
"gets",
"a",
"BiqQuery",
"service",
"object"
] | def create_big_query():
"""Authenticates with cloud platform and gets a BiqQuery service object
"""
creds = GoogleCredentials.get_application_default()
return discovery.build(
'bigquery', 'v2', credentials=creds, cache_discovery=False) | [
"def",
"create_big_query",
"(",
")",
":",
"creds",
"=",
"GoogleCredentials",
".",
"get_application_default",
"(",
")",
"return",
"discovery",
".",
"build",
"(",
"'bigquery'",
",",
"'v2'",
",",
"credentials",
"=",
"creds",
",",
"cache_discovery",
"=",
"False",
... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/benchmarks/util/big_query_utils.py#L18-L23 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/mod.py | python | _mod_tbe | () | return | Mod TBE register | Mod TBE register | [
"Mod",
"TBE",
"register"
] | def _mod_tbe():
"""Mod TBE register"""
return | [
"def",
"_mod_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/mod.py#L39-L41 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | CalculateVariables | (default_variables, params) | Generated variables that require params to be known. | Generated variables that require params to be known. | [
"Generated",
"variables",
"that",
"require",
"params",
"to",
"be",
"known",
"."
] | def CalculateVariables(default_variables, params):
"""Generated variables that require params to be known."""
generator_flags = params.get('generator_flags', {})
# Select project file format version (if unset, default to auto detecting).
msvs_version = MSVSVersion.SelectVisualStudioVersion(
generator_fl... | [
"def",
"CalculateVariables",
"(",
"default_variables",
",",
"params",
")",
":",
"generator_flags",
"=",
"params",
".",
"get",
"(",
"'generator_flags'",
",",
"{",
"}",
")",
"# Select project file format version (if unset, default to auto detecting).",
"msvs_version",
"=",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L1893-L1918 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Dnn.py | python | Dnn.output_layers | (self) | return self.get_outputs() | All sink layers of the network. | All sink layers of the network. | [
"All",
"sink",
"layers",
"of",
"the",
"network",
"."
] | def output_layers(self):
"""All sink layers of the network.
"""
return self.get_outputs() | [
"def",
"output_layers",
"(",
"self",
")",
":",
"return",
"self",
".",
"get_outputs",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Dnn.py#L119-L122 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/samplelogs/view.py | python | SampleLogsView.set_model | (self, model) | Set the model onto the table | Set the model onto the table | [
"Set",
"the",
"model",
"onto",
"the",
"table"
] | def set_model(self, model):
"""Set the model onto the table"""
self.model = model
self.table.setModel(self.model)
self.table.resizeColumnsToContents()
self.table.horizontalHeader().setSectionResizeMode(2, QHeaderView.Stretch)
self.table.selectionModel().selectionChanged.c... | [
"def",
"set_model",
"(",
"self",
",",
"model",
")",
":",
"self",
".",
"model",
"=",
"model",
"self",
".",
"table",
".",
"setModel",
"(",
"self",
".",
"model",
")",
"self",
".",
"table",
".",
"resizeColumnsToContents",
"(",
")",
"self",
".",
"table",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/samplelogs/view.py#L141-L147 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/ast.py | python | FieldListEntry.get_should_forward | (self) | return self.forward_to_shards or self.forward_from_shards | Get the shard-forwarding rule for a generic argument or reply field. | Get the shard-forwarding rule for a generic argument or reply field. | [
"Get",
"the",
"shard",
"-",
"forwarding",
"rule",
"for",
"a",
"generic",
"argument",
"or",
"reply",
"field",
"."
] | def get_should_forward(self):
"""Get the shard-forwarding rule for a generic argument or reply field."""
assert not (self.forward_to_shards and self.forward_from_shards), \
"Only FieldListEntry.forward_to_shards or forward_from_shards should be set"
return self.forward_to_shards or ... | [
"def",
"get_should_forward",
"(",
"self",
")",
":",
"assert",
"not",
"(",
"self",
".",
"forward_to_shards",
"and",
"self",
".",
"forward_from_shards",
")",
",",
"\"Only FieldListEntry.forward_to_shards or forward_from_shards should be set\"",
"return",
"self",
".",
"forwa... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/ast.py#L325-L330 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/fcn-xs/data.py | python | FileIter.provide_label | (self) | return [(k, tuple([1] + list(v.shape[1:]))) for k, v in self.label] | The name and shape of label provided by this iterator | The name and shape of label provided by this iterator | [
"The",
"name",
"and",
"shape",
"of",
"label",
"provided",
"by",
"this",
"iterator"
] | def provide_label(self):
"""The name and shape of label provided by this iterator"""
return [(k, tuple([1] + list(v.shape[1:]))) for k, v in self.label] | [
"def",
"provide_label",
"(",
"self",
")",
":",
"return",
"[",
"(",
"k",
",",
"tuple",
"(",
"[",
"1",
"]",
"+",
"list",
"(",
"v",
".",
"shape",
"[",
"1",
":",
"]",
")",
")",
")",
"for",
"k",
",",
"v",
"in",
"self",
".",
"label",
"]"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/fcn-xs/data.py#L113-L115 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/mavlink_px4.py | python | MAVLink.set_mode_encode | (self, target_system, base_mode, custom_mode) | return msg | Set the system mode, as defined by enum MAV_MODE. There is no target
component id as the mode is by definition for the
overall aircraft, not only for one component.
target_system : The system setting the mode (uint8_t)
base_mode ... | Set the system mode, as defined by enum MAV_MODE. There is no target
component id as the mode is by definition for the
overall aircraft, not only for one component. | [
"Set",
"the",
"system",
"mode",
"as",
"defined",
"by",
"enum",
"MAV_MODE",
".",
"There",
"is",
"no",
"target",
"component",
"id",
"as",
"the",
"mode",
"is",
"by",
"definition",
"for",
"the",
"overall",
"aircraft",
"not",
"only",
"for",
"one",
"component",
... | def set_mode_encode(self, target_system, base_mode, custom_mode):
'''
Set the system mode, as defined by enum MAV_MODE. There is no target
component id as the mode is by definition for the
overall aircraft, not only for one component.
targ... | [
"def",
"set_mode_encode",
"(",
"self",
",",
"target_system",
",",
"base_mode",
",",
"custom_mode",
")",
":",
"msg",
"=",
"MAVLink_set_mode_message",
"(",
"target_system",
",",
"base_mode",
",",
"custom_mode",
")",
"msg",
".",
"pack",
"(",
"self",
")",
"return"... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_px4.py#L2637-L2650 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/reshape/tile.py | python | _format_labels | (
bins, precision: int, right: bool = True, include_lowest: bool = False, dtype=None
) | return IntervalIndex.from_breaks(breaks, closed=closed) | 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: int, right: bool = True, include_lowest: bool = False, dtype=None
):
"""based on the dtype, return our labels"""
closed = "right" if right else "left"
formatter: Callable[[Any], Timestamp] | Callable[[Any], Timedelta]
if is_datetime64tz_dtype(dtype):
fo... | [
"def",
"_format_labels",
"(",
"bins",
",",
"precision",
":",
"int",
",",
"right",
":",
"bool",
"=",
"True",
",",
"include_lowest",
":",
"bool",
"=",
"False",
",",
"dtype",
"=",
"None",
")",
":",
"closed",
"=",
"\"right\"",
"if",
"right",
"else",
"\"lef... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/reshape/tile.py#L552-L579 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/gestures.py | python | MouseGestures._check_modifiers | (self, event) | return True | Internal: Returns True if all needed modifiers are down
for the given event. | Internal: Returns True if all needed modifiers are down
for the given event. | [
"Internal",
":",
"Returns",
"True",
"if",
"all",
"needed",
"modifiers",
"are",
"down",
"for",
"the",
"given",
"event",
"."
] | def _check_modifiers(self, event):
'''Internal: Returns True if all needed modifiers are down
for the given event.'''
if len(self.modifiers) > 0:
good = True
if wx.WXK_CONTROL in self.modifiers:
good = good and event.ControlDown()
if wx.WXK_SH... | [
"def",
"_check_modifiers",
"(",
"self",
",",
"event",
")",
":",
"if",
"len",
"(",
"self",
".",
"modifiers",
")",
">",
"0",
":",
"good",
"=",
"True",
"if",
"wx",
".",
"WXK_CONTROL",
"in",
"self",
".",
"modifiers",
":",
"good",
"=",
"good",
"and",
"e... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/gestures.py#L117-L129 | |
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | GLGenerator.WriteCommonUtilsHeader | (self, filename) | Writes the gles2 common utility header. | Writes the gles2 common utility header. | [
"Writes",
"the",
"gles2",
"common",
"utility",
"header",
"."
] | def WriteCommonUtilsHeader(self, filename):
"""Writes the gles2 common utility header."""
with CHeaderWriter(filename) as f:
type_infos = sorted(_NAMED_TYPE_INFO.keys())
for type_info in type_infos:
if _NAMED_TYPE_INFO[type_info]['type'] == 'GLenum':
f.write("static std::string Get... | [
"def",
"WriteCommonUtilsHeader",
"(",
"self",
",",
"filename",
")",
":",
"with",
"CHeaderWriter",
"(",
"filename",
")",
"as",
"f",
":",
"type_infos",
"=",
"sorted",
"(",
"_NAMED_TYPE_INFO",
".",
"keys",
"(",
")",
")",
"for",
"type_info",
"in",
"type_infos",
... | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L10863-L10872 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | htmlParseDoc | (cur, encoding) | return xmlDoc(_obj=ret) | parse an HTML in-memory document and build a tree. | parse an HTML in-memory document and build a tree. | [
"parse",
"an",
"HTML",
"in",
"-",
"memory",
"document",
"and",
"build",
"a",
"tree",
"."
] | def htmlParseDoc(cur, encoding):
"""parse an HTML in-memory document and build a tree. """
ret = libxml2mod.htmlParseDoc(cur, encoding)
if ret is None:raise parserError('htmlParseDoc() failed')
return xmlDoc(_obj=ret) | [
"def",
"htmlParseDoc",
"(",
"cur",
",",
"encoding",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"htmlParseDoc",
"(",
"cur",
",",
"encoding",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"parserError",
"(",
"'htmlParseDoc() failed'",
")",
"return",
"xmlDoc",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L816-L820 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlTextReader.LookupNamespace | (self, prefix) | return ret | Resolves a namespace prefix in the scope of the current
element. | Resolves a namespace prefix in the scope of the current
element. | [
"Resolves",
"a",
"namespace",
"prefix",
"in",
"the",
"scope",
"of",
"the",
"current",
"element",
"."
] | def LookupNamespace(self, prefix):
"""Resolves a namespace prefix in the scope of the current
element. """
ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
return ret | [
"def",
"LookupNamespace",
"(",
"self",
",",
"prefix",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlTextReaderLookupNamespace",
"(",
"self",
".",
"_o",
",",
"prefix",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L6682-L6686 | |
illuz/leetcode | 75f5b46edfc37366eab45fc3db0f7c5916f80bcc | solutions/279.Perfect_Squares/MLE_dp_nsqrtn.py | python | Solution.numSquares | (self, n) | return self.helper(n) | :type n: int
:rtype: int | :type n: int
:rtype: int | [
":",
"type",
"n",
":",
"int",
":",
"rtype",
":",
"int"
] | def numSquares(self, n):
"""
:type n: int
:rtype: int
"""
self.result = [0 for _ in xrange(n + 1)]
self.square = [s**2 for s in xrange(1, int(math.sqrt(n))+1)]
return self.helper(n) | [
"def",
"numSquares",
"(",
"self",
",",
"n",
")",
":",
"self",
".",
"result",
"=",
"[",
"0",
"for",
"_",
"in",
"xrange",
"(",
"n",
"+",
"1",
")",
"]",
"self",
".",
"square",
"=",
"[",
"s",
"**",
"2",
"for",
"s",
"in",
"xrange",
"(",
"1",
","... | https://github.com/illuz/leetcode/blob/75f5b46edfc37366eab45fc3db0f7c5916f80bcc/solutions/279.Perfect_Squares/MLE_dp_nsqrtn.py#L18-L26 | |
msitt/blpapi-python | bebcf43668c9e5f5467b1f685f9baebbfc45bc87 | src/blpapi/constant.py | python | ConstantList.getConstantAt | (self, position) | return Constant(res, self.__sessions) | Args:
position (int): Position of the requested constant in the list
Returns:
Constant: Constant at the specified ``position``.
Raises:
IndexOutOfRangeException: If ``position`` is not in the range from
``0`` to ``numConstants() - 1``. | Args:
position (int): Position of the requested constant in the list | [
"Args",
":",
"position",
"(",
"int",
")",
":",
"Position",
"of",
"the",
"requested",
"constant",
"in",
"the",
"list"
] | def getConstantAt(self, position):
"""
Args:
position (int): Position of the requested constant in the list
Returns:
Constant: Constant at the specified ``position``.
Raises:
IndexOutOfRangeException: If ``position`` is not in the range from
... | [
"def",
"getConstantAt",
"(",
"self",
",",
"position",
")",
":",
"res",
"=",
"internals",
".",
"blpapi_ConstantList_getConstantAt",
"(",
"self",
".",
"__handle",
",",
"position",
")",
"if",
"res",
"is",
"None",
":",
"errMessage",
"=",
"\"Index '{0}' out of bounds... | https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/constant.py#L285-L302 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/tix.py | python | CheckList.getmode | (self, entrypath) | return self.tk.call(self._w, 'getmode', entrypath) | Returns the current mode of the entry given by entryPath. | Returns the current mode of the entry given by entryPath. | [
"Returns",
"the",
"current",
"mode",
"of",
"the",
"entry",
"given",
"by",
"entryPath",
"."
] | def getmode(self, entrypath):
'''Returns the current mode of the entry given by entryPath.'''
return self.tk.call(self._w, 'getmode', entrypath) | [
"def",
"getmode",
"(",
"self",
",",
"entrypath",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'getmode'",
",",
"entrypath",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/tix.py#L1573-L1575 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/utils/collect_and_build_with_pgo.py | python | _looks_like_llvm_dir | (directory) | return 'llvm' in include_listing | Arbitrary set of heuristics to determine if `directory` is an llvm dir.
Errs on the side of false-positives. | Arbitrary set of heuristics to determine if `directory` is an llvm dir. | [
"Arbitrary",
"set",
"of",
"heuristics",
"to",
"determine",
"if",
"directory",
"is",
"an",
"llvm",
"dir",
"."
] | def _looks_like_llvm_dir(directory):
"""Arbitrary set of heuristics to determine if `directory` is an llvm dir.
Errs on the side of false-positives."""
contents = set(os.listdir(directory))
expected_contents = [
'CODE_OWNERS.TXT',
'cmake',
'docs',
'include',
'ut... | [
"def",
"_looks_like_llvm_dir",
"(",
"directory",
")",
":",
"contents",
"=",
"set",
"(",
"os",
".",
"listdir",
"(",
"directory",
")",
")",
"expected_contents",
"=",
"[",
"'CODE_OWNERS.TXT'",
",",
"'cmake'",
",",
"'docs'",
",",
"'include'",
",",
"'utils'",
","... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/utils/collect_and_build_with_pgo.py#L412-L434 | |
jeog/TOSDataBridge | 6a5a08ca5cf3883db1f12e9bc89ef374d098df5a | python/tosdb/__init__.py | python | vconnected | () | return _admin_call('connected') | Returns True if there is an active connection to the engine AND TOS platform on host.
vconnected()
returns -> bool
throws TOSDB_VirtualizationError TOSDB_ImplErrorWrapper | Returns True if there is an active connection to the engine AND TOS platform on host. | [
"Returns",
"True",
"if",
"there",
"is",
"an",
"active",
"connection",
"to",
"the",
"engine",
"AND",
"TOS",
"platform",
"on",
"host",
"."
] | def vconnected():
""" Returns True if there is an active connection to the engine AND TOS platform on host.
vconnected()
returns -> bool
throws TOSDB_VirtualizationError TOSDB_ImplErrorWrapper
"""
return _admin_call('connected') | [
"def",
"vconnected",
"(",
")",
":",
"return",
"_admin_call",
"(",
"'connected'",
")"
] | https://github.com/jeog/TOSDataBridge/blob/6a5a08ca5cf3883db1f12e9bc89ef374d098df5a/python/tosdb/__init__.py#L224-L233 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | AboutDialogInfo.SetName | (*args, **kwargs) | return _misc_.AboutDialogInfo_SetName(*args, **kwargs) | SetName(self, String name)
Set the name of the program. If this method is not called, the string
returned by `wx.App.GetAppName` will be shown in the dialog. | SetName(self, String name) | [
"SetName",
"(",
"self",
"String",
"name",
")"
] | def SetName(*args, **kwargs):
"""
SetName(self, String name)
Set the name of the program. If this method is not called, the string
returned by `wx.App.GetAppName` will be shown in the dialog.
"""
return _misc_.AboutDialogInfo_SetName(*args, **kwargs) | [
"def",
"SetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"AboutDialogInfo_SetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L6579-L6586 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/input.py | python | _shapes | (tensor_list_list, shapes, enqueue_many) | return shapes | Calculate and merge the shapes of incoming tensors.
Args:
tensor_list_list: List of tensor lists.
shapes: List of shape tuples corresponding to tensors within the lists.
enqueue_many: Boolean describing whether shapes will be enqueued as
batches or individual entries.
Returns:
A list of shap... | Calculate and merge the shapes of incoming tensors. | [
"Calculate",
"and",
"merge",
"the",
"shapes",
"of",
"incoming",
"tensors",
"."
] | def _shapes(tensor_list_list, shapes, enqueue_many):
"""Calculate and merge the shapes of incoming tensors.
Args:
tensor_list_list: List of tensor lists.
shapes: List of shape tuples corresponding to tensors within the lists.
enqueue_many: Boolean describing whether shapes will be enqueued as
bat... | [
"def",
"_shapes",
"(",
"tensor_list_list",
",",
"shapes",
",",
"enqueue_many",
")",
":",
"if",
"shapes",
"is",
"None",
":",
"len0",
"=",
"len",
"(",
"tensor_list_list",
"[",
"0",
"]",
")",
"for",
"tl",
"in",
"tensor_list_list",
":",
"for",
"i",
"in",
"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/input.py#L449-L477 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/interpolate/fitpack2.py | python | UnivariateSpline.antiderivative | (self, n=1) | return UnivariateSpline._from_tck(tck, self.ext) | Construct a new spline representing the antiderivative of this spline.
Parameters
----------
n : int, optional
Order of antiderivative to evaluate. Default: 1
Returns
-------
spline : UnivariateSpline
Spline of order k2=k+n representing the antid... | Construct a new spline representing the antiderivative of this spline. | [
"Construct",
"a",
"new",
"spline",
"representing",
"the",
"antiderivative",
"of",
"this",
"spline",
"."
] | def antiderivative(self, n=1):
"""
Construct a new spline representing the antiderivative of this spline.
Parameters
----------
n : int, optional
Order of antiderivative to evaluate. Default: 1
Returns
-------
spline : UnivariateSpline
... | [
"def",
"antiderivative",
"(",
"self",
",",
"n",
"=",
"1",
")",
":",
"tck",
"=",
"fitpack",
".",
"splantider",
"(",
"self",
".",
"_eval_args",
",",
"n",
")",
"return",
"UnivariateSpline",
".",
"_from_tck",
"(",
"tck",
",",
"self",
".",
"ext",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/fitpack2.py#L461-L513 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/mox.py | python | MockAnything._Verify | (self) | Verify that all of the expected calls have been made.
Raises:
ExpectedMethodCallsError: if there are still more method calls in the
expected queue. | Verify that all of the expected calls have been made. | [
"Verify",
"that",
"all",
"of",
"the",
"expected",
"calls",
"have",
"been",
"made",
"."
] | def _Verify(self):
"""Verify that all of the expected calls have been made.
Raises:
ExpectedMethodCallsError: if there are still more method calls in the
expected queue.
"""
# If the list of expected calls is not empty, raise an exception
if self._expected_calls_queue:
# The la... | [
"def",
"_Verify",
"(",
"self",
")",
":",
"# If the list of expected calls is not empty, raise an exception",
"if",
"self",
".",
"_expected_calls_queue",
":",
"# The last MultipleTimesGroup is not popped from the queue.",
"if",
"(",
"len",
"(",
"self",
".",
"_expected_calls_queu... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/mox.py#L331-L347 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/vs_toolchain.py | python | DetectVisualStudioPath | () | Return path to the installed Visual Studio. | Return path to the installed Visual Studio. | [
"Return",
"path",
"to",
"the",
"installed",
"Visual",
"Studio",
"."
] | def DetectVisualStudioPath():
"""Return path to the installed Visual Studio.
"""
# Note that this code is used from
# build/toolchain/win/setup_toolchain.py as well.
version_as_year = GetVisualStudioVersion()
# The VC++ >=2017 install location needs to be located using COM instead of
# the registry. For... | [
"def",
"DetectVisualStudioPath",
"(",
")",
":",
"# Note that this code is used from",
"# build/toolchain/win/setup_toolchain.py as well.",
"version_as_year",
"=",
"GetVisualStudioVersion",
"(",
")",
"# The VC++ >=2017 install location needs to be located using COM instead of",
"# the regis... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/vs_toolchain.py#L191-L223 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/importlib/_bootstrap.py | python | FrozenImporter.get_source | (cls, fullname) | return None | Return None as frozen modules do not have source code. | Return None as frozen modules do not have source code. | [
"Return",
"None",
"as",
"frozen",
"modules",
"do",
"not",
"have",
"source",
"code",
"."
] | def get_source(cls, fullname):
"""Return None as frozen modules do not have source code."""
return None | [
"def",
"get_source",
"(",
"cls",
",",
"fullname",
")",
":",
"return",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_bootstrap.py#L857-L859 | |
waymo-research/waymo-open-dataset | 5de359f3429e1496761790770868296140161b66 | waymo_open_dataset/latency/examples/tensorflow/from_saved_model/wod_latency_submission/model.py | python | Model.__init__ | (self) | Create an empty object with no underlying model yet. | Create an empty object with no underlying model yet. | [
"Create",
"an",
"empty",
"object",
"with",
"no",
"underlying",
"model",
"yet",
"."
] | def __init__(self):
"""Create an empty object with no underlying model yet."""
self._model = None
self._model_fn = None | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_model",
"=",
"None",
"self",
".",
"_model_fn",
"=",
"None"
] | https://github.com/waymo-research/waymo-open-dataset/blob/5de359f3429e1496761790770868296140161b66/waymo_open_dataset/latency/examples/tensorflow/from_saved_model/wod_latency_submission/model.py#L25-L28 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/functools.py | python | update_wrapper | (wrapper,
wrapped,
assigned = WRAPPER_ASSIGNMENTS,
updated = WRAPPER_UPDATES) | return wrapper | Update a wrapper function to look like the wrapped function
wrapper is the function to be updated
wrapped is the original function
assigned is a tuple naming the attributes assigned directly
from the wrapped function to the wrapper function (defaults to
functools.WRAPPER_ASSIGNMENTS)... | Update a wrapper function to look like the wrapped function | [
"Update",
"a",
"wrapper",
"function",
"to",
"look",
"like",
"the",
"wrapped",
"function"
] | def update_wrapper(wrapper,
wrapped,
assigned = WRAPPER_ASSIGNMENTS,
updated = WRAPPER_UPDATES):
"""Update a wrapper function to look like the wrapped function
wrapper is the function to be updated
wrapped is the original function
assign... | [
"def",
"update_wrapper",
"(",
"wrapper",
",",
"wrapped",
",",
"assigned",
"=",
"WRAPPER_ASSIGNMENTS",
",",
"updated",
"=",
"WRAPPER_UPDATES",
")",
":",
"for",
"attr",
"in",
"assigned",
":",
"setattr",
"(",
"wrapper",
",",
"attr",
",",
"getattr",
"(",
"wrappe... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/functools.py#L17-L37 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/errors.py | python | FailedPreconditionError.__init__ | (self, node_def, op, message) | Creates a `FailedPreconditionError`. | Creates a `FailedPreconditionError`. | [
"Creates",
"a",
"FailedPreconditionError",
"."
] | def __init__(self, node_def, op, message):
"""Creates a `FailedPreconditionError`."""
super(FailedPreconditionError, self).__init__(node_def, op, message,
FAILED_PRECONDITION) | [
"def",
"__init__",
"(",
"self",
",",
"node_def",
",",
"op",
",",
"message",
")",
":",
"super",
"(",
"FailedPreconditionError",
",",
"self",
")",
".",
"__init__",
"(",
"node_def",
",",
"op",
",",
"message",
",",
"FAILED_PRECONDITION",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/errors.py#L310-L313 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py | python | ParseResults.asList | ( self ) | return [res.asList() if isinstance(res,ParseResults) else res for res in self.__toklist] | Returns the parse results as a nested list of matching tokens, all converted to strings.
Example::
patt = OneOrMore(Word(alphas))
result = patt.parseString("sldkj lsdkj sldkj")
# even though the result prints in string-like form, it is actually a pyparsing ParseResults
... | Returns the parse results as a nested list of matching tokens, all converted to strings. | [
"Returns",
"the",
"parse",
"results",
"as",
"a",
"nested",
"list",
"of",
"matching",
"tokens",
"all",
"converted",
"to",
"strings",
"."
] | def asList( self ):
"""
Returns the parse results as a nested list of matching tokens, all converted to strings.
Example::
patt = OneOrMore(Word(alphas))
result = patt.parseString("sldkj lsdkj sldkj")
# even though the result prints in string-like form, it is... | [
"def",
"asList",
"(",
"self",
")",
":",
"return",
"[",
"res",
".",
"asList",
"(",
")",
"if",
"isinstance",
"(",
"res",
",",
"ParseResults",
")",
"else",
"res",
"for",
"res",
"in",
"self",
".",
"__toklist",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py#L705-L719 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/PRESUBMIT.py | python | _CheckChangeLintsClean | (input_api, output_api) | return input_api.canned_checks.CheckChangeLintsClean(
input_api, output_api, sources) | Makes sure that the chrome/ code is cpplint clean. | Makes sure that the chrome/ code is cpplint clean. | [
"Makes",
"sure",
"that",
"the",
"chrome",
"/",
"code",
"is",
"cpplint",
"clean",
"."
] | def _CheckChangeLintsClean(input_api, output_api):
"""Makes sure that the chrome/ code is cpplint clean."""
black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDE
sources = lambda x: input_api.FilterSourceFile(
x, white_list=INCLUDE_CPP_FILES_ONLY, black_list=black_list)
return input_api.canned_checks.CheckCha... | [
"def",
"_CheckChangeLintsClean",
"(",
"input_api",
",",
"output_api",
")",
":",
"black_list",
"=",
"input_api",
".",
"DEFAULT_BLACK_LIST",
"+",
"EXCLUDE",
"sources",
"=",
"lambda",
"x",
":",
"input_api",
".",
"FilterSourceFile",
"(",
"x",
",",
"white_list",
"=",... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/PRESUBMIT.py#L49-L55 | |
sfzhang15/RefineDet | 52b6fe23dc1a160fe710b7734576dca509bf4fae | scripts/cpp_lint.py | python | _ClassifyInclude | (fileinfo, include, is_system) | return _OTHER_HEADER | Figures out what kind of header 'include' is.
Args:
fileinfo: The current file cpplint is running over. A FileInfo instance.
include: The path to a #included file.
is_system: True if the #include used <> rather than "".
Returns:
One of the _XXX_HEADER constants.
For example:
>>> _ClassifyIn... | Figures out what kind of header 'include' is. | [
"Figures",
"out",
"what",
"kind",
"of",
"header",
"include",
"is",
"."
] | def _ClassifyInclude(fileinfo, include, is_system):
"""Figures out what kind of header 'include' is.
Args:
fileinfo: The current file cpplint is running over. A FileInfo instance.
include: The path to a #included file.
is_system: True if the #include used <> rather than "".
Returns:
One of the _... | [
"def",
"_ClassifyInclude",
"(",
"fileinfo",
",",
"include",
",",
"is_system",
")",
":",
"# This is a list of all standard c++ header files, except",
"# those already checked for above.",
"is_cpp_h",
"=",
"include",
"in",
"_CPP_HEADERS",
"if",
"is_system",
":",
"if",
"is_cpp... | https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/scripts/cpp_lint.py#L3624-L3680 | |
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/build/build_request.py | python | __x_product | (property_sets) | return __x_product_aux (property_sets, x_product_seen)[0] | Return the cross-product of all elements of property_sets, less any
that would contain conflicting values for single-valued features. | Return the cross-product of all elements of property_sets, less any
that would contain conflicting values for single-valued features. | [
"Return",
"the",
"cross",
"-",
"product",
"of",
"all",
"elements",
"of",
"property_sets",
"less",
"any",
"that",
"would",
"contain",
"conflicting",
"values",
"for",
"single",
"-",
"valued",
"features",
"."
] | def __x_product (property_sets):
""" Return the cross-product of all elements of property_sets, less any
that would contain conflicting values for single-valued features.
"""
x_product_seen = set()
return __x_product_aux (property_sets, x_product_seen)[0] | [
"def",
"__x_product",
"(",
"property_sets",
")",
":",
"x_product_seen",
"=",
"set",
"(",
")",
"return",
"__x_product_aux",
"(",
"property_sets",
",",
"x_product_seen",
")",
"[",
"0",
"]"
] | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/build_request.py#L29-L34 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | IntProperty_DoValidation | (*args, **kwargs) | return _propgrid.IntProperty_DoValidation(*args, **kwargs) | IntProperty_DoValidation(PGProperty property, wxLongLong_t value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool | IntProperty_DoValidation(PGProperty property, wxLongLong_t value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool | [
"IntProperty_DoValidation",
"(",
"PGProperty",
"property",
"wxLongLong_t",
"value",
"PGValidationInfo",
"pValidationInfo",
"int",
"mode",
"=",
"PG_PROPERTY_VALIDATION_ERROR_MESSAGE",
")",
"-",
">",
"bool"
] | def IntProperty_DoValidation(*args, **kwargs):
"""
IntProperty_DoValidation(PGProperty property, wxLongLong_t value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool
"""
return _propgrid.IntProperty_DoValidation(*args, **kwargs) | [
"def",
"IntProperty_DoValidation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"IntProperty_DoValidation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2927-L2932 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/control/utils.py | python | Promise.__nonzero__ | (self) | return self.available() | Returns True if the provider has responded with a value or error. | Returns True if the provider has responded with a value or error. | [
"Returns",
"True",
"if",
"the",
"provider",
"has",
"responded",
"with",
"a",
"value",
"or",
"error",
"."
] | def __nonzero__(self):
"""Returns True if the provider has responded with a value or error."""
return self.available() | [
"def",
"__nonzero__",
"(",
"self",
")",
":",
"return",
"self",
".",
"available",
"(",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/utils.py#L236-L238 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/combotreebox.py | python | IterableTreeCtrl.GetFirstItem | (self) | Returns the very first item in the tree. This is the root item
unless the root item is hidden. In that case the first child of
the root item is returned, if any. If the tree is empty, an
invalid tree item is returned.
:return: :class:`TreeItemId`
:rtype: :class:`TreeItem... | Returns the very first item in the tree. This is the root item
unless the root item is hidden. In that case the first child of
the root item is returned, if any. If the tree is empty, an
invalid tree item is returned.
:return: :class:`TreeItemId`
:rtype: :class:`TreeItem... | [
"Returns",
"the",
"very",
"first",
"item",
"in",
"the",
"tree",
".",
"This",
"is",
"the",
"root",
"item",
"unless",
"the",
"root",
"item",
"is",
"hidden",
".",
"In",
"that",
"case",
"the",
"first",
"child",
"of",
"the",
"root",
"item",
"is",
"returned"... | def GetFirstItem(self):
"""
Returns the very first item in the tree. This is the root item
unless the root item is hidden. In that case the first child of
the root item is returned, if any. If the tree is empty, an
invalid tree item is returned.
:return: :class:`... | [
"def",
"GetFirstItem",
"(",
"self",
")",
":",
"rootItem",
"=",
"self",
".",
"GetRootItem",
"(",
")",
"if",
"rootItem",
"and",
"(",
"self",
".",
"GetWindowStyle",
"(",
")",
"&",
"wx",
".",
"TR_HIDE_ROOT",
")",
":",
"firstChild",
",",
"cookie",
"=",
"sel... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/combotreebox.py#L108-L124 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/coprocessing.py | python | CoProcessor.SetInitialOutputOptions | (self, timeStepToStartOutputAt, forceOutputAtFirstCall) | Set the frequencies at which the pipeline needs to be updated.
Typically, this is called by the subclass once it has determined what
timesteps co-processing will be needed to be done.
frequencies is a map, with key->string name of for the simulation
input, and value is a list... | Set the frequencies at which the pipeline needs to be updated.
Typically, this is called by the subclass once it has determined what
timesteps co-processing will be needed to be done.
frequencies is a map, with key->string name of for the simulation
input, and value is a list... | [
"Set",
"the",
"frequencies",
"at",
"which",
"the",
"pipeline",
"needs",
"to",
"be",
"updated",
".",
"Typically",
"this",
"is",
"called",
"by",
"the",
"subclass",
"once",
"it",
"has",
"determined",
"what",
"timesteps",
"co",
"-",
"processing",
"will",
"be",
... | def SetInitialOutputOptions(self, timeStepToStartOutputAt, forceOutputAtFirstCall):
"""Set the frequencies at which the pipeline needs to be updated.
Typically, this is called by the subclass once it has determined what
timesteps co-processing will be needed to be done.
frequenc... | [
"def",
"SetInitialOutputOptions",
"(",
"self",
",",
"timeStepToStartOutputAt",
",",
"forceOutputAtFirstCall",
")",
":",
"self",
".",
"__TimeStepToStartOutputAt",
"=",
"timeStepToStartOutputAt",
"self",
".",
"__ForceOutputAtFirstCall",
"=",
"forceOutputAtFirstCall"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/coprocessing.py#L99-L108 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/gtk.py | python | inputhook | (context) | When the eventloop of prompt-toolkit is idle, call this inputhook.
This will run the GTK main loop until the file descriptor
`context.fileno()` becomes ready.
:param context: An `InputHookContext` instance. | When the eventloop of prompt-toolkit is idle, call this inputhook. | [
"When",
"the",
"eventloop",
"of",
"prompt",
"-",
"toolkit",
"is",
"idle",
"call",
"this",
"inputhook",
"."
] | def inputhook(context):
"""
When the eventloop of prompt-toolkit is idle, call this inputhook.
This will run the GTK main loop until the file descriptor
`context.fileno()` becomes ready.
:param context: An `InputHookContext` instance.
"""
def _main_quit(*a, **kw):
gtk.main_quit()
... | [
"def",
"inputhook",
"(",
"context",
")",
":",
"def",
"_main_quit",
"(",
"*",
"a",
",",
"*",
"*",
"kw",
")",
":",
"gtk",
".",
"main_quit",
"(",
")",
"return",
"False",
"gobject",
".",
"io_add_watch",
"(",
"context",
".",
"fileno",
"(",
")",
",",
"go... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/gtk.py#L44-L58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.