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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/altgraph/Dot.py | python | Dot.edge_style | (self, head, tail, **kwargs) | Modifies an edge style to the dot representation. | Modifies an edge style to the dot representation. | [
"Modifies",
"an",
"edge",
"style",
"to",
"the",
"dot",
"representation",
"."
] | def edge_style(self, head, tail, **kwargs):
'''
Modifies an edge style to the dot representation.
'''
try:
if tail not in self.edges[head]:
self.edges[head][tail]= {}
self.edges[head][tail] = kwargs
except KeyError:
raise GraphE... | [
"def",
"edge_style",
"(",
"self",
",",
"head",
",",
"tail",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"if",
"tail",
"not",
"in",
"self",
".",
"edges",
"[",
"head",
"]",
":",
"self",
".",
"edges",
"[",
"head",
"]",
"[",
"tail",
"]",
"=",
... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/altgraph/Dot.py#L177-L186 | ||
include-what-you-use/include-what-you-use | 208fbfffa5d69364b9f78e427caa443441279283 | fix_includes.py | python | _CalculateMoveSpans | (file_lines, forward_declare_spans) | Fills each input_line's move_span field.
A 'move span' is a range of lines (from file_lines) that includes
an #include or forward-declare, and all the comments preceding it.
It is the unit we would move if we decided to move (or delete) this
#include or forward-declare.
For lines of type _INCLUDE_RE or _FOR... | Fills each input_line's move_span field. | [
"Fills",
"each",
"input_line",
"s",
"move_span",
"field",
"."
] | def _CalculateMoveSpans(file_lines, forward_declare_spans):
"""Fills each input_line's move_span field.
A 'move span' is a range of lines (from file_lines) that includes
an #include or forward-declare, and all the comments preceding it.
It is the unit we would move if we decided to move (or delete) this
#inc... | [
"def",
"_CalculateMoveSpans",
"(",
"file_lines",
",",
"forward_declare_spans",
")",
":",
"# First let's do #includes.",
"for",
"line_number",
"in",
"range",
"(",
"len",
"(",
"file_lines",
")",
")",
":",
"if",
"file_lines",
"[",
"line_number",
"]",
".",
"type",
"... | https://github.com/include-what-you-use/include-what-you-use/blob/208fbfffa5d69364b9f78e427caa443441279283/fix_includes.py#L860-L889 | ||
google/zooshi | 05390b98f79eed8ef26ec4ab2c3aea3790b1165c | scripts/build_assets.py | python | main | () | return builder.main(
project_root=PROJECT_ROOT,
assets_path=ASSETS_PATH,
asset_meta=ASSET_META,
asset_roots=ASSET_ROOTS,
intermediate_path=INTERMEDIATE_TEXTURE_PATH,
overlay_dirs=OVERLAY_DIRS,
tga_files_to_convert=tga_files_to_convert,
png_files_to_convert=png_files_to_co... | Builds or cleans the assets needed for the game.
To build all assets, either call this script without any arguments. Or
alternatively, call it with the argument 'all'. To just convert the
flatbuffer json files, call it with 'flatbuffers'. Likewise to convert the
png files to webp files, call it with 'webp'. To... | Builds or cleans the assets needed for the game. | [
"Builds",
"or",
"cleans",
"the",
"assets",
"needed",
"for",
"the",
"game",
"."
] | def main():
"""Builds or cleans the assets needed for the game.
To build all assets, either call this script without any arguments. Or
alternatively, call it with the argument 'all'. To just convert the
flatbuffer json files, call it with 'flatbuffers'. Likewise to convert the
png files to webp files, call i... | [
"def",
"main",
"(",
")",
":",
"return",
"builder",
".",
"main",
"(",
"project_root",
"=",
"PROJECT_ROOT",
",",
"assets_path",
"=",
"ASSETS_PATH",
",",
"asset_meta",
"=",
"ASSET_META",
",",
"asset_roots",
"=",
"ASSET_ROOTS",
",",
"intermediate_path",
"=",
"INTE... | https://github.com/google/zooshi/blob/05390b98f79eed8ef26ec4ab2c3aea3790b1165c/scripts/build_assets.py#L217-L241 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/sparse_apply_ftrl_v2.py | python | _sparse_apply_ftrl_v2_tbe | () | return | SparseApplyFtrlV2D TBE register | SparseApplyFtrlV2D TBE register | [
"SparseApplyFtrlV2D",
"TBE",
"register"
] | def _sparse_apply_ftrl_v2_tbe():
"""SparseApplyFtrlV2D TBE register"""
return | [
"def",
"_sparse_apply_ftrl_v2_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/sparse_apply_ftrl_v2.py#L48-L50 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/logging/handlers.py | python | BaseRotatingHandler.emit | (self, record) | Emit a record.
Output the record to the file, catering for rollover as described
in doRollover(). | Emit a record. | [
"Emit",
"a",
"record",
"."
] | def emit(self, record):
"""
Emit a record.
Output the record to the file, catering for rollover as described
in doRollover().
"""
try:
if self.shouldRollover(record):
self.doRollover()
logging.FileHandler.emit(self, record)
... | [
"def",
"emit",
"(",
"self",
",",
"record",
")",
":",
"try",
":",
"if",
"self",
".",
"shouldRollover",
"(",
"record",
")",
":",
"self",
".",
"doRollover",
"(",
")",
"logging",
".",
"FileHandler",
".",
"emit",
"(",
"self",
",",
"record",
")",
"except",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/logging/handlers.py#L68-L82 | ||
scylladb/dpdk | cc7e6ed22c0fc08e3ff37b3e68a61979d8214547 | tools/dpdk_nic_bind.py | python | get_nic_details | () | This function populates the "devices" dictionary. The keys used are
the pci addresses (domain:bus:slot.func). The values are themselves
dictionaries - one for each NIC. | This function populates the "devices" dictionary. The keys used are
the pci addresses (domain:bus:slot.func). The values are themselves
dictionaries - one for each NIC. | [
"This",
"function",
"populates",
"the",
"devices",
"dictionary",
".",
"The",
"keys",
"used",
"are",
"the",
"pci",
"addresses",
"(",
"domain",
":",
"bus",
":",
"slot",
".",
"func",
")",
".",
"The",
"values",
"are",
"themselves",
"dictionaries",
"-",
"one",
... | def get_nic_details():
'''This function populates the "devices" dictionary. The keys used are
the pci addresses (domain:bus:slot.func). The values are themselves
dictionaries - one for each NIC.'''
global devices
global dpdk_drivers
# clear any old data
devices = {}
# first loop through... | [
"def",
"get_nic_details",
"(",
")",
":",
"global",
"devices",
"global",
"dpdk_drivers",
"# clear any old data",
"devices",
"=",
"{",
"}",
"# first loop through and read details for all devices",
"# request machine readable format, with numeric IDs",
"dev",
"=",
"{",
"}",
"dev... | https://github.com/scylladb/dpdk/blob/cc7e6ed22c0fc08e3ff37b3e68a61979d8214547/tools/dpdk_nic_bind.py#L216-L277 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/tensor_shape.py | python | Dimension.__le__ | (self, other) | Returns True if `self` is known to be less than or equal to `other`.
Dimensions are compared as follows:
```python
(tf.Dimension(m) <= tf.Dimension(n)) == (m <= n)
(tf.Dimension(m) <= tf.Dimension(None)) == None
(tf.Dimension(None) <= tf.Dimension(n)) == None
(tf.Dimension(None) <=... | Returns True if `self` is known to be less than or equal to `other`. | [
"Returns",
"True",
"if",
"self",
"is",
"known",
"to",
"be",
"less",
"than",
"or",
"equal",
"to",
"other",
"."
] | def __le__(self, other):
"""Returns True if `self` is known to be less than or equal to `other`.
Dimensions are compared as follows:
```python
(tf.Dimension(m) <= tf.Dimension(n)) == (m <= n)
(tf.Dimension(m) <= tf.Dimension(None)) == None
(tf.Dimension(None) <= tf.Dimension(n)) ==... | [
"def",
"__le__",
"(",
"self",
",",
"other",
")",
":",
"other",
"=",
"as_dimension",
"(",
"other",
")",
"if",
"self",
".",
"_value",
"is",
"None",
"or",
"other",
".",
"value",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",
"self",
".",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/tensor_shape.py#L305-L328 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/gem5/components/cachehierarchies/chi/private_l1_cache_hierarchy.py | python | PrivateL1CacheHierarchy.__init__ | (self, size: str, assoc: int) | :param size: The size of the priavte I/D caches in the hierarchy.
:param assoc: The associativity of each cache. | :param size: The size of the priavte I/D caches in the hierarchy.
:param assoc: The associativity of each cache. | [
":",
"param",
"size",
":",
"The",
"size",
"of",
"the",
"priavte",
"I",
"/",
"D",
"caches",
"in",
"the",
"hierarchy",
".",
":",
"param",
"assoc",
":",
"The",
"associativity",
"of",
"each",
"cache",
"."
] | def __init__(self, size: str, assoc: int) -> None:
"""
:param size: The size of the priavte I/D caches in the hierarchy.
:param assoc: The associativity of each cache.
"""
super().__init__()
self._size = size
self._assoc = assoc | [
"def",
"__init__",
"(",
"self",
",",
"size",
":",
"str",
",",
"assoc",
":",
"int",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_size",
"=",
"size",
"self",
".",
"_assoc",
"=",
"assoc"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/gem5/components/cachehierarchies/chi/private_l1_cache_hierarchy.py#L71-L79 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/modulegraph/pkg_resources.py | python | WorkingSet.iter_entry_points | (self, group, name=None) | Yield entry point objects from `group` matching `name`
If `name` is None, yields all entry points in `group` from all
distributions in the working set, otherwise only ones matching
both `group` and `name` are yielded (in distribution order). | Yield entry point objects from `group` matching `name` | [
"Yield",
"entry",
"point",
"objects",
"from",
"group",
"matching",
"name"
] | def iter_entry_points(self, group, name=None):
"""Yield entry point objects from `group` matching `name`
If `name` is None, yields all entry points in `group` from all
distributions in the working set, otherwise only ones matching
both `group` and `name` are yielded (in distribution ord... | [
"def",
"iter_entry_points",
"(",
"self",
",",
"group",
",",
"name",
"=",
"None",
")",
":",
"for",
"dist",
"in",
"self",
":",
"entries",
"=",
"dist",
".",
"get_entry_map",
"(",
"group",
")",
"if",
"name",
"is",
"None",
":",
"for",
"ep",
"in",
"entries... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L350-L363 | ||
baidu/Familia | 958febfd5fe7a61e46a35bfb084e71f806dde6a6 | python/familia_wrapper.py | python | TopicalWordEmbeddingsWrapper.__init__ | (self, model_dir, emb_file) | 初始化TWE对象
Args:
model_dir: 模型目录路径
emb_file: topical word embeddings模型文件 | 初始化TWE对象
Args:
model_dir: 模型目录路径
emb_file: topical word embeddings模型文件 | [
"初始化TWE对象",
"Args",
":",
"model_dir",
":",
"模型目录路径",
"emb_file",
":",
"topical",
"word",
"embeddings模型文件"
] | def __init__(self, model_dir, emb_file):
"""初始化TWE对象
Args:
model_dir: 模型目录路径
emb_file: topical word embeddings模型文件
"""
self._twe = familia.init_twe(model_dir, emb_file) | [
"def",
"__init__",
"(",
"self",
",",
"model_dir",
",",
"emb_file",
")",
":",
"self",
".",
"_twe",
"=",
"familia",
".",
"init_twe",
"(",
"model_dir",
",",
"emb_file",
")"
] | https://github.com/baidu/Familia/blob/958febfd5fe7a61e46a35bfb084e71f806dde6a6/python/familia_wrapper.py#L190-L196 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/monitoring.py | python | CounterCell.increase_by | (self, value) | Atomically increments the value.
Args:
value: non-negative value. | Atomically increments the value. | [
"Atomically",
"increments",
"the",
"value",
"."
] | def increase_by(self, value):
"""Atomically increments the value.
Args:
value: non-negative value.
"""
pywrap_tensorflow.TFE_MonitoringCounterCellIncrementBy(self._cell, value) | [
"def",
"increase_by",
"(",
"self",
",",
"value",
")",
":",
"pywrap_tensorflow",
".",
"TFE_MonitoringCounterCellIncrementBy",
"(",
"self",
".",
"_cell",
",",
"value",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/monitoring.py#L153-L159 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/database.py | python | EggInfoDistribution.check_installed_files | (self) | return mismatches | Checks that the hashes and sizes of the files in ``RECORD`` are
matched by the files themselves. Returns a (possibly empty) list of
mismatches. Each entry in the mismatch list will be a tuple consisting
of the path, 'exists', 'size' or 'hash' according to what didn't match
(existence is ... | Checks that the hashes and sizes of the files in ``RECORD`` are
matched by the files themselves. Returns a (possibly empty) list of
mismatches. Each entry in the mismatch list will be a tuple consisting
of the path, 'exists', 'size' or 'hash' according to what didn't match
(existence is ... | [
"Checks",
"that",
"the",
"hashes",
"and",
"sizes",
"of",
"the",
"files",
"in",
"RECORD",
"are",
"matched",
"by",
"the",
"files",
"themselves",
".",
"Returns",
"a",
"(",
"possibly",
"empty",
")",
"list",
"of",
"mismatches",
".",
"Each",
"entry",
"in",
"th... | def check_installed_files(self):
"""
Checks that the hashes and sizes of the files in ``RECORD`` are
matched by the files themselves. Returns a (possibly empty) list of
mismatches. Each entry in the mismatch list will be a tuple consisting
of the path, 'exists', 'size' or 'hash' ... | [
"def",
"check_installed_files",
"(",
"self",
")",
":",
"mismatches",
"=",
"[",
"]",
"record_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"path",
",",
"'installed-files.txt'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"record_path... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L949-L966 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_labels.py | python | Label.Activated | (self) | Execute when the command is called. | Execute when the command is called. | [
"Execute",
"when",
"the",
"command",
"is",
"called",
"."
] | def Activated(self):
"""Execute when the command is called."""
super(Label, self).Activated(name="Label")
self.ghost = None
self.labeltype = utils.getParam("labeltype", "Custom")
self.sel = Gui.Selection.getSelectionEx()
if self.sel:
self.sel = self.sel[0]
... | [
"def",
"Activated",
"(",
"self",
")",
":",
"super",
"(",
"Label",
",",
"self",
")",
".",
"Activated",
"(",
"name",
"=",
"\"Label\"",
")",
"self",
".",
"ghost",
"=",
"None",
"self",
".",
"labeltype",
"=",
"utils",
".",
"getParam",
"(",
"\"labeltype\"",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_labels.py#L67-L81 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/gyp/util/resource_utils.py | python | RJavaBuildOptions._IsResourceFinal | (self, entry) | return entry.name not in self.resources_allowlist | Determines whether a resource should be final or not.
Args:
entry: A _TextSymbolEntry instance.
Returns:
True iff the corresponding entry should be final. | Determines whether a resource should be final or not. | [
"Determines",
"whether",
"a",
"resource",
"should",
"be",
"final",
"or",
"not",
"."
] | def _IsResourceFinal(self, entry):
"""Determines whether a resource should be final or not.
Args:
entry: A _TextSymbolEntry instance.
Returns:
True iff the corresponding entry should be final.
"""
if entry.resource_type == 'styleable' and entry.java_type != 'int[]':
# A styleable constant m... | [
"def",
"_IsResourceFinal",
"(",
"self",
",",
"entry",
")",
":",
"if",
"entry",
".",
"resource_type",
"==",
"'styleable'",
"and",
"entry",
".",
"java_type",
"!=",
"'int[]'",
":",
"# A styleable constant may be exported as non-final after all.",
"return",
"not",
"self",... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/util/resource_utils.py#L511-L529 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tools/import_pb_to_tensorboard.py | python | import_to_tensorboard | (model_dir, log_dir, tag_set) | View an SavedModel as a graph in Tensorboard.
Args:
model_dir: The directory containing the SavedModel to import.
log_dir: The location for the Tensorboard log to begin visualization from.
tag_set: Group of tag(s) of the MetaGraphDef to load, in string format,
separated by ','. For tag-set contains... | View an SavedModel as a graph in Tensorboard. | [
"View",
"an",
"SavedModel",
"as",
"a",
"graph",
"in",
"Tensorboard",
"."
] | def import_to_tensorboard(model_dir, log_dir, tag_set):
"""View an SavedModel as a graph in Tensorboard.
Args:
model_dir: The directory containing the SavedModel to import.
log_dir: The location for the Tensorboard log to begin visualization from.
tag_set: Group of tag(s) of the MetaGraphDef to load, i... | [
"def",
"import_to_tensorboard",
"(",
"model_dir",
",",
"log_dir",
",",
"tag_set",
")",
":",
"with",
"session",
".",
"Session",
"(",
"graph",
"=",
"ops",
".",
"Graph",
"(",
")",
")",
"as",
"sess",
":",
"input_graph_def",
"=",
"saved_model_utils",
".",
"get_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tools/import_pb_to_tensorboard.py#L40-L61 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py | python | KScriptGenerator.updateCalledFunctionList | (self, callee) | Maintains a list of functions that will actually be called | Maintains a list of functions that will actually be called | [
"Maintains",
"a",
"list",
"of",
"functions",
"that",
"will",
"actually",
"be",
"called"
] | def updateCalledFunctionList(self, callee):
"""Maintains a list of functions that will actually be called"""
# Update the total call count
self.updateTotalCallCount(callee)
# If this function is already in the list, don't do anything else
if callee in self.calledFunctions:
... | [
"def",
"updateCalledFunctionList",
"(",
"self",
",",
"callee",
")",
":",
"# Update the total call count",
"self",
".",
"updateTotalCallCount",
"(",
"callee",
")",
"# If this function is already in the list, don't do anything else",
"if",
"callee",
"in",
"self",
".",
"called... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/llvm/examples/Kaleidoscope/MCJIT/lazy/genk-timing.py#L68-L80 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/polynomial/polyutils.py | python | _fromroots | (line_f, mul_f, roots) | Helper function used to implement the ``<type>fromroots`` functions.
Parameters
----------
line_f : function(float, float) -> ndarray
The ``<type>line`` function, such as ``polyline``
mul_f : function(array_like, array_like) -> ndarray
The ``<type>mul`` function, such as ``polymul``
... | Helper function used to implement the ``<type>fromroots`` functions. | [
"Helper",
"function",
"used",
"to",
"implement",
"the",
"<type",
">",
"fromroots",
"functions",
"."
] | def _fromroots(line_f, mul_f, roots):
"""
Helper function used to implement the ``<type>fromroots`` functions.
Parameters
----------
line_f : function(float, float) -> ndarray
The ``<type>line`` function, such as ``polyline``
mul_f : function(array_like, array_like) -> ndarray
T... | [
"def",
"_fromroots",
"(",
"line_f",
",",
"mul_f",
",",
"roots",
")",
":",
"if",
"len",
"(",
"roots",
")",
"==",
"0",
":",
"return",
"np",
".",
"ones",
"(",
"1",
")",
"else",
":",
"[",
"roots",
"]",
"=",
"as_series",
"(",
"[",
"roots",
"]",
",",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/polyutils.py#L456-L483 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridTableBase.SetValueAsBool | (*args, **kwargs) | return _grid.GridTableBase_SetValueAsBool(*args, **kwargs) | SetValueAsBool(self, int row, int col, bool value) | SetValueAsBool(self, int row, int col, bool value) | [
"SetValueAsBool",
"(",
"self",
"int",
"row",
"int",
"col",
"bool",
"value",
")"
] | def SetValueAsBool(*args, **kwargs):
"""SetValueAsBool(self, int row, int col, bool value)"""
return _grid.GridTableBase_SetValueAsBool(*args, **kwargs) | [
"def",
"SetValueAsBool",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase_SetValueAsBool",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L854-L856 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/arraypad.py | python | _set_wrap_both | (padded, axis, width_pair) | return new_left_pad, new_right_pad | Pad `axis` of `arr` with wrapped values.
Parameters
----------
padded : ndarray
Input array of arbitrary shape.
axis : int
Axis along which to pad `arr`.
width_pair : (int, int)
Pair of widths that mark the pad area on both sides in the given
dimension.
Returns
... | Pad `axis` of `arr` with wrapped values. | [
"Pad",
"axis",
"of",
"arr",
"with",
"wrapped",
"values",
"."
] | def _set_wrap_both(padded, axis, width_pair):
"""
Pad `axis` of `arr` with wrapped values.
Parameters
----------
padded : ndarray
Input array of arbitrary shape.
axis : int
Axis along which to pad `arr`.
width_pair : (int, int)
Pair of widths that mark the pad area o... | [
"def",
"_set_wrap_both",
"(",
"padded",
",",
"axis",
",",
"width_pair",
")",
":",
"left_pad",
",",
"right_pad",
"=",
"width_pair",
"period",
"=",
"padded",
".",
"shape",
"[",
"axis",
"]",
"-",
"right_pad",
"-",
"left_pad",
"# If the current dimension of `arr` do... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/arraypad.py#L386-L456 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/graph_editor/subgraph.py | python | SubGraphView.input_index | (self, t) | return subgraph_id | Find the input index corresponding to the given input tensor t.
Args:
t: the input tensor of this subgraph view.
Returns:
The index in the self.inputs list.
Raises:
Error: if t in not an input tensor. | Find the input index corresponding to the given input tensor t. | [
"Find",
"the",
"input",
"index",
"corresponding",
"to",
"the",
"given",
"input",
"tensor",
"t",
"."
] | def input_index(self, t):
"""Find the input index corresponding to the given input tensor t.
Args:
t: the input tensor of this subgraph view.
Returns:
The index in the self.inputs list.
Raises:
Error: if t in not an input tensor.
"""
try:
subgraph_id = self._input_ts.ind... | [
"def",
"input_index",
"(",
"self",
",",
"t",
")",
":",
"try",
":",
"subgraph_id",
"=",
"self",
".",
"_input_ts",
".",
"index",
"(",
"t",
")",
"except",
":",
"raise",
"ValueError",
"(",
"\"Can't find {} in inputs of subgraph {}.\"",
".",
"format",
"(",
"t",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/subgraph.py#L553-L568 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | ipc/ipdl/ipdl/parser.py | python | p_TranslationUnit | (p) | TranslationUnit : Preamble NamespacedStuff | TranslationUnit : Preamble NamespacedStuff | [
"TranslationUnit",
":",
"Preamble",
"NamespacedStuff"
] | def p_TranslationUnit(p):
"""TranslationUnit : Preamble NamespacedStuff"""
tu = Parser.current.tu
tu.loc = Loc(tu.filename)
for stmt in p[1]:
if isinstance(stmt, CxxInclude):
tu.addCxxInclude(stmt)
elif isinstance(stmt, Include):
tu.addInclude(stmt)
elif i... | [
"def",
"p_TranslationUnit",
"(",
"p",
")",
":",
"tu",
"=",
"Parser",
".",
"current",
".",
"tu",
"tu",
".",
"loc",
"=",
"Loc",
"(",
"tu",
".",
"filename",
")",
"for",
"stmt",
"in",
"p",
"[",
"1",
"]",
":",
"if",
"isinstance",
"(",
"stmt",
",",
"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/ipc/ipdl/ipdl/parser.py#L188-L229 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/batch_norm_benchmark.py | python | build_graph | (device, input_shape, axes, num_layers, mode, scale, train) | Build a graph containing a sequence of batch normalizations.
Args:
device: string, the device to run on.
input_shape: shape of the input tensor.
axes: axes that are to be normalized across.
num_layers: number of batch normalization layers in the graph.
mode: "op", "py" or "slow" depending on the ... | Build a graph containing a sequence of batch normalizations. | [
"Build",
"a",
"graph",
"containing",
"a",
"sequence",
"of",
"batch",
"normalizations",
"."
] | def build_graph(device, input_shape, axes, num_layers, mode, scale, train):
"""Build a graph containing a sequence of batch normalizations.
Args:
device: string, the device to run on.
input_shape: shape of the input tensor.
axes: axes that are to be normalized across.
num_layers: number of batch no... | [
"def",
"build_graph",
"(",
"device",
",",
"input_shape",
",",
"axes",
",",
"num_layers",
",",
"mode",
",",
"scale",
",",
"train",
")",
":",
"moment_shape",
"=",
"[",
"]",
"keep_dims",
"=",
"mode",
"==",
"\"py\"",
"or",
"mode",
"==",
"\"slow\"",
"if",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/batch_norm_benchmark.py#L68-L114 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/builder_impl.py | python | _add_asset_to_metagraph | (meta_graph_def, asset_filename, asset_tensor) | Builds an asset proto and adds it to the meta graph def.
Args:
meta_graph_def: The meta graph def to which the asset will be added.
asset_filename: The filename of the asset to be added.
asset_tensor: The asset tensor used to populate the tensor info of the asset
proto. | Builds an asset proto and adds it to the meta graph def. | [
"Builds",
"an",
"asset",
"proto",
"and",
"adds",
"it",
"to",
"the",
"meta",
"graph",
"def",
"."
] | def _add_asset_to_metagraph(meta_graph_def, asset_filename, asset_tensor):
"""Builds an asset proto and adds it to the meta graph def.
Args:
meta_graph_def: The meta graph def to which the asset will be added.
asset_filename: The filename of the asset to be added.
asset_tensor: The asset tensor used to... | [
"def",
"_add_asset_to_metagraph",
"(",
"meta_graph_def",
",",
"asset_filename",
",",
"asset_tensor",
")",
":",
"asset_proto",
"=",
"meta_graph_def",
".",
"asset_file_def",
".",
"add",
"(",
")",
"asset_proto",
".",
"filename",
"=",
"asset_filename",
"asset_proto",
".... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/builder_impl.py#L742-L753 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/cephfs/filesystem.py | python | Filesystem.wait_for_state | (self, goal_state, reject=None, timeout=None, mds_id=None, rank=None) | Block until the MDS reaches a particular state, or a failure condition
is met.
When there are multiple MDSs, succeed when exaclty one MDS is in the
goal state, or fail when any MDS is in the reject state.
:param goal_state: Return once the MDS is in this state
:param reject: Fa... | Block until the MDS reaches a particular state, or a failure condition
is met. | [
"Block",
"until",
"the",
"MDS",
"reaches",
"a",
"particular",
"state",
"or",
"a",
"failure",
"condition",
"is",
"met",
"."
] | def wait_for_state(self, goal_state, reject=None, timeout=None, mds_id=None, rank=None):
"""
Block until the MDS reaches a particular state, or a failure condition
is met.
When there are multiple MDSs, succeed when exaclty one MDS is in the
goal state, or fail when any MDS is in... | [
"def",
"wait_for_state",
"(",
"self",
",",
"goal_state",
",",
"reject",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"mds_id",
"=",
"None",
",",
"rank",
"=",
"None",
")",
":",
"started_at",
"=",
"time",
".",
"time",
"(",
")",
"while",
"True",
":",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/filesystem.py#L1199-L1257 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/pytorch/policy_gradient.py | python | PolicyGradient._add_transition | (self, time_step) | Adds intra-episode transition to the `_episode_data` buffer.
Adds the transition from `self._prev_time_step` to `time_step`.
Args:
time_step: an instance of rl_environment.TimeStep. | Adds intra-episode transition to the `_episode_data` buffer. | [
"Adds",
"intra",
"-",
"episode",
"transition",
"to",
"the",
"_episode_data",
"buffer",
"."
] | def _add_transition(self, time_step):
"""Adds intra-episode transition to the `_episode_data` buffer.
Adds the transition from `self._prev_time_step` to `time_step`.
Args:
time_step: an instance of rl_environment.TimeStep.
"""
assert self._prev_time_step is not None
legal_actions = (
... | [
"def",
"_add_transition",
"(",
"self",
",",
"time_step",
")",
":",
"assert",
"self",
".",
"_prev_time_step",
"is",
"not",
"None",
"legal_actions",
"=",
"(",
"self",
".",
"_prev_time_step",
".",
"observations",
"[",
"\"legal_actions\"",
"]",
"[",
"self",
".",
... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/pytorch/policy_gradient.py#L383-L404 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | ColourData.GetChooseFull | (*args, **kwargs) | return _windows_.ColourData_GetChooseFull(*args, **kwargs) | GetChooseFull(self) -> bool
Under Windows, determines whether the Windows colour dialog will
display the full dialog with custom colour selection controls. Has no
meaning under other platforms. The default value is true. | GetChooseFull(self) -> bool | [
"GetChooseFull",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetChooseFull(*args, **kwargs):
"""
GetChooseFull(self) -> bool
Under Windows, determines whether the Windows colour dialog will
display the full dialog with custom colour selection controls. Has no
meaning under other platforms. The default value is true.
"""
... | [
"def",
"GetChooseFull",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"ColourData_GetChooseFull",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2931-L2939 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/layers/python/layers/feature_column_ops.py | python | _create_embedding_lookup | (column,
columns_to_tensors,
embedding_lookup_arguments,
num_outputs,
trainable,
weight_collections) | Creates variables and returns predictions for linear weights in a model.
Args:
column: the column we're working on.
columns_to_tensors: a map from column name to tensors.
embedding_lookup_arguments: arguments for embedding lookup.
num_outputs: how many outputs.
trainable: whether the variable we creat... | Creates variables and returns predictions for linear weights in a model. | [
"Creates",
"variables",
"and",
"returns",
"predictions",
"for",
"linear",
"weights",
"in",
"a",
"model",
"."
] | def _create_embedding_lookup(column,
columns_to_tensors,
embedding_lookup_arguments,
num_outputs,
trainable,
weight_collections):
"""Creates variables and returns prediction... | [
"def",
"_create_embedding_lookup",
"(",
"column",
",",
"columns_to_tensors",
",",
"embedding_lookup_arguments",
",",
"num_outputs",
",",
"trainable",
",",
"weight_collections",
")",
":",
"with",
"variable_scope",
".",
"variable_scope",
"(",
"None",
",",
"default_name",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L261-L300 | ||
nasa/meshNetwork | ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c | python/mesh/generic/serialComm.py | python | SerialComm.readBytes | (self, bufferFlag=False) | Reads raw bytes from radio | Reads raw bytes from radio | [
"Reads",
"raw",
"bytes",
"from",
"radio"
] | def readBytes(self, bufferFlag=False):
"""Reads raw bytes from radio"""
self.radio.readBytes(bufferFlag) | [
"def",
"readBytes",
"(",
"self",
",",
"bufferFlag",
"=",
"False",
")",
":",
"self",
".",
"radio",
".",
"readBytes",
"(",
"bufferFlag",
")"
] | https://github.com/nasa/meshNetwork/blob/ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c/python/mesh/generic/serialComm.py#L77-L79 | ||
tinyobjloader/tinyobjloader | 8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93 | deps/cpplint.py | python | CheckForBadCharacters | (filename, lines, error) | Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that it's possible for this to throw off line
numbering if... | Logs an error for each line containing bad characters. | [
"Logs",
"an",
"error",
"for",
"each",
"line",
"containing",
"bad",
"characters",
"."
] | def CheckForBadCharacters(filename, lines, error):
"""Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that... | [
"def",
"CheckForBadCharacters",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"for",
"linenum",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"if",
"u'\\ufffd'",
"in",
"line",
":",
"error",
"(",
"filename",
",",
"linenum",
",",
"'reada... | https://github.com/tinyobjloader/tinyobjloader/blob/8322e00ae685ea623ab6ac5a6cebcfa2d22fbf93/deps/cpplint.py#L1800-L1822 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.CalcColLabelsExposed | (*args, **kwargs) | return _grid.Grid_CalcColLabelsExposed(*args, **kwargs) | CalcColLabelsExposed(self, Region reg) -> wxArrayInt | CalcColLabelsExposed(self, Region reg) -> wxArrayInt | [
"CalcColLabelsExposed",
"(",
"self",
"Region",
"reg",
")",
"-",
">",
"wxArrayInt"
] | def CalcColLabelsExposed(*args, **kwargs):
"""CalcColLabelsExposed(self, Region reg) -> wxArrayInt"""
return _grid.Grid_CalcColLabelsExposed(*args, **kwargs) | [
"def",
"CalcColLabelsExposed",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_CalcColLabelsExposed",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1243-L1245 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pyclbr.py | python | readmodule_ex | (module, path=None) | return _readmodule(module, path or []) | Return a dictionary with all functions and classes in module.
Search for module in PATH + sys.path.
If possible, include imported superclasses.
Do this by reading source, without importing (and executing) it. | Return a dictionary with all functions and classes in module. | [
"Return",
"a",
"dictionary",
"with",
"all",
"functions",
"and",
"classes",
"in",
"module",
"."
] | def readmodule_ex(module, path=None):
"""Return a dictionary with all functions and classes in module.
Search for module in PATH + sys.path.
If possible, include imported superclasses.
Do this by reading source, without importing (and executing) it.
"""
return _readmodule(module, path or []) | [
"def",
"readmodule_ex",
"(",
"module",
",",
"path",
"=",
"None",
")",
":",
"return",
"_readmodule",
"(",
"module",
",",
"path",
"or",
"[",
"]",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pyclbr.py#L109-L116 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridTableBase._setOORInfo | (*args, **kwargs) | return _grid.GridTableBase__setOORInfo(*args, **kwargs) | _setOORInfo(self, PyObject _self) | _setOORInfo(self, PyObject _self) | [
"_setOORInfo",
"(",
"self",
"PyObject",
"_self",
")"
] | def _setOORInfo(*args, **kwargs):
"""_setOORInfo(self, PyObject _self)"""
return _grid.GridTableBase__setOORInfo(*args, **kwargs) | [
"def",
"_setOORInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase__setOORInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L770-L772 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/special/basic.py | python | jnyn_zeros | (n, nt) | return specfun.jyzo(abs(n), nt) | Compute nt zeros of Bessel functions Jn(x), Jn'(x), Yn(x), and Yn'(x).
Returns 4 arrays of length `nt`, corresponding to the first `nt` zeros of
Jn(x), Jn'(x), Yn(x), and Yn'(x), respectively.
Parameters
----------
n : int
Order of the Bessel functions
nt : int
Number (<=1200) ... | Compute nt zeros of Bessel functions Jn(x), Jn'(x), Yn(x), and Yn'(x). | [
"Compute",
"nt",
"zeros",
"of",
"Bessel",
"functions",
"Jn",
"(",
"x",
")",
"Jn",
"(",
"x",
")",
"Yn",
"(",
"x",
")",
"and",
"Yn",
"(",
"x",
")",
"."
] | def jnyn_zeros(n, nt):
"""Compute nt zeros of Bessel functions Jn(x), Jn'(x), Yn(x), and Yn'(x).
Returns 4 arrays of length `nt`, corresponding to the first `nt` zeros of
Jn(x), Jn'(x), Yn(x), and Yn'(x), respectively.
Parameters
----------
n : int
Order of the Bessel functions
nt ... | [
"def",
"jnyn_zeros",
"(",
"n",
",",
"nt",
")",
":",
"if",
"not",
"(",
"isscalar",
"(",
"nt",
")",
"and",
"isscalar",
"(",
"n",
")",
")",
":",
"raise",
"ValueError",
"(",
"\"Arguments must be scalars.\"",
")",
"if",
"(",
"floor",
"(",
"n",
")",
"!=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/special/basic.py#L199-L227 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_header_value_parser.py | python | get_dtext | (value) | return ptext, value | r""" dtext = <printable ascii except \ [ ]> / obs-dtext
obs-dtext = obs-NO-WS-CTL / quoted-pair
We allow anything except the excluded characters, but if we find any
ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is
added to the token's defects list. Quoted pairs are convert... | r""" dtext = <printable ascii except \ [ ]> / obs-dtext
obs-dtext = obs-NO-WS-CTL / quoted-pair | [
"r",
"dtext",
"=",
"<printable",
"ascii",
"except",
"\\",
"[",
"]",
">",
"/",
"obs",
"-",
"dtext",
"obs",
"-",
"dtext",
"=",
"obs",
"-",
"NO",
"-",
"WS",
"-",
"CTL",
"/",
"quoted",
"-",
"pair"
] | def get_dtext(value):
r""" dtext = <printable ascii except \ [ ]> / obs-dtext
obs-dtext = obs-NO-WS-CTL / quoted-pair
We allow anything except the excluded characters, but if we find any
ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is
added to the token's defects list.... | [
"def",
"get_dtext",
"(",
"value",
")",
":",
"ptext",
",",
"value",
",",
"had_qp",
"=",
"_get_ptext_to_endchars",
"(",
"value",
",",
"'[]'",
")",
"ptext",
"=",
"ValueTerminal",
"(",
"ptext",
",",
"'ptext'",
")",
"if",
"had_qp",
":",
"ptext",
".",
"defects... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/_header_value_parser.py#L1523-L1541 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | ppapi/generators/idl_parser.py | python | IDLParser.p_integer | (self, p) | integer : HEX
| INT
| OCT | integer : HEX
| INT
| OCT | [
"integer",
":",
"HEX",
"|",
"INT",
"|",
"OCT"
] | def p_integer(self, p):
"""integer : HEX
| INT
| OCT"""
p[0] = p[1]
if self.parse_debug: DumpReduction('integer', p) | [
"def",
"p_integer",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"if",
"self",
".",
"parse_debug",
":",
"DumpReduction",
"(",
"'integer'",
",",
"p",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/ppapi/generators/idl_parser.py#L450-L455 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/make_distrib.py | python | combine_libs | (build_dir, libs, dest_lib) | Combine multiple static libraries into a single static library. | Combine multiple static libraries into a single static library. | [
"Combine",
"multiple",
"static",
"libraries",
"into",
"a",
"single",
"static",
"library",
"."
] | def combine_libs(build_dir, libs, dest_lib):
""" Combine multiple static libraries into a single static library. """
cmdline = 'msvs_env.bat win%s python combine_libs.py -o "%s"' % (platform_arch, dest_lib)
for lib in libs:
lib_path = os.path.join(build_dir, lib)
for path in get_files(lib_path): # Expand... | [
"def",
"combine_libs",
"(",
"build_dir",
",",
"libs",
",",
"dest_lib",
")",
":",
"cmdline",
"=",
"'msvs_env.bat win%s python combine_libs.py -o \"%s\"'",
"%",
"(",
"platform_arch",
",",
"dest_lib",
")",
"for",
"lib",
"in",
"libs",
":",
"lib_path",
"=",
"os",
"."... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/make_distrib.py#L242-L251 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_trotting_env.py | python | MinitaurTrottingEnv._get_observation | (self) | return self._observation | Get observations of this environment.
It includes the base roll, pitch, roll dot and pitch dot which may contain
noises, bias, and latency. Also includes the disired/observed motor angles
if the relevant flags are set.
Returns:
The observation list. | Get observations of this environment. | [
"Get",
"observations",
"of",
"this",
"environment",
"."
] | def _get_observation(self):
"""Get observations of this environment.
It includes the base roll, pitch, roll dot and pitch dot which may contain
noises, bias, and latency. Also includes the disired/observed motor angles
if the relevant flags are set.
Returns:
The observation list.
"""
... | [
"def",
"_get_observation",
"(",
"self",
")",
":",
"observation",
"=",
"[",
"]",
"roll",
",",
"pitch",
",",
"_",
"=",
"self",
".",
"minitaur",
".",
"GetBaseRollPitchYaw",
"(",
")",
"roll_rate",
",",
"pitch_rate",
",",
"_",
"=",
"self",
".",
"minitaur",
... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_trotting_env.py#L254-L273 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/smtplib.py | python | SMTP.getreply | (self) | return errcode, errmsg | Get a reply from the server.
Returns a tuple consisting of:
- server response code (e.g. '250', or such, if all goes well)
Note: returns -1 if it can't read response code.
- server response string corresponding to response code (multiline
responses are converted to... | Get a reply from the server. | [
"Get",
"a",
"reply",
"from",
"the",
"server",
"."
] | def getreply(self):
"""Get a reply from the server.
Returns a tuple consisting of:
- server response code (e.g. '250', or such, if all goes well)
Note: returns -1 if it can't read response code.
- server response string corresponding to response code (multiline
... | [
"def",
"getreply",
"(",
"self",
")",
":",
"resp",
"=",
"[",
"]",
"if",
"self",
".",
"file",
"is",
"None",
":",
"self",
".",
"file",
"=",
"self",
".",
"sock",
".",
"makefile",
"(",
"'rb'",
")",
"while",
"1",
":",
"try",
":",
"line",
"=",
"self",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/smtplib.py#L380-L427 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/utils/text.py | python | columnize | (items, row_first=False, separator=' ', displaywidth=80, spread=False) | return '\n'.join(map(sjoin, fmatrix))+'\n' | Transform a list of strings into a single string with columns.
Parameters
----------
items : sequence of strings
The strings to process.
row_first : (default False)
Whether to compute columns for a row-first matrix instead of
column-first (default).
separator : str, option... | Transform a list of strings into a single string with columns. | [
"Transform",
"a",
"list",
"of",
"strings",
"into",
"a",
"single",
"string",
"with",
"columns",
"."
] | def columnize(items, row_first=False, separator=' ', displaywidth=80, spread=False):
""" Transform a list of strings into a single string with columns.
Parameters
----------
items : sequence of strings
The strings to process.
row_first : (default False)
Whether to compute columns ... | [
"def",
"columnize",
"(",
"items",
",",
"row_first",
"=",
"False",
",",
"separator",
"=",
"' '",
",",
"displaywidth",
"=",
"80",
",",
"spread",
"=",
"False",
")",
":",
"if",
"not",
"items",
":",
"return",
"'\\n'",
"matrix",
",",
"info",
"=",
"compute_i... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/utils/text.py#L701-L730 | |
microsoft/AirSim | 8057725712c0cd46979135396381784075ffc0f3 | PythonClient/airsim/client.py | python | VehicleClient.getGpsData | (self, gps_name = '', vehicle_name = '') | return GpsData.from_msgpack(self.client.call('getGpsData', gps_name, vehicle_name)) | Args:
gps_name (str, optional): Name of GPS to get data from, specified in settings.json
vehicle_name (str, optional): Name of vehicle to which the sensor corresponds to
Returns:
GpsData: | Args:
gps_name (str, optional): Name of GPS to get data from, specified in settings.json
vehicle_name (str, optional): Name of vehicle to which the sensor corresponds to | [
"Args",
":",
"gps_name",
"(",
"str",
"optional",
")",
":",
"Name",
"of",
"GPS",
"to",
"get",
"data",
"from",
"specified",
"in",
"settings",
".",
"json",
"vehicle_name",
"(",
"str",
"optional",
")",
":",
"Name",
"of",
"vehicle",
"to",
"which",
"the",
"s... | def getGpsData(self, gps_name = '', vehicle_name = ''):
"""
Args:
gps_name (str, optional): Name of GPS to get data from, specified in settings.json
vehicle_name (str, optional): Name of vehicle to which the sensor corresponds to
Returns:
GpsData:
"""... | [
"def",
"getGpsData",
"(",
"self",
",",
"gps_name",
"=",
"''",
",",
"vehicle_name",
"=",
"''",
")",
":",
"return",
"GpsData",
".",
"from_msgpack",
"(",
"self",
".",
"client",
".",
"call",
"(",
"'getGpsData'",
",",
"gps_name",
",",
"vehicle_name",
")",
")"... | https://github.com/microsoft/AirSim/blob/8057725712c0cd46979135396381784075ffc0f3/PythonClient/airsim/client.py#L872-L881 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Canvas.type | (self, tagOrId) | return self.tk.call(self._w, 'type', tagOrId) or None | Return the type of the item TAGORID. | Return the type of the item TAGORID. | [
"Return",
"the",
"type",
"of",
"the",
"item",
"TAGORID",
"."
] | def type(self, tagOrId):
"""Return the type of the item TAGORID."""
return self.tk.call(self._w, 'type', tagOrId) or None | [
"def",
"type",
"(",
"self",
",",
"tagOrId",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'type'",
",",
"tagOrId",
")",
"or",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L2630-L2632 | |
s9xie/hed | 94fb22f10cbfec8d84fbc0642b224022014b6bd6 | python/caffe/pycaffe.py | python | _Net_blobs | (self) | return OrderedDict(zip(self._blob_names, self._blobs)) | An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name | An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name | [
"An",
"OrderedDict",
"(",
"bottom",
"to",
"top",
"i",
".",
"e",
".",
"input",
"to",
"output",
")",
"of",
"network",
"blobs",
"indexed",
"by",
"name"
] | def _Net_blobs(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
blobs indexed by name
"""
return OrderedDict(zip(self._blob_names, self._blobs)) | [
"def",
"_Net_blobs",
"(",
"self",
")",
":",
"return",
"OrderedDict",
"(",
"zip",
"(",
"self",
".",
"_blob_names",
",",
"self",
".",
"_blobs",
")",
")"
] | https://github.com/s9xie/hed/blob/94fb22f10cbfec8d84fbc0642b224022014b6bd6/python/caffe/pycaffe.py#L22-L27 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/layer/basic.py | python | Dense.__init__ | (self,
in_channels,
out_channels,
weight_init='normal',
bias_init='zeros',
has_bias=True,
activation=None) | Initialize Dense. | Initialize Dense. | [
"Initialize",
"Dense",
"."
] | def __init__(self,
in_channels,
out_channels,
weight_init='normal',
bias_init='zeros',
has_bias=True,
activation=None):
"""Initialize Dense."""
super(Dense, self).__init__()
self.in_channels = V... | [
"def",
"__init__",
"(",
"self",
",",
"in_channels",
",",
"out_channels",
",",
"weight_init",
"=",
"'normal'",
",",
"bias_init",
"=",
"'zeros'",
",",
"has_bias",
"=",
"True",
",",
"activation",
"=",
"None",
")",
":",
"super",
"(",
"Dense",
",",
"self",
")... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/layer/basic.py#L278-L317 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/image_ops.py | python | grayscale_to_rgb | (images, name=None) | Converts one or more images from Grayscale to RGB.
Outputs a tensor of the same `DType` and rank as `images`. The size of the
last dimension of the output is 3, containing the RGB value of the pixels.
Args:
images: The Grayscale tensor to convert. Last dimension must be size 1.
name: A name for the ope... | Converts one or more images from Grayscale to RGB. | [
"Converts",
"one",
"or",
"more",
"images",
"from",
"Grayscale",
"to",
"RGB",
"."
] | def grayscale_to_rgb(images, name=None):
"""Converts one or more images from Grayscale to RGB.
Outputs a tensor of the same `DType` and rank as `images`. The size of the
last dimension of the output is 3, containing the RGB value of the pixels.
Args:
images: The Grayscale tensor to convert. Last dimensio... | [
"def",
"grayscale_to_rgb",
"(",
"images",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"images",
"]",
",",
"name",
",",
"'grayscale_to_rgb'",
")",
"as",
"name",
":",
"images",
"=",
"ops",
".",
"convert_to_tensor",
"(",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/image_ops.py#L1158-L1180 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/wallet.py | python | Wallet.timestamp | (self, timestamp) | Sets the timestamp of this Wallet.
:param timestamp: The timestamp of this Wallet. # noqa: E501
:type: datetime | Sets the timestamp of this Wallet. | [
"Sets",
"the",
"timestamp",
"of",
"this",
"Wallet",
"."
] | def timestamp(self, timestamp):
"""Sets the timestamp of this Wallet.
:param timestamp: The timestamp of this Wallet. # noqa: E501
:type: datetime
"""
self._timestamp = timestamp | [
"def",
"timestamp",
"(",
"self",
",",
"timestamp",
")",
":",
"self",
".",
"_timestamp",
"=",
"timestamp"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/wallet.py#L624-L632 | ||
nucleic/atom | 9f0cb2a8101dd63c354a98ebc7489b2c616dc82a | docs/source/examples/example_doc_generator.py | python | main | () | Generate documentation for all atom examples. | Generate documentation for all atom examples. | [
"Generate",
"documentation",
"for",
"all",
"atom",
"examples",
"."
] | def main():
"""Generate documentation for all atom examples."""
docs_path = os.path.dirname(__file__)
base_path = "../../../examples"
base_path = os.path.realpath(os.path.join(docs_path, base_path))
# Find all the files in the examples directory with a .enaml extension
# that contain the pragma... | [
"def",
"main",
"(",
")",
":",
"docs_path",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
"base_path",
"=",
"\"../../../examples\"",
"base_path",
"=",
"os",
".",
"path",
".",
"realpath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"docs_pa... | https://github.com/nucleic/atom/blob/9f0cb2a8101dd63c354a98ebc7489b2c616dc82a/docs/source/examples/example_doc_generator.py#L109-L121 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/saved_model/utils_impl.py | python | build_tensor_info | (tensor) | return tensor_info | Utility function to build TensorInfo proto.
Args:
tensor: Tensor or SparseTensor whose name, dtype and shape are used to
build the TensorInfo. For SparseTensors, the names of the three
constitutent Tensors are used.
Returns:
A TensorInfo protocol buffer constructed based on the supplied ar... | Utility function to build TensorInfo proto. | [
"Utility",
"function",
"to",
"build",
"TensorInfo",
"proto",
"."
] | def build_tensor_info(tensor):
"""Utility function to build TensorInfo proto.
Args:
tensor: Tensor or SparseTensor whose name, dtype and shape are used to
build the TensorInfo. For SparseTensors, the names of the three
constitutent Tensors are used.
Returns:
A TensorInfo protocol buffer ... | [
"def",
"build_tensor_info",
"(",
"tensor",
")",
":",
"tensor_info",
"=",
"meta_graph_pb2",
".",
"TensorInfo",
"(",
"dtype",
"=",
"dtypes",
".",
"as_dtype",
"(",
"tensor",
".",
"dtype",
")",
".",
"as_datatype_enum",
",",
"tensor_shape",
"=",
"tensor",
".",
"g... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/saved_model/utils_impl.py#L30-L50 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py | python | Numbers.pc_str_width | (cls) | return width | How many characters wide can pc_covered_str be? | How many characters wide can pc_covered_str be? | [
"How",
"many",
"characters",
"wide",
"can",
"pc_covered_str",
"be?"
] | def pc_str_width(cls):
"""How many characters wide can pc_covered_str be?"""
width = 3 # "100"
if cls._precision > 0:
width += 1 + cls._precision
return width | [
"def",
"pc_str_width",
"(",
"cls",
")",
":",
"width",
"=",
"3",
"# \"100\"",
"if",
"cls",
".",
"_precision",
">",
"0",
":",
"width",
"+=",
"1",
"+",
"cls",
".",
"_precision",
"return",
"width"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py#L224-L229 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | scripts/cpp_lint.py | python | _NestingState.Update | (self, filename, clean_lines, linenum, error) | Update nesting state with current line.
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. | Update nesting state with current line. | [
"Update",
"nesting",
"state",
"with",
"current",
"line",
"."
] | def Update(self, filename, clean_lines, linenum, error):
"""Update nesting state with current line.
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 err... | [
"def",
"Update",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Update pp_stack first",
"self",
".",
"UpdatePreprocessor",
"(",
"line",
")",
"# Coun... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/cpp_lint.py#L2008-L2162 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetExecutableName | (self) | Returns the executable name of the bundle represented by this target.
E.g. Chromium. | Returns the executable name of the bundle represented by this target.
E.g. Chromium. | [
"Returns",
"the",
"executable",
"name",
"of",
"the",
"bundle",
"represented",
"by",
"this",
"target",
".",
"E",
".",
"g",
".",
"Chromium",
"."
] | def GetExecutableName(self):
"""Returns the executable name of the bundle represented by this target.
E.g. Chromium."""
if self._IsBundle():
return self.spec.get('product_name', self.spec['target_name'])
else:
return self._GetStandaloneBinaryPath() | [
"def",
"GetExecutableName",
"(",
"self",
")",
":",
"if",
"self",
".",
"_IsBundle",
"(",
")",
":",
"return",
"self",
".",
"spec",
".",
"get",
"(",
"'product_name'",
",",
"self",
".",
"spec",
"[",
"'target_name'",
"]",
")",
"else",
":",
"return",
"self",... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/xcode_emulation.py#L471-L477 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/calendar.py | python | Calendar.itermonthdays | (self, year, month) | Like itermonthdates(), but will yield day numbers. For days outside
the specified month the day number is 0. | Like itermonthdates(), but will yield day numbers. For days outside
the specified month the day number is 0. | [
"Like",
"itermonthdates",
"()",
"but",
"will",
"yield",
"day",
"numbers",
".",
"For",
"days",
"outside",
"the",
"specified",
"month",
"the",
"day",
"number",
"is",
"0",
"."
] | def itermonthdays(self, year, month):
"""
Like itermonthdates(), but will yield day numbers. For days outside
the specified month the day number is 0.
"""
for date in self.itermonthdates(year, month):
if date.month != month:
yield 0
else:
... | [
"def",
"itermonthdays",
"(",
"self",
",",
"year",
",",
"month",
")",
":",
"for",
"date",
"in",
"self",
".",
"itermonthdates",
"(",
"year",
",",
"month",
")",
":",
"if",
"date",
".",
"month",
"!=",
"month",
":",
"yield",
"0",
"else",
":",
"yield",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/calendar.py#L183-L192 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py | python | _handle_ns | (packageName, path_item) | return subpath | Ensure that named package includes a subpath of path_item (if needed) | Ensure that named package includes a subpath of path_item (if needed) | [
"Ensure",
"that",
"named",
"package",
"includes",
"a",
"subpath",
"of",
"path_item",
"(",
"if",
"needed",
")"
] | def _handle_ns(packageName, path_item):
"""Ensure that named package includes a subpath of path_item (if needed)"""
importer = get_importer(path_item)
if importer is None:
return None
# use find_spec (PEP 451) and fall-back to find_module (PEP 302)
try:
loader = importer.find_spec(... | [
"def",
"_handle_ns",
"(",
"packageName",
",",
"path_item",
")",
":",
"importer",
"=",
"get_importer",
"(",
"path_item",
")",
"if",
"importer",
"is",
"None",
":",
"return",
"None",
"# use find_spec (PEP 451) and fall-back to find_module (PEP 302)",
"try",
":",
"loader"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L2193-L2225 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/datetimelike.py | python | DatetimeTimedeltaMixin._set_freq | (self, freq) | Set the _freq attribute on our underlying DatetimeArray.
Parameters
----------
freq : DateOffset, None, or "infer" | Set the _freq attribute on our underlying DatetimeArray. | [
"Set",
"the",
"_freq",
"attribute",
"on",
"our",
"underlying",
"DatetimeArray",
"."
] | def _set_freq(self, freq):
"""
Set the _freq attribute on our underlying DatetimeArray.
Parameters
----------
freq : DateOffset, None, or "infer"
"""
# GH#29843
if freq is None:
# Always valid
pass
elif len(self) == 0 and i... | [
"def",
"_set_freq",
"(",
"self",
",",
"freq",
")",
":",
"# GH#29843",
"if",
"freq",
"is",
"None",
":",
"# Always valid",
"pass",
"elif",
"len",
"(",
"self",
")",
"==",
"0",
"and",
"isinstance",
"(",
"freq",
",",
"DateOffset",
")",
":",
"# Always valid. ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/datetimelike.py#L575-L596 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/array_ops.py | python | _OneHotShape | (op) | return [tensor_shape.TensorShape(new_shape)] | Shape function for the OneHot op.
It closely follows the code in the .cc implementation.
Args:
op: A OneHot Operation.
Returns:
A single-element list containing the shape of the output.
Raises:
ValueError: if axis < -1. | Shape function for the OneHot op. | [
"Shape",
"function",
"for",
"the",
"OneHot",
"op",
"."
] | def _OneHotShape(op):
"""Shape function for the OneHot op.
It closely follows the code in the .cc implementation.
Args:
op: A OneHot Operation.
Returns:
A single-element list containing the shape of the output.
Raises:
ValueError: if axis < -1.
"""
indices_shape = op.inputs[0].get_shape()
... | [
"def",
"_OneHotShape",
"(",
"op",
")",
":",
"indices_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
"indices_dims",
"=",
"indices_shape",
".",
"ndims",
"depth",
"=",
"tensor_util",
".",
"constant_value",
"(",
"op",
".",
"inp... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/array_ops.py#L2721-L2748 | |
Kitware/kwiver | 7ed70308905698b6e88d27ae3dc028c9b016ca0a | python/kwiver/sprokit/processes/pytorch/utils/parse_gpu_list.py | python | get_device | (gpu_list=None) | return torch.device('cuda:{}'.format(gpu_list[0])), True | Get a Pytorch device corresponding to one of the GPU indices listed
in gpu_list. If gpu_list is empty, get the device corresponding
to the CPU instead. If gpu_list is None (the default), enumerate
the available GPU indices and pick one as though the list had been
passed directly, except that in the ca... | Get a Pytorch device corresponding to one of the GPU indices listed
in gpu_list. If gpu_list is empty, get the device corresponding
to the CPU instead. If gpu_list is None (the default), enumerate
the available GPU indices and pick one as though the list had been
passed directly, except that in the ca... | [
"Get",
"a",
"Pytorch",
"device",
"corresponding",
"to",
"one",
"of",
"the",
"GPU",
"indices",
"listed",
"in",
"gpu_list",
".",
"If",
"gpu_list",
"is",
"empty",
"get",
"the",
"device",
"corresponding",
"to",
"the",
"CPU",
"instead",
".",
"If",
"gpu_list",
"... | def get_device(gpu_list=None):
"""Get a Pytorch device corresponding to one of the GPU indices listed
in gpu_list. If gpu_list is empty, get the device corresponding
to the CPU instead. If gpu_list is None (the default), enumerate
the available GPU indices and pick one as though the list had been
... | [
"def",
"get_device",
"(",
"gpu_list",
"=",
"None",
")",
":",
"if",
"gpu_list",
"is",
"None",
":",
"gpu_list",
"=",
"list",
"(",
"range",
"(",
"torch",
".",
"cuda",
".",
"device_count",
"(",
")",
")",
")",
"elif",
"not",
"gpu_list",
":",
"return",
"to... | https://github.com/Kitware/kwiver/blob/7ed70308905698b6e88d27ae3dc028c9b016ca0a/python/kwiver/sprokit/processes/pytorch/utils/parse_gpu_list.py#L61-L79 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/third_party.py | python | evaluate_node_alias_map | (lib_root, lib_name) | return evaluated_name_alias_map | Given a root of a lib config, perform an evaluation of all the aliases and produce a map of its value
:param lib_root: The lib root
:return: The map of aliased values | Given a root of a lib config, perform an evaluation of all the aliases and produce a map of its value
:param lib_root: The lib root
:return: The map of aliased values | [
"Given",
"a",
"root",
"of",
"a",
"lib",
"config",
"perform",
"an",
"evaluation",
"of",
"all",
"the",
"aliases",
"and",
"produce",
"a",
"map",
"of",
"its",
"value",
":",
"param",
"lib_root",
":",
"The",
"lib",
"root",
":",
"return",
":",
"The",
"map",
... | def evaluate_node_alias_map(lib_root, lib_name):
"""
Given a root of a lib config, perform an evaluation of all the aliases and produce a map of its value
:param lib_root: The lib root
:return: The map of aliased values
"""
def _process_alias_value(name_alias_map, name_alias_value, visit_st... | [
"def",
"evaluate_node_alias_map",
"(",
"lib_root",
",",
"lib_name",
")",
":",
"def",
"_process_alias_value",
"(",
"name_alias_map",
",",
"name_alias_value",
",",
"visit_stack",
")",
":",
"alias_match",
"=",
"ALIAS_SEARCH_PATTERN",
".",
"search",
"(",
"name_alias_value... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/third_party.py#L112-L172 | |
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/rules/rule.py | python | Wrap.serialize | (self, serializer) | Load/unload class state to/from serializer object. | Load/unload class state to/from serializer object. | [
"Load",
"/",
"unload",
"class",
"state",
"to",
"/",
"from",
"serializer",
"object",
"."
] | def serialize(self, serializer):
"""Load/unload class state to/from serializer object."""
serializer.serializeValue(self)
serializer.serializeAttribute(self, common.CODE_ID) | [
"def",
"serialize",
"(",
"self",
",",
"serializer",
")",
":",
"serializer",
".",
"serializeValue",
"(",
"self",
")",
"serializer",
".",
"serializeAttribute",
"(",
"self",
",",
"common",
".",
"CODE_ID",
")"
] | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/rules/rule.py#L140-L143 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/edit_config_handler.py | python | _ChangeTestPatterns | (old_patterns, new_patterns) | return _RemoveOverlapping(added_test_paths, removed_test_paths) | Updates tests that are different between old_patterns and new_patterns.
The two arguments both represent sets of test paths (i.e. sets of data
series). Any tests that are different between these two sets need to be
updated.
Some properties of TestMetadata entities are updated when they are put in the
|_pre_... | Updates tests that are different between old_patterns and new_patterns. | [
"Updates",
"tests",
"that",
"are",
"different",
"between",
"old_patterns",
"and",
"new_patterns",
"."
] | def _ChangeTestPatterns(old_patterns, new_patterns):
"""Updates tests that are different between old_patterns and new_patterns.
The two arguments both represent sets of test paths (i.e. sets of data
series). Any tests that are different between these two sets need to be
updated.
Some properties of TestMetad... | [
"def",
"_ChangeTestPatterns",
"(",
"old_patterns",
",",
"new_patterns",
")",
":",
"added_patterns",
",",
"removed_patterns",
"=",
"_ComputeDeltas",
"(",
"old_patterns",
",",
"new_patterns",
")",
"added_test_paths",
"=",
"_AllTestPathsMatchingPatterns",
"(",
"added_pattern... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/edit_config_handler.py#L165-L189 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/base/renderers.py | python | Renderer.getRoot | (self) | Return the rendered content root node.
Called by the Translator prior to beginning rendering. | Return the rendered content root node. | [
"Return",
"the",
"rendered",
"content",
"root",
"node",
"."
] | def getRoot(self):
"""
Return the rendered content root node.
Called by the Translator prior to beginning rendering.
"""
raise NotImplementedError() | [
"def",
"getRoot",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/base/renderers.py#L59-L65 | ||
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | dali/python/nvidia/dali/math.py | python | clamp | (value, lo, hi) | return _arithm_op("clamp", value, lo, hi) | Produces a tensor of values from ``value`` clamped to the range ``[lo, hi]``.
:rtype: TensorList of the type that is calculated based on the type promotion rules. | Produces a tensor of values from ``value`` clamped to the range ``[lo, hi]``. | [
"Produces",
"a",
"tensor",
"of",
"values",
"from",
"value",
"clamped",
"to",
"the",
"range",
"[",
"lo",
"hi",
"]",
"."
] | def clamp(value, lo, hi):
"""Produces a tensor of values from ``value`` clamped to the range ``[lo, hi]``.
:rtype: TensorList of the type that is calculated based on the type promotion rules.
"""
return _arithm_op("clamp", value, lo, hi) | [
"def",
"clamp",
"(",
"value",
",",
"lo",
",",
"hi",
")",
":",
"return",
"_arithm_op",
"(",
"\"clamp\"",
",",
"value",
",",
"lo",
",",
"hi",
")"
] | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/dali/python/nvidia/dali/math.py#L245-L250 | |
libornovax/master_thesis_code | 6eca474ed3cae673afde010caef338cf7349f839 | caffe/python/caffe/pycaffe.py | python | _Net_forward_all | (self, blobs=None, **kwargs) | return all_outs | Run net forward in batches.
Parameters
----------
blobs : list of blobs to extract as in forward()
kwargs : Keys are input blob names and values are blob ndarrays.
Refer to forward().
Returns
-------
all_outs : {blob name: list of blobs} dict. | Run net forward in batches. | [
"Run",
"net",
"forward",
"in",
"batches",
"."
] | def _Net_forward_all(self, blobs=None, **kwargs):
"""
Run net forward in batches.
Parameters
----------
blobs : list of blobs to extract as in forward()
kwargs : Keys are input blob names and values are blob ndarrays.
Refer to forward().
Returns
-------
all_outs : {blo... | [
"def",
"_Net_forward_all",
"(",
"self",
",",
"blobs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Collect outputs from batches",
"all_outs",
"=",
"{",
"out",
":",
"[",
"]",
"for",
"out",
"in",
"set",
"(",
"self",
".",
"outputs",
"+",
"(",
"blobs... | https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/caffe/python/caffe/pycaffe.py#L175-L203 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matrixlib/defmatrix.py | python | matrix.all | (self, axis=None, out=None) | return N.ndarray.all(self, axis, out, keepdims=True)._collapse(axis) | Test whether all matrix elements along a given axis evaluate to True.
Parameters
----------
See `numpy.all` for complete descriptions
See Also
--------
numpy.all
Notes
-----
This is the same as `ndarray.all`, but it returns a `matrix` object.
... | Test whether all matrix elements along a given axis evaluate to True. | [
"Test",
"whether",
"all",
"matrix",
"elements",
"along",
"a",
"given",
"axis",
"evaluate",
"to",
"True",
"."
] | def all(self, axis=None, out=None):
"""
Test whether all matrix elements along a given axis evaluate to True.
Parameters
----------
See `numpy.all` for complete descriptions
See Also
--------
numpy.all
Notes
-----
This is the sam... | [
"def",
"all",
"(",
"self",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
")",
":",
"return",
"N",
".",
"ndarray",
".",
"all",
"(",
"self",
",",
"axis",
",",
"out",
",",
"keepdims",
"=",
"True",
")",
".",
"_collapse",
"(",
"axis",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matrixlib/defmatrix.py#L615-L653 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | samples/doodle/superdoodle.py | python | ControlPanel.OnSetThickness | (self, event) | Use the event ID to set the thickness in the doodle. | Use the event ID to set the thickness in the doodle. | [
"Use",
"the",
"event",
"ID",
"to",
"set",
"the",
"thickness",
"in",
"the",
"doodle",
"."
] | def OnSetThickness(self, event):
"""
Use the event ID to set the thickness in the doodle.
"""
thickness = event.GetId()
if thickness != self.doodle.thickness:
# untoggle the old thickness button
self.thknsBtns[self.doodle.thickness].SetToggle(False)
... | [
"def",
"OnSetThickness",
"(",
"self",
",",
"event",
")",
":",
"thickness",
"=",
"event",
".",
"GetId",
"(",
")",
"if",
"thickness",
"!=",
"self",
".",
"doodle",
".",
"thickness",
":",
"# untoggle the old thickness button",
"self",
".",
"thknsBtns",
"[",
"sel... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/doodle/superdoodle.py#L283-L292 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | buildconfig/python_export_maker.py | python | get_namespace | (headerfile) | return namespace | Returns the Mantid namespace that the header resides in | Returns the Mantid namespace that the header resides in | [
"Returns",
"the",
"Mantid",
"namespace",
"that",
"the",
"header",
"resides",
"in"
] | def get_namespace(headerfile):
"""
Returns the Mantid namespace that the header resides in
"""
matches = re.match(r".*inc(/|\\)Mantid(\w+)(/|\\).*\.h", headerfile)
if matches:
namespace = matches.group(2)
else:
raise RuntimeError("Unknown header path style. Cannot extract Mantid ... | [
"def",
"get_namespace",
"(",
"headerfile",
")",
":",
"matches",
"=",
"re",
".",
"match",
"(",
"r\".*inc(/|\\\\)Mantid(\\w+)(/|\\\\).*\\.h\"",
",",
"headerfile",
")",
"if",
"matches",
":",
"namespace",
"=",
"matches",
".",
"group",
"(",
"2",
")",
"else",
":",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/buildconfig/python_export_maker.py#L41-L50 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/autodiff/kinematics_ad.py | python | KinematicsBuilder.world_angular_velocity | (self,link) | return self.link_angular_velocities[link] | Returns an autodiff expression for the world angular velocity of the
given link.
Expression evaluates to a 9-D so3_ad array. | Returns an autodiff expression for the world angular velocity of the
given link. | [
"Returns",
"an",
"autodiff",
"expression",
"for",
"the",
"world",
"angular",
"velocity",
"of",
"the",
"given",
"link",
"."
] | def world_angular_velocity(self,link):
"""Returns an autodiff expression for the world angular velocity of the
given link.
Expression evaluates to a 9-D so3_ad array.
"""
link = self._link_index(link)
return self.link_angular_velocities[link] | [
"def",
"world_angular_velocity",
"(",
"self",
",",
"link",
")",
":",
"link",
"=",
"self",
".",
"_link_index",
"(",
"link",
")",
"return",
"self",
".",
"link_angular_velocities",
"[",
"link",
"]"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/autodiff/kinematics_ad.py#L551-L558 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/msi.py | python | build_wxsfile_default_gui | (root) | This function adds a default GUI to the wxs file | This function adds a default GUI to the wxs file | [
"This",
"function",
"adds",
"a",
"default",
"GUI",
"to",
"the",
"wxs",
"file"
] | def build_wxsfile_default_gui(root):
""" This function adds a default GUI to the wxs file
"""
factory = Document()
Product = root.getElementsByTagName('Product')[0]
UIRef = factory.createElement('UIRef')
UIRef.attributes['Id'] = 'WixUI_Mondo'
Product.childNodes.append(UIRef)
UIRef ... | [
"def",
"build_wxsfile_default_gui",
"(",
"root",
")",
":",
"factory",
"=",
"Document",
"(",
")",
"Product",
"=",
"root",
".",
"getElementsByTagName",
"(",
"'Product'",
")",
"[",
"0",
"]",
"UIRef",
"=",
"factory",
".",
"createElement",
"(",
"'UIRef'",
")",
... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/msi.py#L417-L429 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py | python | _singlefileMailbox.__len__ | (self) | return len(self._toc) | Return a count of messages in the mailbox. | Return a count of messages in the mailbox. | [
"Return",
"a",
"count",
"of",
"messages",
"in",
"the",
"mailbox",
"."
] | def __len__(self):
"""Return a count of messages in the mailbox."""
self._lookup()
return len(self._toc) | [
"def",
"__len__",
"(",
"self",
")",
":",
"self",
".",
"_lookup",
"(",
")",
"return",
"len",
"(",
"self",
".",
"_toc",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L617-L620 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/gem5/components/processors/complex_generator_core.py | python | ComplexGeneratorCore._create_linear_traffic | (
self,
duration: str,
rate: str,
block_size: int,
min_addr: int,
max_addr: int,
rd_perc: int,
data_limit: int,
) | This function yields (creates) a linear traffic based on the input
params. Then it will yield (create) an exit traffic (exit traffic is
used to exit the simulation).
:param duration: The number of ticks for the generator core to generate
traffic.
:param rate: The rate at which t... | This function yields (creates) a linear traffic based on the input
params. Then it will yield (create) an exit traffic (exit traffic is
used to exit the simulation). | [
"This",
"function",
"yields",
"(",
"creates",
")",
"a",
"linear",
"traffic",
"based",
"on",
"the",
"input",
"params",
".",
"Then",
"it",
"will",
"yield",
"(",
"create",
")",
"an",
"exit",
"traffic",
"(",
"exit",
"traffic",
"is",
"used",
"to",
"exit",
"... | def _create_linear_traffic(
self,
duration: str,
rate: str,
block_size: int,
min_addr: int,
max_addr: int,
rd_perc: int,
data_limit: int,
) -> None:
"""
This function yields (creates) a linear traffic based on the input
params. ... | [
"def",
"_create_linear_traffic",
"(",
"self",
",",
"duration",
":",
"str",
",",
"rate",
":",
"str",
",",
"block_size",
":",
"int",
",",
"min_addr",
":",
"int",
",",
"max_addr",
":",
"int",
",",
"rd_perc",
":",
"int",
",",
"data_limit",
":",
"int",
",",... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/gem5/components/processors/complex_generator_core.py#L242-L286 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/estimators/head.py | python | _assert_class_id | (class_id, num_classes=None) | Average label value for class `class_id`. | Average label value for class `class_id`. | [
"Average",
"label",
"value",
"for",
"class",
"class_id",
"."
] | def _assert_class_id(class_id, num_classes=None):
"""Average label value for class `class_id`."""
if (class_id is None) or (class_id < 0):
raise ValueError("Invalid class_id %s." % class_id)
if num_classes is not None:
if num_classes < 2:
raise ValueError("Invalid num_classes %s." % num_classes)
... | [
"def",
"_assert_class_id",
"(",
"class_id",
",",
"num_classes",
"=",
"None",
")",
":",
"if",
"(",
"class_id",
"is",
"None",
")",
"or",
"(",
"class_id",
"<",
"0",
")",
":",
"raise",
"ValueError",
"(",
"\"Invalid class_id %s.\"",
"%",
"class_id",
")",
"if",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/head.py#L2017-L2025 | ||
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/swift_build_support/swift_build_support/targets.py | python | Platform.cmake_options | (self, args) | return '' | CMake flags to build for a platform, useful for cross-compiling | CMake flags to build for a platform, useful for cross-compiling | [
"CMake",
"flags",
"to",
"build",
"for",
"a",
"platform",
"useful",
"for",
"cross",
"-",
"compiling"
] | def cmake_options(self, args):
"""
CMake flags to build for a platform, useful for cross-compiling
"""
return '' | [
"def",
"cmake_options",
"(",
"self",
",",
"args",
")",
":",
"return",
"''"
] | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/swift_build_support/swift_build_support/targets.py#L77-L81 | |
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | elle/drake/src/drake/__init__.py | python | FunctionExpander.function | (self) | return self.__function | The function. | The function. | [
"The",
"function",
"."
] | def function(self):
"""The function."""
return self.__function | [
"def",
"function",
"(",
"self",
")",
":",
"return",
"self",
".",
"__function"
] | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L2842-L2844 | |
koth/kcws | 88efbd36a7022de4e6e90f5a1fb880cf87cfae9f | third_party/setuptools/pkg_resources.py | python | DistInfoDistribution._compute_dependencies | (self) | return dm | Recompute this distribution's dependencies. | Recompute this distribution's dependencies. | [
"Recompute",
"this",
"distribution",
"s",
"dependencies",
"."
] | def _compute_dependencies(self):
"""Recompute this distribution's dependencies."""
from _markerlib import compile as compile_marker
dm = self.__dep_map = {None: []}
reqs = []
# Including any condition expressions
for req in self._parsed_pkg_info.get_all('Requires-Dist') ... | [
"def",
"_compute_dependencies",
"(",
"self",
")",
":",
"from",
"_markerlib",
"import",
"compile",
"as",
"compile_marker",
"dm",
"=",
"self",
".",
"__dep_map",
"=",
"{",
"None",
":",
"[",
"]",
"}",
"reqs",
"=",
"[",
"]",
"# Including any condition expressions",... | https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/setuptools/pkg_resources.py#L2577-L2602 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus3.in.py | python | exodus.get_node_set_name | (self, object_id) | return self.__ex_get_name('EX_NODE_SET', object_id) | get the name of a node set
>>> node_set_name = exo.get_node_set_name(node_set_id)
Parameters
----------
<int> node_set_id node set *ID* (not *INDEX*)
Returns
-------
<string> node_set_name | get the name of a node set | [
"get",
"the",
"name",
"of",
"a",
"node",
"set"
] | def get_node_set_name(self, object_id):
"""
get the name of a node set
>>> node_set_name = exo.get_node_set_name(node_set_id)
Parameters
----------
<int> node_set_id node set *ID* (not *INDEX*)
Returns
-------
<string> node_set_name
... | [
"def",
"get_node_set_name",
"(",
"self",
",",
"object_id",
")",
":",
"return",
"self",
".",
"__ex_get_name",
"(",
"'EX_NODE_SET'",
",",
"object_id",
")"
] | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L3180-L3194 | |
sofa-framework/sofa | 70628e35a44fcc258cf8250109b5e4eba8c5abe9 | applications/plugins/PSL/python/pslengine.py | python | populateFrame | (cname, frame, stack) | Initialize a frame from the current attributes of the 'self' object
This is needed to expose the data as first class object. | Initialize a frame from the current attributes of the 'self' object
This is needed to expose the data as first class object. | [
"Initialize",
"a",
"frame",
"from",
"the",
"current",
"attributes",
"of",
"the",
"self",
"object",
"This",
"is",
"needed",
"to",
"expose",
"the",
"data",
"as",
"first",
"class",
"object",
"."
] | def populateFrame(cname, frame, stack):
"""Initialize a frame from the current attributes of the 'self' object
This is needed to expose the data as first class object.
"""
fself = getFromStack("self", stack)
if fself == None:
return | [
"def",
"populateFrame",
"(",
"cname",
",",
"frame",
",",
"stack",
")",
":",
"fself",
"=",
"getFromStack",
"(",
"\"self\"",
",",
"stack",
")",
"if",
"fself",
"==",
"None",
":",
"return"
] | https://github.com/sofa-framework/sofa/blob/70628e35a44fcc258cf8250109b5e4eba8c5abe9/applications/plugins/PSL/python/pslengine.py#L112-L118 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/factorization/examples/mnist.py | python | run_training | () | Train MNIST for a number of steps. | Train MNIST for a number of steps. | [
"Train",
"MNIST",
"for",
"a",
"number",
"of",
"steps",
"."
] | def run_training():
"""Train MNIST for a number of steps."""
# Get the sets of images and labels for training, validation, and
# test on MNIST.
train_dir = tempfile.mkdtemp()
data_sets = input_data.read_data_sets(train_dir, FLAGS.fake_data)
# Tell TensorFlow that the model will be built into the default Gr... | [
"def",
"run_training",
"(",
")",
":",
"# Get the sets of images and labels for training, validation, and",
"# test on MNIST.",
"train_dir",
"=",
"tempfile",
".",
"mkdtemp",
"(",
")",
"data_sets",
"=",
"input_data",
".",
"read_data_sets",
"(",
"train_dir",
",",
"FLAGS",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/factorization/examples/mnist.py#L192-L281 | ||
lrjconan/GRAN | 43cb4433e6f69401c3a4a6e946ea75da6ec35d72 | utils/dist_helper.py | python | gaussian_emd | (x, y, sigma=1.0, distance_scaling=1.0) | return np.exp(-emd * emd / (2 * sigma * sigma)) | Gaussian kernel with squared distance in exponential term replaced by EMD
Args:
x, y: 1D pmf of two distributions with the same support
sigma: standard deviation | Gaussian kernel with squared distance in exponential term replaced by EMD
Args:
x, y: 1D pmf of two distributions with the same support
sigma: standard deviation | [
"Gaussian",
"kernel",
"with",
"squared",
"distance",
"in",
"exponential",
"term",
"replaced",
"by",
"EMD",
"Args",
":",
"x",
"y",
":",
"1D",
"pmf",
"of",
"two",
"distributions",
"with",
"the",
"same",
"support",
"sigma",
":",
"standard",
"deviation"
] | def gaussian_emd(x, y, sigma=1.0, distance_scaling=1.0):
''' Gaussian kernel with squared distance in exponential term replaced by EMD
Args:
x, y: 1D pmf of two distributions with the same support
sigma: standard deviation
'''
support_size = max(len(x), len(y))
d_mat = toeplitz(range(support_siz... | [
"def",
"gaussian_emd",
"(",
"x",
",",
"y",
",",
"sigma",
"=",
"1.0",
",",
"distance_scaling",
"=",
"1.0",
")",
":",
"support_size",
"=",
"max",
"(",
"len",
"(",
"x",
")",
",",
"len",
"(",
"y",
")",
")",
"d_mat",
"=",
"toeplitz",
"(",
"range",
"("... | https://github.com/lrjconan/GRAN/blob/43cb4433e6f69401c3a4a6e946ea75da6ec35d72/utils/dist_helper.py#L57-L76 | |
qboticslabs/mastering_ros | d83e78f30acc45b0f18522c1d5fae3a7f52974b9 | chapter_4_codes/seven_dof_arm_gazebo/scripts/pick_and_place_both_working_good.py | python | CokeCanPickAndPlace._place | (self, group, target, place) | return True | Place a target using the planning group | Place a target using the planning group | [
"Place",
"a",
"target",
"using",
"the",
"planning",
"group"
] | def _place(self, group, target, place):
"""
Place a target using the planning group
"""
# Obtain possible places:
places = self._generate_places(place)
# Create and send Place goal:
goal = self._create_place_goal(group, target, places)
state = self._pla... | [
"def",
"_place",
"(",
"self",
",",
"group",
",",
"target",
",",
"place",
")",
":",
"# Obtain possible places:",
"places",
"=",
"self",
".",
"_generate_places",
"(",
"place",
")",
"# Create and send Place goal:",
"goal",
"=",
"self",
".",
"_create_place_goal",
"(... | https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_4_codes/seven_dof_arm_gazebo/scripts/pick_and_place_both_working_good.py#L324-L349 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | HDFStore._identify_group | (self, key: str, append: bool) | return group | Identify HDF5 group based on key, delete/create group if needed. | Identify HDF5 group based on key, delete/create group if needed. | [
"Identify",
"HDF5",
"group",
"based",
"on",
"key",
"delete",
"/",
"create",
"group",
"if",
"needed",
"."
] | def _identify_group(self, key: str, append: bool) -> Node:
"""Identify HDF5 group based on key, delete/create group if needed."""
group = self.get_node(key)
# we make this assertion for mypy; the get_node call will already
# have raised if this is incorrect
assert self._handle i... | [
"def",
"_identify_group",
"(",
"self",
",",
"key",
":",
"str",
",",
"append",
":",
"bool",
")",
"->",
"Node",
":",
"group",
"=",
"self",
".",
"get_node",
"(",
"key",
")",
"# we make this assertion for mypy; the get_node call will already",
"# have raised if this is ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L1796-L1812 | |
yuxng/PoseCNN | 9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04 | lib/utils/bbox_transform.py | python | clip_boxes | (boxes, im_shape) | return boxes | Clip boxes to image boundaries. | Clip boxes to image boundaries. | [
"Clip",
"boxes",
"to",
"image",
"boundaries",
"."
] | def clip_boxes(boxes, im_shape):
"""
Clip boxes to image boundaries.
"""
# x1 >= 0
boxes[:, 0::4] = np.maximum(np.minimum(boxes[:, 0::4], im_shape[1] - 1), 0)
# y1 >= 0
boxes[:, 1::4] = np.maximum(np.minimum(boxes[:, 1::4], im_shape[0] - 1), 0)
# x2 < im_shape[1]
boxes[:, 2::4] = np.maximum(np.minimu... | [
"def",
"clip_boxes",
"(",
"boxes",
",",
"im_shape",
")",
":",
"# x1 >= 0",
"boxes",
"[",
":",
",",
"0",
":",
":",
"4",
"]",
"=",
"np",
".",
"maximum",
"(",
"np",
".",
"minimum",
"(",
"boxes",
"[",
":",
",",
"0",
":",
":",
"4",
"]",
",",
"im_s... | https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/utils/bbox_transform.py#L67-L80 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py | python | Babyl.get_file | (self, key) | return io.BytesIO(self.get_bytes(key).replace(b'\n', linesep)) | Return a file-like representation or raise a KeyError. | Return a file-like representation or raise a KeyError. | [
"Return",
"a",
"file",
"-",
"like",
"representation",
"or",
"raise",
"a",
"KeyError",
"."
] | def get_file(self, key):
"""Return a file-like representation or raise a KeyError."""
return io.BytesIO(self.get_bytes(key).replace(b'\n', linesep)) | [
"def",
"get_file",
"(",
"self",
",",
"key",
")",
":",
"return",
"io",
".",
"BytesIO",
"(",
"self",
".",
"get_bytes",
"(",
"key",
")",
".",
"replace",
"(",
"b'\\n'",
",",
"linesep",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L1317-L1319 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/algorithm_detail/batch_execution.py | python | rename_group_workspace | (name_of_workspace, name_of_group_workspace) | Rename a group workspace
:param name_of_workspace: current name of group workspace
:param name_of_group_workspace: target name of group workspace | Rename a group workspace
:param name_of_workspace: current name of group workspace
:param name_of_group_workspace: target name of group workspace | [
"Rename",
"a",
"group",
"workspace",
":",
"param",
"name_of_workspace",
":",
"current",
"name",
"of",
"group",
"workspace",
":",
"param",
"name_of_group_workspace",
":",
"target",
"name",
"of",
"group",
"workspace"
] | def rename_group_workspace(name_of_workspace, name_of_group_workspace):
"""
Rename a group workspace
:param name_of_workspace: current name of group workspace
:param name_of_group_workspace: target name of group workspace
"""
rename_name = "RenameWorkspace"
rename_options = {"InputWorkspace"... | [
"def",
"rename_group_workspace",
"(",
"name_of_workspace",
",",
"name_of_group_workspace",
")",
":",
"rename_name",
"=",
"\"RenameWorkspace\"",
"rename_options",
"=",
"{",
"\"InputWorkspace\"",
":",
"name_of_workspace",
",",
"\"OutputWorkspace\"",
":",
"name_of_group_workspac... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/batch_execution.py#L1067-L1078 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | screen.scroll_down | (self) | Scroll display down one line. | Scroll display down one line. | [
"Scroll",
"display",
"down",
"one",
"line",
"."
] | def scroll_down (self): # <ESC>D
'''Scroll display down one line.'''
# Screen is indexed from 1, but arrays are indexed from 0.
s = self.scroll_row_start - 1
e = self.scroll_row_end - 1
self.w[s+1:e+1] = copy.deepcopy(self.w[s:e]) | [
"def",
"scroll_down",
"(",
"self",
")",
":",
"# <ESC>D",
"# Screen is indexed from 1, but arrays are indexed from 0.",
"s",
"=",
"self",
".",
"scroll_row_start",
"-",
"1",
"e",
"=",
"self",
".",
"scroll_row_end",
"-",
"1",
"self",
".",
"w",
"[",
"s",
"+",
"1",... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L360-L366 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/math_ops.py | python | Invert.__init__ | (self) | Initialize Invert | Initialize Invert | [
"Initialize",
"Invert"
] | def __init__(self):
"""Initialize Invert"""
self.init_prim_io_names(inputs=['x'], outputs=['y']) | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"init_prim_io_names",
"(",
"inputs",
"=",
"[",
"'x'",
"]",
",",
"outputs",
"=",
"[",
"'y'",
"]",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/math_ops.py#L5177-L5179 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Tools/generateBase/generateTools.py | python | temporary_exec | (text, globals, locals) | this function is a dirty hack to allow using the copier from
python2 and python3. Once the support of python2 has stopped
feel free to remove this function and use the std exec function
instead | this function is a dirty hack to allow using the copier from
python2 and python3. Once the support of python2 has stopped
feel free to remove this function and use the std exec function
instead | [
"this",
"function",
"is",
"a",
"dirty",
"hack",
"to",
"allow",
"using",
"the",
"copier",
"from",
"python2",
"and",
"python3",
".",
"Once",
"the",
"support",
"of",
"python2",
"has",
"stopped",
"feel",
"free",
"to",
"remove",
"this",
"function",
"and",
"use"... | def temporary_exec(text, globals, locals):
"""this function is a dirty hack to allow using the copier from
python2 and python3. Once the support of python2 has stopped
feel free to remove this function and use the std exec function
instead"""
# maybe this should be fixed by rewriting the g... | [
"def",
"temporary_exec",
"(",
"text",
",",
"globals",
",",
"locals",
")",
":",
"# maybe this should be fixed by rewriting the generators.",
"if",
"sys",
".",
"version_info",
"[",
"0",
"]",
"<",
"3",
":",
"from",
".",
"__exec_old",
"import",
"__exec_old__",
"__exec... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Tools/generateBase/generateTools.py#L10-L21 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/models.py | python | bidirectional_rnn | (cell_fw,
cell_bw,
inputs,
initial_state_fw=None,
initial_state_bw=None,
dtype=None,
sequence_length=None,
scope=None) | return outputs, array_ops_.concat(1, [state_fw, state_bw]) | Creates a bidirectional recurrent neural network.
Similar to the unidirectional case (rnn) but takes input and builds
independent forward and backward RNNs with the final forward and backward
outputs depth-concatenated, such that the output will have the format
[time][batch][cell_fw.output_size + cell_bw.outpu... | Creates a bidirectional recurrent neural network. | [
"Creates",
"a",
"bidirectional",
"recurrent",
"neural",
"network",
"."
] | def bidirectional_rnn(cell_fw,
cell_bw,
inputs,
initial_state_fw=None,
initial_state_bw=None,
dtype=None,
sequence_length=None,
scope=None):
"""Creates a bidirectio... | [
"def",
"bidirectional_rnn",
"(",
"cell_fw",
",",
"cell_bw",
",",
"inputs",
",",
"initial_state_fw",
"=",
"None",
",",
"initial_state_bw",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"sequence_length",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"if"... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/models.py#L266-L336 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | Colour.Alpha | (*args, **kwargs) | return _gdi_.Colour_Alpha(*args, **kwargs) | Alpha(self) -> byte
Returns the Alpha value. | Alpha(self) -> byte | [
"Alpha",
"(",
"self",
")",
"-",
">",
"byte"
] | def Alpha(*args, **kwargs):
"""
Alpha(self) -> byte
Returns the Alpha value.
"""
return _gdi_.Colour_Alpha(*args, **kwargs) | [
"def",
"Alpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Colour_Alpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L157-L163 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle.window_height | (self) | return self.screen._window_size()[1] | Return the height of the turtle window.
No argument.
Example (for a TurtleScreen instance named screen):
>>> screen.window_height()
480 | Return the height of the turtle window. | [
"Return",
"the",
"height",
"of",
"the",
"turtle",
"window",
"."
] | def window_height(self):
""" Return the height of the turtle window.
No argument.
Example (for a TurtleScreen instance named screen):
>>> screen.window_height()
480
"""
return self.screen._window_size()[1] | [
"def",
"window_height",
"(",
"self",
")",
":",
"return",
"self",
".",
"screen",
".",
"_window_size",
"(",
")",
"[",
"1",
"]"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py#L3396-L3405 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/handlers.py | python | TimedRotatingFileHandler.shouldRollover | (self, record) | return 0 | Determine if rollover should occur.
record is not used, as we are just comparing times, but it is needed so
the method signatures are the same | Determine if rollover should occur. | [
"Determine",
"if",
"rollover",
"should",
"occur",
"."
] | def shouldRollover(self, record):
"""
Determine if rollover should occur.
record is not used, as we are just comparing times, but it is needed so
the method signatures are the same
"""
t = int(time.time())
if t >= self.rolloverAt:
return 1
#pr... | [
"def",
"shouldRollover",
"(",
"self",
",",
"record",
")",
":",
"t",
"=",
"int",
"(",
"time",
".",
"time",
"(",
")",
")",
"if",
"t",
">=",
"self",
".",
"rolloverAt",
":",
"return",
"1",
"#print \"No need to rollover: %d, %d\" % (t, self.rolloverAt)",
"return",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/handlers.py#L281-L292 | |
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/338.counting-bits.py | python | Solution2.countBits | (self, num) | :type num: int
:rtype: List[int] | :type num: int
:rtype: List[int] | [
":",
"type",
"num",
":",
"int",
":",
"rtype",
":",
"List",
"[",
"int",
"]"
] | def countBits(self, num):
"""
:type num: int
:rtype: List[int]
"""
table = []
for i in range(num + 1):
table.append(i % 2)
pre = i >> 1
if pre > 0:
table[i] += table[pre] | [
"def",
"countBits",
"(",
"self",
",",
"num",
")",
":",
"table",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"num",
"+",
"1",
")",
":",
"table",
".",
"append",
"(",
"i",
"%",
"2",
")",
"pre",
"=",
"i",
">>",
"1",
"if",
"pre",
">",
"0",
... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/338.counting-bits.py#L58-L70 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBCommandReturnObject.SetImmediateErrorFile | (self, fh) | return _lldb.SBCommandReturnObject_SetImmediateErrorFile(self, fh) | SetImmediateErrorFile(SBCommandReturnObject self, FILE * fh) | SetImmediateErrorFile(SBCommandReturnObject self, FILE * fh) | [
"SetImmediateErrorFile",
"(",
"SBCommandReturnObject",
"self",
"FILE",
"*",
"fh",
")"
] | def SetImmediateErrorFile(self, fh):
"""SetImmediateErrorFile(SBCommandReturnObject self, FILE * fh)"""
return _lldb.SBCommandReturnObject_SetImmediateErrorFile(self, fh) | [
"def",
"SetImmediateErrorFile",
"(",
"self",
",",
"fh",
")",
":",
"return",
"_lldb",
".",
"SBCommandReturnObject_SetImmediateErrorFile",
"(",
"self",
",",
"fh",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2950-L2952 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | IndexCol.take_data | (self) | return self.values | return the values | return the values | [
"return",
"the",
"values"
] | def take_data(self):
"""return the values"""
return self.values | [
"def",
"take_data",
"(",
"self",
")",
":",
"return",
"self",
".",
"values"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L2095-L2097 | |
NVIDIA/MDL-SDK | aa9642b2546ad7b6236b5627385d882c2ed83c5d | src/mdl/jit/generator_jit/gen_intrinsic_func.py | python | SignatureParser.is_debug_supported | (self, name, signature) | return False | Checks if the given debug intrinsic is supported. | Checks if the given debug intrinsic is supported. | [
"Checks",
"if",
"the",
"given",
"debug",
"intrinsic",
"is",
"supported",
"."
] | def is_debug_supported(self, name, signature):
"""Checks if the given debug intrinsic is supported."""
ret_type, params = self.split_signature(signature)
if name == "breakpoint":
if len(params) == 0:
# support breakpoint()
self.intrinsic_modes[name + signature] = "debug::breakpoint"
return True
... | [
"def",
"is_debug_supported",
"(",
"self",
",",
"name",
",",
"signature",
")",
":",
"ret_type",
",",
"params",
"=",
"self",
".",
"split_signature",
"(",
"signature",
")",
"if",
"name",
"==",
"\"breakpoint\"",
":",
"if",
"len",
"(",
"params",
")",
"==",
"0... | https://github.com/NVIDIA/MDL-SDK/blob/aa9642b2546ad7b6236b5627385d882c2ed83c5d/src/mdl/jit/generator_jit/gen_intrinsic_func.py#L706-L725 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | Joystick.ReleaseCapture | (*args, **kwargs) | return _misc_.Joystick_ReleaseCapture(*args, **kwargs) | ReleaseCapture(self) -> bool | ReleaseCapture(self) -> bool | [
"ReleaseCapture",
"(",
"self",
")",
"-",
">",
"bool"
] | def ReleaseCapture(*args, **kwargs):
"""ReleaseCapture(self) -> bool"""
return _misc_.Joystick_ReleaseCapture(*args, **kwargs) | [
"def",
"ReleaseCapture",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Joystick_ReleaseCapture",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L2290-L2292 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py | python | FitFunctionOptionsView.plot_guess_points | (self) | return int(self.plot_guess_points_spin_box.value()) | Returns the points for the guess fit. | Returns the points for the guess fit. | [
"Returns",
"the",
"points",
"for",
"the",
"guess",
"fit",
"."
] | def plot_guess_points(self) -> int:
"""Returns the points for the guess fit."""
return int(self.plot_guess_points_spin_box.value()) | [
"def",
"plot_guess_points",
"(",
"self",
")",
"->",
"int",
":",
"return",
"int",
"(",
"self",
".",
"plot_guess_points_spin_box",
".",
"value",
"(",
")",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/fit_function_options_view.py#L272-L274 | |
ycm-core/ycmd | fc0fb7e5e15176cc5a2a30c80956335988c6b59a | ycmd/completers/language_server/language_server_completer.py | python | LanguageServerCompleter.Format | ( self, request_data ) | return responses.BuildFixItResponse( [ responses.FixIt(
responses.Location( request_data[ 'line_num' ],
request_data[ 'column_num' ],
request_data[ 'filepath' ] ),
chunks ) ] ) | Issues the formatting or rangeFormatting request (depending on the
presence of a range) and returns the result as a FixIt response. | Issues the formatting or rangeFormatting request (depending on the
presence of a range) and returns the result as a FixIt response. | [
"Issues",
"the",
"formatting",
"or",
"rangeFormatting",
"request",
"(",
"depending",
"on",
"the",
"presence",
"of",
"a",
"range",
")",
"and",
"returns",
"the",
"result",
"as",
"a",
"FixIt",
"response",
"."
] | def Format( self, request_data ):
"""Issues the formatting or rangeFormatting request (depending on the
presence of a range) and returns the result as a FixIt response."""
if not self.ServerIsReady():
raise RuntimeError( 'Server is initializing. Please wait.' )
self._UpdateServerWithFileContents(... | [
"def",
"Format",
"(",
"self",
",",
"request_data",
")",
":",
"if",
"not",
"self",
".",
"ServerIsReady",
"(",
")",
":",
"raise",
"RuntimeError",
"(",
"'Server is initializing. Please wait.'",
")",
"self",
".",
"_UpdateServerWithFileContents",
"(",
"request_data",
"... | https://github.com/ycm-core/ycmd/blob/fc0fb7e5e15176cc5a2a30c80956335988c6b59a/ycmd/completers/language_server/language_server_completer.py#L2648-L2679 | |
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | tools/blade/src/blade/fbthrift_library.py | python | FBThriftLibrary.scons_rules | (self) | scons_rules.
It outputs the scons rules according to user options. | scons_rules. | [
"scons_rules",
"."
] | def scons_rules(self):
"""scons_rules.
It outputs the scons rules according to user options.
"""
self._prepare_to_generate_rule()
# Build java source according to its option
env_name = self._env_name()
self.options = self.blade.get_options()
self.direc... | [
"def",
"scons_rules",
"(",
"self",
")",
":",
"self",
".",
"_prepare_to_generate_rule",
"(",
")",
"# Build java source according to its option",
"env_name",
"=",
"self",
".",
"_env_name",
"(",
")",
"self",
".",
"options",
"=",
"self",
".",
"blade",
".",
"get_opti... | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/fbthrift_library.py#L130-L197 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/PixMapWrapper.py | python | PixMapWrapper.fromImage | (self,im) | Initialize this PixMap from a PIL Image object. | Initialize this PixMap from a PIL Image object. | [
"Initialize",
"this",
"PixMap",
"from",
"a",
"PIL",
"Image",
"object",
"."
] | def fromImage(self,im):
"""Initialize this PixMap from a PIL Image object."""
# We need data in ARGB format; PIL can't currently do that,
# but it can do RGBA, which we can use by inserting one null
# up frontpm =
if im.mode != 'RGBA': im = im.convert('RGBA')
data = chr(0... | [
"def",
"fromImage",
"(",
"self",
",",
"im",
")",
":",
"# We need data in ARGB format; PIL can't currently do that,",
"# but it can do RGBA, which we can use by inserting one null",
"# up frontpm =",
"if",
"im",
".",
"mode",
"!=",
"'RGBA'",
":",
"im",
"=",
"im",
".",
"conv... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/PixMapWrapper.py#L191-L198 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/usb_gadget/usb_descriptors.py | python | Descriptor.total_size | (self) | return self.struct_size | Returns the total size of this descriptor. | Returns the total size of this descriptor. | [
"Returns",
"the",
"total",
"size",
"of",
"this",
"descriptor",
"."
] | def total_size(self):
"""Returns the total size of this descriptor."""
return self.struct_size | [
"def",
"total_size",
"(",
"self",
")",
":",
"return",
"self",
".",
"struct_size"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/usb_descriptors.py#L172-L174 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | kratos/python_scripts/deprecation_management.py | python | DeprecationManager.ReplaceDeprecatedVariableName | (parameters, old_variable_name, new_variable_name) | Replace a key by another. The old key is assumed to be present. | Replace a key by another. The old key is assumed to be present. | [
"Replace",
"a",
"key",
"by",
"another",
".",
"The",
"old",
"key",
"is",
"assumed",
"to",
"be",
"present",
"."
] | def ReplaceDeprecatedVariableName(parameters, old_variable_name, new_variable_name):
""" Replace a key by another. The old key is assumed to be present."""
parameters.AddEmptyValue(new_variable_name)
if parameters[old_variable_name].IsInt():
parameters[new_variable_name].SetInt(para... | [
"def",
"ReplaceDeprecatedVariableName",
"(",
"parameters",
",",
"old_variable_name",
",",
"new_variable_name",
")",
":",
"parameters",
".",
"AddEmptyValue",
"(",
"new_variable_name",
")",
"if",
"parameters",
"[",
"old_variable_name",
"]",
".",
"IsInt",
"(",
")",
":"... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/deprecation_management.py#L37-L52 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/vector_sinh_arcsinh_diag.py | python | VectorSinhArcsinhDiag.scale | (self) | return self._scale | The `LinearOperator` `scale` in `Y := loc + scale @ F(Z) * (2 / F(2)). | The `LinearOperator` `scale` in `Y := loc + scale | [
"The",
"LinearOperator",
"scale",
"in",
"Y",
":",
"=",
"loc",
"+",
"scale"
] | def scale(self):
"""The `LinearOperator` `scale` in `Y := loc + scale @ F(Z) * (2 / F(2))."""
return self._scale | [
"def",
"scale",
"(",
"self",
")",
":",
"return",
"self",
".",
"_scale"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/vector_sinh_arcsinh_diag.py#L262-L264 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.