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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
greenheartgames/greenworks | 3ea4ab490b56676de3f0a237c74bcfdb17323e60 | deps/cpplint/cpplint.py | python | FileInfo.BaseName | (self) | return self.Split()[1] | File base name - text after the final slash, before the final period. | File base name - text after the final slash, before the final period. | [
"File",
"base",
"name",
"-",
"text",
"after",
"the",
"final",
"slash",
"before",
"the",
"final",
"period",
"."
] | def BaseName(self):
"""File base name - text after the final slash, before the final period."""
return self.Split()[1] | [
"def",
"BaseName",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"1",
"]"
] | https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L1144-L1146 | |
NERSC/timemory | 431912b360ff50d1a160d7826e2eea04fbd1037f | scripts/gprof2dot.py | python | Theme.hsl_to_rgb | (self, h, s, l) | return (r, g, b) | Convert a color from HSL color-model to RGB.
See also:
- http://www.w3.org/TR/css3-color/#hsl-color | Convert a color from HSL color-model to RGB. | [
"Convert",
"a",
"color",
"from",
"HSL",
"color",
"-",
"model",
"to",
"RGB",
"."
] | def hsl_to_rgb(self, h, s, l):
"""Convert a color from HSL color-model to RGB.
See also:
- http://www.w3.org/TR/css3-color/#hsl-color
"""
h = h % 1.0
s = min(max(s, 0.0), 1.0)
l = min(max(l, 0.0), 1.0)
if l <= 0.5:
m2 = l*(s + 1.0)
e... | [
"def",
"hsl_to_rgb",
"(",
"self",
",",
"h",
",",
"s",
",",
"l",
")",
":",
"h",
"=",
"h",
"%",
"1.0",
"s",
"=",
"min",
"(",
"max",
"(",
"s",
",",
"0.0",
")",
",",
"1.0",
")",
"l",
"=",
"min",
"(",
"max",
"(",
"l",
",",
"0.0",
")",
",",
... | https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/scripts/gprof2dot.py#L2863-L2888 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py | python | Node.select_scanner | (self, scanner) | return scanner.select(self) | Selects a scanner for this Node.
This is a separate method so it can be overridden by Node
subclasses (specifically, Node.FS.Dir) that *must* use their
own Scanner and don't select one the Scanner.Selector that's
configured for the target. | Selects a scanner for this Node. | [
"Selects",
"a",
"scanner",
"for",
"this",
"Node",
"."
] | def select_scanner(self, scanner):
"""Selects a scanner for this Node.
This is a separate method so it can be overridden by Node
subclasses (specifically, Node.FS.Dir) that *must* use their
own Scanner and don't select one the Scanner.Selector that's
configured for the target.
... | [
"def",
"select_scanner",
"(",
"self",
",",
"scanner",
")",
":",
"return",
"scanner",
".",
"select",
"(",
"self",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py#L1062-L1070 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | RegionIterator.GetW | (*args, **kwargs) | return _gdi_.RegionIterator_GetW(*args, **kwargs) | GetW(self) -> int | GetW(self) -> int | [
"GetW",
"(",
"self",
")",
"-",
">",
"int"
] | def GetW(*args, **kwargs):
"""GetW(self) -> int"""
return _gdi_.RegionIterator_GetW(*args, **kwargs) | [
"def",
"GetW",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"RegionIterator_GetW",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L1678-L1680 | |
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/texture.py | python | Texture.dtype | (self) | return self._dtype | str: Data type. | str: Data type. | [
"str",
":",
"Data",
"type",
"."
] | def dtype(self) -> str:
'''
str: Data type.
'''
return self._dtype | [
"def",
"dtype",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_dtype"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/texture.py#L285-L290 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py | python | _StandaloneConnection.__init__ | (self, request_handler) | Construct an instance.
Args:
request_handler: A WebSocketRequestHandler instance. | Construct an instance. | [
"Construct",
"an",
"instance",
"."
] | def __init__(self, request_handler):
"""Construct an instance.
Args:
request_handler: A WebSocketRequestHandler instance.
"""
self._request_handler = request_handler | [
"def",
"__init__",
"(",
"self",
",",
"request_handler",
")",
":",
"self",
".",
"_request_handler",
"=",
"request_handler"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py#L201-L208 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py2/jinja2/runtime.py | python | Context.call | (__self, __obj, *args, **kwargs) | Call the callable with the arguments and keyword arguments
provided but inject the active context or environment as first
argument if the callable is a :func:`contextfunction` or
:func:`environmentfunction`. | Call the callable with the arguments and keyword arguments
provided but inject the active context or environment as first
argument if the callable is a :func:`contextfunction` or
:func:`environmentfunction`. | [
"Call",
"the",
"callable",
"with",
"the",
"arguments",
"and",
"keyword",
"arguments",
"provided",
"but",
"inject",
"the",
"active",
"context",
"or",
"environment",
"as",
"first",
"argument",
"if",
"the",
"callable",
"is",
"a",
":",
"func",
":",
"contextfunctio... | def call(__self, __obj, *args, **kwargs): # noqa: B902
"""Call the callable with the arguments and keyword arguments
provided but inject the active context or environment as first
argument if the callable is a :func:`contextfunction` or
:func:`environmentfunction`.
"""
i... | [
"def",
"call",
"(",
"__self",
",",
"__obj",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: B902",
"if",
"__debug__",
":",
"__traceback_hide__",
"=",
"True",
"# noqa",
"# Allow callable classes to take a context",
"if",
"hasattr",
"(",
"__obj",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/runtime.py#L261-L296 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/code_coverage/croc.py | python | Coverage.ParseConfig | (self, filename, **kwargs) | Parses a configuration file.
Args:
filename: Config filename.
kwargs: Additional parameters to pass to AddConfig(). | Parses a configuration file. | [
"Parses",
"a",
"configuration",
"file",
"."
] | def ParseConfig(self, filename, **kwargs):
"""Parses a configuration file.
Args:
filename: Config filename.
kwargs: Additional parameters to pass to AddConfig().
"""
# TODO: All manner of error checking
f = None
try:
f = open(filename, 'rt')
# Need to strip CR's from CRL... | [
"def",
"ParseConfig",
"(",
"self",
",",
"filename",
",",
"*",
"*",
"kwargs",
")",
":",
"# TODO: All manner of error checking",
"f",
"=",
"None",
"try",
":",
"f",
"=",
"open",
"(",
"filename",
",",
"'rt'",
")",
"# Need to strip CR's from CRLF-terminated lines or po... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/code_coverage/croc.py#L539-L568 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenu.SendOverItem | (self, itemIdx, over) | Sends the ``EVT_FLAT_MENU_ITEM_MOUSE_OVER`` and ``EVT_FLAT_MENU_ITEM_MOUSE_OUT``
events.
:param integer `itemIdx`: the menu item index for which we want to send an event;
:param bool `over`: ``True`` to send a ``EVT_FLAT_MENU_ITEM_MOUSE_OVER`` event, ``False`` to
send a ``EVT_FLAT_MENU... | Sends the ``EVT_FLAT_MENU_ITEM_MOUSE_OVER`` and ``EVT_FLAT_MENU_ITEM_MOUSE_OUT``
events. | [
"Sends",
"the",
"EVT_FLAT_MENU_ITEM_MOUSE_OVER",
"and",
"EVT_FLAT_MENU_ITEM_MOUSE_OUT",
"events",
"."
] | def SendOverItem(self, itemIdx, over):
"""
Sends the ``EVT_FLAT_MENU_ITEM_MOUSE_OVER`` and ``EVT_FLAT_MENU_ITEM_MOUSE_OUT``
events.
:param integer `itemIdx`: the menu item index for which we want to send an event;
:param bool `over`: ``True`` to send a ``EVT_FLAT_MENU_ITEM_MOUSE... | [
"def",
"SendOverItem",
"(",
"self",
",",
"itemIdx",
",",
"over",
")",
":",
"item",
"=",
"self",
".",
"_itemsArr",
"[",
"itemIdx",
"]",
"# Create the event",
"event",
"=",
"FlatMenuEvent",
"(",
"(",
"over",
"and",
"[",
"wxEVT_FLAT_MENU_ITEM_MOUSE_OVER",
"]",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L6992-L7016 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Optimizer/vai_p_pytorch/cifar10/analyse.py | python | accuracy | (output, target, topk=(1,)) | Computes the accuracy over the k top predictions
for the specified values of k | Computes the accuracy over the k top predictions
for the specified values of k | [
"Computes",
"the",
"accuracy",
"over",
"the",
"k",
"top",
"predictions",
"for",
"the",
"specified",
"values",
"of",
"k"
] | def accuracy(output, target, topk=(1,)):
"""Computes the accuracy over the k top predictions
for the specified values of k"""
with torch.no_grad():
maxk = max(topk)
batch_size = target.size(0)
_, pred = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, -1).ex... | [
"def",
"accuracy",
"(",
"output",
",",
"target",
",",
"topk",
"=",
"(",
"1",
",",
")",
")",
":",
"with",
"torch",
".",
"no_grad",
"(",
")",
":",
"maxk",
"=",
"max",
"(",
"topk",
")",
"batch_size",
"=",
"target",
".",
"size",
"(",
"0",
")",
"_",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Optimizer/vai_p_pytorch/cifar10/analyse.py#L60-L75 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/multiprocessing/__init__.py | python | set_sharing_strategy | (new_strategy) | Sets the strategy for sharing CPU tensors.
Args:
new_strategy (str): Name of the selected strategy. Should be one of
the values returned by :func:`get_all_sharing_strategies()`. | Sets the strategy for sharing CPU tensors. | [
"Sets",
"the",
"strategy",
"for",
"sharing",
"CPU",
"tensors",
"."
] | def set_sharing_strategy(new_strategy):
"""Sets the strategy for sharing CPU tensors.
Args:
new_strategy (str): Name of the selected strategy. Should be one of
the values returned by :func:`get_all_sharing_strategies()`.
"""
global _sharing_strategy
assert new_strategy in _all_s... | [
"def",
"set_sharing_strategy",
"(",
"new_strategy",
")",
":",
"global",
"_sharing_strategy",
"assert",
"new_strategy",
"in",
"_all_sharing_strategies",
"_sharing_strategy",
"=",
"new_strategy"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/multiprocessing/__init__.py#L50-L59 | ||
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armoryengine/ArmoryUtils.py | python | SettingsFile.extend | (self, name, value) | Adds/converts setting to list, appends value to the end of it | Adds/converts setting to list, appends value to the end of it | [
"Adds",
"/",
"converts",
"setting",
"to",
"list",
"appends",
"value",
"to",
"the",
"end",
"of",
"it"
] | def extend(self, name, value):
""" Adds/converts setting to list, appends value to the end of it """
if not self.settingsMap.has_key(name):
if isinstance(value, list):
self.set(name, value)
else:
self.set(name, [value])
else:
origVal = self.get(name, ... | [
"def",
"extend",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"if",
"not",
"self",
".",
"settingsMap",
".",
"has_key",
"(",
"name",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"self",
".",
"set",
"(",
"name",
",",
"val... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/ArmoryUtils.py#L3558-L3572 | ||
TimoSaemann/caffe-segnet-cudnn5 | abcf30dca449245e101bf4ced519f716177f0885 | scripts/cpp_lint.py | python | CheckForHeaderGuard | (filename, lines, error) | Checks that the file contains a header guard.
Logs an error if no #ifndef header guard is present. For other
headers, checks that the full pathname is used.
Args:
filename: The name of the C++ header file.
lines: An array of strings, each representing a line of the file.
error: The function to call... | Checks that the file contains a header guard. | [
"Checks",
"that",
"the",
"file",
"contains",
"a",
"header",
"guard",
"."
] | def CheckForHeaderGuard(filename, lines, error):
"""Checks that the file contains a header guard.
Logs an error if no #ifndef header guard is present. For other
headers, checks that the full pathname is used.
Args:
filename: The name of the C++ header file.
lines: An array of strings, each representi... | [
"def",
"CheckForHeaderGuard",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"cppvar",
"=",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
"ifndef",
"=",
"None",
"ifndef_linenum",
"=",
"0",
"define",
"=",
"None",
"endif",
"=",
"None",
"endif_linenu... | https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/scripts/cpp_lint.py#L1408-L1480 | ||
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/seqan/dox/proc_doc.py | python | EntryConverter.bodyToTextNode | (self, raw_body) | return res | Convert a RawBody to a TextNode. | Convert a RawBody to a TextNode. | [
"Convert",
"a",
"RawBody",
"to",
"a",
"TextNode",
"."
] | def bodyToTextNode(self, raw_body):
"""Convert a RawBody to a TextNode."""
res = TextNode(type='div')
for p in raw_body.paragraphs:
try:
if p.getType() == 'paragraph':
if not p.text.text.strip():
continue # Skip whitespace
... | [
"def",
"bodyToTextNode",
"(",
"self",
",",
"raw_body",
")",
":",
"res",
"=",
"TextNode",
"(",
"type",
"=",
"'div'",
")",
"for",
"p",
"in",
"raw_body",
".",
"paragraphs",
":",
"try",
":",
"if",
"p",
".",
"getType",
"(",
")",
"==",
"'paragraph'",
":",
... | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/dox/proc_doc.py#L1155-L1203 | |
yuxng/DA-RNN | 77fbb50b4272514588a10a9f90b7d5f8d46974fb | lib/datasets/rgbd_scene.py | python | rgbd_scene.depth_path_from_index | (self, index) | return depth_path | Construct an depth path from the image's "index" identifier. | Construct an depth path from the image's "index" identifier. | [
"Construct",
"an",
"depth",
"path",
"from",
"the",
"image",
"s",
"index",
"identifier",
"."
] | def depth_path_from_index(self, index):
"""
Construct an depth path from the image's "index" identifier.
"""
depth_path = os.path.join(self._data_path, index + '-depth' + self._image_ext)
assert os.path.exists(depth_path), \
'Path does not exist: {}'.format(depth_... | [
"def",
"depth_path_from_index",
"(",
"self",
",",
"index",
")",
":",
"depth_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_data_path",
",",
"index",
"+",
"'-depth'",
"+",
"self",
".",
"_image_ext",
")",
"assert",
"os",
".",
"path",
"."... | https://github.com/yuxng/DA-RNN/blob/77fbb50b4272514588a10a9f90b7d5f8d46974fb/lib/datasets/rgbd_scene.py#L55-L62 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/dataset/wmt16.py | python | get_dict | (lang, dict_size, reverse=False) | return __load_dict(tar_file, dict_size, lang, reverse) | return the word dictionary for the specified language.
Args:
lang(string): A string indicating which language is the source
language. Available options are: "en" for English
and "de" for Germany.
dict_size(int): Size of the specified language dictionary.
... | return the word dictionary for the specified language. | [
"return",
"the",
"word",
"dictionary",
"for",
"the",
"specified",
"language",
"."
] | def get_dict(lang, dict_size, reverse=False):
"""
return the word dictionary for the specified language.
Args:
lang(string): A string indicating which language is the source
language. Available options are: "en" for English
and "de" for Germany.
d... | [
"def",
"get_dict",
"(",
"lang",
",",
"dict_size",
",",
"reverse",
"=",
"False",
")",
":",
"if",
"lang",
"==",
"\"en\"",
":",
"dict_size",
"=",
"min",
"(",
"dict_size",
",",
"TOTAL_EN_WORDS",
")",
"else",
":",
"dict_size",
"=",
"min",
"(",
"dict_size",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/dataset/wmt16.py#L307-L334 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/externals/cloudpickle/cloudpickle.py | python | _make_skeleton_enum | (bases, name, qualname, members, module,
class_tracker_id, extra) | return _lookup_class_or_track(class_tracker_id, enum_class) | Build dynamic enum with an empty __dict__ to be filled once memoized
The creation of the enum class is inspired by the code of
EnumMeta._create_.
If class_tracker_id is not None, try to lookup an existing enum definition
matching that id. If none is found, track a newly reconstructed enum
definiti... | Build dynamic enum with an empty __dict__ to be filled once memoized | [
"Build",
"dynamic",
"enum",
"with",
"an",
"empty",
"__dict__",
"to",
"be",
"filled",
"once",
"memoized"
] | def _make_skeleton_enum(bases, name, qualname, members, module,
class_tracker_id, extra):
"""Build dynamic enum with an empty __dict__ to be filled once memoized
The creation of the enum class is inspired by the code of
EnumMeta._create_.
If class_tracker_id is not None, try to... | [
"def",
"_make_skeleton_enum",
"(",
"bases",
",",
"name",
",",
"qualname",
",",
"members",
",",
"module",
",",
"class_tracker_id",
",",
"extra",
")",
":",
"# enums always inherit from their base Enum class at the last position in",
"# the list of base classes:",
"enum_base",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/externals/cloudpickle/cloudpickle.py#L876-L903 | |
CNevd/Difacto_DMLC | f16862e35062707b1cf7e37d04d9b6ae34bbfd28 | dmlc-core/tracker/dmlc_sge.py | python | sge_submit | (nworker, nserver, pass_envs) | customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional parameters in input
Parameters
nworker number of slave process to start up
nserver number of server nodes to start up
pass_envs enviromen... | customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional parameters in input
Parameters
nworker number of slave process to start up
nserver number of server nodes to start up
pass_envs enviromen... | [
"customized",
"submit",
"script",
"that",
"submit",
"nslave",
"jobs",
"each",
"must",
"contain",
"args",
"as",
"parameter",
"note",
"this",
"can",
"be",
"a",
"lambda",
"function",
"containing",
"additional",
"parameters",
"in",
"input",
"Parameters",
"nworker",
... | def sge_submit(nworker, nserver, pass_envs):
"""
customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional parameters in input
Parameters
nworker number of slave process to start up
nserver numb... | [
"def",
"sge_submit",
"(",
"nworker",
",",
"nserver",
",",
"pass_envs",
")",
":",
"env_arg",
"=",
"','",
".",
"join",
"(",
"[",
"'%s=\\\"%s\\\"'",
"%",
"(",
"k",
",",
"str",
"(",
"v",
")",
")",
"for",
"k",
",",
"v",
"in",
"pass_envs",
".",
"items",
... | https://github.com/CNevd/Difacto_DMLC/blob/f16862e35062707b1cf7e37d04d9b6ae34bbfd28/dmlc-core/tracker/dmlc_sge.py#L51-L71 | ||
Illumina/strelka | d7377443b62319f7c7bd70c241c4b2df3459e29a | src/python/lib/workflowUtil.py | python | cleanId | (input_id) | return re.sub(r'([^a-zA-Z0-9_\-])', "_", input_id) | filter id so that it's safe to use as a pyflow indentifier | filter id so that it's safe to use as a pyflow indentifier | [
"filter",
"id",
"so",
"that",
"it",
"s",
"safe",
"to",
"use",
"as",
"a",
"pyflow",
"indentifier"
] | def cleanId(input_id) :
"""
filter id so that it's safe to use as a pyflow indentifier
"""
import re
return re.sub(r'([^a-zA-Z0-9_\-])', "_", input_id) | [
"def",
"cleanId",
"(",
"input_id",
")",
":",
"import",
"re",
"return",
"re",
".",
"sub",
"(",
"r'([^a-zA-Z0-9_\\-])'",
",",
"\"_\"",
",",
"input_id",
")"
] | https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/workflowUtil.py#L265-L270 | |
emsesp/EMS-ESP | 65c4a381bf8df61d1e18ba00223b1a55933fc547 | scripts/esptool.py | python | timeout_per_mb | (seconds_per_mb, size_bytes) | return result | Scales timeouts which are size-specific | Scales timeouts which are size-specific | [
"Scales",
"timeouts",
"which",
"are",
"size",
"-",
"specific"
] | def timeout_per_mb(seconds_per_mb, size_bytes):
""" Scales timeouts which are size-specific """
result = seconds_per_mb * (size_bytes / 1e6)
if result < DEFAULT_TIMEOUT:
return DEFAULT_TIMEOUT
return result | [
"def",
"timeout_per_mb",
"(",
"seconds_per_mb",
",",
"size_bytes",
")",
":",
"result",
"=",
"seconds_per_mb",
"*",
"(",
"size_bytes",
"/",
"1e6",
")",
"if",
"result",
"<",
"DEFAULT_TIMEOUT",
":",
"return",
"DEFAULT_TIMEOUT",
"return",
"result"
] | https://github.com/emsesp/EMS-ESP/blob/65c4a381bf8df61d1e18ba00223b1a55933fc547/scripts/esptool.py#L79-L84 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftobjects/layer.py | python | Layer.addObject | (self, obj, child) | Add an object to this object if not in the Group property. | Add an object to this object if not in the Group property. | [
"Add",
"an",
"object",
"to",
"this",
"object",
"if",
"not",
"in",
"the",
"Group",
"property",
"."
] | def addObject(self, obj, child):
"""Add an object to this object if not in the Group property."""
group = obj.Group
if child not in group:
group.append(child)
obj.Group = group | [
"def",
"addObject",
"(",
"self",
",",
"obj",
",",
"child",
")",
":",
"group",
"=",
"obj",
".",
"Group",
"if",
"child",
"not",
"in",
"group",
":",
"group",
".",
"append",
"(",
"child",
")",
"obj",
".",
"Group",
"=",
"group"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftobjects/layer.py#L77-L82 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/sensors/sensor.py | python | newer_obs_blender | (low_value: Any, unused_high_value: Any,
unused_coeff: float) | return low_value | Always choosing low value, which is the newer value between low/high. | Always choosing low value, which is the newer value between low/high. | [
"Always",
"choosing",
"low",
"value",
"which",
"is",
"the",
"newer",
"value",
"between",
"low",
"/",
"high",
"."
] | def newer_obs_blender(low_value: Any, unused_high_value: Any,
unused_coeff: float):
"""Always choosing low value, which is the newer value between low/high."""
return low_value | [
"def",
"newer_obs_blender",
"(",
"low_value",
":",
"Any",
",",
"unused_high_value",
":",
"Any",
",",
"unused_coeff",
":",
"float",
")",
":",
"return",
"low_value"
] | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/sensors/sensor.py#L49-L52 | |
AcademySoftwareFoundation/OpenColorIO | 73508eb5230374df8d96147a0627c015d359a641 | share/docs/frozendoc.py | python | backup_frozen | (app) | Duplicate existing frozen RST files for comparison with newly
frozen RST in ``compare_frozen()`` after docs are built. | Duplicate existing frozen RST files for comparison with newly
frozen RST in ``compare_frozen()`` after docs are built. | [
"Duplicate",
"existing",
"frozen",
"RST",
"files",
"for",
"comparison",
"with",
"newly",
"frozen",
"RST",
"in",
"compare_frozen",
"()",
"after",
"docs",
"are",
"built",
"."
] | def backup_frozen(app):
"""
Duplicate existing frozen RST files for comparison with newly
frozen RST in ``compare_frozen()`` after docs are built.
"""
if app.config.frozendoc_build or app.config.frozendoc_compare:
# Apply monkeypatch, enabling frozen RST generation
patch()
if n... | [
"def",
"backup_frozen",
"(",
"app",
")",
":",
"if",
"app",
".",
"config",
".",
"frozendoc_build",
"or",
"app",
".",
"config",
".",
"frozendoc_compare",
":",
"# Apply monkeypatch, enabling frozen RST generation",
"patch",
"(",
")",
"if",
"not",
"app",
".",
"confi... | https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/73508eb5230374df8d96147a0627c015d359a641/share/docs/frozendoc.py#L174-L202 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/cookies.py | python | remove_cookie_by_name | (cookiejar, name, domain=None, path=None) | Unsets a cookie by name, by default over all domains and paths.
Wraps CookieJar.clear(), is O(n). | Unsets a cookie by name, by default over all domains and paths. | [
"Unsets",
"a",
"cookie",
"by",
"name",
"by",
"default",
"over",
"all",
"domains",
"and",
"paths",
"."
] | def remove_cookie_by_name(cookiejar, name, domain=None, path=None):
"""Unsets a cookie by name, by default over all domains and paths.
Wraps CookieJar.clear(), is O(n).
"""
clearables = []
for cookie in cookiejar:
if cookie.name != name:
continue
if domain is not None an... | [
"def",
"remove_cookie_by_name",
"(",
"cookiejar",
",",
"name",
",",
"domain",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"clearables",
"=",
"[",
"]",
"for",
"cookie",
"in",
"cookiejar",
":",
"if",
"cookie",
".",
"name",
"!=",
"name",
":",
"contin... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/cookies.py#L146-L162 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/internals/blocks.py | python | Block.putmask | (self, mask, new) | putmask the data to the block; it is possible that we may create a
new dtype of block
Return the resulting block(s).
Parameters
----------
mask : np.ndarray[bool], SparseArray[bool], or BooleanArray
new : a ndarray/object
Returns
-------
List[Bl... | putmask the data to the block; it is possible that we may create a
new dtype of block | [
"putmask",
"the",
"data",
"to",
"the",
"block",
";",
"it",
"is",
"possible",
"that",
"we",
"may",
"create",
"a",
"new",
"dtype",
"of",
"block"
] | def putmask(self, mask, new) -> list[Block]:
"""
putmask the data to the block; it is possible that we may create a
new dtype of block
Return the resulting block(s).
Parameters
----------
mask : np.ndarray[bool], SparseArray[bool], or BooleanArray
new : ... | [
"def",
"putmask",
"(",
"self",
",",
"mask",
",",
"new",
")",
"->",
"list",
"[",
"Block",
"]",
":",
"orig_mask",
"=",
"mask",
"mask",
",",
"noop",
"=",
"validate_putmask",
"(",
"self",
".",
"values",
".",
"T",
",",
"mask",
")",
"assert",
"not",
"isi... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/blocks.py#L990-L1053 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/urlgrabber/mirror.py | python | MirrorGroup.increment_mirror | (self, gr, action={}) | Tell the mirror object increment the mirror index
This increments the mirror index, which amounts to telling the
mirror object to use a different mirror (for this and future
downloads).
This is a SEMI-public method. It will be called internally,
and you may never need to call ... | Tell the mirror object increment the mirror index | [
"Tell",
"the",
"mirror",
"object",
"increment",
"the",
"mirror",
"index"
] | def increment_mirror(self, gr, action={}):
"""Tell the mirror object increment the mirror index
This increments the mirror index, which amounts to telling the
mirror object to use a different mirror (for this and future
downloads).
This is a SEMI-public method. It will be call... | [
"def",
"increment_mirror",
"(",
"self",
",",
"gr",
",",
"action",
"=",
"{",
"}",
")",
":",
"badmirror",
"=",
"gr",
".",
"mirrors",
"[",
"gr",
".",
"_next",
"]",
"self",
".",
"_lock",
".",
"acquire",
"(",
")",
"try",
":",
"ind",
"=",
"self",
".",
... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/urlgrabber/mirror.py#L315-L362 | ||
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | SynthText_Chinese/ransac.py | python | fit_plane_ransac | (pts, neighbors=None,z_pos=None, dist_inlier=0.05,
min_inlier_frac=0.60, nsample=3, max_iter=100) | Fits a 3D plane model using RANSAC.
pts : (nx3 array) of point coordinates | Fits a 3D plane model using RANSAC.
pts : (nx3 array) of point coordinates | [
"Fits",
"a",
"3D",
"plane",
"model",
"using",
"RANSAC",
".",
"pts",
":",
"(",
"nx3",
"array",
")",
"of",
"point",
"coordinates"
] | def fit_plane_ransac(pts, neighbors=None,z_pos=None, dist_inlier=0.05,
min_inlier_frac=0.60, nsample=3, max_iter=100):
"""
Fits a 3D plane model using RANSAC.
pts : (nx3 array) of point coordinates
"""
n,_ = pts.shape
ninlier,models = [],[]
for i in xrange(max_iter)... | [
"def",
"fit_plane_ransac",
"(",
"pts",
",",
"neighbors",
"=",
"None",
",",
"z_pos",
"=",
"None",
",",
"dist_inlier",
"=",
"0.05",
",",
"min_inlier_frac",
"=",
"0.60",
",",
"nsample",
"=",
"3",
",",
"max_iter",
"=",
"100",
")",
":",
"n",
",",
"_",
"="... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/SynthText_Chinese/ransac.py#L25-L64 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/builtin_trap.py | python | BuiltinTrap.add_builtin | (self, key, value) | Add a builtin and save the original. | Add a builtin and save the original. | [
"Add",
"a",
"builtin",
"and",
"save",
"the",
"original",
"."
] | def add_builtin(self, key, value):
"""Add a builtin and save the original."""
bdict = builtin_mod.__dict__
orig = bdict.get(key, BuiltinUndefined)
if value is HideBuiltin:
if orig is not BuiltinUndefined: #same as 'key in bdict'
self._orig_builtins[key] = orig... | [
"def",
"add_builtin",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"bdict",
"=",
"builtin_mod",
".",
"__dict__",
"orig",
"=",
"bdict",
".",
"get",
"(",
"key",
",",
"BuiltinUndefined",
")",
"if",
"value",
"is",
"HideBuiltin",
":",
"if",
"orig",
"is"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/builtin_trap.py#L81-L91 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_utils/transformations.py | python | arcball_constrain_to_axis | (point, axis) | return unit_vector([-a[1], a[0], 0]) | Return sphere point perpendicular to axis. | Return sphere point perpendicular to axis. | [
"Return",
"sphere",
"point",
"perpendicular",
"to",
"axis",
"."
] | def arcball_constrain_to_axis(point, axis):
"""Return sphere point perpendicular to axis."""
v = numpy.array(point, dtype=numpy.float64, copy=True)
a = numpy.array(axis, dtype=numpy.float64, copy=True)
v -= a * numpy.dot(a, v) # on plane
n = vector_norm(v)
if n > _EPS:
if v[2] < 0.0:
... | [
"def",
"arcball_constrain_to_axis",
"(",
"point",
",",
"axis",
")",
":",
"v",
"=",
"numpy",
".",
"array",
"(",
"point",
",",
"dtype",
"=",
"numpy",
".",
"float64",
",",
"copy",
"=",
"True",
")",
"a",
"=",
"numpy",
".",
"array",
"(",
"axis",
",",
"d... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_utils/transformations.py#L1485-L1498 | |
DaFuCoding/MTCNN_Caffe | 09c30c3ff391bd9cb6b249c1910afaf147767ab3 | scripts/cpp_lint.py | python | CheckAccess | (filename, clean_lines, linenum, nesting_state, error) | Checks for improper use of DISALLOW* macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A _NestingState instance which maintains information about
the current stac... | Checks for improper use of DISALLOW* macros. | [
"Checks",
"for",
"improper",
"use",
"of",
"DISALLOW",
"*",
"macros",
"."
] | def CheckAccess(filename, clean_lines, linenum, nesting_state, error):
"""Checks for improper use of DISALLOW* macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A _NestingState in... | [
"def",
"CheckAccess",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# get rid of comments and strings",
"matched",
"=",
"Match",
"(",
"(",
"r'... | https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/scripts/cpp_lint.py#L2486-L2514 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py | python | ProgramMakefile.generate_target_default | (self, mfile) | Generate the default target.
mfile is the file object. | Generate the default target. | [
"Generate",
"the",
"default",
"target",
"."
] | def generate_target_default(self, mfile):
"""Generate the default target.
mfile is the file object.
"""
# Do these first so that it's safe for a sub-class to append additional
# commands to the real target, but make sure the default is correct.
mfile.write("\nall: $(TARG... | [
"def",
"generate_target_default",
"(",
"self",
",",
"mfile",
")",
":",
"# Do these first so that it's safe for a sub-class to append additional",
"# commands to the real target, but make sure the default is correct.",
"mfile",
".",
"write",
"(",
"\"\\nall: $(TARGET)\\n\"",
")",
"mfil... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/sipconfig.py#L2023-L2057 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/tensor_forest/client/random_forest.py | python | _assert_float32 | (tensors) | Assert all tensors are float32.
Args:
tensors: `Tensor` or `dict` of `Tensor` objects.
Raises:
TypeError: if any tensor is not float32. | Assert all tensors are float32. | [
"Assert",
"all",
"tensors",
"are",
"float32",
"."
] | def _assert_float32(tensors):
"""Assert all tensors are float32.
Args:
tensors: `Tensor` or `dict` of `Tensor` objects.
Raises:
TypeError: if any tensor is not float32.
"""
if not isinstance(tensors, dict):
tensors = [tensors]
else:
tensors = tensors.values()
for tensor in tensors:
i... | [
"def",
"_assert_float32",
"(",
"tensors",
")",
":",
"if",
"not",
"isinstance",
"(",
"tensors",
",",
"dict",
")",
":",
"tensors",
"=",
"[",
"tensors",
"]",
"else",
":",
"tensors",
"=",
"tensors",
".",
"values",
"(",
")",
"for",
"tensor",
"in",
"tensors"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tensor_forest/client/random_forest.py#L51-L66 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/difflib.py | python | IS_LINE_JUNK | (line, pat=re.compile(r"\s*(?:#\s*)?$").match) | return pat(line) is not None | r"""
Return True for ignorable line: iff `line` is blank or contains a single '#'.
Examples:
>>> IS_LINE_JUNK('\n')
True
>>> IS_LINE_JUNK(' # \n')
True
>>> IS_LINE_JUNK('hello\n')
False | r"""
Return True for ignorable line: iff `line` is blank or contains a single '#'. | [
"r",
"Return",
"True",
"for",
"ignorable",
"line",
":",
"iff",
"line",
"is",
"blank",
"or",
"contains",
"a",
"single",
"#",
"."
] | def IS_LINE_JUNK(line, pat=re.compile(r"\s*(?:#\s*)?$").match):
r"""
Return True for ignorable line: iff `line` is blank or contains a single '#'.
Examples:
>>> IS_LINE_JUNK('\n')
True
>>> IS_LINE_JUNK(' # \n')
True
>>> IS_LINE_JUNK('hello\n')
False
"""
return pat(line)... | [
"def",
"IS_LINE_JUNK",
"(",
"line",
",",
"pat",
"=",
"re",
".",
"compile",
"(",
"r\"\\s*(?:#\\s*)?$\"",
")",
".",
"match",
")",
":",
"return",
"pat",
"(",
"line",
")",
"is",
"not",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/difflib.py#L1045-L1059 | |
milvus-io/milvus | 3b1030de2b6c39e3512833e97f6044d63eb24237 | internal/core/build-support/cpplint.py | python | FilesBelongToSameModule | (filename_cc, filename_h) | return files_belong_to_same_module, common_path | Check if these two filenames belong to the same module.
The concept of a 'module' here is as follows:
foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
same 'module' if they are in the same directory.
some/path/public/xyzzy and some/path/internal/xyzzy are also considered
to belong to t... | Check if these two filenames belong to the same module. | [
"Check",
"if",
"these",
"two",
"filenames",
"belong",
"to",
"the",
"same",
"module",
"."
] | def FilesBelongToSameModule(filename_cc, filename_h):
"""Check if these two filenames belong to the same module.
The concept of a 'module' here is as follows:
foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
same 'module' if they are in the same directory.
some/path/public/xyzzy and so... | [
"def",
"FilesBelongToSameModule",
"(",
"filename_cc",
",",
"filename_h",
")",
":",
"fileinfo_cc",
"=",
"FileInfo",
"(",
"filename_cc",
")",
"if",
"not",
"fileinfo_cc",
".",
"Extension",
"(",
")",
".",
"lstrip",
"(",
"'.'",
")",
"in",
"GetNonHeaderExtensions",
... | https://github.com/milvus-io/milvus/blob/3b1030de2b6c39e3512833e97f6044d63eb24237/internal/core/build-support/cpplint.py#L5967-L6022 | |
wallix/redemption | fb4ceefb39e11e1ae250bce17e878e1dc7d195d2 | tools/sesman/sesmanworker/challenge.py | python | md_to_challenge | (md) | return Challenge(
challenge_type=auth_type,
title=title,
message=message,
fields=[],
echos=[],
username=md.get("username"),
challenge=md,
token=None,
recall=True,
) | Convert new Challenge from bastion to internal Challenge
param challenge: Challenge from bastion
:rtype: Challenge
:return: a converted Challenge | Convert new Challenge from bastion to internal Challenge | [
"Convert",
"new",
"Challenge",
"from",
"bastion",
"to",
"internal",
"Challenge"
] | def md_to_challenge(md):
""" Convert new Challenge from bastion to internal Challenge
param challenge: Challenge from bastion
:rtype: Challenge
:return: a converted Challenge
"""
auth_type = md.get("auth_type")
title = "= MOBILE DEVICE ="
message = md.get("prompt", "")
return Challe... | [
"def",
"md_to_challenge",
"(",
"md",
")",
":",
"auth_type",
"=",
"md",
".",
"get",
"(",
"\"auth_type\"",
")",
"title",
"=",
"\"= MOBILE DEVICE =\"",
"message",
"=",
"md",
".",
"get",
"(",
"\"prompt\"",
",",
"\"\"",
")",
"return",
"Challenge",
"(",
"challen... | https://github.com/wallix/redemption/blob/fb4ceefb39e11e1ae250bce17e878e1dc7d195d2/tools/sesman/sesmanworker/challenge.py#L97-L117 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py | python | Base.PrependENVPath | (self, name, newpath, envname = 'ENV', sep = os.pathsep,
delete_existing=1) | Prepend path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
assure this. This can also handle the case where the env
variable is a list instead of a string.
If d... | Prepend path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
assure this. This can also handle the case where the env
variable is a list instead of a string. | [
"Prepend",
"path",
"elements",
"to",
"the",
"path",
"name",
"in",
"the",
"ENV",
"dictionary",
"for",
"this",
"environment",
".",
"Will",
"only",
"add",
"any",
"particular",
"path",
"once",
"and",
"will",
"normpath",
"and",
"normcase",
"all",
"paths",
"to",
... | def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep,
delete_existing=1):
"""Prepend path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to hel... | [
"def",
"PrependENVPath",
"(",
"self",
",",
"name",
",",
"newpath",
",",
"envname",
"=",
"'ENV'",
",",
"sep",
"=",
"os",
".",
"pathsep",
",",
"delete_existing",
"=",
"1",
")",
":",
"orig",
"=",
"''",
"if",
"envname",
"in",
"self",
".",
"_dict",
"and",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py#L1668-L1690 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/FSIApplication/python_scripts/trilinos_partitioned_fsi_base_solver.py | python | TrilinosPartitionedFSIBaseSolver.GetDefaultParameters | (cls) | return this_defaults | This function returns the default-settings used by this class | This function returns the default-settings used by this class | [
"This",
"function",
"returns",
"the",
"default",
"-",
"settings",
"used",
"by",
"this",
"class"
] | def GetDefaultParameters(cls):
"""This function returns the default-settings used by this class
"""
this_defaults = KratosMultiphysics.Parameters("""{
"parallel_type": "MPI"
}""")
this_defaults.AddMissingParameters(super().GetDefaultParameters())
return this_d... | [
"def",
"GetDefaultParameters",
"(",
"cls",
")",
":",
"this_defaults",
"=",
"KratosMultiphysics",
".",
"Parameters",
"(",
"\"\"\"{\n \"parallel_type\": \"MPI\"\n }\"\"\"",
")",
"this_defaults",
".",
"AddMissingParameters",
"(",
"super",
"(",
")",
".",
"Ge... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/FSIApplication/python_scripts/trilinos_partitioned_fsi_base_solver.py#L27-L34 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGProperty.OnEvent | (*args, **kwargs) | return _propgrid.PGProperty_OnEvent(*args, **kwargs) | OnEvent(self, PropertyGrid propgrid, Window wnd_primary, Event event) -> bool | OnEvent(self, PropertyGrid propgrid, Window wnd_primary, Event event) -> bool | [
"OnEvent",
"(",
"self",
"PropertyGrid",
"propgrid",
"Window",
"wnd_primary",
"Event",
"event",
")",
"-",
">",
"bool"
] | def OnEvent(*args, **kwargs):
"""OnEvent(self, PropertyGrid propgrid, Window wnd_primary, Event event) -> bool"""
return _propgrid.PGProperty_OnEvent(*args, **kwargs) | [
"def",
"OnEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_OnEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L385-L387 | |
SOUI2/soui | 774e5566b2d3254a94f4b3efd55b982e7c665434 | third-part/jsoncpp/makerelease.py | python | svn_export | (tag_url, export_dir) | Exports the tag_url revision to export_dir.
Target directory, including its parent is created if it does not exist.
If the directory export_dir exist, it is deleted before export proceed. | Exports the tag_url revision to export_dir.
Target directory, including its parent is created if it does not exist.
If the directory export_dir exist, it is deleted before export proceed. | [
"Exports",
"the",
"tag_url",
"revision",
"to",
"export_dir",
".",
"Target",
"directory",
"including",
"its",
"parent",
"is",
"created",
"if",
"it",
"does",
"not",
"exist",
".",
"If",
"the",
"directory",
"export_dir",
"exist",
"it",
"is",
"deleted",
"before",
... | def svn_export(tag_url, export_dir):
"""Exports the tag_url revision to export_dir.
Target directory, including its parent is created if it does not exist.
If the directory export_dir exist, it is deleted before export proceed.
"""
rmdir_if_exist(export_dir)
svn_command('export', tag_url, ... | [
"def",
"svn_export",
"(",
"tag_url",
",",
"export_dir",
")",
":",
"rmdir_if_exist",
"(",
"export_dir",
")",
"svn_command",
"(",
"'export'",
",",
"tag_url",
",",
"export_dir",
")"
] | https://github.com/SOUI2/soui/blob/774e5566b2d3254a94f4b3efd55b982e7c665434/third-part/jsoncpp/makerelease.py#L116-L122 | ||
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/python_message.py | python | _AddPropertiesForField | (field, cls) | Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field.
Args:
field: A FieldDescriptor for this field.
cls: The class we're constructing. | Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field. | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"protocol",
"message",
"field",
".",
"Clients",
"can",
"use",
"this",
"property",
"to",
"get",
"and",
"(",
"in",
"the",
"case",
"of",
"non",
"-",
"repeated",
"scalar",
"fields",
")",
"directly",
"set",
"the"... | def _AddPropertiesForField(field, cls):
"""Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field.
Args:
field: A FieldDescriptor for this field.
cls: The class we're ... | [
"def",
"_AddPropertiesForField",
"(",
"field",
",",
"cls",
")",
":",
"# Catch it if we add other types that we should",
"# handle specially here.",
"assert",
"_FieldDescriptor",
".",
"MAX_CPPTYPE",
"==",
"10",
"constant_name",
"=",
"field",
".",
"name",
".",
"upper",
"(... | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/python_message.py#L361-L383 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cli/req_command.py | python | with_cleanup | (func) | return wrapper | Decorator for common logic related to managing temporary
directories. | Decorator for common logic related to managing temporary
directories. | [
"Decorator",
"for",
"common",
"logic",
"related",
"to",
"managing",
"temporary",
"directories",
"."
] | def with_cleanup(func):
# type: (Any) -> Any
"""Decorator for common logic related to managing temporary
directories.
"""
def configure_tempdir_registry(registry):
# type: (TempDirectoryTypeRegistry) -> None
for t in KEEPABLE_TEMPDIR_TYPES:
registry.set_delete(t, False)
... | [
"def",
"with_cleanup",
"(",
"func",
")",
":",
"# type: (Any) -> Any",
"def",
"configure_tempdir_registry",
"(",
"registry",
")",
":",
"# type: (TempDirectoryTypeRegistry) -> None",
"for",
"t",
"in",
"KEEPABLE_TEMPDIR_TYPES",
":",
"registry",
".",
"set_delete",
"(",
"t",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cli/req_command.py#L161-L186 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/plugins/Launch/launch/handlers.py | python | _OpenToLine | (fname, line, mainw) | Open the given filename to the given line number
@param fname: File name to open, relative paths will be converted to abs
paths.
@param line: Line number to set the cursor to after opening the file
@param mainw: MainWindow instance to open the file in | Open the given filename to the given line number
@param fname: File name to open, relative paths will be converted to abs
paths.
@param line: Line number to set the cursor to after opening the file
@param mainw: MainWindow instance to open the file in | [
"Open",
"the",
"given",
"filename",
"to",
"the",
"given",
"line",
"number",
"@param",
"fname",
":",
"File",
"name",
"to",
"open",
"relative",
"paths",
"will",
"be",
"converted",
"to",
"abs",
"paths",
".",
"@param",
"line",
":",
"Line",
"number",
"to",
"s... | def _OpenToLine(fname, line, mainw):
"""Open the given filename to the given line number
@param fname: File name to open, relative paths will be converted to abs
paths.
@param line: Line number to set the cursor to after opening the file
@param mainw: MainWindow instance to open the fi... | [
"def",
"_OpenToLine",
"(",
"fname",
",",
"line",
",",
"mainw",
")",
":",
"fname",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"fname",
")",
"# Normalize path",
"nbook",
"=",
"mainw",
".",
"GetNotebook",
"(",
")",
"buffers",
"=",
"[",
"page",
".",
"G... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/Launch/launch/handlers.py#L899-L917 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/fx/passes/operator_support.py | python | create_op_support | (is_node_supported: IsNodeSupported) | return FunctionalOperatorSupport() | Wraps a `IsNodeSupported` function into an `OperatorSupportBase` instance
`IsNodeSupported` has the same call signature as
`OperatorSupportBase.is_node_supported` | Wraps a `IsNodeSupported` function into an `OperatorSupportBase` instance | [
"Wraps",
"a",
"IsNodeSupported",
"function",
"into",
"an",
"OperatorSupportBase",
"instance"
] | def create_op_support(is_node_supported: IsNodeSupported) -> OperatorSupportBase:
"""Wraps a `IsNodeSupported` function into an `OperatorSupportBase` instance
`IsNodeSupported` has the same call signature as
`OperatorSupportBase.is_node_supported`
"""
class FunctionalOperatorSupport(OperatorSupport... | [
"def",
"create_op_support",
"(",
"is_node_supported",
":",
"IsNodeSupported",
")",
"->",
"OperatorSupportBase",
":",
"class",
"FunctionalOperatorSupport",
"(",
"OperatorSupportBase",
")",
":",
"def",
"is_node_supported",
"(",
"self",
",",
"submodules",
":",
"t",
".",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/passes/operator_support.py#L133-L144 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/base/android/jni_generator/jni_registration_generator.py | python | CreateFromDict | (registration_dict, use_hash) | return template.substitute(registration_dict) | Returns the content of the header file. | Returns the content of the header file. | [
"Returns",
"the",
"content",
"of",
"the",
"header",
"file",
"."
] | def CreateFromDict(registration_dict, use_hash):
"""Returns the content of the header file."""
template = string.Template("""\
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is autog... | [
"def",
"CreateFromDict",
"(",
"registration_dict",
",",
"use_hash",
")",
":",
"template",
"=",
"string",
".",
"Template",
"(",
"\"\"\"\\\n// Copyright 2017 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in t... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/base/android/jni_generator/jni_registration_generator.py#L250-L311 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/cpplint.py | python | _Filters | () | return _cpplint_state.filters | Returns the module's list of output filters, as a list. | Returns the module's list of output filters, as a list. | [
"Returns",
"the",
"module",
"s",
"list",
"of",
"output",
"filters",
"as",
"a",
"list",
"."
] | def _Filters():
"""Returns the module's list of output filters, as a list."""
return _cpplint_state.filters | [
"def",
"_Filters",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"filters"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/cpplint.py#L871-L873 | |
vicaya/hypertable | e7386f799c238c109ae47973417c2a2c7f750825 | src/py/ThriftClient/gen-py/hyperthrift/gen/ClientService.py | python | Client.open_mutator | (self, name, flags, flush_interval) | return self.recv_open_mutator() | Open a table mutator
@param name - table name
@param flags - mutator flags
@param flush_interval - auto-flush interval in milliseconds; 0 disables it.
@return mutator id
Parameters:
- name
- flags
- flush_interval | Open a table mutator | [
"Open",
"a",
"table",
"mutator"
] | def open_mutator(self, name, flags, flush_interval):
"""
Open a table mutator
@param name - table name
@param flags - mutator flags
@param flush_interval - auto-flush interval in milliseconds; 0 disables it.
@return mutator id
Parameters:
- name
- flags
... | [
"def",
"open_mutator",
"(",
"self",
",",
"name",
",",
"flags",
",",
"flush_interval",
")",
":",
"self",
".",
"send_open_mutator",
"(",
"name",
",",
"flags",
",",
"flush_interval",
")",
"return",
"self",
".",
"recv_open_mutator",
"(",
")"
] | https://github.com/vicaya/hypertable/blob/e7386f799c238c109ae47973417c2a2c7f750825/src/py/ThriftClient/gen-py/hyperthrift/gen/ClientService.py#L783-L801 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | SimRobotController.getCommandedTorque | (self) | return _robotsim.SimRobotController_getCommandedTorque(self) | r"""
Returns The current commanded (feedforward) torque (size model().numDrivers()) | r"""
Returns The current commanded (feedforward) torque (size model().numDrivers()) | [
"r",
"Returns",
"The",
"current",
"commanded",
"(",
"feedforward",
")",
"torque",
"(",
"size",
"model",
"()",
".",
"numDrivers",
"()",
")"
] | def getCommandedTorque(self) ->None:
r"""
Returns The current commanded (feedforward) torque (size model().numDrivers())
"""
return _robotsim.SimRobotController_getCommandedTorque(self) | [
"def",
"getCommandedTorque",
"(",
"self",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"SimRobotController_getCommandedTorque",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7090-L7095 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/common/system/path.py | python | cygpath | (path) | return path | Converts an absolute cygwin path to an absolute Windows path. | Converts an absolute cygwin path to an absolute Windows path. | [
"Converts",
"an",
"absolute",
"cygwin",
"path",
"to",
"an",
"absolute",
"Windows",
"path",
"."
] | def cygpath(path):
"""Converts an absolute cygwin path to an absolute Windows path."""
if sys.platform == 'cygwin':
return _CygPath.convert_using_singleton(path)
return path | [
"def",
"cygpath",
"(",
"path",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'cygwin'",
":",
"return",
"_CygPath",
".",
"convert_using_singleton",
"(",
"path",
")",
"return",
"path"
] | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/common/system/path.py#L47-L51 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/graph_kernel/splitter.py | python | split_with_json | (json_str, flags_str) | Call cost model to split GraphKernel | Call cost model to split GraphKernel | [
"Call",
"cost",
"model",
"to",
"split",
"GraphKernel"
] | def split_with_json(json_str, flags_str):
"""Call cost model to split GraphKernel"""
try:
graph_desc = json.loads(json_str)
flags = json.loads(flags_str)
target = graph_desc['process']
comp = model.load_composite(graph_desc)
graph_split, graph_mode = model.split(comp.grap... | [
"def",
"split_with_json",
"(",
"json_str",
",",
"flags_str",
")",
":",
"try",
":",
"graph_desc",
"=",
"json",
".",
"loads",
"(",
"json_str",
")",
"flags",
"=",
"json",
".",
"loads",
"(",
"flags_str",
")",
"target",
"=",
"graph_desc",
"[",
"'process'",
"]... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/graph_kernel/splitter.py#L26-L44 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibook.py | python | AuiNotebook.OnRenameAccept | (self, page_index, value) | return not self.GetEventHandler().ProcessEvent(evt) or evt.IsAllowed() | Called by :class:`TabTextCtrl`, to accept the changes and to send the
``EVT_AUINOTEBOOK_END_LABEL_EDIT`` event.
:param integer `page_index`: the page index in the notebook;
:param string `value`: the new label for the tab. | Called by :class:`TabTextCtrl`, to accept the changes and to send the
``EVT_AUINOTEBOOK_END_LABEL_EDIT`` event. | [
"Called",
"by",
":",
"class",
":",
"TabTextCtrl",
"to",
"accept",
"the",
"changes",
"and",
"to",
"send",
"the",
"EVT_AUINOTEBOOK_END_LABEL_EDIT",
"event",
"."
] | def OnRenameAccept(self, page_index, value):
"""
Called by :class:`TabTextCtrl`, to accept the changes and to send the
``EVT_AUINOTEBOOK_END_LABEL_EDIT`` event.
:param integer `page_index`: the page index in the notebook;
:param string `value`: the new label for the tab.
... | [
"def",
"OnRenameAccept",
"(",
"self",
",",
"page_index",
",",
"value",
")",
":",
"evt",
"=",
"AuiNotebookEvent",
"(",
"wxEVT_COMMAND_AUINOTEBOOK_END_LABEL_EDIT",
",",
"self",
".",
"GetId",
"(",
")",
")",
"evt",
".",
"SetSelection",
"(",
"page_index",
")",
"evt... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L6014-L6029 | |
facebook/fbthrift | fb9c8562aba04c4fd9b17716eb5d970cc88a75bb | thrift/lib/py/util/__init__.py | python | __list_to_dict | (alist, type_args, defaults: bool=False) | Given a python list-like collection, potentially containing Thrift Structs,
convert it into a dict
:param alist: a list or set
:param defaults: return default values
:return: List | Given a python list-like collection, potentially containing Thrift Structs,
convert it into a dict
:param alist: a list or set
:param defaults: return default values
:return: List | [
"Given",
"a",
"python",
"list",
"-",
"like",
"collection",
"potentially",
"containing",
"Thrift",
"Structs",
"convert",
"it",
"into",
"a",
"dict",
":",
"param",
"alist",
":",
"a",
"list",
"or",
"set",
":",
"param",
"defaults",
":",
"return",
"default",
"va... | def __list_to_dict(alist, type_args, defaults: bool=False):
"""
Given a python list-like collection, potentially containing Thrift Structs,
convert it into a dict
:param alist: a list or set
:param defaults: return default values
:return: List
"""
if not alist:
return alist
... | [
"def",
"__list_to_dict",
"(",
"alist",
",",
"type_args",
",",
"defaults",
":",
"bool",
"=",
"False",
")",
":",
"if",
"not",
"alist",
":",
"return",
"alist",
"element_type",
"=",
"type_args",
"[",
"0",
"]",
"if",
"element_type",
"==",
"TType",
".",
"STRUC... | https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/thrift/lib/py/util/__init__.py#L123-L147 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBPlatformShellCommand.SetWorkingDirectory | (self, path) | return _lldb.SBPlatformShellCommand_SetWorkingDirectory(self, path) | SetWorkingDirectory(SBPlatformShellCommand self, char const * path) | SetWorkingDirectory(SBPlatformShellCommand self, char const * path) | [
"SetWorkingDirectory",
"(",
"SBPlatformShellCommand",
"self",
"char",
"const",
"*",
"path",
")"
] | def SetWorkingDirectory(self, path):
"""SetWorkingDirectory(SBPlatformShellCommand self, char const * path)"""
return _lldb.SBPlatformShellCommand_SetWorkingDirectory(self, path) | [
"def",
"SetWorkingDirectory",
"(",
"self",
",",
"path",
")",
":",
"return",
"_lldb",
".",
"SBPlatformShellCommand_SetWorkingDirectory",
"(",
"self",
",",
"path",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L8025-L8027 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/contrib/_appengine_environ.py | python | is_appengine_sandbox | () | return is_appengine() and os.environ["APPENGINE_RUNTIME"] == "python27" | Reports if the app is running in the first generation sandbox.
The second generation runtimes are technically still in a sandbox, but it
is much less restrictive, so generally you shouldn't need to check for it.
see https://cloud.google.com/appengine/docs/standard/runtimes | Reports if the app is running in the first generation sandbox. | [
"Reports",
"if",
"the",
"app",
"is",
"running",
"in",
"the",
"first",
"generation",
"sandbox",
"."
] | def is_appengine_sandbox():
"""Reports if the app is running in the first generation sandbox.
The second generation runtimes are technically still in a sandbox, but it
is much less restrictive, so generally you shouldn't need to check for it.
see https://cloud.google.com/appengine/docs/standard/runtime... | [
"def",
"is_appengine_sandbox",
"(",
")",
":",
"return",
"is_appengine",
"(",
")",
"and",
"os",
".",
"environ",
"[",
"\"APPENGINE_RUNTIME\"",
"]",
"==",
"\"python27\""
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/contrib/_appengine_environ.py#L12-L19 | |
google/mediapipe | e6c19885c6d3c6f410c730952aeed2852790d306 | mediapipe/python/solutions/face_detection.py | python | get_key_point | (
detection: detection_pb2.Detection, key_point_enum: 'FaceKeyPoint'
) | return detection.location_data.relative_keypoints[key_point_enum] | A convenience method to return a face key point by the FaceKeyPoint type.
Args:
detection: A detection proto message that contains face key points.
key_point_enum: A FaceKeyPoint type.
Returns:
A RelativeKeypoint proto message. | A convenience method to return a face key point by the FaceKeyPoint type. | [
"A",
"convenience",
"method",
"to",
"return",
"a",
"face",
"key",
"point",
"by",
"the",
"FaceKeyPoint",
"type",
"."
] | def get_key_point(
detection: detection_pb2.Detection, key_point_enum: 'FaceKeyPoint'
) -> Union[None, location_data_pb2.LocationData.RelativeKeypoint]:
"""A convenience method to return a face key point by the FaceKeyPoint type.
Args:
detection: A detection proto message that contains face key points.
... | [
"def",
"get_key_point",
"(",
"detection",
":",
"detection_pb2",
".",
"Detection",
",",
"key_point_enum",
":",
"'FaceKeyPoint'",
")",
"->",
"Union",
"[",
"None",
",",
"location_data_pb2",
".",
"LocationData",
".",
"RelativeKeypoint",
"]",
":",
"if",
"not",
"detec... | https://github.com/google/mediapipe/blob/e6c19885c6d3c6f410c730952aeed2852790d306/mediapipe/python/solutions/face_detection.py#L35-L49 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/CNTK/lib/cntk_layers.py | python | DenseLayer.process | (self, ellLayers) | Appends the ELL equivalent of the current layer to ellLayers. | Appends the ELL equivalent of the current layer to ellLayers. | [
"Appends",
"the",
"ELL",
"equivalent",
"of",
"the",
"current",
"layer",
"to",
"ellLayers",
"."
] | def process(self, ellLayers):
"""Appends the ELL equivalent of the current layer to ellLayers."""
# Note that a single CNTK Dense function block is equivalent to the following 3 ELL layers:
# - FullyConnectedLayer
# - BiasLayer
# - ActivationLayer. This layer is sometimes missin... | [
"def",
"process",
"(",
"self",
",",
"ellLayers",
")",
":",
"# Note that a single CNTK Dense function block is equivalent to the following 3 ELL layers:",
"# - FullyConnectedLayer",
"# - BiasLayer",
"# - ActivationLayer. This layer is sometimes missing, depending on activation type.",
"#",
... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/CNTK/lib/cntk_layers.py#L106-L164 | ||
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | tools/extra/summarize.py | python | print_table | (table, max_width) | Print a simple nicely-aligned table.
table must be a list of (equal-length) lists. Columns are space-separated,
and as narrow as possible, but no wider than max_width. Text may overflow
columns; note that unlike string.format, this will not affect subsequent
columns, if possible. | Print a simple nicely-aligned table. | [
"Print",
"a",
"simple",
"nicely",
"-",
"aligned",
"table",
"."
] | def print_table(table, max_width):
"""Print a simple nicely-aligned table.
table must be a list of (equal-length) lists. Columns are space-separated,
and as narrow as possible, but no wider than max_width. Text may overflow
columns; note that unlike string.format, this will not affect subsequent
co... | [
"def",
"print_table",
"(",
"table",
",",
"max_width",
")",
":",
"max_widths",
"=",
"[",
"max_width",
"]",
"*",
"len",
"(",
"table",
"[",
"0",
"]",
")",
"column_widths",
"=",
"[",
"max",
"(",
"printed_len",
"(",
"row",
"[",
"j",
"]",
")",
"+",
"1",
... | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/tools/extra/summarize.py#L41-L61 | ||
nyuwireless-unipd/ns3-mmwave | 4ff9e87e8079764e04cbeccd8e85bff15ae16fb3 | waf-tools/cflags.py | python | CompilerTraits.get_debug_flags | (self, level) | get_debug_flags(level) -> (list of cflags, list of cppdefines) | get_debug_flags(level) -> (list of cflags, list of cppdefines) | [
"get_debug_flags",
"(",
"level",
")",
"-",
">",
"(",
"list",
"of",
"cflags",
"list",
"of",
"cppdefines",
")"
] | def get_debug_flags(self, level):
"""get_debug_flags(level) -> (list of cflags, list of cppdefines)"""
raise NotImplementedError | [
"def",
"get_debug_flags",
"(",
"self",
",",
"level",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/waf-tools/cflags.py#L13-L15 | ||
Atarity/Lightpack | 4dee73a443cba4c4073291febe450e6c1941f3af | Software/apiexamples/liOSC/OSC.py | python | OSCServer.__ne__ | (self, other) | return not self.__eq__(other) | Compare function. | Compare function. | [
"Compare",
"function",
"."
] | def __ne__(self, other):
"""Compare function.
"""
return not self.__eq__(other) | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"return",
"not",
"self",
".",
"__eq__",
"(",
"other",
")"
] | https://github.com/Atarity/Lightpack/blob/4dee73a443cba4c4073291febe450e6c1941f3af/Software/apiexamples/liOSC/OSC.py#L1846-L1849 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/s3/inject.py | python | bucket_download_fileobj | (self, Key, Fileobj, ExtraArgs=None,
Callback=None, Config=None) | return self.meta.client.download_fileobj(
Bucket=self.name, Key=Key, Fileobj=Fileobj, ExtraArgs=ExtraArgs,
Callback=Callback, Config=Config) | Download an object from this bucket to a file-like-object.
The file-like object must be in binary mode.
This is a managed transfer which will perform a multipart download in
multiple threads if necessary.
Usage::
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket('mybu... | Download an object from this bucket to a file-like-object. | [
"Download",
"an",
"object",
"from",
"this",
"bucket",
"to",
"a",
"file",
"-",
"like",
"-",
"object",
"."
] | def bucket_download_fileobj(self, Key, Fileobj, ExtraArgs=None,
Callback=None, Config=None):
"""Download an object from this bucket to a file-like-object.
The file-like object must be in binary mode.
This is a managed transfer which will perform a multipart download in
mult... | [
"def",
"bucket_download_fileobj",
"(",
"self",
",",
"Key",
",",
"Fileobj",
",",
"ExtraArgs",
"=",
"None",
",",
"Callback",
"=",
"None",
",",
"Config",
"=",
"None",
")",
":",
"return",
"self",
".",
"meta",
".",
"client",
".",
"download_fileobj",
"(",
"Buc... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/s3/inject.py#L681-L720 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | EvtHandler.ProcessEvent | (*args, **kwargs) | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) | ProcessEvent(self, Event event) -> bool | ProcessEvent(self, Event event) -> bool | [
"ProcessEvent",
"(",
"self",
"Event",
"event",
")",
"-",
">",
"bool"
] | def ProcessEvent(*args, **kwargs):
"""ProcessEvent(self, Event event) -> bool"""
return _core_.EvtHandler_ProcessEvent(*args, **kwargs) | [
"def",
"ProcessEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"EvtHandler_ProcessEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L4152-L4154 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/gyp/javac_output_processor.py | python | JavacOutputProcessor._ElaborateLinesForUnknownSymbol | (self, lines) | Elaborates passed-in javac output for unresolved symbols.
Looks for unresolved symbols in imports.
Adds:
- Line with GN target which cannot compile.
- Mention of unresolved class if not present in error message.
- Line with suggestion of GN dep to add.
Args:
lines: Generator with javac i... | Elaborates passed-in javac output for unresolved symbols. | [
"Elaborates",
"passed",
"-",
"in",
"javac",
"output",
"for",
"unresolved",
"symbols",
"."
] | def _ElaborateLinesForUnknownSymbol(self, lines):
""" Elaborates passed-in javac output for unresolved symbols.
Looks for unresolved symbols in imports.
Adds:
- Line with GN target which cannot compile.
- Mention of unresolved class if not present in error message.
- Line with suggestion of GN ... | [
"def",
"_ElaborateLinesForUnknownSymbol",
"(",
"self",
",",
"lines",
")",
":",
"previous_line",
"=",
"next",
"(",
"lines",
",",
"None",
")",
"line",
"=",
"next",
"(",
"lines",
",",
"None",
")",
"while",
"previous_line",
"!=",
"None",
":",
"elaborated_lines",... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/javac_output_processor.py#L85-L108 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBFrame.GetModule | (self) | return _lldb.SBFrame_GetModule(self) | GetModule(SBFrame self) -> SBModule | GetModule(SBFrame self) -> SBModule | [
"GetModule",
"(",
"SBFrame",
"self",
")",
"-",
">",
"SBModule"
] | def GetModule(self):
"""GetModule(SBFrame self) -> SBModule"""
return _lldb.SBFrame_GetModule(self) | [
"def",
"GetModule",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBFrame_GetModule",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L5507-L5509 | |
JoseExposito/touchegg | 1f3fda214358d071c05da4bf17c070c33d67b5eb | cmake/cpplint.py | python | CheckForNonConstReference | (filename, clean_lines, linenum,
nesting_state, error) | Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A... | Check for non-const references. | [
"Check",
"for",
"non",
"-",
"const",
"references",
"."
] | def CheckForNonConstReference(filename, clean_lines, linenum,
nesting_state, error):
"""Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean... | [
"def",
"CheckForNonConstReference",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Do nothing if there is no '&' on current line.",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"'&'",
"n... | https://github.com/JoseExposito/touchegg/blob/1f3fda214358d071c05da4bf17c070c33d67b5eb/cmake/cpplint.py#L5013-L5149 | ||
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/utils/pair_tab.py | python | PairTab.reinit | (self,
filename : str
) | Initialize the tabulated interaction
Parameters
----------
filename
File name for the short-range tabulated potential.
The table is a text data file with (N_t + 1) * N_t / 2 + 1 columes.
The first colume is the distance between atoms.
... | Initialize the tabulated interaction | [
"Initialize",
"the",
"tabulated",
"interaction"
] | def reinit(self,
filename : str
) -> None:
"""
Initialize the tabulated interaction
Parameters
----------
filename
File name for the short-range tabulated potential.
The table is a text data file with (N_t + 1) * N_t / 2 + 1 col... | [
"def",
"reinit",
"(",
"self",
",",
"filename",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"vdata",
"=",
"np",
".",
"loadtxt",
"(",
"filename",
")",
"self",
".",
"rmin",
"=",
"self",
".",
"vdata",
"[",
"0",
"]",
"[",
"0",
"]",
"self",
".",... | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/pair_tab.py#L29-L55 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/build_py.py | python | build_py.exclude_data_files | (self, package, src_dir, files) | return [
f for f in files if f not in bad
and f not in seen and seen.setdefault(f,1) # ditch dupes
] | Filter filenames for package's data files in 'src_dir | Filter filenames for package's data files in 'src_dir | [
"Filter",
"filenames",
"for",
"package",
"s",
"data",
"files",
"in",
"src_dir"
] | def exclude_data_files(self, package, src_dir, files):
"""Filter filenames for package's data files in 'src_dir'"""
globs = (self.exclude_package_data.get('', [])
+ self.exclude_package_data.get(package, []))
bad = []
for pattern in globs:
bad.extend(
... | [
"def",
"exclude_data_files",
"(",
"self",
",",
"package",
",",
"src_dir",
",",
"files",
")",
":",
"globs",
"=",
"(",
"self",
".",
"exclude_package_data",
".",
"get",
"(",
"''",
",",
"[",
"]",
")",
"+",
"self",
".",
"exclude_package_data",
".",
"get",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/build_py.py#L240-L256 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | DateTime.MakeTimezone | (*args, **kwargs) | return _misc_.DateTime_MakeTimezone(*args, **kwargs) | MakeTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime | MakeTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime | [
"MakeTimezone",
"(",
"self",
"wxDateTime",
"::",
"TimeZone",
"tz",
"bool",
"noDST",
"=",
"False",
")",
"-",
">",
"DateTime"
] | def MakeTimezone(*args, **kwargs):
"""MakeTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime"""
return _misc_.DateTime_MakeTimezone(*args, **kwargs) | [
"def",
"MakeTimezone",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_MakeTimezone",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3926-L3928 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/io/pytables.py | python | HDFStore.select_as_multiple | (self, keys, where=None, selector=None, columns=None,
start=None, stop=None, iterator=False,
chunksize=None, auto_close=False, **kwargs) | return it.get_result(coordinates=True) | Retrieve pandas objects from multiple tables
Parameters
----------
keys : a list of the tables
selector : the table to apply the where criteria (defaults to keys[0]
if not supplied)
columns : the columns I want back
start : integer (defaults to None), row num... | Retrieve pandas objects from multiple tables | [
"Retrieve",
"pandas",
"objects",
"from",
"multiple",
"tables"
] | def select_as_multiple(self, keys, where=None, selector=None, columns=None,
start=None, stop=None, iterator=False,
chunksize=None, auto_close=False, **kwargs):
""" Retrieve pandas objects from multiple tables
Parameters
----------
ke... | [
"def",
"select_as_multiple",
"(",
"self",
",",
"keys",
",",
"where",
"=",
"None",
",",
"selector",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"start",
"=",
"None",
",",
"stop",
"=",
"None",
",",
"iterator",
"=",
"False",
",",
"chunksize",
"=",
"N... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/pytables.py#L778-L859 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/progress_callback.py | python | FileProgressCallbackHandler.call | (self, # pylint: disable=invalid-name
last_byte_processed,
total_size) | Prints an overwriting line to stderr describing the operation progress.
Args:
last_byte_processed: The last byte processed in the file. For file
components, this number should be in the range
[start_byte:start_byte + override_total_size].
total_size... | Prints an overwriting line to stderr describing the operation progress. | [
"Prints",
"an",
"overwriting",
"line",
"to",
"stderr",
"describing",
"the",
"operation",
"progress",
"."
] | def call(self, # pylint: disable=invalid-name
last_byte_processed,
total_size):
"""Prints an overwriting line to stderr describing the operation progress.
Args:
last_byte_processed: The last byte processed in the file. For file
components, this number sho... | [
"def",
"call",
"(",
"self",
",",
"# pylint: disable=invalid-name",
"last_byte_processed",
",",
"total_size",
")",
":",
"if",
"not",
"self",
".",
"_logger",
".",
"isEnabledFor",
"(",
"logging",
".",
"INFO",
")",
"or",
"self",
".",
"_last_byte_written",
":",
"re... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/progress_callback.py#L141-L171 | ||
savoirfairelinux/jami-daemon | 7634487e9f568ae727f2d4cffbb735d23fa0324c | tools/jamictrl/controller.py | python | DRingCtrl.Call | (self, dest, account=None) | return callid | Start a call and return a CallID
Use the current account previously set using setAccount().
If no account specified, first registered one in account list is used.
return callID Newly generated callidentifier for this call | Start a call and return a CallID | [
"Start",
"a",
"call",
"and",
"return",
"a",
"CallID"
] | def Call(self, dest, account=None):
"""Start a call and return a CallID
Use the current account previously set using setAccount().
If no account specified, first registered one in account list is used.
return callID Newly generated callidentifier for this call
"""
if d... | [
"def",
"Call",
"(",
"self",
",",
"dest",
",",
"account",
"=",
"None",
")",
":",
"if",
"dest",
"is",
"None",
"or",
"dest",
"==",
"\"\"",
":",
"raise",
"DRingCtrlError",
"(",
"\"Invalid call destination\"",
")",
"# Set the account to be used for this call",
"if",
... | https://github.com/savoirfairelinux/jami-daemon/blob/7634487e9f568ae727f2d4cffbb735d23fa0324c/tools/jamictrl/controller.py#L554-L579 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Taskmaster.py | python | Task.get_target | (self) | return self.node | Fetch the target being built or updated by this task. | Fetch the target being built or updated by this task. | [
"Fetch",
"the",
"target",
"being",
"built",
"or",
"updated",
"by",
"this",
"task",
"."
] | def get_target(self):
"""Fetch the target being built or updated by this task.
"""
return self.node | [
"def",
"get_target",
"(",
"self",
")",
":",
"return",
"self",
".",
"node"
] | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Taskmaster.py#L210-L213 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/mailbox.py | python | MH.lock | (self) | Lock the mailbox. | Lock the mailbox. | [
"Lock",
"the",
"mailbox",
"."
] | def lock(self):
"""Lock the mailbox."""
if not self._locked:
self._file = open(os.path.join(self._path, '.mh_sequences'), 'rb+')
_lock_file(self._file)
self._locked = True | [
"def",
"lock",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_locked",
":",
"self",
".",
"_file",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"'.mh_sequences'",
")",
",",
"'rb+'",
")",
"_lock_file",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L1092-L1097 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/graphy/graphy/bar_chart.py | python | BarChart.GetMinMaxValues | (self) | return min_value, max_value | Get the largest & smallest bar values as (min_value, max_value). | Get the largest & smallest bar values as (min_value, max_value). | [
"Get",
"the",
"largest",
"&",
"smallest",
"bar",
"values",
"as",
"(",
"min_value",
"max_value",
")",
"."
] | def GetMinMaxValues(self):
"""Get the largest & smallest bar values as (min_value, max_value)."""
if not self.stacked:
return super(BarChart, self).GetMinMaxValues()
if not self.data:
return None, None # No data, nothing to do.
num_bars = max(len(series.data) for series in self.data)
p... | [
"def",
"GetMinMaxValues",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"stacked",
":",
"return",
"super",
"(",
"BarChart",
",",
"self",
")",
".",
"GetMinMaxValues",
"(",
")",
"if",
"not",
"self",
".",
"data",
":",
"return",
"None",
",",
"None",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/graphy/graphy/bar_chart.py#L152-L171 | |
manutdzou/KITTI_SSD | 5b620c2f291d36a0fe14489214f22a992f173f44 | python/caffe/pycaffe.py | python | _Net_forward_backward_all | (self, blobs=None, diffs=None, **kwargs) | return all_outs, all_diffs | Run net forward + backward in batches.
Parameters
----------
blobs: list of blobs to extract as in forward()
diffs: list of diffs to extract as in backward()
kwargs: Keys are input (for forward) and output (for backward) blob names
and values are ndarrays. Refer to forward() and backwar... | Run net forward + backward in batches. | [
"Run",
"net",
"forward",
"+",
"backward",
"in",
"batches",
"."
] | def _Net_forward_backward_all(self, blobs=None, diffs=None, **kwargs):
"""
Run net forward + backward in batches.
Parameters
----------
blobs: list of blobs to extract as in forward()
diffs: list of diffs to extract as in backward()
kwargs: Keys are input (for forward) and output (for backw... | [
"def",
"_Net_forward_backward_all",
"(",
"self",
",",
"blobs",
"=",
"None",
",",
"diffs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Batch blobs and diffs.",
"all_outs",
"=",
"{",
"out",
":",
"[",
"]",
"for",
"out",
"in",
"set",
"(",
"self",
".... | https://github.com/manutdzou/KITTI_SSD/blob/5b620c2f291d36a0fe14489214f22a992f173f44/python/caffe/pycaffe.py#L206-L248 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rospy/src/rospy/rostime.py | python | Time.from_sec | (float_secs) | return Time(secs, nsecs) | Create new Time instance from a float seconds representation
(e.g. time.time()).
@param float_secs: time value in time.time() format
@type float_secs: float
@return: Time instance for specified time
@rtype: L{Time} | Create new Time instance from a float seconds representation
(e.g. time.time()). | [
"Create",
"new",
"Time",
"instance",
"from",
"a",
"float",
"seconds",
"representation",
"(",
"e",
".",
"g",
".",
"time",
".",
"time",
"()",
")",
"."
] | def from_sec(float_secs):
"""
Create new Time instance from a float seconds representation
(e.g. time.time()).
@param float_secs: time value in time.time() format
@type float_secs: float
@return: Time instance for specified time
@rtype: L{Time}
"... | [
"def",
"from_sec",
"(",
"float_secs",
")",
":",
"secs",
"=",
"int",
"(",
"float_secs",
")",
"nsecs",
"=",
"int",
"(",
"(",
"float_secs",
"-",
"secs",
")",
"*",
"1000000000",
")",
"return",
"Time",
"(",
"secs",
",",
"nsecs",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/rostime.py#L172-L184 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | ThirdParty/cinema/paraview/tpl/cinema_python/images/compositor.py | python | Compositor_SpecB.ambient | (self, rgb) | return np.dstack((rgb[:, :, 0], rgb[:, :, 0], rgb[:, :, 0])) | Returns the ambient contribution in an RGB luminance image. | Returns the ambient contribution in an RGB luminance image. | [
"Returns",
"the",
"ambient",
"contribution",
"in",
"an",
"RGB",
"luminance",
"image",
"."
] | def ambient(self, rgb):
""" Returns the ambient contribution in an RGB luminance image. """
return np.dstack((rgb[:, :, 0], rgb[:, :, 0], rgb[:, :, 0])) | [
"def",
"ambient",
"(",
"self",
",",
"rgb",
")",
":",
"return",
"np",
".",
"dstack",
"(",
"(",
"rgb",
"[",
":",
",",
":",
",",
"0",
"]",
",",
"rgb",
"[",
":",
",",
":",
",",
"0",
"]",
",",
"rgb",
"[",
":",
",",
":",
",",
"0",
"]",
")",
... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/images/compositor.py#L67-L69 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/error_fixer.py | python | ErrorFixer.FinishFile | (self) | Called when the current file has finished style checking.
Used to go back and fix any errors in the file. It currently supports both
js and html files. For js files it does a simple dump of all tokens, but in
order to support html file, we need to merge the original file with the new
token set back tog... | Called when the current file has finished style checking. | [
"Called",
"when",
"the",
"current",
"file",
"has",
"finished",
"style",
"checking",
"."
] | def FinishFile(self):
"""Called when the current file has finished style checking.
Used to go back and fix any errors in the file. It currently supports both
js and html files. For js files it does a simple dump of all tokens, but in
order to support html file, we need to merge the original file with t... | [
"def",
"FinishFile",
"(",
"self",
")",
":",
"if",
"self",
".",
"_file_fix_count",
":",
"# Get the original file content for html.",
"if",
"self",
".",
"_file_is_html",
":",
"f",
"=",
"open",
"(",
"self",
".",
"_file_name",
",",
"'r'",
")",
"original_lines",
"=... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/error_fixer.py#L560-L620 | ||
NervanaSystems/ngraph | f677a119765ca30636cf407009dabd118664951f | python/src/ngraph/ops.py | python | max_pool | (
data: NodeInput,
strides: List[int],
pads_begin: List[int],
pads_end: List[int],
kernel_shape: TensorShape,
rounding_type: str = "floor",
auto_pad: Optional[str] = None,
name: Optional[str] = None,
) | return _get_node_factory().create(
"MaxPool",
[as_node(data)],
{
"strides": strides,
"pads_begin": pads_begin,
"pads_end": pads_end,
"kernel": kernel_shape,
"rounding_type": rounding_type.upper(),
"auto_pad": auto_pad.upper(... | Perform max pooling operation with given parameters on provided data.
:param data: The node providing input data.
:param strides: The distance (in pixels) to slide the filter on the feature map
over the axes.
:param pads_begin: The number of pixels to add... | Perform max pooling operation with given parameters on provided data. | [
"Perform",
"max",
"pooling",
"operation",
"with",
"given",
"parameters",
"on",
"provided",
"data",
"."
] | def max_pool(
data: NodeInput,
strides: List[int],
pads_begin: List[int],
pads_end: List[int],
kernel_shape: TensorShape,
rounding_type: str = "floor",
auto_pad: Optional[str] = None,
name: Optional[str] = None,
) -> Node:
"""Perform max pooling operation with given parameters on pro... | [
"def",
"max_pool",
"(",
"data",
":",
"NodeInput",
",",
"strides",
":",
"List",
"[",
"int",
"]",
",",
"pads_begin",
":",
"List",
"[",
"int",
"]",
",",
"pads_end",
":",
"List",
"[",
"int",
"]",
",",
"kernel_shape",
":",
"TensorShape",
",",
"rounding_type... | https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/python/src/ngraph/ops.py#L1887-L1926 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlTextReader.NodeType | (self) | return ret | Get the node type of the current node Reference:
http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/Xm
lNodeType.html | Get the node type of the current node Reference:
http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/Xm
lNodeType.html | [
"Get",
"the",
"node",
"type",
"of",
"the",
"current",
"node",
"Reference",
":",
"http",
":",
"//",
"www",
".",
"gnu",
".",
"org",
"/",
"software",
"/",
"dotgnu",
"/",
"pnetlib",
"-",
"doc",
"/",
"System",
"/",
"Xml",
"/",
"Xm",
"lNodeType",
".",
"h... | def NodeType(self):
"""Get the node type of the current node Reference:
http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/Xm
lNodeType.html """
ret = libxml2mod.xmlTextReaderNodeType(self._o)
return ret | [
"def",
"NodeType",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlTextReaderNodeType",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L6000-L6005 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/metrics/python/ops/metric_ops.py | python | streaming_false_positives | (predictions,
labels,
weights=None,
metrics_collections=None,
updates_collections=None,
name=None) | return metrics.false_positives(
predictions=predictions,
labels=labels,
weights=weights,
metrics_collections=metrics_collections,
updates_collections=updates_collections,
name=name) | Sum the weights of false positives.
If `weights` is `None`, weights default to 1. Use weights of 0 to mask values.
Args:
predictions: The predicted values, a `Tensor` of arbitrary dimensions. Will
be cast to `bool`.
labels: The ground truth values, a `Tensor` whose dimensions must match
`predi... | Sum the weights of false positives. | [
"Sum",
"the",
"weights",
"of",
"false",
"positives",
"."
] | def streaming_false_positives(predictions,
labels,
weights=None,
metrics_collections=None,
updates_collections=None,
name=None):
"""Sum the weights of false positives.
... | [
"def",
"streaming_false_positives",
"(",
"predictions",
",",
"labels",
",",
"weights",
"=",
"None",
",",
"metrics_collections",
"=",
"None",
",",
"updates_collections",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"metrics",
".",
"false_positives",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/metrics/python/ops/metric_ops.py#L140-L180 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/gdb/mongo.py | python | get_session_kv_pairs | () | return list(absl_get_nodes(session_catalog["_sessions"])) | Return the SessionRuntimeInfoMap stored in the global SessionCatalog object.
Returns a list of (LogicalSessionId, std::unique_ptr<SessionRuntimeInfo>) key-value pairs. For
key-value pair 'session_kv', access the key with 'session_kv["first"]' and access the value with
'session_kv["second"]'. | Return the SessionRuntimeInfoMap stored in the global SessionCatalog object. | [
"Return",
"the",
"SessionRuntimeInfoMap",
"stored",
"in",
"the",
"global",
"SessionCatalog",
"object",
"."
] | def get_session_kv_pairs():
"""Return the SessionRuntimeInfoMap stored in the global SessionCatalog object.
Returns a list of (LogicalSessionId, std::unique_ptr<SessionRuntimeInfo>) key-value pairs. For
key-value pair 'session_kv', access the key with 'session_kv["first"]' and access the value with
'se... | [
"def",
"get_session_kv_pairs",
"(",
")",
":",
"session_catalog",
"=",
"get_session_catalog",
"(",
")",
"if",
"session_catalog",
"is",
"None",
":",
"return",
"list",
"(",
")",
"return",
"list",
"(",
"absl_get_nodes",
"(",
"session_catalog",
"[",
"\"_sessions\"",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/gdb/mongo.py#L97-L107 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py | python | ConstBitStream._setbytepos | (self, bytepos) | Move to absolute byte-aligned position in stream. | Move to absolute byte-aligned position in stream. | [
"Move",
"to",
"absolute",
"byte",
"-",
"aligned",
"position",
"in",
"stream",
"."
] | def _setbytepos(self, bytepos):
"""Move to absolute byte-aligned position in stream."""
self._setbitpos(bytepos * 8) | [
"def",
"_setbytepos",
"(",
"self",
",",
"bytepos",
")",
":",
"self",
".",
"_setbitpos",
"(",
"bytepos",
"*",
"8",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L3788-L3790 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/runtime.py | python | LoopContext.cycle | (self, *args) | return args[self.index0 % len(args)] | Cycles among the arguments with the current loop index. | Cycles among the arguments with the current loop index. | [
"Cycles",
"among",
"the",
"arguments",
"with",
"the",
"current",
"loop",
"index",
"."
] | def cycle(self, *args):
"""Cycles among the arguments with the current loop index."""
if not args:
raise TypeError('no items for cycling given')
return args[self.index0 % len(args)] | [
"def",
"cycle",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"not",
"args",
":",
"raise",
"TypeError",
"(",
"'no items for cycling given'",
")",
"return",
"args",
"[",
"self",
".",
"index0",
"%",
"len",
"(",
"args",
")",
"]"
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/runtime.py#L302-L306 | |
networkit/networkit | 695b7a786a894a303fa8587597d5ef916e797729 | networkit/algebraic.py | python | symmetricEigenvectors | (matrix, cutoff=-1, reverse=False) | return (orderedW, orderedV) | symmetricEigenvectors(matrix, cutoff=-1, reverse=False)
Computes eigenvectors and -values of symmetric matrices.
Parameters
----------
matrix : sparse matrix
The matrix to compute the eigenvectors of
cutoff : int, optional
The maximum (or minimum) magnitude of the eigenvectors needed
reverse : boolean, opti... | symmetricEigenvectors(matrix, cutoff=-1, reverse=False) | [
"symmetricEigenvectors",
"(",
"matrix",
"cutoff",
"=",
"-",
"1",
"reverse",
"=",
"False",
")"
] | def symmetricEigenvectors(matrix, cutoff=-1, reverse=False):
"""
symmetricEigenvectors(matrix, cutoff=-1, reverse=False)
Computes eigenvectors and -values of symmetric matrices.
Parameters
----------
matrix : sparse matrix
The matrix to compute the eigenvectors of
cutoff : int, optional
The maximum (or min... | [
"def",
"symmetricEigenvectors",
"(",
"matrix",
",",
"cutoff",
"=",
"-",
"1",
",",
"reverse",
"=",
"False",
")",
":",
"if",
"cutoff",
"==",
"-",
"1",
":",
"cutoff",
"=",
"matrix",
".",
"shape",
"[",
"0",
"]",
"-",
"3",
"if",
"reverse",
":",
"mode",
... | https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/networkit/algebraic.py#L143-L181 | |
PlatformLab/Arachne | e67391471007174dd4002dc2c160628e19c284e8 | scripts/cpplint.py | python | CheckCStyleCast | (filename, clean_lines, linenum, cast_type, pattern, error) | return True | Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The string for the C++ cast to recommend. This is either
reinterpret_cast, static_... | Checks for a C-style cast by looking for the pattern. | [
"Checks",
"for",
"a",
"C",
"-",
"style",
"cast",
"by",
"looking",
"for",
"the",
"pattern",
"."
] | def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
"""Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
cast_type: The ... | [
"def",
"CheckCStyleCast",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"cast_type",
",",
"pattern",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"match",
"=",
"Search",
"(",
"pattern",
",",
"line",
... | https://github.com/PlatformLab/Arachne/blob/e67391471007174dd4002dc2c160628e19c284e8/scripts/cpplint.py#L4992-L5042 | |
kevinlin311tw/caffe-cvprw15 | 45c2a1bf0368569c54e0be4edf8d34285cf79e70 | scripts/cpp_lint.py | python | CheckCStyleCast | (filename, linenum, line, raw_line, cast_type, pattern,
error) | return True | Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
linenum: The number of the line to check.
line: The line of code to check.
raw_line: The raw line of code to check, with comments.
cast_type: The string for the C++ cast to recommend. This is eith... | Checks for a C-style cast by looking for the pattern. | [
"Checks",
"for",
"a",
"C",
"-",
"style",
"cast",
"by",
"looking",
"for",
"the",
"pattern",
"."
] | def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
error):
"""Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
linenum: The number of the line to check.
line: The line of code to check.
raw_line: The raw ... | [
"def",
"CheckCStyleCast",
"(",
"filename",
",",
"linenum",
",",
"line",
",",
"raw_line",
",",
"cast_type",
",",
"pattern",
",",
"error",
")",
":",
"match",
"=",
"Search",
"(",
"pattern",
",",
"line",
")",
"if",
"not",
"match",
":",
"return",
"False",
"... | https://github.com/kevinlin311tw/caffe-cvprw15/blob/45c2a1bf0368569c54e0be4edf8d34285cf79e70/scripts/cpp_lint.py#L4247-L4338 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/formats/style.py | python | _get_level_lengths | (index, hidden_elements=None) | return non_zero_lengths | Given an index, find the level length for each element.
Optional argument is a list of index positions which
should not be visible.
Result is a dictionary of (level, initial_position): span | Given an index, find the level length for each element. | [
"Given",
"an",
"index",
"find",
"the",
"level",
"length",
"for",
"each",
"element",
"."
] | def _get_level_lengths(index, hidden_elements=None):
"""
Given an index, find the level length for each element.
Optional argument is a list of index positions which
should not be visible.
Result is a dictionary of (level, initial_position): span
"""
levels = index.format(sparsify=lib.no_d... | [
"def",
"_get_level_lengths",
"(",
"index",
",",
"hidden_elements",
"=",
"None",
")",
":",
"levels",
"=",
"index",
".",
"format",
"(",
"sparsify",
"=",
"lib",
".",
"no_default",
",",
"adjoin",
"=",
"False",
",",
"names",
"=",
"False",
")",
"if",
"hidden_e... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/formats/style.py#L1470-L1510 | |
bakwc/JamSpell | ab5ade201df3e52d99c3a1d38ec422cf4ded1795 | evaluate/context_spell_prototype.py | python | edits1 | (word) | return set(deletes + transposes + replaces + inserts) | All edits that are one edit away from `word`. | All edits that are one edit away from `word`. | [
"All",
"edits",
"that",
"are",
"one",
"edit",
"away",
"from",
"word",
"."
] | def edits1(word):
"All edits that are one edit away from `word`."
letters = 'abcdefghijklmnopqrstuvwxyz'
splits = [(word[:i], word[i:]) for i in range(len(word) + 1)]
deletes = [L + R[1:] for L, R in splits if R]
transposes = [L + R[1] + R[0] + R[2:] for L, R in splits if ... | [
"def",
"edits1",
"(",
"word",
")",
":",
"letters",
"=",
"'abcdefghijklmnopqrstuvwxyz'",
"splits",
"=",
"[",
"(",
"word",
"[",
":",
"i",
"]",
",",
"word",
"[",
"i",
":",
"]",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"word",
")",
"+",
"1",
... | https://github.com/bakwc/JamSpell/blob/ab5ade201df3e52d99c3a1d38ec422cf4ded1795/evaluate/context_spell_prototype.py#L54-L62 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/mtv/mtv_api.py | python | Videos.makeURL | (self, URL) | Form a URL to search for videos
return a URL | Form a URL to search for videos
return a URL | [
"Form",
"a",
"URL",
"to",
"search",
"for",
"videos",
"return",
"a",
"URL"
] | def makeURL(self, URL):
'''Form a URL to search for videos
return a URL
'''
additions = dict(self.tree_customize[self.tree_key]['__default__']) # Set defaults
# Add customizations
if self.feed in list(self.tree_customize[self.tree_key].keys()):
for element in... | [
"def",
"makeURL",
"(",
"self",
",",
"URL",
")",
":",
"additions",
"=",
"dict",
"(",
"self",
".",
"tree_customize",
"[",
"self",
".",
"tree_key",
"]",
"[",
"'__default__'",
"]",
")",
"# Set defaults",
"# Add customizations",
"if",
"self",
".",
"feed",
"in",... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/mtv/mtv_api.py#L596-L618 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/rosunit/src/rosunit/xmlrunner.py | python | XMLTestRunnerTest._try_test_run | (self, test_class, expected) | Run the test suite against the supplied test class and compare the
XML result against the expected XML string. Fail if the expected
string doesn't match the actual string. All time attribute in the
expected string should have the value "0.000". All error and failure
messages are reduced ... | Run the test suite against the supplied test class and compare the
XML result against the expected XML string. Fail if the expected
string doesn't match the actual string. All time attribute in the
expected string should have the value "0.000". All error and failure
messages are reduced ... | [
"Run",
"the",
"test",
"suite",
"against",
"the",
"supplied",
"test",
"class",
"and",
"compare",
"the",
"XML",
"result",
"against",
"the",
"expected",
"XML",
"string",
".",
"Fail",
"if",
"the",
"expected",
"string",
"doesn",
"t",
"match",
"the",
"actual",
"... | def _try_test_run(self, test_class, expected):
"""Run the test suite against the supplied test class and compare the
XML result against the expected XML string. Fail if the expected
string doesn't match the actual string. All time attribute in the
expected string should have the value "... | [
"def",
"_try_test_run",
"(",
"self",
",",
"test_class",
",",
"expected",
")",
":",
"runner",
"=",
"XMLTestRunner",
"(",
"self",
".",
"_stream",
")",
"runner",
".",
"run",
"(",
"unittest",
".",
"makeSuite",
"(",
"test_class",
")",
")",
"got",
"=",
"self",... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosunit/src/rosunit/xmlrunner.py#L270-L292 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/lib/sessions.py | python | PostgresqlSession.setup | (cls, **kwargs) | Set up the storage system for Postgres-based sessions.
This should only be called once per process; this will be done
automatically when using sessions.init (as the built-in Tool does). | Set up the storage system for Postgres-based sessions.
This should only be called once per process; this will be done
automatically when using sessions.init (as the built-in Tool does). | [
"Set",
"up",
"the",
"storage",
"system",
"for",
"Postgres",
"-",
"based",
"sessions",
".",
"This",
"should",
"only",
"be",
"called",
"once",
"per",
"process",
";",
"this",
"will",
"be",
"done",
"automatically",
"when",
"using",
"sessions",
".",
"init",
"("... | def setup(cls, **kwargs):
"""Set up the storage system for Postgres-based sessions.
This should only be called once per process; this will be done
automatically when using sessions.init (as the built-in Tool does).
"""
for k, v in kwargs.items():
setattr(cls,... | [
"def",
"setup",
"(",
"cls",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"setattr",
"(",
"cls",
",",
"k",
",",
"v",
")",
"self",
".",
"db",
"=",
"self",
".",
"get_db",
"(",
")"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/sessions.py#L530-L539 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py | python | pyparsing_common.stripHTMLTags | (s, l, tokens) | return pyparsing_common._html_stripper.transformString(tokens[0]) | Parse action to remove HTML tags from web page HTML source
Example::
# strip HTML links from normal text
text = '<td>More info at the <a href="https://github.com/pyparsing/pyparsing/wiki">pyparsing</a> wiki page</td>'
td,td_end = makeHTMLTags("TD")
table_text = ... | Parse action to remove HTML tags from web page HTML source | [
"Parse",
"action",
"to",
"remove",
"HTML",
"tags",
"from",
"web",
"page",
"HTML",
"source"
] | def stripHTMLTags(s, l, tokens):
"""Parse action to remove HTML tags from web page HTML source
Example::
# strip HTML links from normal text
text = '<td>More info at the <a href="https://github.com/pyparsing/pyparsing/wiki">pyparsing</a> wiki page</td>'
td,td_end = ... | [
"def",
"stripHTMLTags",
"(",
"s",
",",
"l",
",",
"tokens",
")",
":",
"return",
"pyparsing_common",
".",
"_html_stripper",
".",
"transformString",
"(",
"tokens",
"[",
"0",
"]",
")"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py#L6196-L6211 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py | python | _POFileBuilder._execute | (self, env, target, source, *args, **kw) | return SCons.Node.NodeList(result) | Execute builder's actions.
Here we append to `target` the languages read from `$LINGUAS_FILE` and
apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.
The arguments and return value are same as for
`SCons.Builder.BuilderBase._execute()`. | Execute builder's actions.
Here we append to `target` the languages read from `$LINGUAS_FILE` and
apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.
The arguments and return value are same as for
`SCons.Builder.BuilderBase._execute()`. | [
"Execute",
"builder",
"s",
"actions",
".",
"Here",
"we",
"append",
"to",
"target",
"the",
"languages",
"read",
"from",
"$LINGUAS_FILE",
"and",
"apply",
"SCons",
".",
"Builder",
".",
"BuilderBase",
".",
"_execute",
"()",
"separatelly",
"to",
"each",
"target",
... | def _execute(self, env, target, source, *args, **kw):
""" Execute builder's actions.
Here we append to `target` the languages read from `$LINGUAS_FILE` and
apply `SCons.Builder.BuilderBase._execute()` separatelly to each target.
The arguments and return value are same as for
`SCons.Builder.Bui... | [
"def",
"_execute",
"(",
"self",
",",
"env",
",",
"target",
",",
"source",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"import",
"SCons",
".",
"Util",
"import",
"SCons",
".",
"Node",
"linguas_files",
"=",
"None",
"if",
"env",
".",
"has_key",
"(... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py#L188-L223 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/tabart.py | python | FF2TabArt.DrawTabBackground | (self, dc, rect, focus, upperTabs) | Draws the tab background for the Firefox 2 style.
This is more consistent with :class:`~lib.agw.flatnotebook.FlatNotebook` than before.
:param `dc`: a :class:`DC` device context;
:param Rect `rect`: rectangle the tab should be confined to;
:param bool `focus`: whether the tab has focus ... | Draws the tab background for the Firefox 2 style.
This is more consistent with :class:`~lib.agw.flatnotebook.FlatNotebook` than before. | [
"Draws",
"the",
"tab",
"background",
"for",
"the",
"Firefox",
"2",
"style",
".",
"This",
"is",
"more",
"consistent",
"with",
":",
"class",
":",
"~lib",
".",
"agw",
".",
"flatnotebook",
".",
"FlatNotebook",
"than",
"before",
"."
] | def DrawTabBackground(self, dc, rect, focus, upperTabs):
"""
Draws the tab background for the Firefox 2 style.
This is more consistent with :class:`~lib.agw.flatnotebook.FlatNotebook` than before.
:param `dc`: a :class:`DC` device context;
:param Rect `rect`: rectangle the tab s... | [
"def",
"DrawTabBackground",
"(",
"self",
",",
"dc",
",",
"rect",
",",
"focus",
",",
"upperTabs",
")",
":",
"# Define the rounded rectangle base on the given rect",
"# we need an array of 9 points for it",
"regPts",
"=",
"[",
"wx",
".",
"Point",
"(",
")",
"for",
"ind... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/tabart.py#L2092-L2148 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py | python | Distribution.__eq__ | (self, other) | return result | See if this distribution is the same as another.
:param other: The distribution to compare with. To be equal to one
another. distributions must have the same type, name,
version and source_url.
:return: True if it is the same, else False. | See if this distribution is the same as another.
:param other: The distribution to compare with. To be equal to one
another. distributions must have the same type, name,
version and source_url.
:return: True if it is the same, else False. | [
"See",
"if",
"this",
"distribution",
"is",
"the",
"same",
"as",
"another",
".",
":",
"param",
"other",
":",
"The",
"distribution",
"to",
"compare",
"with",
".",
"To",
"be",
"equal",
"to",
"one",
"another",
".",
"distributions",
"must",
"have",
"the",
"sa... | def __eq__(self, other):
"""
See if this distribution is the same as another.
:param other: The distribution to compare with. To be equal to one
another. distributions must have the same type, name,
version and source_url.
:return: True if it i... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"type",
"(",
"other",
")",
"is",
"not",
"type",
"(",
"self",
")",
":",
"result",
"=",
"False",
"else",
":",
"result",
"=",
"(",
"self",
".",
"name",
"==",
"other",
".",
"name",
"and",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L451-L465 | |
Smorodov/Multitarget-tracker | bee300e8bfd660c86cbeb6892c65a5b7195c9381 | thirdparty/pybind11/tools/clang/cindex.py | python | Cursor.is_static_method | (self) | return conf.lib.clang_CXXMethod_isStatic(self) | Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'. | Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"member",
"function",
"or",
"member",
"function",
"template",
"that",
"is",
"declared",
"static",
"."
] | def is_static_method(self):
"""Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'.
"""
return conf.lib.clang_CXXMethod_isStatic(self) | [
"def",
"is_static_method",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXMethod_isStatic",
"(",
"self",
")"
] | https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L1359-L1363 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/kokkos-kernels/scripts/analysis/batched/pd.py | python | kkt_parse_exespace_re | (ln) | return hits[0] | Parse an ExecSpace line. | Parse an ExecSpace line. | [
"Parse",
"an",
"ExecSpace",
"line",
"."
] | def kkt_parse_exespace_re(ln):
'Parse an ExecSpace line.'
hits = re.findall('topology\[(?P<one>.*) x (?P<two>.*) x (?P<three>.*) \]', ln + ' ')
if len(hits) == 0:
return ()
return hits[0] | [
"def",
"kkt_parse_exespace_re",
"(",
"ln",
")",
":",
"hits",
"=",
"re",
".",
"findall",
"(",
"'topology\\[(?P<one>.*) x (?P<two>.*) x (?P<three>.*) \\]'",
",",
"ln",
"+",
"' '",
")",
"if",
"len",
"(",
"hits",
")",
"==",
"0",
":",
"return",
"(",
")",
"return"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/kokkos-kernels/scripts/analysis/batched/pd.py#L168-L173 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py | python | Scale.configure | (self, cnf=None, **kw) | Modify or query scale options.
Setting a value for any of the "from", "from_" or "to" options
generates a <<RangeChanged>> event. | Modify or query scale options. | [
"Modify",
"or",
"query",
"scale",
"options",
"."
] | def configure(self, cnf=None, **kw):
"""Modify or query scale options.
Setting a value for any of the "from", "from_" or "to" options
generates a <<RangeChanged>> event."""
if cnf:
kw.update(cnf)
Widget.configure(self, **kw)
if any(['from' in kw, 'from_' in k... | [
"def",
"configure",
"(",
"self",
",",
"cnf",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"if",
"cnf",
":",
"kw",
".",
"update",
"(",
"cnf",
")",
"Widget",
".",
"configure",
"(",
"self",
",",
"*",
"*",
"kw",
")",
"if",
"any",
"(",
"[",
"'from'... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py#L1077-L1086 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py | python | BaseMonitor.begin | (self, max_steps=None) | Called at the beginning of training.
When called, the default graph is the one we are executing.
Args:
max_steps: `int`, the maximum global step this training will run until.
Raises:
ValueError: if we've already begun a run. | Called at the beginning of training. | [
"Called",
"at",
"the",
"beginning",
"of",
"training",
"."
] | def begin(self, max_steps=None):
"""Called at the beginning of training.
When called, the default graph is the one we are executing.
Args:
max_steps: `int`, the maximum global step this training will run until.
Raises:
ValueError: if we've already begun a run.
"""
if self._begun:
... | [
"def",
"begin",
"(",
"self",
",",
"max_steps",
"=",
"None",
")",
":",
"if",
"self",
".",
"_begun",
":",
"raise",
"ValueError",
"(",
"\"begin called twice without end.\"",
")",
"self",
".",
"_max_steps",
"=",
"max_steps",
"self",
".",
"_begun",
"=",
"True"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py#L137-L151 | ||
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/core/mpi.py | python | AllowParallel | () | return -1, [] | Whether this node was set for data parallelism.
Returns
-------
boolean | Whether this node was set for data parallelism. | [
"Whether",
"this",
"node",
"was",
"set",
"for",
"data",
"parallelism",
"."
] | def AllowParallel():
"""Whether this node was set for data parallelism.
Returns
-------
boolean
"""
global _parallel_groups
world_rank = Rank()
for idx, g in enumerate(_parallel_groups):
if world_rank in g: return idx, g
return -1, [] | [
"def",
"AllowParallel",
"(",
")",
":",
"global",
"_parallel_groups",
"world_rank",
"=",
"Rank",
"(",
")",
"for",
"idx",
",",
"g",
"in",
"enumerate",
"(",
"_parallel_groups",
")",
":",
"if",
"world_rank",
"in",
"g",
":",
"return",
"idx",
",",
"g",
"return... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/core/mpi.py#L194-L206 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/regression/_regression.py | python | create | (dataset, target, features=None, validation_set="auto", verbose=True) | return _sl.wrap_model_proxy(model_proxy) | Automatically create a suitable regression model based on the provided
training data.
To use specific options of a desired model, use the ``create`` function
of the corresponding model.
Parameters
----------
dataset : SFrame
Dataset for training the model.
target : str
The... | Automatically create a suitable regression model based on the provided
training data. | [
"Automatically",
"create",
"a",
"suitable",
"regression",
"model",
"based",
"on",
"the",
"provided",
"training",
"data",
"."
] | def create(dataset, target, features=None, validation_set="auto", verbose=True):
"""
Automatically create a suitable regression model based on the provided
training data.
To use specific options of a desired model, use the ``create`` function
of the corresponding model.
Parameters
--------... | [
"def",
"create",
"(",
"dataset",
",",
"target",
",",
"features",
"=",
"None",
",",
"validation_set",
"=",
"\"auto\"",
",",
"verbose",
"=",
"True",
")",
":",
"dataset",
",",
"validation_set",
"=",
"_validate_data",
"(",
"dataset",
",",
"target",
",",
"featu... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/regression/_regression.py#L15-L116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.