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
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/pylinters.py
python
_get_build_dir
()
return os.path.join(git.get_base_dir(), "build")
Get the location of the scons' build directory in case we need to download clang-format.
Get the location of the scons' build directory in case we need to download clang-format.
[ "Get", "the", "location", "of", "the", "scons", "build", "directory", "in", "case", "we", "need", "to", "download", "clang", "-", "format", "." ]
def _get_build_dir(): # type: () -> str """Get the location of the scons' build directory in case we need to download clang-format.""" return os.path.join(git.get_base_dir(), "build")
[ "def", "_get_build_dir", "(", ")", ":", "# type: () -> str", "return", "os", ".", "path", ".", "join", "(", "git", ".", "get_base_dir", "(", ")", ",", "\"build\"", ")" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/pylinters.py#L65-L68
ptrkrysik/gr-gsm
2de47e28ce1fb9a518337bfc0add36c8e3cff5eb
python/qa_tch_h_decoder.py
python
qa_tch_h_decoder.test_facch_th
(self)
FACCH/TH test
FACCH/TH test
[ "FACCH", "/", "TH", "test" ]
def test_facch_th (self): """ FACCH/TH test """ b = self.b self.assertEqual(self.facch_test( frames= [259207, 259209, 259211, 259213, 259211, 259213, 259215, 259217], timeslots = [ 6, 6, 6, 6, 6, 6, 6, 6], ...
[ "def", "test_facch_th", "(", "self", ")", ":", "b", "=", "self", ".", "b", "self", ".", "assertEqual", "(", "self", ".", "facch_test", "(", "frames", "=", "[", "259207", ",", "259209", ",", "259211", ",", "259213", ",", "259211", ",", "259213", ",", ...
https://github.com/ptrkrysik/gr-gsm/blob/2de47e28ce1fb9a518337bfc0add36c8e3cff5eb/python/qa_tch_h_decoder.py#L167-L176
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/traceback.py
python
format_tb
(tb, limit = None)
return format_list(extract_tb(tb, limit))
A shorthand for 'format_list(extract_tb(tb, limit))'.
A shorthand for 'format_list(extract_tb(tb, limit))'.
[ "A", "shorthand", "for", "format_list", "(", "extract_tb", "(", "tb", "limit", "))", "." ]
def format_tb(tb, limit = None): """A shorthand for 'format_list(extract_tb(tb, limit))'.""" return format_list(extract_tb(tb, limit))
[ "def", "format_tb", "(", "tb", ",", "limit", "=", "None", ")", ":", "return", "format_list", "(", "extract_tb", "(", "tb", ",", "limit", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/traceback.py#L74-L76
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/appController.py
python
AppController._HUDInfoChanged
(self)
Called when a HUD setting that requires info refresh has changed.
Called when a HUD setting that requires info refresh has changed.
[ "Called", "when", "a", "HUD", "setting", "that", "requires", "info", "refresh", "has", "changed", "." ]
def _HUDInfoChanged(self): """Called when a HUD setting that requires info refresh has changed.""" if self._isHUDVisible(): self._updateHUDPrimStats() self._updateHUDGeomCounts()
[ "def", "_HUDInfoChanged", "(", "self", ")", ":", "if", "self", ".", "_isHUDVisible", "(", ")", ":", "self", ".", "_updateHUDPrimStats", "(", ")", "self", ".", "_updateHUDGeomCounts", "(", ")" ]
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/appController.py#L5014-L5018
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/google/protobuf/internal/_parameterized.py
python
Parameters
(*testcases)
return _ParameterDecorator(_ARGUMENT_REPR, testcases)
A decorator for creating parameterized tests. See the module docstring for a usage example. Args: *testcases: Parameters for the decorated method, either a single iterable, or a list of tuples/dicts/objects (for tests with only one argument). Returns: A test generator to...
A decorator for creating parameterized tests.
[ "A", "decorator", "for", "creating", "parameterized", "tests", "." ]
def Parameters(*testcases): """A decorator for creating parameterized tests. See the module docstring for a usage example. Args: *testcases: Parameters for the decorated method, either a single iterable, or a list of tuples/dicts/objects (for tests with only one argument). ...
[ "def", "Parameters", "(", "*", "testcases", ")", ":", "return", "_ParameterDecorator", "(", "_ARGUMENT_REPR", ",", "testcases", ")" ]
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/_parameterized.py#L309-L321
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/fnmatch.py
python
fnmatchcase
(name, pat)
return match(name) is not None
Test whether FILENAME matches PATTERN, including case. This is a version of fnmatch() which doesn't case-normalize its arguments.
Test whether FILENAME matches PATTERN, including case.
[ "Test", "whether", "FILENAME", "matches", "PATTERN", "including", "case", "." ]
def fnmatchcase(name, pat): """Test whether FILENAME matches PATTERN, including case. This is a version of fnmatch() which doesn't case-normalize its arguments. """ match = _compile_pattern(pat) return match(name) is not None
[ "def", "fnmatchcase", "(", "name", ",", "pat", ")", ":", "match", "=", "_compile_pattern", "(", "pat", ")", "return", "match", "(", "name", ")", "is", "not", "None" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/fnmatch.py#L70-L77
esa/pagmo
80281d549c8f1b470e1489a5d37c8f06b2e429c0
PyGMO/util/_analysis.py
python
analysis._scale_sample
(self)
Scales the sample in x and f after sampling, so all values are [0,1]. If constraints have been computed, it also scales c to [-k,1-k] for k in [0,1].
Scales the sample in x and f after sampling, so all values are [0,1]. If constraints have been computed, it also scales c to [-k,1-k] for k in [0,1].
[ "Scales", "the", "sample", "in", "x", "and", "f", "after", "sampling", "so", "all", "values", "are", "[", "0", "1", "]", ".", "If", "constraints", "have", "been", "computed", "it", "also", "scales", "c", "to", "[", "-", "k", "1", "-", "k", "]", "...
def _scale_sample(self): """ Scales the sample in x and f after sampling, so all values are [0,1]. If constraints have been computed, it also scales c to [-k,1-k] for k in [0,1]. """ for i in range(self.npoints): for j in range(self.dim): self.points[i...
[ "def", "_scale_sample", "(", "self", ")", ":", "for", "i", "in", "range", "(", "self", ".", "npoints", ")", ":", "for", "j", "in", "range", "(", "self", ".", "dim", ")", ":", "self", ".", "points", "[", "i", "]", "[", "j", "]", "-=", "self", ...
https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/util/_analysis.py#L247-L260
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/PeacockMainWindow.py
python
PeacockMainWindow._setTitle
(self)
Sets the title of the window.
Sets the title of the window.
[ "Sets", "the", "title", "of", "the", "window", "." ]
def _setTitle(self): """ Sets the title of the window. """ title = "Peacock" if self.exe_path: title += " : executable - %s" % os.path.abspath(self.exe_path) if self.input_file_path: title += " : input file - %s" % os.path.abspath(self.input_file_p...
[ "def", "_setTitle", "(", "self", ")", ":", "title", "=", "\"Peacock\"", "if", "self", ".", "exe_path", ":", "title", "+=", "\" : executable - %s\"", "%", "os", ".", "path", ".", "abspath", "(", "self", ".", "exe_path", ")", "if", "self", ".", "input_file...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/PeacockMainWindow.py#L121-L130
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Misc._displayof
(self, displayof)
return ()
Internal function.
Internal function.
[ "Internal", "function", "." ]
def _displayof(self, displayof): """Internal function.""" if displayof: return ('-displayof', displayof) if displayof is None: return ('-displayof', self._w) return ()
[ "def", "_displayof", "(", "self", ",", "displayof", ")", ":", "if", "displayof", ":", "return", "(", "'-displayof'", ",", "displayof", ")", "if", "displayof", "is", "None", ":", "return", "(", "'-displayof'", ",", "self", ".", "_w", ")", "return", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L1299-L1305
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py
python
LabeledScale.__init__
(self, master=None, variable=None, from_=0, to=10, **kw)
Construct a horizontal LabeledScale with parent master, a variable to be associated with the Ttk Scale widget and its range. If variable is not specified, a tkinter.IntVar is created. WIDGET-SPECIFIC OPTIONS compound: 'top' or 'bottom' Specifies how to display the l...
Construct a horizontal LabeledScale with parent master, a variable to be associated with the Ttk Scale widget and its range. If variable is not specified, a tkinter.IntVar is created.
[ "Construct", "a", "horizontal", "LabeledScale", "with", "parent", "master", "a", "variable", "to", "be", "associated", "with", "the", "Ttk", "Scale", "widget", "and", "its", "range", ".", "If", "variable", "is", "not", "specified", "a", "tkinter", ".", "IntV...
def __init__(self, master=None, variable=None, from_=0, to=10, **kw): """Construct a horizontal LabeledScale with parent master, a variable to be associated with the Ttk Scale widget and its range. If variable is not specified, a tkinter.IntVar is created. WIDGET-SPECIFIC OPTIONS ...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "variable", "=", "None", ",", "from_", "=", "0", ",", "to", "=", "10", ",", "*", "*", "kw", ")", ":", "self", ".", "_label_top", "=", "kw", ".", "pop", "(", "'compound'", ",", "'t...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/ttk.py#L1534-L1566
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus2.in.py
python
exodus.put_node_set
(self, id, nodeSetNodes)
exo.put_node_set(node_set_id, ns_nodes) -> store a node set by its id and the list of node *INDICES* in the node set (see exo.get_node_id_map() for explanation of node *INDEX* versus node *ID*) input value(s): <int> node_set_id node set *ID* (not *INDEX*...
exo.put_node_set(node_set_id, ns_nodes)
[ "exo", ".", "put_node_set", "(", "node_set_id", "ns_nodes", ")" ]
def put_node_set(self, id, nodeSetNodes): """ exo.put_node_set(node_set_id, ns_nodes) -> store a node set by its id and the list of node *INDICES* in the node set (see exo.get_node_id_map() for explanation of node *INDEX* versus node *ID*) input value(s): ...
[ "def", "put_node_set", "(", "self", ",", "id", ",", "nodeSetNodes", ")", ":", "self", ".", "__ex_put_node_set", "(", "id", ",", "nodeSetNodes", ")" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L2089-L2101
ku-nlp/jumanpp
008e73b9cf876ce50ba5e751ac7108e68796cb1f
script/git-clang-format.py
python
filter_by_extension
(dictionary, allowed_extensions)
Delete every key in `dictionary` that doesn't have an allowed extension. `allowed_extensions` must be a collection of lowercase file extensions, excluding the period.
Delete every key in `dictionary` that doesn't have an allowed extension.
[ "Delete", "every", "key", "in", "dictionary", "that", "doesn", "t", "have", "an", "allowed", "extension", "." ]
def filter_by_extension(dictionary, allowed_extensions): """Delete every key in `dictionary` that doesn't have an allowed extension. `allowed_extensions` must be a collection of lowercase file extensions, excluding the period.""" allowed_extensions = frozenset(allowed_extensions) for filename in li...
[ "def", "filter_by_extension", "(", "dictionary", ",", "allowed_extensions", ")", ":", "allowed_extensions", "=", "frozenset", "(", "allowed_extensions", ")", "for", "filename", "in", "list", "(", "dictionary", ".", "keys", "(", ")", ")", ":", "base_ext", "=", ...
https://github.com/ku-nlp/jumanpp/blob/008e73b9cf876ce50ba5e751ac7108e68796cb1f/script/git-clang-format.py#L319-L330
cinder/Cinder
e83f5bb9c01a63eec20168d02953a0879e5100f7
docs/libs/pystache/loader.py
python
Loader.load_object
(self, obj)
return self.read(path)
Find and return the template associated to the given object. Arguments: obj: an instance of a user-defined class. search_dirs: the list of directories in which to search.
Find and return the template associated to the given object.
[ "Find", "and", "return", "the", "template", "associated", "to", "the", "given", "object", "." ]
def load_object(self, obj): """ Find and return the template associated to the given object. Arguments: obj: an instance of a user-defined class. search_dirs: the list of directories in which to search. """ locator = self._make_locator() path = lo...
[ "def", "load_object", "(", "self", ",", "obj", ")", ":", "locator", "=", "self", ".", "_make_locator", "(", ")", "path", "=", "locator", ".", "find_object", "(", "obj", ",", "self", ".", "search_dirs", ")", "return", "self", ".", "read", "(", "path", ...
https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/pystache/loader.py#L155-L170
qt/qt
0a2f2382541424726168804be2c90b91381608c6
src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/xcodeproj_file.py
python
XCConfigurationList.AppendBuildSetting
(self, key, value)
Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects.
Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects.
[ "Appends", "value", "to", "the", "build", "setting", "for", "key", "which", "is", "treated", "as", "a", "list", "in", "all", "child", "XCBuildConfiguration", "objects", "." ]
def AppendBuildSetting(self, key, value): """Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects. """ for configuration in self._properties['buildConfigurations']: configuration.AppendBuildSetting(key, value)
[ "def", "AppendBuildSetting", "(", "self", ",", "key", ",", "value", ")", ":", "for", "configuration", "in", "self", ".", "_properties", "[", "'buildConfigurations'", "]", ":", "configuration", ".", "AppendBuildSetting", "(", "key", ",", "value", ")" ]
https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/xcodeproj_file.py#L1634-L1640
ROCmSoftwarePlatform/hipCaffe
4ec5d482515cce532348553b6db6d00d015675d5
python/caffe/coord_map.py
python
crop_params
(fn)
return (axis, offset)
Extract the crop layer parameters with defaults.
Extract the crop layer parameters with defaults.
[ "Extract", "the", "crop", "layer", "parameters", "with", "defaults", "." ]
def crop_params(fn): """ Extract the crop layer parameters with defaults. """ params = fn.params.get('crop_param', fn.params) axis = params.get('axis', 2) # default to spatial crop for N, C, H, W offset = np.array(params.get('offset', 0), ndmin=1) return (axis, offset)
[ "def", "crop_params", "(", "fn", ")", ":", "params", "=", "fn", ".", "params", ".", "get", "(", "'crop_param'", ",", "fn", ".", "params", ")", "axis", "=", "params", ".", "get", "(", "'axis'", ",", "2", ")", "# default to spatial crop for N, C, H, W", "o...
https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/python/caffe/coord_map.py#L40-L47
greenheartgames/greenworks
3ea4ab490b56676de3f0a237c74bcfdb17323e60
deps/cpplint/cpplint.py
python
FilesBelongToSameModule
(filename_cc, filename_h)
return files_belong_to_same_module, common_path
Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and some/path/internal/xyzzy are also considered to belong to...
Check if these two filenames belong to the same module.
[ "Check", "if", "these", "two", "filenames", "belong", "to", "the", "same", "module", "." ]
def FilesBelongToSameModule(filename_cc, filename_h): """Check if these two filenames belong to the same module. The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and ...
[ "def", "FilesBelongToSameModule", "(", "filename_cc", ",", "filename_h", ")", ":", "fileinfo", "=", "FileInfo", "(", "filename_cc", ")", "if", "not", "fileinfo", ".", "IsSource", "(", ")", ":", "return", "(", "False", ",", "''", ")", "filename_cc", "=", "f...
https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L5341-L5393
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/generator/msvs.py
python
_EscapeCommandLineArgumentForMSBuild
(s)
return s
Escapes a Windows command-line argument for use by MSBuild.
Escapes a Windows command-line argument for use by MSBuild.
[ "Escapes", "a", "Windows", "command", "-", "line", "argument", "for", "use", "by", "MSBuild", "." ]
def _EscapeCommandLineArgumentForMSBuild(s): """Escapes a Windows command-line argument for use by MSBuild.""" def _Replace(match): return (len(match.group(1))/2*4)*'\\' + '\\"' # Escape all quotes so that they are interpreted literally. s = quote_replacer_regex2.sub(_Replace, s) return s
[ "def", "_EscapeCommandLineArgumentForMSBuild", "(", "s", ")", ":", "def", "_Replace", "(", "match", ")", ":", "return", "(", "len", "(", "match", ".", "group", "(", "1", ")", ")", "/", "2", "*", "4", ")", "*", "'\\\\'", "+", "'\\\\\"'", "# Escape all q...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/msvs.py#L718-L726
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/framework/ops.py
python
value_text
(tensor, is_repr=False)
return text
Either the NumPy value or a custom TensorFlow formatting of `tensor`. Custom formatting is used for custom device tensors, e.g. parallel tensors with multiple components on different devices. Args: tensor: The tensor to format. is_repr: Controls the style/verbosity of formatting. Returns: The for...
Either the NumPy value or a custom TensorFlow formatting of `tensor`.
[ "Either", "the", "NumPy", "value", "or", "a", "custom", "TensorFlow", "formatting", "of", "tensor", "." ]
def value_text(tensor, is_repr=False): """Either the NumPy value or a custom TensorFlow formatting of `tensor`. Custom formatting is used for custom device tensors, e.g. parallel tensors with multiple components on different devices. Args: tensor: The tensor to format. is_repr: Controls the style/verb...
[ "def", "value_text", "(", "tensor", ",", "is_repr", "=", "False", ")", ":", "# pylint: disable=protected-access # friend access", "if", "tensor", ".", "_prefer_custom_summarizer", "(", ")", ":", "text", "=", "tensor", ".", "_summarize_value", "(", ")", "# pylint: e...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/ops.py#L236-L259
scylladb/seastar
0cdd2329beb1cc4c0af8828598c26114397ffa9c
scripts/perftune.py
python
DiskPerfTuner.__write_cache_config
(self)
return "write back" if self.args.set_write_back else "write through"
:return: None - if write cache mode configuration is not requested or the corresponding write cache configuration value string
:return: None - if write cache mode configuration is not requested or the corresponding write cache configuration value string
[ ":", "return", ":", "None", "-", "if", "write", "cache", "mode", "configuration", "is", "not", "requested", "or", "the", "corresponding", "write", "cache", "configuration", "value", "string" ]
def __write_cache_config(self): """ :return: None - if write cache mode configuration is not requested or the corresponding write cache configuration value string """ if self.args.set_write_back is None: return None return "write back" if self.args.set_write_...
[ "def", "__write_cache_config", "(", "self", ")", ":", "if", "self", ".", "args", ".", "set_write_back", "is", "None", ":", "return", "None", "return", "\"write back\"", "if", "self", ".", "args", ".", "set_write_back", "else", "\"write through\"" ]
https://github.com/scylladb/seastar/blob/0cdd2329beb1cc4c0af8828598c26114397ffa9c/scripts/perftune.py#L1020-L1028
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
PlatformInformation.IsOk
(*args, **kwargs)
return _misc_.PlatformInformation_IsOk(*args, **kwargs)
IsOk(self) -> bool
IsOk(self) -> bool
[ "IsOk", "(", "self", ")", "-", ">", "bool" ]
def IsOk(*args, **kwargs): """IsOk(self) -> bool""" return _misc_.PlatformInformation_IsOk(*args, **kwargs)
[ "def", "IsOk", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "PlatformInformation_IsOk", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1182-L1184
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/mime/application.py
python
MIMEApplication.__init__
(self, _data, _subtype='octet-stream', _encoder=encoders.encode_base64, *, policy=None, **_params)
Create an application/* type MIME document. _data is a string containing the raw application data. _subtype is the MIME content type subtype, defaulting to 'octet-stream'. _encoder is a function which will perform the actual encoding for transport of the application data, defa...
Create an application/* type MIME document.
[ "Create", "an", "application", "/", "*", "type", "MIME", "document", "." ]
def __init__(self, _data, _subtype='octet-stream', _encoder=encoders.encode_base64, *, policy=None, **_params): """Create an application/* type MIME document. _data is a string containing the raw application data. _subtype is the MIME content type subtype, defaulting to ...
[ "def", "__init__", "(", "self", ",", "_data", ",", "_subtype", "=", "'octet-stream'", ",", "_encoder", "=", "encoders", ".", "encode_base64", ",", "*", ",", "policy", "=", "None", ",", "*", "*", "_params", ")", ":", "if", "_subtype", "is", "None", ":",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/mime/application.py#L16-L37
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang/bindings/python/clang/cindex.py
python
Type.get_declaration
(self)
return conf.lib.clang_getTypeDeclaration(self)
Return the cursor for the declaration of the given type.
Return the cursor for the declaration of the given type.
[ "Return", "the", "cursor", "for", "the", "declaration", "of", "the", "given", "type", "." ]
def get_declaration(self): """ Return the cursor for the declaration of the given type. """ return conf.lib.clang_getTypeDeclaration(self)
[ "def", "get_declaration", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTypeDeclaration", "(", "self", ")" ]
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/bindings/python/clang/cindex.py#L2343-L2347
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/AI/AIstate.py
python
AIstate.__split_new_fleets
(self)
Split any new fleets. This function is supposed to be called once at the beginning of the turn. Splitting the auto generated fleets at game start or those created by recently built ships allows the AI to assign correct roles to all ships.
Split any new fleets.
[ "Split", "any", "new", "fleets", "." ]
def __split_new_fleets(self): """Split any new fleets. This function is supposed to be called once at the beginning of the turn. Splitting the auto generated fleets at game start or those created by recently built ships allows the AI to assign correct roles to all ships. """ ...
[ "def", "__split_new_fleets", "(", "self", ")", ":", "# TODO: check length of fleets for losses or do in AIstate.__cleanRoles", "universe", "=", "fo", ".", "getUniverse", "(", ")", "known_fleets", "=", "self", ".", "get_fleet_roles_map", "(", ")", "self", ".", "newlySpli...
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/AIstate.py#L991-L1015
hszhao/PSPNet
cf7e5a99ba37e46118026e96be5821a9bc63bde0
scripts/cpp_lint.py
python
ReverseCloseExpression
(clean_lines, linenum, pos)
return (line, 0, -1)
If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to ...
If input points to ) or } or ] or >, finds the position that opens it.
[ "If", "input", "points", "to", ")", "or", "}", "or", "]", "or", ">", "finds", "the", "position", "that", "opens", "it", "." ]
def ReverseCloseExpression(clean_lines, linenum, pos): """If input points to ) or } or ] or >, finds the position that opens it. If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression. Args: clean_lines: A CleansedLines instance ...
[ "def", "ReverseCloseExpression", "(", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "endchar", "=", "line", "[", "pos", "]", "if", "endchar", "not", "in", "')}]>'", ":", "return", "("...
https://github.com/hszhao/PSPNet/blob/cf7e5a99ba37e46118026e96be5821a9bc63bde0/scripts/cpp_lint.py#L1327-L1369
mysql/mysql-workbench
2f35f9034f015cbcd22139a60e1baa2e3e8e795c
plugins/wb.sqlide/sqlide_schematree_ext.py
python
CodeGenerator.build_cascaded_delete
(self)
To delete a row from a table all references to that row from other tables must be deleted first, otherwise the FK constraint won't let it be done. So this function will build the DELETE statements needed to do that, by deleting references to the given row all the way up to the wanted...
To delete a row from a table all references to that row from other tables must be deleted first, otherwise the FK constraint won't let it be done. So this function will build the DELETE statements needed to do that, by deleting references to the given row all the way up to the wanted...
[ "To", "delete", "a", "row", "from", "a", "table", "all", "references", "to", "that", "row", "from", "other", "tables", "must", "be", "deleted", "first", "otherwise", "the", "FK", "constraint", "won", "t", "let", "it", "be", "done", ".", "So", "this", "...
def build_cascaded_delete(self): """ To delete a row from a table all references to that row from other tables must be deleted first, otherwise the FK constraint won't let it be done. So this function will build the DELETE statements needed to do that, by deleting ...
[ "def", "build_cascaded_delete", "(", "self", ")", ":", "editor", "=", "self", ".", "editor", "object", "=", "self", ".", "selection", "[", "0", "]", "info", "=", "dependencyInfoForSchemaInEditor", "(", "editor", ",", "object", ".", "schemaName", ")", "if", ...
https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/plugins/wb.sqlide/sqlide_schematree_ext.py#L983-L1056
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py
python
SConfBase._shutdown
(self)
Private method. Reset to non-piped spawn
Private method. Reset to non-piped spawn
[ "Private", "method", ".", "Reset", "to", "non", "-", "piped", "spawn" ]
def _shutdown(self): """Private method. Reset to non-piped spawn""" global sconf_global, _ac_config_hs if not self.active: raise SCons.Errors.UserError("Finish may be called only once!") if self.logstream is not None and not dryrun: self.logstream.write("\n") ...
[ "def", "_shutdown", "(", "self", ")", ":", "global", "sconf_global", ",", "_ac_config_hs", "if", "not", "self", ".", "active", ":", "raise", "SCons", ".", "Errors", ".", "UserError", "(", "\"Finish may be called only once!\"", ")", "if", "self", ".", "logstrea...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py#L731-L749
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/sdist.py
python
sdist.write_manifest
(self)
Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'.
Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'.
[ "Write", "the", "file", "list", "in", "self", ".", "filelist", "(", "presumably", "as", "filled", "in", "by", "add_defaults", "()", "and", "read_template", "()", ")", "to", "the", "manifest", "file", "named", "by", "self", ".", "manifest", "." ]
def write_manifest(self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. """ if self._manifest_is_not_generated(): log.info("not writing to manually maintaine...
[ "def", "write_manifest", "(", "self", ")", ":", "if", "self", ".", "_manifest_is_not_generated", "(", ")", ":", "log", ".", "info", "(", "\"not writing to manually maintained \"", "\"manifest file '%s'\"", "%", "self", ".", "manifest", ")", "return", "content", "=...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/sdist.py#L377-L390
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/functools.py
python
_le_from_gt
(self, other, NotImplemented=NotImplemented)
return not op_result
Return a <= b. Computed by @total_ordering from (not a > b).
Return a <= b. Computed by
[ "Return", "a", "<", "=", "b", ".", "Computed", "by" ]
def _le_from_gt(self, other, NotImplemented=NotImplemented): 'Return a <= b. Computed by @total_ordering from (not a > b).' op_result = type(self).__gt__(self, other) if op_result is NotImplemented: return op_result return not op_result
[ "def", "_le_from_gt", "(", "self", ",", "other", ",", "NotImplemented", "=", "NotImplemented", ")", ":", "op_result", "=", "type", "(", "self", ")", ".", "__gt__", "(", "self", ",", "other", ")", "if", "op_result", "is", "NotImplemented", ":", "return", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/functools.py#L145-L150
mapequation/infomap
5f56b94fe0f956483f61a03ef07e94d8def2205e
interfaces/python/infomap.py
python
Infomap.num_leaf_modules
(self)
return num_leaf_modules
Get the number of leaf modules in the tree Returns ------- int The number of leaf modules
Get the number of leaf modules in the tree
[ "Get", "the", "number", "of", "leaf", "modules", "in", "the", "tree" ]
def num_leaf_modules(self): """Get the number of leaf modules in the tree Returns ------- int The number of leaf modules """ num_leaf_modules = 0 for _ in self.leaf_modules: num_leaf_modules += 1 return num_leaf_modules
[ "def", "num_leaf_modules", "(", "self", ")", ":", "num_leaf_modules", "=", "0", "for", "_", "in", "self", ".", "leaf_modules", ":", "num_leaf_modules", "+=", "1", "return", "num_leaf_modules" ]
https://github.com/mapequation/infomap/blob/5f56b94fe0f956483f61a03ef07e94d8def2205e/interfaces/python/infomap.py#L2073-L2084
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/json_schema_compiler/schema_bundle_generator.py
python
SchemaBundleGenerator.GenerateHeader
(self, file_base, body_code)
return c
Generates a code.Code object for a header file Parameters: - |file_base| - the base of the filename, e.g. 'foo' (for 'foo.h') - |body_code| - the code to put in between the multiple inclusion guards
Generates a code.Code object for a header file
[ "Generates", "a", "code", ".", "Code", "object", "for", "a", "header", "file" ]
def GenerateHeader(self, file_base, body_code): """Generates a code.Code object for a header file Parameters: - |file_base| - the base of the filename, e.g. 'foo' (for 'foo.h') - |body_code| - the code to put in between the multiple inclusion guards""" c = code.Code() c.Append(cpp_util.CHROMIUM...
[ "def", "GenerateHeader", "(", "self", ",", "file_base", ",", "body_code", ")", ":", "c", "=", "code", ".", "Code", "(", ")", "c", ".", "Append", "(", "cpp_util", ".", "CHROMIUM_LICENSE", ")", "c", ".", "Append", "(", ")", "c", ".", "Append", "(", "...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/json_schema_compiler/schema_bundle_generator.py#L24-L44
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/nntplib.py
python
NNTP.xhdr
(self, hdr, str, file=None)
return resp, lines
Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 Returns: - resp: server response if successful - list: list of (nr, value) strings
Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 Returns: - resp: server response if successful - list: list of (nr, value) strings
[ "Process", "an", "XHDR", "command", "(", "optional", "server", "extension", ")", ".", "Arguments", ":", "-", "hdr", ":", "the", "header", "type", "(", "e", ".", "g", ".", "subject", ")", "-", "str", ":", "an", "article", "nr", "a", "message", "id", ...
def xhdr(self, hdr, str, file=None): """Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 Returns: - resp: server response if successful - list: list of (nr, valu...
[ "def", "xhdr", "(", "self", ",", "hdr", ",", "str", ",", "file", "=", "None", ")", ":", "pat", "=", "re", ".", "compile", "(", "'^([0-9]+) ?(.*)\\n?'", ")", "resp", ",", "lines", "=", "self", ".", "longcmd", "(", "'XHDR '", "+", "hdr", "+", "' '", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/nntplib.py#L452-L467
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/python/m5/ext/pyfdt/pyfdt.py
python
FdtPropertyBytes.json_represent
(self, depth=0)
return result
Ouput JSON
Ouput JSON
[ "Ouput", "JSON" ]
def json_represent(self, depth=0): """Ouput JSON""" result = '%s: ["bytes", "' % json.dumps(self.name) result += '", "'.join(["%02x" % byte for byte in self.bytes]) result += '"]' return result
[ "def", "json_represent", "(", "self", ",", "depth", "=", "0", ")", ":", "result", "=", "'%s: [\"bytes\", \"'", "%", "json", ".", "dumps", "(", "self", ".", "name", ")", "result", "+=", "'\", \"'", ".", "join", "(", "[", "\"%02x\"", "%", "byte", "for", ...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/m5/ext/pyfdt/pyfdt.py#L364-L370
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
NavigationKeyEvent.SetFromTab
(*args, **kwargs)
return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
SetFromTab(self, bool bIs) Set to true under MSW if the event was generated using the tab key. This is required for proper navogation over radio buttons.
SetFromTab(self, bool bIs)
[ "SetFromTab", "(", "self", "bool", "bIs", ")" ]
def SetFromTab(*args, **kwargs): """ SetFromTab(self, bool bIs) Set to true under MSW if the event was generated using the tab key. This is required for proper navogation over radio buttons. """ return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
[ "def", "SetFromTab", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "NavigationKeyEvent_SetFromTab", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L7275-L7282
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/skype.py
python
ISkypeEvents.ConnectionStatus
(self, Status)
This event is caused by a connection status change. @param Status: New connection status. @type Status: L{Connection status<enums.conUnknown>}
This event is caused by a connection status change.
[ "This", "event", "is", "caused", "by", "a", "connection", "status", "change", "." ]
def ConnectionStatus(self, Status): '''This event is caused by a connection status change. @param Status: New connection status. @type Status: L{Connection status<enums.conUnknown>} '''
[ "def", "ConnectionStatus", "(", "self", ",", "Status", ")", ":" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/skype.py#L1496-L1501
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/code_coverage/croc.py
python
Coverage.__init__
(self)
Constructor.
Constructor.
[ "Constructor", "." ]
def __init__(self): """Constructor.""" self.files = {} # Map filename --> CoverageFile self.root_dirs = [] # (root, altname) self.rules = [] # (regexp, dict of RHS attrs) self.tree = CoveredDir('') self.print_stats = [] # Dicts of args to PrintStat() # ...
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "files", "=", "{", "}", "# Map filename --> CoverageFile", "self", ".", "root_dirs", "=", "[", "]", "# (root, altname)", "self", ".", "rules", "=", "[", "]", "# (regexp, dict of RHS attrs)", "self", ".", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/code_coverage/croc.py#L168-L178
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Build.py
python
BuildContext.get_all_task_gen
(self)
return lst
Utility method, returns a list of all task generators - if you need something more complicated, implement your own
Utility method, returns a list of all task generators - if you need something more complicated, implement your own
[ "Utility", "method", "returns", "a", "list", "of", "all", "task", "generators", "-", "if", "you", "need", "something", "more", "complicated", "implement", "your", "own" ]
def get_all_task_gen(self): """ Utility method, returns a list of all task generators - if you need something more complicated, implement your own """ lst = [] for g in self.groups: lst.extend(t for t in g if isinstance(t, TaskGen.task_gen)) return lst
[ "def", "get_all_task_gen", "(", "self", ")", ":", "lst", "=", "[", "]", "for", "g", "in", "self", ".", "groups", ":", "lst", ".", "extend", "(", "t", "for", "t", "in", "g", "if", "isinstance", "(", "t", ",", "TaskGen", ".", "task_gen", ")", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Build.py#L740-L747
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/rocksdb-master/linters/cpp_linter/cpplint.py
python
CheckIncludeLine
(filename, clean_lines, linenum, include_state, error)
Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_l...
Check rules that are applicable to #include lines.
[ "Check", "rules", "that", "are", "applicable", "to", "#include", "lines", "." ]
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage m...
[ "def", "CheckIncludeLine", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "include_state", ",", "error", ")", ":", "fileinfo", "=", "FileInfo", "(", "filename", ")", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "# \"include\" shoul...
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/rocksdb-master/linters/cpp_linter/cpplint.py#L3582-L3651
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
examples/pycaffe/layers/pascal_multilabel_datalayers.py
python
load_pascal_annotation
(index, pascal_root)
return {'boxes': boxes, 'gt_classes': gt_classes, 'gt_overlaps': overlaps, 'flipped': False, 'index': index}
This code is borrowed from Ross Girshick's FAST-RCNN code (https://github.com/rbgirshick/fast-rcnn). It parses the PASCAL .xml metadata files. See publication for further details: (http://arxiv.org/abs/1504.08083). Thanks Ross!
This code is borrowed from Ross Girshick's FAST-RCNN code (https://github.com/rbgirshick/fast-rcnn). It parses the PASCAL .xml metadata files. See publication for further details: (http://arxiv.org/abs/1504.08083).
[ "This", "code", "is", "borrowed", "from", "Ross", "Girshick", "s", "FAST", "-", "RCNN", "code", "(", "https", ":", "//", "github", ".", "com", "/", "rbgirshick", "/", "fast", "-", "rcnn", ")", ".", "It", "parses", "the", "PASCAL", ".", "xml", "metada...
def load_pascal_annotation(index, pascal_root): """ This code is borrowed from Ross Girshick's FAST-RCNN code (https://github.com/rbgirshick/fast-rcnn). It parses the PASCAL .xml metadata files. See publication for further details: (http://arxiv.org/abs/1504.08083). Thanks Ross! """ cl...
[ "def", "load_pascal_annotation", "(", "index", ",", "pascal_root", ")", ":", "classes", "=", "(", "'__background__'", ",", "# always index 0", "'aeroplane'", ",", "'bicycle'", ",", "'bird'", ",", "'boat'", ",", "'bottle'", ",", "'bus'", ",", "'car'", ",", "'ca...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L176-L229
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/lib/io/tf_record.py
python
TFRecordWriter.close
(self)
Close the file.
Close the file.
[ "Close", "the", "file", "." ]
def close(self): """Close the file.""" self._writer.Close()
[ "def", "close", "(", "self", ")", ":", "self", ".", "_writer", ".", "Close", "(", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/lib/io/tf_record.py#L122-L124
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
CondCore/Utilities/scripts/uploadConditions.py
python
HTTP.query
(self, url, data = None, files = None, keepCookies = True)
Queries a URL, optionally with some data (dictionary). If no data is specified, a GET request will be used. If some data is specified, a POST request will be used. If files is specified, it must be a dictionary like data but the values are filenames. By default, cookies are ke...
Queries a URL, optionally with some data (dictionary).
[ "Queries", "a", "URL", "optionally", "with", "some", "data", "(", "dictionary", ")", "." ]
def query(self, url, data = None, files = None, keepCookies = True): '''Queries a URL, optionally with some data (dictionary). If no data is specified, a GET request will be used. If some data is specified, a POST request will be used. If files is specified, it must be a dictionary lik...
[ "def", "query", "(", "self", ",", "url", ",", "data", "=", "None", ",", "files", "=", "None", ",", "keepCookies", "=", "True", ")", ":", "if", "not", "keepCookies", ":", "self", ".", "discardCookies", "(", ")", "url", "=", "self", ".", "baseUrl", "...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CondCore/Utilities/scripts/uploadConditions.py#L351-L424
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/distribute/distribute_coordinator_utils.py
python
_WorkerContext.has_barrier
(self)
return self._worker_barrier is not None
Whether the barrier is set or not.
Whether the barrier is set or not.
[ "Whether", "the", "barrier", "is", "set", "or", "not", "." ]
def has_barrier(self): """Whether the barrier is set or not.""" return self._worker_barrier is not None
[ "def", "has_barrier", "(", "self", ")", ":", "return", "self", ".", "_worker_barrier", "is", "not", "None" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/distribute/distribute_coordinator_utils.py#L232-L234
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/_quant_ops.py
python
BatchNormFold2.__init__
(self, freeze_bn=0)
Initialize conv2d fold layer
Initialize conv2d fold layer
[ "Initialize", "conv2d", "fold", "layer" ]
def __init__(self, freeze_bn=0): """Initialize conv2d fold layer""" self.freeze_bn = validator.check_value_type('freeze_bn', freeze_bn, (int,), self.name) self.init_prim_io_names(inputs=['x', 'beta', 'gamma', 'batch_std', 'batch_mean', 'running_std', 'runn...
[ "def", "__init__", "(", "self", ",", "freeze_bn", "=", "0", ")", ":", "self", ".", "freeze_bn", "=", "validator", ".", "check_value_type", "(", "'freeze_bn'", ",", "freeze_bn", ",", "(", "int", ",", ")", ",", "self", ".", "name", ")", "self", ".", "i...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/_quant_ops.py#L1264-L1269
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pathlib.py
python
Path.is_mount
(self)
return ino == parent_ino
Check if this path is a POSIX mount point
Check if this path is a POSIX mount point
[ "Check", "if", "this", "path", "is", "a", "POSIX", "mount", "point" ]
def is_mount(self): """ Check if this path is a POSIX mount point """ # Need to exist and be a dir if not self.exists() or not self.is_dir(): return False try: parent_dev = self.parent.stat().st_dev except OSError: return False...
[ "def", "is_mount", "(", "self", ")", ":", "# Need to exist and be a dir", "if", "not", "self", ".", "exists", "(", ")", "or", "not", "self", ".", "is_dir", "(", ")", ":", "return", "False", "try", ":", "parent_dev", "=", "self", ".", "parent", ".", "st...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pathlib.py#L1467-L1485
l4ka/pistachio
8be66aa9b85a774ad1b71dbd3a79c5c745a96273
contrib/cml2/cmlcompile.py
python
intern_symbol
(input, name=None, oktypes=None, record=0)
return ref
Attempt to read and intern a symbol.
Attempt to read and intern a symbol.
[ "Attempt", "to", "read", "and", "intern", "a", "symbol", "." ]
def intern_symbol(input, name=None, oktypes=None, record=0): "Attempt to read and intern a symbol." if name is None: tok = input.lex_token() if tok.type == "word": name = tok.attr else: input.push_token(tok) return None # If symbol is a constant ju...
[ "def", "intern_symbol", "(", "input", ",", "name", "=", "None", ",", "oktypes", "=", "None", ",", "record", "=", "0", ")", ":", "if", "name", "is", "None", ":", "tok", "=", "input", ".", "lex_token", "(", ")", "if", "tok", ".", "type", "==", "\"w...
https://github.com/l4ka/pistachio/blob/8be66aa9b85a774ad1b71dbd3a79c5c745a96273/contrib/cml2/cmlcompile.py#L371-L405
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py
python
JIRA.search_allowed_users_for_issue
(self, user, issueKey=None, projectKey=None, startAt=0, maxResults=50)
return self._fetch_pages(User, None, 'user/viewissue/search', startAt, maxResults, params)
Get a list of user Resources that match a username string and have browse permission for the issue or project. :param user: a string to match usernames against. :param issueKey: find users with browse permission for this issue. :param projectKey: find users with browse permission for this proje...
Get a list of user Resources that match a username string and have browse permission for the issue or project.
[ "Get", "a", "list", "of", "user", "Resources", "that", "match", "a", "username", "string", "and", "have", "browse", "permission", "for", "the", "issue", "or", "project", "." ]
def search_allowed_users_for_issue(self, user, issueKey=None, projectKey=None, startAt=0, maxResults=50): """Get a list of user Resources that match a username string and have browse permission for the issue or project. :param user: a string to match usernames against. :param issueKey: find use...
[ "def", "search_allowed_users_for_issue", "(", "self", ",", "user", ",", "issueKey", "=", "None", ",", "projectKey", "=", "None", ",", "startAt", "=", "0", ",", "maxResults", "=", "50", ")", ":", "params", "=", "{", "'username'", ":", "user", "}", "if", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/jira/client.py#L2299-L2315
bryanyzhu/Hidden-Two-Stream
f7f684adbdacb6df6b1cf196c3a476cd23484a0f
scripts/cpp_lint.py
python
_OutputFormat
()
return _cpplint_state.output_format
Gets the module's output format.
Gets the module's output format.
[ "Gets", "the", "module", "s", "output", "format", "." ]
def _OutputFormat(): """Gets the module's output format.""" return _cpplint_state.output_format
[ "def", "_OutputFormat", "(", ")", ":", "return", "_cpplint_state", ".", "output_format" ]
https://github.com/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/scripts/cpp_lint.py#L767-L769
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/windows_events.py
python
IocpProactor._unregister
(self, ov)
Unregister an overlapped object. Call this method when its future has been cancelled. The event can already be signalled (pending in the proactor event queue). It is also safe if the event is never signalled (because it was cancelled).
Unregister an overlapped object.
[ "Unregister", "an", "overlapped", "object", "." ]
def _unregister(self, ov): """Unregister an overlapped object. Call this method when its future has been cancelled. The event can already be signalled (pending in the proactor event queue). It is also safe if the event is never signalled (because it was cancelled). """ s...
[ "def", "_unregister", "(", "self", ",", "ov", ")", ":", "self", ".", "_check_closed", "(", ")", "self", ".", "_unregistered", ".", "append", "(", "ov", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/windows_events.py#L687-L695
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
Font.GetFaceName
(*args, **kwargs)
return _gdi_.Font_GetFaceName(*args, **kwargs)
GetFaceName(self) -> String Returns the typeface name associated with the font, or the empty string if there is no typeface information.
GetFaceName(self) -> String
[ "GetFaceName", "(", "self", ")", "-", ">", "String" ]
def GetFaceName(*args, **kwargs): """ GetFaceName(self) -> String Returns the typeface name associated with the font, or the empty string if there is no typeface information. """ return _gdi_.Font_GetFaceName(*args, **kwargs)
[ "def", "GetFaceName", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Font_GetFaceName", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L2238-L2245
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/ndarray/ndarray.py
python
imdecode
(str_img, clip_rect=(0, 0, 0, 0), out=None, index=0, channels=3, mean=None)
DEPRECATED, use mx.img instead Parameters ---------- str_img : str Binary image data clip_rect : iterable of 4 int Clip decoded image to rectangle (x0, y0, x1, y1). out : NDArray Output buffer. Can be 3 dimensional (c, h, w) or 4 dimensional (n, c, h, w). index : int ...
DEPRECATED, use mx.img instead
[ "DEPRECATED", "use", "mx", ".", "img", "instead" ]
def imdecode(str_img, clip_rect=(0, 0, 0, 0), out=None, index=0, channels=3, mean=None): """DEPRECATED, use mx.img instead Parameters ---------- str_img : str Binary image data clip_rect : iterable of 4 int Clip decoded image to rectangle (x0, y0, x1, y1). out : NDArray ...
[ "def", "imdecode", "(", "str_img", ",", "clip_rect", "=", "(", "0", ",", "0", ",", "0", ",", "0", ")", ",", "out", "=", "None", ",", "index", "=", "0", ",", "channels", "=", "3", ",", "mean", "=", "None", ")", ":", "# pylint: disable= no-member, pr...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L3312-L3351
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/common.py
python
EncodePOSIXShellList
(list)
return ' '.join(encoded_arguments)
Encodes |list| suitably for consumption by POSIX shells. Returns EncodePOSIXShellArgument for each item in list, and joins them together using the space character as an argument separator.
Encodes |list| suitably for consumption by POSIX shells.
[ "Encodes", "|list|", "suitably", "for", "consumption", "by", "POSIX", "shells", "." ]
def EncodePOSIXShellList(list): """Encodes |list| suitably for consumption by POSIX shells. Returns EncodePOSIXShellArgument for each item in list, and joins them together using the space character as an argument separator. """ encoded_arguments = [] for argument in list: encoded_arguments.append(Enco...
[ "def", "EncodePOSIXShellList", "(", "list", ")", ":", "encoded_arguments", "=", "[", "]", "for", "argument", "in", "list", ":", "encoded_arguments", ".", "append", "(", "EncodePOSIXShellArgument", "(", "argument", ")", ")", "return", "' '", ".", "join", "(", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/common.py#L283-L293
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.StyleSetChangeable
(*args, **kwargs)
return _stc.StyledTextCtrl_StyleSetChangeable(*args, **kwargs)
StyleSetChangeable(self, int style, bool changeable) Set a style to be changeable or not (read only). Experimental feature, currently buggy.
StyleSetChangeable(self, int style, bool changeable)
[ "StyleSetChangeable", "(", "self", "int", "style", "bool", "changeable", ")" ]
def StyleSetChangeable(*args, **kwargs): """ StyleSetChangeable(self, int style, bool changeable) Set a style to be changeable or not (read only). Experimental feature, currently buggy. """ return _stc.StyledTextCtrl_StyleSetChangeable(*args, **kwargs)
[ "def", "StyleSetChangeable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_StyleSetChangeable", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L3019-L3026
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/layer/conv.py
python
Conv2d.__init__
(self, in_channels, out_channels, kernel_size, stride=1, pad_mode='same', padding=0, dilation=1, group=1, has_bias=False, weight_init='normal', ...
Initialize Conv2d.
Initialize Conv2d.
[ "Initialize", "Conv2d", "." ]
def __init__(self, in_channels, out_channels, kernel_size, stride=1, pad_mode='same', padding=0, dilation=1, group=1, has_bias=False, weight_init='nor...
[ "def", "__init__", "(", "self", ",", "in_channels", ",", "out_channels", ",", "kernel_size", ",", "stride", "=", "1", ",", "pad_mode", "=", "'same'", ",", "padding", "=", "0", ",", "dilation", "=", "1", ",", "group", "=", "1", ",", "has_bias", "=", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/layer/conv.py#L223-L263
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/minimum-number-of-operations-to-reinitialize-a-permutation.py
python
Solution2.reinitializePermutation
(self, n)
return result
:type n: int :rtype: int
:type n: int :rtype: int
[ ":", "type", "n", ":", "int", ":", "rtype", ":", "int" ]
def reinitializePermutation(self, n): """ :type n: int :rtype: int """ if n == 2: return 1 result, i = 0, 1 while not result or i != 1: i = (i*2)%(n-1) result += 1 return result
[ "def", "reinitializePermutation", "(", "self", ",", "n", ")", ":", "if", "n", "==", "2", ":", "return", "1", "result", ",", "i", "=", "0", ",", "1", "while", "not", "result", "or", "i", "!=", "1", ":", "i", "=", "(", "i", "*", "2", ")", "%", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-number-of-operations-to-reinitialize-a-permutation.py#L34-L45
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/tools/build/src/util/set.py
python
intersection
(set1, set2)
return result
Removes from set1 any items which don't appear in set2 and returns the result.
Removes from set1 any items which don't appear in set2 and returns the result.
[ "Removes", "from", "set1", "any", "items", "which", "don", "t", "appear", "in", "set2", "and", "returns", "the", "result", "." ]
def intersection (set1, set2): """ Removes from set1 any items which don't appear in set2 and returns the result. """ assert is_iterable(set1) assert is_iterable(set2) result = [] for v in set1: if v in set2: result.append (v) return result
[ "def", "intersection", "(", "set1", ",", "set2", ")", ":", "assert", "is_iterable", "(", "set1", ")", "assert", "is_iterable", "(", "set2", ")", "result", "=", "[", "]", "for", "v", "in", "set1", ":", "if", "v", "in", "set2", ":", "result", ".", "a...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/util/set.py#L20-L29
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/app2.py
python
CommandLoop.onecmd
(self, line)
return False
Process a single command. Runs a single command, and stores the return code in self._last_return_code. Always returns False unless the command was EOF. Args: line: (str) Command line to process. Returns: A bool signaling whether or not the command loop shou...
Process a single command.
[ "Process", "a", "single", "command", "." ]
def onecmd(self, line): """Process a single command. Runs a single command, and stores the return code in self._last_return_code. Always returns False unless the command was EOF. Args: line: (str) Command line to process. Returns: A bool signaling w...
[ "def", "onecmd", "(", "self", ",", "line", ")", ":", "try", ":", "self", ".", "_last_return_code", "=", "cmd", ".", "Cmd", ".", "onecmd", "(", "self", ",", "line", ")", "except", "CommandLoop", ".", "TerminateSignal", ":", "return", "True", "except", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/app2.py#L262-L284
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/mox.py
python
IsA.equals
(self, rhs)
Check to see if the RHS is an instance of class_name. Args: # rhs: the right hand side of the test rhs: object Returns: bool
Check to see if the RHS is an instance of class_name.
[ "Check", "to", "see", "if", "the", "RHS", "is", "an", "instance", "of", "class_name", "." ]
def equals(self, rhs): """Check to see if the RHS is an instance of class_name. Args: # rhs: the right hand side of the test rhs: object Returns: bool """ try: return isinstance(rhs, self._class_name) except TypeError: # Check raw types if there was a type error....
[ "def", "equals", "(", "self", ",", "rhs", ")", ":", "try", ":", "return", "isinstance", "(", "rhs", ",", "self", ".", "_class_name", ")", "except", "TypeError", ":", "# Check raw types if there was a type error. This is helpful for", "# things like cStringIO.StringIO."...
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/mox.py#L807-L823
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/number.py
python
getStrongPrime
(N, e=0, false_positive_prob=1e-6, randfunc=None)
return X
r""" Return a random strong *N*-bit prime number. In this context, *p* is a strong prime if *p-1* and *p+1* have at least one large prime factor. Args: N (integer): the exact length of the strong prime. It must be a multiple of 128 and > 512. e (integer): if provided, the retu...
r""" Return a random strong *N*-bit prime number. In this context, *p* is a strong prime if *p-1* and *p+1* have at least one large prime factor.
[ "r", "Return", "a", "random", "strong", "*", "N", "*", "-", "bit", "prime", "number", ".", "In", "this", "context", "*", "p", "*", "is", "a", "strong", "prime", "if", "*", "p", "-", "1", "*", "and", "*", "p", "+", "1", "*", "have", "at", "lea...
def getStrongPrime(N, e=0, false_positive_prob=1e-6, randfunc=None): r""" Return a random strong *N*-bit prime number. In this context, *p* is a strong prime if *p-1* and *p+1* have at least one large prime factor. Args: N (integer): the exact length of the strong prime. It must b...
[ "def", "getStrongPrime", "(", "N", ",", "e", "=", "0", ",", "false_positive_prob", "=", "1e-6", ",", "randfunc", "=", "None", ")", ":", "# This function was implemented following the", "# instructions found in the paper:", "# \"FAST GENERATION OF RANDOM, STRONG RSA PRIMES\"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Util/number.py#L200-L331
AstarLight/Lets_OCR
b2af7120a34d785434c96e820b6eb1aa69269d20
detector/ctpn/infer.py
python
get_text_lines
(text_proposals, im_size, scores=0)
return text_recs
text_proposals:boxes
text_proposals:boxes
[ "text_proposals", ":", "boxes" ]
def get_text_lines(text_proposals, im_size, scores=0): """ text_proposals:boxes """ #tp_groups = neighbour_connector(text_proposals, im_size) # 首先还是建图,获取到文本行由哪几个小框构成 #print(tp_groups) text_lines = np.zeros((len(text_proposals), 8), np.float32) for index, tp_indices in enumerate(text_propo...
[ "def", "get_text_lines", "(", "text_proposals", ",", "im_size", ",", "scores", "=", "0", ")", ":", "#tp_groups = neighbour_connector(text_proposals, im_size) # 首先还是建图,获取到文本行由哪几个小框构成", "#print(tp_groups)", "text_lines", "=", "np", ".", "zeros", "(", "(", "len", "(", "te...
https://github.com/AstarLight/Lets_OCR/blob/b2af7120a34d785434c96e820b6eb1aa69269d20/detector/ctpn/infer.py#L50-L138
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PropertyGrid.DoHidePropertyError
(*args, **kwargs)
return _propgrid.PropertyGrid_DoHidePropertyError(*args, **kwargs)
DoHidePropertyError(self, PGProperty property)
DoHidePropertyError(self, PGProperty property)
[ "DoHidePropertyError", "(", "self", "PGProperty", "property", ")" ]
def DoHidePropertyError(*args, **kwargs): """DoHidePropertyError(self, PGProperty property)""" return _propgrid.PropertyGrid_DoHidePropertyError(*args, **kwargs)
[ "def", "DoHidePropertyError", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_DoHidePropertyError", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L2436-L2438
takemaru/graphillion
51879f92bb96b53ef8f914ef37a05252ce383617
graphillion/graphset.py
python
GraphSet.complement
(self)
return GraphSet(ss)
Returns a new GraphSet with complement graphs of `self`. The `self` is not changed. Examples: >>> GraphSet.set_universe([(1, 2), (1, 4)]) >>> graph1 = [(1, 2)] >>> graph2 = [(1, 2), (1, 4)] >>> gs = GraphSet([graph1, graph2]) >>> gs.complement() ...
Returns a new GraphSet with complement graphs of `self`.
[ "Returns", "a", "new", "GraphSet", "with", "complement", "graphs", "of", "self", "." ]
def complement(self): """Returns a new GraphSet with complement graphs of `self`. The `self` is not changed. Examples: >>> GraphSet.set_universe([(1, 2), (1, 4)]) >>> graph1 = [(1, 2)] >>> graph2 = [(1, 2), (1, 4)] >>> gs = GraphSet([graph1, graph2]) ...
[ "def", "complement", "(", "self", ")", ":", "ss", "=", "self", ".", "_ss", ".", "copy", "(", ")", "ss", ".", "flip", "(", ")", "return", "GraphSet", "(", "ss", ")" ]
https://github.com/takemaru/graphillion/blob/51879f92bb96b53ef8f914ef37a05252ce383617/graphillion/graphset.py#L1144-L1162
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/python_libs/vtr/log_parse.py
python
determine_lut_size
(architecture_file)
return lut_size
Determines the maximum LUT size (K) in an architecture file. Assumes LUTs are represented as BLIF '.names'
Determines the maximum LUT size (K) in an architecture file.
[ "Determines", "the", "maximum", "LUT", "size", "(", "K", ")", "in", "an", "architecture", "file", "." ]
def determine_lut_size(architecture_file): """ Determines the maximum LUT size (K) in an architecture file. Assumes LUTs are represented as BLIF '.names' """ arch_xml = ET.parse(architecture_file).getroot() lut_size = 0 saw_blif_names = False for elem in arch_xml.findall(".//pb_type"):...
[ "def", "determine_lut_size", "(", "architecture_file", ")", ":", "arch_xml", "=", "ET", ".", "parse", "(", "architecture_file", ")", ".", "getroot", "(", ")", "lut_size", "=", "0", "saw_blif_names", "=", "False", "for", "elem", "in", "arch_xml", ".", "findal...
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/python_libs/vtr/log_parse.py#L470-L495
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/pickletools.py
python
read_floatnl
(f)
return float(s)
r""" >>> import StringIO >>> read_floatnl(StringIO.StringIO("-1.25\n6")) -1.25
r""" >>> import StringIO >>> read_floatnl(StringIO.StringIO("-1.25\n6")) -1.25
[ "r", ">>>", "import", "StringIO", ">>>", "read_floatnl", "(", "StringIO", ".", "StringIO", "(", "-", "1", ".", "25", "\\", "n6", "))", "-", "1", ".", "25" ]
def read_floatnl(f): r""" >>> import StringIO >>> read_floatnl(StringIO.StringIO("-1.25\n6")) -1.25 """ s = read_stringnl(f, decode=False, stripquotes=False) return float(s)
[ "def", "read_floatnl", "(", "f", ")", ":", "s", "=", "read_stringnl", "(", "f", ",", "decode", "=", "False", ",", "stripquotes", "=", "False", ")", "return", "float", "(", "s", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pickletools.py#L562-L569
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/lib/io/file_io.py
python
copy_v2
(src, dst, overwrite=False)
Copies data from `src` to `dst`. Args: src: string, name of the file whose contents need to be copied dst: string, name of the file to which to copy to overwrite: boolean, if false it's an error for `dst` to be occupied by an existing file. Raises: errors.OpError: If the operation fails.
Copies data from `src` to `dst`.
[ "Copies", "data", "from", "src", "to", "dst", "." ]
def copy_v2(src, dst, overwrite=False): """Copies data from `src` to `dst`. Args: src: string, name of the file whose contents need to be copied dst: string, name of the file to which to copy to overwrite: boolean, if false it's an error for `dst` to be occupied by an existing file. Raises: ...
[ "def", "copy_v2", "(", "src", ",", "dst", ",", "overwrite", "=", "False", ")", ":", "pywrap_tensorflow", ".", "CopyFile", "(", "compat", ".", "as_bytes", "(", "src", ")", ",", "compat", ".", "as_bytes", "(", "dst", ")", ",", "overwrite", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/lib/io/file_io.py#L473-L486
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/fractions.py
python
Fraction.__abs__
(a)
return Fraction(abs(a._numerator), a._denominator)
abs(a)
abs(a)
[ "abs", "(", "a", ")" ]
def __abs__(a): """abs(a)""" return Fraction(abs(a._numerator), a._denominator)
[ "def", "__abs__", "(", "a", ")", ":", "return", "Fraction", "(", "abs", "(", "a", ".", "_numerator", ")", ",", "a", ".", "_denominator", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/fractions.py#L497-L499
dgobbi/vtk-dicom
9078df24cfeceead466a785d675b7a4afa034bba
Utilities/chartables.py
python
readdict
(fname)
return d
Read a text file that contains a mapping table. The table is assumed to have two or more columns, with '#' for comments.
Read a text file that contains a mapping table. The table is assumed to have two or more columns, with '#' for comments.
[ "Read", "a", "text", "file", "that", "contains", "a", "mapping", "table", ".", "The", "table", "is", "assumed", "to", "have", "two", "or", "more", "columns", "with", "#", "for", "comments", "." ]
def readdict(fname): """Read a text file that contains a mapping table. The table is assumed to have two or more columns, with '#' for comments. """ d = {} f = open(fname, 'r') for l in f.readlines(): l = l.strip() if l and l[0] != '#': columns = l.split() ...
[ "def", "readdict", "(", "fname", ")", ":", "d", "=", "{", "}", "f", "=", "open", "(", "fname", ",", "'r'", ")", "for", "l", "in", "f", ".", "readlines", "(", ")", ":", "l", "=", "l", ".", "strip", "(", ")", "if", "l", "and", "l", "[", "0"...
https://github.com/dgobbi/vtk-dicom/blob/9078df24cfeceead466a785d675b7a4afa034bba/Utilities/chartables.py#L105-L119
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/optimize/_tstutils.py
python
aps05_f
(x)
return np.sin(x) - 1.0 / 2
r"""Simple Trigonometric function
r"""Simple Trigonometric function
[ "r", "Simple", "Trigonometric", "function" ]
def aps05_f(x): r"""Simple Trigonometric function""" return np.sin(x) - 1.0 / 2
[ "def", "aps05_f", "(", "x", ")", ":", "return", "np", ".", "sin", "(", "x", ")", "-", "1.0", "/", "2" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_tstutils.py#L216-L218
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/framework.py
python
Block._to_readable_code
(self, skip_op_callstack=True)
return block_str
Get readable debug string of Block. .. note:: If you want to get the debug string in protobuf format, please use :code:`to_string` method. Args: skip_op_callstack(bool): whether to skip parsing Operator's attribute op_callstack, default value is True...
Get readable debug string of Block.
[ "Get", "readable", "debug", "string", "of", "Block", "." ]
def _to_readable_code(self, skip_op_callstack=True): """ Get readable debug string of Block. .. note:: If you want to get the debug string in protobuf format, please use :code:`to_string` method. Args: skip_op_callstack(bool): whether to skip parsing...
[ "def", "_to_readable_code", "(", "self", ",", "skip_op_callstack", "=", "True", ")", ":", "assert", "isinstance", "(", "skip_op_callstack", ",", "bool", ")", ",", "\"skip_op_callstack parameter's type is error, expect bool, received {}\"", ".", "format", "(", "type", "(...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/framework.py#L3113-L3156
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/imaplib.py
python
IMAP4._CRAM_MD5_AUTH
(self, challenge)
return self.user + " " + hmac.HMAC(self.password, challenge).hexdigest()
Authobject to use with CRAM-MD5 authentication.
Authobject to use with CRAM-MD5 authentication.
[ "Authobject", "to", "use", "with", "CRAM", "-", "MD5", "authentication", "." ]
def _CRAM_MD5_AUTH(self, challenge): """ Authobject to use with CRAM-MD5 authentication. """ import hmac return self.user + " " + hmac.HMAC(self.password, challenge).hexdigest()
[ "def", "_CRAM_MD5_AUTH", "(", "self", ",", "challenge", ")", ":", "import", "hmac", "return", "self", ".", "user", "+", "\" \"", "+", "hmac", ".", "HMAC", "(", "self", ".", "password", ",", "challenge", ")", ".", "hexdigest", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/imaplib.py#L537-L540
perilouswithadollarsign/cstrike15_src
f82112a2388b841d72cb62ca48ab1846dfcc11c8
thirdparty/protobuf-2.5.0/python/google/protobuf/internal/python_message.py
python
_AddSlots
(message_descriptor, dictionary)
Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type. Args: message_descriptor: A Descriptor instance describing this message type. dictionary: Class dictionary to which we'll add a '__slots__' entry.
Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type.
[ "Adds", "a", "__slots__", "entry", "to", "dictionary", "containing", "the", "names", "of", "all", "valid", "attributes", "for", "this", "message", "type", "." ]
def _AddSlots(message_descriptor, dictionary): """Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type. Args: message_descriptor: A Descriptor instance describing this message type. dictionary: Class dictionary to which we'll add a '__slots__' entry. ...
[ "def", "_AddSlots", "(", "message_descriptor", ",", "dictionary", ")", ":", "dictionary", "[", "'__slots__'", "]", "=", "[", "'_cached_byte_size'", ",", "'_cached_byte_size_dirty'", ",", "'_fields'", ",", "'_unknown_fields'", ",", "'_is_present_in_parent'", ",", "'_li...
https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/python_message.py#L164-L179
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/tactics_api.py
python
arg_initial_node
()
return _ivy_ag.states[0]
Add an initial node to the abstract reachability graph (arg) and return it.
Add an initial node to the abstract reachability graph (arg) and return it.
[ "Add", "an", "initial", "node", "to", "the", "abstract", "reachability", "graph", "(", "arg", ")", "and", "return", "it", "." ]
def arg_initial_node(): """ Add an initial node to the abstract reachability graph (arg) and return it. """ # right now, the initial state is already added as the first # state, so just return it return _ivy_ag.states[0]
[ "def", "arg_initial_node", "(", ")", ":", "# right now, the initial state is already added as the first", "# state, so just return it", "return", "_ivy_ag", ".", "states", "[", "0", "]" ]
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/tactics_api.py#L92-L99
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/samplelogs/model.py
python
SampleLogsModel.getItemModel
(self, searched_key='')
return model
Return a QModel made from the current workspace. This should be set onto a QTableView. The searched_key allows for filtering log entries.
Return a QModel made from the current workspace. This should be set onto a QTableView. The searched_key allows for filtering log entries.
[ "Return", "a", "QModel", "made", "from", "the", "current", "workspace", ".", "This", "should", "be", "set", "onto", "a", "QTableView", ".", "The", "searched_key", "allows", "for", "filtering", "log", "entries", "." ]
def getItemModel(self, searched_key=''): """Return a QModel made from the current workspace. This should be set onto a QTableView. The searched_key allows for filtering log entries. """ def create_table_item(column, itemname, invalid_value_count, log_size, callable, *args): ...
[ "def", "getItemModel", "(", "self", ",", "searched_key", "=", "''", ")", ":", "def", "create_table_item", "(", "column", ",", "itemname", ",", "invalid_value_count", ",", "log_size", ",", "callable", ",", "*", "args", ")", ":", "item", "=", "QStandardItem", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/samplelogs/model.py#L187-L234
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/ticker.py
python
Ticker.ShouldInheritColours
(self)
return False
Don't get colours from our parent...
Don't get colours from our parent...
[ "Don", "t", "get", "colours", "from", "our", "parent", "..." ]
def ShouldInheritColours(self): """Don't get colours from our parent...""" return False
[ "def", "ShouldInheritColours", "(", "self", ")", ":", "return", "False" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ticker.py#L196-L198
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/layers/utils.py
python
object_list_uid
(object_list)
return ', '.join([str(abs(id(x))) for x in object_list])
Creates a single string from object ids.
Creates a single string from object ids.
[ "Creates", "a", "single", "string", "from", "object", "ids", "." ]
def object_list_uid(object_list): """Creates a single string from object ids.""" object_list = nest.flatten(object_list) return ', '.join([str(abs(id(x))) for x in object_list])
[ "def", "object_list_uid", "(", "object_list", ")", ":", "object_list", "=", "nest", ".", "flatten", "(", "object_list", ")", "return", "', '", ".", "join", "(", "[", "str", "(", "abs", "(", "id", "(", "x", ")", ")", ")", "for", "x", "in", "object_lis...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/layers/utils.py#L231-L234
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_queue_runner.py
python
FeedingQueueRunner._run
(self, sess, enqueue_op, feed_fn, coord=None)
Execute the enqueue op in a loop, close the queue in case of error. Args: sess: A `Session`. enqueue_op: The `Operation` to run. feed_fn: the feed function to pass to `sess.run`. coord: Optional `Coordinator` object for reporting errors and checking for stop conditions.
Execute the enqueue op in a loop, close the queue in case of error.
[ "Execute", "the", "enqueue", "op", "in", "a", "loop", "close", "the", "queue", "in", "case", "of", "error", "." ]
def _run(self, sess, enqueue_op, feed_fn, coord=None): """Execute the enqueue op in a loop, close the queue in case of error. Args: sess: A `Session`. enqueue_op: The `Operation` to run. feed_fn: the feed function to pass to `sess.run`. coord: Optional `Coordinator` object for reporting...
[ "def", "_run", "(", "self", ",", "sess", ",", "enqueue_op", ",", "feed_fn", ",", "coord", "=", "None", ")", ":", "# TODO(jamieas): Reduce code duplication with `QueueRunner`.", "decremented", "=", "False", "try", ":", "while", "True", ":", "if", "coord", "and", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_queue_runner.py#L64-L109
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/etree/ElementTree.py
python
Element.keys
(self)
return self.attrib.keys()
Get list of attribute names. Names are returned in an arbitrary order, just like an ordinary Python dict. Equivalent to attrib.keys()
Get list of attribute names.
[ "Get", "list", "of", "attribute", "names", "." ]
def keys(self): """Get list of attribute names. Names are returned in an arbitrary order, just like an ordinary Python dict. Equivalent to attrib.keys() """ return self.attrib.keys()
[ "def", "keys", "(", "self", ")", ":", "return", "self", ".", "attrib", ".", "keys", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/etree/ElementTree.py#L371-L378
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-js/mx.graal-js/mx_graal_js.py
python
testv8
(args, nonZeroIsFatal=True)
run the testV8 conformance suite
run the testV8 conformance suite
[ "run", "the", "testV8", "conformance", "suite" ]
def testv8(args, nonZeroIsFatal=True): """run the testV8 conformance suite""" _location = join(_suite.dir, 'lib', 'testv8') _stack_size = '3m' if mx.get_arch() in ('aarch64', 'sparcv9') else '1m' _run_test_suite( location=_location, library_names=['TESTV8'], custom_args=args, ...
[ "def", "testv8", "(", "args", ",", "nonZeroIsFatal", "=", "True", ")", ":", "_location", "=", "join", "(", "_suite", ".", "dir", ",", "'lib'", ",", "'testv8'", ")", "_stack_size", "=", "'3m'", "if", "mx", ".", "get_arch", "(", ")", "in", "(", "'aarch...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-js/mx.graal-js/mx_graal_js.py#L259-L273
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/turtle.py
python
TNavigator.ycor
(self)
return self._position[1]
Return the turtle's y coordinate --- No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print turtle.ycor() 86.6025403784
Return the turtle's y coordinate --- No arguments.
[ "Return", "the", "turtle", "s", "y", "coordinate", "---", "No", "arguments", "." ]
def ycor(self): """ Return the turtle's y coordinate --- No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print turtle.ycor() 86.6025403784 """ return self._pos...
[ "def", "ycor", "(", "self", ")", ":", "return", "self", ".", "_position", "[", "1", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L1729-L1741
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.GetToolchainEnv
(self, additional_settings=None)
return env
Returns the variables toolchain would set for build steps.
Returns the variables toolchain would set for build steps.
[ "Returns", "the", "variables", "toolchain", "would", "set", "for", "build", "steps", "." ]
def GetToolchainEnv(self, additional_settings=None): """Returns the variables toolchain would set for build steps.""" env = self.GetSortedXcodeEnv(additional_settings=additional_settings) if self.flavor == 'win': env = self.GetMsvsToolchainEnv( additional_settings=additional_settings) re...
[ "def", "GetToolchainEnv", "(", "self", ",", "additional_settings", "=", "None", ")", ":", "env", "=", "self", ".", "GetSortedXcodeEnv", "(", "additional_settings", "=", "additional_settings", ")", "if", "self", ".", "flavor", "==", "'win'", ":", "env", "=", ...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/ninja.py#L1391-L1397
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
IdleEvent.RequestMore
(*args, **kwargs)
return _core_.IdleEvent_RequestMore(*args, **kwargs)
RequestMore(self, bool needMore=True) Tells wxWidgets that more processing is required. This function can be called by an EVT_IDLE handler for a window to indicate that the application should forward the EVT_IDLE event once more to the application windows. If no window calls this functi...
RequestMore(self, bool needMore=True)
[ "RequestMore", "(", "self", "bool", "needMore", "=", "True", ")" ]
def RequestMore(*args, **kwargs): """ RequestMore(self, bool needMore=True) Tells wxWidgets that more processing is required. This function can be called by an EVT_IDLE handler for a window to indicate that the application should forward the EVT_IDLE event once more to the ...
[ "def", "RequestMore", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "IdleEvent_RequestMore", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L7456-L7468
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/cmake.py
python
configure_file
(template_file, environment)
Evaluate a .in template file used in CMake with configure_file(). :param template_file: path to the template, ``str`` :param environment: dictionary of placeholders to substitute, ``dict`` :returns: string with evaluates template :raises: KeyError for placeholders in the template which are not ...
Evaluate a .in template file used in CMake with configure_file().
[ "Evaluate", "a", ".", "in", "template", "file", "used", "in", "CMake", "with", "configure_file", "()", "." ]
def configure_file(template_file, environment): ''' Evaluate a .in template file used in CMake with configure_file(). :param template_file: path to the template, ``str`` :param environment: dictionary of placeholders to substitute, ``dict`` :returns: string with evaluates template :raises...
[ "def", "configure_file", "(", "template_file", ",", "environment", ")", ":", "with", "open", "(", "template_file", ",", "'r'", ")", "as", "f", ":", "template", "=", "f", ".", "read", "(", ")", "return", "configure_string", "(", "template", ",", "environmen...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/cmake.py#L50-L63
wujian16/Cornell-MOE
df299d1be882d2af9796d7a68b3f9505cac7a53e
moe/optimal_learning/python/cpp_wrappers/knowledge_gradient_mcmc.py
python
KnowledgeGradientMCMC.compute_grad_knowledge_gradient_mcmc
(self, force_monte_carlo=False)
return grad_knowledge_gradient_mcmc
r"""Compute the gradient of knowledge gradient at ``points_to_sample`` wrt ``points_to_sample``, with ``points_being_sampled`` concurrent samples. .. Note:: These comments were copied from :meth:`moe.optimal_learning.python.interfaces.expected_improvement_interface.ExpectedImprovementInterface.comput...
r"""Compute the gradient of knowledge gradient at ``points_to_sample`` wrt ``points_to_sample``, with ``points_being_sampled`` concurrent samples.
[ "r", "Compute", "the", "gradient", "of", "knowledge", "gradient", "at", "points_to_sample", "wrt", "points_to_sample", "with", "points_being_sampled", "concurrent", "samples", "." ]
def compute_grad_knowledge_gradient_mcmc(self, force_monte_carlo=False): r"""Compute the gradient of knowledge gradient at ``points_to_sample`` wrt ``points_to_sample``, with ``points_being_sampled`` concurrent samples. .. Note:: These comments were copied from :meth:`moe.optimal_learning.pyt...
[ "def", "compute_grad_knowledge_gradient_mcmc", "(", "self", ",", "force_monte_carlo", "=", "False", ")", ":", "grad_knowledge_gradient_mcmc", "=", "C_GP", ".", "compute_grad_knowledge_gradient_mcmc", "(", "self", ".", "_gaussian_process_mcmc", ".", "_gaussian_process_mcmc", ...
https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/knowledge_gradient_mcmc.py#L575-L617
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/mvn_linear_operator.py
python
MultivariateNormalLinearOperator.scale
(self)
return self.bijector.scale
The `scale` `LinearOperator` in `Y = scale @ X + loc`.
The `scale` `LinearOperator` in `Y = scale
[ "The", "scale", "LinearOperator", "in", "Y", "=", "scale" ]
def scale(self): """The `scale` `LinearOperator` in `Y = scale @ X + loc`.""" return self.bijector.scale
[ "def", "scale", "(", "self", ")", ":", "return", "self", ".", "bijector", ".", "scale" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/mvn_linear_operator.py#L214-L216
google/nucleus
68d3947fafba1337f294c0668a6e1c7f3f1273e3
nucleus/util/variant_utils.py
python
has_calls
(variant)
return bool(variant.calls)
Does variant have any genotype calls? Args: variant: nucleus.genomics.v1.Variant. Returns: True if variant has one or more VariantCalls.
Does variant have any genotype calls?
[ "Does", "variant", "have", "any", "genotype", "calls?" ]
def has_calls(variant): """Does variant have any genotype calls? Args: variant: nucleus.genomics.v1.Variant. Returns: True if variant has one or more VariantCalls. """ return bool(variant.calls)
[ "def", "has_calls", "(", "variant", ")", ":", "return", "bool", "(", "variant", ".", "calls", ")" ]
https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/variant_utils.py#L608-L617
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/SimpleXMLRPCServer.py
python
SimpleXMLRPCDispatcher.register_multicall_functions
(self)
Registers the XML-RPC multicall method in the system namespace. see http://www.xmlrpc.com/discuss/msgReader$1208
Registers the XML-RPC multicall method in the system namespace.
[ "Registers", "the", "XML", "-", "RPC", "multicall", "method", "in", "the", "system", "namespace", "." ]
def register_multicall_functions(self): """Registers the XML-RPC multicall method in the system namespace. see http://www.xmlrpc.com/discuss/msgReader$1208""" self.funcs.update({'system.multicall' : self.system_multicall})
[ "def", "register_multicall_functions", "(", "self", ")", ":", "self", ".", "funcs", ".", "update", "(", "{", "'system.multicall'", ":", "self", ".", "system_multicall", "}", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/SimpleXMLRPCServer.py#L233-L239
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py
python
Store.add_field
(self, name, properties, parent_layer, parents_values)
A field is a component of the final color for a layer. Examples include: depth, normal, color, scalar values.
A field is a component of the final color for a layer. Examples include: depth, normal, color, scalar values.
[ "A", "field", "is", "a", "component", "of", "the", "final", "color", "for", "a", "layer", ".", "Examples", "include", ":", "depth", "normal", "color", "scalar", "values", "." ]
def add_field(self, name, properties, parent_layer, parents_values): """ A field is a component of the final color for a layer. Examples include: depth, normal, color, scalar values. """ properties['type'] = 'hidden' properties['role'] = 'field' self.add_parameter...
[ "def", "add_field", "(", "self", ",", "name", ",", "properties", ",", "parent_layer", ",", "parents_values", ")", ":", "properties", "[", "'type'", "]", "=", "'hidden'", "properties", "[", "'role'", "]", "=", "'field'", "self", ".", "add_parameter", "(", "...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py#L513-L521
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/best-team-with-no-conflicts.py
python
Solution4.bestTeamScore
(self, scores, ages)
return max(dp.itervalues())
:type scores: List[int] :type ages: List[int] :rtype: int
:type scores: List[int] :type ages: List[int] :rtype: int
[ ":", "type", "scores", ":", "List", "[", "int", "]", ":", "type", "ages", ":", "List", "[", "int", "]", ":", "rtype", ":", "int" ]
def bestTeamScore(self, scores, ages): """ :type scores: List[int] :type ages: List[int] :rtype: int """ players = sorted(zip(ages, scores)) sorted_scores = sorted(set(scores)) dp = collections.defaultdict(int) result = 0 for age, score in ...
[ "def", "bestTeamScore", "(", "self", ",", "scores", ",", "ages", ")", ":", "players", "=", "sorted", "(", "zip", "(", "ages", ",", "scores", ")", ")", "sorted_scores", "=", "sorted", "(", "set", "(", "scores", ")", ")", "dp", "=", "collections", ".",...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/best-team-with-no-conflicts.py#L151-L163
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/rpc/backend_registry.py
python
backend_registered
(backend_name)
return backend_name in BackendType.__members__.keys()
Checks if backend_name is registered as an RPC backend. Args: backend_name (str): string to identify the RPC backend. Returns: True if the backend has been registered with ``register_backend``, else False.
Checks if backend_name is registered as an RPC backend.
[ "Checks", "if", "backend_name", "is", "registered", "as", "an", "RPC", "backend", "." ]
def backend_registered(backend_name): """ Checks if backend_name is registered as an RPC backend. Args: backend_name (str): string to identify the RPC backend. Returns: True if the backend has been registered with ``register_backend``, else False. """ return backend_name...
[ "def", "backend_registered", "(", "backend_name", ")", ":", "return", "backend_name", "in", "BackendType", ".", "__members__", ".", "keys", "(", ")" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/rpc/backend_registry.py#L37-L47
taskflow/taskflow
f423a100a70b275f6e7331bc96537a3fe172e8d7
3rd-party/tbb/python/tbb/pool.py
python
Pool.join
(self)
Wait for the worker processes to exit. One must call close() or terminate() before using join().
Wait for the worker processes to exit. One must call close() or terminate() before using join().
[ "Wait", "for", "the", "worker", "processes", "to", "exit", ".", "One", "must", "call", "close", "()", "or", "terminate", "()", "before", "using", "join", "()", "." ]
def join(self): """Wait for the worker processes to exit. One must call close() or terminate() before using join().""" self._tasks.wait()
[ "def", "join", "(", "self", ")", ":", "self", ".", "_tasks", ".", "wait", "(", ")" ]
https://github.com/taskflow/taskflow/blob/f423a100a70b275f6e7331bc96537a3fe172e8d7/3rd-party/tbb/python/tbb/pool.py#L220-L223
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
PyApp.GetTraits
(*args, **kwargs)
return _core_.PyApp_GetTraits(*args, **kwargs)
GetTraits(self) -> wxAppTraits Return (and create if necessary) the app traits object to which we delegate for everything which either should be configurable by the user (then he can change the default behaviour simply by overriding CreateTraits() and returning his own traits object) or...
GetTraits(self) -> wxAppTraits
[ "GetTraits", "(", "self", ")", "-", ">", "wxAppTraits" ]
def GetTraits(*args, **kwargs): """ GetTraits(self) -> wxAppTraits Return (and create if necessary) the app traits object to which we delegate for everything which either should be configurable by the user (then he can change the default behaviour simply by overriding Cr...
[ "def", "GetTraits", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PyApp_GetTraits", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L7804-L7817
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/losses.py
python
_ragged_tensor_msle
(y_true, y_pred)
return _ragged_tensor_apply_loss(mean_squared_logarithmic_error, y_true, y_pred)
Implements support for handling RaggedTensors.
Implements support for handling RaggedTensors.
[ "Implements", "support", "for", "handling", "RaggedTensors", "." ]
def _ragged_tensor_msle(y_true, y_pred): """Implements support for handling RaggedTensors.""" return _ragged_tensor_apply_loss(mean_squared_logarithmic_error, y_true, y_pred)
[ "def", "_ragged_tensor_msle", "(", "y_true", ",", "y_pred", ")", ":", "return", "_ragged_tensor_apply_loss", "(", "mean_squared_logarithmic_error", ",", "y_true", ",", "y_pred", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/losses.py#L1439-L1442
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/quaternion.py
python
Quaternion.__mul__
(self, right)
return Quaternion(self[3] * right[3] - self.vec.dot(right.vec), self[3] * right.vec + right[3] * self.vec + self.vec.cross(right.vec))
quaternion multiplication
quaternion multiplication
[ "quaternion", "multiplication" ]
def __mul__(self, right): """ quaternion multiplication """ return Quaternion(self[3] * right[3] - self.vec.dot(right.vec), self[3] * right.vec + right[3] * self.vec + self.vec.cross(right.vec))
[ "def", "__mul__", "(", "self", ",", "right", ")", ":", "return", "Quaternion", "(", "self", "[", "3", "]", "*", "right", "[", "3", "]", "-", "self", ".", "vec", ".", "dot", "(", "right", ".", "vec", ")", ",", "self", "[", "3", "]", "*", "righ...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/quaternion.py#L19-L23
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/functional_ops.py
python
scan
(fn, elems, initializer=None, parallel_iterations=10, back_prop=True, swap_memory=False, infer_shape=True, name=None)
scan on the list of tensors unpacked from `elems` on dimension 0. The simplest version of `scan` repeatedly applies the callable `fn` to a sequence of elements from first to last. The elements are made of the tensors unpacked from `elems` on dimension 0. The callable fn takes two tensors as arguments. The firs...
scan on the list of tensors unpacked from `elems` on dimension 0.
[ "scan", "on", "the", "list", "of", "tensors", "unpacked", "from", "elems", "on", "dimension", "0", "." ]
def scan(fn, elems, initializer=None, parallel_iterations=10, back_prop=True, swap_memory=False, infer_shape=True, name=None): """scan on the list of tensors unpacked from `elems` on dimension 0. The simplest version of `scan` repeatedly applies the callable `fn` to a sequence of elements from first to ...
[ "def", "scan", "(", "fn", ",", "elems", ",", "initializer", "=", "None", ",", "parallel_iterations", "=", "10", ",", "back_prop", "=", "True", ",", "swap_memory", "=", "False", ",", "infer_shape", "=", "True", ",", "name", "=", "None", ")", ":", "if", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/functional_ops.py#L405-L600
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/hmac.py
python
HMAC.copy
(self)
return other
Return a separate copy of this hashing object. An update to this copy won't affect the original object.
Return a separate copy of this hashing object.
[ "Return", "a", "separate", "copy", "of", "this", "hashing", "object", "." ]
def copy(self): """Return a separate copy of this hashing object. An update to this copy won't affect the original object. """ other = self.__class__(_secret_backdoor_key) other.digest_cons = self.digest_cons other.digest_size = self.digest_size other.inner = sel...
[ "def", "copy", "(", "self", ")", ":", "other", "=", "self", ".", "__class__", "(", "_secret_backdoor_key", ")", "other", ".", "digest_cons", "=", "self", ".", "digest_cons", "other", ".", "digest_size", "=", "self", ".", "digest_size", "other", ".", "inner...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/hmac.py#L85-L95
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
PanedWindow.identify
(self, x, y)
return self.tk.call(self._w, 'identify', x, y)
Identify the panedwindow component at point x, y If the point is over a sash or a sash handle, the result is a two element list containing the index of the sash or handle, and a word indicating whether it is over a sash or a handle, such as {0 sash} or {2 handle}. If the point i...
Identify the panedwindow component at point x, y
[ "Identify", "the", "panedwindow", "component", "at", "point", "x", "y" ]
def identify(self, x, y): """Identify the panedwindow component at point x, y If the point is over a sash or a sash handle, the result is a two element list containing the index of the sash or handle, and a word indicating whether it is over a sash or a handle, such as {0 sash} ...
[ "def", "identify", "(", "self", ",", "x", ",", "y", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'identify'", ",", "x", ",", "y", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3587-L3597
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
LogStderr.__init__
(self, *args, **kwargs)
__init__(self) -> LogStderr
__init__(self) -> LogStderr
[ "__init__", "(", "self", ")", "-", ">", "LogStderr" ]
def __init__(self, *args, **kwargs): """__init__(self) -> LogStderr""" _misc_.LogStderr_swiginit(self,_misc_.new_LogStderr(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_misc_", ".", "LogStderr_swiginit", "(", "self", ",", "_misc_", ".", "new_LogStderr", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1740-L1742
stack-of-tasks/pinocchio
593d4d43fded997bb9aa2421f4e55294dbd233c4
bindings/python/pinocchio/visualize/gepetto_visualizer.py
python
GepettoVisualizer.displayCollisions
(self,visibility)
Set whether to display collision objects or not
Set whether to display collision objects or not
[ "Set", "whether", "to", "display", "collision", "objects", "or", "not" ]
def displayCollisions(self,visibility): """Set whether to display collision objects or not""" gui = self.viewer.gui self.display_collisions = visibility if self.collision_model is None: return if visibility: visibility_mode = "ON" else: visibility...
[ "def", "displayCollisions", "(", "self", ",", "visibility", ")", ":", "gui", "=", "self", ".", "viewer", ".", "gui", "self", ".", "display_collisions", "=", "visibility", "if", "self", ".", "collision_model", "is", "None", ":", "return", "if", "visibility", ...
https://github.com/stack-of-tasks/pinocchio/blob/593d4d43fded997bb9aa2421f4e55294dbd233c4/bindings/python/pinocchio/visualize/gepetto_visualizer.py#L192-L205
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/symbol/symbol.py
python
Symbol.__mul__
(self, other)
x.__mul__(y) <=> x*y Scalar input is supported. Broadcasting is not supported. Use `broadcast_mul` instead.
x.__mul__(y) <=> x*y
[ "x", ".", "__mul__", "(", "y", ")", "<", "=", ">", "x", "*", "y" ]
def __mul__(self, other): """x.__mul__(y) <=> x*y Scalar input is supported. Broadcasting is not supported. Use `broadcast_mul` instead. """ if isinstance(other, Symbol): return _internal._Mul(self, other) if isinstance(other, Number): return _internal._M...
[ "def", "__mul__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "Symbol", ")", ":", "return", "_internal", ".", "_Mul", "(", "self", ",", "other", ")", "if", "isinstance", "(", "other", ",", "Number", ")", ":", "return",...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/symbol.py#L142-L152
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/gyp/dist_aar.py
python
_MergeRTxt
(r_paths, include_globs)
return ''.join(sorted(all_lines))
Merging the given R.txt files and returns them as a string.
Merging the given R.txt files and returns them as a string.
[ "Merging", "the", "given", "R", ".", "txt", "files", "and", "returns", "them", "as", "a", "string", "." ]
def _MergeRTxt(r_paths, include_globs): """Merging the given R.txt files and returns them as a string.""" all_lines = set() for r_path in r_paths: if include_globs and not build_utils.MatchesGlob(r_path, include_globs): continue with open(r_path) as f: all_lines.update(f.readlines()) return ...
[ "def", "_MergeRTxt", "(", "r_paths", ",", "include_globs", ")", ":", "all_lines", "=", "set", "(", ")", "for", "r_path", "in", "r_paths", ":", "if", "include_globs", "and", "not", "build_utils", ".", "MatchesGlob", "(", "r_path", ",", "include_globs", ")", ...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/dist_aar.py#L24-L32
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/bindings/python/MythTV/system.py
python
Grabber.search
(self, phrase, subtitle=None, tolerance=None, func=None)
obj.search(phrase, subtitle=None, tolerance=None) -> result generator Returns a generator of results matching the given search phrase. A secondary phrase can be given through the 'subtitle' parameter, and an optional levenshtein tolerance value can be given ...
obj.search(phrase, subtitle=None, tolerance=None) -> result generator
[ "obj", ".", "search", "(", "phrase", "subtitle", "=", "None", "tolerance", "=", "None", ")", "-", ">", "result", "generator" ]
def search(self, phrase, subtitle=None, tolerance=None, func=None): """ obj.search(phrase, subtitle=None, tolerance=None) -> result generator Returns a generator of results matching the given search phrase. A secondary phrase can be given through the 'subtit...
[ "def", "search", "(", "self", ",", "phrase", ",", "subtitle", "=", "None", ",", "tolerance", "=", "None", ",", "func", "=", "None", ")", ":", "if", "not", "func", ":", "if", "subtitle", "is", "not", "None", ":", "func", "=", "lambda", "p", ",", "...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/system.py#L353-L383
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/linalg/linalg.py
python
lstsq
(a, b, rcond="warn")
return wrap(x), wrap(resids), rank, s
r""" Return the least-squares solution to a linear matrix equation. Solves the equation :math:`a x = b` by computing a vector `x` that minimizes the squared Euclidean 2-norm :math:`\| b - a x \|^2_2`. The equation may be under-, well-, or over-determined (i.e., the number of linearly independent ro...
r""" Return the least-squares solution to a linear matrix equation.
[ "r", "Return", "the", "least", "-", "squares", "solution", "to", "a", "linear", "matrix", "equation", "." ]
def lstsq(a, b, rcond="warn"): r""" Return the least-squares solution to a linear matrix equation. Solves the equation :math:`a x = b` by computing a vector `x` that minimizes the squared Euclidean 2-norm :math:`\| b - a x \|^2_2`. The equation may be under-, well-, or over-determined (i.e., the ...
[ "def", "lstsq", "(", "a", ",", "b", ",", "rcond", "=", "\"warn\"", ")", ":", "a", ",", "_", "=", "_makearray", "(", "a", ")", "b", ",", "wrap", "=", "_makearray", "(", "b", ")", "is_1d", "=", "b", ".", "ndim", "==", "1", "if", "is_1d", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/linalg/linalg.py#L2128-L2281