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
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/copy_helper.py
python
FilterExistingComponents
(dst_args, existing_components, bucket_url, gsutil_api)
return (components_to_upload, uploaded_components, existing_objects_to_delete)
Determines course of action for component objects. Given the list of all target objects based on partitioning the file and the list of objects that have already been uploaded successfully, this function determines which objects should be uploaded, which existing components are still valid, and which existing c...
Determines course of action for component objects.
[ "Determines", "course", "of", "action", "for", "component", "objects", "." ]
def FilterExistingComponents(dst_args, existing_components, bucket_url, gsutil_api): """Determines course of action for component objects. Given the list of all target objects based on partitioning the file and the list of objects that have already been uploaded successfully, this ...
[ "def", "FilterExistingComponents", "(", "dst_args", ",", "existing_components", ",", "bucket_url", ",", "gsutil_api", ")", ":", "components_to_upload", "=", "[", "]", "existing_component_names", "=", "[", "component", ".", "object_name", "for", "component", "in", "e...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/copy_helper.py#L3181-L3275
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/hypertreelist.py
python
TreeListColumnInfo.GetSelectedImage
(self)
return self._selected_image
Returns the column image index in the selected state.
Returns the column image index in the selected state.
[ "Returns", "the", "column", "image", "index", "in", "the", "selected", "state", "." ]
def GetSelectedImage(self): """ Returns the column image index in the selected state. """ return self._selected_image
[ "def", "GetSelectedImage", "(", "self", ")", ":", "return", "self", ".", "_selected_image" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hypertreelist.py#L531-L534
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py
python
_BaseNetwork.is_reserved
(self)
return (self.network_address.is_reserved and self.broadcast_address.is_reserved)
Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within one of the reserved IPv6 Network ranges.
Test if the address is otherwise IETF reserved.
[ "Test", "if", "the", "address", "is", "otherwise", "IETF", "reserved", "." ]
def is_reserved(self): """Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within one of the reserved IPv6 Network ranges. """ return (self.network_address.is_reserved and self.broadcast_address.is_reserv...
[ "def", "is_reserved", "(", "self", ")", ":", "return", "(", "self", ".", "network_address", ".", "is_reserved", "and", "self", ".", "broadcast_address", ".", "is_reserved", ")" ]
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py#L1122-L1131
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
Dialog_GetLayoutAdapter
(*args)
return _windows_.Dialog_GetLayoutAdapter(*args)
Dialog_GetLayoutAdapter() -> DialogLayoutAdapter
Dialog_GetLayoutAdapter() -> DialogLayoutAdapter
[ "Dialog_GetLayoutAdapter", "()", "-", ">", "DialogLayoutAdapter" ]
def Dialog_GetLayoutAdapter(*args): """Dialog_GetLayoutAdapter() -> DialogLayoutAdapter""" return _windows_.Dialog_GetLayoutAdapter(*args)
[ "def", "Dialog_GetLayoutAdapter", "(", "*", "args", ")", ":", "return", "_windows_", ".", "Dialog_GetLayoutAdapter", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L928-L930
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
bindings/python/htcondor/htchirp/htchirp.py
python
HTChirp._read
(self, fd, length, offset=None, stride_length=None, stride_skip=None)
return self._get_fixed_data(rb)
Read from a file on the Chirp server :param fd: File descriptor :param length: Number of bytes to read :param offset: Skip this many bytes when reading :param stride_length: Read this many bytes every stride_skip bytes :param stride_skip: Skip this many bytes between reads ...
Read from a file on the Chirp server
[ "Read", "from", "a", "file", "on", "the", "Chirp", "server" ]
def _read(self, fd, length, offset=None, stride_length=None, stride_skip=None): """Read from a file on the Chirp server :param fd: File descriptor :param length: Number of bytes to read :param offset: Skip this many bytes when reading :param stride_length: Read this many bytes e...
[ "def", "_read", "(", "self", ",", "fd", ",", "length", ",", "offset", "=", "None", ",", "stride_length", "=", "None", ",", "stride_skip", "=", "None", ")", ":", "if", "offset", "is", "None", "and", "(", "stride_length", ",", "stride_skip", ")", "!=", ...
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/bindings/python/htcondor/htchirp/htchirp.py#L410-L458
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/api.py
python
to_device
(obj, stream=0, copy=True, to=None)
return to
to_device(obj, stream=0, copy=True, to=None) Allocate and transfer a numpy ndarray or structured scalar to the device. To copy host->device a numpy array:: ary = np.arange(10) d_ary = cuda.to_device(ary) To enqueue the transfer to a stream:: stream = cuda.stream() d_ary ...
to_device(obj, stream=0, copy=True, to=None)
[ "to_device", "(", "obj", "stream", "=", "0", "copy", "=", "True", "to", "=", "None", ")" ]
def to_device(obj, stream=0, copy=True, to=None): """to_device(obj, stream=0, copy=True, to=None) Allocate and transfer a numpy ndarray or structured scalar to the device. To copy host->device a numpy array:: ary = np.arange(10) d_ary = cuda.to_device(ary) To enqueue the transfer to ...
[ "def", "to_device", "(", "obj", ",", "stream", "=", "0", ",", "copy", "=", "True", ",", "to", "=", "None", ")", ":", "if", "to", "is", "None", ":", "to", ",", "new", "=", "devicearray", ".", "auto_device", "(", "obj", ",", "stream", "=", "stream"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/api.py#L80-L115
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/pycc/compiler.py
python
_ModuleCompiler._emit_method_array
(self, llvm_module)
return method_array_ptr
Collect exported methods and emit a PyMethodDef array. :returns: a pointer to the PyMethodDef array.
Collect exported methods and emit a PyMethodDef array.
[ "Collect", "exported", "methods", "and", "emit", "a", "PyMethodDef", "array", "." ]
def _emit_method_array(self, llvm_module): """ Collect exported methods and emit a PyMethodDef array. :returns: a pointer to the PyMethodDef array. """ method_defs = [] for entry in self.export_entries: name = entry.symbol llvm_func_name = self._m...
[ "def", "_emit_method_array", "(", "self", ",", "llvm_module", ")", ":", "method_defs", "=", "[", "]", "for", "entry", "in", "self", ".", "export_entries", ":", "name", "=", "entry", ".", "symbol", "llvm_func_name", "=", "self", ".", "_mangle_method_symbol", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/pycc/compiler.py#L225-L253
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/variables.py
python
Variable.op
(self)
return self._variable.op
The `Operation` of this variable.
The `Operation` of this variable.
[ "The", "Operation", "of", "this", "variable", "." ]
def op(self): """The `Operation` of this variable.""" return self._variable.op
[ "def", "op", "(", "self", ")", ":", "return", "self", ".", "_variable", ".", "op" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/variables.py#L665-L667
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/train/callback/_landscape.py
python
SummaryLandscape._check_json_file_data
(self, json_file_data)
Check json file data.
Check json file data.
[ "Check", "json", "file", "data", "." ]
def _check_json_file_data(self, json_file_data): """Check json file data.""" file_key = ["epoch_group", "model_params_file_map", "step_per_epoch", "unit", "num_samples", "landscape_size", "create_landscape"] for key in json_file_data.keys(): if key not in file_key...
[ "def", "_check_json_file_data", "(", "self", ",", "json_file_data", ")", ":", "file_key", "=", "[", "\"epoch_group\"", ",", "\"model_params_file_map\"", ",", "\"step_per_epoch\"", ",", "\"unit\"", ",", "\"num_samples\"", ",", "\"landscape_size\"", ",", "\"create_landsca...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/callback/_landscape.py#L845-L873
bitconch/bitconch-core
5537f3215b3e3b76f6720d6f908676a6c34bc5db
deploy-stable.py
python
execute_shell
(command, silent=False, cwd=None, shell=True, env=None)
Execute a system command
Execute a system command
[ "Execute", "a", "system", "command" ]
def execute_shell(command, silent=False, cwd=None, shell=True, env=None): """ Execute a system command """ if env is not None: env = dict(**os.environ, **env) if silent: p = Popen( command, shell=shell, stdout=PIPE, stderr=PIPE, cwd=cwd, env=env) stdout, _ = p.c...
[ "def", "execute_shell", "(", "command", ",", "silent", "=", "False", ",", "cwd", "=", "None", ",", "shell", "=", "True", ",", "env", "=", "None", ")", ":", "if", "env", "is", "not", "None", ":", "env", "=", "dict", "(", "*", "*", "os", ".", "en...
https://github.com/bitconch/bitconch-core/blob/5537f3215b3e3b76f6720d6f908676a6c34bc5db/deploy-stable.py#L39-L54
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/browser/extensions/PRESUBMIT.py
python
HistogramValueChecker.CheckForFileDeletion
(self, affected_file)
return True
Emits a warning notification if file has been deleted
Emits a warning notification if file has been deleted
[ "Emits", "a", "warning", "notification", "if", "file", "has", "been", "deleted" ]
def CheckForFileDeletion(self, affected_file): """Emits a warning notification if file has been deleted """ if not affected_file.NewContents(): self.EmitWarning("The file seems to be deleted in the changelist. If " "your intent is to really delete the file, the code in " ...
[ "def", "CheckForFileDeletion", "(", "self", ",", "affected_file", ")", ":", "if", "not", "affected_file", ".", "NewContents", "(", ")", ":", "self", ".", "EmitWarning", "(", "\"The file seems to be deleted in the changelist. If \"", "\"your intent is to really delete the fi...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/browser/extensions/PRESUBMIT.py#L175-L183
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sframe.py
python
SFrame.to_rdd
(self, sc, number_of_partitions=4)
return output_rdd
Convert the current SFrame to the Spark RDD. Parameters ---------- sc : SparkContext sc is an existing SparkContext. number_of_partitions: int number of partitions for the output rdd Returns ---------- out: pyspark.rdd.RDD Notes...
Convert the current SFrame to the Spark RDD.
[ "Convert", "the", "current", "SFrame", "to", "the", "Spark", "RDD", "." ]
def to_rdd(self, sc, number_of_partitions=4): """ Convert the current SFrame to the Spark RDD. Parameters ---------- sc : SparkContext sc is an existing SparkContext. number_of_partitions: int number of partitions for the output rdd Retu...
[ "def", "to_rdd", "(", "self", ",", "sc", ",", "number_of_partitions", "=", "4", ")", ":", "_mt", ".", "_get_metric_tracker", "(", ")", ".", "track", "(", "'sframe.to_rdd'", ")", "if", "not", "RDD_SUPPORT", ":", "raise", "Exception", "(", "\"Support for trans...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sframe.py#L1824-L1897
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/auth.py
python
HTTPDigestAuth.handle_redirect
(self, r, **kwargs)
Reset num_401_calls counter on redirects.
Reset num_401_calls counter on redirects.
[ "Reset", "num_401_calls", "counter", "on", "redirects", "." ]
def handle_redirect(self, r, **kwargs): """Reset num_401_calls counter on redirects.""" if r.is_redirect: self._thread_local.num_401_calls = 1
[ "def", "handle_redirect", "(", "self", ",", "r", ",", "*", "*", "kwargs", ")", ":", "if", "r", ".", "is_redirect", ":", "self", ".", "_thread_local", ".", "num_401_calls", "=", "1" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/auth.py#L229-L232
gklz1982/caffe-yolov2
ebb27029db4ddc0d40e520634633b0fa9cdcc10d
scripts/cpp_lint.py
python
_CppLintState.SetFilters
(self, filters)
Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Raises: ValueError: The comma-sepa...
Sets the error-message filters.
[ "Sets", "the", "error", "-", "message", "filters", "." ]
def SetFilters(self, filters): """Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Ra...
[ "def", "SetFilters", "(", "self", ",", "filters", ")", ":", "# Default filters always have less priority than the flag ones.", "self", ".", "filters", "=", "_DEFAULT_FILTERS", "[", ":", "]", "for", "filt", "in", "filters", ".", "split", "(", "','", ")", ":", "cl...
https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L717-L740
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py
python
Context.max_mag
(self, a, b)
return a.max_mag(b, context=self)
Compares the values numerically with their sign ignored. >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN')) Decimal('7') >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10')) Decimal('-10') >>> ExtendedContext.max_mag(1, -2) Decimal('-2') >>> ExtendedC...
Compares the values numerically with their sign ignored.
[ "Compares", "the", "values", "numerically", "with", "their", "sign", "ignored", "." ]
def max_mag(self, a, b): """Compares the values numerically with their sign ignored. >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN')) Decimal('7') >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10')) Decimal('-10') >>> ExtendedContext.max_mag(1, -2) ...
[ "def", "max_mag", "(", "self", ",", "a", ",", "b", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "max_mag", "(", "b", ",", "context", "=", "self", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L4865-L4880
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xpathParserContext.xpathLastFunction
(self, nargs)
Implement the last() XPath function number last() The last function returns the number of nodes in the context node list.
Implement the last() XPath function number last() The last function returns the number of nodes in the context node list.
[ "Implement", "the", "last", "()", "XPath", "function", "number", "last", "()", "The", "last", "function", "returns", "the", "number", "of", "nodes", "in", "the", "context", "node", "list", "." ]
def xpathLastFunction(self, nargs): """Implement the last() XPath function number last() The last function returns the number of nodes in the context node list. """ libxml2mod.xmlXPathLastFunction(self._o, nargs)
[ "def", "xpathLastFunction", "(", "self", ",", "nargs", ")", ":", "libxml2mod", ".", "xmlXPathLastFunction", "(", "self", ".", "_o", ",", "nargs", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L7559-L7563
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/cpplint.py
python
FindStartOfExpressionInLine
(line, endpos, stack)
return (-1, stack)
Find position at the matching start of current expression. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at this position. stack: nesting stack at endpos. Retu...
Find position at the matching start of current expression.
[ "Find", "position", "at", "the", "matching", "start", "of", "current", "expression", "." ]
def FindStartOfExpressionInLine(line, endpos, stack): """Find position at the matching start of current expression. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at...
[ "def", "FindStartOfExpressionInLine", "(", "line", ",", "endpos", ",", "stack", ")", ":", "i", "=", "endpos", "while", "i", ">=", "0", ":", "char", "=", "line", "[", "i", "]", "if", "char", "in", "')]}'", ":", "# Found end of expression, push to expression s...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L1790-L1864
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TIntV.Del
(self, *args)
return _snap.TIntV_Del(self, *args)
Del(TIntV self, int const & ValN) Parameters: ValN: int const & Del(TIntV self, int const & MnValN, int const & MxValN) Parameters: MnValN: int const & MxValN: int const &
Del(TIntV self, int const & ValN)
[ "Del", "(", "TIntV", "self", "int", "const", "&", "ValN", ")" ]
def Del(self, *args): """ Del(TIntV self, int const & ValN) Parameters: ValN: int const & Del(TIntV self, int const & MnValN, int const & MxValN) Parameters: MnValN: int const & MxValN: int const & """ return _snap.TIntV_Del...
[ "def", "Del", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TIntV_Del", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L15785-L15799
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/configure/libstdcxx.py
python
find_version
(e)
return encode_ver(last_version)
Given the value of environment variable CXX or HOST_CXX, find the version of the libstdc++ it uses.
Given the value of environment variable CXX or HOST_CXX, find the version of the libstdc++ it uses.
[ "Given", "the", "value", "of", "environment", "variable", "CXX", "or", "HOST_CXX", "find", "the", "version", "of", "the", "libstdc", "++", "it", "uses", "." ]
def find_version(e): """Given the value of environment variable CXX or HOST_CXX, find the version of the libstdc++ it uses. """ args = e.split() args += ['-shared', '-Wl,-t'] p = subprocess.Popen(args, stderr=subprocess.STDOUT, stdout=subprocess.PIPE) candidates = [x for x in p.stdout if 'l...
[ "def", "find_version", "(", "e", ")", ":", "args", "=", "e", ".", "split", "(", ")", "args", "+=", "[", "'-shared'", ",", "'-Wl,-t'", "]", "p", "=", "subprocess", ".", "Popen", "(", "args", ",", "stderr", "=", "subprocess", ".", "STDOUT", ",", "std...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/configure/libstdcxx.py#L56-L73
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/MQTTLib.py
python
AWSIoTMQTTThingJobsClient.sendJobsUpdate
(self, jobId, status, statusDetails=None, expectedVersion=0, executionNumber=0, includeJobExecutionState=False, includeJobDocument=False, stepTimeoutInMinutes=None)
return self._AWSIoTMQTTClient.publish(topic, payload, self._QoS)
**Description** Publishes an MQTT message to a corresponding job execution specific topic to update its status according to the parameters. Can be used to change a job from QUEUED to IN_PROGRESS to SUCEEDED or FAILED. **Syntax** .. code:: python #Update job with id 'jobId12...
**Description**
[ "**", "Description", "**" ]
def sendJobsUpdate(self, jobId, status, statusDetails=None, expectedVersion=0, executionNumber=0, includeJobExecutionState=False, includeJobDocument=False, stepTimeoutInMinutes=None): """ **Description** Publishes an MQTT message to a corresponding job execution specific topic to update its sta...
[ "def", "sendJobsUpdate", "(", "self", ",", "jobId", ",", "status", ",", "statusDetails", "=", "None", ",", "expectedVersion", "=", "0", ",", "executionNumber", "=", "0", ",", "includeJobExecutionState", "=", "False", ",", "includeJobDocument", "=", "False", ",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/MQTTLib.py#L1699-L1746
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/topics.py
python
_PublisherImpl.publish
(self, message, connection_override=None)
Publish the data to the topic. If the topic has no subscribers, the method will return without any affect. Access to publish() should be locked using acquire() and release() in order to ensure proper message publish ordering. @param message: message data instance to publish @typ...
Publish the data to the topic. If the topic has no subscribers, the method will return without any affect. Access to publish() should be locked using acquire() and release() in order to ensure proper message publish ordering.
[ "Publish", "the", "data", "to", "the", "topic", ".", "If", "the", "topic", "has", "no", "subscribers", "the", "method", "will", "return", "without", "any", "affect", ".", "Access", "to", "publish", "()", "should", "be", "locked", "using", "acquire", "()", ...
def publish(self, message, connection_override=None): """ Publish the data to the topic. If the topic has no subscribers, the method will return without any affect. Access to publish() should be locked using acquire() and release() in order to ensure proper message publish orderi...
[ "def", "publish", "(", "self", ",", "message", ",", "connection_override", "=", "None", ")", ":", "#TODO: should really just use IOError instead of rospy.ROSException", "if", "self", ".", "closed", ":", "# during shutdown, the topic can get closed, which creates", "# a race con...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/topics.py#L1017-L1111
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/lldb/lldb_commands.py
python
__lldb_init_module
(debugger, *_args)
Register custom commands.
Register custom commands.
[ "Register", "custom", "commands", "." ]
def __lldb_init_module(debugger, *_args): """Register custom commands.""" debugger.HandleCommand( "command script add -f lldb_commands.PrintGlobalServiceContext mongodb-service-context") debugger.HandleCommand( "command script add -f lldb_commands.PrintGlobalServiceContext mongodb-dump-locks...
[ "def", "__lldb_init_module", "(", "debugger", ",", "*", "_args", ")", ":", "debugger", ".", "HandleCommand", "(", "\"command script add -f lldb_commands.PrintGlobalServiceContext mongodb-service-context\"", ")", "debugger", ".", "HandleCommand", "(", "\"command script add -f ll...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/lldb/lldb_commands.py#L6-L12
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py2/commands.py
python
BuildExt.initialize_options
(self)
Prepare for new options
Prepare for new options
[ "Prepare", "for", "new", "options" ]
def initialize_options(self): """ Prepare for new options """ _build_ext.build_ext.initialize_options(self) if _option_defaults.has_key('build_ext'): for opt_name, default in _option_defaults['build_ext']: setattr(self, opt_name, default)
[ "def", "initialize_options", "(", "self", ")", ":", "_build_ext", ".", "build_ext", ".", "initialize_options", "(", "self", ")", "if", "_option_defaults", ".", "has_key", "(", "'build_ext'", ")", ":", "for", "opt_name", ",", "default", "in", "_option_defaults", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rjsmin/_setup/py2/commands.py#L182-L187
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
python
MacTool._CopyStringsFile
(self, source, dest)
Copies a .strings file using iconv to reconvert the input into UTF-16.
Copies a .strings file using iconv to reconvert the input into UTF-16.
[ "Copies", "a", ".", "strings", "file", "using", "iconv", "to", "reconvert", "the", "input", "into", "UTF", "-", "16", "." ]
def _CopyStringsFile(self, source, dest): """Copies a .strings file using iconv to reconvert the input into UTF-16.""" input_code = self._DetectInputEncoding(source) or "UTF-8" # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call # CFPropertyListCreateFromXMLData() behind th...
[ "def", "_CopyStringsFile", "(", "self", ",", "source", ",", "dest", ")", ":", "input_code", "=", "self", ".", "_DetectInputEncoding", "(", "source", ")", "or", "\"UTF-8\"", "# Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call", "# CFPropertyListCreateFromXMLDat...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py#L138-L157
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/plugin.py
python
PluginData.SetClass
(self, cls)
Set the class used to create this plugins instance @param cls: class
Set the class used to create this plugins instance @param cls: class
[ "Set", "the", "class", "used", "to", "create", "this", "plugins", "instance", "@param", "cls", ":", "class" ]
def SetClass(self, cls): """Set the class used to create this plugins instance @param cls: class """ self._cls = cls
[ "def", "SetClass", "(", "self", ",", "cls", ")", ":", "self", ".", "_cls", "=", "cls" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugin.py#L380-L385
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/layer/normalization.py
python
SyncBatchNorm.__init__
(self, num_features, eps=1e-5, momentum=0.9, affine=True, gamma_init='ones', beta_init='zeros', moving_mean_init='zeros', moving_var_init='ones', use_batch_statistics=...
Initialize SyncBatchNorm.
Initialize SyncBatchNorm.
[ "Initialize", "SyncBatchNorm", "." ]
def __init__(self, num_features, eps=1e-5, momentum=0.9, affine=True, gamma_init='ones', beta_init='zeros', moving_mean_init='zeros', moving_var_init='ones', use_batch...
[ "def", "__init__", "(", "self", ",", "num_features", ",", "eps", "=", "1e-5", ",", "momentum", "=", "0.9", ",", "affine", "=", "True", ",", "gamma_init", "=", "'ones'", ",", "beta_init", "=", "'zeros'", ",", "moving_mean_init", "=", "'zeros'", ",", "movi...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/layer/normalization.py#L730-L752
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/msvc.py
python
_augment_exception
(exc, version, arch='')
Add details to the exception message to help guide the user as to what action will resolve it.
Add details to the exception message to help guide the user as to what action will resolve it.
[ "Add", "details", "to", "the", "exception", "message", "to", "help", "guide", "the", "user", "as", "to", "what", "action", "will", "resolve", "it", "." ]
def _augment_exception(exc, version, arch=''): """ Add details to the exception message to help guide the user as to what action will resolve it. """ # Error if MSVC++ directory not found or environment not set message = exc.args[0] if "vcvarsall" in message.lower() or "visual c" in message...
[ "def", "_augment_exception", "(", "exc", ",", "version", ",", "arch", "=", "''", ")", ":", "# Error if MSVC++ directory not found or environment not set", "message", "=", "exc", ".", "args", "[", "0", "]", "if", "\"vcvarsall\"", "in", "message", ".", "lower", "(...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/msvc.py#L333-L366
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
caffe-20160312/scripts/cpp_lint.py
python
CheckSpacing
(filename, clean_lines, linenum, nesting_state, error)
Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't ...
Checks for the correctness of various spacing issues in the code.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "issues", "in", "the", "code", "." ]
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't star...
[ "def", "CheckSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want to check inside C++11", ...
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/scripts/cpp_lint.py#L2643-L2988
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
PageSetupDialogData.SetMarginBottomRight
(*args, **kwargs)
return _windows_.PageSetupDialogData_SetMarginBottomRight(*args, **kwargs)
SetMarginBottomRight(self, Point pt)
SetMarginBottomRight(self, Point pt)
[ "SetMarginBottomRight", "(", "self", "Point", "pt", ")" ]
def SetMarginBottomRight(*args, **kwargs): """SetMarginBottomRight(self, Point pt)""" return _windows_.PageSetupDialogData_SetMarginBottomRight(*args, **kwargs)
[ "def", "SetMarginBottomRight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PageSetupDialogData_SetMarginBottomRight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L4959-L4961
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/image/detection.py
python
CreateMultiRandCropAugmenter
(min_object_covered=0.1, aspect_ratio_range=(0.75, 1.33), area_range=(0.05, 1.0), min_eject_coverage=0.3, max_attempts=50, skip_prob=0)
return DetRandomSelectAug(augs, skip_prob=skip_prob)
Helper function to create multiple random crop augmenters. Parameters ---------- min_object_covered : float or list of float, default=0.1 The cropped area of the image must contain at least this fraction of any bounding box supplied. The value of this parameter should be non-negative. ...
Helper function to create multiple random crop augmenters.
[ "Helper", "function", "to", "create", "multiple", "random", "crop", "augmenters", "." ]
def CreateMultiRandCropAugmenter(min_object_covered=0.1, aspect_ratio_range=(0.75, 1.33), area_range=(0.05, 1.0), min_eject_coverage=0.3, max_attempts=50, skip_prob=0): """Helper function to create multiple random crop augmenters. Parameters ...
[ "def", "CreateMultiRandCropAugmenter", "(", "min_object_covered", "=", "0.1", ",", "aspect_ratio_range", "=", "(", "0.75", ",", "1.33", ")", ",", "area_range", "=", "(", "0.05", ",", "1.0", ")", ",", "min_eject_coverage", "=", "0.3", ",", "max_attempts", "=", ...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/image/detection.py#L418-L480
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/traveltime/TravelTimeManager.py
python
TravelTimeManager.createForwardOperator
(self, **kwargs)
return fop
Create default forward operator for Traveltime modelling. Your want your Manager use a special forward operator you can add them here on default Dijkstra is used.
Create default forward operator for Traveltime modelling.
[ "Create", "default", "forward", "operator", "for", "Traveltime", "modelling", "." ]
def createForwardOperator(self, **kwargs): """Create default forward operator for Traveltime modelling. Your want your Manager use a special forward operator you can add them here on default Dijkstra is used. """ fop = TravelTimeDijkstraModelling(**kwargs) return fop
[ "def", "createForwardOperator", "(", "self", ",", "*", "*", "kwargs", ")", ":", "fop", "=", "TravelTimeDijkstraModelling", "(", "*", "*", "kwargs", ")", "return", "fop" ]
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/traveltime/TravelTimeManager.py#L47-L54
irods/irods
ed6328646cee87182098d569919004049bf4ce21
scripts/irods/pyparsing.py
python
ParserElement.__sub__
(self, other)
return And( [ self, And._ErrorStop(), other ] )
Implementation of - operator, returns C{L{And}} with error stop
Implementation of - operator, returns C{L{And}} with error stop
[ "Implementation", "of", "-", "operator", "returns", "C", "{", "L", "{", "And", "}}", "with", "error", "stop" ]
def __sub__(self, other): """Implementation of - operator, returns C{L{And}} with error stop""" if isinstance( other, basestring ): other = ParserElement.literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %...
[ "def", "__sub__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "basestring", ")", ":", "other", "=", "ParserElement", ".", "literalStringClass", "(", "other", ")", "if", "not", "isinstance", "(", "other", ",", "ParserElement"...
https://github.com/irods/irods/blob/ed6328646cee87182098d569919004049bf4ce21/scripts/irods/pyparsing.py#L1283-L1291
google/omaha
61e8c2833fd69c9a13978400108e5b9ebff24a09
omaha/site_scons/site_tools/atlmfc_vc12_0.py
python
_FindLocalInstall
()
Returns the directory containing the local install of the tool. Returns: Path to tool (as a string), or None if not found.
Returns the directory containing the local install of the tool.
[ "Returns", "the", "directory", "containing", "the", "local", "install", "of", "the", "tool", "." ]
def _FindLocalInstall(): """Returns the directory containing the local install of the tool. Returns: Path to tool (as a string), or None if not found. """ default_dir = os.environ['VCINSTALLDIR'] + 'atlmfc' if os.path.exists(default_dir): return default_dir else: return None
[ "def", "_FindLocalInstall", "(", ")", ":", "default_dir", "=", "os", ".", "environ", "[", "'VCINSTALLDIR'", "]", "+", "'atlmfc'", "if", "os", ".", "path", ".", "exists", "(", "default_dir", ")", ":", "return", "default_dir", "else", ":", "return", "None" ]
https://github.com/google/omaha/blob/61e8c2833fd69c9a13978400108e5b9ebff24a09/omaha/site_scons/site_tools/atlmfc_vc12_0.py#L25-L35
MiniZinc/libminizinc
0848ce7ec78d3051cbe0f9e558af3c9dcfe65606
docs/utils/sphinxtogithub.py
python
sphinx_extension
(app, exception)
Wrapped up as a Sphinx Extension
Wrapped up as a Sphinx Extension
[ "Wrapped", "up", "as", "a", "Sphinx", "Extension" ]
def sphinx_extension(app, exception): "Wrapped up as a Sphinx Extension" if not app.builder.name in ("html", "dirhtml"): return if not app.config.sphinx_to_github: if app.config.sphinx_to_github_verbose: print("Sphinx-to-github: Disabled, doing nothing.") return if...
[ "def", "sphinx_extension", "(", "app", ",", "exception", ")", ":", "if", "not", "app", ".", "builder", ".", "name", "in", "(", "\"html\"", ",", "\"dirhtml\"", ")", ":", "return", "if", "not", "app", ".", "config", ".", "sphinx_to_github", ":", "if", "a...
https://github.com/MiniZinc/libminizinc/blob/0848ce7ec78d3051cbe0f9e558af3c9dcfe65606/docs/utils/sphinxtogithub.py#L300-L344
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
GridSizer.GetCols
(*args, **kwargs)
return _core_.GridSizer_GetCols(*args, **kwargs)
GetCols(self) -> int Returns the number of columns in the sizer.
GetCols(self) -> int
[ "GetCols", "(", "self", ")", "-", ">", "int" ]
def GetCols(*args, **kwargs): """ GetCols(self) -> int Returns the number of columns in the sizer. """ return _core_.GridSizer_GetCols(*args, **kwargs)
[ "def", "GetCols", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "GridSizer_GetCols", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L15237-L15243
Ardour/ardour
a63a18a3387b90c0920d9b1668d2a50bd6302b83
tools/autowaf.py
python
set_options
(opt, debug_by_default=False)
Add standard autowaf options if they havn't been added yet
Add standard autowaf options if they havn't been added yet
[ "Add", "standard", "autowaf", "options", "if", "they", "havn", "t", "been", "added", "yet" ]
def set_options(opt, debug_by_default=False): "Add standard autowaf options if they havn't been added yet" global g_step if g_step > 0: return # Install directory options dirs_options = opt.add_option_group('Installation directories', '') # Move --prefix and --destdir to directory opti...
[ "def", "set_options", "(", "opt", ",", "debug_by_default", "=", "False", ")", ":", "global", "g_step", "if", "g_step", ">", "0", ":", "return", "# Install directory options", "dirs_options", "=", "opt", ".", "add_option_group", "(", "'Installation directories'", "...
https://github.com/Ardour/ardour/blob/a63a18a3387b90c0920d9b1668d2a50bd6302b83/tools/autowaf.py#L34-L86
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Window.SetSizeWH
(*args, **kwargs)
return _core_.Window_SetSizeWH(*args, **kwargs)
SetSizeWH(self, int width, int height) Sets the size of the window in pixels.
SetSizeWH(self, int width, int height)
[ "SetSizeWH", "(", "self", "int", "width", "int", "height", ")" ]
def SetSizeWH(*args, **kwargs): """ SetSizeWH(self, int width, int height) Sets the size of the window in pixels. """ return _core_.Window_SetSizeWH(*args, **kwargs)
[ "def", "SetSizeWH", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_SetSizeWH", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L9365-L9371
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/signal/ltisys.py
python
TransferFunction.__new__
(cls, *system, **kwargs)
return super(TransferFunction, cls).__new__(cls)
Handle object conversion if input is an instance of lti.
Handle object conversion if input is an instance of lti.
[ "Handle", "object", "conversion", "if", "input", "is", "an", "instance", "of", "lti", "." ]
def __new__(cls, *system, **kwargs): """Handle object conversion if input is an instance of lti.""" if len(system) == 1 and isinstance(system[0], LinearTimeInvariant): return system[0].to_tf() # Choose whether to inherit from `lti` or from `dlti` if cls is TransferFunction: ...
[ "def", "__new__", "(", "cls", ",", "*", "system", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "system", ")", "==", "1", "and", "isinstance", "(", "system", "[", "0", "]", ",", "LinearTimeInvariant", ")", ":", "return", "system", "[", "0", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/ltisys.py#L559-L578
PaddlePaddle/Anakin
5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730
tools/external_converter_v2/utils/net/net_parser.py
python
NetParser._funcs_dict
(self)
The dict of funcs.
The dict of funcs.
[ "The", "dict", "of", "funcs", "." ]
def _funcs_dict(self): """ The dict of funcs. """ for func_io in self.func_io_list: func_type = func_io.get_type() if func_type not in self.funcs.keys(): self.funcs[func_type] = list() self.funcs[func_type].append(func_io)
[ "def", "_funcs_dict", "(", "self", ")", ":", "for", "func_io", "in", "self", ".", "func_io_list", ":", "func_type", "=", "func_io", ".", "get_type", "(", ")", "if", "func_type", "not", "in", "self", ".", "funcs", ".", "keys", "(", ")", ":", "self", "...
https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/utils/net/net_parser.py#L79-L87
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISSumBanks.py
python
ReflectometryISISSumBanks.name
(self)
return 'ReflectometryISISSumBanks'
Return the name of the algorithm.
Return the name of the algorithm.
[ "Return", "the", "name", "of", "the", "algorithm", "." ]
def name(self): """Return the name of the algorithm.""" return 'ReflectometryISISSumBanks'
[ "def", "name", "(", "self", ")", ":", "return", "'ReflectometryISISSumBanks'" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISSumBanks.py#L22-L24
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
demo/HuggingFace/NNDF/torch_utils.py
python
use_cuda
(func: Callable)
return wrapper
Tries to send all parameters of a given function to cuda device if user supports it. Object must have a "to(device: str)" and maps to target device "cuda" Basically, uses torch implementation. Wrapped functions musts have keyword argument "use_cuda: bool" which enables or disables toggling of cuda.
Tries to send all parameters of a given function to cuda device if user supports it. Object must have a "to(device: str)" and maps to target device "cuda" Basically, uses torch implementation.
[ "Tries", "to", "send", "all", "parameters", "of", "a", "given", "function", "to", "cuda", "device", "if", "user", "supports", "it", ".", "Object", "must", "have", "a", "to", "(", "device", ":", "str", ")", "and", "maps", "to", "target", "device", "cuda...
def use_cuda(func: Callable): """ Tries to send all parameters of a given function to cuda device if user supports it. Object must have a "to(device: str)" and maps to target device "cuda" Basically, uses torch implementation. Wrapped functions musts have keyword argument "use_cuda: bool" which ena...
[ "def", "use_cuda", "(", "func", ":", "Callable", ")", ":", "def", "_send_args_to_device", "(", "caller_kwargs", ",", "device", ")", ":", "new_kwargs", "=", "{", "}", "for", "k", ",", "v", "in", "caller_kwargs", ".", "items", "(", ")", ":", "if", "getat...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/HuggingFace/NNDF/torch_utils.py#L29-L81
lawy623/SVS
b7c7ae367c82a4797ff4a896a2ff304f02e7f724
caffe/scripts/cpp_lint.py
python
CheckCStyleCast
(filename, linenum, line, raw_line, cast_type, pattern, error)
return True
Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw line of code to check, with comments. cast_type: The string for the C++ cast to recommend. This is eith...
Checks for a C-style cast by looking for the pattern.
[ "Checks", "for", "a", "C", "-", "style", "cast", "by", "looking", "for", "the", "pattern", "." ]
def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. linenum: The number of the line to check. line: The line of code to check. raw_line: The raw ...
[ "def", "CheckCStyleCast", "(", "filename", ",", "linenum", ",", "line", ",", "raw_line", ",", "cast_type", ",", "pattern", ",", "error", ")", ":", "match", "=", "Search", "(", "pattern", ",", "line", ")", "if", "not", "match", ":", "return", "False", "...
https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L4247-L4338
syoyo/tinygltf
e7f1ff5c59d3ca2489923beb239bdf93d863498f
deps/cpplint.py
python
IsInitializerList
(clean_lines, linenum)
return False
Check if current line is inside constructor initializer list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line appears to be inside constructor initializer list, False otherwise.
Check if current line is inside constructor initializer list.
[ "Check", "if", "current", "line", "is", "inside", "constructor", "initializer", "list", "." ]
def IsInitializerList(clean_lines, linenum): """Check if current line is inside constructor initializer list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line appears to be inside constructor initializer list,...
[ "def", "IsInitializerList", "(", "clean_lines", ",", "linenum", ")", ":", "for", "i", "in", "xrange", "(", "linenum", ",", "1", ",", "-", "1", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "i", "]", "if", "i", "==", "linenum", ":", "rem...
https://github.com/syoyo/tinygltf/blob/e7f1ff5c59d3ca2489923beb239bdf93d863498f/deps/cpplint.py#L5038-L5077
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/bindings/samples/server/deprecated/nginx.py
python
RTMPServer.gen_output
(self)
return instance.gen_output()
Generate RTMP output
Generate RTMP output
[ "Generate", "RTMP", "output" ]
def gen_output(self): """Generate RTMP output """ return instance.gen_output()
[ "def", "gen_output", "(", "self", ")", ":", "return", "instance", ".", "gen_output", "(", ")" ]
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/deprecated/nginx.py#L61-L64
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/grpc/aio/_base_server.py
python
ServicerContext.peer_identities
(self)
Gets one or more peer identity(s). Equivalent to servicer_context.auth_context().get(servicer_context.peer_identity_key()) Returns: An iterable of the identities, or None if the call is not authenticated. Each identity is returned as a raw bytes type.
Gets one or more peer identity(s).
[ "Gets", "one", "or", "more", "peer", "identity", "(", "s", ")", "." ]
def peer_identities(self) -> Optional[Iterable[bytes]]: """Gets one or more peer identity(s). Equivalent to servicer_context.auth_context().get(servicer_context.peer_identity_key()) Returns: An iterable of the identities, or None if the call is not authenticated. Ea...
[ "def", "peer_identities", "(", "self", ")", "->", "Optional", "[", "Iterable", "[", "bytes", "]", "]", ":" ]
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/aio/_base_server.py#L273-L282
OGRECave/ogre-next
287307980e6de8910f04f3cc0994451b075071fd
Tools/BlenderExport/ogrepkg/gui.py
python
MenuItem.__init__
(self, text, action=Action())
return
Constructor. @param text Item string. @param action Action to execute on selection.
Constructor.
[ "Constructor", "." ]
def __init__(self, text, action=Action()): """Constructor. @param text Item string. @param action Action to execute on selection. """ ValueModel.__init__(self, text) self.action = action return
[ "def", "__init__", "(", "self", ",", "text", ",", "action", "=", "Action", "(", ")", ")", ":", "ValueModel", ".", "__init__", "(", "self", ",", "text", ")", "self", ".", "action", "=", "action", "return" ]
https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/gui.py#L917-L925
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/multiprocessing/managers.py
python
BaseManager._number_of_objects
(self)
Return the number of shared objects
Return the number of shared objects
[ "Return", "the", "number", "of", "shared", "objects" ]
def _number_of_objects(self): ''' Return the number of shared objects ''' conn = self._Client(self._address, authkey=self._authkey) try: return dispatch(conn, None, 'number_of_objects') finally: conn.close()
[ "def", "_number_of_objects", "(", "self", ")", ":", "conn", "=", "self", ".", "_Client", "(", "self", ".", "_address", ",", "authkey", "=", "self", ".", "_authkey", ")", "try", ":", "return", "dispatch", "(", "conn", ",", "None", ",", "'number_of_objects...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/multiprocessing/managers.py#L555-L563
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/ogr.py
python
FieldDefn.SetType
(self, *args)
return _ogr.FieldDefn_SetType(self, *args)
r""" SetType(FieldDefn self, OGRFieldType type) void OGR_Fld_SetType(OGRFieldDefnH hDefn, OGRFieldType eType) Set the type of this field. This should never be done to an OGRFieldDefn that is already part of an OGRFeatureDefn. This function is the same as the CP...
r""" SetType(FieldDefn self, OGRFieldType type) void OGR_Fld_SetType(OGRFieldDefnH hDefn, OGRFieldType eType)
[ "r", "SetType", "(", "FieldDefn", "self", "OGRFieldType", "type", ")", "void", "OGR_Fld_SetType", "(", "OGRFieldDefnH", "hDefn", "OGRFieldType", "eType", ")" ]
def SetType(self, *args): r""" SetType(FieldDefn self, OGRFieldType type) void OGR_Fld_SetType(OGRFieldDefnH hDefn, OGRFieldType eType) Set the type of this field. This should never be done to an OGRFieldDefn that is already part of an OGRFeatureDefn. T...
[ "def", "SetType", "(", "self", ",", "*", "args", ")", ":", "return", "_ogr", ".", "FieldDefn_SetType", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L5083-L5103
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/cluster/hierarchy.py
python
ClusterNode.is_leaf
(self)
return self.left is None
Return True if the target node is a leaf. Returns ------- leafness : bool True if the target node is a leaf node.
Return True if the target node is a leaf.
[ "Return", "True", "if", "the", "target", "node", "is", "a", "leaf", "." ]
def is_leaf(self): """ Return True if the target node is a leaf. Returns ------- leafness : bool True if the target node is a leaf node. """ return self.left is None
[ "def", "is_leaf", "(", "self", ")", ":", "return", "self", ".", "left", "is", "None" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/cluster/hierarchy.py#L1254-L1264
coinapi/coinapi-sdk
854f21e7f69ea8599ae35c5403565cf299d8b795
oeml-sdk/python/openapi_client/model/position_data.py
python
PositionData._from_openapi_data
(cls, *args, **kwargs)
return self
PositionData - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. ...
PositionData - a model defined in OpenAPI
[ "PositionData", "-", "a", "model", "defined", "in", "OpenAPI" ]
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 """PositionData - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be ...
[ "def", "_from_openapi_data", "(", "cls", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# noqa: E501", "_check_type", "=", "kwargs", ".", "pop", "(", "'_check_type'", ",", "True", ")", "_spec_property_naming", "=", "kwargs", ".", "pop", "(", "'_spec...
https://github.com/coinapi/coinapi-sdk/blob/854f21e7f69ea8599ae35c5403565cf299d8b795/oeml-sdk/python/openapi_client/model/position_data.py#L128-L207
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/quantization/_dbr/utils.py
python
unwrap_observers_from_placeholders
(module: torch.nn.Module)
Restores observers back to their original state.
Restores observers back to their original state.
[ "Restores", "observers", "back", "to", "their", "original", "state", "." ]
def unwrap_observers_from_placeholders(module: torch.nn.Module) -> None: """ Restores observers back to their original state. """ # Note: we cannot use module.named_children() because we can # have two different names refer to the same module, for example # when we are reusing observers for torc...
[ "def", "unwrap_observers_from_placeholders", "(", "module", ":", "torch", ".", "nn", ".", "Module", ")", "->", "None", ":", "# Note: we cannot use module.named_children() because we can", "# have two different names refer to the same module, for example", "# when we are reusing obser...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/_dbr/utils.py#L167-L181
marbl/canu
08b0347f8655ed977a2ac75d35be198601bd7b3d
src/pipelines/dx-canu/resources/bin/dx-get-instance-info.py
python
parse_args
()
return args
Parse the input arguments.
Parse the input arguments.
[ "Parse", "the", "input", "arguments", "." ]
def parse_args(): '''Parse the input arguments.''' ap = argparse.ArgumentParser(description='Get a list of known instance types') ap.add_argument('-m', '--min-memory', help='Minimum memory in GB.', type=int, required=False) ap.add_argument('-...
[ "def", "parse_args", "(", ")", ":", "ap", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Get a list of known instance types'", ")", "ap", ".", "add_argument", "(", "'-m'", ",", "'--min-memory'", ",", "help", "=", "'Minimum memory in GB.'", ",",...
https://github.com/marbl/canu/blob/08b0347f8655ed977a2ac75d35be198601bd7b3d/src/pipelines/dx-canu/resources/bin/dx-get-instance-info.py#L10-L36
xiaolonw/caffe-video_triplet
c39ea1ad6e937ccf7deba4510b7e555165abf05f
scripts/cpp_lint.py
python
CheckCaffeRandom
(filename, clean_lines, linenum, error)
Checks for calls to C random functions (rand, rand_r, random, ...). Caffe code should (almost) always use the caffe_rng_* functions rather than these, as the internal state of these C functions is independent of the native Caffe RNG system which should produce deterministic results for a fixed Caffe seed set u...
Checks for calls to C random functions (rand, rand_r, random, ...).
[ "Checks", "for", "calls", "to", "C", "random", "functions", "(", "rand", "rand_r", "random", "...", ")", "." ]
def CheckCaffeRandom(filename, clean_lines, linenum, error): """Checks for calls to C random functions (rand, rand_r, random, ...). Caffe code should (almost) always use the caffe_rng_* functions rather than these, as the internal state of these C functions is independent of the native Caffe RNG system which s...
[ "def", "CheckCaffeRandom", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "function", "in", "c_random_function_list", ":", "ix", "=", "line", ".", "find", ...
https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/scripts/cpp_lint.py#L1640-L1663
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/dist.py
python
Distribution.exclude
(self, **attrs)
Remove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules,...
Remove items from distribution that are named in keyword arguments
[ "Remove", "items", "from", "distribution", "that", "are", "named", "in", "keyword", "arguments" ]
def exclude(self, **attrs): """Remove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package...
[ "def", "exclude", "(", "self", ",", "*", "*", "attrs", ")", ":", "for", "k", ",", "v", "in", "attrs", ".", "items", "(", ")", ":", "exclude", "=", "getattr", "(", "self", ",", "'_exclude_'", "+", "k", ",", "None", ")", "if", "exclude", ":", "ex...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/dist.py#L880-L901
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/stone-game-v.py
python
Solution.stoneGameV
(self, stoneValue)
return max_score
:type stoneValue: List[int] :rtype: int
:type stoneValue: List[int] :rtype: int
[ ":", "type", "stoneValue", ":", "List", "[", "int", "]", ":", "rtype", ":", "int" ]
def stoneGameV(self, stoneValue): """ :type stoneValue: List[int] :rtype: int """ n = len(stoneValue) prefix = [0] for v in stoneValue: prefix.append(prefix[-1] + v) mid = range(n) dp = [[0]*n for _ in xrange(n)] for i in xran...
[ "def", "stoneGameV", "(", "self", ",", "stoneValue", ")", ":", "n", "=", "len", "(", "stoneValue", ")", "prefix", "=", "[", "0", "]", "for", "v", "in", "stoneValue", ":", "prefix", ".", "append", "(", "prefix", "[", "-", "1", "]", "+", "v", ")", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/stone-game-v.py#L5-L38
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/jinja2/ext.py
python
Extension.attr
(self, name, lineno=None)
return nodes.ExtensionAttribute(self.identifier, name, lineno=lineno)
Return an attribute node for the current extension. This is useful to pass constants on extensions to generated template code. :: self.attr('_my_attribute', lineno=lineno)
Return an attribute node for the current extension. This is useful to pass constants on extensions to generated template code.
[ "Return", "an", "attribute", "node", "for", "the", "current", "extension", ".", "This", "is", "useful", "to", "pass", "constants", "on", "extensions", "to", "generated", "template", "code", "." ]
def attr(self, name, lineno=None): """Return an attribute node for the current extension. This is useful to pass constants on extensions to generated template code. :: self.attr('_my_attribute', lineno=lineno) """ return nodes.ExtensionAttribute(self.identifier, na...
[ "def", "attr", "(", "self", ",", "name", ",", "lineno", "=", "None", ")", ":", "return", "nodes", ".", "ExtensionAttribute", "(", "self", ".", "identifier", ",", "name", ",", "lineno", "=", "lineno", ")" ]
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/ext.py#L104-L112
stellar-deprecated/stellard
67eabb2217bdfa9a6ea317f62338fb6bca458c90
src/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeBool
(self)
return result
Consumes a boolean value. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed.
Consumes a boolean value.
[ "Consumes", "a", "boolean", "value", "." ]
def ConsumeBool(self): """Consumes a boolean value. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed. """ try: result = ParseBool(self.token) except ValueError, e: raise self._ParseError(str(e)) self.NextToken() return result
[ "def", "ConsumeBool", "(", "self", ")", ":", "try", ":", "result", "=", "ParseBool", "(", "self", ".", "token", ")", "except", "ValueError", ",", "e", ":", "raise", "self", ".", "_ParseError", "(", "str", "(", "e", ")", ")", "self", ".", "NextToken",...
https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/text_format.py#L475-L489
zerollzeng/tiny-tensorrt
e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2
third_party/pybind11/tools/clang/cindex.py
python
SourceLocation.column
(self)
return self._get_instantiation()[2]
Get the column represented by this source location.
Get the column represented by this source location.
[ "Get", "the", "column", "represented", "by", "this", "source", "location", "." ]
def column(self): """Get the column represented by this source location.""" return self._get_instantiation()[2]
[ "def", "column", "(", "self", ")", ":", "return", "self", ".", "_get_instantiation", "(", ")", "[", "2", "]" ]
https://github.com/zerollzeng/tiny-tensorrt/blob/e7bdb8f82934342a0f22ce68dfefdb8e15eb72b2/third_party/pybind11/tools/clang/cindex.py#L208-L210
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/ert/ertModelling.py
python
ERTModellingReference.createRHS
(self, mesh, elecs)
return rhs
Create right-hand-side vector.
Create right-hand-side vector.
[ "Create", "right", "-", "hand", "-", "side", "vector", "." ]
def createRHS(self, mesh, elecs): """Create right-hand-side vector.""" rhs = np.zeros((len(elecs), mesh.nodeCount())) for i, e in enumerate(elecs): c = mesh.findCell(e) rhs[i][c.ids()] = c.N(c.shape().rst(e)) return rhs
[ "def", "createRHS", "(", "self", ",", "mesh", ",", "elecs", ")", ":", "rhs", "=", "np", ".", "zeros", "(", "(", "len", "(", "elecs", ")", ",", "mesh", ".", "nodeCount", "(", ")", ")", ")", "for", "i", ",", "e", "in", "enumerate", "(", "elecs", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/ert/ertModelling.py#L442-L448
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/docview.py
python
DocChildFrame.SetView
(self, view)
Sets the view for this frame.
Sets the view for this frame.
[ "Sets", "the", "view", "for", "this", "frame", "." ]
def SetView(self, view): """ Sets the view for this frame. """ self._childView = view
[ "def", "SetView", "(", "self", ",", "view", ")", ":", "self", ".", "_childView", "=", "view" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/docview.py#L2603-L2607
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/pep425tags.py
python
get_impl_version_info
()
Return sys.version_info-like tuple for use in decrementing the minor version.
Return sys.version_info-like tuple for use in decrementing the minor version.
[ "Return", "sys", ".", "version_info", "-", "like", "tuple", "for", "use", "in", "decrementing", "the", "minor", "version", "." ]
def get_impl_version_info(): """Return sys.version_info-like tuple for use in decrementing the minor version.""" if get_abbr_impl() == 'pp': # as per https://github.com/pypa/pip/issues/2882 return (sys.version_info[0], sys.pypy_version_info.major, sys.pypy_version_info.minor)...
[ "def", "get_impl_version_info", "(", ")", ":", "if", "get_abbr_impl", "(", ")", "==", "'pp'", ":", "# as per https://github.com/pypa/pip/issues/2882", "return", "(", "sys", ".", "version_info", "[", "0", "]", ",", "sys", ".", "pypy_version_info", ".", "major", "...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/pep425tags.py#L51-L59
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/arrays/datetimes.py
python
DatetimeArray.normalize
(self)
return type(self)(new_values)._with_freq("infer").tz_localize(self.tz)
Convert times to midnight. The time component of the date-time is converted to midnight i.e. 00:00:00. This is useful in cases, when the time does not matter. Length is unaltered. The timezones are unaffected. This method is available on Series with datetime values under the ``...
Convert times to midnight.
[ "Convert", "times", "to", "midnight", "." ]
def normalize(self) -> DatetimeArray: """ Convert times to midnight. The time component of the date-time is converted to midnight i.e. 00:00:00. This is useful in cases, when the time does not matter. Length is unaltered. The timezones are unaffected. This method is ava...
[ "def", "normalize", "(", "self", ")", "->", "DatetimeArray", ":", "new_values", "=", "normalize_i8_timestamps", "(", "self", ".", "asi8", ",", "self", ".", "tz", ")", "return", "type", "(", "self", ")", "(", "new_values", ")", ".", "_with_freq", "(", "\"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/arrays/datetimes.py#L1054-L1093
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/msvs_emulation.py
python
_AddPrefix
(element, prefix)
Add |prefix| to |element| or each subelement if element is iterable.
Add |prefix| to |element| or each subelement if element is iterable.
[ "Add", "|prefix|", "to", "|element|", "or", "each", "subelement", "if", "element", "is", "iterable", "." ]
def _AddPrefix(element, prefix): """Add |prefix| to |element| or each subelement if element is iterable.""" if element is None: return element # Note, not Iterable because we don't want to handle strings like that. if isinstance(element, list) or isinstance(element, tuple): return [prefix + e for e in e...
[ "def", "_AddPrefix", "(", "element", ",", "prefix", ")", ":", "if", "element", "is", "None", ":", "return", "element", "# Note, not Iterable because we don't want to handle strings like that.", "if", "isinstance", "(", "element", ",", "list", ")", "or", "isinstance", ...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/msvs_emulation.py#L79-L87
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/framemanager.py
python
AuiDockingGuideInfo.__init__
(self, other=None)
Default class constructor. Used internally, do not call it in your code! :param `other`: another instance of :class:`AuiDockingGuideInfo`.
Default class constructor. Used internally, do not call it in your code!
[ "Default", "class", "constructor", ".", "Used", "internally", "do", "not", "call", "it", "in", "your", "code!" ]
def __init__(self, other=None): """ Default class constructor. Used internally, do not call it in your code! :param `other`: another instance of :class:`AuiDockingGuideInfo`. """ if other: self.Assign(other) else: # window representing th...
[ "def", "__init__", "(", "self", ",", "other", "=", "None", ")", ":", "if", "other", ":", "self", ".", "Assign", "(", "other", ")", "else", ":", "# window representing the docking target", "self", ".", "host", "=", "None", "# dock direction (top, bottom, left, ri...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L222-L236
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiPaneInfo.CenterPane
(*args, **kwargs)
return _aui.AuiPaneInfo_CenterPane(*args, **kwargs)
CenterPane(self) -> AuiPaneInfo
CenterPane(self) -> AuiPaneInfo
[ "CenterPane", "(", "self", ")", "-", ">", "AuiPaneInfo" ]
def CenterPane(*args, **kwargs): """CenterPane(self) -> AuiPaneInfo""" return _aui.AuiPaneInfo_CenterPane(*args, **kwargs)
[ "def", "CenterPane", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiPaneInfo_CenterPane", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L517-L519
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/util.py
python
Substituter.__init__
(self)
Create an empty substituter.
Create an empty substituter.
[ "Create", "an", "empty", "substituter", "." ]
def __init__(self): '''Create an empty substituter.''' self.substitutions_ = {} self.dirty_ = True
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "substitutions_", "=", "{", "}", "self", ".", "dirty_", "=", "True" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/util.py#L543-L546
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py
python
Categorical.min
(self, skipna=True)
return self.categories[pointer]
The minimum value of the object. Only ordered `Categoricals` have a minimum! .. versionchanged:: 1.0.0 Returns an NA value on empty arrays Raises ------ TypeError If the `Categorical` is not `ordered`. Returns ------- min : the ...
The minimum value of the object.
[ "The", "minimum", "value", "of", "the", "object", "." ]
def min(self, skipna=True): """ The minimum value of the object. Only ordered `Categoricals` have a minimum! .. versionchanged:: 1.0.0 Returns an NA value on empty arrays Raises ------ TypeError If the `Categorical` is not `ordered`. ...
[ "def", "min", "(", "self", ",", "skipna", "=", "True", ")", ":", "self", ".", "check_for_ordered", "(", "\"min\"", ")", "if", "not", "len", "(", "self", ".", "_codes", ")", ":", "return", "self", ".", "dtype", ".", "na_value", "good", "=", "self", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L2128-L2160
sfzhang15/RefineDet
52b6fe23dc1a160fe710b7734576dca509bf4fae
tools/extra/summarize.py
python
print_table
(table, max_width)
Print a simple nicely-aligned table. table must be a list of (equal-length) lists. Columns are space-separated, and as narrow as possible, but no wider than max_width. Text may overflow columns; note that unlike string.format, this will not affect subsequent columns, if possible.
Print a simple nicely-aligned table.
[ "Print", "a", "simple", "nicely", "-", "aligned", "table", "." ]
def print_table(table, max_width): """Print a simple nicely-aligned table. table must be a list of (equal-length) lists. Columns are space-separated, and as narrow as possible, but no wider than max_width. Text may overflow columns; note that unlike string.format, this will not affect subsequent co...
[ "def", "print_table", "(", "table", ",", "max_width", ")", ":", "max_widths", "=", "[", "max_width", "]", "*", "len", "(", "table", "[", "0", "]", ")", "column_widths", "=", "[", "max", "(", "printed_len", "(", "row", "[", "j", "]", ")", "+", "1", ...
https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/tools/extra/summarize.py#L41-L61
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/struct_types.py
python
MethodInfo.get_declaration
(self)
return common.template_args( "${pre_modifiers}${return_type}${method_name}(${args})${post_modifiers};", pre_modifiers=pre_modifiers, return_type=return_type_str, method_name=self.method_name, args=', '.join([str(arg) for arg in self.args]), post_mo...
Get a declaration for a method.
Get a declaration for a method.
[ "Get", "a", "declaration", "for", "a", "method", "." ]
def get_declaration(self): # type: () -> unicode """Get a declaration for a method.""" pre_modifiers = '' post_modifiers = '' return_type_str = '' if self.static: pre_modifiers = 'static ' if self.const: post_modifiers = ' const' ...
[ "def", "get_declaration", "(", "self", ")", ":", "# type: () -> unicode", "pre_modifiers", "=", "''", "post_modifiers", "=", "''", "return_type_str", "=", "''", "if", "self", ".", "static", ":", "pre_modifiers", "=", "'static '", "if", "self", ".", "const", ":...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/struct_types.py#L65-L90
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
SplitterWindow.GetSashPosition
(*args, **kwargs)
return _windows_.SplitterWindow_GetSashPosition(*args, **kwargs)
GetSashPosition(self) -> int Returns the surrent sash position.
GetSashPosition(self) -> int
[ "GetSashPosition", "(", "self", ")", "-", ">", "int" ]
def GetSashPosition(*args, **kwargs): """ GetSashPosition(self) -> int Returns the surrent sash position. """ return _windows_.SplitterWindow_GetSashPosition(*args, **kwargs)
[ "def", "GetSashPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "SplitterWindow_GetSashPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L1566-L1572
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
GraphicsContext.GetDPI
(*args, **kwargs)
return _gdi_.GraphicsContext_GetDPI(*args, **kwargs)
GetDPI(self) --> (dpiX, dpiY) Returns the resolution of the graphics context in device points per inch
GetDPI(self) --> (dpiX, dpiY)
[ "GetDPI", "(", "self", ")", "--", ">", "(", "dpiX", "dpiY", ")" ]
def GetDPI(*args, **kwargs): """ GetDPI(self) --> (dpiX, dpiY) Returns the resolution of the graphics context in device points per inch """ return _gdi_.GraphicsContext_GetDPI(*args, **kwargs)
[ "def", "GetDPI", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsContext_GetDPI", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L6257-L6263
3drobotics/ardupilot-solo
05a123b002c11dccc905d4d7703a38e5f36ee723
Tools/scripts/update_wiki.py
python
list_posts
()
list posts
list posts
[ "list", "posts" ]
def list_posts(): '''list posts''' posts = server.wp.getPosts(opts.blog_id, opts.username, opts.password, { 'post_type' : 'wiki', 'number' : 1000000 }, [ 'post_title', 'post_id' ]) for p in posts: try: print('post_id=%s post_t...
[ "def", "list_posts", "(", ")", ":", "posts", "=", "server", ".", "wp", ".", "getPosts", "(", "opts", ".", "blog_id", ",", "opts", ".", "username", ",", "opts", ".", "password", ",", "{", "'post_type'", ":", "'wiki'", ",", "'number'", ":", "1000000", ...
https://github.com/3drobotics/ardupilot-solo/blob/05a123b002c11dccc905d4d7703a38e5f36ee723/Tools/scripts/update_wiki.py#L38-L47
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/learn/python/learn/graph_actions.py
python
infer
(restore_checkpoint_path, output_dict, feed_dict=None)
return run_feeds(output_dict=output_dict, feed_dicts=[feed_dict] if feed_dict is not None else [None], restore_checkpoint_path=restore_checkpoint_path)[0]
Restore graph from `restore_checkpoint_path` and run `output_dict` tensors. If `restore_checkpoint_path` is supplied, restore from checkpoint. Otherwise, init all variables. Args: restore_checkpoint_path: A string containing the path to a checkpoint to restore. output_dict: A `dict` mapping string...
Restore graph from `restore_checkpoint_path` and run `output_dict` tensors.
[ "Restore", "graph", "from", "restore_checkpoint_path", "and", "run", "output_dict", "tensors", "." ]
def infer(restore_checkpoint_path, output_dict, feed_dict=None): """Restore graph from `restore_checkpoint_path` and run `output_dict` tensors. If `restore_checkpoint_path` is supplied, restore from checkpoint. Otherwise, init all variables. Args: restore_checkpoint_path: A string containing the path to a...
[ "def", "infer", "(", "restore_checkpoint_path", ",", "output_dict", ",", "feed_dict", "=", "None", ")", ":", "return", "run_feeds", "(", "output_dict", "=", "output_dict", ",", "feed_dicts", "=", "[", "feed_dict", "]", "if", "feed_dict", "is", "not", "None", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/graph_actions.py#L706-L729
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/common.py
python
infer_compression
( filepath_or_buffer: FilePathOrBuffer, compression: Optional[str] )
Get the compression method for filepath_or_buffer. If compression='infer', the inferred compression method is returned. Otherwise, the input compression method is returned unchanged, unless it's invalid, in which case an error is raised. Parameters ---------- filepath_or_buffer : str or file ha...
Get the compression method for filepath_or_buffer. If compression='infer', the inferred compression method is returned. Otherwise, the input compression method is returned unchanged, unless it's invalid, in which case an error is raised.
[ "Get", "the", "compression", "method", "for", "filepath_or_buffer", ".", "If", "compression", "=", "infer", "the", "inferred", "compression", "method", "is", "returned", ".", "Otherwise", "the", "input", "compression", "method", "is", "returned", "unchanged", "unl...
def infer_compression( filepath_or_buffer: FilePathOrBuffer, compression: Optional[str] ) -> Optional[str]: """ Get the compression method for filepath_or_buffer. If compression='infer', the inferred compression method is returned. Otherwise, the input compression method is returned unchanged, unles...
[ "def", "infer_compression", "(", "filepath_or_buffer", ":", "FilePathOrBuffer", ",", "compression", ":", "Optional", "[", "str", "]", ")", "->", "Optional", "[", "str", "]", ":", "# No compression has been explicitly specified", "if", "compression", "is", "None", ":...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/common.py#L259-L311
Caffe-MPI/Caffe-MPI.github.io
df5992af571a2a19981b69635115c393f18d1c76
python/caffe/draw.py
python
get_pydot_graph
(caffe_net, rankdir, label_edges=True)
return pydot_graph
Create a data structure which represents the `caffe_net`. Parameters ---------- caffe_net : object rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. label_edges : boolean, optional Label the edges (default is True). Returns ------- pydot graph object
Create a data structure which represents the `caffe_net`.
[ "Create", "a", "data", "structure", "which", "represents", "the", "caffe_net", "." ]
def get_pydot_graph(caffe_net, rankdir, label_edges=True): """Create a data structure which represents the `caffe_net`. Parameters ---------- caffe_net : object rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. label_edges : boolean, optional Label the edges (default is Tr...
[ "def", "get_pydot_graph", "(", "caffe_net", ",", "rankdir", ",", "label_edges", "=", "True", ")", ":", "pydot_graph", "=", "pydot", ".", "Dot", "(", "caffe_net", ".", "name", "if", "caffe_net", ".", "name", "else", "'Net'", ",", "graph_type", "=", "'digrap...
https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/python/caffe/draw.py#L130-L186
imharrywu/fastcoin
ed7f9152c1409cb88fadd9c1c4b903a194681a94
contrib/devtools/update-translations.py
python
remove_invalid_characters
(s)
return FIX_RE.sub(b'', s)
Remove invalid characters from translation string
Remove invalid characters from translation string
[ "Remove", "invalid", "characters", "from", "translation", "string" ]
def remove_invalid_characters(s): '''Remove invalid characters from translation string''' return FIX_RE.sub(b'', s)
[ "def", "remove_invalid_characters", "(", "s", ")", ":", "return", "FIX_RE", ".", "sub", "(", "b''", ",", "s", ")" ]
https://github.com/imharrywu/fastcoin/blob/ed7f9152c1409cb88fadd9c1c4b903a194681a94/contrib/devtools/update-translations.py#L100-L102
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryengine/ArmoryUtils.py
python
addWalletToList
(inWltPath, inWltList)
Helper function that checks to see if a path contains a valid wallet. If so, the wallet will be added to the incoming list.
Helper function that checks to see if a path contains a valid wallet. If so, the wallet will be added to the incoming list.
[ "Helper", "function", "that", "checks", "to", "see", "if", "a", "path", "contains", "a", "valid", "wallet", ".", "If", "so", "the", "wallet", "will", "be", "added", "to", "the", "incoming", "list", "." ]
def addWalletToList(inWltPath, inWltList): '''Helper function that checks to see if a path contains a valid wallet. If so, the wallet will be added to the incoming list.''' if os.path.isfile(inWltPath): if not inWltPath.endswith('backup.wallet'): openfile = open(inWltPath, 'rb') firs...
[ "def", "addWalletToList", "(", "inWltPath", ",", "inWltList", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "inWltPath", ")", ":", "if", "not", "inWltPath", ".", "endswith", "(", "'backup.wallet'", ")", ":", "openfile", "=", "open", "(", "inWltP...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/ArmoryUtils.py#L1032-L1046
google/usd_from_gltf
6d288cce8b68744494a226574ae1d7ba6a9c46eb
tools/ufgbatch/ufgcommon/util.py
python
TagTracker.add_from_output
(self, output)
Add totals from tags in log output text.
Add totals from tags in log output text.
[ "Add", "totals", "from", "tags", "in", "log", "output", "text", "." ]
def add_from_output(self, output): """Add totals from tags in log output text.""" for line in output.splitlines(): (severity, tag) = get_message_tag(line) if tag: add_in_dictionary(self.tag_totals[severity], tag, 1) if severity != SEVERITY_UNKNOWN: self.totals[severity] += 1
[ "def", "add_from_output", "(", "self", ",", "output", ")", ":", "for", "line", "in", "output", ".", "splitlines", "(", ")", ":", "(", "severity", ",", "tag", ")", "=", "get_message_tag", "(", "line", ")", "if", "tag", ":", "add_in_dictionary", "(", "se...
https://github.com/google/usd_from_gltf/blob/6d288cce8b68744494a226574ae1d7ba6a9c46eb/tools/ufgbatch/ufgcommon/util.py#L263-L270
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/layers/python/layers/feature_column.py
python
_BucketizedColumn.insert_transformed_feature
(self, columns_to_tensors)
Handles sparse column to id conversion.
Handles sparse column to id conversion.
[ "Handles", "sparse", "column", "to", "id", "conversion", "." ]
def insert_transformed_feature(self, columns_to_tensors): """Handles sparse column to id conversion.""" columns_to_tensors[self] = self._transform_feature( _LazyBuilderByColumnsToTensor(columns_to_tensors))
[ "def", "insert_transformed_feature", "(", "self", ",", "columns_to_tensors", ")", ":", "columns_to_tensors", "[", "self", "]", "=", "self", ".", "_transform_feature", "(", "_LazyBuilderByColumnsToTensor", "(", "columns_to_tensors", ")", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/feature_column.py#L2078-L2081
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py
python
SimpleParser.parseTagOpTestNum
(self, sTag, aasSections, iTagLine, iEndLine)
return self.parseTagOpTest(sTag, aasSections, iTagLine, iEndLine)
Numbered \@optest tag. Either \@optest42 or \@optest[42].
Numbered \
[ "Numbered", "\\" ]
def parseTagOpTestNum(self, sTag, aasSections, iTagLine, iEndLine): """ Numbered \@optest tag. Either \@optest42 or \@optest[42]. """ oInstr = self.ensureInstructionForOpTag(iTagLine); iTest = 0; if sTag[-1] == ']': iTest = int(sTag[8:-1]); else: ...
[ "def", "parseTagOpTestNum", "(", "self", ",", "sTag", ",", "aasSections", ",", "iTagLine", ",", "iEndLine", ")", ":", "oInstr", "=", "self", ".", "ensureInstructionForOpTag", "(", "iTagLine", ")", "iTest", "=", "0", "if", "sTag", "[", "-", "1", "]", "=="...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py#L2612-L2626
opengauss-mirror/openGauss-server
e383f1b77720a00ddbe4c0655bc85914d9b02a2b
src/gausskernel/dbmind/tools/anomaly_detection/detector/algorithm/fb_prophet.py
python
FbProphet.fit
(self, timeseries)
:param timeseries: list, it should include timestamp and value like [[111111111, 2222222222, ...], [4.0, 5.0, ...]]. :return: NA
:param timeseries: list, it should include timestamp and value like [[111111111, 2222222222, ...], [4.0, 5.0, ...]]. :return: NA
[ ":", "param", "timeseries", ":", "list", "it", "should", "include", "timestamp", "and", "value", "like", "[[", "111111111", "2222222222", "...", "]", "[", "4", ".", "0", "5", ".", "0", "...", "]]", ".", ":", "return", ":", "NA" ]
def fit(self, timeseries): """ :param timeseries: list, it should include timestamp and value like [[111111111, 2222222222, ...], [4.0, 5.0, ...]]. :return: NA """ timeseries = pd.DataFrame(timeseries, columns=['ds', 'y']) timeseries['ds'] = timeseries['ds'].map( ...
[ "def", "fit", "(", "self", ",", "timeseries", ")", ":", "timeseries", "=", "pd", ".", "DataFrame", "(", "timeseries", ",", "columns", "=", "[", "'ds'", ",", "'y'", "]", ")", "timeseries", "[", "'ds'", "]", "=", "timeseries", "[", "'ds'", "]", ".", ...
https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/anomaly_detection/detector/algorithm/fb_prophet.py#L35-L48
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel._input_check_error
(self, argument, arg_format)
Report an error that the argument is not of the expected format. This is a helper function which gets called by _input_check in several places.
Report an error that the argument is not of the expected format.
[ "Report", "an", "error", "that", "the", "argument", "is", "not", "of", "the", "expected", "format", "." ]
def _input_check_error(self, argument, arg_format): """ Report an error that the argument is not of the expected format. This is a helper function which gets called by _input_check in several places. """ argument_string = '%s' % argument if len(argument_string) ...
[ "def", "_input_check_error", "(", "self", ",", "argument", ",", "arg_format", ")", ":", "argument_string", "=", "'%s'", "%", "argument", "if", "len", "(", "argument_string", ")", ">", "50", ":", "argument_string", "=", "argument_string", "[", ":", "47", "]",...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L8249-L8269
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
Process.GetErrorStream
(*args, **kwargs)
return _misc_.Process_GetErrorStream(*args, **kwargs)
GetErrorStream(self) -> InputStream
GetErrorStream(self) -> InputStream
[ "GetErrorStream", "(", "self", ")", "-", ">", "InputStream" ]
def GetErrorStream(*args, **kwargs): """GetErrorStream(self) -> InputStream""" return _misc_.Process_GetErrorStream(*args, **kwargs)
[ "def", "GetErrorStream", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Process_GetErrorStream", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2023-L2025
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TVoid.__eq__
(self, *args)
return _snap.TVoid___eq__(self, *args)
__eq__(TVoid self, TVoid arg2) -> bool Parameters: arg2: TVoid const &
__eq__(TVoid self, TVoid arg2) -> bool
[ "__eq__", "(", "TVoid", "self", "TVoid", "arg2", ")", "-", ">", "bool" ]
def __eq__(self, *args): """ __eq__(TVoid self, TVoid arg2) -> bool Parameters: arg2: TVoid const & """ return _snap.TVoid___eq__(self, *args)
[ "def", "__eq__", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TVoid___eq__", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L12045-L12053
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
Dialog.CanDoLayoutAdaptation
(*args, **kwargs)
return _windows_.Dialog_CanDoLayoutAdaptation(*args, **kwargs)
CanDoLayoutAdaptation(self) -> bool
CanDoLayoutAdaptation(self) -> bool
[ "CanDoLayoutAdaptation", "(", "self", ")", "-", ">", "bool" ]
def CanDoLayoutAdaptation(*args, **kwargs): """CanDoLayoutAdaptation(self) -> bool""" return _windows_.Dialog_CanDoLayoutAdaptation(*args, **kwargs)
[ "def", "CanDoLayoutAdaptation", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Dialog_CanDoLayoutAdaptation", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L823-L825
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
ez_setup.py
python
_python_cmd
(*args)
return subprocess.call(args) == 0
Execute a command. Return True if the command succeeded.
Execute a command.
[ "Execute", "a", "command", "." ]
def _python_cmd(*args): """ Execute a command. Return True if the command succeeded. """ args = (sys.executable,) + args return subprocess.call(args) == 0
[ "def", "_python_cmd", "(", "*", "args", ")", ":", "args", "=", "(", "sys", ".", "executable", ",", ")", "+", "args", "return", "subprocess", ".", "call", "(", "args", ")", "==", "0" ]
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/ez_setup.py#L47-L54
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/gluon/data/dataset.py
python
Dataset.transform
(self, fn, lazy=True)
return SimpleDataset([i for i in trans])
Returns a new dataset with each sample transformed by the transformer function `fn`. Parameters ---------- fn : callable A transformer function that takes a sample as input and returns the transformed sample. lazy : bool, default True If False...
Returns a new dataset with each sample transformed by the transformer function `fn`.
[ "Returns", "a", "new", "dataset", "with", "each", "sample", "transformed", "by", "the", "transformer", "function", "fn", "." ]
def transform(self, fn, lazy=True): """Returns a new dataset with each sample transformed by the transformer function `fn`. Parameters ---------- fn : callable A transformer function that takes a sample as input and returns the transformed sample. ...
[ "def", "transform", "(", "self", ",", "fn", ",", "lazy", "=", "True", ")", ":", "trans", "=", "_LazyTransformDataset", "(", "self", ",", "fn", ")", "if", "lazy", ":", "return", "trans", "return", "SimpleDataset", "(", "[", "i", "for", "i", "in", "tra...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/data/dataset.py#L43-L66
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/__init__.py
python
DocbookMan
(env, target, source=None, *args, **kw)
return result
A pseudo-Builder, providing a Docbook toolchain for Man page output.
A pseudo-Builder, providing a Docbook toolchain for Man page output.
[ "A", "pseudo", "-", "Builder", "providing", "a", "Docbook", "toolchain", "for", "Man", "page", "output", "." ]
def DocbookMan(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for Man page output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT...
[ "def", "DocbookMan", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "# Init list of targets/sources", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "# I...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/__init__.py#L666-L731
microsoft/Azure-Kinect-Sensor-SDK
d87ef578676c05b9a5d23c097502942753bf3777
src/python/k4a/src/k4a/_bindings/device.py
python
Device.get_imu_sample
(self, timeout_ms:int)
return imu_sample
! Reads an IMU sample. @param timeout_ms (int): Specifies the time in milliseconds the function should block waiting for the sample. If set to 0, the function will return without blocking. Passing a negative number will block indefinitely until data is available, the device...
! Reads an IMU sample.
[ "!", "Reads", "an", "IMU", "sample", "." ]
def get_imu_sample(self, timeout_ms:int)->ImuSample: '''! Reads an IMU sample. @param timeout_ms (int): Specifies the time in milliseconds the function should block waiting for the sample. If set to 0, the function will return without blocking. Passing a negative number ...
[ "def", "get_imu_sample", "(", "self", ",", "timeout_ms", ":", "int", ")", "->", "ImuSample", ":", "imu_sample", "=", "ImuSample", "(", ")", "wait_status", "=", "k4a_device_get_imu_sample", "(", "self", ".", "__device_handle", ",", "_ctypes", ".", "byref", "(",...
https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/d87ef578676c05b9a5d23c097502942753bf3777/src/python/k4a/src/k4a/_bindings/device.py#L345-L400
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/web_perf/metrics/rendering_stats.py
python
GetTimestampEventName
(process)
return 'BenchmarkInstrumentation::ImplThreadRenderingStats'
Returns the name of the events used to count frame timestamps.
Returns the name of the events used to count frame timestamps.
[ "Returns", "the", "name", "of", "the", "events", "used", "to", "count", "frame", "timestamps", "." ]
def GetTimestampEventName(process): """ Returns the name of the events used to count frame timestamps. """ if process.name == 'SurfaceFlinger': return 'vsync_before' event_name = 'BenchmarkInstrumentation::DisplayRenderingStats' for event in process.IterAllSlicesOfName(event_name): if 'data' in event.a...
[ "def", "GetTimestampEventName", "(", "process", ")", ":", "if", "process", ".", "name", "==", "'SurfaceFlinger'", ":", "return", "'vsync_before'", "event_name", "=", "'BenchmarkInstrumentation::DisplayRenderingStats'", "for", "event", "in", "process", ".", "IterAllSlice...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/web_perf/metrics/rendering_stats.py#L124-L134
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Menu.DestroyId
(*args, **kwargs)
return _core_.Menu_DestroyId(*args, **kwargs)
DestroyId(self, int id) -> bool
DestroyId(self, int id) -> bool
[ "DestroyId", "(", "self", "int", "id", ")", "-", ">", "bool" ]
def DestroyId(*args, **kwargs): """DestroyId(self, int id) -> bool""" return _core_.Menu_DestroyId(*args, **kwargs)
[ "def", "DestroyId", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Menu_DestroyId", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12126-L12128
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/tools/clang/tools/scan-build-py/libscanbuild/analyze.py
python
need_analyzer
(args)
return len(args) and not re.search('configure|autogen', args[0])
Check the intent of the build command. When static analyzer run against project configure step, it should be silent and no need to run the analyzer or generate report. To run `scan-build` against the configure step might be necessary, when compiler wrappers are used. That's the moment when build setup...
Check the intent of the build command.
[ "Check", "the", "intent", "of", "the", "build", "command", "." ]
def need_analyzer(args): """ Check the intent of the build command. When static analyzer run against project configure step, it should be silent and no need to run the analyzer or generate report. To run `scan-build` against the configure step might be necessary, when compiler wrappers are used. T...
[ "def", "need_analyzer", "(", "args", ")", ":", "return", "len", "(", "args", ")", "and", "not", "re", ".", "search", "(", "'configure|autogen'", ",", "args", "[", "0", "]", ")" ]
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/tools/scan-build-py/libscanbuild/analyze.py#L91-L101
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/lib/pretty.py
python
RepresentationPrinter._in_deferred_types
(self, cls)
return printer
Check if the given class is specified in the deferred type registry. Returns the printer from the registry if it exists, and None if the class is not in the registry. Successful matches will be moved to the regular type registry for future use.
Check if the given class is specified in the deferred type registry.
[ "Check", "if", "the", "given", "class", "is", "specified", "in", "the", "deferred", "type", "registry", "." ]
def _in_deferred_types(self, cls): """ Check if the given class is specified in the deferred type registry. Returns the printer from the registry if it exists, and None if the class is not in the registry. Successful matches will be moved to the regular type registry for future ...
[ "def", "_in_deferred_types", "(", "self", ",", "cls", ")", ":", "mod", "=", "_safe_getattr", "(", "cls", ",", "'__module__'", ",", "None", ")", "name", "=", "_safe_getattr", "(", "cls", ",", "'__name__'", ",", "None", ")", "key", "=", "(", "mod", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/lib/pretty.py#L401-L417
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/settings.py
python
Settings.setAndSave
(self, **kwargs)
Sets keyword arguments as settings and quietly saves
Sets keyword arguments as settings and quietly saves
[ "Sets", "keyword", "arguments", "as", "settings", "and", "quietly", "saves" ]
def setAndSave(self, **kwargs): """Sets keyword arguments as settings and quietly saves """ if self._ephemeral: return self.update(kwargs) self.save(ignoreErrors=True)
[ "def", "setAndSave", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "_ephemeral", ":", "return", "self", ".", "update", "(", "kwargs", ")", "self", ".", "save", "(", "ignoreErrors", "=", "True", ")" ]
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/settings.py#L119-L126
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/android/gyp/util/md5_check.py
python
_Metadata.GetTag
(self, path, subpath=None)
return ret and ret['tag']
Returns the tag for the given path / subpath.
Returns the tag for the given path / subpath.
[ "Returns", "the", "tag", "for", "the", "given", "path", "/", "subpath", "." ]
def GetTag(self, path, subpath=None): """Returns the tag for the given path / subpath.""" ret = self._GetEntry(path, subpath) return ret and ret['tag']
[ "def", "GetTag", "(", "self", ",", "path", ",", "subpath", "=", "None", ")", ":", "ret", "=", "self", ".", "_GetEntry", "(", "path", ",", "subpath", ")", "return", "ret", "and", "ret", "[", "'tag'", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/gyp/util/md5_check.py#L339-L342
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Validator.IsSilent
(*args, **kwargs)
return _core_.Validator_IsSilent(*args, **kwargs)
IsSilent() -> bool
IsSilent() -> bool
[ "IsSilent", "()", "-", ">", "bool" ]
def IsSilent(*args, **kwargs): """IsSilent() -> bool""" return _core_.Validator_IsSilent(*args, **kwargs)
[ "def", "IsSilent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Validator_IsSilent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L11900-L11902
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/framework/ops.py
python
Tensor.__iter__
(self)
Dummy method to prevent iteration. Do not call. NOTE(mrry): If we register __getitem__ as an overloaded operator, Python will valiantly attempt to iterate over the Tensor from 0 to infinity. Declaring this method prevents this unintended behavior. Raises: TypeError: when invoked.
Dummy method to prevent iteration. Do not call.
[ "Dummy", "method", "to", "prevent", "iteration", ".", "Do", "not", "call", "." ]
def __iter__(self): """Dummy method to prevent iteration. Do not call. NOTE(mrry): If we register __getitem__ as an overloaded operator, Python will valiantly attempt to iterate over the Tensor from 0 to infinity. Declaring this method prevents this unintended behavior. Raises: TypeErro...
[ "def", "__iter__", "(", "self", ")", ":", "raise", "TypeError", "(", "\"'Tensor' object is not iterable.\"", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/ops.py#L488-L499
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/grid.py
python
Grid.GetDefaultCellOverflow
(*args, **kwargs)
return _grid.Grid_GetDefaultCellOverflow(*args, **kwargs)
GetDefaultCellOverflow(self) -> bool
GetDefaultCellOverflow(self) -> bool
[ "GetDefaultCellOverflow", "(", "self", ")", "-", ">", "bool" ]
def GetDefaultCellOverflow(*args, **kwargs): """GetDefaultCellOverflow(self) -> bool""" return _grid.Grid_GetDefaultCellOverflow(*args, **kwargs)
[ "def", "GetDefaultCellOverflow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetDefaultCellOverflow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1802-L1804
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/ultisnips/plugin/UltiSnips/__init__.py
python
SnippetManager._find_snippets
(self, ft, trigger, potentially = False, seen=None)
return parent_results + snips.get_matching_snippets( trigger, potentially)
Find snippets matching trigger ft - file type to search trigger - trigger to match against potentially - also returns snippets that could potentially match; that is which triggers start with the current trigger
Find snippets matching trigger
[ "Find", "snippets", "matching", "trigger" ]
def _find_snippets(self, ft, trigger, potentially = False, seen=None): """ Find snippets matching trigger ft - file type to search trigger - trigger to match against potentially - also returns snippets that could potentially match; that is whic...
[ "def", "_find_snippets", "(", "self", ",", "ft", ",", "trigger", ",", "potentially", "=", "False", ",", "seen", "=", "None", ")", ":", "snips", "=", "self", ".", "_snippets", ".", "get", "(", "ft", ",", "None", ")", "if", "not", "snips", ":", "retu...
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/ultisnips/plugin/UltiSnips/__init__.py#L1058-L1084
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextLine.GetParent
(*args, **kwargs)
return _richtext.RichTextLine_GetParent(*args, **kwargs)
GetParent(self) -> RichTextParagraph
GetParent(self) -> RichTextParagraph
[ "GetParent", "(", "self", ")", "-", ">", "RichTextParagraph" ]
def GetParent(*args, **kwargs): """GetParent(self) -> RichTextParagraph""" return _richtext.RichTextLine_GetParent(*args, **kwargs)
[ "def", "GetParent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextLine_GetParent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1907-L1909