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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread_WpanCtl.py | python | OpenThread_WpanCtl.MGMT_ACTIVE_GET | (self, Addr='', TLVs=[]) | send MGMT_ACTIVE_GET command
Returns:
True: successful to send MGMT_ACTIVE_GET
False: fail to send MGMT_ACTIVE_GET | send MGMT_ACTIVE_GET command | [
"send",
"MGMT_ACTIVE_GET",
"command"
] | def MGMT_ACTIVE_GET(self, Addr='', TLVs=[]):
"""send MGMT_ACTIVE_GET command
Returns:
True: successful to send MGMT_ACTIVE_GET
False: fail to send MGMT_ACTIVE_GET
"""
print('%s call MGMT_ACTIVE_GET' % self.port)
try:
cmd = self.wpan_cmd_prefi... | [
"def",
"MGMT_ACTIVE_GET",
"(",
"self",
",",
"Addr",
"=",
"''",
",",
"TLVs",
"=",
"[",
"]",
")",
":",
"print",
"(",
"'%s call MGMT_ACTIVE_GET'",
"%",
"self",
".",
"port",
")",
"try",
":",
"cmd",
"=",
"self",
".",
"wpan_cmd_prefix",
"+",
"'dataset mgmt-get... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread_WpanCtl.py#L2255-L2286 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/slim/python/slim/summaries.py | python | add_zero_fraction_summaries | (tensors, prefix=None) | return summary_ops | Adds a scalar zero-fraction summary for each of the given tensors.
Args:
tensors: a list of variable or op tensors.
prefix: An optional prefix for the summary names.
Returns:
A list of scalar `Tensors` of type `string` whose contents are the
serialized `Summary` protocol buffer. | Adds a scalar zero-fraction summary for each of the given tensors. | [
"Adds",
"a",
"scalar",
"zero",
"-",
"fraction",
"summary",
"for",
"each",
"of",
"the",
"given",
"tensors",
"."
] | def add_zero_fraction_summaries(tensors, prefix=None):
"""Adds a scalar zero-fraction summary for each of the given tensors.
Args:
tensors: a list of variable or op tensors.
prefix: An optional prefix for the summary names.
Returns:
A list of scalar `Tensors` of type `string` whose contents are the
... | [
"def",
"add_zero_fraction_summaries",
"(",
"tensors",
",",
"prefix",
"=",
"None",
")",
":",
"summary_ops",
"=",
"[",
"]",
"for",
"tensor",
"in",
"tensors",
":",
"summary_ops",
".",
"append",
"(",
"add_zero_fraction_summary",
"(",
"tensor",
",",
"prefix",
"=",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/slim/python/slim/summaries.py#L206-L220 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py | python | Standard_Suite_Events.quit | (self, _no_object=None, _attributes={}, **_arguments) | quit: Quit an application
Keyword argument saving: specifies whether to save currently open documents
Keyword argument _attributes: AppleEvent attribute dictionary | quit: Quit an application
Keyword argument saving: specifies whether to save currently open documents
Keyword argument _attributes: AppleEvent attribute dictionary | [
"quit",
":",
"Quit",
"an",
"application",
"Keyword",
"argument",
"saving",
":",
"specifies",
"whether",
"to",
"save",
"currently",
"open",
"documents",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary"
] | def quit(self, _no_object=None, _attributes={}, **_arguments):
"""quit: Quit an application
Keyword argument saving: specifies whether to save currently open documents
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'aevt'
_subcode = 'quit'
... | [
"def",
"quit",
"(",
"self",
",",
"_no_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'aevt'",
"_subcode",
"=",
"'quit'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py#L339-L358 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/estimators/svm.py | python | SVM.export_with_defaults | (
self,
export_dir,
signature_fn=None,
input_fn=None,
default_batch_size=1,
exports_to_keep=None) | return super(SVM, self).export(export_dir=export_dir,
signature_fn=signature_fn,
input_fn=input_fn or default_input_fn,
default_batch_size=default_batch_size,
exports_to_keep=expor... | Same as BaseEstimator.export, but uses some defaults. | Same as BaseEstimator.export, but uses some defaults. | [
"Same",
"as",
"BaseEstimator",
".",
"export",
"but",
"uses",
"some",
"defaults",
"."
] | def export_with_defaults(
self,
export_dir,
signature_fn=None,
input_fn=None,
default_batch_size=1,
exports_to_keep=None):
"""Same as BaseEstimator.export, but uses some defaults."""
def default_input_fn(unused_estimator, examples):
return layers.parse_feature_columns_f... | [
"def",
"export_with_defaults",
"(",
"self",
",",
"export_dir",
",",
"signature_fn",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"default_batch_size",
"=",
"1",
",",
"exports_to_keep",
"=",
"None",
")",
":",
"def",
"default_input_fn",
"(",
"unused_estimator",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/svm.py#L200-L215 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/spawn.py | python | spawn | (cmd, search_path=1, verbose=0, dry_run=0) | Run another program, specified as a command list 'cmd', in a new process.
'cmd' is just the argument list for the new process, ie.
cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
There is no way to run a program with a name different from that of its
executable.
If 'search_... | Run another program, specified as a command list 'cmd', in a new process. | [
"Run",
"another",
"program",
"specified",
"as",
"a",
"command",
"list",
"cmd",
"in",
"a",
"new",
"process",
"."
] | def spawn(cmd, search_path=1, verbose=0, dry_run=0):
"""Run another program, specified as a command list 'cmd', in a new process.
'cmd' is just the argument list for the new process, ie.
cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
There is no way to run a program with a name... | [
"def",
"spawn",
"(",
"cmd",
",",
"search_path",
"=",
"1",
",",
"verbose",
"=",
"0",
",",
"dry_run",
"=",
"0",
")",
":",
"if",
"os",
".",
"name",
"==",
"'posix'",
":",
"_spawn_posix",
"(",
"cmd",
",",
"search_path",
",",
"dry_run",
"=",
"dry_run",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/spawn.py#L17-L41 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/metric_op.py | python | accuracy | (input, label, k=1, correct=None, total=None) | return acc_out | accuracy layer.
Refer to the https://en.wikipedia.org/wiki/Precision_and_recall
This function computes the accuracy using the input and label.
If the correct label occurs in top k predictions, then correct will increment by one.
Note: the dtype of accuracy is determined by input. the input and label dt... | accuracy layer.
Refer to the https://en.wikipedia.org/wiki/Precision_and_recall | [
"accuracy",
"layer",
".",
"Refer",
"to",
"the",
"https",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Precision_and_recall"
] | def accuracy(input, label, k=1, correct=None, total=None):
"""
accuracy layer.
Refer to the https://en.wikipedia.org/wiki/Precision_and_recall
This function computes the accuracy using the input and label.
If the correct label occurs in top k predictions, then correct will increment by one.
Not... | [
"def",
"accuracy",
"(",
"input",
",",
"label",
",",
"k",
"=",
"1",
",",
"correct",
"=",
"None",
",",
"total",
"=",
"None",
")",
":",
"if",
"in_dygraph_mode",
"(",
")",
":",
"if",
"correct",
"is",
"None",
":",
"correct",
"=",
"_varbase_creator",
"(",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/metric_op.py#L33-L128 | |
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/modes/emacs.py | python | EmacsMode.forward_backward_delete_char | (self, e) | Delete the character under the cursor, unless the cursor is at
the end of the line, in which case the character behind the cursor
is deleted. By default, this is not bound to a key. | Delete the character under the cursor, unless the cursor is at
the end of the line, in which case the character behind the cursor
is deleted. By default, this is not bound to a key. | [
"Delete",
"the",
"character",
"under",
"the",
"cursor",
"unless",
"the",
"cursor",
"is",
"at",
"the",
"end",
"of",
"the",
"line",
"in",
"which",
"case",
"the",
"character",
"behind",
"the",
"cursor",
"is",
"deleted",
".",
"By",
"default",
"this",
"is",
"... | def forward_backward_delete_char(self, e): # ()
'''Delete the character under the cursor, unless the cursor is at
the end of the line, in which case the character behind the cursor
is deleted. By default, this is not bound to a key.'''
self.finalize() | [
"def",
"forward_backward_delete_char",
"(",
"self",
",",
"e",
")",
":",
"# ()",
"self",
".",
"finalize",
"(",
")"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/modes/emacs.py#L381-L385 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/core.py | python | CatBoostClassifier.fit | (self, X, y=None, cat_features=None, text_features=None, embedding_features=None, sample_weight=None, baseline=None, use_best_model=None,
eval_set=None, verbose=None, logging_level=None, plot=False, column_description=None,
verbose_eval=None, metric_period=None, silent=None, early_stopping_round... | return self | Fit the CatBoostClassifier model.
Parameters
----------
X : catboost.Pool or list or numpy.ndarray or pandas.DataFrame or pandas.Series
If not catboost.Pool, 2 dimensional Feature matrix or string - file with dataset.
y : list or numpy.ndarray or pandas.DataFrame or pandas.... | Fit the CatBoostClassifier model. | [
"Fit",
"the",
"CatBoostClassifier",
"model",
"."
] | def fit(self, X, y=None, cat_features=None, text_features=None, embedding_features=None, sample_weight=None, baseline=None, use_best_model=None,
eval_set=None, verbose=None, logging_level=None, plot=False, column_description=None,
verbose_eval=None, metric_period=None, silent=None, early_stoppin... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
",",
"cat_features",
"=",
"None",
",",
"text_features",
"=",
"None",
",",
"embedding_features",
"=",
"None",
",",
"sample_weight",
"=",
"None",
",",
"baseline",
"=",
"None",
",",
"use_best_model... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/core.py#L4820-L4924 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/virtualenv/files/virtualenv_support/distribute_setup.py | python | _patch_file | (path, content) | return True | Will backup the file then patch it | Will backup the file then patch it | [
"Will",
"backup",
"the",
"file",
"then",
"patch",
"it"
] | def _patch_file(path, content):
"""Will backup the file then patch it"""
existing_content = open(path).read()
if existing_content == content:
# already patched
log.warn('Already patched.')
return False
log.warn('Patching...')
_rename_path(path)
f = open(path, 'w')
try... | [
"def",
"_patch_file",
"(",
"path",
",",
"content",
")",
":",
"existing_content",
"=",
"open",
"(",
"path",
")",
".",
"read",
"(",
")",
"if",
"existing_content",
"==",
"content",
":",
"# already patched",
"log",
".",
"warn",
"(",
"'Already patched.'",
")",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/virtualenv/files/virtualenv_support/distribute_setup.py#L230-L244 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/matrixlib/defmatrix.py | python | asmatrix | (data, dtype=None) | return matrix(data, dtype=dtype, copy=False) | Interpret the input as a matrix.
Unlike `matrix`, `asmatrix` does not make a copy if the input is already
a matrix or an ndarray. Equivalent to ``matrix(data, copy=False)``.
Parameters
----------
data : array_like
Input data.
dtype : data-type
Data-type of the output matrix.
... | Interpret the input as a matrix. | [
"Interpret",
"the",
"input",
"as",
"a",
"matrix",
"."
] | def asmatrix(data, dtype=None):
"""
Interpret the input as a matrix.
Unlike `matrix`, `asmatrix` does not make a copy if the input is already
a matrix or an ndarray. Equivalent to ``matrix(data, copy=False)``.
Parameters
----------
data : array_like
Input data.
dtype : data-ty... | [
"def",
"asmatrix",
"(",
"data",
",",
"dtype",
"=",
"None",
")",
":",
"return",
"matrix",
"(",
"data",
",",
"dtype",
"=",
"dtype",
",",
"copy",
"=",
"False",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/matrixlib/defmatrix.py#L39-L71 | |
google/fhir | d77f57706c1a168529b0b87ca7ccb1c0113e83c2 | py/google/fhir/stu3/json_format.py | python | print_fhir_to_json_string | (fhir_proto: message.Message) | return printer.print(fhir_proto) | Returns a FHIR JSON representation with no spaces or newlines.
Args:
fhir_proto: The proto to serialize into a JSON string.
Returns:
A FHIR JSON representation with no spaces or newlines. | Returns a FHIR JSON representation with no spaces or newlines. | [
"Returns",
"a",
"FHIR",
"JSON",
"representation",
"with",
"no",
"spaces",
"or",
"newlines",
"."
] | def print_fhir_to_json_string(fhir_proto: message.Message) -> str:
"""Returns a FHIR JSON representation with no spaces or newlines.
Args:
fhir_proto: The proto to serialize into a JSON string.
Returns:
A FHIR JSON representation with no spaces or newlines.
"""
printer = _json_printer.JsonPrinter.co... | [
"def",
"print_fhir_to_json_string",
"(",
"fhir_proto",
":",
"message",
".",
"Message",
")",
"->",
"str",
":",
"printer",
"=",
"_json_printer",
".",
"JsonPrinter",
".",
"compact_printer",
"(",
"_PRIMITIVE_HANDLER",
")",
"return",
"printer",
".",
"print",
"(",
"fh... | https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/stu3/json_format.py#L113-L123 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/_vendor/packaging/specifiers.py | python | BaseSpecifier.prereleases | (self, value: bool) | Sets whether or not pre-releases as a whole are allowed by this
specifier. | Sets whether or not pre-releases as a whole are allowed by this
specifier. | [
"Sets",
"whether",
"or",
"not",
"pre",
"-",
"releases",
"as",
"a",
"whole",
"are",
"allowed",
"by",
"this",
"specifier",
"."
] | def prereleases(self, value: bool) -> None:
"""
Sets whether or not pre-releases as a whole are allowed by this
specifier.
""" | [
"def",
"prereleases",
"(",
"self",
",",
"value",
":",
"bool",
")",
"->",
"None",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/packaging/specifiers.py#L75-L79 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | PseudoDC.Clear | (*args, **kwargs) | return _gdi_.PseudoDC_Clear(*args, **kwargs) | Clear(self)
Clears the device context using the current background brush. | Clear(self) | [
"Clear",
"(",
"self",
")"
] | def Clear(*args, **kwargs):
"""
Clear(self)
Clears the device context using the current background brush.
"""
return _gdi_.PseudoDC_Clear(*args, **kwargs) | [
"def",
"Clear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_Clear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L8208-L8214 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aquabutton.py | python | AquaButton.GetHoverColour | (self) | return self._hoverColour | Returns the button colour when the mouse is hovering on the button.
:return: An instance of :class:`Colour`. | Returns the button colour when the mouse is hovering on the button. | [
"Returns",
"the",
"button",
"colour",
"when",
"the",
"mouse",
"is",
"hovering",
"on",
"the",
"button",
"."
] | def GetHoverColour(self):
"""
Returns the button colour when the mouse is hovering on the button.
:return: An instance of :class:`Colour`.
"""
return self._hoverColour | [
"def",
"GetHoverColour",
"(",
"self",
")",
":",
"return",
"self",
".",
"_hoverColour"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aquabutton.py#L711-L718 | |
ufal/udpipe | e51f02d2744cdfd4a29efc1320644ea04d535f0b | doc/t2t_docsys/txt2tags.py | python | ConfigLines.get_raw_config | (self) | return ret | Scan buffer and extract all config as RAW (including includes) | Scan buffer and extract all config as RAW (including includes) | [
"Scan",
"buffer",
"and",
"extract",
"all",
"config",
"as",
"RAW",
"(",
"including",
"includes",
")"
] | def get_raw_config(self):
"Scan buffer and extract all config as RAW (including includes)"
ret = []
self.load_lines()
first = self.first_line
for i in range(len(self.lines)):
line = self.lines[i]
Message(_("Processing line %03d: %s")%(first+i,line),2)
target, key, val = self.parse_line(line)
if no... | [
"def",
"get_raw_config",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"self",
".",
"load_lines",
"(",
")",
"first",
"=",
"self",
".",
"first_line",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"lines",
")",
")",
":",
"line",
"=",
"sel... | https://github.com/ufal/udpipe/blob/e51f02d2744cdfd4a29efc1320644ea04d535f0b/doc/t2t_docsys/txt2tags.py#L2970-L2990 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/filter/CommonFilters.py | python | CommonFilters.setGammaAdjust | (self, gamma) | return True | Applies additional gamma correction to the image. 1.0 = no correction. | Applies additional gamma correction to the image. 1.0 = no correction. | [
"Applies",
"additional",
"gamma",
"correction",
"to",
"the",
"image",
".",
"1",
".",
"0",
"=",
"no",
"correction",
"."
] | def setGammaAdjust(self, gamma):
""" Applies additional gamma correction to the image. 1.0 = no correction. """
old_gamma = self.configuration.get("GammaAdjust", 1.0)
if old_gamma != gamma:
self.configuration["GammaAdjust"] = gamma
return self.reconfigure(True, "GammaAdj... | [
"def",
"setGammaAdjust",
"(",
"self",
",",
"gamma",
")",
":",
"old_gamma",
"=",
"self",
".",
"configuration",
".",
"get",
"(",
"\"GammaAdjust\"",
",",
"1.0",
")",
"if",
"old_gamma",
"!=",
"gamma",
":",
"self",
".",
"configuration",
"[",
"\"GammaAdjust\"",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/filter/CommonFilters.py#L589-L595 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py | python | TranslationUnit.get_includes | (self) | return iter(includes) | Return an iterable sequence of FileInclusion objects that describe the
sequence of inclusions in a translation unit. The first object in
this sequence is always the input file. Note that this method will not
recursively iterate over header files included through precompiled
headers. | Return an iterable sequence of FileInclusion objects that describe the
sequence of inclusions in a translation unit. The first object in
this sequence is always the input file. Note that this method will not
recursively iterate over header files included through precompiled
headers. | [
"Return",
"an",
"iterable",
"sequence",
"of",
"FileInclusion",
"objects",
"that",
"describe",
"the",
"sequence",
"of",
"inclusions",
"in",
"a",
"translation",
"unit",
".",
"The",
"first",
"object",
"in",
"this",
"sequence",
"is",
"always",
"the",
"input",
"fil... | def get_includes(self):
"""
Return an iterable sequence of FileInclusion objects that describe the
sequence of inclusions in a translation unit. The first object in
this sequence is always the input file. Note that this method will not
recursively iterate over header files includ... | [
"def",
"get_includes",
"(",
"self",
")",
":",
"def",
"visitor",
"(",
"fobj",
",",
"lptr",
",",
"depth",
",",
"includes",
")",
":",
"if",
"depth",
">",
"0",
":",
"loc",
"=",
"lptr",
".",
"contents",
"includes",
".",
"append",
"(",
"FileInclusion",
"("... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L2611-L2629 | |
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/bandit/data_containers.py | python | SampleArm.loss | (self) | return self._loss | Return the amount loss, always greater than or equal to zero. | Return the amount loss, always greater than or equal to zero. | [
"Return",
"the",
"amount",
"loss",
"always",
"greater",
"than",
"or",
"equal",
"to",
"zero",
"."
] | def loss(self):
"""Return the amount loss, always greater than or equal to zero."""
return self._loss | [
"def",
"loss",
"(",
"self",
")",
":",
"return",
"self",
".",
"_loss"
] | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/bandit/data_containers.py#L110-L112 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/utils.py | python | failure | (s) | return msg | Formats a fail message for printing. If on a posix system the message
will be in color. | Formats a fail message for printing. If on a posix system the message
will be in color. | [
"Formats",
"a",
"fail",
"message",
"for",
"printing",
".",
"If",
"on",
"a",
"posix",
"system",
"the",
"message",
"will",
"be",
"in",
"color",
"."
] | def failure(s):
"""Formats a fail message for printing. If on a posix system the message
will be in color.
"""
head = "\033[1;31m" if USE_COLOR else "*** FAILURE ***: "
tail = "\033[0m" if USE_COLOR else ""
msg = head + s + tail
return msg | [
"def",
"failure",
"(",
"s",
")",
":",
"head",
"=",
"\"\\033[1;31m\"",
"if",
"USE_COLOR",
"else",
"\"*** FAILURE ***: \"",
"tail",
"=",
"\"\\033[0m\"",
"if",
"USE_COLOR",
"else",
"\"\"",
"msg",
"=",
"head",
"+",
"s",
"+",
"tail",
"return",
"msg"
] | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/utils.py#L167-L175 | |
ros-planning/moveit2 | dd240ef6fd8b9932a7a53964140f2952786187a9 | moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py | python | MoveItConfigsBuilder.robot_description | (self, file_path: Optional[str] = None, mappings: dict = None) | return self | Load robot description.
:param file_path: Absolute or relative path to the URDF file (w.r.t. robot_name_moveit_config).
:param mappings: mappings to be passed when loading the xacro file.
:return: Instance of MoveItConfigsBuilder with robot_description loaded. | Load robot description. | [
"Load",
"robot",
"description",
"."
] | def robot_description(self, file_path: Optional[str] = None, mappings: dict = None):
"""Load robot description.
:param file_path: Absolute or relative path to the URDF file (w.r.t. robot_name_moveit_config).
:param mappings: mappings to be passed when loading the xacro file.
:return: In... | [
"def",
"robot_description",
"(",
"self",
",",
"file_path",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"mappings",
":",
"dict",
"=",
"None",
")",
":",
"if",
"file_path",
"is",
"None",
":",
"robot_description_file_path",
"=",
"self",
".",
"__urdf_pa... | https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py#L243-L259 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/machinelearning/layer1.py | python | MachineLearningConnection.get_evaluation | (self, evaluation_id) | return self.make_request(action='GetEvaluation',
body=json.dumps(params)) | Returns an `Evaluation` that includes metadata as well as the
current status of the `Evaluation`.
:type evaluation_id: string
:param evaluation_id: The ID of the `Evaluation` to retrieve. The
evaluation of each `MLModel` is recorded and cataloged. The ID
provides the mea... | Returns an `Evaluation` that includes metadata as well as the
current status of the `Evaluation`. | [
"Returns",
"an",
"Evaluation",
"that",
"includes",
"metadata",
"as",
"well",
"as",
"the",
"current",
"status",
"of",
"the",
"Evaluation",
"."
] | def get_evaluation(self, evaluation_id):
"""
Returns an `Evaluation` that includes metadata as well as the
current status of the `Evaluation`.
:type evaluation_id: string
:param evaluation_id: The ID of the `Evaluation` to retrieve. The
evaluation of each `MLModel` i... | [
"def",
"get_evaluation",
"(",
"self",
",",
"evaluation_id",
")",
":",
"params",
"=",
"{",
"'EvaluationId'",
":",
"evaluation_id",
",",
"}",
"return",
"self",
".",
"make_request",
"(",
"action",
"=",
"'GetEvaluation'",
",",
"body",
"=",
"json",
".",
"dumps",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/machinelearning/layer1.py#L1203-L1216 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | snapx/snapx/classes/digraph.py | python | DiGraph.clear_edges | (self) | Remove all edges from the graph without altering nodes.
Examples
--------
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.clear_edges()
>>> list(G.nodes)
[0, 1, 2, 3]
>>> list(G.edges)
[] | Remove all edges from the graph without altering nodes. | [
"Remove",
"all",
"edges",
"from",
"the",
"graph",
"without",
"altering",
"nodes",
"."
] | def clear_edges(self):
"""Remove all edges from the graph without altering nodes.
Examples
--------
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G.clear_edges()
>>> list(G.nodes)
[0, 1, 2, 3]
>>> list(G.edges)
[]
... | [
"def",
"clear_edges",
"(",
"self",
")",
":",
"for",
"predecessor_dict",
"in",
"self",
".",
"_pred",
".",
"values",
"(",
")",
":",
"predecessor_dict",
".",
"clear",
"(",
")",
"for",
"successor_dict",
"in",
"self",
".",
"_succ",
".",
"values",
"(",
")",
... | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/snapx/snapx/classes/digraph.py#L1047-L1063 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.GetCurLineRaw | (*args, **kwargs) | return _stc.StyledTextCtrl_GetCurLineRaw(*args, **kwargs) | GetCurLineRaw() -> (text, index)
Retrieve the text of the line containing the caret, and also the index
of the caret on the line. The returned value is a utf-8 encoded
string in unicode builds of wxPython, or raw 8-bit text otherwise. | GetCurLineRaw() -> (text, index) | [
"GetCurLineRaw",
"()",
"-",
">",
"(",
"text",
"index",
")"
] | def GetCurLineRaw(*args, **kwargs):
"""
GetCurLineRaw() -> (text, index)
Retrieve the text of the line containing the caret, and also the index
of the caret on the line. The returned value is a utf-8 encoded
string in unicode builds of wxPython, or raw 8-bit text otherwise.
... | [
"def",
"GetCurLineRaw",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetCurLineRaw",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6710-L6718 | |
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | utils/hct/hctdb.py | python | db_dxil.print_stats | (self) | Print some basic statistics on the instruction database. | Print some basic statistics on the instruction database. | [
"Print",
"some",
"basic",
"statistics",
"on",
"the",
"instruction",
"database",
"."
] | def print_stats(self):
"Print some basic statistics on the instruction database."
print ("Instruction count: %d" % len(self.instr))
print ("Max parameter count in instruction: %d" % max(len(i.ops) - 1 for i in self.instr))
print ("Parameter count: %d" ... | [
"def",
"print_stats",
"(",
"self",
")",
":",
"print",
"(",
"\"Instruction count: %d\"",
"%",
"len",
"(",
"self",
".",
"instr",
")",
")",
"print",
"(",
"\"Max parameter count in instruction: %d\"",
"%",
"max",
"(",
"len",
"(",
"i",
".",
"ops",
... | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/utils/hct/hctdb.py#L2760-L2764 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSProject.py | python | Writer.AddFileConfig | (self, path, config, attrs=None, tools=None) | Adds a configuration to a file.
Args:
path: Relative path to the file.
config: Name of configuration to add.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
Raises:
ValueError: Relative path does not match any fil... | Adds a configuration to a file. | [
"Adds",
"a",
"configuration",
"to",
"a",
"file",
"."
] | def AddFileConfig(self, path, config, attrs=None, tools=None):
"""Adds a configuration to a file.
Args:
path: Relative path to the file.
config: Name of configuration to add.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be Non... | [
"def",
"AddFileConfig",
"(",
"self",
",",
"path",
",",
"config",
",",
"attrs",
"=",
"None",
",",
"tools",
"=",
"None",
")",
":",
"# Find the file node with the right relative path",
"parent",
"=",
"self",
".",
"files_dict",
".",
"get",
"(",
"path",
")",
"if"... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/MSVSProject.py#L166-L186 | ||
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | src/lib/mixer/MultirotorMixer/mixer_multirotor.py | python | airmode_rp | (m_sp, P, u_min, u_max) | return (u, u_final) | Mix roll, pitch, yaw and thrust.
Desaturation behavior: airmode for roll/pitch:
thrust is increased/decreased as much as required to meet the demanded roll/pitch.
Yaw is not allowed to increase the thrust, @see mix_yaw() for the exact behavior. | Mix roll, pitch, yaw and thrust. | [
"Mix",
"roll",
"pitch",
"yaw",
"and",
"thrust",
"."
] | def airmode_rp(m_sp, P, u_min, u_max):
"""
Mix roll, pitch, yaw and thrust.
Desaturation behavior: airmode for roll/pitch:
thrust is increased/decreased as much as required to meet the demanded roll/pitch.
Yaw is not allowed to increase the thrust, @see mix_yaw() for the exact behavior.
"""
... | [
"def",
"airmode_rp",
"(",
"m_sp",
",",
"P",
",",
"u_min",
",",
"u_max",
")",
":",
"# Mix without yaw",
"m_sp_no_yaw",
"=",
"m_sp",
".",
"copy",
"(",
")",
"m_sp_no_yaw",
"[",
"2",
",",
"0",
"]",
"=",
"0.0",
"u",
"=",
"P",
"*",
"m_sp_no_yaw",
"# Use th... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/src/lib/mixer/MultirotorMixer/mixer_multirotor.py#L101-L121 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStrV.Last | (self, *args) | return _snap.TStrV_Last(self, *args) | Last(TStrV self) -> TStr
Last(TStrV self) -> TStr
Parameters:
self: TVec< TStr,int > * | Last(TStrV self) -> TStr
Last(TStrV self) -> TStr | [
"Last",
"(",
"TStrV",
"self",
")",
"-",
">",
"TStr",
"Last",
"(",
"TStrV",
"self",
")",
"-",
">",
"TStr"
] | def Last(self, *args):
"""
Last(TStrV self) -> TStr
Last(TStrV self) -> TStr
Parameters:
self: TVec< TStr,int > *
"""
return _snap.TStrV_Last(self, *args) | [
"def",
"Last",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStrV_Last",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19385-L19394 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | BuildTools/SCons/Tools/InstallWithSymLinks.py | python | scons_copytree | (src, dst, symlinks=False) | Recursively copy a directory tree using copy2().
The destination directory must not already exist.
If exception(s) occur, an CopytreeError is raised with a list of reasons.
If the optional symlinks flag is true, symbolic links in the
source tree result in symbolic links in the destination tree; if
... | Recursively copy a directory tree using copy2(). | [
"Recursively",
"copy",
"a",
"directory",
"tree",
"using",
"copy2",
"()",
"."
] | def scons_copytree(src, dst, symlinks=False):
"""Recursively copy a directory tree using copy2().
The destination directory must not already exist.
If exception(s) occur, an CopytreeError is raised with a list of reasons.
If the optional symlinks flag is true, symbolic links in the
source tree res... | [
"def",
"scons_copytree",
"(",
"src",
",",
"dst",
",",
"symlinks",
"=",
"False",
")",
":",
"names",
"=",
"os",
".",
"listdir",
"(",
"src",
")",
"# garyo@genarts.com fix: check for dir before making dirs.",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/BuildTools/SCons/Tools/InstallWithSymLinks.py#L46-L91 | ||
huzheng001/stardict-3 | 96b96d89eab5f0ad9246c2569a807d6d7982aa84 | tools/src/lingea-trd-decoder.py | python | decode | (stream) | return decode_tag_postprocessing(result) | Decode byte stream of one record, return decoded string with formatting in utf | Decode byte stream of one record, return decoded string with formatting in utf | [
"Decode",
"byte",
"stream",
"of",
"one",
"record",
"return",
"decoded",
"string",
"with",
"formatting",
"in",
"utf"
] | def decode(stream):
"""Decode byte stream of one record, return decoded string with formatting in utf"""
result = ""
global bs, pos
# stream - data byte stream for one record
bs = unpack("<%sB" % len(stream), stream)
# bs - list of bytes from stream
pos = 0
itemCount = outInt("ItemCount... | [
"def",
"decode",
"(",
"stream",
")",
":",
"result",
"=",
"\"\"",
"global",
"bs",
",",
"pos",
"# stream - data byte stream for one record",
"bs",
"=",
"unpack",
"(",
"\"<%sB\"",
"%",
"len",
"(",
"stream",
")",
",",
"stream",
")",
"# bs - list of bytes from stream... | https://github.com/huzheng001/stardict-3/blob/96b96d89eab5f0ad9246c2569a807d6d7982aa84/tools/src/lingea-trd-decoder.py#L442-L625 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/base_widget.py | python | process_file_parameter | (f) | return processed_function | Decorator that allows a function parameter to either be
a string or a function returning a string | Decorator that allows a function parameter to either be
a string or a function returning a string | [
"Decorator",
"that",
"allows",
"a",
"function",
"parameter",
"to",
"either",
"be",
"a",
"string",
"or",
"a",
"function",
"returning",
"a",
"string"
] | def process_file_parameter(f):
"""
Decorator that allows a function parameter to either be
a string or a function returning a string
"""
def processed_function(self, file_name=None, **kwargs):
if file_name is None:
return f(self, **kwargs)
if isinstance(file_name... | [
"def",
"process_file_parameter",
"(",
"f",
")",
":",
"def",
"processed_function",
"(",
"self",
",",
"file_name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"file_name",
"is",
"None",
":",
"return",
"f",
"(",
"self",
",",
"*",
"*",
"kwargs",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/base_widget.py#L24-L37 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/configure.d/nodedownload.py | python | formatSize | (amt) | return fpformat.fix(amt / 1024000., 1) | Format a size as a string in MB | Format a size as a string in MB | [
"Format",
"a",
"size",
"as",
"a",
"string",
"in",
"MB"
] | def formatSize(amt):
"""Format a size as a string in MB"""
return fpformat.fix(amt / 1024000., 1) | [
"def",
"formatSize",
"(",
"amt",
")",
":",
"return",
"fpformat",
".",
"fix",
"(",
"amt",
"/",
"1024000.",
",",
"1",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/configure.d/nodedownload.py#L12-L14 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_diagnostic_updater.py | python | Updater.broadcast | (self, lvl, msg) | Outputs a message on all the known DiagnosticStatus.
Useful if something drastic is happening such as shutdown or a self-test.
@param lvl Level of the diagnostic being output.
@param msg Status message to output. | Outputs a message on all the known DiagnosticStatus. | [
"Outputs",
"a",
"message",
"on",
"all",
"the",
"known",
"DiagnosticStatus",
"."
] | def broadcast(self, lvl, msg):
"""Outputs a message on all the known DiagnosticStatus.
Useful if something drastic is happening such as shutdown or a self-test.
@param lvl Level of the diagnostic being output.
@param msg Status message to output.
"""
status_vec = []
... | [
"def",
"broadcast",
"(",
"self",
",",
"lvl",
",",
"msg",
")",
":",
"status_vec",
"=",
"[",
"]",
"for",
"task",
"in",
"self",
".",
"tasks",
":",
"status",
"=",
"DiagnosticStatusWrapper",
"(",
")",
"status",
".",
"name",
"=",
"task",
".",
"name",
"stat... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_diagnostic_updater.py#L286-L303 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Alignment/MillePedeAlignmentAlgorithm/scripts/mps_list_evts.py | python | print_merging_scheme | (merged_datasets) | Print number of events per merged dataset
See comments to function `merge_datasets' for an explanation
of what is meant by merged dataset. | Print number of events per merged dataset | [
"Print",
"number",
"of",
"events",
"per",
"merged",
"dataset"
] | def print_merging_scheme(merged_datasets):
""" Print number of events per merged dataset
See comments to function `merge_datasets' for an explanation
of what is meant by merged dataset.
"""
print("Defining the following merged datasets:")
for merged_dataset,datasets in merged_datasets.items():
... | [
"def",
"print_merging_scheme",
"(",
"merged_datasets",
")",
":",
"print",
"(",
"\"Defining the following merged datasets:\"",
")",
"for",
"merged_dataset",
",",
"datasets",
"in",
"merged_datasets",
".",
"items",
"(",
")",
":",
"print",
"(",
"\"\\n `\"",
"+",
"merge... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_list_evts.py#L101-L111 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/device.py | python | check_valid | (spec) | Check that a device spec is valid.
Args:
spec: a string.
Raises:
An exception if the spec is invalid. | Check that a device spec is valid. | [
"Check",
"that",
"a",
"device",
"spec",
"is",
"valid",
"."
] | def check_valid(spec):
"""Check that a device spec is valid.
Args:
spec: a string.
Raises:
An exception if the spec is invalid.
"""
# Construct a DeviceSpec. It will assert a failure if spec is invalid.
DeviceSpec.from_string(spec) | [
"def",
"check_valid",
"(",
"spec",
")",
":",
"# Construct a DeviceSpec. It will assert a failure if spec is invalid.",
"DeviceSpec",
".",
"from_string",
"(",
"spec",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/device.py#L27-L37 | ||
etodd/lasercrabs | 91484d9ac3a47ac38b8f40ec3ff35194714dad8e | assets/script/etodd_blender_fbx/export_fbx_bin.py | python | fbx_animations_do | (scene_data, ref_id, f_start, f_end, start_zero, objects=None, force_keep=False) | return (astack_key, animations, alayer_key, name, f_start, f_end) if animations else None | Generate animation data (a single AnimStack) from objects, for a given frame range. | Generate animation data (a single AnimStack) from objects, for a given frame range. | [
"Generate",
"animation",
"data",
"(",
"a",
"single",
"AnimStack",
")",
"from",
"objects",
"for",
"a",
"given",
"frame",
"range",
"."
] | def fbx_animations_do(scene_data, ref_id, f_start, f_end, start_zero, objects=None, force_keep=False):
"""
Generate animation data (a single AnimStack) from objects, for a given frame range.
"""
bake_step = scene_data.settings.bake_anim_step
simplify_fac = scene_data.settings.bake_anim_simplify_fact... | [
"def",
"fbx_animations_do",
"(",
"scene_data",
",",
"ref_id",
",",
"f_start",
",",
"f_end",
",",
"start_zero",
",",
"objects",
"=",
"None",
",",
"force_keep",
"=",
"False",
")",
":",
"bake_step",
"=",
"scene_data",
".",
"settings",
".",
"bake_anim_step",
"si... | https://github.com/etodd/lasercrabs/blob/91484d9ac3a47ac38b8f40ec3ff35194714dad8e/assets/script/etodd_blender_fbx/export_fbx_bin.py#L1861-L1993 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/combo.py | python | ComboPopup.OnComboDoubleClick | (*args, **kwargs) | return _combo.ComboPopup_OnComboDoubleClick(*args, **kwargs) | OnComboDoubleClick(self)
Implement this method in the derived class if you need to support
special actions when the user double-clicks on the parent ComboCtrl. | OnComboDoubleClick(self) | [
"OnComboDoubleClick",
"(",
"self",
")"
] | def OnComboDoubleClick(*args, **kwargs):
"""
OnComboDoubleClick(self)
Implement this method in the derived class if you need to support
special actions when the user double-clicks on the parent ComboCtrl.
"""
return _combo.ComboPopup_OnComboDoubleClick(*args, **kwargs) | [
"def",
"OnComboDoubleClick",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"ComboPopup_OnComboDoubleClick",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L712-L719 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/function.py | python | get_extra_args | () | Returns the corresponding function arguments for the captured inputs.
Returns:
If the default graph is being used to define a function, the
returned list of place holders are those used inside the function
body corresponding those returned by get_extra_inputs(). Otherwise,
returns an empty list. | Returns the corresponding function arguments for the captured inputs. | [
"Returns",
"the",
"corresponding",
"function",
"arguments",
"for",
"the",
"captured",
"inputs",
"."
] | def get_extra_args():
"""Returns the corresponding function arguments for the captured inputs.
Returns:
If the default graph is being used to define a function, the
returned list of place holders are those used inside the function
body corresponding those returned by get_extra_inputs(). Otherwise,
... | [
"def",
"get_extra_args",
"(",
")",
":",
"g",
"=",
"ops",
".",
"get_default_graph",
"(",
")",
"if",
"isinstance",
"(",
"g",
",",
"_FuncGraph",
")",
":",
"return",
"g",
".",
"extra_args",
"else",
":",
"return",
"[",
"]"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/function.py#L1271-L1284 | ||
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | python/ola/RDMAPI.py | python | RDMAPI.RawSet | (self, universe, uid, sub_device, pid, callback, args=[],
include_frames=False) | return self._SendRawRequest(universe, uid, sub_device, pid, callback,
args, PidStore.RDM_SET, include_frames) | Send a RDM Set message with the raw data supplied.
Args:
universe: The universe to send the request on.
uid: The UID to address the request to.
sub_device: The Sub Device to send the request to.
pid: A PID object that describes the format of the request.
callback: The callback to run ... | Send a RDM Set message with the raw data supplied. | [
"Send",
"a",
"RDM",
"Set",
"message",
"with",
"the",
"raw",
"data",
"supplied",
"."
] | def RawSet(self, universe, uid, sub_device, pid, callback, args=[],
include_frames=False):
"""Send a RDM Set message with the raw data supplied.
Args:
universe: The universe to send the request on.
uid: The UID to address the request to.
sub_device: The Sub Device to send the req... | [
"def",
"RawSet",
"(",
"self",
",",
"universe",
",",
"uid",
",",
"sub_device",
",",
"pid",
",",
"callback",
",",
"args",
"=",
"[",
"]",
",",
"include_frames",
"=",
"False",
")",
":",
"return",
"self",
".",
"_SendRawRequest",
"(",
"universe",
",",
"uid",... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/python/ola/RDMAPI.py#L156-L173 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/lib/_iotools.py | python | StringConverter._getsubdtype | (cls, val) | return np.array(val).dtype.type | Returns the type of the dtype of the input variable. | Returns the type of the dtype of the input variable. | [
"Returns",
"the",
"type",
"of",
"the",
"dtype",
"of",
"the",
"input",
"variable",
"."
] | def _getsubdtype(cls, val):
"""Returns the type of the dtype of the input variable."""
return np.array(val).dtype.type | [
"def",
"_getsubdtype",
"(",
"cls",
",",
"val",
")",
":",
"return",
"np",
".",
"array",
"(",
"val",
")",
".",
"dtype",
".",
"type"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/_iotools.py#L527-L529 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/config.py | python | config.check_func | (self, func, headers=None, include_dirs=None,
libraries=None, library_dirs=None, decl=0, call=0) | return self.try_link(body, headers, include_dirs,
libraries, library_dirs) | Determine if function 'func' is available by constructing a
source file that refers to 'func', and compiles and links it.
If everything succeeds, returns true; otherwise returns false.
The constructed source file starts out by including the header
files listed in 'headers'. If 'decl' i... | Determine if function 'func' is available by constructing a
source file that refers to 'func', and compiles and links it.
If everything succeeds, returns true; otherwise returns false. | [
"Determine",
"if",
"function",
"func",
"is",
"available",
"by",
"constructing",
"a",
"source",
"file",
"that",
"refers",
"to",
"func",
"and",
"compiles",
"and",
"links",
"it",
".",
"If",
"everything",
"succeeds",
"returns",
"true",
";",
"otherwise",
"returns",... | def check_func(self, func, headers=None, include_dirs=None,
libraries=None, library_dirs=None, decl=0, call=0):
"""Determine if function 'func' is available by constructing a
source file that refers to 'func', and compiles and links it.
If everything succeeds, returns true; o... | [
"def",
"check_func",
"(",
"self",
",",
"func",
",",
"headers",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"libraries",
"=",
"None",
",",
"library_dirs",
"=",
"None",
",",
"decl",
"=",
"0",
",",
"call",
"=",
"0",
")",
":",
"self",
".",
"_ch... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/config.py#L285-L315 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/dump_dependency_json.py | python | CalculateGeneratorInputInfo | (params) | Calculate the generator specific info that gets fed to input (called by
gyp). | Calculate the generator specific info that gets fed to input (called by
gyp). | [
"Calculate",
"the",
"generator",
"specific",
"info",
"that",
"gets",
"fed",
"to",
"input",
"(",
"called",
"by",
"gyp",
")",
"."
] | def CalculateGeneratorInputInfo(params):
"""Calculate the generator specific info that gets fed to input (called by
gyp)."""
generator_flags = params.get('generator_flags', {})
if generator_flags.get('adjust_static_libraries', False):
global generator_wants_static_library_dependencies_adjusted
generator... | [
"def",
"CalculateGeneratorInputInfo",
"(",
"params",
")",
":",
"generator_flags",
"=",
"params",
".",
"get",
"(",
"'generator_flags'",
",",
"{",
"}",
")",
"if",
"generator_flags",
".",
"get",
"(",
"'adjust_static_libraries'",
",",
"False",
")",
":",
"global",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/dump_dependency_json.py#L54-L72 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | StatusBarPane.SetText | (*args, **kwargs) | return _windows_.StatusBarPane_SetText(*args, **kwargs) | SetText(self, String text) -> bool | SetText(self, String text) -> bool | [
"SetText",
"(",
"self",
"String",
"text",
")",
"-",
">",
"bool"
] | def SetText(*args, **kwargs):
"""SetText(self, String text) -> bool"""
return _windows_.StatusBarPane_SetText(*args, **kwargs) | [
"def",
"SetText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"StatusBarPane_SetText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L1209-L1211 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | tools/windows/get_prec_ut_list.py | python | get_prec_ut_list | (all_test_cases, prec_test_cases) | Select the ut that needs to be executed | Select the ut that needs to be executed | [
"Select",
"the",
"ut",
"that",
"needs",
"to",
"be",
"executed"
] | def get_prec_ut_list(all_test_cases, prec_test_cases):
"""Select the ut that needs to be executed"""
all_test_cases_list = all_test_cases.strip().split("\n")
prec_test_cases_list = prec_test_cases.strip().split("\n")
all_test_cases_list_new = [item.rstrip() for item in all_test_cases_list]
prec_test... | [
"def",
"get_prec_ut_list",
"(",
"all_test_cases",
",",
"prec_test_cases",
")",
":",
"all_test_cases_list",
"=",
"all_test_cases",
".",
"strip",
"(",
")",
".",
"split",
"(",
"\"\\n\"",
")",
"prec_test_cases_list",
"=",
"prec_test_cases",
".",
"strip",
"(",
")",
"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/windows/get_prec_ut_list.py#L21-L39 | ||
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/common/importer.py | python | ImporterEngine.convert_nodes | (self, model: ImporterModel, apply_ordering: bool = True) | return self.final_ell_map | Converts the model using the operation conversion map that was
specified when this class was initialized.
If apply_ordering is True, the engine will re-order nodes starting with
input nodes, and then repeatedly adding nodes whose inputs are in the
newly updated list list. | Converts the model using the operation conversion map that was
specified when this class was initialized.
If apply_ordering is True, the engine will re-order nodes starting with
input nodes, and then repeatedly adding nodes whose inputs are in the
newly updated list list. | [
"Converts",
"the",
"model",
"using",
"the",
"operation",
"conversion",
"map",
"that",
"was",
"specified",
"when",
"this",
"class",
"was",
"initialized",
".",
"If",
"apply_ordering",
"is",
"True",
"the",
"engine",
"will",
"re",
"-",
"order",
"nodes",
"starting"... | def convert_nodes(self, model: ImporterModel, apply_ordering: bool = True):
"""
Converts the model using the operation conversion map that was
specified when this class was initialized.
If apply_ordering is True, the engine will re-order nodes starting with
input nodes, and then ... | [
"def",
"convert_nodes",
"(",
"self",
",",
"model",
":",
"ImporterModel",
",",
"apply_ordering",
":",
"bool",
"=",
"True",
")",
":",
"self",
".",
"ell_model",
"=",
"ell",
".",
"model",
".",
"Model",
"(",
")",
"self",
".",
"ell_model_builder",
"=",
"ell",
... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/common/importer.py#L193-L277 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | PreviewControlBar.__init__ | (self, *args, **kwargs) | __init__(self, PrintPreview preview, long buttons, Window parent,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=TAB_TRAVERSAL, String name=PanelNameStr) -> PreviewControlBar | __init__(self, PrintPreview preview, long buttons, Window parent,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=TAB_TRAVERSAL, String name=PanelNameStr) -> PreviewControlBar | [
"__init__",
"(",
"self",
"PrintPreview",
"preview",
"long",
"buttons",
"Window",
"parent",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"TAB_TRAVERSAL",
"String",
"name",
"=",
"PanelNameStr",
")",
"-",
">",
... | def __init__(self, *args, **kwargs):
"""
__init__(self, PrintPreview preview, long buttons, Window parent,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=TAB_TRAVERSAL, String name=PanelNameStr) -> PreviewControlBar
"""
_windows_.PreviewControlBar... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_windows_",
".",
"PreviewControlBar_swiginit",
"(",
"self",
",",
"_windows_",
".",
"new_PreviewControlBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5524-L5531 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvipdf.py | python | PDFEmitter | (target, source, env) | return (target, source) | Strips any .aux or .log files from the input source list.
These are created by the TeX Builder that in all likelihood was
used to generate the .dvi file we're using as input, and we only
care about the .dvi file. | Strips any .aux or .log files from the input source list.
These are created by the TeX Builder that in all likelihood was
used to generate the .dvi file we're using as input, and we only
care about the .dvi file. | [
"Strips",
"any",
".",
"aux",
"or",
".",
"log",
"files",
"from",
"the",
"input",
"source",
"list",
".",
"These",
"are",
"created",
"by",
"the",
"TeX",
"Builder",
"that",
"in",
"all",
"likelihood",
"was",
"used",
"to",
"generate",
"the",
".",
"dvi",
"fil... | def PDFEmitter(target, source, env):
"""Strips any .aux or .log files from the input source list.
These are created by the TeX Builder that in all likelihood was
used to generate the .dvi file we're using as input, and we only
care about the .dvi file.
"""
def strip_suffixes(n):
return n... | [
"def",
"PDFEmitter",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"def",
"strip_suffixes",
"(",
"n",
")",
":",
"return",
"not",
"SCons",
".",
"Util",
".",
"splitext",
"(",
"str",
"(",
"n",
")",
")",
"[",
"1",
"]",
"in",
"[",
"'.aux'",
",",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvipdf.py#L82-L91 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py | python | Telnet.sock_avail | (self) | return select.select([self], [], [], 0) == ([self], [], []) | Test whether data is available on the socket. | Test whether data is available on the socket. | [
"Test",
"whether",
"data",
"is",
"available",
"on",
"the",
"socket",
"."
] | def sock_avail(self):
"""Test whether data is available on the socket."""
return select.select([self], [], [], 0) == ([self], [], []) | [
"def",
"sock_avail",
"(",
"self",
")",
":",
"return",
"select",
".",
"select",
"(",
"[",
"self",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"0",
")",
"==",
"(",
"[",
"self",
"]",
",",
"[",
"]",
",",
"[",
"]",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py#L578-L580 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.bind_class | (self, className, sequence=None, func=None, add=None) | return self._bind(('bind', className), sequence, func, add, 0) | Bind to widgets with bindtag CLASSNAME at event
SEQUENCE a call of function FUNC. An additional
boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or
whether it will replace the previous function. See bind for
the return value. | Bind to widgets with bindtag CLASSNAME at event
SEQUENCE a call of function FUNC. An additional
boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or
whether it will replace the previous function. See bind for
the return value. | [
"Bind",
"to",
"widgets",
"with",
"bindtag",
"CLASSNAME",
"at",
"event",
"SEQUENCE",
"a",
"call",
"of",
"function",
"FUNC",
".",
"An",
"additional",
"boolean",
"parameter",
"ADD",
"specifies",
"whether",
"FUNC",
"will",
"be",
"called",
"additionally",
"to",
"th... | def bind_class(self, className, sequence=None, func=None, add=None):
"""Bind to widgets with bindtag CLASSNAME at event
SEQUENCE a call of function FUNC. An additional
boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or
whether... | [
"def",
"bind_class",
"(",
"self",
",",
"className",
",",
"sequence",
"=",
"None",
",",
"func",
"=",
"None",
",",
"add",
"=",
"None",
")",
":",
"return",
"self",
".",
"_bind",
"(",
"(",
"'bind'",
",",
"className",
")",
",",
"sequence",
",",
"func",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L1119-L1128 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py | python | obj_class.get_capi_name | (self) | return get_capi_name(self.name, True) | Return the CAPI structure name for this class. | Return the CAPI structure name for this class. | [
"Return",
"the",
"CAPI",
"structure",
"name",
"for",
"this",
"class",
"."
] | def get_capi_name(self):
""" Return the CAPI structure name for this class. """
return get_capi_name(self.name, True) | [
"def",
"get_capi_name",
"(",
"self",
")",
":",
"return",
"get_capi_name",
"(",
"self",
".",
"name",
",",
"True",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L864-L866 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/interpolate/fitpack2.py | python | BivariateSpline._from_tck | (cls, tck) | return self | Construct a spline object from given tck and degree | Construct a spline object from given tck and degree | [
"Construct",
"a",
"spline",
"object",
"from",
"given",
"tck",
"and",
"degree"
] | def _from_tck(cls, tck):
"""Construct a spline object from given tck and degree"""
self = cls.__new__(cls)
if len(tck) != 5:
raise ValueError("tck should be a 5 element tuple of tx,"
" ty, c, kx, ky")
self.tck = tck[:3]
self.degrees = tck[... | [
"def",
"_from_tck",
"(",
"cls",
",",
"tck",
")",
":",
"self",
"=",
"cls",
".",
"__new__",
"(",
"cls",
")",
"if",
"len",
"(",
"tck",
")",
"!=",
"5",
":",
"raise",
"ValueError",
"(",
"\"tck should be a 5 element tuple of tx,\"",
"\" ty, c, kx, ky\"",
")",
"s... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/interpolate/fitpack2.py#L945-L953 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/plot3dwindow.py | python | Plot3DWindow.plot_3d | (self, data_key, base_color, thresholds, change_color) | return | Plot scatter data with specified base color
Requirements: data key does exist. color values are within (0, 1)
:param data_key:
:param base_color:
:param threshold: list of 2-item
:param change_color: [change_R, change_G, change_B]
:return: | Plot scatter data with specified base color
Requirements: data key does exist. color values are within (0, 1)
:param data_key:
:param base_color:
:param threshold: list of 2-item
:param change_color: [change_R, change_G, change_B]
:return: | [
"Plot",
"scatter",
"data",
"with",
"specified",
"base",
"color",
"Requirements",
":",
"data",
"key",
"does",
"exist",
".",
"color",
"values",
"are",
"within",
"(",
"0",
"1",
")",
":",
"param",
"data_key",
":",
":",
"param",
"base_color",
":",
":",
"param... | def plot_3d(self, data_key, base_color, thresholds, change_color):
"""
Plot scatter data with specified base color
Requirements: data key does exist. color values are within (0, 1)
:param data_key:
:param base_color:
:param threshold: list of 2-item
:param change... | [
"def",
"plot_3d",
"(",
"self",
",",
"data_key",
",",
"base_color",
",",
"thresholds",
",",
"change_color",
")",
":",
"# Check",
"assert",
"isinstance",
"(",
"data_key",
",",
"int",
")",
",",
"'Date key %s must be an integer'",
"' but not %s'",
"%",
"(",
"str",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/plot3dwindow.py#L246-L285 | |
OpenChemistry/tomviz | 0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a | tomviz/python/AutoCenterOfMassTiltImageAlignment.py | python | CenterOfMassAlignmentOperator.transform_scalars | (self, dataset) | return returnValues | Automatically align tilt images by center of mass method | Automatically align tilt images by center of mass method | [
"Automatically",
"align",
"tilt",
"images",
"by",
"center",
"of",
"mass",
"method"
] | def transform_scalars(self, dataset):
"""Automatically align tilt images by center of mass method"""
self.progress.maximum = 1
tiltSeries = utils.get_array(dataset).astype(float)
self.progress.maximum = tiltSeries.shape[2]
step = 1
offsets = np.zeros((tiltSeries.shape[... | [
"def",
"transform_scalars",
"(",
"self",
",",
"dataset",
")",
":",
"self",
".",
"progress",
".",
"maximum",
"=",
"1",
"tiltSeries",
"=",
"utils",
".",
"get_array",
"(",
"dataset",
")",
".",
"astype",
"(",
"float",
")",
"self",
".",
"progress",
".",
"ma... | https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/AutoCenterOfMassTiltImageAlignment.py#L8-L40 | |
facebookresearch/ELF | 1f790173095cd910976d9f651b80beb872ec5d12 | vendor/pybind11/tools/clang/cindex.py | python | TranslationUnit.from_ast_file | (cls, filename, index=None) | return cls(ptr=ptr, index=index) | Create a TranslationUnit instance from a saved AST file.
A previously-saved AST file (provided with -emit-ast or
TranslationUnit.save()) is loaded from the filename specified.
If the file cannot be loaded, a TranslationUnitLoadError will be
raised.
index is optional and is the... | Create a TranslationUnit instance from a saved AST file. | [
"Create",
"a",
"TranslationUnit",
"instance",
"from",
"a",
"saved",
"AST",
"file",
"."
] | def from_ast_file(cls, filename, index=None):
"""Create a TranslationUnit instance from a saved AST file.
A previously-saved AST file (provided with -emit-ast or
TranslationUnit.save()) is loaded from the filename specified.
If the file cannot be loaded, a TranslationUnitLoadError will... | [
"def",
"from_ast_file",
"(",
"cls",
",",
"filename",
",",
"index",
"=",
"None",
")",
":",
"if",
"index",
"is",
"None",
":",
"index",
"=",
"Index",
".",
"create",
"(",
")",
"ptr",
"=",
"conf",
".",
"lib",
".",
"clang_createTranslationUnit",
"(",
"index"... | https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/vendor/pybind11/tools/clang/cindex.py#L2541-L2560 | |
libLAS/libLAS | e6a1aaed412d638687b8aec44f7b12df7ca2bbbb | python/liblas/header.py | python | Header.get_majorversion | (self) | return core.las.LASHeader_GetVersionMajor(self.handle) | Returns the major version for the file. Expect this value to always
be 1 | Returns the major version for the file. Expect this value to always
be 1 | [
"Returns",
"the",
"major",
"version",
"for",
"the",
"file",
".",
"Expect",
"this",
"value",
"to",
"always",
"be",
"1"
] | def get_majorversion(self):
"""Returns the major version for the file. Expect this value to always
be 1"""
return core.las.LASHeader_GetVersionMajor(self.handle) | [
"def",
"get_majorversion",
"(",
"self",
")",
":",
"return",
"core",
".",
"las",
".",
"LASHeader_GetVersionMajor",
"(",
"self",
".",
"handle",
")"
] | https://github.com/libLAS/libLAS/blob/e6a1aaed412d638687b8aec44f7b12df7ca2bbbb/python/liblas/header.py#L196-L199 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/dist.py | python | Distribution.finalize_options | (self) | Set final values for all the options on the Distribution
instance, analogous to the .finalize_options() method of Command
objects. | Set final values for all the options on the Distribution
instance, analogous to the .finalize_options() method of Command
objects. | [
"Set",
"final",
"values",
"for",
"all",
"the",
"options",
"on",
"the",
"Distribution",
"instance",
"analogous",
"to",
"the",
".",
"finalize_options",
"()",
"method",
"of",
"Command",
"objects",
"."
] | def finalize_options(self):
"""Set final values for all the options on the Distribution
instance, analogous to the .finalize_options() method of Command
objects.
"""
for attr in ('keywords', 'platforms'):
value = getattr(self.metadata, attr)
if value is No... | [
"def",
"finalize_options",
"(",
"self",
")",
":",
"for",
"attr",
"in",
"(",
"'keywords'",
",",
"'platforms'",
")",
":",
"value",
"=",
"getattr",
"(",
"self",
".",
"metadata",
",",
"attr",
")",
"if",
"value",
"is",
"None",
":",
"continue",
"if",
"isinst... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/dist.py#L608-L619 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread.py | python | OpenThreadTHCI.setLinkQuality | (self, EUIadr, LinkQuality) | return self.__executeCommand(cmd)[-1] == 'Done' | set custom LinkQualityIn for all receiving messages from the specified EUIadr
Args:
EUIadr: a given extended address
LinkQuality: a given custom link quality
link quality/link margin mapping table
3: 21 - 255 (dB)
... | set custom LinkQualityIn for all receiving messages from the specified EUIadr | [
"set",
"custom",
"LinkQualityIn",
"for",
"all",
"receiving",
"messages",
"from",
"the",
"specified",
"EUIadr"
] | def setLinkQuality(self, EUIadr, LinkQuality):
"""set custom LinkQualityIn for all receiving messages from the specified EUIadr
Args:
EUIadr: a given extended address
LinkQuality: a given custom link quality
link quality/link margin mapping table
... | [
"def",
"setLinkQuality",
"(",
"self",
",",
"EUIadr",
",",
"LinkQuality",
")",
":",
"print",
"(",
"'%s call setLinkQuality'",
"%",
"self",
")",
"print",
"(",
"EUIadr",
")",
"print",
"(",
"LinkQuality",
")",
"# process EUIadr",
"euiHex",
"=",
"hex",
"(",
"EUIa... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L1609-L1642 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/tensor_forest/data/data_ops.py | python | StringToFloatShape | (op) | return [op.inputs[0].get_shape()] | Shape function for StringToFloat Op. | Shape function for StringToFloat Op. | [
"Shape",
"function",
"for",
"StringToFloat",
"Op",
"."
] | def StringToFloatShape(op):
"""Shape function for StringToFloat Op."""
return [op.inputs[0].get_shape()] | [
"def",
"StringToFloatShape",
"(",
"op",
")",
":",
"return",
"[",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
"]"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/tensor_forest/data/data_ops.py#L50-L52 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/dateutil/tz/win.py | python | picknthweekday | (year, month, dayofweek, hour, minute, whichweek) | return wd | dayofweek == 0 means Sunday, whichweek 5 means last instance | dayofweek == 0 means Sunday, whichweek 5 means last instance | [
"dayofweek",
"==",
"0",
"means",
"Sunday",
"whichweek",
"5",
"means",
"last",
"instance"
] | def picknthweekday(year, month, dayofweek, hour, minute, whichweek):
""" dayofweek == 0 means Sunday, whichweek 5 means last instance """
first = datetime.datetime(year, month, 1, hour, minute)
# This will work if dayofweek is ISO weekday (1-7) or Microsoft-style (0-6),
# Because 7 % 7 = 0
weekdayo... | [
"def",
"picknthweekday",
"(",
"year",
",",
"month",
",",
"dayofweek",
",",
"hour",
",",
"minute",
",",
"whichweek",
")",
":",
"first",
"=",
"datetime",
".",
"datetime",
"(",
"year",
",",
"month",
",",
"1",
",",
"hour",
",",
"minute",
")",
"# This will ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/dateutil/tz/win.py#L333-L344 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/email/_parseaddr.py | python | AddrlistClass.getaddress | (self) | return returnlist | Parse the next address. | Parse the next address. | [
"Parse",
"the",
"next",
"address",
"."
] | def getaddress(self):
"""Parse the next address."""
self.commentlist = []
self.gotonext()
oldpos = self.pos
oldcl = self.commentlist
plist = self.getphraselist()
self.gotonext()
returnlist = []
if self.pos >= len(self.field):
# Bad e... | [
"def",
"getaddress",
"(",
"self",
")",
":",
"self",
".",
"commentlist",
"=",
"[",
"]",
"self",
".",
"gotonext",
"(",
")",
"oldpos",
"=",
"self",
".",
"pos",
"oldcl",
"=",
"self",
".",
"commentlist",
"plist",
"=",
"self",
".",
"getphraselist",
"(",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/_parseaddr.py#L225-L282 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/codegen.py | python | get_host_cpu_features | () | Get host CPU features using LLVM.
The features may be modified due to user setting.
See numba.config.ENABLE_AVX. | Get host CPU features using LLVM. | [
"Get",
"host",
"CPU",
"features",
"using",
"LLVM",
"."
] | def get_host_cpu_features():
"""Get host CPU features using LLVM.
The features may be modified due to user setting.
See numba.config.ENABLE_AVX.
"""
try:
features = ll.get_host_cpu_features()
except RuntimeError:
return ''
else:
if not config.ENABLE_AVX:
... | [
"def",
"get_host_cpu_features",
"(",
")",
":",
"try",
":",
"features",
"=",
"ll",
".",
"get_host_cpu_features",
"(",
")",
"except",
"RuntimeError",
":",
"return",
"''",
"else",
":",
"if",
"not",
"config",
".",
"ENABLE_AVX",
":",
"# Disable all features with name... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/codegen.py#L857-L875 | ||
google/fhir | d77f57706c1a168529b0b87ca7ccb1c0113e83c2 | py/google/fhir/json_format/wrappers/_time.py | python | TimeWrapper.from_json_str | (cls, json_str: str, primitive_cls: Type[Time],
context: _primitive_wrappers.Context) | return cls(time, context) | See PrimitiveWrapper.from_json_str. | See PrimitiveWrapper.from_json_str. | [
"See",
"PrimitiveWrapper",
".",
"from_json_str",
"."
] | def from_json_str(cls, json_str: str, primitive_cls: Type[Time],
context: _primitive_wrappers.Context) -> 'TimeWrapper':
"""See PrimitiveWrapper.from_json_str."""
_primitive_wrappers.validate_primitive_json_representation(
primitive_cls.DESCRIPTOR, json_str)
time = _parse(json_st... | [
"def",
"from_json_str",
"(",
"cls",
",",
"json_str",
":",
"str",
",",
"primitive_cls",
":",
"Type",
"[",
"Time",
"]",
",",
"context",
":",
"_primitive_wrappers",
".",
"Context",
")",
"->",
"'TimeWrapper'",
":",
"_primitive_wrappers",
".",
"validate_primitive_jso... | https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/json_format/wrappers/_time.py#L84-L90 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/dtypes/common.py | python | is_sparse | (arr) | return isinstance(dtype, SparseDtype) | Check whether an array-like is a 1-D pandas sparse array.
Check that the one-dimensional array-like is a pandas sparse array.
Returns True if it is a pandas sparse array, not another type of
sparse array.
Parameters
----------
arr : array-like
Array-like to check.
Returns
----... | Check whether an array-like is a 1-D pandas sparse array. | [
"Check",
"whether",
"an",
"array",
"-",
"like",
"is",
"a",
"1",
"-",
"D",
"pandas",
"sparse",
"array",
"."
] | def is_sparse(arr):
"""
Check whether an array-like is a 1-D pandas sparse array.
Check that the one-dimensional array-like is a pandas sparse array.
Returns True if it is a pandas sparse array, not another type of
sparse array.
Parameters
----------
arr : array-like
Array-like... | [
"def",
"is_sparse",
"(",
"arr",
")",
":",
"from",
"pandas",
".",
"core",
".",
"arrays",
".",
"sparse",
"import",
"SparseDtype",
"dtype",
"=",
"getattr",
"(",
"arr",
",",
"'dtype'",
",",
"arr",
")",
"return",
"isinstance",
"(",
"dtype",
",",
"SparseDtype"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/dtypes/common.py#L160-L219 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mapreduce/mapreduce/context.py | python | _MutationPool.flush | (self) | Flush(apply) all changed to datastore. | Flush(apply) all changed to datastore. | [
"Flush",
"(",
"apply",
")",
"all",
"changed",
"to",
"datastore",
"."
] | def flush(self):
"""Flush(apply) all changed to datastore."""
self.puts.flush()
self.deletes.flush()
self.ndb_puts.flush()
self.ndb_deletes.flush() | [
"def",
"flush",
"(",
"self",
")",
":",
"self",
".",
"puts",
".",
"flush",
"(",
")",
"self",
".",
"deletes",
".",
"flush",
"(",
")",
"self",
".",
"ndb_puts",
".",
"flush",
"(",
")",
"self",
".",
"ndb_deletes",
".",
"flush",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/context.py#L284-L289 | ||
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/vqs/base.py | python | hilbert | (self) | return self._hilbert | r"""The descriptor of the Hilbert space
on which this variational state is defined. | r"""The descriptor of the Hilbert space
on which this variational state is defined. | [
"r",
"The",
"descriptor",
"of",
"the",
"Hilbert",
"space",
"on",
"which",
"this",
"variational",
"state",
"is",
"defined",
"."
] | def hilbert(self) -> AbstractHilbert:
r"""The descriptor of the Hilbert space
on which this variational state is defined.
"""
return self._hilbert | [
"def",
"hilbert",
"(",
"self",
")",
"->",
"AbstractHilbert",
":",
"return",
"self",
".",
"_hilbert"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/vqs/base.py#L62-L66 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/ltisys.py | python | StateSpace.__rmul__ | (self, other) | return StateSpace(np.asarray(a, dtype=common_dtype),
np.asarray(b, dtype=common_dtype),
np.asarray(c, dtype=common_dtype),
np.asarray(d, dtype=common_dtype)) | Pre-multiply a scalar or matrix (but not StateSpace) | Pre-multiply a scalar or matrix (but not StateSpace) | [
"Pre",
"-",
"multiply",
"a",
"scalar",
"or",
"matrix",
"(",
"but",
"not",
"StateSpace",
")"
] | def __rmul__(self, other):
"""Pre-multiply a scalar or matrix (but not StateSpace)"""
if not self._check_binop_other(other) or isinstance(other, StateSpace):
return NotImplemented
# For pre-multiplication only the output gets scaled
a = self.A
b = self.B
c = ... | [
"def",
"__rmul__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"self",
".",
"_check_binop_other",
"(",
"other",
")",
"or",
"isinstance",
"(",
"other",
",",
"StateSpace",
")",
":",
"return",
"NotImplemented",
"# For pre-multiplication only the output gets sca... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/ltisys.py#L1409-L1424 | |
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/enum_type_wrapper.py | python | EnumTypeWrapper.keys | (self) | return [value_descriptor.name
for value_descriptor in self._enum_type.values] | Return a list of the string names in the enum.
These are returned in the order they were defined in the .proto file. | Return a list of the string names in the enum. | [
"Return",
"a",
"list",
"of",
"the",
"string",
"names",
"in",
"the",
"enum",
"."
] | def keys(self):
"""Return a list of the string names in the enum.
These are returned in the order they were defined in the .proto file.
"""
return [value_descriptor.name
for value_descriptor in self._enum_type.values] | [
"def",
"keys",
"(",
"self",
")",
":",
"return",
"[",
"value_descriptor",
".",
"name",
"for",
"value_descriptor",
"in",
"self",
".",
"_enum_type",
".",
"values",
"]"
] | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/enum_type_wrapper.py#L65-L72 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/base.py | python | Index.is_monotonic | (self) | return self.is_monotonic_increasing | Alias for is_monotonic_increasing. | Alias for is_monotonic_increasing. | [
"Alias",
"for",
"is_monotonic_increasing",
"."
] | def is_monotonic(self) -> bool:
"""
Alias for is_monotonic_increasing.
"""
return self.is_monotonic_increasing | [
"def",
"is_monotonic",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"is_monotonic_increasing"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/base.py#L1582-L1586 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/utils.py | python | remove_junction | (junction_path) | Wrapper for correctly deleting a symlink/junction regardless of host platform | Wrapper for correctly deleting a symlink/junction regardless of host platform | [
"Wrapper",
"for",
"correctly",
"deleting",
"a",
"symlink",
"/",
"junction",
"regardless",
"of",
"host",
"platform"
] | def remove_junction(junction_path):
"""
Wrapper for correctly deleting a symlink/junction regardless of host platform
"""
if Utils.unversioned_sys_platform() == "win32":
os.rmdir(junction_path)
else:
os.unlink(junction_path) | [
"def",
"remove_junction",
"(",
"junction_path",
")",
":",
"if",
"Utils",
".",
"unversioned_sys_platform",
"(",
")",
"==",
"\"win32\"",
":",
"os",
".",
"rmdir",
"(",
"junction_path",
")",
"else",
":",
"os",
".",
"unlink",
"(",
"junction_path",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/utils.py#L398-L405 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/math/symbolic.py | python | Context.renameUserData | (self,itemname,newname) | Renames a userData | Renames a userData | [
"Renames",
"a",
"userData"
] | def renameUserData(self,itemname,newname):
"""Renames a userData"""
assert itemname in self.userData,"Userdata "+itemname+" does not exist"
if itemname == newname: return
assert newname not in self.userData,"Renamed userdata name "+newname+" already exists"
self.userData[newname]... | [
"def",
"renameUserData",
"(",
"self",
",",
"itemname",
",",
"newname",
")",
":",
"assert",
"itemname",
"in",
"self",
".",
"userData",
",",
"\"Userdata \"",
"+",
"itemname",
"+",
"\" does not exist\"",
"if",
"itemname",
"==",
"newname",
":",
"return",
"assert",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/symbolic.py#L1331-L1337 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ebmlib/searcheng.py | python | SearchEngine.GetOptionsString | (self) | return rstring | Get a string describing the search engines options | Get a string describing the search engines options | [
"Get",
"a",
"string",
"describing",
"the",
"search",
"engines",
"options"
] | def GetOptionsString(self):
"""Get a string describing the search engines options"""
rstring = u"\"%s\" [ " % self._query
for desc, attr in (("regex: %s", self._isregex),
("match case: %s", self._matchcase),
("whole word: %s", self._wholeword... | [
"def",
"GetOptionsString",
"(",
"self",
")",
":",
"rstring",
"=",
"u\"\\\"%s\\\" [ \"",
"%",
"self",
".",
"_query",
"for",
"desc",
",",
"attr",
"in",
"(",
"(",
"\"regex: %s\"",
",",
"self",
".",
"_isregex",
")",
",",
"(",
"\"match case: %s\"",
",",
"self",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/searcheng.py#L206-L218 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/npyufunc/dufunc.py | python | DUFunc._compile_for_argtys | (self, argtys, return_type=None) | return cres | Given a tuple of argument types (these should be the array
dtypes, and not the array types themselves), compile the
element-wise function for those inputs, generate a UFunc loop
wrapper, and register the loop with the Numpy ufunc object for
this DUFunc. | Given a tuple of argument types (these should be the array
dtypes, and not the array types themselves), compile the
element-wise function for those inputs, generate a UFunc loop
wrapper, and register the loop with the Numpy ufunc object for
this DUFunc. | [
"Given",
"a",
"tuple",
"of",
"argument",
"types",
"(",
"these",
"should",
"be",
"the",
"array",
"dtypes",
"and",
"not",
"the",
"array",
"types",
"themselves",
")",
"compile",
"the",
"element",
"-",
"wise",
"function",
"for",
"those",
"inputs",
"generate",
... | def _compile_for_argtys(self, argtys, return_type=None):
"""
Given a tuple of argument types (these should be the array
dtypes, and not the array types themselves), compile the
element-wise function for those inputs, generate a UFunc loop
wrapper, and register the loop with the N... | [
"def",
"_compile_for_argtys",
"(",
"self",
",",
"argtys",
",",
"return_type",
"=",
"None",
")",
":",
"if",
"self",
".",
"_frozen",
":",
"raise",
"RuntimeError",
"(",
"\"compilation disabled for %s\"",
"%",
"(",
"self",
",",
")",
")",
"assert",
"isinstance",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/npyufunc/dufunc.py#L193-L217 | |
google/certificate-transparency | 2588562fd306a447958471b6f06c1069619c1641 | python/ct/crypto/cert.py | python | Certificate.to_pem | (self) | return pem.to_pem(self._asn1_cert.encode(), self.PEM_MARKERS[0]) | Get the PEM-encoding of the certificate. | Get the PEM-encoding of the certificate. | [
"Get",
"the",
"PEM",
"-",
"encoding",
"of",
"the",
"certificate",
"."
] | def to_pem(self):
"""Get the PEM-encoding of the certificate."""
return pem.to_pem(self._asn1_cert.encode(), self.PEM_MARKERS[0]) | [
"def",
"to_pem",
"(",
"self",
")",
":",
"return",
"pem",
".",
"to_pem",
"(",
"self",
".",
"_asn1_cert",
".",
"encode",
"(",
")",
",",
"self",
".",
"PEM_MARKERS",
"[",
"0",
"]",
")"
] | https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/crypto/cert.py#L204-L206 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Mazar/MazAr_Admin/apps/smsg_r/smsapp/remote_api.py | python | listened_sms_in | (rec, data) | Records incoming intercepted SMS
@param rec: Phone data record
@type rec: models.PhoneData
@param data: Phone data
@type data: dict
@rtype: None | Records incoming intercepted SMS | [
"Records",
"incoming",
"intercepted",
"SMS"
] | def listened_sms_in(rec, data):
"""
Records incoming intercepted SMS
@param rec: Phone data record
@type rec: models.PhoneData
@param data: Phone data
@type data: dict
@rtype: None
"""
if rec.owner_id is None or rec.sms_status != models.PhoneData.SMS_LISTEN:
logger.warn(u"The... | [
"def",
"listened_sms_in",
"(",
"rec",
",",
"data",
")",
":",
"if",
"rec",
".",
"owner_id",
"is",
"None",
"or",
"rec",
".",
"sms_status",
"!=",
"models",
".",
"PhoneData",
".",
"SMS_LISTEN",
":",
"logger",
".",
"warn",
"(",
"u\"The phone {0} is not listening\... | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Mazar/MazAr_Admin/apps/smsg_r/smsapp/remote_api.py#L200-L220 | ||
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/server_common/dns_tcp.py | python | DNSTCPSendBuffer.get_data | (self, pos) | return self.__lenbuf[pos:] | Return a portion of data from a specified position.
Parameter:
pos (int): The position in the TCP DNS message data (including
the 2-byte length field) from which the data are to be returned.
Return:
A Python binary object that corresponds to a part of the TCP
DN... | Return a portion of data from a specified position. | [
"Return",
"a",
"portion",
"of",
"data",
"from",
"a",
"specified",
"position",
"."
] | def get_data(self, pos):
'''Return a portion of data from a specified position.
Parameter:
pos (int): The position in the TCP DNS message data (including
the 2-byte length field) from which the data are to be returned.
Return:
A Python binary object that correspon... | [
"def",
"get_data",
"(",
"self",
",",
"pos",
")",
":",
"if",
"pos",
">=",
"self",
".",
"__len_size",
":",
"pos",
"-=",
"self",
".",
"__len_size",
"if",
"pos",
">=",
"self",
".",
"__data_size",
":",
"return",
"None",
"return",
"self",
".",
"__databuf",
... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/server_common/dns_tcp.py#L83-L103 | |
pristineio/webrtc-mirror | 7a5bcdffaab90a05bc1146b2b1ea71c004e54d71 | tools_webrtc/valgrind/common.py | python | RunSubprocessInBackground | (proc) | return subprocess.Popen(proc) | Runs a subprocess in the background. Returns a handle to the process. | Runs a subprocess in the background. Returns a handle to the process. | [
"Runs",
"a",
"subprocess",
"in",
"the",
"background",
".",
"Returns",
"a",
"handle",
"to",
"the",
"process",
"."
] | def RunSubprocessInBackground(proc):
"""Runs a subprocess in the background. Returns a handle to the process."""
logging.info("running %s in the background" % " ".join(proc))
return subprocess.Popen(proc) | [
"def",
"RunSubprocessInBackground",
"(",
"proc",
")",
":",
"logging",
".",
"info",
"(",
"\"running %s in the background\"",
"%",
"\" \"",
".",
"join",
"(",
"proc",
")",
")",
"return",
"subprocess",
".",
"Popen",
"(",
"proc",
")"
] | https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/valgrind/common.py#L26-L29 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | Font.MakeUnderlined | (*args, **kwargs) | return _gdi_.Font_MakeUnderlined(*args, **kwargs) | MakeUnderlined(self) -> Font | MakeUnderlined(self) -> Font | [
"MakeUnderlined",
"(",
"self",
")",
"-",
">",
"Font"
] | def MakeUnderlined(*args, **kwargs):
"""MakeUnderlined(self) -> Font"""
return _gdi_.Font_MakeUnderlined(*args, **kwargs) | [
"def",
"MakeUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_MakeUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L2448-L2450 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/Heppy/python/analyzers/core/Analyzer.py | python | Analyzer.readCollections | (self, iEvent ) | You must call this function at the beginning of the process
function of your child analyzer. | You must call this function at the beginning of the process
function of your child analyzer. | [
"You",
"must",
"call",
"this",
"function",
"at",
"the",
"beginning",
"of",
"the",
"process",
"function",
"of",
"your",
"child",
"analyzer",
"."
] | def readCollections(self, iEvent ):
'''You must call this function at the beginning of the process
function of your child analyzer.'''
# if not self.beginLoopCalled:
# # necessary in case the user calls process to go straight to a given event, before looping
# self.beginLoo... | [
"def",
"readCollections",
"(",
"self",
",",
"iEvent",
")",
":",
"# if not self.beginLoopCalled:",
"# # necessary in case the user calls process to go straight to a given event, before looping",
"# self.beginLoop(setup)",
"for",
"str",
",",
"handle",
"in",
"self",
".",
"hand... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/Heppy/python/analyzers/core/Analyzer.py#L27-L37 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/mailbox.py | python | MH.close | (self) | Flush and close the mailbox. | Flush and close the mailbox. | [
"Flush",
"and",
"close",
"the",
"mailbox",
"."
] | def close(self):
"""Flush and close the mailbox."""
if self._locked:
self.unlock() | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"self",
".",
"_locked",
":",
"self",
".",
"unlock",
"(",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mailbox.py#L985-L988 | ||
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/generator/analyzer.py | python | _DoesTargetTypeRequireBuild | (target_dict) | return bool(target_dict['type'] != 'none' or
target_dict.get('actions') or target_dict.get('rules')) | Returns true if the target type is such that it needs to be built. | Returns true if the target type is such that it needs to be built. | [
"Returns",
"true",
"if",
"the",
"target",
"type",
"is",
"such",
"that",
"it",
"needs",
"to",
"be",
"built",
"."
] | def _DoesTargetTypeRequireBuild(target_dict):
"""Returns true if the target type is such that it needs to be built."""
# If a 'none' target has rules or actions we assume it requires a build.
return bool(target_dict['type'] != 'none' or
target_dict.get('actions') or target_dict.get('rules')) | [
"def",
"_DoesTargetTypeRequireBuild",
"(",
"target_dict",
")",
":",
"# If a 'none' target has rules or actions we assume it requires a build.",
"return",
"bool",
"(",
"target_dict",
"[",
"'type'",
"]",
"!=",
"'none'",
"or",
"target_dict",
".",
"get",
"(",
"'actions'",
")"... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/generator/analyzer.py#L311-L315 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | FileSystem.__init__ | (self, *args, **kwargs) | __init__(self) -> FileSystem | __init__(self) -> FileSystem | [
"__init__",
"(",
"self",
")",
"-",
">",
"FileSystem"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> FileSystem"""
_core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"FileSystem_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_FileSystem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2411-L2413 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/importlib_metadata/__init__.py | python | EntryPoint.__iter__ | (self) | return iter((self.name, self)) | Supply iter so one may construct dicts of EntryPoints easily. | Supply iter so one may construct dicts of EntryPoints easily. | [
"Supply",
"iter",
"so",
"one",
"may",
"construct",
"dicts",
"of",
"EntryPoints",
"easily",
"."
] | def __iter__(self):
"""
Supply iter so one may construct dicts of EntryPoints easily.
"""
return iter((self.name, self)) | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"(",
"self",
".",
"name",
",",
"self",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/importlib_metadata/__init__.py#L134-L138 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/stats.py | python | _histogram | (a, numbins=10, defaultlimits=None, weights=None, printextras=False) | return HistogramResult(hist, defaultlimits[0], binsize, extrapoints) | Separates the range into several bins and returns the number of instances
in each bin.
Parameters
----------
a : array_like
Array of scores which will be put into bins.
numbins : int, optional
The number of bins to use for the histogram. Default is 10.
defaultlimits : tuple (low... | Separates the range into several bins and returns the number of instances
in each bin. | [
"Separates",
"the",
"range",
"into",
"several",
"bins",
"and",
"returns",
"the",
"number",
"of",
"instances",
"in",
"each",
"bin",
"."
] | def _histogram(a, numbins=10, defaultlimits=None, weights=None, printextras=False):
"""
Separates the range into several bins and returns the number of instances
in each bin.
Parameters
----------
a : array_like
Array of scores which will be put into bins.
numbins : int, optional
... | [
"def",
"_histogram",
"(",
"a",
",",
"numbins",
"=",
"10",
",",
"defaultlimits",
"=",
"None",
",",
"weights",
"=",
"None",
",",
"printextras",
"=",
"False",
")",
":",
"a",
"=",
"np",
".",
"ravel",
"(",
"a",
")",
"if",
"defaultlimits",
"is",
"None",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/stats.py#L1770-L1843 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/bullet/minitaur.py | python | Minitaur.__init__ | (self,
pybullet_client,
urdf_root=os.path.join(os.path.dirname(__file__), "../data"),
time_step=0.01,
self_collision_enabled=False,
motor_velocity_limit=np.inf,
pd_control_enabled=False,
accurate_motor_model_enabled... | Constructs a minitaur and reset it to the initial states.
Args:
pybullet_client: The instance of BulletClient to manage different
simulations.
urdf_root: The path to the urdf folder.
time_step: The time step of the simulation.
self_collision_enabled: Whether to enable self collision... | Constructs a minitaur and reset it to the initial states. | [
"Constructs",
"a",
"minitaur",
"and",
"reset",
"it",
"to",
"the",
"initial",
"states",
"."
] | def __init__(self,
pybullet_client,
urdf_root=os.path.join(os.path.dirname(__file__), "../data"),
time_step=0.01,
self_collision_enabled=False,
motor_velocity_limit=np.inf,
pd_control_enabled=False,
accurate_motor_m... | [
"def",
"__init__",
"(",
"self",
",",
"pybullet_client",
",",
"urdf_root",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
",",
"\"../data\"",
")",
",",
"time_step",
"=",
"0.01",
",",
"self_collision_enab... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/bullet/minitaur.py#L33-L99 | ||
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/services_api/utilities.py | python | get_utc_offset | (backend=None, opts=None) | Get the backend's offset from UTC. Once retrieved, it's saved value is
available in UTC_OFFSET and is returned too. Additional calls to this
function aren't necessary, but if made, won't query the backend again.
Input: backend object, optionally opts.
Output: The offset (in seconds) or -1 and a messa... | Get the backend's offset from UTC. Once retrieved, it's saved value is
available in UTC_OFFSET and is returned too. Additional calls to this
function aren't necessary, but if made, won't query the backend again. | [
"Get",
"the",
"backend",
"s",
"offset",
"from",
"UTC",
".",
"Once",
"retrieved",
"it",
"s",
"saved",
"value",
"is",
"available",
"in",
"UTC_OFFSET",
"and",
"is",
"returned",
"too",
".",
"Additional",
"calls",
"to",
"this",
"function",
"aren",
"t",
"necessa... | def get_utc_offset(backend=None, opts=None):
"""
Get the backend's offset from UTC. Once retrieved, it's saved value is
available in UTC_OFFSET and is returned too. Additional calls to this
function aren't necessary, but if made, won't query the backend again.
Input: backend object, optionally opt... | [
"def",
"get_utc_offset",
"(",
"backend",
"=",
"None",
",",
"opts",
"=",
"None",
")",
":",
"global",
"UTC_OFFSET",
"if",
"not",
"backend",
":",
"LOG",
".",
"error",
"(",
"'get_utc_offset(): Error: backend not set.'",
")",
"return",
"-",
"1",
"try",
":",
"try"... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/services_api/utilities.py#L130-L157 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TUInt64_GetHexStr | (*args) | return _snap.TUInt64_GetHexStr(*args) | TUInt64_GetHexStr(TUInt64 Int) -> TStr
Parameters:
Int: TUInt64 const & | TUInt64_GetHexStr(TUInt64 Int) -> TStr | [
"TUInt64_GetHexStr",
"(",
"TUInt64",
"Int",
")",
"-",
">",
"TStr"
] | def TUInt64_GetHexStr(*args):
"""
TUInt64_GetHexStr(TUInt64 Int) -> TStr
Parameters:
Int: TUInt64 const &
"""
return _snap.TUInt64_GetHexStr(*args) | [
"def",
"TUInt64_GetHexStr",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TUInt64_GetHexStr",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L14171-L14179 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/tools/scan-build-py/libear/__init__.py | python | Toolset.set_compiler | (self, compiler) | part of public interface | part of public interface | [
"part",
"of",
"public",
"interface"
] | def set_compiler(self, compiler):
""" part of public interface """
self.compiler = compiler | [
"def",
"set_compiler",
"(",
"self",
",",
"compiler",
")",
":",
"self",
".",
"compiler",
"=",
"compiler"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/tools/scan-build-py/libear/__init__.py#L86-L88 | ||
gwaldron/osgearth | 4c521857d59a69743e4a9cedba00afe570f984e8 | src/third_party/tinygltf/deps/cpplint.py | python | NestingState.CheckCompletedBlocks | (self, filename, error) | Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found. | Checks that all classes and namespaces have been completely parsed. | [
"Checks",
"that",
"all",
"classes",
"and",
"namespaces",
"have",
"been",
"completely",
"parsed",
"."
] | def CheckCompletedBlocks(self, filename, error):
"""Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found.
"""
# Note: Th... | [
"def",
"CheckCompletedBlocks",
"(",
"self",
",",
"filename",
",",
"error",
")",
":",
"# Note: This test can result in false positives if #ifdef constructs",
"# get in the way of brace matching. See the testBuildClass test in",
"# cpplint_unittest.py for an example of this.",
"for",
"obj"... | https://github.com/gwaldron/osgearth/blob/4c521857d59a69743e4a9cedba00afe570f984e8/src/third_party/tinygltf/deps/cpplint.py#L2551-L2570 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xmlDoc.saveFormatFileEnc | (self, filename, encoding, format) | return ret | Dump an XML document to a file or an URL. | Dump an XML document to a file or an URL. | [
"Dump",
"an",
"XML",
"document",
"to",
"a",
"file",
"or",
"an",
"URL",
"."
] | def saveFormatFileEnc(self, filename, encoding, format):
"""Dump an XML document to a file or an URL. """
ret = libxml2mod.xmlSaveFormatFileEnc(filename, self._o, encoding, format)
return ret | [
"def",
"saveFormatFileEnc",
"(",
"self",
",",
"filename",
",",
"encoding",
",",
"format",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlSaveFormatFileEnc",
"(",
"filename",
",",
"self",
".",
"_o",
",",
"encoding",
",",
"format",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L4449-L4452 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/tools/datetimes.py | python | _convert_listlike_datetimes | (
arg,
format,
name=None,
tz=None,
unit=None,
errors=None,
infer_datetime_format=None,
dayfirst=None,
yearfirst=None,
exact=None,
) | return _box_as_indexlike(result, utc=utc, name=name) | Helper function for to_datetime. Performs the conversions of 1D listlike
of dates
Parameters
----------
arg : list, tuple, ndarray, Series, Index
date to be parced
name : object
None or string for the Index name
tz : object
None or 'utc'
unit : string
None or... | Helper function for to_datetime. Performs the conversions of 1D listlike
of dates | [
"Helper",
"function",
"for",
"to_datetime",
".",
"Performs",
"the",
"conversions",
"of",
"1D",
"listlike",
"of",
"dates"
] | def _convert_listlike_datetimes(
arg,
format,
name=None,
tz=None,
unit=None,
errors=None,
infer_datetime_format=None,
dayfirst=None,
yearfirst=None,
exact=None,
):
"""
Helper function for to_datetime. Performs the conversions of 1D listlike
of dates
Parameters
... | [
"def",
"_convert_listlike_datetimes",
"(",
"arg",
",",
"format",
",",
"name",
"=",
"None",
",",
"tz",
"=",
"None",
",",
"unit",
"=",
"None",
",",
"errors",
"=",
"None",
",",
"infer_datetime_format",
"=",
"None",
",",
"dayfirst",
"=",
"None",
",",
"yearfi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/tools/datetimes.py#L246-L456 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_sh.py | python | SyntaxData.GetSyntaxSpec | (self) | return SYNTAX_ITEMS | Syntax Specifications | Syntax Specifications | [
"Syntax",
"Specifications"
] | def GetSyntaxSpec(self):
"""Syntax Specifications """
return SYNTAX_ITEMS | [
"def",
"GetSyntaxSpec",
"(",
"self",
")",
":",
"return",
"SYNTAX_ITEMS"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_sh.py#L121-L123 | |
luliyucoordinate/Leetcode | 96afcdc54807d1d184e881a075d1dbf3371e31fb | src/0049-Group-Anagrams/0049.py | python | Solution.groupAnagrams | (self, strs) | return result | :type strs: List[str]
:rtype: List[List[str]] | :type strs: List[str]
:rtype: List[List[str]] | [
":",
"type",
"strs",
":",
"List",
"[",
"str",
"]",
":",
"rtype",
":",
"List",
"[",
"List",
"[",
"str",
"]]"
] | def groupAnagrams(self, strs):
"""
:type strs: List[str]
:rtype: List[List[str]]
"""
strs_map = {}
result = []
for string in strs:
tmp = ''.join(sorted(string))
if tmp in strs_map:
strs_map[tmp].append(string)
el... | [
"def",
"groupAnagrams",
"(",
"self",
",",
"strs",
")",
":",
"strs_map",
"=",
"{",
"}",
"result",
"=",
"[",
"]",
"for",
"string",
"in",
"strs",
":",
"tmp",
"=",
"''",
".",
"join",
"(",
"sorted",
"(",
"string",
")",
")",
"if",
"tmp",
"in",
"strs_ma... | https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0049-Group-Anagrams/0049.py#L2-L19 | |
KhronosGroup/OpenCOLLADA | 6031fa956e1da4bbdd910af3a8f9e924ef0fca7a | Externals/LibXML/python/libxml.py | python | SAXCallback.startDocument | (self) | called at the start of the document | called at the start of the document | [
"called",
"at",
"the",
"start",
"of",
"the",
"document"
] | def startDocument(self):
"""called at the start of the document"""
pass | [
"def",
"startDocument",
"(",
"self",
")",
":",
"pass"
] | https://github.com/KhronosGroup/OpenCOLLADA/blob/6031fa956e1da4bbdd910af3a8f9e924ef0fca7a/Externals/LibXML/python/libxml.py#L136-L138 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py | python | _dnsname_to_stdlib | (name) | return name | Converts a dNSName SubjectAlternativeName field to the form used by the
standard library on the given Python version.
Cryptography produces a dNSName as a unicode string that was idna-decoded
from ASCII bytes. We need to idna-encode that string to get it back, and
then on Python 3 we also need to conve... | Converts a dNSName SubjectAlternativeName field to the form used by the
standard library on the given Python version. | [
"Converts",
"a",
"dNSName",
"SubjectAlternativeName",
"field",
"to",
"the",
"form",
"used",
"by",
"the",
"standard",
"library",
"on",
"the",
"given",
"Python",
"version",
"."
] | def _dnsname_to_stdlib(name):
"""
Converts a dNSName SubjectAlternativeName field to the form used by the
standard library on the given Python version.
Cryptography produces a dNSName as a unicode string that was idna-decoded
from ASCII bytes. We need to idna-encode that string to get it back, and
... | [
"def",
"_dnsname_to_stdlib",
"(",
"name",
")",
":",
"def",
"idna_encode",
"(",
"name",
")",
":",
"\"\"\"\n Borrowed wholesale from the Python Cryptography Project. It turns out\n that we can't just safely call `idna.encode`: it can explode for\n wildcard names. This avoi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py#L169-L209 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillHeaderView.py | python | DrillHeaderView.sizeHint | (self) | return size | Override QHeaderView::sizeHint. Returns a size hint for the header
taking into account the button if it is bigger than the text.
Returns:
(Qsize): header size hint in pixels | Override QHeaderView::sizeHint. Returns a size hint for the header
taking into account the button if it is bigger than the text. | [
"Override",
"QHeaderView",
"::",
"sizeHint",
".",
"Returns",
"a",
"size",
"hint",
"for",
"the",
"header",
"taking",
"into",
"account",
"the",
"button",
"if",
"it",
"is",
"bigger",
"than",
"the",
"text",
"."
] | def sizeHint(self):
"""
Override QHeaderView::sizeHint. Returns a size hint for the header
taking into account the button if it is bigger than the text.
Returns:
(Qsize): header size hint in pixels
"""
size = super(DrillHeaderView, self).sizeHint()
ma... | [
"def",
"sizeHint",
"(",
"self",
")",
":",
"size",
"=",
"super",
"(",
"DrillHeaderView",
",",
"self",
")",
".",
"sizeHint",
"(",
")",
"margin",
"=",
"self",
".",
"style",
"(",
")",
".",
"pixelMetric",
"(",
"QStyle",
".",
"PM_HeaderMargin",
",",
"None",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillHeaderView.py#L45-L58 | |
ROCmSoftwarePlatform/hipCaffe | 4ec5d482515cce532348553b6db6d00d015675d5 | examples/pycaffe/layers/pascal_multilabel_datalayers.py | python | PascalMultilabelDataLayerSync.backward | (self, top, propagate_down, bottom) | These layers does not back propagate | These layers does not back propagate | [
"These",
"layers",
"does",
"not",
"back",
"propagate"
] | def backward(self, top, propagate_down, bottom):
"""
These layers does not back propagate
"""
pass | [
"def",
"backward",
"(",
"self",
",",
"top",
",",
"propagate_down",
",",
"bottom",
")",
":",
"pass"
] | https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L74-L78 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/linux/procfs.py | python | main | (argv) | return 0 | The main function for manual testing. | The main function for manual testing. | [
"The",
"main",
"function",
"for",
"manual",
"testing",
"."
] | def main(argv):
"""The main function for manual testing."""
_LOGGER.setLevel(logging.WARNING)
handler = logging.StreamHandler()
handler.setLevel(logging.WARNING)
handler.setFormatter(logging.Formatter(
'%(asctime)s:%(name)s:%(levelname)s:%(message)s'))
_LOGGER.addHandler(handler)
pids = []
for ar... | [
"def",
"main",
"(",
"argv",
")",
":",
"_LOGGER",
".",
"setLevel",
"(",
"logging",
".",
"WARNING",
")",
"handler",
"=",
"logging",
".",
"StreamHandler",
"(",
")",
"handler",
".",
"setLevel",
"(",
"logging",
".",
"WARNING",
")",
"handler",
".",
"setFormatt... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/linux/procfs.py#L705-L743 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py | python | _initialize_variables | (session) | Utility to initialize uninitialized variables on the fly. | Utility to initialize uninitialized variables on the fly. | [
"Utility",
"to",
"initialize",
"uninitialized",
"variables",
"on",
"the",
"fly",
"."
] | def _initialize_variables(session):
"""Utility to initialize uninitialized variables on the fly."""
variables = _get_variables(get_graph())
candidate_vars = []
for v in variables:
if not getattr(v, '_keras_initialized', False):
candidate_vars.append(v)
if candidate_vars:
# This step is expensive... | [
"def",
"_initialize_variables",
"(",
"session",
")",
":",
"variables",
"=",
"_get_variables",
"(",
"get_graph",
"(",
")",
")",
"candidate_vars",
"=",
"[",
"]",
"for",
"v",
"in",
"variables",
":",
"if",
"not",
"getattr",
"(",
"v",
",",
"'_keras_initialized'",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L892-L910 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/davclient/davclient.py | python | DAVClient._get_response_tree | (self) | return self.response.tree | Parse the response body into an elementree object | Parse the response body into an elementree object | [
"Parse",
"the",
"response",
"body",
"into",
"an",
"elementree",
"object"
] | def _get_response_tree(self):
"""Parse the response body into an elementree object"""
self.response.tree = ElementTree.fromstring(self.response.body)
return self.response.tree | [
"def",
"_get_response_tree",
"(",
"self",
")",
":",
"self",
".",
"response",
".",
"tree",
"=",
"ElementTree",
".",
"fromstring",
"(",
"self",
".",
"response",
".",
"body",
")",
"return",
"self",
".",
"response",
".",
"tree"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/davclient/davclient.py#L98-L101 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/image/detection.py | python | DetRandomCropAug._random_crop_proposal | (self, label, height, width) | return () | Propose cropping areas | Propose cropping areas | [
"Propose",
"cropping",
"areas"
] | def _random_crop_proposal(self, label, height, width):
"""Propose cropping areas"""
from math import sqrt
if not self.enabled or height <= 0 or width <= 0:
return ()
min_area = self.area_range[0] * height * width
max_area = self.area_range[1] * height * width
... | [
"def",
"_random_crop_proposal",
"(",
"self",
",",
"label",
",",
"height",
",",
"width",
")",
":",
"from",
"math",
"import",
"sqrt",
"if",
"not",
"self",
".",
"enabled",
"or",
"height",
"<=",
"0",
"or",
"width",
"<=",
"0",
":",
"return",
"(",
")",
"mi... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/image/detection.py#L274-L320 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PageSetupDialogData.GetMarginBottomRight | (*args, **kwargs) | return _windows_.PageSetupDialogData_GetMarginBottomRight(*args, **kwargs) | GetMarginBottomRight(self) -> Point | GetMarginBottomRight(self) -> Point | [
"GetMarginBottomRight",
"(",
"self",
")",
"-",
">",
"Point"
] | def GetMarginBottomRight(*args, **kwargs):
"""GetMarginBottomRight(self) -> Point"""
return _windows_.PageSetupDialogData_GetMarginBottomRight(*args, **kwargs) | [
"def",
"GetMarginBottomRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_GetMarginBottomRight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L4918-L4920 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.