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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBAttachInfo.GetWaitForLaunch | (self) | return _lldb.SBAttachInfo_GetWaitForLaunch(self) | GetWaitForLaunch(SBAttachInfo self) -> bool | GetWaitForLaunch(SBAttachInfo self) -> bool | [
"GetWaitForLaunch",
"(",
"SBAttachInfo",
"self",
")",
"-",
">",
"bool"
] | def GetWaitForLaunch(self):
"""GetWaitForLaunch(SBAttachInfo self) -> bool"""
return _lldb.SBAttachInfo_GetWaitForLaunch(self) | [
"def",
"GetWaitForLaunch",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBAttachInfo_GetWaitForLaunch",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1079-L1081 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/feature_extraction/text.py | python | CountVectorizer.fit_transform | (self, raw_documents, y=None) | return X | Learn the vocabulary dictionary and return term-document matrix.
This is equivalent to fit followed by transform, but more efficiently
implemented.
Parameters
----------
raw_documents : iterable
An iterable which yields either str, unicode or file objects.
... | Learn the vocabulary dictionary and return term-document matrix. | [
"Learn",
"the",
"vocabulary",
"dictionary",
"and",
"return",
"term",
"-",
"document",
"matrix",
"."
] | def fit_transform(self, raw_documents, y=None):
"""Learn the vocabulary dictionary and return term-document matrix.
This is equivalent to fit followed by transform, but more efficiently
implemented.
Parameters
----------
raw_documents : iterable
An iterable ... | [
"def",
"fit_transform",
"(",
"self",
",",
"raw_documents",
",",
"y",
"=",
"None",
")",
":",
"# We intentionally don't call the transform method to make",
"# fit_transform overridable without unwanted side effects in",
"# TfidfVectorizer.",
"if",
"isinstance",
"(",
"raw_documents"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/feature_extraction/text.py#L809-L864 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/training/python/training/hparam.py | python | HParams.parse_json | (self, values_json) | return self.override_from_dict(values_map) | Override hyperparameter values, parsing new values from a json object.
Args:
values_json: String containing a json object of name:value pairs.
Returns:
The `HParams` instance.
Raises:
ValueError: If `values_json` cannot be parsed. | Override hyperparameter values, parsing new values from a json object. | [
"Override",
"hyperparameter",
"values",
"parsing",
"new",
"values",
"from",
"a",
"json",
"object",
"."
] | def parse_json(self, values_json):
"""Override hyperparameter values, parsing new values from a json object.
Args:
values_json: String containing a json object of name:value pairs.
Returns:
The `HParams` instance.
Raises:
ValueError: If `values_json` cannot be parsed.
"""
va... | [
"def",
"parse_json",
"(",
"self",
",",
"values_json",
")",
":",
"values_map",
"=",
"json",
".",
"loads",
"(",
"values_json",
")",
"return",
"self",
".",
"override_from_dict",
"(",
"values_map",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/training/python/training/hparam.py#L511-L524 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/blocks.py | python | ObjectBlock.is_bool | (self) | return lib.is_bool_array(self.values.ravel()) | we can be a bool if we have only bool values but are of type
object | we can be a bool if we have only bool values but are of type
object | [
"we",
"can",
"be",
"a",
"bool",
"if",
"we",
"have",
"only",
"bool",
"values",
"but",
"are",
"of",
"type",
"object"
] | def is_bool(self):
""" we can be a bool if we have only bool values but are of type
object
"""
return lib.is_bool_array(self.values.ravel()) | [
"def",
"is_bool",
"(",
"self",
")",
":",
"return",
"lib",
".",
"is_bool_array",
"(",
"self",
".",
"values",
".",
"ravel",
"(",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/blocks.py#L2598-L2602 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/models/embedding/word2vec_optimized.py | python | main | (_) | Train a word2vec model. | Train a word2vec model. | [
"Train",
"a",
"word2vec",
"model",
"."
] | def main(_):
"""Train a word2vec model."""
if not FLAGS.train_data or not FLAGS.eval_data or not FLAGS.save_path:
print("--train_data --eval_data and --save_path must be specified.")
sys.exit(1)
opts = Options()
with tf.Graph().as_default(), tf.Session() as session:
with tf.device("/cpu:0"):
m... | [
"def",
"main",
"(",
"_",
")",
":",
"if",
"not",
"FLAGS",
".",
"train_data",
"or",
"not",
"FLAGS",
".",
"eval_data",
"or",
"not",
"FLAGS",
".",
"save_path",
":",
"print",
"(",
"\"--train_data --eval_data and --save_path must be specified.\"",
")",
"sys",
".",
"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/models/embedding/word2vec_optimized.py#L413-L433 | ||
baidu/AnyQ | d94d450d2aaa5f7ed73424b10aa4539835b97527 | tools/simnet/train/paddle/nets/gru.py | python | GRU.__init__ | (self, conf_dict) | initialize | initialize | [
"initialize"
] | def __init__(self, conf_dict):
"""
initialize
"""
self.dict_size = conf_dict["dict_size"]
self.task_mode = conf_dict["task_mode"]
self.emb_dim = conf_dict["net"]["emb_dim"]
self.gru_dim = conf_dict["net"]["gru_dim"]
self.hidden_dim = conf_dict["net"]["hidd... | [
"def",
"__init__",
"(",
"self",
",",
"conf_dict",
")",
":",
"self",
".",
"dict_size",
"=",
"conf_dict",
"[",
"\"dict_size\"",
"]",
"self",
".",
"task_mode",
"=",
"conf_dict",
"[",
"\"task_mode\"",
"]",
"self",
".",
"emb_dim",
"=",
"conf_dict",
"[",
"\"net\... | https://github.com/baidu/AnyQ/blob/d94d450d2aaa5f7ed73424b10aa4539835b97527/tools/simnet/train/paddle/nets/gru.py#L24-L32 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/tensor_shape.py | python | vector | (length) | return TensorShape([length]) | Returns a shape representing a vector.
Args:
length: The length of the vector, which may be None if unknown.
Returns:
A TensorShape representing a vector of the given length. | Returns a shape representing a vector. | [
"Returns",
"a",
"shape",
"representing",
"a",
"vector",
"."
] | def vector(length):
"""Returns a shape representing a vector.
Args:
length: The length of the vector, which may be None if unknown.
Returns:
A TensorShape representing a vector of the given length.
"""
return TensorShape([length]) | [
"def",
"vector",
"(",
"length",
")",
":",
"return",
"TensorShape",
"(",
"[",
"length",
"]",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/tensor_shape.py#L824-L833 | |
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | llvm/utils/lint/common_lint.py | python | RunLintOverAllFiles | (linter, filenames) | return lint | Runs linter over the contents of all files.
Args:
lint: subclass of BaseLint, implementing RunOnFile()
filenames: list of all files whose contents will be linted
Returns:
A list of tuples with format [(filename, line number, msg), ...] with any
violations found. | Runs linter over the contents of all files. | [
"Runs",
"linter",
"over",
"the",
"contents",
"of",
"all",
"files",
"."
] | def RunLintOverAllFiles(linter, filenames):
"""Runs linter over the contents of all files.
Args:
lint: subclass of BaseLint, implementing RunOnFile()
filenames: list of all files whose contents will be linted
Returns:
A list of tuples with format [(filename, line number, msg), ...] with any
viol... | [
"def",
"RunLintOverAllFiles",
"(",
"linter",
",",
"filenames",
")",
":",
"lint",
"=",
"[",
"]",
"for",
"filename",
"in",
"filenames",
":",
"file",
"=",
"open",
"(",
"filename",
",",
"'r'",
")",
"if",
"not",
"file",
":",
"print",
"(",
"'Cound not open %s'... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/llvm/utils/lint/common_lint.py#L78-L98 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/pylib/results/flakiness_dashboard/json_results_generator.py | python | JSONResultsGeneratorBase.GetJSON | (self) | return results_json | Gets the results for the results.json file. | Gets the results for the results.json file. | [
"Gets",
"the",
"results",
"for",
"the",
"results",
".",
"json",
"file",
"."
] | def GetJSON(self):
"""Gets the results for the results.json file."""
results_json = {}
if not results_json:
results_json, error = self._GetArchivedJSONResults()
if error:
# If there was an error don't write a results.json
# file at all as it would lose all the information on the... | [
"def",
"GetJSON",
"(",
"self",
")",
":",
"results_json",
"=",
"{",
"}",
"if",
"not",
"results_json",
":",
"results_json",
",",
"error",
"=",
"self",
".",
"_GetArchivedJSONResults",
"(",
")",
"if",
"error",
":",
"# If there was an error don't write a results.json",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/pylib/results/flakiness_dashboard/json_results_generator.py#L223-L264 | |
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | CleansedLines.NumLines | (self) | return self.num_lines | Returns the number of lines represented. | Returns the number of lines represented. | [
"Returns",
"the",
"number",
"of",
"lines",
"represented",
"."
] | def NumLines(self):
"""Returns the number of lines represented."""
return self.num_lines | [
"def",
"NumLines",
"(",
"self",
")",
":",
"return",
"self",
".",
"num_lines"
] | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L1672-L1674 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/array_ops.py | python | batch_gather | (params, indices, name=None) | Gather slices from params according to indices with leading batch dims. | Gather slices from params according to indices with leading batch dims. | [
"Gather",
"slices",
"from",
"params",
"according",
"to",
"indices",
"with",
"leading",
"batch",
"dims",
"."
] | def batch_gather(params, indices, name=None):
"""Gather slices from params according to indices with leading batch dims."""
with ops.name_scope(name, "BatchGather", [params, indices]):
indices = ops.convert_to_tensor(indices, name="indices")
params = ops.convert_to_tensor(params, name="params")
if indic... | [
"def",
"batch_gather",
"(",
"params",
",",
"indices",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"BatchGather\"",
",",
"[",
"params",
",",
"indices",
"]",
")",
":",
"indices",
"=",
"ops",
".",
"convert_to_... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/array_ops.py#L3984-L3992 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarFile.getnames | (self) | return [tarinfo.name for tarinfo in self.getmembers()] | Return the members of the archive as a list of their names. It has
the same order as the list returned by getmembers(). | Return the members of the archive as a list of their names. It has
the same order as the list returned by getmembers(). | [
"Return",
"the",
"members",
"of",
"the",
"archive",
"as",
"a",
"list",
"of",
"their",
"names",
".",
"It",
"has",
"the",
"same",
"order",
"as",
"the",
"list",
"returned",
"by",
"getmembers",
"()",
"."
] | def getnames(self):
"""Return the members of the archive as a list of their names. It has
the same order as the list returned by getmembers().
"""
return [tarinfo.name for tarinfo in self.getmembers()] | [
"def",
"getnames",
"(",
"self",
")",
":",
"return",
"[",
"tarinfo",
".",
"name",
"for",
"tarinfo",
"in",
"self",
".",
"getmembers",
"(",
")",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L1905-L1909 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/utils.py | python | GetGPUMemoryUsageStats | () | return {
'total_by_gpu': b[0, :],
'max_by_gpu': b[1, :],
'total': np.sum(b[0, :]),
'max_total': np.sum(b[1, :])
} | Get GPU memory usage stats from CUDAContext/HIPContext. This requires flag
--caffe2_gpu_memory_tracking to be enabled | Get GPU memory usage stats from CUDAContext/HIPContext. This requires flag
--caffe2_gpu_memory_tracking to be enabled | [
"Get",
"GPU",
"memory",
"usage",
"stats",
"from",
"CUDAContext",
"/",
"HIPContext",
".",
"This",
"requires",
"flag",
"--",
"caffe2_gpu_memory_tracking",
"to",
"be",
"enabled"
] | def GetGPUMemoryUsageStats():
"""Get GPU memory usage stats from CUDAContext/HIPContext. This requires flag
--caffe2_gpu_memory_tracking to be enabled"""
from caffe2.python import workspace, core
workspace.RunOperatorOnce(
core.CreateOperator(
"GetGPUMemoryUsage",
[],
... | [
"def",
"GetGPUMemoryUsageStats",
"(",
")",
":",
"from",
"caffe2",
".",
"python",
"import",
"workspace",
",",
"core",
"workspace",
".",
"RunOperatorOnce",
"(",
"core",
".",
"CreateOperator",
"(",
"\"GetGPUMemoryUsage\"",
",",
"[",
"]",
",",
"[",
"\"____mem____\""... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/utils.py#L246-L264 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/extending.py | python | type_callable | (func) | return decorate | Decorate a function as implementing typing for the callable *func*.
*func* can be a callable object (probably a global) or a string
denoting a built-in operation (such 'getitem' or '__array_wrap__') | Decorate a function as implementing typing for the callable *func*.
*func* can be a callable object (probably a global) or a string
denoting a built-in operation (such 'getitem' or '__array_wrap__') | [
"Decorate",
"a",
"function",
"as",
"implementing",
"typing",
"for",
"the",
"callable",
"*",
"func",
"*",
".",
"*",
"func",
"*",
"can",
"be",
"a",
"callable",
"object",
"(",
"probably",
"a",
"global",
")",
"or",
"a",
"string",
"denoting",
"a",
"built",
... | def type_callable(func):
"""
Decorate a function as implementing typing for the callable *func*.
*func* can be a callable object (probably a global) or a string
denoting a built-in operation (such 'getitem' or '__array_wrap__')
"""
from .typing.templates import CallableTemplate, infer, infer_glo... | [
"def",
"type_callable",
"(",
"func",
")",
":",
"from",
".",
"typing",
".",
"templates",
"import",
"CallableTemplate",
",",
"infer",
",",
"infer_global",
"if",
"not",
"callable",
"(",
"func",
")",
"and",
"not",
"isinstance",
"(",
"func",
",",
"str",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/extending.py#L22-L49 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibar.py | python | AuiToolBarItem.GetKind | (self) | return self.kind | Returns the toolbar item kind.
See :meth:`SetKind` for more details. | Returns the toolbar item kind. | [
"Returns",
"the",
"toolbar",
"item",
"kind",
"."
] | def GetKind(self):
"""
Returns the toolbar item kind.
See :meth:`SetKind` for more details.
"""
return self.kind | [
"def",
"GetKind",
"(",
"self",
")",
":",
"return",
"self",
".",
"kind"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L392-L399 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextObject.DoSplit | (*args, **kwargs) | return _richtext.RichTextObject_DoSplit(*args, **kwargs) | DoSplit(self, long pos) -> RichTextObject | DoSplit(self, long pos) -> RichTextObject | [
"DoSplit",
"(",
"self",
"long",
"pos",
")",
"-",
">",
"RichTextObject"
] | def DoSplit(*args, **kwargs):
"""DoSplit(self, long pos) -> RichTextObject"""
return _richtext.RichTextObject_DoSplit(*args, **kwargs) | [
"def",
"DoSplit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObject_DoSplit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1206-L1208 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/contrib/socks.py | python | SOCKSConnection._new_conn | (self) | return conn | Establish a new connection via the SOCKS proxy. | Establish a new connection via the SOCKS proxy. | [
"Establish",
"a",
"new",
"connection",
"via",
"the",
"SOCKS",
"proxy",
"."
] | def _new_conn(self):
"""
Establish a new connection via the SOCKS proxy.
"""
extra_kw = {}
if self.source_address:
extra_kw["source_address"] = self.source_address
if self.socket_options:
extra_kw["socket_options"] = self.socket_options
t... | [
"def",
"_new_conn",
"(",
"self",
")",
":",
"extra_kw",
"=",
"{",
"}",
"if",
"self",
".",
"source_address",
":",
"extra_kw",
"[",
"\"source_address\"",
"]",
"=",
"self",
".",
"source_address",
"if",
"self",
".",
"socket_options",
":",
"extra_kw",
"[",
"\"so... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/contrib/socks.py#L78-L134 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/node/base.py | python | Node.Preorder | (self) | Generator that generates first this node, then the same generator for
any child nodes. | Generator that generates first this node, then the same generator for
any child nodes. | [
"Generator",
"that",
"generates",
"first",
"this",
"node",
"then",
"the",
"same",
"generator",
"for",
"any",
"child",
"nodes",
"."
] | def Preorder(self):
'''Generator that generates first this node, then the same generator for
any child nodes.'''
yield self
for child in self.children:
for iterchild in child.Preorder():
yield iterchild | [
"def",
"Preorder",
"(",
"self",
")",
":",
"yield",
"self",
"for",
"child",
"in",
"self",
".",
"children",
":",
"for",
"iterchild",
"in",
"child",
".",
"Preorder",
"(",
")",
":",
"yield",
"iterchild"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/node/base.py#L61-L67 | ||
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/faster-rcnn/lib/datasets/coco.py | python | coco._roidb_from_proposals | (self, method) | return roidb | Creates a roidb from pre-computed proposals of a particular methods. | Creates a roidb from pre-computed proposals of a particular methods. | [
"Creates",
"a",
"roidb",
"from",
"pre",
"-",
"computed",
"proposals",
"of",
"a",
"particular",
"methods",
"."
] | def _roidb_from_proposals(self, method):
"""
Creates a roidb from pre-computed proposals of a particular methods.
"""
top_k = self.config['top_k']
cache_file = osp.join(self.cache_path, self.name +
'_{:s}_top{:d}'.format(method, top_k) +
... | [
"def",
"_roidb_from_proposals",
"(",
"self",
",",
"method",
")",
":",
"top_k",
"=",
"self",
".",
"config",
"[",
"'top_k'",
"]",
"cache_file",
"=",
"osp",
".",
"join",
"(",
"self",
".",
"cache_path",
",",
"self",
".",
"name",
"+",
"'_{:s}_top{:d}'",
".",
... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/faster-rcnn/lib/datasets/coco.py#L132-L159 | |
pirobot/rbx2 | 2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a | rbx2_utils/src/rbx2_utils/srv/_KillProcess.py | python | KillProcessResponse.serialize | (self, buff) | serialize message into buffer
:param buff: buffer, ``StringIO`` | serialize message into buffer
:param buff: buffer, ``StringIO`` | [
"serialize",
"message",
"into",
"buffer",
":",
"param",
"buff",
":",
"buffer",
"StringIO"
] | def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
buff.write(_struct_B.pack(self.success))
except struct.error as se: self._check_types(se)
except TypeError as te: self._check_types(te) | [
"def",
"serialize",
"(",
"self",
",",
"buff",
")",
":",
"try",
":",
"buff",
".",
"write",
"(",
"_struct_B",
".",
"pack",
"(",
"self",
".",
"success",
")",
")",
"except",
"struct",
".",
"error",
"as",
"se",
":",
"self",
".",
"_check_types",
"(",
"se... | https://github.com/pirobot/rbx2/blob/2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a/rbx2_utils/src/rbx2_utils/srv/_KillProcess.py#L167-L175 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/inspect_utils.py | python | getnamespace | (f) | return namespace | Returns the complete namespace of a function.
Namespace is defined here as the mapping of all non-local variables to values.
This includes the globals and the closure variables. Note that this captures
the entire globals collection of the function, and may contain extra symbols
that it does not actually use.
... | Returns the complete namespace of a function. | [
"Returns",
"the",
"complete",
"namespace",
"of",
"a",
"function",
"."
] | def getnamespace(f):
"""Returns the complete namespace of a function.
Namespace is defined here as the mapping of all non-local variables to values.
This includes the globals and the closure variables. Note that this captures
the entire globals collection of the function, and may contain extra symbols
that i... | [
"def",
"getnamespace",
"(",
"f",
")",
":",
"namespace",
"=",
"dict",
"(",
"six",
".",
"get_function_globals",
"(",
"f",
")",
")",
"closure",
"=",
"six",
".",
"get_function_closure",
"(",
"f",
")",
"freevars",
"=",
"six",
".",
"get_function_code",
"(",
"f... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/inspect_utils.py#L131-L150 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/mixed_precision/python/loss_scale_optimizer.py | python | LossScaleOptimizer.__init__ | (self, opt, loss_scale_manager) | Construct a loss scaling optimizer.
Args:
opt: The actual optimizer that will be used to compute and apply the
gradients. Must be an implementation of the
`tf.compat.v1.train.Optimizer` interface.
loss_scale_manager: A LossScaleManager object. | Construct a loss scaling optimizer. | [
"Construct",
"a",
"loss",
"scaling",
"optimizer",
"."
] | def __init__(self, opt, loss_scale_manager):
"""Construct a loss scaling optimizer.
Args:
opt: The actual optimizer that will be used to compute and apply the
gradients. Must be an implementation of the
`tf.compat.v1.train.Optimizer` interface.
loss_scale_manager: A LossScaleManager... | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"loss_scale_manager",
")",
":",
"self",
".",
"_opt",
"=",
"opt",
"self",
".",
"_loss_scale_manager",
"=",
"loss_scale_manager"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/mixed_precision/python/loss_scale_optimizer.py#L102-L112 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2_GetCommandAuditDigest_REQUEST.initFromTpm | (self, buf) | TpmMarshaller method | TpmMarshaller method | [
"TpmMarshaller",
"method"
] | def initFromTpm(self, buf):
""" TpmMarshaller method """
self.qualifyingData = buf.readSizedByteBuf()
inSchemeScheme = buf.readShort()
self.inScheme = UnionFactory.create('TPMU_SIG_SCHEME', inSchemeScheme)
self.inScheme.initFromTpm(buf) | [
"def",
"initFromTpm",
"(",
"self",
",",
"buf",
")",
":",
"self",
".",
"qualifyingData",
"=",
"buf",
".",
"readSizedByteBuf",
"(",
")",
"inSchemeScheme",
"=",
"buf",
".",
"readShort",
"(",
")",
"self",
".",
"inScheme",
"=",
"UnionFactory",
".",
"create",
... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L12911-L12916 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | Font.GetWeight | (*args, **kwargs) | return _gdi_.Font_GetWeight(*args, **kwargs) | GetWeight(self) -> int
Gets the font weight. | GetWeight(self) -> int | [
"GetWeight",
"(",
"self",
")",
"-",
">",
"int"
] | def GetWeight(*args, **kwargs):
"""
GetWeight(self) -> int
Gets the font weight.
"""
return _gdi_.Font_GetWeight(*args, **kwargs) | [
"def",
"GetWeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_GetWeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L2218-L2224 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/directnotify/Notifier.py | python | Notifier.error | (self, errorString, exception=Exception) | Raise an exception with given string and optional type:
Exception: error | Raise an exception with given string and optional type:
Exception: error | [
"Raise",
"an",
"exception",
"with",
"given",
"string",
"and",
"optional",
"type",
":",
"Exception",
":",
"error"
] | def error(self, errorString, exception=Exception):
"""
Raise an exception with given string and optional type:
Exception: error
"""
message = str(errorString)
if Notifier.showTime.getValue():
string = (self.getTime() + str(exception) + ": " + self.__name + "(e... | [
"def",
"error",
"(",
"self",
",",
"errorString",
",",
"exception",
"=",
"Exception",
")",
":",
"message",
"=",
"str",
"(",
"errorString",
")",
"if",
"Notifier",
".",
"showTime",
".",
"getValue",
"(",
")",
":",
"string",
"=",
"(",
"self",
".",
"getTime"... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/directnotify/Notifier.py#L119-L130 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_vim.py | python | EditraCommander.ShowCommandBar | (self) | Open the command bar for the user to enter commands | Open the command bar for the user to enter commands | [
"Open",
"the",
"command",
"bar",
"for",
"the",
"user",
"to",
"enter",
"commands"
] | def ShowCommandBar(self):
"""Open the command bar for the user to enter commands"""
self.stc.ShowCommandBar() | [
"def",
"ShowCommandBar",
"(",
"self",
")",
":",
"self",
".",
"stc",
".",
"ShowCommandBar",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_vim.py#L850-L852 | ||
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | 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/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L1408-L1480 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/TorsionFingerprints.py | python | CalculateTFD | (torsions1, torsions2, weights=None) | return tfd | Calculate the torsion deviation fingerprint (TFD) given two lists of
torsion angles.
Arguments:
- torsions1: torsion angles of conformation 1
- torsions2: torsion angles of conformation 2
- weights: list of torsion weights (default: None)
Return: TFD value (float) | Calculate the torsion deviation fingerprint (TFD) given two lists of
torsion angles. | [
"Calculate",
"the",
"torsion",
"deviation",
"fingerprint",
"(",
"TFD",
")",
"given",
"two",
"lists",
"of",
"torsion",
"angles",
"."
] | def CalculateTFD(torsions1, torsions2, weights=None):
""" Calculate the torsion deviation fingerprint (TFD) given two lists of
torsion angles.
Arguments:
- torsions1: torsion angles of conformation 1
- torsions2: torsion angles of conformation 2
- weights: list of torsion weights (... | [
"def",
"CalculateTFD",
"(",
"torsions1",
",",
"torsions2",
",",
"weights",
"=",
"None",
")",
":",
"if",
"len",
"(",
"torsions1",
")",
"!=",
"len",
"(",
"torsions2",
")",
":",
"raise",
"ValueError",
"(",
"\"List of torsions angles must have the same size.\"",
")"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/TorsionFingerprints.py#L470-L507 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/framework/sparse_tensor.py | python | SparseTensor.values | (self) | return self._values | The non-zero values in the represented dense tensor.
Returns:
A 1-D Tensor of any data type. | The non-zero values in the represented dense tensor. | [
"The",
"non",
"-",
"zero",
"values",
"in",
"the",
"represented",
"dense",
"tensor",
"."
] | def values(self):
"""The non-zero values in the represented dense tensor.
Returns:
A 1-D Tensor of any data type.
"""
return self._values | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"self",
".",
"_values"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/sparse_tensor.py#L161-L167 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py | python | _GetMSVSConfigurationType | (spec, build_file) | return config_type | Returns the configuration type for this project.
It's a number defined by Microsoft. May raise an exception.
Args:
spec: The target dictionary containing the properties of the target.
build_file: The path of the gyp file.
Returns:
An integer, the configuration type. | Returns the configuration type for this project. | [
"Returns",
"the",
"configuration",
"type",
"for",
"this",
"project",
"."
] | def _GetMSVSConfigurationType(spec, build_file):
"""Returns the configuration type for this project.
It's a number defined by Microsoft. May raise an exception.
Args:
spec: The target dictionary containing the properties of the target.
build_file: The path of the gyp file.
Returns:
An integ... | [
"def",
"_GetMSVSConfigurationType",
"(",
"spec",
",",
"build_file",
")",
":",
"try",
":",
"config_type",
"=",
"{",
"'executable'",
":",
"'1'",
",",
"# .exe",
"'shared_library'",
":",
"'2'",
",",
"# .dll",
"'loadable_module'",
":",
"'2'",
",",
"# .dll",
"'stati... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/msvs.py#L983-L1010 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/internal/decoder.py | python | _RaiseInvalidWireType | (buffer, pos, end) | Skip function for unknown wire types. Raises an exception. | Skip function for unknown wire types. Raises an exception. | [
"Skip",
"function",
"for",
"unknown",
"wire",
"types",
".",
"Raises",
"an",
"exception",
"."
] | def _RaiseInvalidWireType(buffer, pos, end):
"""Skip function for unknown wire types. Raises an exception."""
raise _DecodeError('Tag had invalid wire type.') | [
"def",
"_RaiseInvalidWireType",
"(",
"buffer",
",",
"pos",
",",
"end",
")",
":",
"raise",
"_DecodeError",
"(",
"'Tag had invalid wire type.'",
")"
] | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/decoder.py#L817-L820 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/_internal.py | python | _ctypes.shape_as | (self, obj) | return (obj*self._arr.ndim)(*self._arr.shape) | Return the shape tuple as an array of some other c-types
type. For example: ``self.shape_as(ctypes.c_short)``. | Return the shape tuple as an array of some other c-types
type. For example: ``self.shape_as(ctypes.c_short)``. | [
"Return",
"the",
"shape",
"tuple",
"as",
"an",
"array",
"of",
"some",
"other",
"c",
"-",
"types",
"type",
".",
"For",
"example",
":",
"self",
".",
"shape_as",
"(",
"ctypes",
".",
"c_short",
")",
"."
] | def shape_as(self, obj):
"""
Return the shape tuple as an array of some other c-types
type. For example: ``self.shape_as(ctypes.c_short)``.
"""
if self._zerod:
return None
return (obj*self._arr.ndim)(*self._arr.shape) | [
"def",
"shape_as",
"(",
"self",
",",
"obj",
")",
":",
"if",
"self",
".",
"_zerod",
":",
"return",
"None",
"return",
"(",
"obj",
"*",
"self",
".",
"_arr",
".",
"ndim",
")",
"(",
"*",
"self",
".",
"_arr",
".",
"shape",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/_internal.py#L287-L294 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/http/cookies.py | python | BaseCookie.__set | (self, key, real_value, coded_value) | Private method for setting a cookie's value | Private method for setting a cookie's value | [
"Private",
"method",
"for",
"setting",
"a",
"cookie",
"s",
"value"
] | def __set(self, key, real_value, coded_value):
"""Private method for setting a cookie's value"""
M = self.get(key, Morsel())
M.set(key, real_value, coded_value)
dict.__setitem__(self, key, M) | [
"def",
"__set",
"(",
"self",
",",
"key",
",",
"real_value",
",",
"coded_value",
")",
":",
"M",
"=",
"self",
".",
"get",
"(",
"key",
",",
"Morsel",
"(",
")",
")",
"M",
".",
"set",
"(",
"key",
",",
"real_value",
",",
"coded_value",
")",
"dict",
"."... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/http/cookies.py#L482-L486 | ||
MTG/gaia | 0f7214dbdec6f9b651ca34211824841ffba0bc77 | src/doc/doxy2swig.py | python | Doxy2SWIG.parse_Element | (self, node) | Parse an `ELEMENT_NODE`. This calls specific
`do_<tagName>` handers for different elements. If no handler
is available the `subnode_parse` method is called. All
tagNames specified in `self.ignores` are simply ignored. | Parse an `ELEMENT_NODE`. This calls specific
`do_<tagName>` handers for different elements. If no handler
is available the `subnode_parse` method is called. All
tagNames specified in `self.ignores` are simply ignored. | [
"Parse",
"an",
"ELEMENT_NODE",
".",
"This",
"calls",
"specific",
"do_<tagName",
">",
"handers",
"for",
"different",
"elements",
".",
"If",
"no",
"handler",
"is",
"available",
"the",
"subnode_parse",
"method",
"is",
"called",
".",
"All",
"tagNames",
"specified",
... | def parse_Element(self, node):
"""Parse an `ELEMENT_NODE`. This calls specific
`do_<tagName>` handers for different elements. If no handler
is available the `subnode_parse` method is called. All
tagNames specified in `self.ignores` are simply ignored.
"""
name = node.... | [
"def",
"parse_Element",
"(",
"self",
",",
"node",
")",
":",
"name",
"=",
"node",
".",
"tagName",
"ignores",
"=",
"self",
".",
"ignores",
"if",
"name",
"in",
"ignores",
":",
"return",
"attr",
"=",
"\"do_%s\"",
"%",
"name",
"if",
"hasattr",
"(",
"self",
... | https://github.com/MTG/gaia/blob/0f7214dbdec6f9b651ca34211824841ffba0bc77/src/doc/doxy2swig.py#L202-L218 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/Messenger.py | python | Messenger.find | (self, needle) | return a matching event (needle) if found (in haystack).
This is primarily a debugging tool. | return a matching event (needle) if found (in haystack).
This is primarily a debugging tool. | [
"return",
"a",
"matching",
"event",
"(",
"needle",
")",
"if",
"found",
"(",
"in",
"haystack",
")",
".",
"This",
"is",
"primarily",
"a",
"debugging",
"tool",
"."
] | def find(self, needle):
"""
return a matching event (needle) if found (in haystack).
This is primarily a debugging tool.
"""
keys = list(self.__callbacks.keys())
keys.sort()
for event in keys:
if repr(event).find(needle) >= 0:
return {e... | [
"def",
"find",
"(",
"self",
",",
"needle",
")",
":",
"keys",
"=",
"list",
"(",
"self",
".",
"__callbacks",
".",
"keys",
"(",
")",
")",
"keys",
".",
"sort",
"(",
")",
"for",
"event",
"in",
"keys",
":",
"if",
"repr",
"(",
"event",
")",
".",
"find... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/Messenger.py#L538-L547 | ||
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | python/examples/visibilityplanning.py | python | run | (args=None) | Command-line execution of the example.
:param args: arguments for script to parse, if not specified will use sys.argv | Command-line execution of the example. | [
"Command",
"-",
"line",
"execution",
"of",
"the",
"example",
"."
] | def run(args=None):
"""Command-line execution of the example.
:param args: arguments for script to parse, if not specified will use sys.argv
"""
parser = OptionParser(description='Visibility Planning Module.')
OpenRAVEGlobalArguments.addOptions(parser)
parser.add_option('--scene',action="store"... | [
"def",
"run",
"(",
"args",
"=",
"None",
")",
":",
"parser",
"=",
"OptionParser",
"(",
"description",
"=",
"'Visibility Planning Module.'",
")",
"OpenRAVEGlobalArguments",
".",
"addOptions",
"(",
"parser",
")",
"parser",
".",
"add_option",
"(",
"'--scene'",
",",
... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/examples/visibilityplanning.py#L417-L429 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/bccache.py | python | Bucket.load_bytecode | (self, f) | Loads bytecode from a file or file like object. | Loads bytecode from a file or file like object. | [
"Loads",
"bytecode",
"from",
"a",
"file",
"or",
"file",
"like",
"object",
"."
] | def load_bytecode(self, f):
"""Loads bytecode from a file or file like object."""
# make sure the magic header is correct
magic = f.read(len(bc_magic))
if magic != bc_magic:
self.reset()
return
# the source code of the file changed, we need to reload
... | [
"def",
"load_bytecode",
"(",
"self",
",",
"f",
")",
":",
"# make sure the magic header is correct",
"magic",
"=",
"f",
".",
"read",
"(",
"len",
"(",
"bc_magic",
")",
")",
"if",
"magic",
"!=",
"bc_magic",
":",
"self",
".",
"reset",
"(",
")",
"return",
"# ... | 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/bccache.py#L79-L96 | ||
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_parser.py | python | p_tsyms_tsym | (p) | tsyms : var | tsyms : var | [
"tsyms",
":",
"var"
] | def p_tsyms_tsym(p):
'tsyms : var'
p[0] = [p[1]] | [
"def",
"p_tsyms_tsym",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"p",
"[",
"1",
"]",
"]"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L1340-L1342 | ||
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/cpplint.py | python | FindNextMultiLineCommentStart | (lines, lineix) | return len(lines) | Find the beginning marker for a multiline comment. | Find the beginning marker for a multiline comment. | [
"Find",
"the",
"beginning",
"marker",
"for",
"a",
"multiline",
"comment",
"."
] | def FindNextMultiLineCommentStart(lines, lineix):
"""Find the beginning marker for a multiline comment."""
while lineix < len(lines):
if lines[lineix].strip().startswith('/*'):
# Only return this marker if the comment goes beyond this line
if lines[lineix].strip().find('*/', 2) < 0:
return l... | [
"def",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
":",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"if",
"lines",
"[",
"lineix",
"]",
".",
"strip",
"(",
")",
".",
"startswith",
"(",
"'/*'",
")",
":",
"# Only return this... | https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L959-L967 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/client/timeline.py | python | Timeline._alloc_pid | (self) | return pid | Allocate a process Id. | Allocate a process Id. | [
"Allocate",
"a",
"process",
"Id",
"."
] | def _alloc_pid(self):
"""Allocate a process Id."""
pid = self._next_pid
self._next_pid += 1
return pid | [
"def",
"_alloc_pid",
"(",
"self",
")",
":",
"pid",
"=",
"self",
".",
"_next_pid",
"self",
".",
"_next_pid",
"+=",
"1",
"return",
"pid"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/client/timeline.py#L374-L378 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/stata.py | python | StataStrLWriter.generate_blob | (self, gso_table: dict[str, tuple[int, int]]) | return bio.getvalue() | Generates the binary blob of GSOs that is written to the dta file.
Parameters
----------
gso_table : dict
Ordered dictionary (str, vo)
Returns
-------
gso : bytes
Binary content of dta file to be placed between strl tags
Notes
--... | Generates the binary blob of GSOs that is written to the dta file. | [
"Generates",
"the",
"binary",
"blob",
"of",
"GSOs",
"that",
"is",
"written",
"to",
"the",
"dta",
"file",
"."
] | def generate_blob(self, gso_table: dict[str, tuple[int, int]]) -> bytes:
"""
Generates the binary blob of GSOs that is written to the dta file.
Parameters
----------
gso_table : dict
Ordered dictionary (str, vo)
Returns
-------
gso : bytes
... | [
"def",
"generate_blob",
"(",
"self",
",",
"gso_table",
":",
"dict",
"[",
"str",
",",
"tuple",
"[",
"int",
",",
"int",
"]",
"]",
")",
"->",
"bytes",
":",
"# Format information",
"# Length includes null term",
"# 117",
"# GSOvvvvooootllllxxxxxxxxxxxxxxx...x",
"# 3 ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/stata.py#L2929-L2990 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/re2/lib/codereview/codereview.py | python | submit | (ui, repo, *pats, **opts) | return None | submit change to remote repository
Submits change to remote repository.
Bails out if the local repository is not in sync with the remote one. | submit change to remote repository | [
"submit",
"change",
"to",
"remote",
"repository"
] | def submit(ui, repo, *pats, **opts):
"""submit change to remote repository
Submits change to remote repository.
Bails out if the local repository is not in sync with the remote one.
"""
if codereview_disabled:
return codereview_disabled
# We already called this on startup but sometimes Mercurial forgets.
set... | [
"def",
"submit",
"(",
"ui",
",",
"repo",
",",
"*",
"pats",
",",
"*",
"*",
"opts",
")",
":",
"if",
"codereview_disabled",
":",
"return",
"codereview_disabled",
"# We already called this on startup but sometimes Mercurial forgets.",
"set_mercurial_encoding_to_utf8",
"(",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/re2/lib/codereview/codereview.py#L1886-L2013 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/s3/inject.py | python | object_upload_file | (self, Filename,
ExtraArgs=None, Callback=None, Config=None) | return self.meta.client.upload_file(
Filename=Filename, Bucket=self.bucket_name, Key=self.key,
ExtraArgs=ExtraArgs, Callback=Callback, Config=Config) | Upload a file to an S3 object.
Usage::
import boto3
s3 = boto3.resource('s3')
s3.Object('mybucket', 'hello.txt').upload_file('/tmp/hello.txt')
Similar behavior as S3Transfer's upload_file() method,
except that parameters are capitalized. Detailed examples can be found at
:ref:... | Upload a file to an S3 object. | [
"Upload",
"a",
"file",
"to",
"an",
"S3",
"object",
"."
] | def object_upload_file(self, Filename,
ExtraArgs=None, Callback=None, Config=None):
"""Upload a file to an S3 object.
Usage::
import boto3
s3 = boto3.resource('s3')
s3.Object('mybucket', 'hello.txt').upload_file('/tmp/hello.txt')
Similar behavior as S3Transf... | [
"def",
"object_upload_file",
"(",
"self",
",",
"Filename",
",",
"ExtraArgs",
"=",
"None",
",",
"Callback",
"=",
"None",
",",
"Config",
"=",
"None",
")",
":",
"return",
"self",
".",
"meta",
".",
"client",
".",
"upload_file",
"(",
"Filename",
"=",
"Filenam... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/s3/inject.py#L249-L280 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | PageSetupDialogData.GetPaperSize | (*args, **kwargs) | return _windows_.PageSetupDialogData_GetPaperSize(*args, **kwargs) | GetPaperSize(self) -> Size | GetPaperSize(self) -> Size | [
"GetPaperSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def GetPaperSize(*args, **kwargs):
"""GetPaperSize(self) -> Size"""
return _windows_.PageSetupDialogData_GetPaperSize(*args, **kwargs) | [
"def",
"GetPaperSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_GetPaperSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L4934-L4936 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | StopWatch.Start | (*args, **kwargs) | return _misc_.StopWatch_Start(*args, **kwargs) | Start(self, long t0=0) | Start(self, long t0=0) | [
"Start",
"(",
"self",
"long",
"t0",
"=",
"0",
")"
] | def Start(*args, **kwargs):
"""Start(self, long t0=0)"""
return _misc_.StopWatch_Start(*args, **kwargs) | [
"def",
"Start",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"StopWatch_Start",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L883-L885 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiToolBar.GetHintSize | (*args, **kwargs) | return _aui.AuiToolBar_GetHintSize(*args, **kwargs) | GetHintSize(self, int dockDirection) -> Size | GetHintSize(self, int dockDirection) -> Size | [
"GetHintSize",
"(",
"self",
"int",
"dockDirection",
")",
"-",
">",
"Size"
] | def GetHintSize(*args, **kwargs):
"""GetHintSize(self, int dockDirection) -> Size"""
return _aui.AuiToolBar_GetHintSize(*args, **kwargs) | [
"def",
"GetHintSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_GetHintSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L2254-L2256 | |
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/predictor/python/run.py | python | predict | () | Route for prediction, should be called after setup to choose the model to predict
CURL format:
curl -X POST -F file=@/path/to/encoded/data 'https://127.0.0.1:5000/predict'
:return: a jsonified result
{
'pred_startup': 'xxx',
'pred_total': 'xxx',
'successful': ... | Route for prediction, should be called after setup to choose the model to predict
CURL format:
curl -X POST -F file=@/path/to/encoded/data 'https://127.0.0.1:5000/predict'
:return: a jsonified result
{
'pred_startup': 'xxx',
'pred_total': 'xxx',
'successful': ... | [
"Route",
"for",
"prediction",
"should",
"be",
"called",
"after",
"setup",
"to",
"choose",
"the",
"model",
"to",
"predict",
"CURL",
"format",
":",
"curl",
"-",
"X",
"POST",
"-",
"F",
"file",
"=",
"@",
"/",
"path",
"/",
"to",
"/",
"encoded",
"/",
"data... | def predict():
'''
Route for prediction, should be called after setup to choose the model to predict
CURL format:
curl -X POST -F file=@/path/to/encoded/data 'https://127.0.0.1:5000/predict'
:return: a jsonified result
{
'pred_startup': 'xxx',
'pred_total': 'xxx',... | [
"def",
"predict",
"(",
")",
":",
"global",
"running",
"global",
"loaded_model",
"global",
"req_logger",
"global",
"model_logger",
"if",
"request",
".",
"method",
"==",
"'POST'",
":",
"if",
"not",
"(",
"loaded_model",
"and",
"running",
"==",
"1",
")",
":",
... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/predictor/python/run.py#L259-L326 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/backend.py | python | conv2d_transpose | (x,
kernel,
output_shape,
strides=(1, 1),
padding='valid',
data_format=None,
dilation_rate=(1, 1)) | return x | 2D deconvolution (i.e.
transposed convolution).
Args:
x: Tensor or variable.
kernel: kernel tensor.
output_shape: 1D int tensor for the output shape.
strides: strides tuple.
padding: string, `"same"` or `"valid"`.
data_format: string, `"channels_last"` or `"channels_first"`.
... | 2D deconvolution (i.e. | [
"2D",
"deconvolution",
"(",
"i",
".",
"e",
"."
] | def conv2d_transpose(x,
kernel,
output_shape,
strides=(1, 1),
padding='valid',
data_format=None,
dilation_rate=(1, 1)):
"""2D deconvolution (i.e.
transposed convolution).
Args:
x: ... | [
"def",
"conv2d_transpose",
"(",
"x",
",",
"kernel",
",",
"output_shape",
",",
"strides",
"=",
"(",
"1",
",",
"1",
")",
",",
"padding",
"=",
"'valid'",
",",
"data_format",
"=",
"None",
",",
"dilation_rate",
"=",
"(",
"1",
",",
"1",
")",
")",
":",
"i... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/backend.py#L5351-L5420 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/ltisys.py | python | LinearTimeInvariant.__new__ | (cls, *system, **kwargs) | return super(LinearTimeInvariant, cls).__new__(cls) | Create a new object, don't allow direct instances. | Create a new object, don't allow direct instances. | [
"Create",
"a",
"new",
"object",
"don",
"t",
"allow",
"direct",
"instances",
"."
] | def __new__(cls, *system, **kwargs):
"""Create a new object, don't allow direct instances."""
if cls is LinearTimeInvariant:
raise NotImplementedError('The LinearTimeInvariant class is not '
'meant to be used directly, use `lti` '
... | [
"def",
"__new__",
"(",
"cls",
",",
"*",
"system",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"cls",
"is",
"LinearTimeInvariant",
":",
"raise",
"NotImplementedError",
"(",
"'The LinearTimeInvariant class is not '",
"'meant to be used directly, use `lti` '",
"'or `dlti` ins... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/ltisys.py#L50-L56 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Validation/RecoTrack/python/plotting/ntupleDataFormat.py | python | TrackMatchInfo.__getattr__ | (self, attr) | return lambda: val | Custom __getattr__ because of the second index needed to access the branch.
Note that when mapping the 'attr' to a branch, a 'trk' is
prepended and the first letter of 'attr' is turned to upper
case. | Custom __getattr__ because of the second index needed to access the branch. | [
"Custom",
"__getattr__",
"because",
"of",
"the",
"second",
"index",
"needed",
"to",
"access",
"the",
"branch",
"."
] | def __getattr__(self, attr):
"""Custom __getattr__ because of the second index needed to access the branch.
Note that when mapping the 'attr' to a branch, a 'trk' is
prepended and the first letter of 'attr' is turned to upper
case.
"""
val = super(TrackMatchInfo, self)._... | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"val",
"=",
"super",
"(",
"TrackMatchInfo",
",",
"self",
")",
".",
"__getattr__",
"(",
"\"trk\"",
"+",
"attr",
"[",
"0",
"]",
".",
"upper",
"(",
")",
"+",
"attr",
"[",
"1",
":",
"]",
")",
... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/ntupleDataFormat.py#L629-L637 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/ceph-volume/ceph_volume/api/lvm.py | python | create_lv | (name_prefix,
uuid,
vg=None,
device=None,
slots=None,
extents=None,
size=None,
tags=None) | return lv | Create a Logical Volume in a Volume Group. Command looks like::
lvcreate -L 50G -n gfslv vg0
``name_prefix`` is required. If ``size`` is provided its expected to be a
byte count. Tags are an optional dictionary and is expected to
conform to the convention of prefixing them with "ceph." like::
... | Create a Logical Volume in a Volume Group. Command looks like:: | [
"Create",
"a",
"Logical",
"Volume",
"in",
"a",
"Volume",
"Group",
".",
"Command",
"looks",
"like",
"::"
] | def create_lv(name_prefix,
uuid,
vg=None,
device=None,
slots=None,
extents=None,
size=None,
tags=None):
"""
Create a Logical Volume in a Volume Group. Command looks like::
lvcreate -L 50G -n gfslv vg0
... | [
"def",
"create_lv",
"(",
"name_prefix",
",",
"uuid",
",",
"vg",
"=",
"None",
",",
"device",
"=",
"None",
",",
"slots",
"=",
"None",
",",
"extents",
"=",
"None",
",",
"size",
"=",
"None",
",",
"tags",
"=",
"None",
")",
":",
"name",
"=",
"'{}-{}'",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/ceph-volume/ceph_volume/api/lvm.py#L925-L1023 | |
taichi-dev/taichi | 973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6 | python/taichi/lang/snode.py | python | SNode.hash | (axes, dimensions) | Not supported. | Not supported. | [
"Not",
"supported",
"."
] | def hash(axes, dimensions):
# original code is #def hash(self,axes, dimensions) without #@staticmethod before fix pylint R0201
"""Not supported."""
raise RuntimeError('hash not yet supported') | [
"def",
"hash",
"(",
"axes",
",",
"dimensions",
")",
":",
"# original code is #def hash(self,axes, dimensions) without #@staticmethod before fix pylint R0201",
"raise",
"RuntimeError",
"(",
"'hash not yet supported'",
")"
] | https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/snode.py#L56-L59 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/scons/getversion.py | python | _GetRepository | () | Get a reference to the Git Repository.
Is there a cleaner option than searching from the current location? | Get a reference to the Git Repository.
Is there a cleaner option than searching from the current location? | [
"Get",
"a",
"reference",
"to",
"the",
"Git",
"Repository",
".",
"Is",
"there",
"a",
"cleaner",
"option",
"than",
"searching",
"from",
"the",
"current",
"location?"
] | def _GetRepository():
"""Get a reference to the Git Repository.
Is there a cleaner option than searching from the current location?"""
# The syntax is different between library versions (particularly,
# those used by Centos 6 vs Centos 7).
try:
return git.Repo('.', search_parent_directories=... | [
"def",
"_GetRepository",
"(",
")",
":",
"# The syntax is different between library versions (particularly,",
"# those used by Centos 6 vs Centos 7).",
"try",
":",
"return",
"git",
".",
"Repo",
"(",
"'.'",
",",
"search_parent_directories",
"=",
"True",
")",
"except",
"TypeEr... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/scons/getversion.py#L268-L276 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/isis_reduction_steps.py | python | Mask_ISIS.view | (self, instrum) | In MantidPlot this opens InstrumentView to display the masked
detectors in the bank in a different colour
@param instrum: a reference an instrument object to view | In MantidPlot this opens InstrumentView to display the masked
detectors in the bank in a different colour | [
"In",
"MantidPlot",
"this",
"opens",
"InstrumentView",
"to",
"display",
"the",
"masked",
"detectors",
"in",
"the",
"bank",
"in",
"a",
"different",
"colour"
] | def view(self, instrum):
"""
In MantidPlot this opens InstrumentView to display the masked
detectors in the bank in a different colour
@param instrum: a reference an instrument object to view
"""
wksp_name = 'CurrentMask'
instrum.load_empty(wksp_name)
... | [
"def",
"view",
"(",
"self",
",",
"instrum",
")",
":",
"wksp_name",
"=",
"'CurrentMask'",
"instrum",
".",
"load_empty",
"(",
"wksp_name",
")",
"# apply masking to the current detector",
"self",
".",
"execute",
"(",
"None",
",",
"wksp_name",
")",
"# now the other de... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reduction_steps.py#L1085-L1109 | ||
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/nn.py | python | relu6 | (x) | return minimum(maximum(x, 0), 6) | r"""Element-wise `min(max(x, 0), 6)`. | r"""Element-wise `min(max(x, 0), 6)`. | [
"r",
"Element",
"-",
"wise",
"min",
"(",
"max",
"(",
"x",
"0",
")",
"6",
")",
"."
] | def relu6(x):
r"""Element-wise `min(max(x, 0), 6)`."""
return minimum(maximum(x, 0), 6) | [
"def",
"relu6",
"(",
"x",
")",
":",
"return",
"minimum",
"(",
"maximum",
"(",
"x",
",",
"0",
")",
",",
"6",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/nn.py#L837-L839 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/cpplint_1.4.5/cpplint.py | python | CheckSpacingForFunctionCall | (filename, clean_lines, linenum, error) | Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks for the correctness of various spacing around function calls. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"around",
"function",
"calls",
"."
] | def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error):
"""Checks for the correctness of various spacing around function calls.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: T... | [
"def",
"CheckSpacingForFunctionCall",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Since function calls often occur inside if/for/while/switch",
"# expressions - which have th... | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L3177-L3251 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.setWhitespaceChars | ( self, chars ) | return self | Overrides the default whitespace chars | [] | def setWhitespaceChars( self, chars ):
"""
Overrides the default whitespace chars
"""
self.skipWhitespace = True
self.whiteChars = chars
self.copyDefaultWhiteChars = False
return self | [
"def",
"setWhitespaceChars",
"(",
"self",
",",
"chars",
")",
":",
"self",
".",
"skipWhitespace",
"=",
"True",
"self",
".",
"whiteChars",
"=",
"chars",
"self",
".",
"copyDefaultWhiteChars",
"=",
"False",
"return",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L4121-L4135 | ||
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | bindings/python/clang/cindex.py | python | Type.get_align | (self) | return conf.lib.clang_Type_getAlignOf(self) | Retrieve the alignment of the record. | Retrieve the alignment of the record. | [
"Retrieve",
"the",
"alignment",
"of",
"the",
"record",
"."
] | def get_align(self):
"""
Retrieve the alignment of the record.
"""
return conf.lib.clang_Type_getAlignOf(self) | [
"def",
"get_align",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Type_getAlignOf",
"(",
"self",
")"
] | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/bindings/python/clang/cindex.py#L2377-L2381 | |
christinaa/LLVM-VideoCore4 | 7773c3c9e5d22b785d4b96ed0acea37c8aa9c183 | bindings/python/llvm/object.py | python | Relocation.type_number | (self) | return lib.LLVMGetRelocationType(self) | The relocation type, as a long. | The relocation type, as a long. | [
"The",
"relocation",
"type",
"as",
"a",
"long",
"."
] | def type_number(self):
"""The relocation type, as a long."""
if self.expired:
raise Exception('Relocation instance has expired.')
return lib.LLVMGetRelocationType(self) | [
"def",
"type_number",
"(",
"self",
")",
":",
"if",
"self",
".",
"expired",
":",
"raise",
"Exception",
"(",
"'Relocation instance has expired.'",
")",
"return",
"lib",
".",
"LLVMGetRelocationType",
"(",
"self",
")"
] | https://github.com/christinaa/LLVM-VideoCore4/blob/7773c3c9e5d22b785d4b96ed0acea37c8aa9c183/bindings/python/llvm/object.py#L400-L405 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | bindings/python/htcondor/dags/dag.py | python | DAG.node_to_children | (self) | return {k: node.Nodes(v) for k, v in d.items()} | Return a dictionary that maps each node to a :class:`Nodes`
containing its children.
The :class:`Nodes` will be empty if the node has no children. | Return a dictionary that maps each node to a :class:`Nodes`
containing its children.
The :class:`Nodes` will be empty if the node has no children. | [
"Return",
"a",
"dictionary",
"that",
"maps",
"each",
"node",
"to",
"a",
":",
"class",
":",
"Nodes",
"containing",
"its",
"children",
".",
"The",
":",
"class",
":",
"Nodes",
"will",
"be",
"empty",
"if",
"the",
"node",
"has",
"no",
"children",
"."
] | def node_to_children(self) -> Dict[node.BaseNode, node.Nodes]:
"""
Return a dictionary that maps each node to a :class:`Nodes`
containing its children.
The :class:`Nodes` will be empty if the node has no children.
"""
d = {n: set() for n in self.nodes}
for parent,... | [
"def",
"node_to_children",
"(",
"self",
")",
"->",
"Dict",
"[",
"node",
".",
"BaseNode",
",",
"node",
".",
"Nodes",
"]",
":",
"d",
"=",
"{",
"n",
":",
"set",
"(",
")",
"for",
"n",
"in",
"self",
".",
"nodes",
"}",
"for",
"parent",
",",
"child",
... | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/bindings/python/htcondor/dags/dag.py#L332-L342 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/numpy_extension/_op.py | python | convolution | (data=None, weight=None, bias=None, kernel=None, stride=None, dilate=None,
pad=None, num_filter=1, num_group=1, workspace=1024, no_bias=False,
cudnn_tune=None, cudnn_off=False, layout=None) | return _mx_nd_npx.convolution(data=data, weight=weight, bias=bias, kernel=kernel,
stride=stride, dilate=dilate, pad=pad, num_filter=num_filter,
num_group=num_group, workspace=workspace, no_bias=no_bias,
cudnn_tune=cudn... | r"""Compute *N*-D convolution on *(N+2)*-D input.
In the 2-D convolution, given input data with shape *(batch_size,
channel, height, width)*, the output is computed by
.. math::
out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
weight[i,j,:,:]
where :math:`\star` is the... | r"""Compute *N*-D convolution on *(N+2)*-D input. | [
"r",
"Compute",
"*",
"N",
"*",
"-",
"D",
"convolution",
"on",
"*",
"(",
"N",
"+",
"2",
")",
"*",
"-",
"D",
"input",
"."
] | def convolution(data=None, weight=None, bias=None, kernel=None, stride=None, dilate=None,
pad=None, num_filter=1, num_group=1, workspace=1024, no_bias=False,
cudnn_tune=None, cudnn_off=False, layout=None):
r"""Compute *N*-D convolution on *(N+2)*-D input.
In the 2-D convolution,... | [
"def",
"convolution",
"(",
"data",
"=",
"None",
",",
"weight",
"=",
"None",
",",
"bias",
"=",
"None",
",",
"kernel",
"=",
"None",
",",
"stride",
"=",
"None",
",",
"dilate",
"=",
"None",
",",
"pad",
"=",
"None",
",",
"num_filter",
"=",
"1",
",",
"... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy_extension/_op.py#L463-L582 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/simpleapi.py | python | _gather_returns | (func_name, lhs, algm_obj, ignore_regex=None, inout=False) | Gather the return values and ensure they are in the
correct order as defined by the output properties and
return them as a tuple. If their is a single return
value it is returned on its own
:param func_name: The name of the calling function.
:param lhs: A 2-tuple that contains the nu... | Gather the return values and ensure they are in the
correct order as defined by the output properties and
return them as a tuple. If their is a single return
value it is returned on its own | [
"Gather",
"the",
"return",
"values",
"and",
"ensure",
"they",
"are",
"in",
"the",
"correct",
"order",
"as",
"defined",
"by",
"the",
"output",
"properties",
"and",
"return",
"them",
"as",
"a",
"tuple",
".",
"If",
"their",
"is",
"a",
"single",
"return",
"v... | def _gather_returns(func_name, lhs, algm_obj, ignore_regex=None, inout=False): # noqa: C901
"""Gather the return values and ensure they are in the
correct order as defined by the output properties and
return them as a tuple. If their is a single return
value it is returned on its own
:... | [
"def",
"_gather_returns",
"(",
"func_name",
",",
"lhs",
",",
"algm_obj",
",",
"ignore_regex",
"=",
"None",
",",
"inout",
"=",
"False",
")",
":",
"# noqa: C901",
"if",
"ignore_regex",
"is",
"None",
":",
"ignore_regex",
"=",
"[",
"]",
"import",
"re",
"def",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/simpleapi.py#L791-L879 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextBuffer.EndNumberedBullet | (*args, **kwargs) | return _richtext.RichTextBuffer_EndNumberedBullet(*args, **kwargs) | EndNumberedBullet(self) -> bool | EndNumberedBullet(self) -> bool | [
"EndNumberedBullet",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndNumberedBullet(*args, **kwargs):
"""EndNumberedBullet(self) -> bool"""
return _richtext.RichTextBuffer_EndNumberedBullet(*args, **kwargs) | [
"def",
"EndNumberedBullet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_EndNumberedBullet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2428-L2430 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/linalg/decomp.py | python | eig_banded | (a_band, lower=False, eigvals_only=False, overwrite_a_band=False,
select='a', select_range=None, max_ev=0, check_finite=True) | return w, v | Solve real symmetric or complex hermitian band matrix eigenvalue problem.
Find eigenvalues w and optionally right eigenvectors v of a::
a v[:,i] = w[i] v[:,i]
v.H v = identity
The matrix a is stored in a_band either in lower diagonal or upper
diagonal ordered form:
a_band[u + ... | Solve real symmetric or complex hermitian band matrix eigenvalue problem. | [
"Solve",
"real",
"symmetric",
"or",
"complex",
"hermitian",
"band",
"matrix",
"eigenvalue",
"problem",
"."
] | def eig_banded(a_band, lower=False, eigvals_only=False, overwrite_a_band=False,
select='a', select_range=None, max_ev=0, check_finite=True):
"""
Solve real symmetric or complex hermitian band matrix eigenvalue problem.
Find eigenvalues w and optionally right eigenvectors v of a::
a ... | [
"def",
"eig_banded",
"(",
"a_band",
",",
"lower",
"=",
"False",
",",
"eigvals_only",
"=",
"False",
",",
"overwrite_a_band",
"=",
"False",
",",
"select",
"=",
"'a'",
",",
"select_range",
"=",
"None",
",",
"max_ev",
"=",
"0",
",",
"check_finite",
"=",
"Tru... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/linalg/decomp.py#L448-L602 | |
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/experimental/file_dataset_ops.py | python | to_file | (dataset, filename) | return dataset.reduce(0, lambda x, y: x + y) | to_file | to_file | [
"to_file"
] | def to_file(dataset, filename):
"""to_file"""
resource = core_ops.io_file_init(filename)
dataset = dataset.map(lambda e: (e, tf.constant(False)))
dataset = dataset.concatenate(
tf.data.Dataset.from_tensor_slices([tf.constant([], tf.string)]).map(
lambda e: (e, tf.constant(True))
... | [
"def",
"to_file",
"(",
"dataset",
",",
"filename",
")",
":",
"resource",
"=",
"core_ops",
".",
"io_file_init",
"(",
"filename",
")",
"dataset",
"=",
"dataset",
".",
"map",
"(",
"lambda",
"e",
":",
"(",
"e",
",",
"tf",
".",
"constant",
"(",
"False",
"... | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/file_dataset_ops.py#L22-L37 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/platforms/compile_settings_clang.py | python | load_performance_clang_settings | (conf) | Setup all compiler/linker flags with are shared over all targets using the clang compiler
for the "performance" configuration | Setup all compiler/linker flags with are shared over all targets using the clang compiler
for the "performance" configuration | [
"Setup",
"all",
"compiler",
"/",
"linker",
"flags",
"with",
"are",
"shared",
"over",
"all",
"targets",
"using",
"the",
"clang",
"compiler",
"for",
"the",
"performance",
"configuration"
] | def load_performance_clang_settings(conf):
"""
Setup all compiler/linker flags with are shared over all targets using the clang compiler
for the "performance" configuration
"""
# v = conf.env
# load_clang_common_settings(conf)
# Moved to common.clang.json
"""
COMPILER_FLAGS = [
... | [
"def",
"load_performance_clang_settings",
"(",
"conf",
")",
":",
"# v = conf.env",
"# load_clang_common_settings(conf)",
"# Moved to common.clang.json",
"\"\"\"\n COMPILER_FLAGS = [\n '-O2',\n ]\n v['CFLAGS'] += COMPILER_FLAGS\n v['CXXFLAGS'] += COMPILER_FLAGS\n \"\"\"",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/platforms/compile_settings_clang.py#L216-L232 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/multi.py | python | MultiIndex.__reduce__ | (self) | return ibase._new_Index, (type(self), d), None | Necessary for making this object picklable | Necessary for making this object picklable | [
"Necessary",
"for",
"making",
"this",
"object",
"picklable"
] | def __reduce__(self):
"""Necessary for making this object picklable"""
d = {
"levels": list(self.levels),
"codes": list(self.codes),
"sortorder": self.sortorder,
"names": list(self.names),
}
return ibase._new_Index, (type(self), d), None | [
"def",
"__reduce__",
"(",
"self",
")",
":",
"d",
"=",
"{",
"\"levels\"",
":",
"list",
"(",
"self",
".",
"levels",
")",
",",
"\"codes\"",
":",
"list",
"(",
"self",
".",
"codes",
")",
",",
"\"sortorder\"",
":",
"self",
".",
"sortorder",
",",
"\"names\"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/multi.py#L2024-L2032 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/signaltools.py | python | lfiltic | (b, a, y, x=None) | return zi | Construct initial conditions for lfilter given input and output vectors.
Given a linear filter (b, a) and initial conditions on the output `y`
and the input `x`, return the initial conditions on the state vector zi
which is used by `lfilter` to generate the output given the input.
Parameters
-----... | Construct initial conditions for lfilter given input and output vectors. | [
"Construct",
"initial",
"conditions",
"for",
"lfilter",
"given",
"input",
"and",
"output",
"vectors",
"."
] | def lfiltic(b, a, y, x=None):
"""
Construct initial conditions for lfilter given input and output vectors.
Given a linear filter (b, a) and initial conditions on the output `y`
and the input `x`, return the initial conditions on the state vector zi
which is used by `lfilter` to generate the output ... | [
"def",
"lfiltic",
"(",
"b",
",",
"a",
",",
"y",
",",
"x",
"=",
"None",
")",
":",
"N",
"=",
"np",
".",
"size",
"(",
"a",
")",
"-",
"1",
"M",
"=",
"np",
".",
"size",
"(",
"b",
")",
"-",
"1",
"K",
"=",
"max",
"(",
"M",
",",
"N",
")",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/signaltools.py#L1385-L1450 | |
maidsafe-archive/MaidSafe | defd65e1c8cfb6a1cbdeaaa0eee31d065421792d | tools/cpplint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"cl... | https://github.com/maidsafe-archive/MaidSafe/blob/defd65e1c8cfb6a1cbdeaaa0eee31d065421792d/tools/cpplint.py#L584-L607 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/meta_graph.py | python | import_scoped_meta_graph | (meta_graph_or_file,
clear_devices=False,
graph=None,
import_scope=None,
input_map=None,
unbound_inputs_col_name="unbound_inputs",
restore_collect... | return import_scoped_meta_graph_with_return_elements(
meta_graph_or_file, clear_devices, graph, import_scope, input_map,
unbound_inputs_col_name, restore_collections_predicate)[0] | Recreates a `Graph` saved in a `MetaGraphDef` proto.
This function takes a `MetaGraphDef` protocol buffer as input. If
the argument is a file containing a `MetaGraphDef` protocol buffer ,
it constructs a protocol buffer from the file content. The function
then adds all the nodes from the `graph_def` field to t... | Recreates a `Graph` saved in a `MetaGraphDef` proto. | [
"Recreates",
"a",
"Graph",
"saved",
"in",
"a",
"MetaGraphDef",
"proto",
"."
] | def import_scoped_meta_graph(meta_graph_or_file,
clear_devices=False,
graph=None,
import_scope=None,
input_map=None,
unbound_inputs_col_name="unbound_inputs",
... | [
"def",
"import_scoped_meta_graph",
"(",
"meta_graph_or_file",
",",
"clear_devices",
"=",
"False",
",",
"graph",
"=",
"None",
",",
"import_scope",
"=",
"None",
",",
"input_map",
"=",
"None",
",",
"unbound_inputs_col_name",
"=",
"\"unbound_inputs\"",
",",
"restore_col... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/meta_graph.py#L654-L704 | |
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | tools/clang/bindings/python/clang/cindex.py | python | Diagnostic.category_number | (self) | return conf.lib.clang_getDiagnosticCategory(self) | The category number for this diagnostic or 0 if unavailable. | The category number for this diagnostic or 0 if unavailable. | [
"The",
"category",
"number",
"for",
"this",
"diagnostic",
"or",
"0",
"if",
"unavailable",
"."
] | def category_number(self):
"""The category number for this diagnostic or 0 if unavailable."""
return conf.lib.clang_getDiagnosticCategory(self) | [
"def",
"category_number",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getDiagnosticCategory",
"(",
"self",
")"
] | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L363-L365 | |
cksystemsgroup/scal | fa2208a97a77d65f4e90f85fef3404c27c1f2ac2 | tools/cpplint.py | python | FileInfo.NoExtension | (self) | return '/'.join(self.Split()[0:2]) | File has no source file extension. | File has no source file extension. | [
"File",
"has",
"no",
"source",
"file",
"extension",
"."
] | def NoExtension(self):
"""File has no source file extension."""
return '/'.join(self.Split()[0:2]) | [
"def",
"NoExtension",
"(",
"self",
")",
":",
"return",
"'/'",
".",
"join",
"(",
"self",
".",
"Split",
"(",
")",
"[",
"0",
":",
"2",
"]",
")"
] | https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L1055-L1057 | |
NicknineTheEagle/TF2-Base | 20459c5a7fbc995b6bf54fa85c2f62a101e9fb64 | src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py | python | _SimpleEncoder | (wire_type, encode_value, compute_value_size) | return SpecificEncoder | Return a constructor for an encoder for fields of a particular type.
Args:
wire_type: The field's wire type, for encoding tags.
encode_value: A function which encodes an individual value, e.g.
_EncodeVarint().
compute_value_size: A function which computes the size of an individual
... | Return a constructor for an encoder for fields of a particular type. | [
"Return",
"a",
"constructor",
"for",
"an",
"encoder",
"for",
"fields",
"of",
"a",
"particular",
"type",
"."
] | def _SimpleEncoder(wire_type, encode_value, compute_value_size):
"""Return a constructor for an encoder for fields of a particular type.
Args:
wire_type: The field's wire type, for encoding tags.
encode_value: A function which encodes an individual value, e.g.
_EncodeVarint().
compute_v... | [
"def",
"_SimpleEncoder",
"(",
"wire_type",
",",
"encode_value",
",",
"compute_value_size",
")",
":",
"def",
"SpecificEncoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"if",
"is_packed",
":",
"tag_bytes",
"=",
"TagBytes",
"(",
"field_... | https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L392-L430 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_endpoints.py | python | Connection.remote_hostname | (self) | return pn_connection_remote_hostname(self._impl) | The hostname specified by the remote peer for this connection.
This will return ``None`` until the :const:`REMOTE_ACTIVE` state is
reached. See :class:`Endpoint` for more details on endpoint state.
Any (non ``None``) name returned by this operation will be valid until
the connection ob... | The hostname specified by the remote peer for this connection. | [
"The",
"hostname",
"specified",
"by",
"the",
"remote",
"peer",
"for",
"this",
"connection",
"."
] | def remote_hostname(self) -> Optional[str]:
"""
The hostname specified by the remote peer for this connection.
This will return ``None`` until the :const:`REMOTE_ACTIVE` state is
reached. See :class:`Endpoint` for more details on endpoint state.
Any (non ``None``) name returned... | [
"def",
"remote_hostname",
"(",
"self",
")",
"->",
"Optional",
"[",
"str",
"]",
":",
"return",
"pn_connection_remote_hostname",
"(",
"self",
".",
"_impl",
")"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_endpoints.py#L308-L319 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/appdirs.py | python | site_data_dir | (appname=None, appauthor=None, version=None, multipath=False) | return path | r"""Return full path to the user-shared data dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
"appauthor" (only used on Windows) is the name of the
appauthor or distributing body for this application. Typically
... | r"""Return full path to the user-shared data dir for this application. | [
"r",
"Return",
"full",
"path",
"to",
"the",
"user",
"-",
"shared",
"data",
"dir",
"for",
"this",
"application",
"."
] | def site_data_dir(appname=None, appauthor=None, version=None, multipath=False):
r"""Return full path to the user-shared data dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
"appauthor" (only used on Windows) is the name of ... | [
"def",
"site_data_dir",
"(",
"appname",
"=",
"None",
",",
"appauthor",
"=",
"None",
",",
"version",
"=",
"None",
",",
"multipath",
"=",
"False",
")",
":",
"if",
"system",
"==",
"\"win32\"",
":",
"if",
"appauthor",
"is",
"None",
":",
"appauthor",
"=",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/appdirs.py#L100-L163 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/internals/base.py | python | DataManager._equal_values | (self: T, other: T) | To be implemented by the subclasses. Only check the column values
assuming shape and indexes have already been checked. | To be implemented by the subclasses. Only check the column values
assuming shape and indexes have already been checked. | [
"To",
"be",
"implemented",
"by",
"the",
"subclasses",
".",
"Only",
"check",
"the",
"column",
"values",
"assuming",
"shape",
"and",
"indexes",
"have",
"already",
"been",
"checked",
"."
] | def _equal_values(self: T, other: T) -> bool:
"""
To be implemented by the subclasses. Only check the column values
assuming shape and indexes have already been checked.
"""
raise AbstractMethodError(self) | [
"def",
"_equal_values",
"(",
"self",
":",
"T",
",",
"other",
":",
"T",
")",
"->",
"bool",
":",
"raise",
"AbstractMethodError",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/base.py#L99-L104 | ||
xbmc/xbmc | 091211a754589fc40a2a1f239b0ce9f4ee138268 | addons/service.xbmc.versioncheck/resources/lib/version_check/distro/distro.py | python | name | (pretty=False) | return _distro.name(pretty) | Return the name of the current OS distribution, as a human-readable
string.
If *pretty* is false, the name is returned without version or codename.
(e.g. "CentOS Linux")
If *pretty* is true, the version and codename are appended.
(e.g. "CentOS Linux 7.1.1503 (Core)")
**Lookup hierarchy:**
... | Return the name of the current OS distribution, as a human-readable
string. | [
"Return",
"the",
"name",
"of",
"the",
"current",
"OS",
"distribution",
"as",
"a",
"human",
"-",
"readable",
"string",
"."
] | def name(pretty=False):
"""
Return the name of the current OS distribution, as a human-readable
string.
If *pretty* is false, the name is returned without version or codename.
(e.g. "CentOS Linux")
If *pretty* is true, the version and codename are appended.
(e.g. "CentOS Linux 7.1.1503 (Co... | [
"def",
"name",
"(",
"pretty",
"=",
"False",
")",
":",
"return",
"_distro",
".",
"name",
"(",
"pretty",
")"
] | https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/service.xbmc.versioncheck/resources/lib/version_check/distro/distro.py#L203-L239 | |
hydro-project/fluent | 51dc6de82334af4b8d5991d1b13ff2fc6a6fd650 | functions/benchmarks/summa.py | python | run | (flconn, kvs, num_requests, sckt) | return latencies, [], [], 0 | DEFINE AND REGISTER FUNCTIONS | DEFINE AND REGISTER FUNCTIONS | [
"DEFINE",
"AND",
"REGISTER",
"FUNCTIONS"
] | def run(flconn, kvs, num_requests, sckt):
''' DEFINE AND REGISTER FUNCTIONS '''
def summa(fluent, uid, lblock, rblock, rid, cid, numrows, numcols):
import cloudpickle as cp
from anna.lattices import LWWPairLattice
import time
gstart = time.time()
bsize = lblock.shape[0]
... | [
"def",
"run",
"(",
"flconn",
",",
"kvs",
",",
"num_requests",
",",
"sckt",
")",
":",
"def",
"summa",
"(",
"fluent",
",",
"uid",
",",
"lblock",
",",
"rblock",
",",
"rid",
",",
"cid",
",",
"numrows",
",",
"numcols",
")",
":",
"import",
"cloudpickle",
... | https://github.com/hydro-project/fluent/blob/51dc6de82334af4b8d5991d1b13ff2fc6a6fd650/functions/benchmarks/summa.py#L14-L229 | |
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/hpmc/integrate.py | python | HPMCIntegrator.pair_potential | (self) | return self._pair_potential | The user-defined pair potential associated with the integrator. | The user-defined pair potential associated with the integrator. | [
"The",
"user",
"-",
"defined",
"pair",
"potential",
"associated",
"with",
"the",
"integrator",
"."
] | def pair_potential(self):
"""The user-defined pair potential associated with the integrator."""
return self._pair_potential | [
"def",
"pair_potential",
"(",
"self",
")",
":",
"return",
"self",
".",
"_pair_potential"
] | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/hpmc/integrate.py#L358-L360 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/genpy/src/genpy/generate_struct.py | python | reduce_pattern | (pattern) | return new_pattern | Optimize the struct format pattern.
:param pattern: struct pattern, ``str``
:returns: optimized struct pattern, ``str`` | Optimize the struct format pattern.
:param pattern: struct pattern, ``str``
:returns: optimized struct pattern, ``str`` | [
"Optimize",
"the",
"struct",
"format",
"pattern",
".",
":",
"param",
"pattern",
":",
"struct",
"pattern",
"str",
":",
"returns",
":",
"optimized",
"struct",
"pattern",
"str"
] | def reduce_pattern(pattern):
"""
Optimize the struct format pattern.
:param pattern: struct pattern, ``str``
:returns: optimized struct pattern, ``str``
"""
if not pattern or len(pattern) == 1 or '%' in pattern:
return pattern
prev = pattern[0]
count = 1
new_pattern = ''
... | [
"def",
"reduce_pattern",
"(",
"pattern",
")",
":",
"if",
"not",
"pattern",
"or",
"len",
"(",
"pattern",
")",
"==",
"1",
"or",
"'%'",
"in",
"pattern",
":",
"return",
"pattern",
"prev",
"=",
"pattern",
"[",
"0",
"]",
"count",
"=",
"1",
"new_pattern",
"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/generate_struct.py#L64-L90 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/upload.py | python | PutObjectTask._main | (self, client, fileobj, bucket, key, extra_args) | :param client: The client to use when calling PutObject
:param fileobj: The file to upload.
:param bucket: The name of the bucket to upload to
:param key: The name of the key to upload to
:param extra_args: A dictionary of any extra arguments that may be
used in the upload. | :param client: The client to use when calling PutObject
:param fileobj: The file to upload.
:param bucket: The name of the bucket to upload to
:param key: The name of the key to upload to
:param extra_args: A dictionary of any extra arguments that may be
used in the upload. | [
":",
"param",
"client",
":",
"The",
"client",
"to",
"use",
"when",
"calling",
"PutObject",
":",
"param",
"fileobj",
":",
"The",
"file",
"to",
"upload",
".",
":",
"param",
"bucket",
":",
"The",
"name",
"of",
"the",
"bucket",
"to",
"upload",
"to",
":",
... | def _main(self, client, fileobj, bucket, key, extra_args):
"""
:param client: The client to use when calling PutObject
:param fileobj: The file to upload.
:param bucket: The name of the bucket to upload to
:param key: The name of the key to upload to
:param extra_args: A ... | [
"def",
"_main",
"(",
"self",
",",
"client",
",",
"fileobj",
",",
"bucket",
",",
"key",
",",
"extra_args",
")",
":",
"with",
"fileobj",
"as",
"body",
":",
"client",
".",
"put_object",
"(",
"Bucket",
"=",
"bucket",
",",
"Key",
"=",
"key",
",",
"Body",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/upload.py#L682-L692 | ||
ideawu/ssdb-rocks | a3cbb322cafb2f493252829c608e2239df98c9ac | deps/cpy/antlr3/streams.py | python | ANTLRStringStream.seek | (self, index) | consume() ahead until p==index; can't just set p=index as we must
update line and charPositionInLine. | consume() ahead until p==index; can't just set p=index as we must
update line and charPositionInLine. | [
"consume",
"()",
"ahead",
"until",
"p",
"==",
"index",
";",
"can",
"t",
"just",
"set",
"p",
"=",
"index",
"as",
"we",
"must",
"update",
"line",
"and",
"charPositionInLine",
"."
] | def seek(self, index):
"""
consume() ahead until p==index; can't just set p=index as we must
update line and charPositionInLine.
"""
if index <= self.p:
self.p = index # just jump; don't update stream state (line, ...)
return
# seek forwa... | [
"def",
"seek",
"(",
"self",
",",
"index",
")",
":",
"if",
"index",
"<=",
"self",
".",
"p",
":",
"self",
".",
"p",
"=",
"index",
"# just jump; don't update stream state (line, ...)",
"return",
"# seek forward, consume until p hits index",
"while",
"self",
".",
"p",... | https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/streams.py#L466-L478 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/control-examples/OperationalSpaceController.py | python | OperationalSpaceSolver.printStatus | (self,q) | Prints a status printout summarizing all tasks' errors. | Prints a status printout summarizing all tasks' errors. | [
"Prints",
"a",
"status",
"printout",
"summarizing",
"all",
"tasks",
"errors",
"."
] | def printStatus(self,q):
"""Prints a status printout summarizing all tasks' errors."""
priorities = set()
names = dict()
errors = dict()
totalerrors = dict()
for t in self.taskList:
if t.weight==0: continue
priorities.add(t.level)
s = t.name
if len(s) > 8:
s = s[0:8]
err = t.getSensedErro... | [
"def",
"printStatus",
"(",
"self",
",",
"q",
")",
":",
"priorities",
"=",
"set",
"(",
")",
"names",
"=",
"dict",
"(",
")",
"errors",
"=",
"dict",
"(",
")",
"totalerrors",
"=",
"dict",
"(",
")",
"for",
"t",
"in",
"self",
".",
"taskList",
":",
"if"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/control-examples/OperationalSpaceController.py#L194-L228 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/middle/SharedWeightsDuplication.py | python | SharedWeightsDuplication.find_and_replace_pattern | (self, graph: Graph) | This function finds all const data nodes that have more that one consumer and then duplicate them | This function finds all const data nodes that have more that one consumer and then duplicate them | [
"This",
"function",
"finds",
"all",
"const",
"data",
"nodes",
"that",
"have",
"more",
"that",
"one",
"consumer",
"and",
"then",
"duplicate",
"them"
] | def find_and_replace_pattern(self, graph: Graph):
"""
This function finds all const data nodes that have more that one consumer and then duplicate them
"""
data_nodes = [Node(graph, id) for id in graph.nodes() if Node(graph, id).soft_get('kind') == 'data']
for node in data_nodes:... | [
"def",
"find_and_replace_pattern",
"(",
"self",
",",
"graph",
":",
"Graph",
")",
":",
"data_nodes",
"=",
"[",
"Node",
"(",
"graph",
",",
"id",
")",
"for",
"id",
"in",
"graph",
".",
"nodes",
"(",
")",
"if",
"Node",
"(",
"graph",
",",
"id",
")",
".",... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/middle/SharedWeightsDuplication.py#L22-L40 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/roslaunch/src/roslaunch/scriptapi.py | python | ROSLaunch.launch | (self, node) | return proc | Launch a roslaunch node instance
@param node: roslaunch Node instance
@type node: roslaunch.Node
@return: node process
@rtype: roslaunch.Process
@raise RLException: if launch fails | Launch a roslaunch node instance | [
"Launch",
"a",
"roslaunch",
"node",
"instance"
] | def launch(self, node):
"""
Launch a roslaunch node instance
@param node: roslaunch Node instance
@type node: roslaunch.Node
@return: node process
@rtype: roslaunch.Process
@raise RLException: if launch fails
"""
if not self.started:
... | [
"def",
"launch",
"(",
"self",
",",
"node",
")",
":",
"if",
"not",
"self",
".",
"started",
":",
"raise",
"RLException",
"(",
"\"please start ROSLaunch first\"",
")",
"elif",
"not",
"isinstance",
"(",
"node",
",",
"Node",
")",
":",
"raise",
"ValueError",
"("... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/scriptapi.py#L83-L101 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/codegen.py | python | CodeLibrary._optimize_functions | (self, ll_module) | Internal: run function-level optimizations inside *ll_module*. | Internal: run function-level optimizations inside *ll_module*. | [
"Internal",
":",
"run",
"function",
"-",
"level",
"optimizations",
"inside",
"*",
"ll_module",
"*",
"."
] | def _optimize_functions(self, ll_module):
"""
Internal: run function-level optimizations inside *ll_module*.
"""
# Enforce data layout to enable layout-specific optimizations
ll_module.data_layout = self._codegen._data_layout
with self._codegen._function_pass_manager(ll_m... | [
"def",
"_optimize_functions",
"(",
"self",
",",
"ll_module",
")",
":",
"# Enforce data layout to enable layout-specific optimizations",
"ll_module",
".",
"data_layout",
"=",
"self",
".",
"_codegen",
".",
"_data_layout",
"with",
"self",
".",
"_codegen",
".",
"_function_p... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/codegen.py#L122-L134 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/unix_events.py | python | AbstractChildWatcher.close | (self) | Close the watcher.
This must be called to make sure that any underlying resource is freed. | Close the watcher. | [
"Close",
"the",
"watcher",
"."
] | def close(self):
"""Close the watcher.
This must be called to make sure that any underlying resource is freed.
"""
raise NotImplementedError() | [
"def",
"close",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/unix_events.py#L838-L843 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/usb_gadget/gadget.py | python | Gadget.GetStringDescriptor | (self, index, lang, length) | Handle a GET_DESCRIPTOR(String) request from the host.
Descriptor index 0 returns the set of languages supported by the device.
All other indices return the string descriptors registered with those
indices.
See Universal Serial Bus Specification Revision 2.0 section 9.6.7.
Args:
index: Desc... | Handle a GET_DESCRIPTOR(String) request from the host. | [
"Handle",
"a",
"GET_DESCRIPTOR",
"(",
"String",
")",
"request",
"from",
"the",
"host",
"."
] | def GetStringDescriptor(self, index, lang, length):
"""Handle a GET_DESCRIPTOR(String) request from the host.
Descriptor index 0 returns the set of languages supported by the device.
All other indices return the string descriptors registered with those
indices.
See Universal Serial Bus Specificati... | [
"def",
"GetStringDescriptor",
"(",
"self",
",",
"index",
",",
"lang",
",",
"length",
")",
":",
"if",
"index",
"==",
"0",
":",
"length",
"=",
"2",
"+",
"len",
"(",
"self",
".",
"_strings",
")",
"*",
"2",
"header",
"=",
"struct",
".",
"pack",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/gadget.py#L406-L447 | ||
gklz1982/caffe-yolov2 | ebb27029db4ddc0d40e520634633b0fa9cdcc10d | scripts/cpp_lint.py | python | _FunctionState.Count | (self) | Count line in current function body. | Count line in current function body. | [
"Count",
"line",
"in",
"current",
"function",
"body",
"."
] | def Count(self):
"""Count line in current function body."""
if self.in_a_function:
self.lines_in_function += 1 | [
"def",
"Count",
"(",
"self",
")",
":",
"if",
"self",
".",
"in_a_function",
":",
"self",
".",
"lines_in_function",
"+=",
"1"
] | https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L831-L834 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/svrg_optimization/svrg_module.py | python | SVRGModule.fit | (self, train_data, eval_data=None, eval_metric='acc',
epoch_end_callback=None, batch_end_callback=None, kvstore='local',
optimizer='sgd', optimizer_params=(('learning_rate', 0.01),),
eval_end_callback=None,
eval_batch_end_callback=None, initializer=mx.init.Uniform(0.01),
... | Trains the module parameters.
Parameters
----------
train_data : DataIter
Train DataIter.
eval_data : DataIter
If not ``None``, will be used as validation set and the performance
after each epoch will be evaluated.
eval_metric : str or EvalMet... | Trains the module parameters. | [
"Trains",
"the",
"module",
"parameters",
"."
] | def fit(self, train_data, eval_data=None, eval_metric='acc',
epoch_end_callback=None, batch_end_callback=None, kvstore='local',
optimizer='sgd', optimizer_params=(('learning_rate', 0.01),),
eval_end_callback=None,
eval_batch_end_callback=None, initializer=mx.init.Uniform(... | [
"def",
"fit",
"(",
"self",
",",
"train_data",
",",
"eval_data",
"=",
"None",
",",
"eval_metric",
"=",
"'acc'",
",",
"epoch_end_callback",
"=",
"None",
",",
"batch_end_callback",
"=",
"None",
",",
"kvstore",
"=",
"'local'",
",",
"optimizer",
"=",
"'sgd'",
"... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/svrg_optimization/svrg_module.py#L395-L552 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/framework/stdin.py | python | Stdin.__extract_from_buffer | (self, character_count) | return result | Remove the first character_count characters from the internal buffer and
return them. | Remove the first character_count characters from the internal buffer and
return them. | [
"Remove",
"the",
"first",
"character_count",
"characters",
"from",
"the",
"internal",
"buffer",
"and",
"return",
"them",
"."
] | def __extract_from_buffer(self, character_count):
"""Remove the first character_count characters from the internal buffer and
return them.
"""
result = self.buffer[:character_count]
self.buffer = self.buffer[character_count:]
return result | [
"def",
"__extract_from_buffer",
"(",
"self",
",",
"character_count",
")",
":",
"result",
"=",
"self",
".",
"buffer",
"[",
":",
"character_count",
"]",
"self",
".",
"buffer",
"=",
"self",
".",
"buffer",
"[",
"character_count",
":",
"]",
"return",
"result"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pythonwin/pywin/framework/stdin.py#L75-L81 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pydocview.py | python | DocTabbedChildFrame.SetIcon | (self, icon) | Dummy method since the icon of tabbed frames are managed by the notebook. | Dummy method since the icon of tabbed frames are managed by the notebook. | [
"Dummy",
"method",
"since",
"the",
"icon",
"of",
"tabbed",
"frames",
"are",
"managed",
"by",
"the",
"notebook",
"."
] | def SetIcon(self, icon):
"""
Dummy method since the icon of tabbed frames are managed by the notebook.
"""
pass | [
"def",
"SetIcon",
"(",
"self",
",",
"icon",
")",
":",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pydocview.py#L622-L626 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/groupby/grouper.py | python | Grouper._get_grouper | (self, obj: FrameOrSeries, validate: bool = True) | return self.binner, self.grouper, self.obj | Parameters
----------
obj : Series or DataFrame
validate : bool, default True
if True, validate the grouper
Returns
-------
a tuple of binner, grouper, obj (possibly sorted) | Parameters
----------
obj : Series or DataFrame
validate : bool, default True
if True, validate the grouper | [
"Parameters",
"----------",
"obj",
":",
"Series",
"or",
"DataFrame",
"validate",
":",
"bool",
"default",
"True",
"if",
"True",
"validate",
"the",
"grouper"
] | def _get_grouper(self, obj: FrameOrSeries, validate: bool = True):
"""
Parameters
----------
obj : Series or DataFrame
validate : bool, default True
if True, validate the grouper
Returns
-------
a tuple of binner, grouper, obj (possibly sorted... | [
"def",
"_get_grouper",
"(",
"self",
",",
"obj",
":",
"FrameOrSeries",
",",
"validate",
":",
"bool",
"=",
"True",
")",
":",
"self",
".",
"_set_grouper",
"(",
"obj",
")",
"# error: Value of type variable \"FrameOrSeries\" of \"get_grouper\" cannot be",
"# \"Optional[Any]\... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/groupby/grouper.py#L300-L327 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ListBox.Deselect | (*args, **kwargs) | return _controls_.ListBox_Deselect(*args, **kwargs) | Deselect(self, int n) | Deselect(self, int n) | [
"Deselect",
"(",
"self",
"int",
"n",
")"
] | def Deselect(*args, **kwargs):
"""Deselect(self, int n)"""
return _controls_.ListBox_Deselect(*args, **kwargs) | [
"def",
"Deselect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListBox_Deselect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1205-L1207 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/text_format.py | python | Merge | (text,
message,
allow_unknown_extension=False,
allow_field_number=False,
descriptor_pool=None) | return MergeLines(
text.split('\n'),
message,
allow_unknown_extension,
allow_field_number,
descriptor_pool=descriptor_pool) | Parses a text representation of a protocol message into a message.
Like Parse(), but allows repeated values for a non-repeated field, and uses
the last one.
Args:
text: Message text representation.
message: A protocol buffer message to merge into.
allow_unknown_extension: if True, skip over missing ... | Parses a text representation of a protocol message into a message. | [
"Parses",
"a",
"text",
"representation",
"of",
"a",
"protocol",
"message",
"into",
"a",
"message",
"."
] | def Merge(text,
message,
allow_unknown_extension=False,
allow_field_number=False,
descriptor_pool=None):
"""Parses a text representation of a protocol message into a message.
Like Parse(), but allows repeated values for a non-repeated field, and uses
the last one.
Args:... | [
"def",
"Merge",
"(",
"text",
",",
"message",
",",
"allow_unknown_extension",
"=",
"False",
",",
"allow_field_number",
"=",
"False",
",",
"descriptor_pool",
"=",
"None",
")",
":",
"return",
"MergeLines",
"(",
"text",
".",
"split",
"(",
"'\\n'",
")",
",",
"m... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/text_format.py#L452-L481 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/setup.py | python | pythonlib_dir | () | return path where libpython* is. | return path where libpython* is. | [
"return",
"path",
"where",
"libpython",
"*",
"is",
"."
] | def pythonlib_dir():
"""return path where libpython* is."""
if sys.platform == 'win32':
return os.path.join(sys.prefix, "libs")
else:
return get_config_var('LIBDIR') | [
"def",
"pythonlib_dir",
"(",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"sys",
".",
"prefix",
",",
"\"libs\"",
")",
"else",
":",
"return",
"get_config_var",
"(",
"'LIBDIR'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/setup.py#L71-L76 | ||
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/google/protobuf/internal/encoder.py | python | _FixedSizer | (value_size) | return SpecificSizer | Like _SimpleSizer except for a fixed-size field. The input is the size
of one value. | Like _SimpleSizer except for a fixed-size field. The input is the size
of one value. | [
"Like",
"_SimpleSizer",
"except",
"for",
"a",
"fixed",
"-",
"size",
"field",
".",
"The",
"input",
"is",
"the",
"size",
"of",
"one",
"value",
"."
] | def _FixedSizer(value_size):
"""Like _SimpleSizer except for a fixed-size field. The input is the size
of one value."""
def SpecificSizer(field_number, is_repeated, is_packed):
tag_size = _TagSize(field_number)
if is_packed:
local_VarintSize = _VarintSize
def PackedFieldSize(value):
... | [
"def",
"_FixedSizer",
"(",
"value_size",
")",
":",
"def",
"SpecificSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"if",
"is_packed",
":",
"local_VarintSize",
"=",
"_VarintSize",... | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/encoder.py#L187-L210 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | GraphicsGradientStop.SetPosition | (*args, **kwargs) | return _gdi_.GraphicsGradientStop_SetPosition(*args, **kwargs) | SetPosition(self, float pos) | SetPosition(self, float pos) | [
"SetPosition",
"(",
"self",
"float",
"pos",
")"
] | def SetPosition(*args, **kwargs):
"""SetPosition(self, float pos)"""
return _gdi_.GraphicsGradientStop_SetPosition(*args, **kwargs) | [
"def",
"SetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsGradientStop_SetPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6059-L6061 | |
nightingale-media-player/nightingale-hacking | 7a4e3d2d5ea52e3623e2f9c2d10ee544a5530c35 | tools/scripts/aes.py | python | encryptData | (key, data, mode=AESModeOfOperation.modeOfOperation["CBC"]) | return ''.join(map(chr, iv)) + ''.join(map(chr, ciph)) | encrypt `data` using `key`
`key` should be a string of bytes.
returned cipher is a string of bytes prepended with the initialization
vector. | encrypt `data` using `key` | [
"encrypt",
"data",
"using",
"key"
] | def encryptData(key, data, mode=AESModeOfOperation.modeOfOperation["CBC"]):
"""encrypt `data` using `key`
`key` should be a string of bytes.
returned cipher is a string of bytes prepended with the initialization
vector.
"""
key = map(ord, key)
if mode == AESModeOfOperation.modeOfOperation... | [
"def",
"encryptData",
"(",
"key",
",",
"data",
",",
"mode",
"=",
"AESModeOfOperation",
".",
"modeOfOperation",
"[",
"\"CBC\"",
"]",
")",
":",
"key",
"=",
"map",
"(",
"ord",
",",
"key",
")",
"if",
"mode",
"==",
"AESModeOfOperation",
".",
"modeOfOperation",
... | https://github.com/nightingale-media-player/nightingale-hacking/blob/7a4e3d2d5ea52e3623e2f9c2d10ee544a5530c35/tools/scripts/aes.py#L590-L611 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_multiCriterion/interpreter.py | python | interpretAsMultipleRequiredConvergencesAndIterationBounds | (flags) | return interpretation | This is the common interpreter which expects N booleans as input:
+ 1 to N-2: convergence flags, all necessary (e.g. split tolerance)
+ N-1: is the number of iteration high enough?
+ N: is the number of iteration low enough? | This is the common interpreter which expects N booleans as input:
+ 1 to N-2: convergence flags, all necessary (e.g. split tolerance)
+ N-1: is the number of iteration high enough?
+ N: is the number of iteration low enough? | [
"This",
"is",
"the",
"common",
"interpreter",
"which",
"expects",
"N",
"booleans",
"as",
"input",
":",
"+",
"1",
"to",
"N",
"-",
"2",
":",
"convergence",
"flags",
"all",
"necessary",
"(",
"e",
".",
"g",
".",
"split",
"tolerance",
")",
"+",
"N",
"-",
... | def interpretAsMultipleRequiredConvergencesAndIterationBounds(flags):
"""
This is the common interpreter which expects N booleans as input:
+ 1 to N-2: convergence flags, all necessary (e.g. split tolerance)
+ N-1: is the number of iteration high enough?
+ N: is the number of iteration low enough?
... | [
"def",
"interpretAsMultipleRequiredConvergencesAndIterationBounds",
"(",
"flags",
")",
":",
"flag",
"=",
"[",
"all",
"(",
"flags",
"[",
"0",
":",
"-",
"2",
"]",
")",
",",
"flags",
"[",
"-",
"2",
"]",
",",
"flags",
"[",
"-",
"1",
"]",
"]",
"interpretati... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_multiCriterion/interpreter.py#L43-L52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.