nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py
python
Handler.createLock
(self)
Acquire a thread lock for serializing access to the underlying I/O.
Acquire a thread lock for serializing access to the underlying I/O.
[ "Acquire", "a", "thread", "lock", "for", "serializing", "access", "to", "the", "underlying", "I", "/", "O", "." ]
def createLock(self): """ Acquire a thread lock for serializing access to the underlying I/O. """ self.lock = threading.RLock() _register_at_fork_reinit_lock(self)
[ "def", "createLock", "(", "self", ")", ":", "self", ".", "lock", "=", "threading", ".", "RLock", "(", ")", "_register_at_fork_reinit_lock", "(", "self", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py#L831-L836
linkingvision/rapidvms
20a80c2aa78bd005a8a1556b47c2c50ee530c730
velib/3rdparty/libyuv/setup_links.py
python
LibyuvLinkSetup._ActionForPath
(source_path, link_path=None, check_fn=None, check_msg=None)
return actions
Create zero or more Actions to link to a file or directory. This will be a symlink on POSIX platforms. On Windows this requires that NTFS is version 5.0 or higher (Vista or newer). Args: source_path: Path relative to the Chromium checkout root. For readability, the path may contain slashes, ...
Create zero or more Actions to link to a file or directory.
[ "Create", "zero", "or", "more", "Actions", "to", "link", "to", "a", "file", "or", "directory", "." ]
def _ActionForPath(source_path, link_path=None, check_fn=None, check_msg=None): """Create zero or more Actions to link to a file or directory. This will be a symlink on POSIX platforms. On Windows this requires that NTFS is version 5.0 or higher (Vista or newer). Args: sourc...
[ "def", "_ActionForPath", "(", "source_path", ",", "link_path", "=", "None", ",", "check_fn", "=", "None", ",", "check_msg", "=", "None", ")", ":", "def", "fix_separators", "(", "path", ")", ":", "if", "sys", ".", "platform", ".", "startswith", "(", "'win...
https://github.com/linkingvision/rapidvms/blob/20a80c2aa78bd005a8a1556b47c2c50ee530c730/velib/3rdparty/libyuv/setup_links.py#L322-L386
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TBPGraph.Dump
(self, *args)
return _snap.TBPGraph_Dump(self, *args)
Dump(TBPGraph self, FILE * OutF=stdout) Parameters: OutF: FILE * Dump(TBPGraph self) Parameters: self: TBPGraph const *
Dump(TBPGraph self, FILE * OutF=stdout)
[ "Dump", "(", "TBPGraph", "self", "FILE", "*", "OutF", "=", "stdout", ")" ]
def Dump(self, *args): """ Dump(TBPGraph self, FILE * OutF=stdout) Parameters: OutF: FILE * Dump(TBPGraph self) Parameters: self: TBPGraph const * """ return _snap.TBPGraph_Dump(self, *args)
[ "def", "Dump", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TBPGraph_Dump", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L5301-L5314
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/package_index.py
python
PackageIndex.add_find_links
(self, urls)
Add `urls` to the list that will be prescanned for searches
Add `urls` to the list that will be prescanned for searches
[ "Add", "urls", "to", "the", "list", "that", "will", "be", "prescanned", "for", "searches" ]
def add_find_links(self, urls): """Add `urls` to the list that will be prescanned for searches""" for url in urls: if ( self.to_scan is None # if we have already "gone online" or not URL_SCHEME(url) # or it's a local file/directory or url.sta...
[ "def", "add_find_links", "(", "self", ",", "urls", ")", ":", "for", "url", "in", "urls", ":", "if", "(", "self", ".", "to_scan", "is", "None", "# if we have already \"gone online\"", "or", "not", "URL_SCHEME", "(", "url", ")", "# or it's a local file/directory",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/package_index.py#L529-L542
VowpalWabbit/vowpal_wabbit
866b8fa88ff85a957c7eb72065ea44518b9ba416
python/vowpalwabbit/sklearn.py
python
VWClassifier.predict
(self, X)
return self.classes_[indices]
Predict class labels for samples in X. Args: X : array_like or sparse matrix, shape (n_samples, n_features) Samples. Returns: array, shape [n_samples] : C. Predicted class label per sample.
Predict class labels for samples in X.
[ "Predict", "class", "labels", "for", "samples", "in", "X", "." ]
def predict(self, X): """ Predict class labels for samples in X. Args: X : array_like or sparse matrix, shape (n_samples, n_features) Samples. Returns: array, shape [n_samples] : C. Predicted class label per sample. """ scores = ...
[ "def", "predict", "(", "self", ",", "X", ")", ":", "scores", "=", "self", ".", "decision_function", "(", "X", ")", "if", "len", "(", "scores", ".", "shape", ")", "==", "1", ":", "indices", "=", "(", "scores", ">", "0", ")", ".", "astype", "(", ...
https://github.com/VowpalWabbit/vowpal_wabbit/blob/866b8fa88ff85a957c7eb72065ea44518b9ba416/python/vowpalwabbit/sklearn.py#L589-L606
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/xrc.py
python
XmlResourceHandler.GetNode
(*args, **kwargs)
return _xrc.XmlResourceHandler_GetNode(*args, **kwargs)
GetNode(self) -> XmlNode
GetNode(self) -> XmlNode
[ "GetNode", "(", "self", ")", "-", ">", "XmlNode" ]
def GetNode(*args, **kwargs): """GetNode(self) -> XmlNode""" return _xrc.XmlResourceHandler_GetNode(*args, **kwargs)
[ "def", "GetNode", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_xrc", ".", "XmlResourceHandler_GetNode", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L607-L609
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/eclipse.py
python
CalculateGeneratorInputInfo
(params)
Calculate the generator specific info that gets fed to input (called by gyp).
Calculate the generator specific info that gets fed to input (called by gyp).
[ "Calculate", "the", "generator", "specific", "info", "that", "gets", "fed", "to", "input", "(", "called", "by", "gyp", ")", "." ]
def CalculateGeneratorInputInfo(params): """Calculate the generator specific info that gets fed to input (called by gyp).""" generator_flags = params.get('generator_flags', {}) if generator_flags.get('adjust_static_libraries', False): global generator_wants_static_library_dependencies_adjusted generator...
[ "def", "CalculateGeneratorInputInfo", "(", "params", ")", ":", "generator_flags", "=", "params", ".", "get", "(", "'generator_flags'", ",", "{", "}", ")", "if", "generator_flags", ".", "get", "(", "'adjust_static_libraries'", ",", "False", ")", ":", "global", ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/eclipse.py#L58-L64
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_trackers.py
python
rectangleTracker.p1
(self, point=None)
Set or get the base point of the rectangle.
Set or get the base point of the rectangle.
[ "Set", "or", "get", "the", "base", "point", "of", "the", "rectangle", "." ]
def p1(self, point=None): """Set or get the base point of the rectangle.""" if point: self.setorigin(point) else: return Vector(self.coords.point.getValues()[0].getValue())
[ "def", "p1", "(", "self", ",", "point", "=", "None", ")", ":", "if", "point", ":", "self", ".", "setorigin", "(", "point", ")", "else", ":", "return", "Vector", "(", "self", ".", "coords", ".", "point", ".", "getValues", "(", ")", "[", "0", "]", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_trackers.py#L270-L275
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/constructors.py
python
_looks_like_path
(name)
return False
Checks whether the string "looks like" a path on the filesystem. This does not check whether the target actually exists, only judge from the appearance. Returns true if any of the following conditions is true: * a path separator is found (either os.path.sep or os.path.altsep); * a dot is found (wh...
Checks whether the string "looks like" a path on the filesystem.
[ "Checks", "whether", "the", "string", "looks", "like", "a", "path", "on", "the", "filesystem", "." ]
def _looks_like_path(name): # type: (str) -> bool """Checks whether the string "looks like" a path on the filesystem. This does not check whether the target actually exists, only judge from the appearance. Returns true if any of the following conditions is true: * a path separator is found (ei...
[ "def", "_looks_like_path", "(", "name", ")", ":", "# type: (str) -> bool", "if", "os", ".", "path", ".", "sep", "in", "name", ":", "return", "True", "if", "os", ".", "path", ".", "altsep", "is", "not", "None", "and", "os", ".", "path", ".", "altsep", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/req/constructors.py#L230-L247
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/tseries/holiday.py
python
nearest_workday
(dt)
return dt
If holiday falls on Saturday, use day before (Friday) instead; if holiday falls on Sunday, use day thereafter (Monday) instead.
If holiday falls on Saturday, use day before (Friday) instead; if holiday falls on Sunday, use day thereafter (Monday) instead.
[ "If", "holiday", "falls", "on", "Saturday", "use", "day", "before", "(", "Friday", ")", "instead", ";", "if", "holiday", "falls", "on", "Sunday", "use", "day", "thereafter", "(", "Monday", ")", "instead", "." ]
def nearest_workday(dt): """ If holiday falls on Saturday, use day before (Friday) instead; if holiday falls on Sunday, use day thereafter (Monday) instead. """ if dt.weekday() == 5: return dt - timedelta(1) elif dt.weekday() == 6: return dt + timedelta(1) return dt
[ "def", "nearest_workday", "(", "dt", ")", ":", "if", "dt", ".", "weekday", "(", ")", "==", "5", ":", "return", "dt", "-", "timedelta", "(", "1", ")", "elif", "dt", ".", "weekday", "(", ")", "==", "6", ":", "return", "dt", "+", "timedelta", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/tseries/holiday.py#L75-L84
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/saved_model/utils_impl.py
python
get_or_create_debug_dir
(export_dir)
return debug_dir
Returns path to the debug sub-directory, creating if it does not exist.
Returns path to the debug sub-directory, creating if it does not exist.
[ "Returns", "path", "to", "the", "debug", "sub", "-", "directory", "creating", "if", "it", "does", "not", "exist", "." ]
def get_or_create_debug_dir(export_dir): """Returns path to the debug sub-directory, creating if it does not exist.""" debug_dir = get_debug_dir(export_dir) file_io.recursive_create_dir(debug_dir) return debug_dir
[ "def", "get_or_create_debug_dir", "(", "export_dir", ")", ":", "debug_dir", "=", "get_debug_dir", "(", "export_dir", ")", "file_io", ".", "recursive_create_dir", "(", "debug_dir", ")", "return", "debug_dir" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/utils_impl.py#L253-L259
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/image_ops_impl.py
python
image_gradients
(image)
return dy, dx
Returns image gradients (dy, dx) for each color channel. Both output tensors have the same shape as the input: [batch_size, h, w, d]. The gradient values are organized so that [I(x+1, y) - I(x, y)] is in location (x, y). That means that dy will always have zeros in the last row, and dx will always have zeros i...
Returns image gradients (dy, dx) for each color channel.
[ "Returns", "image", "gradients", "(", "dy", "dx", ")", "for", "each", "color", "channel", "." ]
def image_gradients(image): """Returns image gradients (dy, dx) for each color channel. Both output tensors have the same shape as the input: [batch_size, h, w, d]. The gradient values are organized so that [I(x+1, y) - I(x, y)] is in location (x, y). That means that dy will always have zeros in the last row, ...
[ "def", "image_gradients", "(", "image", ")", ":", "if", "image", ".", "get_shape", "(", ")", ".", "ndims", "!=", "4", ":", "raise", "ValueError", "(", "'image_gradients expects a 4D tensor '", "'[batch_size, h, w, d], not {}.'", ".", "format", "(", "image", ".", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/image_ops_impl.py#L4482-L4551
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/sdist.py
python
sdist.get_archive_files
(self)
return self.archive_files
Return the list of archive files created when the command was run, or None if the command hasn't run yet.
Return the list of archive files created when the command was run, or None if the command hasn't run yet.
[ "Return", "the", "list", "of", "archive", "files", "created", "when", "the", "command", "was", "run", "or", "None", "if", "the", "command", "hasn", "t", "run", "yet", "." ]
def get_archive_files(self): """Return the list of archive files created when the command was run, or None if the command hasn't run yet. """ return self.archive_files
[ "def", "get_archive_files", "(", "self", ")", ":", "return", "self", ".", "archive_files" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/sdist.py#L473-L477
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/environment.py
python
Environment.extend
(self, **attributes)
Add the items to the instance of the environment if they do not exist yet. This is used by :ref:`extensions <writing-extensions>` to register callbacks and configuration values without breaking inheritance.
Add the items to the instance of the environment if they do not exist yet. This is used by :ref:`extensions <writing-extensions>` to register callbacks and configuration values without breaking inheritance.
[ "Add", "the", "items", "to", "the", "instance", "of", "the", "environment", "if", "they", "do", "not", "exist", "yet", ".", "This", "is", "used", "by", ":", "ref", ":", "extensions", "<writing", "-", "extensions", ">", "to", "register", "callbacks", "and...
def extend(self, **attributes): """Add the items to the instance of the environment if they do not exist yet. This is used by :ref:`extensions <writing-extensions>` to register callbacks and configuration values without breaking inheritance. """ for key, value in iteritems(attri...
[ "def", "extend", "(", "self", ",", "*", "*", "attributes", ")", ":", "for", "key", ",", "value", "in", "iteritems", "(", "attributes", ")", ":", "if", "not", "hasattr", "(", "self", ",", "key", ")", ":", "setattr", "(", "self", ",", "key", ",", "...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/environment.py#L347-L354
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py
python
_FunctionState.Begin
(self, function_name)
Start analyzing function body. Args: function_name: The name of the function being tracked.
Start analyzing function body.
[ "Start", "analyzing", "function", "body", "." ]
def Begin(self, function_name): """Start analyzing function body. Args: function_name: The name of the function being tracked. """ self.in_a_function = True self.lines_in_function = 0 self.current_function = function_name
[ "def", "Begin", "(", "self", ",", "function_name", ")", ":", "self", ".", "in_a_function", "=", "True", "self", ".", "lines_in_function", "=", "0", "self", ".", "current_function", "=", "function_name" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py#L821-L829
stack-of-tasks/pinocchio
593d4d43fded997bb9aa2421f4e55294dbd233c4
bindings/python/pinocchio/robot_wrapper.py
python
RobotWrapper.getFrameJacobian
(self, frame_id, rf_frame=pin.ReferenceFrame.LOCAL)
return pin.getFrameJacobian(self.model, self.data, frame_id, rf_frame)
It computes the Jacobian of frame given by its id (frame_id) either expressed in the local coordinate frame or in the world coordinate frame.
It computes the Jacobian of frame given by its id (frame_id) either expressed in the local coordinate frame or in the world coordinate frame.
[ "It", "computes", "the", "Jacobian", "of", "frame", "given", "by", "its", "id", "(", "frame_id", ")", "either", "expressed", "in", "the", "local", "coordinate", "frame", "or", "in", "the", "world", "coordinate", "frame", "." ]
def getFrameJacobian(self, frame_id, rf_frame=pin.ReferenceFrame.LOCAL): """ It computes the Jacobian of frame given by its id (frame_id) either expressed in the local coordinate frame or in the world coordinate frame. """ return pin.getFrameJacobian(self.model, self.data...
[ "def", "getFrameJacobian", "(", "self", ",", "frame_id", ",", "rf_frame", "=", "pin", ".", "ReferenceFrame", ".", "LOCAL", ")", ":", "return", "pin", ".", "getFrameJacobian", "(", "self", ".", "model", ",", "self", ".", "data", ",", "frame_id", ",", "rf_...
https://github.com/stack-of-tasks/pinocchio/blob/593d4d43fded997bb9aa2421f4e55294dbd233c4/bindings/python/pinocchio/robot_wrapper.py#L212-L217
greenheartgames/greenworks
3ea4ab490b56676de3f0a237c74bcfdb17323e60
deps/cpplint/cpplint.py
python
NestingState.UpdatePreprocessor
(self, line)
Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the following assumptions (good enough for most...
Update preprocessor stack.
[ "Update", "preprocessor", "stack", "." ]
def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the ...
[ "def", "UpdatePreprocessor", "(", "self", ",", "line", ")", ":", "if", "Match", "(", "r'^\\s*#\\s*(if|ifdef|ifndef)\\b'", ",", "line", ")", ":", "# Beginning of #if block, save the nesting stack here. The saved", "# stack will allow us to restore the parsing state in the #else cas...
https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L2429-L2483
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/core/platform.py
python
Platform.LaunchApplication
(self, application, parameters=None, elevate_privilege=False)
return self._platform_backend.LaunchApplication( application, parameters, elevate_privilege=elevate_privilege)
Launches the given |application| with a list of |parameters| on the OS. Set |elevate_privilege| to launch the application with root or admin rights. Returns: A popen style process handle for host platforms.
Launches the given |application| with a list of |parameters| on the OS.
[ "Launches", "the", "given", "|application|", "with", "a", "list", "of", "|parameters|", "on", "the", "OS", "." ]
def LaunchApplication(self, application, parameters=None, elevate_privilege=False): """"Launches the given |application| with a list of |parameters| on the OS. Set |elevate_privilege| to launch the application with root or admin rights. ...
[ "def", "LaunchApplication", "(", "self", ",", "application", ",", "parameters", "=", "None", ",", "elevate_privilege", "=", "False", ")", ":", "return", "self", ".", "_platform_backend", ".", "LaunchApplication", "(", "application", ",", "parameters", ",", "elev...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/core/platform.py#L183-L197
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/sort_sources.py
python
ProcessFile
(filename, should_confirm)
Process the input file and rewrite if needed. Args: filename: Path to the input file. should_confirm: If true, diff and confirmation prompt are shown.
Process the input file and rewrite if needed.
[ "Process", "the", "input", "file", "and", "rewrite", "if", "needed", "." ]
def ProcessFile(filename, should_confirm): """Process the input file and rewrite if needed. Args: filename: Path to the input file. should_confirm: If true, diff and confirmation prompt are shown. """ original_lines = [] with open(filename, 'r') as input_file: for line in input_file: origi...
[ "def", "ProcessFile", "(", "filename", ",", "should_confirm", ")", ":", "original_lines", "=", "[", "]", "with", "open", "(", "filename", ",", "'r'", ")", "as", "input_file", ":", "for", "line", "in", "input_file", ":", "original_lines", ".", "append", "("...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/sort_sources.py#L143-L168
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/lib/stepper.py
python
NodeStepper.get_tensor_value
(self, tensor_name)
Get the value of a tensor that the stepper has access to. Args: tensor_name: (str) Name of the tensor. Returns: Value of the tensor, from overriding values or cached tensor handles. Raises: ValueError: If the value is not available as an overriding value or through a TensorHandl...
Get the value of a tensor that the stepper has access to.
[ "Get", "the", "value", "of", "a", "tensor", "that", "the", "stepper", "has", "access", "to", "." ]
def get_tensor_value(self, tensor_name): """Get the value of a tensor that the stepper has access to. Args: tensor_name: (str) Name of the tensor. Returns: Value of the tensor, from overriding values or cached tensor handles. Raises: ValueError: If the value is not available as an o...
[ "def", "get_tensor_value", "(", "self", ",", "tensor_name", ")", ":", "if", "self", ".", "is_placeholder", "(", "tensor_name", ")", ":", "if", "\":\"", "not", "in", "tensor_name", ":", "tensor_name", "+=", "\":0\"", "return", "self", ".", "_client_feed_dict", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/stepper.py#L917-L944
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py
python
BabylMessage.add_label
(self, label)
Add label to list of labels on the message.
Add label to list of labels on the message.
[ "Add", "label", "to", "list", "of", "labels", "on", "the", "message", "." ]
def add_label(self, label): """Add label to list of labels on the message.""" if isinstance(label, str): if label not in self._labels: self._labels.append(label) else: raise TypeError('label must be a string: %s' % type(label))
[ "def", "add_label", "(", "self", ",", "label", ")", ":", "if", "isinstance", "(", "label", ",", "str", ")", ":", "if", "label", "not", "in", "self", ".", "_labels", ":", "self", ".", "_labels", ".", "append", "(", "label", ")", "else", ":", "raise"...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L1780-L1786
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/tabart.py
python
AuiDefaultTabArt.SetAGWFlags
(self, agwFlags)
Sets the tab art flags. :param integer `agwFlags`: a combination of the following values: ==================================== ================================== Flag name Description ==================================== ================================== ...
Sets the tab art flags.
[ "Sets", "the", "tab", "art", "flags", "." ]
def SetAGWFlags(self, agwFlags): """ Sets the tab art flags. :param integer `agwFlags`: a combination of the following values: ==================================== ================================== Flag name Description ===================...
[ "def", "SetAGWFlags", "(", "self", ",", "agwFlags", ")", ":", "self", ".", "_agwFlags", "=", "agwFlags" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/tabart.py#L211-L248
jeog/TDAmeritradeAPI
91c738afd7d57b54f6231170bd64c2550fafd34d
python/tdma_api/stream.py
python
StreamingSession.is_active
(self)
return bool(clib.get_val(self._abi("IsActive"), c_int, self._obj))
Returns if the session is active.
Returns if the session is active.
[ "Returns", "if", "the", "session", "is", "active", "." ]
def is_active(self): """Returns if the session is active.""" return bool(clib.get_val(self._abi("IsActive"), c_int, self._obj))
[ "def", "is_active", "(", "self", ")", ":", "return", "bool", "(", "clib", ".", "get_val", "(", "self", ".", "_abi", "(", "\"IsActive\"", ")", ",", "c_int", ",", "self", ".", "_obj", ")", ")" ]
https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/stream.py#L250-L252
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/SavePlot1DAsJson.py
python
SavePlot1DAsJson.summary
(self)
return "Plottable data file in Json format"
Return summary
Return summary
[ "Return", "summary" ]
def summary(self): """ Return summary """ return "Plottable data file in Json format"
[ "def", "summary", "(", "self", ")", ":", "return", "\"Plottable data file in Json format\"" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/SavePlot1DAsJson.py#L31-L34
adnanaziz/epicode
e81d4387d2ae442d21631dfc958690d424e1d84d
cpp/cpplint.py
python
_CppLintState.ResetErrorCounts
(self)
Sets the module's error statistic back to zero.
Sets the module's error statistic back to zero.
[ "Sets", "the", "module", "s", "error", "statistic", "back", "to", "zero", "." ]
def ResetErrorCounts(self): """Sets the module's error statistic back to zero.""" self.error_count = 0 self.errors_by_category = {}
[ "def", "ResetErrorCounts", "(", "self", ")", ":", "self", ".", "error_count", "=", "0", "self", ".", "errors_by_category", "=", "{", "}" ]
https://github.com/adnanaziz/epicode/blob/e81d4387d2ae442d21631dfc958690d424e1d84d/cpp/cpplint.py#L546-L549
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
wrap/gtwrap/interface_parser/function.py
python
ArgumentList.names
(self)
return [arg.name for arg in self.args_list]
Return a list of the names of all the arguments.
Return a list of the names of all the arguments.
[ "Return", "a", "list", "of", "the", "names", "of", "all", "the", "arguments", "." ]
def names(self) -> List[str]: """Return a list of the names of all the arguments.""" return [arg.name for arg in self.args_list]
[ "def", "names", "(", "self", ")", "->", "List", "[", "str", "]", ":", "return", "[", "arg", ".", "name", "for", "arg", "in", "self", ".", "args_list", "]" ]
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/wrap/gtwrap/interface_parser/function.py#L89-L91
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py
python
DataCol.take_data
(self)
return self.data
return the data
return the data
[ "return", "the", "data" ]
def take_data(self): """ return the data """ return self.data
[ "def", "take_data", "(", "self", ")", ":", "return", "self", ".", "data" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py#L2230-L2232
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
uCSIsCatMn
(code)
return ret
Check whether the character is part of Mn UCS Category
Check whether the character is part of Mn UCS Category
[ "Check", "whether", "the", "character", "is", "part", "of", "Mn", "UCS", "Category" ]
def uCSIsCatMn(code): """Check whether the character is part of Mn UCS Category """ ret = libxml2mod.xmlUCSIsCatMn(code) return ret
[ "def", "uCSIsCatMn", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsCatMn", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1528-L1531
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
modules/thermal_hydraulics/python/peacock/ModelBuilder/FlowChannelGeometries.py
python
FlowChannelGeometry.name
(self)
return self.NAME
Return the name of the flow channel geometry
Return the name of the flow channel geometry
[ "Return", "the", "name", "of", "the", "flow", "channel", "geometry" ]
def name(self): """ Return the name of the flow channel geometry """ return self.NAME
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "NAME" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/modules/thermal_hydraulics/python/peacock/ModelBuilder/FlowChannelGeometries.py#L20-L24
NERSC/timemory
431912b360ff50d1a160d7826e2eea04fbd1037f
timemory/profiler/__main__.py
python
find_script
(script_name)
Find the script. If the input is not a file, then $PATH will be searched.
Find the script.
[ "Find", "the", "script", "." ]
def find_script(script_name): """Find the script. If the input is not a file, then $PATH will be searched. """ if os.path.isfile(script_name): return script_name path = os.getenv("PATH", os.defpath).split(os.pathsep) for dir in path: if dir == "": continue fn...
[ "def", "find_script", "(", "script_name", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "script_name", ")", ":", "return", "script_name", "path", "=", "os", ".", "getenv", "(", "\"PATH\"", ",", "os", ".", "defpath", ")", ".", "split", "(", "...
https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/timemory/profiler/__main__.py#L56-L72
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
samples/gamepad/mappingGUI.py
python
MappingGUIDemo.closeDialog
(self, action, newInputType, newInput)
Called in callback when the dialog is closed. newInputType will be "button" or "axis", or None if the remapping was cancelled.
Called in callback when the dialog is closed. newInputType will be "button" or "axis", or None if the remapping was cancelled.
[ "Called", "in", "callback", "when", "the", "dialog", "is", "closed", ".", "newInputType", "will", "be", "button", "or", "axis", "or", "None", "if", "the", "remapping", "was", "cancelled", "." ]
def closeDialog(self, action, newInputType, newInput): """Called in callback when the dialog is closed. newInputType will be "button" or "axis", or None if the remapping was cancelled.""" self.dlgInput = None if newInputType is not None: # map the event to the given action...
[ "def", "closeDialog", "(", "self", ",", "action", ",", "newInputType", ",", "newInput", ")", ":", "self", ".", "dlgInput", "=", "None", "if", "newInputType", "is", "not", "None", ":", "# map the event to the given action", "if", "newInputType", "==", "\"axis\"",...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/gamepad/mappingGUI.py#L259-L288
google/google-api-cpp-client
3df15df632bef43eb320645ac3329d872aabf5ad
prepare_dependencies.py
python
JsonCppPackageInstaller.__init__
(self, config, url)
Standard PackageInstaller initializer.
Standard PackageInstaller initializer.
[ "Standard", "PackageInstaller", "initializer", "." ]
def __init__(self, config, url): """Standard PackageInstaller initializer.""" super(JsonCppPackageInstaller, self).__init__(config, url) self._config_type = CMAKE_CONFIG
[ "def", "__init__", "(", "self", ",", "config", ",", "url", ")", ":", "super", "(", "JsonCppPackageInstaller", ",", "self", ")", ".", "__init__", "(", "config", ",", "url", ")", "self", ".", "_config_type", "=", "CMAKE_CONFIG" ]
https://github.com/google/google-api-cpp-client/blob/3df15df632bef43eb320645ac3329d872aabf5ad/prepare_dependencies.py#L718-L721
bareos/bareos
56a10bb368b0a81e977bb51304033fe49d59efb0
devtools/pip-tools/check_sources/file_util.py
python
is_valid_textfile
(file_path, ignorelist)
return True
check if the file is a non-ignored textfile
check if the file is a non-ignored textfile
[ "check", "if", "the", "file", "is", "a", "non", "-", "ignored", "textfile" ]
def is_valid_textfile(file_path, ignorelist): """check if the file is a non-ignored textfile""" if not file_path.is_file(): return False if file_is_ignored(file_path, ignorelist): return False mime = magic.from_file(str(file_path), mime=True) if not mime.startswith("text/"): ...
[ "def", "is_valid_textfile", "(", "file_path", ",", "ignorelist", ")", ":", "if", "not", "file_path", ".", "is_file", "(", ")", ":", "return", "False", "if", "file_is_ignored", "(", "file_path", ",", "ignorelist", ")", ":", "return", "False", "mime", "=", "...
https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/devtools/pip-tools/check_sources/file_util.py#L43-L56
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/perf/metrics/v8_object_stats.py
python
V8ObjectStatsMetric.AddResults
(self, tab, results)
Add results for this page to the results object.
Add results for this page to the results object.
[ "Add", "results", "for", "this", "page", "to", "the", "results", "object", "." ]
def AddResults(self, tab, results): """Add results for this page to the results object.""" assert self._results != None, 'Must call Stop() first' for counter_name in self._results: display_name = counter_name.replace('.', '_') results.Add(display_name, 'kb', self._results[counter_name] / 1024.0)
[ "def", "AddResults", "(", "self", ",", "tab", ",", "results", ")", ":", "assert", "self", ".", "_results", "!=", "None", ",", "'Must call Stop() first'", "for", "counter_name", "in", "self", ".", "_results", ":", "display_name", "=", "counter_name", ".", "re...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/perf/metrics/v8_object_stats.py#L211-L216
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/model.py
python
FeedForward._init_params
(self, inputs, overwrite=False)
return (arg_names, list(param_names), aux_names)
Initialize weight parameters and auxiliary states.
Initialize weight parameters and auxiliary states.
[ "Initialize", "weight", "parameters", "and", "auxiliary", "states", "." ]
def _init_params(self, inputs, overwrite=False): """Initialize weight parameters and auxiliary states.""" inputs = [x if isinstance(x, DataDesc) else DataDesc(*x) for x in inputs] input_shapes = {item.name: item.shape for item in inputs} arg_shapes, _, aux_shapes = self.symbol.infer_shap...
[ "def", "_init_params", "(", "self", ",", "inputs", ",", "overwrite", "=", "False", ")", ":", "inputs", "=", "[", "x", "if", "isinstance", "(", "x", ",", "DataDesc", ")", "else", "DataDesc", "(", "*", "x", ")", "for", "x", "in", "inputs", "]", "inpu...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/model.py#L582-L620
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py
python
NDFrame.infer_objects
(self: FrameOrSeries)
return self._constructor( self._data.convert( datetime=True, numeric=False, timedelta=True, coerce=False, copy=True ) ).__finalize__(self)
Attempt to infer better dtypes for object columns. Attempts soft conversion of object-dtyped columns, leaving non-object and unconvertible columns unchanged. The inference rules are the same as during normal Series/DataFrame construction. .. versionadded:: 0.21.0 Retur...
Attempt to infer better dtypes for object columns.
[ "Attempt", "to", "infer", "better", "dtypes", "for", "object", "columns", "." ]
def infer_objects(self: FrameOrSeries) -> FrameOrSeries: """ Attempt to infer better dtypes for object columns. Attempts soft conversion of object-dtyped columns, leaving non-object and unconvertible columns unchanged. The inference rules are the same as during normal Se...
[ "def", "infer_objects", "(", "self", ":", "FrameOrSeries", ")", "->", "FrameOrSeries", ":", "# numeric=False necessary to only soft convert;", "# python objects will still be converted to", "# native numpy numeric types", "return", "self", ".", "_constructor", "(", "self", ".",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L5873-L5920
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/py/buffer.py
python
Buffer.hasChanged
(self)
Return True if text in editor has changed since last save.
Return True if text in editor has changed since last save.
[ "Return", "True", "if", "text", "in", "editor", "has", "changed", "since", "last", "save", "." ]
def hasChanged(self): """Return True if text in editor has changed since last save.""" if self.editor: return self.editor.hasChanged() else: return False
[ "def", "hasChanged", "(", "self", ")", ":", "if", "self", ".", "editor", ":", "return", "self", ".", "editor", ".", "hasChanged", "(", ")", "else", ":", "return", "False" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/buffer.py#L47-L52
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/ma/core.py
python
MaskedArray.trace
(self, offset=0, axis1=0, axis2=1, dtype=None, out=None)
(this docstring should be overwritten)
(this docstring should be overwritten)
[ "(", "this", "docstring", "should", "be", "overwritten", ")" ]
def trace(self, offset=0, axis1=0, axis2=1, dtype=None, out=None): """ (this docstring should be overwritten) """ #!!!: implement out + test! m = self._mask if m is nomask: result = super(MaskedArray, self).trace(offset=offset, axis1=axis1, ...
[ "def", "trace", "(", "self", ",", "offset", "=", "0", ",", "axis1", "=", "0", ",", "axis2", "=", "1", ",", "dtype", "=", "None", ",", "out", "=", "None", ")", ":", "#!!!: implement out + test!", "m", "=", "self", ".", "_mask", "if", "m", "is", "n...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L4360-L4372
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py
python
AbstractChildWatcher.remove_child_handler
(self, pid)
Removes the handler for process 'pid'. The function returns True if the handler was successfully removed, False if there was nothing to remove.
Removes the handler for process 'pid'.
[ "Removes", "the", "handler", "for", "process", "pid", "." ]
def remove_child_handler(self, pid): """Removes the handler for process 'pid'. The function returns True if the handler was successfully removed, False if there was nothing to remove.""" raise NotImplementedError()
[ "def", "remove_child_handler", "(", "self", ",", "pid", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py#L820-L826
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/addins/c.py
python
CAddin.generateFunction
(self, func)
return self.bufferFunction_.text() % { 'libraryConversions' : func.parameterList().generate(self.libraryConversions_), 'referenceConversions' : func.parameterList().generate(self.referenceConversions_), 'enumConversions' : func.parameterList().generate(self.enumConversions_), ...
Generate source code for function.
Generate source code for function.
[ "Generate", "source", "code", "for", "function", "." ]
def generateFunction(self, func): """Generate source code for function.""" return self.bufferFunction_.text() % { 'libraryConversions' : func.parameterList().generate(self.libraryConversions_), 'referenceConversions' : func.parameterList().generate(self.referenceConversions_), ...
[ "def", "generateFunction", "(", "self", ",", "func", ")", ":", "return", "self", ".", "bufferFunction_", ".", "text", "(", ")", "%", "{", "'libraryConversions'", ":", "func", ".", "parameterList", "(", ")", ".", "generate", "(", "self", ".", "libraryConver...
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/addins/c.py#L93-L101
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/cookielib.py
python
CookieJar.set_cookie_if_ok
(self, cookie, request)
Set a cookie if policy says it's OK to do so.
Set a cookie if policy says it's OK to do so.
[ "Set", "a", "cookie", "if", "policy", "says", "it", "s", "OK", "to", "do", "so", "." ]
def set_cookie_if_ok(self, cookie, request): """Set a cookie if policy says it's OK to do so.""" self._cookies_lock.acquire() try: self._policy._now = self._now = int(time.time()) if self._policy.set_ok(cookie, request): self.set_cookie(cookie) ...
[ "def", "set_cookie_if_ok", "(", "self", ",", "cookie", ",", "request", ")", ":", "self", ".", "_cookies_lock", ".", "acquire", "(", ")", "try", ":", "self", ".", "_policy", ".", "_now", "=", "self", ".", "_now", "=", "int", "(", "time", ".", "time", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/cookielib.py#L1609-L1620
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/c_config.py
python
check
(self, *k, **kw)
return ret
Performs a configuration test by calling :py:func:`waflib.Configure.run_build`. For the complete list of parameters, see :py:func:`waflib.Tools.c_config.validate_c`. To force a specific compiler, pass ``compiler='c'`` or ``compiler='cxx'`` to the list of arguments Besides build targets, complete builds can be given...
Performs a configuration test by calling :py:func:`waflib.Configure.run_build`. For the complete list of parameters, see :py:func:`waflib.Tools.c_config.validate_c`. To force a specific compiler, pass ``compiler='c'`` or ``compiler='cxx'`` to the list of arguments
[ "Performs", "a", "configuration", "test", "by", "calling", ":", "py", ":", "func", ":", "waflib", ".", "Configure", ".", "run_build", ".", "For", "the", "complete", "list", "of", "parameters", "see", ":", "py", ":", "func", ":", "waflib", ".", "Tools", ...
def check(self, *k, **kw): """ Performs a configuration test by calling :py:func:`waflib.Configure.run_build`. For the complete list of parameters, see :py:func:`waflib.Tools.c_config.validate_c`. To force a specific compiler, pass ``compiler='c'`` or ``compiler='cxx'`` to the list of arguments Besides build targ...
[ "def", "check", "(", "self", ",", "*", "k", ",", "*", "*", "kw", ")", ":", "self", ".", "validate_c", "(", "kw", ")", "self", ".", "start_msg", "(", "kw", "[", "'msg'", "]", ",", "*", "*", "kw", ")", "ret", "=", "None", "try", ":", "ret", "...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/c_config.py#L634-L670
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/lookup.py
python
RosdepView.lookup
(self, rosdep_name)
return self.rosdep_defs[rosdep_name]
:returns: :class:`RosdepDefinition` :raises: :exc:`KeyError` If *rosdep_name* is not declared
:returns: :class:`RosdepDefinition` :raises: :exc:`KeyError` If *rosdep_name* is not declared
[ ":", "returns", ":", ":", "class", ":", "RosdepDefinition", ":", "raises", ":", ":", "exc", ":", "KeyError", "If", "*", "rosdep_name", "*", "is", "not", "declared" ]
def lookup(self, rosdep_name): """ :returns: :class:`RosdepDefinition` :raises: :exc:`KeyError` If *rosdep_name* is not declared """ return self.rosdep_defs[rosdep_name]
[ "def", "lookup", "(", "self", ",", "rosdep_name", ")", ":", "return", "self", ".", "rosdep_defs", "[", "rosdep_name", "]" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/lookup.py#L182-L187
livecode/livecode
4606a10ea10b16d5071d0f9f263ccdd7ede8b31d
gyp/pylib/gyp/MSVSVersion.py
python
VisualStudioVersion.UsesVcxproj
(self)
return self.uses_vcxproj
Returns true if this version uses a vcxproj file.
Returns true if this version uses a vcxproj file.
[ "Returns", "true", "if", "this", "version", "uses", "a", "vcxproj", "file", "." ]
def UsesVcxproj(self): """Returns true if this version uses a vcxproj file.""" return self.uses_vcxproj
[ "def", "UsesVcxproj", "(", "self", ")", ":", "return", "self", ".", "uses_vcxproj" ]
https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/MSVSVersion.py#L50-L52
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/init_ops.py
python
_compute_fans
(shape)
return fan_in, fan_out
Computes the number of input and output units for a weight shape. Arguments: shape: Integer shape tuple or TF tensor shape. Returns: A tuple of scalars (fan_in, fan_out).
Computes the number of input and output units for a weight shape.
[ "Computes", "the", "number", "of", "input", "and", "output", "units", "for", "a", "weight", "shape", "." ]
def _compute_fans(shape): """Computes the number of input and output units for a weight shape. Arguments: shape: Integer shape tuple or TF tensor shape. Returns: A tuple of scalars (fan_in, fan_out). """ if len(shape) < 1: # Just to avoid errors for constants. fan_in = fan_out = 1 elif len(sh...
[ "def", "_compute_fans", "(", "shape", ")", ":", "if", "len", "(", "shape", ")", "<", "1", ":", "# Just to avoid errors for constants.", "fan_in", "=", "fan_out", "=", "1", "elif", "len", "(", "shape", ")", "==", "1", ":", "fan_in", "=", "fan_out", "=", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/init_ops.py#L582-L606
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/_ctypes/symbol.py
python
_init_symbol_module
(symbol_class, root_namespace)
List and add all the atomic symbol functions to current module.
List and add all the atomic symbol functions to current module.
[ "List", "and", "add", "all", "the", "atomic", "symbol", "functions", "to", "current", "module", "." ]
def _init_symbol_module(symbol_class, root_namespace): """List and add all the atomic symbol functions to current module.""" _set_symbol_class(symbol_class) plist = ctypes.POINTER(ctypes.c_char_p)() size = ctypes.c_uint() check_call(_LIB.NNListAllOpNames(ctypes.byref(size), ...
[ "def", "_init_symbol_module", "(", "symbol_class", ",", "root_namespace", ")", ":", "_set_symbol_class", "(", "symbol_class", ")", "plist", "=", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_char_p", ")", "(", ")", "size", "=", "ctypes", ".", "c_uint", "(...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/_ctypes/symbol.py#L201-L226
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cgutils.py
python
create_struct_proxy
(fe_type, kind='value')
return res
Returns a specialized StructProxy subclass for the given fe_type.
Returns a specialized StructProxy subclass for the given fe_type.
[ "Returns", "a", "specialized", "StructProxy", "subclass", "for", "the", "given", "fe_type", "." ]
def create_struct_proxy(fe_type, kind='value'): """ Returns a specialized StructProxy subclass for the given fe_type. """ cache_key = (fe_type, kind) res = _struct_proxy_cache.get(cache_key) if res is None: base = {'value': ValueStructProxy, 'data': DataStructProxy, ...
[ "def", "create_struct_proxy", "(", "fe_type", ",", "kind", "=", "'value'", ")", ":", "cache_key", "=", "(", "fe_type", ",", "kind", ")", "res", "=", "_struct_proxy_cache", ".", "get", "(", "cache_key", ")", "if", "res", "is", "None", ":", "base", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cgutils.py#L56-L72
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/inverse_gamma.py
python
InverseGamma.alpha
(self)
return self._alpha
Shape parameter.
Shape parameter.
[ "Shape", "parameter", "." ]
def alpha(self): """Shape parameter.""" return self._alpha
[ "def", "alpha", "(", "self", ")", ":", "return", "self", ".", "_alpha" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/inverse_gamma.py#L128-L130
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/dygraph/layers.py
python
Layer.create_tensor
(self, name=None, persistable=None, dtype=None)
return self._helper.main_program.current_block().create_var( name=var_name, persistable=persistable, dtype=dtype, type=core.VarDesc.VarType.LOD_TENSOR)
Create Tensor for this layer. Parameters: name(str, optional): name of the tensor. Please refer to :ref:`api_guide_Name` . Default: None persistable(bool, optional): if set this tensor persistable. Default: False dtype(str, optional): data type of this parameter. ...
[]
def create_tensor(self, name=None, persistable=None, dtype=None): """ Create Tensor for this layer. Parameters: name(str, optional): name of the tensor. Please refer to :ref:`api_guide_Name` . Default: None persistable(bool, optional): if set this tensor persistable. De...
[ "def", "create_tensor", "(", "self", ",", "name", "=", "None", ",", "persistable", "=", "None", ",", "dtype", "=", "None", ")", ":", "if", "name", "is", "not", "None", ":", "var_name", "=", "\".\"", ".", "join", "(", "[", "self", ".", "_full_name", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/layers.py#L477-L524
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py
python
ZipProvider._is_current
(self, file_path, zip_path)
return zip_contents == file_contents
Return True if the file_path is current for this zip_path
Return True if the file_path is current for this zip_path
[ "Return", "True", "if", "the", "file_path", "is", "current", "for", "this", "zip_path" ]
def _is_current(self, file_path, zip_path): """ Return True if the file_path is current for this zip_path """ timestamp, size = self._get_date_and_size(self.zipinfo[zip_path]) if not os.path.isfile(file_path): return False stat = os.stat(file_path) if ...
[ "def", "_is_current", "(", "self", ",", "file_path", ",", "zip_path", ")", ":", "timestamp", ",", "size", "=", "self", ".", "_get_date_and_size", "(", "self", ".", "zipinfo", "[", "zip_path", "]", ")", "if", "not", "os", ".", "path", ".", "isfile", "("...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L1812-L1826
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/nntplib.py
python
NNTP.xhdr
(self, hdr, str, *, file=None)
return resp, [remove_number(line) for line in lines]
Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 - file: Filename string or file object to store the result in Returns: - resp: server response if successful - l...
Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 - file: Filename string or file object to store the result in Returns: - resp: server response if successful - l...
[ "Process", "an", "XHDR", "command", "(", "optional", "server", "extension", ")", ".", "Arguments", ":", "-", "hdr", ":", "the", "header", "type", "(", "e", ".", "g", ".", "subject", ")", "-", "str", ":", "an", "article", "nr", "a", "message", "id", ...
def xhdr(self, hdr, str, *, file=None): """Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 - file: Filename string or file object to store the result in Returns: ...
[ "def", "xhdr", "(", "self", ",", "hdr", ",", "str", ",", "*", ",", "file", "=", "None", ")", ":", "pat", "=", "re", ".", "compile", "(", "'^([0-9]+) ?(.*)\\n?'", ")", "resp", ",", "lines", "=", "self", ".", "_longcmdstring", "(", "'XHDR {0} {1}'", "....
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/nntplib.py#L807-L821
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/variables.py
python
Variable.assign_add
(self, delta, use_locking=False)
return state_ops.assign_add(self._variable, delta, use_locking=use_locking)
Adds a value to this variable. This is essentially a shortcut for `assign_add(self, delta)`. Args: delta: A `Tensor`. The value to add to this variable. use_locking: If `True`, use locking during the operation. Returns: A `Tensor` that will hold the new value of this variable after ...
Adds a value to this variable.
[ "Adds", "a", "value", "to", "this", "variable", "." ]
def assign_add(self, delta, use_locking=False): """Adds a value to this variable. This is essentially a shortcut for `assign_add(self, delta)`. Args: delta: A `Tensor`. The value to add to this variable. use_locking: If `True`, use locking during the operation. Returns: A `Tensor` ...
[ "def", "assign_add", "(", "self", ",", "delta", ",", "use_locking", "=", "False", ")", ":", "return", "state_ops", ".", "assign_add", "(", "self", ".", "_variable", ",", "delta", ",", "use_locking", "=", "use_locking", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/variables.py#L530-L543
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/compatibility/ngraph/utils/tensor_iterator_types.py
python
TensorIteratorSliceInputDesc.serialize
(self)
return output
Serialize TensorIteratorSliceInputDesc as a dictionary.
Serialize TensorIteratorSliceInputDesc as a dictionary.
[ "Serialize", "TensorIteratorSliceInputDesc", "as", "a", "dictionary", "." ]
def serialize(self) -> dict: """Serialize TensorIteratorSliceInputDesc as a dictionary.""" output = super().serialize() output["start"] = self.start output["stride"] = self.stride output["part_size"] = self.part_size output["end"] = self.end output["axis"] = self....
[ "def", "serialize", "(", "self", ")", "->", "dict", ":", "output", "=", "super", "(", ")", ".", "serialize", "(", ")", "output", "[", "\"start\"", "]", "=", "self", ".", "start", "output", "[", "\"stride\"", "]", "=", "self", ".", "stride", "output",...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/utils/tensor_iterator_types.py#L62-L70
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedCompositeFieldContainer.__delitem__
(self, key)
Deletes the item at the specified position.
Deletes the item at the specified position.
[ "Deletes", "the", "item", "at", "the", "specified", "position", "." ]
def __delitem__(self, key): """Deletes the item at the specified position.""" del self._values[key] self._message_listener.Modified()
[ "def", "__delitem__", "(", "self", ",", "key", ")", ":", "del", "self", ".", "_values", "[", "key", "]", "self", ".", "_message_listener", ".", "Modified", "(", ")" ]
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/containers.py#L252-L255
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/coverage/coverage/files.py
python
isabs_anywhere
(filename)
return ntpath.isabs(filename) or posixpath.isabs(filename)
Is `filename` an absolute path on any OS?
Is `filename` an absolute path on any OS?
[ "Is", "filename", "an", "absolute", "path", "on", "any", "OS?" ]
def isabs_anywhere(filename): """Is `filename` an absolute path on any OS?""" return ntpath.isabs(filename) or posixpath.isabs(filename)
[ "def", "isabs_anywhere", "(", "filename", ")", ":", "return", "ntpath", ".", "isabs", "(", "filename", ")", "or", "posixpath", ".", "isabs", "(", "filename", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/files.py#L161-L163
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/port/base.py
python
Port.setup_test_run
(self)
Perform port-specific work at the beginning of a test run.
Perform port-specific work at the beginning of a test run.
[ "Perform", "port", "-", "specific", "work", "at", "the", "beginning", "of", "a", "test", "run", "." ]
def setup_test_run(self): """Perform port-specific work at the beginning of a test run.""" pass
[ "def", "setup_test_run", "(", "self", ")", ":", "pass" ]
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/port/base.py#L806-L808
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/demand/wxgui.py
python
WxGui.on_import_trips_from_scenario
(self, event=None)
Select xml file and import new vehicle types.
Select xml file and import new vehicle types.
[ "Select", "xml", "file", "and", "import", "new", "vehicle", "types", "." ]
def on_import_trips_from_scenario(self, event=None): """Select xml file and import new vehicle types. """ filepath = self.get_scenario().get_rootfilepath() # defaultFile = = os.path.dirname(filepath) dirpath = os.path.dirname(filepath) wildcards_all = "All files (*.*)|*...
[ "def", "on_import_trips_from_scenario", "(", "self", ",", "event", "=", "None", ")", ":", "filepath", "=", "self", ".", "get_scenario", "(", ")", ".", "get_rootfilepath", "(", ")", "# defaultFile = = os.path.dirname(filepath)", "dirpath", "=", "os", ".", "path", ...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/wxgui.py#L684-L707
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/aggregation.py
python
maybe_mangle_lambdas
(agg_spec: Any)
return mangled_aggspec
Make new lambdas with unique names. Parameters ---------- agg_spec : Any An argument to GroupBy.agg. Non-dict-like `agg_spec` are pass through as is. For dict-like `agg_spec` a new spec is returned with name-mangled lambdas. Returns ------- mangled : Any ...
Make new lambdas with unique names.
[ "Make", "new", "lambdas", "with", "unique", "names", "." ]
def maybe_mangle_lambdas(agg_spec: Any) -> Any: """ Make new lambdas with unique names. Parameters ---------- agg_spec : Any An argument to GroupBy.agg. Non-dict-like `agg_spec` are pass through as is. For dict-like `agg_spec` a new spec is returned with name-mangled...
[ "def", "maybe_mangle_lambdas", "(", "agg_spec", ":", "Any", ")", "->", "Any", ":", "is_dict", "=", "is_dict_like", "(", "agg_spec", ")", "if", "not", "(", "is_dict", "or", "is_list_like", "(", "agg_spec", ")", ")", ":", "return", "agg_spec", "mangled_aggspec...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/aggregation.py#L244-L285
rsocket/rsocket-cpp
45ed594ebd6701f40795c31ec922d784ec7fc921
build/fbcode_builder/CMake/make_fbpy_archive.py
python
install_library
(args, path_map)
Create an installation directory a python library.
Create an installation directory a python library.
[ "Create", "an", "installation", "directory", "a", "python", "library", "." ]
def install_library(args, path_map): """Create an installation directory a python library.""" out_dir = args.output out_manifest = args.output + ".manifest" install_dir = args.install_dir if not install_dir: install_dir = out_dir os.makedirs(out_dir) with open(out_manifest, "w") as...
[ "def", "install_library", "(", "args", ",", "path_map", ")", ":", "out_dir", "=", "args", ".", "output", "out_manifest", "=", "args", ".", "output", "+", "\".manifest\"", "install_dir", "=", "args", ".", "install_dir", "if", "not", "install_dir", ":", "insta...
https://github.com/rsocket/rsocket-cpp/blob/45ed594ebd6701f40795c31ec922d784ec7fc921/build/fbcode_builder/CMake/make_fbpy_archive.py#L190-L208
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py
python
OpsWorksConnection.create_instance
(self, stack_id, layer_ids, instance_type, auto_scaling_type=None, hostname=None, os=None, ami_id=None, ssh_key_name=None, availability_zone=None, virtualization_type=None, subnet_id=None, architecture=None, ...
return self.make_request(action='CreateInstance', body=json.dumps(params))
Creates an instance in a specified stack. For more information, see `Adding an Instance to a Layer`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more ...
Creates an instance in a specified stack. For more information, see `Adding an Instance to a Layer`_.
[ "Creates", "an", "instance", "in", "a", "specified", "stack", ".", "For", "more", "information", "see", "Adding", "an", "Instance", "to", "a", "Layer", "_", "." ]
def create_instance(self, stack_id, layer_ids, instance_type, auto_scaling_type=None, hostname=None, os=None, ami_id=None, ssh_key_name=None, availability_zone=None, virtualization_type=None, subnet_id=None, architecture=Non...
[ "def", "create_instance", "(", "self", ",", "stack_id", ",", "layer_ids", ",", "instance_type", ",", "auto_scaling_type", "=", "None", ",", "hostname", "=", "None", ",", "os", "=", "None", ",", "ami_id", "=", "None", ",", "ssh_key_name", "=", "None", ",", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py#L617-L755
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/cachecontrol/controller.py
python
CacheController.cached_request
(self, request)
return False
Return a cached response if it exists in the cache, otherwise return False.
Return a cached response if it exists in the cache, otherwise return False.
[ "Return", "a", "cached", "response", "if", "it", "exists", "in", "the", "cache", "otherwise", "return", "False", "." ]
def cached_request(self, request): """ Return a cached response if it exists in the cache, otherwise return False. """ cache_url = self.cache_url(request.url) logger.debug('Looking up "%s" in the cache', cache_url) cc = self.parse_cache_control(request.headers) ...
[ "def", "cached_request", "(", "self", ",", "request", ")", ":", "cache_url", "=", "self", ".", "cache_url", "(", "request", ".", "url", ")", "logger", ".", "debug", "(", "'Looking up \"%s\" in the cache'", ",", "cache_url", ")", "cc", "=", "self", ".", "pa...
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/cachecontrol/controller.py#L120-L229
sideeffects/HoudiniEngineForUnreal
a52be617d90495bda6072fe732f0d2eec33b54f3
Content/Python/HoudiniEngineV2/asyncprocessor.py
python
ProcessHDA.on_pre_process
(self)
Called during pre_process. Subclasses can override this function implement custom functionality.
Called during pre_process.
[ "Called", "during", "pre_process", "." ]
def on_pre_process(self): """ Called during pre_process. Subclasses can override this function implement custom functionality. """ pass
[ "def", "on_pre_process", "(", "self", ")", ":", "pass" ]
https://github.com/sideeffects/HoudiniEngineForUnreal/blob/a52be617d90495bda6072fe732f0d2eec33b54f3/Content/Python/HoudiniEngineV2/asyncprocessor.py#L505-L511
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/variables.py
python
RefVariable.scatter_div
(self, sparse_delta, use_locking=False, name=None)
return gen_state_ops.scatter_div( self._variable, sparse_delta.indices, sparse_delta.values, use_locking=use_locking, name=name)
Divide this variable by `tf.IndexedSlices`. Args: sparse_delta: `tf.IndexedSlices` to divide this variable by. use_locking: If `True`, use locking during the operation. name: the name of the operation. Returns: A `Tensor` that will hold the new value of this variable after the sc...
Divide this variable by `tf.IndexedSlices`.
[ "Divide", "this", "variable", "by", "tf", ".", "IndexedSlices", "." ]
def scatter_div(self, sparse_delta, use_locking=False, name=None): """Divide this variable by `tf.IndexedSlices`. Args: sparse_delta: `tf.IndexedSlices` to divide this variable by. use_locking: If `True`, use locking during the operation. name: the name of the operation. Returns: A...
[ "def", "scatter_div", "(", "self", ",", "sparse_delta", ",", "use_locking", "=", "False", ",", "name", "=", "None", ")", ":", "if", "not", "isinstance", "(", "sparse_delta", ",", "indexed_slices", ".", "IndexedSlices", ")", ":", "raise", "TypeError", "(", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/variables.py#L2221-L2243
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.MarkerSetBackgroundSelected
(*args, **kwargs)
return _stc.StyledTextCtrl_MarkerSetBackgroundSelected(*args, **kwargs)
MarkerSetBackgroundSelected(self, int markerNumber, Colour back)
MarkerSetBackgroundSelected(self, int markerNumber, Colour back)
[ "MarkerSetBackgroundSelected", "(", "self", "int", "markerNumber", "Colour", "back", ")" ]
def MarkerSetBackgroundSelected(*args, **kwargs): """MarkerSetBackgroundSelected(self, int markerNumber, Colour back)""" return _stc.StyledTextCtrl_MarkerSetBackgroundSelected(*args, **kwargs)
[ "def", "MarkerSetBackgroundSelected", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_MarkerSetBackgroundSelected", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L2354-L2356
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py
python
Treeview.selection_add
(self, *items)
Add all of the specified items to the selection.
Add all of the specified items to the selection.
[ "Add", "all", "of", "the", "specified", "items", "to", "the", "selection", "." ]
def selection_add(self, *items): """Add all of the specified items to the selection.""" self._selection("add", items)
[ "def", "selection_add", "(", "self", ",", "*", "items", ")", ":", "self", ".", "_selection", "(", "\"add\"", ",", "items", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py#L1461-L1463
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
orttraining/orttraining/python/training/ortmodule/_utils.py
python
get_state_after_deletion_of_non_ortmodule_methods
(ortmodule, user_module)
return ortmodule_state
Returns ORTModule state after deleting any user defined method from ORTModule state
Returns ORTModule state after deleting any user defined method from ORTModule state
[ "Returns", "ORTModule", "state", "after", "deleting", "any", "user", "defined", "method", "from", "ORTModule", "state" ]
def get_state_after_deletion_of_non_ortmodule_methods(ortmodule, user_module): """Returns ORTModule state after deleting any user defined method from ORTModule state""" ortmodule_state = copy.copy(ortmodule.__dict__) ortmodule_attributes = dict(inspect.getmembers(ortmodule)) torch_module_attributes = d...
[ "def", "get_state_after_deletion_of_non_ortmodule_methods", "(", "ortmodule", ",", "user_module", ")", ":", "ortmodule_state", "=", "copy", ".", "copy", "(", "ortmodule", ".", "__dict__", ")", "ortmodule_attributes", "=", "dict", "(", "inspect", ".", "getmembers", "...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/ortmodule/_utils.py#L210-L243
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/wxPIA_book/Chapter-09/validator1.py
python
NotEmptyValidator.Clone
(self)
return NotEmptyValidator()
Note that every validator must implement the Clone() method.
Note that every validator must implement the Clone() method.
[ "Note", "that", "every", "validator", "must", "implement", "the", "Clone", "()", "method", "." ]
def Clone(self): """ Note that every validator must implement the Clone() method. """ return NotEmptyValidator()
[ "def", "Clone", "(", "self", ")", ":", "return", "NotEmptyValidator", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/wxPIA_book/Chapter-09/validator1.py#L13-L17
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextLine.SetDescent
(*args, **kwargs)
return _richtext.RichTextLine_SetDescent(*args, **kwargs)
SetDescent(self, int descent)
SetDescent(self, int descent)
[ "SetDescent", "(", "self", "int", "descent", ")" ]
def SetDescent(*args, **kwargs): """SetDescent(self, int descent)""" return _richtext.RichTextLine_SetDescent(*args, **kwargs)
[ "def", "SetDescent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextLine_SetDescent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1943-L1945
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py
python
BasicFittingModel._check_data_exists
(workspace_names: list)
return [workspace_name for workspace_name in workspace_names if check_if_workspace_exist(workspace_name)]
Returns only the workspace names that exist in the ADS.
Returns only the workspace names that exist in the ADS.
[ "Returns", "only", "the", "workspace", "names", "that", "exist", "in", "the", "ADS", "." ]
def _check_data_exists(workspace_names: list) -> list: """Returns only the workspace names that exist in the ADS.""" return [workspace_name for workspace_name in workspace_names if check_if_workspace_exist(workspace_name)]
[ "def", "_check_data_exists", "(", "workspace_names", ":", "list", ")", "->", "list", ":", "return", "[", "workspace_name", "for", "workspace_name", "in", "workspace_names", "if", "check_if_workspace_exist", "(", "workspace_name", ")", "]" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py#L656-L658
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_common.py
python
conn_to_ntuple
(fd, fam, type_, laddr, raddr, status, status_map, pid=None)
Convert a raw connection tuple to a proper ntuple.
Convert a raw connection tuple to a proper ntuple.
[ "Convert", "a", "raw", "connection", "tuple", "to", "a", "proper", "ntuple", "." ]
def conn_to_ntuple(fd, fam, type_, laddr, raddr, status, status_map, pid=None): """Convert a raw connection tuple to a proper ntuple.""" if fam in (socket.AF_INET, AF_INET6): if laddr: laddr = addr(*laddr) if raddr: raddr = addr(*raddr) if type_ == socket.SOCK_STREAM ...
[ "def", "conn_to_ntuple", "(", "fd", ",", "fam", ",", "type_", ",", "laddr", ",", "raddr", ",", "status", ",", "status_map", ",", "pid", "=", "None", ")", ":", "if", "fam", "in", "(", "socket", ".", "AF_INET", ",", "AF_INET6", ")", ":", "if", "laddr...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_common.py#L574-L590
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/datetime.py
python
time.utcoffset
(self)
return offset
Return the timezone offset as timedelta, positive east of UTC (negative west of UTC).
Return the timezone offset as timedelta, positive east of UTC (negative west of UTC).
[ "Return", "the", "timezone", "offset", "as", "timedelta", "positive", "east", "of", "UTC", "(", "negative", "west", "of", "UTC", ")", "." ]
def utcoffset(self): """Return the timezone offset as timedelta, positive east of UTC (negative west of UTC).""" if self._tzinfo is None: return None offset = self._tzinfo.utcoffset(None) _check_utc_offset("utcoffset", offset) return offset
[ "def", "utcoffset", "(", "self", ")", ":", "if", "self", ".", "_tzinfo", "is", "None", ":", "return", "None", "offset", "=", "self", ".", "_tzinfo", ".", "utcoffset", "(", "None", ")", "_check_utc_offset", "(", "\"utcoffset\"", ",", "offset", ")", "retur...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/datetime.py#L1415-L1422
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/easy_xml.py
python
XmlToString
(content, encoding='utf-8', pretty=False)
return ''.join(xml_parts)
Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of having to create a lot of function calls. Each XML element of the content is repr...
Writes the XML content to disk, touching the file only if it has changed.
[ "Writes", "the", "XML", "content", "to", "disk", "touching", "the", "file", "only", "if", "it", "has", "changed", "." ]
def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of having to create a l...
[ "def", "XmlToString", "(", "content", ",", "encoding", "=", "'utf-8'", ",", "pretty", "=", "False", ")", ":", "# We create a huge list of all the elements of the file.", "xml_parts", "=", "[", "'<?xml version=\"1.0\" encoding=\"%s\"?>'", "%", "encoding", "]", "if", "pre...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/easy_xml.py#L9-L54
hunterlew/mstar_deeplearning_project
3761624dcbd7d44af257200542d13d1444dc634a
classification/caffe/build/Release/pycaffe/caffe/pycaffe.py
python
_Net_forward_all
(self, blobs=None, **kwargs)
return all_outs
Run net forward in batches. Parameters ---------- blobs : list of blobs to extract as in forward() kwargs : Keys are input blob names and values are blob ndarrays. Refer to forward(). Returns ------- all_outs : {blob name: list of blobs} dict.
Run net forward in batches.
[ "Run", "net", "forward", "in", "batches", "." ]
def _Net_forward_all(self, blobs=None, **kwargs): """ Run net forward in batches. Parameters ---------- blobs : list of blobs to extract as in forward() kwargs : Keys are input blob names and values are blob ndarrays. Refer to forward(). Returns ------- all_outs : {blo...
[ "def", "_Net_forward_all", "(", "self", ",", "blobs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Collect outputs from batches", "all_outs", "=", "{", "out", ":", "[", "]", "for", "out", "in", "set", "(", "self", ".", "outputs", "+", "(", "blobs...
https://github.com/hunterlew/mstar_deeplearning_project/blob/3761624dcbd7d44af257200542d13d1444dc634a/classification/caffe/build/Release/pycaffe/caffe/pycaffe.py#L185-L213
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/display.py
python
set_matplotlib_close
(close=True)
.. deprecated:: 7.23 use `matplotlib_inline.backend_inline.set_matplotlib_close()` Set whether the inline backend closes all figures automatically or not. By default, the inline backend used in the IPython Notebook will close all matplotlib figures automatically after each cell is run. This mean...
.. deprecated:: 7.23
[ "..", "deprecated", "::", "7", ".", "23" ]
def set_matplotlib_close(close=True): """ .. deprecated:: 7.23 use `matplotlib_inline.backend_inline.set_matplotlib_close()` Set whether the inline backend closes all figures automatically or not. By default, the inline backend used in the IPython Notebook will close all matplotlib figur...
[ "def", "set_matplotlib_close", "(", "close", "=", "True", ")", ":", "warnings", ".", "warn", "(", "\"`set_matplotlib_close` is deprecated since IPython 7.23, directly \"", "\"use `matplotlib_inline.backend_inline.set_matplotlib_close()`\"", ",", "DeprecationWarning", ",", "stacklev...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/display.py#L1518-L1556
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/filters.py
python
do_title
(s: str)
return "".join( [ item[0].upper() + item[1:].lower() for item in _word_beginning_split_re.split(soft_str(s)) if item ] )
Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase.
Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase.
[ "Return", "a", "titlecased", "version", "of", "the", "value", ".", "I", ".", "e", ".", "words", "will", "start", "with", "uppercase", "letters", "all", "remaining", "characters", "are", "lowercase", "." ]
def do_title(s: str) -> str: """Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase. """ return "".join( [ item[0].upper() + item[1:].lower() for item in _word_beginning_split_re.split(soft_str(s))...
[ "def", "do_title", "(", "s", ":", "str", ")", "->", "str", ":", "return", "\"\"", ".", "join", "(", "[", "item", "[", "0", "]", ".", "upper", "(", ")", "+", "item", "[", "1", ":", "]", ".", "lower", "(", ")", "for", "item", "in", "_word_begin...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/filters.py#L325-L335
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
kratos/python_scripts/application_generator/utils/io.py
python
GetKratosDirectory
()
return os.path.dirname(os.path.realpath(__file__)) + "/../../../../kratos/"
Return the path to the applications directory
Return the path to the applications directory
[ "Return", "the", "path", "to", "the", "applications", "directory" ]
def GetKratosDirectory(): ''' Return the path to the applications directory ''' return os.path.dirname(os.path.realpath(__file__)) + "/../../../../kratos/"
[ "def", "GetKratosDirectory", "(", ")", ":", "return", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "realpath", "(", "__file__", ")", ")", "+", "\"/../../../../kratos/\"" ]
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/application_generator/utils/io.py#L71-L74
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/web-page-replay/httpclient.py
python
RealHttpFetch._get_connection
(self, request_host, request_port, is_ssl)
return connection
Return a detailed connection object for host/port pair. If a system proxy is defined (see platformsettings.py), it will be used. Args: request_host: a host string (e.g. "www.example.com"). request_port: a port integer (e.g. 8080) or None (for the default port). is_ssl: True if HTTPS connecti...
Return a detailed connection object for host/port pair.
[ "Return", "a", "detailed", "connection", "object", "for", "host", "/", "port", "pair", "." ]
def _get_connection(self, request_host, request_port, is_ssl): """Return a detailed connection object for host/port pair. If a system proxy is defined (see platformsettings.py), it will be used. Args: request_host: a host string (e.g. "www.example.com"). request_port: a port integer (e.g. 8080...
[ "def", "_get_connection", "(", "self", ",", "request_host", ",", "request_port", ",", "is_ssl", ")", ":", "connection_host", "=", "request_host", "connection_port", "=", "request_port", "system_proxy", "=", "self", ".", "_get_system_proxy", "(", "is_ssl", ")", "if...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/httpclient.py#L280-L314
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/quote.py
python
Quote.timestamp
(self, timestamp)
Sets the timestamp of this Quote. :param timestamp: The timestamp of this Quote. # noqa: E501 :type: datetime
Sets the timestamp of this Quote.
[ "Sets", "the", "timestamp", "of", "this", "Quote", "." ]
def timestamp(self, timestamp): """Sets the timestamp of this Quote. :param timestamp: The timestamp of this Quote. # noqa: E501 :type: datetime """ if timestamp is None: raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 s...
[ "def", "timestamp", "(", "self", ",", "timestamp", ")", ":", "if", "timestamp", "is", "None", ":", "raise", "ValueError", "(", "\"Invalid value for `timestamp`, must not be `None`\"", ")", "# noqa: E501", "self", ".", "_timestamp", "=", "timestamp" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/quote.py#L84-L94
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py
python
Base.src_builder
(self)
return scb
Fetch the source code builder for this node. If there isn't one, we cache the source code builder specified for the directory (which in turn will cache the value from its parent directory, and so on up to the file system root).
Fetch the source code builder for this node.
[ "Fetch", "the", "source", "code", "builder", "for", "this", "node", "." ]
def src_builder(self): """Fetch the source code builder for this node. If there isn't one, we cache the source code builder specified for the directory (which in turn will cache the value from its parent directory, and so on up to the file system root). """ try: ...
[ "def", "src_builder", "(", "self", ")", ":", "try", ":", "scb", "=", "self", ".", "sbuilder", "except", "AttributeError", ":", "scb", "=", "self", ".", "dir", ".", "src_builder", "(", ")", "self", ".", "sbuilder", "=", "scb", "return", "scb" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py#L795-L807
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/CallTips.py
python
CallTips.force_open_calltip_event
(self, event)
Happens when the user really wants to open a CallTip, even if a function call is needed.
Happens when the user really wants to open a CallTip, even if a function call is needed.
[ "Happens", "when", "the", "user", "really", "wants", "to", "open", "a", "CallTip", "even", "if", "a", "function", "call", "is", "needed", "." ]
def force_open_calltip_event(self, event): """Happens when the user really wants to open a CallTip, even if a function call is needed. """ self.open_calltip(True)
[ "def", "force_open_calltip_event", "(", "self", ",", "event", ")", ":", "self", ".", "open_calltip", "(", "True", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/CallTips.py#L46-L50
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/hashing_helper.py
python
GetDownloadHashAlgs
(logger, consider_md5=False, consider_crc32c=False)
return hash_algs
Returns a dict of hash algorithms for validating an object. Args: logger: logging.Logger for outputting log messages. consider_md5: If True, consider using a md5 hash. consider_crc32c: If True, consider using a crc32c hash. Returns: Dict of (string, hash algorithm). Raises: CommandException...
Returns a dict of hash algorithms for validating an object.
[ "Returns", "a", "dict", "of", "hash", "algorithms", "for", "validating", "an", "object", "." ]
def GetDownloadHashAlgs(logger, consider_md5=False, consider_crc32c=False): """Returns a dict of hash algorithms for validating an object. Args: logger: logging.Logger for outputting log messages. consider_md5: If True, consider using a md5 hash. consider_crc32c: If True, consider using a crc32c hash. ...
[ "def", "GetDownloadHashAlgs", "(", "logger", ",", "consider_md5", "=", "False", ",", "consider_crc32c", "=", "False", ")", ":", "check_hashes_config", "=", "config", ".", "get", "(", "'GSUtil'", ",", "'check_hashes'", ",", "CHECK_HASH_IF_FAST_ELSE_FAIL", ")", "if"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/hashing_helper.py#L296-L337
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/help.py
python
main
()
Pretty-print the bug information as JSON.
Pretty-print the bug information as JSON.
[ "Pretty", "-", "print", "the", "bug", "information", "as", "JSON", "." ]
def main(): """Pretty-print the bug information as JSON.""" print(json.dumps(info(), sort_keys=True, indent=2))
[ "def", "main", "(", ")", ":", "print", "(", "json", ".", "dumps", "(", "info", "(", ")", ",", "sort_keys", "=", "True", ",", "indent", "=", "2", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/help.py#L113-L115
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/ftplib.py
python
test
()
Test program. Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ... -d dir -l list -p password
Test program. Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
[ "Test", "program", ".", "Usage", ":", "ftp", "[", "-", "d", "]", "[", "-", "r", "[", "file", "]]", "host", "[", "-", "l", "[", "dir", "]]", "[", "-", "d", "[", "dir", "]]", "[", "-", "p", "]", "[", "file", "]", "..." ]
def test(): '''Test program. Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ... -d dir -l list -p password ''' if len(sys.argv) < 2: print(test.__doc__) sys.exit(0) import netrc debugging = 0 rcfile = None while sys.argv[1] == '-d': ...
[ "def", "test", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", "<", "2", ":", "print", "(", "test", ".", "__doc__", ")", "sys", ".", "exit", "(", "0", ")", "import", "netrc", "debugging", "=", "0", "rcfile", "=", "None", "while", "sys...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ftplib.py#L931-L985
DGA-MI-SSI/YaCo
9b85e6ca1809114c4df1382c11255f7e38408912
deps/capstone-3.0.4/bindings/python/build/lib/capstone/__init__.py
python
Cs.disasm
(self, code, offset, count=0)
if not _python2: print(code) code = code.encode() print(code)
if not _python2: print(code) code = code.encode() print(code)
[ "if", "not", "_python2", ":", "print", "(", "code", ")", "code", "=", "code", ".", "encode", "()", "print", "(", "code", ")" ]
def disasm(self, code, offset, count=0): all_insn = ctypes.POINTER(_cs_insn)() '''if not _python2: print(code) code = code.encode() print(code)''' res = _cs.cs_disasm(self.csh, code, len(code), offset, count, ctypes.byref(all_insn)) if res > 0: ...
[ "def", "disasm", "(", "self", ",", "code", ",", "offset", ",", "count", "=", "0", ")", ":", "all_insn", "=", "ctypes", ".", "POINTER", "(", "_cs_insn", ")", "(", ")", "res", "=", "_cs", ".", "cs_disasm", "(", "self", ".", "csh", ",", "code", ",",...
https://github.com/DGA-MI-SSI/YaCo/blob/9b85e6ca1809114c4df1382c11255f7e38408912/deps/capstone-3.0.4/bindings/python/build/lib/capstone/__init__.py#L968-L986
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/dist.py
python
Distribution.find_config_files
(self)
return files
Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions). There are three possible config files: distutils.cfg in ...
Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions).
[ "Find", "as", "many", "configuration", "files", "as", "should", "be", "processed", "for", "this", "platform", "and", "return", "a", "list", "of", "filenames", "in", "the", "order", "in", "which", "they", "should", "be", "parsed", ".", "The", "filenames", "...
def find_config_files(self): """Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions). There are three ...
[ "def", "find_config_files", "(", "self", ")", ":", "files", "=", "[", "]", "check_environ", "(", ")", "# Where to look for the system-wide Distutils config file", "sys_dir", "=", "os", ".", "path", ".", "dirname", "(", "sys", ".", "modules", "[", "'distutils'", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/dist.py#L334-L380
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/trade_bin.py
python
TradeBin.low
(self)
return self._low
Gets the low of this TradeBin. # noqa: E501 :return: The low of this TradeBin. # noqa: E501 :rtype: float
Gets the low of this TradeBin. # noqa: E501
[ "Gets", "the", "low", "of", "this", "TradeBin", ".", "#", "noqa", ":", "E501" ]
def low(self): """Gets the low of this TradeBin. # noqa: E501 :return: The low of this TradeBin. # noqa: E501 :rtype: float """ return self._low
[ "def", "low", "(", "self", ")", ":", "return", "self", ".", "_low" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/trade_bin.py#L197-L204
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/tempfile.py
python
mkdtemp
(suffix="", prefix=template, dir=None)
User-callable function to create and return a unique temporary directory. The return value is the pathname of the directory. Arguments are as for mkstemp, except that the 'text' argument is not accepted. The directory is readable, writable, and searchable only by the creating user. Caller is...
User-callable function to create and return a unique temporary directory. The return value is the pathname of the directory.
[ "User", "-", "callable", "function", "to", "create", "and", "return", "a", "unique", "temporary", "directory", ".", "The", "return", "value", "is", "the", "pathname", "of", "the", "directory", "." ]
def mkdtemp(suffix="", prefix=template, dir=None): """User-callable function to create and return a unique temporary directory. The return value is the pathname of the directory. Arguments are as for mkstemp, except that the 'text' argument is not accepted. The directory is readable, writable, an...
[ "def", "mkdtemp", "(", "suffix", "=", "\"\"", ",", "prefix", "=", "template", ",", "dir", "=", "None", ")", ":", "if", "dir", "is", "None", ":", "dir", "=", "gettempdir", "(", ")", "names", "=", "_get_candidate_names", "(", ")", "for", "seq", "in", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/tempfile.py#L307-L336
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/device/cuda/__init__.py
python
get_device_name
(device=None)
return get_device_properties(device).name
Return the name of the device which is got from CUDA function `cudaDeviceProp <https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g1bf9d625a931d657e08db2b4391170f0>`_. Parameters: device(paddle.CUDAPlace|int, optional): The device or the ID of the device. If dev...
Return the name of the device which is got from CUDA function `cudaDeviceProp <https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g1bf9d625a931d657e08db2b4391170f0>`_.
[ "Return", "the", "name", "of", "the", "device", "which", "is", "got", "from", "CUDA", "function", "cudaDeviceProp", "<https", ":", "//", "docs", ".", "nvidia", ".", "com", "/", "cuda", "/", "cuda", "-", "runtime", "-", "api", "/", "group__CUDART__DEVICE", ...
def get_device_name(device=None): ''' Return the name of the device which is got from CUDA function `cudaDeviceProp <https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g1bf9d625a931d657e08db2b4391170f0>`_. Parameters: device(paddle.CUDAPlace|int, optiona...
[ "def", "get_device_name", "(", "device", "=", "None", ")", ":", "return", "get_device_properties", "(", "device", ")", ".", "name" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/device/cuda/__init__.py#L278-L304
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/floor.py
python
_floor_tbe
()
return
Floor TBE register
Floor TBE register
[ "Floor", "TBE", "register" ]
def _floor_tbe(): """Floor TBE register""" return
[ "def", "_floor_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/floor.py#L35-L37
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
Error.code
(self)
return ret
The error code, e.g. an xmlParserError
The error code, e.g. an xmlParserError
[ "The", "error", "code", "e", ".", "g", ".", "an", "xmlParserError" ]
def code(self): """The error code, e.g. an xmlParserError """ ret = libxml2mod.xmlErrorGetCode(self._o) return ret
[ "def", "code", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlErrorGetCode", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L5023-L5026
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/aui_utilities.py
python
FindFocusDescendant
(ancestor)
return focusWin
Find a window with the focus, that is also a descendant of the given window. This is used to determine the window to initially send commands to. :param Window `ancestor`: the window to check for ancestry.
Find a window with the focus, that is also a descendant of the given window. This is used to determine the window to initially send commands to.
[ "Find", "a", "window", "with", "the", "focus", "that", "is", "also", "a", "descendant", "of", "the", "given", "window", ".", "This", "is", "used", "to", "determine", "the", "window", "to", "initially", "send", "commands", "to", "." ]
def FindFocusDescendant(ancestor): """ Find a window with the focus, that is also a descendant of the given window. This is used to determine the window to initially send commands to. :param Window `ancestor`: the window to check for ancestry. """ # Process events starting with the window ...
[ "def", "FindFocusDescendant", "(", "ancestor", ")", ":", "# Process events starting with the window with the focus, if any.", "focusWin", "=", "wx", ".", "Window", ".", "FindFocus", "(", ")", "win", "=", "focusWin", "# Check if this is a descendant of this frame.", "# If not,...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/aui_utilities.py#L371-L394
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/core.py
python
_mareconstruct
(subtype, baseclass, baseshape, basetype,)
return subtype.__new__(subtype, _data, mask=_mask, dtype=basetype,)
Internal function that builds a new MaskedArray from the information stored in a pickle.
Internal function that builds a new MaskedArray from the information stored in a pickle.
[ "Internal", "function", "that", "builds", "a", "new", "MaskedArray", "from", "the", "information", "stored", "in", "a", "pickle", "." ]
def _mareconstruct(subtype, baseclass, baseshape, basetype,): """Internal function that builds a new MaskedArray from the information stored in a pickle. """ _data = ndarray.__new__(baseclass, baseshape, basetype) _mask = ndarray.__new__(ndarray, baseshape, make_mask_descr(basetype)) return sub...
[ "def", "_mareconstruct", "(", "subtype", ",", "baseclass", ",", "baseshape", ",", "basetype", ",", ")", ":", "_data", "=", "ndarray", ".", "__new__", "(", "baseclass", ",", "baseshape", ",", "basetype", ")", "_mask", "=", "ndarray", ".", "__new__", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L6049-L6056
OPAE/opae-sdk
221124343c8275243a249eb72d69e0ea2d568d1b
python/opae.admin/opae/admin/utils/utils.py
python
dry_run
(obj, enabled=True, **kwargs)
return obj
dry_run Inspects and returns a function that logs its arguments Args: obj: object to inspect (should be callable, otherwise same object is returned). enabled: Flag used as an indication of whether or not to enable 'dry_run'. If False, the same object is ret...
dry_run Inspects and returns a function that logs its arguments
[ "dry_run", "Inspects", "and", "returns", "a", "function", "that", "logs", "its", "arguments" ]
def dry_run(obj, enabled=True, **kwargs): """dry_run Inspects and returns a function that logs its arguments Args: obj: object to inspect (should be callable, otherwise same object is returned). enabled: Flag used as an indication of whether or not to enable ...
[ "def", "dry_run", "(", "obj", ",", "enabled", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "enabled", ":", "if", "callable", "(", "obj", ")", ":", "return", "dry_run_func", "(", "obj", ",", "*", "*", "kwargs", ")", "return", "obj" ]
https://github.com/OPAE/opae-sdk/blob/221124343c8275243a249eb72d69e0ea2d568d1b/python/opae.admin/opae/admin/utils/utils.py#L78-L93
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/io.py
python
NDArrayIter.hard_reset
(self)
Ignore roll over data and set to start.
Ignore roll over data and set to start.
[ "Ignore", "roll", "over", "data", "and", "set", "to", "start", "." ]
def hard_reset(self): """Ignore roll over data and set to start.""" self.cursor = -self.batch_size
[ "def", "hard_reset", "(", "self", ")", ":", "self", ".", "cursor", "=", "-", "self", ".", "batch_size" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/io.py#L691-L693
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py
python
dump_privatekey
(type, pkey, cipher=None, passphrase=None)
return _bio_to_string(bio)
Dump the private key *pkey* into a buffer string encoded with the type *type*. Optionally (if *type* is :const:`FILETYPE_PEM`) encrypting it using *cipher* and *passphrase*. :param type: The file type (one of :const:`FILETYPE_PEM`, :const:`FILETYPE_ASN1`, or :const:`FILETYPE_TEXT`) :param PKey...
Dump the private key *pkey* into a buffer string encoded with the type *type*. Optionally (if *type* is :const:`FILETYPE_PEM`) encrypting it using *cipher* and *passphrase*.
[ "Dump", "the", "private", "key", "*", "pkey", "*", "into", "a", "buffer", "string", "encoded", "with", "the", "type", "*", "type", "*", ".", "Optionally", "(", "if", "*", "type", "*", "is", ":", "const", ":", "FILETYPE_PEM", ")", "encrypting", "it", ...
def dump_privatekey(type, pkey, cipher=None, passphrase=None): """ Dump the private key *pkey* into a buffer string encoded with the type *type*. Optionally (if *type* is :const:`FILETYPE_PEM`) encrypting it using *cipher* and *passphrase*. :param type: The file type (one of :const:`FILETYPE_PEM`,...
[ "def", "dump_privatekey", "(", "type", ",", "pkey", ",", "cipher", "=", "None", ",", "passphrase", "=", "None", ")", ":", "bio", "=", "_new_mem_buf", "(", ")", "if", "not", "isinstance", "(", "pkey", ",", "PKey", ")", ":", "raise", "TypeError", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py#L1851-L1907
CalcProgrammer1/OpenRGB
8156b0167a7590dd8ba561dfde524bfcacf46b5e
dependencies/mbedtls-2.24.0/scripts/config.py
python
Config.known
(self, name)
return name in self.settings
True if a #define for name is present, whether it's commented out or not.
True if a #define for name is present, whether it's commented out or not.
[ "True", "if", "a", "#define", "for", "name", "is", "present", "whether", "it", "s", "commented", "out", "or", "not", "." ]
def known(self, name): """True if a #define for name is present, whether it's commented out or not.""" return name in self.settings
[ "def", "known", "(", "self", ",", "name", ")", ":", "return", "name", "in", "self", ".", "settings" ]
https://github.com/CalcProgrammer1/OpenRGB/blob/8156b0167a7590dd8ba561dfde524bfcacf46b5e/dependencies/mbedtls-2.24.0/scripts/config.py#L82-L84
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py
python
Parameter.replace
(self, *, name=_void, kind=_void, annotation=_void, default=_void)
return type(self)(name, kind, default=default, annotation=annotation)
Creates a customized copy of the Parameter.
Creates a customized copy of the Parameter.
[ "Creates", "a", "customized", "copy", "of", "the", "Parameter", "." ]
def replace(self, *, name=_void, kind=_void, annotation=_void, default=_void): """Creates a customized copy of the Parameter.""" if name is _void: name = self._name if kind is _void: kind = self._kind if annotation is _void: annotati...
[ "def", "replace", "(", "self", ",", "*", ",", "name", "=", "_void", ",", "kind", "=", "_void", ",", "annotation", "=", "_void", ",", "default", "=", "_void", ")", ":", "if", "name", "is", "_void", ":", "name", "=", "self", ".", "_name", "if", "ki...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py#L2533-L2549
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/graph_editor/util.py
python
ControlOutputs.update
(self)
return self
Update the control outputs if the graph has changed.
Update the control outputs if the graph has changed.
[ "Update", "the", "control", "outputs", "if", "the", "graph", "has", "changed", "." ]
def update(self): """Update the control outputs if the graph has changed.""" if self._version != self._graph.version: self._build() return self
[ "def", "update", "(", "self", ")", ":", "if", "self", ".", "_version", "!=", "self", ".", "_graph", ".", "version", ":", "self", ".", "_build", "(", ")", "return", "self" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/graph_editor/util.py#L341-L345
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/framemanager.py
python
AuiPaneInfo.HasGripper
(self)
return self.HasFlag(self.optionGripper)
Returns ``True`` if the pane displays a gripper.
Returns ``True`` if the pane displays a gripper.
[ "Returns", "True", "if", "the", "pane", "displays", "a", "gripper", "." ]
def HasGripper(self): """ Returns ``True`` if the pane displays a gripper. """ return self.HasFlag(self.optionGripper)
[ "def", "HasGripper", "(", "self", ")", ":", "return", "self", ".", "HasFlag", "(", "self", ".", "optionGripper", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L784-L787
opengauss-mirror/openGauss-server
e383f1b77720a00ddbe4c0655bc85914d9b02a2b
src/gausskernel/dbmind/tools/ai_server/service/datafactory/storage/insert_data_to_database.py
python
InfluxDb.insert_data
(self, *args)
insert data to database :param args: args[0] is agent data, args[1] is kafka data :return: None
insert data to database :param args: args[0] is agent data, args[1] is kafka data :return: None
[ "insert", "data", "to", "database", ":", "param", "args", ":", "args", "[", "0", "]", "is", "agent", "data", "args", "[", "1", "]", "is", "kafka", "data", ":", "return", ":", "None" ]
def insert_data(self, *args): """ insert data to database :param args: args[0] is agent data, args[1] is kafka data :return: None """ data_list = [data for data in args if data] client = None try: self.logger.info("Start to insert data:%s." % d...
[ "def", "insert_data", "(", "self", ",", "*", "args", ")", ":", "data_list", "=", "[", "data", "for", "data", "in", "args", "if", "data", "]", "client", "=", "None", "try", ":", "self", ".", "logger", ".", "info", "(", "\"Start to insert data:%s.\"", "%...
https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/ai_server/service/datafactory/storage/insert_data_to_database.py#L106-L149