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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/style/error_handlers.py | python | DefaultStyleErrorHandler.__init__ | (self, file_path, configuration, increment_error_count,
line_numbers=None) | Create a default style error handler.
Args:
file_path: The path to the file containing the error. This
is used for reporting to the user.
configuration: A StyleProcessorConfiguration instance.
increment_error_count: A function that takes no arguments and
... | Create a default style error handler. | [
"Create",
"a",
"default",
"style",
"error",
"handler",
"."
] | def __init__(self, file_path, configuration, increment_error_count,
line_numbers=None):
"""Create a default style error handler.
Args:
file_path: The path to the file containing the error. This
is used for reporting to the user.
configuration: A... | [
"def",
"__init__",
"(",
"self",
",",
"file_path",
",",
"configuration",
",",
"increment_error_count",
",",
"line_numbers",
"=",
"None",
")",
":",
"if",
"line_numbers",
"is",
"not",
"None",
":",
"line_numbers",
"=",
"set",
"(",
"line_numbers",
")",
"self",
".... | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/error_handlers.py#L59-L87 | ||
hughperkins/EasyCL | d4d47ff25fce4c761c8004ee15ebd12d90ca6f2a | thirdparty/cogapp/cogapp/whiteutils.py | python | commonPrefix | (strings) | return prefix | Find the longest string that is a prefix of all the strings. | Find the longest string that is a prefix of all the strings. | [
"Find",
"the",
"longest",
"string",
"that",
"is",
"a",
"prefix",
"of",
"all",
"the",
"strings",
"."
] | def commonPrefix(strings):
""" Find the longest string that is a prefix of all the strings.
"""
if not strings:
return ''
prefix = strings[0]
for s in strings:
if len(s) < len(prefix):
prefix = prefix[:len(s)]
if not prefix:
return ''
for i in ... | [
"def",
"commonPrefix",
"(",
"strings",
")",
":",
"if",
"not",
"strings",
":",
"return",
"''",
"prefix",
"=",
"strings",
"[",
"0",
"]",
"for",
"s",
"in",
"strings",
":",
"if",
"len",
"(",
"s",
")",
"<",
"len",
"(",
"prefix",
")",
":",
"prefix",
"=... | https://github.com/hughperkins/EasyCL/blob/d4d47ff25fce4c761c8004ee15ebd12d90ca6f2a/thirdparty/cogapp/cogapp/whiteutils.py#L56-L71 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/functions.py | python | Function.is_filesystem_dependent | (self) | return False | Exposes whether this function depends on the filesystem for results.
If True, the function touches the filesystem as part of evaluation.
This only tests whether the function itself uses the filesystem. If
this function has arguments that are functions that touch the
filesystem, this wi... | Exposes whether this function depends on the filesystem for results. | [
"Exposes",
"whether",
"this",
"function",
"depends",
"on",
"the",
"filesystem",
"for",
"results",
"."
] | def is_filesystem_dependent(self):
"""Exposes whether this function depends on the filesystem for results.
If True, the function touches the filesystem as part of evaluation.
This only tests whether the function itself uses the filesystem. If
this function has arguments that are functi... | [
"def",
"is_filesystem_dependent",
"(",
"self",
")",
":",
"return",
"False"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/functions.py#L105-L114 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/text_format.py | python | ParseLines | (lines,
message,
allow_unknown_extension=False,
allow_field_number=False,
descriptor_pool=None) | return parser.ParseLines(lines, message) | Parses a text representation of a protocol message into a message.
Args:
lines: An iterable of lines of a message's text representation.
message: A protocol buffer message to merge into.
allow_unknown_extension: if True, skip over missing extensions and keep
parsing
allow_field_number: if True,... | Parses a text representation of a protocol message into a message. | [
"Parses",
"a",
"text",
"representation",
"of",
"a",
"protocol",
"message",
"into",
"a",
"message",
"."
] | def ParseLines(lines,
message,
allow_unknown_extension=False,
allow_field_number=False,
descriptor_pool=None):
"""Parses a text representation of a protocol message into a message.
Args:
lines: An iterable of lines of a message's text representation.
... | [
"def",
"ParseLines",
"(",
"lines",
",",
"message",
",",
"allow_unknown_extension",
"=",
"False",
",",
"allow_field_number",
"=",
"False",
",",
"descriptor_pool",
"=",
"None",
")",
":",
"parser",
"=",
"_Parser",
"(",
"allow_unknown_extension",
",",
"allow_field_num... | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/text_format.py#L484-L508 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/posixpath.py | python | samefile | (f1, f2) | return samestat(s1, s2) | Test whether two pathnames reference the same actual file | Test whether two pathnames reference the same actual file | [
"Test",
"whether",
"two",
"pathnames",
"reference",
"the",
"same",
"actual",
"file"
] | def samefile(f1, f2):
"""Test whether two pathnames reference the same actual file"""
s1 = os.stat(f1)
s2 = os.stat(f2)
return samestat(s1, s2) | [
"def",
"samefile",
"(",
"f1",
",",
"f2",
")",
":",
"s1",
"=",
"os",
".",
"stat",
"(",
"f1",
")",
"s2",
"=",
"os",
".",
"stat",
"(",
"f2",
")",
"return",
"samestat",
"(",
"s1",
",",
"s2",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/posixpath.py#L160-L164 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | FontMapper_GetEncodingName | (*args, **kwargs) | return _gdi_.FontMapper_GetEncodingName(*args, **kwargs) | FontMapper_GetEncodingName(int encoding) -> String | FontMapper_GetEncodingName(int encoding) -> String | [
"FontMapper_GetEncodingName",
"(",
"int",
"encoding",
")",
"-",
">",
"String"
] | def FontMapper_GetEncodingName(*args, **kwargs):
"""FontMapper_GetEncodingName(int encoding) -> String"""
return _gdi_.FontMapper_GetEncodingName(*args, **kwargs) | [
"def",
"FontMapper_GetEncodingName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"FontMapper_GetEncodingName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L2100-L2102 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGrid.CenterSplitter | (*args, **kwargs) | return _propgrid.PropertyGrid_CenterSplitter(*args, **kwargs) | CenterSplitter(self, bool enableAutoResizing=False) | CenterSplitter(self, bool enableAutoResizing=False) | [
"CenterSplitter",
"(",
"self",
"bool",
"enableAutoResizing",
"=",
"False",
")"
] | def CenterSplitter(*args, **kwargs):
"""CenterSplitter(self, bool enableAutoResizing=False)"""
return _propgrid.PropertyGrid_CenterSplitter(*args, **kwargs) | [
"def",
"CenterSplitter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_CenterSplitter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1999-L2001 | |
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/appController.py | python | AppController._findClosestFrameIndex | (self, timeSample) | return closestIndex | Find the closest frame index for the given `timeSample`.
Args:
timeSample (float): A time sample value.
Returns:
int: The closest matching frame index or 0 if one cannot be
found. | Find the closest frame index for the given `timeSample`. | [
"Find",
"the",
"closest",
"frame",
"index",
"for",
"the",
"given",
"timeSample",
"."
] | def _findClosestFrameIndex(self, timeSample):
"""Find the closest frame index for the given `timeSample`.
Args:
timeSample (float): A time sample value.
Returns:
int: The closest matching frame index or 0 if one cannot be
found.
"""
closestIn... | [
"def",
"_findClosestFrameIndex",
"(",
"self",
",",
"timeSample",
")",
":",
"closestIndex",
"=",
"int",
"(",
"round",
"(",
"(",
"timeSample",
"-",
"self",
".",
"_timeSamples",
"[",
"0",
"]",
")",
"/",
"self",
".",
"step",
")",
")",
"# Bounds checking",
"#... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/appController.py#L1980-L1997 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py | python | _main | () | Display all information sysconfig detains. | Display all information sysconfig detains. | [
"Display",
"all",
"information",
"sysconfig",
"detains",
"."
] | def _main():
"""Display all information sysconfig detains."""
print('Platform: "%s"' % get_platform())
print('Python version: "%s"' % get_python_version())
print('Current installation scheme: "%s"' % _get_default_scheme())
print()
_print_dict('Paths', get_paths())
print()
_print_dict('Va... | [
"def",
"_main",
"(",
")",
":",
"print",
"(",
"'Platform: \"%s\"'",
"%",
"get_platform",
"(",
")",
")",
"print",
"(",
"'Python version: \"%s\"'",
"%",
"get_python_version",
"(",
")",
")",
"print",
"(",
"'Current installation scheme: \"%s\"'",
"%",
"_get_default_schem... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py#L776-L784 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _AddPropertiesForExtensions | (descriptor, cls) | Adds properties for all fields in this protocol message type. | Adds properties for all fields in this protocol message type. | [
"Adds",
"properties",
"for",
"all",
"fields",
"in",
"this",
"protocol",
"message",
"type",
"."
] | def _AddPropertiesForExtensions(descriptor, cls):
"""Adds properties for all fields in this protocol message type."""
extension_dict = descriptor.extensions_by_name
for extension_name, extension_field in extension_dict.iteritems():
constant_name = extension_name.upper() + "_FIELD_NUMBER"
setattr(cls, cons... | [
"def",
"_AddPropertiesForExtensions",
"(",
"descriptor",
",",
"cls",
")",
":",
"extension_dict",
"=",
"descriptor",
".",
"extensions_by_name",
"for",
"extension_name",
",",
"extension_field",
"in",
"extension_dict",
".",
"iteritems",
"(",
")",
":",
"constant_name",
... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L570-L575 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/stats/mstats_basic.py | python | ttest_1samp | (a, popmean, axis=0) | return Ttest_1sampResult(t, prob) | Calculates the T-test for the mean of ONE group of scores.
Parameters
----------
a : array_like
sample observation
popmean : float or array_like
expected value in null hypothesis, if array_like than it must have the
same shape as `a` excluding the axis dimension
axis : int o... | Calculates the T-test for the mean of ONE group of scores. | [
"Calculates",
"the",
"T",
"-",
"test",
"for",
"the",
"mean",
"of",
"ONE",
"group",
"of",
"scores",
"."
] | def ttest_1samp(a, popmean, axis=0):
"""
Calculates the T-test for the mean of ONE group of scores.
Parameters
----------
a : array_like
sample observation
popmean : float or array_like
expected value in null hypothesis, if array_like than it must have the
same shape as ... | [
"def",
"ttest_1samp",
"(",
"a",
",",
"popmean",
",",
"axis",
"=",
"0",
")",
":",
"a",
",",
"axis",
"=",
"_chk_asarray",
"(",
"a",
",",
"axis",
")",
"if",
"a",
".",
"size",
"==",
"0",
":",
"return",
"(",
"np",
".",
"nan",
",",
"np",
".",
"nan"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/mstats_basic.py#L968-L1009 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2B_TEMPLATE.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(TPM2B_TEMPLATE) | Returns new TPM2B_TEMPLATE object constructed from its marshaled
representation in the given byte buffer | Returns new TPM2B_TEMPLATE object constructed from its marshaled
representation in the given byte buffer | [
"Returns",
"new",
"TPM2B_TEMPLATE",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new TPM2B_TEMPLATE object constructed from its marshaled
representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(TPM2B_TEMPLATE) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"TPM2B_TEMPLATE",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L8305-L8309 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/generator/cmake.py | python | CreateCMakeTargetFullName | (qualified_target) | return StringToCMakeTargetName(cmake_target_full_name) | An unambiguous name for the target. | An unambiguous name for the target. | [
"An",
"unambiguous",
"name",
"for",
"the",
"target",
"."
] | def CreateCMakeTargetFullName(qualified_target):
"""An unambiguous name for the target."""
gyp_file, gyp_target_name, gyp_target_toolset = (
gyp.common.ParseQualifiedTarget(qualified_target))
cmake_target_full_name = gyp_file + ':' + gyp_target_name
if gyp_target_toolset and gyp_target_toolset != 'target'... | [
"def",
"CreateCMakeTargetFullName",
"(",
"qualified_target",
")",
":",
"gyp_file",
",",
"gyp_target_name",
",",
"gyp_target_toolset",
"=",
"(",
"gyp",
".",
"common",
".",
"ParseQualifiedTarget",
"(",
"qualified_target",
")",
")",
"cmake_target_full_name",
"=",
"gyp_fi... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/generator/cmake.py#L562-L569 | |
reverbrain/elliptics | 4b4f9b8094d7616c1ec50eb8605edb059b9f228e | recovery/elliptics_recovery/types/dc.py | python | fill_buckets | (ctx, results) | This function distributes keys among multiple files (buckets).
One bucket is 'rest_keys' and other buckets are 'bucket_xx', where xx == group_id.
'bucket_xx' contains newest keys that should be recovered from group xx to other groups
via server_send. If a key could not be recovered with server_send it is pl... | This function distributes keys among multiple files (buckets).
One bucket is 'rest_keys' and other buckets are 'bucket_xx', where xx == group_id.
'bucket_xx' contains newest keys that should be recovered from group xx to other groups
via server_send. If a key could not be recovered with server_send it is pl... | [
"This",
"function",
"distributes",
"keys",
"among",
"multiple",
"files",
"(",
"buckets",
")",
".",
"One",
"bucket",
"is",
"rest_keys",
"and",
"other",
"buckets",
"are",
"bucket_xx",
"where",
"xx",
"==",
"group_id",
".",
"bucket_xx",
"contains",
"newest",
"keys... | def fill_buckets(ctx, results):
'''
This function distributes keys among multiple files (buckets).
One bucket is 'rest_keys' and other buckets are 'bucket_xx', where xx == group_id.
'bucket_xx' contains newest keys that should be recovered from group xx to other groups
via server_send. If a key coul... | [
"def",
"fill_buckets",
"(",
"ctx",
",",
"results",
")",
":",
"newest_key_stats",
"=",
"dict",
"(",
")",
"for",
"_",
",",
"_",
",",
"range_stats",
"in",
"results",
":",
"for",
"group",
",",
"count",
"in",
"range_stats",
".",
"iteritems",
"(",
")",
":",
... | https://github.com/reverbrain/elliptics/blob/4b4f9b8094d7616c1ec50eb8605edb059b9f228e/recovery/elliptics_recovery/types/dc.py#L271-L304 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Plugins/pvblot/blotish.py | python | alltimes | () | Set time selection mode to ALLTIMES | Set time selection mode to ALLTIMES | [
"Set",
"time",
"selection",
"mode",
"to",
"ALLTIMES"
] | def alltimes():
"""Set time selection mode to ALLTIMES"""
state.time_selection.set_alltimes()
state.time_selection.print_show() | [
"def",
"alltimes",
"(",
")",
":",
"state",
".",
"time_selection",
".",
"set_alltimes",
"(",
")",
"state",
".",
"time_selection",
".",
"print_show",
"(",
")"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Plugins/pvblot/blotish.py#L917-L920 | ||
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Type.is_pod | (self) | return conf.lib.clang_isPODType(self) | Determine whether this Type represents plain old data (POD). | Determine whether this Type represents plain old data (POD). | [
"Determine",
"whether",
"this",
"Type",
"represents",
"plain",
"old",
"data",
"(",
"POD",
")",
"."
] | def is_pod(self):
"""Determine whether this Type represents plain old data (POD)."""
return conf.lib.clang_isPODType(self) | [
"def",
"is_pod",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isPODType",
"(",
"self",
")"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1770-L1772 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/poplib.py | python | POP3.user | (self, user) | return self._shortcmd('USER %s' % user) | Send user name, return response
(should indicate password required). | Send user name, return response | [
"Send",
"user",
"name",
"return",
"response"
] | def user(self, user):
"""Send user name, return response
(should indicate password required).
"""
return self._shortcmd('USER %s' % user) | [
"def",
"user",
"(",
"self",
",",
"user",
")",
":",
"return",
"self",
".",
"_shortcmd",
"(",
"'USER %s'",
"%",
"user",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/poplib.py#L182-L187 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pydocview.py | python | DocApp.GetService | (self, type) | return None | Returns the instance of a particular type of service that has been installed
into the DocApp. For example, "wx.GetApp().GetService(pydocview.OptionsService)"
returns the isntance of the OptionsService that is running within the DocApp. | Returns the instance of a particular type of service that has been installed
into the DocApp. For example, "wx.GetApp().GetService(pydocview.OptionsService)"
returns the isntance of the OptionsService that is running within the DocApp. | [
"Returns",
"the",
"instance",
"of",
"a",
"particular",
"type",
"of",
"service",
"that",
"has",
"been",
"installed",
"into",
"the",
"DocApp",
".",
"For",
"example",
"wx",
".",
"GetApp",
"()",
".",
"GetService",
"(",
"pydocview",
".",
"OptionsService",
")",
... | def GetService(self, type):
"""
Returns the instance of a particular type of service that has been installed
into the DocApp. For example, "wx.GetApp().GetService(pydocview.OptionsService)"
returns the isntance of the OptionsService that is running within the DocApp.
"""
... | [
"def",
"GetService",
"(",
"self",
",",
"type",
")",
":",
"for",
"service",
"in",
"self",
".",
"_services",
":",
"if",
"isinstance",
"(",
"service",
",",
"type",
")",
":",
"return",
"service",
"return",
"None"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pydocview.py#L1861-L1870 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/profiler/option_builder.py | python | ProfileOptionBuilder.order_by | (self, attribute) | return self | Order the displayed profiler nodes based on a attribute.
Supported attribute includes micros, bytes, occurrence, params, etc.
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler/g3doc/options.md
Args:
attribute: An attribute the profiler node has.
Returns:
self | Order the displayed profiler nodes based on a attribute. | [
"Order",
"the",
"displayed",
"profiler",
"nodes",
"based",
"on",
"a",
"attribute",
"."
] | def order_by(self, attribute):
# pylint: disable=line-too-long
"""Order the displayed profiler nodes based on a attribute.
Supported attribute includes micros, bytes, occurrence, params, etc.
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/core/profiler/g3doc/options.md
Args:
... | [
"def",
"order_by",
"(",
"self",
",",
"attribute",
")",
":",
"# pylint: disable=line-too-long",
"# pylint: enable=line-too-long",
"self",
".",
"_options",
"[",
"'order_by'",
"]",
"=",
"attribute",
"return",
"self"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/profiler/option_builder.py#L356-L370 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread_BR.py | python | OpenThread_BR.getGUA | (self, filterByPrefix=None, eth=False) | get expected global unicast IPv6 address of Thread device
note: existing filterByPrefix are string of in lowercase. e.g.
'2001' or '2001:0db8:0001:0000".
Args:
filterByPrefix: a given expected global IPv6 prefix to be matched
Returns:
a global IPv6 address | get expected global unicast IPv6 address of Thread device | [
"get",
"expected",
"global",
"unicast",
"IPv6",
"address",
"of",
"Thread",
"device"
] | def getGUA(self, filterByPrefix=None, eth=False):
"""get expected global unicast IPv6 address of Thread device
note: existing filterByPrefix are string of in lowercase. e.g.
'2001' or '2001:0db8:0001:0000".
Args:
filterByPrefix: a given expected global IPv6 prefix to be mat... | [
"def",
"getGUA",
"(",
"self",
",",
"filterByPrefix",
"=",
"None",
",",
"eth",
"=",
"False",
")",
":",
"# get global addrs set if multiple",
"if",
"eth",
":",
"return",
"self",
".",
"__getEthGUA",
"(",
"filterByPrefix",
"=",
"filterByPrefix",
")",
"else",
":",
... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread_BR.py#L473-L489 | ||
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_parser.py | python | p_optfinite | (p) | optfinite : | optfinite : | [
"optfinite",
":"
] | def p_optfinite(p):
'optfinite : '
p[0] = False | [
"def",
"p_optfinite",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"False"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L1293-L1295 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/message.py | python | Message.attach | (self, payload) | Add the given payload to the current payload.
The current payload will always be a list of objects after this method
is called. If you want to set the payload to a scalar object, use
set_payload() instead. | Add the given payload to the current payload. | [
"Add",
"the",
"given",
"payload",
"to",
"the",
"current",
"payload",
"."
] | def attach(self, payload):
"""Add the given payload to the current payload.
The current payload will always be a list of objects after this method
is called. If you want to set the payload to a scalar object, use
set_payload() instead.
"""
if self._payload is None:
... | [
"def",
"attach",
"(",
"self",
",",
"payload",
")",
":",
"if",
"self",
".",
"_payload",
"is",
"None",
":",
"self",
".",
"_payload",
"=",
"[",
"payload",
"]",
"else",
":",
"try",
":",
"self",
".",
"_payload",
".",
"append",
"(",
"payload",
")",
"exce... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/message.py#L197-L211 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/inspect.py | python | Signature._bind | (self, args, kwargs, *, partial=False) | return self._bound_arguments_cls(self, arguments) | Private method. Don't use directly. | Private method. Don't use directly. | [
"Private",
"method",
".",
"Don",
"t",
"use",
"directly",
"."
] | def _bind(self, args, kwargs, *, partial=False):
"""Private method. Don't use directly."""
arguments = {}
parameters = iter(self.parameters.values())
parameters_ex = ()
arg_vals = iter(args)
while True:
# Let's iterate through the positional arguments and c... | [
"def",
"_bind",
"(",
"self",
",",
"args",
",",
"kwargs",
",",
"*",
",",
"partial",
"=",
"False",
")",
":",
"arguments",
"=",
"{",
"}",
"parameters",
"=",
"iter",
"(",
"self",
".",
"parameters",
".",
"values",
"(",
")",
")",
"parameters_ex",
"=",
"(... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/inspect.py#L2909-L3038 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | TextAttr.HasFontItalic | (*args, **kwargs) | return _controls_.TextAttr_HasFontItalic(*args, **kwargs) | HasFontItalic(self) -> bool | HasFontItalic(self) -> bool | [
"HasFontItalic",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasFontItalic(*args, **kwargs):
"""HasFontItalic(self) -> bool"""
return _controls_.TextAttr_HasFontItalic(*args, **kwargs) | [
"def",
"HasFontItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_HasFontItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L1800-L1802 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/infodlg.py | python | FileInfoDlg.OnClose | (self, evt) | Destroy ourselves on closer | Destroy ourselves on closer | [
"Destroy",
"ourselves",
"on",
"closer"
] | def OnClose(self, evt):
"""Destroy ourselves on closer"""
self.Destroy()
evt.Skip() | [
"def",
"OnClose",
"(",
"self",
",",
"evt",
")",
":",
"self",
".",
"Destroy",
"(",
")",
"evt",
".",
"Skip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/infodlg.py#L240-L243 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/tensor_array_ops.py | python | TensorArray._merge_element_shape | (self, shape) | Changes the element shape of the array given a shape to merge with.
Args:
shape: A `TensorShape` object to merge with.
Raises:
ValueError: if the provided shape is incompatible with the current
element shape of the `TensorArray`. | Changes the element shape of the array given a shape to merge with. | [
"Changes",
"the",
"element",
"shape",
"of",
"the",
"array",
"given",
"a",
"shape",
"to",
"merge",
"with",
"."
] | def _merge_element_shape(self, shape):
"""Changes the element shape of the array given a shape to merge with.
Args:
shape: A `TensorShape` object to merge with.
Raises:
ValueError: if the provided shape is incompatible with the current
element shape of the `TensorArray`.
"""
... | [
"def",
"_merge_element_shape",
"(",
"self",
",",
"shape",
")",
":",
"if",
"self",
".",
"_element_shape",
":",
"if",
"not",
"shape",
".",
"is_compatible_with",
"(",
"self",
".",
"_element_shape",
"[",
"0",
"]",
")",
":",
"raise",
"ValueError",
"(",
"\"Incon... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/tensor_array_ops.py#L185-L203 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/json_format.py | python | _Parser._ConvertStructMessage | (self, value, message) | return | Convert a JSON representation into Struct message. | Convert a JSON representation into Struct message. | [
"Convert",
"a",
"JSON",
"representation",
"into",
"Struct",
"message",
"."
] | def _ConvertStructMessage(self, value, message):
"""Convert a JSON representation into Struct message."""
if not isinstance(value, dict):
raise ParseError(
'Struct must be in a dict which is {0}.'.format(value))
# Clear will mark the struct as modified so it will be created even if
# the... | [
"def",
"_ConvertStructMessage",
"(",
"self",
",",
"value",
",",
"message",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"raise",
"ParseError",
"(",
"'Struct must be in a dict which is {0}.'",
".",
"format",
"(",
"value",
")",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/json_format.py#L666-L676 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool.ExecMergeInfoPlist | (self, output, *inputs) | Merge multiple .plist files into a single .plist file. | Merge multiple .plist files into a single .plist file. | [
"Merge",
"multiple",
".",
"plist",
"files",
"into",
"a",
"single",
".",
"plist",
"file",
"."
] | def ExecMergeInfoPlist(self, output, *inputs):
"""Merge multiple .plist files into a single .plist file."""
merged_plist = {}
for path in inputs:
plist = self._LoadPlistMaybeBinary(path)
self._MergePlist(merged_plist, plist)
plistlib.writePlist(merged_plist, outpu... | [
"def",
"ExecMergeInfoPlist",
"(",
"self",
",",
"output",
",",
"*",
"inputs",
")",
":",
"merged_plist",
"=",
"{",
"}",
"for",
"path",
"in",
"inputs",
":",
"plist",
"=",
"self",
".",
"_LoadPlistMaybeBinary",
"(",
"path",
")",
"self",
".",
"_MergePlist",
"(... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/mac_tool.py#L434-L440 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/rcnn/rcnn/pycocotools/coco.py | python | COCO.info | (self) | Print information about the annotation file.
:return: | Print information about the annotation file.
:return: | [
"Print",
"information",
"about",
"the",
"annotation",
"file",
".",
":",
"return",
":"
] | def info(self):
"""
Print information about the annotation file.
:return:
"""
for key, value in self.dataset['info'].items():
print('{}: {}'.format(key, value)) | [
"def",
"info",
"(",
"self",
")",
":",
"for",
"key",
",",
"value",
"in",
"self",
".",
"dataset",
"[",
"'info'",
"]",
".",
"items",
"(",
")",
":",
"print",
"(",
"'{}: {}'",
".",
"format",
"(",
"key",
",",
"value",
")",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/pycocotools/coco.py#L133-L139 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/sessions.py | python | Session.request | (self, method, url,
params=None,
data=None,
headers=None,
cookies=None,
files=None,
auth=None,
timeout=None,
allow_redirects=True,
proxies=None,
hooks=None,
stream=None,
verify=None,
cert=None,
json=None) | return resp | Constructs a :class:`Request <Request>`, prepares it and sends it.
Returns :class:`Response <Response>` object.
:param method: method for the new :class:`Request` object.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the... | Constructs a :class:`Request <Request>`, prepares it and sends it.
Returns :class:`Response <Response>` object. | [
"Constructs",
"a",
":",
"class",
":",
"Request",
"<Request",
">",
"prepares",
"it",
"and",
"sends",
"it",
".",
"Returns",
":",
"class",
":",
"Response",
"<Response",
">",
"object",
"."
] | def request(self, method, url,
params=None,
data=None,
headers=None,
cookies=None,
files=None,
auth=None,
timeout=None,
allow_redirects=True,
proxies=None,
hooks=None,
stream=None,
verify=None,
cert=None,
jso... | [
"def",
"request",
"(",
"self",
",",
"method",
",",
"url",
",",
"params",
"=",
"None",
",",
"data",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"cookies",
"=",
"None",
",",
"files",
"=",
"None",
",",
"auth",
"=",
"None",
",",
"timeout",
"=",
"N... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/sessions.py#L386-L467 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/ops/functions.py | python | Function._replace_args_type_check | (arg_map) | Performs a type-compatibility check for arguments to replace_placeholders() and clone(),
in order to output an actionable error message in case of an error. | Performs a type-compatibility check for arguments to replace_placeholders() and clone(),
in order to output an actionable error message in case of an error. | [
"Performs",
"a",
"type",
"-",
"compatibility",
"check",
"for",
"arguments",
"to",
"replace_placeholders",
"()",
"and",
"clone",
"()",
"in",
"order",
"to",
"output",
"an",
"actionable",
"error",
"message",
"in",
"case",
"of",
"an",
"error",
"."
] | def _replace_args_type_check(arg_map): # type: (Dict[param: Variable, arg: Variable]), param meant to be substituted by arg
'''
Performs a type-compatibility check for arguments to replace_placeholders() and clone(),
in order to output an actionable error message in case of an error.
'''... | [
"def",
"_replace_args_type_check",
"(",
"arg_map",
")",
":",
"# type: (Dict[param: Variable, arg: Variable]), param meant to be substituted by arg",
"for",
"i",
",",
"arg_map_item",
"in",
"enumerate",
"(",
"arg_map",
".",
"items",
"(",
")",
")",
":",
"param",
"=",
"arg_... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/functions.py#L307-L341 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/spectral.py | python | _median_bias | (n) | return 1 + np.sum(1. / (ii_2 + 1) - 1. / ii_2) | Returns the bias of the median of a set of periodograms relative to
the mean.
See arXiv:gr-qc/0509116 Appendix B for details.
Parameters
----------
n : int
Numbers of periodograms being averaged.
Returns
-------
bias : float
Calculated bias. | Returns the bias of the median of a set of periodograms relative to
the mean. | [
"Returns",
"the",
"bias",
"of",
"the",
"median",
"of",
"a",
"set",
"of",
"periodograms",
"relative",
"to",
"the",
"mean",
"."
] | def _median_bias(n):
"""
Returns the bias of the median of a set of periodograms relative to
the mean.
See arXiv:gr-qc/0509116 Appendix B for details.
Parameters
----------
n : int
Numbers of periodograms being averaged.
Returns
-------
bias : float
Calculated ... | [
"def",
"_median_bias",
"(",
"n",
")",
":",
"ii_2",
"=",
"2",
"*",
"np",
".",
"arange",
"(",
"1.",
",",
"(",
"n",
"-",
"1",
")",
"//",
"2",
"+",
"1",
")",
"return",
"1",
"+",
"np",
".",
"sum",
"(",
"1.",
"/",
"(",
"ii_2",
"+",
"1",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/spectral.py#L1988-L2006 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/style_editor.py | python | StyleEditorPanel.ResetTransientStyleData | (self) | Reset the transient style data to mark the changes as not dirty | Reset the transient style data to mark the changes as not dirty | [
"Reset",
"the",
"transient",
"style",
"data",
"to",
"mark",
"the",
"changes",
"as",
"not",
"dirty"
] | def ResetTransientStyleData(self):
"""Reset the transient style data to mark the changes as not dirty"""
self.styles_new = DuplicateStyleDict(self.prebuff.GetStyleSet())
self.styles_orig = DuplicateStyleDict(self.styles_new) | [
"def",
"ResetTransientStyleData",
"(",
"self",
")",
":",
"self",
".",
"styles_new",
"=",
"DuplicateStyleDict",
"(",
"self",
".",
"prebuff",
".",
"GetStyleSet",
"(",
")",
")",
"self",
".",
"styles_orig",
"=",
"DuplicateStyleDict",
"(",
"self",
".",
"styles_new"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/style_editor.py#L544-L547 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Build.py | python | BuildContext.hash_env_vars | (self, env, vars_lst) | return ret | Hash configuration set variables::
def build(bld):
bld.hash_env_vars(bld.env, ['CXX', 'CC'])
:param env: Configuration Set
:type env: :py:class:`waflib.ConfigSet.ConfigSet`
:param vars_lst: list of variables
:type vars_list: list of string | Hash configuration set variables:: | [
"Hash",
"configuration",
"set",
"variables",
"::"
] | def hash_env_vars(self, env, vars_lst):
"""
Hash configuration set variables::
def build(bld):
bld.hash_env_vars(bld.env, ['CXX', 'CC'])
:param env: Configuration Set
:type env: :py:class:`waflib.ConfigSet.ConfigSet`
:param vars_lst: list of variables
:type vars_list: list of string
"""
if not... | [
"def",
"hash_env_vars",
"(",
"self",
",",
"env",
",",
"vars_lst",
")",
":",
"if",
"not",
"env",
".",
"table",
":",
"env",
"=",
"env",
".",
"parent",
"if",
"not",
"env",
":",
"return",
"Utils",
".",
"SIG_NIL",
"idx",
"=",
"str",
"(",
"id",
"(",
"e... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Build.py#L452-L487 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus3.in.py | python | exodus.put_elem_face_conn | (self, blkId, elemFaceConn) | return True | put in connectivity information from elems to faces
>>> status = exo.put_elem_face_conn(blkID, elemFaceConn)
Parameters
----------
<int> blkID id of the elem block to be added
if array_type == 'ctype':
<list<float>> elemFaceConn (ravel... | put in connectivity information from elems to faces | [
"put",
"in",
"connectivity",
"information",
"from",
"elems",
"to",
"faces"
] | def put_elem_face_conn(self, blkId, elemFaceConn):
"""
put in connectivity information from elems to faces
>>> status = exo.put_elem_face_conn(blkID, elemFaceConn)
Parameters
----------
<int> blkID id of the elem block to be added
if a... | [
"def",
"put_elem_face_conn",
"(",
"self",
",",
"blkId",
",",
"elemFaceConn",
")",
":",
"ebType",
"=",
"ctypes",
".",
"c_int",
"(",
"get_entity_type",
"(",
"'EX_ELEM_BLOCK'",
")",
")",
"elem_face_conn",
"=",
"(",
"ctypes",
".",
"c_int",
"*",
"len",
"(",
"el... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L4693-L4719 | |
ukoethe/vigra | 093d57d15c8c237adf1704d96daa6393158ce299 | vigranumpy/lib/tagged_array.py | python | TaggedArray.__getitem__ | (self, index) | return res | x.__getitem__(y) <==> x[y]
In addition to the usual indexing functionality, this function
also updates the axistags of the result array. There are three cases:
* getitem creates a scalar value => no axistags are required
* getitem creates an arrayview => axistags are tra... | x.__getitem__(y) <==> x[y] | [
"x",
".",
"__getitem__",
"(",
"y",
")",
"<",
"==",
">",
"x",
"[",
"y",
"]"
] | def __getitem__(self, index):
'''x.__getitem__(y) <==> x[y]
In addition to the usual indexing functionality, this function
also updates the axistags of the result array. There are three cases:
* getitem creates a scalar value => no axistags are required
* getitem... | [
"def",
"__getitem__",
"(",
"self",
",",
"index",
")",
":",
"res",
"=",
"numpy",
".",
"ndarray",
".",
"__getitem__",
"(",
"self",
",",
"index",
")",
"if",
"res",
"is",
"not",
"self",
"and",
"hasattr",
"(",
"res",
",",
"'axistags'",
")",
":",
"if",
"... | https://github.com/ukoethe/vigra/blob/093d57d15c8c237adf1704d96daa6393158ce299/vigranumpy/lib/tagged_array.py#L363-L380 | |
BitcoinUnlimited/BitcoinUnlimited | 05de381c02eb4bfca94957733acadfa217527f25 | contrib/devtools/benchmark_diff.py | python | BenchmarkFile.__getitem__ | (self, bench_name) | Return the benchmark object (full data) for a benchmark name | Return the benchmark object (full data) for a benchmark name | [
"Return",
"the",
"benchmark",
"object",
"(",
"full",
"data",
")",
"for",
"a",
"benchmark",
"name"
] | def __getitem__(self, bench_name):
"""Return the benchmark object (full data) for a benchmark name"""
try:
return self.benchmarks_by_name[bench_name]
except IndexError:
return None | [
"def",
"__getitem__",
"(",
"self",
",",
"bench_name",
")",
":",
"try",
":",
"return",
"self",
".",
"benchmarks_by_name",
"[",
"bench_name",
"]",
"except",
"IndexError",
":",
"return",
"None"
] | https://github.com/BitcoinUnlimited/BitcoinUnlimited/blob/05de381c02eb4bfca94957733acadfa217527f25/contrib/devtools/benchmark_diff.py#L125-L130 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread.py | python | OpenThreadTHCI.__expect | (self, expected, timeout=5, endswith=False) | Find the `expected` line within `times` tries.
Args:
expected str: the expected string
times int: number of tries | Find the `expected` line within `times` tries. | [
"Find",
"the",
"expected",
"line",
"within",
"times",
"tries",
"."
] | def __expect(self, expected, timeout=5, endswith=False):
"""Find the `expected` line within `times` tries.
Args:
expected str: the expected string
times int: number of tries
"""
self.log('Expecting [%s]' % (expected))
deadline = time.time() + ti... | [
"def",
"__expect",
"(",
"self",
",",
"expected",
",",
"timeout",
"=",
"5",
",",
"endswith",
"=",
"False",
")",
":",
"self",
".",
"log",
"(",
"'Expecting [%s]'",
"%",
"(",
"expected",
")",
")",
"deadline",
"=",
"time",
".",
"time",
"(",
")",
"+",
"t... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L329-L356 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/cmd.py | python | Cmd.parseline | (self, line) | return cmd, arg, line | Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed. | Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed. | [
"Parse",
"the",
"line",
"into",
"a",
"command",
"name",
"and",
"a",
"string",
"containing",
"the",
"arguments",
".",
"Returns",
"a",
"tuple",
"containing",
"(",
"command",
"args",
"line",
")",
".",
"command",
"and",
"args",
"may",
"be",
"None",
"if",
"th... | def parseline(self, line):
"""Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed.
"""
line = line.strip()
if not line:
ret... | [
"def",
"parseline",
"(",
"self",
",",
"line",
")",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"not",
"line",
":",
"return",
"None",
",",
"None",
",",
"line",
"elif",
"line",
"[",
"0",
"]",
"==",
"'?'",
":",
"line",
"=",
"'help '",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/cmd.py#L172-L190 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/db_manager/db_plugins/oracle/connector.py | python | OracleDBConnector.getDefinition | (self, view, objectType) | return res[0] if res else None | Returns definition of the view. | Returns definition of the view. | [
"Returns",
"definition",
"of",
"the",
"view",
"."
] | def getDefinition(self, view, objectType):
"""Returns definition of the view."""
schema, tablename = self.getSchemaTableName(view)
where = u""
if schema:
where = u" AND OWNER={} ".format(
self.quoteString(schema))
# Query to grab a view definition
... | [
"def",
"getDefinition",
"(",
"self",
",",
"view",
",",
"objectType",
")",
":",
"schema",
",",
"tablename",
"=",
"self",
".",
"getSchemaTableName",
"(",
"view",
")",
"where",
"=",
"u\"\"",
"if",
"schema",
":",
"where",
"=",
"u\" AND OWNER={} \"",
".",
"form... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/oracle/connector.py#L1127-L1152 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/sliceviewer/model.py | python | _inplace_transposemd | (workspace, axes) | Transpose a workspace inplace
:param workspace: A reference to an MD workspace
:param axes: The axes parameter for TransposeMD | Transpose a workspace inplace
:param workspace: A reference to an MD workspace
:param axes: The axes parameter for TransposeMD | [
"Transpose",
"a",
"workspace",
"inplace",
":",
"param",
"workspace",
":",
"A",
"reference",
"to",
"an",
"MD",
"workspace",
":",
"param",
"axes",
":",
"The",
"axes",
"parameter",
"for",
"TransposeMD"
] | def _inplace_transposemd(workspace, axes):
"""Transpose a workspace inplace
:param workspace: A reference to an MD workspace
:param axes: The axes parameter for TransposeMD
"""
TransposeMD(InputWorkspace=workspace, OutputWorkspace=workspace, Axes=axes) | [
"def",
"_inplace_transposemd",
"(",
"workspace",
",",
"axes",
")",
":",
"TransposeMD",
"(",
"InputWorkspace",
"=",
"workspace",
",",
"OutputWorkspace",
"=",
"workspace",
",",
"Axes",
"=",
"axes",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/model.py#L677-L682 | ||
openfoamtutorials/OpenFOAM_Tutorials_ | 29e19833aea3f6ee87ecceae3d061b050ee3ed89 | InProgress/MultiElementWing/plot.py | python | processForceFile | (path) | return ret | Returns a list of dicts. | Returns a list of dicts. | [
"Returns",
"a",
"list",
"of",
"dicts",
"."
] | def processForceFile(path):
"""
Returns a list of dicts.
"""
lines = getLinesFromFile(path)
ret = []
for line in lines:
if line.split()[0] != "#":
dct = processForceLine(line)
ret.append(dct)
return ret | [
"def",
"processForceFile",
"(",
"path",
")",
":",
"lines",
"=",
"getLinesFromFile",
"(",
"path",
")",
"ret",
"=",
"[",
"]",
"for",
"line",
"in",
"lines",
":",
"if",
"line",
".",
"split",
"(",
")",
"[",
"0",
"]",
"!=",
"\"#\"",
":",
"dct",
"=",
"p... | https://github.com/openfoamtutorials/OpenFOAM_Tutorials_/blob/29e19833aea3f6ee87ecceae3d061b050ee3ed89/InProgress/MultiElementWing/plot.py#L34-L44 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/lib/sessions.py | python | Session.keys | (self) | return self._data.keys() | D.keys() -> list of D's keys. | D.keys() -> list of D's keys. | [
"D",
".",
"keys",
"()",
"-",
">",
"list",
"of",
"D",
"s",
"keys",
"."
] | def keys(self):
"""D.keys() -> list of D's keys."""
if not self.loaded: self.load()
return self._data.keys() | [
"def",
"keys",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"loaded",
":",
"self",
".",
"load",
"(",
")",
"return",
"self",
".",
"_data",
".",
"keys",
"(",
")"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/sessions.py#L314-L317 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | 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/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/bindings/python/clang/cindex.py#L3077-L3088 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/summary_ops_v2.py | python | _should_record_summaries_v2 | () | return _should_record_summaries_internal(default_state=True) | Returns boolean Tensor which is true if summaries should be recorded.
If no recording status has been set, this defaults to True, unlike the public
should_record_summaries(). | Returns boolean Tensor which is true if summaries should be recorded. | [
"Returns",
"boolean",
"Tensor",
"which",
"is",
"true",
"if",
"summaries",
"should",
"be",
"recorded",
"."
] | def _should_record_summaries_v2():
"""Returns boolean Tensor which is true if summaries should be recorded.
If no recording status has been set, this defaults to True, unlike the public
should_record_summaries().
"""
return _should_record_summaries_internal(default_state=True) | [
"def",
"_should_record_summaries_v2",
"(",
")",
":",
"return",
"_should_record_summaries_internal",
"(",
"default_state",
"=",
"True",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/summary_ops_v2.py#L86-L92 | |
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Diagnostic.disable_option | (self) | return conf.lib.clang_getCString(disable) | The command-line option that disables this diagnostic. | The command-line option that disables this diagnostic. | [
"The",
"command",
"-",
"line",
"option",
"that",
"disables",
"this",
"diagnostic",
"."
] | def disable_option(self):
"""The command-line option that disables this diagnostic."""
disable = _CXString()
conf.lib.clang_getDiagnosticOption(self, byref(disable))
return conf.lib.clang_getCString(disable) | [
"def",
"disable_option",
"(",
"self",
")",
":",
"disable",
"=",
"_CXString",
"(",
")",
"conf",
".",
"lib",
".",
"clang_getDiagnosticOption",
"(",
"self",
",",
"byref",
"(",
"disable",
")",
")",
"return",
"conf",
".",
"lib",
".",
"clang_getCString",
"(",
... | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L355-L360 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/utils.py | python | LRUCache.__reversed__ | (self) | return iter(tuple(self._queue)) | Iterate over the values in the cache dict, oldest items
coming first. | Iterate over the values in the cache dict, oldest items
coming first. | [
"Iterate",
"over",
"the",
"values",
"in",
"the",
"cache",
"dict",
"oldest",
"items",
"coming",
"first",
"."
] | def __reversed__(self):
"""Iterate over the values in the cache dict, oldest items
coming first.
"""
return iter(tuple(self._queue)) | [
"def",
"__reversed__",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"tuple",
"(",
"self",
".",
"_queue",
")",
")"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/utils.py#L474-L478 | |
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/targets.py | python | AbstractTarget.name | (self) | return self.name_ | Returns the name of this target. | Returns the name of this target. | [
"Returns",
"the",
"name",
"of",
"this",
"target",
"."
] | def name (self):
""" Returns the name of this target.
"""
return self.name_ | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"name_"
] | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/targets.py#L296-L299 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/sparse/array.py | python | SparseArray.any | (self, axis=0, *args, **kwargs) | return values.any().item() | Tests whether at least one of elements evaluate True
Returns
-------
any : bool
See Also
--------
numpy.any | Tests whether at least one of elements evaluate True | [
"Tests",
"whether",
"at",
"least",
"one",
"of",
"elements",
"evaluate",
"True"
] | def any(self, axis=0, *args, **kwargs):
"""
Tests whether at least one of elements evaluate True
Returns
-------
any : bool
See Also
--------
numpy.any
"""
nv.validate_any(args, kwargs)
values = self.sp_values
if len(val... | [
"def",
"any",
"(",
"self",
",",
"axis",
"=",
"0",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"nv",
".",
"validate_any",
"(",
"args",
",",
"kwargs",
")",
"values",
"=",
"self",
".",
"sp_values",
"if",
"len",
"(",
"values",
")",
"!=",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/sparse/array.py#L1198-L1217 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/integrate/_ode.py | python | complex_ode.set_solout | (self, solout) | Set callable to be called at every successful integration step.
Parameters
----------
solout : callable
``solout(t, y)`` is called at each internal integrator step,
t is a scalar providing the current independent position
y is the current soloution ``y.shape ... | Set callable to be called at every successful integration step. | [
"Set",
"callable",
"to",
"be",
"called",
"at",
"every",
"successful",
"integration",
"step",
"."
] | def set_solout(self, solout):
"""
Set callable to be called at every successful integration step.
Parameters
----------
solout : callable
``solout(t, y)`` is called at each internal integrator step,
t is a scalar providing the current independent position... | [
"def",
"set_solout",
"(",
"self",
",",
"solout",
")",
":",
"if",
"self",
".",
"_integrator",
".",
"supports_solout",
":",
"self",
".",
"_integrator",
".",
"set_solout",
"(",
"solout",
",",
"complex",
"=",
"True",
")",
"else",
":",
"raise",
"TypeError",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/integrate/_ode.py#L725-L743 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py | python | ParserElement.addParseAction | ( self, *fns, **kwargs ) | return self | Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}.
See examples in L{I{copy}<copy>}. | Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}.
See examples in L{I{copy}<copy>}. | [
"Add",
"one",
"or",
"more",
"parse",
"actions",
"to",
"expression",
"s",
"list",
"of",
"parse",
"actions",
".",
"See",
"L",
"{",
"I",
"{",
"setParseAction",
"}",
"<setParseAction",
">",
"}",
".",
"See",
"examples",
"in",
"L",
"{",
"I",
"{",
"copy",
"... | def addParseAction( self, *fns, **kwargs ):
"""
Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}<setParseAction>}.
See examples in L{I{copy}<copy>}.
"""
self.parseAction += list(map(_trim_arity, list(fns)))
self.callDur... | [
"def",
"addParseAction",
"(",
"self",
",",
"*",
"fns",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"parseAction",
"+=",
"list",
"(",
"map",
"(",
"_trim_arity",
",",
"list",
"(",
"fns",
")",
")",
")",
"self",
".",
"callDuringTry",
"=",
"self",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L1288-L1296 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/ccompiler.py | python | CCompiler.compile | (self, sources, output_dir=None, macros=None,
include_dirs=None, debug=0, extra_preargs=None,
extra_postargs=None, depends=None) | return objects | Compile one or more source files.
'sources' must be a list of filenames, most likely C/C++
files, but in reality anything that can be handled by a
particular compiler and compiler class (eg. MSVCCompiler can
handle resource files in 'sources'). Return a list of object
filenames... | Compile one or more source files. | [
"Compile",
"one",
"or",
"more",
"source",
"files",
"."
] | def compile(self, sources, output_dir=None, macros=None,
include_dirs=None, debug=0, extra_preargs=None,
extra_postargs=None, depends=None):
"""Compile one or more source files.
'sources' must be a list of filenames, most likely C/C++
files, but in reality anythi... | [
"def",
"compile",
"(",
"self",
",",
"sources",
",",
"output_dir",
"=",
"None",
",",
"macros",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"debug",
"=",
"0",
",",
"extra_preargs",
"=",
"None",
",",
"extra_postargs",
"=",
"None",
",",
"depends",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/ccompiler.py#L511-L577 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/parser.py | python | Parser.free_identifier | (self, lineno=None) | return rv | Return a new free identifier as :class:`~jinja2.nodes.InternalName`. | Return a new free identifier as :class:`~jinja2.nodes.InternalName`. | [
"Return",
"a",
"new",
"free",
"identifier",
"as",
":",
"class",
":",
"~jinja2",
".",
"nodes",
".",
"InternalName",
"."
] | def free_identifier(self, lineno=None):
"""Return a new free identifier as :class:`~jinja2.nodes.InternalName`."""
self._last_identifier += 1
rv = object.__new__(nodes.InternalName)
nodes.Node.__init__(rv, 'fi%d' % self._last_identifier, lineno=lineno)
return rv | [
"def",
"free_identifier",
"(",
"self",
",",
"lineno",
"=",
"None",
")",
":",
"self",
".",
"_last_identifier",
"+=",
"1",
"rv",
"=",
"object",
".",
"__new__",
"(",
"nodes",
".",
"InternalName",
")",
"nodes",
".",
"Node",
".",
"__init__",
"(",
"rv",
",",... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/parser.py#L114-L119 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/module/python_module.py | python | PythonModule.update_metric | (self, eval_metric, labels, pre_sliced=False) | Evaluates and accumulates evaluation metric on outputs of the last forward computation.
Subclass should override this method if needed.
Parameters
----------
eval_metric : EvalMetric
labels : list of NDArray
Typically ``data_batch.label``. | Evaluates and accumulates evaluation metric on outputs of the last forward computation.
Subclass should override this method if needed. | [
"Evaluates",
"and",
"accumulates",
"evaluation",
"metric",
"on",
"outputs",
"of",
"the",
"last",
"forward",
"computation",
".",
"Subclass",
"should",
"override",
"this",
"method",
"if",
"needed",
"."
] | def update_metric(self, eval_metric, labels, pre_sliced=False):
"""Evaluates and accumulates evaluation metric on outputs of the last forward computation.
Subclass should override this method if needed.
Parameters
----------
eval_metric : EvalMetric
labels : list of NDAr... | [
"def",
"update_metric",
"(",
"self",
",",
"eval_metric",
",",
"labels",
",",
"pre_sliced",
"=",
"False",
")",
":",
"if",
"self",
".",
"_label_shapes",
"is",
"None",
":",
"# since we do not need labels, we are probably not a module with a loss",
"# function or predictions,... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/python_module.py#L141-L160 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_policybase.py | python | Policy.header_max_count | (self, name) | return None | Return the maximum allowed number of headers named 'name'.
Called when a header is added to a Message object. If the returned
value is not 0 or None, and there are already a number of headers with
the name 'name' equal to the value returned, a ValueError is raised.
Because the default... | Return the maximum allowed number of headers named 'name'. | [
"Return",
"the",
"maximum",
"allowed",
"number",
"of",
"headers",
"named",
"name",
"."
] | def header_max_count(self, name):
"""Return the maximum allowed number of headers named 'name'.
Called when a header is added to a Message object. If the returned
value is not 0 or None, and there are already a number of headers with
the name 'name' equal to the value returned, a Value... | [
"def",
"header_max_count",
"(",
"self",
",",
"name",
")",
":",
"return",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_policybase.py#L201-L218 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/debug/cli/curses_ui.py | python | CursesUI._screen_draw_text_line | (self, row, line, attr=curses.A_NORMAL, color=None) | Render a line of text on the screen.
Args:
row: (int) Row index.
line: (str) The line content.
attr: curses font attribute.
color: (str) font foreground color name.
Raises:
TypeError: If row is not of type int. | Render a line of text on the screen. | [
"Render",
"a",
"line",
"of",
"text",
"on",
"the",
"screen",
"."
] | def _screen_draw_text_line(self, row, line, attr=curses.A_NORMAL, color=None):
"""Render a line of text on the screen.
Args:
row: (int) Row index.
line: (str) The line content.
attr: curses font attribute.
color: (str) font foreground color name.
Raises:
TypeError: If row is ... | [
"def",
"_screen_draw_text_line",
"(",
"self",
",",
"row",
",",
"line",
",",
"attr",
"=",
"curses",
".",
"A_NORMAL",
",",
"color",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"row",
",",
"int",
")",
":",
"raise",
"TypeError",
"(",
"\"Invalid ... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/cli/curses_ui.py#L941-L964 | ||
bryanyzhu/Hidden-Two-Stream | f7f684adbdacb6df6b1cf196c3a476cd23484a0f | scripts/cpp_lint.py | python | _SetVerboseLevel | (level) | return _cpplint_state.SetVerboseLevel(level) | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def _SetVerboseLevel(level):
"""Sets the module's verbosity, and returns the previous setting."""
return _cpplint_state.SetVerboseLevel(level) | [
"def",
"_SetVerboseLevel",
"(",
"level",
")",
":",
"return",
"_cpplint_state",
".",
"SetVerboseLevel",
"(",
"level",
")"
] | https://github.com/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/scripts/cpp_lint.py#L782-L784 | |
BVLC/caffe | 9b891540183ddc834a02b2bd81b31afae71b2153 | scripts/cpp_lint.py | python | _Filters | () | return _cpplint_state.filters | Returns the module's list of output filters, as a list. | Returns the module's list of output filters, as a list. | [
"Returns",
"the",
"module",
"s",
"list",
"of",
"output",
"filters",
"as",
"a",
"list",
"."
] | def _Filters():
"""Returns the module's list of output filters, as a list."""
return _cpplint_state.filters | [
"def",
"_Filters",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"filters"
] | https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/scripts/cpp_lint.py#L796-L798 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/_arraytools.py | python | zero_ext | (x, n, axis=-1) | return ext | Zero padding at the boundaries of an array
Generate a new ndarray that is a zero padded extension of `x` along
an axis.
Parameters
----------
x : ndarray
The array to be extended.
n : int
The number of elements by which to extend `x` at each end of the
axis.
axis : ... | Zero padding at the boundaries of an array | [
"Zero",
"padding",
"at",
"the",
"boundaries",
"of",
"an",
"array"
] | def zero_ext(x, n, axis=-1):
"""
Zero padding at the boundaries of an array
Generate a new ndarray that is a zero padded extension of `x` along
an axis.
Parameters
----------
x : ndarray
The array to be extended.
n : int
The number of elements by which to extend `x` at ... | [
"def",
"zero_ext",
"(",
"x",
",",
"n",
",",
"axis",
"=",
"-",
"1",
")",
":",
"if",
"n",
"<",
"1",
":",
"return",
"x",
"zeros_shape",
"=",
"list",
"(",
"x",
".",
"shape",
")",
"zeros_shape",
"[",
"axis",
"]",
"=",
"n",
"zeros",
"=",
"np",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/_arraytools.py#L212-L243 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | Path.dirname | (self) | The directory part of the path.
This is the path without the basename. Throws if the path has
no components.
>>> Path('foo/bar/baz').dirname()
Path("foo/bar")
>>> Path('foo').dirname()
Path(".") | The directory part of the path. | [
"The",
"directory",
"part",
"of",
"the",
"path",
"."
] | def dirname(self):
"""The directory part of the path.
This is the path without the basename. Throws if the path has
no components.
>>> Path('foo/bar/baz').dirname()
Path("foo/bar")
>>> Path('foo').dirname()
Path(".")
"""
if len(self.__path) == 1:
return Path.dot
else:
... | [
"def",
"dirname",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"__path",
")",
"==",
"1",
":",
"return",
"Path",
".",
"dot",
"else",
":",
"return",
"Path",
"(",
"self",
".",
"__path",
"[",
"0",
":",
"-",
"1",
"]",
",",
"absolute",
"=",
... | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L872-L889 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | PrintDialogData.SetCollate | (*args, **kwargs) | return _windows_.PrintDialogData_SetCollate(*args, **kwargs) | SetCollate(self, bool flag) | SetCollate(self, bool flag) | [
"SetCollate",
"(",
"self",
"bool",
"flag",
")"
] | def SetCollate(*args, **kwargs):
"""SetCollate(self, bool flag)"""
return _windows_.PrintDialogData_SetCollate(*args, **kwargs) | [
"def",
"SetCollate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintDialogData_SetCollate",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L5106-L5108 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.ComputeMacBundleOutput | (self, spec) | return os.path.join(path, self.xcode_settings.GetWrapperName()) | Return the 'output' (full output path) to a bundle output directory. | Return the 'output' (full output path) to a bundle output directory. | [
"Return",
"the",
"output",
"(",
"full",
"output",
"path",
")",
"to",
"a",
"bundle",
"output",
"directory",
"."
] | def ComputeMacBundleOutput(self, spec):
"""Return the 'output' (full output path) to a bundle output directory."""
assert self.is_mac_bundle
path = generator_default_variables['PRODUCT_DIR']
return os.path.join(path, self.xcode_settings.GetWrapperName()) | [
"def",
"ComputeMacBundleOutput",
"(",
"self",
",",
"spec",
")",
":",
"assert",
"self",
".",
"is_mac_bundle",
"path",
"=",
"generator_default_variables",
"[",
"'PRODUCT_DIR'",
"]",
"return",
"os",
".",
"path",
".",
"join",
"(",
"path",
",",
"self",
".",
"xcod... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L1417-L1421 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/sparse/linalg/_norm.py | python | norm | (x, ord=None, axis=None) | Norm of a sparse matrix
This function is able to return one of seven different matrix norms,
depending on the value of the ``ord`` parameter.
Parameters
----------
x : a sparse matrix
Input sparse matrix.
ord : {non-zero int, inf, -inf, 'fro'}, optional
Order of the norm (see t... | Norm of a sparse matrix | [
"Norm",
"of",
"a",
"sparse",
"matrix"
] | def norm(x, ord=None, axis=None):
"""
Norm of a sparse matrix
This function is able to return one of seven different matrix norms,
depending on the value of the ``ord`` parameter.
Parameters
----------
x : a sparse matrix
Input sparse matrix.
ord : {non-zero int, inf, -inf, 'fr... | [
"def",
"norm",
"(",
"x",
",",
"ord",
"=",
"None",
",",
"axis",
"=",
"None",
")",
":",
"if",
"not",
"issparse",
"(",
"x",
")",
":",
"raise",
"TypeError",
"(",
"\"input is not sparse. use numpy.linalg.norm\"",
")",
"# Check the default case first and handle it immed... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/sparse/linalg/_norm.py#L22-L184 | ||
FEniCS/dolfinx | 3dfdf038cccdb70962865b58a63bf29c2e55ec6e | python/dolfinx/fem/bcs.py | python | locate_dofs_geometrical | (V: typing.Iterable[typing.Union[_cpp.fem.FunctionSpace, FunctionSpace]],
marker: types.FunctionType) | Locate degrees-of-freedom geometrically using a marker function.
Args:
V: Function space(s) in which to search for degree-of-freedom indices.
marker: A function that takes an array of points ``x`` with shape
``(gdim, num_points)`` and returns an array of booleans of
length `... | Locate degrees-of-freedom geometrically using a marker function. | [
"Locate",
"degrees",
"-",
"of",
"-",
"freedom",
"geometrically",
"using",
"a",
"marker",
"function",
"."
] | def locate_dofs_geometrical(V: typing.Iterable[typing.Union[_cpp.fem.FunctionSpace, FunctionSpace]],
marker: types.FunctionType) -> np.ndarray:
"""Locate degrees-of-freedom geometrically using a marker function.
Args:
V: Function space(s) in which to search for degree-of-fre... | [
"def",
"locate_dofs_geometrical",
"(",
"V",
":",
"typing",
".",
"Iterable",
"[",
"typing",
".",
"Union",
"[",
"_cpp",
".",
"fem",
".",
"FunctionSpace",
",",
"FunctionSpace",
"]",
"]",
",",
"marker",
":",
"types",
".",
"FunctionType",
")",
"->",
"np",
"."... | https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/fem/bcs.py#L27-L63 | ||
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/message.py | python | Message.IsInitialized | (self) | Checks if the message is initialized.
Returns:
The method returns True if the message is initialized (i.e. all of its
required fields are set). | Checks if the message is initialized. | [
"Checks",
"if",
"the",
"message",
"is",
"initialized",
"."
] | def IsInitialized(self):
"""Checks if the message is initialized.
Returns:
The method returns True if the message is initialized (i.e. all of its
required fields are set).
"""
raise NotImplementedError | [
"def",
"IsInitialized",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/message.py#L133-L140 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetPerTargetSetting | (self, setting, default=None) | return result | Tries to get xcode_settings.setting from spec. Assumes that the setting
has the same value in all configurations and throws otherwise. | Tries to get xcode_settings.setting from spec. Assumes that the setting
has the same value in all configurations and throws otherwise. | [
"Tries",
"to",
"get",
"xcode_settings",
".",
"setting",
"from",
"spec",
".",
"Assumes",
"that",
"the",
"setting",
"has",
"the",
"same",
"value",
"in",
"all",
"configurations",
"and",
"throws",
"otherwise",
"."
] | def GetPerTargetSetting(self, setting, default=None):
"""Tries to get xcode_settings.setting from spec. Assumes that the setting
has the same value in all configurations and throws otherwise."""
is_first_pass = True
result = None
for configname in sorted(self.xcode_settings.keys()):
if is_f... | [
"def",
"GetPerTargetSetting",
"(",
"self",
",",
"setting",
",",
"default",
"=",
"None",
")",
":",
"is_first_pass",
"=",
"True",
"result",
"=",
"None",
"for",
"configname",
"in",
"sorted",
"(",
"self",
".",
"xcode_settings",
".",
"keys",
"(",
")",
")",
":... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L892-L907 | |
osrf/gazebo | f570338107862253229a0514ffea10deab4f4517 | tools/cpplint.py | python | _FunctionState.Begin | (self, function_name) | Start analyzing function body.
Args:
function_name: The name of the function being tracked. | Start analyzing function body. | [
"Start",
"analyzing",
"function",
"body",
"."
] | def Begin(self, function_name):
"""Start analyzing function body.
Args:
function_name: The name of the function being tracked.
"""
self.in_a_function = True
self.lines_in_function = 0
self.current_function = function_name | [
"def",
"Begin",
"(",
"self",
",",
"function_name",
")",
":",
"self",
".",
"in_a_function",
"=",
"True",
"self",
".",
"lines_in_function",
"=",
"0",
"self",
".",
"current_function",
"=",
"function_name"
] | https://github.com/osrf/gazebo/blob/f570338107862253229a0514ffea10deab4f4517/tools/cpplint.py#L624-L632 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py | python | PKey.type | (self) | return _lib.EVP_PKEY_id(self._pkey) | Returns the type of the key
:return: The type of the key. | Returns the type of the key | [
"Returns",
"the",
"type",
"of",
"the",
"key"
] | def type(self):
"""
Returns the type of the key
:return: The type of the key.
"""
return _lib.EVP_PKEY_id(self._pkey) | [
"def",
"type",
"(",
"self",
")",
":",
"return",
"_lib",
".",
"EVP_PKEY_id",
"(",
"self",
".",
"_pkey",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py#L352-L358 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/aui.py | python | AuiPaneInfo.PinButton | (*args, **kwargs) | return _aui.AuiPaneInfo_PinButton(*args, **kwargs) | PinButton(self, bool visible=True) -> AuiPaneInfo | PinButton(self, bool visible=True) -> AuiPaneInfo | [
"PinButton",
"(",
"self",
"bool",
"visible",
"=",
"True",
")",
"-",
">",
"AuiPaneInfo"
] | def PinButton(*args, **kwargs):
"""PinButton(self, bool visible=True) -> AuiPaneInfo"""
return _aui.AuiPaneInfo_PinButton(*args, **kwargs) | [
"def",
"PinButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_PinButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L469-L471 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/site.py | python | execusercustomize | () | Run custom user specific code, if available. | Run custom user specific code, if available. | [
"Run",
"custom",
"user",
"specific",
"code",
"if",
"available",
"."
] | def execusercustomize():
"""Run custom user specific code, if available."""
try:
try:
import usercustomize
except ImportError as exc:
if exc.name == 'usercustomize':
pass
else:
raise
except Exception as err:
if sys.f... | [
"def",
"execusercustomize",
"(",
")",
":",
"try",
":",
"try",
":",
"import",
"usercustomize",
"except",
"ImportError",
"as",
"exc",
":",
"if",
"exc",
".",
"name",
"==",
"'usercustomize'",
":",
"pass",
"else",
":",
"raise",
"except",
"Exception",
"as",
"err... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/site.py#L537-L554 | ||
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Utilities/Templates/Modules/Scripted/TemplateKey.py | python | TemplateKeyLogic.run | (self, inputVolume, outputVolume, imageThreshold, enableScreenshots=0) | return True | Run the actual algorithm | Run the actual algorithm | [
"Run",
"the",
"actual",
"algorithm"
] | def run(self, inputVolume, outputVolume, imageThreshold, enableScreenshots=0):
"""
Run the actual algorithm
"""
if not self.isValidInputOutputData(inputVolume, outputVolume):
slicer.util.errorDisplay('Input volume is the same as output volume. Choose a different output volume.')
return Fals... | [
"def",
"run",
"(",
"self",
",",
"inputVolume",
",",
"outputVolume",
",",
"imageThreshold",
",",
"enableScreenshots",
"=",
"0",
")",
":",
"if",
"not",
"self",
".",
"isValidInputOutputData",
"(",
"inputVolume",
",",
"outputVolume",
")",
":",
"slicer",
".",
"ut... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Utilities/Templates/Modules/Scripted/TemplateKey.py#L177-L198 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/stat.py | python | S_ISLNK | (mode) | return S_IFMT(mode) == S_IFLNK | Return True if mode is from a symbolic link. | Return True if mode is from a symbolic link. | [
"Return",
"True",
"if",
"mode",
"is",
"from",
"a",
"symbolic",
"link",
"."
] | def S_ISLNK(mode):
"""Return True if mode is from a symbolic link."""
return S_IFMT(mode) == S_IFLNK | [
"def",
"S_ISLNK",
"(",
"mode",
")",
":",
"return",
"S_IFMT",
"(",
"mode",
")",
"==",
"S_IFLNK"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/stat.py#L70-L72 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/train/callback/_summary_collector.py | python | SummaryCollector._check_collect_landscape_data | (self, collect_landscape) | Check collect landscape data type and value. | Check collect landscape data type and value. | [
"Check",
"collect",
"landscape",
"data",
"type",
"and",
"value",
"."
] | def _check_collect_landscape_data(self, collect_landscape):
"""Check collect landscape data type and value."""
unexpected_params = set(collect_landscape) - set(self._DEFAULT_SPECIFIED_DATA["collect_landscape"])
if unexpected_params:
raise ValueError(f'For `collect_landscape` the keys... | [
"def",
"_check_collect_landscape_data",
"(",
"self",
",",
"collect_landscape",
")",
":",
"unexpected_params",
"=",
"set",
"(",
"collect_landscape",
")",
"-",
"set",
"(",
"self",
".",
"_DEFAULT_SPECIFIED_DATA",
"[",
"\"collect_landscape\"",
"]",
")",
"if",
"unexpecte... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/callback/_summary_collector.py#L405-L420 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Show/mTempoVis.py | python | TempoVis.hide_all_dependencies | (self, doc_obj) | hide_all_dependencies(doc_obj): hides all objects that doc_obj depends on (directly and indirectly). | hide_all_dependencies(doc_obj): hides all objects that doc_obj depends on (directly and indirectly). | [
"hide_all_dependencies",
"(",
"doc_obj",
")",
":",
"hides",
"all",
"objects",
"that",
"doc_obj",
"depends",
"on",
"(",
"directly",
"and",
"indirectly",
")",
"."
] | def hide_all_dependencies(self, doc_obj):
'''hide_all_dependencies(doc_obj): hides all objects that doc_obj depends on (directly and indirectly).'''
from .DepGraphTools import getAllDependencies, getAllDependent
self.hide(self._3D_objects(getAllDependencies(doc_obj))) | [
"def",
"hide_all_dependencies",
"(",
"self",
",",
"doc_obj",
")",
":",
"from",
".",
"DepGraphTools",
"import",
"getAllDependencies",
",",
"getAllDependent",
"self",
".",
"hide",
"(",
"self",
".",
"_3D_objects",
"(",
"getAllDependencies",
"(",
"doc_obj",
")",
")"... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Show/mTempoVis.py#L353-L356 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiManagerEvent.SetPane | (*args, **kwargs) | return _aui.AuiManagerEvent_SetPane(*args, **kwargs) | SetPane(self, AuiPaneInfo p) | SetPane(self, AuiPaneInfo p) | [
"SetPane",
"(",
"self",
"AuiPaneInfo",
"p",
")"
] | def SetPane(*args, **kwargs):
"""SetPane(self, AuiPaneInfo p)"""
return _aui.AuiManagerEvent_SetPane(*args, **kwargs) | [
"def",
"SetPane",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiManagerEvent_SetPane",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L819-L821 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | Grid.DeselectCol | (*args, **kwargs) | return _grid.Grid_DeselectCol(*args, **kwargs) | DeselectCol(self, int col) | DeselectCol(self, int col) | [
"DeselectCol",
"(",
"self",
"int",
"col",
")"
] | def DeselectCol(*args, **kwargs):
"""DeselectCol(self, int col)"""
return _grid.Grid_DeselectCol(*args, **kwargs) | [
"def",
"DeselectCol",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_DeselectCol",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L2081-L2083 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PGProperty.SetName | (*args, **kwargs) | return _propgrid.PGProperty_SetName(*args, **kwargs) | SetName(self, String newName) | SetName(self, String newName) | [
"SetName",
"(",
"self",
"String",
"newName",
")"
] | def SetName(*args, **kwargs):
"""SetName(self, String newName)"""
return _propgrid.PGProperty_SetName(*args, **kwargs) | [
"def",
"SetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_SetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L754-L756 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/html5lib/treewalkers/base.py | python | TreeWalker.doctype | (self, name, publicId=None, systemId=None) | return {"type": "Doctype",
"name": name,
"publicId": publicId,
"systemId": systemId} | Generates a Doctype token
:arg name:
:arg publicId:
:arg systemId:
:returns: the Doctype token | Generates a Doctype token | [
"Generates",
"a",
"Doctype",
"token"
] | def doctype(self, name, publicId=None, systemId=None):
"""Generates a Doctype token
:arg name:
:arg publicId:
:arg systemId:
:returns: the Doctype token
"""
return {"type": "Doctype",
"name": name,
"publicId": publicId,
... | [
"def",
"doctype",
"(",
"self",
",",
"name",
",",
"publicId",
"=",
"None",
",",
"systemId",
"=",
"None",
")",
":",
"return",
"{",
"\"type\"",
":",
"\"Doctype\"",
",",
"\"name\"",
":",
"name",
",",
"\"publicId\"",
":",
"publicId",
",",
"\"systemId\"",
":",... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/html5lib/treewalkers/base.py#L148-L163 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.option_get | (self, name, className) | return self.tk.call('option', 'get', self._w, name, className) | Return the value for an option NAME for this widget
with CLASSNAME.
Values with higher priority override lower values. | Return the value for an option NAME for this widget
with CLASSNAME. | [
"Return",
"the",
"value",
"for",
"an",
"option",
"NAME",
"for",
"this",
"widget",
"with",
"CLASSNAME",
"."
] | def option_get(self, name, className):
"""Return the value for an option NAME for this widget
with CLASSNAME.
Values with higher priority override lower values."""
return self.tk.call('option', 'get', self._w, name, className) | [
"def",
"option_get",
"(",
"self",
",",
"name",
",",
"className",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"'option'",
",",
"'get'",
",",
"self",
".",
"_w",
",",
"name",
",",
"className",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L713-L718 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | StaticText.GetClassDefaultAttributes | (*args, **kwargs) | return _controls_.StaticText_GetClassDefaultAttributes(*args, **kwargs) | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
co... | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def GetClassDefaultAttributes(*args, **kwargs):
"""
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control... | [
"def",
"GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"StaticText_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1023-L1038 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/intercept.py | python | format_entry | (exec_trace) | Generate the desired fields for compilation database entries. | Generate the desired fields for compilation database entries. | [
"Generate",
"the",
"desired",
"fields",
"for",
"compilation",
"database",
"entries",
"."
] | def format_entry(exec_trace):
""" Generate the desired fields for compilation database entries. """
def abspath(cwd, name):
""" Create normalized absolute path from input filename. """
fullname = name if os.path.isabs(name) else os.path.join(cwd, name)
return os.path.normpath(fullname)
... | [
"def",
"format_entry",
"(",
"exec_trace",
")",
":",
"def",
"abspath",
"(",
"cwd",
",",
"name",
")",
":",
"\"\"\" Create normalized absolute path from input filename. \"\"\"",
"fullname",
"=",
"name",
"if",
"os",
".",
"path",
".",
"isabs",
"(",
"name",
")",
"else... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/intercept.py#L212-L231 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typing/bufproto.py | python | infer_layout | (val) | return 'A' | Infer layout of the given memoryview *val*. | Infer layout of the given memoryview *val*. | [
"Infer",
"layout",
"of",
"the",
"given",
"memoryview",
"*",
"val",
"*",
"."
] | def infer_layout(val):
"""
Infer layout of the given memoryview *val*.
"""
if sys.version_info >= (3,):
return ('C' if val.c_contiguous else
'F' if val.f_contiguous else
'A')
# Python 2: best effort heuristic for 1d arrays
if val.ndim == 1 and val.strides[... | [
"def",
"infer_layout",
"(",
"val",
")",
":",
"if",
"sys",
".",
"version_info",
">=",
"(",
"3",
",",
")",
":",
"return",
"(",
"'C'",
"if",
"val",
".",
"c_contiguous",
"else",
"'F'",
"if",
"val",
".",
"f_contiguous",
"else",
"'A'",
")",
"# Python 2: best... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typing/bufproto.py#L63-L74 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/locks.py | python | Event.is_set | (self) | return self._value | Return True if and only if the internal flag is true. | Return True if and only if the internal flag is true. | [
"Return",
"True",
"if",
"and",
"only",
"if",
"the",
"internal",
"flag",
"is",
"true",
"."
] | def is_set(self):
"""Return True if and only if the internal flag is true."""
return self._value | [
"def",
"is_set",
"(",
"self",
")",
":",
"return",
"self",
".",
"_value"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/locks.py#L258-L260 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/simulation/results.py | python | IntervalAvReader2.__init__ | (self, element, sumo, attrsconfigs_cumulative, attrsconfigs_average) | element is "lane" or "edge" or "tripinfo"
attrnames is a list of attribute names to read. | element is "lane" or "edge" or "tripinfo"
attrnames is a list of attribute names to read. | [
"element",
"is",
"lane",
"or",
"edge",
"or",
"tripinfo",
"attrnames",
"is",
"a",
"list",
"of",
"attribute",
"names",
"to",
"read",
"."
] | def __init__(self, element, sumo, attrsconfigs_cumulative, attrsconfigs_average):
"""
element is "lane" or "edge" or "tripinfo"
attrnames is a list of attribute names to read.
"""
print 'IntervalAvReader2', element
# print ' attrsconfigs_cumulative'
# for attrco... | [
"def",
"__init__",
"(",
"self",
",",
"element",
",",
"sumo",
",",
"attrsconfigs_cumulative",
",",
"attrsconfigs_average",
")",
":",
"print",
"'IntervalAvReader2'",
",",
"element",
"# print ' attrsconfigs_cumulative'",
"# for attrconfig in attrsconfigs_cumulative: print ' ',... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/simulation/results.py#L1940-L1970 | ||
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/pattern_parser.py | python | parser_t.__find_args_separator | (self, decl_string, start_pos) | return -1 | implementation details | implementation details | [
"implementation",
"details"
] | def __find_args_separator(self, decl_string, start_pos):
"""implementation details"""
bracket_depth = 0
for index, ch in enumerate(decl_string[start_pos:]):
if ch not in (self.__begin, self.__end, self.__separator):
continue # I am interested only in < and >
... | [
"def",
"__find_args_separator",
"(",
"self",
",",
"decl_string",
",",
"start_pos",
")",
":",
"bracket_depth",
"=",
"0",
"for",
"index",
",",
"ch",
"in",
"enumerate",
"(",
"decl_string",
"[",
"start_pos",
":",
"]",
")",
":",
"if",
"ch",
"not",
"in",
"(",
... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/pattern_parser.py#L55-L70 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pydocview.py | python | DocSDIFrame._LayoutFrame | (self) | Lays out the Frame. | Lays out the Frame. | [
"Lays",
"out",
"the",
"Frame",
"."
] | def _LayoutFrame(self):
"""
Lays out the Frame.
"""
self.Layout() | [
"def",
"_LayoutFrame",
"(",
"self",
")",
":",
"self",
".",
"Layout",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pydocview.py#L2361-L2365 | ||
H-uru/Plasma | c2140ea046e82e9c199e257a7f2e7edb42602871 | Scripts/Python/plasma/pch.py | python | getinst | () | gets the instance of the ptModifier class in the selected module | gets the instance of the ptModifier class in the selected module | [
"gets",
"the",
"instance",
"of",
"the",
"ptModifier",
"class",
"in",
"the",
"selected",
"module"
] | def getinst():
"gets the instance of the ptModifier class in the selected module"
global __pmods
global __sel
for name in __pmods[__sel][1].__dict__.keys():
ist = __pmods[__sel][1].__dict__[name]
if isinstance(ist,PlasmaTypes.ptModifier):
return ist | [
"def",
"getinst",
"(",
")",
":",
"global",
"__pmods",
"global",
"__sel",
"for",
"name",
"in",
"__pmods",
"[",
"__sel",
"]",
"[",
"1",
"]",
".",
"__dict__",
".",
"keys",
"(",
")",
":",
"ist",
"=",
"__pmods",
"[",
"__sel",
"]",
"[",
"1",
"]",
".",
... | https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/pch.py#L236-L243 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/profiler/parser/integrator.py | python | GpuTimelineGenerator._clock_synchronize_to_gpu | (self, timeline_list) | Synchronize the timestamp from device to host. | Synchronize the timestamp from device to host. | [
"Synchronize",
"the",
"timestamp",
"from",
"device",
"to",
"host",
"."
] | def _clock_synchronize_to_gpu(self, timeline_list):
"""Synchronize the timestamp from device to host."""
start_time_file_path = os.path.join(self._profiling_dir, f"start_time_{self._device_id}.txt")
try:
with open(start_time_file_path) as f_obj:
lines = f_obj.readlin... | [
"def",
"_clock_synchronize_to_gpu",
"(",
"self",
",",
"timeline_list",
")",
":",
"start_time_file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_profiling_dir",
",",
"f\"start_time_{self._device_id}.txt\"",
")",
"try",
":",
"with",
"open",
"(",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/parser/integrator.py#L901-L918 | ||
vicaya/hypertable | e7386f799c238c109ae47973417c2a2c7f750825 | src/py/ThriftClient/gen-py/hyperthrift/gen2/HqlService.py | python | Client.hql_query | (self, command) | return self.recv_hql_query() | Convenience method for executing an buffered and flushed query
because thrift doesn't (and probably won't) support default argument values
@param command - HQL command
Parameters:
- command | Convenience method for executing an buffered and flushed query
because thrift doesn't (and probably won't) support default argument values | [
"Convenience",
"method",
"for",
"executing",
"an",
"buffered",
"and",
"flushed",
"query",
"because",
"thrift",
"doesn",
"t",
"(",
"and",
"probably",
"won",
"t",
")",
"support",
"default",
"argument",
"values"
] | def hql_query(self, command):
"""
Convenience method for executing an buffered and flushed query
because thrift doesn't (and probably won't) support default argument values
@param command - HQL command
Parameters:
- command
"""
self.send_hql_query(command)
return self... | [
"def",
"hql_query",
"(",
"self",
",",
"command",
")",
":",
"self",
".",
"send_hql_query",
"(",
"command",
")",
"return",
"self",
".",
"recv_hql_query",
"(",
")"
] | https://github.com/vicaya/hypertable/blob/e7386f799c238c109ae47973417c2a2c7f750825/src/py/ThriftClient/gen-py/hyperthrift/gen2/HqlService.py#L129-L141 | |
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.__delslice__ | (self, start, stop) | Deletes the subset of items from between the specified indices. | Deletes the subset of items from between the specified indices. | [
"Deletes",
"the",
"subset",
"of",
"items",
"from",
"between",
"the",
"specified",
"indices",
"."
] | def __delslice__(self, start, stop):
"""Deletes the subset of items from between the specified indices."""
del self._values[start:stop]
self._message_listener.Modified() | [
"def",
"__delslice__",
"(",
"self",
",",
"start",
",",
"stop",
")",
":",
"del",
"self",
".",
"_values",
"[",
"start",
":",
"stop",
"]",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py#L232-L235 | ||
p4lang/p4c | 3272e79369f20813cc1a555a5eb26f44432f84a4 | tools/cpplint.py | python | CheckPrintf | (filename, clean_lines, linenum, error) | Check for printf related issues.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Check for printf related issues. | [
"Check",
"for",
"printf",
"related",
"issues",
"."
] | def CheckPrintf(filename, clean_lines, linenum, error):
"""Check for printf related issues.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found.
"""
l... | [
"def",
"CheckPrintf",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# When snprintf is used, the second argument shouldn't be a literal.",
"match",
"=",
"Search",
"(",
"r... | https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L5453-L5479 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/SimpleXMLRPCServer.py | python | CGIXMLRPCRequestHandler.handle_xmlrpc | (self, request_text) | Handle a single XML-RPC request | Handle a single XML-RPC request | [
"Handle",
"a",
"single",
"XML",
"-",
"RPC",
"request"
] | def handle_xmlrpc(self, request_text):
"""Handle a single XML-RPC request"""
response = self._marshaled_dispatch(request_text)
print 'Content-Type: text/xml'
print 'Content-Length: %d' % len(response)
print
sys.stdout.write(response) | [
"def",
"handle_xmlrpc",
"(",
"self",
",",
"request_text",
")",
":",
"response",
"=",
"self",
".",
"_marshaled_dispatch",
"(",
"request_text",
")",
"print",
"'Content-Type: text/xml'",
"print",
"'Content-Length: %d'",
"%",
"len",
"(",
"response",
")",
"print",
"sys... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/SimpleXMLRPCServer.py#L647-L655 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/io/arff/arffread.py | python | MetaData.names | (self) | return self._attrnames | Return the list of attribute names. | Return the list of attribute names. | [
"Return",
"the",
"list",
"of",
"attribute",
"names",
"."
] | def names(self):
"""Return the list of attribute names."""
return self._attrnames | [
"def",
"names",
"(",
"self",
")",
":",
"return",
"self",
".",
"_attrnames"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/io/arff/arffread.py#L456-L458 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/email/feedparser.py | python | BufferedSubFile.push | (self, data) | Push some new data into this object. | Push some new data into this object. | [
"Push",
"some",
"new",
"data",
"into",
"this",
"object",
"."
] | def push(self, data):
"""Push some new data into this object."""
# Crack into lines, but preserve the linesep characters on the end of each
parts = data.splitlines(True)
if not parts or not parts[0].endswith(('\n', '\r')):
# No new complete lines, so just accumulate partials... | [
"def",
"push",
"(",
"self",
",",
"data",
")",
":",
"# Crack into lines, but preserve the linesep characters on the end of each",
"parts",
"=",
"data",
".",
"splitlines",
"(",
"True",
")",
"if",
"not",
"parts",
"or",
"not",
"parts",
"[",
"0",
"]",
".",
"endswith"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/feedparser.py#L96-L118 | ||
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | scripts/data/shared/geometry.py | python | Rt4x4 | (R, t) | return Rt | Combines rotation and translation to a single 4x4 matrix. | Combines rotation and translation to a single 4x4 matrix. | [
"Combines",
"rotation",
"and",
"translation",
"to",
"a",
"single",
"4x4",
"matrix",
"."
] | def Rt4x4(R, t):
"""
Combines rotation and translation to a single 4x4 matrix.
"""
Rt = np.asmatrix(np.eye(4))
Rt[:3,:3] = R
Rt[:3,3] = t
return Rt | [
"def",
"Rt4x4",
"(",
"R",
",",
"t",
")",
":",
"Rt",
"=",
"np",
".",
"asmatrix",
"(",
"np",
".",
"eye",
"(",
"4",
")",
")",
"Rt",
"[",
":",
"3",
",",
":",
"3",
"]",
"=",
"R",
"Rt",
"[",
":",
"3",
",",
"3",
"]",
"=",
"t",
"return",
"Rt"... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/data/shared/geometry.py#L88-L96 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/platform.py | python | dist | (distname='',version='',id='',
supported_dists=_supported_dists) | return linux_distribution(distname, version, id,
supported_dists=supported_dists,
full_distribution_name=0) | Tries to determine the name of the Linux OS distribution name.
The function first looks for a distribution release file in
/etc and then reverts to _dist_try_harder() in case no
suitable files are found.
Returns a tuple (distname,version,id) which default to the
args given as p... | Tries to determine the name of the Linux OS distribution name. | [
"Tries",
"to",
"determine",
"the",
"name",
"of",
"the",
"Linux",
"OS",
"distribution",
"name",
"."
] | def dist(distname='',version='',id='',
supported_dists=_supported_dists):
""" Tries to determine the name of the Linux OS distribution name.
The function first looks for a distribution release file in
/etc and then reverts to _dist_try_harder() in case no
suitable files are found... | [
"def",
"dist",
"(",
"distname",
"=",
"''",
",",
"version",
"=",
"''",
",",
"id",
"=",
"''",
",",
"supported_dists",
"=",
"_supported_dists",
")",
":",
"return",
"linux_distribution",
"(",
"distname",
",",
"version",
",",
"id",
",",
"supported_dists",
"=",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/platform.py#L347-L363 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/multi_process_lib.py | python | is_oss | () | return len(sys.argv) >= 1 and 'bazel' in sys.argv[0] | Returns whether the test is run under OSS. | Returns whether the test is run under OSS. | [
"Returns",
"whether",
"the",
"test",
"is",
"run",
"under",
"OSS",
"."
] | def is_oss():
"""Returns whether the test is run under OSS."""
return len(sys.argv) >= 1 and 'bazel' in sys.argv[0] | [
"def",
"is_oss",
"(",
")",
":",
"return",
"len",
"(",
"sys",
".",
"argv",
")",
">=",
"1",
"and",
"'bazel'",
"in",
"sys",
".",
"argv",
"[",
"0",
"]"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/multi_process_lib.py#L28-L30 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/gaussian_process/kernels.py | python | WhiteKernel.diag | (self, X) | return np.full(_num_samples(X), self.noise_level,
dtype=np.array(self.noise_level).dtype) | Returns the diagonal of the kernel k(X, X).
The result of this method is identical to np.diag(self(X)); however,
it can be evaluated more efficiently since only the diagonal is
evaluated.
Parameters
----------
X : sequence of length n_samples_X
Argument to t... | Returns the diagonal of the kernel k(X, X). | [
"Returns",
"the",
"diagonal",
"of",
"the",
"kernel",
"k",
"(",
"X",
"X",
")",
"."
] | def diag(self, X):
"""Returns the diagonal of the kernel k(X, X).
The result of this method is identical to np.diag(self(X)); however,
it can be evaluated more efficiently since only the diagonal is
evaluated.
Parameters
----------
X : sequence of length n_sampl... | [
"def",
"diag",
"(",
"self",
",",
"X",
")",
":",
"return",
"np",
".",
"full",
"(",
"_num_samples",
"(",
"X",
")",
",",
"self",
".",
"noise_level",
",",
"dtype",
"=",
"np",
".",
"array",
"(",
"self",
".",
"noise_level",
")",
".",
"dtype",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/gaussian_process/kernels.py#L1187-L1206 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | EggMetadata.__init__ | (self, importer) | Create a metadata provider from a zipimporter | Create a metadata provider from a zipimporter | [
"Create",
"a",
"metadata",
"provider",
"from",
"a",
"zipimporter"
] | def __init__(self, importer):
"""Create a metadata provider from a zipimporter"""
self.zip_pre = importer.archive + os.sep
self.loader = importer
if importer.prefix:
self.module_path = os.path.join(importer.archive, importer.prefix)
else:
self.module_path... | [
"def",
"__init__",
"(",
"self",
",",
"importer",
")",
":",
"self",
".",
"zip_pre",
"=",
"importer",
".",
"archive",
"+",
"os",
".",
"sep",
"self",
".",
"loader",
"=",
"importer",
"if",
"importer",
".",
"prefix",
":",
"self",
".",
"module_path",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L1942-L1951 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/client.py | python | OAuth2Credentials._do_revoke | (self, http_request, token) | Revokes this credential and deletes the stored copy (if it exists).
Args:
http_request: callable, a callable that matches the method signature of
httplib2.Http.request, used to make the refresh request.
token: A string used as the token to be revoked. Can be either an
access_token or re... | Revokes this credential and deletes the stored copy (if it exists). | [
"Revokes",
"this",
"credential",
"and",
"deletes",
"the",
"stored",
"copy",
"(",
"if",
"it",
"exists",
")",
"."
] | def _do_revoke(self, http_request, token):
"""Revokes this credential and deletes the stored copy (if it exists).
Args:
http_request: callable, a callable that matches the method signature of
httplib2.Http.request, used to make the refresh request.
token: A string used as the token to be re... | [
"def",
"_do_revoke",
"(",
"self",
",",
"http_request",
",",
"token",
")",
":",
"logger",
".",
"info",
"(",
"'Revoking token'",
")",
"query_params",
"=",
"{",
"'token'",
":",
"token",
"}",
"token_revoke_uri",
"=",
"_update_query_params",
"(",
"self",
".",
"re... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/client.py#L845-L874 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.