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
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
native_client_sdk/src/build_tools/sdk_tools/update_manifest.py
python
GsUtil.CheckIfExists
(self, path)
return self.Run(['ls', self.GetURI(path)]) == 0
Check whether a given path exists on commondatastorage Args: path: path relative to SDK root directory on the server Returns: True if it exists, False if it does not
Check whether a given path exists on commondatastorage
[ "Check", "whether", "a", "given", "path", "exists", "on", "commondatastorage" ]
def CheckIfExists(self, path): '''Check whether a given path exists on commondatastorage Args: path: path relative to SDK root directory on the server Returns: True if it exists, False if it does not''' # todo(mball): Be a little more intelligent about this check and compare # the output str...
[ "def", "CheckIfExists", "(", "self", ",", "path", ")", ":", "# todo(mball): Be a little more intelligent about this check and compare", "# the output strings against expected values", "return", "self", ".", "Run", "(", "[", "'ls'", ",", "self", ".", "GetURI", "(", "path",...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/sdk_tools/update_manifest.py#L218-L227
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/third_party/jinja2/filters.py
python
environmentfilter
(f)
return f
Decorator for marking environment dependent filters. The current :class:`Environment` is passed to the filter as first argument.
Decorator for marking environment dependent filters. The current :class:`Environment` is passed to the filter as first argument.
[ "Decorator", "for", "marking", "environment", "dependent", "filters", ".", "The", "current", ":", "class", ":", "Environment", "is", "passed", "to", "the", "filter", "as", "first", "argument", "." ]
def environmentfilter(f): """Decorator for marking environment dependent filters. The current :class:`Environment` is passed to the filter as first argument. """ f.environmentfilter = True return f
[ "def", "environmentfilter", "(", "f", ")", ":", "f", ".", "environmentfilter", "=", "True", "return", "f" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/filters.py#L48-L53
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/debug_alert.py
python
DebugAlertHandler.get
(self)
Displays UI for debugging the anomaly detection function. Request parameters: test_path: Full test path (Master/bot/suite/chart) for test with alert. rev: A revision (Row id number) to center the graph on. num_before: Maximum number of points after the given revision to get. num_after: Maxi...
Displays UI for debugging the anomaly detection function.
[ "Displays", "UI", "for", "debugging", "the", "anomaly", "detection", "function", "." ]
def get(self): """Displays UI for debugging the anomaly detection function. Request parameters: test_path: Full test path (Master/bot/suite/chart) for test with alert. rev: A revision (Row id number) to center the graph on. num_before: Maximum number of points after the given revision to get....
[ "def", "get", "(", "self", ")", ":", "try", ":", "test", "=", "self", ".", "_GetTest", "(", ")", "num_before", ",", "num_after", "=", "self", ".", "_GetNumBeforeAfter", "(", ")", "config_name", "=", "self", ".", "_GetConfigName", "(", "test", ")", "con...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/debug_alert.py#L31-L86
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/build.py
python
load_system
(source_dir)
return pyproject_data['build-system']
Load the build system from a source dir (pyproject.toml).
Load the build system from a source dir (pyproject.toml).
[ "Load", "the", "build", "system", "from", "a", "source", "dir", "(", "pyproject", ".", "toml", ")", "." ]
def load_system(source_dir): """ Load the build system from a source dir (pyproject.toml). """ pyproject = os.path.join(source_dir, 'pyproject.toml') with open(pyproject) as f: pyproject_data = toml.load(f) return pyproject_data['build-system']
[ "def", "load_system", "(", "source_dir", ")", ":", "pyproject", "=", "os", ".", "path", ".", "join", "(", "source_dir", ",", "'pyproject.toml'", ")", "with", "open", "(", "pyproject", ")", "as", "f", ":", "pyproject_data", "=", "toml", ".", "load", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/build.py#L29-L36
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
Slider_GetClassDefaultAttributes
(*args, **kwargs)
return _controls_.Slider_GetClassDefaultAttributes(*args, **kwargs)
Slider_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or ...
Slider_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "Slider_GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def Slider_GetClassDefaultAttributes(*args, **kwargs): """ Slider_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- whic...
[ "def", "Slider_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Slider_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L2962-L2977
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/tools/docs/pretty_docs.py
python
_build_class_page
(page_info)
return ''.join(parts)
Given a ClassPageInfo object Return the page as an md string.
Given a ClassPageInfo object Return the page as an md string.
[ "Given", "a", "ClassPageInfo", "object", "Return", "the", "page", "as", "an", "md", "string", "." ]
def _build_class_page(page_info): """Given a ClassPageInfo object Return the page as an md string.""" meta_data = _Metadata(page_info.full_name) for item in itertools.chain( page_info.classes, page_info.properties, page_info.methods, page_info.other_members): meta_data.append(item) ...
[ "def", "_build_class_page", "(", "page_info", ")", ":", "meta_data", "=", "_Metadata", "(", "page_info", ".", "full_name", ")", "for", "item", "in", "itertools", ".", "chain", "(", "page_info", ".", "classes", ",", "page_info", ".", "properties", ",", "page_...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/tools/docs/pretty_docs.py#L83-L181
ouster-lidar/ouster_example
13ea8e8b8a4951fb630dbc9108666995c8443bf6
python/src/ouster/pcap/pcap.py
python
Pcap.closed
(self)
Check if source is closed. Thread-safe.
Check if source is closed. Thread-safe.
[ "Check", "if", "source", "is", "closed", ".", "Thread", "-", "safe", "." ]
def closed(self) -> bool: """Check if source is closed. Thread-safe.""" with self._lock: return self._handle is None
[ "def", "closed", "(", "self", ")", "->", "bool", ":", "with", "self", ".", "_lock", ":", "return", "self", ".", "_handle", "is", "None" ]
https://github.com/ouster-lidar/ouster_example/blob/13ea8e8b8a4951fb630dbc9108666995c8443bf6/python/src/ouster/pcap/pcap.py#L250-L253
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/more-itertools/py3/more_itertools/recipes.py
python
pad_none
(iterable)
return chain(iterable, repeat(None))
Returns the sequence of elements and then returns ``None`` indefinitely. >>> take(5, pad_none(range(3))) [0, 1, 2, None, None] Useful for emulating the behavior of the built-in :func:`map` function. See also :func:`padded`.
Returns the sequence of elements and then returns ``None`` indefinitely.
[ "Returns", "the", "sequence", "of", "elements", "and", "then", "returns", "None", "indefinitely", "." ]
def pad_none(iterable): """Returns the sequence of elements and then returns ``None`` indefinitely. >>> take(5, pad_none(range(3))) [0, 1, 2, None, None] Useful for emulating the behavior of the built-in :func:`map` function. See also :func:`padded`. """ return chain(iterable, re...
[ "def", "pad_none", "(", "iterable", ")", ":", "return", "chain", "(", "iterable", ",", "repeat", "(", "None", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py3/more_itertools/recipes.py#L185-L196
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/filters.py
python
do_upper
(s)
return soft_unicode(s).upper()
Convert a value to uppercase.
Convert a value to uppercase.
[ "Convert", "a", "value", "to", "uppercase", "." ]
def do_upper(s): """Convert a value to uppercase.""" return soft_unicode(s).upper()
[ "def", "do_upper", "(", "s", ")", ":", "return", "soft_unicode", "(", "s", ")", ".", "upper", "(", ")" ]
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/filters.py#L128-L130
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.SetToolTip
(*args, **kwargs)
return _core_.Window_SetToolTip(*args, **kwargs)
SetToolTip(self, ToolTip tip) Attach a tooltip to the window.
SetToolTip(self, ToolTip tip)
[ "SetToolTip", "(", "self", "ToolTip", "tip", ")" ]
def SetToolTip(*args, **kwargs): """ SetToolTip(self, ToolTip tip) Attach a tooltip to the window. """ return _core_.Window_SetToolTip(*args, **kwargs)
[ "def", "SetToolTip", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_SetToolTip", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L11384-L11390
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py
python
construct_rnn
(initial_state, sequence_input, cell, num_label_columns, dtype=dtypes.float32, parallel_iterations=32, swap_memory=True)
Build an RNN and apply a fully connected layer to get the desired output. Args: initial_state: The initial state to pass the RNN. If `None`, the default starting state for `self._cell` is used. sequence_input: A `Tensor` with shape `[batch_size, padded_length, d]` that will be passed as input to ...
Build an RNN and apply a fully connected layer to get the desired output.
[ "Build", "an", "RNN", "and", "apply", "a", "fully", "connected", "layer", "to", "get", "the", "desired", "output", "." ]
def construct_rnn(initial_state, sequence_input, cell, num_label_columns, dtype=dtypes.float32, parallel_iterations=32, swap_memory=True): """Build an RNN and apply a fully connected layer to get the desired ou...
[ "def", "construct_rnn", "(", "initial_state", ",", "sequence_input", ",", "cell", ",", "num_label_columns", ",", "dtype", "=", "dtypes", ".", "float32", ",", "parallel_iterations", "=", "32", ",", "swap_memory", "=", "True", ")", ":", "with", "ops", ".", "na...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py#L208-L252
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextCtrl.BeginFont
(*args, **kwargs)
return _richtext.RichTextCtrl_BeginFont(*args, **kwargs)
BeginFont(self, Font font) -> bool Begin using this font
BeginFont(self, Font font) -> bool
[ "BeginFont", "(", "self", "Font", "font", ")", "-", ">", "bool" ]
def BeginFont(*args, **kwargs): """ BeginFont(self, Font font) -> bool Begin using this font """ return _richtext.RichTextCtrl_BeginFont(*args, **kwargs)
[ "def", "BeginFont", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_BeginFont", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3399-L3405
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/type_extractor/type_extractor/params_info.py
python
Param.name_text
(self)
return object_attr_string_repr(self.name)
Returns a parameter's name.
Returns a parameter's name.
[ "Returns", "a", "parameter", "s", "name", "." ]
def name_text(self): """Returns a parameter's name.""" return object_attr_string_repr(self.name)
[ "def", "name_text", "(", "self", ")", ":", "return", "object_attr_string_repr", "(", "self", ".", "name", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/params_info.py#L37-L39
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py
python
get_function_impls
(content, ident)
return result
Retrieve the function parts from the specified contents as a set of return value, name, arguments and body. Ident must occur somewhere in the value.
Retrieve the function parts from the specified contents as a set of return value, name, arguments and body. Ident must occur somewhere in the value.
[ "Retrieve", "the", "function", "parts", "from", "the", "specified", "contents", "as", "a", "set", "of", "return", "value", "name", "arguments", "and", "body", ".", "Ident", "must", "occur", "somewhere", "in", "the", "value", "." ]
def get_function_impls(content, ident): """ Retrieve the function parts from the specified contents as a set of return value, name, arguments and body. Ident must occur somewhere in the value. """ # extract the functions p = re.compile('\n'+_cre_func+'\((.*?)\)([A-Za-z0-9_\s]{0,})'+ ...
[ "def", "get_function_impls", "(", "content", ",", "ident", ")", ":", "# extract the functions", "p", "=", "re", ".", "compile", "(", "'\\n'", "+", "_cre_func", "+", "'\\((.*?)\\)([A-Za-z0-9_\\s]{0,})'", "+", "'\\{(.*?)\\n\\}'", ",", "re", ".", "MULTILINE", "|", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py#L438-L481
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/python_message.py
python
_AddClearFieldMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddClearFieldMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def ClearField(self, field_name): try: field = message_descriptor.fields_by_name[field_name] except KeyError: raise ValueError('Protocol message has no "%s" field.' % field_name) if field in self._fiel...
[ "def", "_AddClearFieldMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "ClearField", "(", "self", ",", "field_name", ")", ":", "try", ":", "field", "=", "message_descriptor", ".", "fields_by_name", "[", "field_name", "]", "except", "KeyError", ...
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/python_message.py#L608-L627
BestSonny/SSTD
174d452189f6bf9cf4b6957719392008bd974069
python/caffe/draw.py
python
choose_color_by_layertype
(layertype)
return color
Define colors for nodes based on the layer type.
Define colors for nodes based on the layer type.
[ "Define", "colors", "for", "nodes", "based", "on", "the", "layer", "type", "." ]
def choose_color_by_layertype(layertype): """Define colors for nodes based on the layer type. """ color = '#6495ED' # Default if layertype == 'Convolution' or layertype == 'Deconvolution': color = '#FF5050' elif layertype == 'Pooling': color = '#FF9900' elif layertype == 'InnerP...
[ "def", "choose_color_by_layertype", "(", "layertype", ")", ":", "color", "=", "'#6495ED'", "# Default", "if", "layertype", "==", "'Convolution'", "or", "layertype", "==", "'Deconvolution'", ":", "color", "=", "'#FF5050'", "elif", "layertype", "==", "'Pooling'", ":...
https://github.com/BestSonny/SSTD/blob/174d452189f6bf9cf4b6957719392008bd974069/python/caffe/draw.py#L117-L127
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/android/provision_devices.py
python
_ConfigureLocalProperties
(device, java_debug=True)
Set standard readonly testing device properties prior to reboot.
Set standard readonly testing device properties prior to reboot.
[ "Set", "standard", "readonly", "testing", "device", "properties", "prior", "to", "reboot", "." ]
def _ConfigureLocalProperties(device, java_debug=True): """Set standard readonly testing device properties prior to reboot.""" local_props = [ 'persist.sys.usb.config=adb', 'ro.monkey=1', 'ro.test_harness=1', 'ro.audio.silent=1', 'ro.setupwizard.mode=DISABLED', ] if java_debug:...
[ "def", "_ConfigureLocalProperties", "(", "device", ",", "java_debug", "=", "True", ")", ":", "local_props", "=", "[", "'persist.sys.usb.config=adb'", ",", "'ro.monkey=1'", ",", "'ro.test_harness=1'", ",", "'ro.audio.silent=1'", ",", "'ro.setupwizard.mode=DISABLED'", ",", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/provision_devices.py#L327-L349
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/utils.py
python
S3RegionRedirector.redirect_from_error
(self, request_dict, response, operation, **kwargs)
return 0
An S3 request sent to the wrong region will return an error that contains the endpoint the request should be sent to. This handler will add the redirect information to the signing context and then redirect the request.
An S3 request sent to the wrong region will return an error that contains the endpoint the request should be sent to. This handler will add the redirect information to the signing context and then redirect the request.
[ "An", "S3", "request", "sent", "to", "the", "wrong", "region", "will", "return", "an", "error", "that", "contains", "the", "endpoint", "the", "request", "should", "be", "sent", "to", ".", "This", "handler", "will", "add", "the", "redirect", "information", ...
def redirect_from_error(self, request_dict, response, operation, **kwargs): """ An S3 request sent to the wrong region will return an error that contains the endpoint the request should be sent to. This handler will add the redirect information to the signing context and then red...
[ "def", "redirect_from_error", "(", "self", ",", "request_dict", ",", "response", ",", "operation", ",", "*", "*", "kwargs", ")", ":", "if", "response", "is", "None", ":", "# This could be none if there was a ConnectionError or other", "# transport error.", "return", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/utils.py#L1157-L1241
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/inspect.py
python
_signature_from_function
(cls, func)
return cls(parameters, return_annotation=annotations.get('return', _empty), __validate_parameters__=is_duck_function)
Private helper: constructs Signature for the given python function.
Private helper: constructs Signature for the given python function.
[ "Private", "helper", ":", "constructs", "Signature", "for", "the", "given", "python", "function", "." ]
def _signature_from_function(cls, func): """Private helper: constructs Signature for the given python function.""" is_duck_function = False if not isfunction(func): if _signature_is_functionlike(func): is_duck_function = True else: # If it's not a pure Python functio...
[ "def", "_signature_from_function", "(", "cls", ",", "func", ")", ":", "is_duck_function", "=", "False", "if", "not", "isfunction", "(", "func", ")", ":", "if", "_signature_is_functionlike", "(", "func", ")", ":", "is_duck_function", "=", "True", "else", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/inspect.py#L2117-L2195
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/utils.py
python
LRUCache.copy
(self)
return rv
Return a shallow copy of the instance.
Return a shallow copy of the instance.
[ "Return", "a", "shallow", "copy", "of", "the", "instance", "." ]
def copy(self): """Return a shallow copy of the instance.""" rv = self.__class__(self.capacity) rv._mapping.update(self._mapping) rv._queue = deque(self._queue) return rv
[ "def", "copy", "(", "self", ")", ":", "rv", "=", "self", ".", "__class__", "(", "self", ".", "capacity", ")", "rv", ".", "_mapping", ".", "update", "(", "self", ".", "_mapping", ")", "rv", ".", "_queue", "=", "deque", "(", "self", ".", "_queue", ...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/utils.py#L329-L334
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/compression.py
python
register_compression
(name, callback, extensions, force=False)
Register an "inferable" file compression type. Registers transparent file compression type for use with fsspec.open. Compression can be specified by name in open, or "infer"-ed for any files ending with the given extensions. Args: name: (str) The compression type name. Eg. "gzip". call...
Register an "inferable" file compression type.
[ "Register", "an", "inferable", "file", "compression", "type", "." ]
def register_compression(name, callback, extensions, force=False): """Register an "inferable" file compression type. Registers transparent file compression type for use with fsspec.open. Compression can be specified by name in open, or "infer"-ed for any files ending with the given extensions. Arg...
[ "def", "register_compression", "(", "name", ",", "callback", ",", "extensions", ",", "force", "=", "False", ")", ":", "if", "isinstance", "(", "extensions", ",", "str", ")", ":", "extensions", "=", "[", "extensions", "]", "# Validate registration", "if", "na...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/compression.py#L18-L54
alexgkendall/caffe-segnet
344c113bf1832886f1cbe9f33ffe28a3beeaf412
scripts/cpp_lint.py
python
ResetNolintSuppressions
()
Resets the set of NOLINT suppressions to empty.
Resets the set of NOLINT suppressions to empty.
[ "Resets", "the", "set", "of", "NOLINT", "suppressions", "to", "empty", "." ]
def ResetNolintSuppressions(): "Resets the set of NOLINT suppressions to empty." _error_suppressions.clear()
[ "def", "ResetNolintSuppressions", "(", ")", ":", "_error_suppressions", ".", "clear", "(", ")" ]
https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/scripts/cpp_lint.py#L495-L497
wxWidgets/wxWidgets
2356dda03444674c373cee43a49c5e47c7f172b2
build/bakefiles/wxwin.py
python
headersOnly
(files)
return utils.substitute2(files, callback)
Filters 'files' so that only headers are left. Used with <msvc-project-files> to add headers to VC++ projects but not files such as arrimpl.cpp.
Filters 'files' so that only headers are left. Used with <msvc-project-files> to add headers to VC++ projects but not files such as arrimpl.cpp.
[ "Filters", "files", "so", "that", "only", "headers", "are", "left", ".", "Used", "with", "<msvc", "-", "project", "-", "files", ">", "to", "add", "headers", "to", "VC", "++", "projects", "but", "not", "files", "such", "as", "arrimpl", ".", "cpp", "." ]
def headersOnly(files): """Filters 'files' so that only headers are left. Used with <msvc-project-files> to add headers to VC++ projects but not files such as arrimpl.cpp.""" def callback(cond, sources): prf = suf = '' if sources[0].isspace(): prf=' ' if sources[-1].is...
[ "def", "headersOnly", "(", "files", ")", ":", "def", "callback", "(", "cond", ",", "sources", ")", ":", "prf", "=", "suf", "=", "''", "if", "sources", "[", "0", "]", ".", "isspace", "(", ")", ":", "prf", "=", "' '", "if", "sources", "[", "-", "...
https://github.com/wxWidgets/wxWidgets/blob/2356dda03444674c373cee43a49c5e47c7f172b2/build/bakefiles/wxwin.py#L136-L150
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/msvc.py
python
PlatformInfo.target_cpu
(self)
return self.arch[self.arch.find('_') + 1:]
Return Target CPU architecture. Return ------ str Target CPU
Return Target CPU architecture.
[ "Return", "Target", "CPU", "architecture", "." ]
def target_cpu(self): """ Return Target CPU architecture. Return ------ str Target CPU """ return self.arch[self.arch.find('_') + 1:]
[ "def", "target_cpu", "(", "self", ")", ":", "return", "self", ".", "arch", "[", "self", ".", "arch", ".", "find", "(", "'_'", ")", "+", "1", ":", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/msvc.py#L384-L393
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/api.py
python
patch
(url, data=None, **kwargs)
return request('patch', url, data=data, **kwargs)
r"""Sends a PATCH request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body of the :class:`Request`. :param \*\*k...
r"""Sends a PATCH request.
[ "r", "Sends", "a", "PATCH", "request", "." ]
def patch(url, data=None, **kwargs): r"""Sends a PATCH request. :param url: URL for the new :class:`Request` object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:`Request`. :param json: (optional) json data to send in the body ...
[ "def", "patch", "(", "url", ",", "data", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "request", "(", "'patch'", ",", "url", ",", "data", "=", "data", ",", "*", "*", "kwargs", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/api.py#L137-L149
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PGProperty.SetValueInEvent
(*args, **kwargs)
return _propgrid.PGProperty_SetValueInEvent(*args, **kwargs)
SetValueInEvent(self, wxVariant value)
SetValueInEvent(self, wxVariant value)
[ "SetValueInEvent", "(", "self", "wxVariant", "value", ")" ]
def SetValueInEvent(*args, **kwargs): """SetValueInEvent(self, wxVariant value)""" return _propgrid.PGProperty_SetValueInEvent(*args, **kwargs)
[ "def", "SetValueInEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_SetValueInEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L718-L720
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/namespaces.py
python
Installer._get_all_ns_packages
(self)
return sorted(flatten(map(self._pkg_names, pkgs)))
Return sorted list of all package namespaces
Return sorted list of all package namespaces
[ "Return", "sorted", "list", "of", "all", "package", "namespaces" ]
def _get_all_ns_packages(self): """Return sorted list of all package namespaces""" pkgs = self.distribution.namespace_packages or [] return sorted(flatten(map(self._pkg_names, pkgs)))
[ "def", "_get_all_ns_packages", "(", "self", ")", ":", "pkgs", "=", "self", ".", "distribution", ".", "namespace_packages", "or", "[", "]", "return", "sorted", "(", "flatten", "(", "map", "(", "self", ".", "_pkg_names", ",", "pkgs", ")", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/namespaces.py#L81-L84
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/poplib.py
python
POP3.user
(self, user)
return self._shortcmd('USER %s' % user)
Send user name, return response (should indicate password required).
Send user name, return response
[ "Send", "user", "name", "return", "response" ]
def user(self, user): """Send user name, return response (should indicate password required). """ return self._shortcmd('USER %s' % user)
[ "def", "user", "(", "self", ",", "user", ")", ":", "return", "self", ".", "_shortcmd", "(", "'USER %s'", "%", "user", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/poplib.py#L174-L179
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
cmake/target/version/generate_version_header.py
python
get_version_str
()
return output.strip().decode("ascii")
System call to get the git hash Return: String with git hash
System call to get the git hash
[ "System", "call", "to", "get", "the", "git", "hash" ]
def get_version_str(): """ System call to get the git hash Return: String with git hash """ output = subprocess.check_output(["git", "describe", "--tags", "--always"]) return output.strip().decode("ascii")
[ "def", "get_version_str", "(", ")", ":", "output", "=", "subprocess", ".", "check_output", "(", "[", "\"git\"", ",", "\"describe\"", ",", "\"--tags\"", ",", "\"--always\"", "]", ")", "return", "output", ".", "strip", "(", ")", ".", "decode", "(", "\"ascii\...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/cmake/target/version/generate_version_header.py#L25-L32
bumptop/BumpTop
466d23597a07ae738f4265262fa01087fc6e257c
trunk/win/Source/bin/jinja2/runtime.py
python
Context.derived
(self, locals=None)
return context
Internal helper function to create a derived context.
Internal helper function to create a derived context.
[ "Internal", "helper", "function", "to", "create", "a", "derived", "context", "." ]
def derived(self, locals=None): """Internal helper function to create a derived context.""" context = new_context(self.environment, self.name, {}, self.parent, True, None, locals) context.blocks.update((k, list(v)) for k, v in self.blocks.iteritems()) return...
[ "def", "derived", "(", "self", ",", "locals", "=", "None", ")", ":", "context", "=", "new_context", "(", "self", ".", "environment", ",", "self", ".", "name", ",", "{", "}", ",", "self", ".", "parent", ",", "True", ",", "None", ",", "locals", ")", ...
https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/runtime.py#L181-L186
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ipaddress.py
python
_IPAddressBase._prefix_from_ip_int
(cls, ip_int)
return prefixlen
Return prefix length from the bitwise netmask. Args: ip_int: An integer, the netmask in expanded bitwise format Returns: An integer, the prefix length. Raises: ValueError: If the input intermingles zeroes & ones
Return prefix length from the bitwise netmask.
[ "Return", "prefix", "length", "from", "the", "bitwise", "netmask", "." ]
def _prefix_from_ip_int(cls, ip_int): """Return prefix length from the bitwise netmask. Args: ip_int: An integer, the netmask in expanded bitwise format Returns: An integer, the prefix length. Raises: ValueError: If the input intermingles zeroes & o...
[ "def", "_prefix_from_ip_int", "(", "cls", ",", "ip_int", ")", ":", "trailing_zeroes", "=", "_count_righthand_zero_bits", "(", "ip_int", ",", "cls", ".", "_max_prefixlen", ")", "prefixlen", "=", "cls", ".", "_max_prefixlen", "-", "trailing_zeroes", "leading_ones", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ipaddress.py#L447-L469
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
clang/bindings/python/clang/cindex.py
python
TokenGroup.get_tokens
(tu, extent)
Helper method to return all tokens in an extent. This functionality is needed multiple places in this module. We define it here because it seems like a logical place.
Helper method to return all tokens in an extent.
[ "Helper", "method", "to", "return", "all", "tokens", "in", "an", "extent", "." ]
def get_tokens(tu, extent): """Helper method to return all tokens in an extent. This functionality is needed multiple places in this module. We define it here because it seems like a logical place. """ tokens_memory = POINTER(Token)() tokens_count = c_uint() con...
[ "def", "get_tokens", "(", "tu", ",", "extent", ")", ":", "tokens_memory", "=", "POINTER", "(", "Token", ")", "(", ")", "tokens_count", "=", "c_uint", "(", ")", "conf", ".", "lib", ".", "clang_tokenize", "(", "tu", ",", "extent", ",", "byref", "(", "t...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/clang/bindings/python/clang/cindex.py#L541-L571
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/lifecycle.py
python
LifecycleConfig.add_rule
(self, action, action_params, conditions)
Add a rule to this Lifecycle configuration. This only adds the rule to the local copy. To install the new rule(s) on the bucket, you need to pass this Lifecycle config object to the configure_lifecycle method of the Bucket object. :type action: str :param action: Action to be ...
Add a rule to this Lifecycle configuration. This only adds the rule to the local copy. To install the new rule(s) on the bucket, you need to pass this Lifecycle config object to the configure_lifecycle method of the Bucket object.
[ "Add", "a", "rule", "to", "this", "Lifecycle", "configuration", ".", "This", "only", "adds", "the", "rule", "to", "the", "local", "copy", ".", "To", "install", "the", "new", "rule", "(", "s", ")", "on", "the", "bucket", "you", "need", "to", "pass", "...
def add_rule(self, action, action_params, conditions): """ Add a rule to this Lifecycle configuration. This only adds the rule to the local copy. To install the new rule(s) on the bucket, you need to pass this Lifecycle config object to the configure_lifecycle method of the Buc...
[ "def", "add_rule", "(", "self", ",", "action", ",", "action_params", ",", "conditions", ")", ":", "rule", "=", "Rule", "(", "action", ",", "action_params", ",", "conditions", ")", "self", ".", "append", "(", "rule", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/lifecycle.py#L206-L227
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/compute_api.py
python
compute
(shape, fcompute, name=None, dtype=None, attrs=OrderedDict())
return tensor
Construct a new tensor based on the shape and the compute function. The API **returns a new tensor**. The shape must be a tuple. The number of elements in the tuple decides the dimension of the returned tensor. The second field `fcompute` defines the construction rule of the returned tensor, which must...
Construct a new tensor based on the shape and the compute function.
[ "Construct", "a", "new", "tensor", "based", "on", "the", "shape", "and", "the", "compute", "function", "." ]
def compute(shape, fcompute, name=None, dtype=None, attrs=OrderedDict()): """Construct a new tensor based on the shape and the compute function. The API **returns a new tensor**. The shape must be a tuple. The number of elements in the tuple decides the dimension of the returned tensor. The second fiel...
[ "def", "compute", "(", "shape", ",", "fcompute", ",", "name", "=", "None", ",", "dtype", "=", "None", ",", "attrs", "=", "OrderedDict", "(", ")", ")", ":", "# check API correctness", "if", "not", "isinstance", "(", "shape", ",", "tuple", ")", ":", "rai...
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/compute_api.py#L211-L297
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/vis/glprogram.py
python
GLNavigationProgram.get_view
(self)
return self.view
Returns a GLViewport describing the viewport, which could be saved to file.
Returns a GLViewport describing the viewport, which could be saved to file.
[ "Returns", "a", "GLViewport", "describing", "the", "viewport", "which", "could", "be", "saved", "to", "file", "." ]
def get_view(self): """Returns a GLViewport describing the viewport, which could be saved to file.""" return self.view
[ "def", "get_view", "(", "self", ")", ":", "return", "self", ".", "view" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/glprogram.py#L387-L390
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibook.py
python
AuiNotebook.GetPage
(self, page_idx)
return self._tabs.GetWindowFromIdx(page_idx)
Returns the page specified by the given index. :param integer `page_idx`: the page index.
Returns the page specified by the given index.
[ "Returns", "the", "page", "specified", "by", "the", "given", "index", "." ]
def GetPage(self, page_idx): """ Returns the page specified by the given index. :param integer `page_idx`: the page index. """ if page_idx >= self._tabs.GetPageCount(): raise Exception("invalid notebook page") return self._tabs.GetWindowFromIdx(page_idx)
[ "def", "GetPage", "(", "self", ",", "page_idx", ")", ":", "if", "page_idx", ">=", "self", ".", "_tabs", ".", "GetPageCount", "(", ")", ":", "raise", "Exception", "(", "\"invalid notebook page\"", ")", "return", "self", ".", "_tabs", ".", "GetWindowFromIdx", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L4087-L4097
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/parsing_ops.py
python
_DecodeCSVShape
(op)
return [input_shape] * len(op.outputs)
Shape function for the DecodeCSV op.
Shape function for the DecodeCSV op.
[ "Shape", "function", "for", "the", "DecodeCSV", "op", "." ]
def _DecodeCSVShape(op): # pylint: disable=invalid-name """Shape function for the DecodeCSV op.""" input_shape = op.inputs[0].get_shape() # Optionally check that all of other inputs are scalar or empty. for default_input in op.inputs[1:]: default_input_shape = default_input.get_shape().with_rank(1) if ...
[ "def", "_DecodeCSVShape", "(", "op", ")", ":", "# pylint: disable=invalid-name", "input_shape", "=", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", "# Optionally check that all of other inputs are scalar or empty.", "for", "default_input", "in", "op", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/parsing_ops.py#L934-L943
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py
python
replace
(a, old, new, count=None)
return _to_string_or_unicode_array( _vec_string( a, object_, 'replace', [old, new] +_clean_args(count)))
For each element in `a`, return a copy of the string with all occurrences of substring `old` replaced by `new`. Calls `str.replace` element-wise. Parameters ---------- a : array-like of str or unicode old, new : str or unicode count : int, optional If the optional argument `count...
For each element in `a`, return a copy of the string with all occurrences of substring `old` replaced by `new`.
[ "For", "each", "element", "in", "a", "return", "a", "copy", "of", "the", "string", "with", "all", "occurrences", "of", "substring", "old", "replaced", "by", "new", "." ]
def replace(a, old, new, count=None): """ For each element in `a`, return a copy of the string with all occurrences of substring `old` replaced by `new`. Calls `str.replace` element-wise. Parameters ---------- a : array-like of str or unicode old, new : str or unicode count : int...
[ "def", "replace", "(", "a", ",", "old", ",", "new", ",", "count", "=", "None", ")", ":", "return", "_to_string_or_unicode_array", "(", "_vec_string", "(", "a", ",", "object_", ",", "'replace'", ",", "[", "old", ",", "new", "]", "+", "_clean_args", "(",...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py#L1042-L1071
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd.py
python
_flip_matrix_to_vector_dynamic
(mat, batch_shape)
return vector
Flip matrix to vector with dynamic shapes.
Flip matrix to vector with dynamic shapes.
[ "Flip", "matrix", "to", "vector", "with", "dynamic", "shapes", "." ]
def _flip_matrix_to_vector_dynamic(mat, batch_shape): """Flip matrix to vector with dynamic shapes.""" mat_rank = array_ops.rank(mat) k = array_ops.gather(array_ops.shape(mat), mat_rank - 2) final_shape = array_ops.concat(0, (batch_shape, [k])) # mat.shape = matrix_batch_shape + [k, M] # Permutation corres...
[ "def", "_flip_matrix_to_vector_dynamic", "(", "mat", ",", "batch_shape", ")", ":", "mat_rank", "=", "array_ops", ".", "rank", "(", "mat", ")", "k", "=", "array_ops", ".", "gather", "(", "array_ops", ".", "shape", "(", "mat", ")", ",", "mat_rank", "-", "2...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/operator_pd.py#L674-L686
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/traceback.py
python
walk_tb
(tb)
Walk a traceback yielding the frame and line number for each frame. This will follow tb.tb_next (and thus is in the opposite order to walk_stack). Usually used with StackSummary.extract.
Walk a traceback yielding the frame and line number for each frame.
[ "Walk", "a", "traceback", "yielding", "the", "frame", "and", "line", "number", "for", "each", "frame", "." ]
def walk_tb(tb): """Walk a traceback yielding the frame and line number for each frame. This will follow tb.tb_next (and thus is in the opposite order to walk_stack). Usually used with StackSummary.extract. """ while tb is not None: yield tb.tb_frame, tb.tb_lineno tb = tb.tb_next
[ "def", "walk_tb", "(", "tb", ")", ":", "while", "tb", "is", "not", "None", ":", "yield", "tb", ".", "tb_frame", ",", "tb", ".", "tb_lineno", "tb", "=", "tb", ".", "tb_next" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/traceback.py#L302-L310
eclipse/omr
056e7c9ce9d503649190bc5bd9931fac30b4e4bc
jitbuilder/apigen/cppgen.py
python
CppGenerator.generate_parm_list
(self, parms_desc, namespace="", is_client=True)
return ", ".join([ self.generate_parm(p, namespace=namespace, is_client=is_client) for p in parms_desc ])
Produces a stringified comma seperated list of parameter declarations from a list of parameter descriptions. The list is usable as the parameter listing of a function declaration.
Produces a stringified comma seperated list of parameter declarations from a list of parameter descriptions. The list is usable as the parameter listing of a function declaration.
[ "Produces", "a", "stringified", "comma", "seperated", "list", "of", "parameter", "declarations", "from", "a", "list", "of", "parameter", "descriptions", ".", "The", "list", "is", "usable", "as", "the", "parameter", "listing", "of", "a", "function", "declaration"...
def generate_parm_list(self, parms_desc, namespace="", is_client=True): """ Produces a stringified comma seperated list of parameter declarations from a list of parameter descriptions. The list is usable as the parameter listing of a function declaration. """ return ", "....
[ "def", "generate_parm_list", "(", "self", ",", "parms_desc", ",", "namespace", "=", "\"\"", ",", "is_client", "=", "True", ")", ":", "return", "\", \"", ".", "join", "(", "[", "self", ".", "generate_parm", "(", "p", ",", "namespace", "=", "namespace", ",...
https://github.com/eclipse/omr/blob/056e7c9ce9d503649190bc5bd9931fac30b4e4bc/jitbuilder/apigen/cppgen.py#L207-L213
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
clang/bindings/python/clang/cindex.py
python
Cursor.lexical_parent
(self)
return self._lexical_parent
Return the lexical parent for this cursor.
Return the lexical parent for this cursor.
[ "Return", "the", "lexical", "parent", "for", "this", "cursor", "." ]
def lexical_parent(self): """Return the lexical parent for this cursor.""" if not hasattr(self, '_lexical_parent'): self._lexical_parent = conf.lib.clang_getCursorLexicalParent(self) return self._lexical_parent
[ "def", "lexical_parent", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_lexical_parent'", ")", ":", "self", ".", "_lexical_parent", "=", "conf", ".", "lib", ".", "clang_getCursorLexicalParent", "(", "self", ")", "return", "self", ".", ...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L1762-L1767
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.GetTable
(*args, **kwargs)
return _grid.Grid_GetTable(*args, **kwargs)
GetTable(self) -> GridTableBase
GetTable(self) -> GridTableBase
[ "GetTable", "(", "self", ")", "-", ">", "GridTableBase" ]
def GetTable(*args, **kwargs): """GetTable(self) -> GridTableBase""" return _grid.Grid_GetTable(*args, **kwargs)
[ "def", "GetTable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetTable", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1255-L1257
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/robotinterfaceutils.py
python
RobotInterfaceEmulator.moveToPosition
(self,indices,q,speed)
Backup: runs a position command using a piecewise linear trajectory
Backup: runs a position command using a piecewise linear trajectory
[ "Backup", ":", "runs", "a", "position", "command", "using", "a", "piecewise", "linear", "trajectory" ]
def moveToPosition(self,indices,q,speed): """Backup: runs a position command using a piecewise linear trajectory""" if self.status != 'ok': return model = self.klamptModel if model is None: #TODO: warn that move-to is unavailable? warnings.warn("moveToPosition is ...
[ "def", "moveToPosition", "(", "self", ",", "indices", ",", "q", ",", "speed", ")", ":", "if", "self", ".", "status", "!=", "'ok'", ":", "return", "model", "=", "self", ".", "klamptModel", "if", "model", "is", "None", ":", "#TODO: warn that move-to is unava...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterfaceutils.py#L4800-L4866
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/lbfgsb.py
python
fmin_l_bfgs_b
(func, x0, fprime=None, args=(), approx_grad=0, bounds=None, m=10, factr=1e7, pgtol=1e-5, epsilon=1e-8, iprint=-1, maxfun=15000, maxiter=15000, disp=None, callback=None, maxls=20)
return x, f, d
Minimize a function func using the L-BFGS-B algorithm. Parameters ---------- func : callable f(x,*args) Function to minimise. x0 : ndarray Initial guess. fprime : callable fprime(x,*args), optional The gradient of `func`. If None, then `func` returns the function va...
Minimize a function func using the L-BFGS-B algorithm.
[ "Minimize", "a", "function", "func", "using", "the", "L", "-", "BFGS", "-", "B", "algorithm", "." ]
def fmin_l_bfgs_b(func, x0, fprime=None, args=(), approx_grad=0, bounds=None, m=10, factr=1e7, pgtol=1e-5, epsilon=1e-8, iprint=-1, maxfun=15000, maxiter=15000, disp=None, callback=None, maxls=20): """ Minimize a function ...
[ "def", "fmin_l_bfgs_b", "(", "func", ",", "x0", ",", "fprime", "=", "None", ",", "args", "=", "(", ")", ",", "approx_grad", "=", "0", ",", "bounds", "=", "None", ",", "m", "=", "10", ",", "factr", "=", "1e7", ",", "pgtol", "=", "1e-5", ",", "ep...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/lbfgsb.py#L49-L208
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/mpi_collectives/mpi_ops.py
python
allgather
(tensor, name=None)
return MPI_LIB.mpi_allgather(tensor, sizes, name=name)
An op which concatenates the input tensor with the same input tensor on all other MPI processes. The concatenation is done on the first dimension, so the input tensors on the different processes must have the same rank and shape, except for the first dimension, which is allowed to be different. Returns: ...
An op which concatenates the input tensor with the same input tensor on all other MPI processes.
[ "An", "op", "which", "concatenates", "the", "input", "tensor", "with", "the", "same", "input", "tensor", "on", "all", "other", "MPI", "processes", "." ]
def allgather(tensor, name=None): """An op which concatenates the input tensor with the same input tensor on all other MPI processes. The concatenation is done on the first dimension, so the input tensors on the different processes must have the same rank and shape, except for the first dimension, which is a...
[ "def", "allgather", "(", "tensor", ",", "name", "=", "None", ")", ":", "# Specify that first allgather is to collect the tensor gather sizes,", "# indicated by passing in a scalar (0-D tensor) of value 0", "sizes_flag", "=", "tf", ".", "constant", "(", "0", ",", "dtype", "=...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/mpi_collectives/mpi_ops.py#L137-L160
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/fix_gn_headers.py
python
AddHeadersToSources
(headers, skip_ambiguous=True)
Add header files to the sources list in the first GN file. The target GN file is the first one up the parent directories. This usually does the wrong thing for _test files if the test and the main target are in the same .gn file. When skip_ambiguous is True, skip if multiple sources arrays are found. "git c...
Add header files to the sources list in the first GN file.
[ "Add", "header", "files", "to", "the", "sources", "list", "in", "the", "first", "GN", "file", "." ]
def AddHeadersToSources(headers, skip_ambiguous=True): """Add header files to the sources list in the first GN file. The target GN file is the first one up the parent directories. This usually does the wrong thing for _test files if the test and the main target are in the same .gn file. When skip_ambiguous i...
[ "def", "AddHeadersToSources", "(", "headers", ",", "skip_ambiguous", "=", "True", ")", ":", "for", "filename", "in", "headers", ":", "filename", "=", "filename", ".", "strip", "(", ")", "print", "(", "filename", ")", "dirname", "=", "os", ".", "path", "....
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/fix_gn_headers.py#L103-L134
MhLiao/TextBoxes_plusplus
39d4898de1504c53a2ed3d67966a57b3595836d0
python/caffe/coord_map.py
python
crop
(top_from, top_to)
return L.Crop(top_from, top_to, crop_param=dict(axis=ax + 1, # +1 for first cropping dim. offset=list(-np.round(b).astype(int))))
Define a Crop layer to crop a top (from) to another top (to) by determining the coordinate mapping between the two and net spec'ing the axis and shift parameters of the crop.
Define a Crop layer to crop a top (from) to another top (to) by determining the coordinate mapping between the two and net spec'ing the axis and shift parameters of the crop.
[ "Define", "a", "Crop", "layer", "to", "crop", "a", "top", "(", "from", ")", "to", "another", "top", "(", "to", ")", "by", "determining", "the", "coordinate", "mapping", "between", "the", "two", "and", "net", "spec", "ing", "the", "axis", "and", "shift"...
def crop(top_from, top_to): """ Define a Crop layer to crop a top (from) to another top (to) by determining the coordinate mapping between the two and net spec'ing the axis and shift parameters of the crop. """ ax, a, b = coord_map_from_to(top_from, top_to) assert (a == 1).all(), 'scale mism...
[ "def", "crop", "(", "top_from", ",", "top_to", ")", ":", "ax", ",", "a", ",", "b", "=", "coord_map_from_to", "(", "top_from", ",", "top_to", ")", "assert", "(", "a", "==", "1", ")", ".", "all", "(", ")", ",", "'scale mismatch on crop (a = {})'", ".", ...
https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/python/caffe/coord_map.py#L172-L185
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/XRCed/component.py
python
SmartContainer.getTreeOrImplicitNode
(self, node)
Return topmost child (implicit if exists).
Return topmost child (implicit if exists).
[ "Return", "topmost", "child", "(", "implicit", "if", "exists", ")", "." ]
def getTreeOrImplicitNode(self, node): '''Return topmost child (implicit if exists).''' if node.parentNode.getAttribute('class') == self.implicitKlass: return node.parentNode else: return node
[ "def", "getTreeOrImplicitNode", "(", "self", ",", "node", ")", ":", "if", "node", ".", "parentNode", ".", "getAttribute", "(", "'class'", ")", "==", "self", ".", "implicitKlass", ":", "return", "node", ".", "parentNode", "else", ":", "return", "node" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/XRCed/component.py#L469-L474
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tarfile.py
python
TarFile.taropen
(cls, name, mode="r", fileobj=None, **kwargs)
return cls(name, mode, fileobj, **kwargs)
Open uncompressed tar archive name for reading or writing.
Open uncompressed tar archive name for reading or writing.
[ "Open", "uncompressed", "tar", "archive", "name", "for", "reading", "or", "writing", "." ]
def taropen(cls, name, mode="r", fileobj=None, **kwargs): """Open uncompressed tar archive name for reading or writing. """ if mode not in ("r", "a", "w", "x"): raise ValueError("mode must be 'r', 'a', 'w' or 'x'") return cls(name, mode, fileobj, **kwargs)
[ "def", "taropen", "(", "cls", ",", "name", ",", "mode", "=", "\"r\"", ",", "fileobj", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "mode", "not", "in", "(", "\"r\"", ",", "\"a\"", ",", "\"w\"", ",", "\"x\"", ")", ":", "raise", "ValueErro...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tarfile.py#L1618-L1623
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/memory_inspector/memory_inspector/backends/android/memdump_parser.py
python
Parse
(lines)
return maps
Parses the output of memdump. memdump (see chrome/src/tools/memdump) is a Linux/Android binary meant to be executed on the target device which extracts memory map information about one or more processes. In principle is can be seen as an alternative to cat-ing /proc/PID/smaps, but with extra features (multipro...
Parses the output of memdump.
[ "Parses", "the", "output", "of", "memdump", "." ]
def Parse(lines): """Parses the output of memdump. memdump (see chrome/src/tools/memdump) is a Linux/Android binary meant to be executed on the target device which extracts memory map information about one or more processes. In principle is can be seen as an alternative to cat-ing /proc/PID/smaps, but with e...
[ "def", "Parse", "(", "lines", ")", ":", "RE", "=", "(", "r'^([0-9a-f]+)-([0-9a-f]+)\\s+'", "r'([rwxps-]{4})\\s*.*?'", "r'private_unevictable=(\\d+) private=(\\d+) '", "r'shared_app=(.*?) '", "r'shared_other_unevictable=(\\d+) shared_other=(\\d+) '", "r'\\\"(.*)\\\" '", "r'\\[([a-zA-Z0-...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/memory_inspector/memory_inspector/backends/android/memdump_parser.py#L14-L83
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py
python
StateTracker.GetLastNonSpaceToken
(self)
return self._last_non_space_token
Return the last non whitespace token.
Return the last non whitespace token.
[ "Return", "the", "last", "non", "whitespace", "token", "." ]
def GetLastNonSpaceToken(self): """Return the last non whitespace token.""" return self._last_non_space_token
[ "def", "GetLastNonSpaceToken", "(", "self", ")", ":", "return", "self", ".", "_last_non_space_token" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/statetracker.py#L1049-L1051
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/io.py
python
IOBase.isatty
(self)
return False
Return whether this is an 'interactive' stream. Return False if it can't be determined.
Return whether this is an 'interactive' stream.
[ "Return", "whether", "this", "is", "an", "interactive", "stream", "." ]
def isatty(self): """Return whether this is an 'interactive' stream. Return False if it can't be determined. """ self._checkClosed() return False
[ "def", "isatty", "(", "self", ")", ":", "self", ".", "_checkClosed", "(", ")", "return", "False" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/io.py#L482-L488
eclipse/upm
d6f76ff8c231417666594214679c49399513112e
src/doxy2swig.py
python
Doxy2SWIG.__init__
(self, src, include_function_definition=True, quiet=False)
Initialize the instance given a source object. `src` can be a file or filename. If you do not want to include function definitions from doxygen then set `include_function_definition` to `False`. This is handy since this allows you to use the swig generated function definition ...
Initialize the instance given a source object. `src` can be a file or filename. If you do not want to include function definitions from doxygen then set `include_function_definition` to `False`. This is handy since this allows you to use the swig generated function definition ...
[ "Initialize", "the", "instance", "given", "a", "source", "object", ".", "src", "can", "be", "a", "file", "or", "filename", ".", "If", "you", "do", "not", "want", "to", "include", "function", "definitions", "from", "doxygen", "then", "set", "include_function_...
def __init__(self, src, include_function_definition=True, quiet=False): """Initialize the instance given a source object. `src` can be a file or filename. If you do not want to include function definitions from doxygen then set `include_function_definition` to `False`. This is handy s...
[ "def", "__init__", "(", "self", ",", "src", ",", "include_function_definition", "=", "True", ",", "quiet", "=", "False", ")", ":", "f", "=", "my_open_read", "(", "src", ")", "self", ".", "my_dir", "=", "os", ".", "path", ".", "dirname", "(", "f", "."...
https://github.com/eclipse/upm/blob/d6f76ff8c231417666594214679c49399513112e/src/doxy2swig.py#L63-L96
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/tools/compatibility/ast_edits.py
python
get_arg_value
(node, arg_name, arg_pos=None)
return (False, None)
Get the value of an argument from a ast.Call node. This function goes through the positional and keyword arguments to check whether a given argument was used, and if so, returns its value (the node representing its value). This cannot introspect *args or **args, but it safely handles *args in Python3.5+. ...
Get the value of an argument from a ast.Call node.
[ "Get", "the", "value", "of", "an", "argument", "from", "a", "ast", ".", "Call", "node", "." ]
def get_arg_value(node, arg_name, arg_pos=None): """Get the value of an argument from a ast.Call node. This function goes through the positional and keyword arguments to check whether a given argument was used, and if so, returns its value (the node representing its value). This cannot introspect *args or *...
[ "def", "get_arg_value", "(", "node", ",", "arg_name", ",", "arg_pos", "=", "None", ")", ":", "# Check keyword args", "if", "arg_name", "is", "not", "None", ":", "for", "kw", "in", "node", ".", "keywords", ":", "if", "kw", ".", "arg", "==", "arg_name", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/compatibility/ast_edits.py#L68-L104
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/compat.py
python
get_path_uid
(path)
return file_uid
Return path's uid. Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003 Placed this function in compat due to differences on AIX and Jython, that should eventually go away. :raises OSError: When path is a symlink or can't be read.
[]
def get_path_uid(path): # type: (str) -> int """ Return path's uid. Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003 Placed this function in compat due to differences on AIX and Jython, that should eventually go away. :raises OSError: W...
[ "def", "get_path_uid", "(", "path", ")", ":", "# type: (str) -> int", "if", "hasattr", "(", "os", ",", "'O_NOFOLLOW'", ")", ":", "fd", "=", "os", ".", "open", "(", "path", ",", "os", ".", "O_RDONLY", "|", "os", ".", "O_NOFOLLOW", ")", "file_uid", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/compat.py#L221-L277
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py
python
Real.__float__
(self)
Any Real can be converted to a native float object. Called for float(self).
Any Real can be converted to a native float object.
[ "Any", "Real", "can", "be", "converted", "to", "a", "native", "float", "object", "." ]
def __float__(self): """Any Real can be converted to a native float object. Called for float(self).""" raise NotImplementedError
[ "def", "__float__", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py#L159-L163
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
unicycler/assembly_graph.py
python
AssemblyGraph.get_n_segment_length
(self, n_percent)
return 0
Returns the length for which segments that length and longer make up >= n% of the total bases. E.g. if n = 50, this function returns the N50. n must be from 0 to 100.
Returns the length for which segments that length and longer make up >= n% of the total bases. E.g. if n = 50, this function returns the N50. n must be from 0 to 100.
[ "Returns", "the", "length", "for", "which", "segments", "that", "length", "and", "longer", "make", "up", ">", "=", "n%", "of", "the", "total", "bases", ".", "E", ".", "g", ".", "if", "n", "=", "50", "this", "function", "returns", "the", "N50", ".", ...
def get_n_segment_length(self, n_percent): """ Returns the length for which segments that length and longer make up >= n% of the total bases. E.g. if n = 50, this function returns the N50. n must be from 0 to 100. """ total_length = self.get_total_length() target_length...
[ "def", "get_n_segment_length", "(", "self", ",", "n_percent", ")", ":", "total_length", "=", "self", ".", "get_total_length", "(", ")", "target_length", "=", "total_length", "*", "(", "n_percent", "/", "100.0", ")", "sorted_segments", "=", "sorted", "(", "self...
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/assembly_graph.py#L723-L737
google/tink
59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14
python/tink/jwt/_raw_jwt.py
python
RawJwt._from_json
(cls, type_header: Optional[str], payload: str)
return raw_jwt
Creates a RawJwt from payload encoded as JSON string.
Creates a RawJwt from payload encoded as JSON string.
[ "Creates", "a", "RawJwt", "from", "payload", "encoded", "as", "JSON", "string", "." ]
def _from_json(cls, type_header: Optional[str], payload: str) -> 'RawJwt': """Creates a RawJwt from payload encoded as JSON string.""" raw_jwt = object.__new__(cls) raw_jwt.__init__(type_header, _json_util.json_loads(payload)) return raw_jwt
[ "def", "_from_json", "(", "cls", ",", "type_header", ":", "Optional", "[", "str", "]", ",", "payload", ":", "str", ")", "->", "'RawJwt'", ":", "raw_jwt", "=", "object", ".", "__new__", "(", "cls", ")", "raw_jwt", ".", "__init__", "(", "type_header", ",...
https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/jwt/_raw_jwt.py#L229-L233
google/ion
ef47f3b824050499ce5c6f774b366f6c4dbce0af
ion/dev/doxygen_filter.py
python
DoxygenFormatter.AppendToBufferedLine
(self, text)
Appends text to the last buffered empty line. Empty lines are buffered rather than being written out directly. This lets us retroactively rewrite buffered lines to include markup that affects the following line, while avoiding the line number offset that would result from inserting a line that wasn't ...
Appends text to the last buffered empty line.
[ "Appends", "text", "to", "the", "last", "buffered", "empty", "line", "." ]
def AppendToBufferedLine(self, text): """Appends text to the last buffered empty line. Empty lines are buffered rather than being written out directly. This lets us retroactively rewrite buffered lines to include markup that affects the following line, while avoiding the line number offset that would ...
[ "def", "AppendToBufferedLine", "(", "self", ",", "text", ")", ":", "if", "self", ".", "empty_line_buffer", ":", "last_line", "=", "self", ".", "empty_line_buffer", ".", "pop", "(", ")", ".", "rstrip", "(", ")", "last_line", "+=", "text", "+", "'\\n'", "s...
https://github.com/google/ion/blob/ef47f3b824050499ce5c6f774b366f6c4dbce0af/ion/dev/doxygen_filter.py#L130-L151
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/amber2lmp/dump2trj99.py
python
Convert_files
()
Handle the whole conversion process
Handle the whole conversion process
[ "Handle", "the", "whole", "conversion", "process" ]
def Convert_files(): 'Handle the whole conversion process' print print 'Welcome to dump2trj, a program to convert Lammps position dump files to\nAmber trajectory format!' print Basename_list = Find_dump_files() for Basename in Basename_list: t = Trajectory() if t.Read_dump(Bas...
[ "def", "Convert_files", "(", ")", ":", "print", "print", "'Welcome to dump2trj, a program to convert Lammps position dump files to\\nAmber trajectory format!'", "print", "Basename_list", "=", "Find_dump_files", "(", ")", "for", "Basename", "in", "Basename_list", ":", "t", "="...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/amber2lmp/dump2trj99.py#L12-L26
reverbrain/elliptics
4b4f9b8094d7616c1ec50eb8605edb059b9f228e
recovery/elliptics_recovery/dc_server_send.py
python
BucketsManager.move_to_rest_bucket
(self, key, key_infos)
Dumps key to 'rest_keys' bucket.
Dumps key to 'rest_keys' bucket.
[ "Dumps", "key", "to", "rest_keys", "bucket", "." ]
def move_to_rest_bucket(self, key, key_infos): ''' Dumps key to 'rest_keys' bucket. ''' log.info("Moving key to rest keys bucket: {0}".format(key)) key_data = (key, key_infos) dump_key_data(key_data, self.ctx.rest_file)
[ "def", "move_to_rest_bucket", "(", "self", ",", "key", ",", "key_infos", ")", ":", "log", ".", "info", "(", "\"Moving key to rest keys bucket: {0}\"", ".", "format", "(", "key", ")", ")", "key_data", "=", "(", "key", ",", "key_infos", ")", "dump_key_data", "...
https://github.com/reverbrain/elliptics/blob/4b4f9b8094d7616c1ec50eb8605edb059b9f228e/recovery/elliptics_recovery/dc_server_send.py#L51-L57
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCObject._EncodeComment
(self, comment)
return '/* ' + comment.replace('*/', '(*)/') + ' */'
Encodes a comment to be placed in the project file output, mimicing Xcode behavior.
Encodes a comment to be placed in the project file output, mimicing Xcode behavior.
[ "Encodes", "a", "comment", "to", "be", "placed", "in", "the", "project", "file", "output", "mimicing", "Xcode", "behavior", "." ]
def _EncodeComment(self, comment): """Encodes a comment to be placed in the project file output, mimicing Xcode behavior. """ # This mimics Xcode behavior by wrapping the comment in "/*" and "*/". If # the string already contains a "*/", it is turned into "(*)/". This keeps # the file writer ...
[ "def", "_EncodeComment", "(", "self", ",", "comment", ")", ":", "# This mimics Xcode behavior by wrapping the comment in \"/*\" and \"*/\". If", "# the string already contains a \"*/\", it is turned into \"(*)/\". This keeps", "# the file writer from outputting something that would be treated ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/xcodeproj_file.py#L500-L511
letscontrolit/ESPEasy
acb2c9e695d6f61d8d67adf0fe4037c08d4baedd
lib/IRremoteESP8266/tools/auto_analyse_raw_data.py
python
RawIRMessage.add_data_byte_decode_code
(self, bin_str, name="", ambles=None)
return code
Add the common byte-wise "data" sequence decode code.
Add the common byte-wise "data" sequence decode code.
[ "Add", "the", "common", "byte", "-", "wise", "data", "sequence", "decode", "code", "." ]
def add_data_byte_decode_code(self, bin_str, name="", ambles=None): """Add the common byte-wise "data" sequence decode code.""" # pylint: disable=no-self-use code = [] nbits = len(bin_str) nbytes = nbits / 8 if nbits % 8: code.append(" // WARNING: Nr. of bits is not a multiple of 8. " ...
[ "def", "add_data_byte_decode_code", "(", "self", ",", "bin_str", ",", "name", "=", "\"\"", ",", "ambles", "=", "None", ")", ":", "# pylint: disable=no-self-use", "code", "=", "[", "]", "nbits", "=", "len", "(", "bin_str", ")", "nbytes", "=", "nbits", "/", ...
https://github.com/letscontrolit/ESPEasy/blob/acb2c9e695d6f61d8d67adf0fe4037c08d4baedd/lib/IRremoteESP8266/tools/auto_analyse_raw_data.py#L174-L210
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
interpreter/llvm/src/tools/clang/bindings/python/clang/cindex.py
python
CompileCommand.arguments
(self)
Get an iterable object providing each argument in the command line for the compiler invocation as a _CXString. Invariant : the first argument is the compiler executable
Get an iterable object providing each argument in the command line for the compiler invocation as a _CXString.
[ "Get", "an", "iterable", "object", "providing", "each", "argument", "in", "the", "command", "line", "for", "the", "compiler", "invocation", "as", "a", "_CXString", "." ]
def arguments(self): """ Get an iterable object providing each argument in the command line for the compiler invocation as a _CXString. Invariant : the first argument is the compiler executable """ length = conf.lib.clang_CompileCommand_getNumArgs(self.cmd) for i...
[ "def", "arguments", "(", "self", ")", ":", "length", "=", "conf", ".", "lib", ".", "clang_CompileCommand_getNumArgs", "(", "self", ".", "cmd", ")", "for", "i", "in", "range", "(", "length", ")", ":", "yield", "conf", ".", "lib", ".", "clang_CompileComman...
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/bindings/python/clang/cindex.py#L3188-L3197
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/ContactStructuralMechanicsApplication/python_scripts/custom_sympy_fe_utilities.py
python
OutputVector_CollectingFactorsNonZero
(A,name, mode, initial_tabs = 1, max_index=30, optimizations='basic')
return A_out
This method collects the constants of the replacement for vectors (only non-zero terms) Keyword arguments: A -- The factors name -- The name of the constant mode -- The mode of replacement initial_tabs -- The number of initial tabulations max_index -- The max number of indexes optimization...
This method collects the constants of the replacement for vectors (only non-zero terms)
[ "This", "method", "collects", "the", "constants", "of", "the", "replacement", "for", "vectors", "(", "only", "non", "-", "zero", "terms", ")" ]
def OutputVector_CollectingFactorsNonZero(A,name, mode, initial_tabs = 1, max_index=30, optimizations='basic'): """ This method collects the constants of the replacement for vectors (only non-zero terms) Keyword arguments: A -- The factors name -- The name of the constant mode -- The mode of repla...
[ "def", "OutputVector_CollectingFactorsNonZero", "(", "A", ",", "name", ",", "mode", ",", "initial_tabs", "=", "1", ",", "max_index", "=", "30", ",", "optimizations", "=", "'basic'", ")", ":", "symbol_name", "=", "\"c\"", "+", "name", "A_factors", ",", "A_col...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/custom_sympy_fe_utilities.py#L803-L827
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/sandbox.py
python
SandboxedEnvironment.getitem
(self, obj, argument)
return self.undefined(obj=obj, name=argument)
Subscribe an object from sandboxed code.
Subscribe an object from sandboxed code.
[ "Subscribe", "an", "object", "from", "sandboxed", "code", "." ]
def getitem(self, obj, argument): """Subscribe an object from sandboxed code.""" try: return obj[argument] except (TypeError, LookupError): if isinstance(argument, string_types): try: attr = str(argument) except Exceptio...
[ "def", "getitem", "(", "self", ",", "obj", ",", "argument", ")", ":", "try", ":", "return", "obj", "[", "argument", "]", "except", "(", "TypeError", ",", "LookupError", ")", ":", "if", "isinstance", "(", "argument", ",", "string_types", ")", ":", "try"...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/sandbox.py#L359-L378
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/misc.py
python
captured_stderr
()
return captured_output('stderr')
See captured_stdout().
See captured_stdout().
[ "See", "captured_stdout", "()", "." ]
def captured_stderr(): """ See captured_stdout(). """ return captured_output('stderr')
[ "def", "captured_stderr", "(", ")", ":", "return", "captured_output", "(", "'stderr'", ")" ]
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/utils/misc.py#L629-L633
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
bindings/python/llvm/core.py
python
LLVMEnumeration.register
(cls, name, value)
Registers a new enumeration. This is called by this module for each enumeration defined in enumerations. You should not need to call this outside this module.
Registers a new enumeration.
[ "Registers", "a", "new", "enumeration", "." ]
def register(cls, name, value): """Registers a new enumeration. This is called by this module for each enumeration defined in enumerations. You should not need to call this outside this module. """ if value in cls._value_map: raise ValueError('%s value already regist...
[ "def", "register", "(", "cls", ",", "name", ",", "value", ")", ":", "if", "value", "in", "cls", ".", "_value_map", ":", "raise", "ValueError", "(", "'%s value already registered: %d'", "%", "(", "cls", ".", "__name__", ",", "value", ")", ")", "enum", "="...
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/bindings/python/llvm/core.py#L61-L72
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/fft/helper.py
python
rfftfreq
(n, d=1.0)
return results * val
Return the Discrete Fourier Transform sample frequencies (for usage with rfft, irfft). The returned float array `f` contains the frequency bin centers in cycles per unit of the sample spacing (with zero at the start). For instance, if the sample spacing is in seconds, then the frequency unit is cycles...
Return the Discrete Fourier Transform sample frequencies (for usage with rfft, irfft).
[ "Return", "the", "Discrete", "Fourier", "Transform", "sample", "frequencies", "(", "for", "usage", "with", "rfft", "irfft", ")", "." ]
def rfftfreq(n, d=1.0): """ Return the Discrete Fourier Transform sample frequencies (for usage with rfft, irfft). The returned float array `f` contains the frequency bin centers in cycles per unit of the sample spacing (with zero at the start). For instance, if the sample spacing is in second...
[ "def", "rfftfreq", "(", "n", ",", "d", "=", "1.0", ")", ":", "if", "not", "isinstance", "(", "n", ",", "integer_types", ")", ":", "raise", "ValueError", "(", "\"n should be an integer\"", ")", "val", "=", "1.0", "/", "(", "n", "*", "d", ")", "N", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/fft/helper.py#L176-L224
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/receptive_field/python/util/receptive_field.py
python
_get_effective_padding_node_input
(stride, padding, effective_padding_output)
return stride * effective_padding_output + padding
Computes effective padding at the input of a given layer. Args: stride: Stride of given layer (integer). padding: Padding of given layer (integer). effective_padding_output: Effective padding at output of given layer (integer). Returns: effective_padding_input: Effective padding at input of ...
Computes effective padding at the input of a given layer.
[ "Computes", "effective", "padding", "at", "the", "input", "of", "a", "given", "layer", "." ]
def _get_effective_padding_node_input(stride, padding, effective_padding_output): """Computes effective padding at the input of a given layer. Args: stride: Stride of given layer (integer). padding: Padding of given layer (integer). effective_padding_output: Effect...
[ "def", "_get_effective_padding_node_input", "(", "stride", ",", "padding", ",", "effective_padding_output", ")", ":", "return", "stride", "*", "effective_padding_output", "+", "padding" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/receptive_field/python/util/receptive_field.py#L57-L71
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/SimpleXMLRPCServer.py
python
SimpleXMLRPCDispatcher.register_introspection_functions
(self)
Registers the XML-RPC introspection methods in the system namespace. see http://xmlrpc.usefulinc.com/doc/reserved.html
Registers the XML-RPC introspection methods in the system namespace.
[ "Registers", "the", "XML", "-", "RPC", "introspection", "methods", "in", "the", "system", "namespace", "." ]
def register_introspection_functions(self): """Registers the XML-RPC introspection methods in the system namespace. see http://xmlrpc.usefulinc.com/doc/reserved.html """ self.funcs.update({'system.listMethods' : self.system_listMethods, 'system.methodSigna...
[ "def", "register_introspection_functions", "(", "self", ")", ":", "self", ".", "funcs", ".", "update", "(", "{", "'system.listMethods'", ":", "self", ".", "system_listMethods", ",", "'system.methodSignature'", ":", "self", ".", "system_methodSignature", ",", "'syste...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/SimpleXMLRPCServer.py#L220-L229
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_PCR_Allocate_REQUEST.toTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def toTpm(self, buf): """ TpmMarshaller method """ buf.writeObjArr(self.pcrAllocation)
[ "def", "toTpm", "(", "self", ",", "buf", ")", ":", "buf", ".", "writeObjArr", "(", "self", ".", "pcrAllocation", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L13905-L13907
3dem/relion
72bbf0c06cea68f8992328703ee5ae5f3d1fc9b7
scripts/bfactor_plot.py
python
RelionItOptions.update_from
(self, other)
Update this RelionItOptions object from a dictionary. Special values (with names like '__xxx__') are removed, allowing this method to be given a dictionary containing the namespace from a script run with ``runpy``.
Update this RelionItOptions object from a dictionary. Special values (with names like '__xxx__') are removed, allowing this method to be given a dictionary containing the namespace from a script run with ``runpy``.
[ "Update", "this", "RelionItOptions", "object", "from", "a", "dictionary", ".", "Special", "values", "(", "with", "names", "like", "__xxx__", ")", "are", "removed", "allowing", "this", "method", "to", "be", "given", "a", "dictionary", "containing", "the", "name...
def update_from(self, other): """ Update this RelionItOptions object from a dictionary. Special values (with names like '__xxx__') are removed, allowing this method to be given a dictionary containing the namespace from a script run with ``runpy``. """ wh...
[ "def", "update_from", "(", "self", ",", "other", ")", ":", "while", "len", "(", "other", ")", ">", "0", ":", "key", ",", "value", "=", "other", ".", "popitem", "(", ")", "if", "not", "(", "key", ".", "startswith", "(", "'__'", ")", "and", "key", ...
https://github.com/3dem/relion/blob/72bbf0c06cea68f8992328703ee5ae5f3d1fc9b7/scripts/bfactor_plot.py#L96-L110
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/add_point.py
python
_EscapeName
(name)
return re.sub(r'[\:|=/#&,]', '_', name)
Escapes a trace name so it can be stored in a row. Args: name: A string representing a name. Returns: An escaped version of the name.
Escapes a trace name so it can be stored in a row.
[ "Escapes", "a", "trace", "name", "so", "it", "can", "be", "stored", "in", "a", "row", "." ]
def _EscapeName(name): """Escapes a trace name so it can be stored in a row. Args: name: A string representing a name. Returns: An escaped version of the name. """ return re.sub(r'[\:|=/#&,]', '_', name)
[ "def", "_EscapeName", "(", "name", ")", ":", "return", "re", ".", "sub", "(", "r'[\\:|=/#&,]'", ",", "'_'", ",", "name", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/add_point.py#L448-L457
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/contrib/telnet/protocol.py
python
TelnetProtocolParser.ttype
(self, data: bytes)
Received terminal type.
Received terminal type.
[ "Received", "terminal", "type", "." ]
def ttype(self, data: bytes) -> None: """ Received terminal type. """ subcmd, data = data[0:1], data[1:] if subcmd == IS: ttype = data.decode("ascii") self.ttype_received_callback(ttype) else: logger.warning("Received a non-IS terminal ...
[ "def", "ttype", "(", "self", ",", "data", ":", "bytes", ")", "->", "None", ":", "subcmd", ",", "data", "=", "data", "[", "0", ":", "1", "]", ",", "data", "[", "1", ":", "]", "if", "subcmd", "==", "IS", ":", "ttype", "=", "data", ".", "decode"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/contrib/telnet/protocol.py#L130-L139
ros/geometry2
c0cb44e5315abc6067d7640cf58487e61d8d680a
tf2_ros/src/tf2_ros/buffer_client.py
python
BufferClient.lookup_transform
(self, target_frame, source_frame, time, timeout=rospy.Duration(0.0))
return self.__process_goal(goal)
Get the transform from the source frame to the target frame. :param target_frame: Name of the frame to transform into. :param source_frame: Name of the input frame. :param time: The time at which to get the transform. (0 will get the latest) :param timeout: (Optional) Time to wait for ...
Get the transform from the source frame to the target frame.
[ "Get", "the", "transform", "from", "the", "source", "frame", "to", "the", "target", "frame", "." ]
def lookup_transform(self, target_frame, source_frame, time, timeout=rospy.Duration(0.0)): """ Get the transform from the source frame to the target frame. :param target_frame: Name of the frame to transform into. :param source_frame: Name of the input frame. :param time: The ti...
[ "def", "lookup_transform", "(", "self", ",", "target_frame", ",", "source_frame", ",", "time", ",", "timeout", "=", "rospy", ".", "Duration", "(", "0.0", ")", ")", ":", "goal", "=", "LookupTransformGoal", "(", ")", "goal", ".", "target_frame", "=", "target...
https://github.com/ros/geometry2/blob/c0cb44e5315abc6067d7640cf58487e61d8d680a/tf2_ros/src/tf2_ros/buffer_client.py#L77-L95
microsoft/SPTAG
c674f6cd8ed742c564515d15994cf591435f38e6
docs/examples/features_extractor.py
python
get_filenames
(glob_pattern, recursive=True)
return all_files
Extracts list of filenames (full paths) based on specific glob path pattern. Parameters ---------- glob_pattern : str Glob pattern for glob to extract filenames, eg. "directory/**/*.jpg" recursive : bool, optional Recursively search through subdirectories, by default True R...
Extracts list of filenames (full paths) based on specific glob path pattern. Parameters ---------- glob_pattern : str Glob pattern for glob to extract filenames, eg. "directory/**/*.jpg" recursive : bool, optional Recursively search through subdirectories, by default True R...
[ "Extracts", "list", "of", "filenames", "(", "full", "paths", ")", "based", "on", "specific", "glob", "path", "pattern", ".", "Parameters", "----------", "glob_pattern", ":", "str", "Glob", "pattern", "for", "glob", "to", "extract", "filenames", "eg", ".", "d...
def get_filenames(glob_pattern, recursive=True): """Extracts list of filenames (full paths) based on specific glob path pattern. Parameters ---------- glob_pattern : str Glob pattern for glob to extract filenames, eg. "directory/**/*.jpg" recursive : bool, optional Recursively s...
[ "def", "get_filenames", "(", "glob_pattern", ",", "recursive", "=", "True", ")", ":", "all_files", "=", "glob", ".", "glob", "(", "glob_pattern", ",", "recursive", "=", "recursive", ")", "print", "(", "'Found %s files using pattern: %s'", "%", "(", "len", "(",...
https://github.com/microsoft/SPTAG/blob/c674f6cd8ed742c564515d15994cf591435f38e6/docs/examples/features_extractor.py#L11-L28
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Misc._report_exception
(self)
Internal function.
Internal function.
[ "Internal", "function", "." ]
def _report_exception(self): """Internal function.""" import sys exc, val, tb = sys.exc_type, sys.exc_value, sys.exc_traceback root = self._root() root.report_callback_exception(exc, val, tb)
[ "def", "_report_exception", "(", "self", ")", ":", "import", "sys", "exc", ",", "val", ",", "tb", "=", "sys", ".", "exc_type", ",", "sys", ".", "exc_value", ",", "sys", ".", "exc_traceback", "root", "=", "self", ".", "_root", "(", ")", "root", ".", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1231-L1236
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/generator/msvs.py
python
_GenerateRulesForMSVS
(p, output_dir, options, spec, sources, excluded_sources, actions_to_add)
Generate all the rules for a particular project. Arguments: p: the project output_dir: directory to emit rules to options: global options passed to the generator spec: the specification for this project sources: the set of all known source files in this project excluded_sources: the set of so...
Generate all the rules for a particular project.
[ "Generate", "all", "the", "rules", "for", "a", "particular", "project", "." ]
def _GenerateRulesForMSVS(p, output_dir, options, spec, sources, excluded_sources, actions_to_add): """Generate all the rules for a particular project. Arguments: p: the project output_dir: directory to emit rules to options: global options passed to ...
[ "def", "_GenerateRulesForMSVS", "(", "p", ",", "output_dir", ",", "options", ",", "spec", ",", "sources", ",", "excluded_sources", ",", "actions_to_add", ")", ":", "rules", "=", "spec", ".", "get", "(", "'rules'", ",", "[", "]", ")", "rules_native", "=", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/msvs.py#L798-L824
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/common/walterWidgets/walterLayersView.py
python
LayersItem.__init__
(self, parentItem, name, visible, renderable)
Called after the instance has been created.
Called after the instance has been created.
[ "Called", "after", "the", "instance", "has", "been", "created", "." ]
def __init__(self, parentItem, name, visible, renderable): """Called after the instance has been created.""" super(LayersItem, self).__init__(parentItem, name) self.visible = visible self.renderable = renderable
[ "def", "__init__", "(", "self", ",", "parentItem", ",", "name", ",", "visible", ",", "renderable", ")", ":", "super", "(", "LayersItem", ",", "self", ")", ".", "__init__", "(", "parentItem", ",", "name", ")", "self", ".", "visible", "=", "visible", "se...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/common/walterWidgets/walterLayersView.py#L280-L284
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
SimRobotController.sensor
(self, *args)
return _robotsim.SimRobotController_sensor(self, *args)
r""" Returns a sensor by index or by name. If out of bounds or unavailable, a null sensor is returned (i.e., SimRobotSensor.name() or SimRobotSensor.type()) will return the empty string.) sensor (index): :class:`~klampt.SimRobotSensor` sensor (name): :class:`~klampt.SimRobotS...
r""" Returns a sensor by index or by name. If out of bounds or unavailable, a null sensor is returned (i.e., SimRobotSensor.name() or SimRobotSensor.type()) will return the empty string.)
[ "r", "Returns", "a", "sensor", "by", "index", "or", "by", "name", ".", "If", "out", "of", "bounds", "or", "unavailable", "a", "null", "sensor", "is", "returned", "(", "i", ".", "e", ".", "SimRobotSensor", ".", "name", "()", "or", "SimRobotSensor", ".",...
def sensor(self, *args) -> "SimRobotSensor": r""" Returns a sensor by index or by name. If out of bounds or unavailable, a null sensor is returned (i.e., SimRobotSensor.name() or SimRobotSensor.type()) will return the empty string.) sensor (index): :class:`~klampt.SimRobotSens...
[ "def", "sensor", "(", "self", ",", "*", "args", ")", "->", "\"SimRobotSensor\"", ":", "return", "_robotsim", ".", "SimRobotController_sensor", "(", "self", ",", "*", "args", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7124-L7142
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlNode.addNextSibling
(self, elem)
return __tmp
Add a new node @elem as the next sibling of @cur If the new node was already inserted in a document it is first unlinked from its existing context. As a result of text merging @elem may be freed. If the new node is ATTRIBUTE, it is added into properties instead of children. If th...
Add a new node
[ "Add", "a", "new", "node" ]
def addNextSibling(self, elem): """Add a new node @elem as the next sibling of @cur If the new node was already inserted in a document it is first unlinked from its existing context. As a result of text merging @elem may be freed. If the new node is ATTRIBUTE, it is added...
[ "def", "addNextSibling", "(", "self", ",", "elem", ")", ":", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlAddNextSibling", "(", "self", ".", "_o", ",", "el...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L3114-L3126
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/ops.py
python
BaseGrouper._get_cython_func_and_vals
( self, kind: str, how: str, values: np.ndarray, is_numeric: bool )
return func, values
Find the appropriate cython function, casting if necessary. Parameters ---------- kind : sttr how : srt values : np.ndarray is_numeric : bool Returns ------- func : callable values : np.ndarray
Find the appropriate cython function, casting if necessary.
[ "Find", "the", "appropriate", "cython", "function", "casting", "if", "necessary", "." ]
def _get_cython_func_and_vals( self, kind: str, how: str, values: np.ndarray, is_numeric: bool ): """ Find the appropriate cython function, casting if necessary. Parameters ---------- kind : sttr how : srt values : np.ndarray is_numeric : bool...
[ "def", "_get_cython_func_and_vals", "(", "self", ",", "kind", ":", "str", ",", "how", ":", "str", ",", "values", ":", "np", ".", "ndarray", ",", "is_numeric", ":", "bool", ")", ":", "try", ":", "func", "=", "self", ".", "_get_cython_function", "(", "ki...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/ops.py#L393-L425
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
Notebook.GetThemeBackgroundColour
(*args, **kwargs)
return _controls_.Notebook_GetThemeBackgroundColour(*args, **kwargs)
GetThemeBackgroundColour(self) -> Colour
GetThemeBackgroundColour(self) -> Colour
[ "GetThemeBackgroundColour", "(", "self", ")", "-", ">", "Colour" ]
def GetThemeBackgroundColour(*args, **kwargs): """GetThemeBackgroundColour(self) -> Colour""" return _controls_.Notebook_GetThemeBackgroundColour(*args, **kwargs)
[ "def", "GetThemeBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Notebook_GetThemeBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3104-L3106
Lavender105/DFF
152397cec4a3dac2aa86e92a65cc27e6c8016ab9
pytorch-encoding/encoding/models/casenet.py
python
get_casenet
(dataset='cityscapes', backbone='resnet50', pretrained=False, root='./pretrain_models', **kwargs)
return model
r"""CaseNet model from the paper "CASENet: Deep Category-Aware Semantic Edge Detection"
r"""CaseNet model from the paper "CASENet: Deep Category-Aware Semantic Edge Detection"
[ "r", "CaseNet", "model", "from", "the", "paper", "CASENet", ":", "Deep", "Category", "-", "Aware", "Semantic", "Edge", "Detection" ]
def get_casenet(dataset='cityscapes', backbone='resnet50', pretrained=False, root='./pretrain_models', **kwargs): r"""CaseNet model from the paper "CASENet: Deep Category-Aware Semantic Edge Detection" """ acronyms = { 'pascal_voc': 'voc', 'pascal_aug': 'voc', 'pcontext':...
[ "def", "get_casenet", "(", "dataset", "=", "'cityscapes'", ",", "backbone", "=", "'resnet50'", ",", "pretrained", "=", "False", ",", "root", "=", "'./pretrain_models'", ",", "*", "*", "kwargs", ")", ":", "acronyms", "=", "{", "'pascal_voc'", ":", "'voc'", ...
https://github.com/Lavender105/DFF/blob/152397cec4a3dac2aa86e92a65cc27e6c8016ab9/pytorch-encoding/encoding/models/casenet.py#L120-L139
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py
python
NDFrame.to_xarray
(self)
Return an xarray object from the pandas object. Returns ------- xarray.DataArray or xarray.Dataset Data in the pandas structure converted to Dataset if the object is a DataFrame, or a DataArray if the object is a Series. See Also -------- DataFra...
Return an xarray object from the pandas object.
[ "Return", "an", "xarray", "object", "from", "the", "pandas", "object", "." ]
def to_xarray(self): """ Return an xarray object from the pandas object. Returns ------- xarray.DataArray or xarray.Dataset Data in the pandas structure converted to Dataset if the object is a DataFrame, or a DataArray if the object is a Series. ...
[ "def", "to_xarray", "(", "self", ")", ":", "xarray", "=", "import_optional_dependency", "(", "\"xarray\"", ")", "if", "self", ".", "ndim", "==", "1", ":", "return", "xarray", ".", "DataArray", ".", "from_series", "(", "self", ")", "else", ":", "return", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py#L2787-L2868
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/plan/motionplanning.py
python
CSpaceInterface.isVisible
(self, a, b)
return _motionplanning.CSpaceInterface_isVisible(self, a, b)
Queries whether two configurations are visible. Args: a (:obj:`object`) b (:obj:`object`) Returns: (bool):
Queries whether two configurations are visible.
[ "Queries", "whether", "two", "configurations", "are", "visible", "." ]
def isVisible(self, a, b): """ Queries whether two configurations are visible. Args: a (:obj:`object`) b (:obj:`object`) Returns: (bool): """ return _motionplanning.CSpaceInterface_isVisible(self, a, b)
[ "def", "isVisible", "(", "self", ",", "a", ",", "b", ")", ":", "return", "_motionplanning", ".", "CSpaceInterface_isVisible", "(", "self", ",", "a", ",", "b", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/plan/motionplanning.py#L430-L440
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
DateTime.GetDateOnly
(*args, **kwargs)
return _misc_.DateTime_GetDateOnly(*args, **kwargs)
GetDateOnly(self) -> DateTime
GetDateOnly(self) -> DateTime
[ "GetDateOnly", "(", "self", ")", "-", ">", "DateTime" ]
def GetDateOnly(*args, **kwargs): """GetDateOnly(self) -> DateTime""" return _misc_.DateTime_GetDateOnly(*args, **kwargs)
[ "def", "GetDateOnly", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_GetDateOnly", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3813-L3815
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/elementwise/ceil.py
python
floor.is_decr
(self, idx)
return False
Is the composition non-increasing in argument idx?
Is the composition non-increasing in argument idx?
[ "Is", "the", "composition", "non", "-", "increasing", "in", "argument", "idx?" ]
def is_decr(self, idx) -> bool: """Is the composition non-increasing in argument idx? """ return False
[ "def", "is_decr", "(", "self", ",", "idx", ")", "->", "bool", ":", "return", "False" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/elementwise/ceil.py#L159-L162
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/distribute/distributed_training_utils.py
python
_make_graph_execution_function
(model, mode)
Makes function to run one step of distributed model in graph mode.
Makes function to run one step of distributed model in graph mode.
[ "Makes", "function", "to", "run", "one", "step", "of", "distributed", "model", "in", "graph", "mode", "." ]
def _make_graph_execution_function(model, mode): """Makes function to run one step of distributed model in graph mode.""" def _per_replica_function(model): f = model._make_execution_function(mode) return (f.inputs, f.outputs, f.updates_op, f.session_kwargs) strategy = model._distribution_strategy with...
[ "def", "_make_graph_execution_function", "(", "model", ",", "mode", ")", ":", "def", "_per_replica_function", "(", "model", ")", ":", "f", "=", "model", ".", "_make_execution_function", "(", "mode", ")", "return", "(", "f", ".", "inputs", ",", "f", ".", "o...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/distribute/distributed_training_utils.py#L952-L990
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/generate_compile_expansions_shared_cache.py
python
generate_expansions
()
Entry point for the script. This calls functions to generate version and scons cache expansions and writes them to a file.
Entry point for the script.
[ "Entry", "point", "for", "the", "script", "." ]
def generate_expansions(): """Entry point for the script. This calls functions to generate version and scons cache expansions and writes them to a file. """ args = parse_args() expansions = {} expansions.update(generate_version_expansions()) expansions.update(generate_scons_cache_expans...
[ "def", "generate_expansions", "(", ")", ":", "args", "=", "parse_args", "(", ")", "expansions", "=", "{", "}", "expansions", ".", "update", "(", "generate_version_expansions", "(", ")", ")", "expansions", ".", "update", "(", "generate_scons_cache_expansions", "(...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/generate_compile_expansions_shared_cache.py#L20-L33
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Chem/MolSurf.py
python
_pyTPSAContribs
(mol, verbose=False)
return res
DEPRECATED: this has been reimplmented in C++ calculates atomic contributions to a molecules TPSA Algorithm described in: P. Ertl, B. Rohde, P. Selzer Fast Calculation of Molecular Polar Surface Area as a Sum of Fragment-based Contributions and Its Application to the Prediction of Drug Transport ...
DEPRECATED: this has been reimplmented in C++ calculates atomic contributions to a molecules TPSA
[ "DEPRECATED", ":", "this", "has", "been", "reimplmented", "in", "C", "++", "calculates", "atomic", "contributions", "to", "a", "molecules", "TPSA" ]
def _pyTPSAContribs(mol, verbose=False): """ DEPRECATED: this has been reimplmented in C++ calculates atomic contributions to a molecules TPSA Algorithm described in: P. Ertl, B. Rohde, P. Selzer Fast Calculation of Molecular Polar Surface Area as a Sum of Fragment-based Contributions and Its Appl...
[ "def", "_pyTPSAContribs", "(", "mol", ",", "verbose", "=", "False", ")", ":", "res", "=", "[", "0", "]", "*", "mol", ".", "GetNumAtoms", "(", ")", "for", "i", "in", "range", "(", "mol", ".", "GetNumAtoms", "(", ")", ")", ":", "atom", "=", "mol", ...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/MolSurf.py#L317-L458
lyxok1/Tiny-DSOD
94d15450699bea0dd3720e75e2d273e476174fba
examples/pycaffe/layers/pascal_multilabel_datalayers.py
python
check_params
(params)
A utility function to check the parameters for the data layers.
A utility function to check the parameters for the data layers.
[ "A", "utility", "function", "to", "check", "the", "parameters", "for", "the", "data", "layers", "." ]
def check_params(params): """ A utility function to check the parameters for the data layers. """ assert 'split' in params.keys( ), 'Params must include split (train, val, or test).' required = ['batch_size', 'pascal_root', 'im_shape'] for r in required: assert r in params.keys(), '...
[ "def", "check_params", "(", "params", ")", ":", "assert", "'split'", "in", "params", ".", "keys", "(", ")", ",", "'Params must include split (train, val, or test).'", "required", "=", "[", "'batch_size'", ",", "'pascal_root'", ",", "'im_shape'", "]", "for", "r", ...
https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L196-L205
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/monitoring.py
python
StringGauge.get_cell
(self, *labels)
return StringGaugeCell(super(StringGauge, self).get_cell(*labels))
Retrieves the cell.
Retrieves the cell.
[ "Retrieves", "the", "cell", "." ]
def get_cell(self, *labels): """Retrieves the cell.""" return StringGaugeCell(super(StringGauge, self).get_cell(*labels))
[ "def", "get_cell", "(", "self", ",", "*", "labels", ")", ":", "return", "StringGaugeCell", "(", "super", "(", "StringGauge", ",", "self", ")", ".", "get_cell", "(", "*", "labels", ")", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/monitoring.py#L306-L308
smartdevicelink/sdl_core
68f082169e0a40fccd9eb0db3c83911c28870f07
tools/InterfaceGenerator/generator/generators/PolicyTypes.py
python
CodeGenerator._namespaces_strings
(self, namespace)
return namespace_open, namespace_close
Generate open and close namespaces strings Generates source code for opening and close namespaces Keyword arguments: namespace -- name of destination namespace. Returns: Tuple with namespace open string and namespace close string
Generate open and close namespaces strings
[ "Generate", "open", "and", "close", "namespaces", "strings" ]
def _namespaces_strings(self, namespace): """ Generate open and close namespaces strings Generates source code for opening and close namespaces Keyword arguments: namespace -- name of destination namespace. Returns: Tuple with namespace open string and namespace close...
[ "def", "_namespaces_strings", "(", "self", ",", "namespace", ")", ":", "namespace_open", "=", "u\"\"", "namespace_close", "=", "u\"\"", "if", "namespace", ":", "parts", "=", "namespace", ".", "split", "(", "u\"::\"", ")", "for", "part", "in", "parts", ":", ...
https://github.com/smartdevicelink/sdl_core/blob/68f082169e0a40fccd9eb0db3c83911c28870f07/tools/InterfaceGenerator/generator/generators/PolicyTypes.py#L246-L271
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/function_def_to_graph.py
python
function_def_to_graph
(fdef, input_shapes=None, copy_functions=True)
return func_graph
Converts a FunctionDef to a FuncGraph (sub-class Graph). The returned FuncGraph's `name`, `inputs` and `outputs` fields will be set. The input tensors are represented as placeholders. Note: `FuncGraph.inputs` and `FuncGraph.captures` are not set and may be set by the caller. Args: fdef: FunctionDef. ...
Converts a FunctionDef to a FuncGraph (sub-class Graph).
[ "Converts", "a", "FunctionDef", "to", "a", "FuncGraph", "(", "sub", "-", "class", "Graph", ")", "." ]
def function_def_to_graph(fdef, input_shapes=None, copy_functions=True): """Converts a FunctionDef to a FuncGraph (sub-class Graph). The returned FuncGraph's `name`, `inputs` and `outputs` fields will be set. The input tensors are represented as placeholders. Note: `FuncGraph.inputs` and `FuncGraph.captures` ...
[ "def", "function_def_to_graph", "(", "fdef", ",", "input_shapes", "=", "None", ",", "copy_functions", "=", "True", ")", ":", "func_graph", "=", "FuncGraph", "(", "fdef", ".", "signature", ".", "name", ")", "if", "input_shapes", "is", "None", ":", "input_shap...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/function_def_to_graph.py#L32-L106
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/packages/six.py
python
_add_doc
(func, doc)
Add documentation to a function.
Add documentation to a function.
[ "Add", "documentation", "to", "a", "function", "." ]
def _add_doc(func, doc): """Add documentation to a function.""" func.__doc__ = doc
[ "def", "_add_doc", "(", "func", ",", "doc", ")", ":", "func", ".", "__doc__", "=", "doc" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/packages/six.py#L75-L77
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/sets.py
python
BaseSet.__contains__
(self, element)
Report whether an element is a member of a set. (Called in response to the expression `element in self'.)
Report whether an element is a member of a set.
[ "Report", "whether", "an", "element", "is", "a", "member", "of", "a", "set", "." ]
def __contains__(self, element): """Report whether an element is a member of a set. (Called in response to the expression `element in self'.) """ try: return element in self._data except TypeError: transform = getattr(element, "__as_temporarily_immutable_...
[ "def", "__contains__", "(", "self", ",", "element", ")", ":", "try", ":", "return", "element", "in", "self", ".", "_data", "except", "TypeError", ":", "transform", "=", "getattr", "(", "element", ",", "\"__as_temporarily_immutable__\"", ",", "None", ")", "if...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/sets.py#L274-L285
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/ContactStructuralMechanicsApplication/python_scripts/basic_mapping_process.py
python
BasicMappingProcess.ExecuteInitializeSolutionStep
(self)
This method is executed in order to initialize the current step Keyword arguments: self -- It signifies an instance of a class.
This method is executed in order to initialize the current step
[ "This", "method", "is", "executed", "in", "order", "to", "initialize", "the", "current", "step" ]
def ExecuteInitializeSolutionStep(self): """ This method is executed in order to initialize the current step Keyword arguments: self -- It signifies an instance of a class. """ current_time = self.origin_model_part.ProcessInfo[KratosMultiphysics.TIME] if self.interval.I...
[ "def", "ExecuteInitializeSolutionStep", "(", "self", ")", ":", "current_time", "=", "self", ".", "origin_model_part", ".", "ProcessInfo", "[", "KratosMultiphysics", ".", "TIME", "]", "if", "self", ".", "interval", ".", "IsInInterval", "(", "current_time", ")", "...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/basic_mapping_process.py#L99-L108