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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_implementations.py | python | bprop_switch | (cond, tb, fb, out, dout) | return C.zeros_like(cond), F.switch(cond, dout, C.zeros_like(tb)), \
F.switch(cond, C.zeros_like(fb), dout) | Backpropagator for primitive `switch`. | Backpropagator for primitive `switch`. | [
"Backpropagator",
"for",
"primitive",
"switch",
"."
] | def bprop_switch(cond, tb, fb, out, dout):
"""Backpropagator for primitive `switch`."""
return C.zeros_like(cond), F.switch(cond, dout, C.zeros_like(tb)), \
F.switch(cond, C.zeros_like(fb), dout) | [
"def",
"bprop_switch",
"(",
"cond",
",",
"tb",
",",
"fb",
",",
"out",
",",
"dout",
")",
":",
"return",
"C",
".",
"zeros_like",
"(",
"cond",
")",
",",
"F",
".",
"switch",
"(",
"cond",
",",
"dout",
",",
"C",
".",
"zeros_like",
"(",
"tb",
")",
")"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_implementations.py#L251-L254 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py | python | PopenSpawn.write | (self, s) | This is similar to send() except that there is no return value. | This is similar to send() except that there is no return value. | [
"This",
"is",
"similar",
"to",
"send",
"()",
"except",
"that",
"there",
"is",
"no",
"return",
"value",
"."
] | def write(self, s):
'''This is similar to send() except that there is no return value.
'''
self.send(s) | [
"def",
"write",
"(",
"self",
",",
"s",
")",
":",
"self",
".",
"send",
"(",
"s",
")"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/popen_spawn.py#L117-L120 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/Queue.py | python | Queue.task_done | (self) | Indicate that a formerly enqueued task is complete.
Used by Queue consumer threads. For each get() used to fetch a task,
a subsequent call to task_done() tells the queue that the processing
on the task is complete.
If a join() is currently blocking, it will resume when all items
... | Indicate that a formerly enqueued task is complete. | [
"Indicate",
"that",
"a",
"formerly",
"enqueued",
"task",
"is",
"complete",
"."
] | def task_done(self):
"""Indicate that a formerly enqueued task is complete.
Used by Queue consumer threads. For each get() used to fetch a task,
a subsequent call to task_done() tells the queue that the processing
on the task is complete.
If a join() is currently blocking, it ... | [
"def",
"task_done",
"(",
"self",
")",
":",
"self",
".",
"all_tasks_done",
".",
"acquire",
"(",
")",
"try",
":",
"unfinished",
"=",
"self",
".",
"unfinished_tasks",
"-",
"1",
"if",
"unfinished",
"<=",
"0",
":",
"if",
"unfinished",
"<",
"0",
":",
"raise"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/Queue.py#L45-L68 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | ConfigBase.Exists | (*args, **kwargs) | return _misc_.ConfigBase_Exists(*args, **kwargs) | Exists(self, String name) -> bool
Returns True if either a group or an entry with a given name exists | Exists(self, String name) -> bool | [
"Exists",
"(",
"self",
"String",
"name",
")",
"-",
">",
"bool"
] | def Exists(*args, **kwargs):
"""
Exists(self, String name) -> bool
Returns True if either a group or an entry with a given name exists
"""
return _misc_.ConfigBase_Exists(*args, **kwargs) | [
"def",
"Exists",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"ConfigBase_Exists",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L3239-L3245 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | ControlFlowState.EnterGradWhileContext | (self, op, before) | Enter the WhileContext for gradient computation. | Enter the WhileContext for gradient computation. | [
"Enter",
"the",
"WhileContext",
"for",
"gradient",
"computation",
"."
] | def EnterGradWhileContext(self, op, before):
"""Enter the WhileContext for gradient computation."""
grad_state = self._GetGradState(op, before)
if grad_state:
grad_state.grad_context.Enter() | [
"def",
"EnterGradWhileContext",
"(",
"self",
",",
"op",
",",
"before",
")",
":",
"grad_state",
"=",
"self",
".",
"_GetGradState",
"(",
"op",
",",
"before",
")",
"if",
"grad_state",
":",
"grad_state",
".",
"grad_context",
".",
"Enter",
"(",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L830-L834 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | PrintDialogData.GetEnablePageNumbers | (*args, **kwargs) | return _windows_.PrintDialogData_GetEnablePageNumbers(*args, **kwargs) | GetEnablePageNumbers(self) -> bool | GetEnablePageNumbers(self) -> bool | [
"GetEnablePageNumbers",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetEnablePageNumbers(*args, **kwargs):
"""GetEnablePageNumbers(self) -> bool"""
return _windows_.PrintDialogData_GetEnablePageNumbers(*args, **kwargs) | [
"def",
"GetEnablePageNumbers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintDialogData_GetEnablePageNumbers",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5138-L5140 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/type_checkers.py | python | GetTypeChecker | (field) | return _VALUE_CHECKERS[field.cpp_type] | Returns a type checker for a message field of the specified types.
Args:
field: FieldDescriptor object for this field.
Returns:
An instance of TypeChecker which can be used to verify the types
of values assigned to a field of the specified type. | Returns a type checker for a message field of the specified types. | [
"Returns",
"a",
"type",
"checker",
"for",
"a",
"message",
"field",
"of",
"the",
"specified",
"types",
"."
] | def GetTypeChecker(field):
"""Returns a type checker for a message field of the specified types.
Args:
field: FieldDescriptor object for this field.
Returns:
An instance of TypeChecker which can be used to verify the types
of values assigned to a field of the specified type.
"""
if (field.cpp_ty... | [
"def",
"GetTypeChecker",
"(",
"field",
")",
":",
"if",
"(",
"field",
".",
"cpp_type",
"==",
"_FieldDescriptor",
".",
"CPPTYPE_STRING",
"and",
"field",
".",
"type",
"==",
"_FieldDescriptor",
".",
"TYPE_STRING",
")",
":",
"return",
"UnicodeValueChecker",
"(",
")... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/type_checkers.py#L64-L83 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/data_table_view.py | python | DataTableModel._getCellText | (self, row, col) | return self._dataToText(row, col, rowData[col]).strip() if len(rowData) > col else None | get the text of a cell
:param row: row of the cell
:param col: column of the cell
:return: text of the cell | get the text of a cell
:param row: row of the cell
:param col: column of the cell
:return: text of the cell | [
"get",
"the",
"text",
"of",
"a",
"cell",
":",
"param",
"row",
":",
"row",
"of",
"the",
"cell",
":",
"param",
"col",
":",
"column",
"of",
"the",
"cell",
":",
"return",
":",
"text",
"of",
"the",
"cell"
] | def _getCellText(self, row, col):
"""
get the text of a cell
:param row: row of the cell
:param col: column of the cell
:return: text of the cell
"""
rowData = self._getRow(row)
return self._dataToText(row, col, rowData[col]).strip() if len(rowData) > col ... | [
"def",
"_getCellText",
"(",
"self",
",",
"row",
",",
"col",
")",
":",
"rowData",
"=",
"self",
".",
"_getRow",
"(",
"row",
")",
"return",
"self",
".",
"_dataToText",
"(",
"row",
",",
"col",
",",
"rowData",
"[",
"col",
"]",
")",
".",
"strip",
"(",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/data_table_view.py#L108-L116 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/notemacs.py | python | NotEmacsMode.backward_kill_line | (self, e) | Kill backward to the beginning of the line. | Kill backward to the beginning of the line. | [
"Kill",
"backward",
"to",
"the",
"beginning",
"of",
"the",
"line",
"."
] | def backward_kill_line(self, e): # (C-x Rubout)
'''Kill backward to the beginning of the line. '''
self.l_buffer.backward_kill_line() | [
"def",
"backward_kill_line",
"(",
"self",
",",
"e",
")",
":",
"# (C-x Rubout)",
"self",
".",
"l_buffer",
".",
"backward_kill_line",
"(",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/notemacs.py#L326-L328 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetExecutableName | (self) | Returns the executable name of the bundle represented by this target.
E.g. Chromium. | Returns the executable name of the bundle represented by this target.
E.g. Chromium. | [
"Returns",
"the",
"executable",
"name",
"of",
"the",
"bundle",
"represented",
"by",
"this",
"target",
".",
"E",
".",
"g",
".",
"Chromium",
"."
] | def GetExecutableName(self):
"""Returns the executable name of the bundle represented by this target.
E.g. Chromium."""
if self._IsBundle():
return self.spec.get('product_name', self.spec['target_name'])
else:
return self._GetStandaloneBinaryPath() | [
"def",
"GetExecutableName",
"(",
"self",
")",
":",
"if",
"self",
".",
"_IsBundle",
"(",
")",
":",
"return",
"self",
".",
"spec",
".",
"get",
"(",
"'product_name'",
",",
"self",
".",
"spec",
"[",
"'target_name'",
"]",
")",
"else",
":",
"return",
"self",... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L401-L407 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | FormulaFactory.instance | (self, type) | return self.instances[type] | Get an instance of the given type. | Get an instance of the given type. | [
"Get",
"an",
"instance",
"of",
"the",
"given",
"type",
"."
] | def instance(self, type):
"Get an instance of the given type."
if not type in self.instances or not self.instances[type]:
self.instances[type] = self.create(type)
return self.instances[type] | [
"def",
"instance",
"(",
"self",
",",
"type",
")",
":",
"if",
"not",
"type",
"in",
"self",
".",
"instances",
"or",
"not",
"self",
".",
"instances",
"[",
"type",
"]",
":",
"self",
".",
"instances",
"[",
"type",
"]",
"=",
"self",
".",
"create",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L3042-L3046 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/web-crawler-multithreaded.py | python | HtmlParser.getUrls | (self, url) | :type url: str
:rtype List[str] | :type url: str
:rtype List[str] | [
":",
"type",
"url",
":",
"str",
":",
"rtype",
"List",
"[",
"str",
"]"
] | def getUrls(self, url):
"""
:type url: str
:rtype List[str]
"""
pass | [
"def",
"getUrls",
"(",
"self",
",",
"url",
")",
":",
"pass"
] | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/web-crawler-multithreaded.py#L13-L18 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Accuracy.py | python | Accuracy.reset | (self, reset) | Specifies if the statistics should be reset after each run. | Specifies if the statistics should be reset after each run. | [
"Specifies",
"if",
"the",
"statistics",
"should",
"be",
"reset",
"after",
"each",
"run",
"."
] | def reset(self, reset):
"""Specifies if the statistics should be reset after each run.
"""
self._internal.set_reset(bool(reset)) | [
"def",
"reset",
"(",
"self",
",",
"reset",
")",
":",
"self",
".",
"_internal",
".",
"set_reset",
"(",
"bool",
"(",
"reset",
")",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Accuracy.py#L74-L77 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/functions/EISFDiffSphere.py | python | EISFDiffSphere.function1D | (self, xvals) | return self.getParameterValue('A') * np.square(3 * self.vecbessel(zs)) | r"""Calculate the intensities
Parameters
----------
xvals : sequence of floats
The domain where to evaluate the function
jacobian: 2D array
partial derivative of the function with respect to the fitting
parameters evaluated at the domain.
Returns
... | r"""Calculate the intensities | [
"r",
"Calculate",
"the",
"intensities"
] | def function1D(self, xvals):
r"""Calculate the intensities
Parameters
----------
xvals : sequence of floats
The domain where to evaluate the function
jacobian: 2D array
partial derivative of the function with respect to the fitting
parameters evalua... | [
"def",
"function1D",
"(",
"self",
",",
"xvals",
")",
":",
"zs",
"=",
"self",
".",
"getParameterValue",
"(",
"'R'",
")",
"*",
"np",
".",
"asarray",
"(",
"xvals",
")",
"return",
"self",
".",
"getParameterValue",
"(",
"'A'",
")",
"*",
"np",
".",
"square... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/functions/EISFDiffSphere.py#L45-L62 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | _handle_ns | (packageName, path_item) | return subpath | Ensure that named package includes a subpath of path_item (if needed) | Ensure that named package includes a subpath of path_item (if needed) | [
"Ensure",
"that",
"named",
"package",
"includes",
"a",
"subpath",
"of",
"path_item",
"(",
"if",
"needed",
")"
] | def _handle_ns(packageName, path_item):
"""Ensure that named package includes a subpath of path_item (if needed)"""
importer = get_importer(path_item)
if importer is None:
return None
# use find_spec (PEP 451) and fall-back to find_module (PEP 302)
try:
loader = importer.find_spec(... | [
"def",
"_handle_ns",
"(",
"packageName",
",",
"path_item",
")",
":",
"importer",
"=",
"get_importer",
"(",
"path_item",
")",
"if",
"importer",
"is",
"None",
":",
"return",
"None",
"# use find_spec (PEP 451) and fall-back to find_module (PEP 302)",
"try",
":",
"loader"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L2193-L2225 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/check_ops.py | python | assert_less | (x, y, data=None, summarize=None, message=None, name=None) | Assert the condition `x < y` holds element-wise.
Example of adding a dependency to an operation:
```python
with tf.control_dependencies([tf.assert_less(x, y)]):
output = tf.reduce_sum(x)
```
Example of adding dependency to the tensor being checked:
```python
x = tf.with_dependencies([tf.assert_les... | Assert the condition `x < y` holds element-wise. | [
"Assert",
"the",
"condition",
"x",
"<",
"y",
"holds",
"element",
"-",
"wise",
"."
] | def assert_less(x, y, data=None, summarize=None, message=None, name=None):
"""Assert the condition `x < y` holds element-wise.
Example of adding a dependency to an operation:
```python
with tf.control_dependencies([tf.assert_less(x, y)]):
output = tf.reduce_sum(x)
```
Example of adding dependency to ... | [
"def",
"assert_less",
"(",
"x",
",",
"y",
",",
"data",
"=",
"None",
",",
"summarize",
"=",
"None",
",",
"message",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"message",
"=",
"message",
"or",
"''",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/check_ops.py#L311-L354 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/affine/index.py | python | index.numeric | (self, values) | return values[0][self._orig_key] | Returns the index/slice into the given value. | Returns the index/slice into the given value. | [
"Returns",
"the",
"index",
"/",
"slice",
"into",
"the",
"given",
"value",
"."
] | def numeric(self, values):
""" Returns the index/slice into the given value.
"""
return values[0][self._orig_key] | [
"def",
"numeric",
"(",
"self",
",",
"values",
")",
":",
"return",
"values",
"[",
"0",
"]",
"[",
"self",
".",
"_orig_key",
"]"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/index.py#L72-L75 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/input.py | python | TurnIntIntoStrInDict | (the_dict) | Given dict the_dict, recursively converts all integers into strings. | Given dict the_dict, recursively converts all integers into strings. | [
"Given",
"dict",
"the_dict",
"recursively",
"converts",
"all",
"integers",
"into",
"strings",
"."
] | def TurnIntIntoStrInDict(the_dict):
"""Given dict the_dict, recursively converts all integers into strings.
"""
# Use items instead of iteritems because there's no need to try to look at
# reinserted keys and their associated values.
for k, v in the_dict.items():
if type(v) is int:
v = str(v)
... | [
"def",
"TurnIntIntoStrInDict",
"(",
"the_dict",
")",
":",
"# Use items instead of iteritems because there's no need to try to look at",
"# reinserted keys and their associated values.",
"for",
"k",
",",
"v",
"in",
"the_dict",
".",
"items",
"(",
")",
":",
"if",
"type",
"(",
... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/input.py#L2289-L2305 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/constraint_solver/samples/cvrptw_break.py | python | create_data_model | () | return data | Stores the data for the problem. | Stores the data for the problem. | [
"Stores",
"the",
"data",
"for",
"the",
"problem",
"."
] | def create_data_model():
"""Stores the data for the problem."""
data = {}
# Locations in block unit
locations_ = \
[(4, 4), # depot
(2, 0), (8, 0), # locations to visit
(0, 1), (1, 1),
(5, 2), (7, 2),
(3, 3), (6, 3),
(5, 5), ... | [
"def",
"create_data_model",
"(",
")",
":",
"data",
"=",
"{",
"}",
"# Locations in block unit",
"locations_",
"=",
"[",
"(",
"4",
",",
"4",
")",
",",
"# depot",
"(",
"2",
",",
"0",
")",
",",
"(",
"8",
",",
"0",
")",
",",
"# locations to visit",
"(",
... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/samples/cvrptw_break.py#L33-L79 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgi.py | python | FieldStorage.__contains__ | (self, key) | return any(item.name == key for item in self.list) | Dictionary style __contains__ method. | Dictionary style __contains__ method. | [
"Dictionary",
"style",
"__contains__",
"method",
"."
] | def __contains__(self, key):
"""Dictionary style __contains__ method."""
if self.list is None:
raise TypeError("not indexable")
return any(item.name == key for item in self.list) | [
"def",
"__contains__",
"(",
"self",
",",
"key",
")",
":",
"if",
"self",
".",
"list",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"\"not indexable\"",
")",
"return",
"any",
"(",
"item",
".",
"name",
"==",
"key",
"for",
"item",
"in",
"self",
".",
"li... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgi.py#L587-L591 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/wheel.py | python | Wheel.filename | (self) | return '%s-%s%s-%s-%s-%s.whl' % (self.name, version, buildver,
pyver, abi, arch) | Build and return a filename from the various components. | Build and return a filename from the various components. | [
"Build",
"and",
"return",
"a",
"filename",
"from",
"the",
"various",
"components",
"."
] | def filename(self):
"""
Build and return a filename from the various components.
"""
if self.buildver:
buildver = '-' + self.buildver
else:
buildver = ''
pyver = '.'.join(self.pyver)
abi = '.'.join(self.abi)
arch = '.'.join(self.arc... | [
"def",
"filename",
"(",
"self",
")",
":",
"if",
"self",
".",
"buildver",
":",
"buildver",
"=",
"'-'",
"+",
"self",
".",
"buildver",
"else",
":",
"buildver",
"=",
"''",
"pyver",
"=",
"'.'",
".",
"join",
"(",
"self",
".",
"pyver",
")",
"abi",
"=",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/wheel.py#L186-L200 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | MajorObject.GetMetadataItem | (self, *args) | return _ogr.MajorObject_GetMetadataItem(self, *args) | r"""GetMetadataItem(MajorObject self, char const * pszName, char const * pszDomain="") -> char const * | r"""GetMetadataItem(MajorObject self, char const * pszName, char const * pszDomain="") -> char const * | [
"r",
"GetMetadataItem",
"(",
"MajorObject",
"self",
"char",
"const",
"*",
"pszName",
"char",
"const",
"*",
"pszDomain",
"=",
")",
"-",
">",
"char",
"const",
"*"
] | def GetMetadataItem(self, *args):
r"""GetMetadataItem(MajorObject self, char const * pszName, char const * pszDomain="") -> char const *"""
return _ogr.MajorObject_GetMetadataItem(self, *args) | [
"def",
"GetMetadataItem",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"MajorObject_GetMetadataItem",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L443-L445 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/stubs.py | python | ds_permute | (src_lane, dest_lane) | AMDGCN Data Share intrinsic forwards permute (push semantics) | AMDGCN Data Share intrinsic forwards permute (push semantics) | [
"AMDGCN",
"Data",
"Share",
"intrinsic",
"forwards",
"permute",
"(",
"push",
"semantics",
")"
] | def ds_permute(src_lane, dest_lane):
"""
AMDGCN Data Share intrinsic forwards permute (push semantics)
"""
raise _stub_error | [
"def",
"ds_permute",
"(",
"src_lane",
",",
"dest_lane",
")",
":",
"raise",
"_stub_error"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/stubs.py#L102-L106 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ShallowWaterApplication/python_scripts/benchmarks/base_benchmark_process.py | python | BaseBenchmarkProcess.Check | (self) | Check if the input values have physical sense. | Check if the input values have physical sense. | [
"Check",
"if",
"the",
"input",
"values",
"have",
"physical",
"sense",
"."
] | def Check(self):
"""Check if the input values have physical sense."""
if len(self.variables) != len(self.exact_variables):
raise Exception("The input variables list does not match the input exact variables list")
if len(self.variables) != len(self.error_variables):
rais... | [
"def",
"Check",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"variables",
")",
"!=",
"len",
"(",
"self",
".",
"exact_variables",
")",
":",
"raise",
"Exception",
"(",
"\"The input variables list does not match the input exact variables list\"",
")",
"if",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ShallowWaterApplication/python_scripts/benchmarks/base_benchmark_process.py#L81-L97 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/codecs.py | python | getwriter | (encoding) | return lookup(encoding).streamwriter | Lookup up the codec for the given encoding and return
its StreamWriter class or factory function.
Raises a LookupError in case the encoding cannot be found. | Lookup up the codec for the given encoding and return
its StreamWriter class or factory function. | [
"Lookup",
"up",
"the",
"codec",
"for",
"the",
"given",
"encoding",
"and",
"return",
"its",
"StreamWriter",
"class",
"or",
"factory",
"function",
"."
] | def getwriter(encoding):
""" Lookup up the codec for the given encoding and return
its StreamWriter class or factory function.
Raises a LookupError in case the encoding cannot be found.
"""
return lookup(encoding).streamwriter | [
"def",
"getwriter",
"(",
"encoding",
")",
":",
"return",
"lookup",
"(",
"encoding",
")",
".",
"streamwriter"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/codecs.py#L1014-L1022 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/decl_factory.py | python | decl_factory_t.create_constructor | (self, *arguments, **keywords) | return constructor_t(*arguments, **keywords) | creates instance of class that describes constructor declaration | creates instance of class that describes constructor declaration | [
"creates",
"instance",
"of",
"class",
"that",
"describes",
"constructor",
"declaration"
] | def create_constructor(self, *arguments, **keywords):
"""creates instance of class that describes constructor declaration"""
return constructor_t(*arguments, **keywords) | [
"def",
"create_constructor",
"(",
"self",
",",
"*",
"arguments",
",",
"*",
"*",
"keywords",
")",
":",
"return",
"constructor_t",
"(",
"*",
"arguments",
",",
"*",
"*",
"keywords",
")"
] | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/decl_factory.py#L40-L42 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/aoc/processor.py | python | AoCProcessor.link_researchables | (full_data_set) | Link techs to their buildings. This is done
to provide quick access during conversion.
:param full_data_set: GenieObjectContainer instance that
contains all relevant data for the conversion
process.
:type full_data_set: class: ...dataf... | Link techs to their buildings. This is done
to provide quick access during conversion. | [
"Link",
"techs",
"to",
"their",
"buildings",
".",
"This",
"is",
"done",
"to",
"provide",
"quick",
"access",
"during",
"conversion",
"."
] | def link_researchables(full_data_set):
"""
Link techs to their buildings. This is done
to provide quick access during conversion.
:param full_data_set: GenieObjectContainer instance that
contains all relevant data for the conversion
... | [
"def",
"link_researchables",
"(",
"full_data_set",
")",
":",
"tech_groups",
"=",
"full_data_set",
".",
"tech_groups",
"for",
"tech",
"in",
"tech_groups",
".",
"values",
"(",
")",
":",
"if",
"tech",
".",
"is_researchable",
"(",
")",
":",
"research_location_id",
... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/processor.py#L1087-L1102 | ||
electron-archive/brightray | 3d9ebb549990d50ab67b705b8ff16433a3dbc546 | tools/mac/change_mach_o_flags.py | python | HandleFatFile | (file, options, fat_offset=0) | Seeks the file-like |file| object to |offset| and loops over its
|fat_header| entries, calling HandleMachOFile for each. | Seeks the file-like |file| object to |offset| and loops over its
|fat_header| entries, calling HandleMachOFile for each. | [
"Seeks",
"the",
"file",
"-",
"like",
"|file|",
"object",
"to",
"|offset|",
"and",
"loops",
"over",
"its",
"|fat_header|",
"entries",
"calling",
"HandleMachOFile",
"for",
"each",
"."
] | def HandleFatFile(file, options, fat_offset=0):
"""Seeks the file-like |file| object to |offset| and loops over its
|fat_header| entries, calling HandleMachOFile for each."""
CheckedSeek(file, fat_offset)
magic = ReadUInt32(file, '>')
assert magic == FAT_MAGIC
nfat_arch = ReadUInt32(file, '>')
for inde... | [
"def",
"HandleFatFile",
"(",
"file",
",",
"options",
",",
"fat_offset",
"=",
"0",
")",
":",
"CheckedSeek",
"(",
"file",
",",
"fat_offset",
")",
"magic",
"=",
"ReadUInt32",
"(",
"file",
",",
"'>'",
")",
"assert",
"magic",
"==",
"FAT_MAGIC",
"nfat_arch",
"... | https://github.com/electron-archive/brightray/blob/3d9ebb549990d50ab67b705b8ff16433a3dbc546/tools/mac/change_mach_o_flags.py#L221-L239 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/slice_sans_event.py | python | _get_scaled_workspace | (workspace, factor) | return multiply_alg.getProperty("OutputWorkspace").value | Scales a workspace by a specified factor.
:param workspace: the workspace to scale.
:param factor: the scale factor.
:return: the scaled workspace. | Scales a workspace by a specified factor. | [
"Scales",
"a",
"workspace",
"by",
"a",
"specified",
"factor",
"."
] | def _get_scaled_workspace(workspace, factor):
"""
Scales a workspace by a specified factor.
:param workspace: the workspace to scale.
:param factor: the scale factor.
:return: the scaled workspace.
"""
single_valued_name = "CreateSingleValuedWorkspace"
single_valued_options = {"OutputWo... | [
"def",
"_get_scaled_workspace",
"(",
"workspace",
",",
"factor",
")",
":",
"single_valued_name",
"=",
"\"CreateSingleValuedWorkspace\"",
"single_valued_options",
"=",
"{",
"\"OutputWorkspace\"",
":",
"EMPTY_NAME",
",",
"\"DataValue\"",
":",
"factor",
"}",
"single_valued_a... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/slice_sans_event.py#L116-L137 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiToolBar.GetToolIndex | (*args, **kwargs) | return _aui.AuiToolBar_GetToolIndex(*args, **kwargs) | GetToolIndex(self, int toolId) -> int | GetToolIndex(self, int toolId) -> int | [
"GetToolIndex",
"(",
"self",
"int",
"toolId",
")",
"-",
">",
"int"
] | def GetToolIndex(*args, **kwargs):
"""GetToolIndex(self, int toolId) -> int"""
return _aui.AuiToolBar_GetToolIndex(*args, **kwargs) | [
"def",
"GetToolIndex",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_GetToolIndex",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L2094-L2096 | |
Yijunmaverick/GenerativeFaceCompletion | f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2 | scripts/cpp_lint.py | python | _CppLintState.PrintErrorCounts | (self) | Print a summary of errors by category, and the total. | Print a summary of errors by category, and the total. | [
"Print",
"a",
"summary",
"of",
"errors",
"by",
"category",
"and",
"the",
"total",
"."
] | def PrintErrorCounts(self):
"""Print a summary of errors by category, and the total."""
for category, count in self.errors_by_category.iteritems():
sys.stderr.write('Category \'%s\' errors found: %d\n' %
(category, count))
sys.stderr.write('Total errors found: %d\n' % self.error... | [
"def",
"PrintErrorCounts",
"(",
"self",
")",
":",
"for",
"category",
",",
"count",
"in",
"self",
".",
"errors_by_category",
".",
"iteritems",
"(",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"'Category \\'%s\\' errors found: %d\\n'",
"%",
"(",
"category... | https://github.com/Yijunmaverick/GenerativeFaceCompletion/blob/f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2/scripts/cpp_lint.py#L757-L762 | ||
lawy623/SVS | b7c7ae367c82a4797ff4a896a2ff304f02e7f724 | caffe/scripts/cpp_lint.py | python | CheckBraces | (filename, clean_lines, linenum, error) | Looks for misplaced braces (e.g. at the end of line).
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Looks for misplaced braces (e.g. at the end of line). | [
"Looks",
"for",
"misplaced",
"braces",
"(",
"e",
".",
"g",
".",
"at",
"the",
"end",
"of",
"line",
")",
"."
] | def CheckBraces(filename, clean_lines, linenum, error):
"""Looks for misplaced braces (e.g. at the end of line).
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any er... | [
"def",
"CheckBraces",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# get rid of comments and strings",
"if",
"Match",
"(",
"r'\\s*{\\s*$'",
",",
"line",
")",
":",
... | https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L3069-L3240 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/reinforcement-learning/a3c/launcher.py | python | submit | (args) | Submit function of local jobs. | Submit function of local jobs. | [
"Submit",
"function",
"of",
"local",
"jobs",
"."
] | def submit(args):
gpus = args.gpus.strip().split(',')
"""Submit function of local jobs."""
def mthread_submit(nworker, nserver, envs):
"""
customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional p... | [
"def",
"submit",
"(",
"args",
")",
":",
"gpus",
"=",
"args",
".",
"gpus",
".",
"strip",
"(",
")",
".",
"split",
"(",
"','",
")",
"def",
"mthread_submit",
"(",
"nworker",
",",
"nserver",
",",
"envs",
")",
":",
"\"\"\"\n customized submit script, that... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/reinforcement-learning/a3c/launcher.py#L79-L106 | ||
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.MergeFrom | (self, other) | Appends the contents of another repeated field of the same type to this
one, copying each individual message. | Appends the contents of another repeated field of the same type to this
one, copying each individual message. | [
"Appends",
"the",
"contents",
"of",
"another",
"repeated",
"field",
"of",
"the",
"same",
"type",
"to",
"this",
"one",
"copying",
"each",
"individual",
"message",
"."
] | def MergeFrom(self, other):
"""Appends the contents of another repeated field of the same type to this
one, copying each individual message.
"""
self.extend(other._values) | [
"def",
"MergeFrom",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"extend",
"(",
"other",
".",
"_values",
")"
] | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py#L232-L236 | ||
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/msvs.py | python | _GetMSBuildExternalBuilderTargets | (spec) | return targets | Return a list of MSBuild targets for external builders.
The "Build" and "Clean" targets are always generated. If the spec contains
'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also
be generated, to support building selected C/C++ files.
Arguments:
spec: The gyp target spec.
R... | Return a list of MSBuild targets for external builders. | [
"Return",
"a",
"list",
"of",
"MSBuild",
"targets",
"for",
"external",
"builders",
"."
] | def _GetMSBuildExternalBuilderTargets(spec):
"""Return a list of MSBuild targets for external builders.
The "Build" and "Clean" targets are always generated. If the spec contains
'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also
be generated, to support building selected C/C++ files... | [
"def",
"_GetMSBuildExternalBuilderTargets",
"(",
"spec",
")",
":",
"build_cmd",
"=",
"_BuildCommandLineForRuleRaw",
"(",
"spec",
",",
"spec",
"[",
"'msvs_external_builder_build_cmd'",
"]",
",",
"False",
",",
"False",
",",
"False",
",",
"False",
")",
"build_target",
... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/msvs.py#L3346-L3380 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py | python | _make_zipfile | (base_name, base_dir, verbose=0, dry_run=0, logger=None) | return zip_filename | Create a zip file from all the files under 'base_dir'.
The output zip file will be named 'base_name' + ".zip". Uses either the
"zipfile" Python module (if available) or the InfoZIP "zip" utility
(if installed and found on the default search path). If neither tool is
available, raises ExecError. Retu... | Create a zip file from all the files under 'base_dir'. | [
"Create",
"a",
"zip",
"file",
"from",
"all",
"the",
"files",
"under",
"base_dir",
"."
] | def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
"""Create a zip file from all the files under 'base_dir'.
The output zip file will be named 'base_name' + ".zip". Uses either the
"zipfile" Python module (if available) or the InfoZIP "zip" utility
(if installed and found on th... | [
"def",
"_make_zipfile",
"(",
"base_name",
",",
"base_dir",
",",
"verbose",
"=",
"0",
",",
"dry_run",
"=",
"0",
",",
"logger",
"=",
"None",
")",
":",
"zip_filename",
"=",
"base_name",
"+",
"\".zip\"",
"archive_dir",
"=",
"os",
".",
"path",
".",
"dirname",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py#L455-L500 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | _flatten | (tuple) | return res | Internal function. | Internal function. | [
"Internal",
"function",
"."
] | def _flatten(tuple):
"""Internal function."""
res = ()
for item in tuple:
if type(item) in (TupleType, ListType):
res = res + _flatten(item)
elif item is not None:
res = res + (item,)
return res | [
"def",
"_flatten",
"(",
"tuple",
")",
":",
"res",
"=",
"(",
")",
"for",
"item",
"in",
"tuple",
":",
"if",
"type",
"(",
"item",
")",
"in",
"(",
"TupleType",
",",
"ListType",
")",
":",
"res",
"=",
"res",
"+",
"_flatten",
"(",
"item",
")",
"elif",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L96-L104 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py | python | TarIter.__iter__ | (self) | return self | Return iterator object. | Return iterator object. | [
"Return",
"iterator",
"object",
"."
] | def __iter__(self):
"""Return iterator object.
"""
return self | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"self"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py#L2565-L2568 | |
Komnomnomnom/swigibpy | cfd307fdbfaffabc69a2dc037538d7e34a8b8daf | swigibpy.py | python | EClient.cancelOrder | (self, id) | return _swigibpy.EClient_cancelOrder(self, id) | cancelOrder(EClient self, OrderId id) | cancelOrder(EClient self, OrderId id) | [
"cancelOrder",
"(",
"EClient",
"self",
"OrderId",
"id",
")"
] | def cancelOrder(self, id):
"""cancelOrder(EClient self, OrderId id)"""
return _swigibpy.EClient_cancelOrder(self, id) | [
"def",
"cancelOrder",
"(",
"self",
",",
"id",
")",
":",
"return",
"_swigibpy",
".",
"EClient_cancelOrder",
"(",
"self",
",",
"id",
")"
] | https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L1130-L1132 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/addfunctiondialog/view.py | python | AddFunctionDialogView.is_text_in_function_list | (self, function: str) | return self.ui.functionBox.findText(function, Qt.MatchExactly) != -1 | Return True if the given str is in the function list | Return True if the given str is in the function list | [
"Return",
"True",
"if",
"the",
"given",
"str",
"is",
"in",
"the",
"function",
"list"
] | def is_text_in_function_list(self, function: str) -> bool:
"""Return True if the given str is in the function list"""
return self.ui.functionBox.findText(function, Qt.MatchExactly) != -1 | [
"def",
"is_text_in_function_list",
"(",
"self",
",",
"function",
":",
"str",
")",
"->",
"bool",
":",
"return",
"self",
".",
"ui",
".",
"functionBox",
".",
"findText",
"(",
"function",
",",
"Qt",
".",
"MatchExactly",
")",
"!=",
"-",
"1"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/addfunctiondialog/view.py#L68-L70 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Decimal.is_canonical | (self) | return True | Return True if self is canonical; otherwise return False.
Currently, the encoding of a Decimal instance is always
canonical, so this method returns True for any Decimal. | Return True if self is canonical; otherwise return False. | [
"Return",
"True",
"if",
"self",
"is",
"canonical",
";",
"otherwise",
"return",
"False",
"."
] | def is_canonical(self):
"""Return True if self is canonical; otherwise return False.
Currently, the encoding of a Decimal instance is always
canonical, so this method returns True for any Decimal.
"""
return True | [
"def",
"is_canonical",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L3007-L3013 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBQueue.__init__ | (self, *args) | __init__(lldb::SBQueue self) -> SBQueue
__init__(lldb::SBQueue self, lldb::QueueSP const & queue_sp) -> SBQueue | __init__(lldb::SBQueue self) -> SBQueue
__init__(lldb::SBQueue self, lldb::QueueSP const & queue_sp) -> SBQueue | [
"__init__",
"(",
"lldb",
"::",
"SBQueue",
"self",
")",
"-",
">",
"SBQueue",
"__init__",
"(",
"lldb",
"::",
"SBQueue",
"self",
"lldb",
"::",
"QueueSP",
"const",
"&",
"queue_sp",
")",
"-",
">",
"SBQueue"
] | def __init__(self, *args):
"""
__init__(lldb::SBQueue self) -> SBQueue
__init__(lldb::SBQueue self, lldb::QueueSP const & queue_sp) -> SBQueue
"""
this = _lldb.new_SBQueue(*args)
try:
self.this.append(this)
except __builtin__.Exception:
sel... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"this",
"=",
"_lldb",
".",
"new_SBQueue",
"(",
"*",
"args",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
"__builtin__",
".",
"Exception",
":",
"self",
"... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9041-L9050 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintspointgrp.py | python | PointGroup.__init__ | (self, *args) | Constructor | Constructor | [
"Constructor"
] | def __init__(self, *args):
"""Constructor"""
# Schoenflies symbol
self.symb = 'c1'
# point of origin
self.PYorigin = [0.0, 0.0, 0.0]
# bit representation of point group
self.PYbits = 0
# Divert to constructor functions
# if len(args) == 0:
# ... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"# Schoenflies symbol",
"self",
".",
"symb",
"=",
"'c1'",
"# point of origin",
"self",
".",
"PYorigin",
"=",
"[",
"0.0",
",",
"0.0",
",",
"0.0",
"]",
"# bit representation of point group",
"self",
"... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintspointgrp.py#L1512-L1540 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | Driver.DeleteDataSource | (self, *args) | return _ogr.Driver_DeleteDataSource(self, *args) | r"""DeleteDataSource(Driver self, char const * utf8_path) -> int | r"""DeleteDataSource(Driver self, char const * utf8_path) -> int | [
"r",
"DeleteDataSource",
"(",
"Driver",
"self",
"char",
"const",
"*",
"utf8_path",
")",
"-",
">",
"int"
] | def DeleteDataSource(self, *args):
r"""DeleteDataSource(Driver self, char const * utf8_path) -> int"""
return _ogr.Driver_DeleteDataSource(self, *args) | [
"def",
"DeleteDataSource",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"Driver_DeleteDataSource",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L536-L538 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/device_setter.py | python | _ReplicaDeviceChooser.__init__ | (self, ps_tasks, ps_device, worker_device, merge_devices, ps_ops,
ps_strategy) | Create a new `_ReplicaDeviceChooser`.
Args:
ps_tasks: Number of tasks in the `ps` job.
ps_device: String. Name of the `ps` job.
worker_device: String. Name of the `worker` job.
merge_devices: Boolean. Set to True to allow merging of device specs.
ps_ops: List of strings representing... | Create a new `_ReplicaDeviceChooser`. | [
"Create",
"a",
"new",
"_ReplicaDeviceChooser",
"."
] | def __init__(self, ps_tasks, ps_device, worker_device, merge_devices, ps_ops,
ps_strategy):
"""Create a new `_ReplicaDeviceChooser`.
Args:
ps_tasks: Number of tasks in the `ps` job.
ps_device: String. Name of the `ps` job.
worker_device: String. Name of the `worker` job.
... | [
"def",
"__init__",
"(",
"self",
",",
"ps_tasks",
",",
"ps_device",
",",
"worker_device",
",",
"merge_devices",
",",
"ps_ops",
",",
"ps_strategy",
")",
":",
"self",
".",
"_ps_tasks",
"=",
"ps_tasks",
"self",
".",
"_ps_device",
"=",
"ps_device",
"self",
".",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/device_setter.py#L66-L86 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py | python | ungroup | (expr) | return TokenConverter(expr).setParseAction(lambda t:t[0]) | Helper to undo pyparsing's default grouping of And expressions, even
if all but one are non-empty. | Helper to undo pyparsing's default grouping of And expressions, even
if all but one are non-empty. | [
"Helper",
"to",
"undo",
"pyparsing",
"s",
"default",
"grouping",
"of",
"And",
"expressions",
"even",
"if",
"all",
"but",
"one",
"are",
"non",
"-",
"empty",
"."
] | def ungroup(expr):
"""
Helper to undo pyparsing's default grouping of And expressions, even
if all but one are non-empty.
"""
return TokenConverter(expr).setParseAction(lambda t:t[0]) | [
"def",
"ungroup",
"(",
"expr",
")",
":",
"return",
"TokenConverter",
"(",
"expr",
")",
".",
"setParseAction",
"(",
"lambda",
"t",
":",
"t",
"[",
"0",
"]",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py#L4718-L4723 | |
fifengine/fifengine | 4b62c42e85bec19893cef8e63e6855927cff2c47 | engine/python/fife/extensions/pychan/__init__.py | python | setUnicodePolicy | (*policy) | Set the unicode error handling policy.
Possible options are:
- 'strict' meaning that encoding errors raise a UnicodeEncodeError.
- 'ignore' all encoding errors will be silently ignored.
- 'replace' all errors are replaced by the next argument.
For further information look at the python documentation,
especi... | Set the unicode error handling policy.
Possible options are:
- 'strict' meaning that encoding errors raise a UnicodeEncodeError.
- 'ignore' all encoding errors will be silently ignored.
- 'replace' all errors are replaced by the next argument. | [
"Set",
"the",
"unicode",
"error",
"handling",
"policy",
".",
"Possible",
"options",
"are",
":",
"-",
"strict",
"meaning",
"that",
"encoding",
"errors",
"raise",
"a",
"UnicodeEncodeError",
".",
"-",
"ignore",
"all",
"encoding",
"errors",
"will",
"be",
"silently... | def setUnicodePolicy(*policy):
"""
Set the unicode error handling policy.
Possible options are:
- 'strict' meaning that encoding errors raise a UnicodeEncodeError.
- 'ignore' all encoding errors will be silently ignored.
- 'replace' all errors are replaced by the next argument.
For further information look... | [
"def",
"setUnicodePolicy",
"(",
"*",
"policy",
")",
":",
"if",
"not",
"manager",
":",
"raise",
"InitializationError",
"(",
"\"PyChan is not initialized yet.\"",
")",
"manager",
".",
"unicodePolicy",
"=",
"policy"
] | https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/__init__.py#L427-L444 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/tpu/python/tpu/tpu.py | python | outside_all_rewrites | () | Experimental API to 'break out' of a tpu.rewrite() (or shard(), etc.). | Experimental API to 'break out' of a tpu.rewrite() (or shard(), etc.). | [
"Experimental",
"API",
"to",
"break",
"out",
"of",
"a",
"tpu",
".",
"rewrite",
"()",
"(",
"or",
"shard",
"()",
"etc",
".",
")",
"."
] | def outside_all_rewrites():
"""Experimental API to 'break out' of a tpu.rewrite() (or shard(), etc.)."""
with ops.control_dependencies(None):
yield | [
"def",
"outside_all_rewrites",
"(",
")",
":",
"with",
"ops",
".",
"control_dependencies",
"(",
"None",
")",
":",
"yield"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/tpu/python/tpu/tpu.py#L98-L101 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | dmlc-core/scripts/lint3.py | python | LintHelper.print_summary | (self, strm) | return nerr | Print summary of lint. | Print summary of lint. | [
"Print",
"summary",
"of",
"lint",
"."
] | def print_summary(self, strm):
"""Print summary of lint."""
nerr = 0
nerr += LintHelper._print_summary_map(strm, self.cpp_header_map, 'cpp-header')
nerr += LintHelper._print_summary_map(strm, self.cpp_src_map, 'cpp-soruce')
nerr += LintHelper._print_summary_map(strm, self.python_... | [
"def",
"print_summary",
"(",
"self",
",",
"strm",
")",
":",
"nerr",
"=",
"0",
"nerr",
"+=",
"LintHelper",
".",
"_print_summary_map",
"(",
"strm",
",",
"self",
".",
"cpp_header_map",
",",
"'cpp-header'",
")",
"nerr",
"+=",
"LintHelper",
".",
"_print_summary_m... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/dmlc-core/scripts/lint3.py#L88-L98 | |
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.__eq__ | (self, other) | return self._values == other._values | Compares the current instance with another one. | Compares the current instance with another one. | [
"Compares",
"the",
"current",
"instance",
"with",
"another",
"one",
"."
] | def __eq__(self, other):
"""Compares the current instance with another one."""
if self is other:
return True
if not isinstance(other, self.__class__):
raise TypeError('Can only compare repeated composite fields against '
'other repeated composite fields.')
return self._... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
"is",
"other",
":",
"return",
"True",
"if",
"not",
"isinstance",
"(",
"other",
",",
"self",
".",
"__class__",
")",
":",
"raise",
"TypeError",
"(",
"'Can only compare repeated composite field... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/internal/containers.py#L309-L316 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/core.py | python | strip_protocol | (urlpath) | return cls._strip_protocol(urlpath) | Return only path part of full URL, according to appropriate backend | Return only path part of full URL, according to appropriate backend | [
"Return",
"only",
"path",
"part",
"of",
"full",
"URL",
"according",
"to",
"appropriate",
"backend"
] | def strip_protocol(urlpath):
"""Return only path part of full URL, according to appropriate backend"""
protocol, _ = split_protocol(urlpath)
cls = get_filesystem_class(protocol)
return cls._strip_protocol(urlpath) | [
"def",
"strip_protocol",
"(",
"urlpath",
")",
":",
"protocol",
",",
"_",
"=",
"split_protocol",
"(",
"urlpath",
")",
"cls",
"=",
"get_filesystem_class",
"(",
"protocol",
")",
"return",
"cls",
".",
"_strip_protocol",
"(",
"urlpath",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/core.py#L374-L378 | |
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | python/caffe/pycaffe.py | python | _Net_backward | (self, diffs=None, start=None, end=None, **kwargs) | return {out: self.blobs[out].diff for out in outputs} | Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If None, top diffs are taken from forward loss.
start : optional name of layer at w... | Backward pass: prepare diffs and run the net backward. | [
"Backward",
"pass",
":",
"prepare",
"diffs",
"and",
"run",
"the",
"net",
"backward",
"."
] | def _Net_backward(self, diffs=None, start=None, end=None, **kwargs):
"""
Backward pass: prepare diffs and run the net backward.
Parameters
----------
diffs : list of diffs to return in addition to bottom diffs.
kwargs : Keys are output blob names and values are diff ndarrays.
If Non... | [
"def",
"_Net_backward",
"(",
"self",
",",
"diffs",
"=",
"None",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"diffs",
"is",
"None",
":",
"diffs",
"=",
"[",
"]",
"if",
"start",
"is",
"not",
"None",
... | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/python/caffe/pycaffe.py#L137-L182 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/tools/common.py | python | handle_options | (tool, condition, command, options) | Handle common options for toolset, specifically sets the following
flag variables:
- CONFIG_COMMAND to 'command'
- OPTIOns for compile to the value of <compileflags> in options
- OPTIONS for compile.c to the value of <cflags> in options
- OPTIONS for compile.c++ to the value of <... | Handle common options for toolset, specifically sets the following
flag variables:
- CONFIG_COMMAND to 'command'
- OPTIOns for compile to the value of <compileflags> in options
- OPTIONS for compile.c to the value of <cflags> in options
- OPTIONS for compile.c++ to the value of <... | [
"Handle",
"common",
"options",
"for",
"toolset",
"specifically",
"sets",
"the",
"following",
"flag",
"variables",
":",
"-",
"CONFIG_COMMAND",
"to",
"command",
"-",
"OPTIOns",
"for",
"compile",
"to",
"the",
"value",
"of",
"<compileflags",
">",
"in",
"options",
... | def handle_options(tool, condition, command, options):
""" Handle common options for toolset, specifically sets the following
flag variables:
- CONFIG_COMMAND to 'command'
- OPTIOns for compile to the value of <compileflags> in options
- OPTIONS for compile.c to the value of <cflags>... | [
"def",
"handle_options",
"(",
"tool",
",",
"condition",
",",
"command",
",",
"options",
")",
":",
"from",
"b2",
".",
"build",
"import",
"toolset",
"assert",
"(",
"isinstance",
"(",
"tool",
",",
"str",
")",
")",
"assert",
"(",
"isinstance",
"(",
"conditio... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/tools/common.py#L423-L445 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/adapters.py | python | HTTPAdapter.request_url | (self, request, proxies) | return url | Obtain the url to use when making the final request.
If the message is being sent through a HTTP proxy, the full URL has to
be used. Otherwise, we should only use the path portion of the URL.
This should not be called from user code, and is only exposed for use
when subclassing the
... | Obtain the url to use when making the final request. | [
"Obtain",
"the",
"url",
"to",
"use",
"when",
"making",
"the",
"final",
"request",
"."
] | def request_url(self, request, proxies):
"""Obtain the url to use when making the final request.
If the message is being sent through a HTTP proxy, the full URL has to
be used. Otherwise, we should only use the path portion of the URL.
This should not be called from user code, and is o... | [
"def",
"request_url",
"(",
"self",
",",
"request",
",",
"proxies",
")",
":",
"proxy",
"=",
"select_proxy",
"(",
"request",
".",
"url",
",",
"proxies",
")",
"scheme",
"=",
"urlparse",
"(",
"request",
".",
"url",
")",
".",
"scheme",
"is_proxied_http_request"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/adapters.py#L329-L356 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/tensor/logic.py | python | isclose | (x, y, rtol=1e-05, atol=1e-08, equal_nan=False, name=None) | return out | ${comment}
Args:
x(Tensor): ${input_comment}.
y(Tensor): ${other_comment}.
rtol(rtoltype, optional): The relative tolerance. Default: :math:`1e-5` .
atol(atoltype, optional): The absolute tolerance. Default: :math:`1e-8` .
equal_nan(equalnantype, optional): ${equal_nan_comme... | ${comment} | [
"$",
"{",
"comment",
"}"
] | def isclose(x, y, rtol=1e-05, atol=1e-08, equal_nan=False, name=None):
"""
${comment}
Args:
x(Tensor): ${input_comment}.
y(Tensor): ${other_comment}.
rtol(rtoltype, optional): The relative tolerance. Default: :math:`1e-5` .
atol(atoltype, optional): The absolute tolerance. D... | [
"def",
"isclose",
"(",
"x",
",",
"y",
",",
"rtol",
"=",
"1e-05",
",",
"atol",
"=",
"1e-08",
",",
"equal_nan",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"if",
"in_dygraph_mode",
"(",
")",
":",
"return",
"_C_ops",
".",
"isclose",
"(",
"x",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/logic.py#L589-L659 | |
jubatus/jubatus | 1251ce551bac980488a6313728e72b3fe0b79a9f | tools/codestyle/cpplint/cpplint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"cl... | https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/tools/codestyle/cpplint/cpplint.py#L536-L559 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/memory_inspector/memory_inspector/frontends/www_server.py | python | _GetProfileTreeDataForSnapshot | (args, req_vars) | return _HTTP_OK, [], resp | Gets the data for the tree chart for a given time and metric.
The response is formatted according to the Google Charts DataTable format. | Gets the data for the tree chart for a given time and metric. | [
"Gets",
"the",
"data",
"for",
"the",
"tree",
"chart",
"for",
"a",
"given",
"time",
"and",
"metric",
"."
] | def _GetProfileTreeDataForSnapshot(args, req_vars): # pylint: disable=W0613
"""Gets the data for the tree chart for a given time and metric.
The response is formatted according to the Google Charts DataTable format.
"""
snapshot_id = args[0]
metric_index = int(args[1])
time = int(args[2])
snapshots = _G... | [
"def",
"_GetProfileTreeDataForSnapshot",
"(",
"args",
",",
"req_vars",
")",
":",
"# pylint: disable=W0613",
"snapshot_id",
"=",
"args",
"[",
"0",
"]",
"metric_index",
"=",
"int",
"(",
"args",
"[",
"1",
"]",
")",
"time",
"=",
"int",
"(",
"args",
"[",
"2",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/memory_inspector/memory_inspector/frontends/www_server.py#L262-L296 | |
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.AdjustLibraries | (self, libraries) | return libraries | Transforms entries like 'Cocoa.framework' in libraries into entries like
'-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. | Transforms entries like 'Cocoa.framework' in libraries into entries like
'-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. | [
"Transforms",
"entries",
"like",
"Cocoa",
".",
"framework",
"in",
"libraries",
"into",
"entries",
"like",
"-",
"framework",
"Cocoa",
"libcrypto",
".",
"dylib",
"into",
"-",
"lcrypto",
"etc",
"."
] | def AdjustLibraries(self, libraries):
"""Transforms entries like 'Cocoa.framework' in libraries into entries like
'-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc.
"""
libraries = [ self._AdjustLibrary(library) for library in libraries]
return libraries | [
"def",
"AdjustLibraries",
"(",
"self",
",",
"libraries",
")",
":",
"libraries",
"=",
"[",
"self",
".",
"_AdjustLibrary",
"(",
"library",
")",
"for",
"library",
"in",
"libraries",
"]",
"return",
"libraries"
] | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcode_emulation.py#L671-L676 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/nn_ops.py | python | gelu | (features, approximate=False, name=None) | Compute the Gaussian Error Linear Unit (GELU) activation function.
Gaussian error linear unit (GELU) computes
`x * P(X <= x)`, where `P(X) ~ N(0, 1)`.
The (GELU) nonlinearity weights inputs by their value, rather than gates
inputs by their sign as in ReLU.
For example:
>>> x = tf.constant([-3.0, -1.0, 0.... | Compute the Gaussian Error Linear Unit (GELU) activation function. | [
"Compute",
"the",
"Gaussian",
"Error",
"Linear",
"Unit",
"(",
"GELU",
")",
"activation",
"function",
"."
] | def gelu(features, approximate=False, name=None):
"""Compute the Gaussian Error Linear Unit (GELU) activation function.
Gaussian error linear unit (GELU) computes
`x * P(X <= x)`, where `P(X) ~ N(0, 1)`.
The (GELU) nonlinearity weights inputs by their value, rather than gates
inputs by their sign as in ReLU.... | [
"def",
"gelu",
"(",
"features",
",",
"approximate",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"Gelu\"",
",",
"[",
"features",
"]",
")",
":",
"features",
"=",
"ops",
".",
"convert_to_tensor",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/nn_ops.py#L3668-L3709 | ||
gnina/gnina | b9ae032f52fc7a8153987bde09c0efa3620d8bb6 | caffe/scripts/cpp_lint.py | python | GetHeaderGuardCPPVariable | (filename) | return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_' | Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file. | Returns the CPP variable that should be used as a header guard. | [
"Returns",
"the",
"CPP",
"variable",
"that",
"should",
"be",
"used",
"as",
"a",
"header",
"guard",
"."
] | def GetHeaderGuardCPPVariable(filename):
"""Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file.
"""
# Restores original filename in case that cpplint is... | [
"def",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
":",
"# Restores original filename in case that cpplint is invoked from Emacs's",
"# flymake.",
"filename",
"=",
"re",
".",
"sub",
"(",
"r'_flymake\\.h$'",
",",
"'.h'",
",",
"filename",
")",
"filename",
"=",
"re",
... | https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L1388-L1409 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/mooseutils/csvdiff.py | python | CSVTools.convertToTable | (self, files) | return table_pair | Convert text to a map of column names to column values | Convert text to a map of column names to column values | [
"Convert",
"text",
"to",
"a",
"map",
"of",
"column",
"names",
"to",
"column",
"values"
] | def convertToTable(self, files):
"""Convert text to a map of column names to column values"""
table_pair = []
for f in files:
f.seek(0)
text = f.read()
text = re.sub( r'\n\s*\n', '\n', text).strip()
# Exceptions occur if you try to parse a .e file... | [
"def",
"convertToTable",
"(",
"self",
",",
"files",
")",
":",
"table_pair",
"=",
"[",
"]",
"for",
"f",
"in",
"files",
":",
"f",
".",
"seek",
"(",
"0",
")",
"text",
"=",
"f",
".",
"read",
"(",
")",
"text",
"=",
"re",
".",
"sub",
"(",
"r'\\n\\s*\... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/mooseutils/csvdiff.py#L37-L71 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_message.py | python | Message.clear | (self) | Clears the contents of the :class:`Message`. All fields will be reset to
their default values. | Clears the contents of the :class:`Message`. All fields will be reset to
their default values. | [
"Clears",
"the",
"contents",
"of",
"the",
":",
"class",
":",
"Message",
".",
"All",
"fields",
"will",
"be",
"reset",
"to",
"their",
"default",
"values",
"."
] | def clear(self) -> None:
"""
Clears the contents of the :class:`Message`. All fields will be reset to
their default values.
"""
pn_message_clear(self._msg)
self.instructions = None
self.annotations = None
self.properties = None
self.body = None | [
"def",
"clear",
"(",
"self",
")",
"->",
"None",
":",
"pn_message_clear",
"(",
"self",
".",
"_msg",
")",
"self",
".",
"instructions",
"=",
"None",
"self",
".",
"annotations",
"=",
"None",
"self",
".",
"properties",
"=",
"None",
"self",
".",
"body",
"=",... | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_message.py#L164-L173 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/TaskGen.py | python | process_subst | (self) | Define a transformation that substitutes the contents of *source* files to *target* files::
def build(bld):
bld(
features='subst',
source='foo.c.in',
target='foo.c',
install_path='${LIBDIR}/pkgconfig',
VAR = 'val'
... | Define a transformation that substitutes the contents of *source* files to *target* files:: | [
"Define",
"a",
"transformation",
"that",
"substitutes",
"the",
"contents",
"of",
"*",
"source",
"*",
"files",
"to",
"*",
"target",
"*",
"files",
"::"
] | def process_subst(self):
"""
Define a transformation that substitutes the contents of *source* files to *target* files::
def build(bld):
bld(
features='subst',
source='foo.c.in',
target='foo.c',
install_path='${LIBDIR}/pkgconfi... | [
"def",
"process_subst",
"(",
"self",
")",
":",
"src",
"=",
"Utils",
".",
"to_list",
"(",
"getattr",
"(",
"self",
",",
"'source'",
",",
"[",
"]",
")",
")",
"if",
"isinstance",
"(",
"src",
",",
"Node",
".",
"Node",
")",
":",
"src",
"=",
"[",
"src",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/TaskGen.py#L752-L820 | ||
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/fast_rcnn/train_multi_gpu.py | python | train_net_multi_gpu | (solver_prototxt, roidb, output_dir, pretrained_model, max_iter, gpus) | Train a Fast R-CNN network. | Train a Fast R-CNN network. | [
"Train",
"a",
"Fast",
"R",
"-",
"CNN",
"network",
"."
] | def train_net_multi_gpu(solver_prototxt, roidb, output_dir, pretrained_model, max_iter, gpus):
"""Train a Fast R-CNN network."""
uid = caffe.NCCL.new_uid()
caffe.init_log()
caffe.log('Using devices %s' % str(gpus))
procs = []
for rank in range(len(gpus)):
p = Process(target=solve,
... | [
"def",
"train_net_multi_gpu",
"(",
"solver_prototxt",
",",
"roidb",
",",
"output_dir",
",",
"pretrained_model",
",",
"max_iter",
",",
"gpus",
")",
":",
"uid",
"=",
"caffe",
".",
"NCCL",
".",
"new_uid",
"(",
")",
"caffe",
".",
"init_log",
"(",
")",
"caffe",... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/fast_rcnn/train_multi_gpu.py#L203-L217 | ||
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | cpplint.py | python | IsOutOfLineMethodDefinition | (clean_lines, linenum) | return False | Check if current line contains an out-of-line method definition.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definition. | Check if current line contains an out-of-line method definition. | [
"Check",
"if",
"current",
"line",
"contains",
"an",
"out",
"-",
"of",
"-",
"line",
"method",
"definition",
"."
] | def IsOutOfLineMethodDefinition(clean_lines, linenum):
"""Check if current line contains an out-of-line method definition.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definition... | [
"def",
"IsOutOfLineMethodDefinition",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"# Scan back a few lines for start of current function",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"max",
"(",
"-",
"1",
",",
"linenum",
"-",
"10",
")",
",",
"-",
"1",
"... | https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L5025-L5038 | |
facebook/fbthrift | fb9c8562aba04c4fd9b17716eb5d970cc88a75bb | build/fbcode_builder/getdeps/fetcher.py | python | ArchiveFetcher._download_dir | (self) | return download_dir | returns the download dir, creating it if it doesn't already exist | returns the download dir, creating it if it doesn't already exist | [
"returns",
"the",
"download",
"dir",
"creating",
"it",
"if",
"it",
"doesn",
"t",
"already",
"exist"
] | def _download_dir(self):
"""returns the download dir, creating it if it doesn't already exist"""
download_dir = os.path.dirname(self.file_name)
if not os.path.exists(download_dir):
os.makedirs(download_dir)
return download_dir | [
"def",
"_download_dir",
"(",
"self",
")",
":",
"download_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"self",
".",
"file_name",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"download_dir",
")",
":",
"os",
".",
"makedirs",
"(",
"down... | https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/build/fbcode_builder/getdeps/fetcher.py#L729-L734 | |
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | bingo/bingo-elastic/python/bingo_elastic/elastic.py | python | ElasticRepository.__init__ | (
self,
index_name: IndexName,
*,
host: Union[str, List[str]] = "localhost",
port: int = 9200,
scheme: str = "",
http_auth: Optional[Tuple[str]] = None,
ssl_context: Any = None,
request_timeout: int = 60,
retry_on_timeout: bool = True,
... | :param index_name: use function get_index_name for setting this argument
:param host: host or list of hosts
:param port:
:param scheme: http or https
:param http_auth:
:param ssl_context:
:param timeout:
:param retry_on_timeout: | :param index_name: use function get_index_name for setting this argument
:param host: host or list of hosts
:param port:
:param scheme: http or https
:param http_auth:
:param ssl_context:
:param timeout:
:param retry_on_timeout: | [
":",
"param",
"index_name",
":",
"use",
"function",
"get_index_name",
"for",
"setting",
"this",
"argument",
":",
"param",
"host",
":",
"host",
"or",
"list",
"of",
"hosts",
":",
"param",
"port",
":",
":",
"param",
"scheme",
":",
"http",
"or",
"https",
":"... | def __init__(
self,
index_name: IndexName,
*,
host: Union[str, List[str]] = "localhost",
port: int = 9200,
scheme: str = "",
http_auth: Optional[Tuple[str]] = None,
ssl_context: Any = None,
request_timeout: int = 60,
retry_on_timeout: bool ... | [
"def",
"__init__",
"(",
"self",
",",
"index_name",
":",
"IndexName",
",",
"*",
",",
"host",
":",
"Union",
"[",
"str",
",",
"List",
"[",
"str",
"]",
"]",
"=",
"\"localhost\"",
",",
"port",
":",
"int",
"=",
"9200",
",",
"scheme",
":",
"str",
"=",
"... | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/bingo/bingo-elastic/python/bingo_elastic/elastic.py#L50-L91 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/device.py | python | DeviceSpec.__init__ | (self, job=None, replica=None, task=None, device_type=None,
device_index=None) | Create a new `DeviceSpec` object.
Args:
job: string. Optional job name.
replica: int. Optional replica index.
task: int. Optional task index.
device_type: Optional device type string (e.g. "CPU" or "GPU")
device_index: int. Optional device index. If left
unspecified, devi... | Create a new `DeviceSpec` object. | [
"Create",
"a",
"new",
"DeviceSpec",
"object",
"."
] | def __init__(self, job=None, replica=None, task=None, device_type=None,
device_index=None):
"""Create a new `DeviceSpec` object.
Args:
job: string. Optional job name.
replica: int. Optional replica index.
task: int. Optional task index.
device_type: Optional device typ... | [
"def",
"__init__",
"(",
"self",
",",
"job",
"=",
"None",
",",
"replica",
"=",
"None",
",",
"task",
"=",
"None",
",",
"device_type",
"=",
"None",
",",
"device_index",
"=",
"None",
")",
":",
"self",
".",
"job",
"=",
"job",
"self",
".",
"replica",
"="... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/device.py#L65-L86 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ast.py | python | iter_fields | (node) | Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
that is present on *node*. | Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
that is present on *node*. | [
"Yield",
"a",
"tuple",
"of",
"(",
"fieldname",
"value",
")",
"for",
"each",
"field",
"in",
"node",
".",
"_fields",
"that",
"is",
"present",
"on",
"*",
"node",
"*",
"."
] | def iter_fields(node):
"""
Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
that is present on *node*.
"""
for field in node._fields:
try:
yield field, getattr(node, field)
except AttributeError:
pass | [
"def",
"iter_fields",
"(",
"node",
")",
":",
"for",
"field",
"in",
"node",
".",
"_fields",
":",
"try",
":",
"yield",
"field",
",",
"getattr",
"(",
"node",
",",
"field",
")",
"except",
"AttributeError",
":",
"pass"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ast.py#L161-L170 | ||
apache/incubator-weex | 5c25f0b59f7ac90703c363e7261f60bd06356dbe | weex_core/tools/cpplint.py | python | CheckCasts | (filename, clean_lines, linenum, error) | Various cast related checks.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Various cast related checks. | [
"Various",
"cast",
"related",
"checks",
"."
] | def CheckCasts(filename, clean_lines, linenum, error):
"""Various cast related checks.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found.
"""
line =... | [
"def",
"CheckCasts",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Check to see if they're using an conversion function cast.",
"# I just try to capture the most common basic t... | https://github.com/apache/incubator-weex/blob/5c25f0b59f7ac90703c363e7261f60bd06356dbe/weex_core/tools/cpplint.py#L5152-L5268 | ||
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | SynthText_Chinese/colorize3_poisson.py | python | FontColor.triangle_color | (self, col1, col2) | return np.squeeze(cv.cvtColor(col1[None,None,:],cv.cv.CV_HSV2RGB)) | Returns a color which is "opposite" to both col1 and col2. | Returns a color which is "opposite" to both col1 and col2. | [
"Returns",
"a",
"color",
"which",
"is",
"opposite",
"to",
"both",
"col1",
"and",
"col2",
"."
] | def triangle_color(self, col1, col2):
"""
Returns a color which is "opposite" to both col1 and col2.
"""
col1, col2 = np.array(col1), np.array(col2)
col1 = np.squeeze(cv.cvtColor(col1[None,None,:], cv.cv.CV_RGB2HSV))
col2 = np.squeeze(cv.cvtColor(col2[None,None,:], cv.cv.... | [
"def",
"triangle_color",
"(",
"self",
",",
"col1",
",",
"col2",
")",
":",
"col1",
",",
"col2",
"=",
"np",
".",
"array",
"(",
"col1",
")",
",",
"np",
".",
"array",
"(",
"col2",
")",
"col1",
"=",
"np",
".",
"squeeze",
"(",
"cv",
".",
"cvtColor",
... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/SynthText_Chinese/colorize3_poisson.py#L113-L125 | |
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/LevelUp.py | python | GetLevelUpNews | () | return News | Returns a string containing improvements gain on level up.
These include: HP, spells per level, and lore, among others. | Returns a string containing improvements gain on level up. | [
"Returns",
"a",
"string",
"containing",
"improvements",
"gain",
"on",
"level",
"up",
"."
] | def GetLevelUpNews():
"""Returns a string containing improvements gain on level up.
These include: HP, spells per level, and lore, among others."""
News = GemRB.GetString (5259) + '\n\n'
# display if our class has been reactivated
if IsDual:
if (Level[0] - LevelDiff[0]) <= Level[1] and Level[0] > Level[1]:
... | [
"def",
"GetLevelUpNews",
"(",
")",
":",
"News",
"=",
"GemRB",
".",
"GetString",
"(",
"5259",
")",
"+",
"'\\n\\n'",
"# display if our class has been reactivated",
"if",
"IsDual",
":",
"if",
"(",
"Level",
"[",
"0",
"]",
"-",
"LevelDiff",
"[",
"0",
"]",
")",
... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/LevelUp.py#L346-L467 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | python/artm/score_tracker.py | python | ClassPrecisionScoreTracker.__init__ | (self, score) | :Properties:
* Note: every field is a list of info about score on all synchronizations.
* value - values of ratio of correct predictions.
* error - numbers of error predictiona.
* total - numbers of all predictions.
* Note: every field has a version with prefix 'last_', means ret... | :Properties:
* Note: every field is a list of info about score on all synchronizations.
* value - values of ratio of correct predictions.
* error - numbers of error predictiona.
* total - numbers of all predictions.
* Note: every field has a version with prefix 'last_', means ret... | [
":",
"Properties",
":",
"*",
"Note",
":",
"every",
"field",
"is",
"a",
"list",
"of",
"info",
"about",
"score",
"on",
"all",
"synchronizations",
".",
"*",
"value",
"-",
"values",
"of",
"ratio",
"of",
"correct",
"predictions",
".",
"*",
"error",
"-",
"nu... | def __init__(self, score):
"""
:Properties:
* Note: every field is a list of info about score on all synchronizations.
* value - values of ratio of correct predictions.
* error - numbers of error predictiona.
* total - numbers of all predictions.
* Note: every fie... | [
"def",
"__init__",
"(",
"self",
",",
"score",
")",
":",
"BaseScoreTracker",
".",
"__init__",
"(",
"self",
",",
"score",
")"
] | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/score_tracker.py#L277-L287 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/roslaunch/src/roslaunch/netapi.py | python | get_roslaunch_uris | () | @return: list of roslaunch XML-RPC URIs for roscore that's in
the current environment, or None if roscore cannot be contacted.
@rtype: [str] | [] | def get_roslaunch_uris():
"""
@return: list of roslaunch XML-RPC URIs for roscore that's in
the current environment, or None if roscore cannot be contacted.
@rtype: [str]
"""
try:
m = rosgraph.Master(_ID)
vals = m.getParam('/roslaunch/uris')
return vals.values()
excep... | [
"def",
"get_roslaunch_uris",
"(",
")",
":",
"try",
":",
"m",
"=",
"rosgraph",
".",
"Master",
"(",
"_ID",
")",
"vals",
"=",
"m",
".",
"getParam",
"(",
"'/roslaunch/uris'",
")",
"return",
"vals",
".",
"values",
"(",
")",
"except",
"rosgraph",
".",
"Maste... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/netapi.py#L48-L59 | |||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/atom/token_store.py | python | TokenStore.remove_token | (self, token) | return token_found | Removes the token from the token_store.
This method is used when a token is determined to be invalid. If the
token was found by find_token, but resulted in a 401 or 403 error stating
that the token was invlid, then the token should be removed to prevent
future use.
Returns:
True if a token w... | Removes the token from the token_store. | [
"Removes",
"the",
"token",
"from",
"the",
"token_store",
"."
] | def remove_token(self, token):
"""Removes the token from the token_store.
This method is used when a token is determined to be invalid. If the
token was found by find_token, but resulted in a 401 or 403 error stating
that the token was invlid, then the token should be removed to prevent
future use.... | [
"def",
"remove_token",
"(",
"self",
",",
"token",
")",
":",
"token_found",
"=",
"False",
"scopes_to_delete",
"=",
"[",
"]",
"for",
"scope",
",",
"stored_token",
"in",
"self",
".",
"_tokens",
".",
"iteritems",
"(",
")",
":",
"if",
"stored_token",
"==",
"t... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/atom/token_store.py#L94-L114 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | ScrollHelper.CalcUnscrolledPosition | (*args) | return _windows_.ScrollHelper_CalcUnscrolledPosition(*args) | CalcUnscrolledPosition(self, Point pt) -> Point
CalcUnscrolledPosition(int x, int y) -> (ux, uy)
Translate between scrolled and unscrolled coordinates. | CalcUnscrolledPosition(self, Point pt) -> Point
CalcUnscrolledPosition(int x, int y) -> (ux, uy) | [
"CalcUnscrolledPosition",
"(",
"self",
"Point",
"pt",
")",
"-",
">",
"Point",
"CalcUnscrolledPosition",
"(",
"int",
"x",
"int",
"y",
")",
"-",
">",
"(",
"ux",
"uy",
")"
] | def CalcUnscrolledPosition(*args):
"""
CalcUnscrolledPosition(self, Point pt) -> Point
CalcUnscrolledPosition(int x, int y) -> (ux, uy)
Translate between scrolled and unscrolled coordinates.
"""
return _windows_.ScrollHelper_CalcUnscrolledPosition(*args) | [
"def",
"CalcUnscrolledPosition",
"(",
"*",
"args",
")",
":",
"return",
"_windows_",
".",
"ScrollHelper_CalcUnscrolledPosition",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L224-L231 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dygraph/dygraph_to_static/tensor_shape_transformer.py | python | TensorShapeTransformer._is_var_shape | (self, node) | return False | Return True if node is like `x.shape` or `x.shape[0]`, return False otherwise. | Return True if node is like `x.shape` or `x.shape[0]`, return False otherwise. | [
"Return",
"True",
"if",
"node",
"is",
"like",
"x",
".",
"shape",
"or",
"x",
".",
"shape",
"[",
"0",
"]",
"return",
"False",
"otherwise",
"."
] | def _is_var_shape(self, node):
"""
Return True if node is like `x.shape` or `x.shape[0]`, return False otherwise.
"""
if not isinstance(node, (gast.Attribute, gast.Subscript)):
return False
if isinstance(node, gast.Attribute):
# If node is `paddle.shape`,... | [
"def",
"_is_var_shape",
"(",
"self",
",",
"node",
")",
":",
"if",
"not",
"isinstance",
"(",
"node",
",",
"(",
"gast",
".",
"Attribute",
",",
"gast",
".",
"Subscript",
")",
")",
":",
"return",
"False",
"if",
"isinstance",
"(",
"node",
",",
"gast",
"."... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/dygraph_to_static/tensor_shape_transformer.py#L277-L297 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/cpplint_1.4.5/cpplint.py | python | NestingState.UpdatePreprocessor | (self, line) | Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the following assumptions (good enough for most... | Update preprocessor stack. | [
"Update",
"preprocessor",
"stack",
"."
] | def UpdatePreprocessor(self, line):
"""Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the ... | [
"def",
"UpdatePreprocessor",
"(",
"self",
",",
"line",
")",
":",
"if",
"Match",
"(",
"r'^\\s*#\\s*(if|ifdef|ifndef)\\b'",
",",
"line",
")",
":",
"# Beginning of #if block, save the nesting stack here. The saved",
"# stack will allow us to restore the parsing state in the #else cas... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L2757-L2811 | ||
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/win_tool.py | python | WinTool._CommandifyName | (self, name_string) | return name_string.title().replace('-', '') | Transforms a tool name like recursive-mirror to RecursiveMirror. | Transforms a tool name like recursive-mirror to RecursiveMirror. | [
"Transforms",
"a",
"tool",
"name",
"like",
"recursive",
"-",
"mirror",
"to",
"RecursiveMirror",
"."
] | def _CommandifyName(self, name_string):
"""Transforms a tool name like recursive-mirror to RecursiveMirror."""
return name_string.title().replace('-', '') | [
"def",
"_CommandifyName",
"(",
"self",
",",
"name_string",
")",
":",
"return",
"name_string",
".",
"title",
"(",
")",
".",
"replace",
"(",
"'-'",
",",
"''",
")"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/win_tool.py#L72-L74 | |
memkind/memkind | cbbf843ba63d852914f665064b6bf74cdc07ac54 | utils/qemu/main.py | python | QEMU._hda_option | (self) | return f'-hda {self.cfg.image}' | Hard drive as a file | Hard drive as a file | [
"Hard",
"drive",
"as",
"a",
"file"
] | def _hda_option(self) -> str:
"""
Hard drive as a file
"""
return f'-hda {self.cfg.image}' | [
"def",
"_hda_option",
"(",
"self",
")",
"->",
"str",
":",
"return",
"f'-hda {self.cfg.image}'"
] | https://github.com/memkind/memkind/blob/cbbf843ba63d852914f665064b6bf74cdc07ac54/utils/qemu/main.py#L248-L252 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/shapedbutton.py | python | SButton.SetLabelColour | (self, colour=None) | Sets the button label colour.
:param `colour`: an instance of :class:`Colour`. | Sets the button label colour. | [
"Sets",
"the",
"button",
"label",
"colour",
"."
] | def SetLabelColour(self, colour=None):
"""
Sets the button label colour.
:param `colour`: an instance of :class:`Colour`.
"""
if colour is None:
colour = wx.BLACK
self._labelcolour = colour | [
"def",
"SetLabelColour",
"(",
"self",
",",
"colour",
"=",
"None",
")",
":",
"if",
"colour",
"is",
"None",
":",
"colour",
"=",
"wx",
".",
"BLACK",
"self",
".",
"_labelcolour",
"=",
"colour"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/shapedbutton.py#L357-L367 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/session_ops.py | python | TensorHandle._get_reader_key | (handle) | return handle_parts[0] + ";" + handle_parts[-1] | The graph key for reader. | The graph key for reader. | [
"The",
"graph",
"key",
"for",
"reader",
"."
] | def _get_reader_key(handle):
"""The graph key for reader."""
handle_parts = str(handle).split(";")
return handle_parts[0] + ";" + handle_parts[-1] | [
"def",
"_get_reader_key",
"(",
"handle",
")",
":",
"handle_parts",
"=",
"str",
"(",
"handle",
")",
".",
"split",
"(",
"\";\"",
")",
"return",
"handle_parts",
"[",
"0",
"]",
"+",
"\";\"",
"+",
"handle_parts",
"[",
"-",
"1",
"]"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/session_ops.py#L128-L131 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/parser/source_reader.py | python | source_reader_t.create_xml_file_from_string | (self, content, destination=None) | return xml_file | Creates XML file from text.
:param content: C++ source code
:type content: str
:param destination: file name for xml file
:type destination: str
:rtype: returns file name of xml file | Creates XML file from text. | [
"Creates",
"XML",
"file",
"from",
"text",
"."
] | def create_xml_file_from_string(self, content, destination=None):
"""
Creates XML file from text.
:param content: C++ source code
:type content: str
:param destination: file name for xml file
:type destination: str
:rtype: returns file name of xml file
... | [
"def",
"create_xml_file_from_string",
"(",
"self",
",",
"content",
",",
"destination",
"=",
"None",
")",
":",
"header_file",
"=",
"utils",
".",
"create_temp_file_name",
"(",
"suffix",
"=",
"'.h'",
")",
"try",
":",
"with",
"open",
"(",
"header_file",
",",
"\"... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/parser/source_reader.py#L276-L296 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/cubecolourdialog.py | python | Slope | (pt1, pt2) | Calculates the slope of the line connecting 2 points.
:param `pt1`: an instance of :class:`Point`;
:param `pt2`: another instance of :class:`Point`. | Calculates the slope of the line connecting 2 points. | [
"Calculates",
"the",
"slope",
"of",
"the",
"line",
"connecting",
"2",
"points",
"."
] | def Slope(pt1, pt2):
"""
Calculates the slope of the line connecting 2 points.
:param `pt1`: an instance of :class:`Point`;
:param `pt2`: another instance of :class:`Point`.
"""
y = float(pt2.y - pt1.y)
x = float(pt2.x - pt1.x)
if x:
return y/x
else:
return None | [
"def",
"Slope",
"(",
"pt1",
",",
"pt2",
")",
":",
"y",
"=",
"float",
"(",
"pt2",
".",
"y",
"-",
"pt1",
".",
"y",
")",
"x",
"=",
"float",
"(",
"pt2",
".",
"x",
"-",
"pt1",
".",
"x",
")",
"if",
"x",
":",
"return",
"y",
"/",
"x",
"else",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L1256-L1270 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | GraphicsBitmap.__init__ | (self, *args, **kwargs) | __init__(self) -> GraphicsBitmap | __init__(self) -> GraphicsBitmap | [
"__init__",
"(",
"self",
")",
"-",
">",
"GraphicsBitmap"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> GraphicsBitmap"""
_gdi_.GraphicsBitmap_swiginit(self,_gdi_.new_GraphicsBitmap(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_gdi_",
".",
"GraphicsBitmap_swiginit",
"(",
"self",
",",
"_gdi_",
".",
"new_GraphicsBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5587-L5589 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/tseries/frequencies.py | python | _get_offset | (name: str) | return _offset_map[name] | Return DateOffset object associated with rule name.
Examples
--------
_get_offset('EOM') --> BMonthEnd(1) | Return DateOffset object associated with rule name. | [
"Return",
"DateOffset",
"object",
"associated",
"with",
"rule",
"name",
"."
] | def _get_offset(name: str) -> DateOffset:
"""
Return DateOffset object associated with rule name.
Examples
--------
_get_offset('EOM') --> BMonthEnd(1)
"""
if name not in libfreqs._dont_uppercase:
name = name.upper()
name = libfreqs._lite_rule_alias.get(name, name)
n... | [
"def",
"_get_offset",
"(",
"name",
":",
"str",
")",
"->",
"DateOffset",
":",
"if",
"name",
"not",
"in",
"libfreqs",
".",
"_dont_uppercase",
":",
"name",
"=",
"name",
".",
"upper",
"(",
")",
"name",
"=",
"libfreqs",
".",
"_lite_rule_alias",
".",
"get",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/tseries/frequencies.py#L204-L232 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/__init__.py | python | allow_connection_pickling | () | Install support for sending connections and sockets between processes | Install support for sending connections and sockets between processes | [
"Install",
"support",
"for",
"sending",
"connections",
"and",
"sockets",
"between",
"processes"
] | def allow_connection_pickling():
'''
Install support for sending connections and sockets between processes
'''
from multiprocessing import reduction | [
"def",
"allow_connection_pickling",
"(",
")",
":",
"from",
"multiprocessing",
"import",
"reduction"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/__init__.py#L161-L165 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/laguerre.py | python | poly2lag | (pol) | return res | poly2lag(pol)
Convert a polynomial to a Laguerre series.
Convert an array representing the coefficients of a polynomial (relative
to the "standard" basis) ordered from lowest degree to highest, to an
array of the coefficients of the equivalent Laguerre series, ordered
from lowest to highest degree... | poly2lag(pol) | [
"poly2lag",
"(",
"pol",
")"
] | def poly2lag(pol) :
"""
poly2lag(pol)
Convert a polynomial to a Laguerre series.
Convert an array representing the coefficients of a polynomial (relative
to the "standard" basis) ordered from lowest degree to highest, to an
array of the coefficients of the equivalent Laguerre series, ordered
... | [
"def",
"poly2lag",
"(",
"pol",
")",
":",
"[",
"pol",
"]",
"=",
"pu",
".",
"as_series",
"(",
"[",
"pol",
"]",
")",
"deg",
"=",
"len",
"(",
"pol",
")",
"-",
"1",
"res",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"deg",
",",
"-",
"1",
",",
"-... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/laguerre.py#L78-L121 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/plistlib.py | python | _BinaryPlistParser._read_object | (self, ref) | return result | read the object by reference.
May recursively read sub-objects (content of an array/dict/set) | read the object by reference. | [
"read",
"the",
"object",
"by",
"reference",
"."
] | def _read_object(self, ref):
"""
read the object by reference.
May recursively read sub-objects (content of an array/dict/set)
"""
result = self._objects[ref]
if result is not _undefined:
return result
offset = self._object_offsets[ref]
self.... | [
"def",
"_read_object",
"(",
"self",
",",
"ref",
")",
":",
"result",
"=",
"self",
".",
"_objects",
"[",
"ref",
"]",
"if",
"result",
"is",
"not",
"_undefined",
":",
"return",
"result",
"offset",
"=",
"self",
".",
"_object_offsets",
"[",
"ref",
"]",
"self... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/plistlib.py#L506-L605 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/session_ops.py | python | TensorHandle.eval | (self) | return self._session.run(reader, feed_dict={holder: self._handle}) | Return the value of the tensor represented by this handle. | Return the value of the tensor represented by this handle. | [
"Return",
"the",
"value",
"of",
"the",
"tensor",
"represented",
"by",
"this",
"handle",
"."
] | def eval(self):
"""Return the value of the tensor represented by this handle."""
if not self._auto_gc_enabled:
raise TypeError("Persistent tensor %s may have already been deleted."
% self.handle)
holder, reader = _get_handle_reader(self._session.graph, self._handle,
... | [
"def",
"eval",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_auto_gc_enabled",
":",
"raise",
"TypeError",
"(",
"\"Persistent tensor %s may have already been deleted.\"",
"%",
"self",
".",
"handle",
")",
"holder",
",",
"reader",
"=",
"_get_handle_reader",
"(",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/session_ops.py#L93-L100 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/html5lib-python/html5lib/inputstream.py | python | HTMLUnicodeInputStream.openStream | (self, source) | return stream | Produces a file object from source.
source can be either a file object, local filename or a string. | Produces a file object from source. | [
"Produces",
"a",
"file",
"object",
"from",
"source",
"."
] | def openStream(self, source):
"""Produces a file object from source.
source can be either a file object, local filename or a string.
"""
# Already a file object
if hasattr(source, 'read'):
stream = source
else:
stream = StringIO(source)
... | [
"def",
"openStream",
"(",
"self",
",",
"source",
")",
":",
"# Already a file object",
"if",
"hasattr",
"(",
"source",
",",
"'read'",
")",
":",
"stream",
"=",
"source",
"else",
":",
"stream",
"=",
"StringIO",
"(",
"source",
")",
"return",
"stream"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/html5lib-python/html5lib/inputstream.py#L213-L225 | |
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/get.py | python | _OptionChainGetterBase.get_symbol | (self) | return clib.get_str('OptionChainGetter_GetSymbol_ABI', self._obj) | Returns symbol being used. | Returns symbol being used. | [
"Returns",
"symbol",
"being",
"used",
"."
] | def get_symbol(self):
"""Returns symbol being used."""
return clib.get_str('OptionChainGetter_GetSymbol_ABI', self._obj) | [
"def",
"get_symbol",
"(",
"self",
")",
":",
"return",
"clib",
".",
"get_str",
"(",
"'OptionChainGetter_GetSymbol_ABI'",
",",
"self",
".",
"_obj",
")"
] | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L796-L798 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/fractions.py | python | Fraction.__repr__ | (self) | return '%s(%s, %s)' % (self.__class__.__name__,
self._numerator, self._denominator) | repr(self) | repr(self) | [
"repr",
"(",
"self",
")"
] | def __repr__(self):
"""repr(self)"""
return '%s(%s, %s)' % (self.__class__.__name__,
self._numerator, self._denominator) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"'%s(%s, %s)'",
"%",
"(",
"self",
".",
"__class__",
".",
"__name__",
",",
"self",
".",
"_numerator",
",",
"self",
".",
"_denominator",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/fractions.py#L282-L285 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/typing.py | python | NewType | (name, tp) | return new_type | NewType creates simple unique types with almost zero
runtime overhead. NewType(name, tp) is considered a subtype of tp
by static type checkers. At runtime, NewType(name, tp) returns
a dummy function that simply returns its argument. Usage::
UserId = NewType('UserId', int)
def name_by_id(us... | NewType creates simple unique types with almost zero
runtime overhead. NewType(name, tp) is considered a subtype of tp
by static type checkers. At runtime, NewType(name, tp) returns
a dummy function that simply returns its argument. Usage:: | [
"NewType",
"creates",
"simple",
"unique",
"types",
"with",
"almost",
"zero",
"runtime",
"overhead",
".",
"NewType",
"(",
"name",
"tp",
")",
"is",
"considered",
"a",
"subtype",
"of",
"tp",
"by",
"static",
"type",
"checkers",
".",
"At",
"runtime",
"NewType",
... | def NewType(name, tp):
"""NewType creates simple unique types with almost zero
runtime overhead. NewType(name, tp) is considered a subtype of tp
by static type checkers. At runtime, NewType(name, tp) returns
a dummy function that simply returns its argument. Usage::
UserId = NewType('UserId', i... | [
"def",
"NewType",
"(",
"name",
",",
"tp",
")",
":",
"def",
"new_type",
"(",
"x",
")",
":",
"return",
"x",
"new_type",
".",
"__name__",
"=",
"name",
"new_type",
".",
"__supertype__",
"=",
"tp",
"return",
"new_type"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/typing.py#L1455-L1479 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py | python | format_translation_includes | (header, body) | return result | Return the necessary list of includes based on the contents of the
body. | Return the necessary list of includes based on the contents of the
body. | [
"Return",
"the",
"necessary",
"list",
"of",
"includes",
"based",
"on",
"the",
"contents",
"of",
"the",
"body",
"."
] | def format_translation_includes(header, body):
""" Return the necessary list of includes based on the contents of the
body.
"""
result = ''
# <algorithm> required for VS2013.
if body.find('std::min') > 0 or body.find('std::max') > 0:
result += '#include <algorithm>\n'
if body.find(... | [
"def",
"format_translation_includes",
"(",
"header",
",",
"body",
")",
":",
"result",
"=",
"''",
"# <algorithm> required for VS2013.",
"if",
"body",
".",
"find",
"(",
"'std::min'",
")",
">",
"0",
"or",
"body",
".",
"find",
"(",
"'std::max'",
")",
">",
"0",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L293-L335 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/linalg_ops.py | python | _RegularizedGramianCholesky | (matrix, l2_regularizer, first_kind) | return gen_linalg_ops.cholesky(gramian) | r"""Computes Cholesky factorization of regularized gramian matrix.
Below we will use the following notation for each pair of matrix and
right-hand sides in the batch:
`matrix`=\\(A \in \Re^{m \times n}\\),
`output`=\\(C \in \Re^{\min(m, n) \times \min(m,n)}\\),
`l2_regularizer`=\\(\lambda\\).
If `first_... | r"""Computes Cholesky factorization of regularized gramian matrix. | [
"r",
"Computes",
"Cholesky",
"factorization",
"of",
"regularized",
"gramian",
"matrix",
"."
] | def _RegularizedGramianCholesky(matrix, l2_regularizer, first_kind):
r"""Computes Cholesky factorization of regularized gramian matrix.
Below we will use the following notation for each pair of matrix and
right-hand sides in the batch:
`matrix`=\\(A \in \Re^{m \times n}\\),
`output`=\\(C \in \Re^{\min(m, n... | [
"def",
"_RegularizedGramianCholesky",
"(",
"matrix",
",",
"l2_regularizer",
",",
"first_kind",
")",
":",
"gramian",
"=",
"math_ops",
".",
"matmul",
"(",
"matrix",
",",
"matrix",
",",
"adjoint_a",
"=",
"first_kind",
",",
"adjoint_b",
"=",
"not",
"first_kind",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg_ops.py#L38-L76 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBModule.get_compile_units_array | (self) | return self.compile_units_array | An accessor function that returns an array object that contains all compile_units in this module object. | An accessor function that returns an array object that contains all compile_units in this module object. | [
"An",
"accessor",
"function",
"that",
"returns",
"an",
"array",
"object",
"that",
"contains",
"all",
"compile_units",
"in",
"this",
"module",
"object",
"."
] | def get_compile_units_array(self):
'''An accessor function that returns an array object that contains all compile_units in this module object.'''
if not hasattr(self, 'compile_units_array'):
self.compile_units_array = []
for idx in range(self.GetNumCompileUnits()):
... | [
"def",
"get_compile_units_array",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'compile_units_array'",
")",
":",
"self",
".",
"compile_units_array",
"=",
"[",
"]",
"for",
"idx",
"in",
"range",
"(",
"self",
".",
"GetNumCompileUnits",
"(",... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L6425-L6431 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/tseries/holiday.py | python | previous_workday | (dt) | return dt | returns previous weekday used for observances | returns previous weekday used for observances | [
"returns",
"previous",
"weekday",
"used",
"for",
"observances"
] | def previous_workday(dt):
"""
returns previous weekday used for observances
"""
dt -= timedelta(days=1)
while dt.weekday() > 4:
# Mon-Fri are 0-4
dt -= timedelta(days=1)
return dt | [
"def",
"previous_workday",
"(",
"dt",
")",
":",
"dt",
"-=",
"timedelta",
"(",
"days",
"=",
"1",
")",
"while",
"dt",
".",
"weekday",
"(",
")",
">",
"4",
":",
"# Mon-Fri are 0-4",
"dt",
"-=",
"timedelta",
"(",
"days",
"=",
"1",
")",
"return",
"dt"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/tseries/holiday.py#L98-L106 | |
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/prediction/data_pipelines/common/online_to_offline.py | python | LabelGenerator.__init__ | (self) | feature_dict contains the organized Feature in the following way:
obstacle_ID --> [Feature1, Feature2, Feature3, ...] (sequentially sorted) | feature_dict contains the organized Feature in the following way:
obstacle_ID --> [Feature1, Feature2, Feature3, ...] (sequentially sorted) | [
"feature_dict",
"contains",
"the",
"organized",
"Feature",
"in",
"the",
"following",
"way",
":",
"obstacle_ID",
"--",
">",
"[",
"Feature1",
"Feature2",
"Feature3",
"...",
"]",
"(",
"sequentially",
"sorted",
")"
] | def __init__(self):
self.filepath = None
'''
feature_dict contains the organized Feature in the following way:
obstacle_ID --> [Feature1, Feature2, Feature3, ...] (sequentially sorted)
'''
self.feature_dict = dict()
'''
observation_dict contains the i... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"filepath",
"=",
"None",
"self",
".",
"feature_dict",
"=",
"dict",
"(",
")",
"'''\n observation_dict contains the important observations of the subsequent\n Features for each obstacle at every timestamp:\n ... | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/prediction/data_pipelines/common/online_to_offline.py#L37-L70 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/numbers.py | python | Complex.__rsub__ | (self, other) | return -self + other | other - self | other - self | [
"other",
"-",
"self"
] | def __rsub__(self, other):
"""other - self"""
return -self + other | [
"def",
"__rsub__",
"(",
"self",
",",
"other",
")",
":",
"return",
"-",
"self",
"+",
"other"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/numbers.py#L96-L98 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.