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
senlinuc/caffe_ocr
81642f61ea8f888e360cca30e08e05b7bc6d4556
examples/web_demo/app.py
python
start_from_terminal
(app)
Parse command line options and start the server.
Parse command line options and start the server.
[ "Parse", "command", "line", "options", "and", "start", "the", "server", "." ]
def start_from_terminal(app): """ Parse command line options and start the server. """ parser = optparse.OptionParser() parser.add_option( '-d', '--debug', help="enable debug mode", action="store_true", default=False) parser.add_option( '-p', '--port', hel...
[ "def", "start_from_terminal", "(", "app", ")", ":", "parser", "=", "optparse", ".", "OptionParser", "(", ")", "parser", ".", "add_option", "(", "'-d'", ",", "'--debug'", ",", "help", "=", "\"enable debug mode\"", ",", "action", "=", "\"store_true\"", ",", "d...
https://github.com/senlinuc/caffe_ocr/blob/81642f61ea8f888e360cca30e08e05b7bc6d4556/examples/web_demo/app.py#L192-L220
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftgeoutils/edges.py
python
getTangent
(edge, from_point=None)
return None
Return the tangent to an edge, including BSpline and circular arcs. If from_point is given, it is used to calculate the tangent, only useful for a circular arc.
Return the tangent to an edge, including BSpline and circular arcs.
[ "Return", "the", "tangent", "to", "an", "edge", "including", "BSpline", "and", "circular", "arcs", "." ]
def getTangent(edge, from_point=None): """Return the tangent to an edge, including BSpline and circular arcs. If from_point is given, it is used to calculate the tangent, only useful for a circular arc. """ if geomType(edge) == "Line": return vec(edge) elif (geomType(edge) == "BSplineC...
[ "def", "getTangent", "(", "edge", ",", "from_point", "=", "None", ")", ":", "if", "geomType", "(", "edge", ")", "==", "\"Line\"", ":", "return", "vec", "(", "edge", ")", "elif", "(", "geomType", "(", "edge", ")", "==", "\"BSplineCurve\"", "or", "geomTy...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftgeoutils/edges.py#L174-L197
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py2/pygments/lexers/__init__.py
python
_load_lexers
(module_name)
Load a lexer (and all others in the module too).
Load a lexer (and all others in the module too).
[ "Load", "a", "lexer", "(", "and", "all", "others", "in", "the", "module", "too", ")", "." ]
def _load_lexers(module_name): """Load a lexer (and all others in the module too).""" mod = __import__(module_name, None, None, ['__all__']) for lexer_name in mod.__all__: cls = getattr(mod, lexer_name) _lexer_cache[cls.name] = cls
[ "def", "_load_lexers", "(", "module_name", ")", ":", "mod", "=", "__import__", "(", "module_name", ",", "None", ",", "None", ",", "[", "'__all__'", "]", ")", "for", "lexer_name", "in", "mod", ".", "__all__", ":", "cls", "=", "getattr", "(", "mod", ",",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py2/pygments/lexers/__init__.py#L43-L48
rampageX/firmware-mod-kit
c94cd6aeee50d92ec5280a6dba6d74828fd3606b
src/binwalk-2.1.1/src/binwalk/core/common.py
python
warning
(msg)
Prints warning messages to stderr
Prints warning messages to stderr
[ "Prints", "warning", "messages", "to", "stderr" ]
def warning(msg): ''' Prints warning messages to stderr ''' sys.stderr.write("\nWARNING: " + msg + "\n")
[ "def", "warning", "(", "msg", ")", ":", "sys", ".", "stderr", ".", "write", "(", "\"\\nWARNING: \"", "+", "msg", "+", "\"\\n\"", ")" ]
https://github.com/rampageX/firmware-mod-kit/blob/c94cd6aeee50d92ec5280a6dba6d74828fd3606b/src/binwalk-2.1.1/src/binwalk/core/common.py#L32-L36
SeisSol/SeisSol
955fbeb8c5d40d3363a2da0edc611259aebe1653
postprocessing/science/compute_diff_seissol_data.py
python
fuzzysort
(arr, idx, dim=0, tol=1e-6)
return srtdidx
return indexes of sorted points robust to small perturbations of individual components. https://stackoverflow.com/questions/19072110/numpy-np-lexsort-with-fuzzy-tolerant-comparisons note that I added dim<arr.shape[0]-1 in some if statement (else it will crash sometimes)
return indexes of sorted points robust to small perturbations of individual components. https://stackoverflow.com/questions/19072110/numpy-np-lexsort-with-fuzzy-tolerant-comparisons note that I added dim<arr.shape[0]-1 in some if statement (else it will crash sometimes)
[ "return", "indexes", "of", "sorted", "points", "robust", "to", "small", "perturbations", "of", "individual", "components", ".", "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "19072110", "/", "numpy", "-", "np", "-", "lexsort", "-", ...
def fuzzysort(arr, idx, dim=0, tol=1e-6): """ return indexes of sorted points robust to small perturbations of individual components. https://stackoverflow.com/questions/19072110/numpy-np-lexsort-with-fuzzy-tolerant-comparisons note that I added dim<arr.shape[0]-1 in some if statement (else it will cras...
[ "def", "fuzzysort", "(", "arr", ",", "idx", ",", "dim", "=", "0", ",", "tol", "=", "1e-6", ")", ":", "arrd", "=", "arr", "[", "dim", "]", "srtdidx", "=", "sorted", "(", "idx", ",", "key", "=", "arrd", ".", "__getitem__", ")", "i", ",", "ix", ...
https://github.com/SeisSol/SeisSol/blob/955fbeb8c5d40d3363a2da0edc611259aebe1653/postprocessing/science/compute_diff_seissol_data.py#L23-L42
ZhouWeikuan/DouDiZhu
0d84ff6c0bc54dba6ae37955de9ae9307513dc99
code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
Type.element_type
(self)
return result
Retrieve the Type of elements within this Type. If accessed on a type that is not an array, complex, or vector type, an exception will be raised.
Retrieve the Type of elements within this Type.
[ "Retrieve", "the", "Type", "of", "elements", "within", "this", "Type", "." ]
def element_type(self): """Retrieve the Type of elements within this Type. If accessed on a type that is not an array, complex, or vector type, an exception will be raised. """ result = conf.lib.clang_getElementType(self) if result.kind == TypeKind.INVALID: r...
[ "def", "element_type", "(", "self", ")", ":", "result", "=", "conf", ".", "lib", ".", "clang_getElementType", "(", "self", ")", "if", "result", ".", "kind", "==", "TypeKind", ".", "INVALID", ":", "raise", "Exception", "(", "'Element type not available on this ...
https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1504-L1514
koth/kcws
88efbd36a7022de4e6e90f5a1fb880cf87cfae9f
third_party/setuptools/pkg_resources.py
python
ResourceManager.cleanup_resources
(self, force=False)
Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be called when the extraction path is a temporary directory ex...
Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be called when the extraction path is a temporary directory ex...
[ "Delete", "all", "extracted", "resource", "files", "and", "directories", "returning", "a", "list", "of", "the", "file", "and", "directory", "names", "that", "could", "not", "be", "successfully", "removed", ".", "This", "function", "does", "not", "have", "any",...
def cleanup_resources(self, force=False): """ Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be calle...
[ "def", "cleanup_resources", "(", "self", ",", "force", "=", "False", ")", ":" ]
https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/setuptools/pkg_resources.py#L1093-L1103
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py
python
RefVariable.scatter_update
(self, sparse_delta, use_locking=False, name=None)
return gen_state_ops.scatter_update( self._variable, sparse_delta.indices, sparse_delta.values, use_locking=use_locking, name=name)
Assigns `tf.IndexedSlices` to this variable. Args: sparse_delta: `tf.IndexedSlices` to be assigned to this variable. use_locking: If `True`, use locking during the operation. name: the name of the operation. Returns: A `Tensor` that will hold the new value of this variable after ...
Assigns `tf.IndexedSlices` to this variable.
[ "Assigns", "tf", ".", "IndexedSlices", "to", "this", "variable", "." ]
def scatter_update(self, sparse_delta, use_locking=False, name=None): """Assigns `tf.IndexedSlices` to this variable. Args: sparse_delta: `tf.IndexedSlices` to be assigned to this variable. use_locking: If `True`, use locking during the operation. name: the name of the operation. Returns...
[ "def", "scatter_update", "(", "self", ",", "sparse_delta", ",", "use_locking", "=", "False", ",", "name", "=", "None", ")", ":", "if", "not", "isinstance", "(", "sparse_delta", ",", "ops", ".", "IndexedSlices", ")", ":", "raise", "TypeError", "(", "\"spars...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py#L2262-L2284
qixuxiang/orb-slam2_with_semantic_label
c05c945c783db86196267317f5951e0bd630b1bc
Examples/RGB-D/associate.py
python
associate
(first_list, second_list,offset,max_difference)
return matches
Associate two dictionaries of (stamp,data). As the time stamps never match exactly, we aim to find the closest match for every input tuple. Input: first_list -- first dictionary of (stamp,data) tuples second_list -- second dictionary of (stamp,data) tuples offset -- time offset between both diction...
Associate two dictionaries of (stamp,data). As the time stamps never match exactly, we aim to find the closest match for every input tuple.
[ "Associate", "two", "dictionaries", "of", "(", "stamp", "data", ")", ".", "As", "the", "time", "stamps", "never", "match", "exactly", "we", "aim", "to", "find", "the", "closest", "match", "for", "every", "input", "tuple", "." ]
def associate(first_list, second_list,offset,max_difference): """ Associate two dictionaries of (stamp,data). As the time stamps never match exactly, we aim to find the closest match for every input tuple. Input: first_list -- first dictionary of (stamp,data) tuples second_list -- second dictio...
[ "def", "associate", "(", "first_list", ",", "second_list", ",", "offset", ",", "max_difference", ")", ":", "first_keys", "=", "first_list", ".", "keys", "(", ")", "second_keys", "=", "second_list", ".", "keys", "(", ")", "potential_matches", "=", "[", "(", ...
https://github.com/qixuxiang/orb-slam2_with_semantic_label/blob/c05c945c783db86196267317f5951e0bd630b1bc/Examples/RGB-D/associate.py#L71-L101
chanyn/3Dpose_ssl
585696676279683a279b1ecca136c0e0d02aef2a
caffe-3dssl/scripts/cpp_lint.py
python
_FunctionState.Count
(self)
Count line in current function body.
Count line in current function body.
[ "Count", "line", "in", "current", "function", "body", "." ]
def Count(self): """Count line in current function body.""" if self.in_a_function: self.lines_in_function += 1
[ "def", "Count", "(", "self", ")", ":", "if", "self", ".", "in_a_function", ":", "self", ".", "lines_in_function", "+=", "1" ]
https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/scripts/cpp_lint.py#L831-L834
s9xie/hed
94fb22f10cbfec8d84fbc0642b224022014b6bd6
tools/extra/parse_log.py
python
parse_line_for_net_output
(regex_obj, row, row_dict_list, line, iteration, seconds, learning_rate)
return row_dict_list, row
Parse a single line for training or test output Returns a a tuple with (row_dict_list, row) row: may be either a new row or an augmented version of the current row row_dict_list: may be either the current row_dict_list or an augmented version of the current row_dict_list
Parse a single line for training or test output
[ "Parse", "a", "single", "line", "for", "training", "or", "test", "output" ]
def parse_line_for_net_output(regex_obj, row, row_dict_list, line, iteration, seconds, learning_rate): """Parse a single line for training or test output Returns a a tuple with (row_dict_list, row) row: may be either a new row or an augmented version of the current row row...
[ "def", "parse_line_for_net_output", "(", "regex_obj", ",", "row", ",", "row_dict_list", ",", "line", ",", "iteration", ",", "seconds", ",", "learning_rate", ")", ":", "output_match", "=", "regex_obj", ".", "search", "(", "line", ")", "if", "output_match", ":",...
https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/tools/extra/parse_log.py#L77-L116
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/robotparser.py
python
RobotFileParser.parse
(self, lines)
parse the input lines from a robots.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.
parse the input lines from a robots.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.
[ "parse", "the", "input", "lines", "from", "a", "robots", ".", "txt", "file", ".", "We", "allow", "that", "a", "user", "-", "agent", ":", "line", "is", "not", "preceded", "by", "one", "or", "more", "blank", "lines", "." ]
def parse(self, lines): """parse the input lines from a robots.txt file. We allow that a user-agent: line is not preceded by one or more blank lines.""" # states: # 0: start state # 1: saw user-agent line # 2: saw an allow or disallow line stat...
[ "def", "parse", "(", "self", ",", "lines", ")", ":", "# states:", "# 0: start state", "# 1: saw user-agent line", "# 2: saw an allow or disallow line", "state", "=", "0", "linenumber", "=", "0", "entry", "=", "Entry", "(", ")", "for", "line", "in", "lines", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/robotparser.py#L77-L125
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/build/lib.linux-x86_64-2.7/mxnet/recordio.py
python
MXRecordIO.close
(self)
close record file
close record file
[ "close", "record", "file" ]
def close(self): """close record file""" if not self.is_open: return if self.writable: check_call(_LIB.MXRecordIOWriterFree(self.handle)) else: check_call(_LIB.MXRecordIOReaderFree(self.handle))
[ "def", "close", "(", "self", ")", ":", "if", "not", "self", ".", "is_open", ":", "return", "if", "self", ".", "writable", ":", "check_call", "(", "_LIB", ".", "MXRecordIOWriterFree", "(", "self", ".", "handle", ")", ")", "else", ":", "check_call", "(",...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/recordio.py#L52-L59
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
Grid.EnableDragColSize
(*args, **kwargs)
return _grid.Grid_EnableDragColSize(*args, **kwargs)
EnableDragColSize(self, bool enable=True)
EnableDragColSize(self, bool enable=True)
[ "EnableDragColSize", "(", "self", "bool", "enable", "=", "True", ")" ]
def EnableDragColSize(*args, **kwargs): """EnableDragColSize(self, bool enable=True)""" return _grid.Grid_EnableDragColSize(*args, **kwargs)
[ "def", "EnableDragColSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_EnableDragColSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1606-L1608
vicaya/hypertable
e7386f799c238c109ae47973417c2a2c7f750825
src/py/ThriftClient/gen-py/hyperthrift/gen2/HqlService.py
python
Iface.hql_query2
(self, command)
@see hql_query Parameters: - command
[]
def hql_query2(self, command): """ @see hql_query Parameters: - command """ pass
[ "def", "hql_query2", "(", "self", ",", "command", ")", ":", "pass" ]
https://github.com/vicaya/hypertable/blob/e7386f799c238c109ae47973417c2a2c7f750825/src/py/ThriftClient/gen-py/hyperthrift/gen2/HqlService.py#L66-L73
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/position.py
python
Position.open_order_buy_cost
(self, open_order_buy_cost)
Sets the open_order_buy_cost of this Position. :param open_order_buy_cost: The open_order_buy_cost of this Position. # noqa: E501 :type: float
Sets the open_order_buy_cost of this Position.
[ "Sets", "the", "open_order_buy_cost", "of", "this", "Position", "." ]
def open_order_buy_cost(self, open_order_buy_cost): """Sets the open_order_buy_cost of this Position. :param open_order_buy_cost: The open_order_buy_cost of this Position. # noqa: E501 :type: float """ self._open_order_buy_cost = open_order_buy_cost
[ "def", "open_order_buy_cost", "(", "self", ",", "open_order_buy_cost", ")", ":", "self", ".", "_open_order_buy_cost", "=", "open_order_buy_cost" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L955-L963
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/sparse_grad.py
python
_SparseAddGrad
(op, *grads)
return (None, a_val_grad, None, None, b_val_grad, None, None)
The backward operator for the SparseAdd op. The SparseAdd op calculates A + B, where A, B, and the sum are all represented as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. non-empty values of the sum, and outputs the gradients w.r.t. the non-empty values of A and B. Args: op: th...
The backward operator for the SparseAdd op.
[ "The", "backward", "operator", "for", "the", "SparseAdd", "op", "." ]
def _SparseAddGrad(op, *grads): """The backward operator for the SparseAdd op. The SparseAdd op calculates A + B, where A, B, and the sum are all represented as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. non-empty values of the sum, and outputs the gradients w.r.t. the non-empty v...
[ "def", "_SparseAddGrad", "(", "op", ",", "*", "grads", ")", ":", "val_grad", "=", "grads", "[", "1", "]", "a_indices", "=", "op", ".", "inputs", "[", "0", "]", "b_indices", "=", "op", ".", "inputs", "[", "3", "]", "sum_indices", "=", "op", ".", "...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/sparse_grad.py#L62-L94
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/protobuf/python/mox.py
python
In.__init__
(self, key)
Initialize. Args: # key is any thing that could be in a list or a key in a dict
Initialize.
[ "Initialize", "." ]
def __init__(self, key): """Initialize. Args: # key is any thing that could be in a list or a key in a dict """ self._key = key
[ "def", "__init__", "(", "self", ",", "key", ")", ":", "self", ".", "_key", "=", "key" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/mox.py#L946-L953
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/framework/python/ops/checkpoint_ops.py
python
load_variable_slot_initializer
(ckpt_path, old_tensor_name, primary_partition_info, new_row_vocab_size, new_col_vocab_size, old_row_vocab_file=None, ...
return _initializer
Loads pre-trained multi-class slots for linear models from checkpoint. Wrapper around `load_and_remap_matrix_initializer()` specialized for loading multi-class slots (such as optimizer accumulators) and remapping them according to the provided vocab files. See docs for `load_and_remap_matrix_initializer()` for...
Loads pre-trained multi-class slots for linear models from checkpoint.
[ "Loads", "pre", "-", "trained", "multi", "-", "class", "slots", "for", "linear", "models", "from", "checkpoint", "." ]
def load_variable_slot_initializer(ckpt_path, old_tensor_name, primary_partition_info, new_row_vocab_size, new_col_vocab_size, old_row_vocab_file...
[ "def", "load_variable_slot_initializer", "(", "ckpt_path", ",", "old_tensor_name", ",", "primary_partition_info", ",", "new_row_vocab_size", ",", "new_col_vocab_size", ",", "old_row_vocab_file", "=", "None", ",", "new_row_vocab_file", "=", "None", ",", "old_col_vocab_file",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/framework/python/ops/checkpoint_ops.py#L518-L609
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
uCSIsMathematicalAlphanumericSymbols
(code)
return ret
Check whether the character is part of MathematicalAlphanumericSymbols UCS Block
Check whether the character is part of MathematicalAlphanumericSymbols UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "MathematicalAlphanumericSymbols", "UCS", "Block" ]
def uCSIsMathematicalAlphanumericSymbols(code): """Check whether the character is part of MathematicalAlphanumericSymbols UCS Block """ ret = libxml2mod.xmlUCSIsMathematicalAlphanumericSymbols(code) return ret
[ "def", "uCSIsMathematicalAlphanumericSymbols", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsMathematicalAlphanumericSymbols", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1940-L1944
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/osr.py
python
SpatialReference.SetVDG
(self, *args, **kwargs)
return _osr.SpatialReference_SetVDG(self, *args, **kwargs)
r"""SetVDG(SpatialReference self, double clong, double fe, double fn) -> OGRErr
r"""SetVDG(SpatialReference self, double clong, double fe, double fn) -> OGRErr
[ "r", "SetVDG", "(", "SpatialReference", "self", "double", "clong", "double", "fe", "double", "fn", ")", "-", ">", "OGRErr" ]
def SetVDG(self, *args, **kwargs): r"""SetVDG(SpatialReference self, double clong, double fe, double fn) -> OGRErr""" return _osr.SpatialReference_SetVDG(self, *args, **kwargs)
[ "def", "SetVDG", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_osr", ".", "SpatialReference_SetVDG", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/osr.py#L694-L696
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/servers/portable_globe.py
python
Globe.ServeGlobe
(self, globe_path)
return True
Sets local or remote globe to be served.
Sets local or remote globe to be served.
[ "Sets", "local", "or", "remote", "globe", "to", "be", "served", "." ]
def ServeGlobe(self, globe_path): """Sets local or remote globe to be served.""" globe_path = os.path.normpath(globe_path) if not os.path.exists(globe_path): self.SetGlobePath(globe_path) print "Unable to find", globe_path return False if globe_path[-4:] == ".glb" or globe_path[-4:] =...
[ "def", "ServeGlobe", "(", "self", ",", "globe_path", ")", ":", "globe_path", "=", "os", ".", "path", ".", "normpath", "(", "globe_path", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "globe_path", ")", ":", "self", ".", "SetGlobePath", "(", ...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/portable_globe.py#L366-L386
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
GridEvent.__init__
(self, *args, **kwargs)
__init__(self, int id, EventType type, Object obj, int row=-1, int col=-1, int x=-1, int y=-1, bool sel=True, bool control=False, bool shift=False, bool alt=False, bool meta=False) -> GridEvent
__init__(self, int id, EventType type, Object obj, int row=-1, int col=-1, int x=-1, int y=-1, bool sel=True, bool control=False, bool shift=False, bool alt=False, bool meta=False) -> GridEvent
[ "__init__", "(", "self", "int", "id", "EventType", "type", "Object", "obj", "int", "row", "=", "-", "1", "int", "col", "=", "-", "1", "int", "x", "=", "-", "1", "int", "y", "=", "-", "1", "bool", "sel", "=", "True", "bool", "control", "=", "Fal...
def __init__(self, *args, **kwargs): """ __init__(self, int id, EventType type, Object obj, int row=-1, int col=-1, int x=-1, int y=-1, bool sel=True, bool control=False, bool shift=False, bool alt=False, bool meta=False) -> GridEvent """ _grid.Gri...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_grid", ".", "GridEvent_swiginit", "(", "self", ",", "_grid", ".", "new_GridEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L2297-L2304
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/package_index.py
python
ContentChecker.feed
(self, block)
return
Feed a block of data to the hash.
Feed a block of data to the hash.
[ "Feed", "a", "block", "of", "data", "to", "the", "hash", "." ]
def feed(self, block): """ Feed a block of data to the hash. """ return
[ "def", "feed", "(", "self", ",", "block", ")", ":", "return" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/package_index.py#L246-L250
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/boost/tools/build/src/build/property_set.py
python
PropertySet.free
(self)
return result
Returns free properties which are not dependency properties.
Returns free properties which are not dependency properties.
[ "Returns", "free", "properties", "which", "are", "not", "dependency", "properties", "." ]
def free (self): """ Returns free properties which are not dependency properties. """ result = [p for p in self.lazy_properties if not p.feature.incidental and p.feature.free] result.extend(self.free_) return result
[ "def", "free", "(", "self", ")", ":", "result", "=", "[", "p", "for", "p", "in", "self", ".", "lazy_properties", "if", "not", "p", ".", "feature", ".", "incidental", "and", "p", ".", "feature", ".", "free", "]", "result", ".", "extend", "(", "self"...
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/property_set.py#L272-L278
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/cookielib.py
python
CookiePolicy.set_ok
(self, cookie, request)
Return true if (and only if) cookie should be accepted from server. Currently, pre-expired cookies never get this far -- the CookieJar class deletes such cookies itself.
Return true if (and only if) cookie should be accepted from server.
[ "Return", "true", "if", "(", "and", "only", "if", ")", "cookie", "should", "be", "accepted", "from", "server", "." ]
def set_ok(self, cookie, request): """Return true if (and only if) cookie should be accepted from server. Currently, pre-expired cookies never get this far -- the CookieJar class deletes such cookies itself. """ raise NotImplementedError()
[ "def", "set_ok", "(", "self", ",", "cookie", ",", "request", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/cookielib.py#L814-L821
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/missing.py
python
notna
(obj)
return ~res
Detect non-missing values for an array-like object. This function takes a scalar or array-like object and indicates whether values are valid (not missing, which is ``NaN`` in numeric arrays, ``None`` or ``NaN`` in object arrays, ``NaT`` in datetimelike). Parameters ---------- obj : array-like ...
Detect non-missing values for an array-like object.
[ "Detect", "non", "-", "missing", "values", "for", "an", "array", "-", "like", "object", "." ]
def notna(obj): """ Detect non-missing values for an array-like object. This function takes a scalar or array-like object and indicates whether values are valid (not missing, which is ``NaN`` in numeric arrays, ``None`` or ``NaN`` in object arrays, ``NaT`` in datetimelike). Parameters ----...
[ "def", "notna", "(", "obj", ")", ":", "res", "=", "isna", "(", "obj", ")", "if", "is_scalar", "(", "res", ")", ":", "return", "not", "res", "return", "~", "res" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/missing.py#L299-L379
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/compilerop.py
python
CachingCompiler.compiler_flags
(self)
return self.flags
Flags currently active in the compilation process.
Flags currently active in the compilation process.
[ "Flags", "currently", "active", "in", "the", "compilation", "process", "." ]
def compiler_flags(self): """Flags currently active in the compilation process. """ return self.flags
[ "def", "compiler_flags", "(", "self", ")", ":", "return", "self", ".", "flags" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/compilerop.py#L110-L113
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/third_party.py
python
ThirdPartyLibReader.get_most_specific_entry
(self, key_base_name, uselib_name, lib_configuration, fail_if_missing=False)
Attempt to get the most specific entry list based on platform and/or configuration for a library. :param key_base_name: Base name of the entry to lookup :param uselib_name: The name of the uselib this entry that is being looked up :param lib_configuration: Library configuration ...
Attempt to get the most specific entry list based on platform and/or configuration for a library.
[ "Attempt", "to", "get", "the", "most", "specific", "entry", "list", "based", "on", "platform", "and", "/", "or", "configuration", "for", "a", "library", "." ]
def get_most_specific_entry(self, key_base_name, uselib_name, lib_configuration, fail_if_missing=False): """ Attempt to get the most specific entry list based on platform and/o...
[ "def", "get_most_specific_entry", "(", "self", ",", "key_base_name", ",", "uselib_name", ",", "lib_configuration", ",", "fail_if_missing", "=", "False", ")", ":", "entry", "=", "None", "platform_node", "=", "None", "# Platform specific nodes are optional provided as long ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/third_party.py#L662-L760
HKUST-Aerial-Robotics/Teach-Repeat-Replan
98505a7f74b13c8b501176ff838a38423dbef536
utils/pose_utils/build/catkin_generated/installspace/_setup_util.py
python
_prefix_env_variable
(environ, name, paths, subfolders)
return prefix_str
Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items.
Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items.
[ "Return", "the", "prefix", "to", "prepend", "to", "the", "environment", "variable", "NAME", "adding", "any", "path", "in", "NEW_PATHS_STR", "without", "creating", "duplicate", "or", "empty", "items", "." ]
def _prefix_env_variable(environ, name, paths, subfolders): ''' Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items. ''' value = environ[name] if name in environ else '' environ_paths = [path for path in value.spli...
[ "def", "_prefix_env_variable", "(", "environ", ",", "name", ",", "paths", ",", "subfolders", ")", ":", "value", "=", "environ", "[", "name", "]", "if", "name", "in", "environ", "else", "''", "environ_paths", "=", "[", "path", "for", "path", "in", "value"...
https://github.com/HKUST-Aerial-Robotics/Teach-Repeat-Replan/blob/98505a7f74b13c8b501176ff838a38423dbef536/utils/pose_utils/build/catkin_generated/installspace/_setup_util.py#L149-L169
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/thumbnailctrl.py
python
ScrolledThumbnail.IsAudio
(self, fname)
return os.path.splitext(fname)[1].lower() in \ [".mpa", ".mp2", ".mp3", ".ac3", ".dts", ".pcm"]
Returns ``True`` if a file contains audio data. Currently unused as :class:`ThumbnailCtrl` recognizes only image files. :param `fname`: a file name. .. todo:: Find a way to create thumbnails of video, audio and other formats.
Returns ``True`` if a file contains audio data. Currently unused as :class:`ThumbnailCtrl` recognizes only image files.
[ "Returns", "True", "if", "a", "file", "contains", "audio", "data", ".", "Currently", "unused", "as", ":", "class", ":", "ThumbnailCtrl", "recognizes", "only", "image", "files", "." ]
def IsAudio(self, fname): """ Returns ``True`` if a file contains audio data. Currently unused as :class:`ThumbnailCtrl` recognizes only image files. :param `fname`: a file name. .. todo:: Find a way to create thumbnails of video, audio and other formats. """ r...
[ "def", "IsAudio", "(", "self", ",", "fname", ")", ":", "return", "os", ".", "path", ".", "splitext", "(", "fname", ")", "[", "1", "]", ".", "lower", "(", ")", "in", "[", "\".mpa\"", ",", "\".mp2\"", ",", "\".mp3\"", ",", "\".ac3\"", ",", "\".dts\""...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/thumbnailctrl.py#L1687-L1698
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/control.py
python
coverage.xml_report
(self, morfs=None, outfile=None, ignore_errors=None, omit=None, include=None)
Generate an XML report of coverage results. The report is compatible with Cobertura reports. Each module in `morfs` is included in the report. `outfile` is the path to write the file to, "-" will write to stdout. See `coverage.report()` for other arguments.
Generate an XML report of coverage results.
[ "Generate", "an", "XML", "report", "of", "coverage", "results", "." ]
def xml_report(self, morfs=None, outfile=None, ignore_errors=None, omit=None, include=None): """Generate an XML report of coverage results. The report is compatible with Cobertura reports. Each module in `morfs` is included in the report. `outfile` is the path to w...
[ "def", "xml_report", "(", "self", ",", "morfs", "=", "None", ",", "outfile", "=", "None", ",", "ignore_errors", "=", "None", ",", "omit", "=", "None", ",", "include", "=", "None", ")", ":", "self", ".", "config", ".", "from_args", "(", "ignore_errors",...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/control.py#L601-L629
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/neural_network/_stochastic_optimizers.py
python
BaseOptimizer.iteration_ends
(self, time_step)
Perform update to learning rate and potentially other states at the end of an iteration
Perform update to learning rate and potentially other states at the end of an iteration
[ "Perform", "update", "to", "learning", "rate", "and", "potentially", "other", "states", "at", "the", "end", "of", "an", "iteration" ]
def iteration_ends(self, time_step): """Perform update to learning rate and potentially other states at the end of an iteration """ pass
[ "def", "iteration_ends", "(", "self", ",", "time_step", ")", ":", "pass" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/neural_network/_stochastic_optimizers.py#L47-L51
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/perf/metrics/system_memory.py
python
SystemMemoryMetric.Stop
(self, page, tab)
Prepare the results for this page. The results are the differences between the current system memory stats and the values when Start() was called.
Prepare the results for this page.
[ "Prepare", "the", "results", "for", "this", "page", "." ]
def Stop(self, page, tab): """Prepare the results for this page. The results are the differences between the current system memory stats and the values when Start() was called. """ assert self._memory_stats_start, 'Must call Start() first' self._memory_stats_end = self._browser.memory_stats
[ "def", "Stop", "(", "self", ",", "page", ",", "tab", ")", ":", "assert", "self", ".", "_memory_stats_start", ",", "'Must call Start() first'", "self", ".", "_memory_stats_end", "=", "self", ".", "_browser", ".", "memory_stats" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/metrics/system_memory.py#L31-L38
qboticslabs/mastering_ros
d83e78f30acc45b0f18522c1d5fae3a7f52974b9
chapter_9_codes/chefbot/chefbot/chefbot_bringup/scripts/bkup_working/arduino.py
python
Arduino._GetBaseAndExponent
(self, floatValue, resolution=4)
Converts a float into a tuple holding two integers: The base, an integer with the number of digits equaling resolution. The exponent indicating what the base needs to multiplied with to get back the original float value with the specified resolution.
Converts a float into a tuple holding two integers: The base, an integer with the number of digits equaling resolution. The exponent indicating what the base needs to multiplied with to get back the original float value with the specified resolution.
[ "Converts", "a", "float", "into", "a", "tuple", "holding", "two", "integers", ":", "The", "base", "an", "integer", "with", "the", "number", "of", "digits", "equaling", "resolution", ".", "The", "exponent", "indicating", "what", "the", "base", "needs", "to", ...
def _GetBaseAndExponent(self, floatValue, resolution=4): ''' Converts a float into a tuple holding two integers: The base, an integer with the number of digits equaling resolution. The exponent indicating what the base needs to multiplied with to get back the original float value with the specified resolution...
[ "def", "_GetBaseAndExponent", "(", "self", ",", "floatValue", ",", "resolution", "=", "4", ")", ":", "if", "(", "floatValue", "==", "0.0", ")", ":", "return", "(", "0", ",", "0", ")", "else", ":", "exponent", "=", "int", "(", "1.0", "+", "math", "....
https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_9_codes/chefbot/chefbot/chefbot_bringup/scripts/bkup_working/arduino.py#L407-L422
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
WhileContext.AddValue
(self, val)
return result
Add `val` to the current context and its outer context recursively.
Add `val` to the current context and its outer context recursively.
[ "Add", "val", "to", "the", "current", "context", "and", "its", "outer", "context", "recursively", "." ]
def AddValue(self, val): """Add `val` to the current context and its outer context recursively.""" result = val if val.name not in self._values: self._values.add(val.name) # If we are in a grad context and val is from its forward context, # use GetRealValue(), which adds the logic to save...
[ "def", "AddValue", "(", "self", ",", "val", ")", ":", "result", "=", "val", "if", "val", ".", "name", "not", "in", "self", ".", "_values", ":", "self", ".", "_values", ".", "add", "(", "val", ".", "name", ")", "# If we are in a grad context and val is fr...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1437-L1475
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/examples/skflow/language_model.py
python
seq_autoencoder
(X, y)
return learn.ops.sequence_classifier(decoding, out_y, sampling_decoding)
Sequence auto-encoder with RNN.
Sequence auto-encoder with RNN.
[ "Sequence", "auto", "-", "encoder", "with", "RNN", "." ]
def seq_autoencoder(X, y): """Sequence auto-encoder with RNN.""" inputs = learn.ops.one_hot_matrix(X, 256) in_X, in_y, out_y = learn.ops.seq2seq_inputs(inputs, y, MAX_DOC_LENGTH, MAX_DOC_LENGTH) encoder_cell = tf.nn.rnn_cell.GRUCell(HIDDEN_SIZE) decoder_cell = tf.nn.rnn_cell.OutputProjectionWrapper(tf.nn.rnn_...
[ "def", "seq_autoencoder", "(", "X", ",", "y", ")", ":", "inputs", "=", "learn", ".", "ops", ".", "one_hot_matrix", "(", "X", ",", "256", ")", "in_X", ",", "in_y", ",", "out_y", "=", "learn", ".", "ops", ".", "seq2seq_inputs", "(", "inputs", ",", "y...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/examples/skflow/language_model.py#L69-L76
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/comm_ops.py
python
_MirrorMicroStepOperator.__init__
(self, group=None, dev_num=None, mean_flag=None)
Initialize _MirrorMicroStepOperator.
Initialize _MirrorMicroStepOperator.
[ "Initialize", "_MirrorMicroStepOperator", "." ]
def __init__(self, group=None, dev_num=None, mean_flag=None): """Initialize _MirrorMicroStepOperator.""" self.group = group self.dev_num = dev_num self.mean_flag = mean_flag
[ "def", "__init__", "(", "self", ",", "group", "=", "None", ",", "dev_num", "=", "None", ",", "mean_flag", "=", "None", ")", ":", "self", ".", "group", "=", "group", "self", ".", "dev_num", "=", "dev_num", "self", ".", "mean_flag", "=", "mean_flag" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/comm_ops.py#L1047-L1051
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
isExtender
(ch)
return ret
This function is DEPRECATED. Use xmlIsExtender_ch or xmlIsExtenderQ instead
This function is DEPRECATED. Use xmlIsExtender_ch or xmlIsExtenderQ instead
[ "This", "function", "is", "DEPRECATED", ".", "Use", "xmlIsExtender_ch", "or", "xmlIsExtenderQ", "instead" ]
def isExtender(ch): """This function is DEPRECATED. Use xmlIsExtender_ch or xmlIsExtenderQ instead """ ret = libxml2mod.xmlIsExtender(ch) return ret
[ "def", "isExtender", "(", "ch", ")", ":", "ret", "=", "libxml2mod", ".", "xmlIsExtender", "(", "ch", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1056-L1060
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
PickerBase.SetTextCtrlProportion
(*args, **kwargs)
return _controls_.PickerBase_SetTextCtrlProportion(*args, **kwargs)
SetTextCtrlProportion(self, int prop) Sets the proportion between the text control and the picker button. This is used to set relative sizes of the text contorl and the picker. The value passed to this function must be >= 1.
SetTextCtrlProportion(self, int prop)
[ "SetTextCtrlProportion", "(", "self", "int", "prop", ")" ]
def SetTextCtrlProportion(*args, **kwargs): """ SetTextCtrlProportion(self, int prop) Sets the proportion between the text control and the picker button. This is used to set relative sizes of the text contorl and the picker. The value passed to this function must be >= 1. ...
[ "def", "SetTextCtrlProportion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "PickerBase_SetTextCtrlProportion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L6756-L6764
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/easy_install.py
python
CommandSpec._extract_options
(orig_script)
return options.strip()
Extract any options from the first line of the script.
Extract any options from the first line of the script.
[ "Extract", "any", "options", "from", "the", "first", "line", "of", "the", "script", "." ]
def _extract_options(orig_script): """ Extract any options from the first line of the script. """ first = (orig_script + '\n').splitlines()[0] match = _first_line_re().match(first) options = match.group(1) or '' if match else '' return options.strip()
[ "def", "_extract_options", "(", "orig_script", ")", ":", "first", "=", "(", "orig_script", "+", "'\\n'", ")", ".", "splitlines", "(", ")", "[", "0", "]", "match", "=", "_first_line_re", "(", ")", ".", "match", "(", "first", ")", "options", "=", "match"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/easy_install.py#L2033-L2040
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/ccompiler.py
python
CCompiler._fix_compile_args
(self, output_dir, macros, include_dirs)
return output_dir, macros, include_dirs
Typecheck and fix-up some of the arguments to the 'compile()' method, and return fixed-up values. Specifically: if 'output_dir' is None, replaces it with 'self.output_dir'; ensures that 'macros' is a list, and augments it with 'self.macros'; ensures that 'include_dirs' is a list, and au...
Typecheck and fix-up some of the arguments to the 'compile()' method, and return fixed-up values. Specifically: if 'output_dir' is None, replaces it with 'self.output_dir'; ensures that 'macros' is a list, and augments it with 'self.macros'; ensures that 'include_dirs' is a list, and au...
[ "Typecheck", "and", "fix", "-", "up", "some", "of", "the", "arguments", "to", "the", "compile", "()", "method", "and", "return", "fixed", "-", "up", "values", ".", "Specifically", ":", "if", "output_dir", "is", "None", "replaces", "it", "with", "self", "...
def _fix_compile_args(self, output_dir, macros, include_dirs): """Typecheck and fix-up some of the arguments to the 'compile()' method, and return fixed-up values. Specifically: if 'output_dir' is None, replaces it with 'self.output_dir'; ensures that 'macros' is a list, and augments it...
[ "def", "_fix_compile_args", "(", "self", ",", "output_dir", ",", "macros", ",", "include_dirs", ")", ":", "if", "output_dir", "is", "None", ":", "output_dir", "=", "self", ".", "output_dir", "elif", "not", "isinstance", "(", "output_dir", ",", "str", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/ccompiler.py#L362-L392
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/sandbox.py
python
AbstractSandbox._remap_input
(self, operation, path, *args, **kw)
return self._validate_path(path)
Called for path inputs
Called for path inputs
[ "Called", "for", "path", "inputs" ]
def _remap_input(self, operation, path, *args, **kw): """Called for path inputs""" return self._validate_path(path)
[ "def", "_remap_input", "(", "self", ",", "operation", ",", "path", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "_validate_path", "(", "path", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/sandbox.py#L360-L362
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
_arraymethod
(funcname, onmask=True)
return wrapped_method
Return a class method wrapper around a basic array method. Creates a class method which returns a masked array, where the new ``_data`` array is the output of the corresponding basic method called on the original ``_data``. If `onmask` is True, the new mask is the output of the method called on th...
Return a class method wrapper around a basic array method.
[ "Return", "a", "class", "method", "wrapper", "around", "a", "basic", "array", "method", "." ]
def _arraymethod(funcname, onmask=True): """ Return a class method wrapper around a basic array method. Creates a class method which returns a masked array, where the new ``_data`` array is the output of the corresponding basic method called on the original ``_data``. If `onmask` is True, the ...
[ "def", "_arraymethod", "(", "funcname", ",", "onmask", "=", "True", ")", ":", "def", "wrapped_method", "(", "self", ",", "*", "args", ",", "*", "*", "params", ")", ":", "result", "=", "getattr", "(", "self", ".", "_data", ",", "funcname", ")", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L2562-L2604
mamedev/mame
02cd26d37ee11191f3e311e19e805d872cb1e3a4
scripts/build/png.py
python
isarray
(x)
Same as ``isinstance(x, array)`` except on Python 2.2, where it always returns ``False``. This helps PyPNG work on Python 2.2.
Same as ``isinstance(x, array)`` except on Python 2.2, where it always returns ``False``. This helps PyPNG work on Python 2.2.
[ "Same", "as", "isinstance", "(", "x", "array", ")", "except", "on", "Python", "2", ".", "2", "where", "it", "always", "returns", "False", ".", "This", "helps", "PyPNG", "work", "on", "Python", "2", ".", "2", "." ]
def isarray(x): """Same as ``isinstance(x, array)`` except on Python 2.2, where it always returns ``False``. This helps PyPNG work on Python 2.2. """ try: return isinstance(x, array) except TypeError: # Because on Python 2.2 array.array is not a type. return False
[ "def", "isarray", "(", "x", ")", ":", "try", ":", "return", "isinstance", "(", "x", ",", "array", ")", "except", "TypeError", ":", "# Because on Python 2.2 array.array is not a type.", "return", "False" ]
https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/scripts/build/png.py#L193-L202
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ipaddress.py
python
IPv4Address.is_link_local
(self)
return self in self._constants._linklocal_network
Test if the address is reserved for link-local. Returns: A boolean, True if the address is link-local per RFC 3927.
Test if the address is reserved for link-local.
[ "Test", "if", "the", "address", "is", "reserved", "for", "link", "-", "local", "." ]
def is_link_local(self): """Test if the address is reserved for link-local. Returns: A boolean, True if the address is link-local per RFC 3927. """ return self in self._constants._linklocal_network
[ "def", "is_link_local", "(", "self", ")", ":", "return", "self", "in", "self", ".", "_constants", ".", "_linklocal_network" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ipaddress.py#L1395-L1402
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py
python
BaseEnumeration.name
(self)
return self._name_map[self]
Get the enumeration name of this cursor kind.
Get the enumeration name of this cursor kind.
[ "Get", "the", "enumeration", "name", "of", "this", "cursor", "kind", "." ]
def name(self): """Get the enumeration name of this cursor kind.""" if self._name_map is None: self._name_map = {} for key, value in self.__class__.__dict__.items(): if isinstance(value, self.__class__): self._name_map[value] = key retu...
[ "def", "name", "(", "self", ")", ":", "if", "self", ".", "_name_map", "is", "None", ":", "self", ".", "_name_map", "=", "{", "}", "for", "key", ",", "value", "in", "self", ".", "__class__", ".", "__dict__", ".", "items", "(", ")", ":", "if", "isi...
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L568-L575
BSVino/DoubleAction
c550b168a3e919926c198c30240f506538b92e75
mp/src/thirdparty/protobuf-2.3.0/python/mox.py
python
Mox.CreateMock
(self, class_to_mock)
return new_mock
Create a new mock object. Args: # class_to_mock: the class to be mocked class_to_mock: class Returns: MockObject that can be used as the class_to_mock would be.
Create a new mock object.
[ "Create", "a", "new", "mock", "object", "." ]
def CreateMock(self, class_to_mock): """Create a new mock object. Args: # class_to_mock: the class to be mocked class_to_mock: class Returns: MockObject that can be used as the class_to_mock would be. """ new_mock = MockObject(class_to_mock) self._mock_objects.append(new_moc...
[ "def", "CreateMock", "(", "self", ",", "class_to_mock", ")", ":", "new_mock", "=", "MockObject", "(", "class_to_mock", ")", "self", ".", "_mock_objects", ".", "append", "(", "new_mock", ")", "return", "new_mock" ]
https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/mox.py#L164-L177
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/transport/TSocket.py
python
TSocket.__init__
(self, host='localhost', port=9090, unix_socket=None, socket_family=socket.AF_UNSPEC, socket_keepalive=False)
Initialize a TSocket @param host(str) The host to connect to. @param port(int) The (TCP) port to connect to. @param unix_socket(str) The filename of a unix socket to connect to. (host and port will be ignored.) @param socket_family(int) The socket fa...
Initialize a TSocket
[ "Initialize", "a", "TSocket" ]
def __init__(self, host='localhost', port=9090, unix_socket=None, socket_family=socket.AF_UNSPEC, socket_keepalive=False): """Initialize a TSocket @param host(str) The host to connect to. @param port(int) The (TCP) port to connect to. @param unix_sock...
[ "def", "__init__", "(", "self", ",", "host", "=", "'localhost'", ",", "port", "=", "9090", ",", "unix_socket", "=", "None", ",", "socket_family", "=", "socket", ".", "AF_UNSPEC", ",", "socket_keepalive", "=", "False", ")", ":", "self", ".", "host", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/transport/TSocket.py#L53-L71
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/stageView.py
python
StageView.computeAndSetClosestDistance
(self)
Using the current FreeCamera's frustum, determine the world-space closest rendered point to the camera. Use that point to set our FreeCamera's closest visible distance.
Using the current FreeCamera's frustum, determine the world-space closest rendered point to the camera. Use that point to set our FreeCamera's closest visible distance.
[ "Using", "the", "current", "FreeCamera", "s", "frustum", "determine", "the", "world", "-", "space", "closest", "rendered", "point", "to", "the", "camera", ".", "Use", "that", "point", "to", "set", "our", "FreeCamera", "s", "closest", "visible", "distance", "...
def computeAndSetClosestDistance(self): '''Using the current FreeCamera's frustum, determine the world-space closest rendered point to the camera. Use that point to set our FreeCamera's closest visible distance.''' # pick() operates at very low screen resolution, but that's OK for ...
[ "def", "computeAndSetClosestDistance", "(", "self", ")", ":", "# pick() operates at very low screen resolution, but that's OK for", "# our purposes. Ironically, the same limited Z-buffer resolution for", "# which we are trying to compensate may cause us to completely lose", "# ALL of our geometry...
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/stageView.py#L2132-L2163
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetCflagsC
(self, configname)
return cflags_c
Returns flags that need to be added to .c, and .m compilations.
Returns flags that need to be added to .c, and .m compilations.
[ "Returns", "flags", "that", "need", "to", "be", "added", "to", ".", "c", "and", ".", "m", "compilations", "." ]
def GetCflagsC(self, configname): """Returns flags that need to be added to .c, and .m compilations.""" self.configname = configname cflags_c = [] if self._Settings().get('GCC_C_LANGUAGE_STANDARD', '') == 'ansi': cflags_c.append('-ansi') else: self._Appendf(cflags_c, 'GCC_C_LANGUAGE_STAN...
[ "def", "GetCflagsC", "(", "self", ",", "configname", ")", ":", "self", ".", "configname", "=", "configname", "cflags_c", "=", "[", "]", "if", "self", ".", "_Settings", "(", ")", ".", "get", "(", "'GCC_C_LANGUAGE_STANDARD'", ",", "''", ")", "==", "'ansi'"...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L591-L601
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/build/engine.py
python
Engine.get_target_variable
(self, targets, variable)
return bjam_interface.call('get-target-variable', targets, variable)
Gets the value of `variable` on set on the first target in `targets`. Args: targets (str or list): one or more targets to get the variable from. variable (str): the name of the variable Returns: the value of `variable` set on `targets` (list) Example: ...
Gets the value of `variable` on set on the first target in `targets`.
[ "Gets", "the", "value", "of", "variable", "on", "set", "on", "the", "first", "target", "in", "targets", "." ]
def get_target_variable(self, targets, variable): """Gets the value of `variable` on set on the first target in `targets`. Args: targets (str or list): one or more targets to get the variable from. variable (str): the name of the variable Returns: the value...
[ "def", "get_target_variable", "(", "self", ",", "targets", ",", "variable", ")", ":", "if", "isinstance", "(", "targets", ",", "str", ")", ":", "targets", "=", "[", "targets", "]", "assert", "is_iterable", "(", "targets", ")", "assert", "isinstance", "(", ...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/engine.py#L93-L121
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/AI/ShipDesignAI.py
python
ShipDesignCache.print_production_time
(self)
Print production_time cache.
Print production_time cache.
[ "Print", "production_time", "cache", "." ]
def print_production_time(self): """Print production_time cache.""" universe = fo.getUniverse() debug("Cached production cost per planet:") for pid in self.production_time: debug(" %s: %s" % (universe.getPlanet(pid).name, self.production_time[pid]))
[ "def", "print_production_time", "(", "self", ")", ":", "universe", "=", "fo", ".", "getUniverse", "(", ")", "debug", "(", "\"Cached production cost per planet:\"", ")", "for", "pid", "in", "self", ".", "production_time", ":", "debug", "(", "\" %s: %s\"", "%", ...
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/ShipDesignAI.py#L251-L256
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewListStore.__init__
(self, *args, **kwargs)
__init__(self) -> DataViewListStore
__init__(self) -> DataViewListStore
[ "__init__", "(", "self", ")", "-", ">", "DataViewListStore" ]
def __init__(self, *args, **kwargs): """__init__(self) -> DataViewListStore""" _dataview.DataViewListStore_swiginit(self,_dataview.new_DataViewListStore(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_dataview", ".", "DataViewListStore_swiginit", "(", "self", ",", "_dataview", ".", "new_DataViewListStore", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L2060-L2062
hunterlew/mstar_deeplearning_project
3761624dcbd7d44af257200542d13d1444dc634a
classification/caffe/build/Release/pycaffe/caffe/io.py
python
load_image
(filename, color=True)
return img
Load an image converting from grayscale or alpha as needed. Parameters ---------- filename : string color : boolean flag for color format. True (default) loads as RGB while False loads as intensity (if image is already grayscale). Returns ------- image : an image with type ...
Load an image converting from grayscale or alpha as needed.
[ "Load", "an", "image", "converting", "from", "grayscale", "or", "alpha", "as", "needed", "." ]
def load_image(filename, color=True): """ Load an image converting from grayscale or alpha as needed. Parameters ---------- filename : string color : boolean flag for color format. True (default) loads as RGB while False loads as intensity (if image is already grayscale). R...
[ "def", "load_image", "(", "filename", ",", "color", "=", "True", ")", ":", "img", "=", "skimage", ".", "img_as_float", "(", "skimage", ".", "io", ".", "imread", "(", "filename", ",", "as_grey", "=", "not", "color", ")", ")", ".", "astype", "(", "np",...
https://github.com/hunterlew/mstar_deeplearning_project/blob/3761624dcbd7d44af257200542d13d1444dc634a/classification/caffe/build/Release/pycaffe/caffe/io.py#L279-L303
amd/OpenCL-caffe
638543108517265366c18ae5821f3096cf5cf34a
scripts/cpp_lint.py
python
_SetCountingStyle
(level)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def _SetCountingStyle(level): """Sets the module's counting options.""" _cpplint_state.SetCountingStyle(level)
[ "def", "_SetCountingStyle", "(", "level", ")", ":", "_cpplint_state", ".", "SetCountingStyle", "(", "level", ")" ]
https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/scripts/cpp_lint.py#L787-L789
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/multiprocessing/managers.py
python
all_methods
(obj)
return temp
Return a list of names of methods of `obj`
Return a list of names of methods of `obj`
[ "Return", "a", "list", "of", "names", "of", "methods", "of", "obj" ]
def all_methods(obj): ''' Return a list of names of methods of `obj` ''' temp = [] for name in dir(obj): func = getattr(obj, name) if hasattr(func, '__call__'): temp.append(name) return temp
[ "def", "all_methods", "(", "obj", ")", ":", "temp", "=", "[", "]", "for", "name", "in", "dir", "(", "obj", ")", ":", "func", "=", "getattr", "(", "obj", ",", "name", ")", "if", "hasattr", "(", "func", ",", "'__call__'", ")", ":", "temp", ".", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/multiprocessing/managers.py#L127-L136
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mimetypes.py
python
MimeTypes.add_type
(self, type, ext, strict=True)
Add a mapping between a type and an extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be added to list of...
Add a mapping between a type and an extension.
[ "Add", "a", "mapping", "between", "a", "type", "and", "an", "extension", "." ]
def add_type(self, type, ext, strict=True): """Add a mapping between a type and an extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If stric...
[ "def", "add_type", "(", "self", ",", "type", ",", "ext", ",", "strict", "=", "True", ")", ":", "self", ".", "types_map", "[", "strict", "]", "[", "ext", "]", "=", "type", "exts", "=", "self", ".", "types_map_inv", "[", "strict", "]", ".", "setdefau...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mimetypes.py#L78-L93
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/tensor_shape.py
python
TensorShape.dims
(self)
return self._dims
Returns a list of Dimensions, or None if the shape is unspecified.
Returns a list of Dimensions, or None if the shape is unspecified.
[ "Returns", "a", "list", "of", "Dimensions", "or", "None", "if", "the", "shape", "is", "unspecified", "." ]
def dims(self): """Returns a list of Dimensions, or None if the shape is unspecified.""" return self._dims
[ "def", "dims", "(", "self", ")", ":", "return", "self", ".", "_dims" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/tensor_shape.py#L469-L471
anestisb/oatdump_plus
ba858c1596598f0d9ae79c14d08c708cecc50af3
tools/common/common.py
python
ITestEnv.logfile
(self)
Gets file handle to logfile residing on host.
Gets file handle to logfile residing on host.
[ "Gets", "file", "handle", "to", "logfile", "residing", "on", "host", "." ]
def logfile(self): """Gets file handle to logfile residing on host."""
[ "def", "logfile", "(", "self", ")", ":" ]
https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/common/common.py#L274-L275
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/support.py
python
get_former_line_indentation
(iter_start)
return ""
Returns the indentation of the former paragraph or empty string
Returns the indentation of the former paragraph or empty string
[ "Returns", "the", "indentation", "of", "the", "former", "paragraph", "or", "empty", "string" ]
def get_former_line_indentation(iter_start): """Returns the indentation of the former paragraph or empty string""" if not iter_start.backward_chars(2) or iter_start.get_char() == cons.CHAR_NEWLINE: return "" buffer_start = False while iter_start: if iter_start.get_char() == cons.CHAR_NEWLINE: br...
[ "def", "get_former_line_indentation", "(", "iter_start", ")", ":", "if", "not", "iter_start", ".", "backward_chars", "(", "2", ")", "or", "iter_start", ".", "get_char", "(", ")", "==", "cons", ".", "CHAR_NEWLINE", ":", "return", "\"\"", "buffer_start", "=", ...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/support.py#L748-L768
sfzhang15/RefineDet
52b6fe23dc1a160fe710b7734576dca509bf4fae
python/caffe/coord_map.py
python
compose
(base_map, next_map)
return ax, a1 * a2, a1 * b2 + b1
Compose a base coord map with scale a1, shift b1 with a further coord map with scale a2, shift b2. The scales multiply and the further shift, b2, is scaled by base coord scale a1.
Compose a base coord map with scale a1, shift b1 with a further coord map with scale a2, shift b2. The scales multiply and the further shift, b2, is scaled by base coord scale a1.
[ "Compose", "a", "base", "coord", "map", "with", "scale", "a1", "shift", "b1", "with", "a", "further", "coord", "map", "with", "scale", "a2", "shift", "b2", ".", "The", "scales", "multiply", "and", "the", "further", "shift", "b2", "is", "scaled", "by", ...
def compose(base_map, next_map): """ Compose a base coord map with scale a1, shift b1 with a further coord map with scale a2, shift b2. The scales multiply and the further shift, b2, is scaled by base coord scale a1. """ ax1, a1, b1 = base_map ax2, a2, b2 = next_map if ax1 is None: ...
[ "def", "compose", "(", "base_map", ",", "next_map", ")", ":", "ax1", ",", "a1", ",", "b1", "=", "base_map", "ax2", ",", "a2", ",", "b2", "=", "next_map", "if", "ax1", "is", "None", ":", "ax", "=", "ax2", "elif", "ax2", "is", "None", "or", "ax1", ...
https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/python/caffe/coord_map.py#L89-L103
mongodb/mongo-cxx-driver
eb86512b05be20d2f51d53ba9b860c709e0799b3
etc/clang_format.py
python
format_func
(clang_format)
Format files command entry point
Format files command entry point
[ "Format", "files", "command", "entry", "point" ]
def format_func(clang_format): """Format files command entry point """ files = get_files_to_check() _format_files(clang_format, files)
[ "def", "format_func", "(", "clang_format", ")", ":", "files", "=", "get_files_to_check", "(", ")", "_format_files", "(", "clang_format", ",", "files", ")" ]
https://github.com/mongodb/mongo-cxx-driver/blob/eb86512b05be20d2f51d53ba9b860c709e0799b3/etc/clang_format.py#L708-L713
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/estimators/base.py
python
DeprecatedMixin.save
(self, path)
Saves checkpoints and graph to given path. Args: path: Folder to save model to.
Saves checkpoints and graph to given path.
[ "Saves", "checkpoints", "and", "graph", "to", "given", "path", "." ]
def save(self, path): """Saves checkpoints and graph to given path. Args: path: Folder to save model to. """ # Copy model dir into new path. _copy_dir(self.model_dir, path)
[ "def", "save", "(", "self", ",", "path", ")", ":", "# Copy model dir into new path.", "_copy_dir", "(", "self", ".", "model_dir", ",", "path", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/base.py#L144-L151
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/copier.py
python
Jarrer.copy
(self, dest, skip_if_older=True)
Pack all registered files in the given destination jar. The given destination jar may be a path to jar file, or a Dest instance for a jar file. If the destination jar file exists, its (compressed) contents are used instead of the registered BaseFile instances when appropriate.
Pack all registered files in the given destination jar. The given destination jar may be a path to jar file, or a Dest instance for a jar file. If the destination jar file exists, its (compressed) contents are used instead of the registered BaseFile instances when appropriate.
[ "Pack", "all", "registered", "files", "in", "the", "given", "destination", "jar", ".", "The", "given", "destination", "jar", "may", "be", "a", "path", "to", "jar", "file", "or", "a", "Dest", "instance", "for", "a", "jar", "file", ".", "If", "the", "des...
def copy(self, dest, skip_if_older=True): ''' Pack all registered files in the given destination jar. The given destination jar may be a path to jar file, or a Dest instance for a jar file. If the destination jar file exists, its (compressed) contents are used instead of ...
[ "def", "copy", "(", "self", ",", "dest", ",", "skip_if_older", "=", "True", ")", ":", "class", "DeflaterDest", "(", "Dest", ")", ":", "'''\n Dest-like class, reading from a file-like object initially, but\n switching to a Deflater object if written to.\n\n ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/copier.py#L423-L484
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
cnx/tickds.py
python
TickDataSeries.getApDataSeries
(self)
return self.__apDS
Returns a :class:`pyalgotrade.dataseries.DataSeries` with the open prices.
Returns a :class:`pyalgotrade.dataseries.DataSeries` with the open prices.
[ "Returns", "a", ":", "class", ":", "pyalgotrade", ".", "dataseries", ".", "DataSeries", "with", "the", "open", "prices", "." ]
def getApDataSeries(self): """Returns a :class:`pyalgotrade.dataseries.DataSeries` with the open prices.""" return self.__apDS
[ "def", "getApDataSeries", "(", "self", ")", ":", "return", "self", ".", "__apDS" ]
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/cnx/tickds.py#L97-L99
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
GCDC.__init__
(self, *args)
__init__(self, WindowDC dc) -> GCDC __init__(self, MemoryDC dc) -> GCDC __init__(self, PrinterDC dc) -> GCDC __init__(self, Window window) -> GCDC __init__(self, GraphicsContext ctx) -> GCDC
__init__(self, WindowDC dc) -> GCDC __init__(self, MemoryDC dc) -> GCDC __init__(self, PrinterDC dc) -> GCDC __init__(self, Window window) -> GCDC __init__(self, GraphicsContext ctx) -> GCDC
[ "__init__", "(", "self", "WindowDC", "dc", ")", "-", ">", "GCDC", "__init__", "(", "self", "MemoryDC", "dc", ")", "-", ">", "GCDC", "__init__", "(", "self", "PrinterDC", "dc", ")", "-", ">", "GCDC", "__init__", "(", "self", "Window", "window", ")", "...
def __init__(self, *args): """ __init__(self, WindowDC dc) -> GCDC __init__(self, MemoryDC dc) -> GCDC __init__(self, PrinterDC dc) -> GCDC __init__(self, Window window) -> GCDC __init__(self, GraphicsContext ctx) -> GCDC """ _gdi_.GCDC_swiginit(self,_gdi...
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_gdi_", ".", "GCDC_swiginit", "(", "self", ",", "_gdi_", ".", "new_GCDC", "(", "*", "args", ")", ")", "self", ".", "__dc", "=", "args", "[", "0", "]" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L6679-L6688
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Util.py
python
AppendPath
(oldpath, newpath, sep = os.pathsep, delete_existing=1, canonicalize=None)
This appends new path elements to the given old path. Will only add any particular path once (leaving the last one it encounters and ignoring the rest, to preserve path order), and will os.path.normpath and os.path.normcase all paths to help assure this. This can also handle the case where the given o...
This appends new path elements to the given old path. Will only add any particular path once (leaving the last one it encounters and ignoring the rest, to preserve path order), and will os.path.normpath and os.path.normcase all paths to help assure this. This can also handle the case where the given o...
[ "This", "appends", "new", "path", "elements", "to", "the", "given", "old", "path", ".", "Will", "only", "add", "any", "particular", "path", "once", "(", "leaving", "the", "last", "one", "it", "encounters", "and", "ignoring", "the", "rest", "to", "preserve"...
def AppendPath(oldpath, newpath, sep = os.pathsep, delete_existing=1, canonicalize=None): """This appends new path elements to the given old path. Will only add any particular path once (leaving the last one it encounters and ignoring the rest, to preserve path order), and will os.path.n...
[ "def", "AppendPath", "(", "oldpath", ",", "newpath", ",", "sep", "=", "os", ".", "pathsep", ",", "delete_existing", "=", "1", ",", "canonicalize", "=", "None", ")", ":", "orig", "=", "oldpath", "is_list", "=", "1", "paths", "=", "orig", "if", "not", ...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Util.py#L925-L1004
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/monitoring.py
python
SamplerCell.value
(self)
return histogram_proto
Retrieves the current distribution of samples. Returns: A HistogramProto describing the distribution of samples.
Retrieves the current distribution of samples.
[ "Retrieves", "the", "current", "distribution", "of", "samples", "." ]
def value(self): """Retrieves the current distribution of samples. Returns: A HistogramProto describing the distribution of samples. """ with c_api_util.tf_buffer() as buffer_: pywrap_tfe.TFE_MonitoringSamplerCellValue(self._cell, buffer_) proto_data = pywrap_tf_session.TF_GetBuffer(b...
[ "def", "value", "(", "self", ")", ":", "with", "c_api_util", ".", "tf_buffer", "(", ")", "as", "buffer_", ":", "pywrap_tfe", ".", "TFE_MonitoringSamplerCellValue", "(", "self", ".", "_cell", ",", "buffer_", ")", "proto_data", "=", "pywrap_tf_session", ".", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/monitoring.py#L385-L396
Illumina/strelka
d7377443b62319f7c7bd70c241c4b2df3459e29a
src/python/lib/strelkaSequenceErrorEstimation.py
python
SyncronizedAccumulator.countTasksRequiredToReachTarget
(self, targetVal)
return (None, isContinuous)
Return the tuple (taskCount, isContinuous), where: taskCount is the smallest index N such that sum of values [1:N] is >= targetVal, or None if no such value exists isContinuous is True if all tasks in range [1:N] are present in the value
Return the tuple (taskCount, isContinuous), where:
[ "Return", "the", "tuple", "(", "taskCount", "isContinuous", ")", "where", ":" ]
def countTasksRequiredToReachTarget(self, targetVal): """ Return the tuple (taskCount, isContinuous), where: taskCount is the smallest index N such that sum of values [1:N] is >= targetVal, or None if no such value exists isContinuous is True if all tasks in range [1:N] are present in t...
[ "def", "countTasksRequiredToReachTarget", "(", "self", ",", "targetVal", ")", ":", "taskCount", "=", "0", "sum", "=", "0", "isContinuous", "=", "True", "# Handle the edge case, targetVal <= 0", "if", "sum", ">=", "targetVal", ":", "return", "(", "taskCount", ",", ...
https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/strelkaSequenceErrorEstimation.py#L163-L187
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xpathContext.setContextNode
(self, node)
Set the current node of an xpathContext
Set the current node of an xpathContext
[ "Set", "the", "current", "node", "of", "an", "xpathContext" ]
def setContextNode(self, node): """Set the current node of an xpathContext """ if node is None: node__o = None else: node__o = node._o libxml2mod.xmlXPathSetContextNode(self._o, node__o)
[ "def", "setContextNode", "(", "self", ",", "node", ")", ":", "if", "node", "is", "None", ":", "node__o", "=", "None", "else", ":", "node__o", "=", "node", ".", "_o", "libxml2mod", ".", "xmlXPathSetContextNode", "(", "self", ".", "_o", ",", "node__o", "...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6511-L6515
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/idl_parser/idl_lexer.py
python
IDLLexer.t_string
(self, t)
return t
r'"[^"]*"
r'"[^"]*"
[ "r", "[", "^", "]", "*" ]
def t_string(self, t): r'"[^"]*"' t.value = t.value[1:-1] self.AddLines(t.value.count('\n')) return t
[ "def", "t_string", "(", "self", ",", "t", ")", ":", "t", ".", "value", "=", "t", ".", "value", "[", "1", ":", "-", "1", "]", "self", ".", "AddLines", "(", "t", ".", "value", ".", "count", "(", "'\\n'", ")", ")", "return", "t" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/idl_parser/idl_lexer.py#L140-L144
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/platform.py
python
python_implementation
()
return _sys_version()[0]
Returns a string identifying the Python implementation. Currently, the following implementations are identified: 'CPython' (C implementation of Python), 'IronPython' (.NET implementation of Python), 'Jython' (Java implementation of Python), 'PyPy' (Python implementation ...
Returns a string identifying the Python implementation.
[ "Returns", "a", "string", "identifying", "the", "Python", "implementation", "." ]
def python_implementation(): """ Returns a string identifying the Python implementation. Currently, the following implementations are identified: 'CPython' (C implementation of Python), 'IronPython' (.NET implementation of Python), 'Jython' (Java implementation of Python), ...
[ "def", "python_implementation", "(", ")", ":", "return", "_sys_version", "(", ")", "[", "0", "]" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/platform.py#L1474-L1485
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py
python
_GetIncludeDirs
(config)
return include_dirs, resource_include_dirs
Returns the list of directories to be used for #include directives. Arguments: config: The dictionnary that defines the special processing to be done for this configuration. Returns: The list of directory paths.
Returns the list of directories to be used for #include directives.
[ "Returns", "the", "list", "of", "directories", "to", "be", "used", "for", "#include", "directives", "." ]
def _GetIncludeDirs(config): """Returns the list of directories to be used for #include directives. Arguments: config: The dictionnary that defines the special processing to be done for this configuration. Returns: The list of directory paths. """ # TODO(bradnelson): include_dirs should r...
[ "def", "_GetIncludeDirs", "(", "config", ")", ":", "# TODO(bradnelson): include_dirs should really be flexible enough not to", "# require this sort of thing.", "include_dirs", "=", "(", "config", ".", "get", "(", "'include_dirs'", ",", "[", "]", ")", "+", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py#L1090-L1107
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
IndividualLayoutConstraint.SetValue
(*args, **kwargs)
return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
SetValue(self, int v)
SetValue(self, int v)
[ "SetValue", "(", "self", "int", "v", ")" ]
def SetValue(*args, **kwargs): """SetValue(self, int v)""" return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
[ "def", "SetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "IndividualLayoutConstraint_SetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L16236-L16238
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/parquet.py
python
read_parquet
(path, engine: str = "auto", columns=None, **kwargs)
return impl.read(path, columns=columns, **kwargs)
Load a parquet object from the file path, returning a DataFrame. .. versionadded:: 0.21.0 Parameters ---------- path : str, path object or file-like object Any valid string path is acceptable. The string could be a URL. Valid URL schemes include http, ftp, s3, and file. For file URLs, ...
Load a parquet object from the file path, returning a DataFrame.
[ "Load", "a", "parquet", "object", "from", "the", "file", "path", "returning", "a", "DataFrame", "." ]
def read_parquet(path, engine: str = "auto", columns=None, **kwargs): """ Load a parquet object from the file path, returning a DataFrame. .. versionadded:: 0.21.0 Parameters ---------- path : str, path object or file-like object Any valid string path is acceptable. The string could be...
[ "def", "read_parquet", "(", "path", ",", "engine", ":", "str", "=", "\"auto\"", ",", "columns", "=", "None", ",", "*", "*", "kwargs", ")", ":", "impl", "=", "get_engine", "(", "engine", ")", "return", "impl", ".", "read", "(", "path", ",", "columns",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/parquet.py#L268-L310
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/minimum.py
python
_minimum_tbe
()
return
Minimum TBE register
Minimum TBE register
[ "Minimum", "TBE", "register" ]
def _minimum_tbe(): """Minimum TBE register""" return
[ "def", "_minimum_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/minimum.py#L38-L40
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatmenu.py
python
FlatMenu.RefreshChilds
(self)
In some cases, we need to perform a recursive refresh for all opened submenu from this.
In some cases, we need to perform a recursive refresh for all opened submenu from this.
[ "In", "some", "cases", "we", "need", "to", "perform", "a", "recursive", "refresh", "for", "all", "opened", "submenu", "from", "this", "." ]
def RefreshChilds(self): """ In some cases, we need to perform a recursive refresh for all opened submenu from this. """ # Draw all childs menus of self menu as well child = self._openedSubMenu while child: dc = wx.ClientDC(child) self.Get...
[ "def", "RefreshChilds", "(", "self", ")", ":", "# Draw all childs menus of self menu as well", "child", "=", "self", ".", "_openedSubMenu", "while", "child", ":", "dc", "=", "wx", ".", "ClientDC", "(", "child", ")", "self", ".", "GetRenderer", "(", ")", ".", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L5815-L5826
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/asyncio/tasks.py
python
_register_task
(task)
Register a new task in asyncio as executed by loop.
Register a new task in asyncio as executed by loop.
[ "Register", "a", "new", "task", "in", "asyncio", "as", "executed", "by", "loop", "." ]
def _register_task(task): """Register a new task in asyncio as executed by loop.""" _all_tasks.add(task)
[ "def", "_register_task", "(", "task", ")", ":", "_all_tasks", ".", "add", "(", "task", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/tasks.py#L858-L860
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/config.py
python
config.try_compile
(self, body, headers=None, include_dirs=None, lang="c")
return ok
Try to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise.
Try to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise.
[ "Try", "to", "compile", "a", "source", "file", "built", "from", "body", "and", "headers", ".", "Return", "true", "on", "success", "false", "otherwise", "." ]
def try_compile(self, body, headers=None, include_dirs=None, lang="c"): """Try to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise. """ from distutils.ccompiler import CompileError self._check_compiler() try: self....
[ "def", "try_compile", "(", "self", ",", "body", ",", "headers", "=", "None", ",", "include_dirs", "=", "None", ",", "lang", "=", "\"c\"", ")", ":", "from", "distutils", ".", "ccompiler", "import", "CompileError", "self", ".", "_check_compiler", "(", ")", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/config.py#L225-L239
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/engine/ensembles.py
python
NVEEnsemble.qcstep
(self)
Velocity Verlet centroid position propagator.
Velocity Verlet centroid position propagator.
[ "Velocity", "Verlet", "centroid", "position", "propagator", "." ]
def qcstep(self): """Velocity Verlet centroid position propagator.""" self.nm.qnm[0,:] += depstrip(self.nm.pnm)[0,:]/depstrip(self.beads.m3)[0]*self.dt
[ "def", "qcstep", "(", "self", ")", ":", "self", ".", "nm", ".", "qnm", "[", "0", ",", ":", "]", "+=", "depstrip", "(", "self", ".", "nm", ".", "pnm", ")", "[", "0", ",", ":", "]", "/", "depstrip", "(", "self", ".", "beads", ".", "m3", ")", ...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/ensembles.py#L232-L235
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/posixpath.py
python
ismount
(path)
return False
Test whether a path is a mount point
Test whether a path is a mount point
[ "Test", "whether", "a", "path", "is", "a", "mount", "point" ]
def ismount(path): """Test whether a path is a mount point""" if islink(path): # A symlink can never be a mount point return False try: s1 = os.lstat(path) s2 = os.lstat(join(path, '..')) except os.error: return False # It doesn't exist -- so not a mount point :-)...
[ "def", "ismount", "(", "path", ")", ":", "if", "islink", "(", "path", ")", ":", "# A symlink can never be a mount point", "return", "False", "try", ":", "s1", "=", "os", ".", "lstat", "(", "path", ")", "s2", "=", "os", ".", "lstat", "(", "join", "(", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/posixpath.py#L189-L207
CleverRaven/Cataclysm-DDA
03e7363df0835ec1b39da973ea29f26f27833b38
tools/windows_limit_memory.py
python
__init__
(self)
Initialization.
Initialization.
[ "Initialization", "." ]
def __init__(self) -> None: """Initialization. """ logger.debug("instantiating kernel32 wrapper.") self._kernel32: Kernel32Wrapper = Kernel32Wrapper() self._handle_process: Optional[HANDLE] = None self._handle_thread: Optional[HANDLE] = None self._handle_job: Opti...
[ "def", "__init__", "(", "self", ")", "->", "None", ":", "logger", ".", "debug", "(", "\"instantiating kernel32 wrapper.\"", ")", "self", ".", "_kernel32", ":", "Kernel32Wrapper", "=", "Kernel32Wrapper", "(", ")", "self", ".", "_handle_process", ":", "Optional", ...
https://github.com/CleverRaven/Cataclysm-DDA/blob/03e7363df0835ec1b39da973ea29f26f27833b38/tools/windows_limit_memory.py#L328-L340
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/util/decorators.py
python
run_once
(func)
return wrapper
Decorator to run func only at its first invocation. Set func.has_run to False to manually re-run.
Decorator to run func only at its first invocation.
[ "Decorator", "to", "run", "func", "only", "at", "its", "first", "invocation", "." ]
def run_once(func): """ Decorator to run func only at its first invocation. Set func.has_run to False to manually re-run. """ def wrapper(*args, **kwargs): """ Returned function wrapper. """ if wrapper.has_run: return None wrapper.has_run = True return ...
[ "def", "run_once", "(", "func", ")", ":", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\" Returned function wrapper. \"\"\"", "if", "wrapper", ".", "has_run", ":", "return", "None", "wrapper", ".", "has_run", "=", "True", "re...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/decorators.py#L8-L24
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/callback.py
python
log_train_metric
(period, auto_reset=False)
return _callback
Callback to log the training evaluation result every period. Parameters ---------- period : int The number of batch to log the training evaluation metric. auto_reset : bool Reset the metric after each log. Returns ------- callback : function The callback function th...
Callback to log the training evaluation result every period.
[ "Callback", "to", "log", "the", "training", "evaluation", "result", "every", "period", "." ]
def log_train_metric(period, auto_reset=False): """Callback to log the training evaluation result every period. Parameters ---------- period : int The number of batch to log the training evaluation metric. auto_reset : bool Reset the metric after each log. Returns ------- ...
[ "def", "log_train_metric", "(", "period", ",", "auto_reset", "=", "False", ")", ":", "def", "_callback", "(", "param", ")", ":", "\"\"\"The checkpoint function.\"\"\"", "if", "param", ".", "nbatch", "%", "period", "==", "0", "and", "param", ".", "eval_metric",...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/callback.py#L93-L117
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PropertyGrid.GetUnspecifiedCommonValue
(*args, **kwargs)
return _propgrid.PropertyGrid_GetUnspecifiedCommonValue(*args, **kwargs)
GetUnspecifiedCommonValue(self) -> int
GetUnspecifiedCommonValue(self) -> int
[ "GetUnspecifiedCommonValue", "(", "self", ")", "-", ">", "int" ]
def GetUnspecifiedCommonValue(*args, **kwargs): """GetUnspecifiedCommonValue(self) -> int""" return _propgrid.PropertyGrid_GetUnspecifiedCommonValue(*args, **kwargs)
[ "def", "GetUnspecifiedCommonValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_GetUnspecifiedCommonValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L2332-L2334
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros/rosmake/src/rosmake/parallel_build.py
python
BuildQueue.return_built
(self, package, successful=True)
The thread which completes a package marks it as done with this method.
The thread which completes a package marks it as done with this method.
[ "The", "thread", "which", "completes", "a", "package", "marks", "it", "as", "done", "with", "this", "method", "." ]
def return_built(self, package, successful=True): # mark that a package is built """ The thread which completes a package marks it as done with this method.""" with self.condition: if successful: self.built.append(package) else: self.failed.append(package) if package in sel...
[ "def", "return_built", "(", "self", ",", "package", ",", "successful", "=", "True", ")", ":", "# mark that a package is built", "with", "self", ".", "condition", ":", "if", "successful", ":", "self", ".", "built", ".", "append", "(", "package", ")", "else", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosmake/src/rosmake/parallel_build.py#L232-L246
facebook/bistro
db9eff7e92f5cedcc917a440d5c88064c7980e40
build/fbcode_builder/getdeps/fetcher.py
python
Fetcher.update
(self)
return ChangeStatus()
Brings the src dir up to date, ideally minimizing changes so that a subsequent build doesn't over-build. Returns a ChangeStatus object that helps the caller to understand the nature of the changes required during the update.
Brings the src dir up to date, ideally minimizing changes so that a subsequent build doesn't over-build. Returns a ChangeStatus object that helps the caller to understand the nature of the changes required during the update.
[ "Brings", "the", "src", "dir", "up", "to", "date", "ideally", "minimizing", "changes", "so", "that", "a", "subsequent", "build", "doesn", "t", "over", "-", "build", ".", "Returns", "a", "ChangeStatus", "object", "that", "helps", "the", "caller", "to", "und...
def update(self): """Brings the src dir up to date, ideally minimizing changes so that a subsequent build doesn't over-build. Returns a ChangeStatus object that helps the caller to understand the nature of the changes required during the update.""" return ChangeStatus()
[ "def", "update", "(", "self", ")", ":", "return", "ChangeStatus", "(", ")" ]
https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/getdeps/fetcher.py#L105-L111
Cantera/cantera
0119484b261967ccb55a0066c020599cacc312e4
interfaces/cython/cantera/onedim.py
python
FlameBase.set_initial_guess
(self, *args, data=None, group=None, **kwargs)
Set the initial guess for the solution, and load restart data if provided. Derived classes extend this function to set approximations for the temperature and composition profiles. :param data: Restart data, which are typically based on an earlier simulation result. Resta...
Set the initial guess for the solution, and load restart data if provided. Derived classes extend this function to set approximations for the temperature and composition profiles.
[ "Set", "the", "initial", "guess", "for", "the", "solution", "and", "load", "restart", "data", "if", "provided", ".", "Derived", "classes", "extend", "this", "function", "to", "set", "approximations", "for", "the", "temperature", "and", "composition", "profiles",...
def set_initial_guess(self, *args, data=None, group=None, **kwargs): """ Set the initial guess for the solution, and load restart data if provided. Derived classes extend this function to set approximations for the temperature and composition profiles. :param data: R...
[ "def", "set_initial_guess", "(", "self", ",", "*", "args", ",", "data", "=", "None", ",", "group", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", ")", ".", "set_initial_guess", "(", "*", "args", ",", "data", "=", "data", ",", "group"...
https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/onedim.py#L98-L182
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/AI/CombatRatingsAI/_ratings.py
python
weight_attack_troops
(troops: float, grade: str)
return troops * weight
Re-weights troops on a ship based on species piloting grade. :return: piloting grade weighted troops
Re-weights troops on a ship based on species piloting grade.
[ "Re", "-", "weights", "troops", "on", "a", "ship", "based", "on", "species", "piloting", "grade", "." ]
def weight_attack_troops(troops: float, grade: str) -> float: """Re-weights troops on a ship based on species piloting grade. :return: piloting grade weighted troops """ weight = {"NO": 0.0, "BAD": 0.5, "": 1.0, "GOOD": 1.5, "GREAT": 2.0, "ULTIMATE": 3.0}.get(grade, 1.0) return troops * weight
[ "def", "weight_attack_troops", "(", "troops", ":", "float", ",", "grade", ":", "str", ")", "->", "float", ":", "weight", "=", "{", "\"NO\"", ":", "0.0", ",", "\"BAD\"", ":", "0.5", ",", "\"\"", ":", "1.0", ",", "\"GOOD\"", ":", "1.5", ",", "\"GREAT\"...
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/CombatRatingsAI/_ratings.py#L51-L57
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/html.py
python
HtmlWindow.HistoryCanForward
(*args, **kwargs)
return _html.HtmlWindow_HistoryCanForward(*args, **kwargs)
HistoryCanForward(self) -> bool
HistoryCanForward(self) -> bool
[ "HistoryCanForward", "(", "self", ")", "-", ">", "bool" ]
def HistoryCanForward(*args, **kwargs): """HistoryCanForward(self) -> bool""" return _html.HtmlWindow_HistoryCanForward(*args, **kwargs)
[ "def", "HistoryCanForward", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWindow_HistoryCanForward", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L1065-L1067
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py
python
ParserElement.setParseAction
(self, *fns, **kwargs)
return self
Define one or more actions to perform when successfully matching parse element definition. Parse action fn is a callable method with 0-3 arguments, called as ``fn(s, loc, toks)`` , ``fn(loc, toks)`` , ``fn(toks)`` , or just ``fn()`` , where: - s = the original string being parsed (see note be...
Define one or more actions to perform when successfully matching parse element definition. Parse action fn is a callable method with 0-3 arguments, called as ``fn(s, loc, toks)`` , ``fn(loc, toks)`` , ``fn(toks)`` , or just ``fn()`` , where:
[ "Define", "one", "or", "more", "actions", "to", "perform", "when", "successfully", "matching", "parse", "element", "definition", ".", "Parse", "action", "fn", "is", "a", "callable", "method", "with", "0", "-", "3", "arguments", "called", "as", "fn", "(", "...
def setParseAction(self, *fns, **kwargs): """ Define one or more actions to perform when successfully matching parse element definition. Parse action fn is a callable method with 0-3 arguments, called as ``fn(s, loc, toks)`` , ``fn(loc, toks)`` , ``fn(toks)`` , or just ``fn()`` , where: ...
[ "def", "setParseAction", "(", "self", ",", "*", "fns", ",", "*", "*", "kwargs", ")", ":", "if", "list", "(", "fns", ")", "==", "[", "None", ",", "]", ":", "self", ".", "parseAction", "=", "[", "]", "else", ":", "if", "not", "all", "(", "callabl...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py#L1518-L1565
stack-of-tasks/pinocchio
593d4d43fded997bb9aa2421f4e55294dbd233c4
bindings/python/pinocchio/derivative/lambdas.py
python
jFromIdx
(idxv,robot)
Return the joint index from the velocity index
Return the joint index from the velocity index
[ "Return", "the", "joint", "index", "from", "the", "velocity", "index" ]
def jFromIdx(idxv,robot): '''Return the joint index from the velocity index''' for j in range(1,robot.model.njoint): if idxv in range(robot.model.joints[j].idx_v, robot.model.joints[j].idx_v+robot.model.joints[j].nv): return j
[ "def", "jFromIdx", "(", "idxv", ",", "robot", ")", ":", "for", "j", "in", "range", "(", "1", ",", "robot", ".", "model", ".", "njoint", ")", ":", "if", "idxv", "in", "range", "(", "robot", ".", "model", ".", "joints", "[", "j", "]", ".", "idx_v...
https://github.com/stack-of-tasks/pinocchio/blob/593d4d43fded997bb9aa2421f4e55294dbd233c4/bindings/python/pinocchio/derivative/lambdas.py#L9-L14
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
EventLoopBase.DispatchTimeout
(*args, **kwargs)
return _core_.EventLoopBase_DispatchTimeout(*args, **kwargs)
DispatchTimeout(self, unsigned long timeout) -> int
DispatchTimeout(self, unsigned long timeout) -> int
[ "DispatchTimeout", "(", "self", "unsigned", "long", "timeout", ")", "-", ">", "int" ]
def DispatchTimeout(*args, **kwargs): """DispatchTimeout(self, unsigned long timeout) -> int""" return _core_.EventLoopBase_DispatchTimeout(*args, **kwargs)
[ "def", "DispatchTimeout", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "EventLoopBase_DispatchTimeout", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L8800-L8802
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Rect.Intersects
(*args, **kwargs)
return _core_.Rect_Intersects(*args, **kwargs)
Intersects(self, Rect rect) -> bool Returns True if the rectangles have a non empty intersection.
Intersects(self, Rect rect) -> bool
[ "Intersects", "(", "self", "Rect", "rect", ")", "-", ">", "bool" ]
def Intersects(*args, **kwargs): """ Intersects(self, Rect rect) -> bool Returns True if the rectangles have a non empty intersection. """ return _core_.Rect_Intersects(*args, **kwargs)
[ "def", "Intersects", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect_Intersects", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L1533-L1539
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/nccl/python/ops/nccl_ops.py
python
_broadcast_grad
(op, accumulated_grad)
The gradients for input `Operation` of `broadcast`. Args: op: The `broadcast send` `Operation` that we are differentiating. accumulated_grad: Accumulated gradients with respect to the output of the `broadcast` op. Returns: Gradients with respect to the input of `broadcast`.
The gradients for input `Operation` of `broadcast`.
[ "The", "gradients", "for", "input", "Operation", "of", "broadcast", "." ]
def _broadcast_grad(op, accumulated_grad): """The gradients for input `Operation` of `broadcast`. Args: op: The `broadcast send` `Operation` that we are differentiating. accumulated_grad: Accumulated gradients with respect to the output of the `broadcast` op. Returns: Gradients with respect to...
[ "def", "_broadcast_grad", "(", "op", ",", "accumulated_grad", ")", ":", "# Grab inputs of accumulated_grad and replace accumulation with reduce_sum.", "grads", "=", "[", "t", "for", "t", "in", "accumulated_grad", ".", "op", ".", "inputs", "]", "for", "t", "in", "gra...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/nccl/python/ops/nccl_ops.py#L191-L208
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Utilities/ReleaseScripts/scripts/duplicateReflexLibrarySearch.py
python
searchClassDefXml
()
Searches through the requested directory looking at 'classes_def.xml' files looking for duplicate Reflex definitions.
Searches through the requested directory looking at 'classes_def.xml' files looking for duplicate Reflex definitions.
[ "Searches", "through", "the", "requested", "directory", "looking", "at", "classes_def", ".", "xml", "files", "looking", "for", "duplicate", "Reflex", "definitions", "." ]
def searchClassDefXml (): """ Searches through the requested directory looking at 'classes_def.xml' files looking for duplicate Reflex definitions.""" # compile necessary RE statements classNameRE = re.compile (r'class\s+name\s*=\s*"([^"]*)"') spacesRE = re.compile (r'\s+') stdRE ...
[ "def", "searchClassDefXml", "(", ")", ":", "# compile necessary RE statements", "classNameRE", "=", "re", ".", "compile", "(", "r'class\\s+name\\s*=\\s*\"([^\"]*)\"'", ")", "spacesRE", "=", "re", ".", "compile", "(", "r'\\s+'", ")", "stdRE", "=", "re", ".", "compi...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Utilities/ReleaseScripts/scripts/duplicateReflexLibrarySearch.py#L88-L241
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/cpplint_1.4.5/cpplint.py
python
IsDerivedFunction
(clean_lines, linenum)
return False
Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier.
Check if current line contains an inherited function.
[ "Check", "if", "current", "line", "contains", "an", "inherited", "function", "." ]
def IsDerivedFunction(clean_lines, linenum): """Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier. """ ...
[ "def", "IsDerivedFunction", "(", "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/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L5205-L5224
irods/irods
ed6328646cee87182098d569919004049bf4ce21
scripts/irods/pyparsing.py
python
ParserElement.__xor__
(self, other )
return Or( [ self, other ] )
Implementation of ^ operator - returns C{L{Or}}
Implementation of ^ operator - returns C{L{Or}}
[ "Implementation", "of", "^", "operator", "-", "returns", "C", "{", "L", "{", "Or", "}}" ]
def __xor__(self, other ): """Implementation of ^ operator - returns C{L{Or}}""" if isinstance( other, basestring ): other = ParserElement.literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserEl...
[ "def", "__xor__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "basestring", ")", ":", "other", "=", "ParserElement", ".", "literalStringClass", "(", "other", ")", "if", "not", "isinstance", "(", "other", ",", "ParserElement"...
https://github.com/irods/irods/blob/ed6328646cee87182098d569919004049bf4ce21/scripts/irods/pyparsing.py#L1394-L1402
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/calendar.py
python
Calendar.yeardays2calendar
(self, year, width=3)
return [months[i:i+width] for i in range(0, len(months), width) ]
Return the data for the specified year ready for formatting (similar to yeardatescalendar()). Entries in the week lists are (day number, weekday number) tuples. Day numbers outside this month are zero.
Return the data for the specified year ready for formatting (similar to yeardatescalendar()). Entries in the week lists are (day number, weekday number) tuples. Day numbers outside this month are zero.
[ "Return", "the", "data", "for", "the", "specified", "year", "ready", "for", "formatting", "(", "similar", "to", "yeardatescalendar", "()", ")", ".", "Entries", "in", "the", "week", "lists", "are", "(", "day", "number", "weekday", "number", ")", "tuples", "...
def yeardays2calendar(self, year, width=3): """ Return the data for the specified year ready for formatting (similar to yeardatescalendar()). Entries in the week lists are (day number, weekday number) tuples. Day numbers outside this month are zero. """ months = [...
[ "def", "yeardays2calendar", "(", "self", ",", "year", ",", "width", "=", "3", ")", ":", "months", "=", "[", "self", ".", "monthdays2calendar", "(", "year", ",", "i", ")", "for", "i", "in", "range", "(", "January", ",", "January", "+", "12", ")", "]...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/calendar.py#L233-L244