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
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/v1/all_reduce.py
python
_padded_split
(tensor, pieces)
Like split for 1D tensors but pads-out case where len % pieces != 0. Args: tensor: `tf.Tensor` that must be 1D. pieces: a positive integer specifying the number of pieces into which tensor should be split. Returns: list of `tf.Tensor` of length pieces, which hold the values of thin input t...
Like split for 1D tensors but pads-out case where len % pieces != 0.
[ "Like", "split", "for", "1D", "tensors", "but", "pads", "-", "out", "case", "where", "len", "%", "pieces", "!", "=", "0", "." ]
def _padded_split(tensor, pieces): """Like split for 1D tensors but pads-out case where len % pieces != 0. Args: tensor: `tf.Tensor` that must be 1D. pieces: a positive integer specifying the number of pieces into which tensor should be split. Returns: list of `tf.Tensor` of length pieces, whi...
[ "def", "_padded_split", "(", "tensor", ",", "pieces", ")", ":", "shape", "=", "tensor", ".", "shape", "if", "1", "!=", "len", "(", "shape", ")", ":", "raise", "ValueError", "(", "\"input tensor must be 1D\"", ")", "tensor_len", "=", "shape", ".", "dims", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/v1/all_reduce.py#L74-L124
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
SimCalorimetry/HGCalSimProducers/python/hgcalDigitizer_cfi.py
python
HGCal_setRealisticStartupNoise_fixedSiPMTileAreasAndSN
(process,targetSN=7,referenceXtalk=-1,ignorePedestal=False)
return process
similar to HGCal_setRealisticStartupNoise but tile and SiPM areas are fixed as 4mm2 assumed use Idark=0.25 so that S/N ~ 7 by changing the target S/N different the reference Idark will be scaled accordingly
similar to HGCal_setRealisticStartupNoise but tile and SiPM areas are fixed as 4mm2 assumed use Idark=0.25 so that S/N ~ 7 by changing the target S/N different the reference Idark will be scaled accordingly
[ "similar", "to", "HGCal_setRealisticStartupNoise", "but", "tile", "and", "SiPM", "areas", "are", "fixed", "as", "4mm2", "assumed", "use", "Idark", "=", "0", ".", "25", "so", "that", "S", "/", "N", "~", "7", "by", "changing", "the", "target", "S", "/", ...
def HGCal_setRealisticStartupNoise_fixedSiPMTileAreasAndSN(process,targetSN=7,referenceXtalk=-1,ignorePedestal=False): """ similar to HGCal_setRealisticStartupNoise but tile and SiPM areas are fixed as 4mm2 assumed use Idark=0.25 so that S/N ~ 7 by changing the target S/N different the reference Idark ...
[ "def", "HGCal_setRealisticStartupNoise_fixedSiPMTileAreasAndSN", "(", "process", ",", "targetSN", "=", "7", ",", "referenceXtalk", "=", "-", "1", ",", "ignorePedestal", "=", "False", ")", ":", "process", "=", "HGCal_setRealisticNoiseSi", "(", "process", ",", "byDose...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/SimCalorimetry/HGCalSimProducers/python/hgcalDigitizer_cfi.py#L242-L258
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/dtypes.py
python
DType.is_integer
(self)
return (self.is_numpy_compatible and not self.is_quantized and issubclass(self.as_numpy_dtype, np.integer))
Returns whether this is a (non-quantized) integer type.
Returns whether this is a (non-quantized) integer type.
[ "Returns", "whether", "this", "is", "a", "(", "non", "-", "quantized", ")", "integer", "type", "." ]
def is_integer(self): """Returns whether this is a (non-quantized) integer type.""" return (self.is_numpy_compatible and not self.is_quantized and issubclass(self.as_numpy_dtype, np.integer))
[ "def", "is_integer", "(", "self", ")", ":", "return", "(", "self", ".", "is_numpy_compatible", "and", "not", "self", ".", "is_quantized", "and", "issubclass", "(", "self", ".", "as_numpy_dtype", ",", "np", ".", "integer", ")", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/dtypes.py#L135-L138
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/posixpath.py
python
samestat
(s1, s2)
return s1.st_ino == s2.st_ino and \ s1.st_dev == s2.st_dev
Test whether two stat buffers reference the same file
Test whether two stat buffers reference the same file
[ "Test", "whether", "two", "stat", "buffers", "reference", "the", "same", "file" ]
def samestat(s1, s2): """Test whether two stat buffers reference the same file""" return s1.st_ino == s2.st_ino and \ s1.st_dev == s2.st_dev
[ "def", "samestat", "(", "s1", ",", "s2", ")", ":", "return", "s1", ".", "st_ino", "==", "s2", ".", "st_ino", "and", "s1", ".", "st_dev", "==", "s2", ".", "st_dev" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/posixpath.py#L180-L183
DLR-SC/tigl
d1c5901e948e33d10b1f9659ff3e22c4717b455f
thirdparty/nsiqcppstyle/nsiqcppstyle_state.py
python
_NsiqCppStyleState.IncrementErrorCount
(self, category, file)
Bumps the module's error statistic.
Bumps the module's error statistic.
[ "Bumps", "the", "module", "s", "error", "statistic", "." ]
def IncrementErrorCount(self, category, file): """Bumps the module's error statistic.""" self.error_count += 1 self.errorPerChecker[category] = self.errorPerChecker.get(category, 0) + 1 errorsPerFile = self.errorPerFile.get(file, {}) errorsPerFile[category] = errorsPerFile.get(ca...
[ "def", "IncrementErrorCount", "(", "self", ",", "category", ",", "file", ")", ":", "self", ".", "error_count", "+=", "1", "self", ".", "errorPerChecker", "[", "category", "]", "=", "self", ".", "errorPerChecker", ".", "get", "(", "category", ",", "0", ")...
https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/thirdparty/nsiqcppstyle/nsiqcppstyle_state.py#L65-L71
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBUnixSignals.GetSignalNumberFromName
(self, *args)
return _lldb.SBUnixSignals_GetSignalNumberFromName(self, *args)
GetSignalNumberFromName(self, str name) -> int32_t
GetSignalNumberFromName(self, str name) -> int32_t
[ "GetSignalNumberFromName", "(", "self", "str", "name", ")", "-", ">", "int32_t" ]
def GetSignalNumberFromName(self, *args): """GetSignalNumberFromName(self, str name) -> int32_t""" return _lldb.SBUnixSignals_GetSignalNumberFromName(self, *args)
[ "def", "GetSignalNumberFromName", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBUnixSignals_GetSignalNumberFromName", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L12725-L12727
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/numerics.py
python
verify_tensor_all_finite_v2
(x, message, name=None)
return out
Assert that the tensor does not contain any NaN's or Inf's. Args: x: Tensor to check. message: Message to log on failure. name: A name for this operation (optional). Returns: Same tensor as `x`.
Assert that the tensor does not contain any NaN's or Inf's.
[ "Assert", "that", "the", "tensor", "does", "not", "contain", "any", "NaN", "s", "or", "Inf", "s", "." ]
def verify_tensor_all_finite_v2(x, message, name=None): """Assert that the tensor does not contain any NaN's or Inf's. Args: x: Tensor to check. message: Message to log on failure. name: A name for this operation (optional). Returns: Same tensor as `x`. """ with ops.name_scope(name, "VerifyF...
[ "def", "verify_tensor_all_finite_v2", "(", "x", ",", "message", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"VerifyFinite\"", ",", "[", "x", "]", ")", "as", "name", ":", "x", "=", "ops", ".", "convert_to_te...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/numerics.py#L53-L69
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/extras/xcode6.py
python
XCConfigurationList.__init__
(self, configlst)
:param configlst: list of XCConfigurationList
:param configlst: list of XCConfigurationList
[ ":", "param", "configlst", ":", "list", "of", "XCConfigurationList" ]
def __init__(self, configlst): """ :param configlst: list of XCConfigurationList """ XCodeNode.__init__(self) self.buildConfigurations = configlst self.defaultConfigurationIsVisible = 0 self.defaultConfigurationName = configlst and configlst[0].name or ""
[ "def", "__init__", "(", "self", ",", "configlst", ")", ":", "XCodeNode", ".", "__init__", "(", "self", ")", "self", ".", "buildConfigurations", "=", "configlst", "self", ".", "defaultConfigurationIsVisible", "=", "0", "self", ".", "defaultConfigurationName", "="...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/xcode6.py#L214-L219
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
GridCellEditor.EndEdit
(*args, **kwargs)
return _grid.GridCellEditor_EndEdit(*args, **kwargs)
EndEdit(self, int row, int col, Grid grid, String oldval, String newval) -> bool
EndEdit(self, int row, int col, Grid grid, String oldval, String newval) -> bool
[ "EndEdit", "(", "self", "int", "row", "int", "col", "Grid", "grid", "String", "oldval", "String", "newval", ")", "-", ">", "bool" ]
def EndEdit(*args, **kwargs): """EndEdit(self, int row, int col, Grid grid, String oldval, String newval) -> bool""" return _grid.GridCellEditor_EndEdit(*args, **kwargs)
[ "def", "EndEdit", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridCellEditor_EndEdit", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L292-L294
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Tools/CryVersionSelector/cryselect.py
python
CrySwitch.close
(self)
Closes this window.
Closes this window.
[ "Closes", "this", "window", "." ]
def close(self): """ Closes this window. """ self.root.destroy()
[ "def", "close", "(", "self", ")", ":", "self", ".", "root", ".", "destroy", "(", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Tools/CryVersionSelector/cryselect.py#L744-L748
potassco/clingo
e0c91d8f95cc28de1c480a871f9c97c30de83d40
doc/py/_gen/gen.py
python
parse_class
(aux, name, doc)
Extract a class declaration from a docstring.
Extract a class declaration from a docstring.
[ "Extract", "a", "class", "declaration", "from", "a", "docstring", "." ]
def parse_class(aux, name, doc): """ Extract a class declaration from a docstring. """ match = re.search(r"class ({}(\([^)]*\))?):".format(name), doc) start = match.start() end = doc.find("```", start) doc = doc[start:end] aux.write(doc)
[ "def", "parse_class", "(", "aux", ",", "name", ",", "doc", ")", ":", "match", "=", "re", ".", "search", "(", "r\"class ({}(\\([^)]*\\))?):\"", ".", "format", "(", "name", ")", ",", "doc", ")", "start", "=", "match", ".", "start", "(", ")", "end", "="...
https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/doc/py/_gen/gen.py#L16-L26
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/solver/solver.py
python
applyDirichlet
(mat, rhs, uDirIndex, uDirichlet)
This should be moved directly into the core
This should be moved directly into the core
[ "This", "should", "be", "moved", "directly", "into", "the", "core" ]
def applyDirichlet(mat, rhs, uDirIndex, uDirichlet): """This should be moved directly into the core""" if mat is not None: if rhs is not None: uDir = pg.Vector(mat.rows(), 0.0) uDir.setVal(uDirichlet, uDirIndex) rhs -= mat * uDir for i in uDirIndex: ...
[ "def", "applyDirichlet", "(", "mat", ",", "rhs", ",", "uDirIndex", ",", "uDirichlet", ")", ":", "if", "mat", "is", "not", "None", ":", "if", "rhs", "is", "not", "None", ":", "uDir", "=", "pg", ".", "Vector", "(", "mat", ".", "rows", "(", ")", ","...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/solver/solver.py#L1266-L1281
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Modules/Scripted/DICOMLib/DICOMExportScene.py
python
DICOMExportScene.createDICOMFileForScene
(self)
return True
Export the scene data: - first to a directory using the utility in the mrmlScene - create a zip file using the application logic - create secondary capture based on the sample dataset - add the zip file as a private creator tag TODO: confirm that resulting file is valid - may need to change the CLI ...
Export the scene data: - first to a directory using the utility in the mrmlScene - create a zip file using the application logic - create secondary capture based on the sample dataset - add the zip file as a private creator tag TODO: confirm that resulting file is valid - may need to change the CLI ...
[ "Export", "the", "scene", "data", ":", "-", "first", "to", "a", "directory", "using", "the", "utility", "in", "the", "mrmlScene", "-", "create", "a", "zip", "file", "using", "the", "application", "logic", "-", "create", "secondary", "capture", "based", "on...
def createDICOMFileForScene(self): """ Export the scene data: - first to a directory using the utility in the mrmlScene - create a zip file using the application logic - create secondary capture based on the sample dataset - add the zip file as a private creator tag TODO: confirm that result...
[ "def", "createDICOMFileForScene", "(", "self", ")", ":", "# set up temp directories and files", "if", "self", ".", "saveDirectoryPath", "is", "None", ":", "self", ".", "saveDirectoryPath", "=", "tempfile", ".", "mkdtemp", "(", "''", ",", "'dicomExport'", ",", "sli...
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Modules/Scripted/DICOMLib/DICOMExportScene.py#L63-L170
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriSliceOperation.py
python
PhactoriSliceOperation.CreateParaViewFilter
(self, inInputFilter)
return newParaViewFilter
create the slice plane filter for ParaView
create the slice plane filter for ParaView
[ "create", "the", "slice", "plane", "filter", "for", "ParaView" ]
def CreateParaViewFilter(self, inInputFilter): #don't need our own init code at this point, but this is how it would be #added #def __init__(self): # MySuperClass.__init__(self) """create the slice plane filter for ParaView""" if PhactoriDbg(100): myDebugPrint3('PhactoriSliceOperation...
[ "def", "CreateParaViewFilter", "(", "self", ",", "inInputFilter", ")", ":", "#don't need our own init code at this point, but this is how it would be", "#added", "#def __init__(self):", "# MySuperClass.__init__(self)", "if", "PhactoriDbg", "(", "100", ")", ":", "myDebugPrint3"...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriSliceOperation.py#L40-L64
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/locations.py
python
distutils_scheme
( dist_name, user=False, home=None, root=None, isolated=False, prefix=None )
return scheme
Return a distutils install scheme
Return a distutils install scheme
[ "Return", "a", "distutils", "install", "scheme" ]
def distutils_scheme( dist_name, user=False, home=None, root=None, isolated=False, prefix=None ): # type:(str, bool, str, str, bool, str) -> Dict[str, str] """ Return a distutils install scheme """ from distutils.dist import Distribution dist_args = {'name': dist_name} # type: Dict[str, Un...
[ "def", "distutils_scheme", "(", "dist_name", ",", "user", "=", "False", ",", "home", "=", "None", ",", "root", "=", "None", ",", "isolated", "=", "False", ",", "prefix", "=", "None", ")", ":", "# type:(str, bool, str, str, bool, str) -> Dict[str, str]", "from", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/locations.py#L85-L146
LisaAnne/lisa-caffe-public
49b8643ddef23a4f6120017968de30c45e693f59
scripts/cpp_lint.py
python
ResetNolintSuppressions
()
Resets the set of NOLINT suppressions to empty.
Resets the set of NOLINT suppressions to empty.
[ "Resets", "the", "set", "of", "NOLINT", "suppressions", "to", "empty", "." ]
def ResetNolintSuppressions(): "Resets the set of NOLINT suppressions to empty." _error_suppressions.clear()
[ "def", "ResetNolintSuppressions", "(", ")", ":", "_error_suppressions", ".", "clear", "(", ")" ]
https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/scripts/cpp_lint.py#L495-L497
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/stats/stats.py
python
combine_pvalues
(pvalues, method='fisher', weights=None)
Methods for combining the p-values of independent tests bearing upon the same hypothesis. Parameters ---------- pvalues : array_like, 1-D Array of p-values assumed to come from independent tests. method : {'fisher', 'stouffer'}, optional Name of method to use to combine p-values. Th...
Methods for combining the p-values of independent tests bearing upon the same hypothesis.
[ "Methods", "for", "combining", "the", "p", "-", "values", "of", "independent", "tests", "bearing", "upon", "the", "same", "hypothesis", "." ]
def combine_pvalues(pvalues, method='fisher', weights=None): """ Methods for combining the p-values of independent tests bearing upon the same hypothesis. Parameters ---------- pvalues : array_like, 1-D Array of p-values assumed to come from independent tests. method : {'fisher', 's...
[ "def", "combine_pvalues", "(", "pvalues", ",", "method", "=", "'fisher'", ",", "weights", "=", "None", ")", ":", "pvalues", "=", "np", ".", "asarray", "(", "pvalues", ")", "if", "pvalues", ".", "ndim", "!=", "1", ":", "raise", "ValueError", "(", "\"pva...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/stats.py#L5430-L5511
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/mfg/games/crowd_modelling.py
python
MFGCrowdModellingGame.max_chance_nodes_in_history
(self)
return self.horizon + 1
Maximun chance nodes in game history.
Maximun chance nodes in game history.
[ "Maximun", "chance", "nodes", "in", "game", "history", "." ]
def max_chance_nodes_in_history(self): """Maximun chance nodes in game history.""" return self.horizon + 1
[ "def", "max_chance_nodes_in_history", "(", "self", ")", ":", "return", "self", ".", "horizon", "+", "1" ]
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/crowd_modelling.py#L92-L94
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py
python
CodeWarrior_suite_Events.add
(self, _object, _attributes={}, **_arguments)
add: add elements to a project or target Required argument: an AE object reference Keyword argument new: the class of the new element or elements to add Keyword argument with_data: the initial data for the element or elements Keyword argument to_targets: the targets to which the new elem...
add: add elements to a project or target Required argument: an AE object reference Keyword argument new: the class of the new element or elements to add Keyword argument with_data: the initial data for the element or elements Keyword argument to_targets: the targets to which the new elem...
[ "add", ":", "add", "elements", "to", "a", "project", "or", "target", "Required", "argument", ":", "an", "AE", "object", "reference", "Keyword", "argument", "new", ":", "the", "class", "of", "the", "new", "element", "or", "elements", "to", "add", "Keyword",...
def add(self, _object, _attributes={}, **_arguments): """add: add elements to a project or target Required argument: an AE object reference Keyword argument new: the class of the new element or elements to add Keyword argument with_data: the initial data for the element or elements ...
[ "def", "add", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'CWIE'", "_subcode", "=", "'ADDF'", "aetools", ".", "keysubst", "(", "_arguments", ",", "self", ".", "_argmap_add", ")",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py#L22-L44
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDynamicContent/AWS/resource-manager-code/dc_service_api.py
python
command_show_uploaded
(context, args)
List all uploaded content in the DLC bucket
List all uploaded content in the DLC bucket
[ "List", "all", "uploaded", "content", "in", "the", "DLC", "bucket" ]
def command_show_uploaded(context, args) -> None: """ List all uploaded content in the DLC bucket """ versioned = content_bucket.content_versioning_enabled(context, context.config.default_deployment) if versioned: raise RuntimeError("[WARNING] Versioning is not supported for this command. Pl...
[ "def", "command_show_uploaded", "(", "context", ",", "args", ")", "->", "None", ":", "versioned", "=", "content_bucket", ".", "content_versioning_enabled", "(", "context", ",", "context", ".", "config", ".", "default_deployment", ")", "if", "versioned", ":", "ra...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDynamicContent/AWS/resource-manager-code/dc_service_api.py#L142-L149
epam/Indigo
30e40b4b1eb9bae0207435a26cfcb81ddcc42be1
api/python/indigo/__init__.py
python
Indigo.similarity
(self, item1, item2, metrics="")
return self._checkResultFloat( Indigo._lib.indigoSimilarity( item1.id, item2.id, metrics.encode(ENCODE_ENCODING) ) )
Returns the similarity measure between two structures. Accepts two molecules, two reactions, or two fingerprints. Args: item1 (IndigoObject): molecule, reaction or fingerprint object item2 (IndigoObject): molecule, reaction or fingerprint object metrics (str): "tanim...
Returns the similarity measure between two structures. Accepts two molecules, two reactions, or two fingerprints.
[ "Returns", "the", "similarity", "measure", "between", "two", "structures", ".", "Accepts", "two", "molecules", "two", "reactions", "or", "two", "fingerprints", "." ]
def similarity(self, item1, item2, metrics=""): """Returns the similarity measure between two structures. Accepts two molecules, two reactions, or two fingerprints. Args: item1 (IndigoObject): molecule, reaction or fingerprint object item2 (IndigoObject): molecule, react...
[ "def", "similarity", "(", "self", ",", "item1", ",", "item2", ",", "metrics", "=", "\"\"", ")", ":", "if", "metrics", "is", "None", ":", "metrics", "=", "\"\"", "self", ".", "_setSessionId", "(", ")", "return", "self", ".", "_checkResultFloat", "(", "I...
https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L6023-L6042
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
cmake/tribits/python_utils/GeneralScriptSupport.py
python
joinDirs
(dirArray)
return dirPath
Join directories. 2009/06/09: rabartl: We should be able to just use os.path.join(...) but I found when used in at least on context that it resulted in not joining the elements but instead just returning the array.
Join directories.
[ "Join", "directories", "." ]
def joinDirs(dirArray): """ Join directories. 2009/06/09: rabartl: We should be able to just use os.path.join(...) but I found when used in at least on context that it resulted in not joining the elements but instead just returning the array. """ dirPath = "" for dir in dirArray: if not dirPath: ...
[ "def", "joinDirs", "(", "dirArray", ")", ":", "dirPath", "=", "\"\"", "for", "dir", "in", "dirArray", ":", "if", "not", "dirPath", ":", "dirPath", "=", "dir", "else", ":", "dirPath", "=", "dirPath", "+", "\"/\"", "+", "dir", "return", "dirPath" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/cmake/tribits/python_utils/GeneralScriptSupport.py#L511-L525
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py
python
BaseSpecifier.__eq__
(self, other)
Returns a boolean representing whether or not the two Specifier like objects are equal.
Returns a boolean representing whether or not the two Specifier like objects are equal.
[ "Returns", "a", "boolean", "representing", "whether", "or", "not", "the", "two", "Specifier", "like", "objects", "are", "equal", "." ]
def __eq__(self, other): """ Returns a boolean representing whether or not the two Specifier like objects are equal. """
[ "def", "__eq__", "(", "self", ",", "other", ")", ":" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py#L37-L41
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parse/standard_method.py
python
get_itemsize
(x_type)
return itemsize_map[x_type]
get itemsize from tensor's dtype.
get itemsize from tensor's dtype.
[ "get", "itemsize", "from", "tensor", "s", "dtype", "." ]
def get_itemsize(x_type): """get itemsize from tensor's dtype.""" return itemsize_map[x_type]
[ "def", "get_itemsize", "(", "x_type", ")", ":", "return", "itemsize_map", "[", "x_type", "]" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/standard_method.py#L1574-L1576
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/maximum-xor-with-an-element-from-array.py
python
Solution.maximizeXor
(self, nums, queries)
return result
:type nums: List[int] :type queries: List[List[int]] :rtype: List[int]
:type nums: List[int] :type queries: List[List[int]] :rtype: List[int]
[ ":", "type", "nums", ":", "List", "[", "int", "]", ":", "type", "queries", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "List", "[", "int", "]" ]
def maximizeXor(self, nums, queries): """ :type nums: List[int] :type queries: List[List[int]] :rtype: List[int] """ nums.sort() max_val = max(nums[-1], max(queries, key=lambda x: x[0])[0]) queries = sorted(enumerate(queries), key=lambda x: x[1][1]) ...
[ "def", "maximizeXor", "(", "self", ",", "nums", ",", "queries", ")", ":", "nums", ".", "sort", "(", ")", "max_val", "=", "max", "(", "nums", "[", "-", "1", "]", ",", "max", "(", "queries", ",", "key", "=", "lambda", "x", ":", "x", "[", "0", "...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/maximum-xor-with-an-element-from-array.py#L32-L49
bh107/bohrium
5b83e7117285fefc7779ed0e9acb0f8e74c7e068
bridge/bh107/bh107/bharray.py
python
BhArray.fill
(self, value)
Fill the array with a scalar value. Parameters ---------- value : scalar All elements of `a` will be assigned this value. Examples -------- >>> a = bh107.array([1, 2]) >>> a.fill(0) >>> a array(...
Fill the array with a scalar value.
[ "Fill", "the", "array", "with", "a", "scalar", "value", "." ]
def fill(self, value): """Fill the array with a scalar value. Parameters ---------- value : scalar All elements of `a` will be assigned this value. Examples -------- >>> a = bh107.array([1, 2]) >>> a.fill(0) ...
[ "def", "fill", "(", "self", ",", "value", ")", ":", "from", ".", "ufuncs", "import", "assign", "assign", "(", "value", ",", "self", ")" ]
https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/bh107/bh107/bharray.py#L180-L200
ivansafrin/Polycode
37a40fefe194ec7f6e9d1257f3bb3517b0a168bc
Bindings/Scripts/create_lua_library/zipfile.py
python
PyZipFile._get_codename
(self, pathname, basename)
return (fname, archivename)
Return (filename, archivename) for the path. Given a module name path, return the correct file path and archive name, compiling if necessary. For example, given /python/lib/string, return (/python/lib/string.pyc, string).
Return (filename, archivename) for the path.
[ "Return", "(", "filename", "archivename", ")", "for", "the", "path", "." ]
def _get_codename(self, pathname, basename): """Return (filename, archivename) for the path. Given a module name path, return the correct file path and archive name, compiling if necessary. For example, given /python/lib/string, return (/python/lib/string.pyc, string). """ ...
[ "def", "_get_codename", "(", "self", ",", "pathname", ",", "basename", ")", ":", "file_py", "=", "pathname", "+", "\".py\"", "file_pyc", "=", "pathname", "+", "\".pyc\"", "file_pyo", "=", "pathname", "+", "\".pyo\"", "if", "os", ".", "path", ".", "isfile",...
https://github.com/ivansafrin/Polycode/blob/37a40fefe194ec7f6e9d1257f3bb3517b0a168bc/Bindings/Scripts/create_lua_library/zipfile.py#L1342-L1370
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/design-file-system.py
python
FileSystem.get
(self, path)
return self.__lookup[path]
:type path: str :rtype: int
:type path: str :rtype: int
[ ":", "type", "path", ":", "str", ":", "rtype", ":", "int" ]
def get(self, path): """ :type path: str :rtype: int """ if path not in self.__lookup: return -1 return self.__lookup[path]
[ "def", "get", "(", "self", ",", "path", ")", ":", "if", "path", "not", "in", "self", ".", "__lookup", ":", "return", "-", "1", "return", "self", ".", "__lookup", "[", "path", "]" ]
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/design-file-system.py#L21-L28
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/symbol/symbol.py
python
minimum
(left, right)
Returns element-wise minimum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be compared. Returns ------- ...
Returns element-wise minimum of the input elements.
[ "Returns", "element", "-", "wise", "minimum", "of", "the", "input", "elements", "." ]
def minimum(left, right): """Returns element-wise minimum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be com...
[ "def", "minimum", "(", "left", ",", "right", ")", ":", "if", "isinstance", "(", "left", ",", "Symbol", ")", "and", "isinstance", "(", "right", ",", "Symbol", ")", ":", "return", "_internal", ".", "_Minimum", "(", "left", ",", "right", ")", "if", "isi...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/symbol.py#L2913-L2952
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryd.py
python
Armory_Json_Rpc_Server.jsonrpc_listtransactions
(self, from_page=0)
return final_tx_list
DESCRIPTION: List the transactions associated with the currently loaded wallet. PARAMETERS: from_page - (Default=0) The history page to get the transactions from. RETURN: A dictionary with information on the retrieved transactions.
DESCRIPTION: List the transactions associated with the currently loaded wallet. PARAMETERS: from_page - (Default=0) The history page to get the transactions from. RETURN: A dictionary with information on the retrieved transactions.
[ "DESCRIPTION", ":", "List", "the", "transactions", "associated", "with", "the", "currently", "loaded", "wallet", ".", "PARAMETERS", ":", "from_page", "-", "(", "Default", "=", "0", ")", "The", "history", "page", "to", "get", "the", "transactions", "from", "....
def jsonrpc_listtransactions(self, from_page=0): """ DESCRIPTION: List the transactions associated with the currently loaded wallet. PARAMETERS: from_page - (Default=0) The history page to get the transactions from. RETURN: A dictionary with information on the retrieved transac...
[ "def", "jsonrpc_listtransactions", "(", "self", ",", "from_page", "=", "0", ")", ":", "# This does not use 'account's like in the Satoshi client", "final_tx_list", "=", "[", "]", "#this should be in a try/catch block, since it will throw if from_page is", "#out of range", "ledgerEn...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryd.py#L1457-L1612
mozilla/DeepSpeech
aa1d28530d531d0d92289bf5f11a49fe516fdc86
bin/import_voxforge.py
python
AtomicCounter.increment
(self, amount=1)
return v
Increments the counter by the given amount :param amount: the amount to increment by (default 1) :return: the incremented value of the counter
Increments the counter by the given amount :param amount: the amount to increment by (default 1) :return: the incremented value of the counter
[ "Increments", "the", "counter", "by", "the", "given", "amount", ":", "param", "amount", ":", "the", "amount", "to", "increment", "by", "(", "default", "1", ")", ":", "return", ":", "the", "incremented", "value", "of", "the", "counter" ]
def increment(self, amount=1): """Increments the counter by the given amount :param amount: the amount to increment by (default 1) :return: the incremented value of the counter """ self.__lock.acquire() self.__count += amount v = self.value() self.__...
[ "def", "increment", "(", "self", ",", "amount", "=", "1", ")", ":", "self", ".", "__lock", ".", "acquire", "(", ")", "self", ".", "__count", "+=", "amount", "v", "=", "self", ".", "value", "(", ")", "self", ".", "__lock", ".", "release", "(", ")"...
https://github.com/mozilla/DeepSpeech/blob/aa1d28530d531d0d92289bf5f11a49fe516fdc86/bin/import_voxforge.py#L36-L45
peterljq/OpenMMD
795d4dd660cf7e537ceb599fdb038c5388b33390
VMD 3D Pose Baseline Multi-Objects/packages/lifting/utils/prob_model.py
python
Prob3dPose.centre
(data_2d)
return (data_2d.T - data_2d.mean(1)).T
center data according to each of the coordiante components
center data according to each of the coordiante components
[ "center", "data", "according", "to", "each", "of", "the", "coordiante", "components" ]
def centre(data_2d): """center data according to each of the coordiante components""" return (data_2d.T - data_2d.mean(1)).T
[ "def", "centre", "(", "data_2d", ")", ":", "return", "(", "data_2d", ".", "T", "-", "data_2d", ".", "mean", "(", "1", ")", ")", ".", "T" ]
https://github.com/peterljq/OpenMMD/blob/795d4dd660cf7e537ceb599fdb038c5388b33390/VMD 3D Pose Baseline Multi-Objects/packages/lifting/utils/prob_model.py#L90-L92
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextPrinting.SetParentWindow
(*args, **kwargs)
return _richtext.RichTextPrinting_SetParentWindow(*args, **kwargs)
SetParentWindow(self, Window parent)
SetParentWindow(self, Window parent)
[ "SetParentWindow", "(", "self", "Window", "parent", ")" ]
def SetParentWindow(*args, **kwargs): """SetParentWindow(self, Window parent)""" return _richtext.RichTextPrinting_SetParentWindow(*args, **kwargs)
[ "def", "SetParentWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextPrinting_SetParentWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4580-L4582
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/ma/core.py
python
_DomainedBinaryOperation.__init__
(self, dbfunc, domain, fillx=0, filly=0)
abfunc(fillx, filly) must be defined. abfunc(x, filly) = x for all x to enable reduce.
abfunc(fillx, filly) must be defined. abfunc(x, filly) = x for all x to enable reduce.
[ "abfunc", "(", "fillx", "filly", ")", "must", "be", "defined", ".", "abfunc", "(", "x", "filly", ")", "=", "x", "for", "all", "x", "to", "enable", "reduce", "." ]
def __init__ (self, dbfunc, domain, fillx=0, filly=0): """abfunc(fillx, filly) must be defined. abfunc(x, filly) = x for all x to enable reduce. """ self.f = dbfunc self.domain = domain self.fillx = fillx self.filly = filly self.__doc__ = getattr(dbfunc...
[ "def", "__init__", "(", "self", ",", "dbfunc", ",", "domain", ",", "fillx", "=", "0", ",", "filly", "=", "0", ")", ":", "self", ".", "f", "=", "dbfunc", "self", ".", "domain", "=", "domain", "self", ".", "fillx", "=", "fillx", "self", ".", "filly...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L1047-L1058
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
register_functions
(lib, ignore_errors)
Register function prototypes with a libclang library instance. This must be called as part of library instantiation so Python knows how to call out to the shared library.
Register function prototypes with a libclang library instance.
[ "Register", "function", "prototypes", "with", "a", "libclang", "library", "instance", "." ]
def register_functions(lib, ignore_errors): """Register function prototypes with a libclang library instance. This must be called as part of library instantiation so Python knows how to call out to the shared library. """ def register(item): return register_function(lib, item, ignore_error...
[ "def", "register_functions", "(", "lib", ",", "ignore_errors", ")", ":", "def", "register", "(", "item", ")", ":", "return", "register_function", "(", "lib", ",", "item", ",", "ignore_errors", ")", "for", "f", "in", "functionList", ":", "register", "(", "f...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L4085-L4096
alembic/alembic
6253269ad35db108ed7ab26a70fb3c4183cb710e
lib/python/abcutils/Path.py
python
mapFSTree
( root, path, dirs=set(), links={} )
return dirs, links
Create a sparse map of the filesystem graph from the root node to the path node.
Create a sparse map of the filesystem graph from the root node to the path node.
[ "Create", "a", "sparse", "map", "of", "the", "filesystem", "graph", "from", "the", "root", "node", "to", "the", "path", "node", "." ]
def mapFSTree( root, path, dirs=set(), links={} ): """Create a sparse map of the filesystem graph from the root node to the path node.""" root = Path( root ) path = Path( path ) for sp in path.subpaths(): if sp.isabs(): full = sp else: full = sp.toabs() ...
[ "def", "mapFSTree", "(", "root", ",", "path", ",", "dirs", "=", "set", "(", ")", ",", "links", "=", "{", "}", ")", ":", "root", "=", "Path", "(", "root", ")", "path", "=", "Path", "(", "path", ")", "for", "sp", "in", "path", ".", "subpaths", ...
https://github.com/alembic/alembic/blob/6253269ad35db108ed7ab26a70fb3c4183cb710e/lib/python/abcutils/Path.py#L313-L350
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/logging/__init__.py
python
Logger.error
(self, msg, *args, **kwargs)
Log 'msg % args' with severity 'ERROR'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.error("Houston, we have a %s", "major problem", exc_info=1)
Log 'msg % args' with severity 'ERROR'.
[ "Log", "msg", "%", "args", "with", "severity", "ERROR", "." ]
def error(self, msg, *args, **kwargs): """ Log 'msg % args' with severity 'ERROR'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.error("Houston, we have a %s", "major problem", exc_info=1) """ if self.isEnabledFo...
[ "def", "error", "(", "self", ",", "msg", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "isEnabledFor", "(", "ERROR", ")", ":", "self", ".", "_log", "(", "ERROR", ",", "msg", ",", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/logging/__init__.py#L1190-L1200
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/tools/pretty_gyp.py
python
mask_quotes
(input)
return [search_re.sub(quote_replace, line) for line in input]
Mask the quoted strings so we skip braces inside quoted strings.
Mask the quoted strings so we skip braces inside quoted strings.
[ "Mask", "the", "quoted", "strings", "so", "we", "skip", "braces", "inside", "quoted", "strings", "." ]
def mask_quotes(input): """Mask the quoted strings so we skip braces inside quoted strings.""" search_re = re.compile(r'(.*?)' + QUOTE_RE_STR) return [search_re.sub(quote_replace, line) for line in input]
[ "def", "mask_quotes", "(", "input", ")", ":", "search_re", "=", "re", ".", "compile", "(", "r'(.*?)'", "+", "QUOTE_RE_STR", ")", "return", "[", "search_re", ".", "sub", "(", "quote_replace", ",", "line", ")", "for", "line", "in", "input", "]" ]
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/tools/pretty_gyp.py#L41-L44
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlTextReader.SchemaValidate
(self, xsd)
return ret
Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If @xsd is None, then XML Schema validation is deactivated.
Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If
[ "Use", "W3C", "XSD", "schema", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "If" ]
def SchemaValidate(self, xsd): """Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If @xsd is None, then XML Schema validation is deactivated. """ ret = libxml2mod.xmlTextReaderSchemaValidate(self._o, xsd)...
[ "def", "SchemaValidate", "(", "self", ",", "xsd", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderSchemaValidate", "(", "self", ".", "_o", ",", "xsd", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L6885-L6891
intel-iot-devkit/how-to-code-samples
b4ea616f36bbfa2e042beb1698f968cfd651d79f
close-call-reporter/python/iot_close_call_reporter/hardware/dfrobot.py
python
DfrobotBoard.detect_object
(self)
return self.interrupter.objectDetected()
Detect object.
Detect object.
[ "Detect", "object", "." ]
def detect_object(self): """ Detect object. """ return self.interrupter.objectDetected()
[ "def", "detect_object", "(", "self", ")", ":", "return", "self", ".", "interrupter", ".", "objectDetected", "(", ")" ]
https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/close-call-reporter/python/iot_close_call_reporter/hardware/dfrobot.py#L105-L111
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py
python
DataFrame._repr_fits_horizontal_
(self, ignore_width: bool = False)
return repr_width < width
Check if full repr fits in horizontal boundaries imposed by the display options width and max_columns. In case off non-interactive session, no boundaries apply. `ignore_width` is here so ipnb+HTML output can behave the way users expect. display.max_columns remains in effect. GH...
Check if full repr fits in horizontal boundaries imposed by the display options width and max_columns.
[ "Check", "if", "full", "repr", "fits", "in", "horizontal", "boundaries", "imposed", "by", "the", "display", "options", "width", "and", "max_columns", "." ]
def _repr_fits_horizontal_(self, ignore_width: bool = False) -> bool: """ Check if full repr fits in horizontal boundaries imposed by the display options width and max_columns. In case off non-interactive session, no boundaries apply. `ignore_width` is here so ipnb+HTML output ...
[ "def", "_repr_fits_horizontal_", "(", "self", ",", "ignore_width", ":", "bool", "=", "False", ")", "->", "bool", ":", "width", ",", "height", "=", "console", ".", "get_console_size", "(", ")", "max_columns", "=", "get_option", "(", "\"display.max_columns\"", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py#L600-L651
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/application.py
python
IApplicationStream.SendDatagram
(self, Text)
Sends datagram to stream. @param Text: Datagram to send. @type Text: unicode
Sends datagram to stream.
[ "Sends", "datagram", "to", "stream", "." ]
def SendDatagram(self, Text): '''Sends datagram to stream. @param Text: Datagram to send. @type Text: unicode ''' self._Application._Alter('DATAGRAM', '%s %s' % (self._Handle, Text))
[ "def", "SendDatagram", "(", "self", ",", "Text", ")", ":", "self", ".", "_Application", ".", "_Alter", "(", "'DATAGRAM'", ",", "'%s %s'", "%", "(", "self", ".", "_Handle", ",", "Text", ")", ")" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/application.py#L169-L175
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py
python
Disk_Folder_File_Suite_Events.move
(self, _object, _attributes={}, **_arguments)
move: Move disk item(s) to a new location. Required argument: the object for the command Keyword argument to: The new location for the disk item(s). Keyword argument _attributes: AppleEvent attribute dictionary Returns: the reply for the command
move: Move disk item(s) to a new location. Required argument: the object for the command Keyword argument to: The new location for the disk item(s). Keyword argument _attributes: AppleEvent attribute dictionary Returns: the reply for the command
[ "move", ":", "Move", "disk", "item", "(", "s", ")", "to", "a", "new", "location", ".", "Required", "argument", ":", "the", "object", "for", "the", "command", "Keyword", "argument", "to", ":", "The", "new", "location", "for", "the", "disk", "item", "(",...
def move(self, _object, _attributes={}, **_arguments): """move: Move disk item(s) to a new location. Required argument: the object for the command Keyword argument to: The new location for the disk item(s). Keyword argument _attributes: AppleEvent attribute dictionary Returns: th...
[ "def", "move", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'core'", "_subcode", "=", "'move'", "aetools", ".", "keysubst", "(", "_arguments", ",", "self", ".", "_argmap_move", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py#L19-L39
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_getitem.py
python
_build_ragged_tensor_from_value_ranges
(starts, limits, step, values)
return value_indices.with_values(gathered_values)
Returns a `RaggedTensor` containing the specified sequences of values. Returns a RaggedTensor `output` where: ```python output.shape[0] = starts.shape[0] output[i] = values[starts[i]:limits[i]:step] ``` Requires that `starts.shape == limits.shape` and `0 <= starts[i] <= limits[i] <= values.shape[0]`. ...
Returns a `RaggedTensor` containing the specified sequences of values.
[ "Returns", "a", "RaggedTensor", "containing", "the", "specified", "sequences", "of", "values", "." ]
def _build_ragged_tensor_from_value_ranges(starts, limits, step, values): """Returns a `RaggedTensor` containing the specified sequences of values. Returns a RaggedTensor `output` where: ```python output.shape[0] = starts.shape[0] output[i] = values[starts[i]:limits[i]:step] ``` Requires that `starts.s...
[ "def", "_build_ragged_tensor_from_value_ranges", "(", "starts", ",", "limits", ",", "step", ",", "values", ")", ":", "# Use `ragged_range` to get the index of each value we should include.", "if", "step", "is", "None", ":", "step", "=", "1", "step", "=", "ops", ".", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_getitem.py#L333-L380
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
clang/utils/check_cfc/check_cfc.py
python
remove_dir_from_path
(path_var, directory)
return os.pathsep.join(pathlist)
Remove the specified directory from path_var, a string representing PATH
Remove the specified directory from path_var, a string representing PATH
[ "Remove", "the", "specified", "directory", "from", "path_var", "a", "string", "representing", "PATH" ]
def remove_dir_from_path(path_var, directory): """Remove the specified directory from path_var, a string representing PATH""" pathlist = path_var.split(os.pathsep) norm_directory = os.path.normpath(os.path.normcase(directory)) pathlist = [x for x in pathlist if os.path.normpath( os.path.norm...
[ "def", "remove_dir_from_path", "(", "path_var", ",", "directory", ")", ":", "pathlist", "=", "path_var", ".", "split", "(", "os", ".", "pathsep", ")", "norm_directory", "=", "os", ".", "path", ".", "normpath", "(", "os", ".", "path", ".", "normcase", "("...
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/utils/check_cfc/check_cfc.py#L96-L103
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBValue.CreateValueFromAddress
(self, name, address, type)
return _lldb.SBValue_CreateValueFromAddress(self, name, address, type)
CreateValueFromAddress(SBValue self, char const * name, lldb::addr_t address, SBType type) -> SBValue
CreateValueFromAddress(SBValue self, char const * name, lldb::addr_t address, SBType type) -> SBValue
[ "CreateValueFromAddress", "(", "SBValue", "self", "char", "const", "*", "name", "lldb", "::", "addr_t", "address", "SBType", "type", ")", "-", ">", "SBValue" ]
def CreateValueFromAddress(self, name, address, type): """CreateValueFromAddress(SBValue self, char const * name, lldb::addr_t address, SBType type) -> SBValue""" return _lldb.SBValue_CreateValueFromAddress(self, name, address, type)
[ "def", "CreateValueFromAddress", "(", "self", ",", "name", ",", "address", ",", "type", ")", ":", "return", "_lldb", ".", "SBValue_CreateValueFromAddress", "(", "self", ",", "name", ",", "address", ",", "type", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L14448-L14450
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/json_format.py
python
_FieldToJsonObject
( field, value, including_default_value_fields=False)
return value
Converts field value according to Proto3 JSON Specification.
Converts field value according to Proto3 JSON Specification.
[ "Converts", "field", "value", "according", "to", "Proto3", "JSON", "Specification", "." ]
def _FieldToJsonObject( field, value, including_default_value_fields=False): """Converts field value according to Proto3 JSON Specification.""" if field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_MESSAGE: return _MessageToJsonObject(value, including_default_value_fields) elif field.cpp_type == descrip...
[ "def", "_FieldToJsonObject", "(", "field", ",", "value", ",", "including_default_value_fields", "=", "False", ")", ":", "if", "field", ".", "cpp_type", "==", "descriptor", ".", "FieldDescriptor", ".", "CPPTYPE_MESSAGE", ":", "return", "_MessageToJsonObject", "(", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/json_format.py#L174-L204
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros/roslib/src/roslib/gentools.py
python
compute_md5_text
(get_deps_dict, spec, rospack=None)
return buff.getvalue().strip()
Compute the text used for md5 calculation. MD5 spec states that we removes comments and non-meaningful whitespace. We also strip packages names from type names. For convenience sake, constants are reordered ahead of other declarations, in the order that they were originally defined. @return: text f...
Compute the text used for md5 calculation. MD5 spec states that we removes comments and non-meaningful whitespace. We also strip packages names from type names. For convenience sake, constants are reordered ahead of other declarations, in the order that they were originally defined.
[ "Compute", "the", "text", "used", "for", "md5", "calculation", ".", "MD5", "spec", "states", "that", "we", "removes", "comments", "and", "non", "-", "meaningful", "whitespace", ".", "We", "also", "strip", "packages", "names", "from", "type", "names", ".", ...
def compute_md5_text(get_deps_dict, spec, rospack=None): """ Compute the text used for md5 calculation. MD5 spec states that we removes comments and non-meaningful whitespace. We also strip packages names from type names. For convenience sake, constants are reordered ahead of other declarations, in ...
[ "def", "compute_md5_text", "(", "get_deps_dict", ",", "spec", ",", "rospack", "=", "None", ")", ":", "uniquedeps", "=", "get_deps_dict", "[", "'uniquedeps'", "]", "package", "=", "get_deps_dict", "[", "'package'", "]", "# #1554: need to suppress computation of files i...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/roslib/src/roslib/gentools.py#L117-L158
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/encodings/punycode.py
python
selective_len
(str, max)
return res
Return the length of str, considering only characters below max.
Return the length of str, considering only characters below max.
[ "Return", "the", "length", "of", "str", "considering", "only", "characters", "below", "max", "." ]
def selective_len(str, max): """Return the length of str, considering only characters below max.""" res = 0 for c in str: if ord(c) < max: res += 1 return res
[ "def", "selective_len", "(", "str", ",", "max", ")", ":", "res", "=", "0", "for", "c", "in", "str", ":", "if", "ord", "(", "c", ")", "<", "max", ":", "res", "+=", "1", "return", "res" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/encodings/punycode.py#L22-L28
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlDoc.nodeDumpOutput
(self, buf, cur, level, format, encoding)
Dump an XML node, recursive behaviour, children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called
Dump an XML node, recursive behaviour, children are printed too. Note that
[ "Dump", "an", "XML", "node", "recursive", "behaviour", "children", "are", "printed", "too", ".", "Note", "that" ]
def nodeDumpOutput(self, buf, cur, level, format, encoding): """Dump an XML node, recursive behaviour, children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called """ if buf is None: buf__o = ...
[ "def", "nodeDumpOutput", "(", "self", ",", "buf", ",", "cur", ",", "level", ",", "format", ",", "encoding", ")", ":", "if", "buf", "is", "None", ":", "buf__o", "=", "None", "else", ":", "buf__o", "=", "buf", ".", "_o", "if", "cur", "is", "None", ...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L4362-L4371
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
CursorKind.is_attribute
(self)
return conf.lib.clang_isAttribute(self)
Test if this is an attribute kind.
Test if this is an attribute kind.
[ "Test", "if", "this", "is", "an", "attribute", "kind", "." ]
def is_attribute(self): """Test if this is an attribute kind.""" return conf.lib.clang_isAttribute(self)
[ "def", "is_attribute", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isAttribute", "(", "self", ")" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L687-L689
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Spinbox.__init__
(self, master=None, cnf={}, **kw)
Construct a spinbox widget with the parent MASTER. STANDARD OPTIONS activebackground, background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, in...
Construct a spinbox widget with the parent MASTER.
[ "Construct", "a", "spinbox", "widget", "with", "the", "parent", "MASTER", "." ]
def __init__(self, master=None, cnf={}, **kw): """Construct a spinbox widget with the parent MASTER. STANDARD OPTIONS activebackground, background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthic...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "'spinbox'", ",", "cnf", ",", "kw", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3619-L3646
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedCompositeFieldContainer.__delslice__
(self, start, stop)
Deletes the subset of items from between the specified indices.
Deletes the subset of items from between the specified indices.
[ "Deletes", "the", "subset", "of", "items", "from", "between", "the", "specified", "indices", "." ]
def __delslice__(self, start, stop): """Deletes the subset of items from between the specified indices.""" del self._values[start:stop] self._message_listener.Modified()
[ "def", "__delslice__", "(", "self", ",", "start", ",", "stop", ")", ":", "del", "self", ".", "_values", "[", "start", ":", "stop", "]", "self", ".", "_message_listener", ".", "Modified", "(", ")" ]
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/containers.py#L247-L250
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py
python
MaskedArray._get_recordmask
(self)
return np.all(flatten_structured_array(_mask), axis= -1)
Return the mask of the records. A record is masked when all the fields are masked.
Return the mask of the records. A record is masked when all the fields are masked.
[ "Return", "the", "mask", "of", "the", "records", ".", "A", "record", "is", "masked", "when", "all", "the", "fields", "are", "masked", "." ]
def _get_recordmask(self): """ Return the mask of the records. A record is masked when all the fields are masked. """ _mask = ndarray.__getattribute__(self, '_mask').view(ndarray) if _mask.dtype.names is None: return _mask return np.all(flatten_structured_arr...
[ "def", "_get_recordmask", "(", "self", ")", ":", "_mask", "=", "ndarray", ".", "__getattribute__", "(", "self", ",", "'_mask'", ")", ".", "view", "(", "ndarray", ")", "if", "_mask", ".", "dtype", ".", "names", "is", "None", ":", "return", "_mask", "ret...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L3198-L3207
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/optim/thor.py
python
ThorGpu._get_ainv_ginv_list
(self, gradients, damping_step, matrix_a_allreduce, matrix_g_allreduce)
return matrix_a_allreduce, matrix_g_allreduce
get matrixA inverse list and matrix G inverse list
get matrixA inverse list and matrix G inverse list
[ "get", "matrixA", "inverse", "list", "and", "matrix", "G", "inverse", "list" ]
def _get_ainv_ginv_list(self, gradients, damping_step, matrix_a_allreduce, matrix_g_allreduce): """get matrixA inverse list and matrix G inverse list""" for i in range(len(self.params)): thor_layer_count = self.weight_fim_idx_map[i] conv_layer_count = self.weight_conv_idx_map[i] ...
[ "def", "_get_ainv_ginv_list", "(", "self", ",", "gradients", ",", "damping_step", ",", "matrix_a_allreduce", ",", "matrix_g_allreduce", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "params", ")", ")", ":", "thor_layer_count", "=", "self...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/optim/thor.py#L506-L556
OPAE/opae-sdk
221124343c8275243a249eb72d69e0ea2d568d1b
binaries/hssi/ethernet/hssicommon.py
python
HSSICOMMON.write_reg
(self, region_index, reg_data, value)
return True
Read CTL Address CSR if not zero clear it Write cmd to CTL Address CSR Write cmd to CTL status CSR poll for status Write Data
Read CTL Address CSR if not zero clear it Write cmd to CTL Address CSR Write cmd to CTL status CSR poll for status Write Data
[ "Read", "CTL", "Address", "CSR", "if", "not", "zero", "clear", "it", "Write", "cmd", "to", "CTL", "Address", "CSR", "Write", "cmd", "to", "CTL", "status", "CSR", "poll", "for", "status", "Write", "Data" ]
def write_reg(self, region_index, reg_data, value): """ Read CTL Address CSR if not zero clear it Write cmd to CTL Address CSR Write cmd to CTL status CSR poll for status Write Data """ ret = self.clear_ctl_sts_reg(region_index) if not ret:...
[ "def", "write_reg", "(", "self", ",", "region_index", ",", "reg_data", ",", "value", ")", ":", "ret", "=", "self", ".", "clear_ctl_sts_reg", "(", "region_index", ")", "if", "not", "ret", ":", "print", "(", "\"Failed to clear HSSI CTL STS csr\"", ")", "return",...
https://github.com/OPAE/opae-sdk/blob/221124343c8275243a249eb72d69e0ea2d568d1b/binaries/hssi/ethernet/hssicommon.py#L978-L1009
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/tools/datetimes.py
python
_attempt_YYYYMMDD
(arg, errors)
return None
try to parse the YYYYMMDD/%Y%m%d format, try to deal with NaT-like, arg is a passed in as an object dtype, but could really be ints/strings with nan-like/or floats (e.g. with nan) Parameters ---------- arg : passed value errors : 'raise','ignore','coerce'
try to parse the YYYYMMDD/%Y%m%d format, try to deal with NaT-like, arg is a passed in as an object dtype, but could really be ints/strings with nan-like/or floats (e.g. with nan)
[ "try", "to", "parse", "the", "YYYYMMDD", "/", "%Y%m%d", "format", "try", "to", "deal", "with", "NaT", "-", "like", "arg", "is", "a", "passed", "in", "as", "an", "object", "dtype", "but", "could", "really", "be", "ints", "/", "strings", "with", "nan", ...
def _attempt_YYYYMMDD(arg, errors): """ try to parse the YYYYMMDD/%Y%m%d format, try to deal with NaT-like, arg is a passed in as an object dtype, but could really be ints/strings with nan-like/or floats (e.g. with nan) Parameters ---------- arg : passed value errors : 'raise','ignore',...
[ "def", "_attempt_YYYYMMDD", "(", "arg", ",", "errors", ")", ":", "def", "calc", "(", "carg", ")", ":", "# calculate the actual result", "carg", "=", "carg", ".", "astype", "(", "object", ")", "parsed", "=", "parsing", ".", "try_parse_year_month_day", "(", "c...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/tools/datetimes.py#L731-L780
google/orbit
7c0a530f402f0c3753d0bc52f8e3eb620f65d017
third_party/include-what-you-use/fix_includes.py
python
_GetLineKind
(file_line, filename, separate_project_includes)
Given a file_line + file being edited, return best *_KIND value or None.
Given a file_line + file being edited, return best *_KIND value or None.
[ "Given", "a", "file_line", "+", "file", "being", "edited", "return", "best", "*", "_KIND", "value", "or", "None", "." ]
def _GetLineKind(file_line, filename, separate_project_includes): """Given a file_line + file being edited, return best *_KIND value or None.""" line_without_coments = _COMMENT_RE.sub('', file_line.line) if file_line.deleted: return None elif _IsMainCUInclude(file_line, filename): return _MAIN_CU_INCLUD...
[ "def", "_GetLineKind", "(", "file_line", ",", "filename", ",", "separate_project_includes", ")", ":", "line_without_coments", "=", "_COMMENT_RE", ".", "sub", "(", "''", ",", "file_line", ".", "line", ")", "if", "file_line", ".", "deleted", ":", "return", "None...
https://github.com/google/orbit/blob/7c0a530f402f0c3753d0bc52f8e3eb620f65d017/third_party/include-what-you-use/fix_includes.py#L1652-L1671
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py
python
rnn_decoder
(decoder_inputs, initial_state, cell, loop_function=None, scope=None)
return outputs, state
RNN decoder for the sequence-to-sequence model. Args: decoder_inputs: A list of 2D Tensors [batch_size x input_size]. initial_state: 2D Tensor with shape [batch_size x cell.state_size]. cell: rnn_cell.RNNCell defining the cell function and size. loop_function: If not None, this function will be appli...
RNN decoder for the sequence-to-sequence model.
[ "RNN", "decoder", "for", "the", "sequence", "-", "to", "-", "sequence", "model", "." ]
def rnn_decoder(decoder_inputs, initial_state, cell, loop_function=None, scope=None): """RNN decoder for the sequence-to-sequence model. Args: decoder_inputs: A list of 2D Tensors [batch_size x input_size]. initial_state: 2D Tensor with shape ...
[ "def", "rnn_decoder", "(", "decoder_inputs", ",", "initial_state", ",", "cell", ",", "loop_function", "=", "None", ",", "scope", "=", "None", ")", ":", "with", "variable_scope", ".", "variable_scope", "(", "scope", "or", "\"rnn_decoder\"", ")", ":", "state", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py#L112-L156
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/SANSUtility.py
python
check_if_is_event_data
(file_name)
return is_event_mode
Event mode files have a class with a "NXevent_data" type Structure: |--mantid_workspace_1/raw_data_1| |--some_group| |--Attribute: NX_class = NXevent_data
Event mode files have a class with a "NXevent_data" type Structure: |--mantid_workspace_1/raw_data_1| |--some_group| |--Attribute: NX_class = NXevent_data
[ "Event", "mode", "files", "have", "a", "class", "with", "a", "NXevent_data", "type", "Structure", ":", "|", "--", "mantid_workspace_1", "/", "raw_data_1|", "|", "--", "some_group|", "|", "--", "Attribute", ":", "NX_class", "=", "NXevent_data" ]
def check_if_is_event_data(file_name): """ Event mode files have a class with a "NXevent_data" type Structure: |--mantid_workspace_1/raw_data_1| |--some_group| |--Attribute: NX_class = NXevent_data """ full_file...
[ "def", "check_if_is_event_data", "(", "file_name", ")", ":", "full_file_path", "=", "FileFinder", ".", "findRuns", "(", "file_name", ")", "if", "hasattr", "(", "full_file_path", ",", "'__iter__'", ")", ":", "file_name", "=", "full_file_path", "[", "0", "]", "w...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/SANSUtility.py#L719-L742
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/values.py
python
_ConstOpMixin.gep
(self, indices)
return FormattedConstant(outtype.as_pointer(self.addrspace), op)
Call getelementptr on this pointer constant.
Call getelementptr on this pointer constant.
[ "Call", "getelementptr", "on", "this", "pointer", "constant", "." ]
def gep(self, indices): """ Call getelementptr on this pointer constant. """ if not isinstance(self.type, types.PointerType): raise TypeError("can only call gep() on pointer constants, not '%s'" % (self.type,)) outtype = self.type ...
[ "def", "gep", "(", "self", ",", "indices", ")", ":", "if", "not", "isinstance", "(", "self", ".", "type", ",", "types", ".", "PointerType", ")", ":", "raise", "TypeError", "(", "\"can only call gep() on pointer constants, not '%s'\"", "%", "(", "self", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/values.py#L75-L93
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/multivariate_time_series/src/metrics.py
python
get_custom_metrics
()
return mx.metric.create([_rae, _rse, _corr])
:return: mxnet metric object
:return: mxnet metric object
[ ":", "return", ":", "mxnet", "metric", "object" ]
def get_custom_metrics(): """ :return: mxnet metric object """ _rse = mx.metric.create(rse) _rae = mx.metric.create(rae) _corr = mx.metric.create(corr) return mx.metric.create([_rae, _rse, _corr])
[ "def", "get_custom_metrics", "(", ")", ":", "_rse", "=", "mx", ".", "metric", ".", "create", "(", "rse", ")", "_rae", "=", "mx", ".", "metric", ".", "create", "(", "rae", ")", "_corr", "=", "mx", ".", "metric", ".", "create", "(", "corr", ")", "r...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/multivariate_time_series/src/metrics.py#L45-L52
dmlc/decord
96b750c7221322391969929e855b942d2fdcd06b
python/decord/video_reader.py
python
VideoReader.seek
(self, pos)
Fast seek to frame position, this does not guarantee accurate position. To obtain accurate seeking, see `accurate_seek`. Parameters ---------- pos : integer Non negative seeking position.
Fast seek to frame position, this does not guarantee accurate position. To obtain accurate seeking, see `accurate_seek`.
[ "Fast", "seek", "to", "frame", "position", "this", "does", "not", "guarantee", "accurate", "position", ".", "To", "obtain", "accurate", "seeking", "see", "accurate_seek", "." ]
def seek(self, pos): """Fast seek to frame position, this does not guarantee accurate position. To obtain accurate seeking, see `accurate_seek`. Parameters ---------- pos : integer Non negative seeking position. """ assert self._handle is not None ...
[ "def", "seek", "(", "self", ",", "pos", ")", ":", "assert", "self", ".", "_handle", "is", "not", "None", "assert", "pos", ">=", "0", "and", "pos", "<", "self", ".", "_num_frame", "success", "=", "_CAPI_VideoReaderSeek", "(", "self", ".", "_handle", ","...
https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/video_reader.py#L204-L218
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
catalog.resolve
(self, pubID, sysID)
return ret
Do a complete resolution lookup of an External Identifier
Do a complete resolution lookup of an External Identifier
[ "Do", "a", "complete", "resolution", "lookup", "of", "an", "External", "Identifier" ]
def resolve(self, pubID, sysID): """Do a complete resolution lookup of an External Identifier """ ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID) return ret
[ "def", "resolve", "(", "self", ",", "pubID", ",", "sysID", ")", ":", "ret", "=", "libxml2mod", ".", "xmlACatalogResolve", "(", "self", ".", "_o", ",", "pubID", ",", "sysID", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L5632-L5635
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py
python
Bits.__hash__
(self)
return h % 1442968193
Return an integer hash of the object.
Return an integer hash of the object.
[ "Return", "an", "integer", "hash", "of", "the", "object", "." ]
def __hash__(self): """Return an integer hash of the object.""" # We can't in general hash the whole bitstring (it could take hours!) # So instead take some bits from the start and end. if self.len <= 160: # Use the whole bitstring. shorter = self else: ...
[ "def", "__hash__", "(", "self", ")", ":", "# We can't in general hash the whole bitstring (it could take hours!)", "# So instead take some bits from the start and end.", "if", "self", ".", "len", "<=", "160", ":", "# Use the whole bitstring.", "shorter", "=", "self", "else", ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L1164-L1185
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/mpi_collectives/mpi_ops.py
python
size
(name=None)
return MPI_LIB.mpi_size(name=name)
An op which returns the number of MPI processes. This is equivalent to running `MPI_Comm_size(MPI_COMM_WORLD, ...)` to get the size of the global communicator. Returns: An integer scalar containing the number of MPI processes.
An op which returns the number of MPI processes.
[ "An", "op", "which", "returns", "the", "number", "of", "MPI", "processes", "." ]
def size(name=None): """An op which returns the number of MPI processes. This is equivalent to running `MPI_Comm_size(MPI_COMM_WORLD, ...)` to get the size of the global communicator. Returns: An integer scalar containing the number of MPI processes. """ return MPI_LIB.mpi_size(name=name)
[ "def", "size", "(", "name", "=", "None", ")", ":", "return", "MPI_LIB", ".", "mpi_size", "(", "name", "=", "name", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/mpi_collectives/mpi_ops.py#L62-L71
takemaru/graphillion
51879f92bb96b53ef8f914ef37a05252ce383617
graphillion/graphset.py
python
GraphSet.rand_iter
(self)
Iterates over graphs uniformly randomly. This method relies on its own random number generator, doesn't rely on Python random module. Examples: >>> graph1 = [(1, 2)] >>> graph2 = [(1, 2), (1, 4)] >>> gs = GraphSet([graph1, graph2]) >>> for g in gs.rand_i...
Iterates over graphs uniformly randomly.
[ "Iterates", "over", "graphs", "uniformly", "randomly", "." ]
def rand_iter(self): """Iterates over graphs uniformly randomly. This method relies on its own random number generator, doesn't rely on Python random module. Examples: >>> graph1 = [(1, 2)] >>> graph2 = [(1, 2), (1, 4)] >>> gs = GraphSet([graph1, graph2]) ...
[ "def", "rand_iter", "(", "self", ")", ":", "for", "g", "in", "self", ".", "_ss", ".", "rand_iter", "(", ")", ":", "try", ":", "yield", "GraphSet", ".", "_conv_ret", "(", "g", ")", "except", "StopIteration", ":", "return" ]
https://github.com/takemaru/graphillion/blob/51879f92bb96b53ef8f914ef37a05252ce383617/graphillion/graphset.py#L659-L687
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/errors.py
python
ParserContext.add_enum_bad_type_error
(self, location, enum_name, enum_type)
Add an error for an enum having the wrong type.
Add an error for an enum having the wrong type.
[ "Add", "an", "error", "for", "an", "enum", "having", "the", "wrong", "type", "." ]
def add_enum_bad_type_error(self, location, enum_name, enum_type): # type: (common.SourceLocation, unicode, unicode) -> None """Add an error for an enum having the wrong type.""" self._add_error(location, ERROR_ID_ENUM_BAD_TYPE, "Enum '%s' type '%s' is not a supported enu...
[ "def", "add_enum_bad_type_error", "(", "self", ",", "location", ",", "enum_name", ",", "enum_type", ")", ":", "# type: (common.SourceLocation, unicode, unicode) -> None", "self", ".", "_add_error", "(", "location", ",", "ERROR_ID_ENUM_BAD_TYPE", ",", "\"Enum '%s' type '%s' ...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/errors.py#L523-L527
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/metrics/fbeta.py
python
Fbeta.update
(self, *inputs)
Updates the internal evaluation result `y_pred` and `y`. Args: inputs: Input `y_pred` and `y`. `y_pred` and `y` are Tensor, list or numpy.ndarray. `y_pred` is in most cases (not strictly) a list of floating numbers in range :math:`[0, 1]` and the shape is :math:`(N, ...
Updates the internal evaluation result `y_pred` and `y`.
[ "Updates", "the", "internal", "evaluation", "result", "y_pred", "and", "y", "." ]
def update(self, *inputs): """ Updates the internal evaluation result `y_pred` and `y`. Args: inputs: Input `y_pred` and `y`. `y_pred` and `y` are Tensor, list or numpy.ndarray. `y_pred` is in most cases (not strictly) a list of floating numbers in range :math:`[0, 1...
[ "def", "update", "(", "self", ",", "*", "inputs", ")", ":", "if", "len", "(", "inputs", ")", "!=", "2", ":", "raise", "ValueError", "(", "\"For 'Fbeta.update', it needs 2 inputs (predicted value, true value), \"", "\"but got {}.\"", ".", "format", "(", "len", "(",...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/metrics/fbeta.py#L64-L105
alexozer/jankdrone
c4b403eb254b41b832ab2bdfade12ba59c99e5dc
drone/lib/nanopb/generator/nanopb_generator.py
python
Field.pb_field_t
(self, prev_field_name)
return result
Return the pb_field_t initializer to use in the constant array. prev_field_name is the name of the previous field or None.
Return the pb_field_t initializer to use in the constant array. prev_field_name is the name of the previous field or None.
[ "Return", "the", "pb_field_t", "initializer", "to", "use", "in", "the", "constant", "array", ".", "prev_field_name", "is", "the", "name", "of", "the", "previous", "field", "or", "None", "." ]
def pb_field_t(self, prev_field_name): '''Return the pb_field_t initializer to use in the constant array. prev_field_name is the name of the previous field or None. ''' if self.rules == 'ONEOF': if self.anonymous: result = ' PB_ANONYMOUS_ONEOF_FIELD(%s, ' ...
[ "def", "pb_field_t", "(", "self", ",", "prev_field_name", ")", ":", "if", "self", ".", "rules", "==", "'ONEOF'", ":", "if", "self", ".", "anonymous", ":", "result", "=", "' PB_ANONYMOUS_ONEOF_FIELD(%s, '", "%", "self", ".", "union_name", "else", ":", "res...
https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/drone/lib/nanopb/generator/nanopb_generator.py#L491-L524
brave/brave-core
ceaa3de4735789d355b6fa80c21d4709e2c1d0e8
script/lib/transifex.py
python
get_transifex_source_resource_strings
(grd_file_path)
return get_strings_dict_from_xml_content( r.json()['content'].encode('utf-8'))
Obtains the list of strings from Transifex
Obtains the list of strings from Transifex
[ "Obtains", "the", "list", "of", "strings", "from", "Transifex" ]
def get_transifex_source_resource_strings(grd_file_path): """Obtains the list of strings from Transifex""" filename = os.path.basename(grd_file_path).split('.')[0] url_part = ( 'project/%s/resource/%s/content/' % ( transifex_project_name, transifex_name_from_filename(grd_file...
[ "def", "get_transifex_source_resource_strings", "(", "grd_file_path", ")", ":", "filename", "=", "os", ".", "path", ".", "basename", "(", "grd_file_path", ")", ".", "split", "(", "'.'", ")", "[", "0", "]", "url_part", "=", "(", "'project/%s/resource/%s/content/'...
https://github.com/brave/brave-core/blob/ceaa3de4735789d355b6fa80c21d4709e2c1d0e8/script/lib/transifex.py#L677-L689
tangzhenyu/Scene-Text-Understanding
0f7ffc7aea5971a50cdc03d33d0a41075285948b
ctpn_crnn_ocr/CTPN/caffe/python/caffe/pycaffe.py
python
_Net_forward_backward_all
(self, blobs=None, diffs=None, **kwargs)
return all_outs, all_diffs
Run net forward + backward in batches. Parameters ---------- blobs: list of blobs to extract as in forward() diffs: list of diffs to extract as in backward() kwargs: Keys are input (for forward) and output (for backward) blob names and values are ndarrays. Refer to forward() and backwar...
Run net forward + backward in batches.
[ "Run", "net", "forward", "+", "backward", "in", "batches", "." ]
def _Net_forward_backward_all(self, blobs=None, diffs=None, **kwargs): """ Run net forward + backward in batches. Parameters ---------- blobs: list of blobs to extract as in forward() diffs: list of diffs to extract as in backward() kwargs: Keys are input (for forward) and output (for backw...
[ "def", "_Net_forward_backward_all", "(", "self", ",", "blobs", "=", "None", ",", "diffs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Batch blobs and diffs.", "all_outs", "=", "{", "out", ":", "[", "]", "for", "out", "in", "set", "(", "self", "....
https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/CTPN/caffe/python/caffe/pycaffe.py#L191-L233
syoyo/tinygltf
e7f1ff5c59d3ca2489923beb239bdf93d863498f
deps/cpplint.py
python
NestingState.CheckCompletedBlocks
(self, filename, error)
Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
Checks that all classes and namespaces have been completely parsed.
[ "Checks", "that", "all", "classes", "and", "namespaces", "have", "been", "completely", "parsed", "." ]
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: Th...
[ "def", "CheckCompletedBlocks", "(", "self", ",", "filename", ",", "error", ")", ":", "# Note: This test can result in false positives if #ifdef constructs", "# get in the way of brace matching. See the testBuildClass test in", "# cpplint_unittest.py for an example of this.", "for", "obj"...
https://github.com/syoyo/tinygltf/blob/e7f1ff5c59d3ca2489923beb239bdf93d863498f/deps/cpplint.py#L2551-L2570
Studio3T/robomongo
2411cd032e2e69b968dadda13ac91ca4ef3483b0
src/third-party/qscintilla-2.8.4/sources/Python/configure.py
python
read_define
(filename, define)
return value
Read the value of a #define from a file. filename is the name of the file. define is the name of the #define. None is returned if there was no such #define.
Read the value of a #define from a file. filename is the name of the file. define is the name of the #define. None is returned if there was no such #define.
[ "Read", "the", "value", "of", "a", "#define", "from", "a", "file", ".", "filename", "is", "the", "name", "of", "the", "file", ".", "define", "is", "the", "name", "of", "the", "#define", ".", "None", "is", "returned", "if", "there", "was", "no", "such...
def read_define(filename, define): """ Read the value of a #define from a file. filename is the name of the file. define is the name of the #define. None is returned if there was no such #define. """ f = open(filename) for l in f: wl = l.split() if len(wl) >= 3 and wl[0] == ...
[ "def", "read_define", "(", "filename", ",", "define", ")", ":", "f", "=", "open", "(", "filename", ")", "for", "l", "in", "f", ":", "wl", "=", "l", ".", "split", "(", ")", "if", "len", "(", "wl", ")", ">=", "3", "and", "wl", "[", "0", "]", ...
https://github.com/Studio3T/robomongo/blob/2411cd032e2e69b968dadda13ac91ca4ef3483b0/src/third-party/qscintilla-2.8.4/sources/Python/configure.py#L381-L400
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/default_settings.py
python
_get_string_value
(ctx, msg, value)
return user_input
Helper function to ask the user for a string value
Helper function to ask the user for a string value
[ "Helper", "function", "to", "ask", "the", "user", "for", "a", "string", "value" ]
def _get_string_value(ctx, msg, value): """ Helper function to ask the user for a string value """ msg += ' ' while len(msg) < 53: msg += ' ' msg += '['+value+']: ' user_input = input(msg) if user_input == '': # No input -> return default return value return user_inpu...
[ "def", "_get_string_value", "(", "ctx", ",", "msg", ",", "value", ")", ":", "msg", "+=", "' '", "while", "len", "(", "msg", ")", "<", "53", ":", "msg", "+=", "' '", "msg", "+=", "'['", "+", "value", "+", "']: '", "user_input", "=", "input", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/default_settings.py#L87-L97
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/simple_copy.py
python
deepcopy
(x)
Deep copy operation on gyp objects such as strings, ints, dicts and lists. More than twice as fast as copy.deepcopy but much less generic.
Deep copy operation on gyp objects such as strings, ints, dicts and lists. More than twice as fast as copy.deepcopy but much less generic.
[ "Deep", "copy", "operation", "on", "gyp", "objects", "such", "as", "strings", "ints", "dicts", "and", "lists", ".", "More", "than", "twice", "as", "fast", "as", "copy", ".", "deepcopy", "but", "much", "less", "generic", "." ]
def deepcopy(x): """Deep copy operation on gyp objects such as strings, ints, dicts and lists. More than twice as fast as copy.deepcopy but much less generic.""" try: return _deepcopy_dispatch[type(x)](x) except KeyError: raise Error('Unsupported type %s for deepcopy. Use copy.deepcopy ' + ...
[ "def", "deepcopy", "(", "x", ")", ":", "try", ":", "return", "_deepcopy_dispatch", "[", "type", "(", "x", ")", "]", "(", "x", ")", "except", "KeyError", ":", "raise", "Error", "(", "'Unsupported type %s for deepcopy. Use copy.deepcopy '", "+", "'or expand simple...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/simple_copy.py#L15-L24
apple/swift-clang
d7403439fc6641751840b723e7165fb02f52db95
tools/scan-build-py/libscanbuild/analyze.py
python
require
(required)
return decorator
Decorator for checking the required values in state. It checks the required attributes in the passed state and stop when any of those is missing.
Decorator for checking the required values in state.
[ "Decorator", "for", "checking", "the", "required", "values", "in", "state", "." ]
def require(required): """ Decorator for checking the required values in state. It checks the required attributes in the passed state and stop when any of those is missing. """ def decorator(function): @functools.wraps(function) def wrapper(*args, **kwargs): for key in requ...
[ "def", "require", "(", "required", ")", ":", "def", "decorator", "(", "function", ")", ":", "@", "functools", ".", "wraps", "(", "function", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "for", "key", "in", "required", ...
https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/tools/scan-build-py/libscanbuild/analyze.py#L402-L420
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/libs/predef/tools/ci/common.py
python
ci_travis.install_toolset
(self, toolset)
Installs specific toolset on CI system.
Installs specific toolset on CI system.
[ "Installs", "specific", "toolset", "on", "CI", "system", "." ]
def install_toolset(self, toolset): ''' Installs specific toolset on CI system. ''' info = toolset_info[toolset] if sys.platform.startswith('linux'): os.chdir(self.work_dir) if 'ppa' in info: for ppa in info['ppa']: util...
[ "def", "install_toolset", "(", "self", ",", "toolset", ")", ":", "info", "=", "toolset_info", "[", "toolset", "]", "if", "sys", ".", "platform", ".", "startswith", "(", "'linux'", ")", ":", "os", ".", "chdir", "(", "self", ".", "work_dir", ")", "if", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/libs/predef/tools/ci/common.py#L683-L709
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/sparse/series.py
python
SparseSeries.__array_finalize__
(self, obj)
Gets called after any ufunc or other array operations, necessary to pass on the index.
Gets called after any ufunc or other array operations, necessary to pass on the index.
[ "Gets", "called", "after", "any", "ufunc", "or", "other", "array", "operations", "necessary", "to", "pass", "on", "the", "index", "." ]
def __array_finalize__(self, obj): """ Gets called after any ufunc or other array operations, necessary to pass on the index. """ self.name = getattr(obj, 'name', None) self.fill_value = getattr(obj, 'fill_value', None)
[ "def", "__array_finalize__", "(", "self", ",", "obj", ")", ":", "self", ".", "name", "=", "getattr", "(", "obj", ",", "'name'", ",", "None", ")", "self", ".", "fill_value", "=", "getattr", "(", "obj", ",", "'fill_value'", ",", "None", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/sparse/series.py#L126-L132
google/fhir
d77f57706c1a168529b0b87ca7ccb1c0113e83c2
py/google/fhir/utils/proto_utils.py
python
get_value_at_field_index
(msg: message.Message, field: Union[descriptor.FieldDescriptor, str], index: int)
return get_value_at_field(msg, field)
Returns the value at index for the provided field. Calling this method on a singular field with an index of 0 is identicial to calling get_value_at_field. Providing an index other than 0 in this case raises an exception. Args: msg: The Message whose fields to examine. field: The FieldDescriptor or n...
Returns the value at index for the provided field.
[ "Returns", "the", "value", "at", "index", "for", "the", "provided", "field", "." ]
def get_value_at_field_index(msg: message.Message, field: Union[descriptor.FieldDescriptor, str], index: int) -> Any: """Returns the value at index for the provided field. Calling this method on a singular field with an index of 0 is identicial...
[ "def", "get_value_at_field_index", "(", "msg", ":", "message", ".", "Message", ",", "field", ":", "Union", "[", "descriptor", ".", "FieldDescriptor", ",", "str", "]", ",", "index", ":", "int", ")", "->", "Any", ":", "if", "isinstance", "(", "field", ",",...
https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/utils/proto_utils.py#L164-L199
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py
python
Tag.__repr__
(self, encoding=DEFAULT_OUTPUT_ENCODING)
return self.__str__(encoding)
Renders this tag as a string.
Renders this tag as a string.
[ "Renders", "this", "tag", "as", "a", "string", "." ]
def __repr__(self, encoding=DEFAULT_OUTPUT_ENCODING): """Renders this tag as a string.""" return self.__str__(encoding)
[ "def", "__repr__", "(", "self", ",", "encoding", "=", "DEFAULT_OUTPUT_ENCODING", ")", ":", "return", "self", ".", "__str__", "(", "encoding", ")" ]
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L677-L679
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py
python
NDFrame.tz_convert
( self: FrameOrSeries, tz, axis=0, level=None, copy: bool_t = True )
return result.__finalize__(self)
Convert tz-aware axis to target time zone. Parameters ---------- tz : str or tzinfo object axis : the axis to convert level : int, str, default None If axis is a MultiIndex, convert a specific level. Otherwise must be None. copy : bool, default Tr...
Convert tz-aware axis to target time zone.
[ "Convert", "tz", "-", "aware", "axis", "to", "target", "time", "zone", "." ]
def tz_convert( self: FrameOrSeries, tz, axis=0, level=None, copy: bool_t = True ) -> FrameOrSeries: """ Convert tz-aware axis to target time zone. Parameters ---------- tz : str or tzinfo object axis : the axis to convert level : int, str, default No...
[ "def", "tz_convert", "(", "self", ":", "FrameOrSeries", ",", "tz", ",", "axis", "=", "0", ",", "level", "=", "None", ",", "copy", ":", "bool_t", "=", "True", ")", "->", "FrameOrSeries", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py#L9304-L9359
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/xcodeproj_file.py
python
PBXProject.AddOrGetProjectReference
(self, other_pbxproject)
return [product_group, project_ref]
Add a reference to another project file (via PBXProject object) to this one. Returns [ProductGroup, ProjectRef]. ProductGroup is a PBXGroup object in this project file that contains a PBXReferenceProxy object for each product of each PBXNativeTarget in the other project file. ProjectRef is a PBXF...
Add a reference to another project file (via PBXProject object) to this one.
[ "Add", "a", "reference", "to", "another", "project", "file", "(", "via", "PBXProject", "object", ")", "to", "this", "one", "." ]
def AddOrGetProjectReference(self, other_pbxproject): """Add a reference to another project file (via PBXProject object) to this one. Returns [ProductGroup, ProjectRef]. ProductGroup is a PBXGroup object in this project file that contains a PBXReferenceProxy object for each product of each PBXNati...
[ "def", "AddOrGetProjectReference", "(", "self", ",", "other_pbxproject", ")", ":", "if", "not", "'projectReferences'", "in", "self", ".", "_properties", ":", "self", ".", "_properties", "[", "'projectReferences'", "]", "=", "[", "]", "product_group", "=", "None"...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcodeproj_file.py#L2609-L2681
zeakey/DeepSkeleton
dc70170f8fd2ec8ca1157484ce66129981104486
python/caffe/pycaffe.py
python
_Net_blob_loss_weights
(self)
return OrderedDict(zip(self._blob_names, self._blob_loss_weights))
An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name
An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name
[ "An", "OrderedDict", "(", "bottom", "to", "top", "i", ".", "e", ".", "input", "to", "output", ")", "of", "network", "blob", "loss", "weights", "indexed", "by", "name" ]
def _Net_blob_loss_weights(self): """ An OrderedDict (bottom to top, i.e., input to output) of network blob loss weights indexed by name """ return OrderedDict(zip(self._blob_names, self._blob_loss_weights))
[ "def", "_Net_blob_loss_weights", "(", "self", ")", ":", "return", "OrderedDict", "(", "zip", "(", "self", ".", "_blob_names", ",", "self", ".", "_blob_loss_weights", ")", ")" ]
https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/python/caffe/pycaffe.py#L31-L36
danxuhk/ContinuousCRF-CNN
2b6dcaf179620f118b225ed12c890414ca828e21
examples/web_demo/app.py
python
embed_image_html
(image)
return 'data:image/png;base64,' + data
Creates an image embedded in HTML base64 format.
Creates an image embedded in HTML base64 format.
[ "Creates", "an", "image", "embedded", "in", "HTML", "base64", "format", "." ]
def embed_image_html(image): """Creates an image embedded in HTML base64 format.""" image_pil = Image.fromarray((255 * image).astype('uint8')) image_pil = image_pil.resize((256, 256)) string_buf = StringIO.StringIO() image_pil.save(string_buf, format='png') data = string_buf.getvalue().encode('b...
[ "def", "embed_image_html", "(", "image", ")", ":", "image_pil", "=", "Image", ".", "fromarray", "(", "(", "255", "*", "image", ")", ".", "astype", "(", "'uint8'", ")", ")", "image_pil", "=", "image_pil", ".", "resize", "(", "(", "256", ",", "256", ")...
https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/examples/web_demo/app.py#L82-L89
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/functional.py
python
upsample_nearest
(input, size=None, scale_factor=None)
return interpolate(input, size, scale_factor, mode="nearest")
r"""Upsamples the input, using nearest neighbours' pixel values. .. warning:: This function is deprecated in favor of :func:`torch.nn.functional.interpolate`. This is equivalent with ``nn.functional.interpolate(..., mode='nearest')``. Currently spatial and volumetric upsampling are supported (...
r"""Upsamples the input, using nearest neighbours' pixel values.
[ "r", "Upsamples", "the", "input", "using", "nearest", "neighbours", "pixel", "values", "." ]
def upsample_nearest(input, size=None, scale_factor=None): # noqa: F811 r"""Upsamples the input, using nearest neighbours' pixel values. .. warning:: This function is deprecated in favor of :func:`torch.nn.functional.interpolate`. This is equivalent with ``nn.functional.interpolate(..., mode='...
[ "def", "upsample_nearest", "(", "input", ",", "size", "=", "None", ",", "scale_factor", "=", "None", ")", ":", "# noqa: F811", "# DeprecationWarning is ignored by default", "warnings", ".", "warn", "(", "\"nn.functional.upsample_nearest is deprecated. Use nn.functional.interp...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/functional.py#L3919-L3940
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/function_base.py
python
_needs_add_docstring
(obj)
return True
Returns true if the only way to set the docstring of `obj` from python is via add_docstring. This function errs on the side of being overly conservative.
Returns true if the only way to set the docstring of `obj` from python is via add_docstring.
[ "Returns", "true", "if", "the", "only", "way", "to", "set", "the", "docstring", "of", "obj", "from", "python", "is", "via", "add_docstring", "." ]
def _needs_add_docstring(obj): """ Returns true if the only way to set the docstring of `obj` from python is via add_docstring. This function errs on the side of being overly conservative. """ Py_TPFLAGS_HEAPTYPE = 1 << 9 if isinstance(obj, (types.FunctionType, types.MethodType, property))...
[ "def", "_needs_add_docstring", "(", "obj", ")", ":", "Py_TPFLAGS_HEAPTYPE", "=", "1", "<<", "9", "if", "isinstance", "(", "obj", ",", "(", "types", ".", "FunctionType", ",", "types", ".", "MethodType", ",", "property", ")", ")", ":", "return", "False", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/function_base.py#L428-L443
rsummers11/CADLab
976ed959a0b5208bb4173127a7ef732ac73a9b6f
lesion_detector_3DCE/rcnn/fio/image.py
python
get_image
(roidb)
return processed_ims, processed_roidb
preprocess image and return processed roidb :param roidb: a list of roidb :return: list of img as in mxnet format roidb add new item['im_info'] 0 --- x (width, second dim of im) | y (height, first dim of im)
preprocess image and return processed roidb :param roidb: a list of roidb :return: list of img as in mxnet format roidb add new item['im_info'] 0 --- x (width, second dim of im) | y (height, first dim of im)
[ "preprocess", "image", "and", "return", "processed", "roidb", ":", "param", "roidb", ":", "a", "list", "of", "roidb", ":", "return", ":", "list", "of", "img", "as", "in", "mxnet", "format", "roidb", "add", "new", "item", "[", "im_info", "]", "0", "---"...
def get_image(roidb): """ preprocess image and return processed roidb :param roidb: a list of roidb :return: list of img as in mxnet format roidb add new item['im_info'] 0 --- x (width, second dim of im) | y (height, first dim of im) """ num_images = len(roidb) processed_ims ...
[ "def", "get_image", "(", "roidb", ")", ":", "num_images", "=", "len", "(", "roidb", ")", "processed_ims", "=", "[", "]", "processed_roidb", "=", "[", "]", "# t = Timer()", "for", "i", "in", "range", "(", "num_images", ")", ":", "r", "=", "roidb", "[", ...
https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/lesion_detector_3DCE/rcnn/fio/image.py#L15-L57
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/serial/serialposix.py
python
Serial._update_break_state
(self)
\ Set break: Controls TXD. When active, no transmitting is possible.
\ Set break: Controls TXD. When active, no transmitting is possible.
[ "\\", "Set", "break", ":", "Controls", "TXD", ".", "When", "active", "no", "transmitting", "is", "possible", "." ]
def _update_break_state(self): """\ Set break: Controls TXD. When active, no transmitting is possible. """ if self._break_state: fcntl.ioctl(self.fd, TIOCSBRK) else: fcntl.ioctl(self.fd, TIOCCBRK)
[ "def", "_update_break_state", "(", "self", ")", ":", "if", "self", ".", "_break_state", ":", "fcntl", ".", "ioctl", "(", "self", ".", "fd", ",", "TIOCSBRK", ")", "else", ":", "fcntl", ".", "ioctl", "(", "self", ".", "fd", ",", "TIOCCBRK", ")" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialposix.py#L615-L622
francinexue/xuefu
b6ff79747a42e020588c0c0a921048e08fe4680c
ctpx/ctp3/ctptd.py
python
CtpTd.onRspQryOptionInstrCommRate
(self, OptionInstrCommRateField, RspInfoField, requestId, final)
请求查询期权合约手续费响应
请求查询期权合约手续费响应
[ "请求查询期权合约手续费响应" ]
def onRspQryOptionInstrCommRate(self, OptionInstrCommRateField, RspInfoField, requestId, final): """请求查询期权合约手续费响应""" pass
[ "def", "onRspQryOptionInstrCommRate", "(", "self", ",", "OptionInstrCommRateField", ",", "RspInfoField", ",", "requestId", ",", "final", ")", ":", "pass" ]
https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp3/ctptd.py#L314-L316
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/debug/wrappers/framework.py
python
OnRunStartResponse.__init__
(self, action, debug_urls, debug_ops="DebugIdentity", node_name_regex_whitelist=None, op_type_regex_whitelist=None, tensor_dtype_regex_whitelist=None, tolerate_debug_op_creation_failures=False)
Constructor of `OnRunStartResponse`. Args: action: (`OnRunStartAction`) the action actually taken by the wrapped session for the run() call. debug_urls: (`list` of `str`) debug_urls used in watching the tensors during the run() call. debug_ops: (`str` or `list` of `str`) Debug op(...
Constructor of `OnRunStartResponse`.
[ "Constructor", "of", "OnRunStartResponse", "." ]
def __init__(self, action, debug_urls, debug_ops="DebugIdentity", node_name_regex_whitelist=None, op_type_regex_whitelist=None, tensor_dtype_regex_whitelist=None, tolerate_debug_op_creation_failures=False): """C...
[ "def", "__init__", "(", "self", ",", "action", ",", "debug_urls", ",", "debug_ops", "=", "\"DebugIdentity\"", ",", "node_name_regex_whitelist", "=", "None", ",", "op_type_regex_whitelist", "=", "None", ",", "tensor_dtype_regex_whitelist", "=", "None", ",", "tolerate...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/wrappers/framework.py#L244-L282
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Script/SConsOptions.py
python
SConsOptionParser.reparse_local_options
(self)
Re-parse the leftover command-line options stored in self.largs, so that any value overridden on the command line is immediately available if the user turns around and does a GetOption() right away. We mimic the processing of the single args in the original OptionParser....
Re-parse the leftover command-line options stored in self.largs, so that any value overridden on the command line is immediately available if the user turns around and does a GetOption() right away. We mimic the processing of the single args in the original OptionParser....
[ "Re", "-", "parse", "the", "leftover", "command", "-", "line", "options", "stored", "in", "self", ".", "largs", "so", "that", "any", "value", "overridden", "on", "the", "command", "line", "is", "immediately", "available", "if", "the", "user", "turns", "aro...
def reparse_local_options(self): """ Re-parse the leftover command-line options stored in self.largs, so that any value overridden on the command line is immediately available if the user turns around and does a GetOption() right away. We mimic the processing of ...
[ "def", "reparse_local_options", "(", "self", ")", ":", "rargs", "=", "[", "]", "largs_restore", "=", "[", "]", "# Loop over all remaining arguments", "skip", "=", "False", "for", "l", "in", "self", ".", "largs", ":", "if", "skip", ":", "# Accept all remaining ...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Script/SConsOptions.py#L360-L423
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/connection.py
python
_ConnectionBase.send
(self, obj)
Send a (picklable) object
Send a (picklable) object
[ "Send", "a", "(", "picklable", ")", "object" ]
def send(self, obj): """Send a (picklable) object""" self._check_closed() self._check_writable() self._send_bytes(_ForkingPickler.dumps(obj))
[ "def", "send", "(", "self", ",", "obj", ")", ":", "self", ".", "_check_closed", "(", ")", "self", ".", "_check_writable", "(", ")", "self", ".", "_send_bytes", "(", "_ForkingPickler", ".", "dumps", "(", "obj", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/multiprocessing/connection.py#L202-L206
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/ceph_manager.py
python
CephManager.are_all_osds_up
(self)
return (len(x) == sum([(y['up'] > 0) for y in x]))
Returns true if all osds are up.
Returns true if all osds are up.
[ "Returns", "true", "if", "all", "osds", "are", "up", "." ]
def are_all_osds_up(self): """ Returns true if all osds are up. """ x = self.get_osd_dump() return (len(x) == sum([(y['up'] > 0) for y in x]))
[ "def", "are_all_osds_up", "(", "self", ")", ":", "x", "=", "self", ".", "get_osd_dump", "(", ")", "return", "(", "len", "(", "x", ")", "==", "sum", "(", "[", "(", "y", "[", "'up'", "]", ">", "0", ")", "for", "y", "in", "x", "]", ")", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ceph_manager.py#L2745-L2750
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
ScrollHelper.__init__
(self, *args, **kwargs)
__init__(self, Window winToScroll) -> ScrollHelper
__init__(self, Window winToScroll) -> ScrollHelper
[ "__init__", "(", "self", "Window", "winToScroll", ")", "-", ">", "ScrollHelper" ]
def __init__(self, *args, **kwargs): """__init__(self, Window winToScroll) -> ScrollHelper""" _windows_.ScrollHelper_swiginit(self,_windows_.new_ScrollHelper(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_windows_", ".", "ScrollHelper_swiginit", "(", "self", ",", "_windows_", ".", "new_ScrollHelper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L142-L144
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/mox.py
python
MockMethod.WithSideEffects
(self, side_effects)
return self
Set the side effects that are simulated when this method is called. Args: side_effects: A callable which modifies the parameters or other relevant state which a given test case depends on. Returns: Self for chaining with AndReturn and AndRaise.
Set the side effects that are simulated when this method is called.
[ "Set", "the", "side", "effects", "that", "are", "simulated", "when", "this", "method", "is", "called", "." ]
def WithSideEffects(self, side_effects): """Set the side effects that are simulated when this method is called. Args: side_effects: A callable which modifies the parameters or other relevant state which a given test case depends on. Returns: Self for chaining with AndReturn and AndRais...
[ "def", "WithSideEffects", "(", "self", ",", "side_effects", ")", ":", "self", ".", "_side_effects", "=", "side_effects", "return", "self" ]
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/mox.py#L738-L749
OpenChemistry/tomviz
0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a
tomviz/python/tomviz/io/dm.py
python
FileDM.__init__
(self, filename, verbose=False, on_memory=True)
Parameters ---------- filename : str or pathlib.Path String pointing to the filesystem location of the file. verbose : bool, optional, default False If True, debug information is printed. on_memory : bool, optional, default True If True, file data is...
[]
def __init__(self, filename, verbose=False, on_memory=True): """ Parameters ---------- filename : str or pathlib.Path String pointing to the filesystem location of the file. verbose : bool, optional, default False If True, debug information is printed. ...
[ "def", "__init__", "(", "self", ",", "filename", ",", "verbose", "=", "False", ",", "on_memory", "=", "True", ")", ":", "self", ".", "filename", "=", "filename", "# necessary declarations, if something fails", "self", ".", "fid", "=", "None", "self", ".", "_...
https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/tomviz/io/dm.py#L106-L230
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/package/package_importer.py
python
PackageImporter.import_module
(self, name: str, package=None)
return self._gcd_import(name)
Load a module from the package if it hasn't already been loaded, and then return the module. Modules are loaded locally to the importer and will appear in ``self.modules`` rather than ``sys.modules``. Args: name (str): Fully qualified name of the module to load. package ...
Load a module from the package if it hasn't already been loaded, and then return the module. Modules are loaded locally to the importer and will appear in ``self.modules`` rather than ``sys.modules``.
[ "Load", "a", "module", "from", "the", "package", "if", "it", "hasn", "t", "already", "been", "loaded", "and", "then", "return", "the", "module", ".", "Modules", "are", "loaded", "locally", "to", "the", "importer", "and", "will", "appear", "in", "self", "...
def import_module(self, name: str, package=None): """Load a module from the package if it hasn't already been loaded, and then return the module. Modules are loaded locally to the importer and will appear in ``self.modules`` rather than ``sys.modules``. Args: name (str): Ful...
[ "def", "import_module", "(", "self", ",", "name", ":", "str", ",", "package", "=", "None", ")", ":", "# We should always be able to support importing modules from this package.", "# This is to support something like:", "# obj = importer.load_pickle(...)", "# importer.import_mod...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/package/package_importer.py#L111-L132
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/utils.py
python
debug
(f)
return wrapper
Use this method to decorate your function with DebugMode's functionality Example: @debug def test_foo(self): raise Exception("Bar")
Use this method to decorate your function with DebugMode's functionality
[ "Use", "this", "method", "to", "decorate", "your", "function", "with", "DebugMode", "s", "functionality" ]
def debug(f): ''' Use this method to decorate your function with DebugMode's functionality Example: @debug def test_foo(self): raise Exception("Bar") ''' @functools.wraps(f) def wrapper(*args, **kwargs): def func(): return f(*args, **kwargs) return...
[ "def", "debug", "(", "f", ")", ":", "@", "functools", ".", "wraps", "(", "f", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "def", "func", "(", ")", ":", "return", "f", "(", "*", "args", ",", "*", "*", "kwargs", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/utils.py#L320-L338
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Text.yview_pickplace
(self, *what)
Obsolete function, use see.
Obsolete function, use see.
[ "Obsolete", "function", "use", "see", "." ]
def yview_pickplace(self, *what): """Obsolete function, use see.""" self.tk.call((self._w, 'yview', '-pickplace') + what)
[ "def", "yview_pickplace", "(", "self", ",", "*", "what", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "self", ".", "_w", ",", "'yview'", ",", "'-pickplace'", ")", "+", "what", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3186-L3188