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/osx_cocoa/grid.py | python | Grid.GetDefaultCellOverflow | (*args, **kwargs) | return _grid.Grid_GetDefaultCellOverflow(*args, **kwargs) | GetDefaultCellOverflow(self) -> bool | GetDefaultCellOverflow(self) -> bool | [
"GetDefaultCellOverflow",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetDefaultCellOverflow(*args, **kwargs):
"""GetDefaultCellOverflow(self) -> bool"""
return _grid.Grid_GetDefaultCellOverflow(*args, **kwargs) | [
"def",
"GetDefaultCellOverflow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_GetDefaultCellOverflow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1802-L1804 | |
FEniCS/dolfinx | 3dfdf038cccdb70962865b58a63bf29c2e55ec6e | python/dolfinx/fem/function.py | python | Expression.code | (self) | return self._code | C code strings | C code strings | [
"C",
"code",
"strings"
] | def code(self) -> str:
"""C code strings"""
return self._code | [
"def",
"code",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_code"
] | https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/fem/function.py#L208-L210 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/name_expansion.py | python | _NameExpansionIterator.WildcardIterator | (self, url_string) | return gslib.wildcard_iterator.CreateWildcardIterator(
url_string, self.gsutil_api, debug=self.debug,
all_versions=self.all_versions,
project_id=self.project_id) | Helper to instantiate gslib.WildcardIterator.
Args are same as gslib.WildcardIterator interface, but this method fills
in most of the values from instance state.
Args:
url_string: URL string naming wildcard objects to iterate.
Returns:
Wildcard iterator over URL string. | Helper to instantiate gslib.WildcardIterator. | [
"Helper",
"to",
"instantiate",
"gslib",
".",
"WildcardIterator",
"."
] | def WildcardIterator(self, url_string):
"""Helper to instantiate gslib.WildcardIterator.
Args are same as gslib.WildcardIterator interface, but this method fills
in most of the values from instance state.
Args:
url_string: URL string naming wildcard objects to iterate.
Returns:
Wildca... | [
"def",
"WildcardIterator",
"(",
"self",
",",
"url_string",
")",
":",
"return",
"gslib",
".",
"wildcard_iterator",
".",
"CreateWildcardIterator",
"(",
"url_string",
",",
"self",
".",
"gsutil_api",
",",
"debug",
"=",
"self",
".",
"debug",
",",
"all_versions",
"=... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/name_expansion.py#L282-L297 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/glob.py | python | iglob | (pathname) | Return an iterator which yields the paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns. | Return an iterator which yields the paths matching a pathname pattern. | [
"Return",
"an",
"iterator",
"which",
"yields",
"the",
"paths",
"matching",
"a",
"pathname",
"pattern",
"."
] | def iglob(pathname):
"""Return an iterator which yields the paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.
"""
dirna... | [
"def",
"iglob",
"(",
"pathname",
")",
":",
"dirname",
",",
"basename",
"=",
"os",
".",
"path",
".",
"split",
"(",
"pathname",
")",
"if",
"not",
"has_magic",
"(",
"pathname",
")",
":",
"if",
"basename",
":",
"if",
"os",
".",
"path",
".",
"lexists",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/glob.py#L29-L65 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/xrc.py | python | XmlDocument.LoadFromStream | (*args, **kwargs) | return _xrc.XmlDocument_LoadFromStream(*args, **kwargs) | LoadFromStream(self, InputStream stream, String encoding=UTF8String, int flags=XMLDOC_NONE) -> bool | LoadFromStream(self, InputStream stream, String encoding=UTF8String, int flags=XMLDOC_NONE) -> bool | [
"LoadFromStream",
"(",
"self",
"InputStream",
"stream",
"String",
"encoding",
"=",
"UTF8String",
"int",
"flags",
"=",
"XMLDOC_NONE",
")",
"-",
">",
"bool"
] | def LoadFromStream(*args, **kwargs):
"""LoadFromStream(self, InputStream stream, String encoding=UTF8String, int flags=XMLDOC_NONE) -> bool"""
return _xrc.XmlDocument_LoadFromStream(*args, **kwargs) | [
"def",
"LoadFromStream",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlDocument_LoadFromStream",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L519-L521 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/swgbcc/ability_subprocessor.py | python | SWGBCCAbilitySubprocessor.death_ability | (line) | return ability_forward_ref | Adds the Death ability to a line that is used to make entities die.
:param line: Unit/Building line that gets the ability.
:type line: ...dataformat.converter_object.ConverterObjectGroup
:returns: The forward reference for the ability.
:rtype: ...dataformat.forward_ref.ForwardRef | Adds the Death ability to a line that is used to make entities die. | [
"Adds",
"the",
"Death",
"ability",
"to",
"a",
"line",
"that",
"is",
"used",
"to",
"make",
"entities",
"die",
"."
] | def death_ability(line):
"""
Adds the Death ability to a line that is used to make entities die.
:param line: Unit/Building line that gets the ability.
:type line: ...dataformat.converter_object.ConverterObjectGroup
:returns: The forward reference for the ability.
:rtype... | [
"def",
"death_ability",
"(",
"line",
")",
":",
"ability_forward_ref",
"=",
"AoCAbilitySubprocessor",
".",
"death_ability",
"(",
"line",
")",
"# TODO: Implement diffing of civ lines",
"return",
"ability_forward_ref"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/swgbcc/ability_subprocessor.py#L500-L513 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/filters.py | python | do_urlencode | (
value: t.Union[str, t.Mapping[str, t.Any], t.Iterable[t.Tuple[str, t.Any]]]
) | return "&".join(
f"{url_quote(k, for_qs=True)}={url_quote(v, for_qs=True)}" for k, v in items
) | Quote data for use in a URL path or query using UTF-8.
Basic wrapper around :func:`urllib.parse.quote` when given a
string, or :func:`urllib.parse.urlencode` for a dict or iterable.
:param value: Data to quote. A string will be quoted directly. A
dict or iterable of ``(key, value)`` pairs will be ... | Quote data for use in a URL path or query using UTF-8. | [
"Quote",
"data",
"for",
"use",
"in",
"a",
"URL",
"path",
"or",
"query",
"using",
"UTF",
"-",
"8",
"."
] | def do_urlencode(
value: t.Union[str, t.Mapping[str, t.Any], t.Iterable[t.Tuple[str, t.Any]]]
) -> str:
"""Quote data for use in a URL path or query using UTF-8.
Basic wrapper around :func:`urllib.parse.quote` when given a
string, or :func:`urllib.parse.urlencode` for a dict or iterable.
:param va... | [
"def",
"do_urlencode",
"(",
"value",
":",
"t",
".",
"Union",
"[",
"str",
",",
"t",
".",
"Mapping",
"[",
"str",
",",
"t",
".",
"Any",
"]",
",",
"t",
".",
"Iterable",
"[",
"t",
".",
"Tuple",
"[",
"str",
",",
"t",
".",
"Any",
"]",
"]",
"]",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/filters.py#L197-L225 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_workflow/command_interface.py | python | ReductionSingleton.__getattr__ | (self, attr) | return getattr(self.__instance, attr) | Delegate access to implementation | Delegate access to implementation | [
"Delegate",
"access",
"to",
"implementation"
] | def __getattr__(self, attr):
""" Delegate access to implementation """
return getattr(self.__instance, attr) | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"return",
"getattr",
"(",
"self",
".",
"__instance",
",",
"attr",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_workflow/command_interface.py#L61-L63 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/stats.py | python | f_value_multivariate | (ER, EF, dfnum, dfden) | return n_um / d_en | Returns a multivariate F-statistic.
Parameters
----------
ER : ndarray
Error associated with the null hypothesis (the Restricted model).
From a multivariate F calculation.
EF : ndarray
Error associated with the alternate hypothesis (the Full model)
From a multivariate F ... | Returns a multivariate F-statistic. | [
"Returns",
"a",
"multivariate",
"F",
"-",
"statistic",
"."
] | def f_value_multivariate(ER, EF, dfnum, dfden):
"""
Returns a multivariate F-statistic.
Parameters
----------
ER : ndarray
Error associated with the null hypothesis (the Restricted model).
From a multivariate F calculation.
EF : ndarray
Error associated with the alternat... | [
"def",
"f_value_multivariate",
"(",
"ER",
",",
"EF",
",",
"dfnum",
",",
"dfden",
")",
":",
"if",
"isinstance",
"(",
"ER",
",",
"(",
"int",
",",
"float",
")",
")",
":",
"ER",
"=",
"array",
"(",
"[",
"[",
"ER",
"]",
"]",
")",
"if",
"isinstance",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/stats.py#L5142-L5171 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py | python | BooleanParser.Convert | (self, argument) | Converts the argument to a boolean; raise ValueError on errors. | Converts the argument to a boolean; raise ValueError on errors. | [
"Converts",
"the",
"argument",
"to",
"a",
"boolean",
";",
"raise",
"ValueError",
"on",
"errors",
"."
] | def Convert(self, argument):
"""Converts the argument to a boolean; raise ValueError on errors."""
if type(argument) == str:
if argument.lower() in ['true', 't', '1']:
return True
elif argument.lower() in ['false', 'f', '0']:
return False
bool_argument = bool(argument)
if ar... | [
"def",
"Convert",
"(",
"self",
",",
"argument",
")",
":",
"if",
"type",
"(",
"argument",
")",
"==",
"str",
":",
"if",
"argument",
".",
"lower",
"(",
")",
"in",
"[",
"'true'",
",",
"'t'",
",",
"'1'",
"]",
":",
"return",
"True",
"elif",
"argument",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L2324-L2338 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | Distribution.__getattr__ | (self, attr) | return getattr(self._provider, attr) | Delegate all unrecognized public attributes to .metadata provider | Delegate all unrecognized public attributes to .metadata provider | [
"Delegate",
"all",
"unrecognized",
"public",
"attributes",
"to",
".",
"metadata",
"provider"
] | def __getattr__(self, attr):
"""Delegate all unrecognized public attributes to .metadata provider"""
if attr.startswith('_'):
raise AttributeError(attr)
return getattr(self._provider, attr) | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"if",
"attr",
".",
"startswith",
"(",
"'_'",
")",
":",
"raise",
"AttributeError",
"(",
"attr",
")",
"return",
"getattr",
"(",
"self",
".",
"_provider",
",",
"attr",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L2728-L2732 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py | python | PtyProcess.isalive | (self) | return False | This tests if the child process is running or not. This is
non-blocking. If the child was terminated then this will read the
exitstatus or signalstatus of the child. This returns True if the child
process appears to be running or False if not. It can take literally
SECONDS for Solaris to... | This tests if the child process is running or not. This is
non-blocking. If the child was terminated then this will read the
exitstatus or signalstatus of the child. This returns True if the child
process appears to be running or False if not. It can take literally
SECONDS for Solaris to... | [
"This",
"tests",
"if",
"the",
"child",
"process",
"is",
"running",
"or",
"not",
".",
"This",
"is",
"non",
"-",
"blocking",
".",
"If",
"the",
"child",
"was",
"terminated",
"then",
"this",
"will",
"read",
"the",
"exitstatus",
"or",
"signalstatus",
"of",
"t... | def isalive(self):
'''This tests if the child process is running or not. This is
non-blocking. If the child was terminated then this will read the
exitstatus or signalstatus of the child. This returns True if the child
process appears to be running or False if not. It can take literally
... | [
"def",
"isalive",
"(",
"self",
")",
":",
"if",
"self",
".",
"terminated",
":",
"return",
"False",
"if",
"self",
".",
"flag_eof",
":",
"# This is for Linux, which requires the blocking form",
"# of waitpid to get the status of a defunct process.",
"# This is super-lame. The fl... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L685-L760 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | contrib/src/sceneeditor/seAnimPanel.py | python | LoadAnimPanel.onDestroy | (self, event) | If you have open any thing, please rewrite here! | If you have open any thing, please rewrite here! | [
"If",
"you",
"have",
"open",
"any",
"thing",
"please",
"rewrite",
"here!"
] | def onDestroy(self, event):
messenger.send('AWL_close',[self.nodeName])
'''
If you have open any thing, please rewrite here!
'''
pass | [
"def",
"onDestroy",
"(",
"self",
",",
"event",
")",
":",
"messenger",
".",
"send",
"(",
"'AWL_close'",
",",
"[",
"self",
".",
"nodeName",
"]",
")",
"pass"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/contrib/src/sceneeditor/seAnimPanel.py#L539-L544 | ||
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/tools/scan-build-py/libscanbuild/analyze.py | python | filter_debug_flags | (opts, continuation=run_analyzer) | return continuation(opts) | Filter out nondebug macros when requested. | Filter out nondebug macros when requested. | [
"Filter",
"out",
"nondebug",
"macros",
"when",
"requested",
"."
] | def filter_debug_flags(opts, continuation=run_analyzer):
""" Filter out nondebug macros when requested. """
if opts.pop('force_debug'):
# lazy implementation just append an undefine macro at the end
opts.update({'flags': opts['flags'] + ['-UNDEBUG']})
return continuation(opts) | [
"def",
"filter_debug_flags",
"(",
"opts",
",",
"continuation",
"=",
"run_analyzer",
")",
":",
"if",
"opts",
".",
"pop",
"(",
"'force_debug'",
")",
":",
"# lazy implementation just append an undefine macro at the end",
"opts",
".",
"update",
"(",
"{",
"'flags'",
":",... | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/tools/scan-build-py/libscanbuild/analyze.py#L411-L418 | |
mickem/nscp | 79f89fdbb6da63f91bc9dedb7aea202fe938f237 | scripts/python/lib/google/protobuf/internal/cpp_message.py | python | CompositeProperty | (cdescriptor, message_type) | return property(Getter) | Returns a Python property the given composite field. | Returns a Python property the given composite field. | [
"Returns",
"a",
"Python",
"property",
"the",
"given",
"composite",
"field",
"."
] | def CompositeProperty(cdescriptor, message_type):
"""Returns a Python property the given composite field."""
def Getter(self):
sub_message = self._composite_fields.get(cdescriptor.name, None)
if sub_message is None:
cmessage = self._cmsg.NewSubMessage(cdescriptor)
sub_message = message_type._co... | [
"def",
"CompositeProperty",
"(",
"cdescriptor",
",",
"message_type",
")",
":",
"def",
"Getter",
"(",
"self",
")",
":",
"sub_message",
"=",
"self",
".",
"_composite_fields",
".",
"get",
"(",
"cdescriptor",
".",
"name",
",",
"None",
")",
"if",
"sub_message",
... | https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/internal/cpp_message.py#L88-L99 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configHandler.py | python | IdleConf.CurrentTheme | (self) | return self.GetOption('main','Theme','name',default='') | Returns the name of the currently active theme | Returns the name of the currently active theme | [
"Returns",
"the",
"name",
"of",
"the",
"currently",
"active",
"theme"
] | def CurrentTheme(self):
"""
Returns the name of the currently active theme
"""
return self.GetOption('main','Theme','name',default='') | [
"def",
"CurrentTheme",
"(",
"self",
")",
":",
"return",
"self",
".",
"GetOption",
"(",
"'main'",
",",
"'Theme'",
",",
"'name'",
",",
"default",
"=",
"''",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configHandler.py#L388-L392 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/operator/_abstract_operator.py | python | AbstractOperator.T | (self) | return self.transpose() | Returns the transposed operator | Returns the transposed operator | [
"Returns",
"the",
"transposed",
"operator"
] | def T(self) -> "AbstractOperator":
"""Returns the transposed operator"""
return self.transpose() | [
"def",
"T",
"(",
"self",
")",
"->",
"\"AbstractOperator\"",
":",
"return",
"self",
".",
"transpose",
"(",
")"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/operator/_abstract_operator.py#L62-L64 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/lib.py | python | parse_idl | (idl_path: str, import_directories: List[str]) | return parsed_doc | Parse an IDL file or throw an error. | Parse an IDL file or throw an error. | [
"Parse",
"an",
"IDL",
"file",
"or",
"throw",
"an",
"error",
"."
] | def parse_idl(idl_path: str, import_directories: List[str]) -> syntax.IDLParsedSpec:
"""Parse an IDL file or throw an error."""
parsed_doc = parser.parse(open(idl_path), idl_path, CompilerImportResolver(import_directories))
if parsed_doc.errors:
parsed_doc.errors.dump_errors()
raise ValueEr... | [
"def",
"parse_idl",
"(",
"idl_path",
":",
"str",
",",
"import_directories",
":",
"List",
"[",
"str",
"]",
")",
"->",
"syntax",
".",
"IDLParsedSpec",
":",
"parsed_doc",
"=",
"parser",
".",
"parse",
"(",
"open",
"(",
"idl_path",
")",
",",
"idl_path",
",",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/lib.py#L50-L58 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | screen.put_abs | (self, r, c, ch) | Screen array starts at 1 index. | Screen array starts at 1 index. | [
"Screen",
"array",
"starts",
"at",
"1",
"index",
"."
] | def put_abs (self, r, c, ch):
'''Screen array starts at 1 index.'''
r = constrain (r, 1, self.rows)
c = constrain (c, 1, self.cols)
if isinstance(ch, bytes):
ch = self._decode(ch)[0]
else:
ch = ch[0]
self.w[r-1][c-1] = ch | [
"def",
"put_abs",
"(",
"self",
",",
"r",
",",
"c",
",",
"ch",
")",
":",
"r",
"=",
"constrain",
"(",
"r",
",",
"1",
",",
"self",
".",
"rows",
")",
"c",
"=",
"constrain",
"(",
"c",
",",
"1",
",",
"self",
".",
"cols",
")",
"if",
"isinstance",
... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L200-L209 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/context.py | python | BaseContext.Value | (self, typecode_or_type, *args, lock=True) | return Value(typecode_or_type, *args, lock=lock,
ctx=self.get_context()) | Returns a synchronized shared object | Returns a synchronized shared object | [
"Returns",
"a",
"synchronized",
"shared",
"object"
] | def Value(self, typecode_or_type, *args, lock=True):
'''Returns a synchronized shared object'''
from .sharedctypes import Value
return Value(typecode_or_type, *args, lock=lock,
ctx=self.get_context()) | [
"def",
"Value",
"(",
"self",
",",
"typecode_or_type",
",",
"*",
"args",
",",
"lock",
"=",
"True",
")",
":",
"from",
".",
"sharedctypes",
"import",
"Value",
"return",
"Value",
"(",
"typecode_or_type",
",",
"*",
"args",
",",
"lock",
"=",
"lock",
",",
"ct... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/context.py#L131-L135 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py | python | ConfigDialog.ok | (self) | Apply config changes, then dismiss dialog.
Methods:
apply
destroy: inherited | Apply config changes, then dismiss dialog. | [
"Apply",
"config",
"changes",
"then",
"dismiss",
"dialog",
"."
] | def ok(self):
"""Apply config changes, then dismiss dialog.
Methods:
apply
destroy: inherited
"""
self.apply()
self.destroy() | [
"def",
"ok",
"(",
"self",
")",
":",
"self",
".",
"apply",
"(",
")",
"self",
".",
"destroy",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py#L167-L175 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/response.py | python | HTTPResponse.supports_chunked_reads | (self) | return hasattr(self._fp, 'fp') | Checks if the underlying file-like object looks like a
httplib.HTTPResponse object. We do this by testing for the fp
attribute. If it is present we assume it returns raw chunks as
processed by read_chunked(). | Checks if the underlying file-like object looks like a
httplib.HTTPResponse object. We do this by testing for the fp
attribute. If it is present we assume it returns raw chunks as
processed by read_chunked(). | [
"Checks",
"if",
"the",
"underlying",
"file",
"-",
"like",
"object",
"looks",
"like",
"a",
"httplib",
".",
"HTTPResponse",
"object",
".",
"We",
"do",
"this",
"by",
"testing",
"for",
"the",
"fp",
"attribute",
".",
"If",
"it",
"is",
"present",
"we",
"assume... | def supports_chunked_reads(self):
"""
Checks if the underlying file-like object looks like a
httplib.HTTPResponse object. We do this by testing for the fp
attribute. If it is present we assume it returns raw chunks as
processed by read_chunked().
"""
return hasatt... | [
"def",
"supports_chunked_reads",
"(",
"self",
")",
":",
"return",
"hasattr",
"(",
"self",
".",
"_fp",
",",
"'fp'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/response.py#L526-L533 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py | python | dictOf | ( key, value ) | return Dict( ZeroOrMore( Group ( key + value ) ) ) | Helper to easily and clearly define a dictionary by specifying the respective patterns
for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens
in the proper order. The key pattern can include delimiting markers or punctuation,
as long as they are suppressed, ... | Helper to easily and clearly define a dictionary by specifying the respective patterns
for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens
in the proper order. The key pattern can include delimiting markers or punctuation,
as long as they are suppressed, ... | [
"Helper",
"to",
"easily",
"and",
"clearly",
"define",
"a",
"dictionary",
"by",
"specifying",
"the",
"respective",
"patterns",
"for",
"the",
"key",
"and",
"value",
".",
"Takes",
"care",
"of",
"defining",
"the",
"C",
"{",
"L",
"{",
"Dict",
"}}",
"C",
"{",
... | def dictOf( key, value ):
"""
Helper to easily and clearly define a dictionary by specifying the respective patterns
for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens
in the proper order. The key pattern can include delimiting markers or punctuation... | [
"def",
"dictOf",
"(",
"key",
",",
"value",
")",
":",
"return",
"Dict",
"(",
"ZeroOrMore",
"(",
"Group",
"(",
"key",
"+",
"value",
")",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py#L4646-L4679 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py | python | Message.__init__ | (self, message=None) | Initialize a Message instance. | Initialize a Message instance. | [
"Initialize",
"a",
"Message",
"instance",
"."
] | def __init__(self, message=None):
"""Initialize a Message instance."""
if isinstance(message, email.message.Message):
self._become_message(copy.deepcopy(message))
if isinstance(message, Message):
message._explain_to(self)
elif isinstance(message, str):
... | [
"def",
"__init__",
"(",
"self",
",",
"message",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"message",
",",
"email",
".",
"message",
".",
"Message",
")",
":",
"self",
".",
"_become_message",
"(",
"copy",
".",
"deepcopy",
"(",
"message",
")",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L1442-L1455 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/logging/config.py | python | DictConfigurator.configure_handler | (self, config) | return result | Configure a handler from a dictionary. | Configure a handler from a dictionary. | [
"Configure",
"a",
"handler",
"from",
"a",
"dictionary",
"."
] | def configure_handler(self, config):
"""Configure a handler from a dictionary."""
formatter = config.pop('formatter', None)
if formatter:
try:
formatter = self.config['formatters'][formatter]
except StandardError, e:
raise ValueError('Unabl... | [
"def",
"configure_handler",
"(",
"self",
",",
"config",
")",
":",
"formatter",
"=",
"config",
".",
"pop",
"(",
"'formatter'",
",",
"None",
")",
"if",
"formatter",
":",
"try",
":",
"formatter",
"=",
"self",
".",
"config",
"[",
"'formatters'",
"]",
"[",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/logging/config.py#L702-L758 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | build_scripts/build_usd.py | python | GetCommandOutput | (command) | return None | Executes the specified command and returns output or None. | Executes the specified command and returns output or None. | [
"Executes",
"the",
"specified",
"command",
"and",
"returns",
"output",
"or",
"None",
"."
] | def GetCommandOutput(command):
"""Executes the specified command and returns output or None."""
try:
return subprocess.check_output(
shlex.split(command),
stderr=subprocess.STDOUT).decode(GetLocale(), 'replace').strip()
except subprocess.CalledProcessError:
pass
... | [
"def",
"GetCommandOutput",
"(",
"command",
")",
":",
"try",
":",
"return",
"subprocess",
".",
"check_output",
"(",
"shlex",
".",
"split",
"(",
"command",
")",
",",
"stderr",
"=",
"subprocess",
".",
"STDOUT",
")",
".",
"decode",
"(",
"GetLocale",
"(",
")"... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/build_scripts/build_usd.py#L100-L108 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pgen2/driver.py | python | load_packaged_grammar | (package, grammar_source) | return g | Normally, loads a pickled grammar by doing
pkgutil.get_data(package, pickled_grammar)
where *pickled_grammar* is computed from *grammar_source* by adding the
Python version and using a ``.pickle`` extension.
However, if *grammar_source* is an extant file, load_grammar(grammar_source)
is called ... | Normally, loads a pickled grammar by doing
pkgutil.get_data(package, pickled_grammar)
where *pickled_grammar* is computed from *grammar_source* by adding the
Python version and using a ``.pickle`` extension. | [
"Normally",
"loads",
"a",
"pickled",
"grammar",
"by",
"doing",
"pkgutil",
".",
"get_data",
"(",
"package",
"pickled_grammar",
")",
"where",
"*",
"pickled_grammar",
"*",
"is",
"computed",
"from",
"*",
"grammar_source",
"*",
"by",
"adding",
"the",
"Python",
"ver... | def load_packaged_grammar(package, grammar_source):
"""Normally, loads a pickled grammar by doing
pkgutil.get_data(package, pickled_grammar)
where *pickled_grammar* is computed from *grammar_source* by adding the
Python version and using a ``.pickle`` extension.
However, if *grammar_source* is ... | [
"def",
"load_packaged_grammar",
"(",
"package",
",",
"grammar_source",
")",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"grammar_source",
")",
":",
"return",
"load_grammar",
"(",
"grammar_source",
")",
"pickled_name",
"=",
"_generate_pickle_name",
"(",
"os... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pgen2/driver.py#L144-L161 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/parser.py | python | _opcode | (name) | return dis.opmap[name] | Return the opcode by name from the dis module. | Return the opcode by name from the dis module. | [
"Return",
"the",
"opcode",
"by",
"name",
"from",
"the",
"dis",
"module",
"."
] | def _opcode(name):
"""Return the opcode by name from the dis module."""
return dis.opmap[name] | [
"def",
"_opcode",
"(",
"name",
")",
":",
"return",
"dis",
".",
"opmap",
"[",
"name",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/parser.py#L276-L278 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | ppapi/generators/idl_gen_wrapper.py | python | WrapperGen.DeclareWrapperInfos | (self, iface_releases, out) | The wrapper methods usually need access to the real_iface, so we must
declare these wrapper infos ahead of time (there is a circular dependency). | The wrapper methods usually need access to the real_iface, so we must
declare these wrapper infos ahead of time (there is a circular dependency). | [
"The",
"wrapper",
"methods",
"usually",
"need",
"access",
"to",
"the",
"real_iface",
"so",
"we",
"must",
"declare",
"these",
"wrapper",
"infos",
"ahead",
"of",
"time",
"(",
"there",
"is",
"a",
"circular",
"dependency",
")",
"."
] | def DeclareWrapperInfos(self, iface_releases, out):
"""The wrapper methods usually need access to the real_iface, so we must
declare these wrapper infos ahead of time (there is a circular dependency).
"""
out.Write('/* BEGIN Declarations for all Wrapper Infos */\n\n')
for iface in iface_releases:
... | [
"def",
"DeclareWrapperInfos",
"(",
"self",
",",
"iface_releases",
",",
"out",
")",
":",
"out",
".",
"Write",
"(",
"'/* BEGIN Declarations for all Wrapper Infos */\\n\\n'",
")",
"for",
"iface",
"in",
"iface_releases",
":",
"out",
".",
"Write",
"(",
"'static struct %s... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/ppapi/generators/idl_gen_wrapper.py#L402-L410 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/plugins/prt/wxgui.py | python | AddPrtCompressorTool.deactivate | (self) | This call by metacanvas signals that the tool has been
deactivated and can now interact with metacanvas. | This call by metacanvas signals that the tool has been
deactivated and can now interact with metacanvas. | [
"This",
"call",
"by",
"metacanvas",
"signals",
"that",
"the",
"tool",
"has",
"been",
"deactivated",
"and",
"can",
"now",
"interact",
"with",
"metacanvas",
"."
] | def deactivate(self):
"""
This call by metacanvas signals that the tool has been
deactivated and can now interact with metacanvas.
"""
self._is_active = False
# self.unhighlight()
# reset lane visibility
if self._is_lane_visible_before is not None:
... | [
"def",
"deactivate",
"(",
"self",
")",
":",
"self",
".",
"_is_active",
"=",
"False",
"# self.unhighlight()",
"# reset lane visibility",
"if",
"self",
".",
"_is_lane_visible_before",
"is",
"not",
"None",
":",
"lanedraws",
"=",
"self",
".",
"get_drawobj_by_ident",
"... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/prt/wxgui.py#L112-L128 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/mesa/MesaLib/src/mesa/main/APIspec.py | python | Function.param_node_size | (self, param) | return size | Return the size of a vector. | Return the size of a vector. | [
"Return",
"the",
"size",
"of",
"a",
"vector",
"."
] | def param_node_size(self, param):
"""Return the size of a vector."""
if param.name != "vector":
return 0
size = param.prop("size")
if size.isdigit():
size = int(size)
else:
size = 0
if not size:
size = self._vector_size
... | [
"def",
"param_node_size",
"(",
"self",
",",
"param",
")",
":",
"if",
"param",
".",
"name",
"!=",
"\"vector\"",
":",
"return",
"0",
"size",
"=",
"param",
".",
"prop",
"(",
"\"size\"",
")",
"if",
"size",
".",
"isdigit",
"(",
")",
":",
"size",
"=",
"i... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/mesa/main/APIspec.py#L243-L258 | |
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/pycocotools/cocoeval.py | python | COCOeval._prepare | (self) | Prepare ._gts and ._dts for evaluation based on params
:return: None | Prepare ._gts and ._dts for evaluation based on params
:return: None | [
"Prepare",
".",
"_gts",
"and",
".",
"_dts",
"for",
"evaluation",
"based",
"on",
"params",
":",
"return",
":",
"None"
] | def _prepare(self):
'''
Prepare ._gts and ._dts for evaluation based on params
:return: None
'''
#
def _toMask(objs, coco):
# modify segmentation by reference
for obj in objs:
t = coco.imgs[obj['image_id']]
if type(o... | [
"def",
"_prepare",
"(",
"self",
")",
":",
"#",
"def",
"_toMask",
"(",
"objs",
",",
"coco",
")",
":",
"# modify segmentation by reference",
"for",
"obj",
"in",
"objs",
":",
"t",
"=",
"coco",
".",
"imgs",
"[",
"obj",
"[",
"'image_id'",
"]",
"]",
"if",
... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/pycocotools/cocoeval.py#L82-L127 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetCflagsCC | (self, configname) | return cflags_cc | Returns flags that need to be added to .cc, and .mm compilations. | Returns flags that need to be added to .cc, and .mm compilations. | [
"Returns",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
".",
"cc",
"and",
".",
"mm",
"compilations",
"."
] | def GetCflagsCC(self, configname):
"""Returns flags that need to be added to .cc, and .mm compilations."""
self.configname = configname
cflags_cc = []
if self._Test('GCC_ENABLE_CPP_RTTI', 'NO', default='YES'):
cflags_cc.append('-fno-rtti')
if self._Test('GCC_ENABLE_CPP_EXCEPTIONS', 'NO', defau... | [
"def",
"GetCflagsCC",
"(",
"self",
",",
"configname",
")",
":",
"self",
".",
"configname",
"=",
"configname",
"cflags_cc",
"=",
"[",
"]",
"if",
"self",
".",
"_Test",
"(",
"'GCC_ENABLE_CPP_RTTI'",
",",
"'NO'",
",",
"default",
"=",
"'YES'",
")",
":",
"cfla... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcode_emulation.py#L353-L381 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py | python | Context.Etiny | (self) | return int(self.Emin - self.prec + 1) | Returns Etiny (= Emin - prec + 1) | Returns Etiny (= Emin - prec + 1) | [
"Returns",
"Etiny",
"(",
"=",
"Emin",
"-",
"prec",
"+",
"1",
")"
] | def Etiny(self):
"""Returns Etiny (= Emin - prec + 1)"""
return int(self.Emin - self.prec + 1) | [
"def",
"Etiny",
"(",
"self",
")",
":",
"return",
"int",
"(",
"self",
".",
"Emin",
"-",
"self",
".",
"prec",
"+",
"1",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py#L3895-L3897 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/qemu.py | python | _setup_nfs_mount | (remote, client, service_name, mount_dir) | Sets up an nfs mount on the remote that the guest can use to
store logs. This nfs mount is also used to touch a file
at the end of the test to indicate if the test was successful
or not. | Sets up an nfs mount on the remote that the guest can use to
store logs. This nfs mount is also used to touch a file
at the end of the test to indicate if the test was successful
or not. | [
"Sets",
"up",
"an",
"nfs",
"mount",
"on",
"the",
"remote",
"that",
"the",
"guest",
"can",
"use",
"to",
"store",
"logs",
".",
"This",
"nfs",
"mount",
"is",
"also",
"used",
"to",
"touch",
"a",
"file",
"at",
"the",
"end",
"of",
"the",
"test",
"to",
"i... | def _setup_nfs_mount(remote, client, service_name, mount_dir):
"""
Sets up an nfs mount on the remote that the guest can use to
store logs. This nfs mount is also used to touch a file
at the end of the test to indicate if the test was successful
or not.
"""
export_dir = "/export/{client}".fo... | [
"def",
"_setup_nfs_mount",
"(",
"remote",
",",
"client",
",",
"service_name",
",",
"mount_dir",
")",
":",
"export_dir",
"=",
"\"/export/{client}\"",
".",
"format",
"(",
"client",
"=",
"client",
")",
"log",
".",
"info",
"(",
"\"Creating the nfs export directory...\... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/qemu.py#L369-L402 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/Bastion.py | python | BastionClass.__getattr__ | (self, name) | return attribute | Get an as-yet undefined attribute value.
This calls the get() function that was passed to the
constructor. The result is stored as an instance variable so
that the next time the same attribute is requested,
__getattr__() won't be invoked.
If the get() function raises an except... | Get an as-yet undefined attribute value. | [
"Get",
"an",
"as",
"-",
"yet",
"undefined",
"attribute",
"value",
"."
] | def __getattr__(self, name):
"""Get an as-yet undefined attribute value.
This calls the get() function that was passed to the
constructor. The result is stored as an instance variable so
that the next time the same attribute is requested,
__getattr__() won't be invoked.
... | [
"def",
"__getattr__",
"(",
"self",
",",
"name",
")",
":",
"attribute",
"=",
"self",
".",
"_get_",
"(",
"name",
")",
"self",
".",
"__dict__",
"[",
"name",
"]",
"=",
"attribute",
"return",
"attribute"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/Bastion.py#L70-L84 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/findertools.py | python | _seticon | (object_alias, icondata) | set the icondata for object, formatted as produced by _geticon() | set the icondata for object, formatted as produced by _geticon() | [
"set",
"the",
"icondata",
"for",
"object",
"formatted",
"as",
"produced",
"by",
"_geticon",
"()"
] | def _seticon(object_alias, icondata):
"""set the icondata for object, formatted as produced by _geticon()"""
finder = _getfinder()
args = {}
attrs = {}
aeobj_00 = aetypes.ObjectSpecifier(want=aetypes.Type('cobj'),
form="alis", seld=object_alias, fr=None)
aeobj_01 = aetypes.ObjectSpec... | [
"def",
"_seticon",
"(",
"object_alias",
",",
"icondata",
")",
":",
"finder",
"=",
"_getfinder",
"(",
")",
"args",
"=",
"{",
"}",
"attrs",
"=",
"{",
"}",
"aeobj_00",
"=",
"aetypes",
".",
"ObjectSpecifier",
"(",
"want",
"=",
"aetypes",
".",
"Type",
"(",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/findertools.py#L560-L575 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/legendre.py | python | legline | (off, scl) | Legendre series whose graph is a straight line.
Parameters
----------
off, scl : scalars
The specified line is given by ``off + scl*x``.
Returns
-------
y : ndarray
This module's representation of the Legendre series for
``off + scl*x``.
See Also
--------
... | Legendre series whose graph is a straight line. | [
"Legendre",
"series",
"whose",
"graph",
"is",
"a",
"straight",
"line",
"."
] | def legline(off, scl):
"""
Legendre series whose graph is a straight line.
Parameters
----------
off, scl : scalars
The specified line is given by ``off + scl*x``.
Returns
-------
y : ndarray
This module's representation of the Legendre series for
``off + scl*... | [
"def",
"legline",
"(",
"off",
",",
"scl",
")",
":",
"if",
"scl",
"!=",
"0",
":",
"return",
"np",
".",
"array",
"(",
"[",
"off",
",",
"scl",
"]",
")",
"else",
":",
"return",
"np",
".",
"array",
"(",
"[",
"off",
"]",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/legendre.py#L232-L265 | ||
SmartisanTech/Wrench | 27f3c17692910997bba3a3c9fd88c8717497aac6 | extra-cmake-modules/usr/share/ECM/find-modules/rules_engine.py | python | RuleSet.function_rules | (self) | Return a compiled list of rules for functions.
:return: A FunctionRuleDb instance | Return a compiled list of rules for functions. | [
"Return",
"a",
"compiled",
"list",
"of",
"rules",
"for",
"functions",
"."
] | def function_rules(self):
"""
Return a compiled list of rules for functions.
:return: A FunctionRuleDb instance
"""
raise NotImplemented(_("Missing subclass implementation")) | [
"def",
"function_rules",
"(",
"self",
")",
":",
"raise",
"NotImplemented",
"(",
"_",
"(",
"\"Missing subclass implementation\"",
")",
")"
] | https://github.com/SmartisanTech/Wrench/blob/27f3c17692910997bba3a3c9fd88c8717497aac6/extra-cmake-modules/usr/share/ECM/find-modules/rules_engine.py#L449-L455 | ||
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/seqan/dox/write_html.py | python | TemplateManager.loadTemplate | (self, path) | Load template string at path. | Load template string at path. | [
"Load",
"template",
"string",
"at",
"path",
"."
] | def loadTemplate(self, path):
"""Load template string at path."""
self.tpls[path] = self.env.get_template(path) | [
"def",
"loadTemplate",
"(",
"self",
",",
"path",
")",
":",
"self",
".",
"tpls",
"[",
"path",
"]",
"=",
"self",
".",
"env",
".",
"get_template",
"(",
"path",
")"
] | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/dox/write_html.py#L215-L217 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/req/req_set.py | python | RequirementSet._to_install | (self) | return order | Create the installation order.
The installation order is topological - requirements are installed
before the requiring thing. We break cycles at an arbitrary point,
and make no other guarantees. | Create the installation order. | [
"Create",
"the",
"installation",
"order",
"."
] | def _to_install(self):
"""Create the installation order.
The installation order is topological - requirements are installed
before the requiring thing. We break cycles at an arbitrary point,
and make no other guarantees.
"""
# The current implementation, which we may cha... | [
"def",
"_to_install",
"(",
"self",
")",
":",
"# The current implementation, which we may change at any point",
"# installs the user specified things in the order given, except when",
"# dependencies must come earlier to achieve topological order.",
"order",
"=",
"[",
"]",
"ordered_reqs",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/req/req_set.py#L571-L593 | |
Alexhuszagh/rust-lexical | 01fcdcf8efc8850edb35d8fc65fd5f31bd0981a0 | scripts/timings.py | python | clean | (directory=home) | Clean the project | Clean the project | [
"Clean",
"the",
"project"
] | def clean(directory=home):
'''Clean the project'''
os.chdir(directory)
subprocess.check_call(
['cargo', '+nightly', 'clean'],
shell=False,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
) | [
"def",
"clean",
"(",
"directory",
"=",
"home",
")",
":",
"os",
".",
"chdir",
"(",
"directory",
")",
"subprocess",
".",
"check_call",
"(",
"[",
"'cargo'",
",",
"'+nightly'",
",",
"'clean'",
"]",
",",
"shell",
"=",
"False",
",",
"stdout",
"=",
"subproces... | https://github.com/Alexhuszagh/rust-lexical/blob/01fcdcf8efc8850edb35d8fc65fd5f31bd0981a0/scripts/timings.py#L44-L53 | ||
sideeffects/HoudiniEngineForUnreal | a52be617d90495bda6072fe732f0d2eec33b54f3 | Content/Python/HoudiniEngineV2/asyncprocessor.py | python | ProcessHDA._handle_on_pre_process | (self, wrapper) | Called during pre_process. Calls self.on_pre_process(). | Called during pre_process. Calls self.on_pre_process(). | [
"Called",
"during",
"pre_process",
".",
"Calls",
"self",
".",
"on_pre_process",
"()",
"."
] | def _handle_on_pre_process(self, wrapper):
""" Called during pre_process. Calls self.on_pre_process().
"""
if not self._check_wrapper(wrapper):
return
self.on_pre_process() | [
"def",
"_handle_on_pre_process",
"(",
"self",
",",
"wrapper",
")",
":",
"if",
"not",
"self",
".",
"_check_wrapper",
"(",
"wrapper",
")",
":",
"return",
"self",
".",
"on_pre_process",
"(",
")"
] | https://github.com/sideeffects/HoudiniEngineForUnreal/blob/a52be617d90495bda6072fe732f0d2eec33b54f3/Content/Python/HoudiniEngineV2/asyncprocessor.py#L419-L426 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Text.window_cget | (self, index, option) | return self.tk.call(self._w, 'window', 'cget', index, option) | Return the value of OPTION of an embedded window at INDEX. | Return the value of OPTION of an embedded window at INDEX. | [
"Return",
"the",
"value",
"of",
"OPTION",
"of",
"an",
"embedded",
"window",
"at",
"INDEX",
"."
] | def window_cget(self, index, option):
"""Return the value of OPTION of an embedded window at INDEX."""
if option[:1] != '-':
option = '-' + option
if option[-1:] == '_':
option = option[:-1]
return self.tk.call(self._w, 'window', 'cget', index, option) | [
"def",
"window_cget",
"(",
"self",
",",
"index",
",",
"option",
")",
":",
"if",
"option",
"[",
":",
"1",
"]",
"!=",
"'-'",
":",
"option",
"=",
"'-'",
"+",
"option",
"if",
"option",
"[",
"-",
"1",
":",
"]",
"==",
"'_'",
":",
"option",
"=",
"opti... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3166-L3172 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/mock/mock.py | python | _patch.start | (self) | return result | Activate a patch, returning any created mock. | Activate a patch, returning any created mock. | [
"Activate",
"a",
"patch",
"returning",
"any",
"created",
"mock",
"."
] | def start(self):
"""Activate a patch, returning any created mock."""
result = self.__enter__()
self._active_patches.add(self)
return result | [
"def",
"start",
"(",
"self",
")",
":",
"result",
"=",
"self",
".",
"__enter__",
"(",
")",
"self",
".",
"_active_patches",
".",
"add",
"(",
"self",
")",
"return",
"result"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/mock/mock.py#L1394-L1398 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/memory_inspector/memory_inspector/core/backends.py | python | Process.Freeze | (self) | Stops the process and all its threads. | Stops the process and all its threads. | [
"Stops",
"the",
"process",
"and",
"all",
"its",
"threads",
"."
] | def Freeze(self):
"""Stops the process and all its threads."""
raise NotImplementedError() | [
"def",
"Freeze",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/memory_inspector/memory_inspector/core/backends.py#L137-L139 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | TextCtrl.IsMultiLine | (*args, **kwargs) | return _controls_.TextCtrl_IsMultiLine(*args, **kwargs) | IsMultiLine(self) -> bool | IsMultiLine(self) -> bool | [
"IsMultiLine",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsMultiLine(*args, **kwargs):
"""IsMultiLine(self) -> bool"""
return _controls_.TextCtrl_IsMultiLine(*args, **kwargs) | [
"def",
"IsMultiLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextCtrl_IsMultiLine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2035-L2037 | |
ComputationalRadiationPhysics/picongpu | 59e9b53605f9a5c1bf271eeb055bc74370a99052 | lib/python/picongpu/plugins/plot_mpl/transition_radiation_visualizer.py | python | Visualizer.visualize | (self, **kwargs) | Creates a plot on the provided axes object for
the data of the given iteration using matpotlib.
Parameters
----------
kwargs: dictionary with further keyword arguments, valid are:
species: string
short name of the particle species, e.g. 'e' for electrons
... | Creates a plot on the provided axes object for
the data of the given iteration using matpotlib. | [
"Creates",
"a",
"plot",
"on",
"the",
"provided",
"axes",
"object",
"for",
"the",
"data",
"of",
"the",
"given",
"iteration",
"using",
"matpotlib",
"."
] | def visualize(self, **kwargs):
"""
Creates a plot on the provided axes object for
the data of the given iteration using matpotlib.
Parameters
----------
kwargs: dictionary with further keyword arguments, valid are:
species: string
short name o... | [
"def",
"visualize",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"type",
"=",
"kwargs",
"[",
"\"type\"",
"]",
"super",
"(",
")",
".",
"visualize",
"(",
"*",
"*",
"kwargs",
")"
] | https://github.com/ComputationalRadiationPhysics/picongpu/blob/59e9b53605f9a5c1bf271eeb055bc74370a99052/lib/python/picongpu/plugins/plot_mpl/transition_radiation_visualizer.py#L68-L104 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/email/message.py | python | Message.get_content_type | (self) | return ctype | Return the message's content type.
The returned string is coerced to lower case of the form
`maintype/subtype'. If there was no Content-Type header in the
message, the default type as given by get_default_type() will be
returned. Since according to RFC 2045, messages always have a def... | Return the message's content type. | [
"Return",
"the",
"message",
"s",
"content",
"type",
"."
] | def get_content_type(self):
"""Return the message's content type.
The returned string is coerced to lower case of the form
`maintype/subtype'. If there was no Content-Type header in the
message, the default type as given by get_default_type() will be
returned. Since according ... | [
"def",
"get_content_type",
"(",
"self",
")",
":",
"missing",
"=",
"object",
"(",
")",
"value",
"=",
"self",
".",
"get",
"(",
"'content-type'",
",",
"missing",
")",
"if",
"value",
"is",
"missing",
":",
"# This should have no parameters",
"return",
"self",
"."... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/email/message.py#L425-L447 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | deprecated/algorithms/sfm/OpenSfM/opensfm/matching.py | python | _convert_matches_to_vector | (matches) | return matches_vector | Convert Dmatch object to matrix form. | Convert Dmatch object to matrix form. | [
"Convert",
"Dmatch",
"object",
"to",
"matrix",
"form",
"."
] | def _convert_matches_to_vector(matches):
"""Convert Dmatch object to matrix form."""
matches_vector = np.zeros((len(matches), 2), dtype=np.int)
k = 0
for mm in matches:
matches_vector[k, 0] = mm.queryIdx
matches_vector[k, 1] = mm.trainIdx
k = k+1
return matches_vector | [
"def",
"_convert_matches_to_vector",
"(",
"matches",
")",
":",
"matches_vector",
"=",
"np",
".",
"zeros",
"(",
"(",
"len",
"(",
"matches",
")",
",",
"2",
")",
",",
"dtype",
"=",
"np",
".",
"int",
")",
"k",
"=",
"0",
"for",
"mm",
"in",
"matches",
":... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/matching.py#L51-L59 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchIFC.py | python | IfcContext.getIfcSchema | (self) | return ArchIFCSchema.IfcContexts | Get the IFC schema of all IFC types that inherit from IfcContexts.
Returns
-------
dict
The schema of all the types relevant to this class. | Get the IFC schema of all IFC types that inherit from IfcContexts. | [
"Get",
"the",
"IFC",
"schema",
"of",
"all",
"IFC",
"types",
"that",
"inherit",
"from",
"IfcContexts",
"."
] | def getIfcSchema(self):
"""Get the IFC schema of all IFC types that inherit from IfcContexts.
Returns
-------
dict
The schema of all the types relevant to this class.
"""
return ArchIFCSchema.IfcContexts | [
"def",
"getIfcSchema",
"(",
"self",
")",
":",
"return",
"ArchIFCSchema",
".",
"IfcContexts"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchIFC.py#L480-L488 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | StaticBitmap.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, int id=-1, Bitmap bitmap=wxNullBitmap,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=StaticBitmapNameStr) -> StaticBitmap | __init__(self, Window parent, int id=-1, Bitmap bitmap=wxNullBitmap,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=StaticBitmapNameStr) -> StaticBitmap | [
"__init__",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"Bitmap",
"bitmap",
"=",
"wxNullBitmap",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"0",
"String",
"name",
"=",
"StaticBitmapNameS... | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, Bitmap bitmap=wxNullBitmap,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=StaticBitmapNameStr) -> StaticBitmap
"""
_controls_.StaticBitmap_swiginit(s... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_controls_",
".",
"StaticBitmap_swiginit",
"(",
"self",
",",
"_controls_",
".",
"new_StaticBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L1071-L1078 | ||
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | python-threatexchange/threatexchange/cli/command_base.py | python | Command.get_help | (cls) | return line | The short help of the command | The short help of the command | [
"The",
"short",
"help",
"of",
"the",
"command"
] | def get_help(cls) -> str:
"""The short help of the command"""
line = cls.get_description().strip().partition("\n")[0]
# Good luck debugging this! Slightly reformat short description
# (toplevel --help)
if line[0].isupper():
first_word, sp, rem = line.partition(" ")
... | [
"def",
"get_help",
"(",
"cls",
")",
"->",
"str",
":",
"line",
"=",
"cls",
".",
"get_description",
"(",
")",
".",
"strip",
"(",
")",
".",
"partition",
"(",
"\"\\n\"",
")",
"[",
"0",
"]",
"# Good luck debugging this! Slightly reformat short description",
"# (top... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/python-threatexchange/threatexchange/cli/command_base.py#L72-L82 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py | python | ParserElement.ignore | ( self, other ) | return self | Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or other
ignorable patterns.
Example::
patt = OneOrMore(Word(alphas))
patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
... | Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or other
ignorable patterns.
Example::
patt = OneOrMore(Word(alphas))
patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
... | [
"Define",
"expression",
"to",
"be",
"ignored",
"(",
"e",
".",
"g",
".",
"comments",
")",
"while",
"doing",
"pattern",
"matching",
";",
"may",
"be",
"called",
"repeatedly",
"to",
"define",
"multiple",
"comment",
"or",
"other",
"ignorable",
"patterns",
".",
... | def ignore( self, other ):
"""
Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or other
ignorable patterns.
Example::
patt = OneOrMore(Word(alphas))
patt.parseStri... | [
"def",
"ignore",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"Suppress",
"(",
"other",
")",
"if",
"isinstance",
"(",
"other",
",",
"Suppress",
")",
":",
"if",
"other",
"not",
"in",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L2079-L2100 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/tools/scan-build-py/libscanbuild/analyze.py | python | prefix_with | (constant, pieces) | return [elem for piece in pieces for elem in [constant, piece]] | From a sequence create another sequence where every second element
is from the original sequence and the odd elements are the prefix.
eg.: prefix_with(0, [1,2,3]) creates [0, 1, 0, 2, 0, 3] | From a sequence create another sequence where every second element
is from the original sequence and the odd elements are the prefix. | [
"From",
"a",
"sequence",
"create",
"another",
"sequence",
"where",
"every",
"second",
"element",
"is",
"from",
"the",
"original",
"sequence",
"and",
"the",
"odd",
"elements",
"are",
"the",
"prefix",
"."
] | def prefix_with(constant, pieces):
""" From a sequence create another sequence where every second element
is from the original sequence and the odd elements are the prefix.
eg.: prefix_with(0, [1,2,3]) creates [0, 1, 0, 2, 0, 3] """
return [elem for piece in pieces for elem in [constant, piece]] | [
"def",
"prefix_with",
"(",
"constant",
",",
"pieces",
")",
":",
"return",
"[",
"elem",
"for",
"piece",
"in",
"pieces",
"for",
"elem",
"in",
"[",
"constant",
",",
"piece",
"]",
"]"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/tools/scan-build-py/libscanbuild/analyze.py#L103-L109 | |
clementine-player/Clementine | 111379dfd027802b59125829fcf87e3e1d0ad73b | dist/cpplint.py | python | FileInfo.FullName | (self) | return os.path.abspath(self._filename).replace('\\', '/') | Make Windows paths like Unix. | Make Windows paths like Unix. | [
"Make",
"Windows",
"paths",
"like",
"Unix",
"."
] | def FullName(self):
"""Make Windows paths like Unix."""
return os.path.abspath(self._filename).replace('\\', '/') | [
"def",
"FullName",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"self",
".",
"_filename",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/'",
")"
] | https://github.com/clementine-player/Clementine/blob/111379dfd027802b59125829fcf87e3e1d0ad73b/dist/cpplint.py#L978-L980 | |
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | Function.WriteDestinationInitalizationValidation | (self, f) | Writes the client side destintion initialization validation. | Writes the client side destintion initialization validation. | [
"Writes",
"the",
"client",
"side",
"destintion",
"initialization",
"validation",
"."
] | def WriteDestinationInitalizationValidation(self, f):
"""Writes the client side destintion initialization validation."""
self.type_handler.WriteDestinationInitalizationValidation(self, f) | [
"def",
"WriteDestinationInitalizationValidation",
"(",
"self",
",",
"f",
")",
":",
"self",
".",
"type_handler",
".",
"WriteDestinationInitalizationValidation",
"(",
"self",
",",
"f",
")"
] | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L9667-L9669 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/symbol/numpy/_symbol.py | python | greater_equal | (x1, x2, out=None) | return _ufunc_helper(x1, x2, _npi.greater_equal, _np.greater_equal, _npi.greater_equal_scalar,
_npi.less_equal_scalar, out) | Return the truth value of (x1 >= x2) element-wise.
Parameters
----------
x1, x2 : _Symbol or scalars
Input arrays. If ``x1.shape != x2.shape``, they must be broadcastable to
a common shape (which becomes the shape of the output).
out : Dummy parameter, optional
A location into wh... | Return the truth value of (x1 >= x2) element-wise.
Parameters
----------
x1, x2 : _Symbol or scalars
Input arrays. If ``x1.shape != x2.shape``, they must be broadcastable to
a common shape (which becomes the shape of the output).
out : Dummy parameter, optional
A location into wh... | [
"Return",
"the",
"truth",
"value",
"of",
"(",
"x1",
">",
"=",
"x2",
")",
"element",
"-",
"wise",
".",
"Parameters",
"----------",
"x1",
"x2",
":",
"_Symbol",
"or",
"scalars",
"Input",
"arrays",
".",
"If",
"x1",
".",
"shape",
"!",
"=",
"x2",
".",
"s... | def greater_equal(x1, x2, out=None):
"""
Return the truth value of (x1 >= x2) element-wise.
Parameters
----------
x1, x2 : _Symbol or scalars
Input arrays. If ``x1.shape != x2.shape``, they must be broadcastable to
a common shape (which becomes the shape of the output).
out : Dum... | [
"def",
"greater_equal",
"(",
"x1",
",",
"x2",
",",
"out",
"=",
"None",
")",
":",
"return",
"_ufunc_helper",
"(",
"x1",
",",
"x2",
",",
"_npi",
".",
"greater_equal",
",",
"_np",
".",
"greater_equal",
",",
"_npi",
".",
"greater_equal_scalar",
",",
"_npi",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L6470-L6499 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xpathParserContext.xpathNextParent | (self, cur) | return __tmp | Traversal function for the "parent" direction The parent
axis contains the parent of the context node, if there is
one. | Traversal function for the "parent" direction The parent
axis contains the parent of the context node, if there is
one. | [
"Traversal",
"function",
"for",
"the",
"parent",
"direction",
"The",
"parent",
"axis",
"contains",
"the",
"parent",
"of",
"the",
"context",
"node",
"if",
"there",
"is",
"one",
"."
] | def xpathNextParent(self, cur):
"""Traversal function for the "parent" direction The parent
axis contains the parent of the context node, if there is
one. """
if cur is None: cur__o = None
else: cur__o = cur._o
ret = libxml2mod.xmlXPathNextParent(self._o, cur__o)
... | [
"def",
"xpathNextParent",
"(",
"self",
",",
"cur",
")",
":",
"if",
"cur",
"is",
"None",
":",
"cur__o",
"=",
"None",
"else",
":",
"cur__o",
"=",
"cur",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlXPathNextParent",
"(",
"self",
".",
"_o",
",",
"cur__... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L7708-L7717 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.IndicatorStart | (*args, **kwargs) | return _stc.StyledTextCtrl_IndicatorStart(*args, **kwargs) | IndicatorStart(self, int indicator, int position) -> int
Where does a particular indicator start? | IndicatorStart(self, int indicator, int position) -> int | [
"IndicatorStart",
"(",
"self",
"int",
"indicator",
"int",
"position",
")",
"-",
">",
"int"
] | def IndicatorStart(*args, **kwargs):
"""
IndicatorStart(self, int indicator, int position) -> int
Where does a particular indicator start?
"""
return _stc.StyledTextCtrl_IndicatorStart(*args, **kwargs) | [
"def",
"IndicatorStart",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_IndicatorStart",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5711-L5717 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/input/euphonicloader.py | python | EuphonicLoader.read_vibrational_or_phonon_data | (self) | return self._rearrange_data(data=file_data) | Get AbinsData (structure and modes) from force constants data.
Frequencies/displacements are interpolated using the Euphonic library
over a regular q-point mesh. The mesh is determined by a Moreno-Soler
realspace cutoff, related to the size of an equivalent
supercell. Meshes are rounded... | Get AbinsData (structure and modes) from force constants data. | [
"Get",
"AbinsData",
"(",
"structure",
"and",
"modes",
")",
"from",
"force",
"constants",
"data",
"."
] | def read_vibrational_or_phonon_data(self):
"""Get AbinsData (structure and modes) from force constants data.
Frequencies/displacements are interpolated using the Euphonic library
over a regular q-point mesh. The mesh is determined by a Moreno-Soler
realspace cutoff, related to the size ... | [
"def",
"read_vibrational_or_phonon_data",
"(",
"self",
")",
":",
"if",
"not",
"euphonic_available",
"(",
")",
":",
"raise",
"ImportError",
"(",
"\"Could not import Euphonic library; this is \"",
"\"required to import force constants from Phonopy or .castep_bin.\"",
")",
"cutoff",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/input/euphonicloader.py#L32-L71 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Entry.__init__ | (self, master=None, cnf={}, **kw) | Construct an entry widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, highlightbackground,
highlightcolor, highlightthickness, insertbackground,
insertborderwidth, insertofftime, insertontime, insertwidth,... | Construct an entry widget with the parent MASTER. | [
"Construct",
"an",
"entry",
"widget",
"with",
"the",
"parent",
"MASTER",
"."
] | def __init__(self, master=None, cnf={}, **kw):
"""Construct an entry widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, highlightbackground,
highlightcolor, highlightthickness, insertbackground,
in... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"'entry'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2436-L2447 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_tstutils.py | python | aps11_f | (x, n) | return (n * x - 1) / ((n - 1) * x) | r"""Rational function with a zero at x=1/n and a pole at x=0 | r"""Rational function with a zero at x=1/n and a pole at x=0 | [
"r",
"Rational",
"function",
"with",
"a",
"zero",
"at",
"x",
"=",
"1",
"/",
"n",
"and",
"a",
"pole",
"at",
"x",
"=",
"0"
] | def aps11_f(x, n):
r"""Rational function with a zero at x=1/n and a pole at x=0"""
return (n * x - 1) / ((n - 1) * x) | [
"def",
"aps11_f",
"(",
"x",
",",
"n",
")",
":",
"return",
"(",
"n",
"*",
"x",
"-",
"1",
")",
"/",
"(",
"(",
"n",
"-",
"1",
")",
"*",
"x",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_tstutils.py#L294-L296 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/engine/training_arrays.py | python | _get_num_samples_or_steps | (ins, batch_size, steps_per_epoch) | return training_utils.check_num_samples(ins, batch_size, steps_per_epoch,
'steps_per_epoch') | Returns total number of samples (when training in batch mode) or steps. | Returns total number of samples (when training in batch mode) or steps. | [
"Returns",
"total",
"number",
"of",
"samples",
"(",
"when",
"training",
"in",
"batch",
"mode",
")",
"or",
"steps",
"."
] | def _get_num_samples_or_steps(ins, batch_size, steps_per_epoch):
"""Returns total number of samples (when training in batch mode) or steps."""
if steps_per_epoch:
return steps_per_epoch
return training_utils.check_num_samples(ins, batch_size, steps_per_epoch,
'steps_p... | [
"def",
"_get_num_samples_or_steps",
"(",
"ins",
",",
"batch_size",
",",
"steps_per_epoch",
")",
":",
"if",
"steps_per_epoch",
":",
"return",
"steps_per_epoch",
"return",
"training_utils",
".",
"check_num_samples",
"(",
"ins",
",",
"batch_size",
",",
"steps_per_epoch",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/engine/training_arrays.py#L489-L494 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/cookies.py | python | RequestsCookieJar.iteritems | (self) | Dict-like iteritems() that returns an iterator of name-value tuples
from the jar.
.. seealso:: iterkeys() and itervalues(). | Dict-like iteritems() that returns an iterator of name-value tuples
from the jar. | [
"Dict",
"-",
"like",
"iteritems",
"()",
"that",
"returns",
"an",
"iterator",
"of",
"name",
"-",
"value",
"tuples",
"from",
"the",
"jar",
"."
] | def iteritems(self):
"""Dict-like iteritems() that returns an iterator of name-value tuples
from the jar.
.. seealso:: iterkeys() and itervalues().
"""
for cookie in iter(self):
yield cookie.name, cookie.value | [
"def",
"iteritems",
"(",
"self",
")",
":",
"for",
"cookie",
"in",
"iter",
"(",
"self",
")",
":",
"yield",
"cookie",
".",
"name",
",",
"cookie",
".",
"value"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/cookies.py#L252-L259 | ||
facebookresearch/habitat-sim | 63b6c71d9ca8adaefb140b198196f5d0ca1f1e34 | src_python/habitat_sim/utils/common.py | python | angle_between_quats | (q1: qt.quaternion, q2: qt.quaternion) | return 2 * np.arctan2(np.linalg.norm(dq.imag), np.abs(dq.real)) | r"""Computes the angular distance between two quaternions
:return: The angular distance between q1 and q2 in radians | r"""Computes the angular distance between two quaternions | [
"r",
"Computes",
"the",
"angular",
"distance",
"between",
"two",
"quaternions"
] | def angle_between_quats(q1: qt.quaternion, q2: qt.quaternion) -> float:
r"""Computes the angular distance between two quaternions
:return: The angular distance between q1 and q2 in radians
"""
q1_inv = np.conjugate(q1)
dq = q1_inv * q2
return 2 * np.arctan2(np.linalg.norm(dq.imag), np.abs(dq.... | [
"def",
"angle_between_quats",
"(",
"q1",
":",
"qt",
".",
"quaternion",
",",
"q2",
":",
"qt",
".",
"quaternion",
")",
"->",
"float",
":",
"q1_inv",
"=",
"np",
".",
"conjugate",
"(",
"q1",
")",
"dq",
"=",
"q1_inv",
"*",
"q2",
"return",
"2",
"*",
"np"... | https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/src_python/habitat_sim/utils/common.py#L121-L130 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlDoc.newEntity | (self, name, type, ExternalID, SystemID, content) | return __tmp | Create a new entity, this differs from xmlAddDocEntity()
that if the document is None or has no internal subset
defined, then an unlinked entity structure will be
returned, it is then the responsability of the caller to
link it to the document later or free it when not needed
... | Create a new entity, this differs from xmlAddDocEntity()
that if the document is None or has no internal subset
defined, then an unlinked entity structure will be
returned, it is then the responsability of the caller to
link it to the document later or free it when not needed
... | [
"Create",
"a",
"new",
"entity",
"this",
"differs",
"from",
"xmlAddDocEntity",
"()",
"that",
"if",
"the",
"document",
"is",
"None",
"or",
"has",
"no",
"internal",
"subset",
"defined",
"then",
"an",
"unlinked",
"entity",
"structure",
"will",
"be",
"returned",
... | def newEntity(self, name, type, ExternalID, SystemID, content):
"""Create a new entity, this differs from xmlAddDocEntity()
that if the document is None or has no internal subset
defined, then an unlinked entity structure will be
returned, it is then the responsability of the calle... | [
"def",
"newEntity",
"(",
"self",
",",
"name",
",",
"type",
",",
"ExternalID",
",",
"SystemID",
",",
"content",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlNewEntity",
"(",
"self",
".",
"_o",
",",
"name",
",",
"type",
",",
"ExternalID",
",",
"SystemID"... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4154-L4164 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/xrc.py | python | XmlResource.ClearHandlers | (*args, **kwargs) | return _xrc.XmlResource_ClearHandlers(*args, **kwargs) | ClearHandlers(self) | ClearHandlers(self) | [
"ClearHandlers",
"(",
"self",
")"
] | def ClearHandlers(*args, **kwargs):
"""ClearHandlers(self)"""
return _xrc.XmlResource_ClearHandlers(*args, **kwargs) | [
"def",
"ClearHandlers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResource_ClearHandlers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L110-L112 | |
CleverRaven/Cataclysm-DDA | 03e7363df0835ec1b39da973ea29f26f27833b38 | tools/json_tools/util.py | python | ui_counts_to_columns | (counts) | Take a Counter instance and display in single fixed width key:value
column. | Take a Counter instance and display in single fixed width key:value
column. | [
"Take",
"a",
"Counter",
"instance",
"and",
"display",
"in",
"single",
"fixed",
"width",
"key",
":",
"value",
"column",
"."
] | def ui_counts_to_columns(counts):
"""Take a Counter instance and display in single fixed width key:value
column.
"""
# Values in left column, counts in right, left
# column as wide as longest string length.
key_vals = counts.most_common()
key_field_len = len(max(list(counts.keys()), key=len)... | [
"def",
"ui_counts_to_columns",
"(",
"counts",
")",
":",
"# Values in left column, counts in right, left",
"# column as wide as longest string length.",
"key_vals",
"=",
"counts",
".",
"most_common",
"(",
")",
"key_field_len",
"=",
"len",
"(",
"max",
"(",
"list",
"(",
"c... | https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/json_tools/util.py#L305-L315 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/procrouting/proc.py | python | run_fnodfcc | (name, **kwargs) | return fnocc_wfn | Function encoding sequence of PSI module calls for
a DF-CCSD(T) computation.
>>> set cc_type df
>>> energy('fno-ccsd(t)') | Function encoding sequence of PSI module calls for
a DF-CCSD(T) computation. | [
"Function",
"encoding",
"sequence",
"of",
"PSI",
"module",
"calls",
"for",
"a",
"DF",
"-",
"CCSD",
"(",
"T",
")",
"computation",
"."
] | def run_fnodfcc(name, **kwargs):
"""Function encoding sequence of PSI module calls for
a DF-CCSD(T) computation.
>>> set cc_type df
>>> energy('fno-ccsd(t)')
"""
kwargs = p4util.kwargs_lower(kwargs)
# stash user options
optstash = p4util.OptionsState(
['FNOCC', 'COMPUTE_TRIPLE... | [
"def",
"run_fnodfcc",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"p4util",
".",
"kwargs_lower",
"(",
"kwargs",
")",
"# stash user options",
"optstash",
"=",
"p4util",
".",
"OptionsState",
"(",
"[",
"'FNOCC'",
",",
"'COMPUTE_TRIPLES'",
"]"... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/procrouting/proc.py#L4796-L4897 | |
vnpy/vnpy | f50f2535ed39dd33272e0985ed40c7078e4c19f6 | vnpy/rpc/__init__.py | python | RpcServer.start | (
self,
rep_address: str,
pub_address: str,
server_secretkey_path: str = "",
username: str = "",
password: str = ""
) | Start RpcServer | Start RpcServer | [
"Start",
"RpcServer"
] | def start(
self,
rep_address: str,
pub_address: str,
server_secretkey_path: str = "",
username: str = "",
password: str = ""
) -> None:
"""
Start RpcServer
"""
if self.__active:
return
# Start authenticator
... | [
"def",
"start",
"(",
"self",
",",
"rep_address",
":",
"str",
",",
"pub_address",
":",
"str",
",",
"server_secretkey_path",
":",
"str",
"=",
"\"\"",
",",
"username",
":",
"str",
"=",
"\"\"",
",",
"password",
":",
"str",
"=",
"\"\"",
")",
"->",
"None",
... | https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/rpc/__init__.py#L75-L127 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.ScrollList | (self, dx, dy) | return True | Scrolls the :class:`UltimateListCtrl`.
:param `dx`: if in icon, small icon or report view mode, specifies the number
of pixels to scroll. If in list view mode, `dx` specifies the number of
columns to scroll.
:param `dy`: always specifies the number of pixels to scroll vertically. | Scrolls the :class:`UltimateListCtrl`. | [
"Scrolls",
"the",
":",
"class",
":",
"UltimateListCtrl",
"."
] | def ScrollList(self, dx, dy):
"""
Scrolls the :class:`UltimateListCtrl`.
:param `dx`: if in icon, small icon or report view mode, specifies the number
of pixels to scroll. If in list view mode, `dx` specifies the number of
columns to scroll.
:param `dy`: always specifi... | [
"def",
"ScrollList",
"(",
"self",
",",
"dx",
",",
"dy",
")",
":",
"if",
"not",
"self",
".",
"InReportView",
"(",
")",
":",
"# TODO: this should work in all views but is not implemented now",
"return",
"False",
"top",
",",
"bottom",
"=",
"self",
".",
"GetVisibleL... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L10796-L10827 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/win_tool.py | python | WinTool.ExecManifestWrapper | (self, arch, *args) | return popen.returncode | Run manifest tool with environment set. Strip out undesirable warning
(some XML blocks are recognized by the OS loader, but not the manifest
tool). | Run manifest tool with environment set. Strip out undesirable warning
(some XML blocks are recognized by the OS loader, but not the manifest
tool). | [
"Run",
"manifest",
"tool",
"with",
"environment",
"set",
".",
"Strip",
"out",
"undesirable",
"warning",
"(",
"some",
"XML",
"blocks",
"are",
"recognized",
"by",
"the",
"OS",
"loader",
"but",
"not",
"the",
"manifest",
"tool",
")",
"."
] | def ExecManifestWrapper(self, arch, *args):
"""Run manifest tool with environment set. Strip out undesirable warning
(some XML blocks are recognized by the OS loader, but not the manifest
tool)."""
env = self._GetEnv(arch)
popen = subprocess.Popen(args, shell=True, env=env,
... | [
"def",
"ExecManifestWrapper",
"(",
"self",
",",
"arch",
",",
"*",
"args",
")",
":",
"env",
"=",
"self",
".",
"_GetEnv",
"(",
"arch",
")",
"popen",
"=",
"subprocess",
".",
"Popen",
"(",
"args",
",",
"shell",
"=",
"True",
",",
"env",
"=",
"env",
",",... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/win_tool.py#L109-L120 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridTableBase.GetNumberCols | (*args, **kwargs) | return _grid.GridTableBase_GetNumberCols(*args, **kwargs) | GetNumberCols(self) -> int | GetNumberCols(self) -> int | [
"GetNumberCols",
"(",
"self",
")",
"-",
">",
"int"
] | def GetNumberCols(*args, **kwargs):
"""GetNumberCols(self) -> int"""
return _grid.GridTableBase_GetNumberCols(*args, **kwargs) | [
"def",
"GetNumberCols",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase_GetNumberCols",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L806-L808 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py | python | RefVariable.__init__ | (
self, # pylint: disable=super-init-not-called
initial_value=None,
trainable=None,
collections=None,
validate_shape=True,
caching_device=None,
name=None,
variable_def=None,
dtype=None,
expected_shape=None,
import_scope=None,
constraint=None,
... | Creates a new variable with value `initial_value`.
The new variable is added to the graph collections listed in `collections`,
which defaults to `[GraphKeys.GLOBAL_VARIABLES]`.
If `trainable` is `True` the variable is also added to the graph collection
`GraphKeys.TRAINABLE_VARIABLES`.
This constr... | Creates a new variable with value `initial_value`. | [
"Creates",
"a",
"new",
"variable",
"with",
"value",
"initial_value",
"."
] | def __init__(
self, # pylint: disable=super-init-not-called
initial_value=None,
trainable=None,
collections=None,
validate_shape=True,
caching_device=None,
name=None,
variable_def=None,
dtype=None,
expected_shape=None,
import_scope=None,
constrain... | [
"def",
"__init__",
"(",
"self",
",",
"# pylint: disable=super-init-not-called",
"initial_value",
"=",
"None",
",",
"trainable",
"=",
"None",
",",
"collections",
"=",
"None",
",",
"validate_shape",
"=",
"True",
",",
"caching_device",
"=",
"None",
",",
"name",
"="... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py#L1579-L1688 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/common.py | python | is_true_slices | (l) | return [isinstance(k, slice) and not is_null_slice(k) for k in l] | Find non-trivial slices in "l": return a list of booleans with same length. | Find non-trivial slices in "l": return a list of booleans with same length. | [
"Find",
"non",
"-",
"trivial",
"slices",
"in",
"l",
":",
"return",
"a",
"list",
"of",
"booleans",
"with",
"same",
"length",
"."
] | def is_true_slices(l):
"""
Find non-trivial slices in "l": return a list of booleans with same length.
"""
return [isinstance(k, slice) and not is_null_slice(k) for k in l] | [
"def",
"is_true_slices",
"(",
"l",
")",
":",
"return",
"[",
"isinstance",
"(",
"k",
",",
"slice",
")",
"and",
"not",
"is_null_slice",
"(",
"k",
")",
"for",
"k",
"in",
"l",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/common.py#L296-L300 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | benchmarks/operator_benchmark/benchmark_core.py | python | BenchmarkRunner._launch_backward | (self, test_case, iters, print_per_iter=False) | return backward_time | This function runs forward path of an op to get an output. Then the backward path is executed
and the execution time is reported | This function runs forward path of an op to get an output. Then the backward path is executed
and the execution time is reported | [
"This",
"function",
"runs",
"forward",
"path",
"of",
"an",
"op",
"to",
"get",
"an",
"output",
".",
"Then",
"the",
"backward",
"path",
"is",
"executed",
"and",
"the",
"execution",
"time",
"is",
"reported"
] | def _launch_backward(self, test_case, iters, print_per_iter=False):
""" This function runs forward path of an op to get an output. Then the backward path is executed
and the execution time is reported
"""
test_case.run_forward(num_runs=1, print_per_iter=False, cuda_sync=False)
if... | [
"def",
"_launch_backward",
"(",
"self",
",",
"test_case",
",",
"iters",
",",
"print_per_iter",
"=",
"False",
")",
":",
"test_case",
".",
"run_forward",
"(",
"num_runs",
"=",
"1",
",",
"print_per_iter",
"=",
"False",
",",
"cuda_sync",
"=",
"False",
")",
"if... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/benchmarks/operator_benchmark/benchmark_core.py#L261-L271 | |
WeitaoVan/L-GM-loss | 598582f0631bac876b3eeb8d6c4cd1d780269e03 | python/caffe/coord_map.py | python | coord_map_from_to | (top_from, top_to) | Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted. | Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted. | [
"Determine",
"the",
"coordinate",
"mapping",
"betweeen",
"a",
"top",
"(",
"from",
")",
"and",
"a",
"top",
"(",
"to",
")",
".",
"Walk",
"the",
"graph",
"to",
"find",
"a",
"common",
"ancestor",
"while",
"composing",
"the",
"coord",
"maps",
"for",
"from",
... | def coord_map_from_to(top_from, top_to):
"""
Determine the coordinate mapping betweeen a top (from) and a top (to).
Walk the graph to find a common ancestor while composing the coord maps for
from and to until they meet. As a last step the from map is inverted.
"""
# We need to find a common anc... | [
"def",
"coord_map_from_to",
"(",
"top_from",
",",
"top_to",
")",
":",
"# We need to find a common ancestor of top_from and top_to.",
"# We'll assume that all ancestors are equivalent here (otherwise the graph",
"# is an inconsistent state (which we could improve this to check for)).",
"# For n... | https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/python/caffe/coord_map.py#L115-L169 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | EnumProperty.GetIndexForValue | (*args, **kwargs) | return _propgrid.EnumProperty_GetIndexForValue(*args, **kwargs) | GetIndexForValue(self, int value) -> int | GetIndexForValue(self, int value) -> int | [
"GetIndexForValue",
"(",
"self",
"int",
"value",
")",
"-",
">",
"int"
] | def GetIndexForValue(*args, **kwargs):
"""GetIndexForValue(self, int value) -> int"""
return _propgrid.EnumProperty_GetIndexForValue(*args, **kwargs) | [
"def",
"GetIndexForValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"EnumProperty_GetIndexForValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3005-L3007 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/filters.py | python | do_float | (value: t.Any, default: float = 0.0) | Convert the value into a floating point number. If the
conversion doesn't work it will return ``0.0``. You can
override this default using the first parameter. | Convert the value into a floating point number. If the
conversion doesn't work it will return ``0.0``. You can
override this default using the first parameter. | [
"Convert",
"the",
"value",
"into",
"a",
"floating",
"point",
"number",
".",
"If",
"the",
"conversion",
"doesn",
"t",
"work",
"it",
"will",
"return",
"0",
".",
"0",
".",
"You",
"can",
"override",
"this",
"default",
"using",
"the",
"first",
"parameter",
".... | def do_float(value: t.Any, default: float = 0.0) -> float:
"""Convert the value into a floating point number. If the
conversion doesn't work it will return ``0.0``. You can
override this default using the first parameter.
"""
try:
return float(value)
except (TypeError, ValueError):
... | [
"def",
"do_float",
"(",
"value",
":",
"t",
".",
"Any",
",",
"default",
":",
"float",
"=",
"0.0",
")",
"->",
"float",
":",
"try",
":",
"return",
"float",
"(",
"value",
")",
"except",
"(",
"TypeError",
",",
"ValueError",
")",
":",
"return",
"default"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/filters.py#L989-L997 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/Cookie.py | python | BaseCookie.__set | (self, key, real_value, coded_value) | Private method for setting a cookie's value | Private method for setting a cookie's value | [
"Private",
"method",
"for",
"setting",
"a",
"cookie",
"s",
"value"
] | def __set(self, key, real_value, coded_value):
"""Private method for setting a cookie's value"""
M = self.get(key, Morsel())
M.set(key, real_value, coded_value)
dict.__setitem__(self, key, M) | [
"def",
"__set",
"(",
"self",
",",
"key",
",",
"real_value",
",",
"coded_value",
")",
":",
"M",
"=",
"self",
".",
"get",
"(",
"key",
",",
"Morsel",
"(",
")",
")",
"M",
".",
"set",
"(",
"key",
",",
"real_value",
",",
"coded_value",
")",
"dict",
"."... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/Cookie.py#L582-L586 | ||
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | elle/drake/src/drake/__init__.py | python | Rule.__lshift__ | (self, nodes) | Add a node to build when the rule is built.
>>> rule = Rule('name')
>>> created = drake.touch('/tmp/.drake.rule.add')
>>> created.path().remove()
>>> rule << created
>>> rule.build()
Touch /tmp/.drake.rule.add | Add a node to build when the rule is built. | [
"Add",
"a",
"node",
"to",
"build",
"when",
"the",
"rule",
"is",
"built",
"."
] | def __lshift__(self, nodes):
'''Add a node to build when the rule is built.
>>> rule = Rule('name')
>>> created = drake.touch('/tmp/.drake.rule.add')
>>> created.path().remove()
>>> rule << created
>>> rule.build()
Touch /tmp/.drake.rule.add
'''
if isinstance(nodes, (list, types.Gen... | [
"def",
"__lshift__",
"(",
"self",
",",
"nodes",
")",
":",
"if",
"isinstance",
"(",
"nodes",
",",
"(",
"list",
",",
"types",
".",
"GeneratorType",
")",
")",
":",
"for",
"node",
"in",
"nodes",
":",
"self",
"<<",
"node",
"else",
":",
"self",
".",
"dep... | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L3453-L3467 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/profiler/profiler.py | python | _KinetoProfile.key_averages | (self, group_by_input_shape: bool = False, group_by_stack_n: int = 0) | return self.profiler.key_averages(group_by_input_shape, group_by_stack_n) | Averages events, grouping them by operator name and (optionally) input shapes and
stack.
.. note::
To use shape/stack functionality make sure to set record_shapes/with_stack
when creating profiler context manager. | Averages events, grouping them by operator name and (optionally) input shapes and
stack. | [
"Averages",
"events",
"grouping",
"them",
"by",
"operator",
"name",
"and",
"(",
"optionally",
")",
"input",
"shapes",
"and",
"stack",
"."
] | def key_averages(self, group_by_input_shape: bool = False, group_by_stack_n: int = 0):
"""Averages events, grouping them by operator name and (optionally) input shapes and
stack.
.. note::
To use shape/stack functionality make sure to set record_shapes/with_stack
when cr... | [
"def",
"key_averages",
"(",
"self",
",",
"group_by_input_shape",
":",
"bool",
"=",
"False",
",",
"group_by_stack_n",
":",
"int",
"=",
"0",
")",
":",
"assert",
"self",
".",
"profiler",
"return",
"self",
".",
"profiler",
".",
"key_averages",
"(",
"group_by_inp... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/profiler/profiler.py#L140-L149 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | dot | (a, b, strict=False, out=None) | Return the dot product of two arrays.
This function is the equivalent of `numpy.dot` that takes masked values
into account. Note that `strict` and `out` are in different position
than in the method version. In order to maintain compatibility with the
corresponding method, it is recommended that the opt... | Return the dot product of two arrays. | [
"Return",
"the",
"dot",
"product",
"of",
"two",
"arrays",
"."
] | def dot(a, b, strict=False, out=None):
"""
Return the dot product of two arrays.
This function is the equivalent of `numpy.dot` that takes masked values
into account. Note that `strict` and `out` are in different position
than in the method version. In order to maintain compatibility with the
c... | [
"def",
"dot",
"(",
"a",
",",
"b",
",",
"strict",
"=",
"False",
",",
"out",
"=",
"None",
")",
":",
"# !!!: Works only with 2D arrays. There should be a way to get it to run",
"# with higher dimension",
"if",
"strict",
"and",
"(",
"a",
".",
"ndim",
"==",
"2",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L7447-L7526 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/math_utils.py | python | Mean | (values) | return sum(values) / float(len(values)) | Returns the arithmetic mean, or NaN if the input is empty. | Returns the arithmetic mean, or NaN if the input is empty. | [
"Returns",
"the",
"arithmetic",
"mean",
"or",
"NaN",
"if",
"the",
"input",
"is",
"empty",
"."
] | def Mean(values):
"""Returns the arithmetic mean, or NaN if the input is empty."""
if not values:
return float('nan')
return sum(values) / float(len(values)) | [
"def",
"Mean",
"(",
"values",
")",
":",
"if",
"not",
"values",
":",
"return",
"float",
"(",
"'nan'",
")",
"return",
"sum",
"(",
"values",
")",
"/",
"float",
"(",
"len",
"(",
"values",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/math_utils.py#L10-L14 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/server/factory.py | python | RegisterClassFactories | (clsids, flags = None, clsctx = None) | return ret | Given a list of CLSID, create and register class factories.
Returns a list, which should be passed to RevokeClassFactories | Given a list of CLSID, create and register class factories.
Returns a list, which should be passed to RevokeClassFactories | [
"Given",
"a",
"list",
"of",
"CLSID",
"create",
"and",
"register",
"class",
"factories",
".",
"Returns",
"a",
"list",
"which",
"should",
"be",
"passed",
"to",
"RevokeClassFactories"
] | def RegisterClassFactories(clsids, flags = None, clsctx = None):
"""Given a list of CLSID, create and register class factories.
Returns a list, which should be passed to RevokeClassFactories
"""
if flags is None: flags = pythoncom.REGCLS_MULTIPLEUSE|pythoncom.REGCLS_SUSPENDED
if clsctx is None: clsctx = pytho... | [
"def",
"RegisterClassFactories",
"(",
"clsids",
",",
"flags",
"=",
"None",
",",
"clsctx",
"=",
"None",
")",
":",
"if",
"flags",
"is",
"None",
":",
"flags",
"=",
"pythoncom",
".",
"REGCLS_MULTIPLEUSE",
"|",
"pythoncom",
".",
"REGCLS_SUSPENDED",
"if",
"clsctx"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/server/factory.py#L4-L18 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tix.py | python | TixWidget.subwidgets_all | (self) | return retlist | Return all subwidgets. | Return all subwidgets. | [
"Return",
"all",
"subwidgets",
"."
] | def subwidgets_all(self):
"""Return all subwidgets."""
names = self._subwidget_names()
if not names:
return []
retlist = []
for name in names:
name = name[len(self._w)+1:]
try:
retlist.append(self._nametowidget(name))
... | [
"def",
"subwidgets_all",
"(",
"self",
")",
":",
"names",
"=",
"self",
".",
"_subwidget_names",
"(",
")",
"if",
"not",
"names",
":",
"return",
"[",
"]",
"retlist",
"=",
"[",
"]",
"for",
"name",
"in",
"names",
":",
"name",
"=",
"name",
"[",
"len",
"(... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tix.py#L357-L370 | |
yuxng/DA-RNN | 77fbb50b4272514588a10a9f90b7d5f8d46974fb | lib/datasets/gmu_scene.py | python | gmu_scene._process_label_image | (self, label_image) | return label_index | change label image to label index | change label image to label index | [
"change",
"label",
"image",
"to",
"label",
"index"
] | def _process_label_image(self, label_image):
"""
change label image to label index
"""
class_colors = self._class_colors
width = label_image.shape[1]
height = label_image.shape[0]
label_index = np.zeros((height, width), dtype=np.float32)
# label image is ... | [
"def",
"_process_label_image",
"(",
"self",
",",
"label_image",
")",
":",
"class_colors",
"=",
"self",
".",
"_class_colors",
"width",
"=",
"label_image",
".",
"shape",
"[",
"1",
"]",
"height",
"=",
"label_image",
".",
"shape",
"[",
"0",
"]",
"label_index",
... | https://github.com/yuxng/DA-RNN/blob/77fbb50b4272514588a10a9f90b7d5f8d46974fb/lib/datasets/gmu_scene.py#L178-L195 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiDockingHintWindow.MakeVenetianBlinds | (self) | Creates the "venetian blind" effect if :class:`AuiManager` has the ``AUI_MGR_VENETIAN_BLINDS_HINT``
flag set. | Creates the "venetian blind" effect if :class:`AuiManager` has the ``AUI_MGR_VENETIAN_BLINDS_HINT``
flag set. | [
"Creates",
"the",
"venetian",
"blind",
"effect",
"if",
":",
"class",
":",
"AuiManager",
"has",
"the",
"AUI_MGR_VENETIAN_BLINDS_HINT",
"flag",
"set",
"."
] | def MakeVenetianBlinds(self):
"""
Creates the "venetian blind" effect if :class:`AuiManager` has the ``AUI_MGR_VENETIAN_BLINDS_HINT``
flag set.
"""
amount = 128
size = self.GetClientSize()
region = wx.Region(0, 0, size.x, 1)
for y in xrange(size.y):
... | [
"def",
"MakeVenetianBlinds",
"(",
"self",
")",
":",
"amount",
"=",
"128",
"size",
"=",
"self",
".",
"GetClientSize",
"(",
")",
"region",
"=",
"wx",
".",
"Region",
"(",
"0",
",",
"0",
",",
"size",
".",
"x",
",",
"1",
")",
"for",
"y",
"in",
"xrange... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L2734-L2753 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py | python | prod | (x, axis=None, keepdims=False) | return math_ops.reduce_prod(x, axis, keepdims) | Multiplies the values in a tensor, alongside the specified axis.
Arguments:
x: A tensor or variable.
axis: An integer, the axis to compute the product.
keepdims: A boolean, whether to keep the dimensions or not.
If `keepdims` is `False`, the rank of the tensor is reduced
by 1. I... | Multiplies the values in a tensor, alongside the specified axis. | [
"Multiplies",
"the",
"values",
"in",
"a",
"tensor",
"alongside",
"the",
"specified",
"axis",
"."
] | def prod(x, axis=None, keepdims=False):
"""Multiplies the values in a tensor, alongside the specified axis.
Arguments:
x: A tensor or variable.
axis: An integer, the axis to compute the product.
keepdims: A boolean, whether to keep the dimensions or not.
If `keepdims` is `False`, the ra... | [
"def",
"prod",
"(",
"x",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
")",
":",
"return",
"math_ops",
".",
"reduce_prod",
"(",
"x",
",",
"axis",
",",
"keepdims",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L1901-L1915 | |
Smorodov/Multitarget-tracker | bee300e8bfd660c86cbeb6892c65a5b7195c9381 | thirdparty/pybind11/tools/clang/cindex.py | python | CursorKind.get_all_kinds | () | return [_f for _f in CursorKind._kinds if _f] | Return all CursorKind enumeration instances. | Return all CursorKind enumeration instances. | [
"Return",
"all",
"CursorKind",
"enumeration",
"instances",
"."
] | def get_all_kinds():
"""Return all CursorKind enumeration instances."""
return [_f for _f in CursorKind._kinds if _f] | [
"def",
"get_all_kinds",
"(",
")",
":",
"return",
"[",
"_f",
"for",
"_f",
"in",
"CursorKind",
".",
"_kinds",
"if",
"_f",
"]"
] | https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L572-L574 | |
POV-Ray/povray | 76a804d18a30a1dbb0afbc0070b62526715571eb | tools/meta-make/bluenoise/BlueNoise.py | python | FindTightestCluster | (BinaryPattern,StandardDeviation) | return np.argmax(np.where(BinaryPattern,FilteredArray,-1.0)) | Like FindLargestVoid() but finds the tightest cluster which is a minority
pixel by definition.
\sa GetVoidAndClusterBlueNoise | Like FindLargestVoid() but finds the tightest cluster which is a minority
pixel by definition.
\sa GetVoidAndClusterBlueNoise | [
"Like",
"FindLargestVoid",
"()",
"but",
"finds",
"the",
"tightest",
"cluster",
"which",
"is",
"a",
"minority",
"pixel",
"by",
"definition",
".",
"\\",
"sa",
"GetVoidAndClusterBlueNoise"
] | def FindTightestCluster(BinaryPattern,StandardDeviation):
"""Like FindLargestVoid() but finds the tightest cluster which is a minority
pixel by definition.
\sa GetVoidAndClusterBlueNoise"""
if(np.count_nonzero(BinaryPattern)*2>=np.size(BinaryPattern)):
BinaryPattern=np.logical_not(BinaryPa... | [
"def",
"FindTightestCluster",
"(",
"BinaryPattern",
",",
"StandardDeviation",
")",
":",
"if",
"(",
"np",
".",
"count_nonzero",
"(",
"BinaryPattern",
")",
"*",
"2",
">=",
"np",
".",
"size",
"(",
"BinaryPattern",
")",
")",
":",
"BinaryPattern",
"=",
"np",
".... | https://github.com/POV-Ray/povray/blob/76a804d18a30a1dbb0afbc0070b62526715571eb/tools/meta-make/bluenoise/BlueNoise.py#L56-L63 | |
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | tools/clang/tools/scan-build-py/libscanbuild/analyze.py | python | analyze_build_wrapper | (cplusplus) | return result | Entry point for `analyze-cc` and `analyze-c++` compiler wrappers. | Entry point for `analyze-cc` and `analyze-c++` compiler wrappers. | [
"Entry",
"point",
"for",
"analyze",
"-",
"cc",
"and",
"analyze",
"-",
"c",
"++",
"compiler",
"wrappers",
"."
] | def analyze_build_wrapper(cplusplus):
""" Entry point for `analyze-cc` and `analyze-c++` compiler wrappers. """
# initialize wrapper logging
logging.basicConfig(format='analyze: %(levelname)s: %(message)s',
level=os.getenv('ANALYZE_BUILD_VERBOSE', 'INFO'))
# execute with real co... | [
"def",
"analyze_build_wrapper",
"(",
"cplusplus",
")",
":",
"# initialize wrapper logging",
"logging",
".",
"basicConfig",
"(",
"format",
"=",
"'analyze: %(levelname)s: %(message)s'",
",",
"level",
"=",
"os",
".",
"getenv",
"(",
"'ANALYZE_BUILD_VERBOSE'",
",",
"'INFO'",... | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/tools/scan-build-py/libscanbuild/analyze.py#L147-L191 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py | python | Keyword.setDefaultKeywordChars | ( chars ) | Overrides the default Keyword chars | Overrides the default Keyword chars | [
"Overrides",
"the",
"default",
"Keyword",
"chars"
] | def setDefaultKeywordChars( chars ):
"""Overrides the default Keyword chars
"""
Keyword.DEFAULT_KEYWORD_CHARS = chars | [
"def",
"setDefaultKeywordChars",
"(",
"chars",
")",
":",
"Keyword",
".",
"DEFAULT_KEYWORD_CHARS",
"=",
"chars"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py#L2697-L2700 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py | python | calc_chksums | (buf) | return unsigned_chksum, signed_chksum | Calculate the checksum for a member's header by summing up all
characters except for the chksum field which is treated as if
it was filled with spaces. According to the GNU tar sources,
some tars (Sun and NeXT) calculate chksum with signed char,
which will be different if there are chars in ... | Calculate the checksum for a member's header by summing up all
characters except for the chksum field which is treated as if
it was filled with spaces. According to the GNU tar sources,
some tars (Sun and NeXT) calculate chksum with signed char,
which will be different if there are chars in ... | [
"Calculate",
"the",
"checksum",
"for",
"a",
"member",
"s",
"header",
"by",
"summing",
"up",
"all",
"characters",
"except",
"for",
"the",
"chksum",
"field",
"which",
"is",
"treated",
"as",
"if",
"it",
"was",
"filled",
"with",
"spaces",
".",
"According",
"to... | def calc_chksums(buf):
"""Calculate the checksum for a member's header by summing up all
characters except for the chksum field which is treated as if
it was filled with spaces. According to the GNU tar sources,
some tars (Sun and NeXT) calculate chksum with signed char,
which will be di... | [
"def",
"calc_chksums",
"(",
"buf",
")",
":",
"unsigned_chksum",
"=",
"256",
"+",
"sum",
"(",
"struct",
".",
"unpack",
"(",
"\"148B\"",
",",
"buf",
"[",
":",
"148",
"]",
")",
"+",
"struct",
".",
"unpack",
"(",
"\"356B\"",
",",
"buf",
"[",
"156",
":"... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py#L243-L254 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/handler.py | python | ErrorHandler.warning | (self, exception) | Handle a warning. | Handle a warning. | [
"Handle",
"a",
"warning",
"."
] | def warning(self, exception):
"Handle a warning."
print(exception) | [
"def",
"warning",
"(",
"self",
",",
"exception",
")",
":",
"print",
"(",
"exception",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/handler.py#L40-L42 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py | python | register_loader_type | (loader_type, provider_factory) | Register `provider_factory` to make providers for `loader_type`
`loader_type` is the type or class of a PEP 302 ``module.__loader__``,
and `provider_factory` is a function that, passed a *module* object,
returns an ``IResourceProvider`` for that module. | Register `provider_factory` to make providers for `loader_type` | [
"Register",
"provider_factory",
"to",
"make",
"providers",
"for",
"loader_type"
] | def register_loader_type(loader_type, provider_factory):
"""Register `provider_factory` to make providers for `loader_type`
`loader_type` is the type or class of a PEP 302 ``module.__loader__``,
and `provider_factory` is a function that, passed a *module* object,
returns an ``IResourceProvider`` for th... | [
"def",
"register_loader_type",
"(",
"loader_type",
",",
"provider_factory",
")",
":",
"_provider_factories",
"[",
"loader_type",
"]",
"=",
"provider_factory"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L401-L408 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | VListBox.SetSelection | (*args, **kwargs) | return _windows_.VListBox_SetSelection(*args, **kwargs) | SetSelection(self, int selection) | SetSelection(self, int selection) | [
"SetSelection",
"(",
"self",
"int",
"selection",
")"
] | def SetSelection(*args, **kwargs):
"""SetSelection(self, int selection)"""
return _windows_.VListBox_SetSelection(*args, **kwargs) | [
"def",
"SetSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VListBox_SetSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L2656-L2658 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/saver.py | python | Saver._MetaGraphFilename | (self, checkpoint_filename, meta_graph_suffix="meta") | return meta_graph_filename | Returns the meta graph filename.
Args:
checkpoint_filename: Name of the checkpoint file.
meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'.
Returns:
MetaGraph file name. | Returns the meta graph filename. | [
"Returns",
"the",
"meta",
"graph",
"filename",
"."
] | def _MetaGraphFilename(self, checkpoint_filename, meta_graph_suffix="meta"):
"""Returns the meta graph filename.
Args:
checkpoint_filename: Name of the checkpoint file.
meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'.
Returns:
MetaGraph file name.
"""
# If t... | [
"def",
"_MetaGraphFilename",
"(",
"self",
",",
"checkpoint_filename",
",",
"meta_graph_suffix",
"=",
"\"meta\"",
")",
":",
"# If the checkpoint_filename is sharded, the checkpoint_filename could",
"# be of format model.ckpt-step#-?????-of-shard#. For example,",
"# model.ckpt-123456-?????... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/saver.py#L1313-L1328 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.MoveCaretInsideView | (*args, **kwargs) | return _stc.StyledTextCtrl_MoveCaretInsideView(*args, **kwargs) | MoveCaretInsideView(self)
Move the caret inside current view if it's not there already. | MoveCaretInsideView(self) | [
"MoveCaretInsideView",
"(",
"self",
")"
] | def MoveCaretInsideView(*args, **kwargs):
"""
MoveCaretInsideView(self)
Move the caret inside current view if it's not there already.
"""
return _stc.StyledTextCtrl_MoveCaretInsideView(*args, **kwargs) | [
"def",
"MoveCaretInsideView",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_MoveCaretInsideView",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L4783-L4789 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.