nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | build/plugins/lib/nots/package_manager/pnpm/package_manager.py | python | PnpmPackageManager._build_merged_lockfile | (self, dep_paths) | :type dep_paths: list of str
:rtype: PnpmLockfile | :type dep_paths: list of str
:rtype: PnpmLockfile | [
":",
"type",
"dep_paths",
":",
"list",
"of",
"str",
":",
"rtype",
":",
"PnpmLockfile"
] | def _build_merged_lockfile(self, dep_paths):
"""
:type dep_paths: list of str
:rtype: PnpmLockfile
"""
in_lf_path = build_lockfile_path(self.sources_path)
out_lf_path = build_lockfile_path(self.build_path)
lf = PnpmLockfile.load(in_lf_path)
# Change to th... | [
"def",
"_build_merged_lockfile",
"(",
"self",
",",
"dep_paths",
")",
":",
"in_lf_path",
"=",
"build_lockfile_path",
"(",
"self",
".",
"sources_path",
")",
"out_lf_path",
"=",
"build_lockfile_path",
"(",
"self",
".",
"build_path",
")",
"lf",
"=",
"PnpmLockfile",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/build/plugins/lib/nots/package_manager/pnpm/package_manager.py#L123-L143 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | CommandTreeEvent.SetKeyEvent | (self, event) | Sets the keyboard data (for ``EVT_TREE_KEY_DOWN`` event only).
:param `event`: a :class:`CommandTreeEvent` event to be processed. | Sets the keyboard data (for ``EVT_TREE_KEY_DOWN`` event only). | [
"Sets",
"the",
"keyboard",
"data",
"(",
"for",
"EVT_TREE_KEY_DOWN",
"event",
"only",
")",
"."
] | def SetKeyEvent(self, event):
"""
Sets the keyboard data (for ``EVT_TREE_KEY_DOWN`` event only).
:param `event`: a :class:`CommandTreeEvent` event to be processed.
"""
self._evtKey = event | [
"def",
"SetKeyEvent",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"_evtKey",
"=",
"event"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L1108-L1115 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/uniform.py | python | Uniform._cross_entropy | (self, dist, low_b, high_b, low=None, high=None) | return self._entropy(low, high) + self._kl_loss(dist, low_b, high_b, low, high) | Evaluate cross entropy between Uniform distributions.
Args:
dist (str): The type of the distributions. Should be "Uniform" in this case.
low_b (Tensor): The lower bound of distribution b.
high_b (Tensor): The upper bound of distribution b.
low_a (Tensor): The low... | Evaluate cross entropy between Uniform distributions. | [
"Evaluate",
"cross",
"entropy",
"between",
"Uniform",
"distributions",
"."
] | def _cross_entropy(self, dist, low_b, high_b, low=None, high=None):
"""
Evaluate cross entropy between Uniform distributions.
Args:
dist (str): The type of the distributions. Should be "Uniform" in this case.
low_b (Tensor): The lower bound of distribution b.
... | [
"def",
"_cross_entropy",
"(",
"self",
",",
"dist",
",",
"low_b",
",",
"high_b",
",",
"low",
"=",
"None",
",",
"high",
"=",
"None",
")",
":",
"check_distribution_name",
"(",
"dist",
",",
"'Uniform'",
")",
"return",
"self",
".",
"_entropy",
"(",
"low",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/uniform.py#L272-L284 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | CopyDocksAndPanes2 | (src_docks, src_panes) | return dest_docks, dest_panes | This utility function creates full copies of
the dock and pane info. :class:`AuiManager` usually contain pointers
to :class:`AuiPaneInfo` classes, thus this function is necessary to reliably
reconstruct that relationship in the new dock info and pane info arrays.
:param `src_docks`: a list of :class:`A... | This utility function creates full copies of
the dock and pane info. :class:`AuiManager` usually contain pointers
to :class:`AuiPaneInfo` classes, thus this function is necessary to reliably
reconstruct that relationship in the new dock info and pane info arrays. | [
"This",
"utility",
"function",
"creates",
"full",
"copies",
"of",
"the",
"dock",
"and",
"pane",
"info",
".",
":",
"class",
":",
"AuiManager",
"usually",
"contain",
"pointers",
"to",
":",
"class",
":",
"AuiPaneInfo",
"classes",
"thus",
"this",
"function",
"is... | def CopyDocksAndPanes2(src_docks, src_panes):
"""
This utility function creates full copies of
the dock and pane info. :class:`AuiManager` usually contain pointers
to :class:`AuiPaneInfo` classes, thus this function is necessary to reliably
reconstruct that relationship in the new dock info and pane... | [
"def",
"CopyDocksAndPanes2",
"(",
"src_docks",
",",
"src_panes",
")",
":",
"dest_docks",
"=",
"[",
"]",
"for",
"ii",
"in",
"xrange",
"(",
"len",
"(",
"src_docks",
")",
")",
":",
"dest_docks",
".",
"append",
"(",
"AuiDockInfo",
"(",
")",
")",
"dest_docks"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L3491-L3554 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/api.py | python | put | (url, data=None, **kwargs) | return request('put', url, data=data, **kwargs) | r"""Sends a PUT request.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the :class:`Request`.
:param json: (optional) json data to send in the body of the :class:`Request`.
:param \*\*kwa... | r"""Sends a PUT request. | [
"r",
"Sends",
"a",
"PUT",
"request",
"."
] | def put(url, data=None, **kwargs):
r"""Sends a PUT request.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the :class:`Request`.
:param json: (optional) json data to send in the body of t... | [
"def",
"put",
"(",
"url",
",",
"data",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"request",
"(",
"'put'",
",",
"url",
",",
"data",
"=",
"data",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/api.py#L122-L134 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py | python | Categorical._get_codes | (self) | return v | Get the codes.
Returns
-------
codes : integer array view
A non writable view of the `codes` array. | Get the codes. | [
"Get",
"the",
"codes",
"."
] | def _get_codes(self):
"""
Get the codes.
Returns
-------
codes : integer array view
A non writable view of the `codes` array.
"""
v = self._codes.view()
v.flags.writeable = False
return v | [
"def",
"_get_codes",
"(",
"self",
")",
":",
"v",
"=",
"self",
".",
"_codes",
".",
"view",
"(",
")",
"v",
".",
"flags",
".",
"writeable",
"=",
"False",
"return",
"v"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L662-L673 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewModelNotifier.BeforeReset | (*args, **kwargs) | return _dataview.DataViewModelNotifier_BeforeReset(*args, **kwargs) | BeforeReset(self) -> bool | BeforeReset(self) -> bool | [
"BeforeReset",
"(",
"self",
")",
"-",
">",
"bool"
] | def BeforeReset(*args, **kwargs):
"""BeforeReset(self) -> bool"""
return _dataview.DataViewModelNotifier_BeforeReset(*args, **kwargs) | [
"def",
"BeforeReset",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewModelNotifier_BeforeReset",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L259-L261 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBarEvent.GetItemRect | (*args, **kwargs) | return _aui.AuiToolBarEvent_GetItemRect(*args, **kwargs) | GetItemRect(self) -> Rect | GetItemRect(self) -> Rect | [
"GetItemRect",
"(",
"self",
")",
"-",
">",
"Rect"
] | def GetItemRect(*args, **kwargs):
"""GetItemRect(self) -> Rect"""
return _aui.AuiToolBarEvent_GetItemRect(*args, **kwargs) | [
"def",
"GetItemRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarEvent_GetItemRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1697-L1699 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/callback/ds_callback.py | python | DSCallback.ds_epoch_end | (self, ds_run_context) | Called after an epoch is finished.
Args:
ds_run_context (RunContext): Include some information of the pipeline. | Called after an epoch is finished. | [
"Called",
"after",
"an",
"epoch",
"is",
"finished",
"."
] | def ds_epoch_end(self, ds_run_context):
"""
Called after an epoch is finished.
Args:
ds_run_context (RunContext): Include some information of the pipeline.
""" | [
"def",
"ds_epoch_end",
"(",
"self",
",",
"ds_run_context",
")",
":"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/callback/ds_callback.py#L64-L70 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/engine/atoms.py | python | Atom.kstress | (self) | return ks/self.m | Calculates the contribution of the atom to the kinetic stress
tensor. | Calculates the contribution of the atom to the kinetic stress
tensor. | [
"Calculates",
"the",
"contribution",
"of",
"the",
"atom",
"to",
"the",
"kinetic",
"stress",
"tensor",
"."
] | def kstress(self):
"""Calculates the contribution of the atom to the kinetic stress
tensor.
"""
p = depstrip(self.p)
ks = numpy.zeros((3,3),float)
for i in range(3):
for j in range(i,3):
ks[i,j] = p[i]*p[j]
return ks/self.m | [
"def",
"kstress",
"(",
"self",
")",
":",
"p",
"=",
"depstrip",
"(",
"self",
".",
"p",
")",
"ks",
"=",
"numpy",
".",
"zeros",
"(",
"(",
"3",
",",
"3",
")",
",",
"float",
")",
"for",
"i",
"in",
"range",
"(",
"3",
")",
":",
"for",
"j",
"in",
... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/atoms.py#L75-L85 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBDebugger.FindTargetWithProcessID | (self, pid) | return _lldb.SBDebugger_FindTargetWithProcessID(self, pid) | FindTargetWithProcessID(SBDebugger self, lldb::pid_t pid) -> SBTarget | FindTargetWithProcessID(SBDebugger self, lldb::pid_t pid) -> SBTarget | [
"FindTargetWithProcessID",
"(",
"SBDebugger",
"self",
"lldb",
"::",
"pid_t",
"pid",
")",
"-",
">",
"SBTarget"
] | def FindTargetWithProcessID(self, pid):
"""FindTargetWithProcessID(SBDebugger self, lldb::pid_t pid) -> SBTarget"""
return _lldb.SBDebugger_FindTargetWithProcessID(self, pid) | [
"def",
"FindTargetWithProcessID",
"(",
"self",
",",
"pid",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_FindTargetWithProcessID",
"(",
"self",
",",
"pid",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3973-L3975 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/fancy_getopt.py | python | FancyGetopt.get_option_order | (self) | Returns the list of (option, value) tuples processed by the
previous run of 'getopt()'. Raises RuntimeError if
'getopt()' hasn't been called yet. | Returns the list of (option, value) tuples processed by the
previous run of 'getopt()'. Raises RuntimeError if
'getopt()' hasn't been called yet. | [
"Returns",
"the",
"list",
"of",
"(",
"option",
"value",
")",
"tuples",
"processed",
"by",
"the",
"previous",
"run",
"of",
"getopt",
"()",
".",
"Raises",
"RuntimeError",
"if",
"getopt",
"()",
"hasn",
"t",
"been",
"called",
"yet",
"."
] | def get_option_order (self):
"""Returns the list of (option, value) tuples processed by the
previous run of 'getopt()'. Raises RuntimeError if
'getopt()' hasn't been called yet.
"""
if self.option_order is None:
raise RuntimeError, "'getopt()' hasn't been called yet"... | [
"def",
"get_option_order",
"(",
"self",
")",
":",
"if",
"self",
".",
"option_order",
"is",
"None",
":",
"raise",
"RuntimeError",
",",
"\"'getopt()' hasn't been called yet\"",
"else",
":",
"return",
"self",
".",
"option_order"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/fancy_getopt.py#L298-L306 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/options.py | python | OptionParser.parse_command_line | (
self, args: Optional[List[str]] = None, final: bool = True
) | return remaining | Parses all options given on the command line (defaults to
`sys.argv`).
Options look like ``--option=value`` and are parsed according
to their ``type``. For boolean options, ``--option`` is
equivalent to ``--option=true``
If the option has ``multiple=True``, comma-separated valu... | Parses all options given on the command line (defaults to
`sys.argv`). | [
"Parses",
"all",
"options",
"given",
"on",
"the",
"command",
"line",
"(",
"defaults",
"to",
"sys",
".",
"argv",
")",
"."
] | def parse_command_line(
self, args: Optional[List[str]] = None, final: bool = True
) -> List[str]:
"""Parses all options given on the command line (defaults to
`sys.argv`).
Options look like ``--option=value`` and are parsed according
to their ``type``. For boolean options, ... | [
"def",
"parse_command_line",
"(",
"self",
",",
"args",
":",
"Optional",
"[",
"List",
"[",
"str",
"]",
"]",
"=",
"None",
",",
"final",
":",
"bool",
"=",
"True",
")",
"->",
"List",
"[",
"str",
"]",
":",
"if",
"args",
"is",
"None",
":",
"args",
"=",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/options.py#L304-L356 | |
savoirfairelinux/jami-daemon | 7634487e9f568ae727f2d4cffbb735d23fa0324c | tools/jamictrl/controller.py | python | DRingCtrl.getAllCalls | (self) | return [str(x) for x in self.callmanager.getCallList()] | Return all calls handled by the daemon | Return all calls handled by the daemon | [
"Return",
"all",
"calls",
"handled",
"by",
"the",
"daemon"
] | def getAllCalls(self):
"""Return all calls handled by the daemon"""
return [str(x) for x in self.callmanager.getCallList()] | [
"def",
"getAllCalls",
"(",
"self",
")",
":",
"return",
"[",
"str",
"(",
"x",
")",
"for",
"x",
"in",
"self",
".",
"callmanager",
".",
"getCallList",
"(",
")",
"]"
] | https://github.com/savoirfairelinux/jami-daemon/blob/7634487e9f568ae727f2d4cffbb735d23fa0324c/tools/jamictrl/controller.py#L528-L531 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Text.mark_previous | (self, index) | return self.tk.call(self._w, 'mark', 'previous', index) or None | Return the name of the previous mark before INDEX. | Return the name of the previous mark before INDEX. | [
"Return",
"the",
"name",
"of",
"the",
"previous",
"mark",
"before",
"INDEX",
"."
] | def mark_previous(self, index):
"""Return the name of the previous mark before INDEX."""
return self.tk.call(self._w, 'mark', 'previous', index) or None | [
"def",
"mark_previous",
"(",
"self",
",",
"index",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'mark'",
",",
"'previous'",
",",
"index",
")",
"or",
"None"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3067-L3069 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/special/basic.py | python | riccati_yn | (n, x) | return jn[:(n+1)], jnp[:(n+1)] | Compute Ricatti-Bessel function of the second kind and its derivative.
The Ricatti-Bessel function of the second kind is defined as :math:`x
y_n(x)`, where :math:`y_n` is the spherical Bessel function of the second
kind of order :math:`n`.
This function computes the value and first derivative of the f... | Compute Ricatti-Bessel function of the second kind and its derivative. | [
"Compute",
"Ricatti",
"-",
"Bessel",
"function",
"of",
"the",
"second",
"kind",
"and",
"its",
"derivative",
"."
] | def riccati_yn(n, x):
"""Compute Ricatti-Bessel function of the second kind and its derivative.
The Ricatti-Bessel function of the second kind is defined as :math:`x
y_n(x)`, where :math:`y_n` is the spherical Bessel function of the second
kind of order :math:`n`.
This function computes the value ... | [
"def",
"riccati_yn",
"(",
"n",
",",
"x",
")",
":",
"if",
"not",
"(",
"isscalar",
"(",
"n",
")",
"and",
"isscalar",
"(",
"x",
")",
")",
":",
"raise",
"ValueError",
"(",
"\"arguments must be scalars.\"",
")",
"if",
"(",
"n",
"!=",
"floor",
"(",
"n",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/basic.py#L1048-L1098 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc.grid_rowconfigure | (self, index, cnf={}, **kw) | return self._grid_configure('rowconfigure', index, cnf, kw) | Configure row INDEX of a grid.
Valid resources are minsize (minimum size of the row),
weight (how much does additional space propagate to this row)
and pad (how much space to let additionally). | Configure row INDEX of a grid. | [
"Configure",
"row",
"INDEX",
"of",
"a",
"grid",
"."
] | def grid_rowconfigure(self, index, cnf={}, **kw):
"""Configure row INDEX of a grid.
Valid resources are minsize (minimum size of the row),
weight (how much does additional space propagate to this row)
and pad (how much space to let additionally)."""
return self._grid_configure('... | [
"def",
"grid_rowconfigure",
"(",
"self",
",",
"index",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"_grid_configure",
"(",
"'rowconfigure'",
",",
"index",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1391-L1397 | |
OpenGenus/cosmos | 1a94e8880068e51d571543be179c323936bd0936 | code/game_theory/src/game_of_nim_win_loss_prediction/game_of_nim_win_loss_prediction.py | python | nim | (heaps, game_type) | Computes next move for Nim, for both game types normal and misere.
Assumption : Both players involved would play without making mistakes.
if there is a winning move:
return tuple(heap_index, amount_to_remove)
else:
return "You will lose :(" | Computes next move for Nim, for both game types normal and misere.
Assumption : Both players involved would play without making mistakes. | [
"Computes",
"next",
"move",
"for",
"Nim",
"for",
"both",
"game",
"types",
"normal",
"and",
"misere",
".",
"Assumption",
":",
"Both",
"players",
"involved",
"would",
"play",
"without",
"making",
"mistakes",
"."
] | def nim(heaps, game_type):
"""
Computes next move for Nim, for both game types normal and misere.
Assumption : Both players involved would play without making mistakes.
if there is a winning move:
return tuple(heap_index, amount_to_remove)
else:
return "You will lose :("
"""
... | [
"def",
"nim",
"(",
"heaps",
",",
"game_type",
")",
":",
"print",
"(",
"game_type",
",",
"heaps",
",",
"end",
"=",
"\" \"",
")",
"is_misere",
"=",
"game_type",
"==",
"MISERE",
"endgame_reached",
"=",
"False",
"count_non_0_1",
"=",
"sum",
"(",
"1",
"for",
... | https://github.com/OpenGenus/cosmos/blob/1a94e8880068e51d571543be179c323936bd0936/code/game_theory/src/game_of_nim_win_loss_prediction/game_of_nim_win_loss_prediction.py#L8-L50 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/layer_function_generator.py | python | _generate_doc_string_ | (op_proto,
additional_args_lines=None,
skip_attrs_set=None) | return buf.getvalue() | Generate docstring by OpProto
Args:
op_proto (framework_pb2.OpProto): a protobuf message typed OpProto
Returns:
str: the document string | Generate docstring by OpProto | [
"Generate",
"docstring",
"by",
"OpProto"
] | def _generate_doc_string_(op_proto,
additional_args_lines=None,
skip_attrs_set=None):
"""
Generate docstring by OpProto
Args:
op_proto (framework_pb2.OpProto): a protobuf message typed OpProto
Returns:
str: the document string
"""... | [
"def",
"_generate_doc_string_",
"(",
"op_proto",
",",
"additional_args_lines",
"=",
"None",
",",
"skip_attrs_set",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"op_proto",
",",
"framework_pb2",
".",
"OpProto",
")",
":",
"raise",
"TypeError",
"(",
"\"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/layer_function_generator.py#L67-L135 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/bindings/python/clang/cindex.py | python | Cursor.objc_type_encoding | (self) | return self._objc_type_encoding | Return the Objective-C type encoding as a str. | Return the Objective-C type encoding as a str. | [
"Return",
"the",
"Objective",
"-",
"C",
"type",
"encoding",
"as",
"a",
"str",
"."
] | def objc_type_encoding(self):
"""Return the Objective-C type encoding as a str."""
if not hasattr(self, '_objc_type_encoding'):
self._objc_type_encoding = \
conf.lib.clang_getDeclObjCTypeEncoding(self)
return self._objc_type_encoding | [
"def",
"objc_type_encoding",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_objc_type_encoding'",
")",
":",
"self",
".",
"_objc_type_encoding",
"=",
"conf",
".",
"lib",
".",
"clang_getDeclObjCTypeEncoding",
"(",
"self",
")",
"return",
"sel... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/bindings/python/clang/cindex.py#L1740-L1746 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/stats/mstats_basic.py | python | ttest_rel | (a, b, axis=0) | return Ttest_relResult(t, probs) | Calculates the T-test on TWO RELATED samples of scores, a and b.
Parameters
----------
a, b : array_like
The arrays must have the same shape.
axis : int or None, optional
Axis along which to compute test. If None, compute over the whole
arrays, `a`, and `b`.
Returns
---... | Calculates the T-test on TWO RELATED samples of scores, a and b. | [
"Calculates",
"the",
"T",
"-",
"test",
"on",
"TWO",
"RELATED",
"samples",
"of",
"scores",
"a",
"and",
"b",
"."
] | def ttest_rel(a, b, axis=0):
"""
Calculates the T-test on TWO RELATED samples of scores, a and b.
Parameters
----------
a, b : array_like
The arrays must have the same shape.
axis : int or None, optional
Axis along which to compute test. If None, compute over the whole
a... | [
"def",
"ttest_rel",
"(",
"a",
",",
"b",
",",
"axis",
"=",
"0",
")",
":",
"a",
",",
"b",
",",
"axis",
"=",
"_chk2_asarray",
"(",
"a",
",",
"b",
",",
"axis",
")",
"if",
"len",
"(",
"a",
")",
"!=",
"len",
"(",
"b",
")",
":",
"raise",
"ValueErr... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/mstats_basic.py#L1085-L1127 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Warnings.py | python | suppressWarningClass | (clazz) | Suppresses all warnings that are of type clazz or
derived from clazz. | Suppresses all warnings that are of type clazz or
derived from clazz. | [
"Suppresses",
"all",
"warnings",
"that",
"are",
"of",
"type",
"clazz",
"or",
"derived",
"from",
"clazz",
"."
] | def suppressWarningClass(clazz):
"""Suppresses all warnings that are of type clazz or
derived from clazz."""
_enabled.insert(0, (clazz, 0)) | [
"def",
"suppressWarningClass",
"(",
"clazz",
")",
":",
"_enabled",
".",
"insert",
"(",
"0",
",",
"(",
"clazz",
",",
"0",
")",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Warnings.py#L146-L149 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/candidate_sampling_ops.py | python | fixed_unigram_candidate_sampler | (true_classes,
num_true,
num_sampled,
unique,
range_max,
vocab_file='',
distortion=1.0,
... | return gen_candidate_sampling_ops._fixed_unigram_candidate_sampler(
true_classes, num_true, num_sampled, unique, range_max,
vocab_file=vocab_file, distortion=distortion,
num_reserved_ids=num_reserved_ids, num_shards=num_shards, shard=shard,
unigrams=unigrams, seed=seed1, seed2=seed2, name=name) | Samples a set of classes using the provided (fixed) base distribution.
This operation randomly samples a tensor of sampled classes
(`sampled_candidates`) from the range of integers `[0, range_max)`.
The elements of `sampled_candidates` are drawn without replacement
(if `unique=True`) or with replacement (if `... | Samples a set of classes using the provided (fixed) base distribution. | [
"Samples",
"a",
"set",
"of",
"classes",
"using",
"the",
"provided",
"(",
"fixed",
")",
"base",
"distribution",
"."
] | def fixed_unigram_candidate_sampler(true_classes,
num_true,
num_sampled,
unique,
range_max,
vocab_file='',
... | [
"def",
"fixed_unigram_candidate_sampler",
"(",
"true_classes",
",",
"num_true",
",",
"num_sampled",
",",
"unique",
",",
"range_max",
",",
"vocab_file",
"=",
"''",
",",
"distortion",
"=",
"1.0",
",",
"num_reserved_ids",
"=",
"0",
",",
"num_shards",
"=",
"1",
",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/candidate_sampling_ops.py#L195-L283 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/conversion/converter_object.py | python | ConverterObject.has_member | (self, name) | return name in self.members | Returns True if the object has a member with the specified name. | Returns True if the object has a member with the specified name. | [
"Returns",
"True",
"if",
"the",
"object",
"has",
"a",
"member",
"with",
"the",
"specified",
"name",
"."
] | def has_member(self, name):
"""
Returns True if the object has a member with the specified name.
"""
return name in self.members | [
"def",
"has_member",
"(",
"self",
",",
"name",
")",
":",
"return",
"name",
"in",
"self",
".",
"members"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/converter_object.py#L77-L81 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py | python | JIRA.status | (self, id) | return self._find_for_resource(Status, id) | Get a status Resource from the server.
:param id: ID of the status resource to get | Get a status Resource from the server. | [
"Get",
"a",
"status",
"Resource",
"from",
"the",
"server",
"."
] | def status(self, id):
"""Get a status Resource from the server.
:param id: ID of the status resource to get
"""
return self._find_for_resource(Status, id) | [
"def",
"status",
"(",
"self",
",",
"id",
")",
":",
"return",
"self",
".",
"_find_for_resource",
"(",
"Status",
",",
"id",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py#L2120-L2125 | |
openweave/openweave-core | 11ceb6b7efd39fe05de7f79229247a5774d56766 | src/device-manager/python/weave-device-mgr.py | python | DeviceMgrCmd.do_blediagtesttiming | (self, line) | ble-diag-test-timing [ <options> ] [ on | off ]
Set Tx timing mode.
Options:
--remote | -r
Set the remote Tx timing mode. | ble-diag-test-timing [ <options> ] [ on | off ] | [
"ble",
"-",
"diag",
"-",
"test",
"-",
"timing",
"[",
"<options",
">",
"]",
"[",
"on",
"|",
"off",
"]"
] | def do_blediagtesttiming(self, line):
"""
ble-diag-test-timing [ <options> ] [ on | off ]
Set Tx timing mode.
Options:
--remote | -r
Set the remote Tx timing mode.
"""
args = shlex.split(line)
if (len(args) == 0):
print("Usa... | [
"def",
"do_blediagtesttiming",
"(",
"self",
",",
"line",
")",
":",
"args",
"=",
"shlex",
".",
"split",
"(",
"line",
")",
"if",
"(",
"len",
"(",
"args",
")",
"==",
"0",
")",
":",
"print",
"(",
"\"Usage:\"",
")",
"self",
".",
"do_help",
"(",
"'ble-di... | https://github.com/openweave/openweave-core/blob/11ceb6b7efd39fe05de7f79229247a5774d56766/src/device-manager/python/weave-device-mgr.py#L709-L763 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/nn_ops.py | python | _check_positive_int_or_tuple | (arg_name, arg_value, prim_name, allow_four=False, ret_four=False) | return ret_value | Checks whether an argument is a positive int or tuple with 2 or 4(when allow_four is True) positive int elements. | Checks whether an argument is a positive int or tuple with 2 or 4(when allow_four is True) positive int elements. | [
"Checks",
"whether",
"an",
"argument",
"is",
"a",
"positive",
"int",
"or",
"tuple",
"with",
"2",
"or",
"4",
"(",
"when",
"allow_four",
"is",
"True",
")",
"positive",
"int",
"elements",
"."
] | def _check_positive_int_or_tuple(arg_name, arg_value, prim_name, allow_four=False, ret_four=False):
"""
Checks whether an argument is a positive int or tuple with 2 or 4(when allow_four is True) positive int elements.
"""
def _raise_message():
raise ValueError(f"For '{prim_name}' attr '{arg_nam... | [
"def",
"_check_positive_int_or_tuple",
"(",
"arg_name",
",",
"arg_value",
",",
"prim_name",
",",
"allow_four",
"=",
"False",
",",
"ret_four",
"=",
"False",
")",
":",
"def",
"_raise_message",
"(",
")",
":",
"raise",
"ValueError",
"(",
"f\"For '{prim_name}' attr '{a... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/nn_ops.py#L32-L60 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/metrics/histograms/update_histogram_enum.py | python | _GetOldAndUpdatedXml | (histogram_enum_name, source_enum_values,
source_enum_path) | return (xml, new_xml) | Reads old histogram from |histogram_enum_name| from |HISTOGRAMS_PATH|, and
calculates new histogram from |source_enum_values| from |source_enum_path|,
and returns both in XML format. | Reads old histogram from |histogram_enum_name| from |HISTOGRAMS_PATH|, and
calculates new histogram from |source_enum_values| from |source_enum_path|,
and returns both in XML format. | [
"Reads",
"old",
"histogram",
"from",
"|histogram_enum_name|",
"from",
"|HISTOGRAMS_PATH|",
"and",
"calculates",
"new",
"histogram",
"from",
"|source_enum_values|",
"from",
"|source_enum_path|",
"and",
"returns",
"both",
"in",
"XML",
"format",
"."
] | def _GetOldAndUpdatedXml(histogram_enum_name, source_enum_values,
source_enum_path):
"""Reads old histogram from |histogram_enum_name| from |HISTOGRAMS_PATH|, and
calculates new histogram from |source_enum_values| from |source_enum_path|,
and returns both in XML format.
"""
Log('Readi... | [
"def",
"_GetOldAndUpdatedXml",
"(",
"histogram_enum_name",
",",
"source_enum_values",
",",
"source_enum_path",
")",
":",
"Log",
"(",
"'Reading existing histograms from \"{0}\".'",
".",
"format",
"(",
"HISTOGRAMS_PATH",
")",
")",
"with",
"open",
"(",
"HISTOGRAMS_PATH",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/metrics/histograms/update_histogram_enum.py#L149-L166 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | cmake/std/trilinosprhelpers/TrilinosPRConfigurationBase.py | python | TrilinosPRConfigurationBase.working_directory_ctest | (self) | return os.path.join(self.arg_workspace_dir, 'TFW_testing_single_configure_prototype') | Generate the working directory for where we should launch the CTest command from.
For PR testing this should be in $WORKSPACE/TFW_testing_single_configure_prototype | Generate the working directory for where we should launch the CTest command from.
For PR testing this should be in $WORKSPACE/TFW_testing_single_configure_prototype | [
"Generate",
"the",
"working",
"directory",
"for",
"where",
"we",
"should",
"launch",
"the",
"CTest",
"command",
"from",
".",
"For",
"PR",
"testing",
"this",
"should",
"be",
"in",
"$WORKSPACE",
"/",
"TFW_testing_single_configure_prototype"
] | def working_directory_ctest(self):
"""
Generate the working directory for where we should launch the CTest command from.
For PR testing this should be in $WORKSPACE/TFW_testing_single_configure_prototype
"""
return os.path.join(self.arg_workspace_dir, 'TFW_testing_single_configur... | [
"def",
"working_directory_ctest",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"arg_workspace_dir",
",",
"'TFW_testing_single_configure_prototype'",
")"
] | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/cmake/std/trilinosprhelpers/TrilinosPRConfigurationBase.py#L208-L213 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlHelpWindow.GetCfgData | (*args, **kwargs) | return _html.HtmlHelpWindow_GetCfgData(*args, **kwargs) | GetCfgData(self) -> wxHtmlHelpFrameCfg | GetCfgData(self) -> wxHtmlHelpFrameCfg | [
"GetCfgData",
"(",
"self",
")",
"-",
">",
"wxHtmlHelpFrameCfg"
] | def GetCfgData(*args, **kwargs):
"""GetCfgData(self) -> wxHtmlHelpFrameCfg"""
return _html.HtmlHelpWindow_GetCfgData(*args, **kwargs) | [
"def",
"GetCfgData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlHelpWindow_GetCfgData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1654-L1656 | |
schwehr/libais | 1e19605942c8e155cd02fde6d1acde75ecd15d75 | third_party/gmock/scripts/fuse_gmock_files.py | python | GetGTestRootDir | (gmock_root) | return os.path.join(gmock_root, 'gtest') | Returns the root directory of Google Test. | Returns the root directory of Google Test. | [
"Returns",
"the",
"root",
"directory",
"of",
"Google",
"Test",
"."
] | def GetGTestRootDir(gmock_root):
"""Returns the root directory of Google Test."""
return os.path.join(gmock_root, 'gtest') | [
"def",
"GetGTestRootDir",
"(",
"gmock_root",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"gmock_root",
",",
"'gtest'",
")"
] | https://github.com/schwehr/libais/blob/1e19605942c8e155cd02fde6d1acde75ecd15d75/third_party/gmock/scripts/fuse_gmock_files.py#L91-L94 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/lookup.py | python | RosdepLookup.get_views_that_define | (self, rosdep_name) | return retval | Locate all views that directly define *rosdep_name*. A
side-effect of this method is that all available rosdep files
in the configuration will be loaded into memory.
Error state from single-stack failures
(e.g. :exc:`InvalidData`, :exc:`ResourceNotFound`) are
not propagated. C... | Locate all views that directly define *rosdep_name*. A
side-effect of this method is that all available rosdep files
in the configuration will be loaded into memory. | [
"Locate",
"all",
"views",
"that",
"directly",
"define",
"*",
"rosdep_name",
"*",
".",
"A",
"side",
"-",
"effect",
"of",
"this",
"method",
"is",
"that",
"all",
"available",
"rosdep",
"files",
"in",
"the",
"configuration",
"will",
"be",
"loaded",
"into",
"me... | def get_views_that_define(self, rosdep_name):
"""
Locate all views that directly define *rosdep_name*. A
side-effect of this method is that all available rosdep files
in the configuration will be loaded into memory.
Error state from single-stack failures
(e.g. :exc:`Inv... | [
"def",
"get_views_that_define",
"(",
"self",
",",
"rosdep_name",
")",
":",
"#TODOXXX: change this to return errors object so that caller cannot ignore",
"self",
".",
"_load_all_views",
"(",
"self",
".",
"loader",
")",
"db",
"=",
"self",
".",
"rosdep_db",
"retval",
"=",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/lookup.py#L609-L636 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/virtualenv/virtualenv_embedded/site.py | python | setencoding | () | Set the string encoding used by the Unicode implementation. The
default is 'ascii', but if you're willing to experiment, you can
change this. | Set the string encoding used by the Unicode implementation. The
default is 'ascii', but if you're willing to experiment, you can
change this. | [
"Set",
"the",
"string",
"encoding",
"used",
"by",
"the",
"Unicode",
"implementation",
".",
"The",
"default",
"is",
"ascii",
"but",
"if",
"you",
"re",
"willing",
"to",
"experiment",
"you",
"can",
"change",
"this",
"."
] | def setencoding():
"""Set the string encoding used by the Unicode implementation. The
default is 'ascii', but if you're willing to experiment, you can
change this."""
encoding = "ascii" # Default value set by _PyUnicode_Init()
if 0:
# Enable to support locale aware default string encodings.... | [
"def",
"setencoding",
"(",
")",
":",
"encoding",
"=",
"\"ascii\"",
"# Default value set by _PyUnicode_Init()",
"if",
"0",
":",
"# Enable to support locale aware default string encodings.",
"import",
"locale",
"loc",
"=",
"locale",
".",
"getdefaultlocale",
"(",
")",
"if",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/virtualenv/virtualenv_embedded/site.py#L525-L542 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/interval.py | python | _is_type_compatible | (a, b) | return (
(is_number(a) and is_number(b))
or (is_ts_compat(a) and is_ts_compat(b))
or (is_td_compat(a) and is_td_compat(b))
or com.any_none(a, b)
) | Helper for interval_range to check type compat of start/end/freq. | Helper for interval_range to check type compat of start/end/freq. | [
"Helper",
"for",
"interval_range",
"to",
"check",
"type",
"compat",
"of",
"start",
"/",
"end",
"/",
"freq",
"."
] | def _is_type_compatible(a, b) -> bool:
"""
Helper for interval_range to check type compat of start/end/freq.
"""
is_ts_compat = lambda x: isinstance(x, (Timestamp, BaseOffset))
is_td_compat = lambda x: isinstance(x, (Timedelta, BaseOffset))
return (
(is_number(a) and is_number(b))
... | [
"def",
"_is_type_compatible",
"(",
"a",
",",
"b",
")",
"->",
"bool",
":",
"is_ts_compat",
"=",
"lambda",
"x",
":",
"isinstance",
"(",
"x",
",",
"(",
"Timestamp",
",",
"BaseOffset",
")",
")",
"is_td_compat",
"=",
"lambda",
"x",
":",
"isinstance",
"(",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/interval.py#L910-L921 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/tools/webforms_aggregator.py | python | Retriever.__del__ | (self) | Cleans up before this object is destroyed.
The function closes the corresponding curl object that does the downloading. | Cleans up before this object is destroyed. | [
"Cleans",
"up",
"before",
"this",
"object",
"is",
"destroyed",
"."
] | def __del__(self):
"""Cleans up before this object is destroyed.
The function closes the corresponding curl object that does the downloading.
"""
if self._curl_object:
self._curl_object.close() | [
"def",
"__del__",
"(",
"self",
")",
":",
"if",
"self",
".",
"_curl_object",
":",
"self",
".",
"_curl_object",
".",
"close",
"(",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/tools/webforms_aggregator.py#L103-L109 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/profile.py | python | run | (statement, filename=None, sort=-1) | return _Utils(Profile).run(statement, filename, sort) | Run statement under profiler optionally saving results in filename
This function takes a single argument that can be passed to the
"exec" statement, and an optional file name. In all cases this
routine attempts to "exec" its first argument and gather profiling
statistics from the execution. If no file... | Run statement under profiler optionally saving results in filename | [
"Run",
"statement",
"under",
"profiler",
"optionally",
"saving",
"results",
"in",
"filename"
] | def run(statement, filename=None, sort=-1):
"""Run statement under profiler optionally saving results in filename
This function takes a single argument that can be passed to the
"exec" statement, and an optional file name. In all cases this
routine attempts to "exec" its first argument and gather prof... | [
"def",
"run",
"(",
"statement",
",",
"filename",
"=",
"None",
",",
"sort",
"=",
"-",
"1",
")",
":",
"return",
"_Utils",
"(",
"Profile",
")",
".",
"run",
"(",
"statement",
",",
"filename",
",",
"sort",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/profile.py#L80-L91 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/fitfunctions.py | python | FunctionWrapper.__add__ | (self, other) | return sum | Implement + operator for composite function
:param other: functionWrapper to be added to self | Implement + operator for composite function | [
"Implement",
"+",
"operator",
"for",
"composite",
"function"
] | def __add__(self, other):
"""
Implement + operator for composite function
:param other: functionWrapper to be added to self
"""
sum = CompositeFunctionWrapper(self, other)
if sum.pureAddition:
sum = sum.flatten()
return sum | [
"def",
"__add__",
"(",
"self",
",",
"other",
")",
":",
"sum",
"=",
"CompositeFunctionWrapper",
"(",
"self",
",",
"other",
")",
"if",
"sum",
".",
"pureAddition",
":",
"sum",
"=",
"sum",
".",
"flatten",
"(",
")",
"return",
"sum"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/fitfunctions.py#L129-L138 | |
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | clang/utils/creduce-clang-crash.py | python | Reduce.reduce_clang_args | (self) | Minimize the clang arguments after running C-Reduce, to get the smallest
command that reproduces the crash on the reduced file. | Minimize the clang arguments after running C-Reduce, to get the smallest
command that reproduces the crash on the reduced file. | [
"Minimize",
"the",
"clang",
"arguments",
"after",
"running",
"C",
"-",
"Reduce",
"to",
"get",
"the",
"smallest",
"command",
"that",
"reproduces",
"the",
"crash",
"on",
"the",
"reduced",
"file",
"."
] | def reduce_clang_args(self):
"""Minimize the clang arguments after running C-Reduce, to get the smallest
command that reproduces the crash on the reduced file.
"""
print("\nReducing the clang crash command...")
new_args = self.clang_args
# Remove some often occurring args
new_args = self.t... | [
"def",
"reduce_clang_args",
"(",
"self",
")",
":",
"print",
"(",
"\"\\nReducing the clang crash command...\"",
")",
"new_args",
"=",
"self",
".",
"clang_args",
"# Remove some often occurring args",
"new_args",
"=",
"self",
".",
"try_remove_args",
"(",
"new_args",
",",
... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/utils/creduce-clang-crash.py#L335-L367 | ||
SOUI2/soui | 774e5566b2d3254a94f4b3efd55b982e7c665434 | third-part/jsoncpp/makerelease.py | python | svn_commit | (message) | Commit the sandbox, providing the specified comment. | Commit the sandbox, providing the specified comment. | [
"Commit",
"the",
"sandbox",
"providing",
"the",
"specified",
"comment",
"."
] | def svn_commit(message):
"""Commit the sandbox, providing the specified comment.
"""
svn_command('ci', '-m', message) | [
"def",
"svn_commit",
"(",
"message",
")",
":",
"svn_command",
"(",
"'ci'",
",",
"'-m'",
",",
"message",
")"
] | https://github.com/SOUI2/soui/blob/774e5566b2d3254a94f4b3efd55b982e7c665434/third-part/jsoncpp/makerelease.py#L101-L104 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ftplib.py | python | parse150 | (resp) | Parse the '150' response for a RETR request.
Returns the expected transfer size or None; size is not guaranteed to
be present in the 150 message. | Parse the '150' response for a RETR request.
Returns the expected transfer size or None; size is not guaranteed to
be present in the 150 message. | [
"Parse",
"the",
"150",
"response",
"for",
"a",
"RETR",
"request",
".",
"Returns",
"the",
"expected",
"transfer",
"size",
"or",
"None",
";",
"size",
"is",
"not",
"guaranteed",
"to",
"be",
"present",
"in",
"the",
"150",
"message",
"."
] | def parse150(resp):
'''Parse the '150' response for a RETR request.
Returns the expected transfer size or None; size is not guaranteed to
be present in the 150 message.
'''
if resp[:3] != '150':
raise error_reply, resp
global _150_re
if _150_re is None:
import re
_150... | [
"def",
"parse150",
"(",
"resp",
")",
":",
"if",
"resp",
"[",
":",
"3",
"]",
"!=",
"'150'",
":",
"raise",
"error_reply",
",",
"resp",
"global",
"_150_re",
"if",
"_150_re",
"is",
"None",
":",
"import",
"re",
"_150_re",
"=",
"re",
".",
"compile",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ftplib.py#L813-L831 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32comext/authorization/demos/EditSecurity.py | python | SecurityInformation.GetAccessRights | (self, objecttype, flags) | return (accessrights, 0) | Returns a tuple of (AccessRights, DefaultAccess), where AccessRights is a sequence of tuples representing
SI_ACCESS structs, containing (guid, access mask, Name, flags). DefaultAccess indicates which of the
AccessRights will be used initially when a new ACE is added (zero based).
Fla... | Returns a tuple of (AccessRights, DefaultAccess), where AccessRights is a sequence of tuples representing
SI_ACCESS structs, containing (guid, access mask, Name, flags). DefaultAccess indicates which of the
AccessRights will be used initially when a new ACE is added (zero based).
Fla... | [
"Returns",
"a",
"tuple",
"of",
"(",
"AccessRights",
"DefaultAccess",
")",
"where",
"AccessRights",
"is",
"a",
"sequence",
"of",
"tuples",
"representing",
"SI_ACCESS",
"structs",
"containing",
"(",
"guid",
"access",
"mask",
"Name",
"flags",
")",
".",
"DefaultAcce... | def GetAccessRights(self, objecttype, flags):
"""Returns a tuple of (AccessRights, DefaultAccess), where AccessRights is a sequence of tuples representing
SI_ACCESS structs, containing (guid, access mask, Name, flags). DefaultAccess indicates which of the
AccessRights will be used initia... | [
"def",
"GetAccessRights",
"(",
"self",
",",
"objecttype",
",",
"flags",
")",
":",
"## input flags: SI_ADVANCED,SI_EDIT_AUDITS,SI_EDIT_PROPERTIES indicating which property sheet is requesting the rights",
"if",
"(",
"objecttype",
"is",
"not",
"None",
")",
"and",
"(",
"objectty... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32comext/authorization/demos/EditSecurity.py#L68-L97 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/quantized/modules/embedding_ops.py | python | EmbeddingBag.from_float | (cls, mod) | return qembedding_bag | r"""Create a quantized embedding_bag module from a float module
Args:
mod (Module): a float module, either produced by torch.ao.quantization
utilities or provided by user | r"""Create a quantized embedding_bag module from a float module | [
"r",
"Create",
"a",
"quantized",
"embedding_bag",
"module",
"from",
"a",
"float",
"module"
] | def from_float(cls, mod):
r"""Create a quantized embedding_bag module from a float module
Args:
mod (Module): a float module, either produced by torch.ao.quantization
utilities or provided by user
"""
if hasattr(mod, 'weight_fake_quant'):
... | [
"def",
"from_float",
"(",
"cls",
",",
"mod",
")",
":",
"if",
"hasattr",
"(",
"mod",
",",
"'weight_fake_quant'",
")",
":",
"weight_observer",
"=",
"mod",
".",
"weight_fake_quant",
"else",
":",
"assert",
"type",
"(",
"mod",
")",
"==",
"nn",
".",
"Embedding... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/quantized/modules/embedding_ops.py#L228-L262 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/docview.py | python | Document.GetDocumentWindow | (self) | Intended to return a suitable window for using as a parent for
document-related dialog boxes. By default, uses the frame associated
with the first view. | Intended to return a suitable window for using as a parent for
document-related dialog boxes. By default, uses the frame associated
with the first view. | [
"Intended",
"to",
"return",
"a",
"suitable",
"window",
"for",
"using",
"as",
"a",
"parent",
"for",
"document",
"-",
"related",
"dialog",
"boxes",
".",
"By",
"default",
"uses",
"the",
"frame",
"associated",
"with",
"the",
"first",
"view",
"."
] | def GetDocumentWindow(self):
"""
Intended to return a suitable window for using as a parent for
document-related dialog boxes. By default, uses the frame associated
with the first view.
"""
if len(self._documentViews) > 0:
return self._documentViews[0].GetFram... | [
"def",
"GetDocumentWindow",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"_documentViews",
")",
">",
"0",
":",
"return",
"self",
".",
"_documentViews",
"[",
"0",
"]",
".",
"GetFrame",
"(",
")",
"else",
":",
"return",
"wx",
".",
"GetApp",
"("... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/docview.py#L598-L607 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib2to3/fixer_base.py | python | BaseFix.__init__ | (self, options, log) | Initializer. Subclass may override.
Args:
options: a dict containing the options passed to RefactoringTool
that could be used to customize the fixer through the command line.
log: a list to append warnings and other messages to. | Initializer. Subclass may override. | [
"Initializer",
".",
"Subclass",
"may",
"override",
"."
] | def __init__(self, options, log):
"""Initializer. Subclass may override.
Args:
options: a dict containing the options passed to RefactoringTool
that could be used to customize the fixer through the command line.
log: a list to append warnings and other messages to.
... | [
"def",
"__init__",
"(",
"self",
",",
"options",
",",
"log",
")",
":",
"self",
".",
"options",
"=",
"options",
"self",
".",
"log",
"=",
"log",
"self",
".",
"compile_pattern",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/fixer_base.py#L48-L58 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/imp2.py | python | _resolve_name | (name, package, level) | return "%s.%s" % (package[:dot], name) | Return the absolute name of the module to be imported. | Return the absolute name of the module to be imported. | [
"Return",
"the",
"absolute",
"name",
"of",
"the",
"module",
"to",
"be",
"imported",
"."
] | def _resolve_name(name, package, level):
"""Return the absolute name of the module to be imported."""
if not hasattr(package, 'rindex'):
raise ValueError("'package' not set to a string")
dot = len(package)
for x in py2and3.xrange(level, 1, -1):
try:
dot = package.rindex('.', ... | [
"def",
"_resolve_name",
"(",
"name",
",",
"package",
",",
"level",
")",
":",
"if",
"not",
"hasattr",
"(",
"package",
",",
"'rindex'",
")",
":",
"raise",
"ValueError",
"(",
"\"'package' not set to a string\"",
")",
"dot",
"=",
"len",
"(",
"package",
")",
"f... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/imp2.py#L12-L23 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/commands/perfdiag.py | python | PerfDiagCommand.Download | (self, object_name, file_name=None, serialization_data=None,
start_byte=0, end_byte=None) | Downloads an object from the test bucket.
Args:
object_name: The name of the object (in the test bucket) to download.
file_name: Optional file name to write downloaded data to. If None,
downloaded data is discarded immediately.
serialization_data: Optional serialization data, use... | Downloads an object from the test bucket. | [
"Downloads",
"an",
"object",
"from",
"the",
"test",
"bucket",
"."
] | def Download(self, object_name, file_name=None, serialization_data=None,
start_byte=0, end_byte=None):
"""Downloads an object from the test bucket.
Args:
object_name: The name of the object (in the test bucket) to download.
file_name: Optional file name to write downloaded data to. I... | [
"def",
"Download",
"(",
"self",
",",
"object_name",
",",
"file_name",
"=",
"None",
",",
"serialization_data",
"=",
"None",
",",
"start_byte",
"=",
"0",
",",
"end_byte",
"=",
"None",
")",
":",
"fp",
"=",
"None",
"try",
":",
"if",
"file_name",
"is",
"not... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/commands/perfdiag.py#L1163-L1194 | ||
CleverRaven/Cataclysm-DDA | 03e7363df0835ec1b39da973ea29f26f27833b38 | tools/gfx_tools/compose.py | python | main | () | return 0 | Called when the script is executed directly | Called when the script is executed directly | [
"Called",
"when",
"the",
"script",
"is",
"executed",
"directly"
] | def main() -> Union[int, ComposingException]:
"""
Called when the script is executed directly
"""
# read arguments and initialize objects
arg_parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
arg_parser.add_argument(
... | [
"def",
"main",
"(",
")",
"->",
"Union",
"[",
"int",
",",
"ComposingException",
"]",
":",
"# read arguments and initialize objects",
"arg_parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"__doc__",
",",
"formatter_class",
"=",
"argparse",
"... | https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/gfx_tools/compose.py#L852-L949 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | ImageFromDataWithAlpha | (*args, **kwargs) | return val | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
Construct an Image from a buffer of RGB bytes with an Alpha channel.
Accepts either a string or a buffer object holding the data and the
length of the data must be width*height*3 bytes, and the length of the
alpha data mu... | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | [
"ImageFromDataWithAlpha",
"(",
"int",
"width",
"int",
"height",
"buffer",
"data",
"buffer",
"alpha",
")",
"-",
">",
"Image"
] | def ImageFromDataWithAlpha(*args, **kwargs):
"""
ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
Construct an Image from a buffer of RGB bytes with an Alpha channel.
Accepts either a string or a buffer object holding the data and the
length of the data must be widt... | [
"def",
"ImageFromDataWithAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_core_",
".",
"new_ImageFromDataWithAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L3764-L3774 | |
wy1iu/LargeMargin_Softmax_Loss | c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec | python/caffe/net_spec.py | python | Top.to_proto | (self) | return to_proto(self) | Generate a NetParameter that contains all layers needed to compute
this top. | Generate a NetParameter that contains all layers needed to compute
this top. | [
"Generate",
"a",
"NetParameter",
"that",
"contains",
"all",
"layers",
"needed",
"to",
"compute",
"this",
"top",
"."
] | def to_proto(self):
"""Generate a NetParameter that contains all layers needed to compute
this top."""
return to_proto(self) | [
"def",
"to_proto",
"(",
"self",
")",
":",
"return",
"to_proto",
"(",
"self",
")"
] | https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/python/caffe/net_spec.py#L90-L94 | |
Ifsttar/I-Simpa | 2283385f4cac769a92e265edabb9c79cb6c42d03 | currentRelease/SystemScript/graphy/backends/google_chart_api/util.py | python | JoinLists | (**args) | return out | Take a dictionary of {long_name:values}, and join the values.
For each long_name, join the values into a string according to
JOIN_DELIMS. If values is empty or None, replace with an empty string.
Returns:
A dictionary {long_name:joined_value} entries. | Take a dictionary of {long_name:values}, and join the values. | [
"Take",
"a",
"dictionary",
"of",
"{",
"long_name",
":",
"values",
"}",
"and",
"join",
"the",
"values",
"."
] | def JoinLists(**args):
"""Take a dictionary of {long_name:values}, and join the values.
For each long_name, join the values into a string according to
JOIN_DELIMS. If values is empty or None, replace with an empty string.
Returns:
A dictionary {long_name:joined_value} entries.
"""
out = {}
... | [
"def",
"JoinLists",
"(",
"*",
"*",
"args",
")",
":",
"out",
"=",
"{",
"}",
"for",
"key",
",",
"val",
"in",
"args",
".",
"items",
"(",
")",
":",
"if",
"val",
":",
"out",
"[",
"key",
"]",
"=",
"StrJoin",
"(",
"JOIN_DELIMS",
"[",
"key",
"]",
","... | https://github.com/Ifsttar/I-Simpa/blob/2283385f4cac769a92e265edabb9c79cb6c42d03/currentRelease/SystemScript/graphy/backends/google_chart_api/util.py#L170-L185 | |
isc-projects/kea | c5836c791b63f42173bb604dd5f05d7110f3e716 | hammer.py | python | _configure_mysql | (system, revision, features) | Configure MySQL database. | Configure MySQL database. | [
"Configure",
"MySQL",
"database",
"."
] | def _configure_mysql(system, revision, features):
"""Configure MySQL database."""
if system in ['debian', 'fedora', 'centos']:
execute('sudo systemctl enable mariadb.service')
execute('sudo systemctl start mariadb.service')
elif system == 'ubuntu':
execute('sudo systemctl enable mys... | [
"def",
"_configure_mysql",
"(",
"system",
",",
"revision",
",",
"features",
")",
":",
"if",
"system",
"in",
"[",
"'debian'",
",",
"'fedora'",
",",
"'centos'",
"]",
":",
"execute",
"(",
"'sudo systemctl enable mariadb.service'",
")",
"execute",
"(",
"'sudo system... | https://github.com/isc-projects/kea/blob/c5836c791b63f42173bb604dd5f05d7110f3e716/hammer.py#L1122-L1181 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/path-with-maximum-minimum-value.py | python | Solution2.maximumMinimumPath | (self, A) | return -1 | :type A: List[List[int]]
:rtype: int | :type A: List[List[int]]
:rtype: int | [
":",
"type",
"A",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"int"
] | def maximumMinimumPath(self, A):
"""
:type A: List[List[int]]
:rtype: int
"""
directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
max_heap = [(-A[0][0], 0, 0)]
lookup = set([(0, 0)])
while max_heap:
i, r, c = heapq.heappop(max_heap)
if ... | [
"def",
"maximumMinimumPath",
"(",
"self",
",",
"A",
")",
":",
"directions",
"=",
"[",
"(",
"0",
",",
"1",
")",
",",
"(",
"1",
",",
"0",
")",
",",
"(",
"0",
",",
"-",
"1",
")",
",",
"(",
"-",
"1",
",",
"0",
")",
"]",
"max_heap",
"=",
"[",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/path-with-maximum-minimum-value.py#L51-L70 | |
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/property_set.py | python | PropertySet.dependency | (self) | return self.dependency_ | Returns dependency properties. | Returns dependency properties. | [
"Returns",
"dependency",
"properties",
"."
] | def dependency (self):
""" Returns dependency properties.
"""
return self.dependency_ | [
"def",
"dependency",
"(",
"self",
")",
":",
"return",
"self",
".",
"dependency_"
] | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/property_set.py#L268-L271 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | ListItem.SetText | (*args, **kwargs) | return _controls_.ListItem_SetText(*args, **kwargs) | SetText(self, String text) | SetText(self, String text) | [
"SetText",
"(",
"self",
"String",
"text",
")"
] | def SetText(*args, **kwargs):
"""SetText(self, String text)"""
return _controls_.ListItem_SetText(*args, **kwargs) | [
"def",
"SetText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListItem_SetText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4180-L4182 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListCtrl.GetItemBackgroundColour | (*args, **kwargs) | return _controls_.ListCtrl_GetItemBackgroundColour(*args, **kwargs) | GetItemBackgroundColour(self, long item) -> Colour | GetItemBackgroundColour(self, long item) -> Colour | [
"GetItemBackgroundColour",
"(",
"self",
"long",
"item",
")",
"-",
">",
"Colour"
] | def GetItemBackgroundColour(*args, **kwargs):
"""GetItemBackgroundColour(self, long item) -> Colour"""
return _controls_.ListCtrl_GetItemBackgroundColour(*args, **kwargs) | [
"def",
"GetItemBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_GetItemBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4748-L4750 | |
9miao/CrossApp | 1f5375e061bf69841eb19728598f5ae3f508d620 | tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Diagnostic.option | (self) | return conf.lib.clang_getDiagnosticOption(self, None) | The command-line option that enables this diagnostic. | The command-line option that enables this diagnostic. | [
"The",
"command",
"-",
"line",
"option",
"that",
"enables",
"this",
"diagnostic",
"."
] | def option(self):
"""The command-line option that enables this diagnostic."""
return conf.lib.clang_getDiagnosticOption(self, None) | [
"def",
"option",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getDiagnosticOption",
"(",
"self",
",",
"None",
")"
] | https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L350-L352 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Text.tag_nextrange | (self, tagName, index1, index2=None) | return self.tk.splitlist(self.tk.call(
self._w, 'tag', 'nextrange', tagName, index1, index2)) | Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1. | Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1. | [
"Return",
"a",
"list",
"of",
"start",
"and",
"end",
"index",
"for",
"the",
"first",
"sequence",
"of",
"characters",
"between",
"INDEX1",
"and",
"INDEX2",
"which",
"all",
"have",
"tag",
"TAGNAME",
".",
"The",
"text",
"is",
"searched",
"forward",
"from",
"IN... | def tag_nextrange(self, tagName, index1, index2=None):
"""Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1."""
return self.tk.splitlist(self.tk.call(
self._... | [
"def",
"tag_nextrange",
"(",
"self",
",",
"tagName",
",",
"index1",
",",
"index2",
"=",
"None",
")",
":",
"return",
"self",
".",
"tk",
".",
"splitlist",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'tag'",
",",
"'nextrange'",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L3208-L3213 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/config/config_data.py | python | MultiConfigData.find_spec_part | (self, identifier) | Returns the specification for the item at the given
identifier, or None if not found. The first part of the
identifier (up to the first /) is interpreted as the module
name. Returns None if not found, or if identifier is not a
string.
If an index is given for a Lis... | Returns the specification for the item at the given
identifier, or None if not found. The first part of the
identifier (up to the first /) is interpreted as the module
name. Returns None if not found, or if identifier is not a
string.
If an index is given for a Lis... | [
"Returns",
"the",
"specification",
"for",
"the",
"item",
"at",
"the",
"given",
"identifier",
"or",
"None",
"if",
"not",
"found",
".",
"The",
"first",
"part",
"of",
"the",
"identifier",
"(",
"up",
"to",
"the",
"first",
"/",
")",
"is",
"interpreted",
"as",... | def find_spec_part(self, identifier):
"""Returns the specification for the item at the given
identifier, or None if not found. The first part of the
identifier (up to the first /) is interpreted as the module
name. Returns None if not found, or if identifier is not a
... | [
"def",
"find_spec_part",
"(",
"self",
",",
"identifier",
")",
":",
"if",
"type",
"(",
"identifier",
")",
"!=",
"str",
"or",
"identifier",
"==",
"\"\"",
":",
"return",
"None",
"if",
"identifier",
"[",
"0",
"]",
"==",
"'/'",
":",
"identifier",
"=",
"iden... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/config/config_data.py#L443-L470 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py | python | TrilinosPRConfigurationBase.max_cores_allowed | (self) | return self._max_cores_allowed | Calculate the true max number of cores we can use.
This is the minimum of the available cores detected on the system
and the max cores allowed by argument.
If the max_cores_allowd is not > 0 then we use the # of cores on the system. | Calculate the true max number of cores we can use. | [
"Calculate",
"the",
"true",
"max",
"number",
"of",
"cores",
"we",
"can",
"use",
"."
] | def max_cores_allowed(self):
"""
Calculate the true max number of cores we can use.
This is the minimum of the available cores detected on the system
and the max cores allowed by argument.
If the max_cores_allowd is not > 0 then we use the # of cores on the system.
"""
... | [
"def",
"max_cores_allowed",
"(",
"self",
")",
":",
"if",
"self",
".",
"_max_cores_allowed",
"is",
"None",
":",
"num_cores",
"=",
"multiprocessing",
".",
"cpu_count",
"(",
")",
"if",
"self",
".",
"arg_max_cores_allowed",
">",
"0",
":",
"self",
".",
"_max_core... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py#L359-L374 | |
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/layers/blur.py | python | blurriness | (lottie,parameter,idx,direction) | This function will be called for blur layer direction to create the blurriness
value dictionary
Args:
lottie (dict) : Lottie Dictionary for blurriness
parameter (common.Param.Param) : Synfig format param for blur size
idx (int) : Stores the index(number of) of blurriness
... | This function will be called for blur layer direction to create the blurriness
value dictionary | [
"This",
"function",
"will",
"be",
"called",
"for",
"blur",
"layer",
"direction",
"to",
"create",
"the",
"blurriness",
"value",
"dictionary"
] | def blurriness(lottie,parameter,idx,direction):
"""
This function will be called for blur layer direction to create the blurriness
value dictionary
Args:
lottie (dict) : Lottie Dictionary for blurriness
parameter (common.Param.Param) : Synfig format param for blur size
idx (int) ... | [
"def",
"blurriness",
"(",
"lottie",
",",
"parameter",
",",
"idx",
",",
"direction",
")",
":",
"lottie",
"[",
"\"ty\"",
"]",
"=",
"0",
"lottie",
"[",
"\"nm\"",
"]",
"=",
"\"Blurriness\"",
"lottie",
"[",
"\"mn\"",
"]",
"=",
"\"Gaussian Blur 1\"",
"lottie",
... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/layers/blur.py#L12-L54 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateTime.SetYear | (*args, **kwargs) | return _misc_.DateTime_SetYear(*args, **kwargs) | SetYear(self, int year) -> DateTime | SetYear(self, int year) -> DateTime | [
"SetYear",
"(",
"self",
"int",
"year",
")",
"-",
">",
"DateTime"
] | def SetYear(*args, **kwargs):
"""SetYear(self, int year) -> DateTime"""
return _misc_.DateTime_SetYear(*args, **kwargs) | [
"def",
"SetYear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_SetYear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3817-L3819 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/onnx2mx/_op_translations.py | python | arctan | (attrs, inputs, proto_obj) | return 'arctan', attrs, inputs | Elementwise inverse tan of input array. | Elementwise inverse tan of input array. | [
"Elementwise",
"inverse",
"tan",
"of",
"input",
"array",
"."
] | def arctan(attrs, inputs, proto_obj):
"""Elementwise inverse tan of input array."""
return 'arctan', attrs, inputs | [
"def",
"arctan",
"(",
"attrs",
",",
"inputs",
",",
"proto_obj",
")",
":",
"return",
"'arctan'",
",",
"attrs",
",",
"inputs"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L606-L608 | |
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/google/protobuf/internal/wire_format.py | python | TagByteSize | (field_number) | return _VarUInt64ByteSizeNoTag(PackTag(field_number, 0)) | Returns the bytes required to serialize a tag with this field number. | Returns the bytes required to serialize a tag with this field number. | [
"Returns",
"the",
"bytes",
"required",
"to",
"serialize",
"a",
"tag",
"with",
"this",
"field",
"number",
"."
] | def TagByteSize(field_number):
"""Returns the bytes required to serialize a tag with this field number."""
# Just pass in type 0, since the type won't affect the tag+type size.
return _VarUInt64ByteSizeNoTag(PackTag(field_number, 0)) | [
"def",
"TagByteSize",
"(",
"field_number",
")",
":",
"# Just pass in type 0, since the type won't affect the tag+type size.",
"return",
"_VarUInt64ByteSizeNoTag",
"(",
"PackTag",
"(",
"field_number",
",",
"0",
")",
")"
] | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/internal/wire_format.py#L224-L227 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/fftpack/pseudo_diffs.py | python | diff | (x,order=1,period=None, _cache=_cache) | return convolve.convolve(tmp,omega,swap_real_imag=order % 2,
overwrite_x=overwrite_x) | Return k-th derivative (or integral) of a periodic sequence x.
If x_j and y_j are Fourier coefficients of periodic functions x
and y, respectively, then::
y_j = pow(sqrt(-1)*j*2*pi/period, order) * x_j
y_0 = 0 if order is not 0.
Parameters
----------
x : array_like
Input array... | Return k-th derivative (or integral) of a periodic sequence x. | [
"Return",
"k",
"-",
"th",
"derivative",
"(",
"or",
"integral",
")",
"of",
"a",
"periodic",
"sequence",
"x",
"."
] | def diff(x,order=1,period=None, _cache=_cache):
"""
Return k-th derivative (or integral) of a periodic sequence x.
If x_j and y_j are Fourier coefficients of periodic functions x
and y, respectively, then::
y_j = pow(sqrt(-1)*j*2*pi/period, order) * x_j
y_0 = 0 if order is not 0.
Para... | [
"def",
"diff",
"(",
"x",
",",
"order",
"=",
"1",
",",
"period",
"=",
"None",
",",
"_cache",
"=",
"_cache",
")",
":",
"tmp",
"=",
"asarray",
"(",
"x",
")",
"if",
"order",
"==",
"0",
":",
"return",
"tmp",
"if",
"iscomplexobj",
"(",
"tmp",
")",
":... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/fftpack/pseudo_diffs.py#L26-L80 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/files.py | python | flat_rootname | (filename) | return re.sub(r"[\\/.:]", "_", name) | A base for a flat file name to correspond to this file.
Useful for writing files about the code where you want all the files in
the same directory, but need to differentiate same-named files from
different directories.
For example, the file a/b/c.py will return 'a_b_c_py' | A base for a flat file name to correspond to this file. | [
"A",
"base",
"for",
"a",
"flat",
"file",
"name",
"to",
"correspond",
"to",
"this",
"file",
"."
] | def flat_rootname(filename):
"""A base for a flat file name to correspond to this file.
Useful for writing files about the code where you want all the files in
the same directory, but need to differentiate same-named files from
different directories.
For example, the file a/b/c.py will return 'a_b... | [
"def",
"flat_rootname",
"(",
"filename",
")",
":",
"name",
"=",
"ntpath",
".",
"splitdrive",
"(",
"filename",
")",
"[",
"1",
"]",
"return",
"re",
".",
"sub",
"(",
"r\"[\\\\/.:]\"",
",",
"\"_\"",
",",
"name",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/files.py#L74-L85 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/ma/core.py | python | MaskedArray.__ne__ | (self, other) | return self._comparison(other, operator.ne) | Check whether other does not equal self elementwise.
When either of the elements is masked, the result is masked as well,
but the underlying boolean data are still set, with self and other
considered equal if both are masked, and unequal otherwise.
For structured arrays, all fields are... | Check whether other does not equal self elementwise. | [
"Check",
"whether",
"other",
"does",
"not",
"equal",
"self",
"elementwise",
"."
] | def __ne__(self, other):
"""Check whether other does not equal self elementwise.
When either of the elements is masked, the result is masked as well,
but the underlying boolean data are still set, with self and other
considered equal if both are masked, and unequal otherwise.
F... | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_comparison",
"(",
"other",
",",
"operator",
".",
"ne",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/core.py#L4119-L4130 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/config/linux/pkg-config.py | python | GetPkgConfigPrefixToStrip | (options, args) | return prefix | Returns the prefix from pkg-config where packages are installed.
This returned prefix is the one that should be stripped from the beginning of
directory names to take into account sysroots. | Returns the prefix from pkg-config where packages are installed. | [
"Returns",
"the",
"prefix",
"from",
"pkg",
"-",
"config",
"where",
"packages",
"are",
"installed",
"."
] | def GetPkgConfigPrefixToStrip(options, args):
"""Returns the prefix from pkg-config where packages are installed.
This returned prefix is the one that should be stripped from the beginning of
directory names to take into account sysroots.
"""
# Some sysroots, like the Chromium OS ones, may generate paths tha... | [
"def",
"GetPkgConfigPrefixToStrip",
"(",
"options",
",",
"args",
")",
":",
"# Some sysroots, like the Chromium OS ones, may generate paths that are not",
"# relative to the sysroot. For example,",
"# /path/to/chroot/build/x86-generic/usr/lib/pkgconfig/pkg.pc may have all",
"# paths relative to... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/config/linux/pkg-config.py#L68-L85 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py | python | convert_argmax | (node, **kwargs) | return nodes | Map MXNet's argmax operator attributes to onnx's ArgMax operator
and return the created node. | Map MXNet's argmax operator attributes to onnx's ArgMax operator
and return the created node. | [
"Map",
"MXNet",
"s",
"argmax",
"operator",
"attributes",
"to",
"onnx",
"s",
"ArgMax",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_argmax(node, **kwargs):
"""Map MXNet's argmax operator attributes to onnx's ArgMax operator
and return the created node.
"""
from onnx.helper import make_node
name, input_nodes, attrs = get_inputs(node, kwargs)
axis = str(attrs.get('axis', 'None'))
keepdims = get_boolean_attribu... | [
"def",
"convert_argmax",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"onnx",
".",
"helper",
"import",
"make_node",
"name",
",",
"input_nodes",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
"kwargs",
")",
"axis",
"=",
"str",
"(",
"attrs... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py#L1381-L1419 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | to_hdf | (
path_or_buf,
key: str,
value: FrameOrSeries,
mode: str = "a",
complevel: int | None = None,
complib: str | None = None,
append: bool = False,
format: str | None = None,
index: bool = True,
min_itemsize: int | dict[str, int] | None = None,
nan_rep=None,
dropna: bool | No... | store this object, close it if we opened it | store this object, close it if we opened it | [
"store",
"this",
"object",
"close",
"it",
"if",
"we",
"opened",
"it"
] | def to_hdf(
path_or_buf,
key: str,
value: FrameOrSeries,
mode: str = "a",
complevel: int | None = None,
complib: str | None = None,
append: bool = False,
format: str | None = None,
index: bool = True,
min_itemsize: int | dict[str, int] | None = None,
nan_rep=None,
dropna:... | [
"def",
"to_hdf",
"(",
"path_or_buf",
",",
"key",
":",
"str",
",",
"value",
":",
"FrameOrSeries",
",",
"mode",
":",
"str",
"=",
"\"a\"",
",",
"complevel",
":",
"int",
"|",
"None",
"=",
"None",
",",
"complib",
":",
"str",
"|",
"None",
"=",
"None",
",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L263-L316 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TNGraph.Clr | (self) | return _snap.TNGraph_Clr(self) | Clr(TNGraph self)
Parameters:
self: TNGraph * | Clr(TNGraph self) | [
"Clr",
"(",
"TNGraph",
"self",
")"
] | def Clr(self):
"""
Clr(TNGraph self)
Parameters:
self: TNGraph *
"""
return _snap.TNGraph_Clr(self) | [
"def",
"Clr",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TNGraph_Clr",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L4167-L4175 | |
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/encoder.py | python | _ModifiedSizer | (compute_value_size, modify_value) | return SpecificSizer | Like SimpleSizer, but modify_value is invoked on each value before it is
passed to compute_value_size. modify_value is typically ZigZagEncode. | Like SimpleSizer, but modify_value is invoked on each value before it is
passed to compute_value_size. modify_value is typically ZigZagEncode. | [
"Like",
"SimpleSizer",
"but",
"modify_value",
"is",
"invoked",
"on",
"each",
"value",
"before",
"it",
"is",
"passed",
"to",
"compute_value_size",
".",
"modify_value",
"is",
"typically",
"ZigZagEncode",
"."
] | def _ModifiedSizer(compute_value_size, modify_value):
"""Like SimpleSizer, but modify_value is invoked on each value before it is
passed to compute_value_size. modify_value is typically ZigZagEncode."""
def SpecificSizer(field_number, is_repeated, is_packed):
tag_size = _TagSize(field_number)
if is_pack... | [
"def",
"_ModifiedSizer",
"(",
"compute_value_size",
",",
"modify_value",
")",
":",
"def",
"SpecificSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"if",
"is_packed",
":",
"local_... | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/encoder.py#L152-L178 | |
robotology/yarp | 3d6e3f258db7755a3c44dd1e62c303cc36c49a8f | extern/thrift/thrift/lib/py/src/Thrift.py | python | TProcessor.process | (self, iprot, oprot) | Process a request. The normal behvaior is to have the
processor invoke the correct handler and then it is the
server's responsibility to write the response to oprot. | Process a request. The normal behvaior is to have the
processor invoke the correct handler and then it is the
server's responsibility to write the response to oprot. | [
"Process",
"a",
"request",
".",
"The",
"normal",
"behvaior",
"is",
"to",
"have",
"the",
"processor",
"invoke",
"the",
"correct",
"handler",
"and",
"then",
"it",
"is",
"the",
"server",
"s",
"responsibility",
"to",
"write",
"the",
"response",
"to",
"oprot",
... | def process(self, iprot, oprot):
"""
Process a request. The normal behvaior is to have the
processor invoke the correct handler and then it is the
server's responsibility to write the response to oprot.
"""
pass | [
"def",
"process",
"(",
"self",
",",
"iprot",
",",
"oprot",
")",
":",
"pass"
] | https://github.com/robotology/yarp/blob/3d6e3f258db7755a3c44dd1e62c303cc36c49a8f/extern/thrift/thrift/lib/py/src/Thrift.py#L72-L78 | ||
robotics/open_abb | 211630855bbf2b529910cac129b20cffc5c19ad6 | abb_node/packages/abb_communications/abb.py | python | Robot.move_circular | (self, pose_onarc, pose_end) | return self.send(msg_1) | Executes a movement in a circular path from current position,
through pose_onarc, to pose_end | Executes a movement in a circular path from current position,
through pose_onarc, to pose_end | [
"Executes",
"a",
"movement",
"in",
"a",
"circular",
"path",
"from",
"current",
"position",
"through",
"pose_onarc",
"to",
"pose_end"
] | def move_circular(self, pose_onarc, pose_end):
'''
Executes a movement in a circular path from current position,
through pose_onarc, to pose_end
'''
msg_0 = "35 " + self.format_pose(pose_onarc)
msg_1 = "36 " + self.format_pose(pose_end)
data = self.send(msg_0)... | [
"def",
"move_circular",
"(",
"self",
",",
"pose_onarc",
",",
"pose_end",
")",
":",
"msg_0",
"=",
"\"35 \"",
"+",
"self",
".",
"format_pose",
"(",
"pose_onarc",
")",
"msg_1",
"=",
"\"36 \"",
"+",
"self",
".",
"format_pose",
"(",
"pose_end",
")",
"data",
"... | https://github.com/robotics/open_abb/blob/211630855bbf2b529910cac129b20cffc5c19ad6/abb_node/packages/abb_communications/abb.py#L278-L290 | |
facebookresearch/habitat-sim | 63b6c71d9ca8adaefb140b198196f5d0ca1f1e34 | src_python/habitat_sim/robots/mobile_manipulator.py | python | MobileManipulator.ee_transform | (self) | return ef_link_transform | Gets the transformation of the end-effector location. This is offset
from the end-effector link location. | Gets the transformation of the end-effector location. This is offset
from the end-effector link location. | [
"Gets",
"the",
"transformation",
"of",
"the",
"end",
"-",
"effector",
"location",
".",
"This",
"is",
"offset",
"from",
"the",
"end",
"-",
"effector",
"link",
"location",
"."
] | def ee_transform(self) -> mn.Matrix4:
"""Gets the transformation of the end-effector location. This is offset
from the end-effector link location.
"""
ef_link_transform = self.sim_obj.get_link_scene_node(
self.params.ee_link
).transformation
ef_link_transform.... | [
"def",
"ee_transform",
"(",
"self",
")",
"->",
"mn",
".",
"Matrix4",
":",
"ef_link_transform",
"=",
"self",
".",
"sim_obj",
".",
"get_link_scene_node",
"(",
"self",
".",
"params",
".",
"ee_link",
")",
".",
"transformation",
"ef_link_transform",
".",
"translati... | https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/src_python/habitat_sim/robots/mobile_manipulator.py#L293-L303 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/wizard.py | python | PyWizardPage.DoMoveWindow | (*args, **kwargs) | return _wizard.PyWizardPage_DoMoveWindow(*args, **kwargs) | DoMoveWindow(self, int x, int y, int width, int height) | DoMoveWindow(self, int x, int y, int width, int height) | [
"DoMoveWindow",
"(",
"self",
"int",
"x",
"int",
"y",
"int",
"width",
"int",
"height",
")"
] | def DoMoveWindow(*args, **kwargs):
"""DoMoveWindow(self, int x, int y, int width, int height)"""
return _wizard.PyWizardPage_DoMoveWindow(*args, **kwargs) | [
"def",
"DoMoveWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_wizard",
".",
"PyWizardPage_DoMoveWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/wizard.py#L151-L153 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Taskmaster.py | python | Task.prepare | (self) | Called just before the task is executed.
This is mainly intended to give the target Nodes a chance to
unlink underlying files and make all necessary directories before
the Action is actually called to build the targets. | Called just before the task is executed. | [
"Called",
"just",
"before",
"the",
"task",
"is",
"executed",
"."
] | def prepare(self):
"""
Called just before the task is executed.
This is mainly intended to give the target Nodes a chance to
unlink underlying files and make all necessary directories before
the Action is actually called to build the targets.
"""
global print_pre... | [
"def",
"prepare",
"(",
"self",
")",
":",
"global",
"print_prepare",
"T",
"=",
"self",
".",
"tm",
".",
"trace",
"if",
"T",
":",
"T",
".",
"write",
"(",
"self",
".",
"trace_message",
"(",
"'Task.prepare()'",
",",
"self",
".",
"node",
")",
")",
"# Now t... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Taskmaster.py#L152-L196 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/encodings/uu_codec.py | python | uu_decode | (input,errors='strict') | return (outfile.getvalue(), len(input)) | Decodes the object input and returns a tuple (output
object, length consumed).
input must be an object which provides the bf_getreadbuf
buffer slot. Python strings, buffer objects and memory
mapped files are examples of objects providing this slot.
errors defines the error hand... | Decodes the object input and returns a tuple (output
object, length consumed). | [
"Decodes",
"the",
"object",
"input",
"and",
"returns",
"a",
"tuple",
"(",
"output",
"object",
"length",
"consumed",
")",
"."
] | def uu_decode(input,errors='strict'):
""" Decodes the object input and returns a tuple (output
object, length consumed).
input must be an object which provides the bf_getreadbuf
buffer slot. Python strings, buffer objects and memory
mapped files are examples of objects providing th... | [
"def",
"uu_decode",
"(",
"input",
",",
"errors",
"=",
"'strict'",
")",
":",
"assert",
"errors",
"==",
"'strict'",
"from",
"cStringIO",
"import",
"StringIO",
"from",
"binascii",
"import",
"a2b_uu",
"infile",
"=",
"StringIO",
"(",
"str",
"(",
"input",
")",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/encodings/uu_codec.py#L44-L94 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/image/image.py | python | random_crop | (src, size, interp=2) | return out, (x0, y0, new_w, new_h) | Randomly crop `src` with `size` (width, height).
Upsample result if `src` is smaller than `size`.
Parameters
----------
src: Source image `NDArray`
size: Size of the crop formatted as (width, height). If the `size` is larger
than the image, then the source image is upsampled to `size` an... | Randomly crop `src` with `size` (width, height).
Upsample result if `src` is smaller than `size`. | [
"Randomly",
"crop",
"src",
"with",
"size",
"(",
"width",
"height",
")",
".",
"Upsample",
"result",
"if",
"src",
"is",
"smaller",
"than",
"size",
"."
] | def random_crop(src, size, interp=2):
"""Randomly crop `src` with `size` (width, height).
Upsample result if `src` is smaller than `size`.
Parameters
----------
src: Source image `NDArray`
size: Size of the crop formatted as (width, height). If the `size` is larger
than the image, th... | [
"def",
"random_crop",
"(",
"src",
",",
"size",
",",
"interp",
"=",
"2",
")",
":",
"h",
",",
"w",
",",
"_",
"=",
"src",
".",
"shape",
"new_w",
",",
"new_h",
"=",
"scale_down",
"(",
"(",
"w",
",",
"h",
")",
",",
"size",
")",
"x0",
"=",
"random"... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/image/image.py#L451-L487 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy/_op.py | python | ediff1d | (ary, to_end=None, to_begin=None) | return _api_internal.ediff1d(ary, to_end, to_begin) | The differences between consecutive elements of an array.
Parameters
----------
ary : ndarray
If necessary, will be flattened before the differences are taken.
to_end : ndarray or scalar, optional
Number(s) to append at the end of the returned differences.
to_begin : ndarray or scal... | The differences between consecutive elements of an array. | [
"The",
"differences",
"between",
"consecutive",
"elements",
"of",
"an",
"array",
"."
] | def ediff1d(ary, to_end=None, to_begin=None):
"""
The differences between consecutive elements of an array.
Parameters
----------
ary : ndarray
If necessary, will be flattened before the differences are taken.
to_end : ndarray or scalar, optional
Number(s) to append at the end o... | [
"def",
"ediff1d",
"(",
"ary",
",",
"to_end",
"=",
"None",
",",
"to_begin",
"=",
"None",
")",
":",
"return",
"_api_internal",
".",
"ediff1d",
"(",
"ary",
",",
"to_end",
",",
"to_begin",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy/_op.py#L8503-L8539 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ticker.py | python | Ticker.OnErase | (self, evt) | Noop because of double buffering | Noop because of double buffering | [
"Noop",
"because",
"of",
"double",
"buffering"
] | def OnErase(self, evt):
"""Noop because of double buffering"""
pass | [
"def",
"OnErase",
"(",
"self",
",",
"evt",
")",
":",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ticker.py#L172-L174 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/device_setup.py | python | Reboot | (device) | Reboot the device.
Args:
device: Device to reboot, from DeviceUtils. | Reboot the device. | [
"Reboot",
"the",
"device",
"."
] | def Reboot(device):
"""Reboot the device.
Args:
device: Device to reboot, from DeviceUtils.
"""
# Kills the device -> host forwarder running on the device so that
# forwarder.Forwarder have correct state tracking after having rebooted.
forwarder.Forwarder.UnmapAllDevicePorts(device)
# Reboot the devi... | [
"def",
"Reboot",
"(",
"device",
")",
":",
"# Kills the device -> host forwarder running on the device so that",
"# forwarder.Forwarder have correct state tracking after having rebooted.",
"forwarder",
".",
"Forwarder",
".",
"UnmapAllDevicePorts",
"(",
"device",
")",
"# Reboot the dev... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/device_setup.py#L81-L94 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/replay.py | python | configure_logging | (log_level_name, log_file_name=None) | Configure logging level and format.
Args:
log_level_name: 'debug', 'info', 'warning', 'error', or 'critical'.
log_file_name: a file name | Configure logging level and format. | [
"Configure",
"logging",
"level",
"and",
"format",
"."
] | def configure_logging(log_level_name, log_file_name=None):
"""Configure logging level and format.
Args:
log_level_name: 'debug', 'info', 'warning', 'error', or 'critical'.
log_file_name: a file name
"""
if logging.root.handlers:
logging.critical('A logging method (e.g. "logging.warn(...)")'
... | [
"def",
"configure_logging",
"(",
"log_level_name",
",",
"log_file_name",
"=",
"None",
")",
":",
"if",
"logging",
".",
"root",
".",
"handlers",
":",
"logging",
".",
"critical",
"(",
"'A logging method (e.g. \"logging.warn(...)\")'",
"' was called before logging was configu... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/replay.py#L67-L92 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/gdal-utils/osgeo_utils/gdal2tiles.py | python | GlobalMercator.ZoomForPixelSize | (self, pixelSize) | return MAXZOOMLEVEL - 1 | Maximal scaledown zoom of the pyramid closest to the pixelSize. | Maximal scaledown zoom of the pyramid closest to the pixelSize. | [
"Maximal",
"scaledown",
"zoom",
"of",
"the",
"pyramid",
"closest",
"to",
"the",
"pixelSize",
"."
] | def ZoomForPixelSize(self, pixelSize):
"Maximal scaledown zoom of the pyramid closest to the pixelSize."
for i in range(MAXZOOMLEVEL):
if pixelSize > self.Resolution(i):
return max(0, i - 1) # We don't want to scale up
return MAXZOOMLEVEL - 1 | [
"def",
"ZoomForPixelSize",
"(",
"self",
",",
"pixelSize",
")",
":",
"for",
"i",
"in",
"range",
"(",
"MAXZOOMLEVEL",
")",
":",
"if",
"pixelSize",
">",
"self",
".",
"Resolution",
"(",
"i",
")",
":",
"return",
"max",
"(",
"0",
",",
"i",
"-",
"1",
")",... | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py#L429-L435 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | PUTHandler.WriteGLES2Implementation | (self, func, file) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteGLES2Implementation(self, func, file):
"""Overrriden from TypeHandler."""
impl_func = func.GetInfo('impl_func')
if (impl_func != None and impl_func != True):
return;
file.Write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
fun... | [
"def",
"WriteGLES2Implementation",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"impl_func",
"=",
"func",
".",
"GetInfo",
"(",
"'impl_func'",
")",
"if",
"(",
"impl_func",
"!=",
"None",
"and",
"impl_func",
"!=",
"True",
")",
":",
"return",
"file",
"."... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L4795-L4816 | ||
letscontrolit/ESPEasy | acb2c9e695d6f61d8d67adf0fe4037c08d4baedd | lib/IRremoteESP8266/tools/scrape_supported_devices.py | python | generate | (fout) | return ARGS.alert and sets.printwarnings() | Generate data to fout
return True on any issues (when alert is active) | Generate data to fout
return True on any issues (when alert is active) | [
"Generate",
"data",
"to",
"fout",
"return",
"True",
"on",
"any",
"issues",
"(",
"when",
"alert",
"is",
"active",
")"
] | def generate(fout):
"""Generate data to fout
return True on any issues (when alert is active)"""
decodedprotocols = getdecodedprotocols()
sendonly = getallprotocols() - decodedprotocols
allacs = getallacs()
sets = getalldevices()
allcodes = sets.allcodes
allbrands = list(allcodes.keys())
allbrands.so... | [
"def",
"generate",
"(",
"fout",
")",
":",
"decodedprotocols",
"=",
"getdecodedprotocols",
"(",
")",
"sendonly",
"=",
"getallprotocols",
"(",
")",
"-",
"decodedprotocols",
"allacs",
"=",
"getallacs",
"(",
")",
"sets",
"=",
"getalldevices",
"(",
")",
"allcodes",... | https://github.com/letscontrolit/ESPEasy/blob/acb2c9e695d6f61d8d67adf0fe4037c08d4baedd/lib/IRremoteESP8266/tools/scrape_supported_devices.py#L325-L370 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/saving/saved_model_experimental.py | python | export_saved_model | (model,
saved_model_path,
custom_objects=None,
as_text=False,
input_signature=None,
serving_only=False) | Exports a `tf.keras.Model` as a Tensorflow SavedModel.
Note that at this time, subclassed models can only be saved using
`serving_only=True`.
The exported `SavedModel` is a standalone serialization of Tensorflow objects,
and is supported by TF language APIs and the Tensorflow Serving system.
To load the mod... | Exports a `tf.keras.Model` as a Tensorflow SavedModel. | [
"Exports",
"a",
"tf",
".",
"keras",
".",
"Model",
"as",
"a",
"Tensorflow",
"SavedModel",
"."
] | def export_saved_model(model,
saved_model_path,
custom_objects=None,
as_text=False,
input_signature=None,
serving_only=False):
"""Exports a `tf.keras.Model` as a Tensorflow SavedModel.
Note that at th... | [
"def",
"export_saved_model",
"(",
"model",
",",
"saved_model_path",
",",
"custom_objects",
"=",
"None",
",",
"as_text",
"=",
"False",
",",
"input_signature",
"=",
"None",
",",
"serving_only",
"=",
"False",
")",
":",
"warnings",
".",
"warn",
"(",
"'`tf.keras.ex... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saved_model_experimental.py#L64-L145 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozboot/mozboot/base.py | python | BaseBootstrapper.upgrade_python | (self, current) | Upgrade Python.
Child classes should reimplement this. | Upgrade Python. | [
"Upgrade",
"Python",
"."
] | def upgrade_python(self, current):
"""Upgrade Python.
Child classes should reimplement this.
"""
print(PYTHON_UNABLE_UPGRADE % (current, MODERN_PYTHON_VERSION)) | [
"def",
"upgrade_python",
"(",
"self",
",",
"current",
")",
":",
"print",
"(",
"PYTHON_UNABLE_UPGRADE",
"%",
"(",
"current",
",",
"MODERN_PYTHON_VERSION",
")",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozboot/mozboot/base.py#L294-L299 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | SimBody.isEnabled | (self) | return _robotsim.SimBody_isEnabled(self) | isEnabled(SimBody self) -> bool
Returns true if this body is being simulated. | isEnabled(SimBody self) -> bool | [
"isEnabled",
"(",
"SimBody",
"self",
")",
"-",
">",
"bool"
] | def isEnabled(self):
"""
isEnabled(SimBody self) -> bool
Returns true if this body is being simulated.
"""
return _robotsim.SimBody_isEnabled(self) | [
"def",
"isEnabled",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"SimBody_isEnabled",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L7867-L7876 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/models/rnn/translate/seq2seq_model.py | python | Seq2SeqModel.__init__ | (self, source_vocab_size, target_vocab_size, buckets, size,
num_layers, max_gradient_norm, batch_size, learning_rate,
learning_rate_decay_factor, use_lstm=False,
num_samples=512, forward_only=False) | Create the model.
Args:
source_vocab_size: size of the source vocabulary.
target_vocab_size: size of the target vocabulary.
buckets: a list of pairs (I, O), where I specifies maximum input length
that will be processed in that bucket, and O specifies maximum output
length. Trainin... | Create the model. | [
"Create",
"the",
"model",
"."
] | def __init__(self, source_vocab_size, target_vocab_size, buckets, size,
num_layers, max_gradient_norm, batch_size, learning_rate,
learning_rate_decay_factor, use_lstm=False,
num_samples=512, forward_only=False):
"""Create the model.
Args:
source_vocab_size: si... | [
"def",
"__init__",
"(",
"self",
",",
"source_vocab_size",
",",
"target_vocab_size",
",",
"buckets",
",",
"size",
",",
"num_layers",
",",
"max_gradient_norm",
",",
"batch_size",
",",
"learning_rate",
",",
"learning_rate_decay_factor",
",",
"use_lstm",
"=",
"False",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/models/rnn/translate/seq2seq_model.py#L46-L166 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/kfac/python/ops/optimizer.py | python | KfacOptimizer._clip_updates | (self, grads_and_vars, precon_grads_and_vars) | return [(pgrad * coeff, var) for pgrad, var in precon_grads_and_vars] | Rescales the preconditioned gradients to satisfy the norm constraint.
Rescales the preconditioned gradients such that the resulting update r
(after multiplying by the learning rate) will satisfy the norm constraint.
This constraint is that r^T F r <= C, where F is the approximate Fisher
matrix, and C i... | Rescales the preconditioned gradients to satisfy the norm constraint. | [
"Rescales",
"the",
"preconditioned",
"gradients",
"to",
"satisfy",
"the",
"norm",
"constraint",
"."
] | def _clip_updates(self, grads_and_vars, precon_grads_and_vars):
"""Rescales the preconditioned gradients to satisfy the norm constraint.
Rescales the preconditioned gradients such that the resulting update r
(after multiplying by the learning rate) will satisfy the norm constraint.
This constraint is t... | [
"def",
"_clip_updates",
"(",
"self",
",",
"grads_and_vars",
",",
"precon_grads_and_vars",
")",
":",
"coeff",
"=",
"self",
".",
"_update_clip_coeff",
"(",
"grads_and_vars",
",",
"precon_grads_and_vars",
")",
"return",
"[",
"(",
"pgrad",
"*",
"coeff",
",",
"var",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/kfac/python/ops/optimizer.py#L222-L242 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py | python | _iter_built_with_prepended | (installed, infos) | Iterator for ``FoundCandidates``.
This iterator is used when the resolver prefers the already-installed
candidate and NOT to upgrade. The installed candidate is therefore
always yielded first, and candidates from index come later in their
normal ordering, except skipped when the version is already... | Iterator for ``FoundCandidates``. | [
"Iterator",
"for",
"FoundCandidates",
"."
] | def _iter_built_with_prepended(installed, infos):
# type: (Candidate, Iterator[IndexCandidateInfo]) -> Iterator[Candidate]
"""Iterator for ``FoundCandidates``.
This iterator is used when the resolver prefers the already-installed
candidate and NOT to upgrade. The installed candidate is therefore
... | [
"def",
"_iter_built_with_prepended",
"(",
"installed",
",",
"infos",
")",
":",
"# type: (Candidate, Iterator[IndexCandidateInfo]) -> Iterator[Candidate]",
"yield",
"installed",
"versions_found",
"=",
"{",
"installed",
".",
"version",
"}",
"# type: Set[_BaseVersion]",
"for",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py#L89-L125 | ||
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py | python | SpawnBase.readline | (self, size=-1) | This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\\n) even on UNIX because
this is ... | This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\\n) even on UNIX because
this is ... | [
"This",
"reads",
"and",
"returns",
"one",
"entire",
"line",
".",
"The",
"newline",
"at",
"the",
"end",
"of",
"line",
"is",
"returned",
"as",
"part",
"of",
"the",
"string",
"unless",
"the",
"file",
"ends",
"without",
"a",
"newline",
".",
"An",
"empty",
... | def readline(self, size=-1):
'''This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\\... | [
"def",
"readline",
"(",
"self",
",",
"size",
"=",
"-",
"1",
")",
":",
"if",
"size",
"==",
"0",
":",
"return",
"self",
".",
"string_type",
"(",
")",
"# delimiter default is EOF",
"index",
"=",
"self",
".",
"expect",
"(",
"[",
"self",
".",
"crlf",
",",... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L459-L478 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/tools/grokdump.py | python | InspectionShell.do_do_map | (self, address) | Print a Map in a readable format. | Print a Map in a readable format. | [
"Print",
"a",
"Map",
"in",
"a",
"readable",
"format",
"."
] | def do_do_map(self, address):
"""
Print a Map in a readable format.
"""
start = self.ParseAddressExpr(address)
if ((start & 1) == 1): start = start - 1
Map(self.heap, None, start).Print(Printer()) | [
"def",
"do_do_map",
"(",
"self",
",",
"address",
")",
":",
"start",
"=",
"self",
".",
"ParseAddressExpr",
"(",
"address",
")",
"if",
"(",
"(",
"start",
"&",
"1",
")",
"==",
"1",
")",
":",
"start",
"=",
"start",
"-",
"1",
"Map",
"(",
"self",
".",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/grokdump.py#L3606-L3612 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/hashlib.py | python | __py_new | (name, data=b'', **kwargs) | return __get_builtin_constructor(name)(data, **kwargs) | new(name, data=b'', **kwargs) - Return a new hashing object using the
named algorithm; optionally initialized with data (which must be
a bytes-like object). | new(name, data=b'', **kwargs) - Return a new hashing object using the
named algorithm; optionally initialized with data (which must be
a bytes-like object). | [
"new",
"(",
"name",
"data",
"=",
"b",
"**",
"kwargs",
")",
"-",
"Return",
"a",
"new",
"hashing",
"object",
"using",
"the",
"named",
"algorithm",
";",
"optionally",
"initialized",
"with",
"data",
"(",
"which",
"must",
"be",
"a",
"bytes",
"-",
"like",
"o... | def __py_new(name, data=b'', **kwargs):
"""new(name, data=b'', **kwargs) - Return a new hashing object using the
named algorithm; optionally initialized with data (which must be
a bytes-like object).
"""
return __get_builtin_constructor(name)(data, **kwargs) | [
"def",
"__py_new",
"(",
"name",
",",
"data",
"=",
"b''",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"__get_builtin_constructor",
"(",
"name",
")",
"(",
"data",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/hashlib.py#L131-L136 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | constrain | (n, min, max) | return n | This returns a number, n constrained to the min and max bounds. | This returns a number, n constrained to the min and max bounds. | [
"This",
"returns",
"a",
"number",
"n",
"constrained",
"to",
"the",
"min",
"and",
"max",
"bounds",
"."
] | def constrain (n, min, max):
'''This returns a number, n constrained to the min and max bounds. '''
if n < min:
return min
if n > max:
return max
return n | [
"def",
"constrain",
"(",
"n",
",",
"min",
",",
"max",
")",
":",
"if",
"n",
"<",
"min",
":",
"return",
"min",
"if",
"n",
">",
"max",
":",
"return",
"max",
"return",
"n"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L60-L68 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/transports.py | python | WriteTransport.can_write_eof | (self) | Return True if this transport supports write_eof(), False if not. | Return True if this transport supports write_eof(), False if not. | [
"Return",
"True",
"if",
"this",
"transport",
"supports",
"write_eof",
"()",
"False",
"if",
"not",
"."
] | def can_write_eof(self):
"""Return True if this transport supports write_eof(), False if not."""
raise NotImplementedError | [
"def",
"can_write_eof",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/transports.py#L122-L124 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/packaging/py2/packaging/tags.py | python | parse_tag | (tag) | return frozenset(tags) | Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.
Returning a set is required due to the possibility that the tag is a
compressed tag set. | Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances. | [
"Parses",
"the",
"provided",
"tag",
"(",
"e",
".",
"g",
".",
"py3",
"-",
"none",
"-",
"any",
")",
"into",
"a",
"frozenset",
"of",
"Tag",
"instances",
"."
] | def parse_tag(tag):
# type: (str) -> FrozenSet[Tag]
"""
Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.
Returning a set is required due to the possibility that the tag is a
compressed tag set.
"""
tags = set()
interpreters, abis, platforms = tag.split("-... | [
"def",
"parse_tag",
"(",
"tag",
")",
":",
"# type: (str) -> FrozenSet[Tag]",
"tags",
"=",
"set",
"(",
")",
"interpreters",
",",
"abis",
",",
"platforms",
"=",
"tag",
".",
"split",
"(",
"\"-\"",
")",
"for",
"interpreter",
"in",
"interpreters",
".",
"split",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/packaging/py2/packaging/tags.py#L140-L154 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/EditorWindow.py | python | EditorWindow.set_notabs_indentwidth | (self) | Update the indentwidth if changed and not using tabs in this window | Update the indentwidth if changed and not using tabs in this window | [
"Update",
"the",
"indentwidth",
"if",
"changed",
"and",
"not",
"using",
"tabs",
"in",
"this",
"window"
] | def set_notabs_indentwidth(self):
"Update the indentwidth if changed and not using tabs in this window"
# Called from configDialog.py
if not self.usetabs:
self.indentwidth = idleConf.GetOption('main', 'Indent','num-spaces',
type='int'... | [
"def",
"set_notabs_indentwidth",
"(",
"self",
")",
":",
"# Called from configDialog.py",
"if",
"not",
"self",
".",
"usetabs",
":",
"self",
".",
"indentwidth",
"=",
"idleConf",
".",
"GetOption",
"(",
"'main'",
",",
"'Indent'",
",",
"'num-spaces'",
",",
"type",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/EditorWindow.py#L821-L826 | ||
google/nucleus | 68d3947fafba1337f294c0668a6e1c7f3f1273e3 | nucleus/util/variant_utils.py | python | variant_type | (variant) | Gets the VariantType of variant.
Args:
variant: nucleus.genomics.v1.Variant.
Returns:
VariantType indicating the type of this variant. | Gets the VariantType of variant. | [
"Gets",
"the",
"VariantType",
"of",
"variant",
"."
] | def variant_type(variant):
"""Gets the VariantType of variant.
Args:
variant: nucleus.genomics.v1.Variant.
Returns:
VariantType indicating the type of this variant.
"""
if is_ref(variant):
return VariantType.ref
elif is_snp(variant):
return VariantType.snp
else:
return VariantType.in... | [
"def",
"variant_type",
"(",
"variant",
")",
":",
"if",
"is_ref",
"(",
"variant",
")",
":",
"return",
"VariantType",
".",
"ref",
"elif",
"is_snp",
"(",
"variant",
")",
":",
"return",
"VariantType",
".",
"snp",
"else",
":",
"return",
"VariantType",
".",
"i... | https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/variant_utils.py#L317-L331 | ||
SeisSol/SeisSol | 955fbeb8c5d40d3363a2da0edc611259aebe1653 | preprocessing/science/kinematic_models/FaultPlane.py | python | FaultPlane.write_srf | (self, fname) | write kinematic model to a srf file (standard rutpure format) | write kinematic model to a srf file (standard rutpure format) | [
"write",
"kinematic",
"model",
"to",
"a",
"srf",
"file",
"(",
"standard",
"rutpure",
"format",
")"
] | def write_srf(self, fname):
"write kinematic model to a srf file (standard rutpure format)"
with open(fname, "w") as fout:
fout.write("1.0\n")
fout.write("POINTS %d\n" % (self.nx * self.ny))
for j in range(self.ny):
for i in range(self.nx):
... | [
"def",
"write_srf",
"(",
"self",
",",
"fname",
")",
":",
"with",
"open",
"(",
"fname",
",",
"\"w\"",
")",
"as",
"fout",
":",
"fout",
".",
"write",
"(",
"\"1.0\\n\"",
")",
"fout",
".",
"write",
"(",
"\"POINTS %d\\n\"",
"%",
"(",
"self",
".",
"nx",
"... | https://github.com/SeisSol/SeisSol/blob/955fbeb8c5d40d3363a2da0edc611259aebe1653/preprocessing/science/kinematic_models/FaultPlane.py#L305-L316 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.