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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/descriptor_pool.py | python | DescriptorPool._AddExtensionDescriptor | (self, extension) | Adds a FieldDescriptor describing an extension to the pool.
Args:
extension: A FieldDescriptor.
Raises:
AssertionError: when another extension with the same number extends the
same message.
TypeError: when the specified extension is not a
descriptor.FieldDescriptor. | Adds a FieldDescriptor describing an extension to the pool. | [
"Adds",
"a",
"FieldDescriptor",
"describing",
"an",
"extension",
"to",
"the",
"pool",
"."
] | def _AddExtensionDescriptor(self, extension):
"""Adds a FieldDescriptor describing an extension to the pool.
Args:
extension: A FieldDescriptor.
Raises:
AssertionError: when another extension with the same number extends the
same message.
TypeError: when the specified extension i... | [
"def",
"_AddExtensionDescriptor",
"(",
"self",
",",
"extension",
")",
":",
"if",
"not",
"(",
"isinstance",
"(",
"extension",
",",
"descriptor",
".",
"FieldDescriptor",
")",
"and",
"extension",
".",
"is_extension",
")",
":",
"raise",
"TypeError",
"(",
"'Expecte... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/descriptor_pool.py#L312-L352 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/msw/gizmos.py | python | TreeListCtrl.GetHeaderWindow | (*args, **kwargs) | return _gizmos.TreeListCtrl_GetHeaderWindow(*args, **kwargs) | GetHeaderWindow(self) -> Window | GetHeaderWindow(self) -> Window | [
"GetHeaderWindow",
"(",
"self",
")",
"-",
">",
"Window"
] | def GetHeaderWindow(*args, **kwargs):
"""GetHeaderWindow(self) -> Window"""
return _gizmos.TreeListCtrl_GetHeaderWindow(*args, **kwargs) | [
"def",
"GetHeaderWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_GetHeaderWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/msw/gizmos.py#L940-L942 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/gn/bin/gyp_flag_compare.py | python | Run | (command_line) | return subprocess.check_output(command_line, shell=True) | Run |command_line| as a subprocess and return stdout. Raises on error. | Run |command_line| as a subprocess and return stdout. Raises on error. | [
"Run",
"|command_line|",
"as",
"a",
"subprocess",
"and",
"return",
"stdout",
".",
"Raises",
"on",
"error",
"."
] | def Run(command_line):
"""Run |command_line| as a subprocess and return stdout. Raises on error."""
print >> sys.stderr, command_line
return subprocess.check_output(command_line, shell=True) | [
"def",
"Run",
"(",
"command_line",
")",
":",
"print",
">>",
"sys",
".",
"stderr",
",",
"command_line",
"return",
"subprocess",
".",
"check_output",
"(",
"command_line",
",",
"shell",
"=",
"True",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/gn/bin/gyp_flag_compare.py#L350-L353 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/pipeline.py | python | Pipeline.get_params | (self, deep=True) | return self._get_params('steps', deep=deep) | Get parameters for this estimator.
Parameters
----------
deep: boolean, optional
If True, will return the parameters for this estimator and
contained subobjects that are estimators.
Returns
-------
params : mapping of string to any
Pa... | Get parameters for this estimator. | [
"Get",
"parameters",
"for",
"this",
"estimator",
"."
] | def get_params(self, deep=True):
"""Get parameters for this estimator.
Parameters
----------
deep: boolean, optional
If True, will return the parameters for this estimator and
contained subobjects that are estimators.
Returns
-------
para... | [
"def",
"get_params",
"(",
"self",
",",
"deep",
"=",
"True",
")",
":",
"return",
"self",
".",
"_get_params",
"(",
"'steps'",
",",
"deep",
"=",
"deep",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/pipeline.py#L155-L169 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typing/context.py | python | BaseContext.resolve_getattr | (self, typ, attr) | Resolve getting the attribute *attr* (a string) on the Numba type.
The attribute's type is returned, or None if resolution failed. | Resolve getting the attribute *attr* (a string) on the Numba type.
The attribute's type is returned, or None if resolution failed. | [
"Resolve",
"getting",
"the",
"attribute",
"*",
"attr",
"*",
"(",
"a",
"string",
")",
"on",
"the",
"Numba",
"type",
".",
"The",
"attribute",
"s",
"type",
"is",
"returned",
"or",
"None",
"if",
"resolution",
"failed",
"."
] | def resolve_getattr(self, typ, attr):
"""
Resolve getting the attribute *attr* (a string) on the Numba type.
The attribute's type is returned, or None if resolution failed.
"""
def core(typ):
out = self.find_matching_getattr_template(typ, attr)
if out:
... | [
"def",
"resolve_getattr",
"(",
"self",
",",
"typ",
",",
"attr",
")",
":",
"def",
"core",
"(",
"typ",
")",
":",
"out",
"=",
"self",
".",
"find_matching_getattr_template",
"(",
"typ",
",",
"attr",
")",
"if",
"out",
":",
"return",
"out",
"[",
"'return_typ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typing/context.py#L266-L288 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/presenter/DrillPresenter.py | python | DrillPresenter._resetTable | (self) | return True | Reset the table header. | Reset the table header. | [
"Reset",
"the",
"table",
"header",
"."
] | def _resetTable(self):
"""
Reset the table header.
"""
acquisitionMode = self.model.getAcquisitionMode()
if acquisitionMode not in RundexSettings.COLUMNS:
self.view.set_table([], [])
return False
parameters = self.model.getParameters()
colu... | [
"def",
"_resetTable",
"(",
"self",
")",
":",
"acquisitionMode",
"=",
"self",
".",
"model",
".",
"getAcquisitionMode",
"(",
")",
"if",
"acquisitionMode",
"not",
"in",
"RundexSettings",
".",
"COLUMNS",
":",
"self",
".",
"view",
".",
"set_table",
"(",
"[",
"]... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/presenter/DrillPresenter.py#L458-L475 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/isapi/samples/advanced.py | python | status_handler | (options, log, arg) | Query the status of something | Query the status of something | [
"Query",
"the",
"status",
"of",
"something"
] | def status_handler(options, log, arg):
"Query the status of something"
print "Everything seems to be fine!" | [
"def",
"status_handler",
"(",
"options",
",",
"log",
",",
"arg",
")",
":",
"print",
"\"Everything seems to be fine!\""
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/isapi/samples/advanced.py#L163-L165 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBType.IsValid | (self) | return _lldb.SBType_IsValid(self) | IsValid(SBType self) -> bool | IsValid(SBType self) -> bool | [
"IsValid",
"(",
"SBType",
"self",
")",
"-",
">",
"bool"
] | def IsValid(self):
"""IsValid(SBType self) -> bool"""
return _lldb.SBType_IsValid(self) | [
"def",
"IsValid",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBType_IsValid",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L12611-L12613 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py | python | TimingScriptGenerator.writeTimingCall | (self, irname, callname) | Echo some comments and invoke both versions of toy | Echo some comments and invoke both versions of toy | [
"Echo",
"some",
"comments",
"and",
"invoke",
"both",
"versions",
"of",
"toy"
] | def writeTimingCall(self, irname, callname):
"""Echo some comments and invoke both versions of toy"""
rootname = irname
if '.' in irname:
rootname = irname[:irname.rfind('.')]
self.shfile.write("echo \"%s: Calls %s\" >> %s\n" % (callname, irname, self.timeFile))
self.... | [
"def",
"writeTimingCall",
"(",
"self",
",",
"irname",
",",
"callname",
")",
":",
"rootname",
"=",
"irname",
"if",
"'.'",
"in",
"irname",
":",
"rootname",
"=",
"irname",
"[",
":",
"irname",
".",
"rfind",
"(",
"'.'",
")",
"]",
"self",
".",
"shfile",
".... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/llvm/examples/Kaleidoscope/MCJIT/cached/split-lib.py#L12-L34 | ||
ros-industrial/industrial_training | e6761c7bee65d3802fee6cf7c99e3113d3dc1af2 | exercises/3.3/ros2/src/myworkcell_moveit_config/launch/myworkcell_planning_execution.launch.py | python | get_package_file | (package, file_path) | return absolute_file_path | Get the location of a file installed in an ament package | Get the location of a file installed in an ament package | [
"Get",
"the",
"location",
"of",
"a",
"file",
"installed",
"in",
"an",
"ament",
"package"
] | def get_package_file(package, file_path):
"""Get the location of a file installed in an ament package"""
package_path = get_package_share_directory(package)
absolute_file_path = os.path.join(package_path, file_path)
return absolute_file_path | [
"def",
"get_package_file",
"(",
"package",
",",
"file_path",
")",
":",
"package_path",
"=",
"get_package_share_directory",
"(",
"package",
")",
"absolute_file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"package_path",
",",
"file_path",
")",
"return",
"abso... | https://github.com/ros-industrial/industrial_training/blob/e6761c7bee65d3802fee6cf7c99e3113d3dc1af2/exercises/3.3/ros2/src/myworkcell_moveit_config/launch/myworkcell_planning_execution.launch.py#L8-L12 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateTime.SetToPrevWeekDay | (*args, **kwargs) | return _misc_.DateTime_SetToPrevWeekDay(*args, **kwargs) | SetToPrevWeekDay(self, int weekday) -> DateTime | SetToPrevWeekDay(self, int weekday) -> DateTime | [
"SetToPrevWeekDay",
"(",
"self",
"int",
"weekday",
")",
"-",
">",
"DateTime"
] | def SetToPrevWeekDay(*args, **kwargs):
"""SetToPrevWeekDay(self, int weekday) -> DateTime"""
return _misc_.DateTime_SetToPrevWeekDay(*args, **kwargs) | [
"def",
"SetToPrevWeekDay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_SetToPrevWeekDay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L3861-L3863 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | utils/lit/lit/util.py | python | killProcessAndChildren | (pid) | This function kills a process with ``pid`` and all its running children
(recursively). It is currently implemented using the psutil module which
provides a simple platform neutral implementation.
TODO: Reimplement this without using psutil so we can remove
our dependency on it. | This function kills a process with ``pid`` and all its running children
(recursively). It is currently implemented using the psutil module which
provides a simple platform neutral implementation. | [
"This",
"function",
"kills",
"a",
"process",
"with",
"pid",
"and",
"all",
"its",
"running",
"children",
"(",
"recursively",
")",
".",
"It",
"is",
"currently",
"implemented",
"using",
"the",
"psutil",
"module",
"which",
"provides",
"a",
"simple",
"platform",
... | def killProcessAndChildren(pid):
"""This function kills a process with ``pid`` and all its running children
(recursively). It is currently implemented using the psutil module which
provides a simple platform neutral implementation.
TODO: Reimplement this without using psutil so we can remove
... | [
"def",
"killProcessAndChildren",
"(",
"pid",
")",
":",
"import",
"psutil",
"try",
":",
"psutilProc",
"=",
"psutil",
".",
"Process",
"(",
"pid",
")",
"# Handle the different psutil API versions",
"try",
":",
"# psutil >= 2.x",
"children_iterator",
"=",
"psutilProc",
... | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/utils/lit/lit/util.py#L398-L424 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/enum.py | python | EnumMeta.__members__ | (cls) | return MappingProxyType(cls._member_map_) | Returns a mapping of member name->value.
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping. | Returns a mapping of member name->value. | [
"Returns",
"a",
"mapping",
"of",
"member",
"name",
"-",
">",
"value",
"."
] | def __members__(cls):
"""Returns a mapping of member name->value.
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.
"""
return MappingProxyType(cls._member_map_) | [
"def",
"__members__",
"(",
"cls",
")",
":",
"return",
"MappingProxyType",
"(",
"cls",
".",
"_member_map_",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/enum.py#L366-L373 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/logging/loggers.py | python | _build_logger_server | () | return None | Create and return a new BuildloggerServer.
This occurs if "buildlogger" is configured as one of the handler class in the configuration,
return None otherwise. | Create and return a new BuildloggerServer. | [
"Create",
"and",
"return",
"a",
"new",
"BuildloggerServer",
"."
] | def _build_logger_server():
"""Create and return a new BuildloggerServer.
This occurs if "buildlogger" is configured as one of the handler class in the configuration,
return None otherwise.
"""
for logger_name in (FIXTURE_LOGGER_NAME, TESTS_LOGGER_NAME):
logger_info = config.LOGGING_CONFIG[... | [
"def",
"_build_logger_server",
"(",
")",
":",
"for",
"logger_name",
"in",
"(",
"FIXTURE_LOGGER_NAME",
",",
"TESTS_LOGGER_NAME",
")",
":",
"logger_info",
"=",
"config",
".",
"LOGGING_CONFIG",
"[",
"logger_name",
"]",
"for",
"handler_info",
"in",
"logger_info",
"[",... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/logging/loggers.py#L40-L51 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/graph_editor/util.py | python | get_tensors | (graph) | return ts | get all the tensors which are input or output of an op in the graph.
Args:
graph: a `tf.Graph`.
Returns:
A list of `tf.Tensor`.
Raises:
TypeError: if graph is not a `tf.Graph`. | get all the tensors which are input or output of an op in the graph. | [
"get",
"all",
"the",
"tensors",
"which",
"are",
"input",
"or",
"output",
"of",
"an",
"op",
"in",
"the",
"graph",
"."
] | def get_tensors(graph):
"""get all the tensors which are input or output of an op in the graph.
Args:
graph: a `tf.Graph`.
Returns:
A list of `tf.Tensor`.
Raises:
TypeError: if graph is not a `tf.Graph`.
"""
if not isinstance(graph, tf_ops.Graph):
raise TypeError("Expected a graph, got: {}"... | [
"def",
"get_tensors",
"(",
"graph",
")",
":",
"if",
"not",
"isinstance",
"(",
"graph",
",",
"tf_ops",
".",
"Graph",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected a graph, got: {}\"",
".",
"format",
"(",
"type",
"(",
"graph",
")",
")",
")",
"ts",
"=",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/util.py#L250-L265 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/bisect.py | python | bisect_right | (a, x, lo=0, hi=None) | return lo | Return the index where to insert item x in list a, assuming a is sorted.
The return value i is such that all e in a[:i] have e <= x, and all e in
a[i:] have e > x. So if x already appears in the list, a.insert(x) will
insert just after the rightmost x already there.
Optional args lo (default 0) and h... | Return the index where to insert item x in list a, assuming a is sorted. | [
"Return",
"the",
"index",
"where",
"to",
"insert",
"item",
"x",
"in",
"list",
"a",
"assuming",
"a",
"is",
"sorted",
"."
] | def bisect_right(a, x, lo=0, hi=None):
"""Return the index where to insert item x in list a, assuming a is sorted.
The return value i is such that all e in a[:i] have e <= x, and all e in
a[i:] have e > x. So if x already appears in the list, a.insert(x) will
insert just after the rightmost x already ... | [
"def",
"bisect_right",
"(",
"a",
",",
"x",
",",
"lo",
"=",
"0",
",",
"hi",
"=",
"None",
")",
":",
"if",
"lo",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"'lo must be non-negative'",
")",
"if",
"hi",
"is",
"None",
":",
"hi",
"=",
"len",
"(",
"a",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/bisect.py#L24-L43 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool.AddDescriptor | (self, desc) | Adds a Descriptor to the pool, non-recursively.
If the Descriptor contains nested messages or enums, the caller must
explicitly register them. This method also registers the FileDescriptor
associated with the message.
Args:
desc: A Descriptor. | Adds a Descriptor to the pool, non-recursively. | [
"Adds",
"a",
"Descriptor",
"to",
"the",
"pool",
"non",
"-",
"recursively",
"."
] | def AddDescriptor(self, desc):
"""Adds a Descriptor to the pool, non-recursively.
If the Descriptor contains nested messages or enums, the caller must
explicitly register them. This method also registers the FileDescriptor
associated with the message.
Args:
desc: A Descriptor.
"""
if... | [
"def",
"AddDescriptor",
"(",
"self",
",",
"desc",
")",
":",
"if",
"not",
"isinstance",
"(",
"desc",
",",
"descriptor",
".",
"Descriptor",
")",
":",
"raise",
"TypeError",
"(",
"'Expected instance of descriptor.Descriptor.'",
")",
"self",
".",
"_descriptors",
"[",... | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/descriptor_pool.py#L162-L176 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | CreateLoadedResponse.toTpm | (self, buf) | TpmMarshaller method | TpmMarshaller method | [
"TpmMarshaller",
"method"
] | def toTpm(self, buf):
""" TpmMarshaller method """
self.outPrivate.toTpm(buf)
buf.writeSizedObj(self.outPublic)
buf.writeSizedByteBuf(self.name) | [
"def",
"toTpm",
"(",
"self",
",",
"buf",
")",
":",
"self",
".",
"outPrivate",
".",
"toTpm",
"(",
"buf",
")",
"buf",
".",
"writeSizedObj",
"(",
"self",
".",
"outPublic",
")",
"buf",
".",
"writeSizedByteBuf",
"(",
"self",
".",
"name",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L10237-L10241 | ||
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/data_structures/sarray.py | python | SArray.__contains__ | (self, item) | return (self == item).any() | Returns true if any element in this SArray is identically equal to item.
Following are equivalent:
>>> element in sa
>>> sa.__contains__(element)
For an element-wise contains see ``SArray.contains`` | Returns true if any element in this SArray is identically equal to item. | [
"Returns",
"true",
"if",
"any",
"element",
"in",
"this",
"SArray",
"is",
"identically",
"equal",
"to",
"item",
"."
] | def __contains__(self, item):
"""
Returns true if any element in this SArray is identically equal to item.
Following are equivalent:
>>> element in sa
>>> sa.__contains__(element)
For an element-wise contains see ``SArray.contains``
"""
return (self ==... | [
"def",
"__contains__",
"(",
"self",
",",
"item",
")",
":",
"return",
"(",
"self",
"==",
"item",
")",
".",
"any",
"(",
")"
] | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L789-L801 | |
deweylab/RSEM | e4dda70e90fb5eb9b831306f1c381f8bbf71ef0e | pRSEM/Prsem.py | python | genPriorByCombinedTSSSignals | (prm) | calculate TSS signals for all external data sets
compute informative p-value, LL for individual data set and combined one
learn prior from training set partitioned by combined TSS signals
derive priors for all isoforms | calculate TSS signals for all external data sets
compute informative p-value, LL for individual data set and combined one
learn prior from training set partitioned by combined TSS signals
derive priors for all isoforms | [
"calculate",
"TSS",
"signals",
"for",
"all",
"external",
"data",
"sets",
"compute",
"informative",
"p",
"-",
"value",
"LL",
"for",
"individual",
"data",
"set",
"and",
"combined",
"one",
"learn",
"prior",
"from",
"training",
"set",
"partitioned",
"by",
"combine... | def genPriorByCombinedTSSSignals(prm):
"""
calculate TSS signals for all external data sets
compute informative p-value, LL for individual data set and combined one
learn prior from training set partitioned by combined TSS signals
derive priors for all isoforms
"""
f_fout = open(prm.finfo_multi_targets, '... | [
"def",
"genPriorByCombinedTSSSignals",
"(",
"prm",
")",
":",
"f_fout",
"=",
"open",
"(",
"prm",
".",
"finfo_multi_targets",
",",
"'w'",
")",
"f_fout",
".",
"write",
"(",
"\"targetid\\tfaln\\tfftrs\\n\"",
")",
"for",
"(",
"tgtid",
",",
"faln",
")",
"in",
"prm... | https://github.com/deweylab/RSEM/blob/e4dda70e90fb5eb9b831306f1c381f8bbf71ef0e/pRSEM/Prsem.py#L121-L160 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/io/matlab/miobase.py | python | read_dtype | (mat_stream, a_dtype) | return arr | Generic get of byte stream data of known type
Parameters
----------
mat_stream : file_like object
MATLAB (tm) mat file stream
a_dtype : dtype
dtype of array to read. `a_dtype` is assumed to be correct
endianness.
Returns
-------
arr : ndarray
Array of dtype... | Generic get of byte stream data of known type | [
"Generic",
"get",
"of",
"byte",
"stream",
"data",
"of",
"known",
"type"
] | def read_dtype(mat_stream, a_dtype):
"""
Generic get of byte stream data of known type
Parameters
----------
mat_stream : file_like object
MATLAB (tm) mat file stream
a_dtype : dtype
dtype of array to read. `a_dtype` is assumed to be correct
endianness.
Returns
... | [
"def",
"read_dtype",
"(",
"mat_stream",
",",
"a_dtype",
")",
":",
"num_bytes",
"=",
"a_dtype",
".",
"itemsize",
"arr",
"=",
"np",
".",
"ndarray",
"(",
"shape",
"=",
"(",
")",
",",
"dtype",
"=",
"a_dtype",
",",
"buffer",
"=",
"mat_stream",
".",
"read",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/io/matlab/miobase.py#L161-L184 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | Grid.SetRowMinimalAcceptableHeight | (*args, **kwargs) | return _grid.Grid_SetRowMinimalAcceptableHeight(*args, **kwargs) | SetRowMinimalAcceptableHeight(self, int width) | SetRowMinimalAcceptableHeight(self, int width) | [
"SetRowMinimalAcceptableHeight",
"(",
"self",
"int",
"width",
")"
] | def SetRowMinimalAcceptableHeight(*args, **kwargs):
"""SetRowMinimalAcceptableHeight(self, int width)"""
return _grid.Grid_SetRowMinimalAcceptableHeight(*args, **kwargs) | [
"def",
"SetRowMinimalAcceptableHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_SetRowMinimalAcceptableHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1922-L1924 | |
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/message.py | python | Message.HasField | (self, field_name) | Checks if a certain field is set for the message. Note if the
field_name is not defined in the message descriptor, ValueError will be
raised. | Checks if a certain field is set for the message. Note if the
field_name is not defined in the message descriptor, ValueError will be
raised. | [
"Checks",
"if",
"a",
"certain",
"field",
"is",
"set",
"for",
"the",
"message",
".",
"Note",
"if",
"the",
"field_name",
"is",
"not",
"defined",
"in",
"the",
"message",
"descriptor",
"ValueError",
"will",
"be",
"raised",
"."
] | def HasField(self, field_name):
"""Checks if a certain field is set for the message. Note if the
field_name is not defined in the message descriptor, ValueError will be
raised."""
raise NotImplementedError | [
"def",
"HasField",
"(",
"self",
",",
"field_name",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/message.py#L228-L232 | ||
lzhang10/maxent | 3560c94b737d4272ed86de529e50d823200e6d8e | example/postagger/context.py | python | get_context1 | (words, pos, i, rare_word) | return context | get tag context for words[i] | get tag context for words[i] | [
"get",
"tag",
"context",
"for",
"words",
"[",
"i",
"]"
] | def get_context1(words, pos, i, rare_word):
'get tag context for words[i]'
context = []
w = words[i]
n = len(words)
if rare_word:
pass
else:
context.append('curword=' + w)
return context | [
"def",
"get_context1",
"(",
"words",
",",
"pos",
",",
"i",
",",
"rare_word",
")",
":",
"context",
"=",
"[",
"]",
"w",
"=",
"words",
"[",
"i",
"]",
"n",
"=",
"len",
"(",
"words",
")",
"if",
"rare_word",
":",
"pass",
"else",
":",
"context",
".",
... | https://github.com/lzhang10/maxent/blob/3560c94b737d4272ed86de529e50d823200e6d8e/example/postagger/context.py#L35-L45 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/locks.py | python | Condition.notify_all | (self) | Wake all waiters. | Wake all waiters. | [
"Wake",
"all",
"waiters",
"."
] | def notify_all(self) -> None:
"""Wake all waiters."""
self.notify(len(self._waiters)) | [
"def",
"notify_all",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"notify",
"(",
"len",
"(",
"self",
".",
"_waiters",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/locks.py#L157-L159 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/clinic/clinic.py | python | text_accumulator | () | return text_accumulator_nt(append, output) | Creates a simple text accumulator / joiner.
Returns a pair of callables:
append, output
"append" appends a string to the accumulator.
"output" returns the contents of the accumulator
joined together (''.join(accumulator)) and
empties the accumulator. | Creates a simple text accumulator / joiner. | [
"Creates",
"a",
"simple",
"text",
"accumulator",
"/",
"joiner",
"."
] | def text_accumulator():
"""
Creates a simple text accumulator / joiner.
Returns a pair of callables:
append, output
"append" appends a string to the accumulator.
"output" returns the contents of the accumulator
joined together (''.join(accumulator)) and
empties the accumulator... | [
"def",
"text_accumulator",
"(",
")",
":",
"text",
",",
"append",
",",
"output",
"=",
"_text_accumulator",
"(",
")",
"return",
"text_accumulator_nt",
"(",
"append",
",",
"output",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/clinic/clinic.py#L87-L99 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/parallel/_auto_parallel_context.py | python | _AutoParallelContext.get_enable_parallel_optimizer | (self) | return self._context_handle.get_enable_parallel_optimizer() | Get parallel optimizer flag. | Get parallel optimizer flag. | [
"Get",
"parallel",
"optimizer",
"flag",
"."
] | def get_enable_parallel_optimizer(self):
"""Get parallel optimizer flag."""
self.check_context_handle()
return self._context_handle.get_enable_parallel_optimizer() | [
"def",
"get_enable_parallel_optimizer",
"(",
"self",
")",
":",
"self",
".",
"check_context_handle",
"(",
")",
"return",
"self",
".",
"_context_handle",
".",
"get_enable_parallel_optimizer",
"(",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/_auto_parallel_context.py#L658-L661 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | GetToolBarDockOffsets | (docks) | return top_left, bottom_right | Returns the toolbar dock offsets (top-left and bottom-right).
:param `docks`: a list of :class:`AuiDockInfo` to analyze. | Returns the toolbar dock offsets (top-left and bottom-right). | [
"Returns",
"the",
"toolbar",
"dock",
"offsets",
"(",
"top",
"-",
"left",
"and",
"bottom",
"-",
"right",
")",
"."
] | def GetToolBarDockOffsets(docks):
"""
Returns the toolbar dock offsets (top-left and bottom-right).
:param `docks`: a list of :class:`AuiDockInfo` to analyze.
"""
top_left = wx.Size(0, 0)
bottom_right = wx.Size(0, 0)
for dock in docks:
if dock.toolbar:
dock_direction =... | [
"def",
"GetToolBarDockOffsets",
"(",
"docks",
")",
":",
"top_left",
"=",
"wx",
".",
"Size",
"(",
"0",
",",
"0",
")",
"bottom_right",
"=",
"wx",
".",
"Size",
"(",
"0",
",",
"0",
")",
"for",
"dock",
"in",
"docks",
":",
"if",
"dock",
".",
"toolbar",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L3715-L3742 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | WhileContext.grad_state | (self) | return self._grad_state | The gradient loop state. | The gradient loop state. | [
"The",
"gradient",
"loop",
"state",
"."
] | def grad_state(self):
"""The gradient loop state."""
return self._grad_state | [
"def",
"grad_state",
"(",
"self",
")",
":",
"return",
"self",
".",
"_grad_state"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1425-L1427 | |
herbstluftwm/herbstluftwm | 23ef0274bd4d317208eae5fea72b21478a71431b | doc/gendoc.py | python | TokTreeInfoExtrator.stream_consume_member_initializers | (self, classname, stream) | given that the opening : is already consumed, consume the member
initializations | given that the opening : is already consumed, consume the member
initializations | [
"given",
"that",
"the",
"opening",
":",
"is",
"already",
"consumed",
"consume",
"the",
"member",
"initializations"
] | def stream_consume_member_initializers(self, classname, stream):
"""given that the opening : is already consumed, consume the member
initializations"""
arg1 = TokenStream.PatternArg()
codeblock = TokenStream.PatternArg(callback=lambda t: TokenGroup.IsTokenGroup(t, opening_token='{'))
... | [
"def",
"stream_consume_member_initializers",
"(",
"self",
",",
"classname",
",",
"stream",
")",
":",
"arg1",
"=",
"TokenStream",
".",
"PatternArg",
"(",
")",
"codeblock",
"=",
"TokenStream",
".",
"PatternArg",
"(",
"callback",
"=",
"lambda",
"t",
":",
"TokenGr... | https://github.com/herbstluftwm/herbstluftwm/blob/23ef0274bd4d317208eae5fea72b21478a71431b/doc/gendoc.py#L733-L748 | ||
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | tools/extra/parse_log.py | python | write_csv | (output_filename, dict_list, delimiter, verbose=False) | Write a CSV file | Write a CSV file | [
"Write",
"a",
"CSV",
"file"
] | def write_csv(output_filename, dict_list, delimiter, verbose=False):
"""Write a CSV file
"""
if not dict_list:
if verbose:
print('Not writing %s; no lines to write' % output_filename)
return
dialect = csv.excel
dialect.delimiter = delimiter
with open(output_filenam... | [
"def",
"write_csv",
"(",
"output_filename",
",",
"dict_list",
",",
"delimiter",
",",
"verbose",
"=",
"False",
")",
":",
"if",
"not",
"dict_list",
":",
"if",
"verbose",
":",
"print",
"(",
"'Not writing %s; no lines to write'",
"%",
"output_filename",
")",
"return... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/tools/extra/parse_log.py#L148-L166 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DateTimeFromTimeT | (*args, **kwargs) | return val | DateTimeFromTimeT(time_t timet) -> DateTime | DateTimeFromTimeT(time_t timet) -> DateTime | [
"DateTimeFromTimeT",
"(",
"time_t",
"timet",
")",
"-",
">",
"DateTime"
] | def DateTimeFromTimeT(*args, **kwargs):
"""DateTimeFromTimeT(time_t timet) -> DateTime"""
val = _misc_.new_DateTimeFromTimeT(*args, **kwargs)
return val | [
"def",
"DateTimeFromTimeT",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_misc_",
".",
"new_DateTimeFromTimeT",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L4313-L4316 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/iterators.py | python | walk | (self) | Walk over the message tree, yielding each subpart.
The walk is performed in depth-first order. This method is a
generator. | Walk over the message tree, yielding each subpart. | [
"Walk",
"over",
"the",
"message",
"tree",
"yielding",
"each",
"subpart",
"."
] | def walk(self):
"""Walk over the message tree, yielding each subpart.
The walk is performed in depth-first order. This method is a
generator.
"""
yield self
if self.is_multipart():
for subpart in self.get_payload():
for subsubpart in subpart.walk():
yield su... | [
"def",
"walk",
"(",
"self",
")",
":",
"yield",
"self",
"if",
"self",
".",
"is_multipart",
"(",
")",
":",
"for",
"subpart",
"in",
"self",
".",
"get_payload",
"(",
")",
":",
"for",
"subsubpart",
"in",
"subpart",
".",
"walk",
"(",
")",
":",
"yield",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/iterators.py#L20-L30 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/function_base.py | python | _needs_add_docstring | (obj) | return True | Returns true if the only way to set the docstring of `obj` from python is
via add_docstring.
This function errs on the side of being overly conservative. | Returns true if the only way to set the docstring of `obj` from python is
via add_docstring. | [
"Returns",
"true",
"if",
"the",
"only",
"way",
"to",
"set",
"the",
"docstring",
"of",
"obj",
"from",
"python",
"is",
"via",
"add_docstring",
"."
] | def _needs_add_docstring(obj):
"""
Returns true if the only way to set the docstring of `obj` from python is
via add_docstring.
This function errs on the side of being overly conservative.
"""
Py_TPFLAGS_HEAPTYPE = 1 << 9
if isinstance(obj, (types.FunctionType, types.MethodType, property))... | [
"def",
"_needs_add_docstring",
"(",
"obj",
")",
":",
"Py_TPFLAGS_HEAPTYPE",
"=",
"1",
"<<",
"9",
"if",
"isinstance",
"(",
"obj",
",",
"(",
"types",
".",
"FunctionType",
",",
"types",
".",
"MethodType",
",",
"property",
")",
")",
":",
"return",
"False",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/function_base.py#L428-L443 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/mailbox.py | python | _ProxyFile._read | (self, size, read_method) | return result | Read size bytes using read_method. | Read size bytes using read_method. | [
"Read",
"size",
"bytes",
"using",
"read_method",
"."
] | def _read(self, size, read_method):
"""Read size bytes using read_method."""
if size is None:
size = -1
self._file.seek(self._pos)
result = read_method(size)
self._pos = self._file.tell()
return result | [
"def",
"_read",
"(",
"self",
",",
"size",
",",
"read_method",
")",
":",
"if",
"size",
"is",
"None",
":",
"size",
"=",
"-",
"1",
"self",
".",
"_file",
".",
"seek",
"(",
"self",
".",
"_pos",
")",
"result",
"=",
"read_method",
"(",
"size",
")",
"sel... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1982-L1989 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus3.in.py | python | exodus.put_name | (self, object_type, object_id, name) | get the name of the specified entity_type and entity
>>> exo.put_name('EX_ELEM_BLOCK', elem_blk_id)
Parameters
----------
object_type : int
block/set type
object_id : int
block/set *ID* (not *INDEX*)
name : string
block/set name
... | get the name of the specified entity_type and entity | [
"get",
"the",
"name",
"of",
"the",
"specified",
"entity_type",
"and",
"entity"
] | def put_name(self, object_type, object_id, name):
"""
get the name of the specified entity_type and entity
>>> exo.put_name('EX_ELEM_BLOCK', elem_blk_id)
Parameters
----------
object_type : int
block/set type
object_id : int
block/set *ID... | [
"def",
"put_name",
"(",
"self",
",",
"object_type",
",",
"object_id",
",",
"name",
")",
":",
"self",
".",
"__ex_put_name",
"(",
"object_type",
",",
"object_id",
",",
"name",
")"
] | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L1762-L1781 | ||
CGRU/cgru | 1881a4128530e3d31ac6c25314c18314fc50c2c7 | afanasy/python/af.py | python | Block.setWorkingDirectory | (self, working_directory, TransferToServer=True) | Missing DocString
:param working_directory:
:param TransferToServer:
:return: | Missing DocString | [
"Missing",
"DocString"
] | def setWorkingDirectory(self, working_directory, TransferToServer=True):
"""Missing DocString
:param working_directory:
:param TransferToServer:
:return:
"""
if TransferToServer:
working_directory = Pathmap.toServer(working_directory)
self.data["worki... | [
"def",
"setWorkingDirectory",
"(",
"self",
",",
"working_directory",
",",
"TransferToServer",
"=",
"True",
")",
":",
"if",
"TransferToServer",
":",
"working_directory",
"=",
"Pathmap",
".",
"toServer",
"(",
"working_directory",
")",
"self",
".",
"data",
"[",
"\"... | https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/afanasy/python/af.py#L228-L237 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/profiler/common/validator/validate_path.py | python | validate_and_normalize_path | (
path,
check_absolute_path=False,
allow_parent_dir=True,
) | return normalized_path | Validates path and returns its normalized form.
If path has a valid scheme, treat path as url, otherwise consider path a
unix local path.
Note:
File scheme (rfc8089) is currently not supported.
Args:
path (str): Path to be normalized.
check_absolute_path (bool): Whether check ... | Validates path and returns its normalized form. | [
"Validates",
"path",
"and",
"returns",
"its",
"normalized",
"form",
"."
] | def validate_and_normalize_path(
path,
check_absolute_path=False,
allow_parent_dir=True,
):
"""
Validates path and returns its normalized form.
If path has a valid scheme, treat path as url, otherwise consider path a
unix local path.
Note:
File scheme (rfc8089) is c... | [
"def",
"validate_and_normalize_path",
"(",
"path",
",",
"check_absolute_path",
"=",
"False",
",",
"allow_parent_dir",
"=",
"True",
",",
")",
":",
"if",
"not",
"path",
":",
"raise",
"RuntimeError",
"(",
"\"The path is invalid!\"",
")",
"path_str",
"=",
"str",
"("... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/common/validator/validate_path.py#L43-L84 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/internal/enum_type_wrapper.py | python | EnumTypeWrapper.Name | (self, number) | Returns a string containing the name of an enum value. | Returns a string containing the name of an enum value. | [
"Returns",
"a",
"string",
"containing",
"the",
"name",
"of",
"an",
"enum",
"value",
"."
] | def Name(self, number):
"""Returns a string containing the name of an enum value."""
if number in self._enum_type.values_by_number:
return self._enum_type.values_by_number[number].name
raise ValueError('Enum %s has no name defined for value %d' % (
self._enum_type.name, number)) | [
"def",
"Name",
"(",
"self",
",",
"number",
")",
":",
"if",
"number",
"in",
"self",
".",
"_enum_type",
".",
"values_by_number",
":",
"return",
"self",
".",
"_enum_type",
".",
"values_by_number",
"[",
"number",
"]",
".",
"name",
"raise",
"ValueError",
"(",
... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/enum_type_wrapper.py#L51-L56 | ||
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | llvm/utils/lit/lit/LitConfig.py | python | LitConfig.load_config | (self, config, path) | return config | load_config(config, path) - Load a config object from an alternate
path. | load_config(config, path) - Load a config object from an alternate
path. | [
"load_config",
"(",
"config",
"path",
")",
"-",
"Load",
"a",
"config",
"object",
"from",
"an",
"alternate",
"path",
"."
] | def load_config(self, config, path):
"""load_config(config, path) - Load a config object from an alternate
path."""
if self.debug:
self.note('load_config from %r' % path)
config.load_from_path(path, self)
return config | [
"def",
"load_config",
"(",
"self",
",",
"config",
",",
"path",
")",
":",
"if",
"self",
".",
"debug",
":",
"self",
".",
"note",
"(",
"'load_config from %r'",
"%",
"path",
")",
"config",
".",
"load_from_path",
"(",
"path",
",",
"self",
")",
"return",
"co... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/llvm/utils/lit/lit/LitConfig.py#L102-L108 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/order.py | python | Order.simple_leaves_qty | (self) | return self._simple_leaves_qty | Gets the simple_leaves_qty of this Order. # noqa: E501
:return: The simple_leaves_qty of this Order. # noqa: E501
:rtype: float | Gets the simple_leaves_qty of this Order. # noqa: E501 | [
"Gets",
"the",
"simple_leaves_qty",
"of",
"this",
"Order",
".",
"#",
"noqa",
":",
"E501"
] | def simple_leaves_qty(self):
"""Gets the simple_leaves_qty of this Order. # noqa: E501
:return: The simple_leaves_qty of this Order. # noqa: E501
:rtype: float
"""
return self._simple_leaves_qty | [
"def",
"simple_leaves_qty",
"(",
"self",
")",
":",
"return",
"self",
".",
"_simple_leaves_qty"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/order.py#L716-L723 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/etree/ElementTree.py | python | Element.itertext | (self) | Create text iterator.
The iterator loops over the element and all subelements in document
order, returning all inner text. | Create text iterator. | [
"Create",
"text",
"iterator",
"."
] | def itertext(self):
"""Create text iterator.
The iterator loops over the element and all subelements in document
order, returning all inner text.
"""
tag = self.tag
if not isinstance(tag, str) and tag is not None:
return
t = self.text
if t:
... | [
"def",
"itertext",
"(",
"self",
")",
":",
"tag",
"=",
"self",
".",
"tag",
"if",
"not",
"isinstance",
"(",
"tag",
",",
"str",
")",
"and",
"tag",
"is",
"not",
"None",
":",
"return",
"t",
"=",
"self",
".",
"text",
"if",
"t",
":",
"yield",
"t",
"fo... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/etree/ElementTree.py#L423-L440 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py | python | ProxyManager._set_proxy_headers | (self, url, headers=None) | return headers_ | Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user. | Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user. | [
"Sets",
"headers",
"needed",
"by",
"proxies",
":",
"specifically",
"the",
"Accept",
"and",
"Host",
"headers",
".",
"Only",
"sets",
"headers",
"not",
"provided",
"by",
"the",
"user",
"."
] | def _set_proxy_headers(self, url, headers=None):
"""
Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user.
"""
headers_ = {"Accept": "*/*"}
netloc = parse_url(url).netloc
if netloc:
head... | [
"def",
"_set_proxy_headers",
"(",
"self",
",",
"url",
",",
"headers",
"=",
"None",
")",
":",
"headers_",
"=",
"{",
"\"Accept\"",
":",
"\"*/*\"",
"}",
"netloc",
"=",
"parse_url",
"(",
"url",
")",
".",
"netloc",
"if",
"netloc",
":",
"headers_",
"[",
"\"H... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py#L507-L520 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/client/timeline.py | python | Timeline._show_memory_counters | (self) | Produce a counter series for each memory allocator. | Produce a counter series for each memory allocator. | [
"Produce",
"a",
"counter",
"series",
"for",
"each",
"memory",
"allocator",
"."
] | def _show_memory_counters(self):
"""Produce a counter series for each memory allocator."""
# Iterate over all tensor trackers to build a list of allocations and
# frees for each allocator. Then sort the lists and emit a cumulative
# counter series for each allocator.
allocations = {}
for name in... | [
"def",
"_show_memory_counters",
"(",
"self",
")",
":",
"# Iterate over all tensor trackers to build a list of allocations and",
"# frees for each allocator. Then sort the lists and emit a cumulative",
"# counter series for each allocator.",
"allocations",
"=",
"{",
"}",
"for",
"name",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/client/timeline.py#L559-L602 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/training/input.py | python | string_input_producer | (string_tensor, num_epochs=None, shuffle=True,
seed=None, capacity=32, shared_name=None, name=None) | Output strings (e.g. filenames) to a queue for an input pipeline.
Args:
string_tensor: A 1-D string tensor with the strings to produce.
num_epochs: An integer (optional). If specified, `string_input_producer`
produces each string from `string_tensor` `num_epochs` times before
generating an `OutOf... | Output strings (e.g. filenames) to a queue for an input pipeline. | [
"Output",
"strings",
"(",
"e",
".",
"g",
".",
"filenames",
")",
"to",
"a",
"queue",
"for",
"an",
"input",
"pipeline",
"."
] | def string_input_producer(string_tensor, num_epochs=None, shuffle=True,
seed=None, capacity=32, shared_name=None, name=None):
"""Output strings (e.g. filenames) to a queue for an input pipeline.
Args:
string_tensor: A 1-D string tensor with the strings to produce.
num_epochs: An i... | [
"def",
"string_input_producer",
"(",
"string_tensor",
",",
"num_epochs",
"=",
"None",
",",
"shuffle",
"=",
"True",
",",
"seed",
"=",
"None",
",",
"capacity",
"=",
"32",
",",
"shared_name",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"not_null_err",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/input.py#L149-L196 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/loading/activity_lens.py | python | ActivityLens._ScriptsExecuting | (cls, events, start_msec, end_msec) | return dict(script_to_duration) | Returns the time during which scripts executed within an interval.
Args:
events: ([tracing.Event]) list of tracing events.
start_msec: (float) start time in ms, inclusive.
end_msec: (float) end time in ms, inclusive.
Returns:
A dict {URL (str) -> duration_msec (float)}. The dict may ha... | Returns the time during which scripts executed within an interval. | [
"Returns",
"the",
"time",
"during",
"which",
"scripts",
"executed",
"within",
"an",
"interval",
"."
] | def _ScriptsExecuting(cls, events, start_msec, end_msec):
"""Returns the time during which scripts executed within an interval.
Args:
events: ([tracing.Event]) list of tracing events.
start_msec: (float) start time in ms, inclusive.
end_msec: (float) end time in ms, inclusive.
Returns:
... | [
"def",
"_ScriptsExecuting",
"(",
"cls",
",",
"events",
",",
"start_msec",
",",
"end_msec",
")",
":",
"script_to_duration",
"=",
"collections",
".",
"defaultdict",
"(",
"float",
")",
"script_events",
"=",
"[",
"e",
"for",
"e",
"in",
"events",
"if",
"(",
"'d... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/activity_lens.py#L97-L118 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/_lib/decorator.py | python | FunctionMaker.update | (self, func, **kw) | Update the signature of func with the data in self | Update the signature of func with the data in self | [
"Update",
"the",
"signature",
"of",
"func",
"with",
"the",
"data",
"in",
"self"
] | def update(self, func, **kw):
"Update the signature of func with the data in self"
func.__name__ = self.name
func.__doc__ = getattr(self, 'doc', None)
func.__dict__ = getattr(self, 'dict', {})
func.__defaults__ = getattr(self, 'defaults', ())
func.__kwdefaults__ = getattr... | [
"def",
"update",
"(",
"self",
",",
"func",
",",
"*",
"*",
"kw",
")",
":",
"func",
".",
"__name__",
"=",
"self",
".",
"name",
"func",
".",
"__doc__",
"=",
"getattr",
"(",
"self",
",",
"'doc'",
",",
"None",
")",
"func",
".",
"__dict__",
"=",
"getat... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/_lib/decorator.py#L152-L167 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.IsSingleSel | (self) | return self.HasAGWFlag(ULC_SINGLE_SEL) | Returns ``True`` if we are in single selection mode, ``False`` if multi selection. | Returns ``True`` if we are in single selection mode, ``False`` if multi selection. | [
"Returns",
"True",
"if",
"we",
"are",
"in",
"single",
"selection",
"mode",
"False",
"if",
"multi",
"selection",
"."
] | def IsSingleSel(self):
""" Returns ``True`` if we are in single selection mode, ``False`` if multi selection. """
return self.HasAGWFlag(ULC_SINGLE_SEL) | [
"def",
"IsSingleSel",
"(",
"self",
")",
":",
"return",
"self",
".",
"HasAGWFlag",
"(",
"ULC_SINGLE_SEL",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L6224-L6227 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/sumolib/net/edge.py | python | Edge.getRawShape3D | (self) | return self._rawShape3D | Return the shape that was used in netconvert for building this edge (3D). | Return the shape that was used in netconvert for building this edge (3D). | [
"Return",
"the",
"shape",
"that",
"was",
"used",
"in",
"netconvert",
"for",
"building",
"this",
"edge",
"(",
"3D",
")",
"."
] | def getRawShape3D(self):
"""Return the shape that was used in netconvert for building this edge (3D)."""
if self._shape is None:
self.rebuildShape()
return self._rawShape3D | [
"def",
"getRawShape3D",
"(",
"self",
")",
":",
"if",
"self",
".",
"_shape",
"is",
"None",
":",
"self",
".",
"rebuildShape",
"(",
")",
"return",
"self",
".",
"_rawShape3D"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/sumolib/net/edge.py#L138-L142 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/prepare_binding_Python.py | python | SwigSettings._any_files_newer | (cls, files, check_mtime) | return False | Returns if any of the given files has a newer modified time.
@param cls the class
@param files a list of zero or more file paths to check
@param check_mtime the modification time to use as a reference.
@return True if any file's modified time is newer than check_mtime. | Returns if any of the given files has a newer modified time. | [
"Returns",
"if",
"any",
"of",
"the",
"given",
"files",
"has",
"a",
"newer",
"modified",
"time",
"."
] | def _any_files_newer(cls, files, check_mtime):
"""Returns if any of the given files has a newer modified time.
@param cls the class
@param files a list of zero or more file paths to check
@param check_mtime the modification time to use as a reference.
@return True if any file's... | [
"def",
"_any_files_newer",
"(",
"cls",
",",
"files",
",",
"check_mtime",
")",
":",
"for",
"path",
"in",
"files",
":",
"path_mtime",
"=",
"os",
".",
"path",
".",
"getmtime",
"(",
"path",
")",
"if",
"path_mtime",
">",
"check_mtime",
":",
"# This path was mod... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/prepare_binding_Python.py#L36-L52 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/log/__init__.py | python | setup_logging | () | setup the logging system | setup the logging system | [
"setup",
"the",
"logging",
"system"
] | def setup_logging():
""" setup the logging system """
logging.Logger.spam = _spam
# do not overwrite any of the predefined levels
# https://docs.python.org/3/library/logging.html#logging-levels
logging.addLevelName(1, "MIN")
logging.addLevelName(SPAM, "SPAM")
logging.addLevelName(51, "MAX")... | [
"def",
"setup_logging",
"(",
")",
":",
"logging",
".",
"Logger",
".",
"spam",
"=",
"_spam",
"# do not overwrite any of the predefined levels",
"# https://docs.python.org/3/library/logging.html#logging-levels",
"logging",
".",
"addLevelName",
"(",
"1",
",",
"\"MIN\"",
")",
... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/log/__init__.py#L71-L83 | ||
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/build/engine.py | python | Engine.set_update_action | (self, action_name, targets, sources, properties=None) | Binds a target to the corresponding update action.
If target needs to be updated, the action registered
with action_name will be used.
The 'action_name' must be previously registered by
either 'register_action' or 'register_bjam_action'
method. | Binds a target to the corresponding update action.
If target needs to be updated, the action registered
with action_name will be used.
The 'action_name' must be previously registered by
either 'register_action' or 'register_bjam_action'
method. | [
"Binds",
"a",
"target",
"to",
"the",
"corresponding",
"update",
"action",
".",
"If",
"target",
"needs",
"to",
"be",
"updated",
"the",
"action",
"registered",
"with",
"action_name",
"will",
"be",
"used",
".",
"The",
"action_name",
"must",
"be",
"previously",
... | def set_update_action (self, action_name, targets, sources, properties=None):
""" Binds a target to the corresponding update action.
If target needs to be updated, the action registered
with action_name will be used.
The 'action_name' must be previously registered by
... | [
"def",
"set_update_action",
"(",
"self",
",",
"action_name",
",",
"targets",
",",
"sources",
",",
"properties",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"targets",
",",
"str",
")",
":",
"targets",
"=",
"[",
"targets",
"]",
"if",
"isinstance",
"(",... | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/engine.py#L145-L164 | ||
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/data/collections.py | python | _HOOMDSyncedCollection._isolate | (self) | Remove link to root, parent, and children. | Remove link to root, parent, and children. | [
"Remove",
"link",
"to",
"root",
"parent",
"and",
"children",
"."
] | def _isolate(self):
"""Remove link to root, parent, and children."""
self._children.clear()
self._children._isolated = True
self._parent = None
self._root = None
self._identity = None
self._isolated = True | [
"def",
"_isolate",
"(",
"self",
")",
":",
"self",
".",
"_children",
".",
"clear",
"(",
")",
"self",
".",
"_children",
".",
"_isolated",
"=",
"True",
"self",
".",
"_parent",
"=",
"None",
"self",
".",
"_root",
"=",
"None",
"self",
".",
"_identity",
"="... | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/data/collections.py#L241-L248 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/metrics/_regression.py | python | mean_absolute_error | (y_true, y_pred,
sample_weight=None,
multioutput='uniform_average') | return np.average(output_errors, weights=multioutput) | Mean absolute error regression loss
Read more in the :ref:`User Guide <mean_absolute_error>`.
Parameters
----------
y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
Ground truth (correct) target values.
y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)... | Mean absolute error regression loss | [
"Mean",
"absolute",
"error",
"regression",
"loss"
] | def mean_absolute_error(y_true, y_pred,
sample_weight=None,
multioutput='uniform_average'):
"""Mean absolute error regression loss
Read more in the :ref:`User Guide <mean_absolute_error>`.
Parameters
----------
y_true : array-like of shape (n_samples... | [
"def",
"mean_absolute_error",
"(",
"y_true",
",",
"y_pred",
",",
"sample_weight",
"=",
"None",
",",
"multioutput",
"=",
"'uniform_average'",
")",
":",
"y_type",
",",
"y_true",
",",
"y_pred",
",",
"multioutput",
"=",
"_check_reg_targets",
"(",
"y_true",
",",
"y... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/metrics/_regression.py#L121-L189 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/code.py | python | InteractiveConsole.raw_input | (self, prompt="") | return raw_input(prompt) | Write a prompt and read a line.
The returned line does not include the trailing newline.
When the user enters the EOF key sequence, EOFError is raised.
The base implementation uses the built-in function
raw_input(); a subclass may replace this with a different
implementation. | Write a prompt and read a line. | [
"Write",
"a",
"prompt",
"and",
"read",
"a",
"line",
"."
] | def raw_input(self, prompt=""):
"""Write a prompt and read a line.
The returned line does not include the trailing newline.
When the user enters the EOF key sequence, EOFError is raised.
The base implementation uses the built-in function
raw_input(); a subclass may replace this... | [
"def",
"raw_input",
"(",
"self",
",",
"prompt",
"=",
"\"\"",
")",
":",
"return",
"raw_input",
"(",
"prompt",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/code.py#L270-L281 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/plugin.py | python | PluginData.GetDescription | (self) | return self._description | @return: Plugins description string | [] | def GetDescription(self):
"""@return: Plugins description string"""
return self._description | [
"def",
"GetDescription",
"(",
"self",
")",
":",
"return",
"self",
".",
"_description"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugin.py#L324-L326 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/filters.py | python | do_format | (value, *args, **kwargs) | return soft_unicode(value) % (kwargs or args) | Apply python string formatting on an object:
.. sourcecode:: jinja
{{ "%s - %s"|format("Hello?", "Foo!") }}
-> Hello? - Foo! | Apply python string formatting on an object: | [
"Apply",
"python",
"string",
"formatting",
"on",
"an",
"object",
":"
] | def do_format(value, *args, **kwargs):
"""
Apply python string formatting on an object:
.. sourcecode:: jinja
{{ "%s - %s"|format("Hello?", "Foo!") }}
-> Hello? - Foo!
"""
if args and kwargs:
raise FilterArgumentError('can\'t handle positional and keyword '
... | [
"def",
"do_format",
"(",
"value",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"args",
"and",
"kwargs",
":",
"raise",
"FilterArgumentError",
"(",
"'can\\'t handle positional and keyword '",
"'arguments at the same time'",
")",
"return",
"soft_unicode",... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/filters.py#L673-L685 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/image/detection.py | python | DetHorizontalFlipAug.__call__ | (self, src, label) | return (src, label) | Augmenter implementation | Augmenter implementation | [
"Augmenter",
"implementation"
] | def __call__(self, src, label):
"""Augmenter implementation"""
if random.random() < self.p:
src = nd.flip(src, axis=1)
self._flip_label(label)
return (src, label) | [
"def",
"__call__",
"(",
"self",
",",
"src",
",",
"label",
")",
":",
"if",
"random",
".",
"random",
"(",
")",
"<",
"self",
".",
"p",
":",
"src",
"=",
"nd",
".",
"flip",
"(",
"src",
",",
"axis",
"=",
"1",
")",
"self",
".",
"_flip_label",
"(",
"... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/image/detection.py#L139-L144 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | ParserElement.transformString | (self, instring) | Extension to :class:`scanString`, to modify matching text with modified tokens that may
be returned from a parse action. To use ``transformString``, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking ``transformString()`` on a target string will ... | [] | def transformString(self, instring):
"""
Extension to :class:`scanString`, to modify matching text with modified tokens that may
be returned from a parse action. To use ``transformString``, define a grammar and
attach a parse action to it that modifies the returned token list.
... | [
"def",
"transformString",
"(",
"self",
",",
"instring",
")",
":",
"out",
"=",
"[",
"]",
"lastE",
"=",
"0",
"# force preservation of <TAB>s, to minimize unwanted transformation of string, and to",
"# keep string locs straight between transformString and scanString",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L4065-L4157 | |||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | uCSIsCJKSymbolsandPunctuation | (code) | return ret | Check whether the character is part of
CJKSymbolsandPunctuation UCS Block | Check whether the character is part of
CJKSymbolsandPunctuation UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"CJKSymbolsandPunctuation",
"UCS",
"Block"
] | def uCSIsCJKSymbolsandPunctuation(code):
"""Check whether the character is part of
CJKSymbolsandPunctuation UCS Block """
ret = libxml2mod.xmlUCSIsCJKSymbolsandPunctuation(code)
return ret | [
"def",
"uCSIsCJKSymbolsandPunctuation",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsCJKSymbolsandPunctuation",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2215-L2219 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py | python | Instruction.getClearedFlagsMask | (self) | return self._flagsToIntegerMask(self.asFlClear) | Returns asFlClear into a integer mask value | Returns asFlClear into a integer mask value | [
"Returns",
"asFlClear",
"into",
"a",
"integer",
"mask",
"value"
] | def getClearedFlagsMask(self):
""" Returns asFlClear into a integer mask value """
return self._flagsToIntegerMask(self.asFlClear); | [
"def",
"getClearedFlagsMask",
"(",
"self",
")",
":",
"return",
"self",
".",
"_flagsToIntegerMask",
"(",
"self",
".",
"asFlClear",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py#L1502-L1504 | |
mkeeter/antimony | ee525bbdad34ae94879fd055821f92bcef74e83f | py/fab/shapes.py | python | revolve_y | (a) | return Shape((pos | neg).math, -m, a.bounds.ymin, -m,
m, a.bounds.ymax, m) | Revolve a part in the XY plane about the Y axis. | Revolve a part in the XY plane about the Y axis. | [
"Revolve",
"a",
"part",
"in",
"the",
"XY",
"plane",
"about",
"the",
"Y",
"axis",
"."
] | def revolve_y(a):
''' Revolve a part in the XY plane about the Y axis. '''
# X' = +/- sqrt(X**2 + Z**2)
pos = a.map(Transform('r+qXqZ', '', '', '', '', ''))
neg = a.map(Transform('nr+qXqZ', '', '', '', '', ''))
m = max(abs(a.bounds.xmin), abs(a.bounds.xmax))
return Shape((pos | neg).math, -m, ... | [
"def",
"revolve_y",
"(",
"a",
")",
":",
"# X' = +/- sqrt(X**2 + Z**2)",
"pos",
"=",
"a",
".",
"map",
"(",
"Transform",
"(",
"'r+qXqZ'",
",",
"''",
",",
"''",
",",
"''",
",",
"''",
",",
"''",
")",
")",
"neg",
"=",
"a",
".",
"map",
"(",
"Transform"... | https://github.com/mkeeter/antimony/blob/ee525bbdad34ae94879fd055821f92bcef74e83f/py/fab/shapes.py#L732-L739 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | SizeEvent.SetSize | (*args, **kwargs) | return _core_.SizeEvent_SetSize(*args, **kwargs) | SetSize(self, Size size) | SetSize(self, Size size) | [
"SetSize",
"(",
"self",
"Size",
"size",
")"
] | def SetSize(*args, **kwargs):
"""SetSize(self, Size size)"""
return _core_.SizeEvent_SetSize(*args, **kwargs) | [
"def",
"SetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"SizeEvent_SetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L6163-L6165 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py | python | to_filename | (name) | return name.replace('-', '_') | Convert a project or version name to its filename-escaped form
Any '-' characters are currently replaced with '_'. | Convert a project or version name to its filename-escaped form | [
"Convert",
"a",
"project",
"or",
"version",
"name",
"to",
"its",
"filename",
"-",
"escaped",
"form"
] | def to_filename(name):
"""Convert a project or version name to its filename-escaped form
Any '-' characters are currently replaced with '_'.
"""
return name.replace('-', '_') | [
"def",
"to_filename",
"(",
"name",
")",
":",
"return",
"name",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py#L1346-L1351 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ListView.Create | (*args, **kwargs) | return _controls_.ListView_Create(*args, **kwargs) | Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LC_REPORT,
Validator validator=DefaultValidator, String name=ListCtrlNameStr) -> bool
Do the 2nd phase and create the GUI control. | Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LC_REPORT,
Validator validator=DefaultValidator, String name=ListCtrlNameStr) -> bool | [
"Create",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"LC_REPORT",
"Validator",
"validator",
"=",
"DefaultValidator",
"String",
"name",
"=",
"L... | def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LC_REPORT,
Validator validator=DefaultValidator, String name=ListCtrlNameStr) -> bool
Do the 2nd phase and create the GUI control.
... | [
"def",
"Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListView_Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4905-L4913 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | parseCatalogFile | (filename) | return xmlDoc(_obj=ret) | parse an XML file and build a tree. It's like
xmlParseFile() except it bypass all catalog lookups. | parse an XML file and build a tree. It's like
xmlParseFile() except it bypass all catalog lookups. | [
"parse",
"an",
"XML",
"file",
"and",
"build",
"a",
"tree",
".",
"It",
"s",
"like",
"xmlParseFile",
"()",
"except",
"it",
"bypass",
"all",
"catalog",
"lookups",
"."
] | def parseCatalogFile(filename):
"""parse an XML file and build a tree. It's like
xmlParseFile() except it bypass all catalog lookups. """
ret = libxml2mod.xmlParseCatalogFile(filename)
if ret is None:raise parserError('xmlParseCatalogFile() failed')
return xmlDoc(_obj=ret) | [
"def",
"parseCatalogFile",
"(",
"filename",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlParseCatalogFile",
"(",
"filename",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"parserError",
"(",
"'xmlParseCatalogFile() failed'",
")",
"return",
"xmlDoc",
"(",
"_obj",... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L960-L965 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transforms/hashes.py | python | HashFast._apply_transform | (self, input_tensors, **kwargs) | return self.return_type(result) | Applies the transformation to the `transform_input`.
Args:
input_tensors: a list of Tensors representing the input to
the Transform.
**kwargs: additional keyword arguments, unused here.
Returns:
A namedtuple of Tensors representing the transformed output. | Applies the transformation to the `transform_input`. | [
"Applies",
"the",
"transformation",
"to",
"the",
"transform_input",
"."
] | def _apply_transform(self, input_tensors, **kwargs):
"""Applies the transformation to the `transform_input`.
Args:
input_tensors: a list of Tensors representing the input to
the Transform.
**kwargs: additional keyword arguments, unused here.
Returns:
A namedtuple of Tensors rep... | [
"def",
"_apply_transform",
"(",
"self",
",",
"input_tensors",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"string_ops",
".",
"string_to_hash_bucket_fast",
"(",
"input_tensors",
"[",
"0",
"]",
",",
"self",
".",
"_num_buckets",
",",
"name",
"=",
"None",
... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transforms/hashes.py#L51-L66 | |
wy1iu/LargeMargin_Softmax_Loss | c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec | python/caffe/io.py | python | blobproto_to_array | (blob, return_diff=False) | Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff. | Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff. | [
"Convert",
"a",
"blob",
"proto",
"to",
"an",
"array",
".",
"In",
"default",
"we",
"will",
"just",
"return",
"the",
"data",
"unless",
"return_diff",
"is",
"True",
"in",
"which",
"case",
"we",
"will",
"return",
"the",
"diff",
"."
] | def blobproto_to_array(blob, return_diff=False):
"""
Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff.
"""
# Read the data into an array
if return_diff:
data = np.array(blob.diff)
else:
... | [
"def",
"blobproto_to_array",
"(",
"blob",
",",
"return_diff",
"=",
"False",
")",
":",
"# Read the data into an array",
"if",
"return_diff",
":",
"data",
"=",
"np",
".",
"array",
"(",
"blob",
".",
"diff",
")",
"else",
":",
"data",
"=",
"np",
".",
"array",
... | https://github.com/wy1iu/LargeMargin_Softmax_Loss/blob/c3e9f20e4f16e2b4daf7d358a614366b9b39a6ec/python/caffe/io.py#L18-L34 | ||
unrealcv/unrealcv | 19305da8554c3a0e683a5e27a1e487cc2cf42776 | client/python/unrealcv/automation.py | python | UE4Automation.install | (self, plugin_folder, overwrite = False) | Install the plugin to UE4 engine folder
Parameters
----------
plugin_folder : str
The plugin folder with compiled binaries | Install the plugin to UE4 engine folder | [
"Install",
"the",
"plugin",
"to",
"UE4",
"engine",
"folder"
] | def install(self, plugin_folder, overwrite = False):
'''
Install the plugin to UE4 engine folder
Parameters
----------
plugin_folder : str
The plugin folder with compiled binaries
'''
print('-' * 30 + ' Install ' + '-' * 30)
engine_plugin_fold... | [
"def",
"install",
"(",
"self",
",",
"plugin_folder",
",",
"overwrite",
"=",
"False",
")",
":",
"print",
"(",
"'-'",
"*",
"30",
"+",
"' Install '",
"+",
"'-'",
"*",
"30",
")",
"engine_plugin_folder",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
"... | https://github.com/unrealcv/unrealcv/blob/19305da8554c3a0e683a5e27a1e487cc2cf42776/client/python/unrealcv/automation.py#L69-L92 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/autocomplete.py | python | AutoComplete.open_completions | (self, args) | return not self.autocompletewindow.show_window(
comp_lists, "insert-%dc" % len(comp_start),
complete, mode, wantwin) | Find the completions and create the AutoCompleteWindow.
Return True if successful (no syntax error or so found).
If complete is True, then if there's nothing to complete and no
start of completion, won't open completions and return False.
If mode is given, will open a completion list onl... | Find the completions and create the AutoCompleteWindow.
Return True if successful (no syntax error or so found).
If complete is True, then if there's nothing to complete and no
start of completion, won't open completions and return False.
If mode is given, will open a completion list onl... | [
"Find",
"the",
"completions",
"and",
"create",
"the",
"AutoCompleteWindow",
".",
"Return",
"True",
"if",
"successful",
"(",
"no",
"syntax",
"error",
"or",
"so",
"found",
")",
".",
"If",
"complete",
"is",
"True",
"then",
"if",
"there",
"s",
"nothing",
"to",... | def open_completions(self, args):
"""Find the completions and create the AutoCompleteWindow.
Return True if successful (no syntax error or so found).
If complete is True, then if there's nothing to complete and no
start of completion, won't open completions and return False.
If m... | [
"def",
"open_completions",
"(",
"self",
",",
"args",
")",
":",
"evalfuncs",
",",
"complete",
",",
"wantwin",
",",
"mode",
"=",
"args",
"# Cancel another delayed call, if it exists.",
"if",
"self",
".",
"_delayed_completion_id",
"is",
"not",
"None",
":",
"self",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/autocomplete.py#L93-L151 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mailbox.py | python | MH.flush | (self) | return | Write any pending changes to the disk. | Write any pending changes to the disk. | [
"Write",
"any",
"pending",
"changes",
"to",
"the",
"disk",
"."
] | def flush(self):
"""Write any pending changes to the disk."""
return | [
"def",
"flush",
"(",
"self",
")",
":",
"return"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L1093-L1095 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/tlslite/tlslite/TLSRecordLayer.py | python | TLSRecordLayer.closeAsync | (self) | Start a close operation on the TLS connection.
This function returns a generator which behaves similarly to
close(). Successive invocations of the generator will return 0
if it is waiting to read from the socket, 1 if it is waiting
to write to the socket, or will raise StopIteration if... | Start a close operation on the TLS connection. | [
"Start",
"a",
"close",
"operation",
"on",
"the",
"TLS",
"connection",
"."
] | def closeAsync(self):
"""Start a close operation on the TLS connection.
This function returns a generator which behaves similarly to
close(). Successive invocations of the generator will return 0
if it is waiting to read from the socket, 1 if it is waiting
to write to the socke... | [
"def",
"closeAsync",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"closed",
":",
"for",
"result",
"in",
"self",
".",
"_decrefAsync",
"(",
")",
":",
"yield",
"result"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/tlslite/tlslite/TLSRecordLayer.py#L312-L326 | ||
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/ros_carla_bridge/carla_ackermann_control/src/carla_ackermann_control/carla_ackermann_control_node.py | python | CarlaAckermannControl.update_drive_vehicle_control_command | (self) | Apply the current speed_control_target value to throttle/brake commands | Apply the current speed_control_target value to throttle/brake commands | [
"Apply",
"the",
"current",
"speed_control_target",
"value",
"to",
"throttle",
"/",
"brake",
"commands"
] | def update_drive_vehicle_control_command(self):
"""
Apply the current speed_control_target value to throttle/brake commands
"""
# the driving impedance moves the 'zero' acceleration border
# Interpretation: To reach a zero acceleration the throttle has to pushed
# down f... | [
"def",
"update_drive_vehicle_control_command",
"(",
"self",
")",
":",
"# the driving impedance moves the 'zero' acceleration border",
"# Interpretation: To reach a zero acceleration the throttle has to pushed",
"# down for a certain amount",
"self",
".",
"info",
".",
"status",
".",
"th... | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/ros_carla_bridge/carla_ackermann_control/src/carla_ackermann_control/carla_ackermann_control_node.py#L411-L458 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/distutils/mwerkscompiler.py | python | MWerksCompiler.find_library_file | (self, dirs, lib, debug=0) | return 0 | Search the specified list of directories for a static or shared
library file 'lib' and return the full path to that file. If
'debug' true, look for a debugging version (if that makes sense on
the current platform). Return None if 'lib' wasn't found in any of
the specified directories. | Search the specified list of directories for a static or shared
library file 'lib' and return the full path to that file. If
'debug' true, look for a debugging version (if that makes sense on
the current platform). Return None if 'lib' wasn't found in any of
the specified directories. | [
"Search",
"the",
"specified",
"list",
"of",
"directories",
"for",
"a",
"static",
"or",
"shared",
"library",
"file",
"lib",
"and",
"return",
"the",
"full",
"path",
"to",
"that",
"file",
".",
"If",
"debug",
"true",
"look",
"for",
"a",
"debugging",
"version",... | def find_library_file (self, dirs, lib, debug=0):
"""Search the specified list of directories for a static or shared
library file 'lib' and return the full path to that file. If
'debug' true, look for a debugging version (if that makes sense on
the current platform). Return None if 'li... | [
"def",
"find_library_file",
"(",
"self",
",",
"dirs",
",",
"lib",
",",
"debug",
"=",
"0",
")",
":",
"return",
"0"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/mwerkscompiler.py#L241-L248 | |
pichenettes/eurorack | 11cc3a80f2c6d67ee024091c711dfce59a58cb59 | tools/optimization/munkres.py | python | Munkres.pad_matrix | (self, matrix, pad_value=0) | return new_matrix | Pad a possibly non-square matrix to make it square.
:Parameters:
matrix : list of lists
matrix to pad
pad_value : int
value to use to pad the matrix
:rtype: list of lists
:return: a new, possibly padded, matrix | Pad a possibly non-square matrix to make it square. | [
"Pad",
"a",
"possibly",
"non",
"-",
"square",
"matrix",
"to",
"make",
"it",
"square",
"."
] | def pad_matrix(self, matrix, pad_value=0):
"""
Pad a possibly non-square matrix to make it square.
:Parameters:
matrix : list of lists
matrix to pad
pad_value : int
value to use to pad the matrix
:rtype: list of lists
:re... | [
"def",
"pad_matrix",
"(",
"self",
",",
"matrix",
",",
"pad_value",
"=",
"0",
")",
":",
"max_columns",
"=",
"0",
"total_rows",
"=",
"len",
"(",
"matrix",
")",
"for",
"row",
"in",
"matrix",
":",
"max_columns",
"=",
"max",
"(",
"max_columns",
",",
"len",
... | https://github.com/pichenettes/eurorack/blob/11cc3a80f2c6d67ee024091c711dfce59a58cb59/tools/optimization/munkres.py#L330-L364 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Widget.beginDrag | (self, x: "int", y: "int", viewport: "Viewport") | return _robotsim.Widget_beginDrag(self, x, y, viewport) | r"""
beginDrag(Widget self, int x, int y, Viewport viewport) -> bool | r"""
beginDrag(Widget self, int x, int y, Viewport viewport) -> bool | [
"r",
"beginDrag",
"(",
"Widget",
"self",
"int",
"x",
"int",
"y",
"Viewport",
"viewport",
")",
"-",
">",
"bool"
] | def beginDrag(self, x: "int", y: "int", viewport: "Viewport") -> "bool":
r"""
beginDrag(Widget self, int x, int y, Viewport viewport) -> bool
"""
return _robotsim.Widget_beginDrag(self, x, y, viewport) | [
"def",
"beginDrag",
"(",
"self",
",",
"x",
":",
"\"int\"",
",",
"y",
":",
"\"int\"",
",",
"viewport",
":",
"\"Viewport\"",
")",
"->",
"\"bool\"",
":",
"return",
"_robotsim",
".",
"Widget_beginDrag",
"(",
"self",
",",
"x",
",",
"y",
",",
"viewport",
")"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L3359-L3365 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/idlelib/SearchEngine.py | python | SearchEngine.getprog | (self) | return prog | Return compiled cooked search pattern. | Return compiled cooked search pattern. | [
"Return",
"compiled",
"cooked",
"search",
"pattern",
"."
] | def getprog(self):
"Return compiled cooked search pattern."
pat = self.getpat()
if not pat:
self.report_error(pat, "Empty regular expression")
return None
pat = self.getcookedpat()
flags = 0
if not self.iscase():
flags = flags | re.IGNO... | [
"def",
"getprog",
"(",
"self",
")",
":",
"pat",
"=",
"self",
".",
"getpat",
"(",
")",
"if",
"not",
"pat",
":",
"self",
".",
"report_error",
"(",
"pat",
",",
"\"Empty regular expression\"",
")",
"return",
"None",
"pat",
"=",
"self",
".",
"getcookedpat",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/SearchEngine.py#L73-L91 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rostopic/src/rostopic/__init__.py | python | _rostopic_list_group_by_host | (master, pubs, subs) | return host_pub_topics, host_sub_topics | Build up maps for hostname to topic list per hostname
:returns: publishers host map, subscribers host map, ``{str: set(str)}, {str: set(str)}`` | Build up maps for hostname to topic list per hostname
:returns: publishers host map, subscribers host map, ``{str: set(str)}, {str: set(str)}`` | [
"Build",
"up",
"maps",
"for",
"hostname",
"to",
"topic",
"list",
"per",
"hostname",
":",
"returns",
":",
"publishers",
"host",
"map",
"subscribers",
"host",
"map",
"{",
"str",
":",
"set",
"(",
"str",
")",
"}",
"{",
"str",
":",
"set",
"(",
"str",
")",... | def _rostopic_list_group_by_host(master, pubs, subs):
"""
Build up maps for hostname to topic list per hostname
:returns: publishers host map, subscribers host map, ``{str: set(str)}, {str: set(str)}``
"""
def build_map(master, state, uricache):
tmap = {}
for topic, tnodes in state:
... | [
"def",
"_rostopic_list_group_by_host",
"(",
"master",
",",
"pubs",
",",
"subs",
")",
":",
"def",
"build_map",
"(",
"master",
",",
"state",
",",
"uricache",
")",
":",
"tmap",
"=",
"{",
"}",
"for",
"topic",
",",
"tnodes",
"in",
"state",
":",
"for",
"p",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rostopic/src/rostopic/__init__.py#L1036-L1062 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py | python | Standard_Suite_Events.class_info | (self, _object=None, _attributes={}, **_arguments) | class info: (optional) Get information about an object class
Required argument: the object class about which information is requested
Keyword argument in_: the human language and script system in which to return information
Keyword argument _attributes: AppleEvent attribute dictionary
Re... | class info: (optional) Get information about an object class
Required argument: the object class about which information is requested
Keyword argument in_: the human language and script system in which to return information
Keyword argument _attributes: AppleEvent attribute dictionary
Re... | [
"class",
"info",
":",
"(",
"optional",
")",
"Get",
"information",
"about",
"an",
"object",
"class",
"Required",
"argument",
":",
"the",
"object",
"class",
"about",
"which",
"information",
"is",
"requested",
"Keyword",
"argument",
"in_",
":",
"the",
"human",
... | def class_info(self, _object=None, _attributes={}, **_arguments):
"""class info: (optional) Get information about an object class
Required argument: the object class about which information is requested
Keyword argument in_: the human language and script system in which to return information
... | [
"def",
"class_info",
"(",
"self",
",",
"_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'core'",
"_subcode",
"=",
"'qobj'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/Standard_Suite.py#L20-L40 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/math_ops.py | python | reduce_all | (input_tensor,
axis=None,
keep_dims=False,
name=None,
reduction_indices=None) | return gen_math_ops._all(
input_tensor,
_ReductionDims(input_tensor, axis, reduction_indices),
keep_dims,
name=name) | Computes the "logical and" of elements across dimensions of a tensor.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each
entry in `axis`. If `keep_dims` is true, the reduced dimensions
are retained with length 1.
If `axis`... | Computes the "logical and" of elements across dimensions of a tensor. | [
"Computes",
"the",
"logical",
"and",
"of",
"elements",
"across",
"dimensions",
"of",
"a",
"tensor",
"."
] | def reduce_all(input_tensor,
axis=None,
keep_dims=False,
name=None,
reduction_indices=None):
"""Computes the "logical and" of elements across dimensions of a tensor.
Reduces `input_tensor` along the dimensions given in `axis`.
Unless `keep_dims` is true... | [
"def",
"reduce_all",
"(",
"input_tensor",
",",
"axis",
"=",
"None",
",",
"keep_dims",
"=",
"False",
",",
"name",
"=",
"None",
",",
"reduction_indices",
"=",
"None",
")",
":",
"return",
"gen_math_ops",
".",
"_all",
"(",
"input_tensor",
",",
"_ReductionDims",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/math_ops.py#L1496-L1540 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/SimpleXMLRPCServer.py | python | SimpleXMLRPCDispatcher._dispatch | (self, method, params) | Dispatches the XML-RPC method.
XML-RPC calls are forwarded to a registered function that
matches the called XML-RPC method name. If no such function
exists then the call is forwarded to the registered instance,
if available.
If the registered instance has a _dispatch method the... | Dispatches the XML-RPC method. | [
"Dispatches",
"the",
"XML",
"-",
"RPC",
"method",
"."
] | def _dispatch(self, method, params):
"""Dispatches the XML-RPC method.
XML-RPC calls are forwarded to a registered function that
matches the called XML-RPC method name. If no such function
exists then the call is forwarded to the registered instance,
if available.
If th... | [
"def",
"_dispatch",
"(",
"self",
",",
"method",
",",
"params",
")",
":",
"func",
"=",
"None",
"try",
":",
"# check to see if a matching function has been registered",
"func",
"=",
"self",
".",
"funcs",
"[",
"method",
"]",
"except",
"KeyError",
":",
"if",
"self... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/SimpleXMLRPCServer.py#L376-L420 | ||
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/crashpad/buildtools/checkdeps/java_checker.py | python | JavaChecker.CheckLine | (self, rules, line, filepath, fail_on_temp_allow=False) | return True, None | Checks the given line with the given rule set.
Returns a tuple (is_import, dependency_violation) where
is_import is True only if the line is an import
statement, and dependency_violation is an instance of
results.DependencyViolation if the line violates a rule, or None
if it does not. | Checks the given line with the given rule set. | [
"Checks",
"the",
"given",
"line",
"with",
"the",
"given",
"rule",
"set",
"."
] | def CheckLine(self, rules, line, filepath, fail_on_temp_allow=False):
"""Checks the given line with the given rule set.
Returns a tuple (is_import, dependency_violation) where
is_import is True only if the line is an import
statement, and dependency_violation is an instance of
results.DependencyVio... | [
"def",
"CheckLine",
"(",
"self",
",",
"rules",
",",
"line",
",",
"filepath",
",",
"fail_on_temp_allow",
"=",
"False",
")",
":",
"found_item",
"=",
"self",
".",
"_EXTRACT_IMPORT_PATH",
".",
"match",
"(",
"line",
")",
"if",
"not",
"found_item",
":",
"return"... | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/crashpad/buildtools/checkdeps/java_checker.py#L131-L156 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/text_encoding.py | python | CUnescape | (text) | return (result.encode('utf-8') # PY3: Make it bytes to allow decode.
.decode('unicode_escape')
# Make it bytes again to return the proper type.
.encode('raw_unicode_escape')) | Unescape a text string with C-style escape sequences to UTF-8 bytes.
Args:
text: The data to parse in a str.
Returns:
A byte string. | Unescape a text string with C-style escape sequences to UTF-8 bytes. | [
"Unescape",
"a",
"text",
"string",
"with",
"C",
"-",
"style",
"escape",
"sequences",
"to",
"UTF",
"-",
"8",
"bytes",
"."
] | def CUnescape(text):
# type: (str) -> bytes
"""Unescape a text string with C-style escape sequences to UTF-8 bytes.
Args:
text: The data to parse in a str.
Returns:
A byte string.
"""
def ReplaceHex(m):
# Only replace the match if the number of leading back slashes is odd. i.e.
# the slash... | [
"def",
"CUnescape",
"(",
"text",
")",
":",
"# type: (str) -> bytes",
"def",
"ReplaceHex",
"(",
"m",
")",
":",
"# Only replace the match if the number of leading back slashes is odd. i.e.",
"# the slash itself is not escaped.",
"if",
"len",
"(",
"m",
".",
"group",
"(",
"1"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/text_encoding.py#L91-L117 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py | python | IsErrorSuppressedByNolint | (category, linenum) | return (_global_error_suppressions.get(category, False) or
linenum in _error_suppressions.get(category, set()) or
linenum in _error_suppressions.get(None, set())) | Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the current line number.
Returns:
... | Returns true if the specified error category is suppressed on this line. | [
"Returns",
"true",
"if",
"the",
"specified",
"error",
"category",
"is",
"suppressed",
"on",
"this",
"line",
"."
] | def IsErrorSuppressedByNolint(category, linenum):
"""Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
... | [
"def",
"IsErrorSuppressedByNolint",
"(",
"category",
",",
"linenum",
")",
":",
"return",
"(",
"_global_error_suppressions",
".",
"get",
"(",
"category",
",",
"False",
")",
"or",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"category",
",",
"set",
"... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L770-L785 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/common.py | python | GetEnvironFallback | (var_list, default) | return default | Look up a key in the environment, with fallback to secondary keys
and finally falling back to a default value. | Look up a key in the environment, with fallback to secondary keys
and finally falling back to a default value. | [
"Look",
"up",
"a",
"key",
"in",
"the",
"environment",
"with",
"fallback",
"to",
"secondary",
"keys",
"and",
"finally",
"falling",
"back",
"to",
"a",
"default",
"value",
"."
] | def GetEnvironFallback(var_list, default):
"""Look up a key in the environment, with fallback to secondary keys
and finally falling back to a default value."""
for var in var_list:
if var in os.environ:
return os.environ[var]
return default | [
"def",
"GetEnvironFallback",
"(",
"var_list",
",",
"default",
")",
":",
"for",
"var",
"in",
"var_list",
":",
"if",
"var",
"in",
"os",
".",
"environ",
":",
"return",
"os",
".",
"environ",
"[",
"var",
"]",
"return",
"default"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/common.py#L119-L125 | |
PaddlePaddle/Anakin | 5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730 | tools/external_converter_v2/parser/onnx/onnx_trans_utils.py | python | parse_Pooling | (onnx_node, weights, graph) | parse Pooling
:param onnx_node:
:param weights:
:param graph:
:return: | parse Pooling
:param onnx_node:
:param weights:
:param graph:
:return: | [
"parse",
"Pooling",
":",
"param",
"onnx_node",
":",
":",
"param",
"weights",
":",
":",
"param",
"graph",
":",
":",
"return",
":"
] | def parse_Pooling(onnx_node, weights, graph):
"""
parse Pooling
:param onnx_node:
:param weights:
:param graph:
:return:
"""
onnx_node['visited'] = True
onnx_node['ak_type'] = 'Pooling'
ak_attr = onnx_node['ak_attr']
onnx_attr = onnx_node['onnx_attr']
padding_val = []
... | [
"def",
"parse_Pooling",
"(",
"onnx_node",
",",
"weights",
",",
"graph",
")",
":",
"onnx_node",
"[",
"'visited'",
"]",
"=",
"True",
"onnx_node",
"[",
"'ak_type'",
"]",
"=",
"'Pooling'",
"ak_attr",
"=",
"onnx_node",
"[",
"'ak_attr'",
"]",
"onnx_attr",
"=",
"... | https://github.com/PaddlePaddle/Anakin/blob/5fd68a6cc4c4620cd1a30794c1bf06eebd3f4730/tools/external_converter_v2/parser/onnx/onnx_trans_utils.py#L1009-L1102 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewListCtrl.ItemToRow | (*args, **kwargs) | return _dataview.DataViewListCtrl_ItemToRow(*args, **kwargs) | ItemToRow(self, DataViewItem item) -> int | ItemToRow(self, DataViewItem item) -> int | [
"ItemToRow",
"(",
"self",
"DataViewItem",
"item",
")",
"-",
">",
"int"
] | def ItemToRow(*args, **kwargs):
"""ItemToRow(self, DataViewItem item) -> int"""
return _dataview.DataViewListCtrl_ItemToRow(*args, **kwargs) | [
"def",
"ItemToRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewListCtrl_ItemToRow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L2092-L2094 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.__eq__ | (self, other) | return self._values == other._values | Compares the current instance with another one. | Compares the current instance with another one. | [
"Compares",
"the",
"current",
"instance",
"with",
"another",
"one",
"."
] | def __eq__(self, other):
"""Compares the current instance with another one."""
if self is other:
return True
if not isinstance(other, self.__class__):
raise TypeError('Can only compare repeated composite fields against '
'other repeated composite fields.')
return self._... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"self",
"is",
"other",
":",
"return",
"True",
"if",
"not",
"isinstance",
"(",
"other",
",",
"self",
".",
"__class__",
")",
":",
"raise",
"TypeError",
"(",
"'Can only compare repeated composite field... | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/containers.py#L252-L259 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | Argument.IsPointer | (self) | return False | Returns true if argument is a pointer. | Returns true if argument is a pointer. | [
"Returns",
"true",
"if",
"argument",
"is",
"a",
"pointer",
"."
] | def IsPointer(self):
"""Returns true if argument is a pointer."""
return False | [
"def",
"IsPointer",
"(",
"self",
")",
":",
"return",
"False"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5770-L5772 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/docs/collection.py | python | document_collection_method | (section, resource_name, action_name,
event_emitter, collection_model, service_model,
include_signature=True) | Documents a collection method
:param section: The section to write to
:param resource_name: The name of the resource
:param action_name: The name of collection action. Currently only
can be all, filter, limit, or page_size
:param event_emitter: The event emitter to use to emit events
:p... | Documents a collection method | [
"Documents",
"a",
"collection",
"method"
] | def document_collection_method(section, resource_name, action_name,
event_emitter, collection_model, service_model,
include_signature=True):
"""Documents a collection method
:param section: The section to write to
:param resource_name: The name... | [
"def",
"document_collection_method",
"(",
"section",
",",
"resource_name",
",",
"action_name",
",",
"event_emitter",
",",
"collection_model",
",",
"service_model",
",",
"include_signature",
"=",
"True",
")",
":",
"operation_model",
"=",
"service_model",
".",
"operatio... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/docs/collection.py#L138-L234 | ||
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/autograd.py | python | Expand.__init__ | (self, shape) | Args:
shape (list[int]: indicates the shape you want to expand to,
following the broadcast rule | Args:
shape (list[int]: indicates the shape you want to expand to,
following the broadcast rule | [
"Args",
":",
"shape",
"(",
"list",
"[",
"int",
"]",
":",
"indicates",
"the",
"shape",
"you",
"want",
"to",
"expand",
"to",
"following",
"the",
"broadcast",
"rule"
] | def __init__(self, shape):
"""
Args:
shape (list[int]: indicates the shape you want to expand to,
following the broadcast rule
"""
super(Expand, self).__init__()
self.shape = shape | [
"def",
"__init__",
"(",
"self",
",",
"shape",
")",
":",
"super",
"(",
"Expand",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"shape",
"=",
"shape"
] | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/autograd.py#L5044-L5051 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/isotonic.py | python | IsotonicRegression.__getstate__ | (self) | return state | Pickle-protocol - return state of the estimator. | Pickle-protocol - return state of the estimator. | [
"Pickle",
"-",
"protocol",
"-",
"return",
"state",
"of",
"the",
"estimator",
"."
] | def __getstate__(self):
"""Pickle-protocol - return state of the estimator. """
state = super(IsotonicRegression, self).__getstate__()
# remove interpolation method
state.pop('f_', None)
return state | [
"def",
"__getstate__",
"(",
"self",
")",
":",
"state",
"=",
"super",
"(",
"IsotonicRegression",
",",
"self",
")",
".",
"__getstate__",
"(",
")",
"# remove interpolation method",
"state",
".",
"pop",
"(",
"'f_'",
",",
"None",
")",
"return",
"state"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/isotonic.py#L407-L412 | |
liulei01/DRBox | b5c76e033c555c9009590ab384e1f7bd3c66c237 | python/caffe/io.py | python | Transformer.deprocess | (self, in_, data) | return decaf_in | Invert Caffe formatting; see preprocess(). | Invert Caffe formatting; see preprocess(). | [
"Invert",
"Caffe",
"formatting",
";",
"see",
"preprocess",
"()",
"."
] | def deprocess(self, in_, data):
"""
Invert Caffe formatting; see preprocess().
"""
self.__check_input(in_)
decaf_in = data.copy().squeeze()
transpose = self.transpose.get(in_)
channel_swap = self.channel_swap.get(in_)
raw_scale = self.raw_scale.get(in_)
... | [
"def",
"deprocess",
"(",
"self",
",",
"in_",
",",
"data",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"decaf_in",
"=",
"data",
".",
"copy",
"(",
")",
".",
"squeeze",
"(",
")",
"transpose",
"=",
"self",
".",
"transpose",
".",
"get",
"("... | https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/python/caffe/io.py#L164-L185 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/linalg/decomp_svd.py | python | svd | (a, full_matrices=True, compute_uv=True, overwrite_a=False,
check_finite=True, lapack_driver='gesdd') | Singular Value Decomposition.
Factorizes the matrix `a` into two unitary matrices ``U`` and ``Vh``, and
a 1-D array ``s`` of singular values (real, non-negative) such that
``a == U @ S @ Vh``, where ``S`` is a suitably shaped matrix of zeros with
main diagonal ``s``.
Parameters
----------
... | Singular Value Decomposition. | [
"Singular",
"Value",
"Decomposition",
"."
] | def svd(a, full_matrices=True, compute_uv=True, overwrite_a=False,
check_finite=True, lapack_driver='gesdd'):
"""
Singular Value Decomposition.
Factorizes the matrix `a` into two unitary matrices ``U`` and ``Vh``, and
a 1-D array ``s`` of singular values (real, non-negative) such that
``a =... | [
"def",
"svd",
"(",
"a",
",",
"full_matrices",
"=",
"True",
",",
"compute_uv",
"=",
"True",
",",
"overwrite_a",
"=",
"False",
",",
"check_finite",
"=",
"True",
",",
"lapack_driver",
"=",
"'gesdd'",
")",
":",
"a1",
"=",
"_asarray_validated",
"(",
"a",
",",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/decomp_svd.py#L16-L139 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/tools/js2c.py | python | BuildMetadata | (sources, source_bytes, native_type) | return metadata | Build the meta data required to generate a libaries file.
Args:
sources: A Sources instance with the prepared sources.
source_bytes: A list of source bytes.
(The concatenation of all sources; might be compressed.)
native_type: The parameter for the NativesCollection template.
Returns:
A di... | Build the meta data required to generate a libaries file. | [
"Build",
"the",
"meta",
"data",
"required",
"to",
"generate",
"a",
"libaries",
"file",
"."
] | def BuildMetadata(sources, source_bytes, native_type):
"""Build the meta data required to generate a libaries file.
Args:
sources: A Sources instance with the prepared sources.
source_bytes: A list of source bytes.
(The concatenation of all sources; might be compressed.)
native_type: The parame... | [
"def",
"BuildMetadata",
"(",
"sources",
",",
"source_bytes",
",",
"native_type",
")",
":",
"total_length",
"=",
"len",
"(",
"source_bytes",
")",
"raw_sources",
"=",
"\"\"",
".",
"join",
"(",
"sources",
".",
"modules",
")",
"# The sources are expected to be ASCII-o... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/tools/js2c.py#L440-L489 | |
facebook/fbthrift | fb9c8562aba04c4fd9b17716eb5d970cc88a75bb | thrift/lib/py/util/randomizer.py | python | ListRandomizer._fuzz_insert | (self, seed) | return seed | Fuzz a list seed by inserting a random element at a random index | Fuzz a list seed by inserting a random element at a random index | [
"Fuzz",
"a",
"list",
"seed",
"by",
"inserting",
"a",
"random",
"element",
"at",
"a",
"random",
"index"
] | def _fuzz_insert(self, seed):
"""Fuzz a list seed by inserting a random element at a random index"""
randomizer = self._element_randomizer
new_elem = randomizer.generate()
insertion_index = random.randint(0, len(seed))
seed.insert(insertion_index, new_elem)
return seed | [
"def",
"_fuzz_insert",
"(",
"self",
",",
"seed",
")",
":",
"randomizer",
"=",
"self",
".",
"_element_randomizer",
"new_elem",
"=",
"randomizer",
".",
"generate",
"(",
")",
"insertion_index",
"=",
"random",
".",
"randint",
"(",
"0",
",",
"len",
"(",
"seed",... | https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/thrift/lib/py/util/randomizer.py#L571-L577 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/server_lib.py | python | ClusterSpec.as_dict | (self) | return self._cluster_spec | Returns a dictionary from job names to lists of network addresses. | Returns a dictionary from job names to lists of network addresses. | [
"Returns",
"a",
"dictionary",
"from",
"job",
"names",
"to",
"lists",
"of",
"network",
"addresses",
"."
] | def as_dict(self):
"""Returns a dictionary from job names to lists of network addresses."""
return self._cluster_spec | [
"def",
"as_dict",
"(",
"self",
")",
":",
"return",
"self",
".",
"_cluster_spec"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/server_lib.py#L285-L287 | |
swig/swig | b624d17f3f42da37ee601945d795dca392e01f84 | Tools/utils.py | python | check_dir_exists | (path) | return os.path.isdir(path) | Checks if a folder exists or not. | Checks if a folder exists or not. | [
"Checks",
"if",
"a",
"folder",
"exists",
"or",
"not",
"."
] | def check_dir_exists(path):
"""
Checks if a folder exists or not.
"""
return os.path.isdir(path) | [
"def",
"check_dir_exists",
"(",
"path",
")",
":",
"return",
"os",
".",
"path",
".",
"isdir",
"(",
"path",
")"
] | https://github.com/swig/swig/blob/b624d17f3f42da37ee601945d795dca392e01f84/Tools/utils.py#L11-L15 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/page.py | python | _detect_screen_size | (screen_lines_def) | return screen_lines_real | Attempt to work out the number of lines on the screen.
This is called by page(). It can raise an error (e.g. when run in the
test suite), so it's separated out so it can easily be called in a try block. | Attempt to work out the number of lines on the screen. | [
"Attempt",
"to",
"work",
"out",
"the",
"number",
"of",
"lines",
"on",
"the",
"screen",
"."
] | def _detect_screen_size(screen_lines_def):
"""Attempt to work out the number of lines on the screen.
This is called by page(). It can raise an error (e.g. when run in the
test suite), so it's separated out so it can easily be called in a try block.
"""
TERM = os.environ.get('TERM',None)
if not(... | [
"def",
"_detect_screen_size",
"(",
"screen_lines_def",
")",
":",
"TERM",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'TERM'",
",",
"None",
")",
"if",
"not",
"(",
"(",
"TERM",
"==",
"'xterm'",
"or",
"TERM",
"==",
"'xterm-color'",
")",
"and",
"sys",
"."... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/page.py#L80-L123 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | FileSystemHandler.CanOpen | (*args, **kwargs) | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) | CanOpen(self, String location) -> bool | CanOpen(self, String location) -> bool | [
"CanOpen",
"(",
"self",
"String",
"location",
")",
"-",
">",
"bool"
] | def CanOpen(*args, **kwargs):
"""CanOpen(self, String location) -> bool"""
return _core_.FileSystemHandler_CanOpen(*args, **kwargs) | [
"def",
"CanOpen",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"FileSystemHandler_CanOpen",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L2344-L2346 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.