nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/utils.py | python | encode_rfc2231 | (s, charset=None, language=None) | return "%s'%s'%s" % (charset, language, s) | Encode string according to RFC 2231.
If neither charset nor language is given, then s is returned as-is. If
charset is given but not language, the string is encoded using the empty
string for language. | Encode string according to RFC 2231. | [
"Encode",
"string",
"according",
"to",
"RFC",
"2231",
"."
] | def encode_rfc2231(s, charset=None, language=None):
"""Encode string according to RFC 2231.
If neither charset nor language is given, then s is returned as-is. If
charset is given but not language, the string is encoded using the empty
string for language.
"""
s = urllib.parse.quote(s, safe=''... | [
"def",
"encode_rfc2231",
"(",
"s",
",",
"charset",
"=",
"None",
",",
"language",
"=",
"None",
")",
":",
"s",
"=",
"urllib",
".",
"parse",
".",
"quote",
"(",
"s",
",",
"safe",
"=",
"''",
",",
"encoding",
"=",
"charset",
"or",
"'ascii'",
")",
"if",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/utils.py#L239-L251 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/bucket.py | python | Bucket.get_policy | (self, headers=None) | Returns the JSON policy associated with the bucket. The policy
is returned as an uninterpreted JSON string. | Returns the JSON policy associated with the bucket. The policy
is returned as an uninterpreted JSON string. | [
"Returns",
"the",
"JSON",
"policy",
"associated",
"with",
"the",
"bucket",
".",
"The",
"policy",
"is",
"returned",
"as",
"an",
"uninterpreted",
"JSON",
"string",
"."
] | def get_policy(self, headers=None):
"""
Returns the JSON policy associated with the bucket. The policy
is returned as an uninterpreted JSON string.
"""
response = self.connection.make_request('GET', self.name,
query_args='policy', headers=headers)
body = ... | [
"def",
"get_policy",
"(",
"self",
",",
"headers",
"=",
"None",
")",
":",
"response",
"=",
"self",
".",
"connection",
".",
"make_request",
"(",
"'GET'",
",",
"self",
".",
"name",
",",
"query_args",
"=",
"'policy'",
",",
"headers",
"=",
"headers",
")",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/bucket.py#L1562-L1574 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PrintPreview.PaintPage | (*args, **kwargs) | return _windows_.PrintPreview_PaintPage(*args, **kwargs) | PaintPage(self, PreviewCanvas canvas, DC dc) -> bool | PaintPage(self, PreviewCanvas canvas, DC dc) -> bool | [
"PaintPage",
"(",
"self",
"PreviewCanvas",
"canvas",
"DC",
"dc",
")",
"-",
">",
"bool"
] | def PaintPage(*args, **kwargs):
"""PaintPage(self, PreviewCanvas canvas, DC dc) -> bool"""
return _windows_.PrintPreview_PaintPage(*args, **kwargs) | [
"def",
"PaintPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintPreview_PaintPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5601-L5603 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/errors.py | python | ParserContext.add_bad_command_namespace_error | (self, location, command_name, command_namespace,
valid_commands) | Add an error about the namespace value not being a valid choice. | Add an error about the namespace value not being a valid choice. | [
"Add",
"an",
"error",
"about",
"the",
"namespace",
"value",
"not",
"being",
"a",
"valid",
"choice",
"."
] | def add_bad_command_namespace_error(self, location, command_name, command_namespace,
valid_commands):
# type: (common.SourceLocation, unicode, unicode, List[unicode]) -> None
"""Add an error about the namespace value not being a valid choice."""
self._add_... | [
"def",
"add_bad_command_namespace_error",
"(",
"self",
",",
"location",
",",
"command_name",
",",
"command_namespace",
",",
"valid_commands",
")",
":",
"# type: (common.SourceLocation, unicode, unicode, List[unicode]) -> None",
"self",
".",
"_add_error",
"(",
"location",
",",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/errors.py#L558-L565 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/utils/watchdog_timer.py | python | WatchdogTimer.IsTimedOut | (self) | return remaining is not None and remaining < 0 | Whether the watchdog has timed out.
Returns:
True if the watchdog has timed out, False otherwise. | Whether the watchdog has timed out. | [
"Whether",
"the",
"watchdog",
"has",
"timed",
"out",
"."
] | def IsTimedOut(self):
"""Whether the watchdog has timed out.
Returns:
True if the watchdog has timed out, False otherwise.
"""
remaining = self.GetRemaining()
return remaining is not None and remaining < 0 | [
"def",
"IsTimedOut",
"(",
"self",
")",
":",
"remaining",
"=",
"self",
".",
"GetRemaining",
"(",
")",
"return",
"remaining",
"is",
"not",
"None",
"and",
"remaining",
"<",
"0"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/utils/watchdog_timer.py#L40-L47 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextCtrl.EndFontSize | (*args, **kwargs) | return _richtext.RichTextCtrl_EndFontSize(*args, **kwargs) | EndFontSize(self) -> bool
End using point size | EndFontSize(self) -> bool | [
"EndFontSize",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndFontSize(*args, **kwargs):
"""
EndFontSize(self) -> bool
End using point size
"""
return _richtext.RichTextCtrl_EndFontSize(*args, **kwargs) | [
"def",
"EndFontSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_EndFontSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3391-L3397 | |
HumbleNet/HumbleNet | dcf31b021c2b809c8aee8ef1436ccfb9ce840fb5 | 3rdparty/boringssl/util/bot/vs_toolchain.py | python | Update | () | return 0 | Requests an update of the toolchain to the specific hashes we have at
this revision. The update outputs a .json of the various configuration
information required to pass to gyp which we use in |GetToolchainDir()|. | Requests an update of the toolchain to the specific hashes we have at
this revision. The update outputs a .json of the various configuration
information required to pass to gyp which we use in |GetToolchainDir()|. | [
"Requests",
"an",
"update",
"of",
"the",
"toolchain",
"to",
"the",
"specific",
"hashes",
"we",
"have",
"at",
"this",
"revision",
".",
"The",
"update",
"outputs",
"a",
".",
"json",
"of",
"the",
"various",
"configuration",
"information",
"required",
"to",
"pas... | def Update():
"""Requests an update of the toolchain to the specific hashes we have at
this revision. The update outputs a .json of the various configuration
information required to pass to gyp which we use in |GetToolchainDir()|.
"""
depot_tools_win_toolchain = \
bool(int(os.environ.get('DEPOT_TOOLS_WI... | [
"def",
"Update",
"(",
")",
":",
"depot_tools_win_toolchain",
"=",
"bool",
"(",
"int",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'DEPOT_TOOLS_WIN_TOOLCHAIN'",
",",
"'1'",
")",
")",
")",
"if",
"sys",
".",
"platform",
"in",
"(",
"'win32'",
",",
"'cygwin'... | https://github.com/HumbleNet/HumbleNet/blob/dcf31b021c2b809c8aee8ef1436ccfb9ce840fb5/3rdparty/boringssl/util/bot/vs_toolchain.py#L79-L97 | |
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | python/interfaces/Grasper.py | python | Grasper.GraspThreaded | (self,approachrays,standoffs,preshapes,rolls,manipulatordirections=None,target=None,transformrobot=True,onlycontacttarget=True,tightgrasp=False,graspingnoise=None,forceclosurethreshold=None,collisionchecker=None,translationstepmult=None,numthreads=None,startindex=None,maxgrasps=None,finestep=None) | return nextid, resvalues | See :ref:`module-grasper-graspthreaded` | See :ref:`module-grasper-graspthreaded` | [
"See",
":",
"ref",
":",
"module",
"-",
"grasper",
"-",
"graspthreaded"
] | def GraspThreaded(self,approachrays,standoffs,preshapes,rolls,manipulatordirections=None,target=None,transformrobot=True,onlycontacttarget=True,tightgrasp=False,graspingnoise=None,forceclosurethreshold=None,collisionchecker=None,translationstepmult=None,numthreads=None,startindex=None,maxgrasps=None,finestep=None):
... | [
"def",
"GraspThreaded",
"(",
"self",
",",
"approachrays",
",",
"standoffs",
",",
"preshapes",
",",
"rolls",
",",
"manipulatordirections",
"=",
"None",
",",
"target",
"=",
"None",
",",
"transformrobot",
"=",
"True",
",",
"onlycontacttarget",
"=",
"True",
",",
... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/interfaces/Grasper.py#L122-L182 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | CheckForMultilineCommentsAndStrings | (filename, clean_lines, linenum, error) | Logs an error if we see /* ... */ or "..." that extend past one line.
/* ... */ comments are legit inside macros, for one line.
Otherwise, we prefer // comments, so it's ok to warn about the
other. Likewise, it's ok for strings to extend across multiple
lines, as long as a line continuation character (backsla... | Logs an error if we see /* ... */ or "..." that extend past one line. | [
"Logs",
"an",
"error",
"if",
"we",
"see",
"/",
"*",
"...",
"*",
"/",
"or",
"...",
"that",
"extend",
"past",
"one",
"line",
"."
] | def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
"""Logs an error if we see /* ... */ or "..." that extend past one line.
/* ... */ comments are legit inside macros, for one line.
Otherwise, we prefer // comments, so it's ok to warn about the
other. Likewise, it's ok for strings... | [
"def",
"CheckForMultilineCommentsAndStrings",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Remove all \\\\ (escaped backslashes) from the line. They are OK, and the",
"# secon... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L2051-L2086 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/errors.py | python | ParserContext.add_bad_array_type_name_error | (self, location, field_name, type_name) | Add an error about a field type having a malformed type name. | Add an error about a field type having a malformed type name. | [
"Add",
"an",
"error",
"about",
"a",
"field",
"type",
"having",
"a",
"malformed",
"type",
"name",
"."
] | def add_bad_array_type_name_error(self, location, field_name, type_name):
# type: (common.SourceLocation, str, str) -> None
"""Add an error about a field type having a malformed type name."""
self._add_error(location, ERROR_ID_BAD_ARRAY_TYPE_NAME,
("'%s' is not a valid ar... | [
"def",
"add_bad_array_type_name_error",
"(",
"self",
",",
"location",
",",
"field_name",
",",
"type_name",
")",
":",
"# type: (common.SourceLocation, str, str) -> None",
"self",
".",
"_add_error",
"(",
"location",
",",
"ERROR_ID_BAD_ARRAY_TYPE_NAME",
",",
"(",
"\"'%s' is ... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/errors.py#L504-L509 | ||
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/stp/rc.py | python | GameInfo.is_direct | (self) | return self.restart == GameRestart.DIRECT | :return: True if the restart is a direct kick. | :return: True if the restart is a direct kick. | [
":",
"return",
":",
"True",
"if",
"the",
"restart",
"is",
"a",
"direct",
"kick",
"."
] | def is_direct(self) -> bool:
"""
:return: True if the restart is a direct kick.
"""
return self.restart == GameRestart.DIRECT | [
"def",
"is_direct",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"restart",
"==",
"GameRestart",
".",
"DIRECT"
] | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/stp/rc.py#L592-L596 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py | python | Retry.from_int | (cls, retries, redirect=True, default=None) | return new_retries | Backwards-compatibility for the old retries format. | Backwards-compatibility for the old retries format. | [
"Backwards",
"-",
"compatibility",
"for",
"the",
"old",
"retries",
"format",
"."
] | def from_int(cls, retries, redirect=True, default=None):
""" Backwards-compatibility for the old retries format."""
if retries is None:
retries = default if default is not None else cls.DEFAULT
if isinstance(retries, Retry):
return retries
redirect = bool(redire... | [
"def",
"from_int",
"(",
"cls",
",",
"retries",
",",
"redirect",
"=",
"True",
",",
"default",
"=",
"None",
")",
":",
"if",
"retries",
"is",
"None",
":",
"retries",
"=",
"default",
"if",
"default",
"is",
"not",
"None",
"else",
"cls",
".",
"DEFAULT",
"i... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/retry.py#L145-L156 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/third_party/jinja2/utils.py | python | LRUCache.itervalue | (self) | return iter(self.values()) | Iterate over all values. | Iterate over all values. | [
"Iterate",
"over",
"all",
"values",
"."
] | def itervalue(self):
"""Iterate over all values."""
return iter(self.values()) | [
"def",
"itervalue",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"self",
".",
"values",
"(",
")",
")"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/utils.py#L458-L460 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonlibs/audio/serial_reader.py | python | SerialReader.open | (self, sample_size, serial_port=None, baud_rate=115200) | Open the serial port so it returns chunks of data of the given sample_size
where data is converted to the expected sample_rate and num_channels
and then scaled to floating point numbers between -1 and 1.
sample_size - number of samples to return from read method
serial_port - serial por... | Open the serial port so it returns chunks of data of the given sample_size
where data is converted to the expected sample_rate and num_channels
and then scaled to floating point numbers between -1 and 1. | [
"Open",
"the",
"serial",
"port",
"so",
"it",
"returns",
"chunks",
"of",
"data",
"of",
"the",
"given",
"sample_size",
"where",
"data",
"is",
"converted",
"to",
"the",
"expected",
"sample_rate",
"and",
"num_channels",
"and",
"then",
"scaled",
"to",
"floating",
... | def open(self, sample_size, serial_port=None, baud_rate=115200):
""" Open the serial port so it returns chunks of data of the given sample_size
where data is converted to the expected sample_rate and num_channels
and then scaled to floating point numbers between -1 and 1.
sample_size - ... | [
"def",
"open",
"(",
"self",
",",
"sample_size",
",",
"serial_port",
"=",
"None",
",",
"baud_rate",
"=",
"115200",
")",
":",
"self",
".",
"serial_port",
"=",
"serial_port",
"self",
".",
"sample_size",
"=",
"sample_size",
"self",
".",
"baud_rate",
"=",
"baud... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonlibs/audio/serial_reader.py#L27-L40 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/tools/grokdump.py | python | InspectionShell.do_dsa | (self, address) | return self.do_display_stack_ascii(address) | see display_stack_ascii | see display_stack_ascii | [
"see",
"display_stack_ascii"
] | def do_dsa(self, address):
""" see display_stack_ascii"""
return self.do_display_stack_ascii(address) | [
"def",
"do_dsa",
"(",
"self",
",",
"address",
")",
":",
"return",
"self",
".",
"do_display_stack_ascii",
"(",
"address",
")"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/tools/grokdump.py#L3354-L3356 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/api.py | python | options | (url, **kwargs) | return request('options', url, **kwargs) | r"""Sends an OPTIONS request.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:return: :class:`Response <Response>` object
:rtype: requests.Response | r"""Sends an OPTIONS request. | [
"r",
"Sends",
"an",
"OPTIONS",
"request",
"."
] | def options(url, **kwargs):
r"""Sends an OPTIONS request.
:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:return: :class:`Response <Response>` object
:rtype: requests.Response
"""
kwargs.setdefault('allow_redirects', True)... | [
"def",
"options",
"(",
"url",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"setdefault",
"(",
"'allow_redirects'",
",",
"True",
")",
"return",
"request",
"(",
"'options'",
",",
"url",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/api.py#L79-L89 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/msvc9compiler.py | python | get_build_version | () | return None | Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.version. For earlier versions, assume the compiler is MSVC 6. | Return the version of MSVC that was used to build Python. | [
"Return",
"the",
"version",
"of",
"MSVC",
"that",
"was",
"used",
"to",
"build",
"Python",
"."
] | def get_build_version():
"""Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.version. For earlier versions, assume the compiler is MSVC 6.
"""
prefix = "MSC v."
i = sys.version.find(prefix)
if i == -1:
return 6
... | [
"def",
"get_build_version",
"(",
")",
":",
"prefix",
"=",
"\"MSC v.\"",
"i",
"=",
"sys",
".",
"version",
".",
"find",
"(",
"prefix",
")",
"if",
"i",
"==",
"-",
"1",
":",
"return",
"6",
"i",
"=",
"i",
"+",
"len",
"(",
"prefix",
")",
"s",
",",
"r... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/msvc9compiler.py#L172-L192 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/tools/pip_package/setup.py | python | make_output | (target) | return subprocess.check_output(make_args(target)).decode('utf-8').strip() | Invoke make on the target and return output. | Invoke make on the target and return output. | [
"Invoke",
"make",
"on",
"the",
"target",
"and",
"return",
"output",
"."
] | def make_output(target):
"""Invoke make on the target and return output."""
return subprocess.check_output(make_args(target)).decode('utf-8').strip() | [
"def",
"make_output",
"(",
"target",
")",
":",
"return",
"subprocess",
".",
"check_output",
"(",
"make_args",
"(",
"target",
")",
")",
".",
"decode",
"(",
"'utf-8'",
")",
".",
"strip",
"(",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/tools/pip_package/setup.py#L84-L86 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/platebtn.py | python | PlateButton.Disable | (self) | Disable the control | Disable the control | [
"Disable",
"the",
"control"
] | def Disable(self):
"""Disable the control"""
super(PlateButton, self).Disable()
self.Refresh() | [
"def",
"Disable",
"(",
"self",
")",
":",
"super",
"(",
"PlateButton",
",",
"self",
")",
".",
"Disable",
"(",
")",
"self",
".",
"Refresh",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/platebtn.py#L401-L404 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_vbscript.py | python | SyntaxData.GetKeywords | (self) | return [(0, VBS_KW),] | Returns Specified Keywords List | Returns Specified Keywords List | [
"Returns",
"Specified",
"Keywords",
"List"
] | def GetKeywords(self):
"""Returns Specified Keywords List """
return [(0, VBS_KW),] | [
"def",
"GetKeywords",
"(",
"self",
")",
":",
"return",
"[",
"(",
"0",
",",
"VBS_KW",
")",
",",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_vbscript.py#L81-L83 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | Caret.SetSizeWH | (*args, **kwargs) | return _misc_.Caret_SetSizeWH(*args, **kwargs) | SetSizeWH(self, int width, int height) | SetSizeWH(self, int width, int height) | [
"SetSizeWH",
"(",
"self",
"int",
"width",
"int",
"height",
")"
] | def SetSizeWH(*args, **kwargs):
"""SetSizeWH(self, int width, int height)"""
return _misc_.Caret_SetSizeWH(*args, **kwargs) | [
"def",
"SetSizeWH",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Caret_SetSizeWH",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L782-L784 | |
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/ctml2yaml.py | python | Reaction.plog | (self, rate_coeff: etree.Element) | return reaction_attributes | Process a PLOG reaction.
:param rate_coeff:
The XML node with rate coefficient information for this reaction. | Process a PLOG reaction. | [
"Process",
"a",
"PLOG",
"reaction",
"."
] | def plog(self, rate_coeff: etree.Element) -> "PLOG_TYPE":
"""Process a PLOG reaction.
:param rate_coeff:
The XML node with rate coefficient information for this reaction.
"""
reaction_attributes = FlowMap({"type": "pressure-dependent-Arrhenius"})
rate_constants = []
... | [
"def",
"plog",
"(",
"self",
",",
"rate_coeff",
":",
"etree",
".",
"Element",
")",
"->",
"\"PLOG_TYPE\"",
":",
"reaction_attributes",
"=",
"FlowMap",
"(",
"{",
"\"type\"",
":",
"\"pressure-dependent-Arrhenius\"",
"}",
")",
"rate_constants",
"=",
"[",
"]",
"for"... | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/ctml2yaml.py#L2264-L2283 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | samples/python/yolov3_onnx/yolov3_to_onnx.py | python | GraphBuilderONNX._make_input_tensor | (self, layer_name, layer_dict) | return layer_name, channels | Create an ONNX input tensor from a 'net' layer and store the batch size.
Keyword arguments:
layer_name -- the layer's name (also the corresponding key in layer_configs)
layer_dict -- a layer parameter dictionary (one element of layer_configs) | Create an ONNX input tensor from a 'net' layer and store the batch size. | [
"Create",
"an",
"ONNX",
"input",
"tensor",
"from",
"a",
"net",
"layer",
"and",
"store",
"the",
"batch",
"size",
"."
] | def _make_input_tensor(self, layer_name, layer_dict):
"""Create an ONNX input tensor from a 'net' layer and store the batch size.
Keyword arguments:
layer_name -- the layer's name (also the corresponding key in layer_configs)
layer_dict -- a layer parameter dictionary (one element of la... | [
"def",
"_make_input_tensor",
"(",
"self",
",",
"layer_name",
",",
"layer_dict",
")",
":",
"batch_size",
"=",
"layer_dict",
"[",
"'batch'",
"]",
"channels",
"=",
"layer_dict",
"[",
"'channels'",
"]",
"height",
"=",
"layer_dict",
"[",
"'height'",
"]",
"width",
... | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/samples/python/yolov3_onnx/yolov3_to_onnx.py#L480-L496 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | PreChoicebook | (*args, **kwargs) | return val | PreChoicebook() -> Choicebook | PreChoicebook() -> Choicebook | [
"PreChoicebook",
"()",
"-",
">",
"Choicebook"
] | def PreChoicebook(*args, **kwargs):
"""PreChoicebook() -> Choicebook"""
val = _controls_.new_PreChoicebook(*args, **kwargs)
return val | [
"def",
"PreChoicebook",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_controls_",
".",
"new_PreChoicebook",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L3285-L3288 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/internal/platform/power_monitor/android_dumpsys_power_monitor.py | python | DumpsysPowerMonitor.__init__ | (self, battery, platform_backend) | Constructor.
Args:
battery: A BatteryUtil instance.
platform_backend: A LinuxBasedPlatformBackend instance. | Constructor. | [
"Constructor",
"."
] | def __init__(self, battery, platform_backend):
"""Constructor.
Args:
battery: A BatteryUtil instance.
platform_backend: A LinuxBasedPlatformBackend instance.
"""
super(DumpsysPowerMonitor, self).__init__()
self._battery = battery
self._browser = None
self._platform = platfor... | [
"def",
"__init__",
"(",
"self",
",",
"battery",
",",
"platform_backend",
")",
":",
"super",
"(",
"DumpsysPowerMonitor",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_battery",
"=",
"battery",
"self",
".",
"_browser",
"=",
"None",
"self",
".... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/platform/power_monitor/android_dumpsys_power_monitor.py#L16-L26 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py | python | ConfigObj._a_to_u | (self, aString) | Decode ASCII strings to unicode if a self.encoding is specified. | Decode ASCII strings to unicode if a self.encoding is specified. | [
"Decode",
"ASCII",
"strings",
"to",
"unicode",
"if",
"a",
"self",
".",
"encoding",
"is",
"specified",
"."
] | def _a_to_u(self, aString):
"""Decode ASCII strings to unicode if a self.encoding is specified."""
if self.encoding:
return aString.decode('ascii')
else:
return aString | [
"def",
"_a_to_u",
"(",
"self",
",",
"aString",
")",
":",
"if",
"self",
".",
"encoding",
":",
"return",
"aString",
".",
"decode",
"(",
"'ascii'",
")",
"else",
":",
"return",
"aString"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py#L1486-L1491 | ||
facebook/folly | 744a0a698074d1b013813065fe60f545aa2c9b94 | build/fbcode_builder/getdeps/manifest.py | python | ManifestParser.get_section_as_ordered_pairs | (self, section, ctx=None) | return res | Used for eg: shipit.pathmap which has strong
ordering requirements | Used for eg: shipit.pathmap which has strong
ordering requirements | [
"Used",
"for",
"eg",
":",
"shipit",
".",
"pathmap",
"which",
"has",
"strong",
"ordering",
"requirements"
] | def get_section_as_ordered_pairs(self, section, ctx=None):
"""Used for eg: shipit.pathmap which has strong
ordering requirements"""
res = []
ctx = ctx or {}
for s in self._config.sections():
if s != section:
if not s.startswith(section + "."):
... | [
"def",
"get_section_as_ordered_pairs",
"(",
"self",
",",
"section",
",",
"ctx",
"=",
"None",
")",
":",
"res",
"=",
"[",
"]",
"ctx",
"=",
"ctx",
"or",
"{",
"}",
"for",
"s",
"in",
"self",
".",
"_config",
".",
"sections",
"(",
")",
":",
"if",
"s",
"... | https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/getdeps/manifest.py#L295-L312 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/m5/ext/pyfdt/pyfdt.py | python | FdtPropertyWords.__len__ | (self) | return len(self.words) | Get words count | Get words count | [
"Get",
"words",
"count"
] | def __len__(self):
"""Get words count"""
return len(self.words) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"words",
")"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/m5/ext/pyfdt/pyfdt.py#L307-L309 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | CloseEvent.GetLoggingOff | (*args, **kwargs) | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) | GetLoggingOff(self) -> bool
Returns ``True`` if the user is logging off or ``False`` if the
system is shutting down. This method can only be called for end
session and query end session events, it doesn't make sense for close
window event. | GetLoggingOff(self) -> bool | [
"GetLoggingOff",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetLoggingOff(*args, **kwargs):
"""
GetLoggingOff(self) -> bool
Returns ``True`` if the user is logging off or ``False`` if the
system is shutting down. This method can only be called for end
session and query end session events, it doesn't make sense for close
windo... | [
"def",
"GetLoggingOff",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"CloseEvent_GetLoggingOff",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L6516-L6525 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLCollectData.py | python | DirectILLCollectData._monitorIndex | (self, monWS) | return monIndex | Return the workspace index of the main monitor. | Return the workspace index of the main monitor. | [
"Return",
"the",
"workspace",
"index",
"of",
"the",
"main",
"monitor",
"."
] | def _monitorIndex(self, monWS):
"""Return the workspace index of the main monitor."""
if self.getProperty(common.PROP_MON_INDEX).isDefault:
NON_RECURSIVE = False # Prevent recursive calls in the following.
if not monWS.getInstrument().hasParameter('default-incident-monitor-spect... | [
"def",
"_monitorIndex",
"(",
"self",
",",
"monWS",
")",
":",
"if",
"self",
".",
"getProperty",
"(",
"common",
".",
"PROP_MON_INDEX",
")",
".",
"isDefault",
":",
"NON_RECURSIVE",
"=",
"False",
"# Prevent recursive calls in the following.",
"if",
"not",
"monWS",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLCollectData.py#L754-L766 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | PyApp_SetMacPreferencesMenuItemId | (*args, **kwargs) | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | PyApp_SetMacPreferencesMenuItemId(long val) | PyApp_SetMacPreferencesMenuItemId(long val) | [
"PyApp_SetMacPreferencesMenuItemId",
"(",
"long",
"val",
")"
] | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
"""PyApp_SetMacPreferencesMenuItemId(long val)"""
return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | [
"def",
"PyApp_SetMacPreferencesMenuItemId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_SetMacPreferencesMenuItemId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L8302-L8304 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiManager.DoFrameLayout | (self) | This is an internal function which invokes :meth:`Sizer.Layout() <Sizer.Layout>`
on the frame's main sizer, then measures all the various UI items
and updates their internal rectangles.
:note: This should always be called instead of calling
`self._managed_window.Layout()` directly. | This is an internal function which invokes :meth:`Sizer.Layout() <Sizer.Layout>`
on the frame's main sizer, then measures all the various UI items
and updates their internal rectangles. | [
"This",
"is",
"an",
"internal",
"function",
"which",
"invokes",
":",
"meth",
":",
"Sizer",
".",
"Layout",
"()",
"<Sizer",
".",
"Layout",
">",
"on",
"the",
"frame",
"s",
"main",
"sizer",
"then",
"measures",
"all",
"the",
"various",
"UI",
"items",
"and",
... | def DoFrameLayout(self):
"""
This is an internal function which invokes :meth:`Sizer.Layout() <Sizer.Layout>`
on the frame's main sizer, then measures all the various UI items
and updates their internal rectangles.
:note: This should always be called instead of calling
... | [
"def",
"DoFrameLayout",
"(",
"self",
")",
":",
"self",
".",
"_frame",
".",
"Layout",
"(",
")",
"for",
"part",
"in",
"self",
".",
"_uiparts",
":",
"# get the rectangle of the UI part",
"# originally, this code looked like this:",
"# part.rect = wx.Rect(part.sizer_item.G... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L6855-L6897 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/robotinfo.py | python | RobotInfo.listResources | (self) | return [item for item in os.listdir(resourceDir)] | Retrieves a list of all named resources, if resourceDir is set | Retrieves a list of all named resources, if resourceDir is set | [
"Retrieves",
"a",
"list",
"of",
"all",
"named",
"resources",
"if",
"resourceDir",
"is",
"set"
] | def listResources(self) -> List[str]:
"""Retrieves a list of all named resources, if resourceDir is set"""
if self.resourceDir is None:
return []
import os
resourceDir = _resolve_file(self.resourceDir,self.filePaths)
return [item for item in os.listdir(resourceDir)] | [
"def",
"listResources",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"if",
"self",
".",
"resourceDir",
"is",
"None",
":",
"return",
"[",
"]",
"import",
"os",
"resourceDir",
"=",
"_resolve_file",
"(",
"self",
".",
"resourceDir",
",",
"self",
".... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/robotinfo.py#L393-L399 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.GetOutlineLevel | (*args, **kwargs) | return _controls_.TextAttr_GetOutlineLevel(*args, **kwargs) | GetOutlineLevel(self) -> int | GetOutlineLevel(self) -> int | [
"GetOutlineLevel",
"(",
"self",
")",
"-",
">",
"int"
] | def GetOutlineLevel(*args, **kwargs):
"""GetOutlineLevel(self) -> int"""
return _controls_.TextAttr_GetOutlineLevel(*args, **kwargs) | [
"def",
"GetOutlineLevel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetOutlineLevel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1764-L1766 | |
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/optimal_learning/python/interfaces/optimization_interface.py | python | OptimizableInterface.set_current_point | (self, current_point) | Set current_point to the specified point; ordering must match.
:param current_point: current_point at which to evaluate the objective function, ``f(x)``
:type current_point: array of float64 with shape (problem_size) | Set current_point to the specified point; ordering must match. | [
"Set",
"current_point",
"to",
"the",
"specified",
"point",
";",
"ordering",
"must",
"match",
"."
] | def set_current_point(self, current_point):
"""Set current_point to the specified point; ordering must match.
:param current_point: current_point at which to evaluate the objective function, ``f(x)``
:type current_point: array of float64 with shape (problem_size)
"""
pass | [
"def",
"set_current_point",
"(",
"self",
",",
"current_point",
")",
":",
"pass"
] | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/interfaces/optimization_interface.py#L51-L58 | ||
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armoryengine/Networking.py | python | str_to_binary | (addrBin) | return ''.join([chr(int(a)) for a in addrBin.split('.')]) | I should come up with a better name for this -- it's net-addr only | I should come up with a better name for this -- it's net-addr only | [
"I",
"should",
"come",
"up",
"with",
"a",
"better",
"name",
"for",
"this",
"--",
"it",
"s",
"net",
"-",
"addr",
"only"
] | def str_to_binary(addrBin):
""" I should come up with a better name for this -- it's net-addr only """
return ''.join([chr(int(a)) for a in addrBin.split('.')]) | [
"def",
"str_to_binary",
"(",
"addrBin",
")",
":",
"return",
"''",
".",
"join",
"(",
"[",
"chr",
"(",
"int",
"(",
"a",
")",
")",
"for",
"a",
"in",
"addrBin",
".",
"split",
"(",
"'.'",
")",
"]",
")"
] | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/Networking.py#L407-L409 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/email/header.py | python | Header.encode | (self, splitchars=';, ') | return self._encode_chunks(newchunks, maxlinelen) | Encode a message header into an RFC-compliant format.
There are many issues involved in converting a given string for use in
an email header. Only certain character sets are readable in most
email clients, and as header strings can only contain a subset of
7-bit ASCII, care must be tak... | Encode a message header into an RFC-compliant format. | [
"Encode",
"a",
"message",
"header",
"into",
"an",
"RFC",
"-",
"compliant",
"format",
"."
] | def encode(self, splitchars=';, '):
"""Encode a message header into an RFC-compliant format.
There are many issues involved in converting a given string for use in
an email header. Only certain character sets are readable in most
email clients, and as header strings can only contain a ... | [
"def",
"encode",
"(",
"self",
",",
"splitchars",
"=",
"';, '",
")",
":",
"newchunks",
"=",
"[",
"]",
"maxlinelen",
"=",
"self",
".",
"_firstlinelen",
"lastlen",
"=",
"0",
"for",
"s",
",",
"charset",
"in",
"self",
".",
"_chunks",
":",
"# The first bit of ... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/email/header.py#L367-L403 | |
rrwick/Unicycler | 96ffea71e3a78d63ade19d6124946773e65cf129 | unicycler/minimap_alignment.py | python | MinimapAlignment.overlaps_reference | (self) | return adjusted_contig_start < 0 or adjusted_contig_end >= self.ref_length | Returns true if the alignment overlaps either end of the reference. | Returns true if the alignment overlaps either end of the reference. | [
"Returns",
"true",
"if",
"the",
"alignment",
"overlaps",
"either",
"end",
"of",
"the",
"reference",
"."
] | def overlaps_reference(self):
"""
Returns true if the alignment overlaps either end of the reference.
"""
adjusted_contig_start = self.ref_start - self.read_start
adjusted_contig_end = self.ref_end + self.read_end_gap
return adjusted_contig_start < 0 or adjusted_contig_en... | [
"def",
"overlaps_reference",
"(",
"self",
")",
":",
"adjusted_contig_start",
"=",
"self",
".",
"ref_start",
"-",
"self",
".",
"read_start",
"adjusted_contig_end",
"=",
"self",
".",
"ref_end",
"+",
"self",
".",
"read_end_gap",
"return",
"adjusted_contig_start",
"<"... | https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/minimap_alignment.py#L89-L95 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillSample.py | python | DrillSample.onProcessSuccess | (self) | Triggered when the sample process succeed. | Triggered when the sample process succeed. | [
"Triggered",
"when",
"the",
"sample",
"process",
"succeed",
"."
] | def onProcessSuccess(self):
"""
Triggered when the sample process succeed.
"""
logger.information("Processing of sample {0} finished with sucess"
.format(self._index + 1))
self._status = self.STATUS_PROCESSED
self.statusChanged.emit() | [
"def",
"onProcessSuccess",
"(",
"self",
")",
":",
"logger",
".",
"information",
"(",
"\"Processing of sample {0} finished with sucess\"",
".",
"format",
"(",
"self",
".",
"_index",
"+",
"1",
")",
")",
"self",
".",
"_status",
"=",
"self",
".",
"STATUS_PROCESSED",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillSample.py#L262-L269 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py | python | matmul | (a,
b,
transpose_a=False,
transpose_b=False,
adjoint_a=False,
adjoint_b=False,
a_is_sparse=False,
b_is_sparse=False,
name=None) | Multiplies matrix `a` by matrix `b`, producing `a` * `b`.
The inputs must, following any transpositions, be tensors of rank >= 2
where the inner 2 dimensions specify valid matrix multiplication arguments,
and any further outer dimensions match.
Both matrices must be of the same type. The supported types are:
... | Multiplies matrix `a` by matrix `b`, producing `a` * `b`. | [
"Multiplies",
"matrix",
"a",
"by",
"matrix",
"b",
"producing",
"a",
"*",
"b",
"."
] | def matmul(a,
b,
transpose_a=False,
transpose_b=False,
adjoint_a=False,
adjoint_b=False,
a_is_sparse=False,
b_is_sparse=False,
name=None):
"""Multiplies matrix `a` by matrix `b`, producing `a` * `b`.
The inputs must, following ... | [
"def",
"matmul",
"(",
"a",
",",
"b",
",",
"transpose_a",
"=",
"False",
",",
"transpose_b",
"=",
"False",
",",
"adjoint_a",
"=",
"False",
",",
"adjoint_b",
"=",
"False",
",",
"a_is_sparse",
"=",
"False",
",",
"b_is_sparse",
"=",
"False",
",",
"name",
"=... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py#L2567-L2754 | ||
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.spelling | (self) | return self._spelling | Return the spelling of the entity pointed at by the cursor. | Return the spelling of the entity pointed at by the cursor. | [
"Return",
"the",
"spelling",
"of",
"the",
"entity",
"pointed",
"at",
"by",
"the",
"cursor",
"."
] | def spelling(self):
"""Return the spelling of the entity pointed at by the cursor."""
if not self.kind.is_declaration():
# FIXME: clang_getCursorSpelling should be fixed to not assert on
# this, for consistency with clang_getCursorUSR.
return None
if not hasat... | [
"def",
"spelling",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"kind",
".",
"is_declaration",
"(",
")",
":",
"# FIXME: clang_getCursorSpelling should be fixed to not assert on",
"# this, for consistency with clang_getCursorUSR.",
"return",
"None",
"if",
"not",
"hasat... | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1103-L1112 | |
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/google/protobuf/service.py | python | RpcController.NotifyOnCancel | (self, callback) | Sets a callback to invoke on cancel.
Asks that the given callback be called when the RPC is canceled. The
callback will always be called exactly once. If the RPC completes without
being canceled, the callback will be called after completion. If the RPC
has already been canceled when NotifyOnCancel()... | Sets a callback to invoke on cancel. | [
"Sets",
"a",
"callback",
"to",
"invoke",
"on",
"cancel",
"."
] | def NotifyOnCancel(self, callback):
"""Sets a callback to invoke on cancel.
Asks that the given callback be called when the RPC is canceled. The
callback will always be called exactly once. If the RPC completes without
being canceled, the callback will be called after completion. If the RPC
has ... | [
"def",
"NotifyOnCancel",
"(",
"self",
",",
"callback",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/service.py#L187-L198 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/client.py | python | GoogleCredentials._get_implicit_credentials | (cls) | Gets credentials implicitly from the environment.
Checks environment in order of precedence:
- Google App Engine (production and testing)
- Environment variable GOOGLE_APPLICATION_CREDENTIALS pointing to
a file with stored credentials information.
- Stored "well known" file associated with `gclou... | Gets credentials implicitly from the environment. | [
"Gets",
"credentials",
"implicitly",
"from",
"the",
"environment",
"."
] | def _get_implicit_credentials(cls):
"""Gets credentials implicitly from the environment.
Checks environment in order of precedence:
- Google App Engine (production and testing)
- Environment variable GOOGLE_APPLICATION_CREDENTIALS pointing to
a file with stored credentials information.
- Stor... | [
"def",
"_get_implicit_credentials",
"(",
"cls",
")",
":",
"env_name",
"=",
"_get_environment",
"(",
")",
"# Environ checks (in order). Assumes each checker takes `env_name`",
"# as a kwarg.",
"environ_checkers",
"=",
"[",
"cls",
".",
"_implicit_credentials_from_gae",
",",
"cl... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/client.py#L1166-L1196 | ||
vgough/encfs | c444f9b9176beea1ad41a7b2e29ca26e709b57f7 | vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py | python | PrintUsage | (message) | Prints a brief usage string and exits, optionally with an error message.
Args:
message: The optional error message. | Prints a brief usage string and exits, optionally with an error message. | [
"Prints",
"a",
"brief",
"usage",
"string",
"and",
"exits",
"optionally",
"with",
"an",
"error",
"message",
"."
] | def PrintUsage(message):
"""Prints a brief usage string and exits, optionally with an error message.
Args:
message: The optional error message.
"""
sys.stderr.write(_USAGE)
if message:
sys.exit('\nFATAL ERROR: ' + message)
else:
sys.exit(1) | [
"def",
"PrintUsage",
"(",
"message",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"_USAGE",
")",
"if",
"message",
":",
"sys",
".",
"exit",
"(",
"'\\nFATAL ERROR: '",
"+",
"message",
")",
"else",
":",
"sys",
".",
"exit",
"(",
"1",
")"
] | https://github.com/vgough/encfs/blob/c444f9b9176beea1ad41a7b2e29ca26e709b57f7/vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py#L4632-L4642 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/telemetry/core/platform/posix_platform_backend.py | python | PosixPlatformBackend._GetPsOutput | (self, columns, pid=None) | return self._RunCommand(args).splitlines() | Returns output of the 'ps' command as a list of lines.
Subclass should override this function.
Args:
columns: A list of require columns, e.g., ['pid', 'pss'].
pid: If nont None, returns only the information of the process
with the pid. | Returns output of the 'ps' command as a list of lines.
Subclass should override this function. | [
"Returns",
"output",
"of",
"the",
"ps",
"command",
"as",
"a",
"list",
"of",
"lines",
".",
"Subclass",
"should",
"override",
"this",
"function",
"."
] | def _GetPsOutput(self, columns, pid=None):
"""Returns output of the 'ps' command as a list of lines.
Subclass should override this function.
Args:
columns: A list of require columns, e.g., ['pid', 'pss'].
pid: If nont None, returns only the information of the process
with the pid.
... | [
"def",
"_GetPsOutput",
"(",
"self",
",",
"columns",
",",
"pid",
"=",
"None",
")",
":",
"args",
"=",
"[",
"'ps'",
"]",
"args",
".",
"extend",
"(",
"[",
"'-p'",
",",
"str",
"(",
"pid",
")",
"]",
"if",
"pid",
"!=",
"None",
"else",
"[",
"'-e'",
"]"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/platform/posix_platform_backend.py#L28-L41 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic.py | python | Context.declare | (self,func,fname=None,fargs=None) | Declares a custom function. If fname is provided, this will be how
the function will be referenced. Otherwise, the Python name of the
function is used.
Args:
func (function or :class:`Expression`): the function / expression
object
fname (str, optional):... | Declares a custom function. If fname is provided, this will be how
the function will be referenced. Otherwise, the Python name of the
function is used. | [
"Declares",
"a",
"custom",
"function",
".",
"If",
"fname",
"is",
"provided",
"this",
"will",
"be",
"how",
"the",
"function",
"will",
"be",
"referenced",
".",
"Otherwise",
"the",
"Python",
"name",
"of",
"the",
"function",
"is",
"used",
"."
] | def declare(self,func,fname=None,fargs=None):
"""Declares a custom function. If fname is provided, this will be how
the function will be referenced. Otherwise, the Python name of the
function is used.
Args:
func (function or :class:`Expression`): the function / expression
... | [
"def",
"declare",
"(",
"self",
",",
"func",
",",
"fname",
"=",
"None",
",",
"fargs",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"func",
",",
"Function",
")",
":",
"if",
"fname",
"is",
"None",
":",
"fname",
"=",
"func",
".",
"name",
"import",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L1237-L1280 | ||
physercoe/starquant | c00cad64d1de2da05081b3dc320ef264c6295e08 | source/engine/strategy_engine.py | python | StrategyEngine.remove_strategy | (self, strategy_name: str, duplicate: bool = False) | return True | Remove a strategy. | Remove a strategy. | [
"Remove",
"a",
"strategy",
"."
] | def remove_strategy(self, strategy_name: str, duplicate: bool = False):
"""
Remove a strategy.
"""
print("begin remove")
strategy = self.strategies[strategy_name]
if strategy.trading:
self.write_log(f"策略{strategy.strategy_name}移除失败,请先停止")
return
... | [
"def",
"remove_strategy",
"(",
"self",
",",
"strategy_name",
":",
"str",
",",
"duplicate",
":",
"bool",
"=",
"False",
")",
":",
"print",
"(",
"\"begin remove\"",
")",
"strategy",
"=",
"self",
".",
"strategies",
"[",
"strategy_name",
"]",
"if",
"strategy",
... | https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/source/engine/strategy_engine.py#L586-L616 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | utils/lui/lldbutil.py | python | run_break_set_by_file_and_line | (
test,
file_name,
line_number,
extra_options=None,
num_expected_locations=1,
loc_exact=False,
module_name=None) | return get_bpno_from_match(break_results) | Set a breakpoint by file and line, returning the breakpoint number.
If extra_options is not None, then we append it to the breakpoint set command.
If num_expected_locations is -1 we check that we got AT LEAST one location, otherwise we check that num_expected_locations equals the number of locations.
If ... | Set a breakpoint by file and line, returning the breakpoint number. | [
"Set",
"a",
"breakpoint",
"by",
"file",
"and",
"line",
"returning",
"the",
"breakpoint",
"number",
"."
] | def run_break_set_by_file_and_line(
test,
file_name,
line_number,
extra_options=None,
num_expected_locations=1,
loc_exact=False,
module_name=None):
"""Set a breakpoint by file and line, returning the breakpoint number.
If extra_options is not None, then w... | [
"def",
"run_break_set_by_file_and_line",
"(",
"test",
",",
"file_name",
",",
"line_number",
",",
"extra_options",
"=",
"None",
",",
"num_expected_locations",
"=",
"1",
",",
"loc_exact",
"=",
"False",
",",
"module_name",
"=",
"None",
")",
":",
"if",
"file_name",
... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/utils/lui/lldbutil.py#L321-L364 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | MenuItem.GetItemLabelText | (*args, **kwargs) | return _core_.MenuItem_GetItemLabelText(*args, **kwargs) | GetItemLabelText(self) -> String | GetItemLabelText(self) -> String | [
"GetItemLabelText",
"(",
"self",
")",
"-",
">",
"String"
] | def GetItemLabelText(*args, **kwargs):
"""GetItemLabelText(self) -> String"""
return _core_.MenuItem_GetItemLabelText(*args, **kwargs) | [
"def",
"GetItemLabelText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_GetItemLabelText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12471-L12473 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/debug/cli/debugger_cli_common.py | python | CommandHandlerRegistry._resolve_prefix | (self, token) | Resolve command prefix from the prefix itself or its alias.
Args:
token: a str to be resolved.
Returns:
If resolvable, the resolved command prefix.
If not resolvable, None. | Resolve command prefix from the prefix itself or its alias. | [
"Resolve",
"command",
"prefix",
"from",
"the",
"prefix",
"itself",
"or",
"its",
"alias",
"."
] | def _resolve_prefix(self, token):
"""Resolve command prefix from the prefix itself or its alias.
Args:
token: a str to be resolved.
Returns:
If resolvable, the resolved command prefix.
If not resolvable, None.
"""
if token in self._handlers:
return token
elif token in s... | [
"def",
"_resolve_prefix",
"(",
"self",
",",
"token",
")",
":",
"if",
"token",
"in",
"self",
".",
"_handlers",
":",
"return",
"token",
"elif",
"token",
"in",
"self",
".",
"_alias_to_prefix",
":",
"return",
"self",
".",
"_alias_to_prefix",
"[",
"token",
"]",... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/debug/cli/debugger_cli_common.py#L484-L499 | ||
zhaoweicai/cascade-rcnn | 2252f46158ea6555868ca6fa5c221ea71d9b5e6c | python/caffe/net_spec.py | python | param_name_dict | () | return dict(zip(param_type_names, param_names)) | Find out the correspondence between layer names and parameter names. | Find out the correspondence between layer names and parameter names. | [
"Find",
"out",
"the",
"correspondence",
"between",
"layer",
"names",
"and",
"parameter",
"names",
"."
] | def param_name_dict():
"""Find out the correspondence between layer names and parameter names."""
layer = caffe_pb2.LayerParameter()
# get all parameter names (typically underscore case) and corresponding
# type names (typically camel case), which contain the layer names
# (note that not all parame... | [
"def",
"param_name_dict",
"(",
")",
":",
"layer",
"=",
"caffe_pb2",
".",
"LayerParameter",
"(",
")",
"# get all parameter names (typically underscore case) and corresponding",
"# type names (typically camel case), which contain the layer names",
"# (note that not all parameters correspon... | https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/python/caffe/net_spec.py#L28-L40 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/simple.py | python | demo2 | (fname="/Users/berk/Work/ParaView/ParaViewData/Data/disk_out_ref.ex2") | This demo shows the use of readers, data information and display
properties. | This demo shows the use of readers, data information and display
properties. | [
"This",
"demo",
"shows",
"the",
"use",
"of",
"readers",
"data",
"information",
"and",
"display",
"properties",
"."
] | def demo2(fname="/Users/berk/Work/ParaView/ParaViewData/Data/disk_out_ref.ex2"):
"""This demo shows the use of readers, data information and display
properties."""
# Create the exodus reader and specify a file name
reader = ExodusIIReader(FileName=fname)
# Get the list of point arrays.
avail = ... | [
"def",
"demo2",
"(",
"fname",
"=",
"\"/Users/berk/Work/ParaView/ParaViewData/Data/disk_out_ref.ex2\"",
")",
":",
"# Create the exodus reader and specify a file name",
"reader",
"=",
"ExodusIIReader",
"(",
"FileName",
"=",
"fname",
")",
"# Get the list of point arrays.",
"avail",
... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/simple.py#L2576-L2622 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_edge.py | python | EdgeDomain.getLastStepMeanSpeed | (self, edgeID) | return self._getUniversal(tc.LAST_STEP_MEAN_SPEED, edgeID) | getLastStepMeanSpeed(string) -> double
Returns the average speed in m/s for the last time step on the given edge. | getLastStepMeanSpeed(string) -> double | [
"getLastStepMeanSpeed",
"(",
"string",
")",
"-",
">",
"double"
] | def getLastStepMeanSpeed(self, edgeID):
"""getLastStepMeanSpeed(string) -> double
Returns the average speed in m/s for the last time step on the given edge.
"""
return self._getUniversal(tc.LAST_STEP_MEAN_SPEED, edgeID) | [
"def",
"getLastStepMeanSpeed",
"(",
"self",
",",
"edgeID",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"LAST_STEP_MEAN_SPEED",
",",
"edgeID",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_edge.py#L112-L117 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/index/package_finder.py | python | _find_name_version_sep | (fragment, canonical_name) | Find the separator's index based on the package's canonical name.
:param fragment: A <package>+<version> filename "fragment" (stem) or
egg fragment.
:param canonical_name: The package's canonical name.
This function is needed since the canonicalized name does not necessarily
have the sa... | Find the separator's index based on the package's canonical name. | [
"Find",
"the",
"separator",
"s",
"index",
"based",
"on",
"the",
"package",
"s",
"canonical",
"name",
"."
] | def _find_name_version_sep(fragment, canonical_name):
# type: (str, str) -> int
"""Find the separator's index based on the package's canonical name.
:param fragment: A <package>+<version> filename "fragment" (stem) or
egg fragment.
:param canonical_name: The package's canonical name.
... | [
"def",
"_find_name_version_sep",
"(",
"fragment",
",",
"canonical_name",
")",
":",
"# type: (str, str) -> int",
"# Project name and version must be separated by one single dash. Find all",
"# occurrences of dashes; if the string in front of it matches the canonical",
"# name, this is the one s... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/index/package_finder.py#L1923-L1971 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.SelectionDuplicate | (*args, **kwargs) | return _stc.StyledTextCtrl_SelectionDuplicate(*args, **kwargs) | SelectionDuplicate(self)
Duplicate the selection. If selection empty duplicate the line containing the caret. | SelectionDuplicate(self) | [
"SelectionDuplicate",
"(",
"self",
")"
] | def SelectionDuplicate(*args, **kwargs):
"""
SelectionDuplicate(self)
Duplicate the selection. If selection empty duplicate the line containing the caret.
"""
return _stc.StyledTextCtrl_SelectionDuplicate(*args, **kwargs) | [
"def",
"SelectionDuplicate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SelectionDuplicate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L5607-L5613 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/environment.py | python | Environment.getitem | (self, obj, argument) | Get an item or attribute of an object but prefer the item. | Get an item or attribute of an object but prefer the item. | [
"Get",
"an",
"item",
"or",
"attribute",
"of",
"an",
"object",
"but",
"prefer",
"the",
"item",
"."
] | def getitem(self, obj, argument):
"""Get an item or attribute of an object but prefer the item."""
try:
return obj[argument]
except (TypeError, LookupError):
if isinstance(argument, string_types):
try:
attr = str(argument)
... | [
"def",
"getitem",
"(",
"self",
",",
"obj",
",",
"argument",
")",
":",
"try",
":",
"return",
"obj",
"[",
"argument",
"]",
"except",
"(",
"TypeError",
",",
"LookupError",
")",
":",
"if",
"isinstance",
"(",
"argument",
",",
"string_types",
")",
":",
"try"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/environment.py#L375-L390 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | demo/DPU-for-RNN/rnn_u25_u50lv/apps/customer_satisfaction/utils/hdf5_format.py | python | load_model_from_hdf5 | (filepath, custom_objects=None, compile=True) | return model | Loads a model saved via `save_model_to_hdf5`.
Arguments:
filepath: One of the following:
- String, path to the saved model
- `h5py.File` object from which to load the model
custom_objects: Optional dictionary mapping names
(strings) to custom classes or functions to be
... | Loads a model saved via `save_model_to_hdf5`. | [
"Loads",
"a",
"model",
"saved",
"via",
"save_model_to_hdf5",
"."
] | def load_model_from_hdf5(filepath, custom_objects=None, compile=True): # pylint: disable=redefined-builtin
"""Loads a model saved via `save_model_to_hdf5`.
Arguments:
filepath: One of the following:
- String, path to the saved model
- `h5py.File` object from which to load the model
... | [
"def",
"load_model_from_hdf5",
"(",
"filepath",
",",
"custom_objects",
"=",
"None",
",",
"compile",
"=",
"True",
")",
":",
"# pylint: disable=redefined-builtin",
"if",
"h5py",
"is",
"None",
":",
"raise",
"ImportError",
"(",
"'`load_model` requires h5py.'",
")",
"if"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/demo/DPU-for-RNN/rnn_u25_u50lv/apps/customer_satisfaction/utils/hdf5_format.py#L137-L225 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/linear_model/logistic.py | python | _multinomial_grad_hess | (w, X, Y, alpha, sample_weight) | return grad, hessp | Computes the gradient and the Hessian, in the case of a multinomial loss.
Parameters
----------
w : ndarray, shape (n_classes * n_features,) or
(n_classes * (n_features + 1),)
Coefficient vector.
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Training data.
... | Computes the gradient and the Hessian, in the case of a multinomial loss. | [
"Computes",
"the",
"gradient",
"and",
"the",
"Hessian",
"in",
"the",
"case",
"of",
"a",
"multinomial",
"loss",
"."
] | def _multinomial_grad_hess(w, X, Y, alpha, sample_weight):
"""
Computes the gradient and the Hessian, in the case of a multinomial loss.
Parameters
----------
w : ndarray, shape (n_classes * n_features,) or
(n_classes * (n_features + 1),)
Coefficient vector.
X : {array-like, sp... | [
"def",
"_multinomial_grad_hess",
"(",
"w",
",",
"X",
",",
"Y",
",",
"alpha",
",",
"sample_weight",
")",
":",
"n_features",
"=",
"X",
".",
"shape",
"[",
"1",
"]",
"n_classes",
"=",
"Y",
".",
"shape",
"[",
"1",
"]",
"fit_intercept",
"=",
"w",
".",
"s... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/linear_model/logistic.py#L351-L421 | |
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | scripts/upload.py | python | SubversionVCS.ReadFile | (self, filename) | return result | Returns the contents of a file. | Returns the contents of a file. | [
"Returns",
"the",
"contents",
"of",
"a",
"file",
"."
] | def ReadFile(self, filename):
"""Returns the contents of a file."""
file = open(filename, 'rb')
result = ""
try:
result = file.read()
finally:
file.close()
return result | [
"def",
"ReadFile",
"(",
"self",
",",
"filename",
")",
":",
"file",
"=",
"open",
"(",
"filename",
",",
"'rb'",
")",
"result",
"=",
"\"\"",
"try",
":",
"result",
"=",
"file",
".",
"read",
"(",
")",
"finally",
":",
"file",
".",
"close",
"(",
")",
"r... | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/scripts/upload.py#L1358-L1366 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool._GetTypeFromScope | (self, package, type_name, scope) | return scope[type_name] | Finds a given type name in the current scope.
Args:
package: The package the proto should be located in.
type_name: The name of the type to be found in the scope.
scope: Dict mapping short and full symbols to message and enum types.
Returns:
The descriptor for the requested type. | Finds a given type name in the current scope. | [
"Finds",
"a",
"given",
"type",
"name",
"in",
"the",
"current",
"scope",
"."
] | def _GetTypeFromScope(self, package, type_name, scope):
"""Finds a given type name in the current scope.
Args:
package: The package the proto should be located in.
type_name: The name of the type to be found in the scope.
scope: Dict mapping short and full symbols to message and enum types.
... | [
"def",
"_GetTypeFromScope",
"(",
"self",
",",
"package",
",",
"type_name",
",",
"scope",
")",
":",
"if",
"type_name",
"not",
"in",
"scope",
":",
"components",
"=",
"_PrefixWithDot",
"(",
"package",
")",
".",
"split",
"(",
"'.'",
")",
"while",
"components",... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/descriptor_pool.py#L777-L797 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/parse/torch_graph.py | python | TorchNode.description | (self) | return node_des | for ip in self._inputs:
if isinstance(ip, list):
node_des['in_value'].append([it.name for it in ip])
else:
node_des['in_value'].append(ip.name) | for ip in self._inputs:
if isinstance(ip, list):
node_des['in_value'].append([it.name for it in ip])
else:
node_des['in_value'].append(ip.name) | [
"for",
"ip",
"in",
"self",
".",
"_inputs",
":",
"if",
"isinstance",
"(",
"ip",
"list",
")",
":",
"node_des",
"[",
"in_value",
"]",
".",
"append",
"(",
"[",
"it",
".",
"name",
"for",
"it",
"in",
"ip",
"]",
")",
"else",
":",
"node_des",
"[",
"in_va... | def description(self):
node_des = {}
node_des['name'] = self.name
node_des['index'] = self.idx
node_des['kind'] = self.kind
node_des['dtype'] = self.dtype
node_des['in_nodes'] = [i.name for i in self._in_nodes]
node_des['out_nodes'] = [o.name for o in self._out_nodes]
node_des['in_value... | [
"def",
"description",
"(",
"self",
")",
":",
"node_des",
"=",
"{",
"}",
"node_des",
"[",
"'name'",
"]",
"=",
"self",
".",
"name",
"node_des",
"[",
"'index'",
"]",
"=",
"self",
".",
"idx",
"node_des",
"[",
"'kind'",
"]",
"=",
"self",
".",
"kind",
"n... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/parse/torch_graph.py#L331-L366 | |
tomz/libsvm-ruby-swig | 206178711168437fb899907e2fc8a9691c304204 | libsvm-3.1/python/svmutil.py | python | svm_load_model | (model_file_name) | return model | svm_load_model(model_file_name) -> model
Load a LIBSVM model from model_file_name and return. | svm_load_model(model_file_name) -> model
Load a LIBSVM model from model_file_name and return. | [
"svm_load_model",
"(",
"model_file_name",
")",
"-",
">",
"model",
"Load",
"a",
"LIBSVM",
"model",
"from",
"model_file_name",
"and",
"return",
"."
] | def svm_load_model(model_file_name):
"""
svm_load_model(model_file_name) -> model
Load a LIBSVM model from model_file_name and return.
"""
model = libsvm.svm_load_model(model_file_name)
if not model:
print("can't open model file %s" % model_file_name)
return None
model = toPyModel(model)
return model | [
"def",
"svm_load_model",
"(",
"model_file_name",
")",
":",
"model",
"=",
"libsvm",
".",
"svm_load_model",
"(",
"model_file_name",
")",
"if",
"not",
"model",
":",
"print",
"(",
"\"can't open model file %s\"",
"%",
"model_file_name",
")",
"return",
"None",
"model",
... | https://github.com/tomz/libsvm-ruby-swig/blob/206178711168437fb899907e2fc8a9691c304204/libsvm-3.1/python/svmutil.py#L27-L38 | |
Illumina/manta | 75b5c38d4fcd2f6961197b28a41eb61856f2d976 | src/python/libexec/sortEdgeLogs.py | python | ensureDir | (d) | make directory if it doesn't already exist, raise exception if
something else is in the way: | make directory if it doesn't already exist, raise exception if
something else is in the way: | [
"make",
"directory",
"if",
"it",
"doesn",
"t",
"already",
"exist",
"raise",
"exception",
"if",
"something",
"else",
"is",
"in",
"the",
"way",
":"
] | def ensureDir(d):
"""
make directory if it doesn't already exist, raise exception if
something else is in the way:
"""
if os.path.exists(d):
if not os.path.isdir(d) :
raise Exception("Can't create directory: %s" % (d))
else :
os.makedirs(d) | [
"def",
"ensureDir",
"(",
"d",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"d",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"d",
")",
":",
"raise",
"Exception",
"(",
"\"Can't create directory: %s\"",
"%",
"(",
"d",
")",
... | https://github.com/Illumina/manta/blob/75b5c38d4fcd2f6961197b28a41eb61856f2d976/src/python/libexec/sortEdgeLogs.py#L28-L37 | ||
AcademySoftwareFoundation/OpenColorIO | 73508eb5230374df8d96147a0627c015d359a641 | src/apps/pyociodisplay/pyociodisplay.py | python | ImageView.view | (self) | return self.view_box.currentText() | :return: OCIO view
:rtype: str | :return: OCIO view
:rtype: str | [
":",
"return",
":",
"OCIO",
"view",
":",
"rtype",
":",
"str"
] | def view(self):
"""
:return: OCIO view
:rtype: str
"""
return self.view_box.currentText() | [
"def",
"view",
"(",
"self",
")",
":",
"return",
"self",
".",
"view_box",
".",
"currentText",
"(",
")"
] | https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/73508eb5230374df8d96147a0627c015d359a641/src/apps/pyociodisplay/pyociodisplay.py#L1147-L1152 | |
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | cpplint.py | python | CleansedLines.NumLines | (self) | return self.num_lines | Returns the number of lines represented. | Returns the number of lines represented. | [
"Returns",
"the",
"number",
"of",
"lines",
"represented",
"."
] | def NumLines(self):
"""Returns the number of lines represented."""
return self.num_lines | [
"def",
"NumLines",
"(",
"self",
")",
":",
"return",
"self",
".",
"num_lines"
] | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/cpplint.py#L887-L889 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/moving_averages.py | python | ExponentialMovingAverage.variables_to_restore | (self, moving_avg_variables=None) | return name_map | Returns a map of names to `Variables` to restore.
If a variable has a moving average, use the moving average variable name as
the restore name; otherwise, use the variable name.
For example,
```python
variables_to_restore = ema.variables_to_restore()
saver = tf.train.Saver(variables_to_re... | Returns a map of names to `Variables` to restore. | [
"Returns",
"a",
"map",
"of",
"names",
"to",
"Variables",
"to",
"restore",
"."
] | def variables_to_restore(self, moving_avg_variables=None):
"""Returns a map of names to `Variables` to restore.
If a variable has a moving average, use the moving average variable name as
the restore name; otherwise, use the variable name.
For example,
```python
variables_to_restore = ema.v... | [
"def",
"variables_to_restore",
"(",
"self",
",",
"moving_avg_variables",
"=",
"None",
")",
":",
"name_map",
"=",
"{",
"}",
"if",
"moving_avg_variables",
"is",
"None",
":",
"# Include trainable variables and variables which have been explicitly",
"# added to the moving_average... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/moving_averages.py#L347-L392 | |
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.setSGroupParentId | (self, parent) | return self.dispatcher._checkResult(
Indigo._lib.indigoSetSGroupParentId(self.id, parent)
) | SGroup method sets parent id
Args:
parent (int): parent id
Returns:
int: 1 if there are no errors | SGroup method sets parent id | [
"SGroup",
"method",
"sets",
"parent",
"id"
] | def setSGroupParentId(self, parent):
"""SGroup method sets parent id
Args:
parent (int): parent id
Returns:
int: 1 if there are no errors
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResult(
Indigo._lib.indigoSetSG... | [
"def",
"setSGroupParentId",
"(",
"self",
",",
"parent",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoSetSGroupParentId",
"(",
"self",
".... | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L2165-L2177 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/frames.py | python | set_enabled | (filter_item, state) | Internal Worker function to set the frame-filter's enabled
state.
Arguments:
filter_item: An object conforming to the frame filter
interface.
state: True or False, depending on desired state. | Internal Worker function to set the frame-filter's enabled
state. | [
"Internal",
"Worker",
"function",
"to",
"set",
"the",
"frame",
"-",
"filter",
"s",
"enabled",
"state",
"."
] | def set_enabled(filter_item, state):
""" Internal Worker function to set the frame-filter's enabled
state.
Arguments:
filter_item: An object conforming to the frame filter
interface.
state: True or False, depending on desired state.
"""
filter_item.enabled = st... | [
"def",
"set_enabled",
"(",
"filter_item",
",",
"state",
")",
":",
"filter_item",
".",
"enabled",
"=",
"state"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/frames.py#L78-L88 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/compiler.py | python | CodeGenerator.write_commons | (self) | Writes a common preamble that is used by root and block functions.
Primarily this sets up common local helpers and enforces a generator
through a dead branch. | Writes a common preamble that is used by root and block functions.
Primarily this sets up common local helpers and enforces a generator
through a dead branch. | [
"Writes",
"a",
"common",
"preamble",
"that",
"is",
"used",
"by",
"root",
"and",
"block",
"functions",
".",
"Primarily",
"this",
"sets",
"up",
"common",
"local",
"helpers",
"and",
"enforces",
"a",
"generator",
"through",
"a",
"dead",
"branch",
"."
] | def write_commons(self):
"""Writes a common preamble that is used by root and block functions.
Primarily this sets up common local helpers and enforces a generator
through a dead branch.
"""
self.writeline('resolve = context.resolve_or_missing')
self.writeline('undefined ... | [
"def",
"write_commons",
"(",
"self",
")",
":",
"self",
".",
"writeline",
"(",
"'resolve = context.resolve_or_missing'",
")",
"self",
".",
"writeline",
"(",
"'undefined = environment.undefined'",
")",
"self",
".",
"writeline",
"(",
"'if 0: yield None'",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/compiler.py#L605-L612 | ||
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/bindings/python/clang/cindex.py | python | SourceLocation.from_position | (tu, file, line, column) | return conf.lib.clang_getLocation(tu, file, line, column) | Retrieve the source location associated with a given file/line/column in
a particular translation unit. | Retrieve the source location associated with a given file/line/column in
a particular translation unit. | [
"Retrieve",
"the",
"source",
"location",
"associated",
"with",
"a",
"given",
"file",
"/",
"line",
"/",
"column",
"in",
"a",
"particular",
"translation",
"unit",
"."
] | def from_position(tu, file, line, column):
"""
Retrieve the source location associated with a given file/line/column in
a particular translation unit.
"""
return conf.lib.clang_getLocation(tu, file, line, column) | [
"def",
"from_position",
"(",
"tu",
",",
"file",
",",
"line",
",",
"column",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getLocation",
"(",
"tu",
",",
"file",
",",
"line",
",",
"column",
")"
] | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/bindings/python/clang/cindex.py#L252-L257 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/media.py | python | MediaCtrl.ShowPlayerControls | (*args, **kwargs) | return _media.MediaCtrl_ShowPlayerControls(*args, **kwargs) | ShowPlayerControls(self, int flags=MEDIACTRLPLAYERCONTROLS_DEFAULT) -> bool | ShowPlayerControls(self, int flags=MEDIACTRLPLAYERCONTROLS_DEFAULT) -> bool | [
"ShowPlayerControls",
"(",
"self",
"int",
"flags",
"=",
"MEDIACTRLPLAYERCONTROLS_DEFAULT",
")",
"-",
">",
"bool"
] | def ShowPlayerControls(*args, **kwargs):
"""ShowPlayerControls(self, int flags=MEDIACTRLPLAYERCONTROLS_DEFAULT) -> bool"""
return _media.MediaCtrl_ShowPlayerControls(*args, **kwargs) | [
"def",
"ShowPlayerControls",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_media",
".",
"MediaCtrl_ShowPlayerControls",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/media.py#L153-L155 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/bisect_utils.py | python | OnAccessError | (func, path, exc_info) | Source: http://stackoverflow.com/questions/2656322/python-shutil-rmtree-fails-on-windows-with-access-is-denied
Error handler for ``shutil.rmtree``.
If the error is due to an access error (read only file)
it attempts to add write permission and then retries.
If the error is for another reason it re-raises the... | Source: http://stackoverflow.com/questions/2656322/python-shutil-rmtree-fails-on-windows-with-access-is-denied | [
"Source",
":",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"2656322",
"/",
"python",
"-",
"shutil",
"-",
"rmtree",
"-",
"fails",
"-",
"on",
"-",
"windows",
"-",
"with",
"-",
"access",
"-",
"is",
"-",
"denied"
] | def OnAccessError(func, path, exc_info):
"""
Source: http://stackoverflow.com/questions/2656322/python-shutil-rmtree-fails-on-windows-with-access-is-denied
Error handler for ``shutil.rmtree``.
If the error is due to an access error (read only file)
it attempts to add write permission and then retries.
If... | [
"def",
"OnAccessError",
"(",
"func",
",",
"path",
",",
"exc_info",
")",
":",
"if",
"not",
"os",
".",
"access",
"(",
"path",
",",
"os",
".",
"W_OK",
")",
":",
"# Is the error an access error ?",
"os",
".",
"chmod",
"(",
"path",
",",
"stat",
".",
"S_IWUS... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect_utils.py#L266-L287 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/kth-smallest-instructions.py | python | Solution.kthSmallestPath | (self, destination, k) | return "".join(result) | :type destination: List[int]
:type k: int
:rtype: str | :type destination: List[int]
:type k: int
:rtype: str | [
":",
"type",
"destination",
":",
"List",
"[",
"int",
"]",
":",
"type",
"k",
":",
"int",
":",
"rtype",
":",
"str"
] | def kthSmallestPath(self, destination, k):
"""
:type destination: List[int]
:type k: int
:rtype: str
"""
def nCr(n, r): # Time: O(n), Space: O(1)
if n < r:
return 0
if n-r < r:
return nCr(n, n-r)
c = 1
... | [
"def",
"kthSmallestPath",
"(",
"self",
",",
"destination",
",",
"k",
")",
":",
"def",
"nCr",
"(",
"n",
",",
"r",
")",
":",
"# Time: O(n), Space: O(1)",
"if",
"n",
"<",
"r",
":",
"return",
"0",
"if",
"n",
"-",
"r",
"<",
"r",
":",
"return",
"nCr",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/kth-smallest-instructions.py#L5-L33 | |
AojunZhou/Incremental-Network-Quantization | c7f6a609d5817d8424ce224209cf4c50f1e4de50 | scripts/cpp_lint.py | python | _ShouldPrintError | (category, confidence, linenum) | return True | If confidence >= verbose, category passes filter and is not suppressed. | If confidence >= verbose, category passes filter and is not suppressed. | [
"If",
"confidence",
">",
"=",
"verbose",
"category",
"passes",
"filter",
"and",
"is",
"not",
"suppressed",
"."
] | def _ShouldPrintError(category, confidence, linenum):
"""If confidence >= verbose, category passes filter and is not suppressed."""
# There are three ways we might decide not to print an error message:
# a "NOLINT(category)" comment appears in the source,
# the verbosity level isn't high enough, or the filters... | [
"def",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"# There are three ways we might decide not to print an error message:",
"# a \"NOLINT(category)\" comment appears in the source,",
"# the verbosity level isn't high enough, or the filters filter it out... | https://github.com/AojunZhou/Incremental-Network-Quantization/blob/c7f6a609d5817d8424ce224209cf4c50f1e4de50/scripts/cpp_lint.py#L961-L985 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | Dialog.GetModality | (*args, **kwargs) | return _windows_.Dialog_GetModality(*args, **kwargs) | GetModality(self) -> int | GetModality(self) -> int | [
"GetModality",
"(",
"self",
")",
"-",
">",
"int"
] | def GetModality(*args, **kwargs):
"""GetModality(self) -> int"""
return _windows_.Dialog_GetModality(*args, **kwargs) | [
"def",
"GetModality",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"Dialog_GetModality",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L887-L889 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/MSVS/__init__.py | python | InsertLargePdbShims | (target_list, target_dicts, gyp_vars) | return target_list, target_dicts | Insert a shim target that forces the linker to use 4KB pagesize PDBs.
This is a workaround for targets with PDBs greater than 1GB in size, the
limit for the 1KB pagesize PDBs created by the linker by default.
Arguments:
target_list: List of target pairs: 'base/base.gyp:base'.
target_dicts: Dict of targe... | Insert a shim target that forces the linker to use 4KB pagesize PDBs. | [
"Insert",
"a",
"shim",
"target",
"that",
"forces",
"the",
"linker",
"to",
"use",
"4KB",
"pagesize",
"PDBs",
"."
] | def InsertLargePdbShims(target_list, target_dicts, gyp_vars):
"""Insert a shim target that forces the linker to use 4KB pagesize PDBs.
This is a workaround for targets with PDBs greater than 1GB in size, the
limit for the 1KB pagesize PDBs created by the linker by default.
Arguments:
target_list: List of ... | [
"def",
"InsertLargePdbShims",
"(",
"target_list",
",",
"target_dicts",
",",
"gyp_vars",
")",
":",
"# Determine which targets need shimming.",
"targets_to_shim",
"=",
"[",
"]",
"for",
"t",
"in",
"target_dicts",
":",
"target_dict",
"=",
"target_dicts",
"[",
"t",
"]",
... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/MSVS/__init__.py#L228-L330 | |
dmtcp/dmtcp | 48a23686e1ce6784829b783ced9c62a14d620507 | util/dmtcp-style.py | python | LinterBase.run_lint | (self, source_paths) | A custom function to provide linting for 'linter_type'.
It takes a list of source files to lint and returns the number
of errors found during the linting process.
It should print any errors as it encounters them to provide
feedback to the caller. | A custom function to provide linting for 'linter_type'.
It takes a list of source files to lint and returns the number
of errors found during the linting process. | [
"A",
"custom",
"function",
"to",
"provide",
"linting",
"for",
"linter_type",
".",
"It",
"takes",
"a",
"list",
"of",
"source",
"files",
"to",
"lint",
"and",
"returns",
"the",
"number",
"of",
"errors",
"found",
"during",
"the",
"linting",
"process",
"."
] | def run_lint(self, source_paths):
'''
A custom function to provide linting for 'linter_type'.
It takes a list of source files to lint and returns the number
of errors found during the linting process.
It should print any errors as it encounters them to provide
feedback t... | [
"def",
"run_lint",
"(",
"self",
",",
"source_paths",
")",
":",
"pass"
] | https://github.com/dmtcp/dmtcp/blob/48a23686e1ce6784829b783ced9c62a14d620507/util/dmtcp-style.py#L72-L81 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ribbon/page.py | python | RibbonPage.OnEraseBackground | (self, event) | Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`RibbonPage`.
:param `event`: a :class:`EraseEvent` event to be processed. | Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`RibbonPage`. | [
"Handles",
"the",
"wx",
".",
"EVT_ERASE_BACKGROUND",
"event",
"for",
":",
"class",
":",
"RibbonPage",
"."
] | def OnEraseBackground(self, event):
"""
Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`RibbonPage`.
:param `event`: a :class:`EraseEvent` event to be processed.
"""
# All painting done in main paint handler to minimise flicker
pass | [
"def",
"OnEraseBackground",
"(",
"self",
",",
"event",
")",
":",
"# All painting done in main paint handler to minimise flicker",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/page.py#L201-L209 | ||
p4lang/behavioral-model | 81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9 | tools/cpplint.py | python | CheckIncludeLine | (filename, clean_lines, linenum, include_state, error) | Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage must be put here.
Args:
filename: The name of the current file.
clean_l... | Check rules that are applicable to #include lines. | [
"Check",
"rules",
"that",
"are",
"applicable",
"to",
"#include",
"lines",
"."
] | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
"""Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage m... | [
"def",
"CheckIncludeLine",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"include_state",
",",
"error",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"# \"include\" shoul... | https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L5047-L5134 | ||
wesnoth/wesnoth | 6ccac5a5e8ff75303c9190c0da60580925cb32c0 | data/tools/wesnoth/wmldata.py | python | DataSub.set_text_val | (self, name, value, delete_if = None, translatable = False,
textdomain = "") | For the lazy. | For the lazy. | [
"For",
"the",
"lazy",
"."
] | def set_text_val(self, name, value, delete_if = None, translatable = False,
textdomain = ""):
"""For the lazy."""
text = self.get_text(name)
if text:
if value == delete_if:
self.remove(text)
else:
text.data = value
t... | [
"def",
"set_text_val",
"(",
"self",
",",
"name",
",",
"value",
",",
"delete_if",
"=",
"None",
",",
"translatable",
"=",
"False",
",",
"textdomain",
"=",
"\"\"",
")",
":",
"text",
"=",
"self",
".",
"get_text",
"(",
"name",
")",
"if",
"text",
":",
"if"... | https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmldata.py#L543-L557 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard_modules.py | python | process_string | (ctx, input_string, additional_aliases) | Process a string through the alias processor and perform any necessary substitutions
:param ctx: Context
:param input_string: The input string to process
:param additional_aliases: Any additional aliases (dict) to use for processing
:return: The processed string | Process a string through the alias processor and perform any necessary substitutions | [
"Process",
"a",
"string",
"through",
"the",
"alias",
"processor",
"and",
"perform",
"any",
"necessary",
"substitutions"
] | def process_string(ctx, input_string, additional_aliases):
"""
Process a string through the alias processor and perform any necessary substitutions
:param ctx: Context
:param input_string: The input string to process
:param additional_aliases: Any additional aliases (dict) t... | [
"def",
"process_string",
"(",
"ctx",
",",
"input_string",
",",
"additional_aliases",
")",
":",
"try",
":",
"return",
"ctx",
".",
"alias_processor",
".",
"preprocess_value",
"(",
"ctx",
",",
"input_string",
",",
"additional_aliases",
")",
"except",
"AttributeError"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard_modules.py#L662-L675 | ||
springer13/hptt | 9fecf0c41f889beebea970387f2a4971d7b84736 | pythonAPI/setup.py | python | get_hptt_root | () | return HPTT_ROOT | Get the root hptt folder - prefer environment variable if is set, but
otherwise default to the parent directory of the python module - the
shared library will be checked for in any case. | Get the root hptt folder - prefer environment variable if is set, but
otherwise default to the parent directory of the python module - the
shared library will be checked for in any case. | [
"Get",
"the",
"root",
"hptt",
"folder",
"-",
"prefer",
"environment",
"variable",
"if",
"is",
"set",
"but",
"otherwise",
"default",
"to",
"the",
"parent",
"directory",
"of",
"the",
"python",
"module",
"-",
"the",
"shared",
"library",
"will",
"be",
"checked",... | def get_hptt_root():
"""Get the root hptt folder - prefer environment variable if is set, but
otherwise default to the parent directory of the python module - the
shared library will be checked for in any case.
"""
from os.path import dirname, realpath, isfile, join
hptt_default = dirname(dirnam... | [
"def",
"get_hptt_root",
"(",
")",
":",
"from",
"os",
".",
"path",
"import",
"dirname",
",",
"realpath",
",",
"isfile",
",",
"join",
"hptt_default",
"=",
"dirname",
"(",
"dirname",
"(",
"realpath",
"(",
"__file__",
")",
")",
")",
"HPTT_ROOT",
"=",
"os",
... | https://github.com/springer13/hptt/blob/9fecf0c41f889beebea970387f2a4971d7b84736/pythonAPI/setup.py#L11-L23 | |
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | python/freesurfer/surface.py | python | Surface.get_face_vertices | (self) | return self.faces | Deprecated - use Surface.faces directly | Deprecated - use Surface.faces directly | [
"Deprecated",
"-",
"use",
"Surface",
".",
"faces",
"directly"
] | def get_face_vertices(self): # TODEP
'''Deprecated - use Surface.faces directly'''
warning('"Surface.get_face_vertices()" is deprecated - use "Surface.faces" directly. Sorry for the back and forth...')
return self.faces | [
"def",
"get_face_vertices",
"(",
"self",
")",
":",
"# TODEP",
"warning",
"(",
"'\"Surface.get_face_vertices()\" is deprecated - use \"Surface.faces\" directly. Sorry for the back and forth...'",
")",
"return",
"self",
".",
"faces"
] | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/python/freesurfer/surface.py#L210-L213 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | _ReqExtras.markers_pass | (self, req, extras=None) | return not req.marker or any(extra_evals) | Evaluate markers for req against each extra that
demanded it.
Return False if the req has a marker and fails
evaluation. Otherwise, return True. | Evaluate markers for req against each extra that
demanded it. | [
"Evaluate",
"markers",
"for",
"req",
"against",
"each",
"extra",
"that",
"demanded",
"it",
"."
] | def markers_pass(self, req, extras=None):
"""
Evaluate markers for req against each extra that
demanded it.
Return False if the req has a marker and fails
evaluation. Otherwise, return True.
"""
extra_evals = (
req.marker.evaluate({'extra': extra})
... | [
"def",
"markers_pass",
"(",
"self",
",",
"req",
",",
"extras",
"=",
"None",
")",
":",
"extra_evals",
"=",
"(",
"req",
".",
"marker",
".",
"evaluate",
"(",
"{",
"'extra'",
":",
"extra",
"}",
")",
"for",
"extra",
"in",
"self",
".",
"get",
"(",
"req",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L1028-L1040 | |
cztomczak/cefpython | 5679f28cec18a57a56e298da2927aac8d8f83ad6 | tools/automate-git.py | python | copy_directory | (source, target, allow_overwrite=False) | Copies a directory from source to target. | Copies a directory from source to target. | [
"Copies",
"a",
"directory",
"from",
"source",
"to",
"target",
"."
] | def copy_directory(source, target, allow_overwrite=False):
""" Copies a directory from source to target. """
if not options.dryrun and os.path.exists(target):
if not allow_overwrite:
raise Exception("Directory %s already exists" % (target))
remove_directory(target)
if os.path.exists(source):
msg... | [
"def",
"copy_directory",
"(",
"source",
",",
"target",
",",
"allow_overwrite",
"=",
"False",
")",
":",
"if",
"not",
"options",
".",
"dryrun",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"target",
")",
":",
"if",
"not",
"allow_overwrite",
":",
"raise",
... | https://github.com/cztomczak/cefpython/blob/5679f28cec18a57a56e298da2927aac8d8f83ad6/tools/automate-git.py#L218-L227 | ||
bristolcrypto/SPDZ-2 | 721abfae849625a02ea49aabc534f9cf41ca643f | Compiler/allocator.py | python | Merger.compute_max_depths | (self, depth_of) | return max_depth_of | Compute the maximum 'depth' at which every instruction can be placed.
This is the minimum depth of any merge_node succeeding an instruction.
Similar to DAG shortest paths algorithm. Traverses the graph in reverse
topological order, updating the max depth of each node's predecessors. | Compute the maximum 'depth' at which every instruction can be placed.
This is the minimum depth of any merge_node succeeding an instruction. | [
"Compute",
"the",
"maximum",
"depth",
"at",
"which",
"every",
"instruction",
"can",
"be",
"placed",
".",
"This",
"is",
"the",
"minimum",
"depth",
"of",
"any",
"merge_node",
"succeeding",
"an",
"instruction",
"."
] | def compute_max_depths(self, depth_of):
""" Compute the maximum 'depth' at which every instruction can be placed.
This is the minimum depth of any merge_node succeeding an instruction.
Similar to DAG shortest paths algorithm. Traverses the graph in reverse
topological order, updating th... | [
"def",
"compute_max_depths",
"(",
"self",
",",
"depth_of",
")",
":",
"G",
"=",
"self",
".",
"G",
"merge_nodes_set",
"=",
"self",
".",
"open_nodes",
"top_order",
"=",
"Compiler",
".",
"graph",
".",
"topological_sort",
"(",
"G",
")",
"max_depth_of",
"=",
"["... | https://github.com/bristolcrypto/SPDZ-2/blob/721abfae849625a02ea49aabc534f9cf41ca643f/Compiler/allocator.py#L213-L236 | |
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/modulegraph/pkg_resources.py | python | yield_lines | (strs) | Yield non-empty/non-comment lines of a ``basestring`` or sequence | Yield non-empty/non-comment lines of a ``basestring`` or sequence | [
"Yield",
"non",
"-",
"empty",
"/",
"non",
"-",
"comment",
"lines",
"of",
"a",
"basestring",
"or",
"sequence"
] | def yield_lines(strs):
"""Yield non-empty/non-comment lines of a ``basestring`` or sequence"""
if isinstance(strs,basestring):
for s in strs.splitlines():
s = s.strip()
if s and not s.startswith('#'): # skip blank lines/comments
yield s
else:
for s... | [
"def",
"yield_lines",
"(",
"strs",
")",
":",
"if",
"isinstance",
"(",
"strs",
",",
"basestring",
")",
":",
"for",
"s",
"in",
"strs",
".",
"splitlines",
"(",
")",
":",
"s",
"=",
"s",
".",
"strip",
"(",
")",
"if",
"s",
"and",
"not",
"s",
".",
"st... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L1577-L1587 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py | python | Subversion.call_vcs_version | (self) | return parsed_version | Query the version of the currently installed Subversion client.
:return: A tuple containing the parts of the version information or
``()`` if the version returned from ``svn`` could not be parsed.
:raises: BadCommand: If ``svn`` is not installed. | Query the version of the currently installed Subversion client. | [
"Query",
"the",
"version",
"of",
"the",
"currently",
"installed",
"Subversion",
"client",
"."
] | def call_vcs_version(self):
# type: () -> Tuple[int, ...]
"""Query the version of the currently installed Subversion client.
:return: A tuple containing the parts of the version information or
``()`` if the version returned from ``svn`` could not be parsed.
:raises: Ba... | [
"def",
"call_vcs_version",
"(",
"self",
")",
":",
"# type: () -> Tuple[int, ...]",
"# Example versions:",
"# svn, version 1.10.3 (r1842928)",
"# compiled Feb 25 2019, 14:20:39 on x86_64-apple-darwin17.0.0",
"# svn, version 1.7.14 (r1542130)",
"# compiled Mar 28 2018, 08:49:13 on ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/subversion.py#L423-L481 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/python/google/gethash_timer.py | python | SetupOutputFile | (file_name) | Open a file for logging results.
Args:
file_name: A path to a file to store the output.
Returns:
None. | Open a file for logging results.
Args:
file_name: A path to a file to store the output.
Returns:
None. | [
"Open",
"a",
"file",
"for",
"logging",
"results",
".",
"Args",
":",
"file_name",
":",
"A",
"path",
"to",
"a",
"file",
"to",
"store",
"the",
"output",
".",
"Returns",
":",
"None",
"."
] | def SetupOutputFile(file_name):
'''Open a file for logging results.
Args:
file_name: A path to a file to store the output.
Returns:
None.
'''
global g_file_handle
g_file_handle = open(file_name, 'w') | [
"def",
"SetupOutputFile",
"(",
"file_name",
")",
":",
"global",
"g_file_handle",
"g_file_handle",
"=",
"open",
"(",
"file_name",
",",
"'w'",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/python/google/gethash_timer.py#L109-L117 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateTime.GetJulianDayNumber | (*args, **kwargs) | return _misc_.DateTime_GetJulianDayNumber(*args, **kwargs) | GetJulianDayNumber(self) -> double | GetJulianDayNumber(self) -> double | [
"GetJulianDayNumber",
"(",
"self",
")",
"-",
">",
"double"
] | def GetJulianDayNumber(*args, **kwargs):
"""GetJulianDayNumber(self) -> double"""
return _misc_.DateTime_GetJulianDayNumber(*args, **kwargs) | [
"def",
"GetJulianDayNumber",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_GetJulianDayNumber",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3902-L3904 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | ImageHandler.GetName | (*args, **kwargs) | return _core_.ImageHandler_GetName(*args, **kwargs) | GetName(self) -> String | GetName(self) -> String | [
"GetName",
"(",
"self",
")",
"-",
">",
"String"
] | def GetName(*args, **kwargs):
"""GetName(self) -> String"""
return _core_.ImageHandler_GetName(*args, **kwargs) | [
"def",
"GetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ImageHandler_GetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L2620-L2622 | |
zju3dv/clean-pvnet | 5870c509e3cc205e1bb28910a7b1a9a3c8add9a8 | lib/utils/pysixd/transform.py | python | quaternion_conjugate | (quaternion) | return q | Return conjugate of quaternion.
>>> q0 = random_quaternion()
>>> q1 = quaternion_conjugate(q0)
>>> q1[0] == q0[0] and all(q1[1:] == -q0[1:])
True | Return conjugate of quaternion. | [
"Return",
"conjugate",
"of",
"quaternion",
"."
] | def quaternion_conjugate(quaternion):
"""Return conjugate of quaternion.
>>> q0 = random_quaternion()
>>> q1 = quaternion_conjugate(q0)
>>> q1[0] == q0[0] and all(q1[1:] == -q0[1:])
True
"""
q = numpy.array(quaternion, dtype=numpy.float64, copy=True)
numpy.negative(q[1:], q[1:])
re... | [
"def",
"quaternion_conjugate",
"(",
"quaternion",
")",
":",
"q",
"=",
"numpy",
".",
"array",
"(",
"quaternion",
",",
"dtype",
"=",
"numpy",
".",
"float64",
",",
"copy",
"=",
"True",
")",
"numpy",
".",
"negative",
"(",
"q",
"[",
"1",
":",
"]",
",",
... | https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/pysixd/transform.py#L1374-L1385 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/sdist.py | python | sdist.prune_file_list | (self) | Prune off branches that might slip into the file list as created
by 'read_template()', but really don't belong there:
* the build tree (typically "build")
* the release tree itself (only an issue if we ran "sdist"
previously with --keep-temp, or it aborted)
* any RCS, C... | Prune off branches that might slip into the file list as created
by 'read_template()', but really don't belong there:
* the build tree (typically "build")
* the release tree itself (only an issue if we ran "sdist"
previously with --keep-temp, or it aborted)
* any RCS, C... | [
"Prune",
"off",
"branches",
"that",
"might",
"slip",
"into",
"the",
"file",
"list",
"as",
"created",
"by",
"read_template",
"()",
"but",
"really",
"don",
"t",
"belong",
"there",
":",
"*",
"the",
"build",
"tree",
"(",
"typically",
"build",
")",
"*",
"the"... | def prune_file_list(self):
"""Prune off branches that might slip into the file list as created
by 'read_template()', but really don't belong there:
* the build tree (typically "build")
* the release tree itself (only an issue if we ran "sdist"
previously with --keep-temp,... | [
"def",
"prune_file_list",
"(",
"self",
")",
":",
"build",
"=",
"self",
".",
"get_finalized_command",
"(",
"'build'",
")",
"base_dir",
"=",
"self",
".",
"distribution",
".",
"get_fullname",
"(",
")",
"self",
".",
"filelist",
".",
"exclude_pattern",
"(",
"None... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/sdist.py#L333-L357 | ||
ukoethe/vigra | 093d57d15c8c237adf1704d96daa6393158ce299 | vigranumpy/lib/arraytypes.py | python | VigraArray.writeImage | (self, filename, dtype = '', compression = '', mode='w') | Write an image to a file.
Consult :func:`vigra.impex.writeImage` for detailed documentation | Write an image to a file.
Consult :func:`vigra.impex.writeImage` for detailed documentation | [
"Write",
"an",
"image",
"to",
"a",
"file",
".",
"Consult",
":",
"func",
":",
"vigra",
".",
"impex",
".",
"writeImage",
"for",
"detailed",
"documentation"
] | def writeImage(self, filename, dtype = '', compression = '', mode='w'):
'''Write an image to a file.
Consult :func:`vigra.impex.writeImage` for detailed documentation'''
import vigra.impex
ndim = self.ndim
if self.channelIndex < ndim:
ndim -= 1
if ndim != 2:
... | [
"def",
"writeImage",
"(",
"self",
",",
"filename",
",",
"dtype",
"=",
"''",
",",
"compression",
"=",
"''",
",",
"mode",
"=",
"'w'",
")",
":",
"import",
"vigra",
".",
"impex",
"ndim",
"=",
"self",
".",
"ndim",
"if",
"self",
".",
"channelIndex",
"<",
... | https://github.com/ukoethe/vigra/blob/093d57d15c8c237adf1704d96daa6393158ce299/vigranumpy/lib/arraytypes.py#L602-L613 | ||
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Runner.py | python | Parallel.task_status | (self, tsk) | Obtains the task status to decide whether to run it immediately or not.
:return: the exit status, for example :py:attr:`waflib.Task.ASK_LATER`
:rtype: integer | Obtains the task status to decide whether to run it immediately or not. | [
"Obtains",
"the",
"task",
"status",
"to",
"decide",
"whether",
"to",
"run",
"it",
"immediately",
"or",
"not",
"."
] | def task_status(self, tsk):
"""
Obtains the task status to decide whether to run it immediately or not.
:return: the exit status, for example :py:attr:`waflib.Task.ASK_LATER`
:rtype: integer
"""
try:
return tsk.runnable_status()
except Exception:
self.processed += 1
tsk.err_msg = traceback.forma... | [
"def",
"task_status",
"(",
"self",
",",
"tsk",
")",
":",
"try",
":",
"return",
"tsk",
".",
"runnable_status",
"(",
")",
"except",
"Exception",
":",
"self",
".",
"processed",
"+=",
"1",
"tsk",
".",
"err_msg",
"=",
"traceback",
".",
"format_exc",
"(",
")... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Runner.py#L422-L449 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/sqrt.py | python | _sqrt_tbe | () | return | Sqrt TBE register | Sqrt TBE register | [
"Sqrt",
"TBE",
"register"
] | def _sqrt_tbe():
"""Sqrt TBE register"""
return | [
"def",
"_sqrt_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/sqrt.py#L35-L37 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/moving_averages.py | python | weighted_moving_average | (value,
decay,
weight,
truediv=True,
collections=None,
name=None) | Compute the weighted moving average of `value`.
Conceptually, the weighted moving average is:
`moving_average(value * weight) / moving_average(weight)`,
where a moving average updates by the rule
`new_value = decay * old_value + (1 - decay) * update`
Internally, this Op keeps moving average variables of ... | Compute the weighted moving average of `value`. | [
"Compute",
"the",
"weighted",
"moving",
"average",
"of",
"value",
"."
] | def weighted_moving_average(value,
decay,
weight,
truediv=True,
collections=None,
name=None):
"""Compute the weighted moving average of `value`.
Conceptually, the weighted mov... | [
"def",
"weighted_moving_average",
"(",
"value",
",",
"decay",
",",
"weight",
",",
"truediv",
"=",
"True",
",",
"collections",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"# Unlike assign_moving_average, the weighted moving average doesn't modify",
"# user-visible v... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/moving_averages.py#L113-L174 | ||
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | util/run-clang-tidy.py | python | run_tidy | (args, tmpdir, build_path, queue, lock, failed_files) | Takes filenames out of queue and runs clang-tidy on them. | Takes filenames out of queue and runs clang-tidy on them. | [
"Takes",
"filenames",
"out",
"of",
"queue",
"and",
"runs",
"clang",
"-",
"tidy",
"on",
"them",
"."
] | def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
invocation = get_tidy_invocation(
name,
args.clang_tidy_binary,
args.checks,
tmpdir,
... | [
"def",
"run_tidy",
"(",
"args",
",",
"tmpdir",
",",
"build_path",
",",
"queue",
",",
"lock",
",",
"failed_files",
")",
":",
"while",
"True",
":",
"name",
"=",
"queue",
".",
"get",
"(",
")",
"invocation",
"=",
"get_tidy_invocation",
"(",
"name",
",",
"a... | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/util/run-clang-tidy.py#L174-L203 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py | python | Bits.__radd__ | (self, bs) | return bs.__add__(self) | Append current bitstring to bs and return new bitstring.
bs -- the string for the 'auto' initialiser that will be appended to. | Append current bitstring to bs and return new bitstring. | [
"Append",
"current",
"bitstring",
"to",
"bs",
"and",
"return",
"new",
"bitstring",
"."
] | def __radd__(self, bs):
"""Append current bitstring to bs and return new bitstring.
bs -- the string for the 'auto' initialiser that will be appended to.
"""
bs = self._converttobitstring(bs)
return bs.__add__(self) | [
"def",
"__radd__",
"(",
"self",
",",
"bs",
")",
":",
"bs",
"=",
"self",
".",
"_converttobitstring",
"(",
"bs",
")",
"return",
"bs",
".",
"__add__",
"(",
"self",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L873-L880 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/input/win32.py | python | attach_win32_input | (
input: _Win32InputBase, callback: Callable[[], None]
) | Context manager that makes this input active in the current event loop.
:param input: :class:`~prompt_toolkit.input.Input` object.
:param input_ready_callback: Called when the input is ready to read. | Context manager that makes this input active in the current event loop. | [
"Context",
"manager",
"that",
"makes",
"this",
"input",
"active",
"in",
"the",
"current",
"event",
"loop",
"."
] | def attach_win32_input(
input: _Win32InputBase, callback: Callable[[], None]
) -> Iterator[None]:
"""
Context manager that makes this input active in the current event loop.
:param input: :class:`~prompt_toolkit.input.Input` object.
:param input_ready_callback: Called when the input is ready to rea... | [
"def",
"attach_win32_input",
"(",
"input",
":",
"_Win32InputBase",
",",
"callback",
":",
"Callable",
"[",
"[",
"]",
",",
"None",
"]",
")",
"->",
"Iterator",
"[",
"None",
"]",
":",
"win32_handles",
"=",
"input",
".",
"win32_handles",
"handle",
"=",
"input",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/input/win32.py#L656-L681 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.