nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/crcmod/python3/crcmod/crcmod.py | python | Crc.update | (self, data) | Update the current CRC value using the string specified as the data
parameter. | Update the current CRC value using the string specified as the data
parameter. | [
"Update",
"the",
"current",
"CRC",
"value",
"using",
"the",
"string",
"specified",
"as",
"the",
"data",
"parameter",
"."
] | def update(self, data):
'''Update the current CRC value using the string specified as the data
parameter.
'''
self.crcValue = self._crc(data, self.crcValue) | [
"def",
"update",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"crcValue",
"=",
"self",
".",
"_crc",
"(",
"data",
",",
"self",
".",
"crcValue",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/crcmod/python3/crcmod/crcmod.py#L148-L152 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/frontend.py | python | filter_settings_spec | (settings_spec, *exclude, **replace) | return tuple(settings) | Return a copy of `settings_spec` excluding/replacing some settings.
`settings_spec` is a tuple of configuration settings with a structure
described for docutils.SettingsSpec.settings_spec.
Optional positional arguments are names of to-be-excluded settings.
Keyword arguments are option specification re... | Return a copy of `settings_spec` excluding/replacing some settings. | [
"Return",
"a",
"copy",
"of",
"settings_spec",
"excluding",
"/",
"replacing",
"some",
"settings",
"."
] | def filter_settings_spec(settings_spec, *exclude, **replace):
"""Return a copy of `settings_spec` excluding/replacing some settings.
`settings_spec` is a tuple of configuration settings with a structure
described for docutils.SettingsSpec.settings_spec.
Optional positional arguments are names of to-be... | [
"def",
"filter_settings_spec",
"(",
"settings_spec",
",",
"*",
"exclude",
",",
"*",
"*",
"replace",
")",
":",
"settings",
"=",
"list",
"(",
"settings_spec",
")",
"# every third item is a sequence of option tuples",
"for",
"i",
"in",
"range",
"(",
"2",
",",
"len"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/frontend.py#L271-L298 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Image.GetRed | (*args, **kwargs) | return _core_.Image_GetRed(*args, **kwargs) | GetRed(self, int x, int y) -> byte
Returns the red intensity at the given coordinate. | GetRed(self, int x, int y) -> byte | [
"GetRed",
"(",
"self",
"int",
"x",
"int",
"y",
")",
"-",
">",
"byte"
] | def GetRed(*args, **kwargs):
"""
GetRed(self, int x, int y) -> byte
Returns the red intensity at the given coordinate.
"""
return _core_.Image_GetRed(*args, **kwargs) | [
"def",
"GetRed",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_GetRed",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L3020-L3026 | |
p4lang/behavioral-model | 81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9 | tools/p4dbg.py | python | DebuggerAPI.do_break_packet_in | (self, line) | Breaks everytime a new packet enters the switch | Breaks everytime a new packet enters the switch | [
"Breaks",
"everytime",
"a",
"new",
"packet",
"enters",
"the",
"switch"
] | def do_break_packet_in(self, line):
"Breaks everytime a new packet enters the switch"
req = Msg_BreakPacketIn(switch_id = 0, req_id = self.get_req_id())
self.sok.send(req.generate())
msg = self.wait_for_msg()
self.check_msg_CLS(msg, Msg_Status)
assert(msg.status == 0)
... | [
"def",
"do_break_packet_in",
"(",
"self",
",",
"line",
")",
":",
"req",
"=",
"Msg_BreakPacketIn",
"(",
"switch_id",
"=",
"0",
",",
"req_id",
"=",
"self",
".",
"get_req_id",
"(",
")",
")",
"self",
".",
"sok",
".",
"send",
"(",
"req",
".",
"generate",
... | https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/p4dbg.py#L1022-L1029 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | cmake/developer_package/cpplint/cpplint.py | python | PrintCategories | () | Prints a list of all the error-categories used by error messages.
These are the categories used to filter messages via --filter. | Prints a list of all the error-categories used by error messages. | [
"Prints",
"a",
"list",
"of",
"all",
"the",
"error",
"-",
"categories",
"used",
"by",
"error",
"messages",
"."
] | def PrintCategories():
"""Prints a list of all the error-categories used by error messages.
These are the categories used to filter messages via --filter.
"""
sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES))
sys.exit(0) | [
"def",
"PrintCategories",
"(",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"''",
".",
"join",
"(",
"' %s\\n'",
"%",
"cat",
"for",
"cat",
"in",
"_ERROR_CATEGORIES",
")",
")",
"sys",
".",
"exit",
"(",
"0",
")"
] | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L6433-L6439 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/debug/debug_data.py | python | DebugTensorDatum.get_tensor | (self) | return load_tensor_from_event_file(self.file_path) | Get tensor from the dump (Event) file.
Returns:
The tensor loaded from the dump (Event) file. | Get tensor from the dump (Event) file. | [
"Get",
"tensor",
"from",
"the",
"dump",
"(",
"Event",
")",
"file",
"."
] | def get_tensor(self):
"""Get tensor from the dump (Event) file.
Returns:
The tensor loaded from the dump (Event) file.
"""
return load_tensor_from_event_file(self.file_path) | [
"def",
"get_tensor",
"(",
"self",
")",
":",
"return",
"load_tensor_from_event_file",
"(",
"self",
".",
"file_path",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/debug/debug_data.py#L259-L265 | |
google/clif | cab24d6a105609a65c95a36a1712ae3c20c7b5df | clif/pybind11/cindex/extractor.py | python | Module.from_source | (cls, source: Text, extra_flags: Optional[List[Text]] = None) | return cls(tu) | Create a Module object from C++ source file. | Create a Module object from C++ source file. | [
"Create",
"a",
"Module",
"object",
"from",
"C",
"++",
"source",
"file",
"."
] | def from_source(cls, source: Text, extra_flags: Optional[List[Text]] = None):
"""Create a Module object from C++ source file."""
flags = ['-x', 'c++', '-std=c++17', '-I.']
if extra_flags:
flags += extra_flags
tu = TranslationUnit.from_source(
'clif_referenced_headers.h', flags,
uns... | [
"def",
"from_source",
"(",
"cls",
",",
"source",
":",
"Text",
",",
"extra_flags",
":",
"Optional",
"[",
"List",
"[",
"Text",
"]",
"]",
"=",
"None",
")",
":",
"flags",
"=",
"[",
"'-x'",
",",
"'c++'",
",",
"'-std=c++17'",
",",
"'-I.'",
"]",
"if",
"ex... | https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/pybind11/cindex/extractor.py#L204-L215 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/gn_args.py | python | GetConfigFileContents | (args) | return "\n".join(pairs) | Generate config file contents for the arguments. | Generate config file contents for the arguments. | [
"Generate",
"config",
"file",
"contents",
"for",
"the",
"arguments",
"."
] | def GetConfigFileContents(args):
"""
Generate config file contents for the arguments.
"""
pairs = []
for k in sorted(args.keys()):
pairs.append("%s=%s" % (k, GetValueString(args[k])))
return "\n".join(pairs) | [
"def",
"GetConfigFileContents",
"(",
"args",
")",
":",
"pairs",
"=",
"[",
"]",
"for",
"k",
"in",
"sorted",
"(",
"args",
".",
"keys",
"(",
")",
")",
":",
"pairs",
".",
"append",
"(",
"\"%s=%s\"",
"%",
"(",
"k",
",",
"GetValueString",
"(",
"args",
"[... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/gn_args.py#L467-L474 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/enum_types.py | python | _EnumTypeString.gen_serializer_definition | (self, indented_writer) | Generate the serializer function definition. | Generate the serializer function definition. | [
"Generate",
"the",
"serializer",
"function",
"definition",
"."
] | def gen_serializer_definition(self, indented_writer):
# type: (writer.IndentedTextWriter) -> None
"""Generate the serializer function definition."""
template_params = {
'enum_name': self.get_cpp_type_name(),
'function_name': self.get_serializer_declaration(),
}
... | [
"def",
"gen_serializer_definition",
"(",
"self",
",",
"indented_writer",
")",
":",
"# type: (writer.IndentedTextWriter) -> None",
"template_params",
"=",
"{",
"'enum_name'",
":",
"self",
".",
"get_cpp_type_name",
"(",
")",
",",
"'function_name'",
":",
"self",
".",
"ge... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/enum_types.py#L334-L352 | ||
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Utilities/Scripts/SlicerWizard/TemplateManager.py | python | TemplateManager.addArguments | (self, parser) | Add template manager |CLI| arguments to parser.
:param parser: Argument parser instance to which to add arguments.
:type parser: :class:`argparse.ArgumentParser`
This adds |CLI| arguments to the specified ``parser`` that may be used to
interact with the template collection.
.. 'note' directive ne... | Add template manager |CLI| arguments to parser. | [
"Add",
"template",
"manager",
"|CLI|",
"arguments",
"to",
"parser",
"."
] | def addArguments(self, parser):
"""Add template manager |CLI| arguments to parser.
:param parser: Argument parser instance to which to add arguments.
:type parser: :class:`argparse.ArgumentParser`
This adds |CLI| arguments to the specified ``parser`` that may be used to
interact with the template ... | [
"def",
"addArguments",
"(",
"self",
",",
"parser",
")",
":",
"parser",
".",
"add_argument",
"(",
"\"--templatePath\"",
",",
"metavar",
"=",
"\"<CATEGORY=>PATH\"",
",",
"action",
"=",
"\"append\"",
",",
"help",
"=",
"\"add additional template path for specified\"",
"... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Utilities/Scripts/SlicerWizard/TemplateManager.py#L312-L338 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Source/JavaScriptCore/Scripts/jsmin.py | python | jsmin | (js) | return outs.getvalue() | returns a minified version of the javascript string | returns a minified version of the javascript string | [
"returns",
"a",
"minified",
"version",
"of",
"the",
"javascript",
"string"
] | def jsmin(js):
"""
returns a minified version of the javascript string
"""
if not is_3:
if cStringIO and not isinstance(js, unicode):
# strings can use cStringIO for a 3x performance
# improvement, but unicode (in python2) cannot
klass = cStringIO.StringIO
... | [
"def",
"jsmin",
"(",
"js",
")",
":",
"if",
"not",
"is_3",
":",
"if",
"cStringIO",
"and",
"not",
"isinstance",
"(",
"js",
",",
"unicode",
")",
":",
"# strings can use cStringIO for a 3x performance",
"# improvement, but unicode (in python2) cannot",
"klass",
"=",
"cS... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Source/JavaScriptCore/Scripts/jsmin.py#L43-L59 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib.py | python | URLopener.http_error_default | (self, url, fp, errcode, errmsg, headers) | Default error handler: close the connection and raise IOError. | Default error handler: close the connection and raise IOError. | [
"Default",
"error",
"handler",
":",
"close",
"the",
"connection",
"and",
"raise",
"IOError",
"."
] | def http_error_default(self, url, fp, errcode, errmsg, headers):
"""Default error handler: close the connection and raise IOError."""
fp.close()
raise IOError, ('http error', errcode, errmsg, headers) | [
"def",
"http_error_default",
"(",
"self",
",",
"url",
",",
"fp",
",",
"errcode",
",",
"errmsg",
",",
"headers",
")",
":",
"fp",
".",
"close",
"(",
")",
"raise",
"IOError",
",",
"(",
"'http error'",
",",
"errcode",
",",
"errmsg",
",",
"headers",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib.py#L378-L381 | ||
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | scripts/data/generators/uiuc_generator.py | python | UIUCGenerator._generate_image | (self, path_out, name_image_bg, name_image_fg) | return image_rgb, labels | Generates a random image with UIUC cars.
Input:
path_out: Path to the output folder
name_image_bg: Image to be used as background
name_image_fg: UIUC car image name
Output:
3 channel BGR image,
dict with labels {bbs, path} | Generates a random image with UIUC cars. | [
"Generates",
"a",
"random",
"image",
"with",
"UIUC",
"cars",
"."
] | def _generate_image(self, path_out, name_image_bg, name_image_fg):
"""
Generates a random image with UIUC cars.
Input:
path_out: Path to the output folder
name_image_bg: Image to be used as background
name_image_fg: UIUC car image name
Output:
3 channel BGR image,
dict with labels {bbs, path}
... | [
"def",
"_generate_image",
"(",
"self",
",",
"path_out",
",",
"name_image_bg",
",",
"name_image_fg",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"path_out",
",",
"str",
"(",
"self",
".",
"image_counter",
")",
"+",
"'.png'",
")",
"# Load ba... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/data/generators/uiuc_generator.py#L84-L144 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/dummy.py | python | DummyClassifier.predict_log_proba | (self, X) | Return log probability estimates for the test vectors X.
Parameters
----------
X : {array-like, sparse matrix}, shape = [n_samples, n_features]
Input vectors, where n_samples is the number of samples
and n_features is the number of features.
Returns
----... | Return log probability estimates for the test vectors X. | [
"Return",
"log",
"probability",
"estimates",
"for",
"the",
"test",
"vectors",
"X",
"."
] | def predict_log_proba(self, X):
"""
Return log probability estimates for the test vectors X.
Parameters
----------
X : {array-like, sparse matrix}, shape = [n_samples, n_features]
Input vectors, where n_samples is the number of samples
and n_features is t... | [
"def",
"predict_log_proba",
"(",
"self",
",",
"X",
")",
":",
"proba",
"=",
"self",
".",
"predict_proba",
"(",
"X",
")",
"if",
"self",
".",
"n_outputs_",
"==",
"1",
":",
"return",
"np",
".",
"log",
"(",
"proba",
")",
"else",
":",
"return",
"[",
"np"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/dummy.py#L299-L320 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/estimators/dnn.py | python | DNNRegressor.predict | (self, x=None, input_fn=None, batch_size=None, outputs=None,
as_iterable=True) | return super(DNNRegressor, self).predict(
x=x,
input_fn=input_fn,
batch_size=batch_size,
outputs=outputs,
as_iterable=as_iterable) | Returns predictions for given features.
By default, returns predicted scores. But this default will be dropped
soon. Users should either pass `outputs`, or call `predict_scores` method.
Args:
x: features.
input_fn: Input function. If set, x must be None.
batch_size: Override default batc... | Returns predictions for given features. | [
"Returns",
"predictions",
"for",
"given",
"features",
"."
] | def predict(self, x=None, input_fn=None, batch_size=None, outputs=None,
as_iterable=True):
"""Returns predictions for given features.
By default, returns predicted scores. But this default will be dropped
soon. Users should either pass `outputs`, or call `predict_scores` method.
Args:
... | [
"def",
"predict",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"outputs",
"=",
"None",
",",
"as_iterable",
"=",
"True",
")",
":",
"if",
"not",
"outputs",
":",
"return",
"self",
".",
"predict_s... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/dnn.py#L701-L736 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/contrib/securetransport.py | python | SecureTransportContext.check_hostname | (self) | return True | SecureTransport cannot have its hostname checking disabled. For more,
see the comment on getpeercert() in this file. | SecureTransport cannot have its hostname checking disabled. For more,
see the comment on getpeercert() in this file. | [
"SecureTransport",
"cannot",
"have",
"its",
"hostname",
"checking",
"disabled",
".",
"For",
"more",
"see",
"the",
"comment",
"on",
"getpeercert",
"()",
"in",
"this",
"file",
"."
] | def check_hostname(self):
"""
SecureTransport cannot have its hostname checking disabled. For more,
see the comment on getpeercert() in this file.
"""
return True | [
"def",
"check_hostname",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/contrib/securetransport.py#L759-L764 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | GraphicsContext.CreateFromNative | (*args, **kwargs) | return _gdi_.GraphicsContext_CreateFromNative(*args, **kwargs) | CreateFromNative(void context) -> GraphicsContext
Creates a wx.GraphicsContext from a native context. This native
context must be eg a CGContextRef for Core Graphics, a Graphics
pointer for GDIPlus or a cairo_t pointer for Cairo. NOTE: For
wxPython we still need a way to make this valu... | CreateFromNative(void context) -> GraphicsContext | [
"CreateFromNative",
"(",
"void",
"context",
")",
"-",
">",
"GraphicsContext"
] | def CreateFromNative(*args, **kwargs):
"""
CreateFromNative(void context) -> GraphicsContext
Creates a wx.GraphicsContext from a native context. This native
context must be eg a CGContextRef for Core Graphics, a Graphics
pointer for GDIPlus or a cairo_t pointer for Cairo. NOTE:... | [
"def",
"CreateFromNative",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsContext_CreateFromNative",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6166-L6175 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/internal/encoder.py | python | MapSizer | (field_descriptor, is_message_map) | return FieldSize | Returns a sizer for a map field. | Returns a sizer for a map field. | [
"Returns",
"a",
"sizer",
"for",
"a",
"map",
"field",
"."
] | def MapSizer(field_descriptor, is_message_map):
"""Returns a sizer for a map field."""
# Can't look at field_descriptor.message_type._concrete_class because it may
# not have been initialized yet.
message_type = field_descriptor.message_type
message_sizer = MessageSizer(field_descriptor.number, False, False)... | [
"def",
"MapSizer",
"(",
"field_descriptor",
",",
"is_message_map",
")",
":",
"# Can't look at field_descriptor.message_type._concrete_class because it may",
"# not have been initialized yet.",
"message_type",
"=",
"field_descriptor",
".",
"message_type",
"message_sizer",
"=",
"Mess... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/encoder.py#L343-L366 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | DC.CanGetTextExtent | (*args, **kwargs) | return _gdi_.DC_CanGetTextExtent(*args, **kwargs) | CanGetTextExtent(self) -> bool | CanGetTextExtent(self) -> bool | [
"CanGetTextExtent",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanGetTextExtent(*args, **kwargs):
"""CanGetTextExtent(self) -> bool"""
return _gdi_.DC_CanGetTextExtent(*args, **kwargs) | [
"def",
"CanGetTextExtent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_CanGetTextExtent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L4291-L4293 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/config/win/get_msvc_config_real.py | python | _RegistryQueryBase | (sysdir, key, value) | return text | Use reg.exe to read a particular key.
While ideally we might use the win32 module, we would like gyp to be
python neutral, so for instance cygwin python lacks this module.
Arguments:
sysdir: The system subdirectory to attempt to launch reg.exe from.
key: The registry key to read from.
value: The par... | Use reg.exe to read a particular key. | [
"Use",
"reg",
".",
"exe",
"to",
"read",
"a",
"particular",
"key",
"."
] | def _RegistryQueryBase(sysdir, key, value):
"""Use reg.exe to read a particular key.
While ideally we might use the win32 module, we would like gyp to be
python neutral, so for instance cygwin python lacks this module.
Arguments:
sysdir: The system subdirectory to attempt to launch reg.exe from.
key: ... | [
"def",
"_RegistryQueryBase",
"(",
"sysdir",
",",
"key",
",",
"value",
")",
":",
"# Skip if not on Windows or Python Win32 setup issue",
"if",
"sys",
".",
"platform",
"not",
"in",
"(",
"'win32'",
",",
"'cygwin'",
")",
":",
"return",
"None",
"# Setup params to pass to... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/config/win/get_msvc_config_real.py#L101-L129 | |
NVlabs/fermat | 06e8c03ac59ab440cbb13897f90631ef1861e769 | contrib/assimp-4.1.0/port/PyAssimp/scripts/transformations.py | python | compose_matrix | (scale=None, shear=None, angles=None, translate=None,
perspective=None) | return M | Return transformation matrix from sequence of transformations.
This is the inverse of the decompose_matrix function.
Sequence of transformations:
scale : vector of 3 scaling factors
shear : list of shear factors for x-y, x-z, y-z axes
angles : list of Euler angles about static x, y, z ... | Return transformation matrix from sequence of transformations. | [
"Return",
"transformation",
"matrix",
"from",
"sequence",
"of",
"transformations",
"."
] | def compose_matrix(scale=None, shear=None, angles=None, translate=None,
perspective=None):
"""Return transformation matrix from sequence of transformations.
This is the inverse of the decompose_matrix function.
Sequence of transformations:
scale : vector of 3 scaling factors
... | [
"def",
"compose_matrix",
"(",
"scale",
"=",
"None",
",",
"shear",
"=",
"None",
",",
"angles",
"=",
"None",
",",
"translate",
"=",
"None",
",",
"perspective",
"=",
"None",
")",
":",
"M",
"=",
"numpy",
".",
"identity",
"(",
"4",
")",
"if",
"perspective... | https://github.com/NVlabs/fermat/blob/06e8c03ac59ab440cbb13897f90631ef1861e769/contrib/assimp-4.1.0/port/PyAssimp/scripts/transformations.py#L785-L835 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py | python | get_object_signature | (obj) | return sig | Get the signature from obj | Get the signature from obj | [
"Get",
"the",
"signature",
"from",
"obj"
] | def get_object_signature(obj):
"""
Get the signature from obj
"""
try:
sig = formatargspec(*getargspec(obj))
except TypeError as errmsg:
sig = ''
# msg = "Unable to retrieve the signature of %s '%s'\n"\
# "(Initial error message: %s)"
# warnings.warn(msg % ... | [
"def",
"get_object_signature",
"(",
"obj",
")",
":",
"try",
":",
"sig",
"=",
"formatargspec",
"(",
"*",
"getargspec",
"(",
"obj",
")",
")",
"except",
"TypeError",
"as",
"errmsg",
":",
"sig",
"=",
"''",
"# msg = \"Unable to retrieve the signature of %s '%s'\... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L109-L122 | |
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | tools/clang/bindings/python/clang/cindex.py | python | Cursor.storage_class | (self) | return StorageClass.from_id(self._storage_class) | Retrieves the storage class (if any) of the entity pointed at by the
cursor. | Retrieves the storage class (if any) of the entity pointed at by the
cursor. | [
"Retrieves",
"the",
"storage",
"class",
"(",
"if",
"any",
")",
"of",
"the",
"entity",
"pointed",
"at",
"by",
"the",
"cursor",
"."
] | def storage_class(self):
"""
Retrieves the storage class (if any) of the entity pointed at by the
cursor.
"""
if not hasattr(self, '_storage_class'):
self._storage_class = conf.lib.clang_Cursor_getStorageClass(self)
return StorageClass.from_id(self._storage_c... | [
"def",
"storage_class",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_storage_class'",
")",
":",
"self",
".",
"_storage_class",
"=",
"conf",
".",
"lib",
".",
"clang_Cursor_getStorageClass",
"(",
"self",
")",
"return",
"StorageClass",
".... | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L1250-L1258 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | src/bindings/python/src/compatibility/ngraph/opset5/ops.py | python | hsigmoid | (data: NodeInput, name: Optional[str] = None,) | return _get_node_factory_opset5().create("HSigmoid", as_nodes(data), {}) | Return a node which performs HSigmoid.
:param data: Tensor with input data floating point type.
:return: The new node which performs HSigmoid | Return a node which performs HSigmoid. | [
"Return",
"a",
"node",
"which",
"performs",
"HSigmoid",
"."
] | def hsigmoid(data: NodeInput, name: Optional[str] = None,) -> Node:
"""Return a node which performs HSigmoid.
:param data: Tensor with input data floating point type.
:return: The new node which performs HSigmoid
"""
return _get_node_factory_opset5().create("HSigmoid", as_nodes(data), {}) | [
"def",
"hsigmoid",
"(",
"data",
":",
"NodeInput",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
")",
"->",
"Node",
":",
"return",
"_get_node_factory_opset5",
"(",
")",
".",
"create",
"(",
"\"HSigmoid\"",
",",
"as_nodes",
"(",
"data",
... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset5/ops.py#L238-L244 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Decimal.logical_and | (self, other, context=None) | return _dec_from_triple(0, result.lstrip('0') or '0', 0) | Applies an 'and' operation between self and other's digits. | Applies an 'and' operation between self and other's digits. | [
"Applies",
"an",
"and",
"operation",
"between",
"self",
"and",
"other",
"s",
"digits",
"."
] | def logical_and(self, other, context=None):
"""Applies an 'and' operation between self and other's digits."""
if context is None:
context = getcontext()
other = _convert_other(other, raiseit=True)
if not self._islogical() or not other._islogical():
return contex... | [
"def",
"logical_and",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"if",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L3276-L3291 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/re.py | python | compile | (pattern, flags=0) | return _compile(pattern, flags) | Compile a regular expression pattern, returning a pattern object. | Compile a regular expression pattern, returning a pattern object. | [
"Compile",
"a",
"regular",
"expression",
"pattern",
"returning",
"a",
"pattern",
"object",
"."
] | def compile(pattern, flags=0):
"Compile a regular expression pattern, returning a pattern object."
return _compile(pattern, flags) | [
"def",
"compile",
"(",
"pattern",
",",
"flags",
"=",
"0",
")",
":",
"return",
"_compile",
"(",
"pattern",
",",
"flags",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/re.py#L192-L194 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ebmlib/histcache.py | python | HistoryCache.GetNextItem | (self) | return item | Get the next item in the history cache, moving the
current position towards the end of the cache.
@return: object or None if at end of list | Get the next item in the history cache, moving the
current position towards the end of the cache.
@return: object or None if at end of list | [
"Get",
"the",
"next",
"item",
"in",
"the",
"history",
"cache",
"moving",
"the",
"current",
"position",
"towards",
"the",
"end",
"of",
"the",
"cache",
".",
"@return",
":",
"object",
"or",
"None",
"if",
"at",
"end",
"of",
"list"
] | def GetNextItem(self):
"""Get the next item in the history cache, moving the
current position towards the end of the cache.
@return: object or None if at end of list
"""
item = None
if self.cpos < len(self._list) - 1:
self.cpos += 1
item = self._l... | [
"def",
"GetNextItem",
"(",
"self",
")",
":",
"item",
"=",
"None",
"if",
"self",
".",
"cpos",
"<",
"len",
"(",
"self",
".",
"_list",
")",
"-",
"1",
":",
"self",
".",
"cpos",
"+=",
"1",
"item",
"=",
"self",
".",
"_list",
"[",
"self",
".",
"cpos",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/histcache.py#L77-L87 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/experimental/distrdf/python/DistRDF/Proxy.py | python | ActionProxy.__getattr__ | (self, attr) | return self._call_action_result | Intercepts calls on the result of
the action node.
Returns:
function: A method to handle an operation call to the
current action node. | Intercepts calls on the result of
the action node. | [
"Intercepts",
"calls",
"on",
"the",
"result",
"of",
"the",
"action",
"node",
"."
] | def __getattr__(self, attr):
"""
Intercepts calls on the result of
the action node.
Returns:
function: A method to handle an operation call to the
current action node.
"""
self._cur_attr = attr # Stores the name of operation call
return s... | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"self",
".",
"_cur_attr",
"=",
"attr",
"# Stores the name of operation call",
"return",
"self",
".",
"_call_action_result"
] | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/experimental/distrdf/python/DistRDF/Proxy.py#L97-L107 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/preprocessing/data.py | python | MaxAbsScaler.partial_fit | (self, X, y=None) | return self | Online computation of max absolute value of X for later scaling.
All of X is processed as a single batch. This is intended for cases
when `fit` is not feasible due to very large number of `n_samples`
or because X is read from a continuous stream.
Parameters
----------
X ... | Online computation of max absolute value of X for later scaling.
All of X is processed as a single batch. This is intended for cases
when `fit` is not feasible due to very large number of `n_samples`
or because X is read from a continuous stream. | [
"Online",
"computation",
"of",
"max",
"absolute",
"value",
"of",
"X",
"for",
"later",
"scaling",
".",
"All",
"of",
"X",
"is",
"processed",
"as",
"a",
"single",
"batch",
".",
"This",
"is",
"intended",
"for",
"cases",
"when",
"fit",
"is",
"not",
"feasible"... | def partial_fit(self, X, y=None):
"""Online computation of max absolute value of X for later scaling.
All of X is processed as a single batch. This is intended for cases
when `fit` is not feasible due to very large number of `n_samples`
or because X is read from a continuous stream.
... | [
"def",
"partial_fit",
"(",
"self",
",",
"X",
",",
"y",
"=",
"None",
")",
":",
"X",
"=",
"check_array",
"(",
"X",
",",
"accept_sparse",
"=",
"(",
"'csr'",
",",
"'csc'",
")",
",",
"copy",
"=",
"self",
".",
"copy",
",",
"ensure_2d",
"=",
"False",
",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/preprocessing/data.py#L767-L803 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/vis/visualization.py | python | setItemConfig | (name : ItemPath, value : Sequence[float]) | return scene().setItemConfig(name,value) | Sets a configuration of an item from the visualization.
Args:
name (str): the item to set the configuration.
value (list of floats): the item's configuration. The number of items
depends on the object's type. See the :mod:`klampt.model.config`
module for more information. | Sets a configuration of an item from the visualization. | [
"Sets",
"a",
"configuration",
"of",
"an",
"item",
"from",
"the",
"visualization",
"."
] | def setItemConfig(name : ItemPath, value : Sequence[float]) -> None:
"""Sets a configuration of an item from the visualization.
Args:
name (str): the item to set the configuration.
value (list of floats): the item's configuration. The number of items
depends on the object's type. ... | [
"def",
"setItemConfig",
"(",
"name",
":",
"ItemPath",
",",
"value",
":",
"Sequence",
"[",
"float",
"]",
")",
"->",
"None",
":",
"return",
"scene",
"(",
")",
".",
"setItemConfig",
"(",
"name",
",",
"value",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L1267-L1277 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBFunction.__eq__ | (self, rhs) | return _lldb.SBFunction___eq__(self, rhs) | __eq__(SBFunction self, SBFunction rhs) -> bool | __eq__(SBFunction self, SBFunction rhs) -> bool | [
"__eq__",
"(",
"SBFunction",
"self",
"SBFunction",
"rhs",
")",
"-",
">",
"bool"
] | def __eq__(self, rhs):
"""__eq__(SBFunction self, SBFunction rhs) -> bool"""
return _lldb.SBFunction___eq__(self, rhs) | [
"def",
"__eq__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"_lldb",
".",
"SBFunction___eq__",
"(",
"self",
",",
"rhs",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L5986-L5988 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/PyShell.py | python | ModifiedInterpreter.runcode | (self, code) | Override base class method | Override base class method | [
"Override",
"base",
"class",
"method"
] | def runcode(self, code):
"Override base class method"
if self.tkconsole.executing:
self.interp.restart_subprocess()
self.checklinecache()
if self.save_warnings_filters is not None:
warnings.filters[:] = self.save_warnings_filters
self.save_warnings_fil... | [
"def",
"runcode",
"(",
"self",
",",
"code",
")",
":",
"if",
"self",
".",
"tkconsole",
".",
"executing",
":",
"self",
".",
"interp",
".",
"restart_subprocess",
"(",
")",
"self",
".",
"checklinecache",
"(",
")",
"if",
"self",
".",
"save_warnings_filters",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/PyShell.py#L748-L795 | ||
xhzdeng/crpn | a5aef0f80dbe486103123f740c634fb01e6cc9a1 | caffe-fast-rcnn/tools/extra/parse_log.py | python | write_csv | (output_filename, dict_list, delimiter, verbose=False) | Write a CSV file | Write a CSV file | [
"Write",
"a",
"CSV",
"file"
] | def write_csv(output_filename, dict_list, delimiter, verbose=False):
"""Write a CSV file
"""
if not dict_list:
if verbose:
print('Not writing %s; no lines to write' % output_filename)
return
dialect = csv.excel
dialect.delimiter = delimiter
with open(output_filenam... | [
"def",
"write_csv",
"(",
"output_filename",
",",
"dict_list",
",",
"delimiter",
",",
"verbose",
"=",
"False",
")",
":",
"if",
"not",
"dict_list",
":",
"if",
"verbose",
":",
"print",
"(",
"'Not writing %s; no lines to write'",
"%",
"output_filename",
")",
"return... | https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/tools/extra/parse_log.py#L157-L175 | ||
mongodb/mongo-cxx-driver | eb86512b05be20d2f51d53ba9b860c709e0799b3 | etc/clang_format.py | python | Repo.rev_parse | (self, command) | return self._callgito(["rev-parse"] + command).rstrip() | git rev-parse wrapper | git rev-parse wrapper | [
"git",
"rev",
"-",
"parse",
"wrapper"
] | def rev_parse(self, command):
"""git rev-parse wrapper
"""
return self._callgito(["rev-parse"] + command).rstrip() | [
"def",
"rev_parse",
"(",
"self",
",",
"command",
")",
":",
"return",
"self",
".",
"_callgito",
"(",
"[",
"\"rev-parse\"",
"]",
"+",
"command",
")",
".",
"rstrip",
"(",
")"
] | https://github.com/mongodb/mongo-cxx-driver/blob/eb86512b05be20d2f51d53ba9b860c709e0799b3/etc/clang_format.py#L593-L596 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/sparse/base.py | python | spmatrix.conj | (self, copy=True) | Element-wise complex conjugation.
If the matrix is of non-complex data type and `copy` is False,
this method does nothing and the data is not copied.
Parameters
----------
copy : bool, optional
If True, the result is guaranteed to not share data with self.
... | Element-wise complex conjugation. | [
"Element",
"-",
"wise",
"complex",
"conjugation",
"."
] | def conj(self, copy=True):
"""Element-wise complex conjugation.
If the matrix is of non-complex data type and `copy` is False,
this method does nothing and the data is not copied.
Parameters
----------
copy : bool, optional
If True, the result is guaranteed ... | [
"def",
"conj",
"(",
"self",
",",
"copy",
"=",
"True",
")",
":",
"if",
"np",
".",
"issubdtype",
"(",
"self",
".",
"dtype",
",",
"np",
".",
"complexfloating",
")",
":",
"return",
"self",
".",
"tocsr",
"(",
"copy",
"=",
"copy",
")",
".",
"conj",
"("... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/base.py#L716-L737 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/combo.py | python | ComboCtrl.UseAltPopupWindow | (*args, **kwargs) | return _combo.ComboCtrl_UseAltPopupWindow(*args, **kwargs) | UseAltPopupWindow(self, bool enable=True)
Enable or disable usage of an alternative popup window, which
guarantees ability to focus the popup control, and allows common
native controls to function normally. This alternative popup window is
usually a wxDialog, and as such, when it is sho... | UseAltPopupWindow(self, bool enable=True) | [
"UseAltPopupWindow",
"(",
"self",
"bool",
"enable",
"=",
"True",
")"
] | def UseAltPopupWindow(*args, **kwargs):
"""
UseAltPopupWindow(self, bool enable=True)
Enable or disable usage of an alternative popup window, which
guarantees ability to focus the popup control, and allows common
native controls to function normally. This alternative popup windo... | [
"def",
"UseAltPopupWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"ComboCtrl_UseAltPopupWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L386-L396 | |
google/certificate-transparency | 2588562fd306a447958471b6f06c1069619c1641 | python/ct/crypto/cert.py | python | Certificate.not_before | (self) | return (self._asn1_cert["tbsCertificate"]["validity"]["notBefore"].
component_value().gmtime()) | Get a time.struct_time representing the notBefore in UTC time.
Returns:
a time.struct_time object.
Raises:
CertificateError: corrupt notBefore value. | Get a time.struct_time representing the notBefore in UTC time. | [
"Get",
"a",
"time",
".",
"struct_time",
"representing",
"the",
"notBefore",
"in",
"UTC",
"time",
"."
] | def not_before(self):
"""Get a time.struct_time representing the notBefore in UTC time.
Returns:
a time.struct_time object.
Raises:
CertificateError: corrupt notBefore value.
"""
return (self._asn1_cert["tbsCertificate"]["validity"]["notBefore"].
... | [
"def",
"not_before",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_asn1_cert",
"[",
"\"tbsCertificate\"",
"]",
"[",
"\"validity\"",
"]",
"[",
"\"notBefore\"",
"]",
".",
"component_value",
"(",
")",
".",
"gmtime",
"(",
")",
")"
] | https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/crypto/cert.py#L542-L552 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py | python | EveryN.every_n_step_begin | (self, step) | return [] | Callback before every n'th step begins.
Args:
step: `int`, the current value of the global step.
Returns:
A `list` of tensors that will be evaluated at this step. | Callback before every n'th step begins. | [
"Callback",
"before",
"every",
"n",
"th",
"step",
"begins",
"."
] | def every_n_step_begin(self, step): # pylint: disable=unused-argument
"""Callback before every n'th step begins.
Args:
step: `int`, the current value of the global step.
Returns:
A `list` of tensors that will be evaluated at this step.
"""
return [] | [
"def",
"every_n_step_begin",
"(",
"self",
",",
"step",
")",
":",
"# pylint: disable=unused-argument",
"return",
"[",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py#L315-L324 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install_egg_info.py | python | to_filename | (name) | return name.replace('-','_') | Convert a project or version name to its filename-escaped form
Any '-' characters are currently replaced with '_'. | Convert a project or version name to its filename-escaped form | [
"Convert",
"a",
"project",
"or",
"version",
"name",
"to",
"its",
"filename",
"-",
"escaped",
"form"
] | def to_filename(name):
"""Convert a project or version name to its filename-escaped form
Any '-' characters are currently replaced with '_'.
"""
return name.replace('-','_') | [
"def",
"to_filename",
"(",
"name",
")",
":",
"return",
"name",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install_egg_info.py#L72-L77 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | HyperlinkCtrl.SetVisitedColour | (*args, **kwargs) | return _controls_.HyperlinkCtrl_SetVisitedColour(*args, **kwargs) | SetVisitedColour(self, Colour colour) | SetVisitedColour(self, Colour colour) | [
"SetVisitedColour",
"(",
"self",
"Colour",
"colour",
")"
] | def SetVisitedColour(*args, **kwargs):
"""SetVisitedColour(self, Colour colour)"""
return _controls_.HyperlinkCtrl_SetVisitedColour(*args, **kwargs) | [
"def",
"SetVisitedColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"HyperlinkCtrl_SetVisitedColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L6650-L6652 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/ndarray/ndarray.py | python | empty | (shape, ctx=None, dtype=None) | return NDArray(handle=_new_alloc_handle(shape, ctx, False, dtype)) | Returns a new array of given shape and type, without initializing entries.
Parameters
----------
shape : int or tuple of int
The shape of the empty array.
ctx : Context, optional
An optional device context (default is the current default context).
dtype : str or numpy.dtype, optiona... | Returns a new array of given shape and type, without initializing entries. | [
"Returns",
"a",
"new",
"array",
"of",
"given",
"shape",
"and",
"type",
"without",
"initializing",
"entries",
"."
] | def empty(shape, ctx=None, dtype=None):
"""Returns a new array of given shape and type, without initializing entries.
Parameters
----------
shape : int or tuple of int
The shape of the empty array.
ctx : Context, optional
An optional device context (default is the current default co... | [
"def",
"empty",
"(",
"shape",
",",
"ctx",
"=",
"None",
",",
"dtype",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"shape",
",",
"int",
")",
":",
"shape",
"=",
"(",
"shape",
",",
")",
"if",
"ctx",
"is",
"None",
":",
"ctx",
"=",
"current_context... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L3955-L3979 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/common/extensions/docs/examples/apps/hello-python/oauth2/__init__.py | python | SignatureMethod_PLAINTEXT.signing_base | (self, request, consumer, token) | return sig, sig | Concatenates the consumer key and secret with the token's
secret. | Concatenates the consumer key and secret with the token's
secret. | [
"Concatenates",
"the",
"consumer",
"key",
"and",
"secret",
"with",
"the",
"token",
"s",
"secret",
"."
] | def signing_base(self, request, consumer, token):
"""Concatenates the consumer key and secret with the token's
secret."""
sig = '%s&' % escape(consumer.secret)
if token:
sig = sig + escape(token.secret)
return sig, sig | [
"def",
"signing_base",
"(",
"self",
",",
"request",
",",
"consumer",
",",
"token",
")",
":",
"sig",
"=",
"'%s&'",
"%",
"escape",
"(",
"consumer",
".",
"secret",
")",
"if",
"token",
":",
"sig",
"=",
"sig",
"+",
"escape",
"(",
"token",
".",
"secret",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/examples/apps/hello-python/oauth2/__init__.py#L748-L754 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/_abcoll.py | python | Mapping.iterkeys | (self) | return iter(self) | D.iterkeys() -> an iterator over the keys of D | D.iterkeys() -> an iterator over the keys of D | [
"D",
".",
"iterkeys",
"()",
"-",
">",
"an",
"iterator",
"over",
"the",
"keys",
"of",
"D"
] | def iterkeys(self):
'D.iterkeys() -> an iterator over the keys of D'
return iter(self) | [
"def",
"iterkeys",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/_abcoll.py#L394-L396 | |
GoldenCheetah/GoldenCheetah | 919a418895040144be5579884446ed6cd701bf0d | util/gh-downloads.py | python | print_total | (total, quiet=False, tag=None) | return total | Print total number of downloads.
:param total: Total number of downloads.
:param quiet: If True, print only number of downloads without an additional text.
:param tag: Release tag name (optional).
:return: Total number of downloads passed via "total" parameter. | Print total number of downloads.
:param total: Total number of downloads.
:param quiet: If True, print only number of downloads without an additional text.
:param tag: Release tag name (optional).
:return: Total number of downloads passed via "total" parameter. | [
"Print",
"total",
"number",
"of",
"downloads",
".",
":",
"param",
"total",
":",
"Total",
"number",
"of",
"downloads",
".",
":",
"param",
"quiet",
":",
"If",
"True",
"print",
"only",
"number",
"of",
"downloads",
"without",
"an",
"additional",
"text",
".",
... | def print_total(total, quiet=False, tag=None):
"""
Print total number of downloads.
:param total: Total number of downloads.
:param quiet: If True, print only number of downloads without an additional text.
:param tag: Release tag name (optional).
:return: Total number of downloads passed via "t... | [
"def",
"print_total",
"(",
"total",
",",
"quiet",
"=",
"False",
",",
"tag",
"=",
"None",
")",
":",
"if",
"not",
"quiet",
":",
"print",
"(",
"\"\\n{0}Total Downloads{1}: {2}\"",
".",
"format",
"(",
"_Text",
".",
"BOLD",
",",
"\"\"",
"if",
"not",
"tag",
... | https://github.com/GoldenCheetah/GoldenCheetah/blob/919a418895040144be5579884446ed6cd701bf0d/util/gh-downloads.py#L264-L279 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | clang/bindings/python/clang/cindex.py | python | TranslationUnit.get_tokens | (self, locations=None, extent=None) | return TokenGroup.get_tokens(self, extent) | Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both are defined,
behavior is undefined. | Obtain tokens in this translation unit. | [
"Obtain",
"tokens",
"in",
"this",
"translation",
"unit",
"."
] | def get_tokens(self, locations=None, extent=None):
"""Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both... | [
"def",
"get_tokens",
"(",
"self",
",",
"locations",
"=",
"None",
",",
"extent",
"=",
"None",
")",
":",
"if",
"locations",
"is",
"not",
"None",
":",
"extent",
"=",
"SourceRange",
"(",
"start",
"=",
"locations",
"[",
"0",
"]",
",",
"end",
"=",
"locatio... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/clang/bindings/python/clang/cindex.py#L3077-L3088 | |
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/scripts/cpp_lint.py | python | FileInfo.RepositoryName | (self) | return fullname | FullName after removing the local path to the repository.
If we have a real absolute path name here we can try to do something smart:
detecting the root of the checkout and truncating /path/to/checkout from
the name so that we get header guards that don't include things like
"C:\Documents and Settings\... | FullName after removing the local path to the repository. | [
"FullName",
"after",
"removing",
"the",
"local",
"path",
"to",
"the",
"repository",
"."
] | def RepositoryName(self):
"""FullName after removing the local path to the repository.
If we have a real absolute path name here we can try to do something smart:
detecting the root of the checkout and truncating /path/to/checkout from
the name so that we get header guards that don't include things lik... | [
"def",
"RepositoryName",
"(",
"self",
")",
":",
"fullname",
"=",
"self",
".",
"FullName",
"(",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"fullname",
")",
":",
"project_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"fullname",
")",
"if",
... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L884-L927 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | tools/scripts/update-pr-base-branch.py | python | get_open_pull_request_ids | (repo, milestone) | return milestone_prs | Find the ids of all of the open pull requests for the milestone
:param repo:
:param milestone: A milestone on the
:return: | Find the ids of all of the open pull requests for the milestone
:param repo:
:param milestone: A milestone on the
:return: | [
"Find",
"the",
"ids",
"of",
"all",
"of",
"the",
"open",
"pull",
"requests",
"for",
"the",
"milestone",
":",
"param",
"repo",
":",
":",
"param",
"milestone",
":",
"A",
"milestone",
"on",
"the",
":",
"return",
":"
] | def get_open_pull_request_ids(repo, milestone):
"""
Find the ids of all of the open pull requests for the milestone
:param repo:
:param milestone: A milestone on the
:return:
"""
info("Fetching IDs of all open pull requests")
issues_search_url = GH_API_URL + "/" + GH_SEARCH_ISSUES_ENDPO... | [
"def",
"get_open_pull_request_ids",
"(",
"repo",
",",
"milestone",
")",
":",
"info",
"(",
"\"Fetching IDs of all open pull requests\"",
")",
"issues_search_url",
"=",
"GH_API_URL",
"+",
"\"/\"",
"+",
"GH_SEARCH_ISSUES_ENDPOINT",
"search_string",
"=",
"\"repo:{} is:pr is:ope... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/tools/scripts/update-pr-base-branch.py#L95-L120 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/locks.py | python | Semaphore.acquire | (self) | return True | Acquire a semaphore.
If the internal counter is larger than zero on entry,
decrement it by one and return True immediately. If it is
zero on entry, block, waiting until some other coroutine has
called release() to make it larger than 0, and then return
True. | Acquire a semaphore. | [
"Acquire",
"a",
"semaphore",
"."
] | async def acquire(self):
"""Acquire a semaphore.
If the internal counter is larger than zero on entry,
decrement it by one and return True immediately. If it is
zero on entry, block, waiting until some other coroutine has
called release() to make it larger than 0, and then retu... | [
"async",
"def",
"acquire",
"(",
"self",
")",
":",
"while",
"self",
".",
"_value",
"<=",
"0",
":",
"fut",
"=",
"self",
".",
"_loop",
".",
"create_future",
"(",
")",
"self",
".",
"_waiters",
".",
"append",
"(",
"fut",
")",
"try",
":",
"await",
"fut",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/locks.py#L461-L482 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/mailbox.py | python | _PartialFile.tell | (self) | return _ProxyFile.tell(self) - self._start | Return the position with respect to start. | Return the position with respect to start. | [
"Return",
"the",
"position",
"with",
"respect",
"to",
"start",
"."
] | def tell(self):
"""Return the position with respect to start."""
return _ProxyFile.tell(self) - self._start | [
"def",
"tell",
"(",
"self",
")",
":",
"return",
"_ProxyFile",
".",
"tell",
"(",
"self",
")",
"-",
"self",
".",
"_start"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L2033-L2035 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/cryengine_modules.py | python | CryResourceCompilerModule | (ctx, *k, **kw) | Wrapper for RC modules | Wrapper for RC modules | [
"Wrapper",
"for",
"RC",
"modules"
] | def CryResourceCompilerModule(ctx, *k, **kw):
"""
Wrapper for RC modules
"""
# Initialize the Task Generator
InitializeTaskGenerator(ctx, kw)
# Setup TaskGenerator specific settings
SetupRunTimeLibraries(ctx,kw, 'static')
ctx.set_rc_flags(kw)
kw['output_sub_folder'] = ctx.CreateRootRelativePath('Tools/rc')
... | [
"def",
"CryResourceCompilerModule",
"(",
"ctx",
",",
"*",
"k",
",",
"*",
"*",
"kw",
")",
":",
"# Initialize the Task Generator",
"InitializeTaskGenerator",
"(",
"ctx",
",",
"kw",
")",
"# Setup TaskGenerator specific settings\t",
"SetupRunTimeLibraries",
"(",
"ctx",
",... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/cryengine_modules.py#L1417-L1435 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cext/__init__.py | python | get_path | () | return os.path.abspath(os.path.join(os.path.dirname(__file__))) | Returns the path to the directory for `numba.cext`. | Returns the path to the directory for `numba.cext`. | [
"Returns",
"the",
"path",
"to",
"the",
"directory",
"for",
"numba",
".",
"cext",
"."
] | def get_path():
"""Returns the path to the directory for `numba.cext`.
"""
return os.path.abspath(os.path.join(os.path.dirname(__file__))) | [
"def",
"get_path",
"(",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cext/__init__.py#L20-L23 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/monteCarloSampler.py | python | MonteCarloSampler._addMonteCarloIndex | (self, indicesToAdd) | Creates and appends MonteCarloIndex instances corresponding to each entry of
indicesToAdd. | Creates and appends MonteCarloIndex instances corresponding to each entry of
indicesToAdd. | [
"Creates",
"and",
"appends",
"MonteCarloIndex",
"instances",
"corresponding",
"to",
"each",
"entry",
"of",
"indicesToAdd",
"."
] | def _addMonteCarloIndex(self, indicesToAdd):
"""
Creates and appends MonteCarloIndex instances corresponding to each entry of
indicesToAdd.
"""
if self.indexConstructor is None:
raise AttributeError("Index constructor is not defined.")
for i in indicesToAdd:
... | [
"def",
"_addMonteCarloIndex",
"(",
"self",
",",
"indicesToAdd",
")",
":",
"if",
"self",
".",
"indexConstructor",
"is",
"None",
":",
"raise",
"AttributeError",
"(",
"\"Index constructor is not defined.\"",
")",
"for",
"i",
"in",
"indicesToAdd",
":",
"self",
".",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/monteCarloSampler.py#L208-L218 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/locations.py | python | virtualenv_no_global | () | Return True if in a venv and no system site packages. | Return True if in a venv and no system site packages. | [
"Return",
"True",
"if",
"in",
"a",
"venv",
"and",
"no",
"system",
"site",
"packages",
"."
] | def virtualenv_no_global():
"""
Return True if in a venv and no system site packages.
"""
# this mirrors the logic in virtualenv.py for locating the
# no-global-site-packages.txt file
site_mod_dir = os.path.dirname(os.path.abspath(site.__file__))
no_global_file = os.path.join(site_mod_dir, '... | [
"def",
"virtualenv_no_global",
"(",
")",
":",
"# this mirrors the logic in virtualenv.py for locating the",
"# no-global-site-packages.txt file",
"site_mod_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"site",
".",
"__file__"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/locations.py#L85-L94 | ||
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | scripts/data/pascalvoc2bbtxt.py | python | check_path | (path, is_folder=False) | return True | Checks if the given path exists.
Input:
path: Path to be checked
is_folder: True if the checked path is a folder
Returns:
True if the given path exists | Checks if the given path exists. | [
"Checks",
"if",
"the",
"given",
"path",
"exists",
"."
] | def check_path(path, is_folder=False):
"""
Checks if the given path exists.
Input:
path: Path to be checked
is_folder: True if the checked path is a folder
Returns:
True if the given path exists
"""
if not os.path.exists(path) or (not is_folder and not os.path.isfile(path)):
print('ERROR: Path "%s" ... | [
"def",
"check_path",
"(",
"path",
",",
"is_folder",
"=",
"False",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
"or",
"(",
"not",
"is_folder",
"and",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
")",
")",
":"... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/data/pascalvoc2bbtxt.py#L132-L146 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py | python | _list_product | (lst) | return result | Computes product of element of the list. | Computes product of element of the list. | [
"Computes",
"product",
"of",
"element",
"of",
"the",
"list",
"."
] | def _list_product(lst):
"""Computes product of element of the list."""
result = 1
for item in lst:
result *= item
return result | [
"def",
"_list_product",
"(",
"lst",
")",
":",
"result",
"=",
"1",
"for",
"item",
"in",
"lst",
":",
"result",
"*=",
"item",
"return",
"result"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py#L52-L57 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBCommunication.GetCloseOnEOF | (self) | return _lldb.SBCommunication_GetCloseOnEOF(self) | GetCloseOnEOF(SBCommunication self) -> bool | GetCloseOnEOF(SBCommunication self) -> bool | [
"GetCloseOnEOF",
"(",
"SBCommunication",
"self",
")",
"-",
">",
"bool"
] | def GetCloseOnEOF(self):
"""GetCloseOnEOF(SBCommunication self) -> bool"""
return _lldb.SBCommunication_GetCloseOnEOF(self) | [
"def",
"GetCloseOnEOF",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBCommunication_GetCloseOnEOF",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3052-L3054 | |
isl-org/Open3D | 79aec3ddde6a571ce2f28e4096477e52ec465244 | python/open3d/visualization/tensorboard_plugin/summary.py | python | _AsyncDataWriter.enqueue | (self, tagfilepath, data) | return os.path.basename(fullfilepath), this_write_loc | Add a write job to the write queue.
Args:
tagfilepath (str): Full file pathname for data. A suffix will be
added to get the complete filename. A None value indicates
writing is over and the writer thread should join.
data (bytes): Data buffer to write.
... | Add a write job to the write queue. | [
"Add",
"a",
"write",
"job",
"to",
"the",
"write",
"queue",
"."
] | def enqueue(self, tagfilepath, data):
"""Add a write job to the write queue.
Args:
tagfilepath (str): Full file pathname for data. A suffix will be
added to get the complete filename. A None value indicates
writing is over and the writer thread should join.
... | [
"def",
"enqueue",
"(",
"self",
",",
"tagfilepath",
",",
"data",
")",
":",
"with",
"self",
".",
"_file_lock",
":",
"if",
"tagfilepath",
"not",
"in",
"self",
".",
"_file_handles",
":",
"# summary.writer.EventFileWriter name format",
"fullfilepath",
"=",
"\"{}.{}.{}.... | https://github.com/isl-org/Open3D/blob/79aec3ddde6a571ce2f28e4096477e52ec465244/python/open3d/visualization/tensorboard_plugin/summary.py#L137-L174 | |
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | library/python/workbench/database_object_selector_widget.py | python | DatabaseObjectSelector._show_selection | (self, group, show_details) | Shows/hides the details of the selections for the group | Shows/hides the details of the selections for the group | [
"Shows",
"/",
"hides",
"the",
"details",
"of",
"the",
"selections",
"for",
"the",
"group"
] | def _show_selection(self, group, show_details):
'''Shows/hides the details of the selections for the group'''
if 'filter_container' in self.ui[group]: # The group is not empty
self.ui[group]['filter_container'].show(bool(show_details))
self.ui[group]['filter_button'].set_text('Hide... | [
"def",
"_show_selection",
"(",
"self",
",",
"group",
",",
"show_details",
")",
":",
"if",
"'filter_container'",
"in",
"self",
".",
"ui",
"[",
"group",
"]",
":",
"# The group is not empty",
"self",
".",
"ui",
"[",
"group",
"]",
"[",
"'filter_container'",
"]",... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/library/python/workbench/database_object_selector_widget.py#L231-L238 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/eval/_splitter.py | python | _Splitter._read_groups_ids | (self) | return line_groups_ids, groups_ids | Find all groups in dataset and which group each line belongs. | Find all groups in dataset and which group each line belongs. | [
"Find",
"all",
"groups",
"in",
"dataset",
"and",
"which",
"group",
"each",
"line",
"belongs",
"."
] | def _read_groups_ids(self):
"""Find all groups in dataset and which group each line belongs."""
line_groups_ids = []
groups_ids = set()
lines = self._line_reader.lines_generator()
# Need to return group id of line and line as string.
for group_id, _ in lines:
... | [
"def",
"_read_groups_ids",
"(",
"self",
")",
":",
"line_groups_ids",
"=",
"[",
"]",
"groups_ids",
"=",
"set",
"(",
")",
"lines",
"=",
"self",
".",
"_line_reader",
".",
"lines_generator",
"(",
")",
"# Need to return group id of line and line as string.",
"for",
"gr... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/eval/_splitter.py#L34-L44 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | Font.SetSymbolicSize | (*args, **kwargs) | return _gdi_.Font_SetSymbolicSize(*args, **kwargs) | SetSymbolicSize(self, int size) | SetSymbolicSize(self, int size) | [
"SetSymbolicSize",
"(",
"self",
"int",
"size",
")"
] | def SetSymbolicSize(*args, **kwargs):
"""SetSymbolicSize(self, int size)"""
return _gdi_.Font_SetSymbolicSize(*args, **kwargs) | [
"def",
"SetSymbolicSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_SetSymbolicSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L2392-L2394 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py | python | PDeque.extend | (self, iterable) | return PDeque(new_left_list, new_right_list, self._length + extend_count, self._maxlen) | Return new deque with all elements of iterable appended to the right.
>>> pdeque([1, 2]).extend([3, 4])
pdeque([1, 2, 3, 4]) | Return new deque with all elements of iterable appended to the right. | [
"Return",
"new",
"deque",
"with",
"all",
"elements",
"of",
"iterable",
"appended",
"to",
"the",
"right",
"."
] | def extend(self, iterable):
"""
Return new deque with all elements of iterable appended to the right.
>>> pdeque([1, 2]).extend([3, 4])
pdeque([1, 2, 3, 4])
"""
new_right_list, new_left_list, extend_count = self._extend(self._right_list, self._left_list, iterable)
... | [
"def",
"extend",
"(",
"self",
",",
"iterable",
")",
":",
"new_right_list",
",",
"new_left_list",
",",
"extend_count",
"=",
"self",
".",
"_extend",
"(",
"self",
".",
"_right_list",
",",
"self",
".",
"_left_list",
",",
"iterable",
")",
"return",
"PDeque",
"(... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py#L232-L240 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/tabart.py | python | AuiSimpleTabArt.GetSelectedFont | (self) | return self._selected_font | Returns the selected tab font for drawing tab labels. | Returns the selected tab font for drawing tab labels. | [
"Returns",
"the",
"selected",
"tab",
"font",
"for",
"drawing",
"tab",
"labels",
"."
] | def GetSelectedFont(self):
""" Returns the selected tab font for drawing tab labels. """
return self._selected_font | [
"def",
"GetSelectedFont",
"(",
"self",
")",
":",
"return",
"self",
".",
"_selected_font"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/tabart.py#L1595-L1598 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/mesh.py | python | NativeMeshTag.__mul__ | (self, multiplier) | return self._do_op(multiplier, "*") | Multiplication operator for NativeMeshTag. Multiplies self by the multiplier using
NumPy slicing if applicable. Multiplier can be any of the following types: int, float,
ndarray, list, NativeMeshTag. Throws error if shapes are incorrect | Multiplication operator for NativeMeshTag. Multiplies self by the multiplier using
NumPy slicing if applicable. Multiplier can be any of the following types: int, float,
ndarray, list, NativeMeshTag. Throws error if shapes are incorrect | [
"Multiplication",
"operator",
"for",
"NativeMeshTag",
".",
"Multiplies",
"self",
"by",
"the",
"multiplier",
"using",
"NumPy",
"slicing",
"if",
"applicable",
".",
"Multiplier",
"can",
"be",
"any",
"of",
"the",
"following",
"types",
":",
"int",
"float",
"ndarray",... | def __mul__(self, multiplier):
"""Multiplication operator for NativeMeshTag. Multiplies self by the multiplier using
NumPy slicing if applicable. Multiplier can be any of the following types: int, float,
ndarray, list, NativeMeshTag. Throws error if shapes are incorrect """
return sel... | [
"def",
"__mul__",
"(",
"self",
",",
"multiplier",
")",
":",
"return",
"self",
".",
"_do_op",
"(",
"multiplier",
",",
"\"*\"",
")"
] | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/mesh.py#L599-L604 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/vae-gan/vaegan_mxnet.py | python | GaussianLogDensity | (x, mu, log_var, name='GaussianLogDensity', EPSILON = 1e-6) | return log_prob | GaussianLogDensity loss calculation for layer wise loss | GaussianLogDensity loss calculation for layer wise loss | [
"GaussianLogDensity",
"loss",
"calculation",
"for",
"layer",
"wise",
"loss"
] | def GaussianLogDensity(x, mu, log_var, name='GaussianLogDensity', EPSILON = 1e-6):
'''GaussianLogDensity loss calculation for layer wise loss
'''
c = mx.sym.ones_like(log_var)*2.0 * 3.1416
c = mx.symbol.log(c)
var = mx.sym.exp(log_var)
x_mu2 = mx.symbol.square(x - mu) # [Issue] not sure the di... | [
"def",
"GaussianLogDensity",
"(",
"x",
",",
"mu",
",",
"log_var",
",",
"name",
"=",
"'GaussianLogDensity'",
",",
"EPSILON",
"=",
"1e-6",
")",
":",
"c",
"=",
"mx",
".",
"sym",
".",
"ones_like",
"(",
"log_var",
")",
"*",
"2.0",
"*",
"3.1416",
"c",
"=",... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/vae-gan/vaegan_mxnet.py#L161-L171 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.remove | (self, elem) | Removes an item from the list. Similar to list.remove(). | Removes an item from the list. Similar to list.remove(). | [
"Removes",
"an",
"item",
"from",
"the",
"list",
".",
"Similar",
"to",
"list",
".",
"remove",
"()",
"."
] | def remove(self, elem):
"""Removes an item from the list. Similar to list.remove()."""
self._values.remove(elem)
self._message_listener.Modified() | [
"def",
"remove",
"(",
"self",
",",
"elem",
")",
":",
"self",
".",
"_values",
".",
"remove",
"(",
"elem",
")",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/containers.py#L155-L158 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/metrics/metric.py | python | Metric.update | (self, *inputs) | An interface describes the behavior of updating the internal evaluation result.
Note:
All subclasses must override this interface.
Args:
inputs: A variable-length input argument list, usually are the logits and the corresponding labels. | An interface describes the behavior of updating the internal evaluation result. | [
"An",
"interface",
"describes",
"the",
"behavior",
"of",
"updating",
"the",
"internal",
"evaluation",
"result",
"."
] | def update(self, *inputs):
"""
An interface describes the behavior of updating the internal evaluation result.
Note:
All subclasses must override this interface.
Args:
inputs: A variable-length input argument list, usually are the logits and the corresponding la... | [
"def",
"update",
"(",
"self",
",",
"*",
"inputs",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Must define update function to use this base class'",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/metrics/metric.py#L225-L235 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mach/mach/commands/settings.py | python | Settings.list_settings | (self) | List available settings in a concise list. | List available settings in a concise list. | [
"List",
"available",
"settings",
"in",
"a",
"concise",
"list",
"."
] | def list_settings(self):
"""List available settings in a concise list."""
for section in sorted(self.settings):
for option in sorted(self.settings[section]):
short, full = self.settings.option_help(section, option)
print('%s.%s -- %s' % (section, option, short... | [
"def",
"list_settings",
"(",
"self",
")",
":",
"for",
"section",
"in",
"sorted",
"(",
"self",
".",
"settings",
")",
":",
"for",
"option",
"in",
"sorted",
"(",
"self",
".",
"settings",
"[",
"section",
"]",
")",
":",
"short",
",",
"full",
"=",
"self",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mach/mach/commands/settings.py#L28-L33 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/indexes/base.py | python | Index.get_indexer_for | (self, target, **kwargs) | return indexer | Guaranteed return of an indexer even when non-unique.
This dispatches to get_indexer or get_indexer_nonunique
as appropriate. | Guaranteed return of an indexer even when non-unique. | [
"Guaranteed",
"return",
"of",
"an",
"indexer",
"even",
"when",
"non",
"-",
"unique",
"."
] | def get_indexer_for(self, target, **kwargs):
"""
Guaranteed return of an indexer even when non-unique.
This dispatches to get_indexer or get_indexer_nonunique
as appropriate.
"""
if self.is_unique:
return self.get_indexer(target, **kwargs)
indexer, _ ... | [
"def",
"get_indexer_for",
"(",
"self",
",",
"target",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"is_unique",
":",
"return",
"self",
".",
"get_indexer",
"(",
"target",
",",
"*",
"*",
"kwargs",
")",
"indexer",
",",
"_",
"=",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/base.py#L4447-L4457 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/google/protobuf/descriptor.py | python | MethodDescriptor.__init__ | (self, name, full_name, index, containing_service,
input_type, output_type, options=None) | The arguments are as described in the description of MethodDescriptor
attributes above.
Note that containing_service may be None, and may be set later if necessary. | The arguments are as described in the description of MethodDescriptor
attributes above. | [
"The",
"arguments",
"are",
"as",
"described",
"in",
"the",
"description",
"of",
"MethodDescriptor",
"attributes",
"above",
"."
] | def __init__(self, name, full_name, index, containing_service,
input_type, output_type, options=None):
"""The arguments are as described in the description of MethodDescriptor
attributes above.
Note that containing_service may be None, and may be set later if necessary.
"""
super(Met... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"full_name",
",",
"index",
",",
"containing_service",
",",
"input_type",
",",
"output_type",
",",
"options",
"=",
"None",
")",
":",
"super",
"(",
"MethodDescriptor",
",",
"self",
")",
".",
"__init__",
"(",
... | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/descriptor.py#L410-L423 | ||
Sigil-Ebook/Sigil | 0d145d3a4874b4a26f7aabd68dbd9d18a2402e52 | src/Resource_Files/plugin_launchers/python/sigil_bs4/__init__.py | python | BeautifulSoup.decode | (self, pretty_print=False,
eventual_encoding=DEFAULT_OUTPUT_ENCODING,
formatter="minimal", indent_chars=" ") | return prefix + super(BeautifulSoup, self).decode(
indent_level, eventual_encoding, formatter, indent_chars) | Returns a string or Unicode representation of this document.
To get Unicode, pass None for encoding. | Returns a string or Unicode representation of this document.
To get Unicode, pass None for encoding. | [
"Returns",
"a",
"string",
"or",
"Unicode",
"representation",
"of",
"this",
"document",
".",
"To",
"get",
"Unicode",
"pass",
"None",
"for",
"encoding",
"."
] | def decode(self, pretty_print=False,
eventual_encoding=DEFAULT_OUTPUT_ENCODING,
formatter="minimal", indent_chars=" "):
"""Returns a string or Unicode representation of this document.
To get Unicode, pass None for encoding."""
if self.is_xml:
# Print th... | [
"def",
"decode",
"(",
"self",
",",
"pretty_print",
"=",
"False",
",",
"eventual_encoding",
"=",
"DEFAULT_OUTPUT_ENCODING",
",",
"formatter",
"=",
"\"minimal\"",
",",
"indent_chars",
"=",
"\" \"",
")",
":",
"if",
"self",
".",
"is_xml",
":",
"# Print the XML decla... | https://github.com/Sigil-Ebook/Sigil/blob/0d145d3a4874b4a26f7aabd68dbd9d18a2402e52/src/Resource_Files/plugin_launchers/python/sigil_bs4/__init__.py#L431-L450 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/core/setup.py | python | visibility_define | (config) | Return the define value to use for NPY_VISIBILITY_HIDDEN (may be empty
string). | Return the define value to use for NPY_VISIBILITY_HIDDEN (may be empty
string). | [
"Return",
"the",
"define",
"value",
"to",
"use",
"for",
"NPY_VISIBILITY_HIDDEN",
"(",
"may",
"be",
"empty",
"string",
")",
"."
] | def visibility_define(config):
"""Return the define value to use for NPY_VISIBILITY_HIDDEN (may be empty
string)."""
if config.check_compiler_gcc4():
return '__attribute__((visibility("hidden")))'
else:
return '' | [
"def",
"visibility_define",
"(",
"config",
")",
":",
"if",
"config",
".",
"check_compiler_gcc4",
"(",
")",
":",
"return",
"'__attribute__((visibility(\"hidden\")))'",
"else",
":",
"return",
"''"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/setup.py#L366-L372 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/html.py | python | _HtmlFrameParser._parse_tbody_tr | (self, table) | Return the list of tbody row elements from the parsed table element.
HTML5 table bodies consist of either 0 or more <tbody> elements (which
only contain <tr> elements) or 0 or more <tr> elements. This method
checks for both structures.
Parameters
----------
table : a ta... | Return the list of tbody row elements from the parsed table element. | [
"Return",
"the",
"list",
"of",
"tbody",
"row",
"elements",
"from",
"the",
"parsed",
"table",
"element",
"."
] | def _parse_tbody_tr(self, table):
"""
Return the list of tbody row elements from the parsed table element.
HTML5 table bodies consist of either 0 or more <tbody> elements (which
only contain <tr> elements) or 0 or more <tr> elements. This method
checks for both structures.
... | [
"def",
"_parse_tbody_tr",
"(",
"self",
",",
"table",
")",
":",
"raise",
"AbstractMethodError",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/html.py#L283-L300 | ||
junhyukoh/caffe-lstm | 598d45456fa2a1b127a644f4aa38daa8fb9fc722 | scripts/cpp_lint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/scripts/cpp_lint.py#L597-L610 | |
lightvector/KataGo | 20d34784703c5b4000643d3ccc43bb37d418f3b5 | python/sgfmill/sgf.py | python | Node.properties | (self) | return list(self._property_map.keys()) | Find the properties defined for the node.
Returns a list of property identifiers (strings), in unspecified order. | Find the properties defined for the node. | [
"Find",
"the",
"properties",
"defined",
"for",
"the",
"node",
"."
] | def properties(self):
"""Find the properties defined for the node.
Returns a list of property identifiers (strings), in unspecified order.
"""
return list(self._property_map.keys()) | [
"def",
"properties",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"_property_map",
".",
"keys",
"(",
")",
")"
] | https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/sgf.py#L51-L57 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | _Stream._init_write_gz | (self) | Initialize for writing with gzip compression. | Initialize for writing with gzip compression. | [
"Initialize",
"for",
"writing",
"with",
"gzip",
"compression",
"."
] | def _init_write_gz(self):
"""Initialize for writing with gzip compression.
"""
self.cmp = self.zlib.compressobj(9, self.zlib.DEFLATED,
-self.zlib.MAX_WBITS,
self.zlib.DEF_MEM_LEVEL,
... | [
"def",
"_init_write_gz",
"(",
"self",
")",
":",
"self",
".",
"cmp",
"=",
"self",
".",
"zlib",
".",
"compressobj",
"(",
"9",
",",
"self",
".",
"zlib",
".",
"DEFLATED",
",",
"-",
"self",
".",
"zlib",
".",
"MAX_WBITS",
",",
"self",
".",
"zlib",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L455-L467 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mock/mock.py | python | NonCallableMock.assert_called_once_with | (_mock_self, *args, **kwargs) | return self.assert_called_with(*args, **kwargs) | assert that the mock was called exactly once and with the specified
arguments. | assert that the mock was called exactly once and with the specified
arguments. | [
"assert",
"that",
"the",
"mock",
"was",
"called",
"exactly",
"once",
"and",
"with",
"the",
"specified",
"arguments",
"."
] | def assert_called_once_with(_mock_self, *args, **kwargs):
"""assert that the mock was called exactly once and with the specified
arguments."""
self = _mock_self
if not self.call_count == 1:
msg = ("Expected to be called once. Called %s times." %
self.call_c... | [
"def",
"assert_called_once_with",
"(",
"_mock_self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
"=",
"_mock_self",
"if",
"not",
"self",
".",
"call_count",
"==",
"1",
":",
"msg",
"=",
"(",
"\"Expected to be called once. Called %s times.\"",
"%... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mock/mock.py#L838-L846 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/SwimmingDEMApplication/python_scripts/assign_exact_variable_to_a_dof_process.py | python | AssignExactVariableToADOFProcess.ExecuteBeforeSolutionLoop | (self) | This method is executed in before initialize the solution loop
Keyword arguments:
self -- It signifies an instance of a class. | This method is executed in before initialize the solution loop
Keyword arguments:
self -- It signifies an instance of a class. | [
"This",
"method",
"is",
"executed",
"in",
"before",
"initialize",
"the",
"solution",
"loop",
"Keyword",
"arguments",
":",
"self",
"--",
"It",
"signifies",
"an",
"instance",
"of",
"a",
"class",
"."
] | def ExecuteBeforeSolutionLoop(self):
"""
This method is executed in before initialize the solution loop
Keyword arguments:
self -- It signifies an instance of a class.
"""
self.ExecuteInitializeSolutionStep() | [
"def",
"ExecuteBeforeSolutionLoop",
"(",
"self",
")",
":",
"self",
".",
"ExecuteInitializeSolutionStep",
"(",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/SwimmingDEMApplication/python_scripts/assign_exact_variable_to_a_dof_process.py#L60-L66 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/sparse.py | python | CSRNDArray.__getitem__ | (self, key) | x.__getitem__(i) <=> x[i]
Returns a sliced view of this array.
Parameters
----------
key : int or slice
Indexing key.
Examples
--------
>>> indptr = np.array([0, 2, 3, 6])
>>> indices = np.array([0, 2, 2, 0, 1, 2])
>>> data = np.arra... | x.__getitem__(i) <=> x[i] | [
"x",
".",
"__getitem__",
"(",
"i",
")",
"<",
"=",
">",
"x",
"[",
"i",
"]"
] | def __getitem__(self, key):
"""x.__getitem__(i) <=> x[i]
Returns a sliced view of this array.
Parameters
----------
key : int or slice
Indexing key.
Examples
--------
>>> indptr = np.array([0, 2, 3, 6])
>>> indices = np.array([0, 2, ... | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"if",
"isinstance",
"(",
"key",
",",
"int",
")",
":",
"if",
"key",
"==",
"-",
"1",
":",
"begin",
"=",
"self",
".",
"shape",
"[",
"0",
"]",
"-",
"1",
"else",
":",
"begin",
"=",
"key",
"r... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/sparse.py#L310-L353 | ||
bh107/bohrium | 5b83e7117285fefc7779ed0e9acb0f8e74c7e068 | bridge/bh107/bh107/util.py | python | get_contiguous_strides | (shape) | return tuple(stride) | Returns a new strides that corresponds to a contiguous traversal of shape | Returns a new strides that corresponds to a contiguous traversal of shape | [
"Returns",
"a",
"new",
"strides",
"that",
"corresponds",
"to",
"a",
"contiguous",
"traversal",
"of",
"shape"
] | def get_contiguous_strides(shape):
"""Returns a new strides that corresponds to a contiguous traversal of shape"""
stride = [0] * len(shape)
s = 1
for i in reversed(range(len(shape))):
stride[i] = s
s *= shape[i]
return tuple(stride) | [
"def",
"get_contiguous_strides",
"(",
"shape",
")",
":",
"stride",
"=",
"[",
"0",
"]",
"*",
"len",
"(",
"shape",
")",
"s",
"=",
"1",
"for",
"i",
"in",
"reversed",
"(",
"range",
"(",
"len",
"(",
"shape",
")",
")",
")",
":",
"stride",
"[",
"i",
"... | https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/bh107/bh107/util.py#L17-L24 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/app_ui.py | python | _UiNode.Tap | (self, point=None, dp_units=False) | Send a tap event to the UI node.
Args:
point: An optional geometry.Point instance indicating the location to
tap, relative to the bounds of the UI node, i.e. (0, 0) taps the
top-left corner. If ommited, the center of the node is tapped.
dp_units: If True, indicates that the coordinates ... | Send a tap event to the UI node. | [
"Send",
"a",
"tap",
"event",
"to",
"the",
"UI",
"node",
"."
] | def Tap(self, point=None, dp_units=False):
"""Send a tap event to the UI node.
Args:
point: An optional geometry.Point instance indicating the location to
tap, relative to the bounds of the UI node, i.e. (0, 0) taps the
top-left corner. If ommited, the center of the node is tapped.
... | [
"def",
"Tap",
"(",
"self",
",",
"point",
"=",
"None",
",",
"dp_units",
"=",
"False",
")",
":",
"if",
"point",
"is",
"None",
":",
"point",
"=",
"self",
".",
"bounds",
".",
"center",
"else",
":",
"if",
"dp_units",
":",
"point",
"=",
"(",
"float",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/app_ui.py#L58-L77 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | TextBoxAttr.SetFlags | (*args, **kwargs) | return _richtext.TextBoxAttr_SetFlags(*args, **kwargs) | SetFlags(self, int flags) | SetFlags(self, int flags) | [
"SetFlags",
"(",
"self",
"int",
"flags",
")"
] | def SetFlags(*args, **kwargs):
"""SetFlags(self, int flags)"""
return _richtext.TextBoxAttr_SetFlags(*args, **kwargs) | [
"def",
"SetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"TextBoxAttr_SetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L556-L558 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/ops.py | python | _NodeDef | (op_type, name, device=None, attrs=None) | return node_def | Create a NodeDef proto.
Args:
op_type: Value for the "op" attribute of the NodeDef proto.
name: Value for the "name" attribute of the NodeDef proto.
device: string, device, or function from NodeDef to string.
Value for the "device" attribute of the NodeDef proto.
attrs: Optional dictionary wher... | Create a NodeDef proto. | [
"Create",
"a",
"NodeDef",
"proto",
"."
] | def _NodeDef(op_type, name, device=None, attrs=None):
"""Create a NodeDef proto.
Args:
op_type: Value for the "op" attribute of the NodeDef proto.
name: Value for the "name" attribute of the NodeDef proto.
device: string, device, or function from NodeDef to string.
Value for the "device" attribut... | [
"def",
"_NodeDef",
"(",
"op_type",
",",
"name",
",",
"device",
"=",
"None",
",",
"attrs",
"=",
"None",
")",
":",
"node_def",
"=",
"graph_pb2",
".",
"NodeDef",
"(",
")",
"node_def",
".",
"op",
"=",
"compat",
".",
"as_bytes",
"(",
"op_type",
")",
"node... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/ops.py#L1080-L1106 | |
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Base/Python/slicer/util.py | python | exit | (status=EXIT_SUCCESS) | Exits the application with the specified exit code.
The method does not stops the process immediately but lets
pending events to be processed.
If exit() is called again while processing pending events,
the error code will be overwritten.
To make the application exit immediately, this code can be used.
Not... | Exits the application with the specified exit code. | [
"Exits",
"the",
"application",
"with",
"the",
"specified",
"exit",
"code",
"."
] | def exit(status=EXIT_SUCCESS):
"""Exits the application with the specified exit code.
The method does not stops the process immediately but lets
pending events to be processed.
If exit() is called again while processing pending events,
the error code will be overwritten.
To make the application exit immed... | [
"def",
"exit",
"(",
"status",
"=",
"EXIT_SUCCESS",
")",
":",
"from",
"slicer",
"import",
"app",
"# Prevent automatic application exit (for example, triggered by starting Slicer",
"# with \"--testing\" argument) from overwriting the exit code that we set now.",
"app",
".",
"commandOpt... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Base/Python/slicer/util.py#L25-L48 | ||
simon-anders/htseq | 5ba0507ea237e2e067ea79fb28febbc56a37f0d4 | python3/HTSeq/__init__.py | python | bundle_multiple_alignments | (sequence_of_alignments) | Some alignment programs, e.g., Bowtie, can output multiple alignments,
i.e., the same read is reported consecutively with different alignments.
This function takes an iterator over alignments and bundles consecutive
alignments regarding the same read to a list of Alignment objects and
returns an iterato... | Some alignment programs, e.g., Bowtie, can output multiple alignments,
i.e., the same read is reported consecutively with different alignments.
This function takes an iterator over alignments and bundles consecutive
alignments regarding the same read to a list of Alignment objects and
returns an iterato... | [
"Some",
"alignment",
"programs",
"e",
".",
"g",
".",
"Bowtie",
"can",
"output",
"multiple",
"alignments",
"i",
".",
"e",
".",
"the",
"same",
"read",
"is",
"reported",
"consecutively",
"with",
"different",
"alignments",
".",
"This",
"function",
"takes",
"an",... | def bundle_multiple_alignments(sequence_of_alignments):
"""Some alignment programs, e.g., Bowtie, can output multiple alignments,
i.e., the same read is reported consecutively with different alignments.
This function takes an iterator over alignments and bundles consecutive
alignments regarding the same... | [
"def",
"bundle_multiple_alignments",
"(",
"sequence_of_alignments",
")",
":",
"alignment_iter",
"=",
"iter",
"(",
"sequence_of_alignments",
")",
"algnt",
"=",
"next",
"(",
"alignment_iter",
")",
"ma",
"=",
"[",
"algnt",
"]",
"for",
"algnt",
"in",
"alignment_iter",... | https://github.com/simon-anders/htseq/blob/5ba0507ea237e2e067ea79fb28febbc56a37f0d4/python3/HTSeq/__init__.py#L474-L490 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/font.py | python | names | (root=None) | return root.tk.splitlist(root.tk.call("font", "names")) | Get names of defined fonts (as a tuple) | Get names of defined fonts (as a tuple) | [
"Get",
"names",
"of",
"defined",
"fonts",
"(",
"as",
"a",
"tuple",
")"
] | def names(root=None):
"Get names of defined fonts (as a tuple)"
if not root:
root = tkinter._default_root
return root.tk.splitlist(root.tk.call("font", "names")) | [
"def",
"names",
"(",
"root",
"=",
"None",
")",
":",
"if",
"not",
"root",
":",
"root",
"=",
"tkinter",
".",
"_default_root",
"return",
"root",
".",
"tk",
".",
"splitlist",
"(",
"root",
".",
"tk",
".",
"call",
"(",
"\"font\"",
",",
"\"names\"",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/font.py#L187-L191 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/sliceviewer/view.py | python | SliceViewerDataView.deactivate_tool | (self, tool_text) | Deactivate a given tool as if the tool button had been pressed | Deactivate a given tool as if the tool button had been pressed | [
"Deactivate",
"a",
"given",
"tool",
"as",
"if",
"the",
"tool",
"button",
"had",
"been",
"pressed"
] | def deactivate_tool(self, tool_text):
"""Deactivate a given tool as if the tool button had been pressed"""
self.mpl_toolbar.set_action_checked(tool_text, False) | [
"def",
"deactivate_tool",
"(",
"self",
",",
"tool_text",
")",
":",
"self",
".",
"mpl_toolbar",
".",
"set_action_checked",
"(",
"tool_text",
",",
"False",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/view.py#L442-L444 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/easy_install.py | python | WindowsScriptWriter._adjust_header | (cls, type_, orig_header) | return new_header if cls._use_header(new_header) else orig_header | Make sure 'pythonw' is used for gui and and 'python' is used for
console (regardless of what sys.executable is). | Make sure 'pythonw' is used for gui and and 'python' is used for
console (regardless of what sys.executable is). | [
"Make",
"sure",
"pythonw",
"is",
"used",
"for",
"gui",
"and",
"and",
"python",
"is",
"used",
"for",
"console",
"(",
"regardless",
"of",
"what",
"sys",
".",
"executable",
"is",
")",
"."
] | def _adjust_header(cls, type_, orig_header):
"""
Make sure 'pythonw' is used for gui and and 'python' is used for
console (regardless of what sys.executable is).
"""
pattern = 'pythonw.exe'
repl = 'python.exe'
if type_ == 'gui':
pattern, repl = repl, p... | [
"def",
"_adjust_header",
"(",
"cls",
",",
"type_",
",",
"orig_header",
")",
":",
"pattern",
"=",
"'pythonw.exe'",
"repl",
"=",
"'python.exe'",
"if",
"type_",
"==",
"'gui'",
":",
"pattern",
",",
"repl",
"=",
"repl",
",",
"pattern",
"pattern_ob",
"=",
"re",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/easy_install.py#L2201-L2212 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/http/server.py | python | CGIHTTPRequestHandler.send_head | (self) | Version of send_head that support CGI scripts | Version of send_head that support CGI scripts | [
"Version",
"of",
"send_head",
"that",
"support",
"CGI",
"scripts"
] | def send_head(self):
"""Version of send_head that support CGI scripts"""
if self.is_cgi():
return self.run_cgi()
else:
return SimpleHTTPRequestHandler.send_head(self) | [
"def",
"send_head",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_cgi",
"(",
")",
":",
"return",
"self",
".",
"run_cgi",
"(",
")",
"else",
":",
"return",
"SimpleHTTPRequestHandler",
".",
"send_head",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/http/server.py#L992-L997 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/middle/TensorIteratorCondition.py | python | LoopConditionMatcher.check_dynamic_seq_len | (graph: Graph, match: dict) | return dynamic_seq_len | Cycle is dynamic if at least one of the boundaries isn't constant OR this boundaries is different from tensor
shape. | Cycle is dynamic if at least one of the boundaries isn't constant OR this boundaries is different from tensor
shape. | [
"Cycle",
"is",
"dynamic",
"if",
"at",
"least",
"one",
"of",
"the",
"boundaries",
"isn",
"t",
"constant",
"OR",
"this",
"boundaries",
"is",
"different",
"from",
"tensor",
"shape",
"."
] | def check_dynamic_seq_len(graph: Graph, match: dict):
"""
Cycle is dynamic if at least one of the boundaries isn't constant OR this boundaries is different from tensor
shape.
"""
dynamic_seq_len = match['Enter_1_less_data'].value is None or match['Enter_2_less_data'].value is Non... | [
"def",
"check_dynamic_seq_len",
"(",
"graph",
":",
"Graph",
",",
"match",
":",
"dict",
")",
":",
"dynamic_seq_len",
"=",
"match",
"[",
"'Enter_1_less_data'",
"]",
".",
"value",
"is",
"None",
"or",
"match",
"[",
"'Enter_2_less_data'",
"]",
".",
"value",
"is",... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/middle/TensorIteratorCondition.py#L199-L207 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py | python | _ClassState.check_finished | (self, error) | Checks that all classes have been completely parsed.
Call this when all lines in a file have been processed.
Args:
error: The function to call with any errors found. | Checks that all classes have been completely parsed. | [
"Checks",
"that",
"all",
"classes",
"have",
"been",
"completely",
"parsed",
"."
] | def check_finished(self, error):
"""Checks that all classes have been completely parsed.
Call this when all lines in a file have been processed.
Args:
error: The function to call with any errors found.
"""
if self.classinfo_stack:
# Note: This test can resu... | [
"def",
"check_finished",
"(",
"self",
",",
"error",
")",
":",
"if",
"self",
".",
"classinfo_stack",
":",
"# Note: This test can result in false positives if #ifdef constructs",
"# get in the way of brace matching. See the testBuildClass test in",
"# cpp_style_unittest.py for an example... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L1153-L1166 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/tcpserver.py | python | TCPServer.bind | (
self,
port: int,
address: Optional[str] = None,
family: socket.AddressFamily = socket.AF_UNSPEC,
backlog: int = 128,
reuse_port: bool = False,
) | Binds this server to the given port on the given address.
To start the server, call `start`. If you want to run this server
in a single process, you can call `listen` as a shortcut to the
sequence of `bind` and `start` calls.
Address may be either an IP address or hostname. If it's a ... | Binds this server to the given port on the given address. | [
"Binds",
"this",
"server",
"to",
"the",
"given",
"port",
"on",
"the",
"given",
"address",
"."
] | def bind(
self,
port: int,
address: Optional[str] = None,
family: socket.AddressFamily = socket.AF_UNSPEC,
backlog: int = 128,
reuse_port: bool = False,
) -> None:
"""Binds this server to the given port on the given address.
To start the server, call ... | [
"def",
"bind",
"(",
"self",
",",
"port",
":",
"int",
",",
"address",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"family",
":",
"socket",
".",
"AddressFamily",
"=",
"socket",
".",
"AF_UNSPEC",
",",
"backlog",
":",
"int",
"=",
"128",
",",
"r... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/tcpserver.py#L173-L210 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | TextAttr.GetBulletStyle | (*args, **kwargs) | return _controls_.TextAttr_GetBulletStyle(*args, **kwargs) | GetBulletStyle(self) -> int | GetBulletStyle(self) -> int | [
"GetBulletStyle",
"(",
"self",
")",
"-",
">",
"int"
] | def GetBulletStyle(*args, **kwargs):
"""GetBulletStyle(self) -> int"""
return _controls_.TextAttr_GetBulletStyle(*args, **kwargs) | [
"def",
"GetBulletStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetBulletStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L1732-L1734 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/extern/__init__.py | python | VendorImporter.find_module | (self, fullname, path=None) | return self | Return self when fullname starts with root_name and the
target module is one vendored through this importer. | Return self when fullname starts with root_name and the
target module is one vendored through this importer. | [
"Return",
"self",
"when",
"fullname",
"starts",
"with",
"root_name",
"and",
"the",
"target",
"module",
"is",
"one",
"vendored",
"through",
"this",
"importer",
"."
] | def find_module(self, fullname, path=None):
"""
Return self when fullname starts with root_name and the
target module is one vendored through this importer.
"""
root, base, target = fullname.partition(self.root_name + '.')
if root:
return
if not any(ma... | [
"def",
"find_module",
"(",
"self",
",",
"fullname",
",",
"path",
"=",
"None",
")",
":",
"root",
",",
"base",
",",
"target",
"=",
"fullname",
".",
"partition",
"(",
"self",
".",
"root_name",
"+",
"'.'",
")",
"if",
"root",
":",
"return",
"if",
"not",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/extern/__init__.py#L23-L33 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/square_ds.py | python | _square_ds_tbe | () | return | Square TBE register | Square TBE register | [
"Square",
"TBE",
"register"
] | def _square_ds_tbe():
"""Square TBE register"""
return | [
"def",
"_square_ds_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/square_ds.py#L37-L39 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | driver/python/pysequoiadb/domain.py | python | domain.__del__ | (self) | release domain
Exceptions:
pysequoiadb.error.SDBBaseError | release domain | [
"release",
"domain"
] | def __del__(self):
"""release domain
Exceptions:
pysequoiadb.error.SDBBaseError
"""
self._domain_name = None
if self._domain is not None:
rc = sdb.release_domain(self._domain)
raise_if_error(rc, "Failed to release domain")
self._dom... | [
"def",
"__del__",
"(",
"self",
")",
":",
"self",
".",
"_domain_name",
"=",
"None",
"if",
"self",
".",
"_domain",
"is",
"not",
"None",
":",
"rc",
"=",
"sdb",
".",
"release_domain",
"(",
"self",
".",
"_domain",
")",
"raise_if_error",
"(",
"rc",
",",
"\... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/pysequoiadb/domain.py#L42-L52 | ||
alibaba/graph-learn | 54cafee9db3054dc310a28b856be7f97c7d5aee9 | graphlearn/python/errors.py | python | InvalidArgumentError.__init__ | (self, message) | Creates an `InvalidArgumentError`. | Creates an `InvalidArgumentError`. | [
"Creates",
"an",
"InvalidArgumentError",
"."
] | def __init__(self, message):
"""Creates an `InvalidArgumentError`."""
super(InvalidArgumentError, self).__init__(message, INVALID_ARGUMENT) | [
"def",
"__init__",
"(",
"self",
",",
"message",
")",
":",
"super",
"(",
"InvalidArgumentError",
",",
"self",
")",
".",
"__init__",
"(",
"message",
",",
"INVALID_ARGUMENT",
")"
] | https://github.com/alibaba/graph-learn/blob/54cafee9db3054dc310a28b856be7f97c7d5aee9/graphlearn/python/errors.py#L85-L87 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py | python | Decimal._power_modulo | (self, other, modulo, context=None) | return _dec_from_triple(sign, str(base), 0) | Three argument version of __pow__ | Three argument version of __pow__ | [
"Three",
"argument",
"version",
"of",
"__pow__"
] | def _power_modulo(self, other, modulo, context=None):
"""Three argument version of __pow__"""
other = _convert_other(other)
if other is NotImplemented:
return other
modulo = _convert_other(modulo)
if modulo is NotImplemented:
return modulo
if con... | [
"def",
"_power_modulo",
"(",
"self",
",",
"other",
",",
"modulo",
",",
"context",
"=",
"None",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
")",
"if",
"other",
"is",
"NotImplemented",
":",
"return",
"other",
"modulo",
"=",
"_convert_other",
"(",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pydecimal.py#L1966-L2049 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/InstanceSerializableVisitor.py | python | InstanceSerializableVisitor._writeTmpl | (self, c, visit_str) | Wrapper to write tmpl to files desc. | Wrapper to write tmpl to files desc. | [
"Wrapper",
"to",
"write",
"tmpl",
"to",
"files",
"desc",
"."
] | def _writeTmpl(self, c, visit_str):
"""
Wrapper to write tmpl to files desc.
"""
DEBUG.debug("InstanceSerializableVisitor:%s" % visit_str)
DEBUG.debug("===================================")
DEBUG.debug(c)
self.__fp.writelines(c.__str__())
DEBUG.debug("====... | [
"def",
"_writeTmpl",
"(",
"self",
",",
"c",
",",
"visit_str",
")",
":",
"DEBUG",
".",
"debug",
"(",
"\"InstanceSerializableVisitor:%s\"",
"%",
"visit_str",
")",
"DEBUG",
".",
"debug",
"(",
"\"===================================\"",
")",
"DEBUG",
".",
"debug",
"(... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/InstanceSerializableVisitor.py#L150-L158 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/yapf/yapf/yapflib/comment_splicer.py | python | _FindAncestorAtIndent | (node, indent) | Find an ancestor of node with the given indentation.
Arguments:
node: node to start from. This must not be the tree root.
indent: indentation string for the ancestor we're looking for.
See _AnnotateIndents for more details.
Returns:
An ancestor node with suitable indentation. If no suitable an... | Find an ancestor of node with the given indentation. | [
"Find",
"an",
"ancestor",
"of",
"node",
"with",
"the",
"given",
"indentation",
"."
] | def _FindAncestorAtIndent(node, indent):
"""Find an ancestor of node with the given indentation.
Arguments:
node: node to start from. This must not be the tree root.
indent: indentation string for the ancestor we're looking for.
See _AnnotateIndents for more details.
Returns:
An ancestor nod... | [
"def",
"_FindAncestorAtIndent",
"(",
"node",
",",
"indent",
")",
":",
"if",
"node",
".",
"parent",
".",
"parent",
"is",
"None",
":",
"# Our parent is the tree root, so there's nowhere else to go.",
"return",
"node",
"# If the parent has an indent annotation, and it's shorter ... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/comment_splicer.py#L309-L337 | ||
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/bindings/python/clang/cindex.py | python | Cursor.availability | (self) | return AvailabilityKind.from_id(self._availability) | Retrieves the availability of the entity pointed at by the cursor. | Retrieves the availability of the entity pointed at by the cursor. | [
"Retrieves",
"the",
"availability",
"of",
"the",
"entity",
"pointed",
"at",
"by",
"the",
"cursor",
"."
] | def availability(self):
"""
Retrieves the availability of the entity pointed at by the cursor.
"""
if not hasattr(self, '_availability'):
self._availability = conf.lib.clang_getCursorAvailability(self)
return AvailabilityKind.from_id(self._availability) | [
"def",
"availability",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_availability'",
")",
":",
"self",
".",
"_availability",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorAvailability",
"(",
"self",
")",
"return",
"AvailabilityKind",
".... | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/bindings/python/clang/cindex.py#L1599-L1606 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.