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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewItem.IsOk | (*args, **kwargs) | return _dataview.DataViewItem_IsOk(*args, **kwargs) | IsOk(self) -> bool
Returns ``True`` if the object refers to an actual item in the data
view control. | IsOk(self) -> bool | [
"IsOk",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsOk(*args, **kwargs):
"""
IsOk(self) -> bool
Returns ``True`` if the object refers to an actual item in the data
view control.
"""
return _dataview.DataViewItem_IsOk(*args, **kwargs) | [
"def",
"IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewItem_IsOk",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L98-L105 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/ops.py | python | masked_arith_op | (x, y, op) | return result | If the given arithmetic operation fails, attempt it again on
only the non-null elements of the input array(s).
Parameters
----------
x : np.ndarray
y : np.ndarray, Series, Index
op : binary operator | If the given arithmetic operation fails, attempt it again on
only the non-null elements of the input array(s). | [
"If",
"the",
"given",
"arithmetic",
"operation",
"fails",
"attempt",
"it",
"again",
"on",
"only",
"the",
"non",
"-",
"null",
"elements",
"of",
"the",
"input",
"array",
"(",
"s",
")",
"."
] | def masked_arith_op(x, y, op):
"""
If the given arithmetic operation fails, attempt it again on
only the non-null elements of the input array(s).
Parameters
----------
x : np.ndarray
y : np.ndarray, Series, Index
op : binary operator
"""
# For Series `x` is 1D so ravel() is a no... | [
"def",
"masked_arith_op",
"(",
"x",
",",
"y",
",",
"op",
")",
":",
"# For Series `x` is 1D so ravel() is a no-op; calling it anyway makes",
"# the logic valid for both Series and DataFrame ops.",
"xrav",
"=",
"x",
".",
"ravel",
"(",
")",
"assert",
"isinstance",
"(",
"x",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/ops.py#L975-L1030 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Base/Python/slicer/ScriptedLoadableModule.py | python | ScriptedLoadableModuleLogic.getAllParameterNodes | (self) | return foundParameterNodes | Return a list of all parameter nodes for this module
Multiple parameter nodes are useful for storing multiple parameter sets in a single scene. | Return a list of all parameter nodes for this module
Multiple parameter nodes are useful for storing multiple parameter sets in a single scene. | [
"Return",
"a",
"list",
"of",
"all",
"parameter",
"nodes",
"for",
"this",
"module",
"Multiple",
"parameter",
"nodes",
"are",
"useful",
"for",
"storing",
"multiple",
"parameter",
"sets",
"in",
"a",
"single",
"scene",
"."
] | def getAllParameterNodes(self):
"""
Return a list of all parameter nodes for this module
Multiple parameter nodes are useful for storing multiple parameter sets in a single scene.
"""
foundParameterNodes = []
numberOfScriptedModuleNodes = slicer.mrmlScene.GetNumberOfNodesByClass("vtkMRMLScripte... | [
"def",
"getAllParameterNodes",
"(",
"self",
")",
":",
"foundParameterNodes",
"=",
"[",
"]",
"numberOfScriptedModuleNodes",
"=",
"slicer",
".",
"mrmlScene",
".",
"GetNumberOfNodesByClass",
"(",
"\"vtkMRMLScriptedModuleNode\"",
")",
"for",
"nodeIndex",
"in",
"range",
"(... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/slicer/ScriptedLoadableModule.py#L247-L258 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/ValidationKit/common/utils.py | python | processKillWithNameCheck | (uPid, sName) | return processKill(uPid) | Like processKill(), but checks if the process name matches before killing
it. This is intended for killing using potentially stale pid values.
Returns True on success, False on failure. | Like processKill(), but checks if the process name matches before killing
it. This is intended for killing using potentially stale pid values. | [
"Like",
"processKill",
"()",
"but",
"checks",
"if",
"the",
"process",
"name",
"matches",
"before",
"killing",
"it",
".",
"This",
"is",
"intended",
"for",
"killing",
"using",
"potentially",
"stale",
"pid",
"values",
"."
] | def processKillWithNameCheck(uPid, sName):
"""
Like processKill(), but checks if the process name matches before killing
it. This is intended for killing using potentially stale pid values.
Returns True on success, False on failure.
"""
if processCheckPidAndName(uPid, sName) is not True:
... | [
"def",
"processKillWithNameCheck",
"(",
"uPid",
",",
"sName",
")",
":",
"if",
"processCheckPidAndName",
"(",
"uPid",
",",
"sName",
")",
"is",
"not",
"True",
":",
"return",
"False",
"return",
"processKill",
"(",
"uPid",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/ValidationKit/common/utils.py#L765-L775 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/__init__.py | python | freeze_support | () | Check whether this is a fake forked process in a frozen executable.
If so then run code specified by commandline and exit. | Check whether this is a fake forked process in a frozen executable.
If so then run code specified by commandline and exit. | [
"Check",
"whether",
"this",
"is",
"a",
"fake",
"forked",
"process",
"in",
"a",
"frozen",
"executable",
".",
"If",
"so",
"then",
"run",
"code",
"specified",
"by",
"commandline",
"and",
"exit",
"."
] | def freeze_support():
'''
Check whether this is a fake forked process in a frozen executable.
If so then run code specified by commandline and exit.
'''
if sys.platform == 'win32' and getattr(sys, 'frozen', False):
from multiprocessing.forking import freeze_support
freeze_support() | [
"def",
"freeze_support",
"(",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
"and",
"getattr",
"(",
"sys",
",",
"'frozen'",
",",
"False",
")",
":",
"from",
"multiprocessing",
".",
"forking",
"import",
"freeze_support",
"freeze_support",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/__init__.py#L138-L145 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/lib2to3/pytree.py | python | Node.insert_child | (self, i, child) | Equivalent to 'node.children.insert(i, child)'. This method also sets
the child's parent attribute appropriately. | Equivalent to 'node.children.insert(i, child)'. This method also sets
the child's parent attribute appropriately. | [
"Equivalent",
"to",
"node",
".",
"children",
".",
"insert",
"(",
"i",
"child",
")",
".",
"This",
"method",
"also",
"sets",
"the",
"child",
"s",
"parent",
"attribute",
"appropriately",
"."
] | def insert_child(self, i, child):
"""
Equivalent to 'node.children.insert(i, child)'. This method also sets
the child's parent attribute appropriately.
"""
child.parent = self
self.children.insert(i, child)
self.changed() | [
"def",
"insert_child",
"(",
"self",
",",
"i",
",",
"child",
")",
":",
"child",
".",
"parent",
"=",
"self",
"self",
".",
"children",
".",
"insert",
"(",
"i",
",",
"child",
")",
"self",
".",
"changed",
"(",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/lib2to3/pytree.py#L316-L323 | ||
FEniCS/dolfinx | 3dfdf038cccdb70962865b58a63bf29c2e55ec6e | python/dolfinx/io.py | python | extract_gmsh_topology_and_markers | (gmsh_model, model_name=None) | return topologies | Extract all entities tagged with a physical marker in the gmsh
model, and collects the data per cell type. Returns a nested
dictionary where the first key is the gmsh MSH element type integer.
Each element type present in the model contains the cell topology of
the elements and corresponding markers. | Extract all entities tagged with a physical marker in the gmsh
model, and collects the data per cell type. Returns a nested
dictionary where the first key is the gmsh MSH element type integer.
Each element type present in the model contains the cell topology of
the elements and corresponding markers. | [
"Extract",
"all",
"entities",
"tagged",
"with",
"a",
"physical",
"marker",
"in",
"the",
"gmsh",
"model",
"and",
"collects",
"the",
"data",
"per",
"cell",
"type",
".",
"Returns",
"a",
"nested",
"dictionary",
"where",
"the",
"first",
"key",
"is",
"the",
"gms... | def extract_gmsh_topology_and_markers(gmsh_model, model_name=None):
"""Extract all entities tagged with a physical marker in the gmsh
model, and collects the data per cell type. Returns a nested
dictionary where the first key is the gmsh MSH element type integer.
Each element type present in the model c... | [
"def",
"extract_gmsh_topology_and_markers",
"(",
"gmsh_model",
",",
"model_name",
"=",
"None",
")",
":",
"if",
"model_name",
"is",
"not",
"None",
":",
"gmsh_model",
".",
"setCurrent",
"(",
"model_name",
")",
"# Get the physical groups from gmsh on the form [(dim1, tag1),(... | https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/io.py#L75-L127 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/nanops.py | python | _get_fill_value | (dtype, fill_value=None, fill_value_typ=None) | return the correct fill value for the dtype of the values | return the correct fill value for the dtype of the values | [
"return",
"the",
"correct",
"fill",
"value",
"for",
"the",
"dtype",
"of",
"the",
"values"
] | def _get_fill_value(dtype, fill_value=None, fill_value_typ=None):
""" return the correct fill value for the dtype of the values """
if fill_value is not None:
return fill_value
if _na_ok_dtype(dtype):
if fill_value_typ is None:
return np.nan
else:
if fill_valu... | [
"def",
"_get_fill_value",
"(",
"dtype",
",",
"fill_value",
"=",
"None",
",",
"fill_value_typ",
"=",
"None",
")",
":",
"if",
"fill_value",
"is",
"not",
"None",
":",
"return",
"fill_value",
"if",
"_na_ok_dtype",
"(",
"dtype",
")",
":",
"if",
"fill_value_typ",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/nanops.py#L180-L200 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | TextEntryBase.Undo | (*args, **kwargs) | return _core_.TextEntryBase_Undo(*args, **kwargs) | Undo(self)
Undoes the last edit in the text field | Undo(self) | [
"Undo",
"(",
"self",
")"
] | def Undo(*args, **kwargs):
"""
Undo(self)
Undoes the last edit in the text field
"""
return _core_.TextEntryBase_Undo(*args, **kwargs) | [
"def",
"Undo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"TextEntryBase_Undo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13211-L13217 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Action.py | python | CommandGeneratorAction.get_presig | (self, target, source, env, executor=None) | return self._generate(target, source, env, 1, executor).get_presig(target, source, env) | Return the signature contents of this action's command line.
This strips $(-$) and everything in between the string,
since those parts don't affect signatures. | Return the signature contents of this action's command line. | [
"Return",
"the",
"signature",
"contents",
"of",
"this",
"action",
"s",
"command",
"line",
"."
] | def get_presig(self, target, source, env, executor=None):
"""Return the signature contents of this action's command line.
This strips $(-$) and everything in between the string,
since those parts don't affect signatures.
"""
return self._generate(target, source, env, 1, executor... | [
"def",
"get_presig",
"(",
"self",
",",
"target",
",",
"source",
",",
"env",
",",
"executor",
"=",
"None",
")",
":",
"return",
"self",
".",
"_generate",
"(",
"target",
",",
"source",
",",
"env",
",",
"1",
",",
"executor",
")",
".",
"get_presig",
"(",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Action.py#L1055-L1061 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | polly/lib/External/isl/imath/tools/mkdoc.py | python | parse_decls | (text) | return decls | Parse a dictionary of declarations from text. | Parse a dictionary of declarations from text. | [
"Parse",
"a",
"dictionary",
"of",
"declarations",
"from",
"text",
"."
] | def parse_decls(text):
"""Parse a dictionary of declarations from text."""
decls = collections.OrderedDict()
idx = LIndex(text)
for m in doc.finditer(text):
line, _ = idx.linecol(m.span('decl')[0])
d = Decl(m.group('text'), m.group('decl'), line)
decls[d.name] = d
return decl... | [
"def",
"parse_decls",
"(",
"text",
")",
":",
"decls",
"=",
"collections",
".",
"OrderedDict",
"(",
")",
"idx",
"=",
"LIndex",
"(",
"text",
")",
"for",
"m",
"in",
"doc",
".",
"finditer",
"(",
"text",
")",
":",
"line",
",",
"_",
"=",
"idx",
".",
"l... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/polly/lib/External/isl/imath/tools/mkdoc.py#L147-L155 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/asynchat.py | python | async_chat.set_terminator | (self, term) | Set the input delimiter. Can be a fixed string of any length, an integer, or None | Set the input delimiter. Can be a fixed string of any length, an integer, or None | [
"Set",
"the",
"input",
"delimiter",
".",
"Can",
"be",
"a",
"fixed",
"string",
"of",
"any",
"length",
"an",
"integer",
"or",
"None"
] | def set_terminator (self, term):
"Set the input delimiter. Can be a fixed string of any length, an integer, or None"
self.terminator = term | [
"def",
"set_terminator",
"(",
"self",
",",
"term",
")",
":",
"self",
".",
"terminator",
"=",
"term"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/asynchat.py#L100-L102 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/s3fs/core.py | python | S3FileSystem.setxattr | (self, path, copy_kwargs=None, **kw_args) | Set metadata.
Attributes have to be of the form documented in the
`Metadata Reference`_.
Parameters
----------
kw_args : key-value pairs like field="value", where the values must be
strings. Does not alter existing fields, unless
the field appears here -... | Set metadata. | [
"Set",
"metadata",
"."
] | def setxattr(self, path, copy_kwargs=None, **kw_args):
""" Set metadata.
Attributes have to be of the form documented in the
`Metadata Reference`_.
Parameters
----------
kw_args : key-value pairs like field="value", where the values must be
strings. Does not... | [
"def",
"setxattr",
"(",
"self",
",",
"path",
",",
"copy_kwargs",
"=",
"None",
",",
"*",
"*",
"kw_args",
")",
":",
"bucket",
",",
"key",
",",
"version_id",
"=",
"self",
".",
"split_path",
"(",
"path",
")",
"metadata",
"=",
"self",
".",
"metadata",
"("... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/s3fs/core.py#L732-L785 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/auth.py | python | _basic_auth_str | (username, password) | return authstr | Returns a Basic Auth string. | Returns a Basic Auth string. | [
"Returns",
"a",
"Basic",
"Auth",
"string",
"."
] | def _basic_auth_str(username, password):
"""Returns a Basic Auth string."""
# "I want us to put a big-ol' comment on top of it that
# says that this behaviour is dumb but we need to preserve
# it because people are relying on it."
# - Lukasa
#
# These are here solely to maintain backward... | [
"def",
"_basic_auth_str",
"(",
"username",
",",
"password",
")",
":",
"# \"I want us to put a big-ol' comment on top of it that",
"# says that this behaviour is dumb but we need to preserve",
"# it because people are relying on it.\"",
"# - Lukasa",
"#",
"# These are here solely to main... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/auth.py#L28-L69 | |
sigmaai/self-driving-golf-cart | 8d891600af3d851add27a10ae45cf3c2108bb87c | ros/src/detection/object_detection/scripts/yolo3/model.py | python | preprocess_true_boxes | (true_boxes, input_shape, anchors, num_classes) | return y_true | Preprocess true boxes to training input format
Parameters
----------
true_boxes: array, shape=(m, T, 5)
Absolute x_min, y_min, x_max, y_max, class_id relative to input_shape.
input_shape: array-like, hw, multiples of 32
anchors: array, shape=(N, 2), wh
num_classes: integer
Returns
... | Preprocess true boxes to training input format | [
"Preprocess",
"true",
"boxes",
"to",
"training",
"input",
"format"
] | def preprocess_true_boxes(true_boxes, input_shape, anchors, num_classes):
"""Preprocess true boxes to training input format
Parameters
----------
true_boxes: array, shape=(m, T, 5)
Absolute x_min, y_min, x_max, y_max, class_id relative to input_shape.
input_shape: array-like, hw, multiples ... | [
"def",
"preprocess_true_boxes",
"(",
"true_boxes",
",",
"input_shape",
",",
"anchors",
",",
"num_classes",
")",
":",
"assert",
"(",
"true_boxes",
"[",
"...",
",",
"4",
"]",
"<",
"num_classes",
")",
".",
"all",
"(",
")",
",",
"'class id must be less than num_cl... | https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/detection/object_detection/scripts/yolo3/model.py#L244-L313 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/transport/TZlibTransport.py | python | TZlibTransport.open | (self) | return self.__trans.open() | Open the underlying transport | Open the underlying transport | [
"Open",
"the",
"underlying",
"transport"
] | def open(self):
"""Open the underlying transport"""
self._init_stats()
return self.__trans.open() | [
"def",
"open",
"(",
"self",
")",
":",
"self",
".",
"_init_stats",
"(",
")",
"return",
"self",
".",
"__trans",
".",
"open",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/transport/TZlibTransport.py#L162-L165 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | import_model | (filename, *args, **kwargs) | return model | Load information from an ExodusII file.
This function is a wrapper around 'ExodusModel.import_model(...)' and is
provided for convenience. Internally, this is equivalent to executing the
following two statements.
>>> model = ExodusModel()
>>> model.import_model(...)
See 'ExodusModel.import_m... | Load information from an ExodusII file. | [
"Load",
"information",
"from",
"an",
"ExodusII",
"file",
"."
] | def import_model(filename, *args, **kwargs):
"""
Load information from an ExodusII file.
This function is a wrapper around 'ExodusModel.import_model(...)' and is
provided for convenience. Internally, this is equivalent to executing the
following two statements.
>>> model = ExodusModel()
>... | [
"def",
"import_model",
"(",
"filename",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"model",
"=",
"ExodusModel",
"(",
")",
"model",
".",
"import_model",
"(",
"filename",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"model"
] | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L94-L110 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_tab.py | python | EdTabBase.DoOnIdle | (self) | Called when the notebook is idle and this instance is the active
tab. | Called when the notebook is idle and this instance is the active
tab. | [
"Called",
"when",
"the",
"notebook",
"is",
"idle",
"and",
"this",
"instance",
"is",
"the",
"active",
"tab",
"."
] | def DoOnIdle(self):
"""Called when the notebook is idle and this instance is the active
tab.
"""
pass | [
"def",
"DoOnIdle",
"(",
"self",
")",
":",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_tab.py#L52-L57 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py | python | SocketHandler.emit | (self, record) | Emit a record.
Pickles the record and writes it to the socket in binary format.
If there is an error with the socket, silently drop the packet.
If there was a problem with the socket, re-establishes the
socket. | Emit a record. | [
"Emit",
"a",
"record",
"."
] | def emit(self, record):
"""
Emit a record.
Pickles the record and writes it to the socket in binary format.
If there is an error with the socket, silently drop the packet.
If there was a problem with the socket, re-establishes the
socket.
"""
try:
... | [
"def",
"emit",
"(",
"self",
",",
"record",
")",
":",
"try",
":",
"s",
"=",
"self",
".",
"makePickle",
"(",
"record",
")",
"self",
".",
"send",
"(",
"s",
")",
"except",
"Exception",
":",
"self",
".",
"handleError",
"(",
"record",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py#L621-L634 | ||
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ui_extensions_api.py | python | apply_goal_tactic | (goal, tactic) | Create a new cell in the notebook that applies the tactic | Create a new cell in the notebook that applies the tactic | [
"Create",
"a",
"new",
"cell",
"in",
"the",
"notebook",
"that",
"applies",
"the",
"tactic"
] | def apply_goal_tactic(goal, tactic):
"""
Create a new cell in the notebook that applies the tactic
"""
code = '''{}(goal({!r}))'''.format(tactic, goal.id)
yield ExecuteNewCell(code) | [
"def",
"apply_goal_tactic",
"(",
"goal",
",",
"tactic",
")",
":",
"code",
"=",
"'''{}(goal({!r}))'''",
".",
"format",
"(",
"tactic",
",",
"goal",
".",
"id",
")",
"yield",
"ExecuteNewCell",
"(",
"code",
")"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ui_extensions_api.py#L383-L388 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/msvccompiler.py | python | MSVCCompiler.find_exe | (self, exe) | return exe | Return path to an MSVC executable program.
Tries to find the program in several places: first, one of the
MSVC program search paths from the registry; next, the directories
in the PATH environment variable. If any of those work, return an
absolute path that is known to exist. If none ... | Return path to an MSVC executable program. | [
"Return",
"path",
"to",
"an",
"MSVC",
"executable",
"program",
"."
] | def find_exe(self, exe):
"""Return path to an MSVC executable program.
Tries to find the program in several places: first, one of the
MSVC program search paths from the registry; next, the directories
in the PATH environment variable. If any of those work, return an
absolute pa... | [
"def",
"find_exe",
"(",
"self",
",",
"exe",
")",
":",
"for",
"p",
"in",
"self",
".",
"__paths",
":",
"fn",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"p",
")",
",",
"exe",
")",
"if",
"os",
".",
"path",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/msvccompiler.py#L565-L585 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py | python | ParserElement.setDefaultWhitespaceChars | ( chars ) | r"""
Overrides the default whitespace chars
Example::
# default whitespace chars are space, <TAB> and newline
OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl']
# change to just treat newline as significant
... | r"""
Overrides the default whitespace chars | [
"r",
"Overrides",
"the",
"default",
"whitespace",
"chars"
] | def setDefaultWhitespaceChars( chars ):
r"""
Overrides the default whitespace chars
Example::
# default whitespace chars are space, <TAB> and newline
OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl']
# cha... | [
"def",
"setDefaultWhitespaceChars",
"(",
"chars",
")",
":",
"ParserElement",
".",
"DEFAULT_WHITE_CHARS",
"=",
"chars"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L1109-L1121 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/misc_util.py | python | msvc_runtime_version | () | return msc_ver | Return version of MSVC runtime library, as defined by __MSC_VER__ macro | Return version of MSVC runtime library, as defined by __MSC_VER__ macro | [
"Return",
"version",
"of",
"MSVC",
"runtime",
"library",
"as",
"defined",
"by",
"__MSC_VER__",
"macro"
] | def msvc_runtime_version():
"Return version of MSVC runtime library, as defined by __MSC_VER__ macro"
msc_pos = sys.version.find('MSC v.')
if msc_pos != -1:
msc_ver = int(sys.version[msc_pos+6:msc_pos+10])
else:
msc_ver = None
return msc_ver | [
"def",
"msvc_runtime_version",
"(",
")",
":",
"msc_pos",
"=",
"sys",
".",
"version",
".",
"find",
"(",
"'MSC v.'",
")",
"if",
"msc_pos",
"!=",
"-",
"1",
":",
"msc_ver",
"=",
"int",
"(",
"sys",
".",
"version",
"[",
"msc_pos",
"+",
"6",
":",
"msc_pos",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/misc_util.py#L401-L408 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/dbwrap.py | python | cure_weight | (refrxn, refeq, rrat, xi=0.2) | return weight | :param refeq: value of benchmark for equilibrium Reaction
:param rrat: ratio of intermonomer separation for Reaction to equilibrium Reaction
:param xi: parameter
:return: weight for CURE | :param refeq: value of benchmark for equilibrium Reaction
:param rrat: ratio of intermonomer separation for Reaction to equilibrium Reaction
:param xi: parameter
:return: weight for CURE | [
":",
"param",
"refeq",
":",
"value",
"of",
"benchmark",
"for",
"equilibrium",
"Reaction",
":",
"param",
"rrat",
":",
"ratio",
"of",
"intermonomer",
"separation",
"for",
"Reaction",
"to",
"equilibrium",
"Reaction",
":",
"param",
"xi",
":",
"parameter",
":",
"... | def cure_weight(refrxn, refeq, rrat, xi=0.2):
"""
:param refeq: value of benchmark for equilibrium Reaction
:param rrat: ratio of intermonomer separation for Reaction to equilibrium Reaction
:param xi: parameter
:return: weight for CURE
"""
sigma = xi * abs(refeq) / (rrat ** 3)
weight =... | [
"def",
"cure_weight",
"(",
"refrxn",
",",
"refeq",
",",
"rrat",
",",
"xi",
"=",
"0.2",
")",
":",
"sigma",
"=",
"xi",
"*",
"abs",
"(",
"refeq",
")",
"/",
"(",
"rrat",
"**",
"3",
")",
"weight",
"=",
"max",
"(",
"abs",
"(",
"refrxn",
")",
",",
"... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/dbwrap.py#L232-L242 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/writer.py | python | UnindentedBlock.__exit__ | (self, *args) | Write the ending of the block. | Write the ending of the block. | [
"Write",
"the",
"ending",
"of",
"the",
"block",
"."
] | def __exit__(self, *args):
# type: (*str) -> None
"""Write the ending of the block."""
self._writer.write_unindented_line(self._closing) | [
"def",
"__exit__",
"(",
"self",
",",
"*",
"args",
")",
":",
"# type: (*str) -> None",
"self",
".",
"_writer",
".",
"write_unindented_line",
"(",
"self",
".",
"_closing",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/writer.py#L274-L277 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Dnn.py | python | Dnn.delete_layer | (self, layer) | Deletes a layer from the network.
:param layer: the layer to be deleted, or its name
:type layer: neoml.Dnn.Layer or str | Deletes a layer from the network. | [
"Deletes",
"a",
"layer",
"from",
"the",
"network",
"."
] | def delete_layer(self, layer):
"""Deletes a layer from the network.
:param layer: the layer to be deleted, or its name
:type layer: neoml.Dnn.Layer or str
"""
if type(layer) is str:
self._delete_layer(layer)
elif isinstance(layer, Layer):
self._de... | [
"def",
"delete_layer",
"(",
"self",
",",
"layer",
")",
":",
"if",
"type",
"(",
"layer",
")",
"is",
"str",
":",
"self",
".",
"_delete_layer",
"(",
"layer",
")",
"elif",
"isinstance",
"(",
"layer",
",",
"Layer",
")",
":",
"self",
".",
"_delete_layer",
... | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Dnn.py#L139-L150 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-thci/OpenThread.py | python | OpenThreadTHCI.__init__ | (self, **kwargs) | initialize the serial port and default network parameters
Args:
**kwargs: Arbitrary keyword arguments
Includes 'EUI' and 'SerialPort' | initialize the serial port and default network parameters
Args:
**kwargs: Arbitrary keyword arguments
Includes 'EUI' and 'SerialPort' | [
"initialize",
"the",
"serial",
"port",
"and",
"default",
"network",
"parameters",
"Args",
":",
"**",
"kwargs",
":",
"Arbitrary",
"keyword",
"arguments",
"Includes",
"EUI",
"and",
"SerialPort"
] | def __init__(self, **kwargs):
"""initialize the serial port and default network parameters
Args:
**kwargs: Arbitrary keyword arguments
Includes 'EUI' and 'SerialPort'
"""
self.intialize(kwargs) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"intialize",
"(",
"kwargs",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L223-L229 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/core/_internal.py | python | _ctypes.get_strides | (self) | return self.strides | Deprecated getter for the `_ctypes.strides` property.
.. deprecated:: 1.21 | Deprecated getter for the `_ctypes.strides` property. | [
"Deprecated",
"getter",
"for",
"the",
"_ctypes",
".",
"strides",
"property",
"."
] | def get_strides(self):
"""Deprecated getter for the `_ctypes.strides` property.
.. deprecated:: 1.21
"""
warnings.warn('"get_strides" is deprecated. Use "strides" instead',
DeprecationWarning, stacklevel=2)
return self.strides | [
"def",
"get_strides",
"(",
"self",
")",
":",
"warnings",
".",
"warn",
"(",
"'\"get_strides\" is deprecated. Use \"strides\" instead'",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"return",
"self",
".",
"strides"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/_internal.py#L374-L381 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/packager-enterprise.py | python | make_package | (distro, build_os, arch, spec, srcdir) | return distro.make_pkg(build_os, arch, spec, srcdir) | Construct the package for (arch, distro, spec), getting
packaging files from srcdir and any user-specified suffix from
suffixes | Construct the package for (arch, distro, spec), getting
packaging files from srcdir and any user-specified suffix from
suffixes | [
"Construct",
"the",
"package",
"for",
"(",
"arch",
"distro",
"spec",
")",
"getting",
"packaging",
"files",
"from",
"srcdir",
"and",
"any",
"user",
"-",
"specified",
"suffix",
"from",
"suffixes"
] | def make_package(distro, build_os, arch, spec, srcdir):
"""Construct the package for (arch, distro, spec), getting
packaging files from srcdir and any user-specified suffix from
suffixes"""
sdir=setupdir(distro, build_os, arch, spec)
packager.ensure_dir(sdir)
# Note that the RPM packages get th... | [
"def",
"make_package",
"(",
"distro",
",",
"build_os",
",",
"arch",
",",
"spec",
",",
"srcdir",
")",
":",
"sdir",
"=",
"setupdir",
"(",
"distro",
",",
"build_os",
",",
"arch",
",",
"spec",
")",
"packager",
".",
"ensure_dir",
"(",
"sdir",
")",
"# Note t... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/packager-enterprise.py#L218-L240 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/valgrind/scan-build.py | python | MultiLineChange.__call__ | (self, line) | return False | Test a single line against multi-line change.
If it matches the currently active line, advance one line.
If the current line is the last line, report a match. | Test a single line against multi-line change. | [
"Test",
"a",
"single",
"line",
"against",
"multi",
"-",
"line",
"change",
"."
] | def __call__(self, line):
""" Test a single line against multi-line change.
If it matches the currently active line, advance one line.
If the current line is the last line, report a match.
"""
if self._tracked_lines[self._current] in line:
self._current = self._current + 1
if self._curr... | [
"def",
"__call__",
"(",
"self",
",",
"line",
")",
":",
"if",
"self",
".",
"_tracked_lines",
"[",
"self",
".",
"_current",
"]",
"in",
"line",
":",
"self",
".",
"_current",
"=",
"self",
".",
"_current",
"+",
"1",
"if",
"self",
".",
"_current",
"==",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/valgrind/scan-build.py#L172-L185 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/all-elements-in-two-binary-search-trees.py | python | Solution.getAllElements | (self, root1, root2) | return result | :type root1: TreeNode
:type root2: TreeNode
:rtype: List[int] | :type root1: TreeNode
:type root2: TreeNode
:rtype: List[int] | [
":",
"type",
"root1",
":",
"TreeNode",
":",
"type",
"root2",
":",
"TreeNode",
":",
"rtype",
":",
"List",
"[",
"int",
"]"
] | def getAllElements(self, root1, root2):
"""
:type root1: TreeNode
:type root2: TreeNode
:rtype: List[int]
"""
def inorder_gen(root):
result, stack = [], [(root, False)]
while stack:
root, is_visited = stack.pop()
if ... | [
"def",
"getAllElements",
"(",
"self",
",",
"root1",
",",
"root2",
")",
":",
"def",
"inorder_gen",
"(",
"root",
")",
":",
"result",
",",
"stack",
"=",
"[",
"]",
",",
"[",
"(",
"root",
",",
"False",
")",
"]",
"while",
"stack",
":",
"root",
",",
"is... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/all-elements-in-two-binary-search-trees.py#L13-L43 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/package_index.py | python | ContentChecker.feed | (self, block) | return | Feed a block of data to the hash. | Feed a block of data to the hash. | [
"Feed",
"a",
"block",
"of",
"data",
"to",
"the",
"hash",
"."
] | def feed(self, block):
"""
Feed a block of data to the hash.
"""
return | [
"def",
"feed",
"(",
"self",
",",
"block",
")",
":",
"return"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/package_index.py#L228-L232 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/alara.py | python | _build_matrix | (N) | return A | This function builds burnup matrix, A. Decay only. | This function builds burnup matrix, A. Decay only. | [
"This",
"function",
"builds",
"burnup",
"matrix",
"A",
".",
"Decay",
"only",
"."
] | def _build_matrix(N):
""" This function builds burnup matrix, A. Decay only.
"""
A = np.zeros((len(N), len(N)))
# convert N to id form
N_id = []
for i in range(len(N)):
if isinstance(N[i], str):
ID = nucname.id(N[i])
else:
ID = N[i]
N_id.append(... | [
"def",
"_build_matrix",
"(",
"N",
")",
":",
"A",
"=",
"np",
".",
"zeros",
"(",
"(",
"len",
"(",
"N",
")",
",",
"len",
"(",
"N",
")",
")",
")",
"# convert N to id form",
"N_id",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"N",
"... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/alara.py#L835-L860 | |
rodeofx/OpenWalter | 6116fbe3f04f1146c854afbfbdbe944feaee647e | walter/maya/scripts/walterPanel/walterOutliner.py | python | TreeItem.getWalterStandinItem | (self) | return parent.getWalterStandinItem() | Recursively search the the origin parent TreeItem in parents. | Recursively search the the origin parent TreeItem in parents. | [
"Recursively",
"search",
"the",
"the",
"origin",
"parent",
"TreeItem",
"in",
"parents",
"."
] | def getWalterStandinItem(self):
"""Recursively search the the origin parent TreeItem in parents."""
parent = self.parent()
if not parent.parent():
return self
return parent.getWalterStandinItem() | [
"def",
"getWalterStandinItem",
"(",
"self",
")",
":",
"parent",
"=",
"self",
".",
"parent",
"(",
")",
"if",
"not",
"parent",
".",
"parent",
"(",
")",
":",
"return",
"self",
"return",
"parent",
".",
"getWalterStandinItem",
"(",
")"
] | https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/walterPanel/walterOutliner.py#L1898-L1904 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | GridTableBase.SetValueAsLong | (*args, **kwargs) | return _grid.GridTableBase_SetValueAsLong(*args, **kwargs) | SetValueAsLong(self, int row, int col, long value) | SetValueAsLong(self, int row, int col, long value) | [
"SetValueAsLong",
"(",
"self",
"int",
"row",
"int",
"col",
"long",
"value",
")"
] | def SetValueAsLong(*args, **kwargs):
"""SetValueAsLong(self, int row, int col, long value)"""
return _grid.GridTableBase_SetValueAsLong(*args, **kwargs) | [
"def",
"SetValueAsLong",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase_SetValueAsLong",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L846-L848 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/sliceviewer/roi.py | python | _index_range_spectraaxis | (workspace: MatrixWorkspace, ymin: float, ymax: float) | Return the workspace indicies for the given ymin/ymax values on the given workspace
:param workspace: A MatrixWorkspace object spectra Y Axis
:param ymin: Minimum Y value in range
:param ymax: Maximum Y value in range | Return the workspace indicies for the given ymin/ymax values on the given workspace
:param workspace: A MatrixWorkspace object spectra Y Axis
:param ymin: Minimum Y value in range
:param ymax: Maximum Y value in range | [
"Return",
"the",
"workspace",
"indicies",
"for",
"the",
"given",
"ymin",
"/",
"ymax",
"values",
"on",
"the",
"given",
"workspace",
":",
"param",
"workspace",
":",
"A",
"MatrixWorkspace",
"object",
"spectra",
"Y",
"Axis",
":",
"param",
"ymin",
":",
"Minimum",... | def _index_range_spectraaxis(workspace: MatrixWorkspace, ymin: float, ymax: float):
"""
Return the workspace indicies for the given ymin/ymax values on the given workspace
:param workspace: A MatrixWorkspace object spectra Y Axis
:param ymin: Minimum Y value in range
:param ymax: Maximum Y value in ... | [
"def",
"_index_range_spectraaxis",
"(",
"workspace",
":",
"MatrixWorkspace",
",",
"ymin",
":",
"float",
",",
"ymax",
":",
"float",
")",
":",
"if",
"ymin",
"is",
"None",
"or",
"ymax",
"is",
"None",
":",
"return",
"0",
",",
"workspace",
".",
"getNumberHistog... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/roi.py#L247-L258 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_presenter.py | python | TFAsymmetryFittingPresenter.handle_normalisation_changed | (self) | Handles when the normalisation line edit has been changed by the user. | Handles when the normalisation line edit has been changed by the user. | [
"Handles",
"when",
"the",
"normalisation",
"line",
"edit",
"has",
"been",
"changed",
"by",
"the",
"user",
"."
] | def handle_normalisation_changed(self) -> None:
"""Handles when the normalisation line edit has been changed by the user."""
self.model.set_current_normalisation(self.view.normalisation)
self.update_plot_guess()
self.fit_parameter_changed_notifier.notify_subscribers() | [
"def",
"handle_normalisation_changed",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"model",
".",
"set_current_normalisation",
"(",
"self",
".",
"view",
".",
"normalisation",
")",
"self",
".",
"update_plot_guess",
"(",
")",
"self",
".",
"fit_parameter_chang... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_presenter.py#L82-L87 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | demo/DPU-for-RNN/rnnt_asr_vck5000/inference.py | python | eval | (
data_layer,
audio_processor,
greedy_decoder,
labels,
args) | performs inference / evaluation
Args:
data_layer: data layer object that holds data loader
audio_processor: data processing module
greedy_decoder: greedy decoder
labels: list of labels as output vocabulary
args: script input arguments | performs inference / evaluation
Args:
data_layer: data layer object that holds data loader
audio_processor: data processing module
greedy_decoder: greedy decoder
labels: list of labels as output vocabulary
args: script input arguments | [
"performs",
"inference",
"/",
"evaluation",
"Args",
":",
"data_layer",
":",
"data",
"layer",
"object",
"that",
"holds",
"data",
"loader",
"audio_processor",
":",
"data",
"processing",
"module",
"greedy_decoder",
":",
"greedy",
"decoder",
"labels",
":",
"list",
"... | def eval(
data_layer,
audio_processor,
greedy_decoder,
labels,
args):
"""performs inference / evaluation
Args:
data_layer: data layer object that holds data loader
audio_processor: data processing module
greedy_decoder: greedy d... | [
"def",
"eval",
"(",
"data_layer",
",",
"audio_processor",
",",
"greedy_decoder",
",",
"labels",
",",
"args",
")",
":",
"start_t",
"=",
"time",
".",
"time",
"(",
")",
"if",
"args",
".",
"mode",
"==",
"1",
"or",
"args",
".",
"mode",
"==",
"2",
":",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/demo/DPU-for-RNN/rnnt_asr_vck5000/inference.py#L138-L205 | ||
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/build/build_request.py | python | expand_no_defaults | (property_sets) | return [property_set.create(p) for p in product] | Expand the given build request by combining all property_sets which don't
specify conflicting non-free features. | Expand the given build request by combining all property_sets which don't
specify conflicting non-free features. | [
"Expand",
"the",
"given",
"build",
"request",
"by",
"combining",
"all",
"property_sets",
"which",
"don",
"t",
"specify",
"conflicting",
"non",
"-",
"free",
"features",
"."
] | def expand_no_defaults (property_sets):
""" Expand the given build request by combining all property_sets which don't
specify conflicting non-free features.
"""
# First make all features and subfeatures explicit
expanded_property_sets = [ps.expand_subfeatures() for ps in property_sets]
... | [
"def",
"expand_no_defaults",
"(",
"property_sets",
")",
":",
"# First make all features and subfeatures explicit",
"expanded_property_sets",
"=",
"[",
"ps",
".",
"expand_subfeatures",
"(",
")",
"for",
"ps",
"in",
"property_sets",
"]",
"# Now combine all of the expanded proper... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/build_request.py#L16-L26 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/dbgen/ndsfpy.py | python | parse_num | (dst) | return base * 10 ** float(exp) | Converts html numbers with exponents to floats | Converts html numbers with exponents to floats | [
"Converts",
"html",
"numbers",
"with",
"exponents",
"to",
"floats"
] | def parse_num(dst):
"""Converts html numbers with exponents to floats
"""
nums = dst.split('x')
base = float(nums[0])
exp = (nums[1].split('<sup>')[1]).split('</sup>')[0]
return base * 10 ** float(exp) | [
"def",
"parse_num",
"(",
"dst",
")",
":",
"nums",
"=",
"dst",
".",
"split",
"(",
"'x'",
")",
"base",
"=",
"float",
"(",
"nums",
"[",
"0",
"]",
")",
"exp",
"=",
"(",
"nums",
"[",
"1",
"]",
".",
"split",
"(",
"'<sup>'",
")",
"[",
"1",
"]",
")... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/dbgen/ndsfpy.py#L98-L104 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/value/summarizable.py | python | SummarizableValue.GetBuildbotValue | (self) | Returns the buildbot's equivalent value. | Returns the buildbot's equivalent value. | [
"Returns",
"the",
"buildbot",
"s",
"equivalent",
"value",
"."
] | def GetBuildbotValue(self):
"""Returns the buildbot's equivalent value."""
raise NotImplementedError() | [
"def",
"GetBuildbotValue",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/value/summarizable.py#L48-L50 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PrintDialogData.GetNoCopies | (*args, **kwargs) | return _windows_.PrintDialogData_GetNoCopies(*args, **kwargs) | GetNoCopies(self) -> int | GetNoCopies(self) -> int | [
"GetNoCopies",
"(",
"self",
")",
"-",
">",
"int"
] | def GetNoCopies(*args, **kwargs):
"""GetNoCopies(self) -> int"""
return _windows_.PrintDialogData_GetNoCopies(*args, **kwargs) | [
"def",
"GetNoCopies",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintDialogData_GetNoCopies",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5058-L5060 | |
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | TokenKind.register | (value, name) | Register a new TokenKind enumeration.
This should only be called at module load time by code within this
package. | Register a new TokenKind enumeration. | [
"Register",
"a",
"new",
"TokenKind",
"enumeration",
"."
] | def register(value, name):
"""Register a new TokenKind enumeration.
This should only be called at module load time by code within this
package.
"""
if value in TokenKind._value_map:
raise ValueError('TokenKind already registered: %d' % value)
kind = TokenKin... | [
"def",
"register",
"(",
"value",
",",
"name",
")",
":",
"if",
"value",
"in",
"TokenKind",
".",
"_value_map",
":",
"raise",
"ValueError",
"(",
"'TokenKind already registered: %d'",
"%",
"value",
")",
"kind",
"=",
"TokenKind",
"(",
"value",
",",
"name",
")",
... | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L575-L586 | ||
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | tools/gyp/pylib/gyp/MSVSProject.py | python | Writer._AddFilesToNode | (self, parent, files) | Adds files and/or filters to the parent node.
Args:
parent: Destination node
files: A list of Filter objects and/or relative paths to files.
Will call itself recursively, if the files list contains Filter objects. | Adds files and/or filters to the parent node. | [
"Adds",
"files",
"and",
"/",
"or",
"filters",
"to",
"the",
"parent",
"node",
"."
] | def _AddFilesToNode(self, parent, files):
"""Adds files and/or filters to the parent node.
Args:
parent: Destination node
files: A list of Filter objects and/or relative paths to files.
Will call itself recursively, if the files list contains Filter objects.
"""
for f in files:
i... | [
"def",
"_AddFilesToNode",
"(",
"self",
",",
"parent",
",",
"files",
")",
":",
"for",
"f",
"in",
"files",
":",
"if",
"isinstance",
"(",
"f",
",",
"Filter",
")",
":",
"node",
"=",
"[",
"'Filter'",
",",
"{",
"'Name'",
":",
"f",
".",
"name",
"}",
"]"... | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/MSVSProject.py#L134-L150 | ||
ros-planning/moveit2 | dd240ef6fd8b9932a7a53964140f2952786187a9 | moveit_ros/benchmarks/scripts/moveit_benchmark_statistics.py | python | plotAttribute | (cur, planners, attribute, typename) | Create a plot for a particular attribute. It will include data for
all planners that have data for this attribute. | Create a plot for a particular attribute. It will include data for
all planners that have data for this attribute. | [
"Create",
"a",
"plot",
"for",
"a",
"particular",
"attribute",
".",
"It",
"will",
"include",
"data",
"for",
"all",
"planners",
"that",
"have",
"data",
"for",
"this",
"attribute",
"."
] | def plotAttribute(cur, planners, attribute, typename):
"""Create a plot for a particular attribute. It will include data for
all planners that have data for this attribute."""
labels = []
measurements = []
nanCounts = []
if typename == "ENUM":
cur.execute('SELECT description FROM enums w... | [
"def",
"plotAttribute",
"(",
"cur",
",",
"planners",
",",
"attribute",
",",
"typename",
")",
":",
"labels",
"=",
"[",
"]",
"measurements",
"=",
"[",
"]",
"nanCounts",
"=",
"[",
"]",
"if",
"typename",
"==",
"\"ENUM\"",
":",
"cur",
".",
"execute",
"(",
... | https://github.com/ros-planning/moveit2/blob/dd240ef6fd8b9932a7a53964140f2952786187a9/moveit_ros/benchmarks/scripts/moveit_benchmark_statistics.py#L392-L505 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/shutil.py | python | get_archive_formats | () | return formats | Returns a list of supported formats for archiving and unarchiving.
Each element of the returned sequence is a tuple (name, description) | Returns a list of supported formats for archiving and unarchiving. | [
"Returns",
"a",
"list",
"of",
"supported",
"formats",
"for",
"archiving",
"and",
"unarchiving",
"."
] | def get_archive_formats():
"""Returns a list of supported formats for archiving and unarchiving.
Each element of the returned sequence is a tuple (name, description)
"""
formats = [(name, registry[2]) for name, registry in
_ARCHIVE_FORMATS.items()]
formats.sort()
return formats | [
"def",
"get_archive_formats",
"(",
")",
":",
"formats",
"=",
"[",
"(",
"name",
",",
"registry",
"[",
"2",
"]",
")",
"for",
"name",
",",
"registry",
"in",
"_ARCHIVE_FORMATS",
".",
"items",
"(",
")",
"]",
"formats",
".",
"sort",
"(",
")",
"return",
"fo... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/shutil.py#L470-L478 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewModel.IsContainer | (*args, **kwargs) | return _dataview.DataViewModel_IsContainer(*args, **kwargs) | IsContainer(self, DataViewItem item) -> bool
Override this to indicate whether an item is a container, in other
words, if it is a parent item that can have children. | IsContainer(self, DataViewItem item) -> bool | [
"IsContainer",
"(",
"self",
"DataViewItem",
"item",
")",
"-",
">",
"bool"
] | def IsContainer(*args, **kwargs):
"""
IsContainer(self, DataViewItem item) -> bool
Override this to indicate whether an item is a container, in other
words, if it is a parent item that can have children.
"""
return _dataview.DataViewModel_IsContainer(*args, **kwargs) | [
"def",
"IsContainer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewModel_IsContainer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L524-L531 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/gluon/utils.py | python | shape_is_known | (shape) | return True | Check whether a shape is completely known with or without np semantics.
Please see the doc of is_np_shape for more details. | Check whether a shape is completely known with or without np semantics. | [
"Check",
"whether",
"a",
"shape",
"is",
"completely",
"known",
"with",
"or",
"without",
"np",
"semantics",
"."
] | def shape_is_known(shape):
"""Check whether a shape is completely known with or without np semantics.
Please see the doc of is_np_shape for more details.
"""
if shape is None:
return False
unknown_dim_size = -1 if is_np_shape() else 0
if len(shape) == 0:
return unknown_dim_size ... | [
"def",
"shape_is_known",
"(",
"shape",
")",
":",
"if",
"shape",
"is",
"None",
":",
"return",
"False",
"unknown_dim_size",
"=",
"-",
"1",
"if",
"is_np_shape",
"(",
")",
"else",
"0",
"if",
"len",
"(",
"shape",
")",
"==",
"0",
":",
"return",
"unknown_dim_... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/utils.py#L417-L432 | |
polyworld/polyworld | eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26 | scripts/agent/agent.py | python | Agent.func | (self) | return self._get_func() | Lazy loading of brain function file | Lazy loading of brain function file | [
"Lazy",
"loading",
"of",
"brain",
"function",
"file"
] | def func(self):
''' Lazy loading of brain function file '''
return self._get_func() | [
"def",
"func",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_func",
"(",
")"
] | https://github.com/polyworld/polyworld/blob/eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26/scripts/agent/agent.py#L185-L187 | |
DLR-SC/tigl | d1c5901e948e33d10b1f9659ff3e22c4717b455f | thirdparty/doxy2swig/doxy2swig.py | python | Doxy2SWIG.get_specific_nodes | (self, node, names) | return dict(nodes) | Given a node and a sequence of strings in `names`, return a
dictionary containing the names as keys and child
`ELEMENT_NODEs`, that have a `tagName` equal to the name. | Given a node and a sequence of strings in `names`, return a
dictionary containing the names as keys and child
`ELEMENT_NODEs`, that have a `tagName` equal to the name. | [
"Given",
"a",
"node",
"and",
"a",
"sequence",
"of",
"strings",
"in",
"names",
"return",
"a",
"dictionary",
"containing",
"the",
"names",
"as",
"keys",
"and",
"child",
"ELEMENT_NODEs",
"that",
"have",
"a",
"tagName",
"equal",
"to",
"the",
"name",
"."
] | def get_specific_nodes(self, node, names):
"""Given a node and a sequence of strings in `names`, return a
dictionary containing the names as keys and child
`ELEMENT_NODEs`, that have a `tagName` equal to the name.
"""
nodes = [(x.tagName, x) for x in node.childNodes
... | [
"def",
"get_specific_nodes",
"(",
"self",
",",
"node",
",",
"names",
")",
":",
"nodes",
"=",
"[",
"(",
"x",
".",
"tagName",
",",
"x",
")",
"for",
"x",
"in",
"node",
".",
"childNodes",
"if",
"x",
".",
"nodeType",
"==",
"x",
".",
"ELEMENT_NODE",
"and... | https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/thirdparty/doxy2swig/doxy2swig.py#L275-L284 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py | python | MultiIndex.from_tuples | (cls, tuples, sortorder=None, names=None) | return MultiIndex.from_arrays(arrays, sortorder=sortorder, names=names) | Convert list of tuples to MultiIndex.
Parameters
----------
tuples : list / sequence of tuple-likes
Each tuple is the index of one row/column.
sortorder : int or None
Level of sortedness (must be lexicographically sorted by that
level).
names ... | Convert list of tuples to MultiIndex. | [
"Convert",
"list",
"of",
"tuples",
"to",
"MultiIndex",
"."
] | def from_tuples(cls, tuples, sortorder=None, names=None):
"""
Convert list of tuples to MultiIndex.
Parameters
----------
tuples : list / sequence of tuple-likes
Each tuple is the index of one row/column.
sortorder : int or None
Level of sortednes... | [
"def",
"from_tuples",
"(",
"cls",
",",
"tuples",
",",
"sortorder",
"=",
"None",
",",
"names",
"=",
"None",
")",
":",
"if",
"not",
"is_list_like",
"(",
"tuples",
")",
":",
"raise",
"TypeError",
"(",
"\"Input must be a list / sequence of tuple-likes.\"",
")",
"e... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py#L440-L495 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/package_index.py | python | unique_everseen | (iterable, key=None) | List unique elements, preserving order. Remember all elements ever seen. | List unique elements, preserving order. Remember all elements ever seen. | [
"List",
"unique",
"elements",
"preserving",
"order",
".",
"Remember",
"all",
"elements",
"ever",
"seen",
"."
] | def unique_everseen(iterable, key=None):
"List unique elements, preserving order. Remember all elements ever seen."
# unique_everseen('AAAABBBCCDAABBB') --> A B C D
# unique_everseen('ABBCcAD', str.lower) --> A B C D
seen = set()
seen_add = seen.add
if key is None:
for element in six.mov... | [
"def",
"unique_everseen",
"(",
"iterable",
",",
"key",
"=",
"None",
")",
":",
"# unique_everseen('AAAABBBCCDAABBB') --> A B C D",
"# unique_everseen('ABBCcAD', str.lower) --> A B C D",
"seen",
"=",
"set",
"(",
")",
"seen_add",
"=",
"seen",
".",
"add",
"if",
"key",
"is... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/package_index.py#L187-L202 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py | python | MultiIndex._format_attrs | (self) | return format_object_attrs(self, include_dtype=False) | Return a list of tuples of the (attr,formatted_value). | Return a list of tuples of the (attr,formatted_value). | [
"Return",
"a",
"list",
"of",
"tuples",
"of",
"the",
"(",
"attr",
"formatted_value",
")",
"."
] | def _format_attrs(self):
"""
Return a list of tuples of the (attr,formatted_value).
"""
return format_object_attrs(self, include_dtype=False) | [
"def",
"_format_attrs",
"(",
"self",
")",
":",
"return",
"format_object_attrs",
"(",
"self",
",",
"include_dtype",
"=",
"False",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/multi.py#L1063-L1067 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/boringssl/src/util/bot/go/bootstrap.py | python | read_file | (path) | Returns contents of a given file or None if not readable. | Returns contents of a given file or None if not readable. | [
"Returns",
"contents",
"of",
"a",
"given",
"file",
"or",
"None",
"if",
"not",
"readable",
"."
] | def read_file(path):
"""Returns contents of a given file or None if not readable."""
assert isinstance(path, (list, tuple))
try:
with open(os.path.join(*path), 'r') as f:
return f.read()
except IOError:
return None | [
"def",
"read_file",
"(",
"path",
")",
":",
"assert",
"isinstance",
"(",
"path",
",",
"(",
"list",
",",
"tuple",
")",
")",
"try",
":",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"*",
"path",
")",
",",
"'r'",
")",
"as",
"f",
":",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/boringssl/src/util/bot/go/bootstrap.py#L83-L90 | ||
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | waf-tools/misc.py | python | subst_func | (tsk) | Substitutes variables in a .in file | Substitutes variables in a .in file | [
"Substitutes",
"variables",
"in",
"a",
".",
"in",
"file"
] | def subst_func(tsk):
"Substitutes variables in a .in file"
m4_re = re.compile('@(\w+)@', re.M)
code = tsk.inputs[0].read() #Utils.readf(infile)
# replace all % by %% to prevent errors by % signs in the input file while string formatting
code = code.replace('%', '%%')
s = m4_re.sub(r'%(\1)s', code)
env = tsk... | [
"def",
"subst_func",
"(",
"tsk",
")",
":",
"m4_re",
"=",
"re",
".",
"compile",
"(",
"'@(\\w+)@'",
",",
"re",
".",
"M",
")",
"code",
"=",
"tsk",
".",
"inputs",
"[",
"0",
"]",
".",
"read",
"(",
")",
"#Utils.readf(infile)",
"# replace all % by %% to prevent... | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/waf-tools/misc.py#L83-L102 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | kratos/python_scripts/python_solver.py | python | PythonSolver.PrepareModelPart | (self) | This function prepares the ModelPart for being used by the PythonSolver | This function prepares the ModelPart for being used by the PythonSolver | [
"This",
"function",
"prepares",
"the",
"ModelPart",
"for",
"being",
"used",
"by",
"the",
"PythonSolver"
] | def PrepareModelPart(self):
"""This function prepares the ModelPart for being used by the PythonSolver
"""
pass | [
"def",
"PrepareModelPart",
"(",
"self",
")",
":",
"pass"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/python_solver.py#L76-L79 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_array_ops.py | python | get_bprop_reshape | (self) | return bprop | Generate bprop for Reshape | Generate bprop for Reshape | [
"Generate",
"bprop",
"for",
"Reshape"
] | def get_bprop_reshape(self):
"""Generate bprop for Reshape"""
def bprop(x, shp, out, dout):
shapex = shape_op(x)
if -1 in shapex:
shapex = dyn_shape_op(x)
return reshape(dout, shapex), zeros_like(shp)
return bprop | [
"def",
"get_bprop_reshape",
"(",
"self",
")",
":",
"def",
"bprop",
"(",
"x",
",",
"shp",
",",
"out",
",",
"dout",
")",
":",
"shapex",
"=",
"shape_op",
"(",
"x",
")",
"if",
"-",
"1",
"in",
"shapex",
":",
"shapex",
"=",
"dyn_shape_op",
"(",
"x",
")... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_array_ops.py#L180-L189 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/python_gflags/gflags.py | python | _GetMainModule | () | return main_module_name | Returns: string, name of the module from which execution started. | Returns: string, name of the module from which execution started. | [
"Returns",
":",
"string",
"name",
"of",
"the",
"module",
"from",
"which",
"execution",
"started",
"."
] | def _GetMainModule():
"""Returns: string, name of the module from which execution started."""
# First, try to use the same logic used by _GetCallingModuleObjectAndName(),
# i.e., call _GetModuleObjectAndName(). For that we first need to
# find the dictionary that the main module uses to store the
# globals.
... | [
"def",
"_GetMainModule",
"(",
")",
":",
"# First, try to use the same logic used by _GetCallingModuleObjectAndName(),",
"# i.e., call _GetModuleObjectAndName(). For that we first need to",
"# find the dictionary that the main module uses to store the",
"# globals.",
"#",
"# That's (normally) th... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/python_gflags/gflags.py#L757-L777 | |
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/site_packages/joblib2/numpy_pickle.py | python | dump | (value, filename, compress=0, cache_size=100) | return pickler._filenames | Fast persistence of an arbitrary Python object into a files, with
dedicated storage for numpy arrays.
Parameters
-----------
value: any Python object
The object to store to disk
filename: string
The name of the file in which it is to be stored
compress: integer for 0 to 9, optio... | Fast persistence of an arbitrary Python object into a files, with
dedicated storage for numpy arrays. | [
"Fast",
"persistence",
"of",
"an",
"arbitrary",
"Python",
"object",
"into",
"a",
"files",
"with",
"dedicated",
"storage",
"for",
"numpy",
"arrays",
"."
] | def dump(value, filename, compress=0, cache_size=100):
"""Fast persistence of an arbitrary Python object into a files, with
dedicated storage for numpy arrays.
Parameters
-----------
value: any Python object
The object to store to disk
filename: string
The name of the file in wh... | [
"def",
"dump",
"(",
"value",
",",
"filename",
",",
"compress",
"=",
"0",
",",
"cache_size",
"=",
"100",
")",
":",
"if",
"not",
"isinstance",
"(",
"filename",
",",
"basestring",
")",
":",
"# People keep inverting arguments, and the resulting error is",
"# incompreh... | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/joblib2/numpy_pickle.py#L313-L367 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/pyct/templates.py | python | ReplaceTransformer._prepare_replacement | (self, replaced, key) | return new_nodes | Prepares a replacement AST that's safe to swap in for a node.
Args:
replaced: ast.AST, the node being replaced
key: Hashable, the key of the replacement AST
Returns:
ast.AST, the replacement AST | Prepares a replacement AST that's safe to swap in for a node. | [
"Prepares",
"a",
"replacement",
"AST",
"that",
"s",
"safe",
"to",
"swap",
"in",
"for",
"a",
"node",
"."
] | def _prepare_replacement(self, replaced, key):
"""Prepares a replacement AST that's safe to swap in for a node.
Args:
replaced: ast.AST, the node being replaced
key: Hashable, the key of the replacement AST
Returns:
ast.AST, the replacement AST
"""
repl = self.replacements[key]
... | [
"def",
"_prepare_replacement",
"(",
"self",
",",
"replaced",
",",
"key",
")",
":",
"repl",
"=",
"self",
".",
"replacements",
"[",
"key",
"]",
"new_nodes",
"=",
"ast_util",
".",
"copy_clean",
"(",
"repl",
",",
"preserve_annos",
"=",
"self",
".",
"preserved_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/pyct/templates.py#L125-L140 | |
appcelerator-archive/titanium_desktop | 37dbaab5664e595115e2fcdc348ed125cd50b48d | site_scons/simplejson/encoder.py | python | JSONEncoder.iterencode | (self, o, _one_shot=False) | return _iterencode(o, 0) | Encode the given object and yield each string
representation as available.
For example::
for chunk in JSONEncoder().iterencode(bigobject):
mysocket.write(chunk) | Encode the given object and yield each string
representation as available. | [
"Encode",
"the",
"given",
"object",
"and",
"yield",
"each",
"string",
"representation",
"as",
"available",
"."
] | def iterencode(self, o, _one_shot=False):
"""Encode the given object and yield each string
representation as available.
For example::
for chunk in JSONEncoder().iterencode(bigobject):
mysocket.write(chunk)
"""
if self.check_circular:
mar... | [
"def",
"iterencode",
"(",
"self",
",",
"o",
",",
"_one_shot",
"=",
"False",
")",
":",
"if",
"self",
".",
"check_circular",
":",
"markers",
"=",
"{",
"}",
"else",
":",
"markers",
"=",
"None",
"if",
"self",
".",
"ensure_ascii",
":",
"_encoder",
"=",
"e... | https://github.com/appcelerator-archive/titanium_desktop/blob/37dbaab5664e595115e2fcdc348ed125cd50b48d/site_scons/simplejson/encoder.py#L205-L260 | |
apache/kudu | 90895ce76590f10730ad7aac3613b69d89ff5422 | src/kudu/scripts/parse_metrics_log.py | python | delta | (prev, cur, m) | return cur[m] - prev[m] | Compute the delta in metric 'm' between two metric snapshots. | Compute the delta in metric 'm' between two metric snapshots. | [
"Compute",
"the",
"delta",
"in",
"metric",
"m",
"between",
"two",
"metric",
"snapshots",
"."
] | def delta(prev, cur, m):
""" Compute the delta in metric 'm' between two metric snapshots. """
if m not in prev or m not in cur:
return 0
return cur[m] - prev[m] | [
"def",
"delta",
"(",
"prev",
",",
"cur",
",",
"m",
")",
":",
"if",
"m",
"not",
"in",
"prev",
"or",
"m",
"not",
"in",
"cur",
":",
"return",
"0",
"return",
"cur",
"[",
"m",
"]",
"-",
"prev",
"[",
"m",
"]"
] | https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/src/kudu/scripts/parse_metrics_log.py#L117-L122 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/generator/cmake.py | python | SetFilesProperty | (output, variable, property_name, values, sep) | Given a set of source files, sets the given property on them. | Given a set of source files, sets the given property on them. | [
"Given",
"a",
"set",
"of",
"source",
"files",
"sets",
"the",
"given",
"property",
"on",
"them",
"."
] | def SetFilesProperty(output, variable, property_name, values, sep):
"""Given a set of source files, sets the given property on them."""
output.write('set_source_files_properties(')
WriteVariable(output, variable)
output.write(' PROPERTIES ')
output.write(property_name)
output.write(' "')
for value in valu... | [
"def",
"SetFilesProperty",
"(",
"output",
",",
"variable",
",",
"property_name",
",",
"values",
",",
"sep",
")",
":",
"output",
".",
"write",
"(",
"'set_source_files_properties('",
")",
"WriteVariable",
"(",
"output",
",",
"variable",
")",
"output",
".",
"writ... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/cmake.py#L156-L166 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/_process_posix.py | python | _find_cmd | (cmd) | return py3compat.bytes_to_str(path) | Find the full path to a command using which. | Find the full path to a command using which. | [
"Find",
"the",
"full",
"path",
"to",
"a",
"command",
"using",
"which",
"."
] | def _find_cmd(cmd):
"""Find the full path to a command using which."""
path = sp.Popen(['/usr/bin/env', 'which', cmd],
stdout=sp.PIPE, stderr=sp.PIPE).communicate()[0]
return py3compat.bytes_to_str(path) | [
"def",
"_find_cmd",
"(",
"cmd",
")",
":",
"path",
"=",
"sp",
".",
"Popen",
"(",
"[",
"'/usr/bin/env'",
",",
"'which'",
",",
"cmd",
"]",
",",
"stdout",
"=",
"sp",
".",
"PIPE",
",",
"stderr",
"=",
"sp",
".",
"PIPE",
")",
".",
"communicate",
"(",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/_process_posix.py#L35-L40 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/executor_manager.py | python | _load_general | (data, targets) | Load a list of arrays into a list of arrays specified by slices. | Load a list of arrays into a list of arrays specified by slices. | [
"Load",
"a",
"list",
"of",
"arrays",
"into",
"a",
"list",
"of",
"arrays",
"specified",
"by",
"slices",
"."
] | def _load_general(data, targets):
"""Load a list of arrays into a list of arrays specified by slices."""
for d_src, d_targets in zip(data, targets):
if isinstance(d_targets, nd.NDArray):
d_src.copyto(d_targets)
else:
assert d_targets[-1][0].stop == d_src.shape[0], \
... | [
"def",
"_load_general",
"(",
"data",
",",
"targets",
")",
":",
"for",
"d_src",
",",
"d_targets",
"in",
"zip",
"(",
"data",
",",
"targets",
")",
":",
"if",
"isinstance",
"(",
"d_targets",
",",
"nd",
".",
"NDArray",
")",
":",
"d_src",
".",
"copyto",
"(... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/executor_manager.py#L98-L108 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/clientsecrets.py | python | loadfile | (filename, cache=None) | return next(six.iteritems(obj)) | Loading of client_secrets JSON file, optionally backed by a cache.
Typical cache storage would be App Engine memcache service,
but you can pass in any other cache client that implements
these methods:
* ``get(key, namespace=ns)``
* ``set(key, value, namespace=ns)``
Usage::
# without caching
clie... | Loading of client_secrets JSON file, optionally backed by a cache. | [
"Loading",
"of",
"client_secrets",
"JSON",
"file",
"optionally",
"backed",
"by",
"a",
"cache",
"."
] | def loadfile(filename, cache=None):
"""Loading of client_secrets JSON file, optionally backed by a cache.
Typical cache storage would be App Engine memcache service,
but you can pass in any other cache client that implements
these methods:
* ``get(key, namespace=ns)``
* ``set(key, value, namespace=ns)``
... | [
"def",
"loadfile",
"(",
"filename",
",",
"cache",
"=",
"None",
")",
":",
"_SECRET_NAMESPACE",
"=",
"'oauth2client:secrets#ns'",
"if",
"not",
"cache",
":",
"return",
"_loadfile",
"(",
"filename",
")",
"obj",
"=",
"cache",
".",
"get",
"(",
"filename",
",",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/clientsecrets.py#L119-L163 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | bin/single_node_perf_run.py | python | backup_workloads | () | return temp_dir | Copy the workload folder to a temporary directory and returns its name.
Used to keep workloads from being clobbered by git checkout. | Copy the workload folder to a temporary directory and returns its name. | [
"Copy",
"the",
"workload",
"folder",
"to",
"a",
"temporary",
"directory",
"and",
"returns",
"its",
"name",
"."
] | def backup_workloads():
"""Copy the workload folder to a temporary directory and returns its name.
Used to keep workloads from being clobbered by git checkout.
"""
temp_dir = mkdtemp()
sh.cp(os.path.join(IMPALA_HOME, "testdata", "workloads"),
temp_dir, R=True, _out=sys.stdout, _err=sys.stderr)
prin... | [
"def",
"backup_workloads",
"(",
")",
":",
"temp_dir",
"=",
"mkdtemp",
"(",
")",
"sh",
".",
"cp",
"(",
"os",
".",
"path",
".",
"join",
"(",
"IMPALA_HOME",
",",
"\"testdata\"",
",",
"\"workloads\"",
")",
",",
"temp_dir",
",",
"R",
"=",
"True",
",",
"_o... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/bin/single_node_perf_run.py#L203-L212 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Validator.GetWindow | (*args, **kwargs) | return _core_.Validator_GetWindow(*args, **kwargs) | GetWindow(self) -> Window | GetWindow(self) -> Window | [
"GetWindow",
"(",
"self",
")",
"-",
">",
"Window"
] | def GetWindow(*args, **kwargs):
"""GetWindow(self) -> Window"""
return _core_.Validator_GetWindow(*args, **kwargs) | [
"def",
"GetWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Validator_GetWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L11892-L11894 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py | python | NeuralNetworkBuilder.add_concat_nd | (self, name, input_names, output_name, axis) | return spec_layer | Add a concat_nd layer to the model that performs concatenation along the
given axis.
Refer to the **ConcatNDLayerParams** message in specification (NeuralNetwork.proto) for more details.
Parameters
----------
name: str
The name of this layer.
input_names: lis... | Add a concat_nd layer to the model that performs concatenation along the
given axis.
Refer to the **ConcatNDLayerParams** message in specification (NeuralNetwork.proto) for more details. | [
"Add",
"a",
"concat_nd",
"layer",
"to",
"the",
"model",
"that",
"performs",
"concatenation",
"along",
"the",
"given",
"axis",
".",
"Refer",
"to",
"the",
"**",
"ConcatNDLayerParams",
"**",
"message",
"in",
"specification",
"(",
"NeuralNetwork",
".",
"proto",
")... | def add_concat_nd(self, name, input_names, output_name, axis):
"""
Add a concat_nd layer to the model that performs concatenation along the
given axis.
Refer to the **ConcatNDLayerParams** message in specification (NeuralNetwork.proto) for more details.
Parameters
------... | [
"def",
"add_concat_nd",
"(",
"self",
",",
"name",
",",
"input_names",
",",
"output_name",
",",
"axis",
")",
":",
"spec_layer",
"=",
"self",
".",
"_add_generic_layer",
"(",
"name",
",",
"input_names",
",",
"[",
"output_name",
"]",
")",
"spec_layer_params",
"=... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L4608-L4629 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetMachOType | (self) | return {
'executable': 'mh_execute',
'static_library': 'staticlib',
'shared_library': 'mh_dylib',
'loadable_module': 'mh_bundle',
}[self.spec['type']] | Returns the MACH_O_TYPE of this target. | Returns the MACH_O_TYPE of this target. | [
"Returns",
"the",
"MACH_O_TYPE",
"of",
"this",
"target",
"."
] | def GetMachOType(self):
"""Returns the MACH_O_TYPE of this target."""
# Weird, but matches Xcode.
if not self._IsBundle() and self.spec['type'] == 'executable':
return ''
return {
'executable': 'mh_execute',
'static_library': 'staticlib',
'shared_library': 'mh_dylib',
'load... | [
"def",
"GetMachOType",
"(",
"self",
")",
":",
"# Weird, but matches Xcode.",
"if",
"not",
"self",
".",
"_IsBundle",
"(",
")",
"and",
"self",
".",
"spec",
"[",
"'type'",
"]",
"==",
"'executable'",
":",
"return",
"''",
"return",
"{",
"'executable'",
":",
"'m... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/xcode_emulation.py#L343-L353 | |
scylladb/seastar | 0cdd2329beb1cc4c0af8828598c26114397ffa9c | scripts/perftune.py | python | NetPerfTuner.__get_irqs_one | (self, iface) | return self.__nic2irqs[iface] | Returns the list of IRQ numbers for the given interface. | Returns the list of IRQ numbers for the given interface. | [
"Returns",
"the",
"list",
"of",
"IRQ",
"numbers",
"for",
"the",
"given",
"interface",
"."
] | def __get_irqs_one(self, iface):
"""
Returns the list of IRQ numbers for the given interface.
"""
return self.__nic2irqs[iface] | [
"def",
"__get_irqs_one",
"(",
"self",
",",
"iface",
")",
":",
"return",
"self",
".",
"__nic2irqs",
"[",
"iface",
"]"
] | https://github.com/scylladb/seastar/blob/0cdd2329beb1cc4c0af8828598c26114397ffa9c/scripts/perftune.py#L564-L568 | |
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/stp/role/assignment/__init__.py | python | IRoleAssignment.assign_roles | (
flat_requests: FlatRoleRequests,
world_state: stp.rc.WorldState,
prev_results: FlatRoleResults,
) | Assigns roles.
:param flat_requests: The role requests.
:param world_state: The current state of the world.
:param prev_results: The previous results.
:return: The results of the role assignment. | Assigns roles.
:param flat_requests: The role requests.
:param world_state: The current state of the world.
:param prev_results: The previous results.
:return: The results of the role assignment. | [
"Assigns",
"roles",
".",
":",
"param",
"flat_requests",
":",
"The",
"role",
"requests",
".",
":",
"param",
"world_state",
":",
"The",
"current",
"state",
"of",
"the",
"world",
".",
":",
"param",
"prev_results",
":",
"The",
"previous",
"results",
".",
":",
... | def assign_roles(
flat_requests: FlatRoleRequests,
world_state: stp.rc.WorldState,
prev_results: FlatRoleResults,
) -> FlatRoleResults:
"""Assigns roles.
:param flat_requests: The role requests.
:param world_state: The current state of the world.
:param prev_r... | [
"def",
"assign_roles",
"(",
"flat_requests",
":",
"FlatRoleRequests",
",",
"world_state",
":",
"stp",
".",
"rc",
".",
"WorldState",
",",
"prev_results",
":",
"FlatRoleResults",
",",
")",
"->",
"FlatRoleResults",
":",
"..."
] | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/stp/role/assignment/__init__.py#L23-L34 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/f2py/capi_maps.py | python | getctype | (var) | return ctype | Determines C type | Determines C type | [
"Determines",
"C",
"type"
] | def getctype(var):
"""
Determines C type
"""
ctype='void'
if isfunction(var):
if 'result' in var:
a=var['result']
else:
a=var['name']
if a in var['vars']:
return getctype(var['vars'][a])
else:
errmess('getctype: function... | [
"def",
"getctype",
"(",
"var",
")",
":",
"ctype",
"=",
"'void'",
"if",
"isfunction",
"(",
"var",
")",
":",
"if",
"'result'",
"in",
"var",
":",
"a",
"=",
"var",
"[",
"'result'",
"]",
"else",
":",
"a",
"=",
"var",
"[",
"'name'",
"]",
"if",
"a",
"... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/f2py/capi_maps.py#L217-L261 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/core.py | python | MaskedArray.nonzero | (self) | return narray(self.filled(0), copy=False).nonzero() | Return the indices of unmasked elements that are not zero.
Returns a tuple of arrays, one for each dimension, containing the
indices of the non-zero elements in that dimension. The corresponding
non-zero values can be obtained with::
a[a.nonzero()]
To group the indices by ... | Return the indices of unmasked elements that are not zero. | [
"Return",
"the",
"indices",
"of",
"unmasked",
"elements",
"that",
"are",
"not",
"zero",
"."
] | def nonzero(self):
"""
Return the indices of unmasked elements that are not zero.
Returns a tuple of arrays, one for each dimension, containing the
indices of the non-zero elements in that dimension. The corresponding
non-zero values can be obtained with::
a[a.nonze... | [
"def",
"nonzero",
"(",
"self",
")",
":",
"return",
"narray",
"(",
"self",
".",
"filled",
"(",
"0",
")",
",",
"copy",
"=",
"False",
")",
".",
"nonzero",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/core.py#L4810-L4909 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM2_Startup_REQUEST.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(TPM2_Startup_REQUEST) | Returns new TPM2_Startup_REQUEST object constructed from its
marshaled representation in the given byte buffer | Returns new TPM2_Startup_REQUEST object constructed from its
marshaled representation in the given byte buffer | [
"Returns",
"new",
"TPM2_Startup_REQUEST",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new TPM2_Startup_REQUEST object constructed from its
marshaled representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(TPM2_Startup_REQUEST) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"TPM2_Startup_REQUEST",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L9082-L9086 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/locked_file.py | python | LockedFile.unlock_and_close | (self) | Unlock and close a file. | Unlock and close a file. | [
"Unlock",
"and",
"close",
"a",
"file",
"."
] | def unlock_and_close(self):
"""Unlock and close a file."""
self._opener.unlock_and_close() | [
"def",
"unlock_and_close",
"(",
"self",
")",
":",
"self",
".",
"_opener",
".",
"unlock_and_close",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/oauth2client/oauth2client/locked_file.py#L376-L378 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/vis/visualization.py | python | hideLabel | (name : ItemPath, hidden=True) | return scene().hideLabel(name,hidden) | Hides or shows the label of an item in the visualization | Hides or shows the label of an item in the visualization | [
"Hides",
"or",
"shows",
"the",
"label",
"of",
"an",
"item",
"in",
"the",
"visualization"
] | def hideLabel(name : ItemPath, hidden=True) -> None:
"""Hides or shows the label of an item in the visualization"""
return scene().hideLabel(name,hidden) | [
"def",
"hideLabel",
"(",
"name",
":",
"ItemPath",
",",
"hidden",
"=",
"True",
")",
"->",
"None",
":",
"return",
"scene",
"(",
")",
".",
"hideLabel",
"(",
"name",
",",
"hidden",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L1283-L1285 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/profiler.py | python | start | () | Start profiling.
Raises:
ProfilerAlreadyRunningError: If another profiling session is running. | Start profiling. | [
"Start",
"profiling",
"."
] | def start():
"""Start profiling.
Raises:
ProfilerAlreadyRunningError: If another profiling session is running.
"""
global _profiler
with _profiler_lock:
if _profiler is not None:
raise ProfilerAlreadyRunningError('Another profiler is running.')
if context.default_execution_mode == context.E... | [
"def",
"start",
"(",
")",
":",
"global",
"_profiler",
"with",
"_profiler_lock",
":",
"if",
"_profiler",
"is",
"not",
"None",
":",
"raise",
"ProfilerAlreadyRunningError",
"(",
"'Another profiler is running.'",
")",
"if",
"context",
".",
"default_execution_mode",
"=="... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/profiler.py#L64-L80 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextParagraphLayoutBox.SetStyle | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_SetStyle(*args, **kwargs) | SetStyle(self, RichTextRange range, RichTextAttr style, int flags=RICHTEXT_SETSTYLE_WITH_UNDO) -> bool | SetStyle(self, RichTextRange range, RichTextAttr style, int flags=RICHTEXT_SETSTYLE_WITH_UNDO) -> bool | [
"SetStyle",
"(",
"self",
"RichTextRange",
"range",
"RichTextAttr",
"style",
"int",
"flags",
"=",
"RICHTEXT_SETSTYLE_WITH_UNDO",
")",
"-",
">",
"bool"
] | def SetStyle(*args, **kwargs):
"""SetStyle(self, RichTextRange range, RichTextAttr style, int flags=RICHTEXT_SETSTYLE_WITH_UNDO) -> bool"""
return _richtext.RichTextParagraphLayoutBox_SetStyle(*args, **kwargs) | [
"def",
"SetStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_SetStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1728-L1730 | |
linyouhappy/kongkongxiyou | 7a69b2913eb29f4be77f9a62fb90cdd72c4160f1 | cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.displayname | (self) | return self._displayname | Return the display name for the entity referenced by this cursor.
The display name contains extra information that helps identify the cursor,
such as the parameters of a function or template or the arguments of a
class template specialization. | Return the display name for the entity referenced by this cursor. | [
"Return",
"the",
"display",
"name",
"for",
"the",
"entity",
"referenced",
"by",
"this",
"cursor",
"."
] | def displayname(self):
"""
Return the display name for the entity referenced by this cursor.
The display name contains extra information that helps identify the cursor,
such as the parameters of a function or template or the arguments of a
class template specialization.
... | [
"def",
"displayname",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_displayname'",
")",
":",
"self",
".",
"_displayname",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorDisplayName",
"(",
"self",
")",
"return",
"self",
".",
"_displayna... | https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1115-L1126 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/synxml.py | python | Syntax.GetLangId | (self) | return self.langid | Get the language id
@return: string | Get the language id
@return: string | [
"Get",
"the",
"language",
"id",
"@return",
":",
"string"
] | def GetLangId(self):
"""Get the language id
@return: string
"""
return self.langid | [
"def",
"GetLangId",
"(",
"self",
")",
":",
"return",
"self",
".",
"langid"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/synxml.py#L575-L580 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/sparse_tensor.py | python | SparseTensor.graph | (self) | return self._indices.graph | The `Graph` that contains the index, value, and dense_shape tensors. | The `Graph` that contains the index, value, and dense_shape tensors. | [
"The",
"Graph",
"that",
"contains",
"the",
"index",
"value",
"and",
"dense_shape",
"tensors",
"."
] | def graph(self):
"""The `Graph` that contains the index, value, and dense_shape tensors."""
return self._indices.graph | [
"def",
"graph",
"(",
"self",
")",
":",
"return",
"self",
".",
"_indices",
".",
"graph"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/sparse_tensor.py#L185-L187 | |
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | utils/grid.py | python | TimelinesRenderer.draw_events | (self, ctx, events, x, y, width, height) | ! Draw Event
@param self this object
@param ctx ctx
@param events events
@param x x
@param y y
@param width width
@param height height
@return none | ! Draw Event | [
"!",
"Draw",
"Event"
] | def draw_events(self, ctx, events, x, y, width, height):
"""! Draw Event
@param self this object
@param ctx ctx
@param events events
@param x x
@param y y
@param width width
@param height height
@return none
"""
if (self.grey_backgr... | [
"def",
"draw_events",
"(",
"self",
",",
"ctx",
",",
"events",
",",
"x",
",",
"y",
",",
"width",
",",
"height",
")",
":",
"if",
"(",
"self",
".",
"grey_background",
"%",
"2",
")",
"==",
"0",
":",
"ctx",
".",
"rectangle",
"(",
"x",
",",
"y",
"-",... | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/utils/grid.py#L717-L745 | ||
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | api/ctpx/ctpmd.py | python | CtpMd.onRspError | (self, RspInfoField, requestId, final) | 错误应答 | 错误应答 | [
"错误应答"
] | def onRspError(self, RspInfoField, requestId, final):
"""错误应答"""
log = u'行情服务响应错误,错误码:[{0}], 错误信息:[{1}]'.format(
RspInfoField.errorID, RspInfoField.errorMsg.decode('gbk'))
logger.info(log) | [
"def",
"onRspError",
"(",
"self",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"log",
"=",
"u'行情服务响应错误,错误码:[{0}], 错误信息:[{1}]'.format(",
"",
"",
"",
"RspInfoField",
".",
"errorID",
",",
"RspInfoField",
".",
"errorMsg",
".",
"decode",
"(",
"'gb... | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/api/ctpx/ctpmd.py#L68-L72 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/fft/fftpack.py | python | ihfft | (a, n=None, axis=-1) | return conjugate(rfft(a, n, axis))/n | Compute the inverse FFT of a signal whose spectrum has Hermitian symmetry.
Parameters
----------
a : array_like
Input array.
n : int, optional
Length of the inverse FFT.
axis : int, optional
Axis over which to compute the inverse FFT, assuming Hermitian
symmetry of t... | Compute the inverse FFT of a signal whose spectrum has Hermitian symmetry. | [
"Compute",
"the",
"inverse",
"FFT",
"of",
"a",
"signal",
"whose",
"spectrum",
"has",
"Hermitian",
"symmetry",
"."
] | def ihfft(a, n=None, axis=-1):
"""
Compute the inverse FFT of a signal whose spectrum has Hermitian symmetry.
Parameters
----------
a : array_like
Input array.
n : int, optional
Length of the inverse FFT.
axis : int, optional
Axis over which to compute the inverse FF... | [
"def",
"ihfft",
"(",
"a",
",",
"n",
"=",
"None",
",",
"axis",
"=",
"-",
"1",
")",
":",
"a",
"=",
"asarray",
"(",
"a",
")",
".",
"astype",
"(",
"float",
")",
"if",
"n",
"is",
"None",
":",
"n",
"=",
"shape",
"(",
"a",
")",
"[",
"axis",
"]",... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/fft/fftpack.py#L472-L508 | |
eranif/codelite | 076eb332d6d2b7ea9a7654afa0461a01d91543aa | Runtime/gdb_printers/libstdcxx/v6/xmethods.py | python | SharedPtrSubscriptWorker._supports | (self, method_name) | return self._is_array | operator[] is only supported for shared_ptr<T[]> | operator[] is only supported for shared_ptr<T[]> | [
"operator",
"[]",
"is",
"only",
"supported",
"for",
"shared_ptr<T",
"[]",
">"
] | def _supports(self, method_name):
"operator[] is only supported for shared_ptr<T[]>"
return self._is_array | [
"def",
"_supports",
"(",
"self",
",",
"method_name",
")",
":",
"return",
"self",
".",
"_is_array"
] | https://github.com/eranif/codelite/blob/076eb332d6d2b7ea9a7654afa0461a01d91543aa/Runtime/gdb_printers/libstdcxx/v6/xmethods.py#L706-L708 | |
OpenGenus/cosmos | 1a94e8880068e51d571543be179c323936bd0936 | code/artificial_intelligence/src/principal_component_analysis/pca.py | python | visualize_data | (data1, data2) | Create a 3D plot for data visualization | Create a 3D plot for data visualization | [
"Create",
"a",
"3D",
"plot",
"for",
"data",
"visualization"
] | def visualize_data(data1, data2):
""" Create a 3D plot for data visualization """
fig = plt.figure(figsize=(8, 8))
ax = fig.add_subplot(111, projection="3d")
plt.rcParams["legend.fontsize"] = 10
ax.plot(
data1[0, :],
data1[1, :],
data1[2, :],
"o",
markersize=8... | [
"def",
"visualize_data",
"(",
"data1",
",",
"data2",
")",
":",
"fig",
"=",
"plt",
".",
"figure",
"(",
"figsize",
"=",
"(",
"8",
",",
"8",
")",
")",
"ax",
"=",
"fig",
".",
"add_subplot",
"(",
"111",
",",
"projection",
"=",
"\"3d\"",
")",
"plt",
".... | https://github.com/OpenGenus/cosmos/blob/1a94e8880068e51d571543be179c323936bd0936/code/artificial_intelligence/src/principal_component_analysis/pca.py#L23-L55 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/command/sdist.py | python | sdist.make_distribution | (self) | Create the source distribution(s). First, we create the release
tree with 'make_release_tree()'; then, we create all required
archive files (according to 'self.formats') from the release tree.
Finally, we clean up by blowing away the release tree (unless
'self.keep_temp' is true). The ... | Create the source distribution(s). First, we create the release
tree with 'make_release_tree()'; then, we create all required
archive files (according to 'self.formats') from the release tree.
Finally, we clean up by blowing away the release tree (unless
'self.keep_temp' is true). The ... | [
"Create",
"the",
"source",
"distribution",
"(",
"s",
")",
".",
"First",
"we",
"create",
"the",
"release",
"tree",
"with",
"make_release_tree",
"()",
";",
"then",
"we",
"create",
"all",
"required",
"archive",
"files",
"(",
"according",
"to",
"self",
".",
"f... | def make_distribution(self):
"""Create the source distribution(s). First, we create the release
tree with 'make_release_tree()'; then, we create all required
archive files (according to 'self.formats') from the release tree.
Finally, we clean up by blowing away the release tree (unless
... | [
"def",
"make_distribution",
"(",
"self",
")",
":",
"# Don't warn about missing meta-data here -- should be (and is!)",
"# done elsewhere.",
"base_dir",
"=",
"self",
".",
"distribution",
".",
"get_fullname",
"(",
")",
"base_name",
"=",
"os",
".",
"path",
".",
"join",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/command/sdist.py#L443-L471 | ||
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/faster-rcnn/lib/pycocotools/coco.py | python | COCO.loadCats | (self, ids=[]) | Load cats with the specified ids.
:param ids (int array) : integer ids specifying cats
:return: cats (object array) : loaded cat objects | Load cats with the specified ids.
:param ids (int array) : integer ids specifying cats
:return: cats (object array) : loaded cat objects | [
"Load",
"cats",
"with",
"the",
"specified",
"ids",
".",
":",
"param",
"ids",
"(",
"int",
"array",
")",
":",
"integer",
"ids",
"specifying",
"cats",
":",
"return",
":",
"cats",
"(",
"object",
"array",
")",
":",
"loaded",
"cat",
"objects"
] | def loadCats(self, ids=[]):
"""
Load cats with the specified ids.
:param ids (int array) : integer ids specifying cats
:return: cats (object array) : loaded cat objects
"""
if type(ids) == list:
return [self.cats[id] for id in ids]
elif type(ids)... | [
"def",
"loadCats",
"(",
"self",
",",
"ids",
"=",
"[",
"]",
")",
":",
"if",
"type",
"(",
"ids",
")",
"==",
"list",
":",
"return",
"[",
"self",
".",
"cats",
"[",
"id",
"]",
"for",
"id",
"in",
"ids",
"]",
"elif",
"type",
"(",
"ids",
")",
"==",
... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/faster-rcnn/lib/pycocotools/coco.py#L213-L222 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/callwrapper.py | python | _ArgManager.add_arg | (self, obj, ty) | return native.value | Unbox argument and emit code that handles any error during unboxing.
Args are cleaned up in reverse order of the parameter list, and
cleanup begins as soon as unboxing of any argument fails. E.g. failure
on arg2 will result in control flow going through:
arg2.err -> arg1.err -> arg0... | Unbox argument and emit code that handles any error during unboxing.
Args are cleaned up in reverse order of the parameter list, and
cleanup begins as soon as unboxing of any argument fails. E.g. failure
on arg2 will result in control flow going through: | [
"Unbox",
"argument",
"and",
"emit",
"code",
"that",
"handles",
"any",
"error",
"during",
"unboxing",
".",
"Args",
"are",
"cleaned",
"up",
"in",
"reverse",
"order",
"of",
"the",
"parameter",
"list",
"and",
"cleanup",
"begins",
"as",
"soon",
"as",
"unboxing",
... | def add_arg(self, obj, ty):
"""
Unbox argument and emit code that handles any error during unboxing.
Args are cleaned up in reverse order of the parameter list, and
cleanup begins as soon as unboxing of any argument fails. E.g. failure
on arg2 will result in control flow going th... | [
"def",
"add_arg",
"(",
"self",
",",
"obj",
",",
"ty",
")",
":",
"# Unbox argument",
"native",
"=",
"self",
".",
"api",
".",
"to_native_value",
"(",
"ty",
",",
"obj",
")",
"# If an error occurred, go to the cleanup block for",
"# the previous argument",
"with",
"cg... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/callwrapper.py#L22-L66 | |
acbull/Unbiased_LambdaMart | 7c39abe5caa18ca07df2d23c2db392916d92956c | Unbias_LightGBM/python-package/lightgbm/basic.py | python | Booster.feature_name | (self) | return [string_buffers[i].value.decode() for i in range_(num_feature)] | Get names of features.
Returns
-------
result : list
List with names of features. | Get names of features. | [
"Get",
"names",
"of",
"features",
"."
] | def feature_name(self):
"""Get names of features.
Returns
-------
result : list
List with names of features.
"""
num_feature = self.num_feature()
# Get name of features
tmp_out_len = ctypes.c_int(0)
string_buffers = [ctypes.create_stri... | [
"def",
"feature_name",
"(",
"self",
")",
":",
"num_feature",
"=",
"self",
".",
"num_feature",
"(",
")",
"# Get name of features",
"tmp_out_len",
"=",
"ctypes",
".",
"c_int",
"(",
"0",
")",
"string_buffers",
"=",
"[",
"ctypes",
".",
"create_string_buffer",
"(",... | https://github.com/acbull/Unbiased_LambdaMart/blob/7c39abe5caa18ca07df2d23c2db392916d92956c/Unbias_LightGBM/python-package/lightgbm/basic.py#L1844-L1863 | |
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | elle/drake/src/drake/__init__.py | python | ShellCommand.__init__ | (self, sources, targets, command,
pretty = None,
cwd = None,
workdir = None,
environment = None,
stdout = None) | Create a builder that runs command.
sources -- List of source nodes, or source node if
there's only one.
targets -- List of target nodes, or target node if
there's only one.
command -- The shell command to run.
pretty -- Optional pretty printing. | Create a builder that runs command. | [
"Create",
"a",
"builder",
"that",
"runs",
"command",
"."
] | def __init__(self, sources, targets, command,
pretty = None,
cwd = None,
workdir = None,
environment = None,
stdout = None):
"""Create a builder that runs command.
sources -- List of source nodes, or source node if
... | [
"def",
"__init__",
"(",
"self",
",",
"sources",
",",
"targets",
",",
"command",
",",
"pretty",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"workdir",
"=",
"None",
",",
"environment",
"=",
"None",
",",
"stdout",
"=",
"None",
")",
":",
"if",
"isinstance... | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L2479-L2507 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Window.CacheBestSize | (*args, **kwargs) | return _core_.Window_CacheBestSize(*args, **kwargs) | CacheBestSize(self, Size size)
Cache the best size so it doesn't need to be calculated again, (at least until
some properties of the window change.) | CacheBestSize(self, Size size) | [
"CacheBestSize",
"(",
"self",
"Size",
"size",
")"
] | def CacheBestSize(*args, **kwargs):
"""
CacheBestSize(self, Size size)
Cache the best size so it doesn't need to be calculated again, (at least until
some properties of the window change.)
"""
return _core_.Window_CacheBestSize(*args, **kwargs) | [
"def",
"CacheBestSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_CacheBestSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L9628-L9635 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/input.py | python | DependencyGraphNode.LinkDependencies | (self, targets, dependencies=None, initial=True) | return dependencies | Returns a list of dependency targets that are linked into this target.
This function has a split personality, depending on the setting of
|initial|. Outside callers should always leave |initial| at its default
setting.
When adding a target to the list of dependencies, this function will
recurse i... | Returns a list of dependency targets that are linked into this target. | [
"Returns",
"a",
"list",
"of",
"dependency",
"targets",
"that",
"are",
"linked",
"into",
"this",
"target",
"."
] | def LinkDependencies(self, targets, dependencies=None, initial=True):
"""Returns a list of dependency targets that are linked into this target.
This function has a split personality, depending on the setting of
|initial|. Outside callers should always leave |initial| at its default
setting.
When ... | [
"def",
"LinkDependencies",
"(",
"self",
",",
"targets",
",",
"dependencies",
"=",
"None",
",",
"initial",
"=",
"True",
")",
":",
"if",
"dependencies",
"==",
"None",
":",
"dependencies",
"=",
"[",
"]",
"# Check for None, corresponding to the root node.",
"if",
"s... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/input.py#L1378-L1443 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextBuffer.EndBatchUndo | (*args, **kwargs) | return _richtext.RichTextBuffer_EndBatchUndo(*args, **kwargs) | EndBatchUndo(self) -> bool | EndBatchUndo(self) -> bool | [
"EndBatchUndo",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndBatchUndo(*args, **kwargs):
"""EndBatchUndo(self) -> bool"""
return _richtext.RichTextBuffer_EndBatchUndo(*args, **kwargs) | [
"def",
"EndBatchUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_EndBatchUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2273-L2275 | |
NeoGeographyToolkit/StereoPipeline | eedf54a919fb5cce1ab0e280bb0df4050763aa11 | src/asp/IceBridge/icebridge_common.py | python | parseDateTimeStrings | (dateString, timeString, useTimeFix, returnMinAndSecOnly) | Parse strings in the format 20110323_17433900. | Parse strings in the format 20110323_17433900. | [
"Parse",
"strings",
"in",
"the",
"format",
"20110323_17433900",
"."
] | def parseDateTimeStrings(dateString, timeString, useTimeFix, returnMinAndSecOnly):
'''Parse strings in the format 20110323_17433900.'''
MILLISECOND_TO_MICROSECOND = 10000
year = int(dateString[0:4])
month = int(dateString[4:6])
day = int(dateString[6:8])
hour = int(timeString[0... | [
"def",
"parseDateTimeStrings",
"(",
"dateString",
",",
"timeString",
",",
"useTimeFix",
",",
"returnMinAndSecOnly",
")",
":",
"MILLISECOND_TO_MICROSECOND",
"=",
"10000",
"year",
"=",
"int",
"(",
"dateString",
"[",
"0",
":",
"4",
"]",
")",
"month",
"=",
"int",
... | https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/icebridge_common.py#L1005-L1034 | ||
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | libs/python/pyste/src/Pyste/ClassExporter.py | python | _VirtualWrapperGenerator.Declaration | (self, method, indent) | return decl | Returns a string with the declarations of the virtual wrapper and
its default implementations. This string must be put inside the Wrapper
body. | Returns a string with the declarations of the virtual wrapper and
its default implementations. This string must be put inside the Wrapper
body. | [
"Returns",
"a",
"string",
"with",
"the",
"declarations",
"of",
"the",
"virtual",
"wrapper",
"and",
"its",
"default",
"implementations",
".",
"This",
"string",
"must",
"be",
"put",
"inside",
"the",
"Wrapper",
"body",
"."
] | def Declaration(self, method, indent):
'''Returns a string with the declarations of the virtual wrapper and
its default implementations. This string must be put inside the Wrapper
body.
'''
pyste = namespaces.pyste
python = namespaces.python
rename = self.... | [
"def",
"Declaration",
"(",
"self",
",",
"method",
",",
"indent",
")",
":",
"pyste",
"=",
"namespaces",
".",
"pyste",
"python",
"=",
"namespaces",
".",
"python",
"rename",
"=",
"self",
".",
"info",
"[",
"method",
".",
"name",
"]",
".",
"rename",
"or",
... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/libs/python/pyste/src/Pyste/ClassExporter.py#L700-L755 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/estimators/svm.py | python | SVM.predict_proba | (self, x=None, input_fn=None, batch_size=None, outputs=None,
as_iterable=False) | return preds[linear._PROBABILITIES] | Runs inference to determine the class probability predictions. | Runs inference to determine the class probability predictions. | [
"Runs",
"inference",
"to",
"determine",
"the",
"class",
"probability",
"predictions",
"."
] | def predict_proba(self, x=None, input_fn=None, batch_size=None, outputs=None,
as_iterable=False):
"""Runs inference to determine the class probability predictions."""
preds = self._estimator.predict(x=x, input_fn=input_fn,
batch_size=batch_size,
... | [
"def",
"predict_proba",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"outputs",
"=",
"None",
",",
"as_iterable",
"=",
"False",
")",
":",
"preds",
"=",
"self",
".",
"_estimator",
".",
"predict",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/svm.py#L215-L224 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/core/redirect.py | python | Pipe.wait | (self) | return self.proc.wait() | Wait for the process to terminate. Returns the error code. | Wait for the process to terminate. Returns the error code. | [
"Wait",
"for",
"the",
"process",
"to",
"terminate",
".",
"Returns",
"the",
"error",
"code",
"."
] | def wait(self):
"""Wait for the process to terminate. Returns the error code."""
return self.proc.wait() | [
"def",
"wait",
"(",
"self",
")",
":",
"return",
"self",
".",
"proc",
".",
"wait",
"(",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/core/redirect.py#L70-L73 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Plugins/pvblot/blotish.py | python | plot | (*args) | Generates the current plot. | Generates the current plot. | [
"Generates",
"the",
"current",
"plot",
"."
] | def plot(*args):
"Generates the current plot."
if state.subProgram == "tplot": return _tplot_plot()
if state.subProgram == "detour": return _detour_plot() | [
"def",
"plot",
"(",
"*",
"args",
")",
":",
"if",
"state",
".",
"subProgram",
"==",
"\"tplot\"",
":",
"return",
"_tplot_plot",
"(",
")",
"if",
"state",
".",
"subProgram",
"==",
"\"detour\"",
":",
"return",
"_detour_plot",
"(",
")"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Plugins/pvblot/blotish.py#L832-L835 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.