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
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/util.py
python
execute
(func, args, msg=None, verbose=0, dry_run=0)
Perform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is supply the function to call and an argument tuple for it (to e...
Perform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is supply the function to call and an argument tuple for it (to e...
[ "Perform", "some", "action", "that", "affects", "the", "outside", "world", "(", "eg", ".", "by", "writing", "to", "the", "filesystem", ")", ".", "Such", "actions", "are", "special", "because", "they", "are", "disabled", "by", "the", "dry_run", "flag", ".",...
def execute (func, args, msg=None, verbose=0, dry_run=0): """Perform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is s...
[ "def", "execute", "(", "func", ",", "args", ",", "msg", "=", "None", ",", "verbose", "=", "0", ",", "dry_run", "=", "0", ")", ":", "if", "msg", "is", "None", ":", "msg", "=", "\"%s%r\"", "%", "(", "func", ".", "__name__", ",", "args", ")", "if"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/util.py#L315-L331
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Tools/pynche/pyColorChooser.py
python
askcolor
(color = None, **options)
return _chooser.show(color, options)
Ask for a color
Ask for a color
[ "Ask", "for", "a", "color" ]
def askcolor(color = None, **options): """Ask for a color""" global _chooser if not _chooser: _chooser = apply(Chooser, (), options) return _chooser.show(color, options)
[ "def", "askcolor", "(", "color", "=", "None", ",", "*", "*", "options", ")", ":", "global", "_chooser", "if", "not", "_chooser", ":", "_chooser", "=", "apply", "(", "Chooser", ",", "(", ")", ",", "options", ")", "return", "_chooser", ".", "show", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Tools/pynche/pyColorChooser.py#L80-L85
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/__init__.py
python
_maybe_match_name
(a, b)
return None
Try to find a name to attach to the result of an operation between a and b. If only one of these has a `name` attribute, return that name. Otherwise return a consensus name if they match of None if they have different names. Parameters ---------- a : object b : object Returns ---...
Try to find a name to attach to the result of an operation between a and b. If only one of these has a `name` attribute, return that name. Otherwise return a consensus name if they match of None if they have different names.
[ "Try", "to", "find", "a", "name", "to", "attach", "to", "the", "result", "of", "an", "operation", "between", "a", "and", "b", ".", "If", "only", "one", "of", "these", "has", "a", "name", "attribute", "return", "that", "name", ".", "Otherwise", "return"...
def _maybe_match_name(a, b): """ Try to find a name to attach to the result of an operation between a and b. If only one of these has a `name` attribute, return that name. Otherwise return a consensus name if they match of None if they have different names. Parameters ---------- a : o...
[ "def", "_maybe_match_name", "(", "a", ",", "b", ")", ":", "a_has", "=", "hasattr", "(", "a", ",", "\"name\"", ")", "b_has", "=", "hasattr", "(", "b", ",", "\"name\"", ")", "if", "a_has", "and", "b_has", ":", "if", "a", ".", "name", "==", "b", "."...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/__init__.py#L124-L156
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/abc.py
python
SourceLoader.path_stats
(self, path)
return {'mtime': self.path_mtime(path)}
Return a metadata dict for the source pointed to by the path (str). Possible keys: - 'mtime' (mandatory) is the numeric timestamp of last source code modification; - 'size' (optional) is the size in bytes of the source code.
Return a metadata dict for the source pointed to by the path (str). Possible keys: - 'mtime' (mandatory) is the numeric timestamp of last source code modification; - 'size' (optional) is the size in bytes of the source code.
[ "Return", "a", "metadata", "dict", "for", "the", "source", "pointed", "to", "by", "the", "path", "(", "str", ")", ".", "Possible", "keys", ":", "-", "mtime", "(", "mandatory", ")", "is", "the", "numeric", "timestamp", "of", "last", "source", "code", "m...
def path_stats(self, path): """Return a metadata dict for the source pointed to by the path (str). Possible keys: - 'mtime' (mandatory) is the numeric timestamp of last source code modification; - 'size' (optional) is the size in bytes of the source code. """ if...
[ "def", "path_stats", "(", "self", ",", "path", ")", ":", "if", "self", ".", "path_mtime", ".", "__func__", "is", "SourceLoader", ".", "path_mtime", ":", "raise", "OSError", "return", "{", "'mtime'", ":", "self", ".", "path_mtime", "(", "path", ")", "}" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/abc.py#L321-L330
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/tools/release/common_includes.py
python
SortingKey
(version)
return ".".join(map("{0:04d}".format, version_keys))
Key for sorting version number strings: '3.11' > '3.2.1.1
Key for sorting version number strings: '3.11' > '3.2.1.1
[ "Key", "for", "sorting", "version", "number", "strings", ":", "3", ".", "11", ">", "3", ".", "2", ".", "1", ".", "1" ]
def SortingKey(version): """Key for sorting version number strings: '3.11' > '3.2.1.1'""" version_keys = map(int, version.split(".")) # Fill up to full version numbers to normalize comparison. while len(version_keys) < 4: # pragma: no cover version_keys.append(0) # Fill digits. return ".".join(map("{0:...
[ "def", "SortingKey", "(", "version", ")", ":", "version_keys", "=", "map", "(", "int", ",", "version", ".", "split", "(", "\".\"", ")", ")", "# Fill up to full version numbers to normalize comparison.", "while", "len", "(", "version_keys", ")", "<", "4", ":", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/tools/release/common_includes.py#L189-L196
zerotier/libzt
41eb9aebc80a5f1c816fa26a06cefde9de906676
src/bindings/python/sockets.py
python
socket.sethostname
(self, name)
libzt does not support this (yet)
libzt does not support this (yet)
[ "libzt", "does", "not", "support", "this", "(", "yet", ")" ]
def sethostname(self, name): """libzt does not support this (yet)""" raise NotImplementedError("libzt does not support this (yet?)")
[ "def", "sethostname", "(", "self", ",", "name", ")", ":", "raise", "NotImplementedError", "(", "\"libzt does not support this (yet?)\"", ")" ]
https://github.com/zerotier/libzt/blob/41eb9aebc80a5f1c816fa26a06cefde9de906676/src/bindings/python/sockets.py#L203-L205
funnyzhou/Adaptive_Feeding
9c78182331d8c0ea28de47226e805776c638d46f
python/caffe/io.py
python
Transformer.set_input_scale
(self, in_, scale)
Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE. Parameters ---------- in_ : which input to assign this scale factor scale : scale coefficient
Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE.
[ "Set", "the", "scale", "of", "preprocessed", "inputs", "s", ".", "t", ".", "the", "blob", "=", "blob", "*", "scale", ".", "N", ".", "B", ".", "input_scale", "is", "done", "AFTER", "mean", "subtraction", "and", "other", "preprocessing", "while", "raw_scal...
def set_input_scale(self, in_, scale): """ Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE. Parameters ---------- in_ : which input to assign...
[ "def", "set_input_scale", "(", "self", ",", "in_", ",", "scale", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "self", ".", "input_scale", "[", "in_", "]", "=", "scale" ]
https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/python/caffe/io.py#L262-L274
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
IResourceProvider.get_resource_stream
(manager, resource_name)
Return a readable file-like object for `resource_name` `manager` must be an ``IResourceManager``
Return a readable file-like object for `resource_name`
[ "Return", "a", "readable", "file", "-", "like", "object", "for", "resource_name" ]
def get_resource_stream(manager, resource_name): """Return a readable file-like object for `resource_name` `manager` must be an ``IResourceManager``"""
[ "def", "get_resource_stream", "(", "manager", ",", "resource_name", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L533-L536
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/ttk.py
python
_format_layoutlist
(layout, indent=0, indent_size=2)
return '\n'.join(script), indent
Formats a layout list so we can pass the result to ttk::style layout and ttk::style settings. Note that the layout doesn't have to be a list necessarily. E.g.: [("Menubutton.background", None), ("Menubutton.button", {"children": [("Menubutton.focus", {"children": [("M...
Formats a layout list so we can pass the result to ttk::style layout and ttk::style settings. Note that the layout doesn't have to be a list necessarily.
[ "Formats", "a", "layout", "list", "so", "we", "can", "pass", "the", "result", "to", "ttk", "::", "style", "layout", "and", "ttk", "::", "style", "settings", ".", "Note", "that", "the", "layout", "doesn", "t", "have", "to", "be", "a", "list", "necessari...
def _format_layoutlist(layout, indent=0, indent_size=2): """Formats a layout list so we can pass the result to ttk::style layout and ttk::style settings. Note that the layout doesn't have to be a list necessarily. E.g.: [("Menubutton.background", None), ("Menubutton.button", {"children": ...
[ "def", "_format_layoutlist", "(", "layout", ",", "indent", "=", "0", ",", "indent_size", "=", "2", ")", ":", "script", "=", "[", "]", "for", "layout_elem", "in", "layout", ":", "elem", ",", "opts", "=", "layout_elem", "opts", "=", "opts", "or", "{", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/ttk.py#L154-L201
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/distutils/fcompiler/gnu.py
python
Gnu95FCompiler._universal_flags
(self, cmd)
return arch_flags
Return a list of -arch flags for every supported architecture.
Return a list of -arch flags for every supported architecture.
[ "Return", "a", "list", "of", "-", "arch", "flags", "for", "every", "supported", "architecture", "." ]
def _universal_flags(self, cmd): """Return a list of -arch flags for every supported architecture.""" if not sys.platform == 'darwin': return [] arch_flags = [] # get arches the C compiler gets. c_archs = self._c_arch_flags() if "i386" in c_archs: ...
[ "def", "_universal_flags", "(", "self", ",", "cmd", ")", ":", "if", "not", "sys", ".", "platform", "==", "'darwin'", ":", "return", "[", "]", "arch_flags", "=", "[", "]", "# get arches the C compiler gets.", "c_archs", "=", "self", ".", "_c_arch_flags", "(",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/distutils/fcompiler/gnu.py#L329-L343
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/tools/freeze_graph.py
python
_parse_input_saver_proto
(input_saver, input_binary)
return saver_def
Parser input tensorflow Saver into SaverDef proto.
Parser input tensorflow Saver into SaverDef proto.
[ "Parser", "input", "tensorflow", "Saver", "into", "SaverDef", "proto", "." ]
def _parse_input_saver_proto(input_saver, input_binary): """Parser input tensorflow Saver into SaverDef proto.""" if not gfile.Exists(input_saver): print("Input saver file '" + input_saver + "' does not exist!") return -1 mode = "rb" if input_binary else "r" with gfile.FastGFile(input_saver, mode) as f:...
[ "def", "_parse_input_saver_proto", "(", "input_saver", ",", "input_binary", ")", ":", "if", "not", "gfile", ".", "Exists", "(", "input_saver", ")", ":", "print", "(", "\"Input saver file '\"", "+", "input_saver", "+", "\"' does not exist!\"", ")", "return", "-", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/tools/freeze_graph.py#L143-L155
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/bayesian-methods/algos.py
python
SGLD
(sym, X, Y, X_test, Y_test, total_iter_num, data_inputs=None, learning_rate=None, lr_scheduler=None, prior_precision=1, out_grad_f=None, initializer=None, minibatch_size=100, thin_interval=100, burn_in_iter_num=1000, task='classification', dev=mx.gpu())
return exe, sample_pool
Generate the implementation of SGLD
Generate the implementation of SGLD
[ "Generate", "the", "implementation", "of", "SGLD" ]
def SGLD(sym, X, Y, X_test, Y_test, total_iter_num, data_inputs=None, learning_rate=None, lr_scheduler=None, prior_precision=1, out_grad_f=None, initializer=None, minibatch_size=100, thin_interval=100, burn_in_iter_num=1000, task='classification', dev=mx.gp...
[ "def", "SGLD", "(", "sym", ",", "X", ",", "Y", ",", "X_test", ",", "Y_test", ",", "total_iter_num", ",", "data_inputs", "=", "None", ",", "learning_rate", "=", "None", ",", "lr_scheduler", "=", "None", ",", "prior_precision", "=", "1", ",", "out_grad_f",...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/bayesian-methods/algos.py#L171-L228
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_bookmark.py
python
BookmarkWindow.OnItemActivate
(self, evt)
Handle double clicks on items to navigate to the selected bookmark.
Handle double clicks on items to navigate to the selected bookmark.
[ "Handle", "double", "clicks", "on", "items", "to", "navigate", "to", "the", "selected", "bookmark", "." ]
def OnItemActivate(self, evt): """Handle double clicks on items to navigate to the selected bookmark. """ index = evt.m_itemIndex marks = EdBookmarks.GetMarks() if index < len(marks): mark = marks[index] self.GotoBookmark(mark)
[ "def", "OnItemActivate", "(", "self", ",", "evt", ")", ":", "index", "=", "evt", ".", "m_itemIndex", "marks", "=", "EdBookmarks", ".", "GetMarks", "(", ")", "if", "index", "<", "len", "(", "marks", ")", ":", "mark", "=", "marks", "[", "index", "]", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_bookmark.py#L216-L225
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/lib/io/file_io.py
python
write_string_to_file
(filename, file_content)
Writes a string to a given file. Args: filename: string, path to a file file_content: string, contents that need to be written to the file Raises: errors.OpError: If there are errors during the operation.
Writes a string to a given file.
[ "Writes", "a", "string", "to", "a", "given", "file", "." ]
def write_string_to_file(filename, file_content): """Writes a string to a given file. Args: filename: string, path to a file file_content: string, contents that need to be written to the file Raises: errors.OpError: If there are errors during the operation. """ with FileIO(filename, mode="w") as...
[ "def", "write_string_to_file", "(", "filename", ",", "file_content", ")", ":", "with", "FileIO", "(", "filename", ",", "mode", "=", "\"w\"", ")", "as", "f", ":", "f", ".", "write", "(", "file_content", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/lib/io/file_io.py#L294-L305
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextBuffer.EndSymbolBullet
(*args, **kwargs)
return _richtext.RichTextBuffer_EndSymbolBullet(*args, **kwargs)
EndSymbolBullet(self) -> bool
EndSymbolBullet(self) -> bool
[ "EndSymbolBullet", "(", "self", ")", "-", ">", "bool" ]
def EndSymbolBullet(*args, **kwargs): """EndSymbolBullet(self) -> bool""" return _richtext.RichTextBuffer_EndSymbolBullet(*args, **kwargs)
[ "def", "EndSymbolBullet", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_EndSymbolBullet", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2436-L2438
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/eager/tape.py
python
Tape.delete_trace
(self, tensor_id)
Deletes any trace we have for this tensor.
Deletes any trace we have for this tensor.
[ "Deletes", "any", "trace", "we", "have", "for", "this", "tensor", "." ]
def delete_trace(self, tensor_id): """Deletes any trace we have for this tensor.""" self._delete_tensor_id(tensor_id)
[ "def", "delete_trace", "(", "self", ",", "tensor_id", ")", ":", "self", ".", "_delete_tensor_id", "(", "tensor_id", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/tape.py#L98-L100
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/mixture/_base.py
python
BaseMixture.score_samples
(self, X)
return logsumexp(self._estimate_weighted_log_prob(X), axis=1)
Compute the weighted log probabilities for each sample. Parameters ---------- X : array-like, shape (n_samples, n_features) List of n_features-dimensional data points. Each row corresponds to a single data point. Returns ------- log_prob : array,...
Compute the weighted log probabilities for each sample.
[ "Compute", "the", "weighted", "log", "probabilities", "for", "each", "sample", "." ]
def score_samples(self, X): """Compute the weighted log probabilities for each sample. Parameters ---------- X : array-like, shape (n_samples, n_features) List of n_features-dimensional data points. Each row corresponds to a single data point. Returns ...
[ "def", "score_samples", "(", "self", ",", "X", ")", ":", "check_is_fitted", "(", "self", ")", "X", "=", "_check_X", "(", "X", ",", "None", ",", "self", ".", "means_", ".", "shape", "[", "1", "]", ")", "return", "logsumexp", "(", "self", ".", "_esti...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/mixture/_base.py#L321-L338
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py
python
ConcreteFunction.name
(self)
return self._delayed_rewrite_functions.forward.name
`ConcreteFunction` name.
`ConcreteFunction` name.
[ "ConcreteFunction", "name", "." ]
def name(self): """`ConcreteFunction` name.""" return self._delayed_rewrite_functions.forward.name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_delayed_rewrite_functions", ".", "forward", ".", "name" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py#L1257-L1259
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/story_runner.py
python
RunBenchmark
(benchmark, finder_options)
return return_code
Run this test with the given options. Returns: The number of failure values (up to 254) or 255 if there is an uncaught exception.
Run this test with the given options.
[ "Run", "this", "test", "with", "the", "given", "options", "." ]
def RunBenchmark(benchmark, finder_options): """Run this test with the given options. Returns: The number of failure values (up to 254) or 255 if there is an uncaught exception. """ benchmark.CustomizeBrowserOptions(finder_options.browser_options) possible_browser = browser_finder.FindBrowser(finder...
[ "def", "RunBenchmark", "(", "benchmark", ",", "finder_options", ")", ":", "benchmark", ".", "CustomizeBrowserOptions", "(", "finder_options", ".", "browser_options", ")", "possible_browser", "=", "browser_finder", ".", "FindBrowser", "(", "finder_options", ")", "if", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/story_runner.py#L273-L330
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/examples/learn/text_classification.py
python
rnn_model
(features, labels, mode)
return estimator_spec_for_softmax_classification( logits=logits, labels=labels, mode=mode)
RNN model to predict from sequence of words to a class.
RNN model to predict from sequence of words to a class.
[ "RNN", "model", "to", "predict", "from", "sequence", "of", "words", "to", "a", "class", "." ]
def rnn_model(features, labels, mode): """RNN model to predict from sequence of words to a class.""" # Convert indexes of words into embeddings. # This creates embeddings matrix of [n_words, EMBEDDING_SIZE] and then # maps word indexes of the sequence into [batch_size, sequence_length, # EMBEDDING_SIZE]. wo...
[ "def", "rnn_model", "(", "features", ",", "labels", ",", "mode", ")", ":", "# Convert indexes of words into embeddings.", "# This creates embeddings matrix of [n_words, EMBEDDING_SIZE] and then", "# maps word indexes of the sequence into [batch_size, sequence_length,", "# EMBEDDING_SIZE]."...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/examples/learn/text_classification.py#L80-L105
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/openvino/runtime/opset1/ops.py
python
equal
( left_node: NodeInput, right_node: NodeInput, auto_broadcast: str = "NUMPY", name: Optional[str] = None, )
return _get_node_factory_opset1().create( "Equal", [left_node, right_node], {"auto_broadcast": auto_broadcast.upper()} )
Return node which checks if input nodes are equal element-wise. @param left_node: The first input node for equal operation. @param right_node: The second input node for equal operation. @param auto_broadcast: The type of broadcasting specifies rules used for auto-broadcasting of ...
Return node which checks if input nodes are equal element-wise.
[ "Return", "node", "which", "checks", "if", "input", "nodes", "are", "equal", "element", "-", "wise", "." ]
def equal( left_node: NodeInput, right_node: NodeInput, auto_broadcast: str = "NUMPY", name: Optional[str] = None, ) -> Node: """Return node which checks if input nodes are equal element-wise. @param left_node: The first input node for equal operation. @param right_node: The second input no...
[ "def", "equal", "(", "left_node", ":", "NodeInput", ",", "right_node", ":", "NodeInput", ",", "auto_broadcast", ":", "str", "=", "\"NUMPY\"", ",", "name", ":", "Optional", "[", "str", "]", "=", "None", ",", ")", "->", "Node", ":", "return", "_get_node_fa...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/openvino/runtime/opset1/ops.py#L798-L815
HKUST-Aerial-Robotics/Fast-Planner
2ddd7793eecd573dbb5b47e2c985aa06606df3cf
uav_simulator/Utils/multi_map_server/src/multi_map_server/msg/_VerticalOccupancyGridList.py
python
VerticalOccupancyGridList.deserialize_numpy
(self, str, numpy)
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
[ "unpack", "serialized", "message", "in", "str", "into", "this", "message", "instance", "using", "numpy", "for", "array", "types", ":", "param", "str", ":", "byte", "array", "of", "serialized", "message", "str", ":", "param", "numpy", ":", "numpy", "python", ...
def deserialize_numpy(self, str, numpy): """ unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module """ try: end = 0 _x = self start = end end += 8 ...
[ "def", "deserialize_numpy", "(", "self", ",", "str", ",", "numpy", ")", ":", "try", ":", "end", "=", "0", "_x", "=", "self", "start", "=", "end", "end", "+=", "8", "(", "_x", ".", "x", ",", "_x", ".", "y", ",", ")", "=", "_struct_2f", ".", "u...
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/src/multi_map_server/msg/_VerticalOccupancyGridList.py#L147-L182
wdas/SeExpr
42b695546689c61ae87c7747fc27ae50653f09f5
src/py/utils.py
python
printTree
(x,sorig)
Print the parse tree of an ASTHandle
Print the parse tree of an ASTHandle
[ "Print", "the", "parse", "tree", "of", "an", "ASTHandle" ]
def printTree(x,sorig): "Print the parse tree of an ASTHandle" printTreeHelper(x.root(),1,1,sorig)
[ "def", "printTree", "(", "x", ",", "sorig", ")", ":", "printTreeHelper", "(", "x", ".", "root", "(", ")", ",", "1", ",", "1", ",", "sorig", ")" ]
https://github.com/wdas/SeExpr/blob/42b695546689c61ae87c7747fc27ae50653f09f5/src/py/utils.py#L119-L121
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py
python
FitFunctionOptionsView.start_x
(self, value: float)
Sets the selected start X.
Sets the selected start X.
[ "Sets", "the", "selected", "start", "X", "." ]
def start_x(self, value: float) -> None: """Sets the selected start X.""" self.start_x_validator.last_valid_value = f"{value:.3f}" self.start_x_line_edit.setText(f"{value:.3f}")
[ "def", "start_x", "(", "self", ",", "value", ":", "float", ")", "->", "None", ":", "self", ".", "start_x_validator", ".", "last_valid_value", "=", "f\"{value:.3f}\"", "self", ".", "start_x_line_edit", ".", "setText", "(", "f\"{value:.3f}\"", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py#L223-L226
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py
python
instance
(cls)
return cls()
Create a new instance of a class. Parameters ---------- cls : type The class to create an instance of. Returns ------- instance : cls A new instance of ``cls``.
Create a new instance of a class.
[ "Create", "a", "new", "instance", "of", "a", "class", "." ]
def instance(cls): """Create a new instance of a class. Parameters ---------- cls : type The class to create an instance of. Returns ------- instance : cls A new instance of ``cls``. """ return cls()
[ "def", "instance", "(", "cls", ")", ":", "return", "cls", "(", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py#L1149-L1162
NREL/EnergyPlus
fadc5973b85c70e8cc923efb69c144e808a26078
src/EnergyPlus/api/state.py
python
StateManager.new_state
(self)
return self.api.stateNew()
This function creates a new state object that is required to pass into EnergyPlus Runtime API function calls :return: A pointer to a new state object in memory
This function creates a new state object that is required to pass into EnergyPlus Runtime API function calls
[ "This", "function", "creates", "a", "new", "state", "object", "that", "is", "required", "to", "pass", "into", "EnergyPlus", "Runtime", "API", "function", "calls" ]
def new_state(self) -> c_void_p: """ This function creates a new state object that is required to pass into EnergyPlus Runtime API function calls :return: A pointer to a new state object in memory """ return self.api.stateNew()
[ "def", "new_state", "(", "self", ")", "->", "c_void_p", ":", "return", "self", ".", "api", ".", "stateNew", "(", ")" ]
https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/src/EnergyPlus/api/state.py#L82-L88
larroy/clearskies_core
3574ddf0edc8555454c7044126e786a6c29444dc
tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.ComputeMacBundleOutput
(self)
return self.ExpandSpecial( os.path.join(path, self.xcode_settings.GetWrapperName()))
Return the 'output' (full output path) to a bundle output directory.
Return the 'output' (full output path) to a bundle output directory.
[ "Return", "the", "output", "(", "full", "output", "path", ")", "to", "a", "bundle", "output", "directory", "." ]
def ComputeMacBundleOutput(self): """Return the 'output' (full output path) to a bundle output directory.""" assert self.is_mac_bundle path = generator_default_variables['PRODUCT_DIR'] return self.ExpandSpecial( os.path.join(path, self.xcode_settings.GetWrapperName()))
[ "def", "ComputeMacBundleOutput", "(", "self", ")", ":", "assert", "self", ".", "is_mac_bundle", "path", "=", "generator_default_variables", "[", "'PRODUCT_DIR'", "]", "return", "self", ".", "ExpandSpecial", "(", "os", ".", "path", ".", "join", "(", "path", ","...
https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/generator/ninja.py#L1275-L1280
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/ext.py
python
Extension.call_method
(self, name, args=None, kwargs=None, dyn_args=None, dyn_kwargs=None, lineno=None)
return nodes.Call(self.attr(name, lineno=lineno), args, kwargs, dyn_args, dyn_kwargs, lineno=lineno)
Call a method of the extension. This is a shortcut for :meth:`attr` + :class:`jinja2.nodes.Call`.
Call a method of the extension. This is a shortcut for :meth:`attr` + :class:`jinja2.nodes.Call`.
[ "Call", "a", "method", "of", "the", "extension", ".", "This", "is", "a", "shortcut", "for", ":", "meth", ":", "attr", "+", ":", "class", ":", "jinja2", ".", "nodes", ".", "Call", "." ]
def call_method(self, name, args=None, kwargs=None, dyn_args=None, dyn_kwargs=None, lineno=None): """Call a method of the extension. This is a shortcut for :meth:`attr` + :class:`jinja2.nodes.Call`. """ if args is None: args = [] if kwargs is None...
[ "def", "call_method", "(", "self", ",", "name", ",", "args", "=", "None", ",", "kwargs", "=", "None", ",", "dyn_args", "=", "None", ",", "dyn_kwargs", "=", "None", ",", "lineno", "=", "None", ")", ":", "if", "args", "is", "None", ":", "args", "=", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/ext.py#L117-L127
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/functions/behavior.py
python
BehaviorProcedure.__init__
(self, func)
Save a reference to the function.
Save a reference to the function.
[ "Save", "a", "reference", "to", "the", "function", "." ]
def __init__(self, func): """Save a reference to the function.""" self.func_ = func
[ "def", "__init__", "(", "self", ",", "func", ")", ":", "self", ".", "func_", "=", "func" ]
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/functions/behavior.py#L88-L90
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/examples/image_retraining/retrain.py
python
cache_bottlenecks
(sess, image_lists, image_dir, bottleneck_dir, jpeg_data_tensor, bottleneck_tensor)
Ensures all the training, testing, and validation bottlenecks are cached. Because we're likely to read the same image multiple times (if there are no distortions applied during training) it can speed things up a lot if we calculate the bottleneck layer values once for each image during preprocessing, and then ...
Ensures all the training, testing, and validation bottlenecks are cached.
[ "Ensures", "all", "the", "training", "testing", "and", "validation", "bottlenecks", "are", "cached", "." ]
def cache_bottlenecks(sess, image_lists, image_dir, bottleneck_dir, jpeg_data_tensor, bottleneck_tensor): """Ensures all the training, testing, and validation bottlenecks are cached. Because we're likely to read the same image multiple times (if there are no distortions applied during train...
[ "def", "cache_bottlenecks", "(", "sess", ",", "image_lists", ",", "image_dir", ",", "bottleneck_dir", ",", "jpeg_data_tensor", ",", "bottleneck_tensor", ")", ":", "how_many_bottlenecks", "=", "0", "ensure_dir_exists", "(", "bottleneck_dir", ")", "for", "label_name", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/examples/image_retraining/retrain.py#L410-L444
eomahony/Numberjack
53fa9e994a36f881ffd320d8d04158097190aad8
Numberjack/__init__.py
python
Expression.get_min
(self, solver=None)
return the_min
Current lower bound of the expression. :param `NBJ_STD_Solver` solver: If specified, the solver from which the lower bound will be sourced, if `None` then the most recently loaded solver is used. :return: The current lower bound of the expression. :rtype: The same as the...
Current lower bound of the expression.
[ "Current", "lower", "bound", "of", "the", "expression", "." ]
def get_min(self, solver=None): """ Current lower bound of the expression. :param `NBJ_STD_Solver` solver: If specified, the solver from which the lower bound will be sourced, if `None` then the most recently loaded solver is used. :return: The current lower boun...
[ "def", "get_min", "(", "self", ",", "solver", "=", "None", ")", ":", "the_min", "=", "self", ".", "lb", "if", "solver", "is", "not", "None", ":", "if", "self", ".", "is_built", "(", "solver", ")", ":", "the_min", "=", "self", ".", "var_list", "[", ...
https://github.com/eomahony/Numberjack/blob/53fa9e994a36f881ffd320d8d04158097190aad8/Numberjack/__init__.py#L473-L492
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/ReflectometrySliceEventWorkspace.py
python
ReflectometrySliceEventWorkspace._rebin_to_monitors
(self)
return alg.getProperty("OutputWorkspace").value
Rebin the output workspace group to the monitors workspace group
Rebin the output workspace group to the monitors workspace group
[ "Rebin", "the", "output", "workspace", "group", "to", "the", "monitors", "workspace", "group" ]
def _rebin_to_monitors(self): """Rebin the output workspace group to the monitors workspace group""" alg = self.createChildAlgorithm("RebinToWorkspace") alg.setProperty("WorkspaceToRebin", self._output_ws_group_name) alg.setProperty("WorkspaceToMatch", self._monitor_ws_group_name) ...
[ "def", "_rebin_to_monitors", "(", "self", ")", ":", "alg", "=", "self", ".", "createChildAlgorithm", "(", "\"RebinToWorkspace\"", ")", "alg", ".", "setProperty", "(", "\"WorkspaceToRebin\"", ",", "self", ".", "_output_ws_group_name", ")", "alg", ".", "setProperty"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/ReflectometrySliceEventWorkspace.py#L230-L238
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/grpc/__init__.py
python
UnaryUnaryMultiCallable.with_call
(self, request, timeout=None, metadata=None, credentials=None, wait_for_ready=None, compression=None)
Synchronously invokes the underlying RPC. Args: request: The request value for the RPC. timeout: An optional durating of time in seconds to allow for the RPC. metadata: Optional :term:`metadata` to be transmitted to the service-side of the RPC. cr...
Synchronously invokes the underlying RPC.
[ "Synchronously", "invokes", "the", "underlying", "RPC", "." ]
def with_call(self, request, timeout=None, metadata=None, credentials=None, wait_for_ready=None, compression=None): """Synchronously invokes the underlying RPC. Args: request: The reque...
[ "def", "with_call", "(", "self", ",", "request", ",", "timeout", "=", "None", ",", "metadata", "=", "None", ",", "credentials", "=", "None", ",", "wait_for_ready", "=", "None", ",", "compression", "=", "None", ")", ":", "raise", "NotImplementedError", "(",...
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/__init__.py#L700-L730
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextLine.SetSize
(*args, **kwargs)
return _richtext.RichTextLine_SetSize(*args, **kwargs)
SetSize(self, Size sz)
SetSize(self, Size sz)
[ "SetSize", "(", "self", "Size", "sz", ")" ]
def SetSize(*args, **kwargs): """SetSize(self, Size sz)""" return _richtext.RichTextLine_SetSize(*args, **kwargs)
[ "def", "SetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextLine_SetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1923-L1925
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Checkbutton.deselect
(self)
Put the button in off-state.
Put the button in off-state.
[ "Put", "the", "button", "in", "off", "-", "state", "." ]
def deselect(self): """Put the button in off-state.""" self.tk.call(self._w, 'deselect')
[ "def", "deselect", "(", "self", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'deselect'", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2418-L2420
goldeneye-source/ges-code
2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d
thirdparty/protobuf-2.3.0/python/google/protobuf/service.py
python
RpcController.NotifyOnCancel
(self, callback)
Sets a callback to invoke on cancel. Asks that the given callback be called when the RPC is canceled. The callback will always be called exactly once. If the RPC completes without being canceled, the callback will be called after completion. If the RPC has already been canceled when NotifyOnCancel()...
Sets a callback to invoke on cancel.
[ "Sets", "a", "callback", "to", "invoke", "on", "cancel", "." ]
def NotifyOnCancel(self, callback): """Sets a callback to invoke on cancel. Asks that the given callback be called when the RPC is canceled. The callback will always be called exactly once. If the RPC completes without being canceled, the callback will be called after completion. If the RPC has ...
[ "def", "NotifyOnCancel", "(", "self", ",", "callback", ")", ":", "raise", "NotImplementedError" ]
https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/service.py#L187-L198
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/external/qt_loaders.py
python
qtapi_version
()
Return which QString API has been set, if any Returns ------- The QString API version (1 or 2), or None if not set
Return which QString API has been set, if any
[ "Return", "which", "QString", "API", "has", "been", "set", "if", "any" ]
def qtapi_version(): """Return which QString API has been set, if any Returns ------- The QString API version (1 or 2), or None if not set """ try: import sip except ImportError: # as of PyQt5 5.11, sip is no longer available as a top-level # module and needs to be i...
[ "def", "qtapi_version", "(", ")", ":", "try", ":", "import", "sip", "except", "ImportError", ":", "# as of PyQt5 5.11, sip is no longer available as a top-level", "# module and needs to be imported from the PyQt5 namespace", "try", ":", "from", "PyQt5", "import", "sip", "exce...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/external/qt_loaders.py#L157-L176
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixer_util.py
python
is_probably_builtin
(node)
return True
Check that something isn't an attribute or function name etc.
Check that something isn't an attribute or function name etc.
[ "Check", "that", "something", "isn", "t", "an", "attribute", "or", "function", "name", "etc", "." ]
def is_probably_builtin(node): """ Check that something isn't an attribute or function name etc. """ prev = node.prev_sibling if prev is not None and prev.type == token.DOT: # Attribute lookup. return False parent = node.parent if parent.type in (syms.funcdef, syms.classdef):...
[ "def", "is_probably_builtin", "(", "node", ")", ":", "prev", "=", "node", ".", "prev_sibling", "if", "prev", "is", "not", "None", "and", "prev", ".", "type", "==", "token", ".", "DOT", ":", "# Attribute lookup.", "return", "False", "parent", "=", "node", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixer_util.py#L227-L248
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/decomposition/pca.py
python
PCA._fit
(self, X)
Dispatch to the right submethod depending on the chosen solver.
Dispatch to the right submethod depending on the chosen solver.
[ "Dispatch", "to", "the", "right", "submethod", "depending", "on", "the", "chosen", "solver", "." ]
def _fit(self, X): """Dispatch to the right submethod depending on the chosen solver.""" # Raise an error for sparse input. # This is more informative than the generic one raised by check_array. if issparse(X): raise TypeError('PCA does not support sparse input. See ' ...
[ "def", "_fit", "(", "self", ",", "X", ")", ":", "# Raise an error for sparse input.", "# This is more informative than the generic one raised by check_array.", "if", "issparse", "(", "X", ")", ":", "raise", "TypeError", "(", "'PCA does not support sparse input. See '", "'Trun...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/decomposition/pca.py#L336-L370
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py3/pygments/lexers/idl.py
python
IDLLexer.analyse_text
(text)
return result
endelse seems to be unique to IDL, endswitch is rare at least.
endelse seems to be unique to IDL, endswitch is rare at least.
[ "endelse", "seems", "to", "be", "unique", "to", "IDL", "endswitch", "is", "rare", "at", "least", "." ]
def analyse_text(text): """endelse seems to be unique to IDL, endswitch is rare at least.""" result = 0 if 'endelse' in text: result += 0.2 if 'endswitch' in text: result += 0.01 return result
[ "def", "analyse_text", "(", "text", ")", ":", "result", "=", "0", "if", "'endelse'", "in", "text", ":", "result", "+=", "0.2", "if", "'endswitch'", "in", "text", ":", "result", "+=", "0.01", "return", "result" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/lexers/idl.py#L271-L280
yyzybb537/libgo
4af17b7c67643c4d54aa354dcc77963ea07847d0
third_party/boost.context/tools/build/src/build/generators.py
python
Generator.match_rank
(self, ps)
return all(ps.get(get_grist(s)) == [get_value(s)] for s in property_requirements) \ and all(ps.get(get_grist(s)) for s in feature_requirements)
Returns true if the generator can be run with the specified properties.
Returns true if the generator can be run with the specified properties.
[ "Returns", "true", "if", "the", "generator", "can", "be", "run", "with", "the", "specified", "properties", "." ]
def match_rank (self, ps): """ Returns true if the generator can be run with the specified properties. """ # See if generator's requirements are satisfied by # 'properties'. Treat a feature name in requirements # (i.e. grist-only element), as matching any value of th...
[ "def", "match_rank", "(", "self", ",", "ps", ")", ":", "# See if generator's requirements are satisfied by", "# 'properties'. Treat a feature name in requirements", "# (i.e. grist-only element), as matching any value of the", "# feature.", "assert", "isinstance", "(", "ps", ",", "...
https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/generators.py#L293-L317
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
tools/blade/src/blade/cu_targets.py
python
CuTarget._cu_objects_rules
(self)
return sources
_cu_library rules.
_cu_library rules.
[ "_cu_library", "rules", "." ]
def _cu_objects_rules(self): """_cu_library rules. """ env_name = self._env_name() var_name = self._generate_variable_name(self.path, self.name) flags_from_option, incs_list = self._get_cu_flags() incs_string = " -I".join(incs_list) flags_string = " ".join(flags_from_opti...
[ "def", "_cu_objects_rules", "(", "self", ")", ":", "env_name", "=", "self", ".", "_env_name", "(", ")", "var_name", "=", "self", ".", "_generate_variable_name", "(", "self", ".", "path", ",", "self", ".", "name", ")", "flags_from_option", ",", "incs_list", ...
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/cu_targets.py#L94-L123
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/math_grad.py
python
_AsinhGrad
(op, grad)
Returns grad * 1/cosh(y).
Returns grad * 1/cosh(y).
[ "Returns", "grad", "*", "1", "/", "cosh", "(", "y", ")", "." ]
def _AsinhGrad(op, grad): """Returns grad * 1/cosh(y).""" y = op.outputs[0] with ops.control_dependencies([grad.op]): y = math_ops.conj(y) return grad / math_ops.cosh(y)
[ "def", "_AsinhGrad", "(", "op", ",", "grad", ")", ":", "y", "=", "op", ".", "outputs", "[", "0", "]", "with", "ops", ".", "control_dependencies", "(", "[", "grad", ".", "op", "]", ")", ":", "y", "=", "math_ops", ".", "conj", "(", "y", ")", "ret...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/math_grad.py#L403-L408
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/keyring_storage.py
python
Storage.locked_get
(self)
return credentials
Retrieve Credential from file. Returns: oauth2client.client.Credentials
Retrieve Credential from file.
[ "Retrieve", "Credential", "from", "file", "." ]
def locked_get(self): """Retrieve Credential from file. Returns: oauth2client.client.Credentials """ credentials = None content = keyring.get_password(self._service_name, self._user_name) if content is not None: try: credentials = Credentials.new_from_json(content) ...
[ "def", "locked_get", "(", "self", ")", ":", "credentials", "=", "None", "content", "=", "keyring", ".", "get_password", "(", "self", ".", "_service_name", ",", "self", ".", "_user_name", ")", "if", "content", "is", "not", "None", ":", "try", ":", "creden...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/keyring_storage.py#L77-L93
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/composable_model.py
python
LinearComposableModel.get_weights
(self, model_dir)
return values
Returns weights per feature of the linear part. Args: model_dir: Directory where model parameters, graph and etc. are saved. Returns: The weights created by this model (without the optimizer weights).
Returns weights per feature of the linear part.
[ "Returns", "weights", "per", "feature", "of", "the", "linear", "part", "." ]
def get_weights(self, model_dir): """Returns weights per feature of the linear part. Args: model_dir: Directory where model parameters, graph and etc. are saved. Returns: The weights created by this model (without the optimizer weights). """ all_variables = [name for name, _ in checkpo...
[ "def", "get_weights", "(", "self", ",", "model_dir", ")", ":", "all_variables", "=", "[", "name", "for", "name", ",", "_", "in", "checkpoints", ".", "list_variables", "(", "model_dir", ")", "]", "values", "=", "{", "}", "optimizer_regex", "=", "r\".*/\"", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/composable_model.py#L170-L189
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/calendar.py
python
timegm
(tuple)
return seconds
Unrelated but handy function to calculate Unix timestamp from GMT.
Unrelated but handy function to calculate Unix timestamp from GMT.
[ "Unrelated", "but", "handy", "function", "to", "calculate", "Unix", "timestamp", "from", "GMT", "." ]
def timegm(tuple): """Unrelated but handy function to calculate Unix timestamp from GMT.""" year, month, day, hour, minute, second = tuple[:6] days = datetime.date(year, month, 1).toordinal() - _EPOCH_ORD + day - 1 hours = days*24 + hour minutes = hours*60 + minute seconds = minutes*60 + second ...
[ "def", "timegm", "(", "tuple", ")", ":", "year", ",", "month", ",", "day", ",", "hour", ",", "minute", ",", "second", "=", "tuple", "[", ":", "6", "]", "days", "=", "datetime", ".", "date", "(", "year", ",", "month", ",", "1", ")", ".", "toordi...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/calendar.py#L655-L662
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/linear_model/_logistic.py
python
LogisticRegressionCV.fit
(self, X, y, sample_weight=None)
return self
Fit the model according to the given training data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training vector, where n_samples is the number of samples and n_features is the number of features. y : array-like of shape...
Fit the model according to the given training data.
[ "Fit", "the", "model", "according", "to", "the", "given", "training", "data", "." ]
def fit(self, X, y, sample_weight=None): """Fit the model according to the given training data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training vector, where n_samples is the number of samples and n_features is the ...
[ "def", "fit", "(", "self", ",", "X", ",", "y", ",", "sample_weight", "=", "None", ")", ":", "solver", "=", "_check_solver", "(", "self", ".", "solver", ",", "self", ".", "penalty", ",", "self", ".", "dual", ")", "if", "not", "isinstance", "(", "sel...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_logistic.py#L1952-L2246
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
driver/python/pysequoiadb/cursor.py
python
cursor.__del__
(self)
release cursor Exceptions: pysequoiadb.error.SDBBaseError
release cursor
[ "release", "cursor" ]
def __del__(self): """release cursor Exceptions: pysequoiadb.error.SDBBaseError """ if self._cursor is not None: rc = sdb.release_cursor(self._cursor) raise_if_error(rc, "Failed to release cursor") self._cursor = None
[ "def", "__del__", "(", "self", ")", ":", "if", "self", ".", "_cursor", "is", "not", "None", ":", "rc", "=", "sdb", ".", "release_cursor", "(", "self", ".", "_cursor", ")", "raise_if_error", "(", "rc", ",", "\"Failed to release cursor\"", ")", "self", "."...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/pysequoiadb/cursor.py#L67-L76
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/install_lib.py
python
install_lib._exclude_pkg_path
(self, pkg, exclusion_path)
return os.path.join(self.install_dir, *parts)
Given a package name and exclusion path within that package, compute the full exclusion path.
Given a package name and exclusion path within that package, compute the full exclusion path.
[ "Given", "a", "package", "name", "and", "exclusion", "path", "within", "that", "package", "compute", "the", "full", "exclusion", "path", "." ]
def _exclude_pkg_path(self, pkg, exclusion_path): """ Given a package name and exclusion path within that package, compute the full exclusion path. """ parts = pkg.split('.') + [exclusion_path] return os.path.join(self.install_dir, *parts)
[ "def", "_exclude_pkg_path", "(", "self", ",", "pkg", ",", "exclusion_path", ")", ":", "parts", "=", "pkg", ".", "split", "(", "'.'", ")", "+", "[", "exclusion_path", "]", "return", "os", ".", "path", ".", "join", "(", "self", ".", "install_dir", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/install_lib.py#L31-L37
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozbuild/jar.py
python
JarMaker.processJarSection
(self, jarfile, lines, jardir)
return
Internal method called by makeJar to actually process a section of a jar.mn file. jarfile is the basename of the jarfile or the directory name for flat output, lines is a PushbackIter of the lines of jar.mn, the remaining options are carried over from makeJar.
Internal method called by makeJar to actually process a section of a jar.mn file.
[ "Internal", "method", "called", "by", "makeJar", "to", "actually", "process", "a", "section", "of", "a", "jar", ".", "mn", "file", "." ]
def processJarSection(self, jarfile, lines, jardir): '''Internal method called by makeJar to actually process a section of a jar.mn file. jarfile is the basename of the jarfile or the directory name for flat output, lines is a PushbackIter of the lines of jar.mn, the remaining o...
[ "def", "processJarSection", "(", "self", ",", "jarfile", ",", "lines", ",", "jardir", ")", ":", "# chromebasepath is used for chrome registration manifests", "# {0} is getting replaced with chrome/ for chrome.manifest, and with", "# an empty string for jarfile.manifest", "chromebasepat...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/jar.py#L279-L356
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/ML/EnrichPlot.py
python
AccumulateCounts
(predictions, thresh=0, sortIt=1)
return res
Accumulates the data for the enrichment plot for a single model **Arguments** - predictions: a list of 3-tuples (as returned by _ScreenModels_) - thresh: a threshold for the confidence level. Anything below this threshold will not be considered - sortIt: toggles sorting on c...
Accumulates the data for the enrichment plot for a single model
[ "Accumulates", "the", "data", "for", "the", "enrichment", "plot", "for", "a", "single", "model" ]
def AccumulateCounts(predictions, thresh=0, sortIt=1): """ Accumulates the data for the enrichment plot for a single model **Arguments** - predictions: a list of 3-tuples (as returned by _ScreenModels_) - thresh: a threshold for the confidence level. Anything below this threshol...
[ "def", "AccumulateCounts", "(", "predictions", ",", "thresh", "=", "0", ",", "sortIt", "=", "1", ")", ":", "if", "sortIt", ":", "predictions", ".", "sort", "(", "lambda", "x", ",", "y", ":", "cmp", "(", "y", "[", "3", "]", ",", "x", "[", "3", "...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/EnrichPlot.py#L186-L223
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/__init__.py
python
is_deterministic_algorithms_warn_only_enabled
()
return _C._get_deterministic_algorithms_warn_only()
r"""Returns True if the global deterministic flag is set to warn only. Refer to :func:`torch.use_deterministic_algorithms` documentation for more details.
r"""Returns True if the global deterministic flag is set to warn only. Refer to :func:`torch.use_deterministic_algorithms` documentation for more details.
[ "r", "Returns", "True", "if", "the", "global", "deterministic", "flag", "is", "set", "to", "warn", "only", ".", "Refer", "to", ":", "func", ":", "torch", ".", "use_deterministic_algorithms", "documentation", "for", "more", "details", "." ]
def is_deterministic_algorithms_warn_only_enabled(): r"""Returns True if the global deterministic flag is set to warn only. Refer to :func:`torch.use_deterministic_algorithms` documentation for more details. """ return _C._get_deterministic_algorithms_warn_only()
[ "def", "is_deterministic_algorithms_warn_only_enabled", "(", ")", ":", "return", "_C", ".", "_get_deterministic_algorithms_warn_only", "(", ")" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/__init__.py#L502-L507
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_data_selector_view.py
python
ModelFittingDataSelectorView.update_y_parameters
(self, y_parameters: list, y_parameter_types: list, emit_signal: bool = False)
Update the available Y parameters.
Update the available Y parameters.
[ "Update", "the", "available", "Y", "parameters", "." ]
def update_y_parameters(self, y_parameters: list, y_parameter_types: list, emit_signal: bool = False) -> None: """Update the available Y parameters.""" old_y_parameter = self.y_selector.currentText() self.y_selector.blockSignals(True) self.y_selector.clear() self.y_selector.addI...
[ "def", "update_y_parameters", "(", "self", ",", "y_parameters", ":", "list", ",", "y_parameter_types", ":", "list", ",", "emit_signal", ":", "bool", "=", "False", ")", "->", "None", ":", "old_y_parameter", "=", "self", ".", "y_selector", ".", "currentText", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_data_selector_view.py#L72-L86
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py
python
Tag.__iter__
(self)
return iter(self.contents)
Iterating over a tag iterates over its contents.
Iterating over a tag iterates over its contents.
[ "Iterating", "over", "a", "tag", "iterates", "over", "its", "contents", "." ]
def __iter__(self): "Iterating over a tag iterates over its contents." return iter(self.contents)
[ "def", "__iter__", "(", "self", ")", ":", "return", "iter", "(", "self", ".", "contents", ")" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L603-L605
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/clipboard/__init__.py
python
determine_clipboard
()
return init_no_clipboard()
Determine the OS/platform and set the copy() and paste() functions accordingly.
Determine the OS/platform and set the copy() and paste() functions accordingly.
[ "Determine", "the", "OS", "/", "platform", "and", "set", "the", "copy", "()", "and", "paste", "()", "functions", "accordingly", "." ]
def determine_clipboard(): """ Determine the OS/platform and set the copy() and paste() functions accordingly. """ global Foundation, AppKit, qtpy, PyQt4, PyQt5 # Setup for the CYGWIN platform: if ( "cygwin" in platform.system().lower() ): # Cygwin has a variety of values retu...
[ "def", "determine_clipboard", "(", ")", ":", "global", "Foundation", ",", "AppKit", ",", "qtpy", ",", "PyQt4", ",", "PyQt5", "# Setup for the CYGWIN platform:", "if", "(", "\"cygwin\"", "in", "platform", ".", "system", "(", ")", ".", "lower", "(", ")", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/clipboard/__init__.py#L498-L569
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/util/nest.py
python
is_sequence
(seq)
return (isinstance(seq, collections.Sequence) and not isinstance(seq, six.string_types))
Returns a true if its input is a collections.Sequence (except strings). Args: seq: an input sequence. Returns: True if the sequence is a not a string and is a collections.Sequence.
Returns a true if its input is a collections.Sequence (except strings).
[ "Returns", "a", "true", "if", "its", "input", "is", "a", "collections", ".", "Sequence", "(", "except", "strings", ")", "." ]
def is_sequence(seq): """Returns a true if its input is a collections.Sequence (except strings). Args: seq: an input sequence. Returns: True if the sequence is a not a string and is a collections.Sequence. """ return (isinstance(seq, collections.Sequence) and not isinstance(seq, six.string...
[ "def", "is_sequence", "(", "seq", ")", ":", "return", "(", "isinstance", "(", "seq", ",", "collections", ".", "Sequence", ")", "and", "not", "isinstance", "(", "seq", ",", "six", ".", "string_types", ")", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/util/nest.py#L70-L80
seqan/seqan
f5f658343c366c9c3d44ba358ffc9317e78a09ed
util/py_lib/pyratemp.py
python
EvalPseudoSandbox.register
(self, name, obj)
Add an object to the "allowed eval-globals". Mainly useful to add user-defined functions to the pseudo-sandbox.
Add an object to the "allowed eval-globals".
[ "Add", "an", "object", "to", "the", "allowed", "eval", "-", "globals", "." ]
def register(self, name, obj): """Add an object to the "allowed eval-globals". Mainly useful to add user-defined functions to the pseudo-sandbox. """ self.eval_allowed_globals[name] = obj
[ "def", "register", "(", "self", ",", "name", ",", "obj", ")", ":", "self", ".", "eval_allowed_globals", "[", "name", "]", "=", "obj" ]
https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/pyratemp.py#L823-L828
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
Dragon/python/dragon/tools/summary_writer.py
python
ScalarSummary.add_summary
(self, scalar, global_step)
Add a summary. Parameters ---------- scalar : tuple or Tensor The scalar. global_step : int The time step of this summary. Returns ------- None
Add a summary.
[ "Add", "a", "summary", "." ]
def add_summary(self, scalar, global_step): """Add a summary. Parameters ---------- scalar : tuple or Tensor The scalar. global_step : int The time step of this summary. Returns ------- None """ if isinstance(scal...
[ "def", "add_summary", "(", "self", ",", "scalar", ",", "global_step", ")", ":", "if", "isinstance", "(", "scalar", ",", "Tensor", ")", ":", "key", ",", "value", "=", "scalar", ".", "name", ",", "ws", ".", "FetchTensor", "(", "scalar", ")", "[", "0", ...
https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/tools/summary_writer.py#L37-L59
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/utils/unpacking.py
python
set_extracted_file_to_default_mode_plus_executable
(path)
Make file present at path have execute for user/group/world (chmod +x) is no-op on windows per python docs
Make file present at path have execute for user/group/world (chmod +x) is no-op on windows per python docs
[ "Make", "file", "present", "at", "path", "have", "execute", "for", "user", "/", "group", "/", "world", "(", "chmod", "+", "x", ")", "is", "no", "-", "op", "on", "windows", "per", "python", "docs" ]
def set_extracted_file_to_default_mode_plus_executable(path): # type: (str) -> None """ Make file present at path have execute for user/group/world (chmod +x) is no-op on windows per python docs """ os.chmod(path, (0o777 & ~current_umask() | 0o111))
[ "def", "set_extracted_file_to_default_mode_plus_executable", "(", "path", ")", ":", "# type: (str) -> None", "os", ".", "chmod", "(", "path", ",", "(", "0o777", "&", "~", "current_umask", "(", ")", "|", "0o111", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/utils/unpacking.py#L97-L103
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/filters.py
python
sync_do_join
( eval_ctx: "EvalContext", value: t.Iterable, d: str = "", attribute: t.Optional[t.Union[str, int]] = None, )
return soft_str(d).join(map(soft_str, value))
Return a string which is the concatenation of the strings in the sequence. The separator between elements is an empty string per default, you can define it with the optional parameter: .. sourcecode:: jinja {{ [1, 2, 3]|join('|') }} -> 1|2|3 {{ [1, 2, 3]|join }} ->...
Return a string which is the concatenation of the strings in the sequence. The separator between elements is an empty string per default, you can define it with the optional parameter:
[ "Return", "a", "string", "which", "is", "the", "concatenation", "of", "the", "strings", "in", "the", "sequence", ".", "The", "separator", "between", "elements", "is", "an", "empty", "string", "per", "default", "you", "can", "define", "it", "with", "the", "...
def sync_do_join( eval_ctx: "EvalContext", value: t.Iterable, d: str = "", attribute: t.Optional[t.Union[str, int]] = None, ) -> str: """Return a string which is the concatenation of the strings in the sequence. The separator between elements is an empty string per default, you can define it...
[ "def", "sync_do_join", "(", "eval_ctx", ":", "\"EvalContext\"", ",", "value", ":", "t", ".", "Iterable", ",", "d", ":", "str", "=", "\"\"", ",", "attribute", ":", "t", ".", "Optional", "[", "t", ".", "Union", "[", "str", ",", "int", "]", "]", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/filters.py#L562-L616
blackberry/Boost
fc90c3fde129c62565c023f091eddc4a7ed9902b
tools/build/v2/build/toolset.py
python
register
(toolset)
Registers a new toolset.
Registers a new toolset.
[ "Registers", "a", "new", "toolset", "." ]
def register (toolset): """ Registers a new toolset. """ feature.extend('toolset', [toolset])
[ "def", "register", "(", "toolset", ")", ":", "feature", ".", "extend", "(", "'toolset'", ",", "[", "toolset", "]", ")" ]
https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/toolset.py#L202-L205
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/ops.py
python
RegisterStatistics.__call__
(self, f)
return f
Registers "f" as the statistics function for "op_type".
Registers "f" as the statistics function for "op_type".
[ "Registers", "f", "as", "the", "statistics", "function", "for", "op_type", "." ]
def __call__(self, f): """Registers "f" as the statistics function for "op_type".""" _stats_registry.register(f, self._op_type + "," + self._statistic_type) return f
[ "def", "__call__", "(", "self", ",", "f", ")", ":", "_stats_registry", ".", "register", "(", "f", ",", "self", ".", "_op_type", "+", "\",\"", "+", "self", ".", "_statistic_type", ")", "return", "f" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/ops.py#L1905-L1908
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/python/op_hint.py
python
_find_children_hints_in_while_loop
(function_def, nodes_mapping)
return ordered_children_hints, new_nodes
Find children hints and all nodes inside the while loop. Args: function_def: Function def of the while loop. nodes_mapping: While loop input_arg : real node name. Returns: Ordered children hints and all re-mapped nodes inside the while loop.
Find children hints and all nodes inside the while loop.
[ "Find", "children", "hints", "and", "all", "nodes", "inside", "the", "while", "loop", "." ]
def _find_children_hints_in_while_loop(function_def, nodes_mapping): """Find children hints and all nodes inside the while loop. Args: function_def: Function def of the while loop. nodes_mapping: While loop input_arg : real node name. Returns: Ordered children hints and all re-mapped nodes inside th...
[ "def", "_find_children_hints_in_while_loop", "(", "function_def", ",", "nodes_mapping", ")", ":", "new_nodes", "=", "[", "]", "# Make nodes inside function def inputs point to the real nodes.", "for", "node", "in", "function_def", ".", "node_def", ":", "for", "i", ",", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/python/op_hint.py#L791-L821
widelands/widelands
e9f047d46a23d81312237d52eabf7d74e8de52d6
doc/sphinx/documentation_enhancements.py
python
LuaClasses.get_children_rows
(self, cls_inst, count=0, rows=None)
return rows
Recursively find all children of cls_inst. Returns a dict where the keys are the rownumbers and the values are lists in form of [[parent,[children],],]
Recursively find all children of cls_inst.
[ "Recursively", "find", "all", "children", "of", "cls_inst", "." ]
def get_children_rows(self, cls_inst, count=0, rows=None): """Recursively find all children of cls_inst. Returns a dict where the keys are the rownumbers and the values are lists in form of [[parent,[children],],] """ if rows is None: rows = {count: []} if co...
[ "def", "get_children_rows", "(", "self", ",", "cls_inst", ",", "count", "=", "0", ",", "rows", "=", "None", ")", ":", "if", "rows", "is", "None", ":", "rows", "=", "{", "count", ":", "[", "]", "}", "if", "count", "==", "MAX_CHILDREN", ":", "return"...
https://github.com/widelands/widelands/blob/e9f047d46a23d81312237d52eabf7d74e8de52d6/doc/sphinx/documentation_enhancements.py#L124-L144
wujixiu/helmet-detection
8eff5c59ddfba5a29e0b76aeb48babcb49246178
hardhat-wearing-detection/SSD-RPA/tools/extra/parse_log.py
python
save_csv_files
(logfile_path, output_dir, train_dict_list, test_dict_list, delimiter=',', verbose=False)
Save CSV files to output_dir If the input log file is, e.g., caffe.INFO, the names will be caffe.INFO.train and caffe.INFO.test
Save CSV files to output_dir
[ "Save", "CSV", "files", "to", "output_dir" ]
def save_csv_files(logfile_path, output_dir, train_dict_list, test_dict_list, delimiter=',', verbose=False): """Save CSV files to output_dir If the input log file is, e.g., caffe.INFO, the names will be caffe.INFO.train and caffe.INFO.test """ log_basename = os.path.basename(log...
[ "def", "save_csv_files", "(", "logfile_path", ",", "output_dir", ",", "train_dict_list", ",", "test_dict_list", ",", "delimiter", "=", "','", ",", "verbose", "=", "False", ")", ":", "log_basename", "=", "os", ".", "path", ".", "basename", "(", "logfile_path", ...
https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/hardhat-wearing-detection/SSD-RPA/tools/extra/parse_log.py#L134-L147
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/xcodeproj_file.py
python
PBXProject.AddOrGetFileInRootGroup
(self, path)
return group.AddOrGetFileByPath(path, hierarchical)
Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics. If an existing PBXFileReference for path exists, it will be returned. Otherwise, one will be created and returned.
Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics.
[ "Returns", "a", "PBXFileReference", "corresponding", "to", "path", "in", "the", "correct", "group", "according", "to", "RootGroupForPath", "s", "heuristics", "." ]
def AddOrGetFileInRootGroup(self, path): """Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics. If an existing PBXFileReference for path exists, it will be returned. Otherwise, one will be created and returned. """ (group, h...
[ "def", "AddOrGetFileInRootGroup", "(", "self", ",", "path", ")", ":", "(", "group", ",", "hierarchical", ")", "=", "self", ".", "RootGroupForPath", "(", "path", ")", "return", "group", ".", "AddOrGetFileByPath", "(", "path", ",", "hierarchical", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/xcodeproj_file.py#L2875-L2884
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/estimator/canned/dnn_linear_combined.py
python
DNNLinearCombinedRegressor.__init__
(self, model_dir=None, linear_feature_columns=None, linear_optimizer='Ftrl', dnn_feature_columns=None, dnn_optimizer='Adagrad', dnn_hidden_units=None, dnn_activation_fn=nn.relu, dnn_dropout=None, ...
Initializes a DNNLinearCombinedRegressor instance. Args: model_dir: Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model. linear_feature_columns: An iterable contain...
Initializes a DNNLinearCombinedRegressor instance.
[ "Initializes", "a", "DNNLinearCombinedRegressor", "instance", "." ]
def __init__(self, model_dir=None, linear_feature_columns=None, linear_optimizer='Ftrl', dnn_feature_columns=None, dnn_optimizer='Adagrad', dnn_hidden_units=None, dnn_activation_fn=nn.relu, dnn_dropou...
[ "def", "__init__", "(", "self", ",", "model_dir", "=", "None", ",", "linear_feature_columns", "=", "None", ",", "linear_optimizer", "=", "'Ftrl'", ",", "dnn_feature_columns", "=", "None", ",", "dnn_optimizer", "=", "'Adagrad'", ",", "dnn_hidden_units", "=", "Non...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/estimator/canned/dnn_linear_combined.py#L464-L544
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
tools/idl_parser/idl_parser.py
python
IDLParser.p_UnionMemberType
(self, p)
UnionMemberType : NonAnyType | UnionType TypeSuffix | ANY '[' ']' TypeSuffix
UnionMemberType : NonAnyType | UnionType TypeSuffix | ANY '[' ']' TypeSuffix
[ "UnionMemberType", ":", "NonAnyType", "|", "UnionType", "TypeSuffix", "|", "ANY", "[", "]", "TypeSuffix" ]
def p_UnionMemberType(self, p): """UnionMemberType : NonAnyType | UnionType TypeSuffix | ANY '[' ']' TypeSuffix"""
[ "def", "p_UnionMemberType", "(", "self", ",", "p", ")", ":" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/tools/idl_parser/idl_parser.py#L737-L740
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/android.py
python
deploy_android
(tsk_gen)
Installs the project APK and copies the layout directory to all the android devices that are connected to the host.
Installs the project APK and copies the layout directory to all the android devices that are connected to the host.
[ "Installs", "the", "project", "APK", "and", "copies", "the", "layout", "directory", "to", "all", "the", "android", "devices", "that", "are", "connected", "to", "the", "host", "." ]
def deploy_android(tsk_gen): ''' Installs the project APK and copies the layout directory to all the android devices that are connected to the host. ''' def should_copy_file(src_file_node, target_time): should_copy = False try: stat_src = os.stat(src_file_node.abspath()) ...
[ "def", "deploy_android", "(", "tsk_gen", ")", ":", "def", "should_copy_file", "(", "src_file_node", ",", "target_time", ")", ":", "should_copy", "=", "False", "try", ":", "stat_src", "=", "os", ".", "stat", "(", "src_file_node", ".", "abspath", "(", ")", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/android.py#L2904-L3181
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/layers/python/layers/feature_column_ops.py
python
sequence_input_from_feature_columns
(columns_to_tensors, feature_columns, weight_collections=None, trainable=True, scope=None)
return _input_from_feature_columns( columns_to_tensors, feature_columns, weight_collections, trainable, scope, output_rank=3, default_name='sequence_input_from_feature_columns')
Builds inputs for sequence models from `FeatureColumn`s. See documentation for `input_from_feature_columns`. The following types of `FeatureColumn` are permitted in `feature_columns`: `_OneHotColumn`, `_EmbeddingColumn`, `_ScatteredEmbeddingColumn`, `_RealValuedColumn`, `_DataFrameColumn`. In addition, columns...
Builds inputs for sequence models from `FeatureColumn`s.
[ "Builds", "inputs", "for", "sequence", "models", "from", "FeatureColumn", "s", "." ]
def sequence_input_from_feature_columns(columns_to_tensors, feature_columns, weight_collections=None, trainable=True, scope=None): """Builds inputs for sequen...
[ "def", "sequence_input_from_feature_columns", "(", "columns_to_tensors", ",", "feature_columns", ",", "weight_collections", "=", "None", ",", "trainable", "=", "True", ",", "scope", "=", "None", ")", ":", "_check_supported_sequence_columns", "(", "feature_columns", ")",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L216-L258
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/raster_wrangler.py
python
RasterWrangler.enablePIL
(self)
Try to turn on PIL file IO support
Try to turn on PIL file IO support
[ "Try", "to", "turn", "on", "PIL", "file", "IO", "support" ]
def enablePIL(self): """Try to turn on PIL file IO support""" if pilEnabled: self.backends.add("PIL") else: warnings.warn("PIL module not found", ImportWarning)
[ "def", "enablePIL", "(", "self", ")", ":", "if", "pilEnabled", ":", "self", ".", "backends", ".", "add", "(", "\"PIL\"", ")", "else", ":", "warnings", ".", "warn", "(", "\"PIL module not found\"", ",", "ImportWarning", ")" ]
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/raster_wrangler.py#L95-L100
projectchrono/chrono
92015a8a6f84ef63ac8206a74e54a676251dcc89
src/demos/python/chrono-tensorflow/PPO/train_serial.py
python
add_disc_sum_rew
(trajectories, gamma)
Adds discounted sum of rewards to all time steps of all trajectories Args: trajectories: as returned by run_policy() gamma: discount Returns: None (mutates trajectories dictionary to add 'disc_sum_rew')
Adds discounted sum of rewards to all time steps of all trajectories
[ "Adds", "discounted", "sum", "of", "rewards", "to", "all", "time", "steps", "of", "all", "trajectories" ]
def add_disc_sum_rew(trajectories, gamma): """ Adds discounted sum of rewards to all time steps of all trajectories Args: trajectories: as returned by run_policy() gamma: discount Returns: None (mutates trajectories dictionary to add 'disc_sum_rew') """ for trajectory in tr...
[ "def", "add_disc_sum_rew", "(", "trajectories", ",", "gamma", ")", ":", "for", "trajectory", "in", "trajectories", ":", "if", "gamma", "<", "0.999", ":", "# don't scale for gamma ~= 1", "rewards", "=", "trajectory", "[", "'rewards'", "]", "*", "(", "1", "-", ...
https://github.com/projectchrono/chrono/blob/92015a8a6f84ef63ac8206a74e54a676251dcc89/src/demos/python/chrono-tensorflow/PPO/train_serial.py#L137-L153
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py
python
Makefile.generate_target_default
(self, mfile)
The default implementation of the default target. mfile is the file object.
The default implementation of the default target.
[ "The", "default", "implementation", "of", "the", "default", "target", "." ]
def generate_target_default(self, mfile): """The default implementation of the default target. mfile is the file object. """ mfile.write("\nall:\n")
[ "def", "generate_target_default", "(", "self", ",", "mfile", ")", ":", "mfile", ".", "write", "(", "\"\\nall:\\n\"", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L1333-L1338
HKUST-Aerial-Robotics/Fast-Planner
2ddd7793eecd573dbb5b47e2c985aa06606df3cf
uav_simulator/Utils/quadrotor_msgs/src/quadrotor_msgs/msg/_Corrections.py
python
Corrections.deserialize_numpy
(self, str, numpy)
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
[ "unpack", "serialized", "message", "in", "str", "into", "this", "message", "instance", "using", "numpy", "for", "array", "types", ":", "param", "str", ":", "byte", "array", "of", "serialized", "message", "str", ":", "param", "numpy", ":", "numpy", "python", ...
def deserialize_numpy(self, str, numpy): """ unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module """ try: end = 0 start = end end += 8 (self.kf_corr...
[ "def", "deserialize_numpy", "(", "self", ",", "str", ",", "numpy", ")", ":", "try", ":", "end", "=", "0", "start", "=", "end", "end", "+=", "8", "(", "self", ".", "kf_correction", ",", ")", "=", "_struct_d", ".", "unpack", "(", "str", "[", "start",...
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/quadrotor_msgs/src/quadrotor_msgs/msg/_Corrections.py#L91-L107
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py
python
PtyProcess.sendintr
(self)
return self._writeb(_INTR), _INTR
This sends a SIGINT to the child. It does not require the SIGINT to be the first character on a line.
This sends a SIGINT to the child. It does not require the SIGINT to be the first character on a line.
[ "This", "sends", "a", "SIGINT", "to", "the", "child", ".", "It", "does", "not", "require", "the", "SIGINT", "to", "be", "the", "first", "character", "on", "a", "line", "." ]
def sendintr(self): '''This sends a SIGINT to the child. It does not require the SIGINT to be the first character on a line. ''' return self._writeb(_INTR), _INTR
[ "def", "sendintr", "(", "self", ")", ":", "return", "self", ".", "_writeb", "(", "_INTR", ")", ",", "_INTR" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L604-L608
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ragged/ragged_where_op.py
python
_coordinate_where
(condition)
return array_ops.concat([ array_ops.expand_dims(selected_rows, 1), array_ops.expand_dims(selected_cols, 1), selected_coords[:, 1:] ], axis=1)
Ragged version of tf.where(condition).
Ragged version of tf.where(condition).
[ "Ragged", "version", "of", "tf", ".", "where", "(", "condition", ")", "." ]
def _coordinate_where(condition): """Ragged version of tf.where(condition).""" if not isinstance(condition, ragged_tensor.RaggedTensor): return array_ops.where(condition) # The coordinate for each `true` value in condition.values. selected_coords = _coordinate_where(condition.values) # Convert the first...
[ "def", "_coordinate_where", "(", "condition", ")", ":", "if", "not", "isinstance", "(", "condition", ",", "ragged_tensor", ".", "RaggedTensor", ")", ":", "return", "array_ops", ".", "where", "(", "condition", ")", "# The coordinate for each `true` value in condition.v...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_where_op.py#L232-L252
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/linalg/python/ops/linear_operator.py
python
LinearOperator.is_square
(self)
return self._is_square_set_or_implied_by_hints
Return `True/False` depending on if this operator is square.
Return `True/False` depending on if this operator is square.
[ "Return", "True", "/", "False", "depending", "on", "if", "this", "operator", "is", "square", "." ]
def is_square(self): """Return `True/False` depending on if this operator is square.""" # Static checks done after __init__. Why? Because domain/range dimension # sometimes requires lots of work done in the derived class after init. auto_square_check = self.domain_dimension == self.range_dimension ...
[ "def", "is_square", "(", "self", ")", ":", "# Static checks done after __init__. Why? Because domain/range dimension", "# sometimes requires lots of work done in the derived class after init.", "auto_square_check", "=", "self", ".", "domain_dimension", "==", "self", ".", "range_dim...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/linalg/python/ops/linear_operator.py#L250-L261
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/polynomial/chebyshev.py
python
_cseries_to_zseries
(cs)
return zs + zs[::-1]
Covert Chebyshev series to z-series. Covert a Chebyshev series to the equivalent z-series. The result is never an empty array. The dtype of the return is the same as that of the input. No checks are run on the arguments as this routine is for internal use. Parameters ---------- cs : 1-d nd...
Covert Chebyshev series to z-series.
[ "Covert", "Chebyshev", "series", "to", "z", "-", "series", "." ]
def _cseries_to_zseries(cs) : """Covert Chebyshev series to z-series. Covert a Chebyshev series to the equivalent z-series. The result is never an empty array. The dtype of the return is the same as that of the input. No checks are run on the arguments as this routine is for internal use. Para...
[ "def", "_cseries_to_zseries", "(", "cs", ")", ":", "n", "=", "cs", ".", "size", "zs", "=", "np", ".", "zeros", "(", "2", "*", "n", "-", "1", ",", "dtype", "=", "cs", ".", "dtype", ")", "zs", "[", "n", "-", "1", ":", "]", "=", "cs", "/", "...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/polynomial/chebyshev.py#L100-L122
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/request.py
python
InputFile.__init__
(self, rfile, length)
File-like object used to provide a seekable view of request body data
File-like object used to provide a seekable view of request body data
[ "File", "-", "like", "object", "used", "to", "provide", "a", "seekable", "view", "of", "request", "body", "data" ]
def __init__(self, rfile, length): """File-like object used to provide a seekable view of request body data""" self._file = rfile self.length = length self._file_position = 0 if length > self.max_buffer_size: self._buf = tempfile.TemporaryFile(mode="rw+b") e...
[ "def", "__init__", "(", "self", ",", "rfile", ",", "length", ")", ":", "self", ".", "_file", "=", "rfile", "self", ".", "length", "=", "length", "self", ".", "_file_position", "=", "0", "if", "length", ">", "self", ".", "max_buffer_size", ":", "self", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/request.py#L36-L46
1989Ryan/Semantic_SLAM
0284b3f832ca431c494f9c134fe46c40ec86ee38
Third_Part/PSPNet_Keras_tensorflow/caffe-tensorflow/kaffe/tensorflow/network.py
python
Network.get_output
(self)
return self.terminals[-1]
Returns the current network output.
Returns the current network output.
[ "Returns", "the", "current", "network", "output", "." ]
def get_output(self): '''Returns the current network output.''' return self.terminals[-1]
[ "def", "get_output", "(", "self", ")", ":", "return", "self", ".", "terminals", "[", "-", "1", "]" ]
https://github.com/1989Ryan/Semantic_SLAM/blob/0284b3f832ca431c494f9c134fe46c40ec86ee38/Third_Part/PSPNet_Keras_tensorflow/caffe-tensorflow/kaffe/tensorflow/network.py#L85-L87
facebook/mysql-5.6
65a650660ec7b4d627d1b738f397252ff4706207
arcanist/lint/cpp_linter/cpplint.py
python
_NestingState.CheckCompletedBlocks
(self, filename, error)
Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
Checks that all classes and namespaces have been completely parsed.
[ "Checks", "that", "all", "classes", "and", "namespaces", "have", "been", "completely", "parsed", "." ]
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: Th...
[ "def", "CheckCompletedBlocks", "(", "self", ",", "filename", ",", "error", ")", ":", "# Note: This test can result in false positives if #ifdef constructs", "# get in the way of brace matching. See the testBuildClass test in", "# cpplint_unittest.py for an example of this.", "for", "obj"...
https://github.com/facebook/mysql-5.6/blob/65a650660ec7b4d627d1b738f397252ff4706207/arcanist/lint/cpp_linter/cpplint.py#L2070-L2089
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/fuchsia/update_sdk.py
python
_ReadFile
(filename)
Read a file in this directory.
Read a file in this directory.
[ "Read", "a", "file", "in", "this", "directory", "." ]
def _ReadFile(filename): """Read a file in this directory.""" with open(os.path.join(os.path.dirname(__file__), filename), 'r') as f: return f.read()
[ "def", "_ReadFile", "(", "filename", ")", ":", "with", "open", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "filename", ")", ",", "'r'", ")", "as", "f", ":", "return", "f", ".", "read", ...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/fuchsia/update_sdk.py#L68-L71
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/utilities/exceptions.py
python
UtilitiesSerializationException.__init__
(self, fileName, className)
Initialize the UtilitiesSerializationException object.
Initialize the UtilitiesSerializationException object.
[ "Initialize", "the", "UtilitiesSerializationException", "object", "." ]
def __init__(self, fileName, className): """Initialize the UtilitiesSerializationException object.""" errorClass, errorObject, traceBack = sys.exc_info() self.value_ = UtilitiesSerializationException.SERIALIZATION_ERROR % { 'className' : className, 'fileName' : fileName, ...
[ "def", "__init__", "(", "self", ",", "fileName", ",", "className", ")", ":", "errorClass", ",", "errorObject", ",", "traceBack", "=", "sys", ".", "exc_info", "(", ")", "self", ".", "value_", "=", "UtilitiesSerializationException", ".", "SERIALIZATION_ERROR", "...
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/utilities/exceptions.py#L34-L40
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PGEditor.SetValueToUnspecified
(*args, **kwargs)
return _propgrid.PGEditor_SetValueToUnspecified(*args, **kwargs)
SetValueToUnspecified(self, PGProperty property, Window ctrl)
SetValueToUnspecified(self, PGProperty property, Window ctrl)
[ "SetValueToUnspecified", "(", "self", "PGProperty", "property", "Window", "ctrl", ")" ]
def SetValueToUnspecified(*args, **kwargs): """SetValueToUnspecified(self, PGProperty property, Window ctrl)""" return _propgrid.PGEditor_SetValueToUnspecified(*args, **kwargs)
[ "def", "SetValueToUnspecified", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGEditor_SetValueToUnspecified", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2689-L2691
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/filters.py
python
do_reject
(*args, **kwargs)
return _select_or_reject(args, kwargs, lambda x: not x, False)
Filters a sequence of objects by appying a test to either the object or the attribute and rejecting the ones with the test succeeding. Example usage: .. sourcecode:: jinja {{ numbers|reject("odd") }} .. versionadded:: 2.7
Filters a sequence of objects by appying a test to either the object or the attribute and rejecting the ones with the test succeeding.
[ "Filters", "a", "sequence", "of", "objects", "by", "appying", "a", "test", "to", "either", "the", "object", "or", "the", "attribute", "and", "rejecting", "the", "ones", "with", "the", "test", "succeeding", "." ]
def do_reject(*args, **kwargs): """Filters a sequence of objects by appying a test to either the object or the attribute and rejecting the ones with the test succeeding. Example usage: .. sourcecode:: jinja {{ numbers|reject("odd") }} .. versionadded:: 2.7 """ return _select_or_r...
[ "def", "do_reject", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_select_or_reject", "(", "args", ",", "kwargs", ",", "lambda", "x", ":", "not", "x", ",", "False", ")" ]
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/filters.py#L860-L872
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Variables/ListVariable.py
python
ListVariable
(key, help, default, names, map={})
return (key, help, default, None, #_validator, lambda val: _converter(val, names, map))
The input parameters describe a 'package list' option, thus they are returned with the correct converter and validator appended. The result is usable for input to opts.Add() . A 'package list' option may either be 'all', 'none' or a list of package names (separated by space).
The input parameters describe a 'package list' option, thus they are returned with the correct converter and validator appended. The result is usable for input to opts.Add() .
[ "The", "input", "parameters", "describe", "a", "package", "list", "option", "thus", "they", "are", "returned", "with", "the", "correct", "converter", "and", "validator", "appended", ".", "The", "result", "is", "usable", "for", "input", "to", "opts", ".", "Ad...
def ListVariable(key, help, default, names, map={}): """ The input parameters describe a 'package list' option, thus they are returned with the correct converter and validator appended. The result is usable for input to opts.Add() . A 'package list' option may either be 'all', 'none' or a list of ...
[ "def", "ListVariable", "(", "key", ",", "help", ",", "default", ",", "names", ",", "map", "=", "{", "}", ")", ":", "names_str", "=", "'allowed names: %s'", "%", "' '", ".", "join", "(", "names", ")", "if", "SCons", ".", "Util", ".", "is_List", "(", ...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Variables/ListVariable.py#L116-L132
mickem/nscp
79f89fdbb6da63f91bc9dedb7aea202fe938f237
scripts/python/lib/google/protobuf/internal/python_message.py
python
_PropertyName
(proto_field_name)
return proto_field_name
Returns the name of the public property attribute which clients can use to get and (in some cases) set the value of a protocol message field. Args: proto_field_name: The protocol message field name, exactly as it appears (or would appear) in a .proto file.
Returns the name of the public property attribute which clients can use to get and (in some cases) set the value of a protocol message field.
[ "Returns", "the", "name", "of", "the", "public", "property", "attribute", "which", "clients", "can", "use", "to", "get", "and", "(", "in", "some", "cases", ")", "set", "the", "value", "of", "a", "protocol", "message", "field", "." ]
def _PropertyName(proto_field_name): """Returns the name of the public property attribute which clients can use to get and (in some cases) set the value of a protocol message field. Args: proto_field_name: The protocol message field name, exactly as it appears (or would appear) in a .proto file. ""...
[ "def", "_PropertyName", "(", "proto_field_name", ")", ":", "# TODO(robinson): Escape Python keywords (e.g., yield), and test this support.", "# nnorwitz makes my day by writing:", "# \"\"\"", "# FYI. See the keyword module in the stdlib. This could be as simple as:", "#", "# if keyword.iskeyw...
https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/internal/python_message.py#L109-L135
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/matlib.py
python
empty
(shape, dtype=None, order='C')
return ndarray.__new__(matrix, shape, dtype, order=order)
Return a new matrix of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int Shape of the empty matrix. dtype : data-type, optional Desired output data-type. order : {'C', 'F'}, optional Whether to store multi-dimensional data ...
Return a new matrix of given shape and type, without initializing entries.
[ "Return", "a", "new", "matrix", "of", "given", "shape", "and", "type", "without", "initializing", "entries", "." ]
def empty(shape, dtype=None, order='C'): """Return a new matrix of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int Shape of the empty matrix. dtype : data-type, optional Desired output data-type. order : {'C', 'F'}, optional ...
[ "def", "empty", "(", "shape", ",", "dtype", "=", "None", ",", "order", "=", "'C'", ")", ":", "return", "ndarray", ".", "__new__", "(", "matrix", ",", "shape", ",", "dtype", ",", "order", "=", "order", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/matlib.py#L24-L60
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/train/trainer.py
python
Trainer.previous_minibatch_evaluation_average
(self)
return super(Trainer, self).previous_minibatch_evaluation_average()
The average evaluation criterion value per sample for the last minibatch trained
The average evaluation criterion value per sample for the last minibatch trained
[ "The", "average", "evaluation", "criterion", "value", "per", "sample", "for", "the", "last", "minibatch", "trained" ]
def previous_minibatch_evaluation_average(self): ''' The average evaluation criterion value per sample for the last minibatch trained ''' return super(Trainer, self).previous_minibatch_evaluation_average()
[ "def", "previous_minibatch_evaluation_average", "(", "self", ")", ":", "return", "super", "(", "Trainer", ",", "self", ")", ".", "previous_minibatch_evaluation_average", "(", ")" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/train/trainer.py#L302-L306
pichenettes/eurorack
11cc3a80f2c6d67ee024091c711dfce59a58cb59
tools/optimization/munkres.py
python
Munkres.__find_smallest
(self)
return minval
Find the smallest uncovered value in the matrix.
Find the smallest uncovered value in the matrix.
[ "Find", "the", "smallest", "uncovered", "value", "in", "the", "matrix", "." ]
def __find_smallest(self): """Find the smallest uncovered value in the matrix.""" minval = sys.maxint for i in range(self.n): for j in range(self.n): if (not self.row_covered[i]) and (not self.col_covered[j]): if minval > self.C[i][j]: ...
[ "def", "__find_smallest", "(", "self", ")", ":", "minval", "=", "sys", ".", "maxint", "for", "i", "in", "range", "(", "self", ".", "n", ")", ":", "for", "j", "in", "range", "(", "self", ".", "n", ")", ":", "if", "(", "not", "self", ".", "row_co...
https://github.com/pichenettes/eurorack/blob/11cc3a80f2c6d67ee024091c711dfce59a58cb59/tools/optimization/munkres.py#L576-L584
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/tools/build/src/build/type.py
python
type
(filename)
Returns file type given it's name. If there are several dots in filename, tries each suffix. E.g. for name of "file.so.1.2" suffixes "2", "1", and "so" will be tried.
Returns file type given it's name. If there are several dots in filename, tries each suffix. E.g. for name of "file.so.1.2" suffixes "2", "1", and "so" will be tried.
[ "Returns", "file", "type", "given", "it", "s", "name", ".", "If", "there", "are", "several", "dots", "in", "filename", "tries", "each", "suffix", ".", "E", ".", "g", ".", "for", "name", "of", "file", ".", "so", ".", "1", ".", "2", "suffixes", "2", ...
def type(filename): """ Returns file type given it's name. If there are several dots in filename, tries each suffix. E.g. for name of "file.so.1.2" suffixes "2", "1", and "so" will be tried. """ assert isinstance(filename, basestring) while 1: filename, suffix = os.path.splitext...
[ "def", "type", "(", "filename", ")", ":", "assert", "isinstance", "(", "filename", ",", "basestring", ")", "while", "1", ":", "filename", ",", "suffix", "=", "os", ".", "path", ".", "splitext", "(", "filename", ")", "if", "not", "suffix", ":", "return"...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/build/type.py#L353-L365
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/util/image_util.py
python
FromPng
(png_data)
return impl.FromPng(png_data)
Create an image from raw PNG data.
Create an image from raw PNG data.
[ "Create", "an", "image", "from", "raw", "PNG", "data", "." ]
def FromPng(png_data): """Create an image from raw PNG data.""" return impl.FromPng(png_data)
[ "def", "FromPng", "(", "png_data", ")", ":", "return", "impl", ".", "FromPng", "(", "png_data", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/util/image_util.py#L69-L71
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/rnn/python/ops/gru_ops.py
python
GRUBlockCell.__call__
(self, x, h_prev, scope=None)
GRU cell.
GRU cell.
[ "GRU", "cell", "." ]
def __call__(self, x, h_prev, scope=None): """GRU cell.""" with vs.variable_scope(scope or type(self).__name__): input_size = x.get_shape().with_rank(2)[1] # Check if the input size exist. if input_size is None: raise ValueError("Expecting input_size to be set.") # Check cell_s...
[ "def", "__call__", "(", "self", ",", "x", ",", "h_prev", ",", "scope", "=", "None", ")", ":", "with", "vs", ".", "variable_scope", "(", "scope", "or", "type", "(", "self", ")", ".", "__name__", ")", ":", "input_size", "=", "x", ".", "get_shape", "(...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/rnn/python/ops/gru_ops.py#L146-L179
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/MooseDocs/extensions/template.py
python
RenderTemplateField._renderField
(self, parent, token, page, modal=None)
Helper to render tokens, the logic is the same across formats.
Helper to render tokens, the logic is the same across formats.
[ "Helper", "to", "render", "tokens", "the", "logic", "is", "the", "same", "across", "formats", "." ]
def _renderField(self, parent, token, page, modal=None): """Helper to render tokens, the logic is the same across formats.""" # Locate the replacement key = token['key'] func = lambda n: (n.name == 'TemplateItem') and (n['key'] == key) replacement = moosetree.find(token.root, fu...
[ "def", "_renderField", "(", "self", ",", "parent", ",", "token", ",", "page", ",", "modal", "=", "None", ")", ":", "# Locate the replacement", "key", "=", "token", "[", "'key'", "]", "func", "=", "lambda", "n", ":", "(", "n", ".", "name", "==", "'Tem...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/template.py#L163-L186
msoos/cryptominisat
02f53d1fc045fdba53671306964d3d094feb949e
scripts/crystal/helper.py
python
helper_add
(toadd, df, features, verb)
return name
to be used like: import functools larger_than = functools.partial(helper.larger_than, df=df, features=features, verb=options.verbose)
to be used like: import functools larger_than = functools.partial(helper.larger_than, df=df, features=features, verb=options.verbose)
[ "to", "be", "used", "like", ":", "import", "functools", "larger_than", "=", "functools", ".", "partial", "(", "helper", ".", "larger_than", "df", "=", "df", "features", "=", "features", "verb", "=", "options", ".", "verbose", ")" ]
def helper_add(toadd, df, features, verb): """ to be used like: import functools larger_than = functools.partial(helper.larger_than, df=df, features=features, verb=options.verbose) """ # add if verb: print("Calulating: the feature addition of: %s", toadd) name = "(" for i i...
[ "def", "helper_add", "(", "toadd", ",", "df", ",", "features", ",", "verb", ")", ":", "# add", "if", "verb", ":", "print", "(", "\"Calulating: the feature addition of: %s\"", ",", "toadd", ")", "name", "=", "\"(\"", "for", "i", "in", "range", "(", "1", "...
https://github.com/msoos/cryptominisat/blob/02f53d1fc045fdba53671306964d3d094feb949e/scripts/crystal/helper.py#L312-L333
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Dbase/DbUtils.py
python
_AddDataToDb
(dBase, table, user, password, colDefs, colTypes, data, nullMarker=None, blockSize=100, cn=None)
*For Internal Use* (drops and) creates a table and then inserts the values
*For Internal Use*
[ "*", "For", "Internal", "Use", "*" ]
def _AddDataToDb(dBase, table, user, password, colDefs, colTypes, data, nullMarker=None, blockSize=100, cn=None): """ *For Internal Use* (drops and) creates a table and then inserts the values """ if not cn: cn = DbModule.connect(dBase, user, password) c = cn.cursor() ...
[ "def", "_AddDataToDb", "(", "dBase", ",", "table", ",", "user", ",", "password", ",", "colDefs", ",", "colTypes", ",", "data", ",", "nullMarker", "=", "None", ",", "blockSize", "=", "100", ",", "cn", "=", "None", ")", ":", "if", "not", "cn", ":", "...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Dbase/DbUtils.py#L313-L366
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/series.py
python
Series.nsmallest
(self, n=5, keep='first')
return algorithms.SelectNSeries(self, n=n, keep=keep).nsmallest()
Return the smallest `n` elements. Parameters ---------- n : int, default 5 Return this many ascending sorted values. keep : {'first', 'last', 'all'}, default 'first' When there are duplicate values that cannot all fit in a Series of `n` elements: ...
Return the smallest `n` elements.
[ "Return", "the", "smallest", "n", "elements", "." ]
def nsmallest(self, n=5, keep='first'): """ Return the smallest `n` elements. Parameters ---------- n : int, default 5 Return this many ascending sorted values. keep : {'first', 'last', 'all'}, default 'first' When there are duplicate values that ...
[ "def", "nsmallest", "(", "self", ",", "n", "=", "5", ",", "keep", "=", "'first'", ")", ":", "return", "algorithms", ".", "SelectNSeries", "(", "self", ",", "n", "=", "n", ",", "keep", "=", "keep", ")", ".", "nsmallest", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/series.py#L3122-L3215
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewIndexListModel.RowDeleted
(*args, **kwargs)
return _dataview.DataViewIndexListModel_RowDeleted(*args, **kwargs)
RowDeleted(self, unsigned int row) Call this after a row has been deleted.
RowDeleted(self, unsigned int row)
[ "RowDeleted", "(", "self", "unsigned", "int", "row", ")" ]
def RowDeleted(*args, **kwargs): """ RowDeleted(self, unsigned int row) Call this after a row has been deleted. """ return _dataview.DataViewIndexListModel_RowDeleted(*args, **kwargs)
[ "def", "RowDeleted", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewIndexListModel_RowDeleted", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L866-L872
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py
python
Gamma.log_cdf
(self, x, name="log_cdf")
Log CDF of observations `x` under these Gamma distribution(s). Args: x: tensor of dtype `dtype`, must be broadcastable with `alpha` and `beta`. name: The name to give this op. Returns: log_cdf: tensor of dtype `dtype`, the log-CDFs of `x`.
Log CDF of observations `x` under these Gamma distribution(s).
[ "Log", "CDF", "of", "observations", "x", "under", "these", "Gamma", "distribution", "(", "s", ")", "." ]
def log_cdf(self, x, name="log_cdf"): """Log CDF of observations `x` under these Gamma distribution(s). Args: x: tensor of dtype `dtype`, must be broadcastable with `alpha` and `beta`. name: The name to give this op. Returns: log_cdf: tensor of dtype `dtype`, the log-CDFs of `x`. """...
[ "def", "log_cdf", "(", "self", ",", "x", ",", "name", "=", "\"log_cdf\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "self", ".", "_alpha", ",", "self", ".", "_beta", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py#L276-L295
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextParagraphLayoutBox.AddParagraphs
(*args, **kwargs)
return _richtext.RichTextParagraphLayoutBox_AddParagraphs(*args, **kwargs)
AddParagraphs(self, String text, RichTextAttr paraStyle=None) -> RichTextRange
AddParagraphs(self, String text, RichTextAttr paraStyle=None) -> RichTextRange
[ "AddParagraphs", "(", "self", "String", "text", "RichTextAttr", "paraStyle", "=", "None", ")", "-", ">", "RichTextRange" ]
def AddParagraphs(*args, **kwargs): """AddParagraphs(self, String text, RichTextAttr paraStyle=None) -> RichTextRange""" return _richtext.RichTextParagraphLayoutBox_AddParagraphs(*args, **kwargs)
[ "def", "AddParagraphs", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextParagraphLayoutBox_AddParagraphs", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1664-L1666