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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathGeom.py | python | Side.toString | (cls, side) | return "On" | toString(side)
Returns a string representation of the enum value. | toString(side)
Returns a string representation of the enum value. | [
"toString",
"(",
"side",
")",
"Returns",
"a",
"string",
"representation",
"of",
"the",
"enum",
"value",
"."
] | def toString(cls, side):
"""toString(side)
Returns a string representation of the enum value."""
if side == cls.Left:
return "Left"
if side == cls.Right:
return "Right"
return "On" | [
"def",
"toString",
"(",
"cls",
",",
"side",
")",
":",
"if",
"side",
"==",
"cls",
".",
"Left",
":",
"return",
"\"Left\"",
"if",
"side",
"==",
"cls",
".",
"Right",
":",
"return",
"\"Right\"",
"return",
"\"On\""
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathGeom.py#L62-L69 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/command/build_py.py | python | build_py.__getattr__ | (self, attr) | return orig.build_py.__getattr__(self, attr) | lazily compute data files | lazily compute data files | [
"lazily",
"compute",
"data",
"files"
] | def __getattr__(self, attr):
"lazily compute data files"
if attr == 'data_files':
self.data_files = self._get_data_files()
return self.data_files
return orig.build_py.__getattr__(self, attr) | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"if",
"attr",
"==",
"'data_files'",
":",
"self",
".",
"data_files",
"=",
"self",
".",
"_get_data_files",
"(",
")",
"return",
"self",
".",
"data_files",
"return",
"orig",
".",
"build_py",
".",
"__g... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/command/build_py.py#L63-L68 | |
kevinlin311tw/cvpr16-deepbit | c60fb3233d7d534cfcee9d3ed47d77af437ee32a | scripts/cpp_lint.py | python | ReplaceAll | (pattern, rep, s) | return _regexp_compile_cache[pattern].sub(rep, s) | Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if no replacements) | Replaces instances of pattern in a string with a replacement. | [
"Replaces",
"instances",
"of",
"pattern",
"in",
"a",
"string",
"with",
"a",
"replacement",
"."
] | def ReplaceAll(pattern, rep, s):
"""Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if... | [
"def",
"ReplaceAll",
"(",
"pattern",
",",
"rep",
",",
"s",
")",
":",
"if",
"pattern",
"not",
"in",
"_regexp_compile_cache",
":",
"_regexp_compile_cache",
"[",
"pattern",
"]",
"=",
"sre_compile",
".",
"compile",
"(",
"pattern",
")",
"return",
"_regexp_compile_c... | https://github.com/kevinlin311tw/cvpr16-deepbit/blob/c60fb3233d7d534cfcee9d3ed47d77af437ee32a/scripts/cpp_lint.py#L525-L540 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | OptionMenu.__init__ | (self, master, variable, value, *values, **kwargs) | Construct an optionmenu widget with the parent MASTER, with
the resource textvariable set to VARIABLE, the initially selected
value VALUE, the other menu values VALUES and an additional
keyword argument command. | Construct an optionmenu widget with the parent MASTER, with
the resource textvariable set to VARIABLE, the initially selected
value VALUE, the other menu values VALUES and an additional
keyword argument command. | [
"Construct",
"an",
"optionmenu",
"widget",
"with",
"the",
"parent",
"MASTER",
"with",
"the",
"resource",
"textvariable",
"set",
"to",
"VARIABLE",
"the",
"initially",
"selected",
"value",
"VALUE",
"the",
"other",
"menu",
"values",
"VALUES",
"and",
"an",
"addition... | def __init__(self, master, variable, value, *values, **kwargs):
"""Construct an optionmenu widget with the parent MASTER, with
the resource textvariable set to VARIABLE, the initially selected
value VALUE, the other menu values VALUES and an additional
keyword argument command."""
... | [
"def",
"__init__",
"(",
"self",
",",
"master",
",",
"variable",
",",
"value",
",",
"*",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"kw",
"=",
"{",
"\"borderwidth\"",
":",
"2",
",",
"\"textvariable\"",
":",
"variable",
",",
"\"indicatoron\"",
":",
"1"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L3446-L3469 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/labelbook.py | python | LabelContainer.Resize | (self, event) | Actually resizes the tab area.
:param `event`: an instance of :class:`SizeEvent`. | Actually resizes the tab area. | [
"Actually",
"resizes",
"the",
"tab",
"area",
"."
] | def Resize(self, event):
"""
Actually resizes the tab area.
:param `event`: an instance of :class:`SizeEvent`.
"""
# Resize our size
self._tabAreaSize = self.GetSize()
newWidth = self._tabAreaSize.x
x = event.GetX()
if self.HasAGWFlag(INB_BOTTOM... | [
"def",
"Resize",
"(",
"self",
",",
"event",
")",
":",
"# Resize our size",
"self",
".",
"_tabAreaSize",
"=",
"self",
".",
"GetSize",
"(",
")",
"newWidth",
"=",
"self",
".",
"_tabAreaSize",
".",
"x",
"x",
"=",
"event",
".",
"GetX",
"(",
")",
"if",
"se... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/labelbook.py#L1761-L1790 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Wm.wm_iconposition | (self, x=None, y=None) | return self._getints(self.tk.call(
'wm', 'iconposition', self._w, x, y)) | Set the position of the icon of this widget to X and Y. Return
a tuple of the current values of X and X if None is given. | Set the position of the icon of this widget to X and Y. Return
a tuple of the current values of X and X if None is given. | [
"Set",
"the",
"position",
"of",
"the",
"icon",
"of",
"this",
"widget",
"to",
"X",
"and",
"Y",
".",
"Return",
"a",
"tuple",
"of",
"the",
"current",
"values",
"of",
"X",
"and",
"X",
"if",
"None",
"is",
"given",
"."
] | def wm_iconposition(self, x=None, y=None):
"""Set the position of the icon of this widget to X and Y. Return
a tuple of the current values of X and X if None is given."""
return self._getints(self.tk.call(
'wm', 'iconposition', self._w, x, y)) | [
"def",
"wm_iconposition",
"(",
"self",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
")",
":",
"return",
"self",
".",
"_getints",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'wm'",
",",
"'iconposition'",
",",
"self",
".",
"_w",
",",
"x",
",",
"y",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L1912-L1916 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py | python | WorkingSet.add_entry | (self, entry) | Add a path item to ``.entries``, finding any distributions on it
``find_distributions(entry, True)`` is used to find distributions
corresponding to the path entry, and they are added. `entry` is
always appended to ``.entries``, even if it is already present.
(This is because ``sys.path... | Add a path item to ``.entries``, finding any distributions on it | [
"Add",
"a",
"path",
"item",
"to",
".",
"entries",
"finding",
"any",
"distributions",
"on",
"it"
] | def add_entry(self, entry):
"""Add a path item to ``.entries``, finding any distributions on it
``find_distributions(entry, True)`` is used to find distributions
corresponding to the path entry, and they are added. `entry` is
always appended to ``.entries``, even if it is already prese... | [
"def",
"add_entry",
"(",
"self",
",",
"entry",
")",
":",
"self",
".",
"entry_keys",
".",
"setdefault",
"(",
"entry",
",",
"[",
"]",
")",
"self",
".",
"entries",
".",
"append",
"(",
"entry",
")",
"for",
"dist",
"in",
"find_distributions",
"(",
"entry",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L661-L674 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/auth.py | python | HTTPDigestAuth.handle_redirect | (self, r, **kwargs) | Reset num_401_calls counter on redirects. | Reset num_401_calls counter on redirects. | [
"Reset",
"num_401_calls",
"counter",
"on",
"redirects",
"."
] | def handle_redirect(self, r, **kwargs):
"""Reset num_401_calls counter on redirects."""
if r.is_redirect:
self.num_401_calls = 1 | [
"def",
"handle_redirect",
"(",
"self",
",",
"r",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"r",
".",
"is_redirect",
":",
"self",
".",
"num_401_calls",
"=",
"1"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/auth.py#L158-L161 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py | python | IndexCol.__eq__ | (self, other: Any) | return all(
getattr(self, a, None) == getattr(other, a, None)
for a in ["name", "cname", "axis", "pos"]
) | compare 2 col items | compare 2 col items | [
"compare",
"2",
"col",
"items"
] | def __eq__(self, other: Any) -> bool:
""" compare 2 col items """
return all(
getattr(self, a, None) == getattr(other, a, None)
for a in ["name", "cname", "axis", "pos"]
) | [
"def",
"__eq__",
"(",
"self",
",",
"other",
":",
"Any",
")",
"->",
"bool",
":",
"return",
"all",
"(",
"getattr",
"(",
"self",
",",
"a",
",",
"None",
")",
"==",
"getattr",
"(",
"other",
",",
"a",
",",
"None",
")",
"for",
"a",
"in",
"[",
"\"name\... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L1925-L1930 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/gradients_impl.py | python | _VerifyGeneratedGradients | (grads, op) | Verify that gradients are valid in number and type.
Args:
grads: List of generated gradients.
op: Operation for which the gradients where generated.
Raises:
ValueError: if sizes of gradients and inputs don't match.
TypeError: if type of any gradient is not valid for its input. | Verify that gradients are valid in number and type. | [
"Verify",
"that",
"gradients",
"are",
"valid",
"in",
"number",
"and",
"type",
"."
] | def _VerifyGeneratedGradients(grads, op):
"""Verify that gradients are valid in number and type.
Args:
grads: List of generated gradients.
op: Operation for which the gradients where generated.
Raises:
ValueError: if sizes of gradients and inputs don't match.
TypeError: if type of any gradient i... | [
"def",
"_VerifyGeneratedGradients",
"(",
"grads",
",",
"op",
")",
":",
"if",
"len",
"(",
"grads",
")",
"!=",
"len",
"(",
"op",
".",
"inputs",
")",
":",
"raise",
"ValueError",
"(",
"\"Num gradients %d generated for op %s do not match num \"",
"\"inputs %d\"",
"%",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/gradients_impl.py#L286-L299 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/decimal.py | python | Context.compare_total | (self, a, b) | return a.compare_total(b) | Compares two operands using their abstract representation.
This is not like the standard compare, which use their numerical
value. Note that a total ordering is defined for all possible abstract
representations.
>>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
... | Compares two operands using their abstract representation. | [
"Compares",
"two",
"operands",
"using",
"their",
"abstract",
"representation",
"."
] | def compare_total(self, a, b):
"""Compares two operands using their abstract representation.
This is not like the standard compare, which use their numerical
value. Note that a total ordering is defined for all possible abstract
representations.
>>> ExtendedContext.compare_tota... | [
"def",
"compare_total",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"compare_total",
"(",
"b",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/decimal.py#L4084-L4111 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/affine/binary_operators.py | python | multiply.numeric | (self, values) | Multiplies the values elementwise. | Multiplies the values elementwise. | [
"Multiplies",
"the",
"values",
"elementwise",
"."
] | def numeric(self, values):
"""Multiplies the values elementwise.
"""
if sp.issparse(values[0]):
return values[0].multiply(values[1])
elif sp.issparse(values[1]):
return values[1].multiply(values[0])
else:
return np.multiply(values[0], values[1]... | [
"def",
"numeric",
"(",
"self",
",",
"values",
")",
":",
"if",
"sp",
".",
"issparse",
"(",
"values",
"[",
"0",
"]",
")",
":",
"return",
"values",
"[",
"0",
"]",
".",
"multiply",
"(",
"values",
"[",
"1",
"]",
")",
"elif",
"sp",
".",
"issparse",
"... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/binary_operators.py#L265-L273 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/odr/odrpack.py | python | ODR.restart | (self, iter=None) | return self.run() | Restarts the run with iter more iterations.
Parameters
----------
iter : int, optional
ODRPACK's default for the number of new iterations is 10.
Returns
-------
output : Output instance
This object is also assigned to the attribute .output . | Restarts the run with iter more iterations. | [
"Restarts",
"the",
"run",
"with",
"iter",
"more",
"iterations",
"."
] | def restart(self, iter=None):
""" Restarts the run with iter more iterations.
Parameters
----------
iter : int, optional
ODRPACK's default for the number of new iterations is 10.
Returns
-------
output : Output instance
This object is als... | [
"def",
"restart",
"(",
"self",
",",
"iter",
"=",
"None",
")",
":",
"if",
"self",
".",
"output",
"is",
"None",
":",
"raise",
"OdrError",
"(",
"\"cannot restart: run() has not been called before\"",
")",
"self",
".",
"set_job",
"(",
"restart",
"=",
"1",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/odr/odrpack.py#L1107-L1130 | |
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | python/ikfast.py | python | IKFastSolver.iterateThreeNonIntersectingAxes | (self, solvejointvars, Links, LinksInv) | check for three consecutive non-intersecting axes.
if several points exist, so have to choose one that is least complex? | check for three consecutive non-intersecting axes.
if several points exist, so have to choose one that is least complex? | [
"check",
"for",
"three",
"consecutive",
"non",
"-",
"intersecting",
"axes",
".",
"if",
"several",
"points",
"exist",
"so",
"have",
"to",
"choose",
"one",
"that",
"is",
"least",
"complex?"
] | def iterateThreeNonIntersectingAxes(self, solvejointvars, Links, LinksInv):
"""check for three consecutive non-intersecting axes.
if several points exist, so have to choose one that is least complex?
"""
ilinks = [i for i,Tlink in enumerate(Links) if self.has(Tlink,*solvejointvars)]
... | [
"def",
"iterateThreeNonIntersectingAxes",
"(",
"self",
",",
"solvejointvars",
",",
"Links",
",",
"LinksInv",
")",
":",
"ilinks",
"=",
"[",
"i",
"for",
"i",
",",
"Tlink",
"in",
"enumerate",
"(",
"Links",
")",
"if",
"self",
".",
"has",
"(",
"Tlink",
",",
... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/ikfast.py#L3146-L3170 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | net/tools/quic/benchmark/run_client.py | python | PageloadExperiment.__init__ | (self, use_wget, quic_binary_dir, quic_server_address,
quic_server_port) | Initialize PageloadExperiment.
Args:
use_wget: Whether to use wget.
quic_binary_dir: Directory for quic_binary.
quic_server_address: IP address of quic server.
quic_server_port: Port of the quic server. | Initialize PageloadExperiment. | [
"Initialize",
"PageloadExperiment",
"."
] | def __init__(self, use_wget, quic_binary_dir, quic_server_address,
quic_server_port):
"""Initialize PageloadExperiment.
Args:
use_wget: Whether to use wget.
quic_binary_dir: Directory for quic_binary.
quic_server_address: IP address of quic server.
quic_server_port: Port ... | [
"def",
"__init__",
"(",
"self",
",",
"use_wget",
",",
"quic_binary_dir",
",",
"quic_server_address",
",",
"quic_server_port",
")",
":",
"self",
".",
"use_wget",
"=",
"use_wget",
"self",
".",
"quic_binary_dir",
"=",
"quic_binary_dir",
"self",
".",
"quic_server_addr... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/net/tools/quic/benchmark/run_client.py#L44-L60 | ||
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/tensor.py | python | LazyValues.load | (self) | return np.array(onnx.numpy_helper.to_array(self.tensor)) | Load a numpy array from the underlying tensor values.
Returns:
np.array: A numpy array containing the values of the tensor. | Load a numpy array from the underlying tensor values. | [
"Load",
"a",
"numpy",
"array",
"from",
"the",
"underlying",
"tensor",
"values",
"."
] | def load(self):
"""
Load a numpy array from the underlying tensor values.
Returns:
np.array: A numpy array containing the values of the tensor.
"""
import onnx
import onnx.numpy_helper
return np.array(onnx.numpy_helper.to_array(self.tensor)) | [
"def",
"load",
"(",
"self",
")",
":",
"import",
"onnx",
"import",
"onnx",
".",
"numpy_helper",
"return",
"np",
".",
"array",
"(",
"onnx",
".",
"numpy_helper",
".",
"to_array",
"(",
"self",
".",
"tensor",
")",
")"
] | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/tensor.py#L196-L206 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | CondCore/Utilities/python/CondDBFW/uploads.py | python | uploader.get_hashes_to_send | (self, upload_session_id) | return response | Get the hashes of the payloads we want to send that the server doesn't have yet. | Get the hashes of the payloads we want to send that the server doesn't have yet. | [
"Get",
"the",
"hashes",
"of",
"the",
"payloads",
"we",
"want",
"to",
"send",
"that",
"the",
"server",
"doesn",
"t",
"have",
"yet",
"."
] | def get_hashes_to_send(self, upload_session_id):
"""
Get the hashes of the payloads we want to send that the server doesn't have yet.
"""
self._outputter.write("Getting list of hashes that the server does not have Payloads for, to send to server.")
post_data = json.dumps(self.get_all_hashes())
url_data = {"... | [
"def",
"get_hashes_to_send",
"(",
"self",
",",
"upload_session_id",
")",
":",
"self",
".",
"_outputter",
".",
"write",
"(",
"\"Getting list of hashes that the server does not have Payloads for, to send to server.\"",
")",
"post_data",
"=",
"json",
".",
"dumps",
"(",
"self... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CondCore/Utilities/python/CondDBFW/uploads.py#L625-L634 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/decomposition/nmf.py | python | _update_projected_gradient_h | (X, W, H, tolH, nls_max_iter, alpha, l1_ratio,
sparseness, beta, eta) | return H, gradH, iterH | Helper function for _fit_projected_gradient | Helper function for _fit_projected_gradient | [
"Helper",
"function",
"for",
"_fit_projected_gradient"
] | def _update_projected_gradient_h(X, W, H, tolH, nls_max_iter, alpha, l1_ratio,
sparseness, beta, eta):
"""Helper function for _fit_projected_gradient"""
n_samples, n_features = X.shape
n_components_ = W.shape[1]
if sparseness is None:
H, gradH, iterH = _nls_subp... | [
"def",
"_update_projected_gradient_h",
"(",
"X",
",",
"W",
",",
"H",
",",
"tolH",
",",
"nls_max_iter",
",",
"alpha",
",",
"l1_ratio",
",",
"sparseness",
",",
"beta",
",",
"eta",
")",
":",
"n_samples",
",",
"n_features",
"=",
"X",
".",
"shape",
"n_compone... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/decomposition/nmf.py#L374-L395 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Pen.GetDashes | (*args, **kwargs) | return _gdi_.Pen_GetDashes(*args, **kwargs) | GetDashes(self) -> PyObject | GetDashes(self) -> PyObject | [
"GetDashes",
"(",
"self",
")",
"-",
">",
"PyObject"
] | def GetDashes(*args, **kwargs):
"""GetDashes(self) -> PyObject"""
return _gdi_.Pen_GetDashes(*args, **kwargs) | [
"def",
"GetDashes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Pen_GetDashes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L449-L451 | |
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.AdjustIncludeDirs | (self, include_dirs, config) | return [self.ConvertVSMacros(p, config=config) for p in includes] | Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar. | Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar. | [
"Updates",
"include_dirs",
"to",
"expand",
"VS",
"specific",
"paths",
"and",
"adds",
"the",
"system",
"include",
"dirs",
"used",
"for",
"platform",
"SDK",
"and",
"similar",
"."
] | def AdjustIncludeDirs(self, include_dirs, config):
"""Updates include_dirs to expand VS specific paths, and adds the system
include dirs used for platform SDK and similar."""
config = self._TargetConfig(config)
includes = include_dirs + self.msvs_system_include_dirs[config]
includes.extend(self._Set... | [
"def",
"AdjustIncludeDirs",
"(",
"self",
",",
"include_dirs",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"includes",
"=",
"include_dirs",
"+",
"self",
".",
"msvs_system_include_dirs",
"[",
"config",
"]",
"includes... | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/msvs_emulation.py#L279-L286 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | build/android/android_commands.py | python | AndroidCommands.SearchLogcatRecord | (self, record, message, thread_id=None, proc_id=None,
log_level=None, component=None) | return results | Searches the specified logcat output and returns results.
This method searches through the logcat output specified by record for a
certain message, narrowing results by matching them against any other
specified criteria. It returns all matching lines as described below.
Args:
record: A string g... | Searches the specified logcat output and returns results. | [
"Searches",
"the",
"specified",
"logcat",
"output",
"and",
"returns",
"results",
"."
] | def SearchLogcatRecord(self, record, message, thread_id=None, proc_id=None,
log_level=None, component=None):
"""Searches the specified logcat output and returns results.
This method searches through the logcat output specified by record for a
certain message, narrowing results by m... | [
"def",
"SearchLogcatRecord",
"(",
"self",
",",
"record",
",",
"message",
",",
"thread_id",
"=",
"None",
",",
"proc_id",
"=",
"None",
",",
"log_level",
"=",
"None",
",",
"component",
"=",
"None",
")",
":",
"if",
"thread_id",
":",
"thread_id",
"=",
"str",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/build/android/android_commands.py#L629-L666 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/sandbox.py | python | AbstractSandbox._remap_output | (self, operation, path) | return self._validate_path(path) | Called for path outputs | Called for path outputs | [
"Called",
"for",
"path",
"outputs"
] | def _remap_output(self, operation, path):
"""Called for path outputs"""
return self._validate_path(path) | [
"def",
"_remap_output",
"(",
"self",
",",
"operation",
",",
"path",
")",
":",
"return",
"self",
".",
"_validate_path",
"(",
"path",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/sandbox.py#L390-L392 | |
Kronuz/Xapiand | a71570859dcfc9f48090d845053f359b07f4f78c | contrib/python/xapiand-py/xapiand/client/documents.py | python | DocumentsClient.upsert | (self, index, id, body=None, content_type=None, params=None) | return self.transport.perform_request('UPSERT', make_url(index, id=id),
params=params, body=body,
headers=content_type and {'content-type': content_type}) | Update or create a document based on a partial data provided.
:arg index: The name of the index
:arg id: Document ID
:arg body: The request definition using a partial `doc`
:arg selector: A comma-separated list of fields to return in the response
:arg timeout: Explicit operation... | Update or create a document based on a partial data provided. | [
"Update",
"or",
"create",
"a",
"document",
"based",
"on",
"a",
"partial",
"data",
"provided",
"."
] | def upsert(self, index, id, body=None, content_type=None, params=None):
"""
Update or create a document based on a partial data provided.
:arg index: The name of the index
:arg id: Document ID
:arg body: The request definition using a partial `doc`
:arg selector: A comma... | [
"def",
"upsert",
"(",
"self",
",",
"index",
",",
"id",
",",
"body",
"=",
"None",
",",
"content_type",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"index",
",",
"id",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
... | https://github.com/Kronuz/Xapiand/blob/a71570859dcfc9f48090d845053f359b07f4f78c/contrib/python/xapiand-py/xapiand/client/documents.py#L64-L79 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/context.py | python | get_log_device_placement | () | return context().log_device_placement | Get if device placements are logged.
Returns:
If device placements are logged. | Get if device placements are logged. | [
"Get",
"if",
"device",
"placements",
"are",
"logged",
"."
] | def get_log_device_placement():
"""Get if device placements are logged.
Returns:
If device placements are logged.
"""
return context().log_device_placement | [
"def",
"get_log_device_placement",
"(",
")",
":",
"return",
"context",
"(",
")",
".",
"log_device_placement"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L2348-L2354 | |
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | tools/clang/tools/scan-build-py/libear/__init__.py | python | Toolset.set_language_standard | (self, standard) | part of public interface | part of public interface | [
"part",
"of",
"public",
"interface"
] | def set_language_standard(self, standard):
""" part of public interface """
self.c_flags.append('-std=' + standard) | [
"def",
"set_language_standard",
"(",
"self",
",",
"standard",
")",
":",
"self",
".",
"c_flags",
".",
"append",
"(",
"'-std='",
"+",
"standard",
")"
] | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/tools/scan-build-py/libear/__init__.py#L91-L93 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/apps/service.py | python | AppsService.GetGeneratorFromLinkFinder | (self, link_finder, func,
num_retries=gdata.service.DEFAULT_NUM_RETRIES,
delay=gdata.service.DEFAULT_DELAY,
backoff=gdata.service.DEFAULT_BACKOFF) | returns a generator for pagination | returns a generator for pagination | [
"returns",
"a",
"generator",
"for",
"pagination"
] | def GetGeneratorFromLinkFinder(self, link_finder, func,
num_retries=gdata.service.DEFAULT_NUM_RETRIES,
delay=gdata.service.DEFAULT_DELAY,
backoff=gdata.service.DEFAULT_BACKOFF):
"""returns a generator for pagination"... | [
"def",
"GetGeneratorFromLinkFinder",
"(",
"self",
",",
"link_finder",
",",
"func",
",",
"num_retries",
"=",
"gdata",
".",
"service",
".",
"DEFAULT_NUM_RETRIES",
",",
"delay",
"=",
"gdata",
".",
"service",
".",
"DEFAULT_DELAY",
",",
"backoff",
"=",
"gdata",
"."... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/apps/service.py#L107-L118 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/objpanel.py | python | NaviPanelMixin.refresh_panel | (self, obj=None, id=None, ids=None, **kwargs) | return None | Deletes previous conents
Builds panel for obj
Updates path window and history | Deletes previous conents
Builds panel for obj
Updates path window and history | [
"Deletes",
"previous",
"conents",
"Builds",
"panel",
"for",
"obj",
"Updates",
"path",
"window",
"and",
"history"
] | def refresh_panel(self, obj=None, id=None, ids=None, **kwargs):
"""
Deletes previous conents
Builds panel for obj
Updates path window and history
"""
if obj is None:
if self.get_obj() == self._defaultobj:
return None # no changes
... | [
"def",
"refresh_panel",
"(",
"self",
",",
"obj",
"=",
"None",
",",
"id",
"=",
"None",
",",
"ids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"obj",
"is",
"None",
":",
"if",
"self",
".",
"get_obj",
"(",
")",
"==",
"self",
".",
"_defau... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py#L4051-L4123 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/six.py | python | remove_move | (name) | Remove item from six.moves. | Remove item from six.moves. | [
"Remove",
"item",
"from",
"six",
".",
"moves",
"."
] | def remove_move(name):
"""Remove item from six.moves."""
try:
delattr(_MovedItems, name)
except AttributeError:
try:
del moves.__dict__[name]
except KeyError:
raise AttributeError("no such move, %r" % (name,)) | [
"def",
"remove_move",
"(",
"name",
")",
":",
"try",
":",
"delattr",
"(",
"_MovedItems",
",",
"name",
")",
"except",
"AttributeError",
":",
"try",
":",
"del",
"moves",
".",
"__dict__",
"[",
"name",
"]",
"except",
"KeyError",
":",
"raise",
"AttributeError",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/six.py#L497-L505 | ||
vgteam/vg | cf4d516a5e9ee5163c783e4437ddf16b18a4b561 | scripts/filter_variants_on_repeats.py | python | entrypoint | () | 0-argument entry point for setuptools to call. | 0-argument entry point for setuptools to call. | [
"0",
"-",
"argument",
"entry",
"point",
"for",
"setuptools",
"to",
"call",
"."
] | def entrypoint():
"""
0-argument entry point for setuptools to call.
"""
# Provide main with its arguments and handle exit codes
sys.exit(main(sys.argv)) | [
"def",
"entrypoint",
"(",
")",
":",
"# Provide main with its arguments and handle exit codes",
"sys",
".",
"exit",
"(",
"main",
"(",
"sys",
".",
"argv",
")",
")"
] | https://github.com/vgteam/vg/blob/cf4d516a5e9ee5163c783e4437ddf16b18a4b561/scripts/filter_variants_on_repeats.py#L207-L213 | ||
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/optimal_learning/python/python_version/expected_improvement.py | python | ExpectedImprovement.__init__ | (
self,
gaussian_process,
points_to_sample=None,
points_being_sampled=None,
num_mc_iterations=DEFAULT_EXPECTED_IMPROVEMENT_MC_ITERATIONS,
randomness=None,
mvndst_parameters=None
) | Construct an ExpectedImprovement object that supports q,p-EI.
TODO(GH-56): Allow callers to pass in a source of randomness.
:param gaussian_process: GaussianProcess describing
:type gaussian_process: interfaces.gaussian_process_interface.GaussianProcessInterface subclass
:param points_... | Construct an ExpectedImprovement object that supports q,p-EI. | [
"Construct",
"an",
"ExpectedImprovement",
"object",
"that",
"supports",
"q",
"p",
"-",
"EI",
"."
] | def __init__(
self,
gaussian_process,
points_to_sample=None,
points_being_sampled=None,
num_mc_iterations=DEFAULT_EXPECTED_IMPROVEMENT_MC_ITERATIONS,
randomness=None,
mvndst_parameters=None
):
"""Construct an ExpectedImprove... | [
"def",
"__init__",
"(",
"self",
",",
"gaussian_process",
",",
"points_to_sample",
"=",
"None",
",",
"points_being_sampled",
"=",
"None",
",",
"num_mc_iterations",
"=",
"DEFAULT_EXPECTED_IMPROVEMENT_MC_ITERATIONS",
",",
"randomness",
"=",
"None",
",",
"mvndst_parameters"... | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/python_version/expected_improvement.py#L149-L196 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/function.py | python | _shape_relaxed_type_for_composite_tensor | (x) | Returns a shape-relaxed TypeSpec for x (if composite) or x (if not). | Returns a shape-relaxed TypeSpec for x (if composite) or x (if not). | [
"Returns",
"a",
"shape",
"-",
"relaxed",
"TypeSpec",
"for",
"x",
"(",
"if",
"composite",
")",
"or",
"x",
"(",
"if",
"not",
")",
"."
] | def _shape_relaxed_type_for_composite_tensor(x):
"""Returns a shape-relaxed TypeSpec for x (if composite) or x (if not)."""
if isinstance(x, composite_tensor.CompositeTensor):
# pylint: disable=protected-access
return x._type_spec._with_tensor_ranks_only()
else:
return x | [
"def",
"_shape_relaxed_type_for_composite_tensor",
"(",
"x",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"composite_tensor",
".",
"CompositeTensor",
")",
":",
"# pylint: disable=protected-access",
"return",
"x",
".",
"_type_spec",
".",
"_with_tensor_ranks_only",
"(",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/function.py#L119-L125 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/tensor_forest/python/tensor_forest.py | python | RandomForestGraphs.inference_graph | (self, input_data, **inference_args) | Constructs a TF graph for evaluating a random forest.
Args:
input_data: A tensor or dict of string->Tensor for the input data.
This input_data must generate the same spec as the
input_data used in training_graph: the dict must have
the same keys, for exa... | Constructs a TF graph for evaluating a random forest. | [
"Constructs",
"a",
"TF",
"graph",
"for",
"evaluating",
"a",
"random",
"forest",
"."
] | def inference_graph(self, input_data, **inference_args):
"""Constructs a TF graph for evaluating a random forest.
Args:
input_data: A tensor or dict of string->Tensor for the input data.
This input_data must generate the same spec as the
input_data used in training_gra... | [
"def",
"inference_graph",
"(",
"self",
",",
"input_data",
",",
"*",
"*",
"inference_args",
")",
":",
"processed_dense_features",
",",
"processed_sparse_features",
",",
"data_spec",
"=",
"(",
"data_ops",
".",
"ParseDataTensorOrDict",
"(",
"input_data",
")",
")",
"p... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/tensor_forest/python/tensor_forest.py#L469-L523 | ||
OAID/Tengine | 66b2c22ad129d25e2fc6de3b22a608bb54dd90db | tools/optimize/yolov3-opt.py | python | cut_nodes_input_output | (node, cut_names) | del nodes from input nodes
Args:
node: the nodes of ONNX model
Returns:
optimized graph nodes(inplace) | del nodes from input nodes
Args:
node: the nodes of ONNX model
Returns:
optimized graph nodes(inplace) | [
"del",
"nodes",
"from",
"input",
"nodes",
"Args",
":",
"node",
":",
"the",
"nodes",
"of",
"ONNX",
"model",
"Returns",
":",
"optimized",
"graph",
"nodes",
"(",
"inplace",
")"
] | def cut_nodes_input_output(node, cut_names):
"""
del nodes from input nodes
Args:
node: the nodes of ONNX model
Returns:
optimized graph nodes(inplace)
"""
for i in range(len(node) - 1, -1, -1):
if node[i].name in cut_names:
node.pop(i) | [
"def",
"cut_nodes_input_output",
"(",
"node",
",",
"cut_names",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"node",
")",
"-",
"1",
",",
"-",
"1",
",",
"-",
"1",
")",
":",
"if",
"node",
"[",
"i",
"]",
".",
"name",
"in",
"cut_names",
":... | https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/tools/optimize/yolov3-opt.py#L96-L106 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/tokenutil.py | python | GetIdentifierForToken | (token) | Get the symbol specified by a token.
Given a token, this function additionally concatenates any parts of an
identifying symbol being identified that are split by whitespace or a
newline.
The function will return None if the token is not the first token of an
identifier.
Args:
token: The first token o... | Get the symbol specified by a token. | [
"Get",
"the",
"symbol",
"specified",
"by",
"a",
"token",
"."
] | def GetIdentifierForToken(token):
"""Get the symbol specified by a token.
Given a token, this function additionally concatenates any parts of an
identifying symbol being identified that are split by whitespace or a
newline.
The function will return None if the token is not the first token of an
identifier... | [
"def",
"GetIdentifierForToken",
"(",
"token",
")",
":",
"# Search backward to determine if this token is the first token of the",
"# identifier. If it is not the first token, return None to signal that this",
"# token should be ignored.",
"prev_token",
"=",
"token",
".",
"previous",
"whi... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/tokenutil.py#L573-L654 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Misc.grab_current | (self) | return self._nametowidget(name) | Return widget which has currently the grab in this application
or None. | Return widget which has currently the grab in this application
or None. | [
"Return",
"widget",
"which",
"has",
"currently",
"the",
"grab",
"in",
"this",
"application",
"or",
"None",
"."
] | def grab_current(self):
"""Return widget which has currently the grab in this application
or None."""
name = self.tk.call('grab', 'current', self._w)
if not name: return None
return self._nametowidget(name) | [
"def",
"grab_current",
"(",
"self",
")",
":",
"name",
"=",
"self",
".",
"tk",
".",
"call",
"(",
"'grab'",
",",
"'current'",
",",
"self",
".",
"_w",
")",
"if",
"not",
"name",
":",
"return",
"None",
"return",
"self",
".",
"_nametowidget",
"(",
"name",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L826-L831 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_differentialevolution.py | python | DifferentialEvolutionSolver._select_samples | (self, candidate, number_samples) | return idxs | obtain random integers from range(self.num_population_members),
without replacement. You can't have the original candidate either. | obtain random integers from range(self.num_population_members),
without replacement. You can't have the original candidate either. | [
"obtain",
"random",
"integers",
"from",
"range",
"(",
"self",
".",
"num_population_members",
")",
"without",
"replacement",
".",
"You",
"can",
"t",
"have",
"the",
"original",
"candidate",
"either",
"."
] | def _select_samples(self, candidate, number_samples):
"""
obtain random integers from range(self.num_population_members),
without replacement. You can't have the original candidate either.
"""
idxs = list(range(self.num_population_members))
idxs.remove(candidate)
... | [
"def",
"_select_samples",
"(",
"self",
",",
"candidate",
",",
"number_samples",
")",
":",
"idxs",
"=",
"list",
"(",
"range",
"(",
"self",
".",
"num_population_members",
")",
")",
"idxs",
".",
"remove",
"(",
"candidate",
")",
"self",
".",
"random_number_gener... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_differentialevolution.py#L993-L1002 | |
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/cpp_wrappers/log_likelihood.py | python | GaussianProcessLogLikelihood.set_hyperparameters | (self, hyperparameters) | Set hyperparameters to the specified hyperparameters; ordering must match.
:param hyperparameters: hyperparameters at which to evaluate the log likelihood (objective function), ``f(x)``
:type hyperparameters: array of float64 with shape (num_hyperparameters) | Set hyperparameters to the specified hyperparameters; ordering must match. | [
"Set",
"hyperparameters",
"to",
"the",
"specified",
"hyperparameters",
";",
"ordering",
"must",
"match",
"."
] | def set_hyperparameters(self, hyperparameters):
"""Set hyperparameters to the specified hyperparameters; ordering must match.
:param hyperparameters: hyperparameters at which to evaluate the log likelihood (objective function), ``f(x)``
:type hyperparameters: array of float64 with shape (num_hy... | [
"def",
"set_hyperparameters",
"(",
"self",
",",
"hyperparameters",
")",
":",
"self",
".",
"_covariance",
".",
"hyperparameters",
"=",
"hyperparameters",
"[",
":",
"self",
".",
"_covariance",
".",
"num_hyperparameters",
"]",
"self",
".",
"_noise_variance",
"=",
"... | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/log_likelihood.py#L300-L308 | ||
h0x91b/redis-v8 | ac8b9d49701d75bcee3719892a2a6a50b437e47a | redis/deps/v8/tools/stats-viewer.py | python | UiCounter.__init__ | (self, var, format) | Creates a new ui counter.
Args:
var: the Tkinter string variable for updating the ui
format: the format string used to format this counter | Creates a new ui counter. | [
"Creates",
"a",
"new",
"ui",
"counter",
"."
] | def __init__(self, var, format):
"""Creates a new ui counter.
Args:
var: the Tkinter string variable for updating the ui
format: the format string used to format this counter
"""
self.var = var
self.format = format
self.last_value = None | [
"def",
"__init__",
"(",
"self",
",",
"var",
",",
"format",
")",
":",
"self",
".",
"var",
"=",
"var",
"self",
".",
"format",
"=",
"format",
"self",
".",
"last_value",
"=",
"None"
] | https://github.com/h0x91b/redis-v8/blob/ac8b9d49701d75bcee3719892a2a6a50b437e47a/redis/deps/v8/tools/stats-viewer.py#L271-L280 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/maximum-number-of-balloons.py | python | Solution.maxNumberOfBalloons | (self, text) | return min(source_count[c]//target_count[c] for c in target_count.iterkeys()) | :type text: str
:rtype: int | :type text: str
:rtype: int | [
":",
"type",
"text",
":",
"str",
":",
"rtype",
":",
"int"
] | def maxNumberOfBalloons(self, text):
"""
:type text: str
:rtype: int
"""
TARGET = "balloon"
source_count = collections.Counter(text)
target_count = collections.Counter(TARGET)
return min(source_count[c]//target_count[c] for c in target_count.iterkeys()) | [
"def",
"maxNumberOfBalloons",
"(",
"self",
",",
"text",
")",
":",
"TARGET",
"=",
"\"balloon\"",
"source_count",
"=",
"collections",
".",
"Counter",
"(",
"text",
")",
"target_count",
"=",
"collections",
".",
"Counter",
"(",
"TARGET",
")",
"return",
"min",
"("... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/maximum-number-of-balloons.py#L8-L16 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/distribute_coordinator.py | python | _WorkerContext.experimental_should_init | (self) | return self._strategy.extended.experimental_should_init | Whether to run init ops. | Whether to run init ops. | [
"Whether",
"to",
"run",
"init",
"ops",
"."
] | def experimental_should_init(self):
"""Whether to run init ops."""
return self._strategy.extended.experimental_should_init | [
"def",
"experimental_should_init",
"(",
"self",
")",
":",
"return",
"self",
".",
"_strategy",
".",
"extended",
".",
"experimental_should_init"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/distribute_coordinator.py#L307-L309 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | MacPrefixHeader._Gch | (self, lang, arch) | return self._CompiledHeader(lang, arch) + '.gch' | Returns the actual file name of the prefix header for language |lang|. | Returns the actual file name of the prefix header for language |lang|. | [
"Returns",
"the",
"actual",
"file",
"name",
"of",
"the",
"prefix",
"header",
"for",
"language",
"|lang|",
"."
] | def _Gch(self, lang, arch):
"""Returns the actual file name of the prefix header for language |lang|."""
assert self.compile_headers
return self._CompiledHeader(lang, arch) + '.gch' | [
"def",
"_Gch",
"(",
"self",
",",
"lang",
",",
"arch",
")",
":",
"assert",
"self",
".",
"compile_headers",
"return",
"self",
".",
"_CompiledHeader",
"(",
"lang",
",",
"arch",
")",
"+",
"'.gch'"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L1218-L1221 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | PanedWindow.proxy_forget | (self) | return self.proxy("forget") | Remove the proxy from the display. | Remove the proxy from the display. | [
"Remove",
"the",
"proxy",
"from",
"the",
"display",
"."
] | def proxy_forget(self):
"""Remove the proxy from the display.
"""
return self.proxy("forget") | [
"def",
"proxy_forget",
"(",
"self",
")",
":",
"return",
"self",
".",
"proxy",
"(",
"\"forget\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3855-L3858 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/packaging/py3/packaging/_manylinux.py | python | _parse_glibc_version | (version_str: str) | return int(m.group("major")), int(m.group("minor")) | Parse glibc version.
We use a regexp instead of str.split because we want to discard any
random junk that might come after the minor version -- this might happen
in patched/forked versions of glibc (e.g. Linaro's version of glibc
uses version strings like "2.20-2014.11"). See gh-3588. | Parse glibc version. | [
"Parse",
"glibc",
"version",
"."
] | def _parse_glibc_version(version_str: str) -> Tuple[int, int]:
"""Parse glibc version.
We use a regexp instead of str.split because we want to discard any
random junk that might come after the minor version -- this might happen
in patched/forked versions of glibc (e.g. Linaro's version of glibc
use... | [
"def",
"_parse_glibc_version",
"(",
"version_str",
":",
"str",
")",
"->",
"Tuple",
"[",
"int",
",",
"int",
"]",
":",
"m",
"=",
"re",
".",
"match",
"(",
"r\"(?P<major>[0-9]+)\\.(?P<minor>[0-9]+)\"",
",",
"version_str",
")",
"if",
"not",
"m",
":",
"warnings",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/packaging/py3/packaging/_manylinux.py#L203-L219 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/cookies.py | python | RequestsCookieJar.itervalues | (self) | Dict-like itervalues() that returns an iterator of values of cookies
from the jar.
.. seealso:: iterkeys() and iteritems(). | Dict-like itervalues() that returns an iterator of values of cookies
from the jar. | [
"Dict",
"-",
"like",
"itervalues",
"()",
"that",
"returns",
"an",
"iterator",
"of",
"values",
"of",
"cookies",
"from",
"the",
"jar",
"."
] | def itervalues(self):
"""Dict-like itervalues() that returns an iterator of values of cookies
from the jar.
.. seealso:: iterkeys() and iteritems().
"""
for cookie in iter(self):
yield cookie.value | [
"def",
"itervalues",
"(",
"self",
")",
":",
"for",
"cookie",
"in",
"iter",
"(",
"self",
")",
":",
"yield",
"cookie",
".",
"value"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/cookies.py#L235-L242 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBTypeMemberFunction.GetDemangledName | (self) | return _lldb.SBTypeMemberFunction_GetDemangledName(self) | GetDemangledName(SBTypeMemberFunction self) -> char const * | GetDemangledName(SBTypeMemberFunction self) -> char const * | [
"GetDemangledName",
"(",
"SBTypeMemberFunction",
"self",
")",
"-",
">",
"char",
"const",
"*"
] | def GetDemangledName(self):
"""GetDemangledName(SBTypeMemberFunction self) -> char const *"""
return _lldb.SBTypeMemberFunction_GetDemangledName(self) | [
"def",
"GetDemangledName",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBTypeMemberFunction_GetDemangledName",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L12470-L12472 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/distutils/line_endings.py | python | unix2dos | (file) | Replace LF with CRLF in argument files. Print names of changed files. | Replace LF with CRLF in argument files. Print names of changed files. | [
"Replace",
"LF",
"with",
"CRLF",
"in",
"argument",
"files",
".",
"Print",
"names",
"of",
"changed",
"files",
"."
] | def unix2dos(file):
"Replace LF with CRLF in argument files. Print names of changed files."
if os.path.isdir(file):
print(file, "Directory!")
return
data = open(file, "rb").read()
if '\0' in data:
print(file, "Binary!")
return
newdata = re.sub("\r\n", "\n", data)
... | [
"def",
"unix2dos",
"(",
"file",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"file",
")",
":",
"print",
"(",
"file",
",",
"\"Directory!\"",
")",
"return",
"data",
"=",
"open",
"(",
"file",
",",
"\"rb\"",
")",
".",
"read",
"(",
")",
"if",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/distutils/line_endings.py#L42-L61 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py | python | InstructionMap.getDisasTableName | (self) | return sName | Returns the disassembler table name for this map. | Returns the disassembler table name for this map. | [
"Returns",
"the",
"disassembler",
"table",
"name",
"for",
"this",
"map",
"."
] | def getDisasTableName(self):
"""
Returns the disassembler table name for this map.
"""
sName = 'g_aDisas';
for sWord in self.sName.split('_'):
if sWord == 'm': # suffix indicating modrm.mod==mem
sName += '_m';
elif sWord == 'r': ... | [
"def",
"getDisasTableName",
"(",
"self",
")",
":",
"sName",
"=",
"'g_aDisas'",
"for",
"sWord",
"in",
"self",
".",
"sName",
".",
"split",
"(",
"'_'",
")",
":",
"if",
"sWord",
"==",
"'m'",
":",
"# suffix indicating modrm.mod==mem",
"sName",
"+=",
"'_m'",
"el... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py#L701-L717 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-time.py | python | SConsTimer.get_debug_times | (self, file, time_string=None) | return result | Fetch times from the --debug=time strings in the specified file. | Fetch times from the --debug=time strings in the specified file. | [
"Fetch",
"times",
"from",
"the",
"--",
"debug",
"=",
"time",
"strings",
"in",
"the",
"specified",
"file",
"."
] | def get_debug_times(self, file, time_string=None):
"""
Fetch times from the --debug=time strings in the specified file.
"""
if time_string is None:
search_string = self.time_string_all
else:
search_string = time_string
contents = open(file).read()
... | [
"def",
"get_debug_times",
"(",
"self",
",",
"file",
",",
"time_string",
"=",
"None",
")",
":",
"if",
"time_string",
"is",
"None",
":",
"search_string",
"=",
"self",
".",
"time_string_all",
"else",
":",
"search_string",
"=",
"time_string",
"contents",
"=",
"o... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-time.py#L622-L642 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/Execute/ConsoleOutputViewerPlugin.py | python | ConsoleOutputViewerPlugin.viewPositionChanged | (self, val) | The view changed.
This can be due to adding additional text
or if the user scroll around the text window.
If we are at the bottom then we turn on auto scrolling.
Input:
val[int]: The current position of the vertical bar slider | The view changed.
This can be due to adding additional text
or if the user scroll around the text window.
If we are at the bottom then we turn on auto scrolling.
Input:
val[int]: The current position of the vertical bar slider | [
"The",
"view",
"changed",
".",
"This",
"can",
"be",
"due",
"to",
"adding",
"additional",
"text",
"or",
"if",
"the",
"user",
"scroll",
"around",
"the",
"text",
"window",
".",
"If",
"we",
"are",
"at",
"the",
"bottom",
"then",
"we",
"turn",
"on",
"auto",
... | def viewPositionChanged(self, val):
"""
The view changed.
This can be due to adding additional text
or if the user scroll around the text window.
If we are at the bottom then we turn on auto scrolling.
Input:
val[int]: The current position of the vertical bar ... | [
"def",
"viewPositionChanged",
"(",
"self",
",",
"val",
")",
":",
"self",
".",
"do_scroll",
"=",
"val",
"==",
"self",
".",
"vert_bar",
".",
"maximum",
"(",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/Execute/ConsoleOutputViewerPlugin.py#L57-L66 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/FemToDemApplication/python_scripts/MainCouplingPfemFemDemAitkenSubstepping.py | python | KratosPrintInfo | (message) | This function prints info on screen | This function prints info on screen | [
"This",
"function",
"prints",
"info",
"on",
"screen"
] | def KratosPrintInfo(message):
"""This function prints info on screen
"""
KM.Logger.Print("", message)
KM.Logger.Flush() | [
"def",
"KratosPrintInfo",
"(",
"message",
")",
":",
"KM",
".",
"Logger",
".",
"Print",
"(",
"\"\"",
",",
"message",
")",
"KM",
".",
"Logger",
".",
"Flush",
"(",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/FemToDemApplication/python_scripts/MainCouplingPfemFemDemAitkenSubstepping.py#L13-L17 | ||
google/usd_from_gltf | 6d288cce8b68744494a226574ae1d7ba6a9c46eb | tools/ufgbatch/ufgcommon/process.py | python | get_process_command | (cmd_args) | return cmd | Get command-line text for task process. | Get command-line text for task process. | [
"Get",
"command",
"-",
"line",
"text",
"for",
"task",
"process",
"."
] | def get_process_command(cmd_args):
"""Get command-line text for task process."""
# Join arguments into command string, escaping any with spaces.
cmd = ''
for arg_index, arg in enumerate(cmd_args):
if arg_index > 0:
cmd += ' '
if ' ' in arg:
cmd += '"' + arg + '"'
else:
cmd += arg
... | [
"def",
"get_process_command",
"(",
"cmd_args",
")",
":",
"# Join arguments into command string, escaping any with spaces.",
"cmd",
"=",
"''",
"for",
"arg_index",
",",
"arg",
"in",
"enumerate",
"(",
"cmd_args",
")",
":",
"if",
"arg_index",
">",
"0",
":",
"cmd",
"+=... | https://github.com/google/usd_from_gltf/blob/6d288cce8b68744494a226574ae1d7ba6a9c46eb/tools/ufgbatch/ufgcommon/process.py#L117-L128 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/neural_network/multilayer_perceptron.py | python | BaseMultilayerPerceptron.fit | (self, X, y) | return self._fit(X, y, incremental=False) | Fit the model to data matrix X and target y.
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
The input data.
y : array-like, shape (n_samples,)
The target values.
Returns
-------
self : returns a trai... | Fit the model to data matrix X and target y. | [
"Fit",
"the",
"model",
"to",
"data",
"matrix",
"X",
"and",
"target",
"y",
"."
] | def fit(self, X, y):
"""Fit the model to data matrix X and target y.
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
The input data.
y : array-like, shape (n_samples,)
The target values.
Returns
-----... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
")",
":",
"return",
"self",
".",
"_fit",
"(",
"X",
",",
"y",
",",
"incremental",
"=",
"False",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/neural_network/multilayer_perceptron.py#L603-L618 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/third_party/mlir/utils/spirv/gen_spirv_dialect.py | python | map_spec_operand_to_ods_argument | (operand) | return '{}:${}'.format(arg_type, name) | Maps a operand in SPIR-V JSON spec to an op argument in ODS.
Arguments:
- A dict containing the operand's kind, quantifier, and name
Returns:
- A string containing both the type and name for the argument | Maps a operand in SPIR-V JSON spec to an op argument in ODS. | [
"Maps",
"a",
"operand",
"in",
"SPIR",
"-",
"V",
"JSON",
"spec",
"to",
"an",
"op",
"argument",
"in",
"ODS",
"."
] | def map_spec_operand_to_ods_argument(operand):
"""Maps a operand in SPIR-V JSON spec to an op argument in ODS.
Arguments:
- A dict containing the operand's kind, quantifier, and name
Returns:
- A string containing both the type and name for the argument
"""
kind = operand['kind']
quantifier = oper... | [
"def",
"map_spec_operand_to_ods_argument",
"(",
"operand",
")",
":",
"kind",
"=",
"operand",
"[",
"'kind'",
"]",
"quantifier",
"=",
"operand",
".",
"get",
"(",
"'quantifier'",
",",
"''",
")",
"# These instruction \"operands\" are for encoding the results; they should",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/third_party/mlir/utils/spirv/gen_spirv_dialect.py#L305-L360 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/html5lib/html5parser.py | python | HTMLParser.parse | (self, stream, encoding=None, parseMeta=True, useChardet=True) | return self.tree.getDocument() | Parse a HTML document into a well-formed tree
stream - a filelike object or string containing the HTML to be parsed
The optional encoding parameter must be a string that indicates
the encoding. If specified, that encoding will be used,
regardless of any BOM or later declaration (such ... | Parse a HTML document into a well-formed tree | [
"Parse",
"a",
"HTML",
"document",
"into",
"a",
"well",
"-",
"formed",
"tree"
] | def parse(self, stream, encoding=None, parseMeta=True, useChardet=True):
"""Parse a HTML document into a well-formed tree
stream - a filelike object or string containing the HTML to be parsed
The optional encoding parameter must be a string that indicates
the encoding. If specified, t... | [
"def",
"parse",
"(",
"self",
",",
"stream",
",",
"encoding",
"=",
"None",
",",
"parseMeta",
"=",
"True",
",",
"useChardet",
"=",
"True",
")",
":",
"self",
".",
"_parse",
"(",
"stream",
",",
"innerHTML",
"=",
"False",
",",
"encoding",
"=",
"encoding",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/html5lib/html5parser.py#L212-L224 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Source/bindings/scripts/interface_dependency_resolver.py | python | InterfaceDependencyResolver.__init__ | (self, interfaces_info, reader) | Initialize dependency resolver.
Args:
interfaces_info:
dict of interfaces information, from compute_dependencies.py
reader:
IdlReader, used for reading dependency files | Initialize dependency resolver. | [
"Initialize",
"dependency",
"resolver",
"."
] | def __init__(self, interfaces_info, reader):
"""Initialize dependency resolver.
Args:
interfaces_info:
dict of interfaces information, from compute_dependencies.py
reader:
IdlReader, used for reading dependency files
"""
self.inter... | [
"def",
"__init__",
"(",
"self",
",",
"interfaces_info",
",",
"reader",
")",
":",
"self",
".",
"interfaces_info",
"=",
"interfaces_info",
"self",
".",
"reader",
"=",
"reader"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/interface_dependency_resolver.py#L55-L65 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/compat/numpy/function.py | python | validate_argmax_with_skipna | (skipna, args, kwargs) | return skipna | If 'Series.argmax' is called via the 'numpy' library,
the third parameter in its signature is 'out', which
takes either an ndarray or 'None', so check if the
'skipna' parameter is either an instance of ndarray or
is None, since 'skipna' itself should be a boolean | If 'Series.argmax' is called via the 'numpy' library,
the third parameter in its signature is 'out', which
takes either an ndarray or 'None', so check if the
'skipna' parameter is either an instance of ndarray or
is None, since 'skipna' itself should be a boolean | [
"If",
"Series",
".",
"argmax",
"is",
"called",
"via",
"the",
"numpy",
"library",
"the",
"third",
"parameter",
"in",
"its",
"signature",
"is",
"out",
"which",
"takes",
"either",
"an",
"ndarray",
"or",
"None",
"so",
"check",
"if",
"the",
"skipna",
"parameter... | def validate_argmax_with_skipna(skipna, args, kwargs):
"""
If 'Series.argmax' is called via the 'numpy' library,
the third parameter in its signature is 'out', which
takes either an ndarray or 'None', so check if the
'skipna' parameter is either an instance of ndarray or
is None, since 'skipna' ... | [
"def",
"validate_argmax_with_skipna",
"(",
"skipna",
",",
"args",
",",
"kwargs",
")",
":",
"skipna",
",",
"args",
"=",
"process_skipna",
"(",
"skipna",
",",
"args",
")",
"validate_argmax",
"(",
"args",
",",
"kwargs",
")",
"return",
"skipna"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/compat/numpy/function.py#L95-L106 | |
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/properties/shapePropKeyframe/helper.py | python | convert_tangent_to_lottie | (t1, t2) | return t1, t2 | Converts tangent from Synfig format to lottie format
Args:
t1 (common.Vector.Vector) : tangent 1 of a point
t2 (common.Vector.Vector) : tangent 2 of a point
Returns:
(common.Vector.Vector) : Converted tangent 1
(common.Vector.Vector) : Converted tangent 2 | Converts tangent from Synfig format to lottie format | [
"Converts",
"tangent",
"from",
"Synfig",
"format",
"to",
"lottie",
"format"
] | def convert_tangent_to_lottie(t1, t2):
"""
Converts tangent from Synfig format to lottie format
Args:
t1 (common.Vector.Vector) : tangent 1 of a point
t2 (common.Vector.Vector) : tangent 2 of a point
Returns:
(common.Vector.Vector) : Converted tangent 1
(common.Vector.V... | [
"def",
"convert_tangent_to_lottie",
"(",
"t1",
",",
"t2",
")",
":",
"# Convert to Lottie format",
"t1",
"/=",
"3",
"t2",
"/=",
"3",
"# Synfig and Lottie use different in tangents SEE DOCUMENTATION",
"t1",
"*=",
"-",
"1",
"# Important: t1 and t2 have to be relative",
"# The ... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/properties/shapePropKeyframe/helper.py#L189-L212 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/framework/ops.py | python | SparseTensor.op | (self) | return self.values.op | The `Operation` that produces `values` as an output. | The `Operation` that produces `values` as an output. | [
"The",
"Operation",
"that",
"produces",
"values",
"as",
"an",
"output",
"."
] | def op(self):
"""The `Operation` that produces `values` as an output."""
return self.values.op | [
"def",
"op",
"(",
"self",
")",
":",
"return",
"self",
".",
"values",
".",
"op"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L1016-L1018 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/decimal.py | python | Decimal.is_subnormal | (self, context=None) | return self.adjusted() < context.Emin | Return True if self is subnormal; otherwise return False. | Return True if self is subnormal; otherwise return False. | [
"Return",
"True",
"if",
"self",
"is",
"subnormal",
";",
"otherwise",
"return",
"False",
"."
] | def is_subnormal(self, context=None):
"""Return True if self is subnormal; otherwise return False."""
if self._is_special or not self:
return False
if context is None:
context = getcontext()
return self.adjusted() < context.Emin | [
"def",
"is_subnormal",
"(",
"self",
",",
"context",
"=",
"None",
")",
":",
"if",
"self",
".",
"_is_special",
"or",
"not",
"self",
":",
"return",
"False",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"return",
"self",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/decimal.py#L3049-L3055 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py | python | BuiltinImporter.get_code | (cls, fullname) | return None | Return None as built-in modules do not have code objects. | Return None as built-in modules do not have code objects. | [
"Return",
"None",
"as",
"built",
"-",
"in",
"modules",
"do",
"not",
"have",
"code",
"objects",
"."
] | def get_code(cls, fullname):
"""Return None as built-in modules do not have code objects."""
return None | [
"def",
"get_code",
"(",
"cls",
",",
"fullname",
")",
":",
"return",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py#L755-L757 | |
QMCPACK/qmcpack | d0948ab455e38364458740cc8e2239600a14c5cd | utils/afqmctools/afqmctools/analysis/average.py | python | average_two_rdm | (filename, estimator='back_propagated', eqlb=1, skip=1, ix=None) | Average AFQMC 2RDM.
Returns a list of 2RDMS, where
2RDM[s1s2,i,k,j,l] = <c_{i}^+ c_{j}^+ c_{l} c_{k}>.
For closed shell systems, returns [(a,a,a,a),(a,a,b,b)]
For collinear systems, returns [(a,a,a,a),(a,a,b,b),(b,b,b,b)]
Parameters
----------
filename : string
QMCPACK out... | Average AFQMC 2RDM. | [
"Average",
"AFQMC",
"2RDM",
"."
] | def average_two_rdm(filename, estimator='back_propagated', eqlb=1, skip=1, ix=None):
"""Average AFQMC 2RDM.
Returns a list of 2RDMS, where
2RDM[s1s2,i,k,j,l] = <c_{i}^+ c_{j}^+ c_{l} c_{k}>.
For closed shell systems, returns [(a,a,a,a),(a,a,b,b)]
For collinear systems, returns [(a,a,a,a),(a... | [
"def",
"average_two_rdm",
"(",
"filename",
",",
"estimator",
"=",
"'back_propagated'",
",",
"eqlb",
"=",
"1",
",",
"skip",
"=",
"1",
",",
"ix",
"=",
"None",
")",
":",
"md",
"=",
"get_metadata",
"(",
"filename",
")",
"mean",
",",
"err",
"=",
"average_ob... | https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/utils/afqmctools/afqmctools/analysis/average.py#L66-L115 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleControl.py | python | CWSCDReductionControl.get_single_scan_pt_model | (self, exp_number, scan_number, pt_number, roi_name, integration_direction) | return vec_x, vec_model | get a single-pt scan summed 1D data either vertically or horizontally with model data
:param exp_number:
:param scan_number:
:param pt_number:
:param roi_name:
:param integration_direction:
:return: 2-tuple.. vector model | get a single-pt scan summed 1D data either vertically or horizontally with model data
:param exp_number:
:param scan_number:
:param pt_number:
:param roi_name:
:param integration_direction:
:return: 2-tuple.. vector model | [
"get",
"a",
"single",
"-",
"pt",
"scan",
"summed",
"1D",
"data",
"either",
"vertically",
"or",
"horizontally",
"with",
"model",
"data",
":",
"param",
"exp_number",
":",
":",
"param",
"scan_number",
":",
":",
"param",
"pt_number",
":",
":",
"param",
"roi_na... | def get_single_scan_pt_model(self, exp_number, scan_number, pt_number, roi_name, integration_direction):
""" get a single-pt scan summed 1D data either vertically or horizontally with model data
:param exp_number:
:param scan_number:
:param pt_number:
:param roi_name:
:pa... | [
"def",
"get_single_scan_pt_model",
"(",
"self",
",",
"exp_number",
",",
"scan_number",
",",
"pt_number",
",",
"roi_name",
",",
"integration_direction",
")",
":",
"# get record key",
"ws_record_key",
"=",
"self",
".",
"_current_single_pt_integration_key",
"print",
"(",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleControl.py#L484-L513 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/bindings/python/clang/cindex.py | python | SourceLocation.column | (self) | return self._get_instantiation()[2] | Get the column represented by this source location. | Get the column represented by this source location. | [
"Get",
"the",
"column",
"represented",
"by",
"this",
"source",
"location",
"."
] | def column(self):
"""Get the column represented by this source location."""
return self._get_instantiation()[2] | [
"def",
"column",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_instantiation",
"(",
")",
"[",
"2",
"]"
] | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/bindings/python/clang/cindex.py#L280-L282 | |
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Type.translation_unit | (self) | return self._tu | The TranslationUnit to which this Type is associated. | The TranslationUnit to which this Type is associated. | [
"The",
"TranslationUnit",
"to",
"which",
"this",
"Type",
"is",
"associated",
"."
] | def translation_unit(self):
"""The TranslationUnit to which this Type is associated."""
# If this triggers an AttributeError, the instance was not properly
# instantiated.
return self._tu | [
"def",
"translation_unit",
"(",
"self",
")",
":",
"# If this triggers an AttributeError, the instance was not properly",
"# instantiated.",
"return",
"self",
".",
"_tu"
] | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1531-L1535 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | BookCtrlBase_GetClassDefaultAttributes | (*args, **kwargs) | return _core_.BookCtrlBase_GetClassDefaultAttributes(*args, **kwargs) | BookCtrlBase_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colou... | BookCtrlBase_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"BookCtrlBase_GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def BookCtrlBase_GetClassDefaultAttributes(*args, **kwargs):
"""
BookCtrlBase_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
con... | [
"def",
"BookCtrlBase_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"BookCtrlBase_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13683-L13698 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/bdist_egg.py | python | iter_symbols | (code) | Yield names and strings used by `code` and its nested code objects | Yield names and strings used by `code` and its nested code objects | [
"Yield",
"names",
"and",
"strings",
"used",
"by",
"code",
"and",
"its",
"nested",
"code",
"objects"
] | def iter_symbols(code):
"""Yield names and strings used by `code` and its nested code objects"""
for name in code.co_names:
yield name
for const in code.co_consts:
if isinstance(const, six.string_types):
yield const
elif isinstance(const, CodeType):
for name i... | [
"def",
"iter_symbols",
"(",
"code",
")",
":",
"for",
"name",
"in",
"code",
".",
"co_names",
":",
"yield",
"name",
"for",
"const",
"in",
"code",
".",
"co_consts",
":",
"if",
"isinstance",
"(",
"const",
",",
"six",
".",
"string_types",
")",
":",
"yield",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/bdist_egg.py#L449-L458 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintscoordentry.py | python | NumberValue.rset | (self, val) | Resets value of coordinate if not fixed | Resets value of coordinate if not fixed | [
"Resets",
"value",
"of",
"coordinate",
"if",
"not",
"fixed"
] | def rset(self, val):
"""Resets value of coordinate if not fixed"""
if not self.PYfixed:
self.value = val | [
"def",
"rset",
"(",
"self",
",",
"val",
")",
":",
"if",
"not",
"self",
".",
"PYfixed",
":",
"self",
".",
"value",
"=",
"val"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintscoordentry.py#L80-L83 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | GenericTreeItem.Set3StateValue | (self, state) | Sets the checkbox item to the given `state`.
:param integer `state`: can be one of: ``wx.CHK_UNCHECKED`` (check is off), ``wx.CHK_CHECKED``
(check is on) or ``wx.CHK_UNDETERMINED`` (check is mixed).
:raise: `Exception` when the item is not a 3-state checkbox item.
:note: This method ... | Sets the checkbox item to the given `state`. | [
"Sets",
"the",
"checkbox",
"item",
"to",
"the",
"given",
"state",
"."
] | def Set3StateValue(self, state):
"""
Sets the checkbox item to the given `state`.
:param integer `state`: can be one of: ``wx.CHK_UNCHECKED`` (check is off), ``wx.CHK_CHECKED``
(check is on) or ``wx.CHK_UNDETERMINED`` (check is mixed).
:raise: `Exception` when the item is not ... | [
"def",
"Set3StateValue",
"(",
"self",
",",
"state",
")",
":",
"if",
"not",
"self",
".",
"_is3State",
"and",
"state",
"==",
"wx",
".",
"CHK_UNDETERMINED",
":",
"raise",
"Exception",
"(",
"\"Set3StateValue can only be used with 3-state checkbox items.\"",
")",
"self",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L2215-L2233 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.ApplyItalicToSelection | (*args, **kwargs) | return _richtext.RichTextCtrl_ApplyItalicToSelection(*args, **kwargs) | ApplyItalicToSelection(self) -> bool
Apply italic to the selection | ApplyItalicToSelection(self) -> bool | [
"ApplyItalicToSelection",
"(",
"self",
")",
"-",
">",
"bool"
] | def ApplyItalicToSelection(*args, **kwargs):
"""
ApplyItalicToSelection(self) -> bool
Apply italic to the selection
"""
return _richtext.RichTextCtrl_ApplyItalicToSelection(*args, **kwargs) | [
"def",
"ApplyItalicToSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_ApplyItalicToSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L3959-L3965 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | python | find_compilation_database | (path) | return os.path.realpath(result) | Adjusts the directory until a compilation database is found. | Adjusts the directory until a compilation database is found. | [
"Adjusts",
"the",
"directory",
"until",
"a",
"compilation",
"database",
"is",
"found",
"."
] | def find_compilation_database(path):
"""Adjusts the directory until a compilation database is found."""
result = './'
while not os.path.isfile(os.path.join(result, path)):
if os.path.realpath(result) == '/':
print('Error: could not find compilation database.')
sys.exit(1)
result += '../'
ret... | [
"def",
"find_compilation_database",
"(",
"path",
")",
":",
"result",
"=",
"'./'",
"while",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"os",
".",
"path",
".",
"join",
"(",
"result",
",",
"path",
")",
")",
":",
"if",
"os",
".",
"path",
".",
"realp... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py#L65-L73 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/boto3/dynamodb/conditions.py | python | Attr.ne | (self, value) | return NotEquals(self, value) | Creates a condition where the attribute is not equal to the value
:param value: The value that the attribute is not equal to. | Creates a condition where the attribute is not equal to the value | [
"Creates",
"a",
"condition",
"where",
"the",
"attribute",
"is",
"not",
"equal",
"to",
"the",
"value"
] | def ne(self, value):
"""Creates a condition where the attribute is not equal to the value
:param value: The value that the attribute is not equal to.
"""
return NotEquals(self, value) | [
"def",
"ne",
"(",
"self",
",",
"value",
")",
":",
"return",
"NotEquals",
"(",
"self",
",",
"value",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/boto3/dynamodb/conditions.py#L230-L235 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/third_party/jinja2/ext.py | python | Extension.bind | (self, environment) | return rv | Create a copy of this extension bound to another environment. | Create a copy of this extension bound to another environment. | [
"Create",
"a",
"copy",
"of",
"this",
"extension",
"bound",
"to",
"another",
"environment",
"."
] | def bind(self, environment):
"""Create a copy of this extension bound to another environment."""
rv = object.__new__(self.__class__)
rv.__dict__.update(self.__dict__)
rv.environment = environment
return rv | [
"def",
"bind",
"(",
"self",
",",
"environment",
")",
":",
"rv",
"=",
"object",
".",
"__new__",
"(",
"self",
".",
"__class__",
")",
"rv",
".",
"__dict__",
".",
"update",
"(",
"self",
".",
"__dict__",
")",
"rv",
".",
"environment",
"=",
"environment",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/ext.py#L75-L80 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/serialize.py | python | _get_function_globals_for_reduction | (func) | return globs | Analyse *func* and return a dictionary of global values suitable for
reduction. | Analyse *func* and return a dictionary of global values suitable for
reduction. | [
"Analyse",
"*",
"func",
"*",
"and",
"return",
"a",
"dictionary",
"of",
"global",
"values",
"suitable",
"for",
"reduction",
"."
] | def _get_function_globals_for_reduction(func):
"""
Analyse *func* and return a dictionary of global values suitable for
reduction.
"""
func_id = bytecode.FunctionIdentity.from_function(func)
bc = bytecode.ByteCode(func_id)
globs = bc.get_used_globals()
for k, v in globs.items():
... | [
"def",
"_get_function_globals_for_reduction",
"(",
"func",
")",
":",
"func_id",
"=",
"bytecode",
".",
"FunctionIdentity",
".",
"from_function",
"(",
"func",
")",
"bc",
"=",
"bytecode",
".",
"ByteCode",
"(",
"func_id",
")",
"globs",
"=",
"bc",
".",
"get_used_gl... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/serialize.py#L50-L65 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/context.py | python | set_log_device_placement | (enabled) | Turns logging for device placement decisions on or off.
Operations execute on a particular device, producing and consuming tensors on
that device. This may change the performance of the operation or require
TensorFlow to copy data to or from an accelerator, so knowing where operations
execute is useful for deb... | Turns logging for device placement decisions on or off. | [
"Turns",
"logging",
"for",
"device",
"placement",
"decisions",
"on",
"or",
"off",
"."
] | def set_log_device_placement(enabled):
"""Turns logging for device placement decisions on or off.
Operations execute on a particular device, producing and consuming tensors on
that device. This may change the performance of the operation or require
TensorFlow to copy data to or from an accelerator, so knowing ... | [
"def",
"set_log_device_placement",
"(",
"enabled",
")",
":",
"context",
"(",
")",
".",
"log_device_placement",
"=",
"enabled"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L2358-L2389 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _AddIsInitializedMethod | (message_descriptor, cls) | Adds the IsInitialized and FindInitializationError methods to the
protocol message class. | Adds the IsInitialized and FindInitializationError methods to the
protocol message class. | [
"Adds",
"the",
"IsInitialized",
"and",
"FindInitializationError",
"methods",
"to",
"the",
"protocol",
"message",
"class",
"."
] | def _AddIsInitializedMethod(message_descriptor, cls):
"""Adds the IsInitialized and FindInitializationError methods to the
protocol message class."""
required_fields = [field for field in message_descriptor.fields
if field.label == _FieldDescriptor.LABEL_REQUIRED]
def IsInitialized(... | [
"def",
"_AddIsInitializedMethod",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"required_fields",
"=",
"[",
"field",
"for",
"field",
"in",
"message_descriptor",
".",
"fields",
"if",
"field",
".",
"label",
"==",
"_FieldDescriptor",
".",
"LABEL_REQUIRED",
"]",
... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L853-L932 | ||
Komnomnomnom/swigibpy | cfd307fdbfaffabc69a2dc037538d7e34a8b8daf | swigibpy.py | python | EClientSocketBase.subscribeToGroupEvents | (self, reqId, groupId) | return _swigibpy.EClientSocketBase_subscribeToGroupEvents(self, reqId, groupId) | subscribeToGroupEvents(EClientSocketBase self, int reqId, int groupId) | subscribeToGroupEvents(EClientSocketBase self, int reqId, int groupId) | [
"subscribeToGroupEvents",
"(",
"EClientSocketBase",
"self",
"int",
"reqId",
"int",
"groupId",
")"
] | def subscribeToGroupEvents(self, reqId, groupId):
"""subscribeToGroupEvents(EClientSocketBase self, int reqId, int groupId)"""
return _swigibpy.EClientSocketBase_subscribeToGroupEvents(self, reqId, groupId) | [
"def",
"subscribeToGroupEvents",
"(",
"self",
",",
"reqId",
",",
"groupId",
")",
":",
"return",
"_swigibpy",
".",
"EClientSocketBase_subscribeToGroupEvents",
"(",
"self",
",",
"reqId",
",",
"groupId",
")"
] | https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L1672-L1674 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/jedi/jedi/api_classes.py | python | BaseDefinition.__init__ | (self, definition, start_pos) | An instance of :class:`jedi.parsing_representation.Base` subclass. | An instance of :class:`jedi.parsing_representation.Base` subclass. | [
"An",
"instance",
"of",
":",
"class",
":",
"jedi",
".",
"parsing_representation",
".",
"Base",
"subclass",
"."
] | def __init__(self, definition, start_pos):
self._start_pos = start_pos
self._definition = definition
"""
An instance of :class:`jedi.parsing_representation.Base` subclass.
"""
self.is_keyword = isinstance(definition, keywords.Keyword)
# generate a path to the def... | [
"def",
"__init__",
"(",
"self",
",",
"definition",
",",
"start_pos",
")",
":",
"self",
".",
"_start_pos",
"=",
"start_pos",
"self",
".",
"_definition",
"=",
"definition",
"self",
".",
"is_keyword",
"=",
"isinstance",
"(",
"definition",
",",
"keywords",
".",
... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/api_classes.py#L72-L83 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | lldb/utils/lui/lldbutil.py | python | get_description | (obj, option=None) | return stream.GetData() | Calls lldb_obj.GetDescription() and returns a string, or None.
For SBTarget, SBBreakpointLocation, and SBWatchpoint lldb objects, an extra
option can be passed in to describe the detailed level of description
desired:
o lldb.eDescriptionLevelBrief
o lldb.eDescriptionLevelFull
o lldb... | Calls lldb_obj.GetDescription() and returns a string, or None. | [
"Calls",
"lldb_obj",
".",
"GetDescription",
"()",
"and",
"returns",
"a",
"string",
"or",
"None",
"."
] | def get_description(obj, option=None):
"""Calls lldb_obj.GetDescription() and returns a string, or None.
For SBTarget, SBBreakpointLocation, and SBWatchpoint lldb objects, an extra
option can be passed in to describe the detailed level of description
desired:
o lldb.eDescriptionLevelBrief
... | [
"def",
"get_description",
"(",
"obj",
",",
"option",
"=",
"None",
")",
":",
"method",
"=",
"getattr",
"(",
"obj",
",",
"'GetDescription'",
")",
"if",
"not",
"method",
":",
"return",
"None",
"tuple",
"=",
"(",
"lldb",
".",
"SBTarget",
",",
"lldb",
".",
... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/utils/lui/lldbutil.py#L121-L146 | |
smartdevicelink/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | tools/InterfaceGenerator/generator/parsers/JSONRPC.py | python | Parser._provide_enum_element_for_function | (self, enum_name, element_name) | return element | Provide enum element for functions.
This implementation replaces the underscore separating interface and
function name with dot and sets it as name of enum element leaving
the name with underscore as internal_name. For enums other than
FunctionID the base implementation is called.
... | Provide enum element for functions. | [
"Provide",
"enum",
"element",
"for",
"functions",
"."
] | def _provide_enum_element_for_function(self, enum_name, element_name):
"""Provide enum element for functions.
This implementation replaces the underscore separating interface and
function name with dot and sets it as name of enum element leaving
the name with underscore as internal_name... | [
"def",
"_provide_enum_element_for_function",
"(",
"self",
",",
"enum_name",
",",
"element_name",
")",
":",
"name",
"=",
"element_name",
"internal_name",
"=",
"None",
"if",
"\"FunctionID\"",
"==",
"enum_name",
":",
"prefix_length",
"=",
"len",
"(",
"self",
".",
"... | https://github.com/smartdevicelink/sdl_core/blob/68f082169e0a40fccd9eb0db3c83911c28870f07/tools/InterfaceGenerator/generator/parsers/JSONRPC.py#L60-L91 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py | python | ProcessTableWidget.get_mask | (self, row_index) | return self.get_cell_value(row_index, self._colIndexMask) | get the mask/ROI name that this integration is based on
:param row_index:
:return: | get the mask/ROI name that this integration is based on
:param row_index:
:return: | [
"get",
"the",
"mask",
"/",
"ROI",
"name",
"that",
"this",
"integration",
"is",
"based",
"on",
":",
"param",
"row_index",
":",
":",
"return",
":"
] | def get_mask(self, row_index):
"""
get the mask/ROI name that this integration is based on
:param row_index:
:return:
"""
return self.get_cell_value(row_index, self._colIndexMask) | [
"def",
"get_mask",
"(",
"self",
",",
"row_index",
")",
":",
"return",
"self",
".",
"get_cell_value",
"(",
"row_index",
",",
"self",
".",
"_colIndexMask",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py#L820-L826 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/decimal.py | python | Context._regard_flags | (self, *flags) | Stop ignoring the flags, if they are raised | Stop ignoring the flags, if they are raised | [
"Stop",
"ignoring",
"the",
"flags",
"if",
"they",
"are",
"raised"
] | def _regard_flags(self, *flags):
"""Stop ignoring the flags, if they are raised"""
if flags and isinstance(flags[0], (tuple,list)):
flags = flags[0]
for flag in flags:
self._ignored_flags.remove(flag) | [
"def",
"_regard_flags",
"(",
"self",
",",
"*",
"flags",
")",
":",
"if",
"flags",
"and",
"isinstance",
"(",
"flags",
"[",
"0",
"]",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"flags",
"=",
"flags",
"[",
"0",
"]",
"for",
"flag",
"in",
"flags",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/decimal.py#L3732-L3737 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xmlTextReader.Prefix | (self) | return ret | A shorthand reference to the namespace associated with the
node. | A shorthand reference to the namespace associated with the
node. | [
"A",
"shorthand",
"reference",
"to",
"the",
"namespace",
"associated",
"with",
"the",
"node",
"."
] | def Prefix(self):
"""A shorthand reference to the namespace associated with the
node. """
ret = libxml2mod.xmlTextReaderConstPrefix(self._o)
return ret | [
"def",
"Prefix",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlTextReaderConstPrefix",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L6751-L6755 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/locale.py | python | _build_localename | (localetuple) | Builds a locale code from the given tuple (language code,
encoding).
No aliasing or normalizing takes place. | Builds a locale code from the given tuple (language code,
encoding). | [
"Builds",
"a",
"locale",
"code",
"from",
"the",
"given",
"tuple",
"(",
"language",
"code",
"encoding",
")",
"."
] | def _build_localename(localetuple):
""" Builds a locale code from the given tuple (language code,
encoding).
No aliasing or normalizing takes place.
"""
language, encoding = localetuple
if language is None:
language = 'C'
if encoding is None:
return language
el... | [
"def",
"_build_localename",
"(",
"localetuple",
")",
":",
"language",
",",
"encoding",
"=",
"localetuple",
"if",
"language",
"is",
"None",
":",
"language",
"=",
"'C'",
"if",
"encoding",
"is",
"None",
":",
"return",
"language",
"else",
":",
"return",
"languag... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/locale.py#L412-L426 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py | python | TurtleScreenBase._resize | (self, canvwidth=None, canvheight=None, bg=None) | Resize the canvas the turtles are drawing on. Does
not alter the drawing window. | Resize the canvas the turtles are drawing on. Does
not alter the drawing window. | [
"Resize",
"the",
"canvas",
"the",
"turtles",
"are",
"drawing",
"on",
".",
"Does",
"not",
"alter",
"the",
"drawing",
"window",
"."
] | def _resize(self, canvwidth=None, canvheight=None, bg=None):
"""Resize the canvas the turtles are drawing on. Does
not alter the drawing window.
"""
# needs amendment
if not isinstance(self.cv, ScrolledCanvas):
return self.canvwidth, self.canvheight
if canvwid... | [
"def",
"_resize",
"(",
"self",
",",
"canvwidth",
"=",
"None",
",",
"canvheight",
"=",
"None",
",",
"bg",
"=",
"None",
")",
":",
"# needs amendment",
"if",
"not",
"isinstance",
"(",
"self",
".",
"cv",
",",
"ScrolledCanvas",
")",
":",
"return",
"self",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py#L779-L792 | ||
emlid/Navio | 14b96c83ad57a10580655e3af49c9be1f5fc0ad2 | Python/navio/adafruit_ads1x15.py | python | ADS1x15.stopContinuousConversion | (self) | return True | Stops the ADC's conversions when in continuous mode \
and resets the configuration to its default value. | Stops the ADC's conversions when in continuous mode \
and resets the configuration to its default value. | [
"Stops",
"the",
"ADC",
"s",
"conversions",
"when",
"in",
"continuous",
"mode",
"\\",
"and",
"resets",
"the",
"configuration",
"to",
"its",
"default",
"value",
"."
] | def stopContinuousConversion(self):
"Stops the ADC's conversions when in continuous mode \
and resets the configuration to its default value."
# Write the default config register to the ADC
# Once we write, the ADC will do a single conversion and
# enter power-off mode.
config = 0x8583 # Page 18... | [
"def",
"stopContinuousConversion",
"(",
"self",
")",
":",
"# Write the default config register to the ADC",
"# Once we write, the ADC will do a single conversion and",
"# enter power-off mode.",
"config",
"=",
"0x8583",
"# Page 18 datasheet.",
"bytes",
"=",
"[",
"(",
"config",
">... | https://github.com/emlid/Navio/blob/14b96c83ad57a10580655e3af49c9be1f5fc0ad2/Python/navio/adafruit_ads1x15.py#L496-L505 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/generator/analyzer.py | python | _GetBuildTargets | (matching_targets, roots) | return result | Returns the set of Targets that require a build.
matching_targets: targets that changed and need to be built.
roots: set of root targets in the build files to search from. | Returns the set of Targets that require a build.
matching_targets: targets that changed and need to be built.
roots: set of root targets in the build files to search from. | [
"Returns",
"the",
"set",
"of",
"Targets",
"that",
"require",
"a",
"build",
".",
"matching_targets",
":",
"targets",
"that",
"changed",
"and",
"need",
"to",
"be",
"built",
".",
"roots",
":",
"set",
"of",
"root",
"targets",
"in",
"the",
"build",
"files",
"... | def _GetBuildTargets(matching_targets, roots):
"""Returns the set of Targets that require a build.
matching_targets: targets that changed and need to be built.
roots: set of root targets in the build files to search from."""
result = set()
for target in matching_targets:
_AddBuildTargets(target, roots, Tr... | [
"def",
"_GetBuildTargets",
"(",
"matching_targets",
",",
"roots",
")",
":",
"result",
"=",
"set",
"(",
")",
"for",
"target",
"in",
"matching_targets",
":",
"_AddBuildTargets",
"(",
"target",
",",
"roots",
",",
"True",
",",
"result",
")",
"return",
"result"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/generator/analyzer.py#L426-L433 | |
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/vm/caffe/solver.py | python | Solver.iter | (self) | return self._iter | Return or Set the current iteration. [**PyCaffe Style**]
Parameters
----------
iter : int
The value of iteration to set.
Returns
-------
The current iteration. | Return or Set the current iteration. [**PyCaffe Style**] | [
"Return",
"or",
"Set",
"the",
"current",
"iteration",
".",
"[",
"**",
"PyCaffe",
"Style",
"**",
"]"
] | def iter(self):
"""Return or Set the current iteration. [**PyCaffe Style**]
Parameters
----------
iter : int
The value of iteration to set.
Returns
-------
The current iteration.
"""
return self._iter | [
"def",
"iter",
"(",
"self",
")",
":",
"return",
"self",
".",
"_iter"
] | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/vm/caffe/solver.py#L383-L396 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | WorkingSet.__init__ | (self, entries=None) | Create working set from list of path entries (default=sys.path) | Create working set from list of path entries (default=sys.path) | [
"Create",
"working",
"set",
"from",
"list",
"of",
"path",
"entries",
"(",
"default",
"=",
"sys",
".",
"path",
")"
] | def __init__(self, entries=None):
"""Create working set from list of path entries (default=sys.path)"""
self.entries = []
self.entry_keys = {}
self.by_key = {}
self.callbacks = []
if entries is None:
entries = sys.path
for entry in entries:
... | [
"def",
"__init__",
"(",
"self",
",",
"entries",
"=",
"None",
")",
":",
"self",
".",
"entries",
"=",
"[",
"]",
"self",
".",
"entry_keys",
"=",
"{",
"}",
"self",
".",
"by_key",
"=",
"{",
"}",
"self",
".",
"callbacks",
"=",
"[",
"]",
"if",
"entries"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L557-L568 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | GraphicsGradientStops.SetEndColour | (*args, **kwargs) | return _gdi_.GraphicsGradientStops_SetEndColour(*args, **kwargs) | SetEndColour(self, Colour col) | SetEndColour(self, Colour col) | [
"SetEndColour",
"(",
"self",
"Colour",
"col",
")"
] | def SetEndColour(*args, **kwargs):
"""SetEndColour(self, Colour col)"""
return _gdi_.GraphicsGradientStops_SetEndColour(*args, **kwargs) | [
"def",
"SetEndColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsGradientStops_SetEndColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6106-L6108 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/base.py | python | IndexOpsMixin.to_numpy | (self, dtype=None, copy=False, na_value=lib.no_default, **kwargs) | return result | A NumPy ndarray representing the values in this Series or Index.
.. versionadded:: 0.24.0
Parameters
----------
dtype : str or numpy.dtype, optional
The dtype to pass to :meth:`numpy.asarray`.
copy : bool, default False
Whether to ensure that the returne... | A NumPy ndarray representing the values in this Series or Index. | [
"A",
"NumPy",
"ndarray",
"representing",
"the",
"values",
"in",
"this",
"Series",
"or",
"Index",
"."
] | def to_numpy(self, dtype=None, copy=False, na_value=lib.no_default, **kwargs):
"""
A NumPy ndarray representing the values in this Series or Index.
.. versionadded:: 0.24.0
Parameters
----------
dtype : str or numpy.dtype, optional
The dtype to pass to :meth... | [
"def",
"to_numpy",
"(",
"self",
",",
"dtype",
"=",
"None",
",",
"copy",
"=",
"False",
",",
"na_value",
"=",
"lib",
".",
"no_default",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"is_extension_array_dtype",
"(",
"self",
".",
"dtype",
")",
":",
"return",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/base.py#L741-L851 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/connection.py | python | HTTPConnection.request_chunked | (self, method, url, body=None, headers=None) | Alternative to the common request method, which sends the
body with chunked encoding and not as one block | Alternative to the common request method, which sends the
body with chunked encoding and not as one block | [
"Alternative",
"to",
"the",
"common",
"request",
"method",
"which",
"sends",
"the",
"body",
"with",
"chunked",
"encoding",
"and",
"not",
"as",
"one",
"block"
] | def request_chunked(self, method, url, body=None, headers=None):
"""
Alternative to the common request method, which sends the
body with chunked encoding and not as one block
"""
headers = HTTPHeaderDict(headers if headers is not None else {})
skip_accept_encoding = "acce... | [
"def",
"request_chunked",
"(",
"self",
",",
"method",
",",
"url",
",",
"body",
"=",
"None",
",",
"headers",
"=",
"None",
")",
":",
"headers",
"=",
"HTTPHeaderDict",
"(",
"headers",
"if",
"headers",
"is",
"not",
"None",
"else",
"{",
"}",
")",
"skip_acce... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/connection.py#L187-L220 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py | python | WebSocketServer.get_request | (self) | return accepted_socket, client_address | Override TCPServer.get_request to wrap OpenSSL.SSL.Connection
object with _StandaloneSSLConnection to provide makefile method. We
cannot substitute OpenSSL.SSL.Connection.makefile since it's readonly
attribute. | Override TCPServer.get_request to wrap OpenSSL.SSL.Connection
object with _StandaloneSSLConnection to provide makefile method. We
cannot substitute OpenSSL.SSL.Connection.makefile since it's readonly
attribute. | [
"Override",
"TCPServer",
".",
"get_request",
"to",
"wrap",
"OpenSSL",
".",
"SSL",
".",
"Connection",
"object",
"with",
"_StandaloneSSLConnection",
"to",
"provide",
"makefile",
"method",
".",
"We",
"cannot",
"substitute",
"OpenSSL",
".",
"SSL",
".",
"Connection",
... | def get_request(self):
"""Override TCPServer.get_request to wrap OpenSSL.SSL.Connection
object with _StandaloneSSLConnection to provide makefile method. We
cannot substitute OpenSSL.SSL.Connection.makefile since it's readonly
attribute.
"""
accepted_socket, client_addres... | [
"def",
"get_request",
"(",
"self",
")",
":",
"accepted_socket",
",",
"client_address",
"=",
"self",
".",
"socket",
".",
"accept",
"(",
")",
"server_options",
"=",
"self",
".",
"websocket_server_options",
"if",
"server_options",
".",
"use_tls",
":",
"if",
"serv... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py#L527-L592 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibook.py | python | AuiTabCtrl.OnMiddleDown | (self, event) | Handles the ``wx.EVT_MIDDLE_DOWN`` event for :class:`AuiTabCtrl`.
:param `event`: a :class:`MouseEvent` event to be processed. | Handles the ``wx.EVT_MIDDLE_DOWN`` event for :class:`AuiTabCtrl`. | [
"Handles",
"the",
"wx",
".",
"EVT_MIDDLE_DOWN",
"event",
"for",
":",
"class",
":",
"AuiTabCtrl",
"."
] | def OnMiddleDown(self, event):
"""
Handles the ``wx.EVT_MIDDLE_DOWN`` event for :class:`AuiTabCtrl`.
:param `event`: a :class:`MouseEvent` event to be processed.
"""
self.StopTooltipTimer()
eventHandler = self.GetEventHandler()
if not isinstance(eventHandler, A... | [
"def",
"OnMiddleDown",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"StopTooltipTimer",
"(",
")",
"eventHandler",
"=",
"self",
".",
"GetEventHandler",
"(",
")",
"if",
"not",
"isinstance",
"(",
"eventHandler",
",",
"AuiTabCtrl",
")",
":",
"event",
".",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L2090-L2116 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py | python | EnvironmentInfo.NetFxSDKLibraries | (self) | return [join(self.si.NetFxSdkDir, r'lib\um%s' % arch_subdir)] | Microsoft .Net Framework SDK Libraries.
Return
------
list of str
paths | Microsoft .Net Framework SDK Libraries. | [
"Microsoft",
".",
"Net",
"Framework",
"SDK",
"Libraries",
"."
] | def NetFxSDKLibraries(self):
"""
Microsoft .Net Framework SDK Libraries.
Return
------
list of str
paths
"""
if self.vs_ver < 14.0 or not self.si.NetFxSdkDir:
return []
arch_subdir = self.pi.target_dir(x64=True)
return [jo... | [
"def",
"NetFxSDKLibraries",
"(",
"self",
")",
":",
"if",
"self",
".",
"vs_ver",
"<",
"14.0",
"or",
"not",
"self",
".",
"si",
".",
"NetFxSdkDir",
":",
"return",
"[",
"]",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"target_dir",
"(",
"x64",
"=",
"True... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py#L1538-L1551 | |
PolygonTek/BlueshiftEngine | fbc374cbc391e1147c744649f405a66a27c35d89 | Source/ThirdParty/freetype/src/tools/glnames.py | python | main | () | main program body | main program body | [
"main",
"program",
"body"
] | def main():
"""main program body"""
if len( sys.argv ) != 2:
print __doc__ % sys.argv[0]
sys.exit( 1 )
file = open( sys.argv[1], "wb" )
write = file.write
count_sid = len( sid_standard_names )
# `mac_extras' contains the list of glyph names in the Macintosh standard
# encoding which are not i... | [
"def",
"main",
"(",
")",
":",
"if",
"len",
"(",
"sys",
".",
"argv",
")",
"!=",
"2",
":",
"print",
"__doc__",
"%",
"sys",
".",
"argv",
"[",
"0",
"]",
"sys",
".",
"exit",
"(",
"1",
")",
"file",
"=",
"open",
"(",
"sys",
".",
"argv",
"[",
"1",
... | https://github.com/PolygonTek/BlueshiftEngine/blob/fbc374cbc391e1147c744649f405a66a27c35d89/Source/ThirdParty/freetype/src/tools/glnames.py#L5289-L5532 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/function.py | python | ConcreteFunction.set_external_captures | (self, captures) | Updates the function capture values.
The new values must have tensor types and shapes consistent with the
original captures of the concrete function, but it is allowed to change a
value captured with a deferred one and vice-versa.
Args:
captures: A list of tensors or closures. Tensors are value ... | Updates the function capture values. | [
"Updates",
"the",
"function",
"capture",
"values",
"."
] | def set_external_captures(self, captures):
"""Updates the function capture values.
The new values must have tensor types and shapes consistent with the
original captures of the concrete function, but it is allowed to change a
value captured with a deferred one and vice-versa.
Args:
captures:... | [
"def",
"set_external_captures",
"(",
"self",
",",
"captures",
")",
":",
"# TODO(wxinyi): 1. verify that the new captures' type spec is compatible",
"# with the original's. However, doing so requires MirroredVariable captures",
"# initialized. 2. replace the original/new captures/deferred",
"# ... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/function.py#L1945-L1962 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/examples/learn/text_classification_character_rnn.py | python | char_rnn_model | (features, labels, mode) | return tf.estimator.EstimatorSpec(
mode=mode, loss=loss, eval_metric_ops=eval_metric_ops) | Character level recurrent neural network model to predict classes. | Character level recurrent neural network model to predict classes. | [
"Character",
"level",
"recurrent",
"neural",
"network",
"model",
"to",
"predict",
"classes",
"."
] | def char_rnn_model(features, labels, mode):
"""Character level recurrent neural network model to predict classes."""
byte_vectors = tf.one_hot(features[CHARS_FEATURE], 256, 1., 0.)
byte_list = tf.unstack(byte_vectors, axis=1)
cell = tf.contrib.rnn.GRUCell(HIDDEN_SIZE)
_, encoding = tf.contrib.rnn.static_rnn(... | [
"def",
"char_rnn_model",
"(",
"features",
",",
"labels",
",",
"mode",
")",
":",
"byte_vectors",
"=",
"tf",
".",
"one_hot",
"(",
"features",
"[",
"CHARS_FEATURE",
"]",
",",
"256",
",",
"1.",
",",
"0.",
")",
"byte_list",
"=",
"tf",
".",
"unstack",
"(",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/examples/learn/text_classification_character_rnn.py#L44-L76 | |
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | dynamic_connectivity/quick_find.py | python | QuickFind.union | (self, elem1, elem2) | When connecting two objects elem1 and elem2, change the id of all
objects that have the id of elem1 to that of elem2, or vice-versa.
Time Complexity is O(n), which is too expensive.
:param elem1: element 1
:param elem2: element 2 | When connecting two objects elem1 and elem2, change the id of all
objects that have the id of elem1 to that of elem2, or vice-versa.
Time Complexity is O(n), which is too expensive. | [
"When",
"connecting",
"two",
"objects",
"elem1",
"and",
"elem2",
"change",
"the",
"id",
"of",
"all",
"objects",
"that",
"have",
"the",
"id",
"of",
"elem1",
"to",
"that",
"of",
"elem2",
"or",
"vice",
"-",
"versa",
".",
"Time",
"Complexity",
"is",
"O",
"... | def union(self, elem1, elem2):
""" When connecting two objects elem1 and elem2, change the id of all
objects that have the id of elem1 to that of elem2, or vice-versa.
Time Complexity is O(n), which is too expensive.
:param elem1: element 1
:param elem2: element 2
"""
... | [
"def",
"union",
"(",
"self",
",",
"elem1",
",",
"elem2",
")",
":",
"pid",
"=",
"self",
".",
"data",
"[",
"elem1",
"]",
"qid",
"=",
"self",
".",
"data",
"[",
"elem2",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"data",
")",
"... | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/dynamic_connectivity/quick_find.py#L35-L47 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mailbox.py | python | mbox._post_message_hook | (self, f) | Called after writing each message to file f. | Called after writing each message to file f. | [
"Called",
"after",
"writing",
"each",
"message",
"to",
"file",
"f",
"."
] | def _post_message_hook(self, f):
"""Called after writing each message to file f."""
f.write(os.linesep) | [
"def",
"_post_message_hook",
"(",
"self",
",",
"f",
")",
":",
"f",
".",
"write",
"(",
"os",
".",
"linesep",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L834-L836 | ||
google/mysql-protobuf | 467cda676afaa49e762c5c9164a43f6ad31a1fbf | protobuf/objectivec/DevTools/pddm.py | python | MacroCollection.Expand | (self, macro_ref_str) | return self._Expand(match, [], macro_ref_str) | Expands the macro reference.
Args:
macro_ref_str: String of a macro reference (i.e. foo(a, b)).
Returns:
The text from the expansion.
Raises:
PDDMError if there are any issues. | Expands the macro reference. | [
"Expands",
"the",
"macro",
"reference",
"."
] | def Expand(self, macro_ref_str):
"""Expands the macro reference.
Args:
macro_ref_str: String of a macro reference (i.e. foo(a, b)).
Returns:
The text from the expansion.
Raises:
PDDMError if there are any issues.
"""
match = _MACRO_RE.match(macro_ref_str)
if match is Non... | [
"def",
"Expand",
"(",
"self",
",",
"macro_ref_str",
")",
":",
"match",
"=",
"_MACRO_RE",
".",
"match",
"(",
"macro_ref_str",
")",
"if",
"match",
"is",
"None",
"or",
"match",
".",
"group",
"(",
"0",
")",
"!=",
"macro_ref_str",
":",
"raise",
"PDDMError",
... | https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/objectivec/DevTools/pddm.py#L259-L276 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.