nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGProperty.SetPyClientData | (*args, **kwargs) | return _propgrid.PGProperty_SetPyClientData(*args, **kwargs) | SetPyClientData(self, PyObject clientData)
Associate the given client data. | SetPyClientData(self, PyObject clientData) | [
"SetPyClientData",
"(",
"self",
"PyObject",
"clientData",
")"
] | def SetPyClientData(*args, **kwargs):
"""
SetPyClientData(self, PyObject clientData)
Associate the given client data.
"""
return _propgrid.PGProperty_SetPyClientData(*args, **kwargs) | [
"def",
"SetPyClientData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_SetPyClientData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L866-L872 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/ma/core.py | python | put | (a, indices, values, mode='raise') | Set storage-indexed locations to corresponding values.
This function is equivalent to `MaskedArray.put`, see that method
for details.
See Also
--------
MaskedArray.put | Set storage-indexed locations to corresponding values. | [
"Set",
"storage",
"-",
"indexed",
"locations",
"to",
"corresponding",
"values",
"."
] | def put(a, indices, values, mode='raise'):
"""
Set storage-indexed locations to corresponding values.
This function is equivalent to `MaskedArray.put`, see that method
for details.
See Also
--------
MaskedArray.put
"""
# We can't use 'frommethod', the order of arguments is differe... | [
"def",
"put",
"(",
"a",
",",
"indices",
",",
"values",
",",
"mode",
"=",
"'raise'",
")",
":",
"# We can't use 'frommethod', the order of arguments is different",
"try",
":",
"return",
"a",
".",
"put",
"(",
"indices",
",",
"values",
",",
"mode",
"=",
"mode",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L6292-L6308 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/transmute/chainsolve.py | python | Transmuter.phi | (self, flux) | Ensures that the flux is correctly formatted. | Ensures that the flux is correctly formatted. | [
"Ensures",
"that",
"the",
"flux",
"is",
"correctly",
"formatted",
"."
] | def phi(self, flux):
"""Ensures that the flux is correctly formatted."""
flux = np.asarray(flux)
if flux.ndim == 0:
_ = np.empty(175, float)
_.fill(flux / 175.0)
flux = _
elif flux.ndim == 1 and flux.shape[0] != 175:
raise ValueError("Group... | [
"def",
"phi",
"(",
"self",
",",
"flux",
")",
":",
"flux",
"=",
"np",
".",
"asarray",
"(",
"flux",
")",
"if",
"flux",
".",
"ndim",
"==",
"0",
":",
"_",
"=",
"np",
".",
"empty",
"(",
"175",
",",
"float",
")",
"_",
".",
"fill",
"(",
"flux",
"/... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/transmute/chainsolve.py#L82-L98 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/config.py | python | ConfigContext.join_aws_directory_path | (self, relative_path) | return os.path.join(self.aws_directory_path, relative_path) | Returns an absolute path when given a path relative to the {root}\{game}\AWS directory. | Returns an absolute path when given a path relative to the {root}\{game}\AWS directory. | [
"Returns",
"an",
"absolute",
"path",
"when",
"given",
"a",
"path",
"relative",
"to",
"the",
"{",
"root",
"}",
"\\",
"{",
"game",
"}",
"\\",
"AWS",
"directory",
"."
] | def join_aws_directory_path(self, relative_path):
"""Returns an absolute path when given a path relative to the {root}\{game}\AWS directory."""
return os.path.join(self.aws_directory_path, relative_path) | [
"def",
"join_aws_directory_path",
"(",
"self",
",",
"relative_path",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"aws_directory_path",
",",
"relative_path",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/config.py#L441-L443 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenu.GetBorderXWidth | (self) | return self._borderXWidth | Returns the menu border x-width, in pixels. | Returns the menu border x-width, in pixels. | [
"Returns",
"the",
"menu",
"border",
"x",
"-",
"width",
"in",
"pixels",
"."
] | def GetBorderXWidth(self):
""" Returns the menu border x-width, in pixels. """
return self._borderXWidth | [
"def",
"GetBorderXWidth",
"(",
"self",
")",
":",
"return",
"self",
".",
"_borderXWidth"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L5677-L5680 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | cmake/tribits/python_utils/GeneralScriptSupport.py | python | createIndexHtmlBrowserFile | (baseDir, fileDirList) | return htmlFile | Creates an HTML browser file as a returned string. | Creates an HTML browser file as a returned string. | [
"Creates",
"an",
"HTML",
"browser",
"file",
"as",
"a",
"returned",
"string",
"."
] | def createIndexHtmlBrowserFile(baseDir, fileDirList):
"""Creates an HTML browser file as a returned string."""
htmlFile = "" \
+ "<html>\n" \
+ "<head>\n" \
+ "<title>"+baseDir+"</title>\n" \
+ "</head>\n" \
+ "<body>\n" \
+ "<b>"+baseDir+"</b>\n" \
+ createIndexHtmlBrowserList(baseDir, ... | [
"def",
"createIndexHtmlBrowserFile",
"(",
"baseDir",
",",
"fileDirList",
")",
":",
"htmlFile",
"=",
"\"\"",
"+",
"\"<html>\\n\"",
"+",
"\"<head>\\n\"",
"+",
"\"<title>\"",
"+",
"baseDir",
"+",
"\"</title>\\n\"",
"+",
"\"</head>\\n\"",
"+",
"\"<body>\\n\"",
"+",
"\... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/cmake/tribits/python_utils/GeneralScriptSupport.py#L876-L888 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/shortcuts.py | python | prompt_async | (message='', **kwargs) | return prompt(message, **kwargs) | Similar to :func:`.prompt`, but return an asyncio coroutine instead. | Similar to :func:`.prompt`, but return an asyncio coroutine instead. | [
"Similar",
"to",
":",
"func",
":",
".",
"prompt",
"but",
"return",
"an",
"asyncio",
"coroutine",
"instead",
"."
] | def prompt_async(message='', **kwargs):
"""
Similar to :func:`.prompt`, but return an asyncio coroutine instead.
"""
kwargs['return_asyncio_coroutine'] = True
return prompt(message, **kwargs) | [
"def",
"prompt_async",
"(",
"message",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'return_asyncio_coroutine'",
"]",
"=",
"True",
"return",
"prompt",
"(",
"message",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/shortcuts.py#L634-L639 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py | python | ParserElement.setDefaultWhitespaceChars | ( chars ) | r"""
Overrides the default whitespace chars
Example::
# default whitespace chars are space, <TAB> and newline
OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl']
# change to just treat newline as significant
... | r"""
Overrides the default whitespace chars | [
"r",
"Overrides",
"the",
"default",
"whitespace",
"chars"
] | def setDefaultWhitespaceChars( chars ):
r"""
Overrides the default whitespace chars
Example::
# default whitespace chars are space, <TAB> and newline
OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl']
# cha... | [
"def",
"setDefaultWhitespaceChars",
"(",
"chars",
")",
":",
"ParserElement",
".",
"DEFAULT_WHITE_CHARS",
"=",
"chars"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py#L1109-L1121 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/pycodegen.py | python | CodeGenerator.initClass | (self) | This method is called once for each class | This method is called once for each class | [
"This",
"method",
"is",
"called",
"once",
"for",
"each",
"class"
] | def initClass(self):
"""This method is called once for each class""" | [
"def",
"initClass",
"(",
"self",
")",
":"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/compiler/pycodegen.py#L225-L226 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py | python | UnicodeDammit._detectEncoding | (self, xml_data, isHTML=False) | return xml_data, xml_encoding, sniffed_xml_encoding | Given a document, tries to detect its XML encoding. | Given a document, tries to detect its XML encoding. | [
"Given",
"a",
"document",
"tries",
"to",
"detect",
"its",
"XML",
"encoding",
"."
] | def _detectEncoding(self, xml_data, isHTML=False):
"""Given a document, tries to detect its XML encoding."""
xml_encoding = sniffed_xml_encoding = None
try:
if xml_data[:4] == '\x4c\x6f\xa7\x94':
# EBCDIC
xml_data = self._ebcdic_to_ascii(xml_data)
... | [
"def",
"_detectEncoding",
"(",
"self",
",",
"xml_data",
",",
"isHTML",
"=",
"False",
")",
":",
"xml_encoding",
"=",
"sniffed_xml_encoding",
"=",
"None",
"try",
":",
"if",
"xml_data",
"[",
":",
"4",
"]",
"==",
"'\\x4c\\x6f\\xa7\\x94'",
":",
"# EBCDIC",
"xml_d... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L1864-L1929 | |
brave/brave-core | ceaa3de4735789d355b6fa80c21d4709e2c1d0e8 | script/lib/transifex.py | python | get_original_grd | (src_root, grd_file_path) | Obtains the Chromium GRD file for a specified Brave GRD file. | Obtains the Chromium GRD file for a specified Brave GRD file. | [
"Obtains",
"the",
"Chromium",
"GRD",
"file",
"for",
"a",
"specified",
"Brave",
"GRD",
"file",
"."
] | def get_original_grd(src_root, grd_file_path):
"""Obtains the Chromium GRD file for a specified Brave GRD file."""
# pylint: disable=fixme
# TODO: consider passing this mapping into the script from l10nUtil.js
grd_file_name = os.path.basename(grd_file_path)
if grd_file_name == 'components_brave_stri... | [
"def",
"get_original_grd",
"(",
"src_root",
",",
"grd_file_path",
")",
":",
"# pylint: disable=fixme",
"# TODO: consider passing this mapping into the script from l10nUtil.js",
"grd_file_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"grd_file_path",
")",
"if",
"grd_f... | https://github.com/brave/brave-core/blob/ceaa3de4735789d355b6fa80c21d4709e2c1d0e8/script/lib/transifex.py#L559-L574 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py | python | GraphRewriter.remove_unneeded_nodes | (self, input_graph) | return output_graph | Prunes out nodes that aren't needed for inference.
There are nodes like Identity and CheckNumerics that are only useful
during training, and can be removed in graphs that will be used for
nothing but inference. Here we identify and remove them, returning an
equivalent graph.
Args:
input_grap... | Prunes out nodes that aren't needed for inference. | [
"Prunes",
"out",
"nodes",
"that",
"aren",
"t",
"needed",
"for",
"inference",
"."
] | def remove_unneeded_nodes(self, input_graph):
"""Prunes out nodes that aren't needed for inference.
There are nodes like Identity and CheckNumerics that are only useful
during training, and can be removed in graphs that will be used for
nothing but inference. Here we identify and remove them, returning... | [
"def",
"remove_unneeded_nodes",
"(",
"self",
",",
"input_graph",
")",
":",
"types_to_remove",
"=",
"{",
"\"CheckNumerics\"",
":",
"True",
"}",
"input_nodes",
"=",
"input_graph",
".",
"node",
"names_to_remove",
"=",
"{",
"}",
"for",
"node",
"in",
"input_nodes",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py#L966-L1036 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/controls/DevWalker.py | python | DevWalker.handleAvatarControls | (self, task) | return Task.cont | Check on the arrow keys and update the avatar. | Check on the arrow keys and update the avatar. | [
"Check",
"on",
"the",
"arrow",
"keys",
"and",
"update",
"the",
"avatar",
"."
] | def handleAvatarControls(self, task):
"""
Check on the arrow keys and update the avatar.
"""
# get the button states:
forward = inputState.isSet("forward")
reverse = inputState.isSet("reverse")
turnLeft = inputState.isSet("turnLeft")
turnRight = inputState... | [
"def",
"handleAvatarControls",
"(",
"self",
",",
"task",
")",
":",
"# get the button states:",
"forward",
"=",
"inputState",
".",
"isSet",
"(",
"\"forward\"",
")",
"reverse",
"=",
"inputState",
".",
"isSet",
"(",
"\"reverse\"",
")",
"turnLeft",
"=",
"inputState"... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/controls/DevWalker.py#L104-L164 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/HuggingFace/NNDF/models.py | python | TorchModelFile.load_model | (self) | return load(self.fpath) | Loads the model from disk if isn't already loaded.
Does not attempt to load if given model is already loaded and instead returns original instance.
Use as_torch_model() instead to always guarantee a new instance and location on disk.
Args:
None
Returns:
torch.Mo... | Loads the model from disk if isn't already loaded.
Does not attempt to load if given model is already loaded and instead returns original instance.
Use as_torch_model() instead to always guarantee a new instance and location on disk. | [
"Loads",
"the",
"model",
"from",
"disk",
"if",
"isn",
"t",
"already",
"loaded",
".",
"Does",
"not",
"attempt",
"to",
"load",
"if",
"given",
"model",
"is",
"already",
"loaded",
"and",
"instead",
"returns",
"original",
"instance",
".",
"Use",
"as_torch_model",... | def load_model(self) -> Module:
"""
Loads the model from disk if isn't already loaded.
Does not attempt to load if given model is already loaded and instead returns original instance.
Use as_torch_model() instead to always guarantee a new instance and location on disk.
Args:
... | [
"def",
"load_model",
"(",
"self",
")",
"->",
"Module",
":",
"if",
"self",
".",
"is_loaded",
":",
"return",
"self",
".",
"model",
"return",
"load",
"(",
"self",
".",
"fpath",
")"
] | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/HuggingFace/NNDF/models.py#L255-L270 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/boto_translation.py | python | BotoTranslation._TranslateBotoKeyTimestamp | (self, key) | Parses the timestamp from the boto key into an datetime object.
This avoids a dependency on dateutil.
Args:
key: Boto key to get timestamp from.
Returns:
datetime object if string is parsed successfully, None otherwise. | Parses the timestamp from the boto key into an datetime object. | [
"Parses",
"the",
"timestamp",
"from",
"the",
"boto",
"key",
"into",
"an",
"datetime",
"object",
"."
] | def _TranslateBotoKeyTimestamp(self, key):
"""Parses the timestamp from the boto key into an datetime object.
This avoids a dependency on dateutil.
Args:
key: Boto key to get timestamp from.
Returns:
datetime object if string is parsed successfully, None otherwise.
"""
if key.last... | [
"def",
"_TranslateBotoKeyTimestamp",
"(",
"self",
",",
"key",
")",
":",
"if",
"key",
".",
"last_modified",
":",
"if",
"'.'",
"in",
"key",
".",
"last_modified",
":",
"key_us_timestamp",
"=",
"key",
".",
"last_modified",
".",
"rstrip",
"(",
"'Z'",
")",
"+",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/boto_translation.py#L1351-L1377 | ||
9miao/CrossApp | 1f5375e061bf69841eb19728598f5ae3f508d620 | tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | CursorKind.is_statement | (self) | return conf.lib.clang_isStatement(self) | Test if this is a statement kind. | Test if this is a statement kind. | [
"Test",
"if",
"this",
"is",
"a",
"statement",
"kind",
"."
] | def is_statement(self):
"""Test if this is a statement kind."""
return conf.lib.clang_isStatement(self) | [
"def",
"is_statement",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isStatement",
"(",
"self",
")"
] | https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L531-L533 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.SetSelAlpha | (*args, **kwargs) | return _stc.StyledTextCtrl_SetSelAlpha(*args, **kwargs) | SetSelAlpha(self, int alpha)
Set the alpha of the selection. | SetSelAlpha(self, int alpha) | [
"SetSelAlpha",
"(",
"self",
"int",
"alpha",
")"
] | def SetSelAlpha(*args, **kwargs):
"""
SetSelAlpha(self, int alpha)
Set the alpha of the selection.
"""
return _stc.StyledTextCtrl_SetSelAlpha(*args, **kwargs) | [
"def",
"SetSelAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetSelAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2747-L2753 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/msi.py | python | create_feature_dict | (files) | return dict | X_MSI_FEATURE and doc FileTag's can be used to collect files in a
hierarchy. This function collects the files into this hierarchy. | X_MSI_FEATURE and doc FileTag's can be used to collect files in a
hierarchy. This function collects the files into this hierarchy. | [
"X_MSI_FEATURE",
"and",
"doc",
"FileTag",
"s",
"can",
"be",
"used",
"to",
"collect",
"files",
"in",
"a",
"hierarchy",
".",
"This",
"function",
"collects",
"the",
"files",
"into",
"this",
"hierarchy",
"."
] | def create_feature_dict(files):
""" X_MSI_FEATURE and doc FileTag's can be used to collect files in a
hierarchy. This function collects the files into this hierarchy.
"""
dict = {}
def add_to_dict( feature, file ):
if not SCons.Util.is_List( feature ):
feature = [ feature ]
... | [
"def",
"create_feature_dict",
"(",
"files",
")",
":",
"dict",
"=",
"{",
"}",
"def",
"add_to_dict",
"(",
"feature",
",",
"file",
")",
":",
"if",
"not",
"SCons",
".",
"Util",
".",
"is_List",
"(",
"feature",
")",
":",
"feature",
"=",
"[",
"feature",
"]"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/msi.py#L127-L151 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/quote.py | python | Quote.__repr__ | (self) | return self.to_str() | For `print` and `pprint` | For `print` and `pprint` | [
"For",
"print",
"and",
"pprint"
] | def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str() | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"self",
".",
"to_str",
"(",
")"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/quote.py#L234-L236 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/extras/xcode6.py | python | xcode.unique_buildfile | (self, buildfile) | return build_files[buildfile] | Returns a unique buildfile, possibly an existing one.
Use this after you've constructed a PBXBuildFile to make sure there is
only one PBXBuildFile for the same file in the same project. | Returns a unique buildfile, possibly an existing one.
Use this after you've constructed a PBXBuildFile to make sure there is
only one PBXBuildFile for the same file in the same project. | [
"Returns",
"a",
"unique",
"buildfile",
"possibly",
"an",
"existing",
"one",
".",
"Use",
"this",
"after",
"you",
"ve",
"constructed",
"a",
"PBXBuildFile",
"to",
"make",
"sure",
"there",
"is",
"only",
"one",
"PBXBuildFile",
"for",
"the",
"same",
"file",
"in",
... | def unique_buildfile(self, buildfile):
"""
Returns a unique buildfile, possibly an existing one.
Use this after you've constructed a PBXBuildFile to make sure there is
only one PBXBuildFile for the same file in the same project.
"""
try:
build_files = self.build_files
except AttributeError:
build_fi... | [
"def",
"unique_buildfile",
"(",
"self",
",",
"buildfile",
")",
":",
"try",
":",
"build_files",
"=",
"self",
".",
"build_files",
"except",
"AttributeError",
":",
"build_files",
"=",
"self",
".",
"build_files",
"=",
"{",
"}",
"if",
"buildfile",
"not",
"in",
... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/extras/xcode6.py#L641-L654 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/filter_design.py | python | lp2lp | (b, a, wo=1.0) | return normalize(b, a) | Transform a lowpass filter prototype to a different frequency.
Return an analog low-pass filter with cutoff frequency `wo`
from an analog low-pass filter prototype with unity cutoff frequency, in
transfer function ('ba') representation.
See Also
--------
lp2hp, lp2bp, lp2bs, bilinear
lp2lp... | Transform a lowpass filter prototype to a different frequency. | [
"Transform",
"a",
"lowpass",
"filter",
"prototype",
"to",
"a",
"different",
"frequency",
"."
] | def lp2lp(b, a, wo=1.0):
"""
Transform a lowpass filter prototype to a different frequency.
Return an analog low-pass filter with cutoff frequency `wo`
from an analog low-pass filter prototype with unity cutoff frequency, in
transfer function ('ba') representation.
See Also
--------
lp... | [
"def",
"lp2lp",
"(",
"b",
",",
"a",
",",
"wo",
"=",
"1.0",
")",
":",
"a",
",",
"b",
"=",
"map",
"(",
"atleast_1d",
",",
"(",
"a",
",",
"b",
")",
")",
"try",
":",
"wo",
"=",
"float",
"(",
"wo",
")",
"except",
"TypeError",
":",
"wo",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/filter_design.py#L1632-L1659 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/elemwise.py | python | floor | (x) | return _elwise(x, mode=Elemwise.Mode.FLOOR) | r"""Element-wise `floor`. | r"""Element-wise `floor`. | [
"r",
"Element",
"-",
"wise",
"floor",
"."
] | def floor(x):
r"""Element-wise `floor`."""
return _elwise(x, mode=Elemwise.Mode.FLOOR) | [
"def",
"floor",
"(",
"x",
")",
":",
"return",
"_elwise",
"(",
"x",
",",
"mode",
"=",
"Elemwise",
".",
"Mode",
".",
"FLOOR",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/elemwise.py#L297-L299 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | python | _CreateVersion | (name, path, sdk_based=False) | return versions[str(name)] | Sets up MSVS project generation.
Setup is based off the GYP_MSVS_VERSION environment variable or whatever is
autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
passed in that doesn't match a value in versions python will throw a error. | Sets up MSVS project generation. | [
"Sets",
"up",
"MSVS",
"project",
"generation",
"."
] | def _CreateVersion(name, path, sdk_based=False):
"""Sets up MSVS project generation.
Setup is based off the GYP_MSVS_VERSION environment variable or whatever is
autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is
passed in that doesn't match a value in versions python will throw a err... | [
"def",
"_CreateVersion",
"(",
"name",
",",
"path",
",",
"sdk_based",
"=",
"False",
")",
":",
"if",
"path",
":",
"path",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"path",
")",
"versions",
"=",
"{",
"'2015'",
":",
"VisualStudioVersion",
"(",
"'2015'"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py#L219-L323 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/ndimage/measurements.py | python | maximum | (input, labels=None, index=None) | return _select(input, labels, index, find_max=True)[0] | Calculate the maximum of the values of an array over labeled regions.
Parameters
----------
input : array_like
Array_like of values. For each region specified by `labels`, the
maximal values of `input` over the region is computed.
labels : array_like, optional
An array of intege... | Calculate the maximum of the values of an array over labeled regions. | [
"Calculate",
"the",
"maximum",
"of",
"the",
"values",
"of",
"an",
"array",
"over",
"labeled",
"regions",
"."
] | def maximum(input, labels=None, index=None):
"""
Calculate the maximum of the values of an array over labeled regions.
Parameters
----------
input : array_like
Array_like of values. For each region specified by `labels`, the
maximal values of `input` over the region is computed.
... | [
"def",
"maximum",
"(",
"input",
",",
"labels",
"=",
"None",
",",
"index",
"=",
"None",
")",
":",
"return",
"_select",
"(",
"input",
",",
"labels",
",",
"index",
",",
"find_max",
"=",
"True",
")",
"[",
"0",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/ndimage/measurements.py#L918-L994 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/analyzer_cli.py | python | DebugAnalyzer.list_outputs | (self, args, screen_info=None) | return output | Command handler for inputs.
Show inputs to a given node.
Args:
args: Command-line arguments, excluding the command prefix, as a list of
str.
screen_info: Optional dict input containing screen information such as
cols.
Returns:
Output text lines as a RichTextLines object. | Command handler for inputs. | [
"Command",
"handler",
"for",
"inputs",
"."
] | def list_outputs(self, args, screen_info=None):
"""Command handler for inputs.
Show inputs to a given node.
Args:
args: Command-line arguments, excluding the command prefix, as a list of
str.
screen_info: Optional dict input containing screen information such as
cols.
Retu... | [
"def",
"list_outputs",
"(",
"self",
",",
"args",
",",
"screen_info",
"=",
"None",
")",
":",
"# Screen info not currently used by this handler. Include this line to",
"# mute pylint.",
"_",
"=",
"screen_info",
"# TODO(cais): Use screen info to format the output lines more prettily,"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/analyzer_cli.py#L1052-L1086 | |
Ifsttar/I-Simpa | 2283385f4cac769a92e265edabb9c79cb6c42d03 | currentRelease/SystemScript/graphy/common.py | python | BaseChart.__init__ | (self) | Construct a BaseChart object. | Construct a BaseChart object. | [
"Construct",
"a",
"BaseChart",
"object",
"."
] | def __init__(self):
"""Construct a BaseChart object."""
self.data = []
self._axes = {}
for code in self._POSITION_CODES:
self._axes[code] = [Axis()]
self._legend_labels = [] # AutoLegend fills this out
self._show_legend = False # AutoLegend fills this out
# Aliases for default form... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"data",
"=",
"[",
"]",
"self",
".",
"_axes",
"=",
"{",
"}",
"for",
"code",
"in",
"self",
".",
"_POSITION_CODES",
":",
"self",
".",
"_axes",
"[",
"code",
"]",
"=",
"[",
"Axis",
"(",
")",
"]"... | https://github.com/Ifsttar/I-Simpa/blob/2283385f4cac769a92e265edabb9c79cb6c42d03/currentRelease/SystemScript/graphy/common.py#L234-L251 | ||
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/program_members/uniform_block.py | python | UniformBlock.binding | (self) | return self.mglo.binding | int: The binding of the uniform block. | int: The binding of the uniform block. | [
"int",
":",
"The",
"binding",
"of",
"the",
"uniform",
"block",
"."
] | def binding(self) -> int:
'''
int: The binding of the uniform block.
'''
return self.mglo.binding | [
"def",
"binding",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"mglo",
".",
"binding"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/program_members/uniform_block.py#L26-L31 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Misc.option_readfile | (self, fileName, priority = None) | Read file FILENAME into the option database.
An optional second parameter gives the numeric
priority. | Read file FILENAME into the option database. | [
"Read",
"file",
"FILENAME",
"into",
"the",
"option",
"database",
"."
] | def option_readfile(self, fileName, priority = None):
"""Read file FILENAME into the option database.
An optional second parameter gives the numeric
priority."""
self.tk.call('option', 'readfile', fileName, priority) | [
"def",
"option_readfile",
"(",
"self",
",",
"fileName",
",",
"priority",
"=",
"None",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"'option'",
",",
"'readfile'",
",",
"fileName",
",",
"priority",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L872-L877 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/examples/customization/bin-utils/binutils.py | python | utob | (debugger, command_line, result, dict) | Convert the unsigned integer to print its binary representation.
args[0] (mandatory) is the unsigned integer to be converted
args[1] (optional) is the bit width of the binary representation
args[2] (optional) if specified, turns on verbose printing | Convert the unsigned integer to print its binary representation.
args[0] (mandatory) is the unsigned integer to be converted
args[1] (optional) is the bit width of the binary representation
args[2] (optional) if specified, turns on verbose printing | [
"Convert",
"the",
"unsigned",
"integer",
"to",
"print",
"its",
"binary",
"representation",
".",
"args",
"[",
"0",
"]",
"(",
"mandatory",
")",
"is",
"the",
"unsigned",
"integer",
"to",
"be",
"converted",
"args",
"[",
"1",
"]",
"(",
"optional",
")",
"is",
... | def utob(debugger, command_line, result, dict):
"""Convert the unsigned integer to print its binary representation.
args[0] (mandatory) is the unsigned integer to be converted
args[1] (optional) is the bit width of the binary representation
args[2] (optional) if specified, turns on verbose printing"""
... | [
"def",
"utob",
"(",
"debugger",
",",
"command_line",
",",
"result",
",",
"dict",
")",
":",
"args",
"=",
"command_line",
".",
"split",
"(",
")",
"try",
":",
"n",
"=",
"int",
"(",
"args",
"[",
"0",
"]",
",",
"0",
")",
"width",
"=",
"None",
"if",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/examples/customization/bin-utils/binutils.py#L65-L94 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/checkpoint_utils.py | python | _set_variable_or_list_initializer | (variable_or_list, ckpt_file,
tensor_name) | Overrides initialization op of given variable or list of variables.
Calls `_set_checkpoint_initializer` for each variable in the given list of
variables.
Args:
variable_or_list: `tf.Variable` object or a list of `tf.Variable` objects.
ckpt_file: string, full path of the checkpoint.
tensor_name: Name... | Overrides initialization op of given variable or list of variables. | [
"Overrides",
"initialization",
"op",
"of",
"given",
"variable",
"or",
"list",
"of",
"variables",
"."
] | def _set_variable_or_list_initializer(variable_or_list, ckpt_file,
tensor_name):
"""Overrides initialization op of given variable or list of variables.
Calls `_set_checkpoint_initializer` for each variable in the given list of
variables.
Args:
variable_or_list: `tf.Va... | [
"def",
"_set_variable_or_list_initializer",
"(",
"variable_or_list",
",",
"ckpt_file",
",",
"tensor_name",
")",
":",
"if",
"isinstance",
"(",
"variable_or_list",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"# A set of slices.",
"slice_name",
"=",
"None",
"for",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/checkpoint_utils.py#L289-L317 | ||
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | library/python/workbench/os_utils.py | python | FileUtils.remove_directory_recursive | (self, path) | Function Type : Success | Function Type : Success | [
"Function",
"Type",
":",
"Success"
] | def remove_directory_recursive(self, path):
"""
Function Type : Success
"""
try:
shutil.rmtree(path)
except (IOError, OSError) as err:
if err.errno == errno.EACCES:
raise PermissionDeniedError("Could not remove directory %s" % path)
... | [
"def",
"remove_directory_recursive",
"(",
"self",
",",
"path",
")",
":",
"try",
":",
"shutil",
".",
"rmtree",
"(",
"path",
")",
"except",
"(",
"IOError",
",",
"OSError",
")",
"as",
"err",
":",
"if",
"err",
".",
"errno",
"==",
"errno",
".",
"EACCES",
... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/library/python/workbench/os_utils.py#L167-L176 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/rnn.py | python | _infer_state_dtype | (explicit_dtype, state) | Infer the dtype of an RNN state.
Args:
explicit_dtype: explicitly declared dtype or None.
state: RNN's hidden state. Must be a Tensor or a nested iterable containing
Tensors.
Returns:
dtype: inferred dtype of hidden state.
Raises:
ValueError: if `state` has heterogeneous dtypes or is empt... | Infer the dtype of an RNN state. | [
"Infer",
"the",
"dtype",
"of",
"an",
"RNN",
"state",
"."
] | def _infer_state_dtype(explicit_dtype, state):
"""Infer the dtype of an RNN state.
Args:
explicit_dtype: explicitly declared dtype or None.
state: RNN's hidden state. Must be a Tensor or a nested iterable containing
Tensors.
Returns:
dtype: inferred dtype of hidden state.
Raises:
ValueE... | [
"def",
"_infer_state_dtype",
"(",
"explicit_dtype",
",",
"state",
")",
":",
"if",
"explicit_dtype",
"is",
"not",
"None",
":",
"return",
"explicit_dtype",
"elif",
"nest",
".",
"is_sequence",
"(",
"state",
")",
":",
"inferred_dtypes",
"=",
"[",
"element",
".",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/rnn.py#L43-L70 | ||
bryanyzhu/Hidden-Two-Stream | f7f684adbdacb6df6b1cf196c3a476cd23484a0f | scripts/cpp_lint.py | python | CheckCaffeDataLayerSetUp | (filename, clean_lines, linenum, error) | Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
li... | Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
li... | [
"Except",
"the",
"base",
"classes",
"Caffe",
"DataLayer",
"should",
"define",
"DataLayerSetUp",
"instead",
"of",
"LayerSetUp",
".",
"The",
"base",
"DataLayers",
"define",
"common",
"SetUp",
"steps",
"the",
"subclasses",
"should",
"not",
"override",
"them",
".",
... | def CheckCaffeDataLayerSetUp(filename, clean_lines, linenum, error):
"""Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current f... | [
"def",
"CheckCaffeDataLayerSetUp",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"ix",
"=",
"line",
".",
"find",
"(",
"'DataLayer<Dtype>::LayerSetUp'",
")",
"if",
... | https://github.com/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/scripts/cpp_lint.py#L1595-L1631 | ||
cksystemsgroup/scal | fa2208a97a77d65f4e90f85fef3404c27c1f2ac2 | tools/cpplint.py | python | CheckOperatorSpacing | (filename, clean_lines, linenum, error) | Checks for horizontal spacing around operators.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for horizontal spacing around operators. | [
"Checks",
"for",
"horizontal",
"spacing",
"around",
"operators",
"."
] | def CheckOperatorSpacing(filename, clean_lines, linenum, error):
"""Checks for horizontal spacing around operators.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any... | [
"def",
"CheckOperatorSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Don't try to do spacing checks for operator methods. Do this by",
"# replacing the troublesome cha... | https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L3127-L3239 | ||
tensor-compiler/taco | d0654a84137169883973c40a951dfdb89883fd9c | python_bindings/pytaco/pytensor/taco_tensor.py | python | evaluate | (expr, *operands, out_format=None, dtype=None) | return tensor.from_tensor_base(tensor_base) | Evaluates the index notation expression on the input operands.
An output tensor may be optionally specified. In this case, the tensor should be given the expected output shape,
format and dtype since the out_format and dtype fields will be ignored if an output tensor is seen.
Parameters
------------
... | Evaluates the index notation expression on the input operands. | [
"Evaluates",
"the",
"index",
"notation",
"expression",
"on",
"the",
"input",
"operands",
"."
] | def evaluate(expr, *operands, out_format=None, dtype=None):
"""
Evaluates the index notation expression on the input operands.
An output tensor may be optionally specified. In this case, the tensor should be given the expected output shape,
format and dtype since the out_format and dtype fields will be... | [
"def",
"evaluate",
"(",
"expr",
",",
"*",
"operands",
",",
"out_format",
"=",
"None",
",",
"dtype",
"=",
"None",
")",
":",
"args",
"=",
"[",
"as_tensor",
"(",
"t",
",",
"False",
")",
"for",
"t",
"in",
"operands",
"]",
"if",
"len",
"(",
"args",
")... | https://github.com/tensor-compiler/taco/blob/d0654a84137169883973c40a951dfdb89883fd9c/python_bindings/pytaco/pytensor/taco_tensor.py#L2824-L2949 | |
ArduPilot/ardupilot | 6e684b3496122b8158ac412b609d00004b7ac306 | Tools/Vicon/vicon_mavlink.py | python | connect_to_vicon | (ip) | connect to a vicon with given ip or hostname | connect to a vicon with given ip or hostname | [
"connect",
"to",
"a",
"vicon",
"with",
"given",
"ip",
"or",
"hostname"
] | def connect_to_vicon(ip):
'''connect to a vicon with given ip or hostname'''
global vicon
print("Opening connection to %s" % ip)
vicon.connect(ip)
print("Configuring vicon")
vicon.set_stream_mode(pyvicon.StreamMode.ClientPull)
vicon.enable_marker_data()
vicon.enable_segment_data()
vi... | [
"def",
"connect_to_vicon",
"(",
"ip",
")",
":",
"global",
"vicon",
"print",
"(",
"\"Opening connection to %s\"",
"%",
"ip",
")",
"vicon",
".",
"connect",
"(",
"ip",
")",
"print",
"(",
"\"Configuring vicon\"",
")",
"vicon",
".",
"set_stream_mode",
"(",
"pyvicon... | https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/Tools/Vicon/vicon_mavlink.py#L55-L73 | ||
rampageX/firmware-mod-kit | c94cd6aeee50d92ec5280a6dba6d74828fd3606b | src/binwalk-2.1.1/src/binwalk/core/module.py | python | Module.load | (self) | return None | Invoked at module load time.
May be overridden by the module sub-class. | Invoked at module load time.
May be overridden by the module sub-class. | [
"Invoked",
"at",
"module",
"load",
"time",
".",
"May",
"be",
"overridden",
"by",
"the",
"module",
"sub",
"-",
"class",
"."
] | def load(self):
'''
Invoked at module load time.
May be overridden by the module sub-class.
'''
return None | [
"def",
"load",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/rampageX/firmware-mod-kit/blob/c94cd6aeee50d92ec5280a6dba6d74828fd3606b/src/binwalk-2.1.1/src/binwalk/core/module.py#L258-L263 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/tracer/cuEdge.py | python | cuEdgeTracer.prepare | (self, conf: dict, debug: bool) | return optForFtrace | Handle Input Options | Handle Input Options | [
"Handle",
"Input",
"Options"
] | def prepare(self, conf: dict, debug: bool):
"Handle Input Options"
"Handle Output Options"
optForFtrace = {
"collector": {
"ftrace": {
"cuEdge": {
"name": "cuEdge",
"type": "kprobe",
... | [
"def",
"prepare",
"(",
"self",
",",
"conf",
":",
"dict",
",",
"debug",
":",
"bool",
")",
":",
"\"Handle Output Options\"",
"optForFtrace",
"=",
"{",
"\"collector\"",
":",
"{",
"\"ftrace\"",
":",
"{",
"\"cuEdge\"",
":",
"{",
"\"name\"",
":",
"\"cuEdge\"",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/tracer/cuEdge.py#L28-L50 | |
IfcOpenShell/IfcOpenShell | 2c2954b11a9c9d581bef03240836d4567e69ad0b | src/ifcpatch/ifcpatch/__init__.py | python | extract_docs | (
submodule_name: str,
cls_name: str,
method_name: str="__init__",
boilerplate_args : typing.Iterable[str]=None) | Extract class docstrings and method arguments
:param submodule_name: Submodule from which to extract the class
:param cls_name: Class from which to extract the docstring and method arguments
:param method_name: Class Method name from which to extract arguments
:param boilerplate_args: String iterable c... | Extract class docstrings and method arguments | [
"Extract",
"class",
"docstrings",
"and",
"method",
"arguments"
] | def extract_docs(
submodule_name: str,
cls_name: str,
method_name: str="__init__",
boilerplate_args : typing.Iterable[str]=None):
"""Extract class docstrings and method arguments
:param submodule_name: Submodule from which to extract the class
:param cls_name: Class from which to extract th... | [
"def",
"extract_docs",
"(",
"submodule_name",
":",
"str",
",",
"cls_name",
":",
"str",
",",
"method_name",
":",
"str",
"=",
"\"__init__\"",
",",
"boilerplate_args",
":",
"typing",
".",
"Iterable",
"[",
"str",
"]",
"=",
"None",
")",
":",
"spec",
"=",
"imp... | https://github.com/IfcOpenShell/IfcOpenShell/blob/2c2954b11a9c9d581bef03240836d4567e69ad0b/src/ifcpatch/ifcpatch/__init__.py#L60-L83 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/resample.py | python | PeriodIndexResampler._upsample | (self, method, limit=None, fill_value=None) | return self._wrap_result(new_obj) | Parameters
----------
method : {'backfill', 'bfill', 'pad', 'ffill'}
Method for upsampling.
limit : int, default None
Maximum size gap to fill when reindexing.
fill_value : scalar, default None
Value to use for missing values.
See Also
... | Parameters
----------
method : {'backfill', 'bfill', 'pad', 'ffill'}
Method for upsampling.
limit : int, default None
Maximum size gap to fill when reindexing.
fill_value : scalar, default None
Value to use for missing values. | [
"Parameters",
"----------",
"method",
":",
"{",
"backfill",
"bfill",
"pad",
"ffill",
"}",
"Method",
"for",
"upsampling",
".",
"limit",
":",
"int",
"default",
"None",
"Maximum",
"size",
"gap",
"to",
"fill",
"when",
"reindexing",
".",
"fill_value",
":",
"scala... | def _upsample(self, method, limit=None, fill_value=None):
"""
Parameters
----------
method : {'backfill', 'bfill', 'pad', 'ffill'}
Method for upsampling.
limit : int, default None
Maximum size gap to fill when reindexing.
fill_value : scalar, defau... | [
"def",
"_upsample",
"(",
"self",
",",
"method",
",",
"limit",
"=",
"None",
",",
"fill_value",
"=",
"None",
")",
":",
"# we may need to actually resample as if we are timestamps",
"if",
"self",
".",
"kind",
"==",
"\"timestamp\"",
":",
"return",
"super",
"(",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/resample.py#L1301-L1336 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/skia/tools/copyright/main.py | python | WriteStringToFile | (string, filepath) | Writes this string out to filepath, replacing the file if it already
exists. | Writes this string out to filepath, replacing the file if it already
exists. | [
"Writes",
"this",
"string",
"out",
"to",
"filepath",
"replacing",
"the",
"file",
"if",
"it",
"already",
"exists",
"."
] | def WriteStringToFile(string, filepath):
"""Writes this string out to filepath, replacing the file if it already
exists.
"""
with open(filepath, 'w') as file_handle:
file_handle.write(string) | [
"def",
"WriteStringToFile",
"(",
"string",
",",
"filepath",
")",
":",
"with",
"open",
"(",
"filepath",
",",
"'w'",
")",
"as",
"file_handle",
":",
"file_handle",
".",
"write",
"(",
"string",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/skia/tools/copyright/main.py#L92-L97 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/py_transforms.py | python | RandomHorizontalFlip.__call__ | (self, img) | return util.random_horizontal_flip(img, self.prob) | Call method.
Args:
img (PIL Image): Image to be horizontally flipped.
Returns:
PIL Image, randomly horizontally flipped image. | Call method. | [
"Call",
"method",
"."
] | def __call__(self, img):
"""
Call method.
Args:
img (PIL Image): Image to be horizontally flipped.
Returns:
PIL Image, randomly horizontally flipped image.
"""
return util.random_horizontal_flip(img, self.prob) | [
"def",
"__call__",
"(",
"self",
",",
"img",
")",
":",
"return",
"util",
".",
"random_horizontal_flip",
"(",
"img",
",",
"self",
".",
"prob",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/py_transforms.py#L495-L505 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/utils/struct/dataclass.py | python | dataclass | (clz=None, *, init_doc=MISSING, cache_hash=False, _frozen=True) | return data_clz | Decorator creating a NetKet-flavour dataclass.
This behaves as a flax dataclass, that is a Frozen python dataclass, with a twist!
See their documentation for standard behaviour.
The new functionalities added by NetKet are:
- it is possible to define a method `__pre_init__(*args, **kwargs) ->
Tu... | Decorator creating a NetKet-flavour dataclass.
This behaves as a flax dataclass, that is a Frozen python dataclass, with a twist!
See their documentation for standard behaviour. | [
"Decorator",
"creating",
"a",
"NetKet",
"-",
"flavour",
"dataclass",
".",
"This",
"behaves",
"as",
"a",
"flax",
"dataclass",
"that",
"is",
"a",
"Frozen",
"python",
"dataclass",
"with",
"a",
"twist!",
"See",
"their",
"documentation",
"for",
"standard",
"behavio... | def dataclass(clz=None, *, init_doc=MISSING, cache_hash=False, _frozen=True):
"""
Decorator creating a NetKet-flavour dataclass.
This behaves as a flax dataclass, that is a Frozen python dataclass, with a twist!
See their documentation for standard behaviour.
The new functionalities added by NetKet... | [
"def",
"dataclass",
"(",
"clz",
"=",
"None",
",",
"*",
",",
"init_doc",
"=",
"MISSING",
",",
"cache_hash",
"=",
"False",
",",
"_frozen",
"=",
"True",
")",
":",
"if",
"clz",
"is",
"None",
":",
"return",
"partial",
"(",
"dataclass",
",",
"init_doc",
"=... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/utils/struct/dataclass.py#L358-L494 | |
paperManu/splash | 0cc65377fa8c1225e1a1b8b3cfa35b4fd3a71467 | tools/package_ubuntu.py | python | debuild | () | return subprocess.call("debuild -S -sa", shell=True) | Build the Debian source package
:return: Return the exit code of the command | Build the Debian source package | [
"Build",
"the",
"Debian",
"source",
"package"
] | def debuild() -> int:
"""
Build the Debian source package
:return: Return the exit code of the command
"""
return subprocess.call("debuild -S -sa", shell=True) | [
"def",
"debuild",
"(",
")",
"->",
"int",
":",
"return",
"subprocess",
".",
"call",
"(",
"\"debuild -S -sa\"",
",",
"shell",
"=",
"True",
")"
] | https://github.com/paperManu/splash/blob/0cc65377fa8c1225e1a1b8b3cfa35b4fd3a71467/tools/package_ubuntu.py#L46-L52 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ftplib.py | python | FTP.retrlines | (self, cmd, callback = None) | return self.voidresp() | Retrieve data in line mode. A new port is created for you.
Args:
cmd: A RETR, LIST, NLST, or MLSD command.
callback: An optional single parameter callable that is called
for each line with the trailing CRLF stripped.
[default: print_line()]
... | Retrieve data in line mode. A new port is created for you. | [
"Retrieve",
"data",
"in",
"line",
"mode",
".",
"A",
"new",
"port",
"is",
"created",
"for",
"you",
"."
] | def retrlines(self, cmd, callback = None):
"""Retrieve data in line mode. A new port is created for you.
Args:
cmd: A RETR, LIST, NLST, or MLSD command.
callback: An optional single parameter callable that is called
for each line with the trailing CRLF stripped.... | [
"def",
"retrlines",
"(",
"self",
",",
"cmd",
",",
"callback",
"=",
"None",
")",
":",
"if",
"callback",
"is",
"None",
":",
"callback",
"=",
"print_line",
"resp",
"=",
"self",
".",
"sendcmd",
"(",
"'TYPE A'",
")",
"conn",
"=",
"self",
".",
"transfercmd",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ftplib.py#L418-L446 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillView.py | python | DrillView.show_directory_manager | (self) | Open the Mantid user directories manager. | Open the Mantid user directories manager. | [
"Open",
"the",
"Mantid",
"user",
"directories",
"manager",
"."
] | def show_directory_manager(self):
"""
Open the Mantid user directories manager.
"""
manageuserdirectories.ManageUserDirectories(self).exec_() | [
"def",
"show_directory_manager",
"(",
"self",
")",
":",
"manageuserdirectories",
".",
"ManageUserDirectories",
"(",
"self",
")",
".",
"exec_",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillView.py#L429-L433 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/tracer/xapm.py | python | xapmTracer.prepare | (self, option: dict, debug: bool) | return option | Handle Input Options | Handle Input Options | [
"Handle",
"Input",
"Options"
] | def prepare(self, option: dict, debug: bool):
"Handle Input Options"
xapmOption = option.get('tracer', {}).get('xapm', {})
self.interval = xapmOption.get("APM_interval", 0.01)
self.apm = APM()
"Handle Output Options"
return option | [
"def",
"prepare",
"(",
"self",
",",
"option",
":",
"dict",
",",
"debug",
":",
"bool",
")",
":",
"xapmOption",
"=",
"option",
".",
"get",
"(",
"'tracer'",
",",
"{",
"}",
")",
".",
"get",
"(",
"'xapm'",
",",
"{",
"}",
")",
"self",
".",
"interval",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/tracer/xapm.py#L123-L130 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/collections/__init__.py | python | OrderedDict.values | (self) | return _OrderedDictValuesView(self) | D.values() -> an object providing a view on D's values | D.values() -> an object providing a view on D's values | [
"D",
".",
"values",
"()",
"-",
">",
"an",
"object",
"providing",
"a",
"view",
"on",
"D",
"s",
"values"
] | def values(self):
"D.values() -> an object providing a view on D's values"
return _OrderedDictValuesView(self) | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"_OrderedDictValuesView",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/collections/__init__.py#L234-L236 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/utils.py | python | generate_lorem_ipsum | (n=5, html=True, min=20, max=100) | return Markup(u'\n'.join(u'<p>%s</p>' % escape(x) for x in result)) | Generate some lorem ipsum for the template. | Generate some lorem ipsum for the template. | [
"Generate",
"some",
"lorem",
"ipsum",
"for",
"the",
"template",
"."
] | def generate_lorem_ipsum(n=5, html=True, min=20, max=100):
"""Generate some lorem ipsum for the template."""
from jinja2.constants import LOREM_IPSUM_WORDS
from random import choice, randrange
words = LOREM_IPSUM_WORDS.split()
result = []
for _ in range(n):
next_capitalized = True
... | [
"def",
"generate_lorem_ipsum",
"(",
"n",
"=",
"5",
",",
"html",
"=",
"True",
",",
"min",
"=",
"20",
",",
"max",
"=",
"100",
")",
":",
"from",
"jinja2",
".",
"constants",
"import",
"LOREM_IPSUM_WORDS",
"from",
"random",
"import",
"choice",
",",
"randrange... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/utils.py#L237-L283 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Scripting.py | python | Dist.execute | (self) | See :py:func:`waflib.Context.Context.execute` | See :py:func:`waflib.Context.Context.execute` | [
"See",
":",
"py",
":",
"func",
":",
"waflib",
".",
"Context",
".",
"Context",
".",
"execute"
] | def execute(self):
"""
See :py:func:`waflib.Context.Context.execute`
"""
self.recurse([os.path.dirname(Context.g_module.root_path)])
self.archive() | [
"def",
"execute",
"(",
"self",
")",
":",
"self",
".",
"recurse",
"(",
"[",
"os",
".",
"path",
".",
"dirname",
"(",
"Context",
".",
"g_module",
".",
"root_path",
")",
"]",
")",
"self",
".",
"archive",
"(",
")"
] | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Scripting.py#L343-L348 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/math_grad.py | python | _AngleGrad | (op, grad) | Returns -grad / (Im(x) + iRe(x)) | Returns -grad / (Im(x) + iRe(x)) | [
"Returns",
"-",
"grad",
"/",
"(",
"Im",
"(",
"x",
")",
"+",
"iRe",
"(",
"x",
"))"
] | def _AngleGrad(op, grad):
"""Returns -grad / (Im(x) + iRe(x))"""
x = op.inputs[0]
with ops.control_dependencies([grad]):
re = math_ops.real(x)
im = math_ops.imag(x)
z = math_ops.reciprocal(math_ops.complex(im, re))
zero = constant_op.constant(0, dtype=grad.dtype)
complex_grad = math_ops.comple... | [
"def",
"_AngleGrad",
"(",
"op",
",",
"grad",
")",
":",
"x",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"with",
"ops",
".",
"control_dependencies",
"(",
"[",
"grad",
"]",
")",
":",
"re",
"=",
"math_ops",
".",
"real",
"(",
"x",
")",
"im",
"=",
"mat... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_grad.py#L1082-L1091 | ||
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/mox.py | python | Mox.CreateMock | (self, class_to_mock) | return new_mock | Create a new mock object.
Args:
# class_to_mock: the class to be mocked
class_to_mock: class
Returns:
MockObject that can be used as the class_to_mock would be. | Create a new mock object. | [
"Create",
"a",
"new",
"mock",
"object",
"."
] | def CreateMock(self, class_to_mock):
"""Create a new mock object.
Args:
# class_to_mock: the class to be mocked
class_to_mock: class
Returns:
MockObject that can be used as the class_to_mock would be.
"""
new_mock = MockObject(class_to_mock)
self._mock_objects.append(new_moc... | [
"def",
"CreateMock",
"(",
"self",
",",
"class_to_mock",
")",
":",
"new_mock",
"=",
"MockObject",
"(",
"class_to_mock",
")",
"self",
".",
"_mock_objects",
".",
"append",
"(",
"new_mock",
")",
"return",
"new_mock"
] | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/mox.py#L164-L177 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_publisher.py | python | HeaderlessTopicDiagnostic.clear_window | (self) | Clears the frequency statistics. | Clears the frequency statistics. | [
"Clears",
"the",
"frequency",
"statistics",
"."
] | def clear_window(self):
"""Clears the frequency statistics."""
self.freq.clear() | [
"def",
"clear_window",
"(",
"self",
")",
":",
"self",
".",
"freq",
".",
"clear",
"(",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_publisher.py#L76-L78 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py | python | MemoizedZipManifests.load | (self, path) | return self[path].manifest | Load a manifest at path or return a suitable manifest already loaded. | Load a manifest at path or return a suitable manifest already loaded. | [
"Load",
"a",
"manifest",
"at",
"path",
"or",
"return",
"a",
"suitable",
"manifest",
"already",
"loaded",
"."
] | def load(self, path):
"""
Load a manifest at path or return a suitable manifest already loaded.
"""
path = os.path.normpath(path)
mtime = os.stat(path).st_mtime
if path not in self or self[path].mtime != mtime:
manifest = self.build(path)
self[pat... | [
"def",
"load",
"(",
"self",
",",
"path",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"path",
")",
"mtime",
"=",
"os",
".",
"stat",
"(",
"path",
")",
".",
"st_mtime",
"if",
"path",
"not",
"in",
"self",
"or",
"self",
"[",
"pat... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L1762-L1773 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html2.py | python | WebView.GoForward | (*args, **kwargs) | return _html2.WebView_GoForward(*args, **kwargs) | GoForward(self) | GoForward(self) | [
"GoForward",
"(",
"self",
")"
] | def GoForward(*args, **kwargs):
"""GoForward(self)"""
return _html2.WebView_GoForward(*args, **kwargs) | [
"def",
"GoForward",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebView_GoForward",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html2.py#L258-L260 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewTreeStore.__init__ | (self, *args, **kwargs) | __init__(self) -> DataViewTreeStore | __init__(self) -> DataViewTreeStore | [
"__init__",
"(",
"self",
")",
"-",
">",
"DataViewTreeStore"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> DataViewTreeStore"""
_dataview.DataViewTreeStore_swiginit(self,_dataview.new_DataViewTreeStore(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_dataview",
".",
"DataViewTreeStore_swiginit",
"(",
"self",
",",
"_dataview",
".",
"new_DataViewTreeStore",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L2355-L2357 | ||
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | python/omnisci/thrift/OmniSci.py | python | Iface.set_table_epochs | (self, session, db_id, table_epochs) | Parameters:
- session
- db_id
- table_epochs | Parameters:
- session
- db_id
- table_epochs | [
"Parameters",
":",
"-",
"session",
"-",
"db_id",
"-",
"table_epochs"
] | def set_table_epochs(self, session, db_id, table_epochs):
"""
Parameters:
- session
- db_id
- table_epochs
"""
pass | [
"def",
"set_table_epochs",
"(",
"self",
",",
"session",
",",
"db_id",
",",
"table_epochs",
")",
":",
"pass"
] | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/thrift/OmniSci.py#L311-L319 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/topicobj.py | python | Topic.getListeners | (self) | return py2and3.keys(self.__listeners) | Get a copy of list of listeners subscribed to this topic. Safe to iterate over while listeners
get un/subscribed from this topics (such as while sending a message). | Get a copy of list of listeners subscribed to this topic. Safe to iterate over while listeners
get un/subscribed from this topics (such as while sending a message). | [
"Get",
"a",
"copy",
"of",
"list",
"of",
"listeners",
"subscribed",
"to",
"this",
"topic",
".",
"Safe",
"to",
"iterate",
"over",
"while",
"listeners",
"get",
"un",
"/",
"subscribed",
"from",
"this",
"topics",
"(",
"such",
"as",
"while",
"sending",
"a",
"m... | def getListeners(self):
"""Get a copy of list of listeners subscribed to this topic. Safe to iterate over while listeners
get un/subscribed from this topics (such as while sending a message)."""
return py2and3.keys(self.__listeners) | [
"def",
"getListeners",
"(",
"self",
")",
":",
"return",
"py2and3",
".",
"keys",
"(",
"self",
".",
"__listeners",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topicobj.py#L262-L265 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/cubecolourdialog.py | python | toscale | (x) | return x*RADIUS/255.0 | Normalize a value as a function of the radius.
:param `x`: a float value to normalize | Normalize a value as a function of the radius. | [
"Normalize",
"a",
"value",
"as",
"a",
"function",
"of",
"the",
"radius",
"."
] | def toscale(x):
"""
Normalize a value as a function of the radius.
:param `x`: a float value to normalize
"""
return x*RADIUS/255.0 | [
"def",
"toscale",
"(",
"x",
")",
":",
"return",
"x",
"*",
"RADIUS",
"/",
"255.0"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L1225-L1232 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | execer.py | python | execpy | (filename, glb=None, loc=None) | A function equivalent to the Python 2.x execfile statement. | A function equivalent to the Python 2.x execfile statement. | [
"A",
"function",
"equivalent",
"to",
"the",
"Python",
"2",
".",
"x",
"execfile",
"statement",
"."
] | def execpy(filename, glb=None, loc=None):
"""A function equivalent to the Python 2.x execfile statement."""
glb = {} if glb is None else glb
with io.open(filename, 'r') as f:
src = f.read()
exec(compile(src, filename, "exec"), glb, loc) | [
"def",
"execpy",
"(",
"filename",
",",
"glb",
"=",
"None",
",",
"loc",
"=",
"None",
")",
":",
"glb",
"=",
"{",
"}",
"if",
"glb",
"is",
"None",
"else",
"glb",
"with",
"io",
".",
"open",
"(",
"filename",
",",
"'r'",
")",
"as",
"f",
":",
"src",
... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/execer.py#L16-L21 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlDoc.relaxNGValidateFullElement | (self, ctxt, elem) | return ret | Validate a full subtree when
xmlRelaxNGValidatePushElement() returned 0 and the content
of the node has been expanded. | Validate a full subtree when
xmlRelaxNGValidatePushElement() returned 0 and the content
of the node has been expanded. | [
"Validate",
"a",
"full",
"subtree",
"when",
"xmlRelaxNGValidatePushElement",
"()",
"returned",
"0",
"and",
"the",
"content",
"of",
"the",
"node",
"has",
"been",
"expanded",
"."
] | def relaxNGValidateFullElement(self, ctxt, elem):
"""Validate a full subtree when
xmlRelaxNGValidatePushElement() returned 0 and the content
of the node has been expanded. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
if elem is None: elem__o = None
... | [
"def",
"relaxNGValidateFullElement",
"(",
"self",
",",
"ctxt",
",",
"elem",
")",
":",
"if",
"ctxt",
"is",
"None",
":",
"ctxt__o",
"=",
"None",
"else",
":",
"ctxt__o",
"=",
"ctxt",
".",
"_o",
"if",
"elem",
"is",
"None",
":",
"elem__o",
"=",
"None",
"e... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L3406-L3415 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewRenderer.SetMode | (*args, **kwargs) | return _dataview.DataViewRenderer_SetMode(*args, **kwargs) | SetMode(self, int mode) | SetMode(self, int mode) | [
"SetMode",
"(",
"self",
"int",
"mode",
")"
] | def SetMode(*args, **kwargs):
"""SetMode(self, int mode)"""
return _dataview.DataViewRenderer_SetMode(*args, **kwargs) | [
"def",
"SetMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewRenderer_SetMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1168-L1170 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/random.py | python | Random.vonmisesvariate | (self, mu, kappa) | return theta | Circular data distribution.
mu is the mean angle, expressed in radians between 0 and 2*pi, and
kappa is the concentration parameter, which must be greater than or
equal to zero. If kappa is equal to zero, this distribution reduces
to a uniform random angle over the range 0 to 2*pi. | Circular data distribution. | [
"Circular",
"data",
"distribution",
"."
] | def vonmisesvariate(self, mu, kappa):
"""Circular data distribution.
mu is the mean angle, expressed in radians between 0 and 2*pi, and
kappa is the concentration parameter, which must be greater than or
equal to zero. If kappa is equal to zero, this distribution reduces
to a u... | [
"def",
"vonmisesvariate",
"(",
"self",
",",
"mu",
",",
"kappa",
")",
":",
"# mu: mean angle (in radians between 0 and 2*pi)",
"# kappa: concentration parameter kappa (>= 0)",
"# if kappa = 0 generate uniform random angle",
"# Based upon an algorithm published in: Fisher, N.I.,",
"# \"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/random.py#L434-L480 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Lrn.py | python | Lrn.beta | (self) | return self._internal.get_beta() | Gets the beta. | Gets the beta. | [
"Gets",
"the",
"beta",
"."
] | def beta(self):
"""Gets the beta.
"""
return self._internal.get_beta() | [
"def",
"beta",
"(",
"self",
")",
":",
"return",
"self",
".",
"_internal",
".",
"get_beta",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Lrn.py#L103-L106 | |
ideawu/ssdb-rocks | a3cbb322cafb2f493252829c608e2239df98c9ac | deps/cpy/antlr3/tree.py | python | BaseTree.setParent | (self, t) | BaseTree doesn't track parent pointers. | BaseTree doesn't track parent pointers. | [
"BaseTree",
"doesn",
"t",
"track",
"parent",
"pointers",
"."
] | def setParent(self, t):
"""BaseTree doesn't track parent pointers."""
pass | [
"def",
"setParent",
"(",
"self",
",",
"t",
")",
":",
"pass"
] | https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tree.py#L861-L864 | ||
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/generators.py | python | Generator.source_types | (self) | return self.source_types_ | Returns the list of target type the generator accepts. | Returns the list of target type the generator accepts. | [
"Returns",
"the",
"list",
"of",
"target",
"type",
"the",
"generator",
"accepts",
"."
] | def source_types (self):
""" Returns the list of target type the generator accepts.
"""
return self.source_types_ | [
"def",
"source_types",
"(",
"self",
")",
":",
"return",
"self",
".",
"source_types_"
] | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/generators.py#L273-L276 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/fractions.py | python | Fraction.__trunc__ | (a) | trunc(a) | trunc(a) | [
"trunc",
"(",
"a",
")"
] | def __trunc__(a):
"""trunc(a)"""
if a._numerator < 0:
return -(-a._numerator // a._denominator)
else:
return a._numerator // a._denominator | [
"def",
"__trunc__",
"(",
"a",
")",
":",
"if",
"a",
".",
"_numerator",
"<",
"0",
":",
"return",
"-",
"(",
"-",
"a",
".",
"_numerator",
"//",
"a",
".",
"_denominator",
")",
"else",
":",
"return",
"a",
".",
"_numerator",
"//",
"a",
".",
"_denominator"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/fractions.py#L501-L506 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/callwrapper.py | python | PyCallWrapper._simplified_return_type | (self) | The NPM callconv has already converted simplified optional types.
We can simply use the value type from it. | The NPM callconv has already converted simplified optional types.
We can simply use the value type from it. | [
"The",
"NPM",
"callconv",
"has",
"already",
"converted",
"simplified",
"optional",
"types",
".",
"We",
"can",
"simply",
"use",
"the",
"value",
"type",
"from",
"it",
"."
] | def _simplified_return_type(self):
"""
The NPM callconv has already converted simplified optional types.
We can simply use the value type from it.
"""
restype = self.fndesc.restype
# Optional type
if isinstance(restype, types.Optional):
return restype.... | [
"def",
"_simplified_return_type",
"(",
"self",
")",
":",
"restype",
"=",
"self",
".",
"fndesc",
".",
"restype",
"# Optional type",
"if",
"isinstance",
"(",
"restype",
",",
"types",
".",
"Optional",
")",
":",
"return",
"restype",
".",
"type",
"else",
":",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/callwrapper.py#L199-L209 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/fields.py | python | RequestField.make_multipart | (self, content_disposition=None, content_type=None,
content_location=None) | Makes this request field into a multipart request field.
This method overrides "Content-Disposition", "Content-Type" and
"Content-Location" headers to the request parameter.
:param content_type:
The 'Content-Type' of the request body.
:param content_location:
Th... | Makes this request field into a multipart request field. | [
"Makes",
"this",
"request",
"field",
"into",
"a",
"multipart",
"request",
"field",
"."
] | def make_multipart(self, content_disposition=None, content_type=None,
content_location=None):
"""
Makes this request field into a multipart request field.
This method overrides "Content-Disposition", "Content-Type" and
"Content-Location" headers to the request par... | [
"def",
"make_multipart",
"(",
"self",
",",
"content_disposition",
"=",
"None",
",",
"content_type",
"=",
"None",
",",
"content_location",
"=",
"None",
")",
":",
"self",
".",
"headers",
"[",
"'Content-Disposition'",
"]",
"=",
"content_disposition",
"or",
"'form-d... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/fields.py#L156-L177 | ||
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/generators.py | python | __ensure_type | (targets) | Ensures all 'targets' have types. If this is not so, exists with
error. | Ensures all 'targets' have types. If this is not so, exists with
error. | [
"Ensures",
"all",
"targets",
"have",
"types",
".",
"If",
"this",
"is",
"not",
"so",
"exists",
"with",
"error",
"."
] | def __ensure_type (targets):
""" Ensures all 'targets' have types. If this is not so, exists with
error.
"""
assert is_iterable_typed(targets, virtual_target.VirtualTarget)
for t in targets:
if not t.type ():
get_manager().errors()("target '%s' has no type" % str (t)) | [
"def",
"__ensure_type",
"(",
"targets",
")",
":",
"assert",
"is_iterable_typed",
"(",
"targets",
",",
"virtual_target",
".",
"VirtualTarget",
")",
"for",
"t",
"in",
"targets",
":",
"if",
"not",
"t",
".",
"type",
"(",
")",
":",
"get_manager",
"(",
")",
".... | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/generators.py#L985-L992 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/v1/input_lib.py | python | _SingleWorkerDatasetIterator.initialize | (self) | Initialize underlying iterator.
In eager execution, this simply recreates the underlying iterator.
In graph execution, it returns the initializer ops for the underlying
iterator.
Returns:
A list of any initializer ops that should be run. | Initialize underlying iterator. | [
"Initialize",
"underlying",
"iterator",
"."
] | def initialize(self):
"""Initialize underlying iterator.
In eager execution, this simply recreates the underlying iterator.
In graph execution, it returns the initializer ops for the underlying
iterator.
Returns:
A list of any initializer ops that should be run.
"""
if ops.executing_... | [
"def",
"initialize",
"(",
"self",
")",
":",
"if",
"ops",
".",
"executing_eagerly_outside_functions",
"(",
")",
":",
"self",
".",
"_iterator",
".",
"_eager_reset",
"(",
")",
"# pylint: disable=protected-access",
"return",
"[",
"]",
"else",
":",
"return",
"[",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/v1/input_lib.py#L343-L357 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/distributed/AsyncRequest.py | python | AsyncRequest.createObjectId | (self, name, className, values = None, context = None) | Create a new database object. You can get the doId from within
your self.finish() function.
This functions is different from createObject in that it does not
generate the object when the response comes back. It only tells you
the doId. This is useful on the UD where we don't really w... | Create a new database object. You can get the doId from within
your self.finish() function. | [
"Create",
"a",
"new",
"database",
"object",
".",
"You",
"can",
"get",
"the",
"doId",
"from",
"within",
"your",
"self",
".",
"finish",
"()",
"function",
"."
] | def createObjectId(self, name, className, values = None, context = None):
"""
Create a new database object. You can get the doId from within
your self.finish() function.
This functions is different from createObject in that it does not
generate the object when the response come... | [
"def",
"createObjectId",
"(",
"self",
",",
"name",
",",
"className",
",",
"values",
"=",
"None",
",",
"context",
"=",
"None",
")",
":",
"assert",
"AsyncRequest",
".",
"notify",
".",
"debugCall",
"(",
")",
"assert",
"name",
"assert",
"className",
"self",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/AsyncRequest.py#L174-L195 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/checkperms/checkperms.py | python | ShouldCheckDirectory | (dir_path) | return repo_url == SVN_REPO_URL | Determine if we should check the content of dir_path. | Determine if we should check the content of dir_path. | [
"Determine",
"if",
"we",
"should",
"check",
"the",
"content",
"of",
"dir_path",
"."
] | def ShouldCheckDirectory(dir_path):
"""Determine if we should check the content of dir_path."""
if not IS_SVN:
return dir_path in GIT_SOURCE_DIRECTORY
repo_url = GetSvnRepositoryRoot(dir_path)
if not repo_url:
return False
return repo_url == SVN_REPO_URL | [
"def",
"ShouldCheckDirectory",
"(",
"dir_path",
")",
":",
"if",
"not",
"IS_SVN",
":",
"return",
"dir_path",
"in",
"GIT_SOURCE_DIRECTORY",
"repo_url",
"=",
"GetSvnRepositoryRoot",
"(",
"dir_path",
")",
"if",
"not",
"repo_url",
":",
"return",
"False",
"return",
"r... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/checkperms/checkperms.py#L194-L201 | |
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Diagnostic.option | (self) | return conf.lib.clang_getDiagnosticOption(self, None) | The command-line option that enables this diagnostic. | The command-line option that enables this diagnostic. | [
"The",
"command",
"-",
"line",
"option",
"that",
"enables",
"this",
"diagnostic",
"."
] | def option(self):
"""The command-line option that enables this diagnostic."""
return conf.lib.clang_getDiagnosticOption(self, None) | [
"def",
"option",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getDiagnosticOption",
"(",
"self",
",",
"None",
")"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L350-L352 | |
KhronosGroup/OpenCOLLADA | 6031fa956e1da4bbdd910af3a8f9e924ef0fca7a | Externals/LibXML/python/libxml.py | python | SAXCallback.cdataBlock | (self, data) | called when CDATA section have been read, data is the string
containing the data, multiple consecutive cdataBlock() callback
are possible. | called when CDATA section have been read, data is the string
containing the data, multiple consecutive cdataBlock() callback
are possible. | [
"called",
"when",
"CDATA",
"section",
"have",
"been",
"read",
"data",
"is",
"the",
"string",
"containing",
"the",
"data",
"multiple",
"consecutive",
"cdataBlock",
"()",
"callback",
"are",
"possible",
"."
] | def cdataBlock(self, data):
"""called when CDATA section have been read, data is the string
containing the data, multiple consecutive cdataBlock() callback
are possible."""
pass | [
"def",
"cdataBlock",
"(",
"self",
",",
"data",
")",
":",
"pass"
] | https://github.com/KhronosGroup/OpenCOLLADA/blob/6031fa956e1da4bbdd910af3a8f9e924ef0fca7a/Externals/LibXML/python/libxml.py#L160-L164 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py | python | ShapeEquivSet.get_shape_classes | (self, name) | return inds | Instead of the shape tuple, return tuple of int, where
each int is the corresponding class index of the size object.
Unknown shapes are given class index -1. Return empty tuple
if the input name is a scalar variable. | Instead of the shape tuple, return tuple of int, where
each int is the corresponding class index of the size object.
Unknown shapes are given class index -1. Return empty tuple
if the input name is a scalar variable. | [
"Instead",
"of",
"the",
"shape",
"tuple",
"return",
"tuple",
"of",
"int",
"where",
"each",
"int",
"is",
"the",
"corresponding",
"class",
"index",
"of",
"the",
"size",
"object",
".",
"Unknown",
"shapes",
"are",
"given",
"class",
"index",
"-",
"1",
".",
"R... | def get_shape_classes(self, name):
"""Instead of the shape tuple, return tuple of int, where
each int is the corresponding class index of the size object.
Unknown shapes are given class index -1. Return empty tuple
if the input name is a scalar variable.
"""
if isinstance... | [
"def",
"get_shape_classes",
"(",
"self",
",",
"name",
")",
":",
"if",
"isinstance",
"(",
"name",
",",
"ir",
".",
"Var",
")",
":",
"name",
"=",
"name",
".",
"name",
"typ",
"=",
"self",
".",
"typemap",
"[",
"name",
"]",
"if",
"name",
"in",
"self",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py#L557-L575 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py2/setup.py | python | find_license | (docs) | return None | Determine license from LICENSE
:return: License text
:rtype: ``str`` | Determine license from LICENSE | [
"Determine",
"license",
"from",
"LICENSE"
] | def find_license(docs):
"""
Determine license from LICENSE
:return: License text
:rtype: ``str``
"""
filename = docs.get('meta.license', 'LICENSE').strip()
if filename and _os.path.isfile(filename):
fp = open(filename)
try:
return fp.read().rstrip()
final... | [
"def",
"find_license",
"(",
"docs",
")",
":",
"filename",
"=",
"docs",
".",
"get",
"(",
"'meta.license'",
",",
"'LICENSE'",
")",
".",
"strip",
"(",
")",
"if",
"filename",
"and",
"_os",
".",
"path",
".",
"isfile",
"(",
"filename",
")",
":",
"fp",
"=",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py2/setup.py#L157-L171 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/arrays/categorical.py | python | Categorical.set_ordered | (self, value, inplace=False) | Set the ordered attribute to the boolean value.
Parameters
----------
value : bool
Set whether this categorical is ordered (True) or not (False).
inplace : bool, default False
Whether or not to set the ordered attribute in-place or return
a copy of this ... | Set the ordered attribute to the boolean value. | [
"Set",
"the",
"ordered",
"attribute",
"to",
"the",
"boolean",
"value",
"."
] | def set_ordered(self, value, inplace=False):
"""
Set the ordered attribute to the boolean value.
Parameters
----------
value : bool
Set whether this categorical is ordered (True) or not (False).
inplace : bool, default False
Whether or not to set th... | [
"def",
"set_ordered",
"(",
"self",
",",
"value",
",",
"inplace",
"=",
"False",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"\"inplace\"",
")",
"new_dtype",
"=",
"CategoricalDtype",
"(",
"self",
".",
"categories",
",",
"ordered",
"="... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/arrays/categorical.py#L823-L840 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MouseState.GetPosition | (*args, **kwargs) | return _core_.MouseState_GetPosition(*args, **kwargs) | GetPosition(self) -> Point | GetPosition(self) -> Point | [
"GetPosition",
"(",
"self",
")",
"-",
">",
"Point"
] | def GetPosition(*args, **kwargs):
"""GetPosition(self) -> Point"""
return _core_.MouseState_GetPosition(*args, **kwargs) | [
"def",
"GetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MouseState_GetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L4446-L4448 | |
LunarG/VulkanSamples | 08e87dc3194cfc15e49125f71592d8acff070ce4 | scripts/update_deps.py | python | GoodRepo.PreBuild | (self) | Execute any prebuild steps from the repo root | Execute any prebuild steps from the repo root | [
"Execute",
"any",
"prebuild",
"steps",
"from",
"the",
"repo",
"root"
] | def PreBuild(self):
"""Execute any prebuild steps from the repo root"""
for p in self.prebuild:
command_output(shlex.split(p), self.repo_dir)
if platform.system() == 'Linux' or platform.system() == 'Darwin':
for p in self.prebuild_linux:
command_output(shl... | [
"def",
"PreBuild",
"(",
"self",
")",
":",
"for",
"p",
"in",
"self",
".",
"prebuild",
":",
"command_output",
"(",
"shlex",
".",
"split",
"(",
"p",
")",
",",
"self",
".",
"repo_dir",
")",
"if",
"platform",
".",
"system",
"(",
")",
"==",
"'Linux'",
"o... | https://github.com/LunarG/VulkanSamples/blob/08e87dc3194cfc15e49125f71592d8acff070ce4/scripts/update_deps.py#L404-L413 | ||
WeitaoVan/L-GM-loss | 598582f0631bac876b3eeb8d6c4cd1d780269e03 | scripts/cpp_lint.py | python | CheckSpacing | (filename, clean_lines, linenum, nesting_state, error) | Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with a blank
line, don't end a function with a blank line, don't ... | Checks for the correctness of various spacing issues in the code. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"issues",
"in",
"the",
"code",
"."
] | def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
"""Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't star... | [
"def",
"CheckSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want to check inside C++11",
... | https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L2643-L2988 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/agents/utility.py | python | initialize_variables | (sess, saver, logdir, checkpoint=None, resume=None) | Initialize or restore variables from a checkpoint if available.
Args:
sess: Session to initialize variables in.
saver: Saver to restore variables.
logdir: Directory to search for checkpoints.
checkpoint: Specify what checkpoint name to use; defaults to most recent.
resume: Whether to expect recov... | Initialize or restore variables from a checkpoint if available. | [
"Initialize",
"or",
"restore",
"variables",
"from",
"a",
"checkpoint",
"if",
"available",
"."
] | def initialize_variables(sess, saver, logdir, checkpoint=None, resume=None):
"""Initialize or restore variables from a checkpoint if available.
Args:
sess: Session to initialize variables in.
saver: Saver to restore variables.
logdir: Directory to search for checkpoints.
checkpoint: Specify what ch... | [
"def",
"initialize_variables",
"(",
"sess",
",",
"saver",
",",
"logdir",
",",
"checkpoint",
"=",
"None",
",",
"resume",
"=",
"None",
")",
":",
"sess",
".",
"run",
"(",
"tf",
".",
"group",
"(",
"tf",
".",
"local_variables_initializer",
"(",
")",
",",
"t... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/utility.py#L99-L126 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py | python | check_requirements | (dist, attr, value) | Verify that install_requires is a valid requirements list | Verify that install_requires is a valid requirements list | [
"Verify",
"that",
"install_requires",
"is",
"a",
"valid",
"requirements",
"list"
] | def check_requirements(dist, attr, value):
"""Verify that install_requires is a valid requirements list"""
try:
list(pkg_resources.parse_requirements(value))
if isinstance(value, (dict, set)):
raise TypeError("Unordered types are not allowed")
except (TypeError, ValueError) as er... | [
"def",
"check_requirements",
"(",
"dist",
",",
"attr",
",",
"value",
")",
":",
"try",
":",
"list",
"(",
"pkg_resources",
".",
"parse_requirements",
"(",
"value",
")",
")",
"if",
"isinstance",
"(",
"value",
",",
"(",
"dict",
",",
"set",
")",
")",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py#L272-L283 | ||
VowpalWabbit/vowpal_wabbit | 866b8fa88ff85a957c7eb72065ea44518b9ba416 | python/vowpalwabbit/dftovw.py | python | Feature.__init__ | (
self,
value: Hashable,
rename_feature: Optional[str] = None,
as_type: Optional[str] = None,
) | Initialize a Feature instance.
Args:
value: The column name with the value of the feature.
rename_feature: The name to use instead of the default (which is the column name defined in the value argument).
as_type: Enforce a specific type ('numerical' or 'categorical') | Initialize a Feature instance. | [
"Initialize",
"a",
"Feature",
"instance",
"."
] | def __init__(
self,
value: Hashable,
rename_feature: Optional[str] = None,
as_type: Optional[str] = None,
):
"""
Initialize a Feature instance.
Args:
value: The column name with the value of the feature.
rename_feature: The name to use... | [
"def",
"__init__",
"(",
"self",
",",
"value",
":",
"Hashable",
",",
"rename_feature",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"as_type",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
")",
":",
"self",
".",
"value",
"=",
"value",
"... | https://github.com/VowpalWabbit/vowpal_wabbit/blob/866b8fa88ff85a957c7eb72065ea44518b9ba416/python/vowpalwabbit/dftovw.py#L365-L388 | ||
OpenGenus/quark | 225ad96efdfcc66cb6584a756c17eb3871e6eb62 | code/code/mathematical_algorithms/src/exponentiation_power/exponentiation_by_squaring/exponentiation_by_squaring.py | python | fast_power | (base, power) | return result | Returns the result of a^b i.e. a**b
We assume that a >= 1 and b >= 0 | Returns the result of a^b i.e. a**b
We assume that a >= 1 and b >= 0 | [
"Returns",
"the",
"result",
"of",
"a^b",
"i",
".",
"e",
".",
"a",
"**",
"b",
"We",
"assume",
"that",
"a",
">",
"=",
"1",
"and",
"b",
">",
"=",
"0"
] | def fast_power(base, power):
"""
Returns the result of a^b i.e. a**b
We assume that a >= 1 and b >= 0
"""
result = 1
while power > 0:
# If power is odd
if power % 2 == 1:
result = (result * base) % MOD
# Divide the power by 2
power = int(power / 2)
... | [
"def",
"fast_power",
"(",
"base",
",",
"power",
")",
":",
"result",
"=",
"1",
"while",
"power",
">",
"0",
":",
"# If power is odd",
"if",
"power",
"%",
"2",
"==",
"1",
":",
"result",
"=",
"(",
"result",
"*",
"base",
")",
"%",
"MOD",
"# Divide the pow... | https://github.com/OpenGenus/quark/blob/225ad96efdfcc66cb6584a756c17eb3871e6eb62/code/code/mathematical_algorithms/src/exponentiation_power/exponentiation_by_squaring/exponentiation_by_squaring.py#L4-L21 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/calendar.py | python | CalendarCtrlBase.SetHoliday | (*args, **kwargs) | return _calendar.CalendarCtrlBase_SetHoliday(*args, **kwargs) | SetHoliday(self, size_t day)
Marks the specified day as being a holiday in the current month. | SetHoliday(self, size_t day) | [
"SetHoliday",
"(",
"self",
"size_t",
"day",
")"
] | def SetHoliday(*args, **kwargs):
"""
SetHoliday(self, size_t day)
Marks the specified day as being a holiday in the current month.
"""
return _calendar.CalendarCtrlBase_SetHoliday(*args, **kwargs) | [
"def",
"SetHoliday",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_calendar",
".",
"CalendarCtrlBase_SetHoliday",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/calendar.py#L387-L393 | |
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/enumerations/enumeratedtypes.py | python | EnumeratedTypeGroup.postSerialize | (self) | Invoke any post serialization behavior that may be required. | Invoke any post serialization behavior that may be required. | [
"Invoke",
"any",
"post",
"serialization",
"behavior",
"that",
"may",
"be",
"required",
"."
] | def postSerialize(self):
"""Invoke any post serialization behavior that may be required."""
for enumeratedType in self.enumeratedTypes_.values():
enumeratedType.setType(self.type_)
enumeratedType.setConstructor(self.constructor_) | [
"def",
"postSerialize",
"(",
"self",
")",
":",
"for",
"enumeratedType",
"in",
"self",
".",
"enumeratedTypes_",
".",
"values",
"(",
")",
":",
"enumeratedType",
".",
"setType",
"(",
"self",
".",
"type_",
")",
"enumeratedType",
".",
"setConstructor",
"(",
"self... | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/enumerations/enumeratedtypes.py#L117-L121 | ||
makefile/frcnn | 8d9b9ebf8be8315ba2f374d460121b0adf1df29c | scripts/cpp_lint.py | python | FindNextMatchingAngleBracket | (clean_lines, linenum, init_suffix) | return True | Find the corresponding > to close a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_suffix: Remainder of the current line after the initial <.
Returns:
True if a matching bracket exists. | Find the corresponding > to close a template. | [
"Find",
"the",
"corresponding",
">",
"to",
"close",
"a",
"template",
"."
] | def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix):
"""Find the corresponding > to close a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_suffix: Remainder of the current line after the initial <.
Returns:
True if a ... | [
"def",
"FindNextMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_suffix",
")",
":",
"line",
"=",
"init_suffix",
"nesting_stack",
"=",
"[",
"'<'",
"]",
"while",
"True",
":",
"# Find the next operator that can tell us whether < is used as an",
"# openin... | https://github.com/makefile/frcnn/blob/8d9b9ebf8be8315ba2f374d460121b0adf1df29c/scripts/cpp_lint.py#L2517-L2583 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/contrib/securetransport.py | python | _write_callback | (connection_id, data_buffer, data_length_pointer) | SecureTransport write callback. This is called by ST to request that data
actually be sent on the network. | SecureTransport write callback. This is called by ST to request that data
actually be sent on the network. | [
"SecureTransport",
"write",
"callback",
".",
"This",
"is",
"called",
"by",
"ST",
"to",
"request",
"that",
"data",
"actually",
"be",
"sent",
"on",
"the",
"network",
"."
] | def _write_callback(connection_id, data_buffer, data_length_pointer):
"""
SecureTransport write callback. This is called by ST to request that data
actually be sent on the network.
"""
wrapped_socket = None
try:
wrapped_socket = _connection_refs.get(connection_id)
if wrapped_sock... | [
"def",
"_write_callback",
"(",
"connection_id",
",",
"data_buffer",
",",
"data_length_pointer",
")",
":",
"wrapped_socket",
"=",
"None",
"try",
":",
"wrapped_socket",
"=",
"_connection_refs",
".",
"get",
"(",
"connection_id",
")",
"if",
"wrapped_socket",
"is",
"No... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/contrib/securetransport.py#L238-L285 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/parenmatch.py | python | ParenMatch.create_tag_expression | (self, indices) | Highlight the entire expression | Highlight the entire expression | [
"Highlight",
"the",
"entire",
"expression"
] | def create_tag_expression(self, indices):
"""Highlight the entire expression"""
if self.text.get(indices[1]) in (')', ']', '}'):
rightindex = indices[1]+"+1c"
else:
rightindex = indices[1]
self.text.tag_add("paren", indices[0], rightindex)
self.text.tag_co... | [
"def",
"create_tag_expression",
"(",
"self",
",",
"indices",
")",
":",
"if",
"self",
".",
"text",
".",
"get",
"(",
"indices",
"[",
"1",
"]",
")",
"in",
"(",
"')'",
",",
"']'",
",",
"'}'",
")",
":",
"rightindex",
"=",
"indices",
"[",
"1",
"]",
"+"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/parenmatch.py#L134-L141 | ||
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.MergeFrom | (self, other) | Appends the contents of another repeated field of the same type to this
one, copying each individual message. | Appends the contents of another repeated field of the same type to this
one, copying each individual message. | [
"Appends",
"the",
"contents",
"of",
"another",
"repeated",
"field",
"of",
"the",
"same",
"type",
"to",
"this",
"one",
"copying",
"each",
"individual",
"message",
"."
] | def MergeFrom(self, other):
"""Appends the contents of another repeated field of the same type to this
one, copying each individual message.
"""
self.extend(other._values) | [
"def",
"MergeFrom",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"extend",
"(",
"other",
".",
"_values",
")"
] | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/containers.py#L237-L241 | ||
scribusproject/scribus | 41ec7c775a060912cf251682a8b1437f753f80f4 | scribus/plugins/scripter/python/scripter_runtime.py | python | mark_keep | () | mark every child of Scripter.collector to keep | mark every child of Scripter.collector to keep | [
"mark",
"every",
"child",
"of",
"Scripter",
".",
"collector",
"to",
"keep"
] | def mark_keep():
"""
mark every child of Scripter.collector to keep
"""
for child in Scripter.collector.children():
if hasattr(child, "qt"): child = child.qt
child.setProperty("keep", QVariant(True)) | [
"def",
"mark_keep",
"(",
")",
":",
"for",
"child",
"in",
"Scripter",
".",
"collector",
".",
"children",
"(",
")",
":",
"if",
"hasattr",
"(",
"child",
",",
"\"qt\"",
")",
":",
"child",
"=",
"child",
".",
"qt",
"child",
".",
"setProperty",
"(",
"\"keep... | https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/scribus/plugins/scripter/python/scripter_runtime.py#L227-L233 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/posixpath.py | python | relpath | (path, start=None) | Return a relative version of a path | Return a relative version of a path | [
"Return",
"a",
"relative",
"version",
"of",
"a",
"path"
] | def relpath(path, start=None):
"""Return a relative version of a path"""
if not path:
raise ValueError("no path specified")
path = os.fspath(path)
if isinstance(path, bytes):
curdir = b'.'
sep = b'/'
pardir = b'..'
else:
curdir = '.'
sep = '/'
... | [
"def",
"relpath",
"(",
"path",
",",
"start",
"=",
"None",
")",
":",
"if",
"not",
"path",
":",
"raise",
"ValueError",
"(",
"\"no path specified\"",
")",
"path",
"=",
"os",
".",
"fspath",
"(",
"path",
")",
"if",
"isinstance",
"(",
"path",
",",
"bytes",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/posixpath.py#L450-L483 | ||
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.hasZCoord | (self) | return bool(
self.dispatcher._checkResult(Indigo._lib.indigoHasZCoord(self.id))
) | Molecule method returns True if the structure contains Z coordinate
Returns:
bool: True if contains Z coordinate, False otherwise | Molecule method returns True if the structure contains Z coordinate | [
"Molecule",
"method",
"returns",
"True",
"if",
"the",
"structure",
"contains",
"Z",
"coordinate"
] | def hasZCoord(self):
"""Molecule method returns True if the structure contains Z coordinate
Returns:
bool: True if contains Z coordinate, False otherwise
"""
self.dispatcher._setSessionId()
return bool(
self.dispatcher._checkResult(Indigo._lib.indigoHasZC... | [
"def",
"hasZCoord",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"bool",
"(",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoHasZCoord",
"(",
"self",
".",
"id",
")",
... | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L3219-L3228 | |
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/optimal_learning/python/cpp_wrappers/domain.py | python | TensorProductDomain.dim | (self) | return len(self._domain_bounds) | Return the number of spatial dimensions. | Return the number of spatial dimensions. | [
"Return",
"the",
"number",
"of",
"spatial",
"dimensions",
"."
] | def dim(self):
"""Return the number of spatial dimensions."""
return len(self._domain_bounds) | [
"def",
"dim",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_domain_bounds",
")"
] | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/cpp_wrappers/domain.py#L38-L40 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | .github/github_org_control/github_api.py | python | GithubOrgApi.is_org_user | (self, user) | return False | Checks that user is a member of GitHub organization | Checks that user is a member of GitHub organization | [
"Checks",
"that",
"user",
"is",
"a",
"member",
"of",
"GitHub",
"organization"
] | def is_org_user(self, user):
"""Checks that user is a member of GitHub organization"""
if is_valid_user(user):
# user.get_organization_membership(self.github_org) doesn't work with org members
# permissions, GITHUB_TOKEN must be org owner now
return self.github_org.ha... | [
"def",
"is_org_user",
"(",
"self",
",",
"user",
")",
":",
"if",
"is_valid_user",
"(",
"user",
")",
":",
"# user.get_organization_membership(self.github_org) doesn't work with org members",
"# permissions, GITHUB_TOKEN must be org owner now",
"return",
"self",
".",
"github_org",... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/.github/github_org_control/github_api.py#L137-L143 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | uCSIsTags | (code) | return ret | Check whether the character is part of Tags UCS Block | Check whether the character is part of Tags UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Tags",
"UCS",
"Block"
] | def uCSIsTags(code):
"""Check whether the character is part of Tags UCS Block """
ret = libxml2mod.xmlUCSIsTags(code)
return ret | [
"def",
"uCSIsTags",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsTags",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2867-L2870 | |
apache/mesos | 97d9a4063332aae3825d78de71611657e05cf5e2 | support/cpplint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array ... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/support/cpplint.py#L2038-L2053 | ||
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/deephol/embedding_store.py | python | TheoremEmbeddingStore.get_thm_scores_for_preceding_thms | (self,
goal_embedding,
thm_index: Optional[int] = None,
tactic_id: Optional[int] = None) | return self.predictor.batch_thm_scores(goal_embedding, thm_embeddings,
tactic_id) | Get the predicted pairwise scores in a numpy array.
For the given goal embedding (which is either the embedding of the goal term
or the embedding of the current proof state), get all the theorem scores
that preceed the given theorem in theorem list and all the local
assumptions stored in this store. Th... | Get the predicted pairwise scores in a numpy array. | [
"Get",
"the",
"predicted",
"pairwise",
"scores",
"in",
"a",
"numpy",
"array",
"."
] | def get_thm_scores_for_preceding_thms(self,
goal_embedding,
thm_index: Optional[int] = None,
tactic_id: Optional[int] = None):
"""Get the predicted pairwise scores in a numpy array.
For the g... | [
"def",
"get_thm_scores_for_preceding_thms",
"(",
"self",
",",
"goal_embedding",
",",
"thm_index",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"tactic_id",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
":",
"if",
"thm_index",
"is",
"None",
":"... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/embedding_store.py#L102-L136 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | ToolBarToolBase.SetDropdownMenu | (*args, **kwargs) | return _controls_.ToolBarToolBase_SetDropdownMenu(*args, **kwargs) | SetDropdownMenu(self, Menu menu) | SetDropdownMenu(self, Menu menu) | [
"SetDropdownMenu",
"(",
"self",
"Menu",
"menu",
")"
] | def SetDropdownMenu(*args, **kwargs):
"""SetDropdownMenu(self, Menu menu)"""
return _controls_.ToolBarToolBase_SetDropdownMenu(*args, **kwargs) | [
"def",
"SetDropdownMenu",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ToolBarToolBase_SetDropdownMenu",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L3553-L3555 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.