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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/factorization/examples/mnist.py | python | run_training | () | Train MNIST for a number of steps. | Train MNIST for a number of steps. | [
"Train",
"MNIST",
"for",
"a",
"number",
"of",
"steps",
"."
] | def run_training():
"""Train MNIST for a number of steps."""
# Get the sets of images and labels for training, validation, and
# test on MNIST.
train_dir = tempfile.mkdtemp()
data_sets = input_data.read_data_sets(train_dir, FLAGS.fake_data)
# Tell TensorFlow that the model will be built into the default Gr... | [
"def",
"run_training",
"(",
")",
":",
"# Get the sets of images and labels for training, validation, and",
"# test on MNIST.",
"train_dir",
"=",
"tempfile",
".",
"mkdtemp",
"(",
")",
"data_sets",
"=",
"input_data",
".",
"read_data_sets",
"(",
"train_dir",
",",
"FLAGS",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/factorization/examples/mnist.py#L192-L281 | ||
mickem/nscp | 79f89fdbb6da63f91bc9dedb7aea202fe938f237 | scripts/python/lib/google/protobuf/service_reflection.py | python | _ServiceBuilder.__init__ | (self, service_descriptor) | Initializes an instance of the service class builder.
Args:
service_descriptor: ServiceDescriptor to use when constructing the
service class. | Initializes an instance of the service class builder. | [
"Initializes",
"an",
"instance",
"of",
"the",
"service",
"class",
"builder",
"."
] | def __init__(self, service_descriptor):
"""Initializes an instance of the service class builder.
Args:
service_descriptor: ServiceDescriptor to use when constructing the
service class.
"""
self.descriptor = service_descriptor | [
"def",
"__init__",
"(",
"self",
",",
"service_descriptor",
")",
":",
"self",
".",
"descriptor",
"=",
"service_descriptor"
] | https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/service_reflection.py#L124-L131 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/chardet/chardistribution.py | python | CharDistributionAnalysis.reset | (self) | reset analyser, clear any state | reset analyser, clear any state | [
"reset",
"analyser",
"clear",
"any",
"state"
] | def reset(self):
"""reset analyser, clear any state"""
# If this flag is set to True, detection is done and conclusion has
# been made
self._done = False
self._total_chars = 0 # Total characters encountered
# The number of characters whose frequency order is less t... | [
"def",
"reset",
"(",
"self",
")",
":",
"# If this flag is set to True, detection is done and conclusion has",
"# been made",
"self",
".",
"_done",
"=",
"False",
"self",
".",
"_total_chars",
"=",
"0",
"# Total characters encountered",
"# The number of characters whose frequency ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/chardet/chardistribution.py#L121-L135 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/masked/maskededit.py | python | __test._onCheck1 | (self,event) | Set required value on/off | Set required value on/off | [
"Set",
"required",
"value",
"on",
"/",
"off"
] | def _onCheck1(self,event):
""" Set required value on/off """
value = event.IsChecked()
if value:
for control in self.editList:
control.SetCtrlParameters(emptyInvalid=True)
control.Refresh()
else:
for ... | [
"def",
"_onCheck1",
"(",
"self",
",",
"event",
")",
":",
"value",
"=",
"event",
".",
"IsChecked",
"(",
")",
"if",
"value",
":",
"for",
"control",
"in",
"self",
".",
"editList",
":",
"control",
".",
"SetCtrlParameters",
"(",
"emptyInvalid",
"=",
"True",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/maskededit.py#L6637-L6648 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/def_function.py | python | run_functions_eagerly | (run_eagerly) | Enables / disables eager execution of `tf.function`s.
After calling `tf.config.experimental_run_functions_eagerly(True)` all
invocations of tf.function will run eagerly instead of running through a graph
function.
This can be useful for debugging or profiling.
Similarly, calling `tf.config.experimental_run... | Enables / disables eager execution of `tf.function`s. | [
"Enables",
"/",
"disables",
"eager",
"execution",
"of",
"tf",
".",
"function",
"s",
"."
] | def run_functions_eagerly(run_eagerly):
"""Enables / disables eager execution of `tf.function`s.
After calling `tf.config.experimental_run_functions_eagerly(True)` all
invocations of tf.function will run eagerly instead of running through a graph
function.
This can be useful for debugging or profiling.
S... | [
"def",
"run_functions_eagerly",
"(",
"run_eagerly",
")",
":",
"global",
"RUN_FUNCTIONS_EAGERLY",
"RUN_FUNCTIONS_EAGERLY",
"=",
"bool",
"(",
"run_eagerly",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/def_function.py#L219-L235 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/gen.py | python | sleep | (duration: float) | return f | Return a `.Future` that resolves after the given number of seconds.
When used with ``yield`` in a coroutine, this is a non-blocking
analogue to `time.sleep` (which should not be used in coroutines
because it is blocking)::
yield gen.sleep(0.5)
Note that calling this function on its own does n... | Return a `.Future` that resolves after the given number of seconds. | [
"Return",
"a",
".",
"Future",
"that",
"resolves",
"after",
"the",
"given",
"number",
"of",
"seconds",
"."
] | def sleep(duration: float) -> "Future[None]":
"""Return a `.Future` that resolves after the given number of seconds.
When used with ``yield`` in a coroutine, this is a non-blocking
analogue to `time.sleep` (which should not be used in coroutines
because it is blocking)::
yield gen.sleep(0.5)
... | [
"def",
"sleep",
"(",
"duration",
":",
"float",
")",
"->",
"\"Future[None]\"",
":",
"f",
"=",
"_create_future",
"(",
")",
"IOLoop",
".",
"current",
"(",
")",
".",
"call_later",
"(",
"duration",
",",
"lambda",
":",
"future_set_result_unless_cancelled",
"(",
"f... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/gen.py#L650-L668 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/plotting/_matplotlib/converter.py | python | TimeSeries_DateFormatter._set_default_format | (self, vmin, vmax) | return self.formatdict | Returns the default ticks spacing. | Returns the default ticks spacing. | [
"Returns",
"the",
"default",
"ticks",
"spacing",
"."
] | def _set_default_format(self, vmin, vmax):
"Returns the default ticks spacing."
if self.plot_obj.date_axis_info is None:
self.plot_obj.date_axis_info = self.finder(vmin, vmax, self.freq)
info = self.plot_obj.date_axis_info
if self.isminor:
format = np.compress(i... | [
"def",
"_set_default_format",
"(",
"self",
",",
"vmin",
",",
"vmax",
")",
":",
"if",
"self",
".",
"plot_obj",
".",
"date_axis_info",
"is",
"None",
":",
"self",
".",
"plot_obj",
".",
"date_axis_info",
"=",
"self",
".",
"finder",
"(",
"vmin",
",",
"vmax",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/plotting/_matplotlib/converter.py#L1065-L1077 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py | python | FileFinder.path_hook | (cls, *loader_details) | return path_hook_for_FileFinder | A class method which returns a closure to use on sys.path_hook
which will return an instance using the specified loaders and the path
called on the closure.
If the path called on the closure is not a directory, ImportError is
raised. | A class method which returns a closure to use on sys.path_hook
which will return an instance using the specified loaders and the path
called on the closure. | [
"A",
"class",
"method",
"which",
"returns",
"a",
"closure",
"to",
"use",
"on",
"sys",
".",
"path_hook",
"which",
"will",
"return",
"an",
"instance",
"using",
"the",
"specified",
"loaders",
"and",
"the",
"path",
"called",
"on",
"the",
"closure",
"."
] | def path_hook(cls, *loader_details):
"""A class method which returns a closure to use on sys.path_hook
which will return an instance using the specified loaders and the path
called on the closure.
If the path called on the closure is not a directory, ImportError is
raised.
... | [
"def",
"path_hook",
"(",
"cls",
",",
"*",
"loader_details",
")",
":",
"def",
"path_hook_for_FileFinder",
"(",
"path",
")",
":",
"\"\"\"Path hook for importlib.machinery.FileFinder.\"\"\"",
"if",
"not",
"_path_isdir",
"(",
"path",
")",
":",
"raise",
"ImportError",
"(... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py#L1436-L1451 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transform.py | python | Transform._check_output_tensors | (self, output_tensors) | Helper for `build(...)`; verifies the output of `_build_transform`.
Args:
output_tensors: value returned by a call to `_build_transform`.
Raises:
TypeError: `transform_output` is not a list.
ValueError: `transform_output` does not match `output_names`. | Helper for `build(...)`; verifies the output of `_build_transform`. | [
"Helper",
"for",
"build",
"(",
"...",
")",
";",
"verifies",
"the",
"output",
"of",
"_build_transform",
"."
] | def _check_output_tensors(self, output_tensors):
"""Helper for `build(...)`; verifies the output of `_build_transform`.
Args:
output_tensors: value returned by a call to `_build_transform`.
Raises:
TypeError: `transform_output` is not a list.
ValueError: `transform_output` does not match... | [
"def",
"_check_output_tensors",
"(",
"self",
",",
"output_tensors",
")",
":",
"if",
"not",
"isinstance",
"(",
"output_tensors",
",",
"self",
".",
"return_type",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected a NamedTuple of Tensors with elements %s; got %s.\"",
"%",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transform.py#L188-L201 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/inspector_backend.py | python | InspectorBackend._ConvertExceptionFromInspectorWebsocket | (self, error) | Converts an Exception from inspector_websocket.
This method always raises a Telemetry exception. It appends debugging
information. The exact exception raised depends on |error|.
Args:
error: An instance of socket.error or websocket.WebSocketException.
Raises:
exceptions.TimeoutException: A... | Converts an Exception from inspector_websocket. | [
"Converts",
"an",
"Exception",
"from",
"inspector_websocket",
"."
] | def _ConvertExceptionFromInspectorWebsocket(self, error):
"""Converts an Exception from inspector_websocket.
This method always raises a Telemetry exception. It appends debugging
information. The exact exception raised depends on |error|.
Args:
error: An instance of socket.error or websocket.Web... | [
"def",
"_ConvertExceptionFromInspectorWebsocket",
"(",
"self",
",",
"error",
")",
":",
"if",
"isinstance",
"(",
"error",
",",
"websocket",
".",
"WebSocketTimeoutException",
")",
":",
"new_error",
"=",
"exceptions",
".",
"TimeoutException",
"(",
")",
"new_error",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/inspector_backend.py#L368-L392 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | withAttribute | (*args,**attrDict) | return pa | Helper to create a validating parse action to be used with start tags created
with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
with a required attribute value, to avoid false matches on common tags such as
C{<TD>} or C{<DIV>}.
Call C{withAttribute} with ... | [] | def withAttribute(*args,**attrDict):
"""
Helper to create a validating parse action to be used with start tags created
with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
with a required attribute value, to avoid false matches on common tags such as
C{<T... | [
"def",
"withAttribute",
"(",
"*",
"args",
",",
"*",
"*",
"attrDict",
")",
":",
"if",
"args",
":",
"attrs",
"=",
"args",
"[",
":",
"]",
"else",
":",
"attrs",
"=",
"attrDict",
".",
"items",
"(",
")",
"attrs",
"=",
"[",
"(",
"k",
",",
"v",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L9863-L9987 | ||
nci/drishti | 89cd8b740239c5b2c8222dffd4e27432fde170a1 | bin/assets/scripts/unet++/unet_collection/swin.py | python | swin_unet_2d | (input_size,
n_labels,
filter_num_begin,
depth,
stack_num_down, stack_num_up,
patch_size, num_heads,
window_size, num_mlp,
shift_window,
output_activation='sigmoid') | return model | filter_num_begin = 128 # number of channels in the first downsampling block;
it is also the number of embedded dimensions
depth = 4 # the depth of SwinUNET; depth=4 means three down/upsampling levels and a bottom level
stack_num_down = 2 # number of... | filter_num_begin = 128 # number of channels in the first downsampling block;
it is also the number of embedded dimensions
depth = 4 # the depth of SwinUNET; depth=4 means three down/upsampling levels and a bottom level
stack_num_down = 2 # number of... | [
"filter_num_begin",
"=",
"128",
"#",
"number",
"of",
"channels",
"in",
"the",
"first",
"downsampling",
"block",
";",
"it",
"is",
"also",
"the",
"number",
"of",
"embedded",
"dimensions",
"depth",
"=",
"4",
"#",
"the",
"depth",
"of",
"SwinUNET",
";",
"depth"... | def swin_unet_2d(input_size,
n_labels,
filter_num_begin,
depth,
stack_num_down, stack_num_up,
patch_size, num_heads,
window_size, num_mlp,
shift_window,
output_activation='sigmoid'):
... | [
"def",
"swin_unet_2d",
"(",
"input_size",
",",
"n_labels",
",",
"filter_num_begin",
",",
"depth",
",",
"stack_num_down",
",",
"stack_num_up",
",",
"patch_size",
",",
"num_heads",
",",
"window_size",
",",
"num_mlp",
",",
"shift_window",
",",
"output_activation",
"=... | https://github.com/nci/drishti/blob/89cd8b740239c5b2c8222dffd4e27432fde170a1/bin/assets/scripts/unet++/unet_collection/swin.py#L161-L200 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextPrinting.GetRichTextBufferPrinting | (*args, **kwargs) | return _richtext.RichTextPrinting_GetRichTextBufferPrinting(*args, **kwargs) | GetRichTextBufferPrinting(self) -> RichTextBuffer | GetRichTextBufferPrinting(self) -> RichTextBuffer | [
"GetRichTextBufferPrinting",
"(",
"self",
")",
"-",
">",
"RichTextBuffer"
] | def GetRichTextBufferPrinting(*args, **kwargs):
"""GetRichTextBufferPrinting(self) -> RichTextBuffer"""
return _richtext.RichTextPrinting_GetRichTextBufferPrinting(*args, **kwargs) | [
"def",
"GetRichTextBufferPrinting",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextPrinting_GetRichTextBufferPrinting",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L4580-L4582 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiToolBarEvent.GetItemRect | (*args, **kwargs) | return _aui.AuiToolBarEvent_GetItemRect(*args, **kwargs) | GetItemRect(self) -> Rect | GetItemRect(self) -> Rect | [
"GetItemRect",
"(",
"self",
")",
"-",
">",
"Rect"
] | def GetItemRect(*args, **kwargs):
"""GetItemRect(self) -> Rect"""
return _aui.AuiToolBarEvent_GetItemRect(*args, **kwargs) | [
"def",
"GetItemRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarEvent_GetItemRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1697-L1699 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/apk_operations.py | python | RunForBundle | (output_directory, bundle_path, bundle_apks_path,
additional_apk_paths, aapt2_path, keystore_path,
keystore_password, keystore_alias, package_name,
command_line_flags_file, proguard_mapping_path, target_cpu,
system_image_locales, default_modules) | Entry point for generated app bundle wrapper scripts.
Args:
output_dir: Chromium output directory path.
bundle_path: Input bundle path.
bundle_apks_path: Output bundle .apks archive path.
additional_apk_paths: Additional APKs to install prior to bundle install.
aapt2_path: Aapt2 tool path.
ke... | Entry point for generated app bundle wrapper scripts. | [
"Entry",
"point",
"for",
"generated",
"app",
"bundle",
"wrapper",
"scripts",
"."
] | def RunForBundle(output_directory, bundle_path, bundle_apks_path,
additional_apk_paths, aapt2_path, keystore_path,
keystore_password, keystore_alias, package_name,
command_line_flags_file, proguard_mapping_path, target_cpu,
system_image_locales, defaul... | [
"def",
"RunForBundle",
"(",
"output_directory",
",",
"bundle_path",
",",
"bundle_apks_path",
",",
"additional_apk_paths",
",",
"aapt2_path",
",",
"keystore_path",
",",
"keystore_password",
",",
"keystore_alias",
",",
"package_name",
",",
"command_line_flags_file",
",",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/apk_operations.py#L1886-L1935 | ||
kevin-ssy/Optical-Flow-Guided-Feature | 07d4501a29002ee7821c38c1820e4a64c1acf6e8 | lib/caffe-action/scripts/cpp_lint.py | python | CleanseComments | (line) | return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) | Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed. | Removes //-comments and single-line C-style /* */ comments. | [
"Removes",
"//",
"-",
"comments",
"and",
"single",
"-",
"line",
"C",
"-",
"style",
"/",
"*",
"*",
"/",
"comments",
"."
] | def CleanseComments(line):
"""Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed.
"""
commentpos = line.find('//')
if commentpos != -1 and not IsCppString(line[:commentpos]):
line = line[:commentpos]... | [
"def",
"CleanseComments",
"(",
"line",
")",
":",
"commentpos",
"=",
"line",
".",
"find",
"(",
"'//'",
")",
"if",
"commentpos",
"!=",
"-",
"1",
"and",
"not",
"IsCppString",
"(",
"line",
"[",
":",
"commentpos",
"]",
")",
":",
"line",
"=",
"line",
"[",
... | https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/scripts/cpp_lint.py#L1167-L1180 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/encoding_stage.py | python | _tf_style_get_params | (get_params_fn) | return actual_get_params_fn | Method decorator for `tf_style_encoding_stage`. | Method decorator for `tf_style_encoding_stage`. | [
"Method",
"decorator",
"for",
"tf_style_encoding_stage",
"."
] | def _tf_style_get_params(get_params_fn):
"""Method decorator for `tf_style_encoding_stage`."""
def actual_get_params_fn(self, name=None):
"""Modified `get_params` method."""
with tf.compat.v1.name_scope(name, self.name + GET_PARAMS_SCOPE_SUFFIX):
return get_params_fn(self, name=name)
return actual... | [
"def",
"_tf_style_get_params",
"(",
"get_params_fn",
")",
":",
"def",
"actual_get_params_fn",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"\"\"\"Modified `get_params` method.\"\"\"",
"with",
"tf",
".",
"compat",
".",
"v1",
".",
"name_scope",
"(",
"name",
",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/encoding_stage.py#L656-L664 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/contrib/imports/mirobridge/mirobridge.py | python | set_del_datatime | (rec_time) | return rec_time.astimezone(
rec_time.UTCTZ()).strftime("%Y-%m-%d %H:%M:%S") | Set the SQL datetime so that the delRecorded and delOldrecorded
methods use UTC datetime values.
return rec_time datetime string | Set the SQL datetime so that the delRecorded and delOldrecorded
methods use UTC datetime values.
return rec_time datetime string | [
"Set",
"the",
"SQL",
"datetime",
"so",
"that",
"the",
"delRecorded",
"and",
"delOldrecorded",
"methods",
"use",
"UTC",
"datetime",
"values",
".",
"return",
"rec_time",
"datetime",
"string"
] | def set_del_datatime(rec_time):
''' Set the SQL datetime so that the delRecorded and delOldrecorded
methods use UTC datetime values.
return rec_time datetime string
'''
#
return rec_time.astimezone(
rec_time.UTCTZ()).strftime("%Y-%m-%d %H:%M:%S") | [
"def",
"set_del_datatime",
"(",
"rec_time",
")",
":",
"#",
"return",
"rec_time",
".",
"astimezone",
"(",
"rec_time",
".",
"UTCTZ",
"(",
")",
")",
".",
"strftime",
"(",
"\"%Y-%m-%d %H:%M:%S\"",
")"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/contrib/imports/mirobridge/mirobridge.py#L728-L735 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | RobotModel.getComVelocity | (self) | return _robotsim.RobotModel_getComVelocity(self) | getComVelocity(RobotModel self)
Returns the 3D velocity of the center of mass at the current config / velocity. | getComVelocity(RobotModel self) | [
"getComVelocity",
"(",
"RobotModel",
"self",
")"
] | def getComVelocity(self):
"""
getComVelocity(RobotModel self)
Returns the 3D velocity of the center of mass at the current config / velocity.
"""
return _robotsim.RobotModel_getComVelocity(self) | [
"def",
"getComVelocity",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"RobotModel_getComVelocity",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L4830-L4839 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/tix.py | python | CheckList.setstatus | (self, entrypath, mode='on') | Sets the status of entryPath to be status. A bitmap will be
displayed next to the entry its status is on, off or default. | Sets the status of entryPath to be status. A bitmap will be
displayed next to the entry its status is on, off or default. | [
"Sets",
"the",
"status",
"of",
"entryPath",
"to",
"be",
"status",
".",
"A",
"bitmap",
"will",
"be",
"displayed",
"next",
"to",
"the",
"entry",
"its",
"status",
"is",
"on",
"off",
"or",
"default",
"."
] | def setstatus(self, entrypath, mode='on'):
'''Sets the status of entryPath to be status. A bitmap will be
displayed next to the entry its status is on, off or default.'''
self.tk.call(self._w, 'setstatus', entrypath, mode) | [
"def",
"setstatus",
"(",
"self",
",",
"entrypath",
",",
"mode",
"=",
"'on'",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'setstatus'",
",",
"entrypath",
",",
"mode",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/tix.py#L1591-L1594 | ||
envoyproxy/envoy-wasm | ab5d9381fdf92a1efa0b87cff80036b5b3e81198 | tools/protodoc/protodoc.py | python | FileCrossRefLabel | (msg_name) | return 'envoy_api_file_%s' % msg_name | File cross reference label. | File cross reference label. | [
"File",
"cross",
"reference",
"label",
"."
] | def FileCrossRefLabel(msg_name):
"""File cross reference label."""
return 'envoy_api_file_%s' % msg_name | [
"def",
"FileCrossRefLabel",
"(",
"msg_name",
")",
":",
"return",
"'envoy_api_file_%s'",
"%",
"msg_name"
] | https://github.com/envoyproxy/envoy-wasm/blob/ab5d9381fdf92a1efa0b87cff80036b5b3e81198/tools/protodoc/protodoc.py#L381-L383 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLDiagnostics.py | python | _reportPeakDiagnostics | (reportWS, peakIntensityWS, diagnosticsWS) | return _reportDiagnostics(reportWS, peakIntensityWS, diagnosticsWS, 'ElasticIntensity', 'IntensityDiagnosed') | Return masked spectrum numbers and add elastic peak diagnostics information to a report workspace. | Return masked spectrum numbers and add elastic peak diagnostics information to a report workspace. | [
"Return",
"masked",
"spectrum",
"numbers",
"and",
"add",
"elastic",
"peak",
"diagnostics",
"information",
"to",
"a",
"report",
"workspace",
"."
] | def _reportPeakDiagnostics(reportWS, peakIntensityWS, diagnosticsWS):
"""Return masked spectrum numbers and add elastic peak diagnostics information to a report workspace."""
return _reportDiagnostics(reportWS, peakIntensityWS, diagnosticsWS, 'ElasticIntensity', 'IntensityDiagnosed') | [
"def",
"_reportPeakDiagnostics",
"(",
"reportWS",
",",
"peakIntensityWS",
",",
"diagnosticsWS",
")",
":",
"return",
"_reportDiagnostics",
"(",
"reportWS",
",",
"peakIntensityWS",
",",
"diagnosticsWS",
",",
"'ElasticIntensity'",
",",
"'IntensityDiagnosed'",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLDiagnostics.py#L286-L288 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/fictitious_play.py | python | XFPSolver.sample_episodes | (self, policies, num) | return totals / num | Samples episodes and averages their returns.
Args:
policies: A list of policies representing the policies executed by each
player.
num: Number of episodes to execute to estimate average return of policies.
Returns:
Average episode return over num episodes. | Samples episodes and averages their returns. | [
"Samples",
"episodes",
"and",
"averages",
"their",
"returns",
"."
] | def sample_episodes(self, policies, num):
"""Samples episodes and averages their returns.
Args:
policies: A list of policies representing the policies executed by each
player.
num: Number of episodes to execute to estimate average return of policies.
Returns:
Average episode retu... | [
"def",
"sample_episodes",
"(",
"self",
",",
"policies",
",",
"num",
")",
":",
"totals",
"=",
"np",
".",
"zeros",
"(",
"self",
".",
"_num_players",
")",
"for",
"_",
"in",
"range",
"(",
"num",
")",
":",
"totals",
"+=",
"self",
".",
"sample_episode",
"(... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/fictitious_play.py#L281-L296 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | parserCtxt.htmlParseChunk | (self, chunk, size, terminate) | return ret | Parse a Chunk of memory | Parse a Chunk of memory | [
"Parse",
"a",
"Chunk",
"of",
"memory"
] | def htmlParseChunk(self, chunk, size, terminate):
"""Parse a Chunk of memory """
ret = libxml2mod.htmlParseChunk(self._o, chunk, size, terminate)
return ret | [
"def",
"htmlParseChunk",
"(",
"self",
",",
"chunk",
",",
"size",
",",
"terminate",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"htmlParseChunk",
"(",
"self",
".",
"_o",
",",
"chunk",
",",
"size",
",",
"terminate",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L5005-L5008 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/ops.py | python | internal_convert_to_tensor_or_composite | (value,
dtype=None,
name=None,
as_ref=False) | Converts the given object to a `Tensor` or `CompositeTensor`.
If `value` is a `CompositeTensor` it is returned unmodified. Otherwise, it
is converted to a `Tensor` using `convert_to_tensor()`.
Args:
value: A `CompositeTensor`, or an object that can be consumed by
`convert_to_tensor()`.
dtype: (Op... | Converts the given object to a `Tensor` or `CompositeTensor`. | [
"Converts",
"the",
"given",
"object",
"to",
"a",
"Tensor",
"or",
"CompositeTensor",
"."
] | def internal_convert_to_tensor_or_composite(value,
dtype=None,
name=None,
as_ref=False):
"""Converts the given object to a `Tensor` or `CompositeTensor`.
If `value` is a `CompositeTen... | [
"def",
"internal_convert_to_tensor_or_composite",
"(",
"value",
",",
"dtype",
"=",
"None",
",",
"name",
"=",
"None",
",",
"as_ref",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"composite_tensor",
".",
"CompositeTensor",
")",
":",
"value_dtyp... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/ops.py#L1816-L1852 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateTime.__ge__ | (*args, **kwargs) | return _misc_.DateTime___ge__(*args, **kwargs) | __ge__(self, DateTime other) -> bool | __ge__(self, DateTime other) -> bool | [
"__ge__",
"(",
"self",
"DateTime",
"other",
")",
"-",
">",
"bool"
] | def __ge__(*args, **kwargs):
"""__ge__(self, DateTime other) -> bool"""
return _misc_.DateTime___ge__(*args, **kwargs) | [
"def",
"__ge__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime___ge__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4118-L4120 | |
Genius-x/genius-x | 9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0 | cocos2d/tools/bindings-generator/clang/cindex.py | python | Type.get_size | (self) | return conf.lib.clang_Type_getSizeOf(self) | Retrieve the size of the record. | Retrieve the size of the record. | [
"Retrieve",
"the",
"size",
"of",
"the",
"record",
"."
] | def get_size(self):
"""
Retrieve the size of the record.
"""
return conf.lib.clang_Type_getSizeOf(self) | [
"def",
"get_size",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Type_getSizeOf",
"(",
"self",
")"
] | https://github.com/Genius-x/genius-x/blob/9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0/cocos2d/tools/bindings-generator/clang/cindex.py#L1806-L1810 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/ops.py | python | device | (device_name_or_function) | Wrapper for `Graph.device()` using the default graph.
See `tf.Graph.device` for more details.
Args:
device_name_or_function: The device name or function to use in the context.
Returns:
A context manager that specifies the default device to use for newly
created ops.
Raises:
RuntimeError: If ... | Wrapper for `Graph.device()` using the default graph. | [
"Wrapper",
"for",
"Graph",
".",
"device",
"()",
"using",
"the",
"default",
"graph",
"."
] | def device(device_name_or_function):
"""Wrapper for `Graph.device()` using the default graph.
See `tf.Graph.device` for more details.
Args:
device_name_or_function: The device name or function to use in the context.
Returns:
A context manager that specifies the default device to use for newly
cre... | [
"def",
"device",
"(",
"device_name_or_function",
")",
":",
"if",
"context",
".",
"executing_eagerly",
"(",
")",
":",
"if",
"callable",
"(",
"device_name_or_function",
")",
":",
"raise",
"RuntimeError",
"(",
"\"tf.device does not support functions when eager execution \"",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/ops.py#L5464-L5496 | ||
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/draw/drawplot/matplotlib_draw.py | python | getMinLocatorAndFormatter | (dates) | return month_loc, month_fm | 获取显示分钟线时使用的Major Locator和Major Formatter | 获取显示分钟线时使用的Major Locator和Major Formatter | [
"获取显示分钟线时使用的Major",
"Locator和Major",
"Formatter"
] | def getMinLocatorAndFormatter(dates):
"""获取显示分钟线时使用的Major Locator和Major Formatter"""
sep = len(dates) / 5
loc = [
(
i, str(d)
if i % sep != 0 else "{}-{}-{} {}:{}".format(d.year, d.month, d.day, d.hour, d.minute)
) for i, d in enumerate(dates)
]
fixed_loc = [i... | [
"def",
"getMinLocatorAndFormatter",
"(",
"dates",
")",
":",
"sep",
"=",
"len",
"(",
"dates",
")",
"/",
"5",
"loc",
"=",
"[",
"(",
"i",
",",
"str",
"(",
"d",
")",
"if",
"i",
"%",
"sep",
"!=",
"0",
"else",
"\"{}-{}-{} {}:{}\"",
".",
"format",
"(",
... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/draw/drawplot/matplotlib_draw.py#L140-L153 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/service_reflection.py | python | _ServiceBuilder._GenerateNonImplementedMethod | (self, method) | return lambda inst, rpc_controller, request, callback: (
self._NonImplementedMethod(method.name, rpc_controller, callback)) | Generates and returns a method that can be set for a service methods.
Args:
method: Descriptor of the service method for which a method is to be
generated.
Returns:
A method that can be added to the service class. | Generates and returns a method that can be set for a service methods. | [
"Generates",
"and",
"returns",
"a",
"method",
"that",
"can",
"be",
"set",
"for",
"a",
"service",
"methods",
"."
] | def _GenerateNonImplementedMethod(self, method):
"""Generates and returns a method that can be set for a service methods.
Args:
method: Descriptor of the service method for which a method is to be
generated.
Returns:
A method that can be added to the service class.
"""
return l... | [
"def",
"_GenerateNonImplementedMethod",
"(",
"self",
",",
"method",
")",
":",
"return",
"lambda",
"inst",
",",
"rpc_controller",
",",
"request",
",",
"callback",
":",
"(",
"self",
".",
"_NonImplementedMethod",
"(",
"method",
".",
"name",
",",
"rpc_controller",
... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/service_reflection.py#L205-L216 | |
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | bindings/python/clang/cindex.py | python | Cursor.get_arguments | (self) | Return an iterator for accessing the arguments of this cursor. | Return an iterator for accessing the arguments of this cursor. | [
"Return",
"an",
"iterator",
"for",
"accessing",
"the",
"arguments",
"of",
"this",
"cursor",
"."
] | def get_arguments(self):
"""Return an iterator for accessing the arguments of this cursor."""
num_args = conf.lib.clang_Cursor_getNumArguments(self)
for i in range(0, num_args):
yield conf.lib.clang_Cursor_getArgument(self, i) | [
"def",
"get_arguments",
"(",
"self",
")",
":",
"num_args",
"=",
"conf",
".",
"lib",
".",
"clang_Cursor_getNumArguments",
"(",
"self",
")",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"num_args",
")",
":",
"yield",
"conf",
".",
"lib",
".",
"clang_Cursor_get... | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/bindings/python/clang/cindex.py#L1800-L1804 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | SizerFlags.Bottom | (*args, **kwargs) | return _core_.SizerFlags_Bottom(*args, **kwargs) | Bottom(self) -> SizerFlags
Aligns the object to the bottom of the available space, a shortcut for
calling Align(wx.ALIGN_BOTTOM) | Bottom(self) -> SizerFlags | [
"Bottom",
"(",
"self",
")",
"-",
">",
"SizerFlags"
] | def Bottom(*args, **kwargs):
"""
Bottom(self) -> SizerFlags
Aligns the object to the bottom of the available space, a shortcut for
calling Align(wx.ALIGN_BOTTOM)
"""
return _core_.SizerFlags_Bottom(*args, **kwargs) | [
"def",
"Bottom",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"SizerFlags_Bottom",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L13841-L13848 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/xsltfunctions/cinemarv_api.py | python | xpathFunctions.cinemarvLinkGeneration | (self, context, *args) | return self.persistence['cinemarvLinkGeneration'] | Generate a link for the CinemaRV.com site. A read of the item's web page is required to
extract the flash video id.
Call example: 'mnvXpath:cinemarvLinkGeneration(string(link))'
return the url link | Generate a link for the CinemaRV.com site. A read of the item's web page is required to
extract the flash video id.
Call example: 'mnvXpath:cinemarvLinkGeneration(string(link))'
return the url link | [
"Generate",
"a",
"link",
"for",
"the",
"CinemaRV",
".",
"com",
"site",
".",
"A",
"read",
"of",
"the",
"item",
"s",
"web",
"page",
"is",
"required",
"to",
"extract",
"the",
"flash",
"video",
"id",
".",
"Call",
"example",
":",
"mnvXpath",
":",
"cinemarvL... | def cinemarvLinkGeneration(self, context, *args):
'''Generate a link for the CinemaRV.com site. A read of the item's web page is required to
extract the flash video id.
Call example: 'mnvXpath:cinemarvLinkGeneration(string(link))'
return the url link
'''
webURL = args[0]
... | [
"def",
"cinemarvLinkGeneration",
"(",
"self",
",",
"context",
",",
"*",
"args",
")",
":",
"webURL",
"=",
"args",
"[",
"0",
"]",
"# If this is for the download then just return what was found for the \"link\" element",
"if",
"'cinemarvLinkGeneration'",
"in",
"self",
".",
... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/xsltfunctions/cinemarv_api.py#L103-L139 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py | python | ZipManifests.build | (cls, path) | Build a dictionary similar to the zipimport directory
caches, except instead of tuples, store ZipInfo objects.
Use a platform-specific path separator (os.sep) for the path keys
for compatibility with pypy on Windows. | Build a dictionary similar to the zipimport directory
caches, except instead of tuples, store ZipInfo objects. | [
"Build",
"a",
"dictionary",
"similar",
"to",
"the",
"zipimport",
"directory",
"caches",
"except",
"instead",
"of",
"tuples",
"store",
"ZipInfo",
"objects",
"."
] | def build(cls, path):
"""
Build a dictionary similar to the zipimport directory
caches, except instead of tuples, store ZipInfo objects.
Use a platform-specific path separator (os.sep) for the path keys
for compatibility with pypy on Windows.
"""
with zipfile.Zip... | [
"def",
"build",
"(",
"cls",
",",
"path",
")",
":",
"with",
"zipfile",
".",
"ZipFile",
"(",
"path",
")",
"as",
"zfile",
":",
"items",
"=",
"(",
"(",
"name",
".",
"replace",
"(",
"'/'",
",",
"os",
".",
"sep",
")",
",",
"zfile",
".",
"getinfo",
"(... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py#L1667-L1683 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/numbers.py | python | Complex.real | (self) | Retrieve the real component of this number.
This should subclass Real. | Retrieve the real component of this number. | [
"Retrieve",
"the",
"real",
"component",
"of",
"this",
"number",
"."
] | def real(self):
"""Retrieve the real component of this number.
This should subclass Real.
"""
raise NotImplementedError | [
"def",
"real",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/numbers.py#L57-L62 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/largest-number-after-mutating-substring.py | python | Solution.maximumNumber | (self, num, change) | return "".join(map(str, result)) | :type num: str
:type change: List[int]
:rtype: str | :type num: str
:type change: List[int]
:rtype: str | [
":",
"type",
"num",
":",
"str",
":",
"type",
"change",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"str"
] | def maximumNumber(self, num, change):
"""
:type num: str
:type change: List[int]
:rtype: str
"""
mutated = False
result = map(int, list(num))
for i, d in enumerate(result):
if change[d] < d:
if mutated:
break... | [
"def",
"maximumNumber",
"(",
"self",
",",
"num",
",",
"change",
")",
":",
"mutated",
"=",
"False",
"result",
"=",
"map",
"(",
"int",
",",
"list",
"(",
"num",
")",
")",
"for",
"i",
",",
"d",
"in",
"enumerate",
"(",
"result",
")",
":",
"if",
"chang... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/largest-number-after-mutating-substring.py#L5-L20 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_trafficlight.py | python | TrafficLightDomain.setPhase | (self, tlsID, index) | setPhase(string, integer) -> None
Switches to the phase with the given index in the list of all phases for
the current program. | setPhase(string, integer) -> None | [
"setPhase",
"(",
"string",
"integer",
")",
"-",
">",
"None"
] | def setPhase(self, tlsID, index):
"""setPhase(string, integer) -> None
Switches to the phase with the given index in the list of all phases for
the current program.
"""
self._setCmd(tc.TL_PHASE_INDEX, tlsID, "i", index) | [
"def",
"setPhase",
"(",
"self",
",",
"tlsID",
",",
"index",
")",
":",
"self",
".",
"_setCmd",
"(",
"tc",
".",
"TL_PHASE_INDEX",
",",
"tlsID",
",",
"\"i\"",
",",
"index",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_trafficlight.py#L306-L312 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/logging/loggers.py | python | configure_loggers | () | Configure the loggers and setup redirects. | Configure the loggers and setup redirects. | [
"Configure",
"the",
"loggers",
"and",
"setup",
"redirects",
"."
] | def configure_loggers():
"""Configure the loggers and setup redirects."""
_setup_redirects()
buildlogger.BUILDLOGGER_FALLBACK = logging.Logger("buildlogger")
# The 'buildlogger' prefix is not added to the fallback logger since the prefix of the original
# logger will be there as part of the logged ... | [
"def",
"configure_loggers",
"(",
")",
":",
"_setup_redirects",
"(",
")",
"buildlogger",
".",
"BUILDLOGGER_FALLBACK",
"=",
"logging",
".",
"Logger",
"(",
"\"buildlogger\"",
")",
"# The 'buildlogger' prefix is not added to the fallback logger since the prefix of the original",
"#... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/logging/loggers.py#L78-L96 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/xcodeproj_file.py | python | PBXProject.AddOrGetFileInRootGroup | (self, path) | return group.AddOrGetFileByPath(path, hierarchical) | Returns a PBXFileReference corresponding to path in the correct group
according to RootGroupForPath's heuristics.
If an existing PBXFileReference for path exists, it will be returned.
Otherwise, one will be created and returned. | Returns a PBXFileReference corresponding to path in the correct group
according to RootGroupForPath's heuristics. | [
"Returns",
"a",
"PBXFileReference",
"corresponding",
"to",
"path",
"in",
"the",
"correct",
"group",
"according",
"to",
"RootGroupForPath",
"s",
"heuristics",
"."
] | def AddOrGetFileInRootGroup(self, path):
"""Returns a PBXFileReference corresponding to path in the correct group
according to RootGroupForPath's heuristics.
If an existing PBXFileReference for path exists, it will be returned.
Otherwise, one will be created and returned.
"""
(group, hierarchi... | [
"def",
"AddOrGetFileInRootGroup",
"(",
"self",
",",
"path",
")",
":",
"(",
"group",
",",
"hierarchical",
")",
"=",
"self",
".",
"RootGroupForPath",
"(",
"path",
")",
"return",
"group",
".",
"AddOrGetFileByPath",
"(",
"path",
",",
"hierarchical",
")"
] | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcodeproj_file.py#L2556-L2565 | |
Harick1/caffe-yolo | eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3 | python/caffe/draw.py | python | get_pydot_graph | (caffe_net, rankdir, label_edges=True) | return pydot_graph | Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is True).
Returns
-------
pydot graph object | Create a data structure which represents the `caffe_net`. | [
"Create",
"a",
"data",
"structure",
"which",
"represents",
"the",
"caffe_net",
"."
] | def get_pydot_graph(caffe_net, rankdir, label_edges=True):
"""Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is Tr... | [
"def",
"get_pydot_graph",
"(",
"caffe_net",
",",
"rankdir",
",",
"label_edges",
"=",
"True",
")",
":",
"pydot_graph",
"=",
"pydot",
".",
"Dot",
"(",
"caffe_net",
".",
"name",
"if",
"caffe_net",
".",
"name",
"else",
"'Net'",
",",
"graph_type",
"=",
"'digrap... | https://github.com/Harick1/caffe-yolo/blob/eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3/python/caffe/draw.py#L130-L186 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | build/pymake/pymake/data.py | python | Target.resolvedeps | (self, makefile, targetstack, rulestack, recursive) | Resolve the actual path of this target, using vpath if necessary.
Recursively resolve dependencies of this target. This means finding implicit
rules which match the target, if appropriate.
Figure out whether this target needs to be rebuild, and set self.outofdate
appropriately.
... | Resolve the actual path of this target, using vpath if necessary. | [
"Resolve",
"the",
"actual",
"path",
"of",
"this",
"target",
"using",
"vpath",
"if",
"necessary",
"."
] | def resolvedeps(self, makefile, targetstack, rulestack, recursive):
"""
Resolve the actual path of this target, using vpath if necessary.
Recursively resolve dependencies of this target. This means finding implicit
rules which match the target, if appropriate.
Figure out whethe... | [
"def",
"resolvedeps",
"(",
"self",
",",
"makefile",
",",
"targetstack",
",",
"rulestack",
",",
"recursive",
")",
":",
"assert",
"makefile",
".",
"parsingfinished",
"if",
"self",
".",
"target",
"in",
"targetstack",
":",
"raise",
"ResolutionError",
"(",
"\"Recur... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/pymake/pymake/data.py#L1093-L1155 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/pylib/utils/logging_utils.py | python | ColorStreamHandler.MakeDefault | (force_color=False) | Replaces the default logging handlers with a coloring handler. To use
a colorizing handler at the same time as others, either register them
after this call, or add the ColorStreamHandler on the logger using
Logger.addHandler()
Args:
force_color: Set to True to bypass the tty check and always... | Replaces the default logging handlers with a coloring handler. To use
a colorizing handler at the same time as others, either register them
after this call, or add the ColorStreamHandler on the logger using
Logger.addHandler() | [
"Replaces",
"the",
"default",
"logging",
"handlers",
"with",
"a",
"coloring",
"handler",
".",
"To",
"use",
"a",
"colorizing",
"handler",
"at",
"the",
"same",
"time",
"as",
"others",
"either",
"register",
"them",
"after",
"this",
"call",
"or",
"add",
"the",
... | def MakeDefault(force_color=False):
"""
Replaces the default logging handlers with a coloring handler. To use
a colorizing handler at the same time as others, either register them
after this call, or add the ColorStreamHandler on the logger using
Logger.addHandler()
Args:
force_col... | [
"def",
"MakeDefault",
"(",
"force_color",
"=",
"False",
")",
":",
"# If the existing handlers aren't removed, messages are duplicated",
"logging",
".",
"getLogger",
"(",
")",
".",
"handlers",
"=",
"[",
"]",
"logging",
".",
"getLogger",
"(",
")",
".",
"addHandler",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/pylib/utils/logging_utils.py#L64-L76 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/SimpleXMLRPCServer.py | python | SimpleXMLRPCDispatcher.system_methodHelp | (self, method_name) | system.methodHelp('add') => "Adds two integers together"
Returns a string containing documentation for the specified method. | system.methodHelp('add') => "Adds two integers together" | [
"system",
".",
"methodHelp",
"(",
"add",
")",
"=",
">",
"Adds",
"two",
"integers",
"together"
] | def system_methodHelp(self, method_name):
"""system.methodHelp('add') => "Adds two integers together"
Returns a string containing documentation for the specified method."""
method = None
if method_name in self.funcs:
method = self.funcs[method_name]
elif self.instan... | [
"def",
"system_methodHelp",
"(",
"self",
",",
"method_name",
")",
":",
"method",
"=",
"None",
"if",
"method_name",
"in",
"self",
".",
"funcs",
":",
"method",
"=",
"self",
".",
"funcs",
"[",
"method_name",
"]",
"elif",
"self",
".",
"instance",
"is",
"not"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/SimpleXMLRPCServer.py#L314-L344 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_differentialevolution.py | python | DifferentialEvolutionSolver.converged | (self) | return (np.std(self.population_energies) <=
self.atol +
self.tol * np.abs(np.mean(self.population_energies))) | Return True if the solver has converged. | Return True if the solver has converged. | [
"Return",
"True",
"if",
"the",
"solver",
"has",
"converged",
"."
] | def converged(self):
"""
Return True if the solver has converged.
"""
return (np.std(self.population_energies) <=
self.atol +
self.tol * np.abs(np.mean(self.population_energies))) | [
"def",
"converged",
"(",
"self",
")",
":",
"return",
"(",
"np",
".",
"std",
"(",
"self",
".",
"population_energies",
")",
"<=",
"self",
".",
"atol",
"+",
"self",
".",
"tol",
"*",
"np",
".",
"abs",
"(",
"np",
".",
"mean",
"(",
"self",
".",
"popula... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_differentialevolution.py#L641-L647 | |
falkTX/Carla | 74a1ae82c90db85f20550ddcdc8a927b8fb7e414 | source/modules/lilv/lilv-0.24.0/bindings/python/lilv.py | python | PluginClass.get_label | (self) | return Node.wrap(node_duplicate(plugin_class_get_label(self.plugin_class))) | Get the label of this plugin class, ie "Oscillators". | Get the label of this plugin class, ie "Oscillators". | [
"Get",
"the",
"label",
"of",
"this",
"plugin",
"class",
"ie",
"Oscillators",
"."
] | def get_label(self):
"""Get the label of this plugin class, ie "Oscillators"."""
return Node.wrap(node_duplicate(plugin_class_get_label(self.plugin_class))) | [
"def",
"get_label",
"(",
"self",
")",
":",
"return",
"Node",
".",
"wrap",
"(",
"node_duplicate",
"(",
"plugin_class_get_label",
"(",
"self",
".",
"plugin_class",
")",
")",
")"
] | https://github.com/falkTX/Carla/blob/74a1ae82c90db85f20550ddcdc8a927b8fb7e414/source/modules/lilv/lilv-0.24.0/bindings/python/lilv.py#L541-L543 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Alignment/MillePedeAlignmentAlgorithm/scripts/mps_alisetup.py | python | SetupAlignment._create_tracker_tree | (self) | Method to create hidden 'TrackerTree.root'. | Method to create hidden 'TrackerTree.root'. | [
"Method",
"to",
"create",
"hidden",
"TrackerTree",
".",
"root",
"."
] | def _create_tracker_tree(self):
"""Method to create hidden 'TrackerTree.root'."""
if self._global_tag is None or self._first_run is None:
print("Trying to create the tracker tree before setting the global", end=' ')
print("tag or the run to determine the geometry IOV.")
... | [
"def",
"_create_tracker_tree",
"(",
"self",
")",
":",
"if",
"self",
".",
"_global_tag",
"is",
"None",
"or",
"self",
".",
"_first_run",
"is",
"None",
":",
"print",
"(",
"\"Trying to create the tracker tree before setting the global\"",
",",
"end",
"=",
"' '",
")",
... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_alisetup.py#L643-L655 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/framework/python/ops/sampling_ops.py | python | stratified_sample | (tensors, labels, target_probs, batch_size,
init_probs=None, enqueue_many=False, queue_capacity=16,
threads_per_queue=1, name=None) | Stochastically creates batches based on per-class probabilities.
This method discards examples. Internally, it creates one queue to amortize
the cost of disk reads, and one queue to hold the properly-proportioned
batch. See `stratified_sample_unknown_dist` for a function that performs
stratified sampling with ... | Stochastically creates batches based on per-class probabilities. | [
"Stochastically",
"creates",
"batches",
"based",
"on",
"per",
"-",
"class",
"probabilities",
"."
] | def stratified_sample(tensors, labels, target_probs, batch_size,
init_probs=None, enqueue_many=False, queue_capacity=16,
threads_per_queue=1, name=None):
"""Stochastically creates batches based on per-class probabilities.
This method discards examples. Internally, it cre... | [
"def",
"stratified_sample",
"(",
"tensors",
",",
"labels",
",",
"target_probs",
",",
"batch_size",
",",
"init_probs",
"=",
"None",
",",
"enqueue_many",
"=",
"False",
",",
"queue_capacity",
"=",
"16",
",",
"threads_per_queue",
"=",
"1",
",",
"name",
"=",
"Non... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/framework/python/ops/sampling_ops.py#L38-L149 | ||
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Cursor.enum_type | (self) | return self._enum_type | Return the integer type of an enum declaration.
Returns a Type corresponding to an integer. If the cursor is not for an
enum, this raises. | Return the integer type of an enum declaration. | [
"Return",
"the",
"integer",
"type",
"of",
"an",
"enum",
"declaration",
"."
] | def enum_type(self):
"""Return the integer type of an enum declaration.
Returns a Type corresponding to an integer. If the cursor is not for an
enum, this raises.
"""
if not hasattr(self, '_enum_type'):
assert self.kind == CursorKind.ENUM_DECL
self._enum_... | [
"def",
"enum_type",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_enum_type'",
")",
":",
"assert",
"self",
".",
"kind",
"==",
"CursorKind",
".",
"ENUM_DECL",
"self",
".",
"_enum_type",
"=",
"conf",
".",
"lib",
".",
"clang_getEnumDec... | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1349-L1359 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/extras.py | python | mask_cols | (a, axis=None) | return mask_rowcols(a, 1) | Mask columns of a 2D array that contain masked values.
This function is a shortcut to ``mask_rowcols`` with `axis` equal to 1.
See Also
--------
mask_rowcols : Mask rows and/or columns of a 2D array.
masked_where : Mask where a condition is met.
Examples
--------
>>> import numpy.ma a... | Mask columns of a 2D array that contain masked values. | [
"Mask",
"columns",
"of",
"a",
"2D",
"array",
"that",
"contain",
"masked",
"values",
"."
] | def mask_cols(a, axis=None):
"""
Mask columns of a 2D array that contain masked values.
This function is a shortcut to ``mask_rowcols`` with `axis` equal to 1.
See Also
--------
mask_rowcols : Mask rows and/or columns of a 2D array.
masked_where : Mask where a condition is met.
Exampl... | [
"def",
"mask_cols",
"(",
"a",
",",
"axis",
"=",
"None",
")",
":",
"return",
"mask_rowcols",
"(",
"a",
",",
"1",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/extras.py#L963-L1006 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/environment.py | python | Environment.make_globals | (self, d) | return dict(self.globals, **d) | Return a dict for the globals. | Return a dict for the globals. | [
"Return",
"a",
"dict",
"for",
"the",
"globals",
"."
] | def make_globals(self, d):
"""Return a dict for the globals."""
if not d:
return self.globals
return dict(self.globals, **d) | [
"def",
"make_globals",
"(",
"self",
",",
"d",
")",
":",
"if",
"not",
"d",
":",
"return",
"self",
".",
"globals",
"return",
"dict",
"(",
"self",
".",
"globals",
",",
"*",
"*",
"d",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/environment.py#L882-L886 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/supertooltip.py | python | ToolTipWindowBase.AlphaCycle | (self, event) | Handles the ``wx.EVT_TIMER`` event for :class:`SuperToolTip`.
:param `event`: a :class:`TimerEvent` event to be processed. | Handles the ``wx.EVT_TIMER`` event for :class:`SuperToolTip`. | [
"Handles",
"the",
"wx",
".",
"EVT_TIMER",
"event",
"for",
":",
"class",
":",
"SuperToolTip",
"."
] | def AlphaCycle(self, event):
"""
Handles the ``wx.EVT_TIMER`` event for :class:`SuperToolTip`.
:param `event`: a :class:`TimerEvent` event to be processed.
"""
# Increase (or decrease) the alpha channel
self.amount += self.delta
if self.amount > 255 or self.amo... | [
"def",
"AlphaCycle",
"(",
"self",
",",
"event",
")",
":",
"# Increase (or decrease) the alpha channel",
"self",
".",
"amount",
"+=",
"self",
".",
"delta",
"if",
"self",
".",
"amount",
">",
"255",
"or",
"self",
".",
"amount",
"<",
"0",
":",
"# We're done, sto... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/supertooltip.py#L613-L634 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/third_party/depot_tools/cpplint.py | python | IsErrorSuppressedByNolint | (category, linenum) | return (_global_error_suppressions.get(category, False) or
linenum in _error_suppressions.get(category, set()) or
linenum in _error_suppressions.get(None, set())) | Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the current line number.
Returns:
... | Returns true if the specified error category is suppressed on this line. | [
"Returns",
"true",
"if",
"the",
"specified",
"error",
"category",
"is",
"suppressed",
"on",
"this",
"line",
"."
] | def IsErrorSuppressedByNolint(category, linenum):
"""Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
... | [
"def",
"IsErrorSuppressedByNolint",
"(",
"category",
",",
"linenum",
")",
":",
"return",
"(",
"_global_error_suppressions",
".",
"get",
"(",
"category",
",",
"False",
")",
"or",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"category",
",",
"set",
"... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/depot_tools/cpplint.py#L604-L619 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py | python | obj_analysis.get_name | (self) | return self.name | Return the name. | Return the name. | [
"Return",
"the",
"name",
"."
] | def get_name(self):
""" Return the name. """
return self.name | [
"def",
"get_name",
"(",
"self",
")",
":",
"return",
"self",
".",
"name"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L1733-L1735 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/lambda_sum_largest.py | python | lambda_sum_largest.numeric | (self, values) | return sum_largest(eigs, self.k).value | Returns the largest eigenvalue of A.
Requires that A be symmetric. | Returns the largest eigenvalue of A. | [
"Returns",
"the",
"largest",
"eigenvalue",
"of",
"A",
"."
] | def numeric(self, values):
"""Returns the largest eigenvalue of A.
Requires that A be symmetric.
"""
eigs = LA.eigvalsh(values[0])
return sum_largest(eigs, self.k).value | [
"def",
"numeric",
"(",
"self",
",",
"values",
")",
":",
"eigs",
"=",
"LA",
".",
"eigvalsh",
"(",
"values",
"[",
"0",
"]",
")",
"return",
"sum_largest",
"(",
"eigs",
",",
"self",
".",
"k",
")",
".",
"value"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/lambda_sum_largest.py#L42-L48 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | SystemColourProperty.ColourToString | (*args, **kwargs) | return _propgrid.SystemColourProperty_ColourToString(*args, **kwargs) | ColourToString(self, Colour col, int index, int argFlags=0) -> String | ColourToString(self, Colour col, int index, int argFlags=0) -> String | [
"ColourToString",
"(",
"self",
"Colour",
"col",
"int",
"index",
"int",
"argFlags",
"=",
"0",
")",
"-",
">",
"String"
] | def ColourToString(*args, **kwargs):
"""ColourToString(self, Colour col, int index, int argFlags=0) -> String"""
return _propgrid.SystemColourProperty_ColourToString(*args, **kwargs) | [
"def",
"ColourToString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"SystemColourProperty_ColourToString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L3310-L3312 | |
bareos/bareos | 56a10bb368b0a81e977bb51304033fe49d59efb0 | contrib/fd-plugins/options-plugin-sample/bareos-fd-file-interact.py | python | load_bareos_plugin | (context, plugindef) | return bRCs['bRC_OK'] | This function is called by the Bareos-FD to load the plugin
We use it to intantiate the plugin class | This function is called by the Bareos-FD to load the plugin
We use it to intantiate the plugin class | [
"This",
"function",
"is",
"called",
"by",
"the",
"Bareos",
"-",
"FD",
"to",
"load",
"the",
"plugin",
"We",
"use",
"it",
"to",
"intantiate",
"the",
"plugin",
"class"
] | def load_bareos_plugin(context, plugindef):
'''
This function is called by the Bareos-FD to load the plugin
We use it to intantiate the plugin class
'''
# BareosFdWrapper.bareos_fd_plugin_object is the module attribute that holds the plugin class object
BareosFdWrapper.bareos_fd_plugin_object = ... | [
"def",
"load_bareos_plugin",
"(",
"context",
",",
"plugindef",
")",
":",
"# BareosFdWrapper.bareos_fd_plugin_object is the module attribute that holds the plugin class object",
"BareosFdWrapper",
".",
"bareos_fd_plugin_object",
"=",
"BareosFdPluginFileInteract",
"(",
"context",
",",
... | https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/contrib/fd-plugins/options-plugin-sample/bareos-fd-file-interact.py#L17-L24 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py | python | EncodePOSIXShellList | (list) | return " ".join(encoded_arguments) | Encodes |list| suitably for consumption by POSIX shells.
Returns EncodePOSIXShellArgument for each item in list, and joins them
together using the space character as an argument separator. | Encodes |list| suitably for consumption by POSIX shells. | [
"Encodes",
"|list|",
"suitably",
"for",
"consumption",
"by",
"POSIX",
"shells",
"."
] | def EncodePOSIXShellList(list):
"""Encodes |list| suitably for consumption by POSIX shells.
Returns EncodePOSIXShellArgument for each item in list, and joins them
together using the space character as an argument separator.
"""
encoded_arguments = []
for argument in list:
encoded_arguments.a... | [
"def",
"EncodePOSIXShellList",
"(",
"list",
")",
":",
"encoded_arguments",
"=",
"[",
"]",
"for",
"argument",
"in",
"list",
":",
"encoded_arguments",
".",
"append",
"(",
"EncodePOSIXShellArgument",
"(",
"argument",
")",
")",
"return",
"\" \"",
".",
"join",
"(",... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py#L290-L300 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/gauth.py | python | get_client_login_token_string | (http_body) | return None | Returns the token value for a ClientLoginToken.
Reads the token from the server's response to a Client Login request and
creates the token value string to use in requests.
Args:
http_body: str The body of the server's HTTP response to a Client Login
request
Returns:
The token value string for... | Returns the token value for a ClientLoginToken. | [
"Returns",
"the",
"token",
"value",
"for",
"a",
"ClientLoginToken",
"."
] | def get_client_login_token_string(http_body):
"""Returns the token value for a ClientLoginToken.
Reads the token from the server's response to a Client Login request and
creates the token value string to use in requests.
Args:
http_body: str The body of the server's HTTP response to a Client Login
... | [
"def",
"get_client_login_token_string",
"(",
"http_body",
")",
":",
"for",
"response_line",
"in",
"http_body",
".",
"splitlines",
"(",
")",
":",
"if",
"response_line",
".",
"startswith",
"(",
"'Auth='",
")",
":",
"# Strip off the leading Auth= and return the Authorizati... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/gauth.py#L108-L125 | |
apache/mesos | 97d9a4063332aae3825d78de71611657e05cf5e2 | support/verify-reviews.py | python | parse_time | (timestamp) | return datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%SZ") | Parse time in ReviewBoard date format. | Parse time in ReviewBoard date format. | [
"Parse",
"time",
"in",
"ReviewBoard",
"date",
"format",
"."
] | def parse_time(timestamp):
"""Parse time in ReviewBoard date format."""
return datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%SZ") | [
"def",
"parse_time",
"(",
"timestamp",
")",
":",
"return",
"datetime",
".",
"strptime",
"(",
"timestamp",
",",
"\"%Y-%m-%dT%H:%M:%SZ\"",
")"
] | https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/support/verify-reviews.py#L117-L119 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/icpc.py | python | find_icpc | (conf) | Finds the program icpc, and execute it to ensure it really is icpc | Finds the program icpc, and execute it to ensure it really is icpc | [
"Finds",
"the",
"program",
"icpc",
"and",
"execute",
"it",
"to",
"ensure",
"it",
"really",
"is",
"icpc"
] | def find_icpc(conf):
"""
Finds the program icpc, and execute it to ensure it really is icpc
"""
cxx = conf.find_program('icpc', var='CXX')
conf.get_cc_version(cxx, icc=True)
conf.env.CXX_NAME = 'icc' | [
"def",
"find_icpc",
"(",
"conf",
")",
":",
"cxx",
"=",
"conf",
".",
"find_program",
"(",
"'icpc'",
",",
"var",
"=",
"'CXX'",
")",
"conf",
".",
"get_cc_version",
"(",
"cxx",
",",
"icc",
"=",
"True",
")",
"conf",
".",
"env",
".",
"CXX_NAME",
"=",
"'i... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/icpc.py#L14-L20 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/format/policy_templates/writers/template_writer.py | python | TemplateWriter.CanBeMandatory | (self, policy) | return policy.get('features', {}).get('can_be_mandatory', True) | Checks if the given policy can be mandatory. | Checks if the given policy can be mandatory. | [
"Checks",
"if",
"the",
"given",
"policy",
"can",
"be",
"mandatory",
"."
] | def CanBeMandatory(self, policy):
'''Checks if the given policy can be mandatory.'''
return policy.get('features', {}).get('can_be_mandatory', True) | [
"def",
"CanBeMandatory",
"(",
"self",
",",
"policy",
")",
":",
"return",
"policy",
".",
"get",
"(",
"'features'",
",",
"{",
"}",
")",
".",
"get",
"(",
"'can_be_mandatory'",
",",
"True",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/writers/template_writer.py#L90-L92 | |
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/build/project.py | python | ProjectRegistry.push_current | (self, project) | Temporary changes the current project to 'project'. Should
be followed by 'pop-current'. | Temporary changes the current project to 'project'. Should
be followed by 'pop-current'. | [
"Temporary",
"changes",
"the",
"current",
"project",
"to",
"project",
".",
"Should",
"be",
"followed",
"by",
"pop",
"-",
"current",
"."
] | def push_current(self, project):
"""Temporary changes the current project to 'project'. Should
be followed by 'pop-current'."""
if __debug__:
from .targets import ProjectTarget
assert isinstance(project, ProjectTarget)
self.saved_current_project.append(self.curren... | [
"def",
"push_current",
"(",
"self",
",",
"project",
")",
":",
"if",
"__debug__",
":",
"from",
".",
"targets",
"import",
"ProjectTarget",
"assert",
"isinstance",
"(",
"project",
",",
"ProjectTarget",
")",
"self",
".",
"saved_current_project",
".",
"append",
"("... | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/project.py#L572-L579 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/App/FreeCADInit.py | python | FCADLogger.error | (self,msg,*args,**kargs) | "Error" level log printer
* msg: message string. May contain new style Python string formatter.
This function accepts additional positional and keyword arguments,
which are forward to string.format() to generate the logging
message. It is strongly recommended to not dir... | "Error" level log printer | [
"Error",
"level",
"log",
"printer"
] | def error(self,msg,*args,**kargs):
'''"Error" level log printer
* msg: message string. May contain new style Python string formatter.
This function accepts additional positional and keyword arguments,
which are forward to string.format() to generate the logging
... | [
"def",
"error",
"(",
"self",
",",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kargs",
")",
":",
"if",
"self",
".",
"_isEnabledFor",
"(",
"0",
")",
":",
"frame",
"=",
"kargs",
".",
"pop",
"(",
"'frame'",
",",
"0",
")",
"+",
"1",
"self",
".",
"_lo... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/App/FreeCADInit.py#L397-L411 | ||
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/exports.py | python | rgb_any_to_24 | (rgb_in) | return rgb_in | Convert any RGB to RRGGBB if needed | Convert any RGB to RRGGBB if needed | [
"Convert",
"any",
"RGB",
"to",
"RRGGBB",
"if",
"needed"
] | def rgb_any_to_24(rgb_in):
"""Convert any RGB to RRGGBB if needed"""
if len(rgb_in) == 12:
r = int(rgb_in[:4], 16)
g = int(rgb_in[4:8], 16)
b = int(rgb_in[8:], 16)
r >>= 8
g >>= 8
b >>= 8
return "%.2x%.2x%.2x" % (r, g, b)
if len(rgb_in) == 6: return rg... | [
"def",
"rgb_any_to_24",
"(",
"rgb_in",
")",
":",
"if",
"len",
"(",
"rgb_in",
")",
"==",
"12",
":",
"r",
"=",
"int",
"(",
"rgb_in",
"[",
":",
"4",
"]",
",",
"16",
")",
"g",
"=",
"int",
"(",
"rgb_in",
"[",
"4",
":",
"8",
"]",
",",
"16",
")",
... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/exports.py#L45-L58 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/auto_bisect/bisect_utils.py | python | RunGClientAndSync | (revisions=None, cwd=None) | return RunGClient(params, cwd=cwd) | Runs gclient and does a normal sync.
Args:
revisions: List of revisions that need to be synced.
E.g., "src@2ae43f...", "src/third_party/webkit@asr1234" etc.
cwd: Working directory to run from.
Returns:
The return code of the call. | Runs gclient and does a normal sync. | [
"Runs",
"gclient",
"and",
"does",
"a",
"normal",
"sync",
"."
] | def RunGClientAndSync(revisions=None, cwd=None):
"""Runs gclient and does a normal sync.
Args:
revisions: List of revisions that need to be synced.
E.g., "src@2ae43f...", "src/third_party/webkit@asr1234" etc.
cwd: Working directory to run from.
Returns:
The return code of the call.
"""
p... | [
"def",
"RunGClientAndSync",
"(",
"revisions",
"=",
"None",
",",
"cwd",
"=",
"None",
")",
":",
"params",
"=",
"[",
"'sync'",
",",
"'--verbose'",
",",
"'--nohooks'",
",",
"'--force'",
",",
"'--delete_unversioned_trees'",
"]",
"if",
"revisions",
"is",
"not",
"N... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/bisect_utils.py#L358-L375 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.GypPathToUniqueOutput | (self, path, qualified=True) | return os.path.normpath(
os.path.join(obj, self.base_dir, path_dir, path_basename)
) | Translate a gyp path to a ninja path for writing output.
If qualified is True, qualify the resulting filename with the name
of the target. This is necessary when e.g. compiling the same
path twice for two separate output targets.
See the above discourse on path conversions. | Translate a gyp path to a ninja path for writing output. | [
"Translate",
"a",
"gyp",
"path",
"to",
"a",
"ninja",
"path",
"for",
"writing",
"output",
"."
] | def GypPathToUniqueOutput(self, path, qualified=True):
"""Translate a gyp path to a ninja path for writing output.
If qualified is True, qualify the resulting filename with the name
of the target. This is necessary when e.g. compiling the same
path twice for two separate output targets... | [
"def",
"GypPathToUniqueOutput",
"(",
"self",
",",
"path",
",",
"qualified",
"=",
"True",
")",
":",
"path",
"=",
"self",
".",
"ExpandSpecial",
"(",
"path",
")",
"assert",
"not",
"path",
".",
"startswith",
"(",
"\"$\"",
")",
",",
"path",
"# Translate the pat... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/ninja.py#L320-L356 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/gmatmul.py | python | gmatmul.sign_from_args | (self) | return (True, False) | Returns sign (is positive, is negative) of the expression. | Returns sign (is positive, is negative) of the expression. | [
"Returns",
"sign",
"(",
"is",
"positive",
"is",
"negative",
")",
"of",
"the",
"expression",
"."
] | def sign_from_args(self) -> Tuple[bool, bool]:
"""Returns sign (is positive, is negative) of the expression.
"""
return (True, False) | [
"def",
"sign_from_args",
"(",
"self",
")",
"->",
"Tuple",
"[",
"bool",
",",
"bool",
"]",
":",
"return",
"(",
"True",
",",
"False",
")"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/gmatmul.py#L94-L97 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/multi.py | python | MultiIndex.__reduce__ | (self) | return ibase._new_Index, (type(self), d), None | Necessary for making this object picklable | Necessary for making this object picklable | [
"Necessary",
"for",
"making",
"this",
"object",
"picklable"
] | def __reduce__(self):
"""Necessary for making this object picklable"""
d = dict(
levels=list(self.levels),
codes=list(self.codes),
sortorder=self.sortorder,
names=list(self.names),
)
return ibase._new_Index, (type(self), d), None | [
"def",
"__reduce__",
"(",
"self",
")",
":",
"d",
"=",
"dict",
"(",
"levels",
"=",
"list",
"(",
"self",
".",
"levels",
")",
",",
"codes",
"=",
"list",
"(",
"self",
".",
"codes",
")",
",",
"sortorder",
"=",
"self",
".",
"sortorder",
",",
"names",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/multi.py#L1895-L1903 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/twodim_base.py | python | triu_indices_from | (arr, k=0) | return triu_indices(arr.shape[0],k) | Return the indices for the upper-triangle of an (n, n) array.
See `triu_indices` for full details.
Parameters
----------
arr : array_like
The indices will be valid for square arrays whose dimensions are
the same as arr.
k : int, optional
Diagonal offset (see `triu` for detail... | Return the indices for the upper-triangle of an (n, n) array. | [
"Return",
"the",
"indices",
"for",
"the",
"upper",
"-",
"triangle",
"of",
"an",
"(",
"n",
"n",
")",
"array",
"."
] | def triu_indices_from(arr, k=0):
"""
Return the indices for the upper-triangle of an (n, n) array.
See `triu_indices` for full details.
Parameters
----------
arr : array_like
The indices will be valid for square arrays whose dimensions are
the same as arr.
k : int, optional... | [
"def",
"triu_indices_from",
"(",
"arr",
",",
"k",
"=",
"0",
")",
":",
"if",
"not",
"(",
"arr",
".",
"ndim",
"==",
"2",
"and",
"arr",
".",
"shape",
"[",
"0",
"]",
"==",
"arr",
".",
"shape",
"[",
"1",
"]",
")",
":",
"raise",
"ValueError",
"(",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/twodim_base.py#L864-L889 | |
facebook/hhvm | cd8d20db628e93583fffa0194aaca937af9b2692 | hphp/tools/gdb/hhbc.py | python | op_table | (name) | Get the symbol `name' as an int8_t[]. | Get the symbol `name' as an int8_t[]. | [
"Get",
"the",
"symbol",
"name",
"as",
"an",
"int8_t",
"[]",
"."
] | def op_table(name):
"""Get the symbol `name' as an int8_t[]."""
try:
return V(name).address.cast(T('int8_t').pointer())
except:
# for some reason some of these tables have no type
# information. for those cases, just take the address and
# cast to a pointer. Note that this ... | [
"def",
"op_table",
"(",
"name",
")",
":",
"try",
":",
"return",
"V",
"(",
"name",
")",
".",
"address",
".",
"cast",
"(",
"T",
"(",
"'int8_t'",
")",
".",
"pointer",
"(",
")",
")",
"except",
":",
"# for some reason some of these tables have no type",
"# info... | https://github.com/facebook/hhvm/blob/cd8d20db628e93583fffa0194aaca937af9b2692/hphp/tools/gdb/hhbc.py#L27-L36 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/ansic/cparse.py | python | p_jump_statement_4 | (t) | jump_statement : RETURN expression_opt SEMI | jump_statement : RETURN expression_opt SEMI | [
"jump_statement",
":",
"RETURN",
"expression_opt",
"SEMI"
] | def p_jump_statement_4(t):
'jump_statement : RETURN expression_opt SEMI'
pass | [
"def",
"p_jump_statement_4",
"(",
"t",
")",
":",
"pass"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L553-L555 | ||
PaddlePaddle/Anakin | 5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730 | tools/external_converter_v2/parser/onnx/med_trans_util.py | python | np_2_ak_tensor | (np_tensor) | return ak_tensor | onnx np array to tensor
:param np_tensor:
:return: | onnx np array to tensor
:param np_tensor:
:return: | [
"onnx",
"np",
"array",
"to",
"tensor",
":",
"param",
"np_tensor",
":",
":",
"return",
":"
] | def np_2_ak_tensor(np_tensor):
"""
onnx np array to tensor
:param np_tensor:
:return:
"""
data_type_map2 ={
np.dtype('float32'): 'float',
np.dtype('int32'): 'int',
np.dtype('bool'): 'bool'
}
data_type_map = {
'float32': 'float',
'int32': 'int',
... | [
"def",
"np_2_ak_tensor",
"(",
"np_tensor",
")",
":",
"data_type_map2",
"=",
"{",
"np",
".",
"dtype",
"(",
"'float32'",
")",
":",
"'float'",
",",
"np",
".",
"dtype",
"(",
"'int32'",
")",
":",
"'int'",
",",
"np",
".",
"dtype",
"(",
"'bool'",
")",
":",
... | https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/onnx/med_trans_util.py#L14-L42 | |
IfcOpenShell/IfcOpenShell | 2c2954b11a9c9d581bef03240836d4567e69ad0b | src/ifcopenshell-python/ifcopenshell/alignment.py | python | convert | (inst) | Looks up one of the conversion functions below in the global namespace | Looks up one of the conversion functions below in the global namespace | [
"Looks",
"up",
"one",
"of",
"the",
"conversion",
"functions",
"below",
"in",
"the",
"global",
"namespace"
] | def convert(inst):
"""
Looks up one of the conversion functions below in the global namespace
"""
yield from globals()[f"convert_{inst.is_a()}_{inst.PredefinedType}"](inst) | [
"def",
"convert",
"(",
"inst",
")",
":",
"yield",
"from",
"globals",
"(",
")",
"[",
"f\"convert_{inst.is_a()}_{inst.PredefinedType}\"",
"]",
"(",
"inst",
")"
] | https://github.com/IfcOpenShell/IfcOpenShell/blob/2c2954b11a9c9d581bef03240836d4567e69ad0b/src/ifcopenshell-python/ifcopenshell/alignment.py#L174-L178 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings._GetAndMunge | (self, field, path, default, prefix, append, map) | return _AppendOrReturn(append, result) | Retrieve a value from |field| at |path| or return |default|. If
|append| is specified, and the item is found, it will be appended to that
object instead of returned. If |map| is specified, results will be
remapped through |map| before being returned or appended. | Retrieve a value from |field| at |path| or return |default|. If
|append| is specified, and the item is found, it will be appended to that
object instead of returned. If |map| is specified, results will be
remapped through |map| before being returned or appended. | [
"Retrieve",
"a",
"value",
"from",
"|field|",
"at",
"|path|",
"or",
"return",
"|default|",
".",
"If",
"|append|",
"is",
"specified",
"and",
"the",
"item",
"is",
"found",
"it",
"will",
"be",
"appended",
"to",
"that",
"object",
"instead",
"of",
"returned",
".... | def _GetAndMunge(self, field, path, default, prefix, append, map):
"""Retrieve a value from |field| at |path| or return |default|. If
|append| is specified, and the item is found, it will be appended to that
object instead of returned. If |map| is specified, results will be
remapped thro... | [
"def",
"_GetAndMunge",
"(",
"self",
",",
"field",
",",
"path",
",",
"default",
",",
"prefix",
",",
"append",
",",
"map",
")",
":",
"result",
"=",
"_GenericRetrieve",
"(",
"field",
",",
"default",
",",
"path",
")",
"result",
"=",
"_DoRemapping",
"(",
"r... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L301-L309 | |
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | QueryEngine/scripts/generate_TableFunctionsFactory_init.py | python | Parser.parse_arg | (self) | return ArgNode(typ, annotations) | fmt: off
arg: type IDENTIFIER? ("|" annotation)*
fmt: on | fmt: off | [
"fmt",
":",
"off"
] | def parse_arg(self):
"""fmt: off
arg: type IDENTIFIER? ("|" annotation)*
fmt: on
"""
typ = self.parse_type()
annotations = []
if not self.is_at_end() and self.match(Token.IDENTIFIER):
name = self.parse_identifier()
annotations.append(An... | [
"def",
"parse_arg",
"(",
"self",
")",
":",
"typ",
"=",
"self",
".",
"parse_type",
"(",
")",
"annotations",
"=",
"[",
"]",
"if",
"not",
"self",
".",
"is_at_end",
"(",
")",
"and",
"self",
".",
"match",
"(",
"Token",
".",
"IDENTIFIER",
")",
":",
"name... | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/QueryEngine/scripts/generate_TableFunctionsFactory_init.py#L1359-L1381 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | ParserElement.__add__ | (self, other) | return And([self, other]) | Implementation of + operator - returns :class:`And`. Adding strings to a ParserElement
converts them to :class:`Literal`s by default.
Example::
greet = Word(alphas) + "," + Word(alphas) + "!"
hello = "Hello, World!"
print (hello, "->", greet.parseString(hello))
... | Implementation of + operator - returns :class:`And`. Adding strings to a ParserElement
converts them to :class:`Literal`s by default. | [
"Implementation",
"of",
"+",
"operator",
"-",
"returns",
":",
"class",
":",
"And",
".",
"Adding",
"strings",
"to",
"a",
"ParserElement",
"converts",
"them",
"to",
":",
"class",
":",
"Literal",
"s",
"by",
"default",
"."
] | def __add__(self, other):
"""
Implementation of + operator - returns :class:`And`. Adding strings to a ParserElement
converts them to :class:`Literal`s by default.
Example::
greet = Word(alphas) + "," + Word(alphas) + "!"
hello = "Hello, World!"
prin... | [
"def",
"__add__",
"(",
"self",
",",
"other",
")",
":",
"if",
"other",
"is",
"Ellipsis",
":",
"return",
"_PendingSkip",
"(",
"self",
")",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"self",
".",
"_literalStringClass",
"(",... | 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/pyparsing.py#L2138-L2174 | |
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | python/ola/ClientWrapper.py | python | _Event.HasExpired | (self, now) | return self._run_at < now | Return true if this event has expired. | Return true if this event has expired. | [
"Return",
"true",
"if",
"this",
"event",
"has",
"expired",
"."
] | def HasExpired(self, now):
"""Return true if this event has expired."""
return self._run_at < now | [
"def",
"HasExpired",
"(",
"self",
",",
"now",
")",
":",
"return",
"self",
".",
"_run_at",
"<",
"now"
] | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/python/ola/ClientWrapper.py#L93-L95 | |
google/mysql-protobuf | 467cda676afaa49e762c5c9164a43f6ad31a1fbf | storage/ndb/mcc/request_handler.py | python | make_rep | (req, body=None) | return rep | Utility which creates a reply object based on the headers in the request
object. | Utility which creates a reply object based on the headers in the request
object. | [
"Utility",
"which",
"creates",
"a",
"reply",
"object",
"based",
"on",
"the",
"headers",
"in",
"the",
"request",
"object",
"."
] | def make_rep(req, body=None):
"""Utility which creates a reply object based on the headers in the request
object."""
rep = { 'head': { 'seq': req['head']['seq'] +1,
'cmd': req['head']['cmd'],
'rSeq': req['head']['seq'] }}
if body:
rep['body'] = body
... | [
"def",
"make_rep",
"(",
"req",
",",
"body",
"=",
"None",
")",
":",
"rep",
"=",
"{",
"'head'",
":",
"{",
"'seq'",
":",
"req",
"[",
"'head'",
"]",
"[",
"'seq'",
"]",
"+",
"1",
",",
"'cmd'",
":",
"req",
"[",
"'head'",
"]",
"[",
"'cmd'",
"]",
","... | https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/storage/ndb/mcc/request_handler.py#L95-L104 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextObject_GetBoxRects | (*args, **kwargs) | return _richtext.RichTextObject_GetBoxRects(*args, **kwargs) | RichTextObject_GetBoxRects(DC dc, RichTextBuffer buffer, RichTextAttr attr, Rect marginRect,
Rect borderRect, Rect contentRect,
Rect paddingRect, Rect outlineRect) -> bool | RichTextObject_GetBoxRects(DC dc, RichTextBuffer buffer, RichTextAttr attr, Rect marginRect,
Rect borderRect, Rect contentRect,
Rect paddingRect, Rect outlineRect) -> bool | [
"RichTextObject_GetBoxRects",
"(",
"DC",
"dc",
"RichTextBuffer",
"buffer",
"RichTextAttr",
"attr",
"Rect",
"marginRect",
"Rect",
"borderRect",
"Rect",
"contentRect",
"Rect",
"paddingRect",
"Rect",
"outlineRect",
")",
"-",
">",
"bool"
] | def RichTextObject_GetBoxRects(*args, **kwargs):
"""
RichTextObject_GetBoxRects(DC dc, RichTextBuffer buffer, RichTextAttr attr, Rect marginRect,
Rect borderRect, Rect contentRect,
Rect paddingRect, Rect outlineRect) -> bool
"""
return _richtext.RichTextObject_GetBoxRects(*args, **kwargs) | [
"def",
"RichTextObject_GetBoxRects",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObject_GetBoxRects",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1478-L1484 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/core.py | python | CatBoost.drop_unused_features | (self) | Drop unused features information from model | Drop unused features information from model | [
"Drop",
"unused",
"features",
"information",
"from",
"model"
] | def drop_unused_features(self):
"""
Drop unused features information from model
"""
self._base_drop_unused_features() | [
"def",
"drop_unused_features",
"(",
"self",
")",
":",
"self",
".",
"_base_drop_unused_features",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/core.py#L3108-L3112 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextBuffer.RemoveHandler | (*args, **kwargs) | return _richtext.RichTextBuffer_RemoveHandler(*args, **kwargs) | RemoveHandler(String name) -> bool | RemoveHandler(String name) -> bool | [
"RemoveHandler",
"(",
"String",
"name",
")",
"-",
">",
"bool"
] | def RemoveHandler(*args, **kwargs):
"""RemoveHandler(String name) -> bool"""
return _richtext.RichTextBuffer_RemoveHandler(*args, **kwargs) | [
"def",
"RemoveHandler",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_RemoveHandler",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2559-L2561 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextCtrl.GetCaretPosition | (*args, **kwargs) | return _richtext.RichTextCtrl_GetCaretPosition(*args, **kwargs) | GetCaretPosition(self) -> long | GetCaretPosition(self) -> long | [
"GetCaretPosition",
"(",
"self",
")",
"-",
">",
"long"
] | def GetCaretPosition(*args, **kwargs):
"""GetCaretPosition(self) -> long"""
return _richtext.RichTextCtrl_GetCaretPosition(*args, **kwargs) | [
"def",
"GetCaretPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_GetCaretPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L4072-L4074 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/contrib/pyopenssl.py | python | inject_into_urllib3 | () | Monkey-patch urllib3 with PyOpenSSL-backed SSL-support. | Monkey-patch urllib3 with PyOpenSSL-backed SSL-support. | [
"Monkey",
"-",
"patch",
"urllib3",
"with",
"PyOpenSSL",
"-",
"backed",
"SSL",
"-",
"support",
"."
] | def inject_into_urllib3():
"Monkey-patch urllib3 with PyOpenSSL-backed SSL-support."
_validate_dependencies_met()
util.SSLContext = PyOpenSSLContext
util.ssl_.SSLContext = PyOpenSSLContext
util.HAS_SNI = HAS_SNI
util.ssl_.HAS_SNI = HAS_SNI
util.IS_PYOPENSSL = True
util.ssl_.IS_PYOPENSS... | [
"def",
"inject_into_urllib3",
"(",
")",
":",
"_validate_dependencies_met",
"(",
")",
"util",
".",
"SSLContext",
"=",
"PyOpenSSLContext",
"util",
".",
"ssl_",
".",
"SSLContext",
"=",
"PyOpenSSLContext",
"util",
".",
"HAS_SNI",
"=",
"HAS_SNI",
"util",
".",
"ssl_",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/contrib/pyopenssl.py#L115-L125 | ||
pgRouting/osm2pgrouting | 8491929fc4037d308f271e84d59bb96da3c28aa2 | tools/cpplint.py | python | _CppLintState.SetCountingStyle | (self, counting_style) | Sets the module's counting options. | Sets the module's counting options. | [
"Sets",
"the",
"module",
"s",
"counting",
"options",
"."
] | def SetCountingStyle(self, counting_style):
"""Sets the module's counting options."""
self.counting = counting_style | [
"def",
"SetCountingStyle",
"(",
"self",
",",
"counting_style",
")",
":",
"self",
".",
"counting",
"=",
"counting_style"
] | https://github.com/pgRouting/osm2pgrouting/blob/8491929fc4037d308f271e84d59bb96da3c28aa2/tools/cpplint.py#L783-L785 | ||
makefile/frcnn | 8d9b9ebf8be8315ba2f374d460121b0adf1df29c | scripts/cpp_lint.py | python | CheckInvalidIncrement | (filename, clean_lines, linenum, error) | Checks for invalid increment *count++.
For example following function:
void increment_counter(int* count) {
*count++;
}
is invalid, because it effectively does count++, moving pointer, and should
be replaced with ++*count, (*count)++ or *count += 1.
Args:
filename: The name of the current file.
... | Checks for invalid increment *count++. | [
"Checks",
"for",
"invalid",
"increment",
"*",
"count",
"++",
"."
] | def CheckInvalidIncrement(filename, clean_lines, linenum, error):
"""Checks for invalid increment *count++.
For example following function:
void increment_counter(int* count) {
*count++;
}
is invalid, because it effectively does count++, moving pointer, and should
be replaced with ++*count, (*count)++ ... | [
"def",
"CheckInvalidIncrement",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"_RE_PATTERN_INVALID_INCREMENT",
".",
"match",
"(",
"line",
")",
":",
"error",
... | https://github.com/makefile/frcnn/blob/8d9b9ebf8be8315ba2f374d460121b0adf1df29c/scripts/cpp_lint.py#L1733-L1752 | ||
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/experimental_show_deformable_mesh.py | python | ExperimentalDeformableMeshVisualizer.handle_update_message | (self, msg) | Updates vertex data for the deformable meshes specified in msg. | Updates vertex data for the deformable meshes specified in msg. | [
"Updates",
"vertex",
"data",
"for",
"the",
"deformable",
"meshes",
"specified",
"in",
"msg",
"."
] | def handle_update_message(self, msg):
"""Updates vertex data for the deformable meshes specified in msg."""
if not len(self._poly_data_list) == msg.num_meshes:
print(
"Received a deformable mesh update message with '{}' meshes; "
"expected {} meshes.".format(
... | [
"def",
"handle_update_message",
"(",
"self",
",",
"msg",
")",
":",
"if",
"not",
"len",
"(",
"self",
".",
"_poly_data_list",
")",
"==",
"msg",
".",
"num_meshes",
":",
"print",
"(",
"\"Received a deformable mesh update message with '{}' meshes; \"",
"\"expected {} meshe... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/experimental_show_deformable_mesh.py#L112-L154 | ||
aimerykong/Low-Rank-Bilinear-Pooling | 487eb2c857fd9c95357a5166b0c15ad0fe135b28 | caffe-20160312/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/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/python/caffe/draw.py#L117-L127 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/dynamodb/conditions.py | python | Attr.ne | (self, value) | return NotEquals(self, value) | Creates a condition where the attribute is not equal to the value
:param value: The value that the attribute is not equal to. | Creates a condition where the attribute is not equal to the value | [
"Creates",
"a",
"condition",
"where",
"the",
"attribute",
"is",
"not",
"equal",
"to",
"the",
"value"
] | def ne(self, value):
"""Creates a condition where the attribute is not equal to the value
:param value: The value that the attribute is not equal to.
"""
return NotEquals(self, value) | [
"def",
"ne",
"(",
"self",
",",
"value",
")",
":",
"return",
"NotEquals",
"(",
"self",
",",
"value",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/dynamodb/conditions.py#L243-L248 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibook.py | python | AuiNotebook.GetSashDClickUnsplit | (self) | return self._sash_dclick_unsplit | Returns whether a splitted :class:`AuiNotebook` can be unsplitted by double-clicking
on the splitter sash. | Returns whether a splitted :class:`AuiNotebook` can be unsplitted by double-clicking
on the splitter sash. | [
"Returns",
"whether",
"a",
"splitted",
":",
"class",
":",
"AuiNotebook",
"can",
"be",
"unsplitted",
"by",
"double",
"-",
"clicking",
"on",
"the",
"splitter",
"sash",
"."
] | def GetSashDClickUnsplit(self):
"""
Returns whether a splitted :class:`AuiNotebook` can be unsplitted by double-clicking
on the splitter sash.
"""
return self._sash_dclick_unsplit | [
"def",
"GetSashDClickUnsplit",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sash_dclick_unsplit"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L3542-L3548 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/_polybase.py | python | ABCPolyBase._get_coefficients | (self, other) | return other | Interpret other as polynomial coefficients.
The `other` argument is checked to see if it is of the same
class as self with identical domain and window. If so,
return its coefficients, otherwise return `other`.
.. versionadded:: 1.9.0
Parameters
----------
other... | Interpret other as polynomial coefficients. | [
"Interpret",
"other",
"as",
"polynomial",
"coefficients",
"."
] | def _get_coefficients(self, other):
"""Interpret other as polynomial coefficients.
The `other` argument is checked to see if it is of the same
class as self with identical domain and window. If so,
return its coefficients, otherwise return `other`.
.. versionadded:: 1.9.0
... | [
"def",
"_get_coefficients",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"ABCPolyBase",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"self",
".",
"__class__",
")",
":",
"raise",
"TypeError",
"(",
"\"Polynomial type... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/_polybase.py#L229-L263 | |
PrincetonUniversity/athena-public-version | 9c266692b9423743d8e23509b3ab266a232a92d2 | tst/style/cpplint.py | python | ParseNolintSuppressions | (filename, raw_line, linenum, error) | Updates the global list of line error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of the input file.
raw_line: str, the line of input text, w... | Updates the global list of line error-suppressions. | [
"Updates",
"the",
"global",
"list",
"of",
"line",
"error",
"-",
"suppressions",
"."
] | def ParseNolintSuppressions(filename, raw_line, linenum, error):
"""Updates the global list of line error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, th... | [
"def",
"ParseNolintSuppressions",
"(",
"filename",
",",
"raw_line",
",",
"linenum",
",",
"error",
")",
":",
"matched",
"=",
"Search",
"(",
"r'\\bNOLINT(NEXTLINE)?\\b(\\([^)]+\\))?'",
",",
"raw_line",
")",
"if",
"matched",
":",
"if",
"matched",
".",
"group",
"(",... | https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L721-L750 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/autocomp/pycomp.py | python | Scope.local | (self, loc) | Add an object to the scopes locals
@param loc: local object to add to locals | Add an object to the scopes locals
@param loc: local object to add to locals | [
"Add",
"an",
"object",
"to",
"the",
"scopes",
"locals",
"@param",
"loc",
":",
"local",
"object",
"to",
"add",
"to",
"locals"
] | def local(self, loc):
"""Add an object to the scopes locals
@param loc: local object to add to locals
"""
self._checkexisting(loc)
self.locals.append((self.NextObjId(), loc)) | [
"def",
"local",
"(",
"self",
",",
"loc",
")",
":",
"self",
".",
"_checkexisting",
"(",
"loc",
")",
"self",
".",
"locals",
".",
"append",
"(",
"(",
"self",
".",
"NextObjId",
"(",
")",
",",
"loc",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/autocomp/pycomp.py#L464-L470 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | uCSIsLetterlikeSymbols | (code) | return ret | Check whether the character is part of LetterlikeSymbols
UCS Block | Check whether the character is part of LetterlikeSymbols
UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"LetterlikeSymbols",
"UCS",
"Block"
] | def uCSIsLetterlikeSymbols(code):
"""Check whether the character is part of LetterlikeSymbols
UCS Block """
ret = libxml2mod.xmlUCSIsLetterlikeSymbols(code)
return ret | [
"def",
"uCSIsLetterlikeSymbols",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsLetterlikeSymbols",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2692-L2696 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridTableBase.InsertCols | (*args, **kwargs) | return _grid.GridTableBase_InsertCols(*args, **kwargs) | InsertCols(self, size_t pos=0, size_t numCols=1) -> bool | InsertCols(self, size_t pos=0, size_t numCols=1) -> bool | [
"InsertCols",
"(",
"self",
"size_t",
"pos",
"=",
"0",
"size_t",
"numCols",
"=",
"1",
")",
"-",
">",
"bool"
] | def InsertCols(*args, **kwargs):
"""InsertCols(self, size_t pos=0, size_t numCols=1) -> bool"""
return _grid.GridTableBase_InsertCols(*args, **kwargs) | [
"def",
"InsertCols",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase_InsertCols",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L874-L876 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/cpp_message.py | python | BuildFile | (content) | Registers a new proto file in the underlying C++ descriptor pool. | Registers a new proto file in the underlying C++ descriptor pool. | [
"Registers",
"a",
"new",
"proto",
"file",
"in",
"the",
"underlying",
"C",
"++",
"descriptor",
"pool",
"."
] | def BuildFile(content):
"""Registers a new proto file in the underlying C++ descriptor pool."""
_net_proto2___python.BuildFile(content) | [
"def",
"BuildFile",
"(",
"content",
")",
":",
"_net_proto2___python",
".",
"BuildFile",
"(",
"content",
")"
] | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/cpp_message.py#L63-L65 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/saving/functional_saver.py | python | MultiDeviceSaver.__init__ | (self, saveable_objects) | Specify a list of `SaveableObject`s to save and restore.
Args:
saveable_objects: A list of `SaveableObject`s. | Specify a list of `SaveableObject`s to save and restore. | [
"Specify",
"a",
"list",
"of",
"SaveableObject",
"s",
"to",
"save",
"and",
"restore",
"."
] | def __init__(self, saveable_objects):
"""Specify a list of `SaveableObject`s to save and restore.
Args:
saveable_objects: A list of `SaveableObject`s.
"""
saveable_objects = list(saveable_objects)
saveables_by_device = {}
for saveable in saveable_objects:
if not isinstance(saveable,... | [
"def",
"__init__",
"(",
"self",
",",
"saveable_objects",
")",
":",
"saveable_objects",
"=",
"list",
"(",
"saveable_objects",
")",
"saveables_by_device",
"=",
"{",
"}",
"for",
"saveable",
"in",
"saveable_objects",
":",
"if",
"not",
"isinstance",
"(",
"saveable",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/saving/functional_saver.py#L128-L144 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pexpect/pexpect/pty_spawn.py | python | spawn.__str__ | (self) | return '\n'.join(s) | This returns a human-readable string that represents the state of
the object. | This returns a human-readable string that represents the state of
the object. | [
"This",
"returns",
"a",
"human",
"-",
"readable",
"string",
"that",
"represents",
"the",
"state",
"of",
"the",
"object",
"."
] | def __str__(self):
'''This returns a human-readable string that represents the state of
the object. '''
s = []
s.append(repr(self))
s.append('command: ' + str(self.command))
s.append('args: %r' % (self.args,))
s.append('buffer (last %s chars): %r' % (self.str_las... | [
"def",
"__str__",
"(",
"self",
")",
":",
"s",
"=",
"[",
"]",
"s",
".",
"append",
"(",
"repr",
"(",
"self",
")",
")",
"s",
".",
"append",
"(",
"'command: '",
"+",
"str",
"(",
"self",
".",
"command",
")",
")",
"s",
".",
"append",
"(",
"'args: %r'... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pexpect/pexpect/pty_spawn.py#L208-L238 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/hd/media_subprocessor.py | python | HDMediaSubprocessor.create_graphics_requests | (full_data_set) | Create export requests for graphics referenced by CombinedSprite objects. | Create export requests for graphics referenced by CombinedSprite objects. | [
"Create",
"export",
"requests",
"for",
"graphics",
"referenced",
"by",
"CombinedSprite",
"objects",
"."
] | def create_graphics_requests(full_data_set):
"""
Create export requests for graphics referenced by CombinedSprite objects.
"""
combined_sprites = full_data_set.combined_sprites.values()
handled_graphic_ids = set()
for sprite in combined_sprites:
ref_graphics ... | [
"def",
"create_graphics_requests",
"(",
"full_data_set",
")",
":",
"combined_sprites",
"=",
"full_data_set",
".",
"combined_sprites",
".",
"values",
"(",
")",
"handled_graphic_ids",
"=",
"set",
"(",
")",
"for",
"sprite",
"in",
"combined_sprites",
":",
"ref_graphics"... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/hd/media_subprocessor.py#L29-L111 | ||
p4lang/PI | 38d87e81253feff9fff0660d662c885be78fb719 | tools/cpplint.py | python | _CppLintState.IncrementErrorCount | (self, category) | Bumps the module's error statistic. | Bumps the module's error statistic. | [
"Bumps",
"the",
"module",
"s",
"error",
"statistic",
"."
] | def IncrementErrorCount(self, category):
"""Bumps the module's error statistic."""
self.error_count += 1
if self.counting in ('toplevel', 'detailed'):
if self.counting != 'detailed':
category = category.split('/')[0]
if category not in self.errors_by_category:
self.errors_by_cate... | [
"def",
"IncrementErrorCount",
"(",
"self",
",",
"category",
")",
":",
"self",
".",
"error_count",
"+=",
"1",
"if",
"self",
".",
"counting",
"in",
"(",
"'toplevel'",
",",
"'detailed'",
")",
":",
"if",
"self",
".",
"counting",
"!=",
"'detailed'",
":",
"cat... | https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/tools/cpplint.py#L1335-L1343 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlNode.schemaValidateOneElement | (self, ctxt) | return ret | Validate a branch of a tree, starting with the given @elem. | Validate a branch of a tree, starting with the given | [
"Validate",
"a",
"branch",
"of",
"a",
"tree",
"starting",
"with",
"the",
"given"
] | def schemaValidateOneElement(self, ctxt):
"""Validate a branch of a tree, starting with the given @elem. """
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.xmlSchemaValidateOneElement(ctxt__o, self._o)
return ret | [
"def",
"schemaValidateOneElement",
"(",
"self",
",",
"ctxt",
")",
":",
"if",
"ctxt",
"is",
"None",
":",
"ctxt__o",
"=",
"None",
"else",
":",
"ctxt__o",
"=",
"ctxt",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlSchemaValidateOneElement",
"(",
"ctxt__o",
",... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L2909-L2914 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.