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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/directives/__init__.py | python | single_char_or_whitespace_or_unicode | (argument) | return char | As with `single_char_or_unicode`, but "tab" and "space" are also supported.
(Directive option conversion function.) | As with `single_char_or_unicode`, but "tab" and "space" are also supported.
(Directive option conversion function.) | [
"As",
"with",
"single_char_or_unicode",
"but",
"tab",
"and",
"space",
"are",
"also",
"supported",
".",
"(",
"Directive",
"option",
"conversion",
"function",
".",
")"
] | def single_char_or_whitespace_or_unicode(argument):
"""
As with `single_char_or_unicode`, but "tab" and "space" are also supported.
(Directive option conversion function.)
"""
if argument == 'tab':
char = '\t'
elif argument == 'space':
char = ' '
else:
char = single_c... | [
"def",
"single_char_or_whitespace_or_unicode",
"(",
"argument",
")",
":",
"if",
"argument",
"==",
"'tab'",
":",
"char",
"=",
"'\\t'",
"elif",
"argument",
"==",
"'space'",
":",
"char",
"=",
"' '",
"else",
":",
"char",
"=",
"single_char_or_unicode",
"(",
"argume... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/directives/__init__.py#L328-L339 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozbuild/controller/building.py | python | BuildMonitor.record_resource_usage | (self) | return o | Record the resource usage of this build.
We write a log message containing a high-level summary. We also produce
a data structure containing the low-level resource usage information.
This data structure can e.g. be serialized into JSON and saved for
subsequent analysis.
If no r... | Record the resource usage of this build. | [
"Record",
"the",
"resource",
"usage",
"of",
"this",
"build",
"."
] | def record_resource_usage(self):
"""Record the resource usage of this build.
We write a log message containing a high-level summary. We also produce
a data structure containing the low-level resource usage information.
This data structure can e.g. be serialized into JSON and saved for
... | [
"def",
"record_resource_usage",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"have_resource_usage",
":",
"return",
"None",
"cpu_percent",
"=",
"self",
".",
"resources",
".",
"aggregate_cpu_percent",
"(",
"phase",
"=",
"None",
",",
"per_cpu",
"=",
"False",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/controller/building.py#L349-L412 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/config.py | python | get_config | (item) | Returns a flattened version of the configuration of the given item.
Nearly all Klamp't objects are recognized, including RobotModel's,
RigidObjectModel's, WorldModel's, IKObjectives, and all variable types in the
coordinates module.
TODO: ContactPoint | Returns a flattened version of the configuration of the given item.
Nearly all Klamp't objects are recognized, including RobotModel's,
RigidObjectModel's, WorldModel's, IKObjectives, and all variable types in the
coordinates module. | [
"Returns",
"a",
"flattened",
"version",
"of",
"the",
"configuration",
"of",
"the",
"given",
"item",
".",
"Nearly",
"all",
"Klamp",
"t",
"objects",
"are",
"recognized",
"including",
"RobotModel",
"s",
"RigidObjectModel",
"s",
"WorldModel",
"s",
"IKObjectives",
"a... | def get_config(item) -> Config:
"""Returns a flattened version of the configuration of the given item.
Nearly all Klamp't objects are recognized, including RobotModel's,
RigidObjectModel's, WorldModel's, IKObjectives, and all variable types in the
coordinates module.
TODO: ContactPoint
"""
... | [
"def",
"get_config",
"(",
"item",
")",
"->",
"Config",
":",
"if",
"hasattr",
"(",
"item",
",",
"'getConfig'",
")",
":",
"return",
"item",
".",
"getConfig",
"(",
")",
"elif",
"isinstance",
"(",
"item",
",",
"RigidObjectModel",
")",
":",
"R",
",",
"t",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/config.py#L146-L199 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/mixture/bayesian_mixture.py | python | BayesianGaussianMixture._check_weights_parameters | (self) | Check the parameter of the Dirichlet distribution. | Check the parameter of the Dirichlet distribution. | [
"Check",
"the",
"parameter",
"of",
"the",
"Dirichlet",
"distribution",
"."
] | def _check_weights_parameters(self):
"""Check the parameter of the Dirichlet distribution."""
if self.weight_concentration_prior is None:
self.weight_concentration_prior_ = 1. / self.n_components
elif self.weight_concentration_prior > 0.:
self.weight_concentration_prior_ ... | [
"def",
"_check_weights_parameters",
"(",
"self",
")",
":",
"if",
"self",
".",
"weight_concentration_prior",
"is",
"None",
":",
"self",
".",
"weight_concentration_prior_",
"=",
"1.",
"/",
"self",
".",
"n_components",
"elif",
"self",
".",
"weight_concentration_prior",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/mixture/bayesian_mixture.py#L353-L363 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/peakmeter.py | python | PeakMeterCtrl.ResetControl | (self) | Resets the :class:`PeakMeterCtrl`. | Resets the :class:`PeakMeterCtrl`. | [
"Resets",
"the",
":",
"class",
":",
"PeakMeterCtrl",
"."
] | def ResetControl(self):
""" Resets the :class:`PeakMeterCtrl`. """
# Initialize vector
for i in xrange(self._numBands):
pm = PeakMeterData(self._maxValue, self._maxValue, self._speed)
self._meterData.append(pm)
self.Refresh() | [
"def",
"ResetControl",
"(",
"self",
")",
":",
"# Initialize vector",
"for",
"i",
"in",
"xrange",
"(",
"self",
".",
"_numBands",
")",
":",
"pm",
"=",
"PeakMeterData",
"(",
"self",
".",
"_maxValue",
",",
"self",
".",
"_maxValue",
",",
"self",
".",
"_speed"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/peakmeter.py#L388-L396 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBType.GetNumberOfTemplateArguments | (self) | return _lldb.SBType_GetNumberOfTemplateArguments(self) | GetNumberOfTemplateArguments(SBType self) -> uint32_t | GetNumberOfTemplateArguments(SBType self) -> uint32_t | [
"GetNumberOfTemplateArguments",
"(",
"SBType",
"self",
")",
"-",
">",
"uint32_t"
] | def GetNumberOfTemplateArguments(self):
"""GetNumberOfTemplateArguments(SBType self) -> uint32_t"""
return _lldb.SBType_GetNumberOfTemplateArguments(self) | [
"def",
"GetNumberOfTemplateArguments",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBType_GetNumberOfTemplateArguments",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L12775-L12777 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/urllib/robotparser.py | python | Entry.allowance | (self, filename) | return True | Preconditions:
- our agent applies to this entry
- filename is URL decoded | Preconditions:
- our agent applies to this entry
- filename is URL decoded | [
"Preconditions",
":",
"-",
"our",
"agent",
"applies",
"to",
"this",
"entry",
"-",
"filename",
"is",
"URL",
"decoded"
] | def allowance(self, filename):
"""Preconditions:
- our agent applies to this entry
- filename is URL decoded"""
for line in self.rulelines:
if line.applies_to(filename):
return line.allowance
return True | [
"def",
"allowance",
"(",
"self",
",",
"filename",
")",
":",
"for",
"line",
"in",
"self",
".",
"rulelines",
":",
"if",
"line",
".",
"applies_to",
"(",
"filename",
")",
":",
"return",
"line",
".",
"allowance",
"return",
"True"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/urllib/robotparser.py#L255-L262 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/estimator_training.py | python | init_run_config | (config, tf_config) | Initializes RunConfig for distribution strategies. | Initializes RunConfig for distribution strategies. | [
"Initializes",
"RunConfig",
"for",
"distribution",
"strategies",
"."
] | def init_run_config(config, tf_config):
"""Initializes RunConfig for distribution strategies."""
# pylint: disable=protected-access
if (config._experimental_distribute and
config._experimental_distribute.train_distribute):
if config._train_distribute:
raise ValueError('Either `train_distribute` or... | [
"def",
"init_run_config",
"(",
"config",
",",
"tf_config",
")",
":",
"# pylint: disable=protected-access",
"if",
"(",
"config",
".",
"_experimental_distribute",
"and",
"config",
".",
"_experimental_distribute",
".",
"train_distribute",
")",
":",
"if",
"config",
".",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/estimator_training.py#L127-L178 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/emma_coverage_stats.py | python | _EmmaCoverageStats.GetCoverageDictForFile | (self, file_path, line_numbers) | return file_coverage_stats | Returns a dict containing detailed coverage info for the given file.
Args:
file_path: The path to the Java source file that we want to create the
coverage dict for.
line_numbers: A list of integer line numbers to retrieve additional stats
for.
Returns:
A dict containing absol... | Returns a dict containing detailed coverage info for the given file. | [
"Returns",
"a",
"dict",
"containing",
"detailed",
"coverage",
"info",
"for",
"the",
"given",
"file",
"."
] | def GetCoverageDictForFile(self, file_path, line_numbers):
"""Returns a dict containing detailed coverage info for the given file.
Args:
file_path: The path to the Java source file that we want to create the
coverage dict for.
line_numbers: A list of integer line numbers to retrieve additio... | [
"def",
"GetCoverageDictForFile",
"(",
"self",
",",
"file_path",
",",
"line_numbers",
")",
":",
"if",
"file_path",
"not",
"in",
"self",
".",
"_source_to_emma",
":",
"return",
"None",
"emma_file",
"=",
"self",
".",
"_source_to_emma",
"[",
"file_path",
"]",
"tota... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/emma_coverage_stats.py#L281-L325 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/stringold.py | python | ljust | (s, width) | return s + ' '*n | ljust(s, width) -> string
Return a left-justified version of s, in a field of the
specified width, padded with spaces as needed. The string is
never truncated. | ljust(s, width) -> string | [
"ljust",
"(",
"s",
"width",
")",
"-",
">",
"string"
] | def ljust(s, width):
"""ljust(s, width) -> string
Return a left-justified version of s, in a field of the
specified width, padded with spaces as needed. The string is
never truncated.
"""
n = width - len(s)
if n <= 0: return s
return s + ' '*n | [
"def",
"ljust",
"(",
"s",
",",
"width",
")",
":",
"n",
"=",
"width",
"-",
"len",
"(",
"s",
")",
"if",
"n",
"<=",
"0",
":",
"return",
"s",
"return",
"s",
"+",
"' '",
"*",
"n"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/stringold.py#L265-L275 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/ntpath.py | python | normcase | (s) | return s.replace("/", "\\").lower() | Normalize case of pathname.
Makes all characters lowercase and all slashes into backslashes. | Normalize case of pathname. | [
"Normalize",
"case",
"of",
"pathname",
"."
] | def normcase(s):
"""Normalize case of pathname.
Makes all characters lowercase and all slashes into backslashes."""
return s.replace("/", "\\").lower() | [
"def",
"normcase",
"(",
"s",
")",
":",
"return",
"s",
".",
"replace",
"(",
"\"/\"",
",",
"\"\\\\\"",
")",
".",
"lower",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ntpath.py#L42-L46 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py | python | MainWindow.find_peak_in_scan | (self, scan_number, load_spice_hkl) | return hkl, vec_q | Find peak in a given scan and record it | Find peak in a given scan and record it | [
"Find",
"peak",
"in",
"a",
"given",
"scan",
"and",
"record",
"it"
] | def find_peak_in_scan(self, scan_number, load_spice_hkl):
""" Find peak in a given scan and record it
"""
# Get experiment, scan and pt
status, ret_obj = gutil.parse_integers_editors([self.ui.lineEdit_exp])
if status is True:
exp_no = ret_obj
else:
... | [
"def",
"find_peak_in_scan",
"(",
"self",
",",
"scan_number",
",",
"load_spice_hkl",
")",
":",
"# Get experiment, scan and pt",
"status",
",",
"ret_obj",
"=",
"gutil",
".",
"parse_integers_editors",
"(",
"[",
"self",
".",
"ui",
".",
"lineEdit_exp",
"]",
")",
"if"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L1119-L1163 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListLineData.IsVirtual | (self) | return self._owner.IsVirtual() | Returns ``True`` if the parent :class:`UltimateListCtrl` has the ``ULC_VIRTUAL`` style set. | Returns ``True`` if the parent :class:`UltimateListCtrl` has the ``ULC_VIRTUAL`` style set. | [
"Returns",
"True",
"if",
"the",
"parent",
":",
"class",
":",
"UltimateListCtrl",
"has",
"the",
"ULC_VIRTUAL",
"style",
"set",
"."
] | def IsVirtual(self):
""" Returns ``True`` if the parent :class:`UltimateListCtrl` has the ``ULC_VIRTUAL`` style set. """
return self._owner.IsVirtual() | [
"def",
"IsVirtual",
"(",
"self",
")",
":",
"return",
"self",
".",
"_owner",
".",
"IsVirtual",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L3892-L3895 | |
xhzdeng/crpn | a5aef0f80dbe486103123f740c634fb01e6cc9a1 | caffe-fast-rcnn/scripts/cpp_lint.py | python | ParseNolintSuppressions | (filename, raw_line, linenum, error) | Updates the global list of error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of the input file.
raw_line: str, the line of input text, with comments.
... | Updates the global list of error-suppressions. | [
"Updates",
"the",
"global",
"list",
"of",
"error",
"-",
"suppressions",
"."
] | def ParseNolintSuppressions(filename, raw_line, linenum, error):
"""Updates the global list of error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of the inp... | [
"def",
"ParseNolintSuppressions",
"(",
"filename",
",",
"raw_line",
",",
"linenum",
",",
"error",
")",
":",
"# FIXME(adonovan): \"NOLINT(\" is misparsed as NOLINT(*).",
"matched",
"=",
"_RE_SUPPRESSION",
".",
"search",
"(",
"raw_line",
")",
"if",
"matched",
":",
"if",... | https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/scripts/cpp_lint.py#L468-L496 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/pystache/locator.py | python | Locator.find_object | (self, obj, search_dirs, file_name=None) | return path | Return the path to a template associated with the given object. | Return the path to a template associated with the given object. | [
"Return",
"the",
"path",
"to",
"a",
"template",
"associated",
"with",
"the",
"given",
"object",
"."
] | def find_object(self, obj, search_dirs, file_name=None):
"""
Return the path to a template associated with the given object.
"""
if file_name is None:
# TODO: should we define a make_file_name() method?
template_name = self.make_template_name(obj)
fil... | [
"def",
"find_object",
"(",
"self",
",",
"obj",
",",
"search_dirs",
",",
"file_name",
"=",
"None",
")",
":",
"if",
"file_name",
"is",
"None",
":",
"# TODO: should we define a make_file_name() method?",
"template_name",
"=",
"self",
".",
"make_template_name",
"(",
"... | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/pystache/locator.py#L160-L177 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/aicpu/reshape.py | python | _reshape_aicpu | () | return | Rpeshape AiCPU register | Rpeshape AiCPU register | [
"Rpeshape",
"AiCPU",
"register"
] | def _reshape_aicpu():
"""Rpeshape AiCPU register"""
return | [
"def",
"_reshape_aicpu",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/aicpu/reshape.py#L38-L40 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/telemetry/core/platform/profiler/monsoon.py | python | Monsoon.GetStatus | (self) | Requests and waits for status. Returns status dictionary. | Requests and waits for status. Returns status dictionary. | [
"Requests",
"and",
"waits",
"for",
"status",
".",
"Returns",
"status",
"dictionary",
"."
] | def GetStatus(self):
"""Requests and waits for status. Returns status dictionary."""
# status packet format
STATUS_FORMAT = '>BBBhhhHhhhHBBBxBbHBHHHHBbbHHBBBbbbbbbbbbBH'
STATUS_FIELDS = [
'packetType', 'firmwareVersion', 'protocolVersion',
'mainFineCurrent', 'usbFineCurrent', 'auxFineC... | [
"def",
"GetStatus",
"(",
"self",
")",
":",
"# status packet format",
"STATUS_FORMAT",
"=",
"'>BBBhhhHhhhHBBBxBbHBHHHHBbbHHBBBbbbbbbbbbBH'",
"STATUS_FIELDS",
"=",
"[",
"'packetType'",
",",
"'firmwareVersion'",
",",
"'protocolVersion'",
",",
"'mainFineCurrent'",
",",
"'usbFin... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/platform/profiler/monsoon.py#L93-L142 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/IntegrateSingePtSubWindow.py | python | IntegrateSinglePtIntensityWindow.plot_summed_single_pt_scan_counts | (self, is_vertical_summed, figure_file=None, pop_error=False) | return | plot single pt scanned counts
:param is_vertical_summed:
:param figure_file:
:param pop_error:
:return: | plot single pt scanned counts
:param is_vertical_summed:
:param figure_file:
:param pop_error:
:return: | [
"plot",
"single",
"pt",
"scanned",
"counts",
":",
"param",
"is_vertical_summed",
":",
":",
"param",
"figure_file",
":",
":",
"param",
"pop_error",
":",
":",
"return",
":"
] | def plot_summed_single_pt_scan_counts(self, is_vertical_summed, figure_file=None, pop_error=False):
"""
plot single pt scanned counts
:param is_vertical_summed:
:param figure_file:
:param pop_error:
:return:
"""
# get scan number
scan_num_str = str... | [
"def",
"plot_summed_single_pt_scan_counts",
"(",
"self",
",",
"is_vertical_summed",
",",
"figure_file",
"=",
"None",
",",
"pop_error",
"=",
"False",
")",
":",
"# get scan number",
"scan_num_str",
"=",
"str",
"(",
"self",
".",
"ui",
".",
"lineEdit_Scan",
".",
"te... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/IntegrateSingePtSubWindow.py#L341-L399 | |
alexgkendall/caffe-segnet | 344c113bf1832886f1cbe9f33ffe28a3beeaf412 | scripts/cpp_lint.py | python | CheckCaffeAlternatives | (filename, clean_lines, linenum, error) | Checks for C(++) functions for which a Caffe substitute should be used.
For certain native C functions (memset, memcpy), there is a Caffe alternative
which should be used instead.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The nu... | Checks for C(++) functions for which a Caffe substitute should be used. | [
"Checks",
"for",
"C",
"(",
"++",
")",
"functions",
"for",
"which",
"a",
"Caffe",
"substitute",
"should",
"be",
"used",
"."
] | def CheckCaffeAlternatives(filename, clean_lines, linenum, error):
"""Checks for C(++) functions for which a Caffe substitute should be used.
For certain native C functions (memset, memcpy), there is a Caffe alternative
which should be used instead.
Args:
filename: The name of the current file.
clean_... | [
"def",
"CheckCaffeAlternatives",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"function",
",",
"alts",
"in",
"caffe_alt_function_list",
":",
"ix",
"=",
"li... | https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/scripts/cpp_lint.py#L1572-L1592 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/Cookie.py | python | BaseCookie.js_output | (self, attrs=None) | return _nulljoin(result) | Return a string suitable for JavaScript. | Return a string suitable for JavaScript. | [
"Return",
"a",
"string",
"suitable",
"for",
"JavaScript",
"."
] | def js_output(self, attrs=None):
"""Return a string suitable for JavaScript."""
result = []
items = self.items()
items.sort()
for K,V in items:
result.append( V.js_output(attrs) )
return _nulljoin(result) | [
"def",
"js_output",
"(",
"self",
",",
"attrs",
"=",
"None",
")",
":",
"result",
"=",
"[",
"]",
"items",
"=",
"self",
".",
"items",
"(",
")",
"items",
".",
"sort",
"(",
")",
"for",
"K",
",",
"V",
"in",
"items",
":",
"result",
".",
"append",
"(",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/Cookie.py#L608-L615 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus3.in.py | python | exodus.elem_blk_info | (self, object_id) | return elemType.value, numElem.value, nodesPerElem.value, numAttr.value | get the element block info
>>> elem_type, num_blk_elems, num_elem_nodes, num_elem_attrs
... = exo.elem_blk_info(elem_blk_id)
Parameters
----------
elem_blk_id : int
element block *ID* (not *INDEX*)
Returns
-------
<string> elem_ty... | get the element block info | [
"get",
"the",
"element",
"block",
"info"
] | def elem_blk_info(self, object_id):
"""
get the element block info
>>> elem_type, num_blk_elems, num_elem_nodes, num_elem_attrs
... = exo.elem_blk_info(elem_blk_id)
Parameters
----------
elem_blk_id : int
element block *ID* (not *INDEX*)
... | [
"def",
"elem_blk_info",
"(",
"self",
",",
"object_id",
")",
":",
"(",
"elemType",
",",
"numElem",
",",
"nodesPerElem",
",",
"numAttr",
")",
"=",
"self",
".",
"__ex_get_block",
"(",
"'EX_ELEM_BLOCK'",
",",
"object_id",
")",
"return",
"elemType",
".",
"value",... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L2490-L2510 | |
FeatherCoin/Feathercoin | 8dad11707024149029bb9bfdd7bc5e10385e0e77 | contrib/devtools/optimize-pngs.py | python | file_hash | (filename) | Return hash of raw file contents | Return hash of raw file contents | [
"Return",
"hash",
"of",
"raw",
"file",
"contents"
] | def file_hash(filename):
'''Return hash of raw file contents'''
with open(filename, 'rb') as f:
return hashlib.sha256(f.read()).hexdigest() | [
"def",
"file_hash",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"f",
":",
"return",
"hashlib",
".",
"sha256",
"(",
"f",
".",
"read",
"(",
")",
")",
".",
"hexdigest",
"(",
")"
] | https://github.com/FeatherCoin/Feathercoin/blob/8dad11707024149029bb9bfdd7bc5e10385e0e77/contrib/devtools/optimize-pngs.py#L15-L18 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/operator.py | python | iadd | (a, b) | return a | Same as a += b. | Same as a += b. | [
"Same",
"as",
"a",
"+",
"=",
"b",
"."
] | def iadd(a, b):
"Same as a += b."
a += b
return a | [
"def",
"iadd",
"(",
"a",
",",
"b",
")",
":",
"a",
"+=",
"b",
"return",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/operator.py#L337-L340 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/urllib3/poolmanager.py | python | PoolManager._new_pool | (self, scheme, host, port, request_context=None) | return pool_cls(host, port, **request_context) | Create a new :class:`ConnectionPool` based on host, port, scheme, and
any additional pool keyword arguments.
If ``request_context`` is provided, it is provided as keyword arguments
to the pool class used. This method is used to actually create the
connection pools handed out by :meth:`c... | Create a new :class:`ConnectionPool` based on host, port, scheme, and
any additional pool keyword arguments. | [
"Create",
"a",
"new",
":",
"class",
":",
"ConnectionPool",
"based",
"on",
"host",
"port",
"scheme",
"and",
"any",
"additional",
"pool",
"keyword",
"arguments",
"."
] | def _new_pool(self, scheme, host, port, request_context=None):
"""
Create a new :class:`ConnectionPool` based on host, port, scheme, and
any additional pool keyword arguments.
If ``request_context`` is provided, it is provided as keyword arguments
to the pool class used. This me... | [
"def",
"_new_pool",
"(",
"self",
",",
"scheme",
",",
"host",
",",
"port",
",",
"request_context",
"=",
"None",
")",
":",
"pool_cls",
"=",
"self",
".",
"pool_classes_by_scheme",
"[",
"scheme",
"]",
"if",
"request_context",
"is",
"None",
":",
"request_context"... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/urllib3/poolmanager.py#L171-L196 | |
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/Maze/module.py | python | MazeMod.start_astar3 | (self) | start the A* search demo with teleporting agents and a front marked by moving agents | start the A* search demo with teleporting agents and a front marked by moving agents | [
"start",
"the",
"A",
"*",
"search",
"demo",
"with",
"teleporting",
"agents",
"and",
"a",
"front",
"marked",
"by",
"moving",
"agents"
] | def start_astar3(self):
""" start the A* search demo with teleporting agents and a front marked by moving agents """
self.start_agent("data/shapes/character/SydneyAStar3.xml", MazeEnvironment) | [
"def",
"start_astar3",
"(",
"self",
")",
":",
"self",
".",
"start_agent",
"(",
"\"data/shapes/character/SydneyAStar3.xml\"",
",",
"MazeEnvironment",
")"
] | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Maze/module.py#L129-L131 | ||
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | utils/grid.py | python | TimelineEvent.__search | (self, key) | return l | ! Search function
@param self this object
@param key the key
@return event index | ! Search function | [
"!",
"Search",
"function"
] | def __search(self, key):
"""! Search function
@param self this object
@param key the key
@return event index
"""
l = 0
u = len(self.events)-1
while l <= u:
i = int((l + u) / 2)
if key == self.events[i].at:
return i
... | [
"def",
"__search",
"(",
"self",
",",
"key",
")",
":",
"l",
"=",
"0",
"u",
"=",
"len",
"(",
"self",
".",
"events",
")",
"-",
"1",
"while",
"l",
"<=",
"u",
":",
"i",
"=",
"int",
"(",
"(",
"l",
"+",
"u",
")",
"/",
"2",
")",
"if",
"key",
"=... | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L201-L218 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | _BatchMatMulShape | (op) | return [batch_dims.concatenate([output_rows, output_cols])] | Shape function for BatchMatMul op. | Shape function for BatchMatMul op. | [
"Shape",
"function",
"for",
"BatchMatMul",
"op",
"."
] | def _BatchMatMulShape(op):
"""Shape function for BatchMatMul op."""
a_shape = op.inputs[0].get_shape()
adj_a = op.get_attr("adj_x")
b_shape = op.inputs[1].get_shape()
adj_b = op.get_attr("adj_y")
if a_shape.dims is None and b_shape.dims is None:
return [tensor_shape.unknown_shape()]
batch_dims = a_sha... | [
"def",
"_BatchMatMulShape",
"(",
"op",
")",
":",
"a_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
"adj_a",
"=",
"op",
".",
"get_attr",
"(",
"\"adj_x\"",
")",
"b_shape",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
".",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1549-L1563 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/inspect.py | python | getdoc | (object) | return cleandoc(doc) | Get the documentation string for an object.
All tabs are expanded to spaces. To clean up docstrings that are
indented to line up with blocks of code, any whitespace than can be
uniformly removed from the second line onwards is removed. | Get the documentation string for an object. | [
"Get",
"the",
"documentation",
"string",
"for",
"an",
"object",
"."
] | def getdoc(object):
"""Get the documentation string for an object.
All tabs are expanded to spaces. To clean up docstrings that are
indented to line up with blocks of code, any whitespace than can be
uniformly removed from the second line onwards is removed."""
try:
doc = object.__doc__
... | [
"def",
"getdoc",
"(",
"object",
")",
":",
"try",
":",
"doc",
"=",
"object",
".",
"__doc__",
"except",
"AttributeError",
":",
"return",
"None",
"if",
"not",
"isinstance",
"(",
"doc",
",",
"types",
".",
"StringTypes",
")",
":",
"return",
"None",
"return",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/inspect.py#L355-L367 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | python | XCConfigurationList.DelBuildSetting | (self, key) | Deletes the build setting key from all child XCBuildConfiguration
objects. | Deletes the build setting key from all child XCBuildConfiguration
objects. | [
"Deletes",
"the",
"build",
"setting",
"key",
"from",
"all",
"child",
"XCBuildConfiguration",
"objects",
"."
] | def DelBuildSetting(self, key):
"""Deletes the build setting key from all child XCBuildConfiguration
objects.
"""
for configuration in self._properties["buildConfigurations"]:
configuration.DelBuildSetting(key) | [
"def",
"DelBuildSetting",
"(",
"self",
",",
"key",
")",
":",
"for",
"configuration",
"in",
"self",
".",
"_properties",
"[",
"\"buildConfigurations\"",
"]",
":",
"configuration",
".",
"DelBuildSetting",
"(",
"key",
")"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py#L1791-L1797 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/instrument.py | python | Instrument.settle | (self, settle) | Sets the settle of this Instrument.
:param settle: The settle of this Instrument. # noqa: E501
:type: datetime | Sets the settle of this Instrument. | [
"Sets",
"the",
"settle",
"of",
"this",
"Instrument",
"."
] | def settle(self, settle):
"""Sets the settle of this Instrument.
:param settle: The settle of this Instrument. # noqa: E501
:type: datetime
"""
self._settle = settle | [
"def",
"settle",
"(",
"self",
",",
"settle",
")",
":",
"self",
".",
"_settle",
"=",
"settle"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L719-L727 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/ror/nyan_subprocessor.py | python | RoRNyanSubprocessor.convert | (cls, gamedata) | Create nyan objects from the given dataset. | Create nyan objects from the given dataset. | [
"Create",
"nyan",
"objects",
"from",
"the",
"given",
"dataset",
"."
] | def convert(cls, gamedata):
"""
Create nyan objects from the given dataset.
"""
cls._process_game_entities(gamedata)
cls._create_nyan_objects(gamedata)
cls._create_nyan_members(gamedata)
cls._check_objects(gamedata) | [
"def",
"convert",
"(",
"cls",
",",
"gamedata",
")",
":",
"cls",
".",
"_process_game_entities",
"(",
"gamedata",
")",
"cls",
".",
"_create_nyan_objects",
"(",
"gamedata",
")",
"cls",
".",
"_create_nyan_members",
"(",
"gamedata",
")",
"cls",
".",
"_check_objects... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/ror/nyan_subprocessor.py#L35-L43 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | Font.GetNoAntiAliasing | (*args, **kwargs) | return _gdi_.Font_GetNoAntiAliasing(*args, **kwargs) | GetNoAntiAliasing(self) -> bool | GetNoAntiAliasing(self) -> bool | [
"GetNoAntiAliasing",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetNoAntiAliasing(*args, **kwargs):
"""GetNoAntiAliasing(self) -> bool"""
return _gdi_.Font_GetNoAntiAliasing(*args, **kwargs) | [
"def",
"GetNoAntiAliasing",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_GetNoAntiAliasing",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L2433-L2435 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/config.py | python | config.check_header | (self, header, include_dirs=None, library_dirs=None,
lang="c") | return self.try_cpp(body="/* No body */", headers=[header],
include_dirs=include_dirs) | Determine if the system header file named by 'header_file'
exists and can be found by the preprocessor; return true if so,
false otherwise. | Determine if the system header file named by 'header_file'
exists and can be found by the preprocessor; return true if so,
false otherwise. | [
"Determine",
"if",
"the",
"system",
"header",
"file",
"named",
"by",
"header_file",
"exists",
"and",
"can",
"be",
"found",
"by",
"the",
"preprocessor",
";",
"return",
"true",
"if",
"so",
"false",
"otherwise",
"."
] | def check_header(self, header, include_dirs=None, library_dirs=None,
lang="c"):
"""Determine if the system header file named by 'header_file'
exists and can be found by the preprocessor; return true if so,
false otherwise.
"""
return self.try_cpp(body="/* No ... | [
"def",
"check_header",
"(",
"self",
",",
"header",
",",
"include_dirs",
"=",
"None",
",",
"library_dirs",
"=",
"None",
",",
"lang",
"=",
"\"c\"",
")",
":",
"return",
"self",
".",
"try_cpp",
"(",
"body",
"=",
"\"/* No body */\"",
",",
"headers",
"=",
"[",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/config.py#L334-L341 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | RectS | (*args, **kwargs) | return val | RectS(Size size) -> Rect
Create a new Rect from a size only. | RectS(Size size) -> Rect | [
"RectS",
"(",
"Size",
"size",
")",
"-",
">",
"Rect"
] | def RectS(*args, **kwargs):
"""
RectS(Size size) -> Rect
Create a new Rect from a size only.
"""
val = _core_.new_RectS(*args, **kwargs)
return val | [
"def",
"RectS",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_core_",
".",
"new_RectS",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1621-L1628 | |
pgRouting/osm2pgrouting | 8491929fc4037d308f271e84d59bb96da3c28aa2 | tools/cpplint.py | python | ProcessLine | (filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]) | Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
clean_lines: An array of strings, each representing a line of the file,
with comments stripped.
line: Number of line being ... | Processes a single line in the file. | [
"Processes",
"a",
"single",
"line",
"in",
"the",
"file",
"."
] | def ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]):
"""Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (d... | [
"def",
"ProcessLine",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line",
",",
"include_state",
",",
"function_state",
",",
"nesting_state",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"raw_lines",
"=",
"clean_lines"... | https://github.com/pgRouting/osm2pgrouting/blob/8491929fc4037d308f271e84d59bb96da3c28aa2/tools/cpplint.py#L5904-L5947 | ||
OpenNI/OpenNI | 1e9524ffd759841789dadb4ca19fb5d4ac5820e7 | Externals/PSCommon/Windows/CreateRedist/redist_base.py | python | RedistBase.check_upgrade_install_sln | (self) | preconsdition: CWD is where wix-variables-file is stored | preconsdition: CWD is where wix-variables-file is stored | [
"preconsdition",
":",
"CWD",
"is",
"where",
"wix",
"-",
"variables",
"-",
"file",
"is",
"stored"
] | def check_upgrade_install_sln(self):
"""preconsdition: CWD is where wix-variables-file is stored"""
up_wix_file = os.path.join('..\\..\\CreateRedist',self.output_dir,"Upgrade%sWIX.txt"%(self.redist_internal_name))
if self.VS_NEED_UPGRADE == 1:
subprocess.call("\"" + self.VS_INST_DIR ... | [
"def",
"check_upgrade_install_sln",
"(",
"self",
")",
":",
"up_wix_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"'..\\\\..\\\\CreateRedist'",
",",
"self",
".",
"output_dir",
",",
"\"Upgrade%sWIX.txt\"",
"%",
"(",
"self",
".",
"redist_internal_name",
")",
")"... | https://github.com/OpenNI/OpenNI/blob/1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Externals/PSCommon/Windows/CreateRedist/redist_base.py#L758-L763 | ||
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/ctml2yaml.py | python | Reaction.arrhenius | (self, rate_coeff: etree.Element) | return FlowMap(
{
"rate-constant": self.process_arrhenius_parameters(
rate_coeff.find("Arrhenius")
)
}
) | Process a standard Arrhenius-type reaction.
:param rate_coeff:
The XML node with rate coefficient information for this reaction. | Process a standard Arrhenius-type reaction. | [
"Process",
"a",
"standard",
"Arrhenius",
"-",
"type",
"reaction",
"."
] | def arrhenius(self, rate_coeff: etree.Element) -> "ARRHENIUS_TYPE":
"""Process a standard Arrhenius-type reaction.
:param rate_coeff:
The XML node with rate coefficient information for this reaction.
"""
return FlowMap(
{
"rate-constant": self.pro... | [
"def",
"arrhenius",
"(",
"self",
",",
"rate_coeff",
":",
"etree",
".",
"Element",
")",
"->",
"\"ARRHENIUS_TYPE\"",
":",
"return",
"FlowMap",
"(",
"{",
"\"rate-constant\"",
":",
"self",
".",
"process_arrhenius_parameters",
"(",
"rate_coeff",
".",
"find",
"(",
"... | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/ctml2yaml.py#L2407-L2419 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/nanfunctions.py | python | nansum | (a, axis=None, dtype=None, out=None, keepdims=np._NoValue) | return np.sum(a, axis=axis, dtype=dtype, out=out, keepdims=keepdims) | Return the sum of array elements over a given axis treating Not a
Numbers (NaNs) as zero.
In NumPy versions <= 1.9.0 Nan is returned for slices that are all-NaN or
empty. In later versions zero is returned.
Parameters
----------
a : array_like
Array containing numbers whose sum is desi... | Return the sum of array elements over a given axis treating Not a
Numbers (NaNs) as zero. | [
"Return",
"the",
"sum",
"of",
"array",
"elements",
"over",
"a",
"given",
"axis",
"treating",
"Not",
"a",
"Numbers",
"(",
"NaNs",
")",
"as",
"zero",
"."
] | def nansum(a, axis=None, dtype=None, out=None, keepdims=np._NoValue):
"""
Return the sum of array elements over a given axis treating Not a
Numbers (NaNs) as zero.
In NumPy versions <= 1.9.0 Nan is returned for slices that are all-NaN or
empty. In later versions zero is returned.
Parameters
... | [
"def",
"nansum",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"out",
"=",
"None",
",",
"keepdims",
"=",
"np",
".",
"_NoValue",
")",
":",
"a",
",",
"mask",
"=",
"_replace_nan",
"(",
"a",
",",
"0",
")",
"return",
"np",
".",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/nanfunctions.py#L560-L650 | |
fluffos/fluffos | bf54d5d4acef4de49dbed7d184849a7b7b354156 | src/thirdparty/libevent/event_rpcgen.py | python | Struct.PrintIndented | (filep, ident, code) | Takes an array, add indentation to each entry and prints it. | Takes an array, add indentation to each entry and prints it. | [
"Takes",
"an",
"array",
"add",
"indentation",
"to",
"each",
"entry",
"and",
"prints",
"it",
"."
] | def PrintIndented(filep, ident, code):
"""Takes an array, add indentation to each entry and prints it."""
for entry in code:
filep.write("%s%s\n" % (ident, entry)) | [
"def",
"PrintIndented",
"(",
"filep",
",",
"ident",
",",
"code",
")",
":",
"for",
"entry",
"in",
"code",
":",
"filep",
".",
"write",
"(",
"\"%s%s\\n\"",
"%",
"(",
"ident",
",",
"entry",
")",
")"
] | https://github.com/fluffos/fluffos/blob/bf54d5d4acef4de49dbed7d184849a7b7b354156/src/thirdparty/libevent/event_rpcgen.py#L93-L96 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_asm68k.py | python | SyntaxData.GetSyntaxSpec | (self) | return SYNTAX_ITEMS | Syntax Specifications | Syntax Specifications | [
"Syntax",
"Specifications"
] | def GetSyntaxSpec(self):
"""Syntax Specifications"""
return SYNTAX_ITEMS | [
"def",
"GetSyntaxSpec",
"(",
"self",
")",
":",
"return",
"SYNTAX_ITEMS"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_asm68k.py#L128-L130 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/zipimport.py | python | zipimporter.find_module | (self, fullname, path=None) | return self.find_loader(fullname, path)[0] | find_module(fullname, path=None) -> self or None.
Search for a module specified by 'fullname'. 'fullname' must be the
fully qualified (dotted) module name. It returns the zipimporter
instance itself if the module was found, or None if it wasn't.
The optional 'path' argument is ignored -... | find_module(fullname, path=None) -> self or None. | [
"find_module",
"(",
"fullname",
"path",
"=",
"None",
")",
"-",
">",
"self",
"or",
"None",
"."
] | def find_module(self, fullname, path=None):
"""find_module(fullname, path=None) -> self or None.
Search for a module specified by 'fullname'. 'fullname' must be the
fully qualified (dotted) module name. It returns the zipimporter
instance itself if the module was found, or None if it wa... | [
"def",
"find_module",
"(",
"self",
",",
"fullname",
",",
"path",
"=",
"None",
")",
":",
"return",
"self",
".",
"find_loader",
"(",
"fullname",
",",
"path",
")",
"[",
"0",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/zipimport.py#L141-L150 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/ir_utils.py | python | remove_dels | (blocks) | return | remove ir.Del nodes | remove ir.Del nodes | [
"remove",
"ir",
".",
"Del",
"nodes"
] | def remove_dels(blocks):
"""remove ir.Del nodes"""
for block in blocks.values():
new_body = []
for stmt in block.body:
if not isinstance(stmt, ir.Del):
new_body.append(stmt)
block.body = new_body
return | [
"def",
"remove_dels",
"(",
"blocks",
")",
":",
"for",
"block",
"in",
"blocks",
".",
"values",
"(",
")",
":",
"new_body",
"=",
"[",
"]",
"for",
"stmt",
"in",
"block",
".",
"body",
":",
"if",
"not",
"isinstance",
"(",
"stmt",
",",
"ir",
".",
"Del",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/ir_utils.py#L488-L496 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py | python | Panedwindow.__init__ | (self, master=None, **kw) | Construct a Ttk Panedwindow with parent master.
STANDARD OPTIONS
class, cursor, style, takefocus
WIDGET-SPECIFIC OPTIONS
orient, width, height
PANE OPTIONS
weight | Construct a Ttk Panedwindow with parent master. | [
"Construct",
"a",
"Ttk",
"Panedwindow",
"with",
"parent",
"master",
"."
] | def __init__(self, master=None, **kw):
"""Construct a Ttk Panedwindow with parent master.
STANDARD OPTIONS
class, cursor, style, takefocus
WIDGET-SPECIFIC OPTIONS
orient, width, height
PANE OPTIONS
weight
"""
Widget.__init__(self,... | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"\"ttk::panedwindow\"",
",",
"kw",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py#L934-L949 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/platforms/platform_impl_win_x64.py | python | vs_installation_version_compare | (left, right) | return 0 | Simple helper function to do a version compare of vs installations
:param left: Left value to compare
:param right: Right value to compare
:return: strcmp equivalent values | Simple helper function to do a version compare of vs installations
:param left: Left value to compare
:param right: Right value to compare
:return: strcmp equivalent values | [
"Simple",
"helper",
"function",
"to",
"do",
"a",
"version",
"compare",
"of",
"vs",
"installations",
":",
"param",
"left",
":",
"Left",
"value",
"to",
"compare",
":",
"param",
"right",
":",
"Right",
"value",
"to",
"compare",
":",
"return",
":",
"strcmp",
... | def vs_installation_version_compare(left, right):
"""
Simple helper function to do a version compare of vs installations
:param left: Left value to compare
:param right: Right value to compare
:return: strcmp equivalent values
"""
left_parts = left.split('.')
right_parts = right.sp... | [
"def",
"vs_installation_version_compare",
"(",
"left",
",",
"right",
")",
":",
"left_parts",
"=",
"left",
".",
"split",
"(",
"'.'",
")",
"right_parts",
"=",
"right",
".",
"split",
"(",
"'.'",
")",
"left_len",
"=",
"len",
"(",
"left_parts",
")",
"right_len"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/platforms/platform_impl_win_x64.py#L476-L507 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/bin/bundyctl/moduleinfo.py | python | ModuleInfo.add_command | (self, command_info) | Add a CommandInfo to this ModuleInfo. | Add a CommandInfo to this ModuleInfo. | [
"Add",
"a",
"CommandInfo",
"to",
"this",
"ModuleInfo",
"."
] | def add_command(self, command_info):
"""Add a CommandInfo to this ModuleInfo."""
self.commands[command_info.name] = command_info | [
"def",
"add_command",
"(",
"self",
",",
"command_info",
")",
":",
"self",
".",
"commands",
"[",
"command_info",
".",
"name",
"]",
"=",
"command_info"
] | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/bin/bundyctl/moduleinfo.py#L201-L203 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | TimeSpan.Multiply | (*args, **kwargs) | return _misc_.TimeSpan_Multiply(*args, **kwargs) | Multiply(self, int n) -> TimeSpan | Multiply(self, int n) -> TimeSpan | [
"Multiply",
"(",
"self",
"int",
"n",
")",
"-",
">",
"TimeSpan"
] | def Multiply(*args, **kwargs):
"""Multiply(self, int n) -> TimeSpan"""
return _misc_.TimeSpan_Multiply(*args, **kwargs) | [
"def",
"Multiply",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"TimeSpan_Multiply",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4422-L4424 | |
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | tools/clang/bindings/python/clang/cindex.py | python | CursorKind.is_unexposed | (self) | return conf.lib.clang_isUnexposed(self) | Test if this is an unexposed kind. | Test if this is an unexposed kind. | [
"Test",
"if",
"this",
"is",
"an",
"unexposed",
"kind",
"."
] | def is_unexposed(self):
"""Test if this is an unexposed kind."""
return conf.lib.clang_isUnexposed(self) | [
"def",
"is_unexposed",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isUnexposed",
"(",
"self",
")"
] | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/bindings/python/clang/cindex.py#L608-L610 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/BaseHTTPServer.py | python | BaseHTTPRequestHandler.address_string | (self) | return socket.getfqdn(host) | Return the client address formatted for logging.
This version looks up the full hostname using gethostbyaddr(),
and tries to find a name that contains at least one dot. | Return the client address formatted for logging. | [
"Return",
"the",
"client",
"address",
"formatted",
"for",
"logging",
"."
] | def address_string(self):
"""Return the client address formatted for logging.
This version looks up the full hostname using gethostbyaddr(),
and tries to find a name that contains at least one dot.
"""
host, port = self.client_address[:2]
return socket.getfqdn(host) | [
"def",
"address_string",
"(",
"self",
")",
":",
"host",
",",
"port",
"=",
"self",
".",
"client_address",
"[",
":",
"2",
"]",
"return",
"socket",
".",
"getfqdn",
"(",
"host",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/BaseHTTPServer.py#L489-L498 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/dom/pulldom.py | python | DOMEventStream._emit | (self) | return rc | Fallback replacement for getEvent() that emits
the events that _slurp() read previously. | Fallback replacement for getEvent() that emits
the events that _slurp() read previously. | [
"Fallback",
"replacement",
"for",
"getEvent",
"()",
"that",
"emits",
"the",
"events",
"that",
"_slurp",
"()",
"read",
"previously",
"."
] | def _emit(self):
""" Fallback replacement for getEvent() that emits
the events that _slurp() read previously.
"""
rc = self.pulldom.firstEvent[1][0]
self.pulldom.firstEvent[1] = self.pulldom.firstEvent[1][1]
return rc | [
"def",
"_emit",
"(",
"self",
")",
":",
"rc",
"=",
"self",
".",
"pulldom",
".",
"firstEvent",
"[",
"1",
"]",
"[",
"0",
"]",
"self",
".",
"pulldom",
".",
"firstEvent",
"[",
"1",
"]",
"=",
"self",
".",
"pulldom",
".",
"firstEvent",
"[",
"1",
"]",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/dom/pulldom.py#L280-L286 | |
FEniCS/dolfinx | 3dfdf038cccdb70962865b58a63bf29c2e55ec6e | utils/pylit/pylit.py | python | is_newer | (path1, path2) | return mtime1 > mtime2 | Check if `path1` is newer than `path2` (using mtime)
Compare modification time of files at path1 and path2.
Non-existing files are considered oldest: Return False if path1 does not
exist and True if path2 does not exist.
Return None for equal modification time. (This evaluates to False in a
Boole... | Check if `path1` is newer than `path2` (using mtime) | [
"Check",
"if",
"path1",
"is",
"newer",
"than",
"path2",
"(",
"using",
"mtime",
")"
] | def is_newer(path1, path2):
"""Check if `path1` is newer than `path2` (using mtime)
Compare modification time of files at path1 and path2.
Non-existing files are considered oldest: Return False if path1 does not
exist and True if path2 does not exist.
Return None for equal modification time. (Thi... | [
"def",
"is_newer",
"(",
"path1",
",",
"path2",
")",
":",
"try",
":",
"mtime1",
"=",
"os",
".",
"path",
".",
"getmtime",
"(",
"path1",
")",
"except",
"OSError",
":",
"mtime1",
"=",
"-",
"1",
"try",
":",
"mtime2",
"=",
"os",
".",
"path",
".",
"getm... | https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/utils/pylit/pylit.py#L1518-L1542 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_tstutils.py | python | aps15_f | (x, n) | return np.exp((n + 1) * x / 2 * 1000) - 1.859 | r"""piecewise linear, constant outside of [0, 0.002/(1+n)] | r"""piecewise linear, constant outside of [0, 0.002/(1+n)] | [
"r",
"piecewise",
"linear",
"constant",
"outside",
"of",
"[",
"0",
"0",
".",
"002",
"/",
"(",
"1",
"+",
"n",
")",
"]"
] | def aps15_f(x, n):
r"""piecewise linear, constant outside of [0, 0.002/(1+n)]"""
if x < 0:
return -0.859
if x > 2 * 1e-3 / (1 + n):
return np.e - 1.859
return np.exp((n + 1) * x / 2 * 1000) - 1.859 | [
"def",
"aps15_f",
"(",
"x",
",",
"n",
")",
":",
"if",
"x",
"<",
"0",
":",
"return",
"-",
"0.859",
"if",
"x",
">",
"2",
"*",
"1e-3",
"/",
"(",
"1",
"+",
"n",
")",
":",
"return",
"np",
".",
"e",
"-",
"1.859",
"return",
"np",
".",
"exp",
"("... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_tstutils.py#L373-L379 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/animate.py | python | AnimationCtrlBase.GetInactiveBitmap | (*args, **kwargs) | return _animate.AnimationCtrlBase_GetInactiveBitmap(*args, **kwargs) | GetInactiveBitmap(self) -> Bitmap | GetInactiveBitmap(self) -> Bitmap | [
"GetInactiveBitmap",
"(",
"self",
")",
"-",
">",
"Bitmap"
] | def GetInactiveBitmap(*args, **kwargs):
"""GetInactiveBitmap(self) -> Bitmap"""
return _animate.AnimationCtrlBase_GetInactiveBitmap(*args, **kwargs) | [
"def",
"GetInactiveBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_animate",
".",
"AnimationCtrlBase_GetInactiveBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/animate.py#L181-L183 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py | python | Event.arguments | (self) | return self._arguments | Get the event arguments. | Get the event arguments. | [
"Get",
"the",
"event",
"arguments",
"."
] | def arguments(self):
"""Get the event arguments."""
return self._arguments | [
"def",
"arguments",
"(",
"self",
")",
":",
"return",
"self",
".",
"_arguments"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L1152-L1154 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/thrift/server/TNonblockingServer.py | python | TNonblockingServer.setNumThreads | (self, num) | Set the number of worker threads that should be created. | Set the number of worker threads that should be created. | [
"Set",
"the",
"number",
"of",
"worker",
"threads",
"that",
"should",
"be",
"created",
"."
] | def setNumThreads(self, num):
"""Set the number of worker threads that should be created."""
# implement ThreadPool interface
assert not self.prepared, "You can't change number of threads for working server"
self.threads = num | [
"def",
"setNumThreads",
"(",
"self",
",",
"num",
")",
":",
"# implement ThreadPool interface",
"assert",
"not",
"self",
".",
"prepared",
",",
"\"You can't change number of threads for working server\"",
"self",
".",
"threads",
"=",
"num"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/thrift/server/TNonblockingServer.py#L229-L233 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/feature_extraction/image.py | python | _to_graph | (n_x, n_y, n_z, mask=None, img=None,
return_as=sparse.coo_matrix, dtype=None) | return return_as(graph) | Auxiliary function for img_to_graph and grid_to_graph | Auxiliary function for img_to_graph and grid_to_graph | [
"Auxiliary",
"function",
"for",
"img_to_graph",
"and",
"grid_to_graph"
] | def _to_graph(n_x, n_y, n_z, mask=None, img=None,
return_as=sparse.coo_matrix, dtype=None):
"""Auxiliary function for img_to_graph and grid_to_graph
"""
edges = _make_edges_3d(n_x, n_y, n_z)
if dtype is None:
if img is None:
dtype = np.int
else:
dty... | [
"def",
"_to_graph",
"(",
"n_x",
",",
"n_y",
",",
"n_z",
",",
"mask",
"=",
"None",
",",
"img",
"=",
"None",
",",
"return_as",
"=",
"sparse",
".",
"coo_matrix",
",",
"dtype",
"=",
"None",
")",
":",
"edges",
"=",
"_make_edges_3d",
"(",
"n_x",
",",
"n_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_extraction/image.py#L87-L129 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/installers.py | python | InstallerContext.get_os_detect | (self) | return self.os_detect | :returns os_detect: :class:`OsDetect` instance used for
detecting platforms. | :returns os_detect: :class:`OsDetect` instance used for
detecting platforms. | [
":",
"returns",
"os_detect",
":",
":",
"class",
":",
"OsDetect",
"instance",
"used",
"for",
"detecting",
"platforms",
"."
] | def get_os_detect(self):
"""
:returns os_detect: :class:`OsDetect` instance used for
detecting platforms.
"""
return self.os_detect | [
"def",
"get_os_detect",
"(",
"self",
")",
":",
"return",
"self",
".",
"os_detect"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/installers.py#L117-L122 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/DecTree/BuildQuantTree.py | python | BuildQuantTree | (examples, target, attrs, nPossibleVals, nBoundsPerVar, depth=0, maxDepth=-1,
exIndices=None, **kwargs) | return tree | **Arguments**
- examples: a list of lists (nInstances x nVariables+1) of variable
values + instance values
- target: an int
- attrs: a list of ints indicating which variables can be used in the tree
- nPossibleVals: a list containing the number of possible values of
... | **Arguments** | [
"**",
"Arguments",
"**"
] | def BuildQuantTree(examples, target, attrs, nPossibleVals, nBoundsPerVar, depth=0, maxDepth=-1,
exIndices=None, **kwargs):
"""
**Arguments**
- examples: a list of lists (nInstances x nVariables+1) of variable
values + instance values
- target: an int
- a... | [
"def",
"BuildQuantTree",
"(",
"examples",
",",
"target",
",",
"attrs",
",",
"nPossibleVals",
",",
"nBoundsPerVar",
",",
"depth",
"=",
"0",
",",
"maxDepth",
"=",
"-",
"1",
",",
"exIndices",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"tree",
"=",
... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/DecTree/BuildQuantTree.py#L87-L208 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/inspect.py | python | trace | (context=1) | return getinnerframes(sys.exc_info()[2], context) | Return a list of records for the stack below the current exception. | Return a list of records for the stack below the current exception. | [
"Return",
"a",
"list",
"of",
"records",
"for",
"the",
"stack",
"below",
"the",
"current",
"exception",
"."
] | def trace(context=1):
"""Return a list of records for the stack below the current exception."""
return getinnerframes(sys.exc_info()[2], context) | [
"def",
"trace",
"(",
"context",
"=",
"1",
")",
":",
"return",
"getinnerframes",
"(",
"sys",
".",
"exc_info",
"(",
")",
"[",
"2",
"]",
",",
"context",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/inspect.py#L1056-L1058 | |
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/pyratemp.py | python | Parser._errpos | (self, fpos) | return filename, srow(string, fpos), scol(string, fpos) | Convert `fpos` to ``(filename,row,column)`` for error-messages. | Convert `fpos` to ``(filename,row,column)`` for error-messages. | [
"Convert",
"fpos",
"to",
"(",
"filename",
"row",
"column",
")",
"for",
"error",
"-",
"messages",
"."
] | def _errpos(self, fpos):
"""Convert `fpos` to ``(filename,row,column)`` for error-messages."""
filename, string = self._includestack[-1]
return filename, srow(string, fpos), scol(string, fpos) | [
"def",
"_errpos",
"(",
"self",
",",
"fpos",
")",
":",
"filename",
",",
"string",
"=",
"self",
".",
"_includestack",
"[",
"-",
"1",
"]",
"return",
"filename",
",",
"srow",
"(",
"string",
",",
"fpos",
")",
",",
"scol",
"(",
"string",
",",
"fpos",
")"... | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/pyratemp.py#L530-L533 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | Grid.DeleteRows | (*args, **kwargs) | return _grid.Grid_DeleteRows(*args, **kwargs) | DeleteRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool | DeleteRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool | [
"DeleteRows",
"(",
"self",
"int",
"pos",
"=",
"0",
"int",
"numRows",
"=",
"1",
"bool",
"updateLabels",
"=",
"True",
")",
"-",
">",
"bool"
] | def DeleteRows(*args, **kwargs):
"""DeleteRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool"""
return _grid.Grid_DeleteRows(*args, **kwargs) | [
"def",
"DeleteRows",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_DeleteRows",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1275-L1277 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/m5/ext/pyfdt/pyfdt.py | python | FdtNode.add_subnode | (self, node) | Add child, deprecated use append() | Add child, deprecated use append() | [
"Add",
"child",
"deprecated",
"use",
"append",
"()"
] | def add_subnode(self, node):
"""Add child, deprecated use append()"""
self.append(node) | [
"def",
"add_subnode",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"append",
"(",
"node",
")"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/m5/ext/pyfdt/pyfdt.py#L456-L458 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py | python | PDeque.pop | (self, count=1) | return PDeque(new_left_list, new_right_list, max(self._length - count, 0), self._maxlen) | Return new deque with rightmost element removed. Popping the empty queue
will return the empty queue. A optional count can be given to indicate the
number of elements to pop. Popping with a negative index is the same as
popleft. Executes in amortized O(k) where k is the number of elements to pop... | Return new deque with rightmost element removed. Popping the empty queue
will return the empty queue. A optional count can be given to indicate the
number of elements to pop. Popping with a negative index is the same as
popleft. Executes in amortized O(k) where k is the number of elements to pop... | [
"Return",
"new",
"deque",
"with",
"rightmost",
"element",
"removed",
".",
"Popping",
"the",
"empty",
"queue",
"will",
"return",
"the",
"empty",
"queue",
".",
"A",
"optional",
"count",
"can",
"be",
"given",
"to",
"indicate",
"the",
"number",
"of",
"elements",... | def pop(self, count=1):
"""
Return new deque with rightmost element removed. Popping the empty queue
will return the empty queue. A optional count can be given to indicate the
number of elements to pop. Popping with a negative index is the same as
popleft. Executes in amortized O... | [
"def",
"pop",
"(",
"self",
",",
"count",
"=",
"1",
")",
":",
"if",
"count",
"<",
"0",
":",
"return",
"self",
".",
"popleft",
"(",
"-",
"count",
")",
"new_right_list",
",",
"new_left_list",
"=",
"PDeque",
".",
"_pop_lists",
"(",
"self",
".",
"_right_l... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py#L105-L123 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/data_flow_ops.py | python | MapStagingArea.get | (self, key=None, indices=None, name=None) | If the key is provided, the associated (key, value)
is returned from the staging area. If the key is not
in the staging area, this method will block until
the associated (key, value) is inserted.
If no key is provided and the staging area is ordered,
the (key, value) with the smallest key will be r... | If the key is provided, the associated (key, value)
is returned from the staging area. If the key is not
in the staging area, this method will block until
the associated (key, value) is inserted. | [
"If",
"the",
"key",
"is",
"provided",
"the",
"associated",
"(",
"key",
"value",
")",
"is",
"returned",
"from",
"the",
"staging",
"area",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"staging",
"area",
"this",
"method",
"will",
"block",
"until",
"... | def get(self, key=None, indices=None, name=None):
"""
If the key is provided, the associated (key, value)
is returned from the staging area. If the key is not
in the staging area, this method will block until
the associated (key, value) is inserted.
If no key is provided and the staging area is... | [
"def",
"get",
"(",
"self",
",",
"key",
"=",
"None",
",",
"indices",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"key",
"is",
"None",
":",
"return",
"self",
".",
"_popitem",
"(",
"indices",
"=",
"indices",
",",
"name",
"=",
"name",
")",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/data_flow_ops.py#L2021-L2049 | ||
facebook/hhvm | cd8d20db628e93583fffa0194aaca937af9b2692 | hphp/tools/gdb/gdbutils.py | python | template_type | (t) | return destruct(str(t).split('<')[0]) | Get the unparametrized name of a template type. | Get the unparametrized name of a template type. | [
"Get",
"the",
"unparametrized",
"name",
"of",
"a",
"template",
"type",
"."
] | def template_type(t):
"""Get the unparametrized name of a template type."""
return destruct(str(t).split('<')[0]) | [
"def",
"template_type",
"(",
"t",
")",
":",
"return",
"destruct",
"(",
"str",
"(",
"t",
")",
".",
"split",
"(",
"'<'",
")",
"[",
"0",
"]",
")"
] | https://github.com/facebook/hhvm/blob/cd8d20db628e93583fffa0194aaca937af9b2692/hphp/tools/gdb/gdbutils.py#L294-L296 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Node.py | python | Node.path_from | (self, node) | Path of this node seen from the other::
def build(bld):
n1 = bld.path.find_node('foo/bar/xyz.txt')
n2 = bld.path.find_node('foo/stuff/')
n1.path_from(n2) # '../bar/xyz.txt'
:param node: path to use as a reference
:type node: :py:class:`waflib.Node.Node`
:returns: a relative path or an absolute on... | Path of this node seen from the other:: | [
"Path",
"of",
"this",
"node",
"seen",
"from",
"the",
"other",
"::"
] | def path_from(self, node):
"""
Path of this node seen from the other::
def build(bld):
n1 = bld.path.find_node('foo/bar/xyz.txt')
n2 = bld.path.find_node('foo/stuff/')
n1.path_from(n2) # '../bar/xyz.txt'
:param node: path to use as a reference
:type node: :py:class:`waflib.Node.Node`
:returns... | [
"def",
"path_from",
"(",
"self",
",",
"node",
")",
":",
"c1",
"=",
"self",
"c2",
"=",
"node",
"c1h",
"=",
"c1",
".",
"height",
"(",
")",
"c2h",
"=",
"c2",
".",
"height",
"(",
")",
"lst",
"=",
"[",
"]",
"up",
"=",
"0",
"while",
"c1h",
">",
"... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Node.py#L474-L519 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/tensor_format.py | python | numeric_summary | (tensor) | Get a text summary of a numeric tensor.
This summary is only available for numeric (int*, float*, complex*) and
Boolean tensors.
Args:
tensor: (`numpy.ndarray`) the tensor value object to be summarized.
Returns:
The summary text as a `RichTextLines` object. If the type of `tensor` is not
numeric ... | Get a text summary of a numeric tensor. | [
"Get",
"a",
"text",
"summary",
"of",
"a",
"numeric",
"tensor",
"."
] | def numeric_summary(tensor):
"""Get a text summary of a numeric tensor.
This summary is only available for numeric (int*, float*, complex*) and
Boolean tensors.
Args:
tensor: (`numpy.ndarray`) the tensor value object to be summarized.
Returns:
The summary text as a `RichTextLines` object. If the ty... | [
"def",
"numeric_summary",
"(",
"tensor",
")",
":",
"def",
"_counts_summary",
"(",
"counts",
",",
"skip_zeros",
"=",
"True",
",",
"total_count",
"=",
"None",
")",
":",
"\"\"\"Format values as a two-row table.\"\"\"",
"if",
"skip_zeros",
":",
"counts",
"=",
"[",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/tensor_format.py#L488-L569 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.GetClientSizeTuple | (*args, **kwargs) | return _core_.Window_GetClientSizeTuple(*args, **kwargs) | GetClientSizeTuple() -> (width, height)
This gets the size of the window's 'client area' in pixels. The client
area is the area which may be drawn on by the programmer, excluding
title bar, border, scrollbars, etc. | GetClientSizeTuple() -> (width, height) | [
"GetClientSizeTuple",
"()",
"-",
">",
"(",
"width",
"height",
")"
] | def GetClientSizeTuple(*args, **kwargs):
"""
GetClientSizeTuple() -> (width, height)
This gets the size of the window's 'client area' in pixels. The client
area is the area which may be drawn on by the programmer, excluding
title bar, border, scrollbars, etc.
"""
... | [
"def",
"GetClientSizeTuple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetClientSizeTuple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L9535-L9543 | |
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | api-reference-examples/python/pytx/pytx/threat_exchange_member.py | python | ThreatExchangeMember.objects | (cls,
full_response=False,
dict_generator=False,
retries=None,
headers=None,
proxies=None,
verify=None) | Get a list of Threat Exchange Members
:param full_response: Return the full response instead of the generator.
Takes precedence over dict_generator.
:type full_response: bool
:param dict_generator: Return a dictionary instead of an instantiated
... | Get a list of Threat Exchange Members | [
"Get",
"a",
"list",
"of",
"Threat",
"Exchange",
"Members"
] | def objects(cls,
full_response=False,
dict_generator=False,
retries=None,
headers=None,
proxies=None,
verify=None):
"""
Get a list of Threat Exchange Members
:param full_response: Return the full res... | [
"def",
"objects",
"(",
"cls",
",",
"full_response",
"=",
"False",
",",
"dict_generator",
"=",
"False",
",",
"retries",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"proxies",
"=",
"None",
",",
"verify",
"=",
"None",
")",
":",
"if",
"full_response",
"... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/api-reference-examples/python/pytx/pytx/threat_exchange_member.py#L114-L153 | ||
llvm-mirror/libcxx | 78d6a7767ed57b50122a161b91f59f19c9bd0d19 | utils/gdb/libcxx/printers.py | python | RBTreeUtils.parent | (self, node) | return parent | Return the parent of node, if it exists. | Return the parent of node, if it exists. | [
"Return",
"the",
"parent",
"of",
"node",
"if",
"it",
"exists",
"."
] | def parent(self, node):
"""Return the parent of node, if it exists."""
# If this is the root, then from the algorithm's point of view, it has no
# parent.
if node == self.root:
return None
# We don't have enough information to tell if this is the end_node (which
... | [
"def",
"parent",
"(",
"self",
",",
"node",
")",
":",
"# If this is the root, then from the algorithm's point of view, it has no",
"# parent.",
"if",
"node",
"==",
"self",
".",
"root",
":",
"return",
"None",
"# We don't have enough information to tell if this is the end_node (wh... | https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b50122a161b91f59f19c9bd0d19/utils/gdb/libcxx/printers.py#L576-L605 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/emr/step.py | python | StreamingStep.__init__ | (self, name, mapper, reducer=None, combiner=None,
action_on_failure='TERMINATE_JOB_FLOW',
cache_files=None, cache_archives=None,
step_args=None, input=None, output=None,
jar='/home/hadoop/contrib/streaming/hadoop-streaming.jar') | A hadoop streaming elastic mapreduce step
:type name: str
:param name: The name of the step
:type mapper: str
:param mapper: The mapper URI
:type reducer: str
:param reducer: The reducer URI
:type combiner: str
:param combiner: The combiner URI. Only work... | A hadoop streaming elastic mapreduce step | [
"A",
"hadoop",
"streaming",
"elastic",
"mapreduce",
"step"
] | def __init__(self, name, mapper, reducer=None, combiner=None,
action_on_failure='TERMINATE_JOB_FLOW',
cache_files=None, cache_archives=None,
step_args=None, input=None, output=None,
jar='/home/hadoop/contrib/streaming/hadoop-streaming.jar'):
""... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"mapper",
",",
"reducer",
"=",
"None",
",",
"combiner",
"=",
"None",
",",
"action_on_failure",
"=",
"'TERMINATE_JOB_FLOW'",
",",
"cache_files",
"=",
"None",
",",
"cache_archives",
"=",
"None",
",",
"step_args... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/emr/step.py#L102-L151 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/py/py/_path/svnurl.py | python | SvnCommandPath._svncmdexecauth | (self, cmd) | return self._cmdexec(cmd) | execute an svn command 'as is' | execute an svn command 'as is' | [
"execute",
"an",
"svn",
"command",
"as",
"is"
] | def _svncmdexecauth(self, cmd):
""" execute an svn command 'as is' """
cmd = svncommon.fixlocale() + cmd
if self.auth is not None:
cmd += ' ' + self.auth.makecmdoptions()
return self._cmdexec(cmd) | [
"def",
"_svncmdexecauth",
"(",
"self",
",",
"cmd",
")",
":",
"cmd",
"=",
"svncommon",
".",
"fixlocale",
"(",
")",
"+",
"cmd",
"if",
"self",
".",
"auth",
"is",
"not",
"None",
":",
"cmd",
"+=",
"' '",
"+",
"self",
".",
"auth",
".",
"makecmdoptions",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_path/svnurl.py#L63-L68 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.GetIndicatorCurrent | (*args, **kwargs) | return _stc.StyledTextCtrl_GetIndicatorCurrent(*args, **kwargs) | GetIndicatorCurrent(self) -> int
Get the current indicator | GetIndicatorCurrent(self) -> int | [
"GetIndicatorCurrent",
"(",
"self",
")",
"-",
">",
"int"
] | def GetIndicatorCurrent(*args, **kwargs):
"""
GetIndicatorCurrent(self) -> int
Get the current indicator
"""
return _stc.StyledTextCtrl_GetIndicatorCurrent(*args, **kwargs) | [
"def",
"GetIndicatorCurrent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetIndicatorCurrent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5655-L5661 | |
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp3/ctptd.py | python | CtpTd.onRspQryInvestorPositionCombineDetail | (self, InvestorPositionCombineDetailField, RspInfoField, requestId, final) | 请求查询投资者持仓明细响应 | 请求查询投资者持仓明细响应 | [
"请求查询投资者持仓明细响应"
] | def onRspQryInvestorPositionCombineDetail(self, InvestorPositionCombineDetailField, RspInfoField, requestId, final):
"""请求查询投资者持仓明细响应"""
pass | [
"def",
"onRspQryInvestorPositionCombineDetail",
"(",
"self",
",",
"InvestorPositionCombineDetailField",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp3/ctptd.py#L258-L260 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/base_api.py | python | BaseApiClient.FinalizeTransferUrl | (self, url) | return url_builder.url | Modify the url for a given transfer, based on auth and version. | Modify the url for a given transfer, based on auth and version. | [
"Modify",
"the",
"url",
"for",
"a",
"given",
"transfer",
"based",
"on",
"auth",
"and",
"version",
"."
] | def FinalizeTransferUrl(self, url):
"""Modify the url for a given transfer, based on auth and version."""
url_builder = _UrlBuilder.FromUrl(url)
if self.global_params.key:
url_builder.query_params['key'] = self.global_params.key
return url_builder.url | [
"def",
"FinalizeTransferUrl",
"(",
"self",
",",
"url",
")",
":",
"url_builder",
"=",
"_UrlBuilder",
".",
"FromUrl",
"(",
"url",
")",
"if",
"self",
".",
"global_params",
".",
"key",
":",
"url_builder",
".",
"query_params",
"[",
"'key'",
"]",
"=",
"self",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/base_api.py#L428-L433 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Tools/ccroot.py | python | process_use | (self) | Process the ``use`` attribute which contains a list of task generator names::
def build(bld):
bld.shlib(source='a.c', target='lib1')
bld.program(source='main.c', target='app', use='lib1')
See :py:func:`waflib.Tools.ccroot.use_rec`. | Process the ``use`` attribute which contains a list of task generator names:: | [
"Process",
"the",
"use",
"attribute",
"which",
"contains",
"a",
"list",
"of",
"task",
"generator",
"names",
"::"
] | def process_use(self):
"""
Process the ``use`` attribute which contains a list of task generator names::
def build(bld):
bld.shlib(source='a.c', target='lib1')
bld.program(source='main.c', target='app', use='lib1')
See :py:func:`waflib.Tools.ccroot.use_rec`.
"""
use_not = self.tmp_use_not = set([])
se... | [
"def",
"process_use",
"(",
"self",
")",
":",
"use_not",
"=",
"self",
".",
"tmp_use_not",
"=",
"set",
"(",
"[",
"]",
")",
"self",
".",
"tmp_use_seen",
"=",
"[",
"]",
"# we would like an ordered set",
"use_prec",
"=",
"self",
".",
"tmp_use_prec",
"=",
"{",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/ccroot.py#L320-L428 | ||
choasup/caffe-yolo9000 | e8a476c4c23d756632f7a26c681a96e3ab672544 | python/caffe/io.py | python | Transformer.deprocess | (self, in_, data) | return decaf_in | Invert Caffe formatting; see preprocess(). | Invert Caffe formatting; see preprocess(). | [
"Invert",
"Caffe",
"formatting",
";",
"see",
"preprocess",
"()",
"."
] | def deprocess(self, in_, data):
"""
Invert Caffe formatting; see preprocess().
"""
self.__check_input(in_)
decaf_in = data.copy().squeeze()
transpose = self.transpose.get(in_)
channel_swap = self.channel_swap.get(in_)
raw_scale = self.raw_scale.get(in_)
... | [
"def",
"deprocess",
"(",
"self",
",",
"in_",
",",
"data",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"decaf_in",
"=",
"data",
".",
"copy",
"(",
")",
".",
"squeeze",
"(",
")",
"transpose",
"=",
"self",
".",
"transpose",
".",
"get",
"("... | https://github.com/choasup/caffe-yolo9000/blob/e8a476c4c23d756632f7a26c681a96e3ab672544/python/caffe/io.py#L164-L185 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/tools/compatibility/ast_edits.py | python | PastaAnalyzeVisitor.visit_Attribute | (self, node) | Handle bare Attributes i.e. [tf.foo, tf.bar]. | Handle bare Attributes i.e. [tf.foo, tf.bar]. | [
"Handle",
"bare",
"Attributes",
"i",
".",
"e",
".",
"[",
"tf",
".",
"foo",
"tf",
".",
"bar",
"]",
"."
] | def visit_Attribute(self, node): # pylint: disable=invalid-name
"""Handle bare Attributes i.e. [tf.foo, tf.bar]."""
full_name = self._get_full_name(node)
if full_name:
detection = self._api_analysis_spec.symbols_to_detect.get(full_name, None)
if detection:
self.add_result(detection)
... | [
"def",
"visit_Attribute",
"(",
"self",
",",
"node",
")",
":",
"# pylint: disable=invalid-name",
"full_name",
"=",
"self",
".",
"_get_full_name",
"(",
"node",
")",
"if",
"full_name",
":",
"detection",
"=",
"self",
".",
"_api_analysis_spec",
".",
"symbols_to_detect"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/compatibility/ast_edits.py#L827-L838 | ||
tiann/android-native-debug | 198903ed9346dc4a74327a63cb98d449b97d8047 | app/source/art/tools/cpplint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/tiann/android-native-debug/blob/198903ed9346dc4a74327a63cb98d449b97d8047/app/source/art/tools/cpplint.py#L467-L480 | |
Dobiasd/frugally-deep | 99d9378c6ef537a209bcb2a102e953899a6ab0e3 | keras_export/convert_model.py | python | show_gru_layer | (layer) | return result | Serialize GRU layer to dict | Serialize GRU layer to dict | [
"Serialize",
"GRU",
"layer",
"to",
"dict"
] | def show_gru_layer(layer):
"""Serialize GRU layer to dict"""
assert not layer.go_backwards
assert not layer.unroll
assert not layer.return_state
weights = layer.get_weights()
assert len(weights) == 2 or len(weights) == 3
result = {'weights': encode_floats(weights[0]),
'recurren... | [
"def",
"show_gru_layer",
"(",
"layer",
")",
":",
"assert",
"not",
"layer",
".",
"go_backwards",
"assert",
"not",
"layer",
".",
"unroll",
"assert",
"not",
"layer",
".",
"return_state",
"weights",
"=",
"layer",
".",
"get_weights",
"(",
")",
"assert",
"len",
... | https://github.com/Dobiasd/frugally-deep/blob/99d9378c6ef537a209bcb2a102e953899a6ab0e3/keras_export/convert_model.py#L382-L395 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview.py | python | MplGraphicsView.get_current_plots | (self) | return tuple_list | Get the current plots on canvas
Returns
-------
list of 2-tuple: integer (plot ID) and string (label) | Get the current plots on canvas
Returns
-------
list of 2-tuple: integer (plot ID) and string (label) | [
"Get",
"the",
"current",
"plots",
"on",
"canvas",
"Returns",
"-------",
"list",
"of",
"2",
"-",
"tuple",
":",
"integer",
"(",
"plot",
"ID",
")",
"and",
"string",
"(",
"label",
")"
] | def get_current_plots(self):
"""
Get the current plots on canvas
Returns
-------
list of 2-tuple: integer (plot ID) and string (label)
"""
tuple_list = list()
line_id_list = sorted(self._my1DPlotDict.keys())
for line_id in line_id_list:
... | [
"def",
"get_current_plots",
"(",
"self",
")",
":",
"tuple_list",
"=",
"list",
"(",
")",
"line_id_list",
"=",
"sorted",
"(",
"self",
".",
"_my1DPlotDict",
".",
"keys",
"(",
")",
")",
"for",
"line_id",
"in",
"line_id_list",
":",
"tuple_list",
".",
"append",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview.py#L904-L916 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/servermanager.py | python | ServerManager.Append | (self, initializer, *init_args, **init_kwargs) | Append a server to the end of the list to run.
Servers start in the order they are appended and stop in the
opposite order.
Args:
initializer: a function that returns a server instance.
A server needs to implement the with-statement interface.
init_args: positional arguments for the ... | Append a server to the end of the list to run. | [
"Append",
"a",
"server",
"to",
"the",
"end",
"of",
"the",
"list",
"to",
"run",
"."
] | def Append(self, initializer, *init_args, **init_kwargs):
"""Append a server to the end of the list to run.
Servers start in the order they are appended and stop in the
opposite order.
Args:
initializer: a function that returns a server instance.
A server needs to implement the with-st... | [
"def",
"Append",
"(",
"self",
",",
"initializer",
",",
"*",
"init_args",
",",
"*",
"*",
"init_kwargs",
")",
":",
"self",
".",
"initializers",
".",
"append",
"(",
"(",
"initializer",
",",
"init_args",
",",
"init_kwargs",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/servermanager.py#L40-L52 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rexec.py | python | RExec.s_exec | (self, *args) | return self.s_apply(self.r_exec, args) | Execute code within a restricted environment.
Similar to the r_exec() method, but the code will be granted access
to restricted versions of the standard I/O streams sys.stdin,
sys.stderr, and sys.stdout.
The code parameter must either be a string containing one or more
lines of... | Execute code within a restricted environment. | [
"Execute",
"code",
"within",
"a",
"restricted",
"environment",
"."
] | def s_exec(self, *args):
"""Execute code within a restricted environment.
Similar to the r_exec() method, but the code will be granted access
to restricted versions of the standard I/O streams sys.stdin,
sys.stderr, and sys.stdout.
The code parameter must either be a string con... | [
"def",
"s_exec",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"self",
".",
"s_apply",
"(",
"self",
".",
"r_exec",
",",
"args",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rexec.py#L422-L434 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/metrics_impl.py | python | _sparse_false_negative_at_k | (labels,
predictions_idx,
class_id=None,
weights=None) | Calculates false negatives for recall@k.
If `class_id` is specified, calculate binary true positives for `class_id`
only.
If `class_id` is not specified, calculate metrics for `k` predicted vs
`n` label classes, where `n` is the 2nd dimension of `labels_sparse`.
Args:
labels: `int64` `Tensor` or... | Calculates false negatives for recall@k. | [
"Calculates",
"false",
"negatives",
"for",
"recall@k",
"."
] | def _sparse_false_negative_at_k(labels,
predictions_idx,
class_id=None,
weights=None):
"""Calculates false negatives for recall@k.
If `class_id` is specified, calculate binary true positives for `class_id`
only.
... | [
"def",
"_sparse_false_negative_at_k",
"(",
"labels",
",",
"predictions_idx",
",",
"class_id",
"=",
"None",
",",
"weights",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"None",
",",
"'false_negatives'",
",",
"(",
"predictions_idx",
",",
"labels... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/metrics_impl.py#L1986-L2029 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/tools/scan-build-py/libscanbuild/report.py | python | escape | (text) | return ''.join(escape_table.get(c, c) for c in text) | Paranoid HTML escape method. (Python version independent) | Paranoid HTML escape method. (Python version independent) | [
"Paranoid",
"HTML",
"escape",
"method",
".",
"(",
"Python",
"version",
"independent",
")"
] | def escape(text):
""" Paranoid HTML escape method. (Python version independent) """
escape_table = {
'&': '&',
'"': '"',
"'": ''',
'>': '>',
'<': '<'
}
return ''.join(escape_table.get(c, c) for c in text) | [
"def",
"escape",
"(",
"text",
")",
":",
"escape_table",
"=",
"{",
"'&'",
":",
"'&'",
",",
"'\"'",
":",
"'"'",
",",
"\"'\"",
":",
"'''",
",",
"'>'",
":",
"'>'",
",",
"'<'",
":",
"'<'",
"}",
"return",
"''",
".",
"join",
"(",
"esca... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/tools/scan-build-py/libscanbuild/report.py#L448-L458 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/resolvelib/providers.py | python | AbstractProvider.identify | (self, requirement_or_candidate) | Given a requirement or candidate, return an identifier for it.
This is used in many places to identify a requirement or candidate,
e.g. whether two requirements should have their specifier parts merged,
whether two candidates would conflict with each other (because they
have same name b... | Given a requirement or candidate, return an identifier for it. | [
"Given",
"a",
"requirement",
"or",
"candidate",
"return",
"an",
"identifier",
"for",
"it",
"."
] | def identify(self, requirement_or_candidate):
"""Given a requirement or candidate, return an identifier for it.
This is used in many places to identify a requirement or candidate,
e.g. whether two requirements should have their specifier parts merged,
whether two candidates would confli... | [
"def",
"identify",
"(",
"self",
",",
"requirement_or_candidate",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/resolvelib/providers.py#L4-L12 | ||
vgough/encfs | c444f9b9176beea1ad41a7b2e29ca26e709b57f7 | vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py | python | CheckPosixThreading | (filename, clean_lines, linenum, error) | Checks for calls to thread-unsafe functions.
Much code has been originally written without consideration of
multi-threading. Also, engineers are relying on their old experience;
they have learned posix before threading extensions were added. These
tests guide the engineers to use thread-safe functions (when us... | Checks for calls to thread-unsafe functions. | [
"Checks",
"for",
"calls",
"to",
"thread",
"-",
"unsafe",
"functions",
"."
] | def CheckPosixThreading(filename, clean_lines, linenum, error):
"""Checks for calls to thread-unsafe functions.
Much code has been originally written without consideration of
multi-threading. Also, engineers are relying on their old experience;
they have learned posix before threading extensions were added. Th... | [
"def",
"CheckPosixThreading",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"single_thread_function",
",",
"multithread_safe_function",
"in",
"threading_list",
":... | https://github.com/vgough/encfs/blob/c444f9b9176beea1ad41a7b2e29ca26e709b57f7/vendor/github.com/muflihun/easyloggingpp/tools/cpplint.py#L1558-L1582 | ||
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/program_members/uniform_block.py | python | UniformBlock.value | (self) | return self.mglo.value | int: The value of the uniform block. | int: The value of the uniform block. | [
"int",
":",
"The",
"value",
"of",
"the",
"uniform",
"block",
"."
] | def value(self) -> int:
'''
int: The value of the uniform block.
'''
return self.mglo.value | [
"def",
"value",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"mglo",
".",
"value"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/program_members/uniform_block.py#L38-L43 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/ccroot.py | python | accept_node_to_link | (self, node) | return not node.name.endswith('.pdb') | PRIVATE INTERNAL USE ONLY | PRIVATE INTERNAL USE ONLY | [
"PRIVATE",
"INTERNAL",
"USE",
"ONLY"
] | def accept_node_to_link(self, node):
"""
PRIVATE INTERNAL USE ONLY
"""
return not node.name.endswith('.pdb') | [
"def",
"accept_node_to_link",
"(",
"self",
",",
"node",
")",
":",
"return",
"not",
"node",
".",
"name",
".",
"endswith",
"(",
"'.pdb'",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/ccroot.py#L366-L370 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/sliceshell.py | python | SlicesShell.redirectStderr | (self, redirect=True) | If redirect is true then sys.stderr will go to the shell. | If redirect is true then sys.stderr will go to the shell. | [
"If",
"redirect",
"is",
"true",
"then",
"sys",
".",
"stderr",
"will",
"go",
"to",
"the",
"shell",
"."
] | def redirectStderr(self, redirect=True):
"""If redirect is true then sys.stderr will go to the shell."""
if redirect:
sys.stderr = PseudoFileErr(self.writeErr)
else:
sys.stderr = self.stderr | [
"def",
"redirectStderr",
"(",
"self",
",",
"redirect",
"=",
"True",
")",
":",
"if",
"redirect",
":",
"sys",
".",
"stderr",
"=",
"PseudoFileErr",
"(",
"self",
".",
"writeErr",
")",
"else",
":",
"sys",
".",
"stderr",
"=",
"self",
".",
"stderr"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/sliceshell.py#L3166-L3171 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/frameworks/inversion.py | python | Inversion.run | (self, dataVals, errorVals, **kwargs) | return self.model | Run inversion.
The inversion will always start from the starting model taken from
the forward operator.
If you want to run the inversion from a specified prior model,
e.g., from a other run, set this model as starting model to the FOP
(fop.setStartModel).
Any self.inv.se... | Run inversion. | [
"Run",
"inversion",
"."
] | def run(self, dataVals, errorVals, **kwargs):
"""Run inversion.
The inversion will always start from the starting model taken from
the forward operator.
If you want to run the inversion from a specified prior model,
e.g., from a other run, set this model as starting model to the... | [
"def",
"run",
"(",
"self",
",",
"dataVals",
",",
"errorVals",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"reset",
"(",
")",
"if",
"self",
".",
"isFrameWork",
":",
"pg",
".",
"critical",
"(",
"'in use?'",
")",
"return",
"self",
".",
"_inv",
"."... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/frameworks/inversion.py#L361-L548 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/parse/standard_method.py | python | take | (x, indices, axis=None, mode='clip') | return res.reshape(shape_out) | Takes elements from an array along an axis.
Args:
a (Tensor): Source array with shape `(Ni…, M, Nk…)`.
indices (Tensor): The indices with shape `(Nj...)` of the values to extract.
axis (int, optional): The axis over which to select values. By default,
the flattened input array i... | Takes elements from an array along an axis. | [
"Takes",
"elements",
"from",
"an",
"array",
"along",
"an",
"axis",
"."
] | def take(x, indices, axis=None, mode='clip'):
"""
Takes elements from an array along an axis.
Args:
a (Tensor): Source array with shape `(Ni…, M, Nk…)`.
indices (Tensor): The indices with shape `(Nj...)` of the values to extract.
axis (int, optional): The axis over which to select v... | [
"def",
"take",
"(",
"x",
",",
"indices",
",",
"axis",
"=",
"None",
",",
"mode",
"=",
"'clip'",
")",
":",
"if",
"mode",
"not",
"in",
"(",
"'raise'",
",",
"'wrap'",
",",
"'clip'",
")",
":",
"const_utils",
".",
"raise_value_error",
"(",
"'raise should be ... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/standard_method.py#L848-L909 | |
sundyCoder/DEye | f1b35e8ab20f10f669fdbc9a6f54e666f4d4e1da | extra/tensorflow-r1.4/jsoncpp/src/jsoncpp/makerelease.py | python | fix_sources_eol | (dist_dir) | Set file EOL for tarball distribution. | Set file EOL for tarball distribution. | [
"Set",
"file",
"EOL",
"for",
"tarball",
"distribution",
"."
] | def fix_sources_eol(dist_dir):
"""Set file EOL for tarball distribution.
"""
print('Preparing exported source file EOL for distribution...')
prune_dirs = antglob.prune_dirs + 'scons-local* ./build* ./libs ./dist'
win_sources = antglob.glob(dist_dir,
includes = '**/*.sln **/*.vcproj',
... | [
"def",
"fix_sources_eol",
"(",
"dist_dir",
")",
":",
"print",
"(",
"'Preparing exported source file EOL for distribution...'",
")",
"prune_dirs",
"=",
"antglob",
".",
"prune_dirs",
"+",
"'scons-local* ./build* ./libs ./dist'",
"win_sources",
"=",
"antglob",
".",
"glob",
"... | https://github.com/sundyCoder/DEye/blob/f1b35e8ab20f10f669fdbc9a6f54e666f4d4e1da/extra/tensorflow-r1.4/jsoncpp/src/jsoncpp/makerelease.py#L124-L140 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiPaneInfo.RightDockable | (*args, **kwargs) | return _aui.AuiPaneInfo_RightDockable(*args, **kwargs) | RightDockable(self, bool b=True) -> AuiPaneInfo | RightDockable(self, bool b=True) -> AuiPaneInfo | [
"RightDockable",
"(",
"self",
"bool",
"b",
"=",
"True",
")",
"-",
">",
"AuiPaneInfo"
] | def RightDockable(*args, **kwargs):
"""RightDockable(self, bool b=True) -> AuiPaneInfo"""
return _aui.AuiPaneInfo_RightDockable(*args, **kwargs) | [
"def",
"RightDockable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_RightDockable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L489-L491 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distro.py | python | minor_version | (best=False) | return _distro.minor_version(best) | Return the minor version of the current OS distribution, as a string,
if provided.
Otherwise, the empty string is returned. The minor version is the second
part of the dot-separated version string.
For a description of the *best* parameter, see the :func:`distro.version`
method. | Return the minor version of the current OS distribution, as a string,
if provided.
Otherwise, the empty string is returned. The minor version is the second
part of the dot-separated version string. | [
"Return",
"the",
"minor",
"version",
"of",
"the",
"current",
"OS",
"distribution",
"as",
"a",
"string",
"if",
"provided",
".",
"Otherwise",
"the",
"empty",
"string",
"is",
"returned",
".",
"The",
"minor",
"version",
"is",
"the",
"second",
"part",
"of",
"th... | def minor_version(best=False):
"""
Return the minor version of the current OS distribution, as a string,
if provided.
Otherwise, the empty string is returned. The minor version is the second
part of the dot-separated version string.
For a description of the *best* parameter, see the :func:`dist... | [
"def",
"minor_version",
"(",
"best",
"=",
"False",
")",
":",
"return",
"_distro",
".",
"minor_version",
"(",
"best",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distro.py#L320-L330 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/fixer_util.py | python | Comma | () | return Leaf(token.COMMA, ",") | A comma leaf | A comma leaf | [
"A",
"comma",
"leaf"
] | def Comma():
"""A comma leaf"""
return Leaf(token.COMMA, ",") | [
"def",
"Comma",
"(",
")",
":",
"return",
"Leaf",
"(",
"token",
".",
"COMMA",
",",
"\",\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/fixer_util.py#L44-L46 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/imputils.py | python | Registry.lower | (self, func, *argtys) | return decorate | Decorate an implementation of *func* for the given argument types.
*func* may be an actual global function object, or any
pseudo-function supported by Numba, such as "getitem".
The decorated implementation has the signature
(context, builder, sig, args). | Decorate an implementation of *func* for the given argument types.
*func* may be an actual global function object, or any
pseudo-function supported by Numba, such as "getitem". | [
"Decorate",
"an",
"implementation",
"of",
"*",
"func",
"*",
"for",
"the",
"given",
"argument",
"types",
".",
"*",
"func",
"*",
"may",
"be",
"an",
"actual",
"global",
"function",
"object",
"or",
"any",
"pseudo",
"-",
"function",
"supported",
"by",
"Numba",
... | def lower(self, func, *argtys):
"""
Decorate an implementation of *func* for the given argument types.
*func* may be an actual global function object, or any
pseudo-function supported by Numba, such as "getitem".
The decorated implementation has the signature
(context, b... | [
"def",
"lower",
"(",
"self",
",",
"func",
",",
"*",
"argtys",
")",
":",
"def",
"decorate",
"(",
"impl",
")",
":",
"self",
".",
"functions",
".",
"append",
"(",
"(",
"impl",
",",
"func",
",",
"argtys",
")",
")",
"return",
"impl",
"return",
"decorate... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/imputils.py#L28-L40 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | doc/paper/cg17/example-2_visualization.py | python | savefig | (mesh, geom, data=None, label='', out=None, **kwargs) | return ax | Little shortcut to plot mesh with asociated geometry. | Little shortcut to plot mesh with asociated geometry. | [
"Little",
"shortcut",
"to",
"plot",
"mesh",
"with",
"asociated",
"geometry",
"."
] | def savefig(mesh, geom, data=None, label='', out=None, **kwargs):
"""Little shortcut to plot mesh with asociated geometry."""
pg.viewer.mpl.hold(1)
ax = kwargs.pop('ax', None)
print(ax)
if data is not None:
ax, _ = pg.show(mesh, data, hold=1, pad=0.55, label=label,
... | [
"def",
"savefig",
"(",
"mesh",
",",
"geom",
",",
"data",
"=",
"None",
",",
"label",
"=",
"''",
",",
"out",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"pg",
".",
"viewer",
".",
"mpl",
".",
"hold",
"(",
"1",
")",
"ax",
"=",
"kwargs",
".",
... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/doc/paper/cg17/example-2_visualization.py#L35-L53 | |
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/common/Param.py | python | Param.append_same_key | (self, key, child) | Helps append in the dict if same key is already present | Helps append in the dict if same key is already present | [
"Helps",
"append",
"in",
"the",
"dict",
"if",
"same",
"key",
"is",
"already",
"present"
] | def append_same_key(self, key, child):
"""
Helps append in the dict if same key is already present
"""
val = Param(child, self)
if self.is_group_child:
val.is_group_child = True
if isinstance(self.subparams[key], list):
self.subparams[key].append... | [
"def",
"append_same_key",
"(",
"self",
",",
"key",
",",
"child",
")",
":",
"val",
"=",
"Param",
"(",
"child",
",",
"self",
")",
"if",
"self",
".",
"is_group_child",
":",
"val",
".",
"is_group_child",
"=",
"True",
"if",
"isinstance",
"(",
"self",
".",
... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/Param.py#L159-L172 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/pathlib.py | python | PurePath.parents | (self) | return _PathParents(self) | A sequence of this path's logical parents. | A sequence of this path's logical parents. | [
"A",
"sequence",
"of",
"this",
"path",
"s",
"logical",
"parents",
"."
] | def parents(self):
"""A sequence of this path's logical parents."""
return _PathParents(self) | [
"def",
"parents",
"(",
"self",
")",
":",
"return",
"_PathParents",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pathlib.py#L941-L943 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Image.ConvertToMonoBitmap | (*args, **kwargs) | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) | ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap | ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap | [
"ConvertToMonoBitmap",
"(",
"self",
"byte",
"red",
"byte",
"green",
"byte",
"blue",
")",
"-",
">",
"Bitmap"
] | def ConvertToMonoBitmap(*args, **kwargs):
"""ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) | [
"def",
"ConvertToMonoBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_ConvertToMonoBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L3648-L3650 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.