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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/shlex.py
python
shlex.error_leader
(self, infile=None, lineno=None)
return "\"%s\", line %d: " % (infile, lineno)
Emit a C-compiler-like, Emacs-friendly error-message leader.
Emit a C-compiler-like, Emacs-friendly error-message leader.
[ "Emit", "a", "C", "-", "compiler", "-", "like", "Emacs", "-", "friendly", "error", "-", "message", "leader", "." ]
def error_leader(self, infile=None, lineno=None): "Emit a C-compiler-like, Emacs-friendly error-message leader." if infile is None: infile = self.infile if lineno is None: lineno = self.lineno return "\"%s\", line %d: " % (infile, lineno)
[ "def", "error_leader", "(", "self", ",", "infile", "=", "None", ",", "lineno", "=", "None", ")", ":", "if", "infile", "is", "None", ":", "infile", "=", "self", ".", "infile", "if", "lineno", "is", "None", ":", "lineno", "=", "self", ".", "lineno", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/shlex.py#L287-L293
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/ops.py
python
get_collection_proto_type
(collection_name)
Returns the proto_type for collection_name.
Returns the proto_type for collection_name.
[ "Returns", "the", "proto_type", "for", "collection_name", "." ]
def get_collection_proto_type(collection_name): """Returns the proto_type for collection_name.""" try: return _proto_function_registry.lookup(collection_name)[0] except LookupError: return None
[ "def", "get_collection_proto_type", "(", "collection_name", ")", ":", "try", ":", "return", "_proto_function_registry", ".", "lookup", "(", "collection_name", ")", "[", "0", "]", "except", "LookupError", ":", "return", "None" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L4063-L4068
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/misc.py
python
FactorScheduler.__call__
(self, iteration)
return lr
Call to schedule current learning rate. Parameters ---------- iteration: int Current iteration count.
Call to schedule current learning rate.
[ "Call", "to", "schedule", "current", "learning", "rate", "." ]
def __call__(self, iteration): """ Call to schedule current learning rate. Parameters ---------- iteration: int Current iteration count. """ if not self.init: self.init = True self.old_lr = self.base_lr lr = self.base_...
[ "def", "__call__", "(", "self", ",", "iteration", ")", ":", "if", "not", "self", ".", "init", ":", "self", ".", "init", "=", "True", "self", ".", "old_lr", "=", "self", ".", "base_lr", "lr", "=", "self", ".", "base_lr", "*", "math", ".", "pow", "...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/misc.py#L62-L80
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ipynb.py
python
_get_code
(input_file)
return raw_code, notebook
Loads the ipynb file and returns a list of CodeLines.
Loads the ipynb file and returns a list of CodeLines.
[ "Loads", "the", "ipynb", "file", "and", "returns", "a", "list", "of", "CodeLines", "." ]
def _get_code(input_file): """Loads the ipynb file and returns a list of CodeLines.""" raw_code = [] with open(input_file) as in_file: notebook = json.load(in_file) cell_index = 0 for cell in notebook["cells"]: if is_python(cell): cell_lines = cell["source"] is_line_split = False ...
[ "def", "_get_code", "(", "input_file", ")", ":", "raw_code", "=", "[", "]", "with", "open", "(", "input_file", ")", "as", "in_file", ":", "notebook", "=", "json", ".", "load", "(", "in_file", ")", "cell_index", "=", "0", "for", "cell", "in", "notebook"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/compatibility/ipynb.py#L103-L145
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/distutils/misc_util.py
python
general_source_directories_files
(top_path)
Return a directory name relative to top_path and files contained.
Return a directory name relative to top_path and files contained.
[ "Return", "a", "directory", "name", "relative", "to", "top_path", "and", "files", "contained", "." ]
def general_source_directories_files(top_path): """Return a directory name relative to top_path and files contained. """ pruned_directories = ['CVS','.svn','build'] prune_file_pat = re.compile(r'(?:[~#]|\.py[co]|\.o)$') for dirpath, dirnames, filenames in os.walk(top_path, topdown=True): ...
[ "def", "general_source_directories_files", "(", "top_path", ")", ":", "pruned_directories", "=", "[", "'CVS'", ",", "'.svn'", ",", "'build'", "]", "prune_file_pat", "=", "re", ".", "compile", "(", "r'(?:[~#]|\\.py[co]|\\.o)$'", ")", "for", "dirpath", ",", "dirname...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/distutils/misc_util.py#L529-L552
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/SConsign.py
python
File
(name, dbm_module=None)
Arrange for all signatures to be stored in a global .sconsign.db* file.
Arrange for all signatures to be stored in a global .sconsign.db* file.
[ "Arrange", "for", "all", "signatures", "to", "be", "stored", "in", "a", "global", ".", "sconsign", ".", "db", "*", "file", "." ]
def File(name, dbm_module=None): """ Arrange for all signatures to be stored in a global .sconsign.db* file. """ global ForDirectory, DB_Name, DB_Module if name is None: ForDirectory = DirFile DB_Module = None else: ForDirectory = DB DB_Name = name if ...
[ "def", "File", "(", "name", ",", "dbm_module", "=", "None", ")", ":", "global", "ForDirectory", ",", "DB_Name", ",", "DB_Module", "if", "name", "is", "None", ":", "ForDirectory", "=", "DirFile", "DB_Module", "=", "None", "else", ":", "ForDirectory", "=", ...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/SConsign.py#L408-L421
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py
python
IResourceProvider.get_resource_filename
(manager, resource_name)
Return a true filesystem path for `resource_name` `manager` must be an ``IResourceManager``
Return a true filesystem path for `resource_name`
[ "Return", "a", "true", "filesystem", "path", "for", "resource_name" ]
def get_resource_filename(manager, resource_name): """Return a true filesystem path for `resource_name` `manager` must be an ``IResourceManager``"""
[ "def", "get_resource_filename", "(", "manager", ",", "resource_name", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L611-L614
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
WeightedCategoricalColumn.parse_example_spec
(self)
return config
See `FeatureColumn` base class.
See `FeatureColumn` base class.
[ "See", "FeatureColumn", "base", "class", "." ]
def parse_example_spec(self): """See `FeatureColumn` base class.""" config = self.categorical_column.parse_example_spec if self.weight_feature_key in config: raise ValueError('Parse config {} already exists for {}.'.format( config[self.weight_feature_key], self.weight_feature_key)) confi...
[ "def", "parse_example_spec", "(", "self", ")", ":", "config", "=", "self", ".", "categorical_column", ".", "parse_example_spec", "if", "self", ".", "weight_feature_key", "in", "config", ":", "raise", "ValueError", "(", "'Parse config {} already exists for {}.'", ".", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L3936-L3943
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/apitools/samples/storage_sample/storage/storage_v1.py
python
ObjectAccessControlsInsert.RunWithArgs
(self, bucket, object)
Creates a new ACL entry on the specified object. Args: bucket: Name of a bucket. object: Name of the object. Flags: generation: If present, selects a specific revision of this object (as opposed to the latest version, the default). objectAccessControl: A ObjectAccessControl res...
Creates a new ACL entry on the specified object.
[ "Creates", "a", "new", "ACL", "entry", "on", "the", "specified", "object", "." ]
def RunWithArgs(self, bucket, object): """Creates a new ACL entry on the specified object. Args: bucket: Name of a bucket. object: Name of the object. Flags: generation: If present, selects a specific revision of this object (as opposed to the latest version, the default). ...
[ "def", "RunWithArgs", "(", "self", ",", "bucket", ",", "object", ")", ":", "client", "=", "GetClientFromFlags", "(", ")", "global_params", "=", "GetGlobalParamsFromFlags", "(", ")", "request", "=", "messages", ".", "StorageObjectAccessControlsInsertRequest", "(", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/samples/storage_sample/storage/storage_v1.py#L1705-L1730
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/dynamodb/conditions.py
python
Attr.contains
(self, value)
return Contains(self, value)
Creates a condition where the attribute contains the value. :param value: The value the attribute contains.
Creates a condition where the attribute contains the value.
[ "Creates", "a", "condition", "where", "the", "attribute", "contains", "the", "value", "." ]
def contains(self, value): """Creates a condition where the attribute contains the value. :param value: The value the attribute contains. """ return Contains(self, value)
[ "def", "contains", "(", "self", ",", "value", ")", ":", "return", "Contains", "(", "self", ",", "value", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/dynamodb/conditions.py#L266-L271
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/util.py
python
strip_prefix_from_items
(prefix, items)
return items_no_prefix
Strips out the prefix from each of the items if it is present. Args: prefix: the string for that you wish to strip from the beginning of each of the items. items: a list of strings that may or may not contain the prefix you want to strip out. Returns: items_no_prefix: a copy of the list of...
Strips out the prefix from each of the items if it is present.
[ "Strips", "out", "the", "prefix", "from", "each", "of", "the", "items", "if", "it", "is", "present", "." ]
def strip_prefix_from_items(prefix, items): """Strips out the prefix from each of the items if it is present. Args: prefix: the string for that you wish to strip from the beginning of each of the items. items: a list of strings that may or may not contain the prefix you want to strip out. Re...
[ "def", "strip_prefix_from_items", "(", "prefix", ",", "items", ")", ":", "items_no_prefix", "=", "[", "]", "for", "item", "in", "items", ":", "if", "item", ".", "startswith", "(", "prefix", ")", ":", "items_no_prefix", ".", "append", "(", "item", "[", "l...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/util.py#L412-L431
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/ndimage/filters.py
python
correlate
(input, weights, output=None, mode='reflect', cval=0.0, origin=0)
return _correlate_or_convolve(input, weights, output, mode, cval, origin, False)
Multi-dimensional correlation. The array is correlated with the given kernel. Parameters ---------- %(input)s weights : ndarray array of weights, same number of dimensions as input %(output)s %(mode_multiple)s %(cval)s %(origin_multiple)s See Also -------- conv...
Multi-dimensional correlation.
[ "Multi", "-", "dimensional", "correlation", "." ]
def correlate(input, weights, output=None, mode='reflect', cval=0.0, origin=0): """ Multi-dimensional correlation. The array is correlated with the given kernel. Parameters ---------- %(input)s weights : ndarray array of weights, same number of dimensions as input ...
[ "def", "correlate", "(", "input", ",", "weights", ",", "output", "=", "None", ",", "mode", "=", "'reflect'", ",", "cval", "=", "0.0", ",", "origin", "=", "0", ")", ":", "return", "_correlate_or_convolve", "(", "input", ",", "weights", ",", "output", ",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/ndimage/filters.py#L617-L639
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/wire_format.py
python
_VarUInt64ByteSizeNoTag
(uint64)
return 10
Returns the number of bytes required to serialize a single varint using boundary value comparisons. (unrolled loop optimization -WPierce) uint64 must be unsigned.
Returns the number of bytes required to serialize a single varint using boundary value comparisons. (unrolled loop optimization -WPierce) uint64 must be unsigned.
[ "Returns", "the", "number", "of", "bytes", "required", "to", "serialize", "a", "single", "varint", "using", "boundary", "value", "comparisons", ".", "(", "unrolled", "loop", "optimization", "-", "WPierce", ")", "uint64", "must", "be", "unsigned", "." ]
def _VarUInt64ByteSizeNoTag(uint64): """Returns the number of bytes required to serialize a single varint using boundary value comparisons. (unrolled loop optimization -WPierce) uint64 must be unsigned. """ if uint64 <= 0x7f: return 1 if uint64 <= 0x3fff: return 2 if uint64 <= 0x1fffff: return 3 if uint...
[ "def", "_VarUInt64ByteSizeNoTag", "(", "uint64", ")", ":", "if", "uint64", "<=", "0x7f", ":", "return", "1", "if", "uint64", "<=", "0x3fff", ":", "return", "2", "if", "uint64", "<=", "0x1fffff", ":", "return", "3", "if", "uint64", "<=", "0xfffffff", ":",...
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/wire_format.py#L232-L248
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/python_gflags/gflags.py
python
FlagValues.__RenderOurModuleKeyFlags
(self, module, output_lines, prefix="")
Generates a help string for the key flags of a given module. Args: module: A module object or a module name (a string). output_lines: A list of strings. The generated help message lines will be appended to this list. prefix: A string that is prepended to each generated help line.
Generates a help string for the key flags of a given module.
[ "Generates", "a", "help", "string", "for", "the", "key", "flags", "of", "a", "given", "module", "." ]
def __RenderOurModuleKeyFlags(self, module, output_lines, prefix=""): """Generates a help string for the key flags of a given module. Args: module: A module object or a module name (a string). output_lines: A list of strings. The generated help message lines will be appended to this list. ...
[ "def", "__RenderOurModuleKeyFlags", "(", "self", ",", "module", ",", "output_lines", ",", "prefix", "=", "\"\"", ")", ":", "key_flags", "=", "self", ".", "_GetKeyFlagsForModule", "(", "module", ")", "if", "key_flags", ":", "self", ".", "__RenderModuleFlags", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/python_gflags/gflags.py#L1402-L1413
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/debug/cli/debugger_cli_common.py
python
CommandHistory.add_command
(self, command)
Add a command to the command history. Args: command: The history command, as a str. Raises: TypeError: if command is not a str.
Add a command to the command history.
[ "Add", "a", "command", "to", "the", "command", "history", "." ]
def add_command(self, command): """Add a command to the command history. Args: command: The history command, as a str. Raises: TypeError: if command is not a str. """ if not isinstance(command, str): raise TypeError("Attempt to enter non-str entry to command history") self....
[ "def", "add_command", "(", "self", ",", "command", ")", ":", "if", "not", "isinstance", "(", "command", ",", "str", ")", ":", "raise", "TypeError", "(", "\"Attempt to enter non-str entry to command history\"", ")", "self", ".", "_commands", ".", "append", "(", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/debug/cli/debugger_cli_common.py#L705-L721
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/file_util.py
python
path_exists
(name)
return os.path.exists(name)
Returns true if the path currently exists.
Returns true if the path currently exists.
[ "Returns", "true", "if", "the", "path", "currently", "exists", "." ]
def path_exists(name): """ Returns true if the path currently exists. """ return os.path.exists(name)
[ "def", "path_exists", "(", "name", ")", ":", "return", "os", ".", "path", ".", "exists", "(", "name", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/file_util.py#L39-L41
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/bundlebuilder.py
python
symlink
(src, dst, mkdirs=0)
Copy a file or a directory.
Copy a file or a directory.
[ "Copy", "a", "file", "or", "a", "directory", "." ]
def symlink(src, dst, mkdirs=0): """Copy a file or a directory.""" if not os.path.exists(src): raise IOError, "No such file or directory: '%s'" % src if mkdirs: makedirs(os.path.dirname(dst)) os.symlink(os.path.abspath(src), dst)
[ "def", "symlink", "(", "src", ",", "dst", ",", "mkdirs", "=", "0", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "src", ")", ":", "raise", "IOError", ",", "\"No such file or directory: '%s'\"", "%", "src", "if", "mkdirs", ":", "makedirs...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/bundlebuilder.py#L781-L787
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ribbon/panel.py
python
RibbonPanel.HideExpanded
(self)
return True
Hide the panel's external expansion. :returns: ``True`` if the panel was un-expanded, ``False`` if it was not (normally due to it not being expanded in the first place). :see: :meth:`~RibbonPanel.HideExpanded`, :meth:`~RibbonPanel.GetExpandedPanel`
Hide the panel's external expansion.
[ "Hide", "the", "panel", "s", "external", "expansion", "." ]
def HideExpanded(self): """ Hide the panel's external expansion. :returns: ``True`` if the panel was un-expanded, ``False`` if it was not (normally due to it not being expanded in the first place). :see: :meth:`~RibbonPanel.HideExpanded`, :meth:`~RibbonPanel.GetExpand...
[ "def", "HideExpanded", "(", "self", ")", ":", "if", "self", ".", "_expanded_dummy", "==", "None", ":", "if", "self", ".", "_expanded_panel", ":", "return", "self", ".", "_expanded_panel", ".", "HideExpanded", "(", ")", "else", ":", "return", "False", "# Mo...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/panel.py#L1016-L1047
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py
python
AddrlistClass.getrouteaddr
(self)
return adlist
Parse a route address (Return-path value). This method just skips all the route stuff and returns the addrspec.
Parse a route address (Return-path value).
[ "Parse", "a", "route", "address", "(", "Return", "-", "path", "value", ")", "." ]
def getrouteaddr(self): """Parse a route address (Return-path value). This method just skips all the route stuff and returns the addrspec. """ if self.field[self.pos] != '<': return expectroute = False self.pos += 1 self.gotonext() adlist = '...
[ "def", "getrouteaddr", "(", "self", ")", ":", "if", "self", ".", "field", "[", "self", ".", "pos", "]", "!=", "'<'", ":", "return", "expectroute", "=", "False", "self", ".", "pos", "+=", "1", "self", ".", "gotonext", "(", ")", "adlist", "=", "''", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_parseaddr.py#L319-L349
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/saving/functional_saver.py
python
_SingleDeviceSaver.save
(self, file_prefix)
Save the saveable objects to a checkpoint with `file_prefix`. Args: file_prefix: A string or scalar string Tensor containing the prefix to save under. Returns: An `Operation`, or None when executing eagerly.
Save the saveable objects to a checkpoint with `file_prefix`.
[ "Save", "the", "saveable", "objects", "to", "a", "checkpoint", "with", "file_prefix", "." ]
def save(self, file_prefix): """Save the saveable objects to a checkpoint with `file_prefix`. Args: file_prefix: A string or scalar string Tensor containing the prefix to save under. Returns: An `Operation`, or None when executing eagerly. """ tensor_names = [] tensors = [] ...
[ "def", "save", "(", "self", ",", "file_prefix", ")", ":", "tensor_names", "=", "[", "]", "tensors", "=", "[", "]", "tensor_slices", "=", "[", "]", "for", "saveable", "in", "self", ".", "_saveable_objects", ":", "for", "spec", "in", "saveable", ".", "sp...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/saving/functional_saver.py#L54-L72
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/http/client.py
python
HTTPConnection._validate_path
(self, url)
Validate a url for putrequest.
Validate a url for putrequest.
[ "Validate", "a", "url", "for", "putrequest", "." ]
def _validate_path(self, url): """Validate a url for putrequest.""" # Prevent CVE-2019-9740. match = _contains_disallowed_url_pchar_re.search(url) if match: raise InvalidURL(f"URL can't contain control characters. {url!r} " f"(found at least {matc...
[ "def", "_validate_path", "(", "self", ",", "url", ")", ":", "# Prevent CVE-2019-9740.", "match", "=", "_contains_disallowed_url_pchar_re", ".", "search", "(", "url", ")", "if", "match", ":", "raise", "InvalidURL", "(", "f\"URL can't contain control characters. {url!r} \...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/client.py#L1217-L1223
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
llvm/bindings/python/llvm/core.py
python
Module.datalayout
(self, new_data_layout)
new_data_layout is a string.
new_data_layout is a string.
[ "new_data_layout", "is", "a", "string", "." ]
def datalayout(self, new_data_layout): """new_data_layout is a string.""" lib.LLVMSetDataLayout(self, new_data_layout)
[ "def", "datalayout", "(", "self", ",", "new_data_layout", ")", ":", "lib", ".", "LLVMSetDataLayout", "(", "self", ",", "new_data_layout", ")" ]
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/llvm/bindings/python/llvm/core.py#L212-L214
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/boosted_trees/lib/learner/batch/ordinal_split_handler.py
python
DenseSplitHandler.make_splits
(self, stamp_token, next_stamp_token, class_id)
return are_splits_ready, partition_ids, gains, split_infos
Create the best split using the accumulated stats and flush the state.
Create the best split using the accumulated stats and flush the state.
[ "Create", "the", "best", "split", "using", "the", "accumulated", "stats", "and", "flush", "the", "state", "." ]
def make_splits(self, stamp_token, next_stamp_token, class_id): """Create the best split using the accumulated stats and flush the state.""" if (self._gradient_shape.rank == 0 and self._hessian_shape.rank == 0): handler = make_dense_split_scalar else: handler = make_dense_split_tensor are_s...
[ "def", "make_splits", "(", "self", ",", "stamp_token", ",", "next_stamp_token", ",", "class_id", ")", ":", "if", "(", "self", ".", "_gradient_shape", ".", "rank", "==", "0", "and", "self", ".", "_hessian_shape", ".", "rank", "==", "0", ")", ":", "handler...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/boosted_trees/lib/learner/batch/ordinal_split_handler.py#L261-L276
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
_CppLintState.SetCountingStyle
(self, counting_style)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style
[ "def", "SetCountingStyle", "(", "self", ",", "counting_style", ")", ":", "self", ".", "counting", "=", "counting_style" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L577-L579
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TFlt.__init__
(self, *args)
__init__(TFlt self) -> TFlt __init__(TFlt self, double const & _Val) -> TFlt Parameters: _Val: double const & __init__(TFlt self, TSIn SIn) -> TFlt Parameters: SIn: TSIn & __init__(TFlt self, TSIn SIn, bool const & IsTxt) -> TFlt Parameters: ...
__init__(TFlt self) -> TFlt __init__(TFlt self, double const & _Val) -> TFlt
[ "__init__", "(", "TFlt", "self", ")", "-", ">", "TFlt", "__init__", "(", "TFlt", "self", "double", "const", "&", "_Val", ")", "-", ">", "TFlt" ]
def __init__(self, *args): """ __init__(TFlt self) -> TFlt __init__(TFlt self, double const & _Val) -> TFlt Parameters: _Val: double const & __init__(TFlt self, TSIn SIn) -> TFlt Parameters: SIn: TSIn & __init__(TFlt self, TSIn SIn, bo...
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_snap", ".", "TFlt_swiginit", "(", "self", ",", "_snap", ".", "new_TFlt", "(", "*", "args", ")", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L14207-L14227
openweave/openweave-core
11ceb6b7efd39fe05de7f79229247a5774d56766
src/tools/factory-prov-tool/WeaveTLV.py
python
TLVWriter.startStructure
(self, tag)
Start writing a TLV structure with the specified TLV tag.
Start writing a TLV structure with the specified TLV tag.
[ "Start", "writing", "a", "TLV", "structure", "with", "the", "specified", "TLV", "tag", "." ]
def startStructure(self, tag): '''Start writing a TLV structure with the specified TLV tag.''' self.startContainer(tag, containerType=TLVType_Structure)
[ "def", "startStructure", "(", "self", ",", "tag", ")", ":", "self", ".", "startContainer", "(", "tag", ",", "containerType", "=", "TLVType_Structure", ")" ]
https://github.com/openweave/openweave-core/blob/11ceb6b7efd39fe05de7f79229247a5774d56766/src/tools/factory-prov-tool/WeaveTLV.py#L235-L237
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/utils/lui/lldbutil.py
python
run_break_set_by_source_regexp
( test, regexp, extra_options=None, num_expected_locations=-1)
return get_bpno_from_match(break_results)
Set a breakpoint by source regular expression. Common options are the same as run_break_set_by_file_and_line.
Set a breakpoint by source regular expression. Common options are the same as run_break_set_by_file_and_line.
[ "Set", "a", "breakpoint", "by", "source", "regular", "expression", ".", "Common", "options", "are", "the", "same", "as", "run_break_set_by_file_and_line", "." ]
def run_break_set_by_source_regexp( test, regexp, extra_options=None, num_expected_locations=-1): """Set a breakpoint by source regular expression. Common options are the same as run_break_set_by_file_and_line.""" command = 'breakpoint set -p "%s"' % (regexp) if extra_option...
[ "def", "run_break_set_by_source_regexp", "(", "test", ",", "regexp", ",", "extra_options", "=", "None", ",", "num_expected_locations", "=", "-", "1", ")", ":", "command", "=", "'breakpoint set -p \"%s\"'", "%", "(", "regexp", ")", "if", "extra_options", ":", "co...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/utils/lui/lldbutil.py#L459-L476
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/linalg/interpolative.py
python
seed
(seed=None)
Seed the internal random number generator used in this ID package. The generator is a lagged Fibonacci method with 55-element internal state. Parameters ---------- seed : int, sequence, 'default', optional If 'default', the random seed is reset to a default value. If `seed` is a seque...
Seed the internal random number generator used in this ID package.
[ "Seed", "the", "internal", "random", "number", "generator", "used", "in", "this", "ID", "package", "." ]
def seed(seed=None): """ Seed the internal random number generator used in this ID package. The generator is a lagged Fibonacci method with 55-element internal state. Parameters ---------- seed : int, sequence, 'default', optional If 'default', the random seed is reset to a default val...
[ "def", "seed", "(", "seed", "=", "None", ")", ":", "# For details, see :func:`backend.id_srand`, :func:`backend.id_srandi`,", "# and :func:`backend.id_srando`.", "if", "isinstance", "(", "seed", ",", "str", ")", "and", "seed", "==", "'default'", ":", "backend", ".", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/interpolative.py#L403-L442
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/base/role_maker.py
python
RoleMakerBase._get_pserver_endpoints
(self)
return self._server_endpoints
return pserver endpoints
return pserver endpoints
[ "return", "pserver", "endpoints" ]
def _get_pserver_endpoints(self): """ return pserver endpoints """ return self._server_endpoints
[ "def", "_get_pserver_endpoints", "(", "self", ")", ":", "return", "self", ".", "_server_endpoints" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/base/role_maker.py#L458-L462
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/generator.py
python
_generate_source
(spec, target_arch, file_name, header_file_name)
Generate a C++ source file.
Generate a C++ source file.
[ "Generate", "a", "C", "++", "source", "file", "." ]
def _generate_source(spec, target_arch, file_name, header_file_name): # type: (ast.IDLAST, str, str, str) -> None """Generate a C++ source file.""" str_value = generate_source_str(spec, target_arch, header_file_name) # Generate structs with io.open(file_name, mode='wb') as file_handle: file...
[ "def", "_generate_source", "(", "spec", ",", "target_arch", ",", "file_name", ",", "header_file_name", ")", ":", "# type: (ast.IDLAST, str, str, str) -> None", "str_value", "=", "generate_source_str", "(", "spec", ",", "target_arch", ",", "header_file_name", ")", "# Gen...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L2744-L2751
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/heapq.py
python
_heappop_max
(heap)
return lastelt
Maxheap version of a heappop.
Maxheap version of a heappop.
[ "Maxheap", "version", "of", "a", "heappop", "." ]
def _heappop_max(heap): """Maxheap version of a heappop.""" lastelt = heap.pop() # raises appropriate IndexError if heap is empty if heap: returnitem = heap[0] heap[0] = lastelt _siftup_max(heap, 0) return returnitem return lastelt
[ "def", "_heappop_max", "(", "heap", ")", ":", "lastelt", "=", "heap", ".", "pop", "(", ")", "# raises appropriate IndexError if heap is empty", "if", "heap", ":", "returnitem", "=", "heap", "[", "0", "]", "heap", "[", "0", "]", "=", "lastelt", "_siftup_max",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/heapq.py#L179-L187
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/inputsplitter.py
python
IPythonInputSplitter.transform_cell
(self, cell)
Process and translate a cell of input.
Process and translate a cell of input.
[ "Process", "and", "translate", "a", "cell", "of", "input", "." ]
def transform_cell(self, cell): """Process and translate a cell of input. """ self.reset() try: self.push(cell) self.flush_transformers() return self.source finally: self.reset()
[ "def", "transform_cell", "(", "self", ",", "cell", ")", ":", "self", ".", "reset", "(", ")", "try", ":", "self", ".", "push", "(", "cell", ")", "self", ".", "flush_transformers", "(", ")", "return", "self", ".", "source", "finally", ":", "self", ".",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/inputsplitter.py#L592-L601
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/ctrlbox.py
python
SegmentBar.OnEnter
(self, evt)
Mouse has entered the SegmentBar, update state info
Mouse has entered the SegmentBar, update state info
[ "Mouse", "has", "entered", "the", "SegmentBar", "update", "state", "info" ]
def OnEnter(self, evt): """Mouse has entered the SegmentBar, update state info""" evt.Skip()
[ "def", "OnEnter", "(", "self", ",", "evt", ")", ":", "evt", ".", "Skip", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/ctrlbox.py#L1007-L1009
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
compiler-rt/lib/asan/scripts/asan_symbolize.py
python
AsanSymbolizerPlugIn.destroy
(self)
Hook called when a plugin is about to be destroyed. Implementations should free any allocated resources here.
Hook called when a plugin is about to be destroyed. Implementations should free any allocated resources here.
[ "Hook", "called", "when", "a", "plugin", "is", "about", "to", "be", "destroyed", ".", "Implementations", "should", "free", "any", "allocated", "resources", "here", "." ]
def destroy(self): """ Hook called when a plugin is about to be destroyed. Implementations should free any allocated resources here. """ pass
[ "def", "destroy", "(", "self", ")", ":", "pass" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/compiler-rt/lib/asan/scripts/asan_symbolize.py#L683-L688
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/metrics_impl.py
python
_streaming_sparse_average_precision_at_top_k
(labels, predictions_idx, weights=None, metrics_collections=None, updates_collections=None, ...
Computes average precision@k of predictions with respect to sparse labels. `sparse_average_precision_at_top_k` creates two local variables, `average_precision_at_<k>/total` and `average_precision_at_<k>/max`, that are used to compute the frequency. This frequency is ultimately returned as `average_precision_at...
Computes average precision@k of predictions with respect to sparse labels.
[ "Computes", "average", "precision@k", "of", "predictions", "with", "respect", "to", "sparse", "labels", "." ]
def _streaming_sparse_average_precision_at_top_k(labels, predictions_idx, weights=None, metrics_collections=None, updates_co...
[ "def", "_streaming_sparse_average_precision_at_top_k", "(", "labels", ",", "predictions_idx", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/metrics_impl.py#L2409-L2499
schwehr/libais
1e19605942c8e155cd02fde6d1acde75ecd15d75
ais/nmea.py
python
_Checksum
(sentence)
return checksum_str.upper()
Compute the NMEA checksum for a payload.
Compute the NMEA checksum for a payload.
[ "Compute", "the", "NMEA", "checksum", "for", "a", "payload", "." ]
def _Checksum(sentence): """Compute the NMEA checksum for a payload.""" checksum = 0 for char in sentence: checksum ^= ord(char) checksum_str = '%02x' % checksum return checksum_str.upper()
[ "def", "_Checksum", "(", "sentence", ")", ":", "checksum", "=", "0", "for", "char", "in", "sentence", ":", "checksum", "^=", "ord", "(", "char", ")", "checksum_str", "=", "'%02x'", "%", "checksum", "return", "checksum_str", ".", "upper", "(", ")" ]
https://github.com/schwehr/libais/blob/1e19605942c8e155cd02fde6d1acde75ecd15d75/ais/nmea.py#L36-L42
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py
python
ResourceManager.postprocess
(self, tempname, filename)
Perform any platform-specific postprocessing of `tempname` This is where Mac header rewrites should be done; other platforms don't have anything special they should do. Resource providers should call this method ONLY after successfully extracting a compressed resource. They must NOT c...
Perform any platform-specific postprocessing of `tempname`
[ "Perform", "any", "platform", "-", "specific", "postprocessing", "of", "tempname" ]
def postprocess(self, tempname, filename): """Perform any platform-specific postprocessing of `tempname` This is where Mac header rewrites should be done; other platforms don't have anything special they should do. Resource providers should call this method ONLY after successfully ...
[ "def", "postprocess", "(", "self", ",", "tempname", ",", "filename", ")", ":", "if", "os", ".", "name", "==", "'posix'", ":", "# Make the resource executable", "mode", "=", "(", "(", "os", ".", "stat", "(", "tempname", ")", ".", "st_mode", ")", "|", "0...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py#L981-L999
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/multiprocessing/context.py
python
BaseContext.JoinableQueue
(self, maxsize=0)
return JoinableQueue(maxsize, ctx=self.get_context())
Returns a queue object
Returns a queue object
[ "Returns", "a", "queue", "object" ]
def JoinableQueue(self, maxsize=0): '''Returns a queue object''' from .queues import JoinableQueue return JoinableQueue(maxsize, ctx=self.get_context())
[ "def", "JoinableQueue", "(", "self", ",", "maxsize", "=", "0", ")", ":", "from", ".", "queues", "import", "JoinableQueue", "return", "JoinableQueue", "(", "maxsize", ",", "ctx", "=", "self", ".", "get_context", "(", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/context.py#L105-L108
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/gdb/mongo.py
python
GetMongoDecoration.__init__
(self)
Initialize GetMongoDecoration.
Initialize GetMongoDecoration.
[ "Initialize", "GetMongoDecoration", "." ]
def __init__(self): """Initialize GetMongoDecoration.""" RegisterMongoCommand.register(self, "mongo-decoration", gdb.COMMAND_DATA)
[ "def", "__init__", "(", "self", ")", ":", "RegisterMongoCommand", ".", "register", "(", "self", ",", "\"mongo-decoration\"", ",", "gdb", ".", "COMMAND_DATA", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/gdb/mongo.py#L254-L256
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
QueryLayoutInfoEvent.GetAlignment
(*args, **kwargs)
return _windows_.QueryLayoutInfoEvent_GetAlignment(*args, **kwargs)
GetAlignment(self) -> int
GetAlignment(self) -> int
[ "GetAlignment", "(", "self", ")", "-", ">", "int" ]
def GetAlignment(*args, **kwargs): """GetAlignment(self) -> int""" return _windows_.QueryLayoutInfoEvent_GetAlignment(*args, **kwargs)
[ "def", "GetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "QueryLayoutInfoEvent_GetAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L1993-L1995
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/nntplib.py
python
NNTP.slave
(self)
return self.shortcmd('SLAVE')
Process a SLAVE command. Returns: - resp: server response if successful
Process a SLAVE command. Returns: - resp: server response if successful
[ "Process", "a", "SLAVE", "command", ".", "Returns", ":", "-", "resp", ":", "server", "response", "if", "successful" ]
def slave(self): """Process a SLAVE command. Returns: - resp: server response if successful""" return self.shortcmd('SLAVE')
[ "def", "slave", "(", "self", ")", ":", "return", "self", ".", "shortcmd", "(", "'SLAVE'", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/nntplib.py#L446-L450
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology2.py
python
NetGraph.generate_blob_names
(self)
Generate blob names for each one of the edge. At this time, Keras does not support "fork" operation (a layer with more than 1 blob output). So we just use names of the src layer to identify a blob. We also assume all neural networks are singly-connected graphs - which should be the case.
Generate blob names for each one of the edge. At this time, Keras does not support "fork" operation (a layer with more than 1 blob output). So we just use names of the src layer to identify a blob. We also assume all neural networks are singly-connected graphs - which should be the case.
[ "Generate", "blob", "names", "for", "each", "one", "of", "the", "edge", ".", "At", "this", "time", "Keras", "does", "not", "support", "fork", "operation", "(", "a", "layer", "with", "more", "than", "1", "blob", "output", ")", ".", "So", "we", "just", ...
def generate_blob_names(self): """ Generate blob names for each one of the edge. At this time, Keras does not support "fork" operation (a layer with more than 1 blob output). So we just use names of the src layer to identify a blob. We also assume all neural networks are singly...
[ "def", "generate_blob_names", "(", "self", ")", ":", "# generate blob names that represent edges in blob_name_map", "# because of the InputLayers, input blobs are also generated.", "# Generate each layer's input / output blob names", "for", "layer", "in", "self", ".", "layer_list", ":"...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_topology2.py#L237-L259
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py
python
FlagValues.__RemoveFlagFromDictByModule
(self, flags_by_module_dict, flag_obj)
Removes a flag object from a module -> list of flags dictionary. Args: flags_by_module_dict: A dictionary that maps module names to lists of flags. flag_obj: A flag object.
Removes a flag object from a module -> list of flags dictionary.
[ "Removes", "a", "flag", "object", "from", "a", "module", "-", ">", "list", "of", "flags", "dictionary", "." ]
def __RemoveFlagFromDictByModule(self, flags_by_module_dict, flag_obj): """Removes a flag object from a module -> list of flags dictionary. Args: flags_by_module_dict: A dictionary that maps module names to lists of flags. flag_obj: A flag object. """ for unused_module, flags_in_mod...
[ "def", "__RemoveFlagFromDictByModule", "(", "self", ",", "flags_by_module_dict", ",", "flag_obj", ")", ":", "for", "unused_module", ",", "flags_in_module", "in", "flags_by_module_dict", ".", "iteritems", "(", ")", ":", "# while (as opposed to if) takes care of multiple occu...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py#L1158-L1170
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/dtypes.py
python
DType.as_numpy_dtype
(self)
return _TF_TO_NP[self._type_enum]
Returns a `numpy.dtype` based on this `DType`.
Returns a `numpy.dtype` based on this `DType`.
[ "Returns", "a", "numpy", ".", "dtype", "based", "on", "this", "DType", "." ]
def as_numpy_dtype(self): """Returns a `numpy.dtype` based on this `DType`.""" return _TF_TO_NP[self._type_enum]
[ "def", "as_numpy_dtype", "(", "self", ")", ":", "return", "_TF_TO_NP", "[", "self", ".", "_type_enum", "]" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/dtypes.py#L129-L131
calamares/calamares
9f6f82405b3074af7c99dc26487d2e46e4ece3e5
src/modules/packages/main.py
python
PMPacman.run_pacman
(self, command, callback=False)
Call pacman in a loop until it is successful or the number of retries is exceeded :param command: The pacman command to run :param callback: An optional boolean that indicates if this pacman run should use the callback :return:
Call pacman in a loop until it is successful or the number of retries is exceeded :param command: The pacman command to run :param callback: An optional boolean that indicates if this pacman run should use the callback :return:
[ "Call", "pacman", "in", "a", "loop", "until", "it", "is", "successful", "or", "the", "number", "of", "retries", "is", "exceeded", ":", "param", "command", ":", "The", "pacman", "command", "to", "run", ":", "param", "callback", ":", "An", "optional", "boo...
def run_pacman(self, command, callback=False): """ Call pacman in a loop until it is successful or the number of retries is exceeded :param command: The pacman command to run :param callback: An optional boolean that indicates if this pacman run should use the callback :return: ...
[ "def", "run_pacman", "(", "self", ",", "command", ",", "callback", "=", "False", ")", ":", "pacman_count", "=", "0", "while", "pacman_count", "<=", "self", ".", "pacman_num_retries", ":", "pacman_count", "+=", "1", "try", ":", "if", "callback", "is", "True...
https://github.com/calamares/calamares/blob/9f6f82405b3074af7c99dc26487d2e46e4ece3e5/src/modules/packages/main.py#L415-L437
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/ndarray/ndarray.py
python
to_dlpack_for_write
(data)
return ctypes.pythonapi.PyCapsule_New(dlpack, _c_str_dltensor, _c_dlpack_deleter)
Returns a reference view of NDArray that represents as DLManagedTensor until all previous read/write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLManagedTensor) a reference view ...
Returns a reference view of NDArray that represents as DLManagedTensor until all previous read/write operations on the current array are finished.
[ "Returns", "a", "reference", "view", "of", "NDArray", "that", "represents", "as", "DLManagedTensor", "until", "all", "previous", "read", "/", "write", "operations", "on", "the", "current", "array", "are", "finished", "." ]
def to_dlpack_for_write(data): """Returns a reference view of NDArray that represents as DLManagedTensor until all previous read/write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLMa...
[ "def", "to_dlpack_for_write", "(", "data", ")", ":", "check_call", "(", "_LIB", ".", "MXNDArrayWaitToWrite", "(", "data", ".", "handle", ")", ")", "dlpack", "=", "DLPackHandle", "(", ")", "check_call", "(", "_LIB", ".", "MXNDArrayToDLPack", "(", "data", ".",...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L4109-L4139
PX4/PX4-Autopilot
0b9f60a0370be53d683352c63fd92db3d6586e18
Tools/ecl_ekf/analysis/detectors.py
python
InAirDetector.take_off
(self)
return self._in_air[0].take_off if self._in_air else None
first take off :return:
first take off :return:
[ "first", "take", "off", ":", "return", ":" ]
def take_off(self) -> Optional[float]: """ first take off :return: """ return self._in_air[0].take_off if self._in_air else None
[ "def", "take_off", "(", "self", ")", "->", "Optional", "[", "float", "]", ":", "return", "self", ".", "_in_air", "[", "0", "]", ".", "take_off", "if", "self", ".", "_in_air", "else", "None" ]
https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/ecl_ekf/analysis/detectors.py#L116-L121
eric612/MobileNet-YOLO
69b4441cb3ec8d553fbdef788ad033e246f901bd
scripts/cpp_lint.py
python
CheckForNonStandardConstructs
(filename, clean_lines, linenum, nesting_state, error)
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const stat...
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
[ "r", "Logs", "an", "error", "if", "we", "see", "certain", "non", "-", "ANSI", "constructs", "ignored", "by", "gcc", "-", "2", "." ]
def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error): r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint ...
[ "def", "CheckForNonStandardConstructs", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Remove comments from the line, but leave in strings for now.", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "i...
https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/scripts/cpp_lint.py#L2198-L2302
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/_parseaddr.py
python
AddrlistClass.getdelimited
(self, beginchar, endchars, allowcomments=True)
return EMPTYSTRING.join(slist)
Parse a header fragment delimited by special characters. `beginchar' is the start character for the fragment. If self is not looking at an instance of `beginchar' then getdelimited returns the empty string. `endchars' is a sequence of allowable end-delimiting characters. Parsin...
Parse a header fragment delimited by special characters.
[ "Parse", "a", "header", "fragment", "delimited", "by", "special", "characters", "." ]
def getdelimited(self, beginchar, endchars, allowcomments=True): """Parse a header fragment delimited by special characters. `beginchar' is the start character for the fragment. If self is not looking at an instance of `beginchar' then getdelimited returns the empty string. `en...
[ "def", "getdelimited", "(", "self", ",", "beginchar", ",", "endchars", ",", "allowcomments", "=", "True", ")", ":", "if", "self", ".", "field", "[", "self", ".", "pos", "]", "!=", "beginchar", ":", "return", "''", "slist", "=", "[", "''", "]", "quote...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/_parseaddr.py#L360-L395
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/combo.py
python
ComboCtrl.GetPopupWindowState
(*args, **kwargs)
return _combo.ComboCtrl_GetPopupWindowState(*args, **kwargs)
GetPopupWindowState(self) -> int
GetPopupWindowState(self) -> int
[ "GetPopupWindowState", "(", "self", ")", "-", ">", "int" ]
def GetPopupWindowState(*args, **kwargs): """GetPopupWindowState(self) -> int""" return _combo.ComboCtrl_GetPopupWindowState(*args, **kwargs)
[ "def", "GetPopupWindowState", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboCtrl_GetPopupWindowState", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/combo.py#L497-L499
CalcProgrammer1/OpenRGB
8156b0167a7590dd8ba561dfde524bfcacf46b5e
dependencies/mbedtls-2.24.0/scripts/assemble_changelog.py
python
ChangeLog.add_file
(self, input_stream)
Add changelog entries from a file.
Add changelog entries from a file.
[ "Add", "changelog", "entries", "from", "a", "file", "." ]
def add_file(self, input_stream): """Add changelog entries from a file. """ self.add_categories_from_text(input_stream.name, 1, input_stream.read(), False)
[ "def", "add_file", "(", "self", ",", "input_stream", ")", ":", "self", ".", "add_categories_from_text", "(", "input_stream", ".", "name", ",", "1", ",", "input_stream", ".", "read", "(", ")", ",", "False", ")" ]
https://github.com/CalcProgrammer1/OpenRGB/blob/8156b0167a7590dd8ba561dfde524bfcacf46b5e/dependencies/mbedtls-2.24.0/scripts/assemble_changelog.py#L238-L242
larroy/clearskies_core
3574ddf0edc8555454c7044126e786a6c29444dc
tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.ComputeOutputFileName
(self, spec, type=None)
Compute the filename of the final output for the current target.
Compute the filename of the final output for the current target.
[ "Compute", "the", "filename", "of", "the", "final", "output", "for", "the", "current", "target", "." ]
def ComputeOutputFileName(self, spec, type=None): """Compute the filename of the final output for the current target.""" if not type: type = spec['type'] default_variables = copy.copy(generator_default_variables) CalculateVariables(default_variables, {'flavor': self.flavor}) # Compute filena...
[ "def", "ComputeOutputFileName", "(", "self", ",", "spec", ",", "type", "=", "None", ")", ":", "if", "not", "type", ":", "type", "=", "spec", "[", "'type'", "]", "default_variables", "=", "copy", ".", "copy", "(", "generator_default_variables", ")", "Calcul...
https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/generator/ninja.py#L1282-L1330
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/utils.py
python
parse_dict_header
(value)
return result
Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict: >>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] If there is no value for a key it wi...
Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict:
[ "Parse", "lists", "of", "key", "value", "pairs", "as", "described", "by", "RFC", "2068", "Section", "2", "and", "convert", "them", "into", "a", "python", "dict", ":" ]
def parse_dict_header(value): """Parse lists of key, value pairs as described by RFC 2068 Section 2 and convert them into a python dict: >>> d = parse_dict_header('foo="is a fish", bar="as well"') >>> type(d) is dict True >>> sorted(d.items()) [('bar', 'as well'), ('foo', 'is a fish')] ...
[ "def", "parse_dict_header", "(", "value", ")", ":", "result", "=", "{", "}", "for", "item", "in", "_parse_list_header", "(", "value", ")", ":", "if", "'='", "not", "in", "item", ":", "result", "[", "item", "]", "=", "None", "continue", "name", ",", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/utils.py#L355-L386
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Rect.ContainsRect
(*args, **kwargs)
return _core_.Rect_ContainsRect(*args, **kwargs)
ContainsRect(self, Rect rect) -> bool Returns ``True`` if the given rectangle is completely inside this rectangle or touches its boundary.
ContainsRect(self, Rect rect) -> bool
[ "ContainsRect", "(", "self", "Rect", "rect", ")", "-", ">", "bool" ]
def ContainsRect(*args, **kwargs): """ ContainsRect(self, Rect rect) -> bool Returns ``True`` if the given rectangle is completely inside this rectangle or touches its boundary. """ return _core_.Rect_ContainsRect(*args, **kwargs)
[ "def", "ContainsRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect_ContainsRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L1517-L1524
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/gypfiles/vs_toolchain.py
python
_CopyRuntime2013
(target_dir, source_dir, dll_pattern)
Copy both the msvcr and msvcp runtime DLLs, only if the target doesn't exist, but the target directory does exist.
Copy both the msvcr and msvcp runtime DLLs, only if the target doesn't exist, but the target directory does exist.
[ "Copy", "both", "the", "msvcr", "and", "msvcp", "runtime", "DLLs", "only", "if", "the", "target", "doesn", "t", "exist", "but", "the", "target", "directory", "does", "exist", "." ]
def _CopyRuntime2013(target_dir, source_dir, dll_pattern): """Copy both the msvcr and msvcp runtime DLLs, only if the target doesn't exist, but the target directory does exist.""" for file_part in ('p', 'r'): dll = dll_pattern % file_part target = os.path.join(target_dir, dll) source = os.path.join(so...
[ "def", "_CopyRuntime2013", "(", "target_dir", ",", "source_dir", ",", "dll_pattern", ")", ":", "for", "file_part", "in", "(", "'p'", ",", "'r'", ")", ":", "dll", "=", "dll_pattern", "%", "file_part", "target", "=", "os", ".", "path", ".", "join", "(", ...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/gypfiles/vs_toolchain.py#L171-L178
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/utils.py
python
rewind_body
(prepared_request)
Move file pointer back to its recorded starting position so it can be read again on redirect.
Move file pointer back to its recorded starting position so it can be read again on redirect.
[ "Move", "file", "pointer", "back", "to", "its", "recorded", "starting", "position", "so", "it", "can", "be", "read", "again", "on", "redirect", "." ]
def rewind_body(prepared_request): """Move file pointer back to its recorded starting position so it can be read again on redirect. """ body_seek = getattr(prepared_request.body, 'seek', None) if body_seek is not None and isinstance(prepared_request._body_position, integer_types): try: ...
[ "def", "rewind_body", "(", "prepared_request", ")", ":", "body_seek", "=", "getattr", "(", "prepared_request", ".", "body", ",", "'seek'", ",", "None", ")", "if", "body_seek", "is", "not", "None", "and", "isinstance", "(", "prepared_request", ".", "_body_posit...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/utils.py#L980-L992
runtimejs/runtime
0a6e84c30823d35a4548d6634166784260ae7b74
deps/v8/tools/grokdump.py
python
InspectionShell.do_k
(self, arguments)
Teach V8 heap layout information to the inspector. This increases the amount of annotations the inspector can produce while dumping data. The first page of each heap space is of particular interest because it contains known objects that do not move.
Teach V8 heap layout information to the inspector. This increases the amount of annotations the inspector can produce while dumping data. The first page of each heap space is of particular interest because it contains known objects that do not move.
[ "Teach", "V8", "heap", "layout", "information", "to", "the", "inspector", ".", "This", "increases", "the", "amount", "of", "annotations", "the", "inspector", "can", "produce", "while", "dumping", "data", ".", "The", "first", "page", "of", "each", "heap", "sp...
def do_k(self, arguments): """ Teach V8 heap layout information to the inspector. This increases the amount of annotations the inspector can produce while dumping data. The first page of each heap space is of particular interest because it contains known objects that do not move. """ sel...
[ "def", "do_k", "(", "self", ",", "arguments", ")", ":", "self", ".", "padawan", ".", "PrintKnowledge", "(", ")" ]
https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/grokdump.py#L2992-L2999
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
ez_setup.py
python
ContextualZipFile.__new__
(cls, *args, **kwargs)
return super(ContextualZipFile, cls).__new__(cls)
Construct a ZipFile or ContextualZipFile as appropriate.
Construct a ZipFile or ContextualZipFile as appropriate.
[ "Construct", "a", "ZipFile", "or", "ContextualZipFile", "as", "appropriate", "." ]
def __new__(cls, *args, **kwargs): """Construct a ZipFile or ContextualZipFile as appropriate.""" if hasattr(zipfile.ZipFile, '__exit__'): return zipfile.ZipFile(*args, **kwargs) return super(ContextualZipFile, cls).__new__(cls)
[ "def", "__new__", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "hasattr", "(", "zipfile", ".", "ZipFile", ",", "'__exit__'", ")", ":", "return", "zipfile", ".", "ZipFile", "(", "*", "args", ",", "*", "*", "kwargs", ")", ...
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/ez_setup.py#L91-L95
ome/openmicroscopy
17d0a38493571540815074bfbf06932526fc3349
examples/ScriptingService/adminWorkflow.py
python
disableScript
(session, scriptId)
This will simply stop a script, defined by ID, from being returned by getScripts() by editing it's mime-type to 'text/plain'
This will simply stop a script, defined by ID, from being returned by getScripts() by editing it's mime-type to 'text/plain'
[ "This", "will", "simply", "stop", "a", "script", "defined", "by", "ID", "from", "being", "returned", "by", "getScripts", "()", "by", "editing", "it", "s", "mime", "-", "type", "to", "text", "/", "plain" ]
def disableScript(session, scriptId): """ This will simply stop a script, defined by ID, from being returned by getScripts() by editing it's mime-type to 'text/plain' """ updateService = session.getUpdateService() scriptFile = session.getQueryService().get("OriginalFile", int(scriptId)) pr...
[ "def", "disableScript", "(", "session", ",", "scriptId", ")", ":", "updateService", "=", "session", ".", "getUpdateService", "(", ")", "scriptFile", "=", "session", ".", "getQueryService", "(", ")", ".", "get", "(", "\"OriginalFile\"", ",", "int", "(", "scri...
https://github.com/ome/openmicroscopy/blob/17d0a38493571540815074bfbf06932526fc3349/examples/ScriptingService/adminWorkflow.py#L289-L301
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang/utils/token-delta.py
python
DeltaAlgorithm.split
(self, S)
split(set) -> [sets] Partition a set into one or two pieces.
split(set) -> [sets]
[ "split", "(", "set", ")", "-", ">", "[", "sets", "]" ]
def split(self, S): """split(set) -> [sets] Partition a set into one or two pieces. """ # There are many ways to split, we could do a better job with more # context information (but then the API becomes grosser). L = list(S) mid = len(L)//2 if mid==0: ...
[ "def", "split", "(", "self", ",", "S", ")", ":", "# There are many ways to split, we could do a better job with more", "# context information (but then the API becomes grosser).", "L", "=", "list", "(", "S", ")", "mid", "=", "len", "(", "L", ")", "//", "2", "if", "m...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/utils/token-delta.py#L49-L62
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/metrics/python/ops/metric_ops.py
python
streaming_sparse_recall_at_k
(predictions, labels, k, class_id=None, ignore_mask=None, metrics_collections=None, updates_collections=None, ...
Computes recall@k of the predictions with respect to sparse labels. If `class_id` is specified, we calculate recall by considering only the entries in the batch for which `class_id` is in the label, and computing the fraction of them for which `class_id` is in the top-k `predictions`. If `class_id` is ...
Computes recall@k of the predictions with respect to sparse labels.
[ "Computes", "recall@k", "of", "the", "predictions", "with", "respect", "to", "sparse", "labels", "." ]
def streaming_sparse_recall_at_k(predictions, labels, k, class_id=None, ignore_mask=None, metrics_collections=None, update...
[ "def", "streaming_sparse_recall_at_k", "(", "predictions", ",", "labels", ",", "k", ",", "class_id", "=", "None", ",", "ignore_mask", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/metrics/python/ops/metric_ops.py#L1028-L1110
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/dispatcher.py
python
CUDAUFuncDispatcher.__call__
(self, *args, **kws)
return CUDAUFuncMechanism.call(self.functions, args, kws)
*args: numpy arrays or DeviceArrayBase (created by cuda.to_device). Cannot mix the two types in one call. **kws: stream -- cuda stream; when defined, asynchronous mode is used. out -- output array. Can be a numpy array or DeviceArrayBase depending...
*args: numpy arrays or DeviceArrayBase (created by cuda.to_device). Cannot mix the two types in one call.
[ "*", "args", ":", "numpy", "arrays", "or", "DeviceArrayBase", "(", "created", "by", "cuda", ".", "to_device", ")", ".", "Cannot", "mix", "the", "two", "types", "in", "one", "call", "." ]
def __call__(self, *args, **kws): """ *args: numpy arrays or DeviceArrayBase (created by cuda.to_device). Cannot mix the two types in one call. **kws: stream -- cuda stream; when defined, asynchronous mode is used. out -- output array. Can be a numpy ar...
[ "def", "__call__", "(", "self", ",", "*", "args", ",", "*", "*", "kws", ")", ":", "return", "CUDAUFuncMechanism", ".", "call", "(", "self", ".", "functions", ",", "args", ",", "kws", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/dispatcher.py#L77-L88
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
MouseEvent.LeftUp
(*args, **kwargs)
return _core_.MouseEvent_LeftUp(*args, **kwargs)
LeftUp(self) -> bool Returns true if the left mouse button state changed to up.
LeftUp(self) -> bool
[ "LeftUp", "(", "self", ")", "-", ">", "bool" ]
def LeftUp(*args, **kwargs): """ LeftUp(self) -> bool Returns true if the left mouse button state changed to up. """ return _core_.MouseEvent_LeftUp(*args, **kwargs)
[ "def", "LeftUp", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MouseEvent_LeftUp", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L5665-L5671
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
psacnn_brain_segmentation/psacnn_brain_segmentation/deeplearn_utils/unet_model.py
python
identity_block
(input_tensor, filters, stage, block, dilation_rate)
return x
The identity block is the block that has no conv layer at shortcut. # Arguments input_tensor: input tensor kernel_size: default 3, the kernel size of middle conv layer at main path filters: list of integers, the filters of 3 conv layer at main path stage: integer, current stage label...
The identity block is the block that has no conv layer at shortcut. # Arguments input_tensor: input tensor kernel_size: default 3, the kernel size of middle conv layer at main path filters: list of integers, the filters of 3 conv layer at main path stage: integer, current stage label...
[ "The", "identity", "block", "is", "the", "block", "that", "has", "no", "conv", "layer", "at", "shortcut", ".", "#", "Arguments", "input_tensor", ":", "input", "tensor", "kernel_size", ":", "default", "3", "the", "kernel", "size", "of", "middle", "conv", "l...
def identity_block(input_tensor, filters, stage, block, dilation_rate): """The identity block is the block that has no conv layer at shortcut. # Arguments input_tensor: input tensor kernel_size: default 3, the kernel size of middle conv layer at main path filters: list of integers, the f...
[ "def", "identity_block", "(", "input_tensor", ",", "filters", ",", "stage", ",", "block", ",", "dilation_rate", ")", ":", "dim", "=", "len", "(", "input_tensor", ".", "shape", ")", "if", "dim", "==", "4", ":", "ConvL", "=", "Conv2D", "MaxPoolingL", "=", ...
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/psacnn_brain_segmentation/psacnn_brain_segmentation/deeplearn_utils/unet_model.py#L850-L909
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
libs/lv2/lv2specgen/lv2specgen.py
python
specProperty
(m, subject, predicate)
return ''
Return a property of the spec.
Return a property of the spec.
[ "Return", "a", "property", "of", "the", "spec", "." ]
def specProperty(m, subject, predicate): "Return a property of the spec." for c in findStatements(m, subject, predicate, None): return getLiteralString(getObject(c)) return ''
[ "def", "specProperty", "(", "m", ",", "subject", ",", "predicate", ")", ":", "for", "c", "in", "findStatements", "(", "m", ",", "subject", ",", "predicate", ",", "None", ")", ":", "return", "getLiteralString", "(", "getObject", "(", "c", ")", ")", "ret...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/libs/lv2/lv2specgen/lv2specgen.py#L874-L878
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/concurrent.py
python
chain_future
(a: "Future[_T]", b: "Future[_T]")
Chain two futures together so that when one completes, so does the other. The result (success or failure) of ``a`` will be copied to ``b``, unless ``b`` has already been completed or cancelled by the time ``a`` finishes. .. versionchanged:: 5.0 Now accepts both Tornado/asyncio `Future` objects and...
Chain two futures together so that when one completes, so does the other.
[ "Chain", "two", "futures", "together", "so", "that", "when", "one", "completes", "so", "does", "the", "other", "." ]
def chain_future(a: "Future[_T]", b: "Future[_T]") -> None: """Chain two futures together so that when one completes, so does the other. The result (success or failure) of ``a`` will be copied to ``b``, unless ``b`` has already been completed or cancelled by the time ``a`` finishes. .. versionchanged:...
[ "def", "chain_future", "(", "a", ":", "\"Future[_T]\"", ",", "b", ":", "\"Future[_T]\"", ")", "->", "None", ":", "def", "copy", "(", "future", ":", "\"Future[_T]\"", ")", "->", "None", ":", "assert", "future", "is", "a", "if", "b", ".", "done", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/concurrent.py#L140-L170
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/type_extractor/type_extractor/parse_includes.py
python
remove_unwanted_functions
(functions)
return { func: func_info for func, func_info in functions.items() if is_wanted(func_info) }
Removes functions which we do not want in our extracted files. Returns a new dictionary with filtered functions.
Removes functions which we do not want in our extracted files.
[ "Removes", "functions", "which", "we", "do", "not", "want", "in", "our", "extracted", "files", "." ]
def remove_unwanted_functions(functions): """Removes functions which we do not want in our extracted files. Returns a new dictionary with filtered functions. """ return { func: func_info for func, func_info in functions.items() if is_wanted(func_info) }
[ "def", "remove_unwanted_functions", "(", "functions", ")", ":", "return", "{", "func", ":", "func_info", "for", "func", ",", "func_info", "in", "functions", ".", "items", "(", ")", "if", "is_wanted", "(", "func_info", ")", "}" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/parse_includes.py#L127-L135
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/grit/grit/format/policy_templates/policy_template_generator.py
python
PolicyTemplateGenerator._ProcessPolicyList
(self, policy_list)
Adds localized message strings to each item in a list of policies and groups. Also breaks up the content of 'supported_on' attributes into lists of dictionaries. Args: policy_list: A list of policies and groups. Message strings will be added for each item and to their child items, recursively...
Adds localized message strings to each item in a list of policies and groups. Also breaks up the content of 'supported_on' attributes into lists of dictionaries.
[ "Adds", "localized", "message", "strings", "to", "each", "item", "in", "a", "list", "of", "policies", "and", "groups", ".", "Also", "breaks", "up", "the", "content", "of", "supported_on", "attributes", "into", "lists", "of", "dictionaries", "." ]
def _ProcessPolicyList(self, policy_list): '''Adds localized message strings to each item in a list of policies and groups. Also breaks up the content of 'supported_on' attributes into lists of dictionaries. Args: policy_list: A list of policies and groups. Message strings will be added f...
[ "def", "_ProcessPolicyList", "(", "self", ",", "policy_list", ")", ":", "for", "policy", "in", "policy_list", ":", "self", ".", "_ProcessPolicy", "(", "policy", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/policy_template_generator.py#L132-L142
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py
python
PDeque.appendleft
(self, elem)
return PDeque(new_left_list, new_right_list, new_length, self._maxlen)
Return new deque with elem as the leftmost element. >>> pdeque([1, 2]).appendleft(3) pdeque([3, 1, 2])
Return new deque with elem as the leftmost element.
[ "Return", "new", "deque", "with", "elem", "as", "the", "leftmost", "element", "." ]
def appendleft(self, elem): """ Return new deque with elem as the leftmost element. >>> pdeque([1, 2]).appendleft(3) pdeque([3, 1, 2]) """ new_right_list, new_left_list, new_length = self._append(self._right_list, self._left_list, elem) return PDeque(new_left_lis...
[ "def", "appendleft", "(", "self", ",", "elem", ")", ":", "new_right_list", ",", "new_left_list", ",", "new_length", "=", "self", ".", "_append", "(", "self", ".", "_right_list", ",", "self", ".", "_left_list", ",", "elem", ")", "return", "PDeque", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py#L193-L201
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Modules/Scripted/SegmentStatistics/SegmentStatisticsPlugins/SegmentStatisticsPluginBase.py
python
SegmentStatisticsPluginBase.computeStatistics
(self, segmentID)
Compute measurements for requested keys on the given segment and return as dictionary mapping key's to measurement results
Compute measurements for requested keys on the given segment and return as dictionary mapping key's to measurement results
[ "Compute", "measurements", "for", "requested", "keys", "on", "the", "given", "segment", "and", "return", "as", "dictionary", "mapping", "key", "s", "to", "measurement", "results" ]
def computeStatistics(self, segmentID): """Compute measurements for requested keys on the given segment and return as dictionary mapping key's to measurement results """ pass
[ "def", "computeStatistics", "(", "self", ",", "segmentID", ")", ":", "pass" ]
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/SegmentStatistics/SegmentStatisticsPlugins/SegmentStatisticsPluginBase.py#L54-L58
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/layers/python/layers/layers.py
python
softmax
(logits, scope=None)
Performs softmax on Nth dimension of N-dimensional logit tensor. For two-dimensional logits this reduces to tf.nn.softmax. The N-th dimension needs to have a specified number of elements (number of classes). Args: logits: N-dimensional `Tensor` with logits, where N > 1. scope: Optional scope for variabl...
Performs softmax on Nth dimension of N-dimensional logit tensor.
[ "Performs", "softmax", "on", "Nth", "dimension", "of", "N", "-", "dimensional", "logit", "tensor", "." ]
def softmax(logits, scope=None): """Performs softmax on Nth dimension of N-dimensional logit tensor. For two-dimensional logits this reduces to tf.nn.softmax. The N-th dimension needs to have a specified number of elements (number of classes). Args: logits: N-dimensional `Tensor` with logits, where N > 1....
[ "def", "softmax", "(", "logits", ",", "scope", "=", "None", ")", ":", "# TODO(jrru): Add axis argument which defaults to last dimension.", "with", "variable_scope", ".", "variable_scope", "(", "scope", ",", "'softmax'", ",", "[", "logits", "]", ")", ":", "num_logits...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/layers.py#L1306-L1326
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/websocket-client/websocket.py
python
getdefaulttimeout
()
return default_timeout
Return the global timeout setting(second) to connect.
Return the global timeout setting(second) to connect.
[ "Return", "the", "global", "timeout", "setting", "(", "second", ")", "to", "connect", "." ]
def getdefaulttimeout(): """ Return the global timeout setting(second) to connect. """ return default_timeout
[ "def", "getdefaulttimeout", "(", ")", ":", "return", "default_timeout" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/websocket-client/websocket.py#L126-L130
fengbingchun/NN_Test
d6305825d5273e4569ccd1eda9ffa2a9c72e18d2
src/tiny-dnn/third_party/cpplint.py
python
ProcessLine
(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=None)
Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file, with comments stripped. line: Number of line being ...
Processes a single line in the file.
[ "Processes", "a", "single", "line", "in", "the", "file", "." ]
def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=None): """Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension ...
[ "def", "ProcessLine", "(", "filename", ",", "file_extension", ",", "clean_lines", ",", "line", ",", "include_state", ",", "function_state", ",", "nesting_state", ",", "error", ",", "extra_check_functions", "=", "None", ")", ":", "raw_lines", "=", "clean_lines", ...
https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L5938-L5981
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py
python
AbstractBufferedFile._upload_chunk
(self, final=False)
Write one part of a multi-block file upload Parameters ========== final: bool This is the last block, so should complete file, if self.autocommit is True.
Write one part of a multi-block file upload
[ "Write", "one", "part", "of", "a", "multi", "-", "block", "file", "upload" ]
def _upload_chunk(self, final=False): """ Write one part of a multi-block file upload Parameters ========== final: bool This is the last block, so should complete file, if self.autocommit is True. """
[ "def", "_upload_chunk", "(", "self", ",", "final", "=", "False", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fsspec/spec.py#L1191-L1199
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/tools/grokdump.py
python
InspectionShell.do_disassemble
(self, args)
Unassemble memory in the region [address, address + size). If the size is not specified, a default value of 32 bytes is used. Synopsis: u 0x<address> 0x<size>
Unassemble memory in the region [address, address + size).
[ "Unassemble", "memory", "in", "the", "region", "[", "address", "address", "+", "size", ")", "." ]
def do_disassemble(self, args): """ Unassemble memory in the region [address, address + size). If the size is not specified, a default value of 32 bytes is used. Synopsis: u 0x<address> 0x<size> """ if len(args) != 0: args = args.split(' ') self.u_start = self.ParseAddressExpr(ar...
[ "def", "do_disassemble", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "!=", "0", ":", "args", "=", "args", ".", "split", "(", "' '", ")", "self", ".", "u_start", "=", "self", ".", "ParseAddressExpr", "(", "args", "[", "0", "...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/tools/grokdump.py#L3731-L3765
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/backward.py
python
_find_op_path_
(block, targets, inputs, no_grad_set, op_path_dict=None, is_while=False)
return op_path
It is used to find the grad path in `block`. Args: block(Block): The block in which to get op path. targets(list[Variable]): The target variables. inputs(list[Variable]): The input variables. no_grad_set(set): The set of no grad var name. no_grad_set will be changed. op_path...
It is used to find the grad path in `block`.
[ "It", "is", "used", "to", "find", "the", "grad", "path", "in", "block", "." ]
def _find_op_path_(block, targets, inputs, no_grad_set, op_path_dict=None, is_while=False): """ It is used to find the grad path in `block`. Args: block(Block): The block in which to get op path. ...
[ "def", "_find_op_path_", "(", "block", ",", "targets", ",", "inputs", ",", "no_grad_set", ",", "op_path_dict", "=", "None", ",", "is_while", "=", "False", ")", ":", "input_names", "=", "set", "(", "[", "inp", ".", "name", "for", "inp", "in", "inputs", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/backward.py#L1792-L1870
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_pages.py
python
EdPages.GetMenuHandlers
(self)
return rlist
Get the (id, evt_handler) tuples that this window should handle. @return: list of tuples
Get the (id, evt_handler) tuples that this window should handle. @return: list of tuples
[ "Get", "the", "(", "id", "evt_handler", ")", "tuples", "that", "this", "window", "should", "handle", ".", "@return", ":", "list", "of", "tuples" ]
def GetMenuHandlers(self): """Get the (id, evt_handler) tuples that this window should handle. @return: list of tuples """ rlist = [(ed_glob.ID_FIND, self._searchctrl.OnShowFindDlg), (ed_glob.ID_FIND_REPLACE, self._searchctrl.OnShowFindDlg), (ed...
[ "def", "GetMenuHandlers", "(", "self", ")", ":", "rlist", "=", "[", "(", "ed_glob", ".", "ID_FIND", ",", "self", ".", "_searchctrl", ".", "OnShowFindDlg", ")", ",", "(", "ed_glob", ".", "ID_FIND_REPLACE", ",", "self", ".", "_searchctrl", ".", "OnShowFindDl...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_pages.py#L290-L304
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
docs/tutorial_utils/vision/cnn_visualization/gradcam.py
python
get_cam
(imggrad, conv_out)
return cam
Compute CAM. Refer section 3 of https://arxiv.org/abs/1610.02391 for details
Compute CAM. Refer section 3 of https://arxiv.org/abs/1610.02391 for details
[ "Compute", "CAM", ".", "Refer", "section", "3", "of", "https", ":", "//", "arxiv", ".", "org", "/", "abs", "/", "1610", ".", "02391", "for", "details" ]
def get_cam(imggrad, conv_out): """Compute CAM. Refer section 3 of https://arxiv.org/abs/1610.02391 for details""" weights = onp.mean(imggrad, axis=(1, 2)) cam = onp.ones(conv_out.shape[1:], dtype=onp.float32) for i, w in enumerate(weights): cam += w * conv_out[i, :, :] cam = cv2.resize(cam,...
[ "def", "get_cam", "(", "imggrad", ",", "conv_out", ")", ":", "weights", "=", "onp", ".", "mean", "(", "imggrad", ",", "axis", "=", "(", "1", ",", "2", ")", ")", "cam", "=", "onp", ".", "ones", "(", "conv_out", ".", "shape", "[", "1", ":", "]", ...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/docs/tutorial_utils/vision/cnn_visualization/gradcam.py#L208-L218
fengjian0106/hed-tutorial-for-document-scanning
7e168f4e1230e691ef51df34fb807c8d55e61148
mobilenet.py
python
mobilenet_v1
(inputs, alpha, is_training)
return output, end_points
https://arxiv.org/pdf/1704.04861v1.pdf MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications reference code https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.py https://github.com/keras-team/keras/blob/master/keras/applications/mobilenet.py ...
https://arxiv.org/pdf/1704.04861v1.pdf MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
[ "https", ":", "//", "arxiv", ".", "org", "/", "pdf", "/", "1704", ".", "04861v1", ".", "pdf", "MobileNets", ":", "Efficient", "Convolutional", "Neural", "Networks", "for", "Mobile", "Vision", "Applications" ]
def mobilenet_v1(inputs, alpha, is_training): ''' https://arxiv.org/pdf/1704.04861v1.pdf MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications reference code https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.py https://github.com/ker...
[ "def", "mobilenet_v1", "(", "inputs", ",", "alpha", ",", "is_training", ")", ":", "assert", "const", ".", "use_batch_norm", "==", "True", "if", "alpha", "not", "in", "[", "0.25", ",", "0.50", ",", "0.75", ",", "1.0", "]", ":", "raise", "ValueError", "(...
https://github.com/fengjian0106/hed-tutorial-for-document-scanning/blob/7e168f4e1230e691ef51df34fb807c8d55e61148/mobilenet.py#L35-L210
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/ctypes/macholib/dyld.py
python
ensure_utf8
(s)
return s
Not all of PyObjC and Python understand unicode paths very well yet
Not all of PyObjC and Python understand unicode paths very well yet
[ "Not", "all", "of", "PyObjC", "and", "Python", "understand", "unicode", "paths", "very", "well", "yet" ]
def ensure_utf8(s): """Not all of PyObjC and Python understand unicode paths very well yet""" if isinstance(s, unicode): return s.encode('utf8') return s
[ "def", "ensure_utf8", "(", "s", ")", ":", "if", "isinstance", "(", "s", ",", "unicode", ")", ":", "return", "s", ".", "encode", "(", "'utf8'", ")", "return", "s" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ctypes/macholib/dyld.py#L34-L38
isc-projects/kea
c5836c791b63f42173bb604dd5f05d7110f3e716
hammer.py
python
VagrantEnv.run_build_and_test
(self, tarball_path, jobs, pkg_version, pkg_isc_version, upload, repository_url)
return total, passed
Run build and unit tests inside Vagrant system.
Run build and unit tests inside Vagrant system.
[ "Run", "build", "and", "unit", "tests", "inside", "Vagrant", "system", "." ]
def run_build_and_test(self, tarball_path, jobs, pkg_version, pkg_isc_version, upload, repository_url): """Run build and unit tests inside Vagrant system.""" if self.dry_run: return 0, 0 # prepare tarball if needed and upload it to vagrant system if not tarball_path: ...
[ "def", "run_build_and_test", "(", "self", ",", "tarball_path", ",", "jobs", ",", "pkg_version", ",", "pkg_isc_version", ",", "upload", ",", "repository_url", ")", ":", "if", "self", ".", "dry_run", ":", "return", "0", ",", "0", "# prepare tarball if needed and u...
https://github.com/isc-projects/kea/blob/c5836c791b63f42173bb604dd5f05d7110f3e716/hammer.py#L782-L887
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/esptool/serial/tools/miniterm.py
python
Miniterm._stop_reader
(self)
Stop reader thread only, wait for clean exit of thread
Stop reader thread only, wait for clean exit of thread
[ "Stop", "reader", "thread", "only", "wait", "for", "clean", "exit", "of", "thread" ]
def _stop_reader(self): """Stop reader thread only, wait for clean exit of thread""" self._reader_alive = False if hasattr(self.serial, 'cancel_read'): self.serial.cancel_read() self.receiver_thread.join()
[ "def", "_stop_reader", "(", "self", ")", ":", "self", ".", "_reader_alive", "=", "False", "if", "hasattr", "(", "self", ".", "serial", ",", "'cancel_read'", ")", ":", "self", ".", "serial", ".", "cancel_read", "(", ")", "self", ".", "receiver_thread", "....
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/tools/miniterm.py#L366-L371
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/common/system/platforminfo.py
python
PlatformInfo.terminal_width
(self)
Returns sys.maxint if the width cannot be determined.
Returns sys.maxint if the width cannot be determined.
[ "Returns", "sys", ".", "maxint", "if", "the", "width", "cannot", "be", "determined", "." ]
def terminal_width(self): """Returns sys.maxint if the width cannot be determined.""" try: if self.is_win(): # From http://code.activestate.com/recipes/440694-determine-size-of-console-window-on-windows/ from ctypes import windll, create_string_buffer ...
[ "def", "terminal_width", "(", "self", ")", ":", "try", ":", "if", "self", ".", "is_win", "(", ")", ":", "# From http://code.activestate.com/recipes/440694-determine-size-of-console-window-on-windows/", "from", "ctypes", "import", "windll", ",", "create_string_buffer", "ha...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/common/system/platforminfo.py#L99-L122
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/linalg/matfuncs.py
python
expm
(A)
return scipy.sparse.linalg.expm(A)
Compute the matrix exponential using Pade approximation. Parameters ---------- A : (N, N) array_like or sparse matrix Matrix to be exponentiated. Returns ------- expm : (N, N) ndarray Matrix exponential of `A`. References ---------- .. [1] Awad H. Al-Mohy and Nicho...
Compute the matrix exponential using Pade approximation.
[ "Compute", "the", "matrix", "exponential", "using", "Pade", "approximation", "." ]
def expm(A): """ Compute the matrix exponential using Pade approximation. Parameters ---------- A : (N, N) array_like or sparse matrix Matrix to be exponentiated. Returns ------- expm : (N, N) ndarray Matrix exponential of `A`. References ---------- .. [1] ...
[ "def", "expm", "(", "A", ")", ":", "# Input checking and conversion is provided by sparse.linalg.expm().", "import", "scipy", ".", "sparse", ".", "linalg", "return", "scipy", ".", "sparse", ".", "linalg", ".", "expm", "(", "A", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/linalg/matfuncs.py#L211-L256
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py
python
Gamma.variance
(self, name="variance")
Variance of each batch member.
Variance of each batch member.
[ "Variance", "of", "each", "batch", "member", "." ]
def variance(self, name="variance"): """Variance of each batch member.""" with ops.name_scope(self.name): with ops.op_scope([self._alpha, self._beta], name): return self._alpha / math_ops.square(self._beta)
[ "def", "variance", "(", "self", ",", "name", "=", "\"variance\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "self", ".", "_alpha", ",", "self", ".", "_beta", "]", ",", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py#L223-L227
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/difflib.py
python
HtmlDiff._convert_flags
(self,fromlist,tolist,flaglist,context,numlines)
return fromlist,tolist,flaglist,next_href,next_id
Makes list of "next" links
Makes list of "next" links
[ "Makes", "list", "of", "next", "links" ]
def _convert_flags(self,fromlist,tolist,flaglist,context,numlines): """Makes list of "next" links""" # all anchor names will be generated using the unique "to" prefix toprefix = self._prefix[1] # process change flags, generating middle column of next anchors/links next_id = [''...
[ "def", "_convert_flags", "(", "self", ",", "fromlist", ",", "tolist", ",", "flaglist", ",", "context", ",", "numlines", ")", ":", "# all anchor names will be generated using the unique \"to\" prefix", "toprefix", "=", "self", ".", "_prefix", "[", "1", "]", "# proces...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/difflib.py#L1896-L1941
rsummers11/CADLab
976ed959a0b5208bb4173127a7ef732ac73a9b6f
panreas_hnn/hed-globalweight/scripts/cpp_lint.py
python
CheckEmptyBlockBody
(filename, clean_lines, linenum, error)
Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Look for empty loop/conditional body with only a single semicolon.
[ "Look", "for", "empty", "loop", "/", "conditional", "body", "with", "only", "a", "single", "semicolon", "." ]
def CheckEmptyBlockBody(filename, clean_lines, linenum, error): """Look for empty loop/conditional body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
[ "def", "CheckEmptyBlockBody", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Search for loop keywords at the beginning of the line. Because only", "# whitespaces are allowed before the keywords, this will also ignore most", "# do-while-loops, since those...
https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/scripts/cpp_lint.py#L3243-L3275
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/socket.py
python
socket.accept
(self)
return sock, addr
accept() -> (socket object, address info) Wait for an incoming connection. Return a new socket representing the connection, and the address of the client. For IP sockets, the address info is a pair (hostaddr, port).
accept() -> (socket object, address info)
[ "accept", "()", "-", ">", "(", "socket", "object", "address", "info", ")" ]
def accept(self): """accept() -> (socket object, address info) Wait for an incoming connection. Return a new socket representing the connection, and the address of the client. For IP sockets, the address info is a pair (hostaddr, port). """ fd, addr = self._accept() ...
[ "def", "accept", "(", "self", ")", ":", "fd", ",", "addr", "=", "self", ".", "_accept", "(", ")", "sock", "=", "socket", "(", "self", ".", "family", ",", "self", ".", "type", ",", "self", ".", "proto", ",", "fileno", "=", "fd", ")", "# Issue #799...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/socket.py#L205-L219
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlWinParser.SetDC
(*args, **kwargs)
return _html.HtmlWinParser_SetDC(*args, **kwargs)
SetDC(self, DC dc)
SetDC(self, DC dc)
[ "SetDC", "(", "self", "DC", "dc", ")" ]
def SetDC(*args, **kwargs): """SetDC(self, DC dc)""" return _html.HtmlWinParser_SetDC(*args, **kwargs)
[ "def", "SetDC", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWinParser_SetDC", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L244-L246
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/kms/layer1.py
python
KMSConnection.put_key_policy
(self, key_id, policy_name, policy)
return self.make_request(action='PutKeyPolicy', body=json.dumps(params))
Attaches a policy to the specified key. :type key_id: string :param key_id: Unique identifier of the key. This can be an ARN, an alias, or a globally unique identifier. :type policy_name: string :param policy_name: Name of the policy to be attached. Currently, the ...
Attaches a policy to the specified key.
[ "Attaches", "a", "policy", "to", "the", "specified", "key", "." ]
def put_key_policy(self, key_id, policy_name, policy): """ Attaches a policy to the specified key. :type key_id: string :param key_id: Unique identifier of the key. This can be an ARN, an alias, or a globally unique identifier. :type policy_name: string :par...
[ "def", "put_key_policy", "(", "self", ",", "key_id", ",", "policy_name", ",", "policy", ")", ":", "params", "=", "{", "'KeyId'", ":", "key_id", ",", "'PolicyName'", ":", "policy_name", ",", "'Policy'", ":", "policy", ",", "}", "return", "self", ".", "mak...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/kms/layer1.py#L677-L699
fluffos/fluffos
bf54d5d4acef4de49dbed7d184849a7b7b354156
src/thirdparty/fmt/support/docopt.py
python
parse_expr
(tokens, options)
return [Either(*result)] if len(result) > 1 else result
expr ::= seq ( '|' seq )* ;
expr ::= seq ( '|' seq )* ;
[ "expr", "::", "=", "seq", "(", "|", "seq", ")", "*", ";" ]
def parse_expr(tokens, options): """expr ::= seq ( '|' seq )* ;""" seq = parse_seq(tokens, options) if tokens.current() != '|': return seq result = [Required(*seq)] if len(seq) > 1 else seq while tokens.current() == '|': tokens.move() seq = parse_seq(tokens, options) ...
[ "def", "parse_expr", "(", "tokens", ",", "options", ")", ":", "seq", "=", "parse_seq", "(", "tokens", ",", "options", ")", "if", "tokens", ".", "current", "(", ")", "!=", "'|'", ":", "return", "seq", "result", "=", "[", "Required", "(", "*", "seq", ...
https://github.com/fluffos/fluffos/blob/bf54d5d4acef4de49dbed7d184849a7b7b354156/src/thirdparty/fmt/support/docopt.py#L377-L387
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
ipc/ipdl/ipdl/parser.py
python
p_CxxType
(p)
CxxType : QualifiedID | CxxID
CxxType : QualifiedID | CxxID
[ "CxxType", ":", "QualifiedID", "|", "CxxID" ]
def p_CxxType(p): """CxxType : QualifiedID | CxxID""" if isinstance(p[1], QualifiedId): p[0] = TypeSpec(p[1].loc, p[1]) else: loc, id = p[1] p[0] = TypeSpec(loc, QualifiedId(loc, id))
[ "def", "p_CxxType", "(", "p", ")", ":", "if", "isinstance", "(", "p", "[", "1", "]", ",", "QualifiedId", ")", ":", "p", "[", "0", "]", "=", "TypeSpec", "(", "p", "[", "1", "]", ".", "loc", ",", "p", "[", "1", "]", ")", "else", ":", "loc", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/ipc/ipdl/ipdl/parser.py#L688-L695
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ListView.IsSelected
(*args, **kwargs)
return _controls_.ListView_IsSelected(*args, **kwargs)
IsSelected(self, long index) -> bool
IsSelected(self, long index) -> bool
[ "IsSelected", "(", "self", "long", "index", ")", "-", ">", "bool" ]
def IsSelected(*args, **kwargs): """IsSelected(self, long index) -> bool""" return _controls_.ListView_IsSelected(*args, **kwargs)
[ "def", "IsSelected", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListView_IsSelected", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L4928-L4930
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_manager.py
python
CephManager.get_last_scrub_stamp
(self, pool, pgnum)
return stats["last_scrub_stamp"]
Get the timestamp of the last scrub.
Get the timestamp of the last scrub.
[ "Get", "the", "timestamp", "of", "the", "last", "scrub", "." ]
def get_last_scrub_stamp(self, pool, pgnum): """ Get the timestamp of the last scrub. """ stats = self.get_single_pg_stats(self.get_pgid(pool, pgnum)) return stats["last_scrub_stamp"]
[ "def", "get_last_scrub_stamp", "(", "self", ",", "pool", ",", "pgnum", ")", ":", "stats", "=", "self", ".", "get_single_pg_stats", "(", "self", ".", "get_pgid", "(", "pool", ",", "pgnum", ")", ")", "return", "stats", "[", "\"last_scrub_stamp\"", "]" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L2417-L2422
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ToolBar.GetClassDefaultAttributes
(*args, **kwargs)
return _controls_.ToolBar_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific co...
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def GetClassDefaultAttributes(*args, **kwargs): """ GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control...
[ "def", "GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBar_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L3963-L3978
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Web/Python/paraview/web/protocols.py
python
ParaViewWebProtocol.getView
(self, vid)
return view
Returns the view for a given view ID, if vid is None then return the current active view. :param vid: The view ID :type vid: str
Returns the view for a given view ID, if vid is None then return the current active view. :param vid: The view ID :type vid: str
[ "Returns", "the", "view", "for", "a", "given", "view", "ID", "if", "vid", "is", "None", "then", "return", "the", "current", "active", "view", ".", ":", "param", "vid", ":", "The", "view", "ID", ":", "type", "vid", ":", "str" ]
def getView(self, vid): """ Returns the view for a given view ID, if vid is None then return the current active view. :param vid: The view ID :type vid: str """ view = self.mapIdToProxy(vid) if not view: # Use active view is none provided. ...
[ "def", "getView", "(", "self", ",", "vid", ")", ":", "view", "=", "self", ".", "mapIdToProxy", "(", "vid", ")", "if", "not", "view", ":", "# Use active view is none provided.", "view", "=", "simple", ".", "GetActiveView", "(", ")", "if", "not", "view", "...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Web/Python/paraview/web/protocols.py#L119-L134
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextParagraph.SplitAt
(*args, **kwargs)
return _richtext.RichTextParagraph_SplitAt(*args, **kwargs)
SplitAt(self, long pos, RichTextObject previousObject=None) -> RichTextObject
SplitAt(self, long pos, RichTextObject previousObject=None) -> RichTextObject
[ "SplitAt", "(", "self", "long", "pos", "RichTextObject", "previousObject", "=", "None", ")", "-", ">", "RichTextObject" ]
def SplitAt(*args, **kwargs): """SplitAt(self, long pos, RichTextObject previousObject=None) -> RichTextObject""" return _richtext.RichTextParagraph_SplitAt(*args, **kwargs)
[ "def", "SplitAt", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextParagraph_SplitAt", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2003-L2005
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/new_github_file_system.py
python
GithubFileSystem.Read
(self, paths)
return Future(delegate=Gettable(resolve))
Returns a directory mapping |paths| to the contents of the file at each path. If path ends with a '/', it is treated as a directory and is mapped to a list of filenames in that directory.
Returns a directory mapping |paths| to the contents of the file at each path. If path ends with a '/', it is treated as a directory and is mapped to a list of filenames in that directory.
[ "Returns", "a", "directory", "mapping", "|paths|", "to", "the", "contents", "of", "the", "file", "at", "each", "path", ".", "If", "path", "ends", "with", "a", "/", "it", "is", "treated", "as", "a", "directory", "and", "is", "mapped", "to", "a", "list",...
def Read(self, paths): '''Returns a directory mapping |paths| to the contents of the file at each path. If path ends with a '/', it is treated as a directory and is mapped to a list of filenames in that directory. ''' self._EnsureRepoZip() def resolve(): repo_zip = self._repo_zip.Get() ...
[ "def", "Read", "(", "self", ",", "paths", ")", ":", "self", ".", "_EnsureRepoZip", "(", ")", "def", "resolve", "(", ")", ":", "repo_zip", "=", "self", ".", "_repo_zip", ".", "Get", "(", ")", "reads", "=", "{", "}", "for", "path", "in", "paths", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/new_github_file_system.py#L243-L260
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
DateTime.SetToWeekOfYear
(*args, **kwargs)
return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs)
SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime
SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime
[ "SetToWeekOfYear", "(", "int", "year", "int", "numWeek", "int", "weekday", "=", "Mon", ")", "-", ">", "DateTime" ]
def SetToWeekOfYear(*args, **kwargs): """SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime""" return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs)
[ "def", "SetToWeekOfYear", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_SetToWeekOfYear", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3881-L3883
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
GridTableBase.CanHaveAttributes
(*args, **kwargs)
return _grid.GridTableBase_CanHaveAttributes(*args, **kwargs)
CanHaveAttributes(self) -> bool
CanHaveAttributes(self) -> bool
[ "CanHaveAttributes", "(", "self", ")", "-", ">", "bool" ]
def CanHaveAttributes(*args, **kwargs): """CanHaveAttributes(self) -> bool""" return _grid.GridTableBase_CanHaveAttributes(*args, **kwargs)
[ "def", "CanHaveAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridTableBase_CanHaveAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L902-L904