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
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/codedeploy/layer1.py
python
CodeDeployConnection.get_application_revision
(self, application_name, revision)
return self.make_request(action='GetApplicationRevision', body=json.dumps(params))
Gets information about an application revision. :type application_name: string :param application_name: The name of the application that corresponds to the revision. :type revision: dict :param revision: Information about the application revision to get, includi...
Gets information about an application revision.
[ "Gets", "information", "about", "an", "application", "revision", "." ]
def get_application_revision(self, application_name, revision): """ Gets information about an application revision. :type application_name: string :param application_name: The name of the application that corresponds to the revision. :type revision: dict :pa...
[ "def", "get_application_revision", "(", "self", ",", "application_name", ",", "revision", ")", ":", "params", "=", "{", "'applicationName'", ":", "application_name", ",", "'revision'", ":", "revision", ",", "}", "return", "self", ".", "make_request", "(", "actio...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/codedeploy/layer1.py#L447-L465
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/pyserial/serial/urlhandler/protocol_loop.py
python
LoopbackSerial.getCD
(self)
return True
Read terminal status line: Carrier Detect
Read terminal status line: Carrier Detect
[ "Read", "terminal", "status", "line", ":", "Carrier", "Detect" ]
def getCD(self): """Read terminal status line: Carrier Detect""" if not self._isOpen: raise portNotOpenError if self.logger: self.logger.info('returning dummy for getCD()') return True
[ "def", "getCD", "(", "self", ")", ":", "if", "not", "self", ".", "_isOpen", ":", "raise", "portNotOpenError", "if", "self", ".", "logger", ":", "self", ".", "logger", ".", "info", "(", "'returning dummy for getCD()'", ")", "return", "True" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/urlhandler/protocol_loop.py#L228-L233
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.SearchPrev
(*args, **kwargs)
return _stc.StyledTextCtrl_SearchPrev(*args, **kwargs)
SearchPrev(self, int flags, String text) -> int Find some text starting at the search anchor and moving backwards. Does not ensure the selection is visible.
SearchPrev(self, int flags, String text) -> int
[ "SearchPrev", "(", "self", "int", "flags", "String", "text", ")", "-", ">", "int" ]
def SearchPrev(*args, **kwargs): """ SearchPrev(self, int flags, String text) -> int Find some text starting at the search anchor and moving backwards. Does not ensure the selection is visible. """ return _stc.StyledTextCtrl_SearchPrev(*args, **kwargs)
[ "def", "SearchPrev", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SearchPrev", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L4938-L4945
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/sliceviewer/roi.py
python
extract_matrix_cuts_spectra_axis
(workspace: MatrixWorkspace, xmin: float, xmax: float, ymin: float, ymax: float, xcut_name: str, y...
Assuming a MatrixWorkspace with vertical spectra axis, extract 1D cuts from the region defined by the given parameters :param workspace: A MatrixWorkspace with a vertical SpectraAxis :param xmin: X min for bounded region :param xmax: X max for bounded region :param ymin: Y min for bounded region ...
Assuming a MatrixWorkspace with vertical spectra axis, extract 1D cuts from the region defined by the given parameters :param workspace: A MatrixWorkspace with a vertical SpectraAxis :param xmin: X min for bounded region :param xmax: X max for bounded region :param ymin: Y min for bounded region ...
[ "Assuming", "a", "MatrixWorkspace", "with", "vertical", "spectra", "axis", "extract", "1D", "cuts", "from", "the", "region", "defined", "by", "the", "given", "parameters", ":", "param", "workspace", ":", "A", "MatrixWorkspace", "with", "a", "vertical", "SpectraA...
def extract_matrix_cuts_spectra_axis(workspace: MatrixWorkspace, xmin: float, xmax: float, ymin: float, ymax: float, xcut_name: str, ...
[ "def", "extract_matrix_cuts_spectra_axis", "(", "workspace", ":", "MatrixWorkspace", ",", "xmin", ":", "float", ",", "xmax", ":", "float", ",", "ymin", ":", "float", ",", "ymax", ":", "float", ",", "xcut_name", ":", "str", ",", "ycut_name", ":", "str", ","...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/roi.py#L36-L80
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/third_party/depot_tools/cpplint.py
python
_NamespaceInfo.CheckEnd
(self, filename, clean_lines, linenum, error)
Check end of namespace comments.
Check end of namespace comments.
[ "Check", "end", "of", "namespace", "comments", "." ]
def CheckEnd(self, filename, clean_lines, linenum, error): """Check end of namespace comments.""" line = clean_lines.raw_lines[linenum] # Check how many lines is enclosed in this namespace. Don't issue # warning for missing namespace comments if there aren't enough # lines. However, do apply chec...
[ "def", "CheckEnd", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "raw_lines", "[", "linenum", "]", "# Check how many lines is enclosed in this namespace. Don't issue", "# warning for missing n...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/depot_tools/cpplint.py#L2218-L2268
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/py/py/_log/log.py
python
KeywordMapper.setconsumer
(self, keywords, consumer)
set a consumer for a set of keywords.
set a consumer for a set of keywords.
[ "set", "a", "consumer", "for", "a", "set", "of", "keywords", "." ]
def setconsumer(self, keywords, consumer): """ set a consumer for a set of keywords. """ # normalize to tuples if isinstance(keywords, str): keywords = tuple(filter(None, keywords.split())) elif hasattr(keywords, '_keywords'): keywords = keywords._keywords ...
[ "def", "setconsumer", "(", "self", ",", "keywords", ",", "consumer", ")", ":", "# normalize to tuples", "if", "isinstance", "(", "keywords", ",", "str", ")", ":", "keywords", "=", "tuple", "(", "filter", "(", "None", ",", "keywords", ".", "split", "(", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_log/log.py#L94-L108
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/coordinator/metric_utils.py
python
get_metric_summary
(metric_name)
return ret
Get summary for the specified metric.
Get summary for the specified metric.
[ "Get", "summary", "for", "the", "specified", "metric", "." ]
def get_metric_summary(metric_name): """Get summary for the specified metric.""" metric = _METRICS_MAPPING[metric_name] histogram_proto = metric.get_cell().value() ret = dict() ret['min'] = histogram_proto.min ret['max'] = histogram_proto.max ret['num'] = histogram_proto.num ret['sum'] = histogram_proto...
[ "def", "get_metric_summary", "(", "metric_name", ")", ":", "metric", "=", "_METRICS_MAPPING", "[", "metric_name", "]", "histogram_proto", "=", "metric", ".", "get_cell", "(", ")", ".", "value", "(", ")", "ret", "=", "dict", "(", ")", "ret", "[", "'min'", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/coordinator/metric_utils.py#L75-L85
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
catalogGetPublic
(pubID)
return ret
Try to lookup the catalog reference associated to a public ID DEPRECATED, use xmlCatalogResolvePublic()
Try to lookup the catalog reference associated to a public ID DEPRECATED, use xmlCatalogResolvePublic()
[ "Try", "to", "lookup", "the", "catalog", "reference", "associated", "to", "a", "public", "ID", "DEPRECATED", "use", "xmlCatalogResolvePublic", "()" ]
def catalogGetPublic(pubID): """Try to lookup the catalog reference associated to a public ID DEPRECATED, use xmlCatalogResolvePublic() """ ret = libxml2mod.xmlCatalogGetPublic(pubID) return ret
[ "def", "catalogGetPublic", "(", "pubID", ")", ":", "ret", "=", "libxml2mod", ".", "xmlCatalogGetPublic", "(", "pubID", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L871-L875
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/greater_equal_impl.py
python
_greater_equal_tensor
(x, y)
return F.tensor_ge(x, y)
Determine whether tensor x is greater equal than tensor y elementwise Args: x(Tensor): Tensor. y(Tensor): Tensor. Returns: Tensor, return value by operator P.GreaterEqual.
Determine whether tensor x is greater equal than tensor y elementwise
[ "Determine", "whether", "tensor", "x", "is", "greater", "equal", "than", "tensor", "y", "elementwise" ]
def _greater_equal_tensor(x, y): """ Determine whether tensor x is greater equal than tensor y elementwise Args: x(Tensor): Tensor. y(Tensor): Tensor. Returns: Tensor, return value by operator P.GreaterEqual. """ return F.tensor_ge(x, y)
[ "def", "_greater_equal_tensor", "(", "x", ",", "y", ")", ":", "return", "F", ".", "tensor_ge", "(", "x", ",", "y", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/greater_equal_impl.py#L43-L54
sofa-framework/sofa
70628e35a44fcc258cf8250109b5e4eba8c5abe9
applications/plugins/PSL/python/pslparserhjson.py
python
objectToString
(object, nspace)
return ores
Convert a Sofa object into a hjson string. This function is used during the serialization process
Convert a Sofa object into a hjson string. This function is used during the serialization process
[ "Convert", "a", "Sofa", "object", "into", "a", "hjson", "string", ".", "This", "function", "is", "used", "during", "the", "serialization", "process" ]
def objectToString(object, nspace): '''Convert a Sofa object into a hjson string. This function is used during the serialization process''' instanceof = object.getData("psl_instanceof") if instanceof != None: instanceof = instanceof.getValue() if instanceof == "Template": ...
[ "def", "objectToString", "(", "object", ",", "nspace", ")", ":", "instanceof", "=", "object", ".", "getData", "(", "\"psl_instanceof\"", ")", "if", "instanceof", "!=", "None", ":", "instanceof", "=", "instanceof", ".", "getValue", "(", ")", "if", "instanceof...
https://github.com/sofa-framework/sofa/blob/70628e35a44fcc258cf8250109b5e4eba8c5abe9/applications/plugins/PSL/python/pslparserhjson.py#L35-L68
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
ToolBarToolBase.GetKind
(*args, **kwargs)
return _controls_.ToolBarToolBase_GetKind(*args, **kwargs)
GetKind(self) -> int
GetKind(self) -> int
[ "GetKind", "(", "self", ")", "-", ">", "int" ]
def GetKind(*args, **kwargs): """GetKind(self) -> int""" return _controls_.ToolBarToolBase_GetKind(*args, **kwargs)
[ "def", "GetKind", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarToolBase_GetKind", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3469-L3471
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/completerlib.py
python
get_root_modules
()
return rootmodules
Returns a list containing the names of all the modules available in the folders of the pythonpath. ip.db['rootmodules_cache'] maps sys.path entries to list of modules.
Returns a list containing the names of all the modules available in the folders of the pythonpath.
[ "Returns", "a", "list", "containing", "the", "names", "of", "all", "the", "modules", "available", "in", "the", "folders", "of", "the", "pythonpath", "." ]
def get_root_modules(): """ Returns a list containing the names of all the modules available in the folders of the pythonpath. ip.db['rootmodules_cache'] maps sys.path entries to list of modules. """ ip = get_ipython() if ip is None: # No global shell instance to store cached list o...
[ "def", "get_root_modules", "(", ")", ":", "ip", "=", "get_ipython", "(", ")", "if", "ip", "is", "None", ":", "# No global shell instance to store cached list of modules.", "# Don't try to scan for modules every time.", "return", "list", "(", "sys", ".", "builtin_module_na...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/completerlib.py#L154-L195
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_utils/transformations.py
python
quaternion_multiply
(quaternion1, quaternion0)
return numpy.array(( x1*w0 + y1*z0 - z1*y0 + w1*x0, -x1*z0 + y1*w0 + z1*x0 + w1*y0, x1*y0 - y1*x0 + z1*w0 + w1*z0, -x1*x0 - y1*y0 - z1*z0 + w1*w0), dtype=numpy.float64)
Return multiplication of two quaternions. >>> q = quaternion_multiply([1, -2, 3, 4], [-5, 6, 7, 8]) >>> numpy.allclose(q, [-44, -14, 48, 28]) True
Return multiplication of two quaternions.
[ "Return", "multiplication", "of", "two", "quaternions", "." ]
def quaternion_multiply(quaternion1, quaternion0): """Return multiplication of two quaternions. >>> q = quaternion_multiply([1, -2, 3, 4], [-5, 6, 7, 8]) >>> numpy.allclose(q, [-44, -14, 48, 28]) True """ x0, y0, z0, w0 = quaternion0 x1, y1, z1, w1 = quaternion1 return numpy.array(( ...
[ "def", "quaternion_multiply", "(", "quaternion1", ",", "quaternion0", ")", ":", "x0", ",", "y0", ",", "z0", ",", "w0", "=", "quaternion0", "x1", ",", "y1", ",", "z1", ",", "w1", "=", "quaternion1", "return", "numpy", ".", "array", "(", "(", "x1", "*"...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_utils/transformations.py#L1228-L1242
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
ListCtrl.GetTextColour
(*args, **kwargs)
return _controls_.ListCtrl_GetTextColour(*args, **kwargs)
GetTextColour(self) -> Colour
GetTextColour(self) -> Colour
[ "GetTextColour", "(", "self", ")", "-", ">", "Colour" ]
def GetTextColour(*args, **kwargs): """GetTextColour(self) -> Colour""" return _controls_.ListCtrl_GetTextColour(*args, **kwargs)
[ "def", "GetTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListCtrl_GetTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4592-L4594
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_ops.py
python
_div_python2
(x, y, name=None)
Divide two values using Python 2 semantics. Used for Tensor.__div__. Args: x: `Tensor` numerator of real numeric type. y: `Tensor` denominator of real numeric type. name: A name for the operation (optional). Returns: `x / y` returns the quotient of x and y.
Divide two values using Python 2 semantics.
[ "Divide", "two", "values", "using", "Python", "2", "semantics", "." ]
def _div_python2(x, y, name=None): """Divide two values using Python 2 semantics. Used for Tensor.__div__. Args: x: `Tensor` numerator of real numeric type. y: `Tensor` denominator of real numeric type. name: A name for the operation (optional). Returns: `x / y` returns the quotient of x and ...
[ "def", "_div_python2", "(", "x", ",", "y", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"div\"", ",", "[", "x", ",", "y", "]", ")", "as", "name", ":", "x", "=", "ops", ".", "convert_to_tensor", "(", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_ops.py#L1530-L1555
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PGProperty.GetMaxLength
(*args, **kwargs)
return _propgrid.PGProperty_GetMaxLength(*args, **kwargs)
GetMaxLength(self) -> int
GetMaxLength(self) -> int
[ "GetMaxLength", "(", "self", ")", "-", ">", "int" ]
def GetMaxLength(*args, **kwargs): """GetMaxLength(self) -> int""" return _propgrid.PGProperty_GetMaxLength(*args, **kwargs)
[ "def", "GetMaxLength", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_GetMaxLength", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L604-L606
facebookresearch/minirts
859e747a5e2fab2355bea083daffa6a36820a7f2
scripts/behavior_clone/module.py
python
CmdEmbedding.forward
(self, ctype, utype)
return torch.cat([ctype_emb, utype_emb], 2)
take cmd_type, produce cmd_repr ctype: [batch, num_padded_unit], 0 <= ctype < num_ctype, padding cmd should have a valid unit_type
take cmd_type, produce cmd_repr
[ "take", "cmd_type", "produce", "cmd_repr" ]
def forward(self, ctype, utype): """take cmd_type, produce cmd_repr ctype: [batch, num_padded_unit], 0 <= ctype < num_ctype, padding cmd should have a valid unit_type """ ctype_emb = self.ctype_emb(ctype) utype_emb = self.utype_emb(utype) # print('>>>>', ctype....
[ "def", "forward", "(", "self", ",", "ctype", ",", "utype", ")", ":", "ctype_emb", "=", "self", ".", "ctype_emb", "(", "ctype", ")", "utype_emb", "=", "self", ".", "utype_emb", "(", "utype", ")", "# print('>>>>', ctype.size())", "return", "torch", ".", "cat...
https://github.com/facebookresearch/minirts/blob/859e747a5e2fab2355bea083daffa6a36820a7f2/scripts/behavior_clone/module.py#L95-L104
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/displayhook.py
python
DisplayHook.quiet
(self)
Should we silence the display hook because of ';'?
Should we silence the display hook because of ';'?
[ "Should", "we", "silence", "the", "display", "hook", "because", "of", ";", "?" ]
def quiet(self): """Should we silence the display hook because of ';'?""" # do not print output if input ends in ';' try: cell = cast_unicode_py2(self.shell.history_manager.input_hist_parsed[-1]) except IndexError: # some uses of ipshellembed may fail her...
[ "def", "quiet", "(", "self", ")", ":", "# do not print output if input ends in ';'", "try", ":", "cell", "=", "cast_unicode_py2", "(", "self", ".", "shell", ".", "history_manager", ".", "input_hist_parsed", "[", "-", "1", "]", ")", "except", "IndexError", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/displayhook.py#L83-L102
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/utils.py
python
get_environ_proxies
(url, no_proxy=None)
Return a dict of environment proxies. :rtype: dict
Return a dict of environment proxies.
[ "Return", "a", "dict", "of", "environment", "proxies", "." ]
def get_environ_proxies(url, no_proxy=None): """ Return a dict of environment proxies. :rtype: dict """ if should_bypass_proxies(url, no_proxy=no_proxy): return {} else: return getproxies()
[ "def", "get_environ_proxies", "(", "url", ",", "no_proxy", "=", "None", ")", ":", "if", "should_bypass_proxies", "(", "url", ",", "no_proxy", "=", "no_proxy", ")", ":", "return", "{", "}", "else", ":", "return", "getproxies", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/utils.py#L760-L769
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/mac_tool.py
python
MacTool._Relink
(self, dest, link)
Creates a symlink to |dest| named |link|. If |link| already exists, it is overwritten.
Creates a symlink to |dest| named |link|. If |link| already exists, it is overwritten.
[ "Creates", "a", "symlink", "to", "|dest|", "named", "|link|", ".", "If", "|link|", "already", "exists", "it", "is", "overwritten", "." ]
def _Relink(self, dest, link): """Creates a symlink to |dest| named |link|. If |link| already exists, it is overwritten.""" if os.path.lexists(link): os.remove(link) os.symlink(dest, link)
[ "def", "_Relink", "(", "self", ",", "dest", ",", "link", ")", ":", "if", "os", ".", "path", ".", "lexists", "(", "link", ")", ":", "os", ".", "remove", "(", "link", ")", "os", ".", "symlink", "(", "dest", ",", "link", ")" ]
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/mac_tool.py#L201-L206
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/feature_column/feature_column.py
python
_create_tuple
(shape, value)
return value
Returns a tuple with given shape and filled with value.
Returns a tuple with given shape and filled with value.
[ "Returns", "a", "tuple", "with", "given", "shape", "and", "filled", "with", "value", "." ]
def _create_tuple(shape, value): """Returns a tuple with given shape and filled with value.""" if shape: return tuple([_create_tuple(shape[1:], value) for _ in range(shape[0])]) return value
[ "def", "_create_tuple", "(", "shape", ",", "value", ")", ":", "if", "shape", ":", "return", "tuple", "(", "[", "_create_tuple", "(", "shape", "[", "1", ":", "]", ",", "value", ")", "for", "_", "in", "range", "(", "shape", "[", "0", "]", ")", "]",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/feature_column/feature_column.py#L1855-L1859
SGL-UT/GPSTk
2340ec1cbdbd0b80a204920127798697bc616b30
swig/doxy2swig.py
python
Doxy2SWIG.parse
(self, node)
Parse a given node. This function in turn calls the `parse_<nodeType>` functions which handle the respective nodes.
Parse a given node. This function in turn calls the `parse_<nodeType>` functions which handle the respective nodes.
[ "Parse", "a", "given", "node", ".", "This", "function", "in", "turn", "calls", "the", "parse_<nodeType", ">", "functions", "which", "handle", "the", "respective", "nodes", "." ]
def parse(self, node): """Parse a given node. This function in turn calls the `parse_<nodeType>` functions which handle the respective nodes. """ pm = getattr(self, "parse_%s"%node.__class__.__name__) pm(node)
[ "def", "parse", "(", "self", ",", "node", ")", ":", "pm", "=", "getattr", "(", "self", ",", "\"parse_%s\"", "%", "node", ".", "__class__", ".", "__name__", ")", "pm", "(", "node", ")" ]
https://github.com/SGL-UT/GPSTk/blob/2340ec1cbdbd0b80a204920127798697bc616b30/swig/doxy2swig.py#L104-L111
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLCollectData.py
python
_applyIncidentEnergyCalibration
(ws, eiWS, wsNames, report, algorithmLogging)
return ws
Update incident energy and wavelength in the sample logs.
Update incident energy and wavelength in the sample logs.
[ "Update", "incident", "energy", "and", "wavelength", "in", "the", "sample", "logs", "." ]
def _applyIncidentEnergyCalibration(ws, eiWS, wsNames, report, algorithmLogging): """Update incident energy and wavelength in the sample logs.""" originalEnergy = ws.getRun().getLogData('Ei').value originalWavelength = ws.getRun().getLogData('wavelength').value energy = eiWS.readY(0)[0] wavelength =...
[ "def", "_applyIncidentEnergyCalibration", "(", "ws", ",", "eiWS", ",", "wsNames", ",", "report", ",", "algorithmLogging", ")", ":", "originalEnergy", "=", "ws", ".", "getRun", "(", ")", ".", "getLogData", "(", "'Ei'", ")", ".", "value", "originalWavelength", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLCollectData.py#L30-L53
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/bayesflow/python/ops/stochastic_graph.py
python
_StochasticValueType.stop_gradient
(self)
Whether the value should be wrapped in stop_gradient. StochasticTensors must respect this property.
Whether the value should be wrapped in stop_gradient.
[ "Whether", "the", "value", "should", "be", "wrapped", "in", "stop_gradient", "." ]
def stop_gradient(self): """Whether the value should be wrapped in stop_gradient. StochasticTensors must respect this property. """ pass
[ "def", "stop_gradient", "(", "self", ")", ":", "pass" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/bayesflow/python/ops/stochastic_graph.py#L144-L149
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/meta_graph.py
python
ops_used_by_graph_def
(graph_def)
return [op for op in used_ops if op not in name_to_function]
Collect the list of ops used by a graph. Does not validate that the ops are all registered. Args: graph_def: A `GraphDef` proto, as from `graph.as_graph_def()`. Returns: A list of strings, each naming an op used by the graph.
Collect the list of ops used by a graph.
[ "Collect", "the", "list", "of", "ops", "used", "by", "a", "graph", "." ]
def ops_used_by_graph_def(graph_def): """Collect the list of ops used by a graph. Does not validate that the ops are all registered. Args: graph_def: A `GraphDef` proto, as from `graph.as_graph_def()`. Returns: A list of strings, each naming an op used by the graph. """ # Map function names to de...
[ "def", "ops_used_by_graph_def", "(", "graph_def", ")", ":", "# Map function names to definitions", "name_to_function", "=", "{", "}", "for", "fun", "in", "graph_def", ".", "library", ".", "function", ":", "name_to_function", "[", "fun", ".", "signature", ".", "nam...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/meta_graph.py#L130-L163
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
SequenceCategoricalColumn.num_buckets
(self)
return self.categorical_column.num_buckets
Returns number of buckets in this sparse feature.
Returns number of buckets in this sparse feature.
[ "Returns", "number", "of", "buckets", "in", "this", "sparse", "feature", "." ]
def num_buckets(self): """Returns number of buckets in this sparse feature.""" return self.categorical_column.num_buckets
[ "def", "num_buckets", "(", "self", ")", ":", "return", "self", ".", "categorical_column", ".", "num_buckets" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L4517-L4519
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/pybind11/pybind11/setup_helpers.py
python
auto_cpp_level
(compiler)
Return the max supported C++ std level (17, 14, or 11). Returns latest on Windows.
Return the max supported C++ std level (17, 14, or 11). Returns latest on Windows.
[ "Return", "the", "max", "supported", "C", "++", "std", "level", "(", "17", "14", "or", "11", ")", ".", "Returns", "latest", "on", "Windows", "." ]
def auto_cpp_level(compiler): """ Return the max supported C++ std level (17, 14, or 11). Returns latest on Windows. """ if WIN: return "latest" global cpp_flag_cache # If this has been previously calculated with the same args, return that with cpp_cache_lock: if cpp_flag_...
[ "def", "auto_cpp_level", "(", "compiler", ")", ":", "if", "WIN", ":", "return", "\"latest\"", "global", "cpp_flag_cache", "# If this has been previously calculated with the same args, return that", "with", "cpp_cache_lock", ":", "if", "cpp_flag_cache", ":", "return", "cpp_f...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/pybind11/pybind11/setup_helpers.py#L256-L280
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/enum_type_wrapper.py
python
EnumTypeWrapper.items
(self)
return [(value_descriptor.name, value_descriptor.number) for value_descriptor in self._enum_type.values]
Return a list of the (name, value) pairs of the enum. Returns: A list of (str, int) pairs, in the order they were defined in the .proto file.
Return a list of the (name, value) pairs of the enum.
[ "Return", "a", "list", "of", "the", "(", "name", "value", ")", "pairs", "of", "the", "enum", "." ]
def items(self): """Return a list of the (name, value) pairs of the enum. Returns: A list of (str, int) pairs, in the order they were defined in the .proto file. """ return [(value_descriptor.name, value_descriptor.number) for value_descriptor in self._enum_type.values]
[ "def", "items", "(", "self", ")", ":", "return", "[", "(", "value_descriptor", ".", "name", ",", "value_descriptor", ".", "number", ")", "for", "value_descriptor", "in", "self", ".", "_enum_type", ".", "values", "]" ]
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/enum_type_wrapper.py#L96-L104
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py
python
Alias
(funcName)
return d[funcName].alias
Return the function that the named function is an alias of. Ex: Alias('DrawArraysEXT') = 'DrawArrays'.
Return the function that the named function is an alias of. Ex: Alias('DrawArraysEXT') = 'DrawArrays'.
[ "Return", "the", "function", "that", "the", "named", "function", "is", "an", "alias", "of", ".", "Ex", ":", "Alias", "(", "DrawArraysEXT", ")", "=", "DrawArrays", "." ]
def Alias(funcName): """Return the function that the named function is an alias of. Ex: Alias('DrawArraysEXT') = 'DrawArrays'. """ d = GetFunctionDict() return d[funcName].alias
[ "def", "Alias", "(", "funcName", ")", ":", "d", "=", "GetFunctionDict", "(", ")", "return", "d", "[", "funcName", "]", ".", "alias" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py#L332-L337
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/credentials.py
python
AssumeRoleWithWebIdentityCredentialFetcher.__init__
(self, client_creator, web_identity_token_loader, role_arn, extra_args=None, cache=None, expiry_window_seconds=None)
:type client_creator: callable :param client_creator: A callable that creates a client taking arguments like ``Session.create_client``. :type web_identity_token_loader: callable :param web_identity_token_loader: A callable that takes no arguments and returns a web identity t...
:type client_creator: callable :param client_creator: A callable that creates a client taking arguments like ``Session.create_client``.
[ ":", "type", "client_creator", ":", "callable", ":", "param", "client_creator", ":", "A", "callable", "that", "creates", "a", "client", "taking", "arguments", "like", "Session", ".", "create_client", "." ]
def __init__(self, client_creator, web_identity_token_loader, role_arn, extra_args=None, cache=None, expiry_window_seconds=None): """ :type client_creator: callable :param client_creator: A callable that creates a client taking arguments like ``Session.create_client`...
[ "def", "__init__", "(", "self", ",", "client_creator", ",", "web_identity_token_loader", ",", "role_arn", ",", "extra_args", "=", "None", ",", "cache", "=", "None", ",", "expiry_window_seconds", "=", "None", ")", ":", "self", ".", "_web_identity_token_loader", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/credentials.py#L820-L854
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/SimpleXMLRPCServer.py
python
list_public_methods
(obj)
return [member for member in dir(obj) if not member.startswith('_') and hasattr(getattr(obj, member), '__call__')]
Returns a list of attribute strings, found in the specified object, which represent callable attributes
Returns a list of attribute strings, found in the specified object, which represent callable attributes
[ "Returns", "a", "list", "of", "attribute", "strings", "found", "in", "the", "specified", "object", "which", "represent", "callable", "attributes" ]
def list_public_methods(obj): """Returns a list of attribute strings, found in the specified object, which represent callable attributes""" return [member for member in dir(obj) if not member.startswith('_') and hasattr(getattr(obj, member), '__call__')]
[ "def", "list_public_methods", "(", "obj", ")", ":", "return", "[", "member", "for", "member", "in", "dir", "(", "obj", ")", "if", "not", "member", ".", "startswith", "(", "'_'", ")", "and", "hasattr", "(", "getattr", "(", "obj", ",", "member", ")", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/SimpleXMLRPCServer.py#L139-L145
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/analyzer_cli.py
python
DebugAnalyzer.list_source
(self, args, screen_info=None)
return output
List Python source files that constructed nodes and tensors.
List Python source files that constructed nodes and tensors.
[ "List", "Python", "source", "files", "that", "constructed", "nodes", "and", "tensors", "." ]
def list_source(self, args, screen_info=None): """List Python source files that constructed nodes and tensors.""" del screen_info # Unused. parsed = self._arg_parsers["list_source"].parse_args(args) source_list = source_utils.list_source_files_against_dump( self._debug_dump, path_regex...
[ "def", "list_source", "(", "self", ",", "args", ",", "screen_info", "=", "None", ")", ":", "del", "screen_info", "# Unused.", "parsed", "=", "self", ".", "_arg_parsers", "[", "\"list_source\"", "]", ".", "parse_args", "(", "args", ")", "source_list", "=", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/analyzer_cli.py#L1242-L1271
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
isChar
(ch)
return ret
This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ instead
This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ instead
[ "This", "function", "is", "DEPRECATED", ".", "Use", "xmlIsChar_ch", "or", "xmlIsCharQ", "instead" ]
def isChar(ch): """This function is DEPRECATED. Use xmlIsChar_ch or xmlIsCharQ instead """ ret = libxml2mod.xmlIsChar(ch) return ret
[ "def", "isChar", "(", "ch", ")", ":", "ret", "=", "libxml2mod", ".", "xmlIsChar", "(", "ch", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L251-L255
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/email/message.py
python
Message.set_charset
(self, charset)
Set the charset of the payload to a given character set. charset can be a Charset instance, a string naming a character set, or None. If it is a string it will be converted to a Charset instance. If charset is None, the charset parameter will be removed from the Content-Type field. An...
Set the charset of the payload to a given character set.
[ "Set", "the", "charset", "of", "the", "payload", "to", "a", "given", "character", "set", "." ]
def set_charset(self, charset): """Set the charset of the payload to a given character set. charset can be a Charset instance, a string naming a character set, or None. If it is a string it will be converted to a Charset instance. If charset is None, the charset parameter will be remov...
[ "def", "set_charset", "(", "self", ",", "charset", ")", ":", "if", "charset", "is", "None", ":", "self", ".", "del_param", "(", "'charset'", ")", "self", ".", "_charset", "=", "None", "return", "if", "not", "isinstance", "(", "charset", ",", "Charset", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/message.py#L323-L368
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
python
PBXProject.RootGroupsTakeOverOnlyChildren
(self, recurse=False)
Calls TakeOverOnlyChild for all groups in the main group.
Calls TakeOverOnlyChild for all groups in the main group.
[ "Calls", "TakeOverOnlyChild", "for", "all", "groups", "in", "the", "main", "group", "." ]
def RootGroupsTakeOverOnlyChildren(self, recurse=False): """Calls TakeOverOnlyChild for all groups in the main group.""" for group in self._properties['mainGroup']._properties['children']: if isinstance(group, PBXGroup): group.TakeOverOnlyChild(recurse)
[ "def", "RootGroupsTakeOverOnlyChildren", "(", "self", ",", "recurse", "=", "False", ")", ":", "for", "group", "in", "self", ".", "_properties", "[", "'mainGroup'", "]", ".", "_properties", "[", "'children'", "]", ":", "if", "isinstance", "(", "group", ",", ...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py#L2632-L2637
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/attr/_make.py
python
_ClassBuilder.build_class
(self)
Finalize class based on the accumulated configuration. Builder cannot be used after calling this method.
Finalize class based on the accumulated configuration.
[ "Finalize", "class", "based", "on", "the", "accumulated", "configuration", "." ]
def build_class(self): """ Finalize class based on the accumulated configuration. Builder cannot be used after calling this method. """ if self._slots is True: return self._create_slots_class() else: return self._patch_original_class()
[ "def", "build_class", "(", "self", ")", ":", "if", "self", ".", "_slots", "is", "True", ":", "return", "self", ".", "_create_slots_class", "(", ")", "else", ":", "return", "self", ".", "_patch_original_class", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/attr/_make.py#L489-L498
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
clang/tools/scan-build-py/libscanbuild/__init__.py
python
run_command
(command, cwd=None)
Run a given command and report the execution. :param command: array of tokens :param cwd: the working directory where the command will be executed :return: output of the command
Run a given command and report the execution.
[ "Run", "a", "given", "command", "and", "report", "the", "execution", "." ]
def run_command(command, cwd=None): """ Run a given command and report the execution. :param command: array of tokens :param cwd: the working directory where the command will be executed :return: output of the command """ def decode_when_needed(result): """ check_output returns bytes or...
[ "def", "run_command", "(", "command", ",", "cwd", "=", "None", ")", ":", "def", "decode_when_needed", "(", "result", ")", ":", "\"\"\" check_output returns bytes or string depend on python version \"\"\"", "return", "result", ".", "decode", "(", "'utf-8'", ")", "if", ...
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/tools/scan-build-py/libscanbuild/__init__.py#L59-L79
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/httputil.py
python
HTTPConnection.finish
(self)
Indicates that the last body data has been written.
Indicates that the last body data has been written.
[ "Indicates", "that", "the", "last", "body", "data", "has", "been", "written", "." ]
def finish(self) -> None: """Indicates that the last body data has been written. """ raise NotImplementedError()
[ "def", "finish", "(", "self", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/httputil.py#L604-L607
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/tbb_2020.3/python/tbb/pool.py
python
Pool.apply
(self, func, args=(), kwds=dict())
return self.apply_async(func, args, kwds).get()
Equivalent of the apply() builtin function. It blocks till the result is ready.
Equivalent of the apply() builtin function. It blocks till the result is ready.
[ "Equivalent", "of", "the", "apply", "()", "builtin", "function", ".", "It", "blocks", "till", "the", "result", "is", "ready", "." ]
def apply(self, func, args=(), kwds=dict()): """Equivalent of the apply() builtin function. It blocks till the result is ready.""" return self.apply_async(func, args, kwds).get()
[ "def", "apply", "(", "self", ",", "func", ",", "args", "=", "(", ")", ",", "kwds", "=", "dict", "(", ")", ")", ":", "return", "self", ".", "apply_async", "(", "func", ",", "args", ",", "kwds", ")", ".", "get", "(", ")" ]
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/tbb_2020.3/python/tbb/pool.py#L101-L104
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
PlatformInformation.__eq__
(*args, **kwargs)
return _misc_.PlatformInformation___eq__(*args, **kwargs)
__eq__(self, PlatformInformation t) -> bool
__eq__(self, PlatformInformation t) -> bool
[ "__eq__", "(", "self", "PlatformInformation", "t", ")", "-", ">", "bool" ]
def __eq__(*args, **kwargs): """__eq__(self, PlatformInformation t) -> bool""" return _misc_.PlatformInformation___eq__(*args, **kwargs)
[ "def", "__eq__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "PlatformInformation___eq__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1053-L1055
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/image_ops.py
python
convert_image_dtype
(image, dtype, saturate=False, name=None)
Convert `image` to `dtype`, scaling its values if needed. Images that are represented using floating point values are expected to have values in the range [0,1). Image data stored in integer data types are expected to have values in the range `[0,MAX]`, where `MAX` is the largest positive representable number ...
Convert `image` to `dtype`, scaling its values if needed.
[ "Convert", "image", "to", "dtype", "scaling", "its", "values", "if", "needed", "." ]
def convert_image_dtype(image, dtype, saturate=False, name=None): """Convert `image` to `dtype`, scaling its values if needed. Images that are represented using floating point values are expected to have values in the range [0,1). Image data stored in integer data types are expected to have values in the range...
[ "def", "convert_image_dtype", "(", "image", ",", "dtype", ",", "saturate", "=", "False", ",", "name", "=", "None", ")", ":", "image", "=", "ops", ".", "convert_to_tensor", "(", "image", ",", "name", "=", "'image'", ")", "if", "dtype", "==", "image", "....
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/image_ops.py#L1048-L1123
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Node.py
python
Node.isdir
(self)
return os.path.isdir(self.abspath())
Returns whether the Node represents a folder :rtype: bool
Returns whether the Node represents a folder
[ "Returns", "whether", "the", "Node", "represents", "a", "folder" ]
def isdir(self): """ Returns whether the Node represents a folder :rtype: bool """ return os.path.isdir(self.abspath())
[ "def", "isdir", "(", "self", ")", ":", "return", "os", ".", "path", ".", "isdir", "(", "self", ".", "abspath", "(", ")", ")" ]
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Node.py#L274-L280
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/keras/python/keras/backend.py
python
softmax
(x)
return nn.softmax(x)
Softmax of a tensor. Arguments: x: A tensor or variable. Returns: A tensor.
Softmax of a tensor.
[ "Softmax", "of", "a", "tensor", "." ]
def softmax(x): """Softmax of a tensor. Arguments: x: A tensor or variable. Returns: A tensor. """ return nn.softmax(x)
[ "def", "softmax", "(", "x", ")", ":", "return", "nn", ".", "softmax", "(", "x", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L2841-L2850
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Chem/FeatMaps/FeatMapUtils.py
python
MergeFeatPoints
(fm, mergeMetric=MergeMetric.NoMerge, mergeTol=1.5, dirMergeMode=DirMergeMode.NoMerge, mergeMethod=MergeMethod.WeightedAverage, compatFunc=familiesMatch)
return res
NOTE that mergeTol is a max value for merging when using distance-based merging and a min value when using score-based merging. returns whether or not any points were actually merged
[]
def MergeFeatPoints(fm, mergeMetric=MergeMetric.NoMerge, mergeTol=1.5, dirMergeMode=DirMergeMode.NoMerge, mergeMethod=MergeMethod.WeightedAverage, compatFunc=familiesMatch): """ NOTE that mergeTol is a max value for merging when using distance-based merging and a min v...
[ "def", "MergeFeatPoints", "(", "fm", ",", "mergeMetric", "=", "MergeMetric", ".", "NoMerge", ",", "mergeTol", "=", "1.5", ",", "dirMergeMode", "=", "DirMergeMode", ".", "NoMerge", ",", "mergeMethod", "=", "MergeMethod", ".", "WeightedAverage", ",", "compatFunc",...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/FeatMaps/FeatMapUtils.py#L111-L225
qt/qt
0a2f2382541424726168804be2c90b91381608c6
src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/common.py
python
ExceptionAppend
(e, msg)
Append a message to the given exception's message.
Append a message to the given exception's message.
[ "Append", "a", "message", "to", "the", "given", "exception", "s", "message", "." ]
def ExceptionAppend(e, msg): """Append a message to the given exception's message.""" if not e.args: e.args = (msg,) elif len(e.args) == 1: e.args = (str(e.args[0]) + ' ' + msg,) else: e.args = (str(e.args[0]) + ' ' + msg,) + e.args[1:]
[ "def", "ExceptionAppend", "(", "e", ",", "msg", ")", ":", "if", "not", "e", ".", "args", ":", "e", ".", "args", "=", "(", "msg", ",", ")", "elif", "len", "(", "e", ".", "args", ")", "==", "1", ":", "e", ".", "args", "=", "(", "str", "(", ...
https://github.com/qt/qt/blob/0a2f2382541424726168804be2c90b91381608c6/src/3rdparty/webkit/Source/ThirdParty/gyp/pylib/gyp/common.py#L14-L21
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/optimize_for_inference_lib.py
python
optimize_for_inference
(input_graph_def, input_node_names, output_node_names, placeholder_type_enum, toco_compatible=False)
return optimized_graph_def
Applies a series of inference optimizations on the input graph. Args: input_graph_def: A GraphDef containing a training model. input_node_names: A list of names of the nodes that are fed inputs during inference. output_node_names: A list of names of the nodes that produce the final results. ...
Applies a series of inference optimizations on the input graph.
[ "Applies", "a", "series", "of", "inference", "optimizations", "on", "the", "input", "graph", "." ]
def optimize_for_inference(input_graph_def, input_node_names, output_node_names, placeholder_type_enum, toco_compatible=False): """Applies a series of inference optimizations on the input graph. Args: input_graph_def: A GraphDef containing a training model. input_node_names: A li...
[ "def", "optimize_for_inference", "(", "input_graph_def", ",", "input_node_names", ",", "output_node_names", ",", "placeholder_type_enum", ",", "toco_compatible", "=", "False", ")", ":", "ensure_graph_is_valid", "(", "input_graph_def", ")", "optimized_graph_def", "=", "inp...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/optimize_for_inference_lib.py#L89-L119
bayandin/chromedriver
d40a2092b50f2fca817221eeb5ea093e0e642c10
log_replay/client_replay.py
python
CommandSequence._IngestRealResponse
(self, response)
Process the actual response from the previously issued command. Ingests the given response that came from calling the last command on the running ChromeDriver replay instance. This is the step where the session and element IDs are matched between |response| and the logged response. Args: res...
Process the actual response from the previously issued command.
[ "Process", "the", "actual", "response", "from", "the", "previously", "issued", "command", "." ]
def _IngestRealResponse(self, response): """Process the actual response from the previously issued command. Ingests the given response that came from calling the last command on the running ChromeDriver replay instance. This is the step where the session and element IDs are matched between |response| a...
[ "def", "_IngestRealResponse", "(", "self", ",", "response", ")", ":", "if", "\"value\"", "in", "response", "and", "self", ".", "_staged_logged_ids", ":", "real_ids", "=", "_GetAnyElementIds", "(", "response", "[", "\"value\"", "]", ")", "if", "real_ids", "and"...
https://github.com/bayandin/chromedriver/blob/d40a2092b50f2fca817221eeb5ea093e0e642c10/log_replay/client_replay.py#L750-L777
OGRECave/ogre-next
287307980e6de8910f04f3cc0994451b075071fd
Tools/BlenderExport/ogrepkg/gui.py
python
Size.__init__
(self, preferredSize=None, minimumSize=None, maximumSize=None)
return
Constructor. A size hint is a list of integers <code>[width, height]</code>. @param preferredSize Default <code>[0,0]</code>. @param minimumSize Default <code>[0,0]</code>. @param maximumSize Default <code>[Size.INFINITY, Size.INFINITY]</code>.
Constructor. A size hint is a list of integers <code>[width, height]</code>.
[ "Constructor", ".", "A", "size", "hint", "is", "a", "list", "of", "integers", "<code", ">", "[", "width", "height", "]", "<", "/", "code", ">", "." ]
def __init__(self, preferredSize=None, minimumSize=None, maximumSize=None): """Constructor. A size hint is a list of integers <code>[width, height]</code>. @param preferredSize Default <code>[0,0]</code>. @param minimumSize Default <code>[0,0]</code>. @param maximumSize Default <code>[Size.INFINITY, Siz...
[ "def", "__init__", "(", "self", ",", "preferredSize", "=", "None", ",", "minimumSize", "=", "None", ",", "maximumSize", "=", "None", ")", ":", "self", ".", "preferredSize", "=", "preferredSize", "or", "[", "0", ",", "0", "]", "if", "minimumSize", ":", ...
https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/gui.py#L62-L82
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/reveal-cards-in-increasing-order.py
python
Solution.deckRevealedIncreasing
(self, deck)
return list(d)
:type deck: List[int] :rtype: List[int]
:type deck: List[int] :rtype: List[int]
[ ":", "type", "deck", ":", "List", "[", "int", "]", ":", "rtype", ":", "List", "[", "int", "]" ]
def deckRevealedIncreasing(self, deck): """ :type deck: List[int] :rtype: List[int] """ d = collections.deque() deck.sort(reverse=True) for i in deck: if d: d.appendleft(d.pop()) d.appendleft(i) return list(d)
[ "def", "deckRevealedIncreasing", "(", "self", ",", "deck", ")", ":", "d", "=", "collections", ".", "deque", "(", ")", "deck", ".", "sort", "(", "reverse", "=", "True", ")", "for", "i", "in", "deck", ":", "if", "d", ":", "d", ".", "appendleft", "(",...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/reveal-cards-in-increasing-order.py#L8-L19
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py
python
DescriptorPool.__init__
(self, descriptor_db=None)
Initializes a Pool of proto buffs. The descriptor_db argument to the constructor is provided to allow specialized file descriptor proto lookup code to be triggered on demand. An example would be an implementation which will read and compile a file specified in a call to FindFileByName() and not require...
Initializes a Pool of proto buffs.
[ "Initializes", "a", "Pool", "of", "proto", "buffs", "." ]
def __init__(self, descriptor_db=None): """Initializes a Pool of proto buffs. The descriptor_db argument to the constructor is provided to allow specialized file descriptor proto lookup code to be triggered on demand. An example would be an implementation which will read and compile a file specifie...
[ "def", "__init__", "(", "self", ",", "descriptor_db", "=", "None", ")", ":", "self", ".", "_internal_db", "=", "descriptor_database", ".", "DescriptorDatabase", "(", ")", "self", ".", "_descriptor_db", "=", "descriptor_db", "self", ".", "_descriptors", "=", "{...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/descriptor_pool.py#L110-L137
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/scons/getversion.py
python
_IsGitDescribeFirstParentSupported
()
return False
Checks whether --first-parent parameter is valid for the version of git available
Checks whether --first-parent parameter is valid for the version of git available
[ "Checks", "whether", "--", "first", "-", "parent", "parameter", "is", "valid", "for", "the", "version", "of", "git", "available" ]
def _IsGitDescribeFirstParentSupported(): """Checks whether --first-parent parameter is valid for the version of git available""" try: repo = _GetRepository() repo.git.describe('--first-parent') return True except git.exc.GitCommandError: pass return False
[ "def", "_IsGitDescribeFirstParentSupported", "(", ")", ":", "try", ":", "repo", "=", "_GetRepository", "(", ")", "repo", ".", "git", ".", "describe", "(", "'--first-parent'", ")", "return", "True", "except", "git", ".", "exc", ".", "GitCommandError", ":", "p...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/scons/getversion.py#L217-L228
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
third_party/Python/module/pexpect-4.6/pexpect/exceptions.py
python
ExceptionPexpect.get_trace
(self)
return ''.join(tblist)
This returns an abbreviated stack trace with lines that only concern the caller. In other words, the stack trace inside the Pexpect module is not included.
This returns an abbreviated stack trace with lines that only concern the caller. In other words, the stack trace inside the Pexpect module is not included.
[ "This", "returns", "an", "abbreviated", "stack", "trace", "with", "lines", "that", "only", "concern", "the", "caller", ".", "In", "other", "words", "the", "stack", "trace", "inside", "the", "Pexpect", "module", "is", "not", "included", "." ]
def get_trace(self): '''This returns an abbreviated stack trace with lines that only concern the caller. In other words, the stack trace inside the Pexpect module is not included. ''' tblist = traceback.extract_tb(sys.exc_info()[2]) tblist = [item for item in tblist if ('pexpect...
[ "def", "get_trace", "(", "self", ")", ":", "tblist", "=", "traceback", ".", "extract_tb", "(", "sys", ".", "exc_info", "(", ")", "[", "2", "]", ")", "tblist", "=", "[", "item", "for", "item", "in", "tblist", "if", "(", "'pexpect/__init__'", "not", "i...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/exceptions.py#L17-L26
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/gluon/trainer.py
python
Trainer._reset_kvstore
(self)
Reset kvstore.
Reset kvstore.
[ "Reset", "kvstore", "." ]
def _reset_kvstore(self): """Reset kvstore.""" if self._kvstore and 'dist' in self._kvstore.type: raise RuntimeError("Cannot reset distributed KVStore.") self._kv_initialized = False self._kvstore = None self._distributed = None self._update_on_kvstore = None ...
[ "def", "_reset_kvstore", "(", "self", ")", ":", "if", "self", ".", "_kvstore", "and", "'dist'", "in", "self", ".", "_kvstore", ".", "type", ":", "raise", "RuntimeError", "(", "\"Cannot reset distributed KVStore.\"", ")", "self", ".", "_kv_initialized", "=", "F...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/trainer.py#L159-L167
BDLDev/bdlauncher
d10fb098852ebcf9fb71afb23052a463ee7b5d0a
scripts/cppheaderparser.py
python
Resolver.resolve_type
( self, string, result )
keeps track of useful things like: how many pointers, number of typedefs, is fundamental or a class, etc...
keeps track of useful things like: how many pointers, number of typedefs, is fundamental or a class, etc...
[ "keeps", "track", "of", "useful", "things", "like", ":", "how", "many", "pointers", "number", "of", "typedefs", "is", "fundamental", "or", "a", "class", "etc", "..." ]
def resolve_type( self, string, result ): # recursive ''' keeps track of useful things like: how many pointers, number of typedefs, is fundamental or a class, etc... ''' ## be careful with templates, what is inside <something*> can be a pointer but the overall type is not a pointer ...
[ "def", "resolve_type", "(", "self", ",", "string", ",", "result", ")", ":", "# recursive", "## be careful with templates, what is inside <something*> can be a pointer but the overall type is not a pointer", "## these come before a template", "s", "=", "string", ".", "split", "(",...
https://github.com/BDLDev/bdlauncher/blob/d10fb098852ebcf9fb71afb23052a463ee7b5d0a/scripts/cppheaderparser.py#L1280-L1323
PaddlePaddle/PaddleOCR
b756bf5f8c90142e0d89d3db0163965c686b6ffe
tools/infer/utility.py
python
get_rotate_crop_image
(img, points)
return dst_img
img_height, img_width = img.shape[0:2] left = int(np.min(points[:, 0])) right = int(np.max(points[:, 0])) top = int(np.min(points[:, 1])) bottom = int(np.max(points[:, 1])) img_crop = img[top:bottom, left:right, :].copy() points[:, 0] = points[:, 0] - left points[:, 1] = points[:, 1] - top
img_height, img_width = img.shape[0:2] left = int(np.min(points[:, 0])) right = int(np.max(points[:, 0])) top = int(np.min(points[:, 1])) bottom = int(np.max(points[:, 1])) img_crop = img[top:bottom, left:right, :].copy() points[:, 0] = points[:, 0] - left points[:, 1] = points[:, 1] - top
[ "img_height", "img_width", "=", "img", ".", "shape", "[", "0", ":", "2", "]", "left", "=", "int", "(", "np", ".", "min", "(", "points", "[", ":", "0", "]", "))", "right", "=", "int", "(", "np", ".", "max", "(", "points", "[", ":", "0", "]", ...
def get_rotate_crop_image(img, points): ''' img_height, img_width = img.shape[0:2] left = int(np.min(points[:, 0])) right = int(np.max(points[:, 0])) top = int(np.min(points[:, 1])) bottom = int(np.max(points[:, 1])) img_crop = img[top:bottom, left:right, :].copy() points[:, 0] = points[...
[ "def", "get_rotate_crop_image", "(", "img", ",", "points", ")", ":", "assert", "len", "(", "points", ")", "==", "4", ",", "\"shape of points must be 4*2\"", "img_crop_width", "=", "int", "(", "max", "(", "np", ".", "linalg", ".", "norm", "(", "points", "["...
https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/tools/infer/utility.py#L581-L613
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/style/filereader.py
python
TextFileReader.process_file
(self, file_path, **kwargs)
Process the given file by calling the processor's process() method. Args: file_path: The path of the file to process. **kwargs: Any additional keyword parameters that should be passed to the processor's process() method. The process() method should s...
Process the given file by calling the processor's process() method.
[ "Process", "the", "given", "file", "by", "calling", "the", "processor", "s", "process", "()", "method", "." ]
def process_file(self, file_path, **kwargs): """Process the given file by calling the processor's process() method. Args: file_path: The path of the file to process. **kwargs: Any additional keyword parameters that should be passed to the processor's process() me...
[ "def", "process_file", "(", "self", ",", "file_path", ",", "*", "*", "kwargs", ")", ":", "self", ".", "file_count", "+=", "1", "if", "not", "self", ".", "filesystem", ".", "exists", "(", "file_path", ")", "and", "file_path", "!=", "\"-\"", ":", "_log",...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/filereader.py#L93-L124
xiaohaoChen/rrc_detection
4f2b110cd122da7f55e8533275a9b4809a88785a
scripts/cpp_lint.py
python
_CppLintState.SetFilters
(self, filters)
Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Raises: ValueError: The comma-sepa...
Sets the error-message filters.
[ "Sets", "the", "error", "-", "message", "filters", "." ]
def SetFilters(self, filters): """Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die. Ra...
[ "def", "SetFilters", "(", "self", ",", "filters", ")", ":", "# Default filters always have less priority than the flag ones.", "self", ".", "filters", "=", "_DEFAULT_FILTERS", "[", ":", "]", "for", "filt", "in", "filters", ".", "split", "(", "','", ")", ":", "cl...
https://github.com/xiaohaoChen/rrc_detection/blob/4f2b110cd122da7f55e8533275a9b4809a88785a/scripts/cpp_lint.py#L717-L740
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/database.py
python
DependencyGraph.add_missing
(self, distribution, requirement)
Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str``
Add a missing *requirement* for the given *distribution*.
[ "Add", "a", "missing", "*", "requirement", "*", "for", "the", "given", "*", "distribution", "*", "." ]
def add_missing(self, distribution, requirement): """ Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str...
[ "def", "add_missing", "(", "self", ",", "distribution", ",", "requirement", ")", ":", "logger", ".", "debug", "(", "'%s missing %r'", ",", "distribution", ",", "requirement", ")", "self", ".", "missing", ".", "setdefault", "(", "distribution", ",", "[", "]",...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L1091-L1100
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
bindings/python/llvm/object.py
python
Section.cache
(self)
Cache properties of this Section. This can be called as a workaround to the single active Section limitation. When called, the properties of the Section are fetched so they are still available after the Section has been marked inactive.
Cache properties of this Section.
[ "Cache", "properties", "of", "this", "Section", "." ]
def cache(self): """Cache properties of this Section. This can be called as a workaround to the single active Section limitation. When called, the properties of the Section are fetched so they are still available after the Section has been marked inactive. """ getattr(se...
[ "def", "cache", "(", "self", ")", ":", "getattr", "(", "self", ",", "'name'", ")", "getattr", "(", "self", ",", "'size'", ")", "getattr", "(", "self", ",", "'contents'", ")", "getattr", "(", "self", ",", "'address'", ")" ]
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/bindings/python/llvm/object.py#L271-L281
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
RobotModelLink.setTransform
(self, R, t)
return _robotsim.RobotModelLink_setTransform(self, R, t)
setTransform(RobotModelLink self, double const [9] R, double const [3] t) Sets the link's current transformation (R,t) to the world frame. Note: This does NOT perform inverse kinematics. The transform is overwritten when the robot's setConfig() method is called.
setTransform(RobotModelLink self, double const [9] R, double const [3] t)
[ "setTransform", "(", "RobotModelLink", "self", "double", "const", "[", "9", "]", "R", "double", "const", "[", "3", "]", "t", ")" ]
def setTransform(self, R, t): """ setTransform(RobotModelLink self, double const [9] R, double const [3] t) Sets the link's current transformation (R,t) to the world frame. Note: This does NOT perform inverse kinematics. The transform is overwritten when...
[ "def", "setTransform", "(", "self", ",", "R", ",", "t", ")", ":", "return", "_robotsim", ".", "RobotModelLink_setTransform", "(", "self", ",", "R", ",", "t", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L3993-L4007
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
grc/core/platform.py
python
Platform._iter_files_in_block_path
(self, path=None, ext='yml')
Iterator for block descriptions and category trees
Iterator for block descriptions and category trees
[ "Iterator", "for", "block", "descriptions", "and", "category", "trees" ]
def _iter_files_in_block_path(self, path=None, ext='yml'): """Iterator for block descriptions and category trees""" for entry in (path or self.config.block_paths): if os.path.isfile(entry): yield entry elif os.path.isdir(entry): for dirpath, dirnam...
[ "def", "_iter_files_in_block_path", "(", "self", ",", "path", "=", "None", ",", "ext", "=", "'yml'", ")", ":", "for", "entry", "in", "(", "path", "or", "self", ".", "config", ".", "block_paths", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", ...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/platform.py#L194-L204
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/message.py
python
_WireReader._get_section
(self, section, count)
Read the next I{count} records from the wire data and add them to the specified section. @param section: the section of the message to which to add records @type section: list of dns.rrset.RRset objects @param count: the number of records to read @type count: int
Read the next I{count} records from the wire data and add them to the specified section.
[ "Read", "the", "next", "I", "{", "count", "}", "records", "from", "the", "wire", "data", "and", "add", "them", "to", "the", "specified", "section", "." ]
def _get_section(self, section, count): """Read the next I{count} records from the wire data and add them to the specified section. @param section: the section of the message to which to add records @type section: list of dns.rrset.RRset objects @param count: the number of record...
[ "def", "_get_section", "(", "self", ",", "section", ",", "count", ")", ":", "if", "self", ".", "updating", "or", "self", ".", "one_rr_per_rrset", ":", "force_unique", "=", "True", "else", ":", "force_unique", "=", "False", "seen_opt", "=", "False", "for", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/message.py#L608-L700
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/api_data_source.py
python
_JSCModel._GetIntroAvailabilityRow
(self)
return { 'title': 'Availability', 'content': [{ 'partial': self._template_cache.GetFromFile( posixpath.join(PRIVATE_TEMPLATES, 'intro_tables', '%s_message.html' % status)).Get(), 'version': version }] }
Generates the 'Availability' row data for an API intro table.
Generates the 'Availability' row data for an API intro table.
[ "Generates", "the", "Availability", "row", "data", "for", "an", "API", "intro", "table", "." ]
def _GetIntroAvailabilityRow(self): ''' Generates the 'Availability' row data for an API intro table. ''' if self._IsExperimental(): status = 'experimental' version = None else: availability = self._GetApiAvailability() status = availability.channel version = availability.v...
[ "def", "_GetIntroAvailabilityRow", "(", "self", ")", ":", "if", "self", ".", "_IsExperimental", "(", ")", ":", "status", "=", "'experimental'", "version", "=", "None", "else", ":", "availability", "=", "self", ".", "_GetApiAvailability", "(", ")", "status", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/api_data_source.py#L364-L383
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/android/vectorgraphics/gen_mozc_drawable.py
python
MozcDrawableConverter._ParseStyle
(self, node, has_shadow, shader_map)
return result
Parses style attribute of the given node.
Parses style attribute of the given node.
[ "Parses", "style", "attribute", "of", "the", "given", "node", "." ]
def _ParseStyle(self, node, has_shadow, shader_map): """Parses style attribute of the given node.""" common_map = {} # Default fill color is black (SVG's spec) fill_map = {'style': 'fill', 'color': 0xFF000000, 'shadow': has_shadow} # Default stroke color is none (SVG's spec) stroke_map = {'style...
[ "def", "_ParseStyle", "(", "self", ",", "node", ",", "has_shadow", ",", "shader_map", ")", ":", "common_map", "=", "{", "}", "# Default fill color is black (SVG's spec)", "fill_map", "=", "{", "'style'", ":", "'fill'", ",", "'color'", ":", "0xFF000000", ",", "...
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/android/vectorgraphics/gen_mozc_drawable.py#L347-L417
blackberry/Boost
fc90c3fde129c62565c023f091eddc4a7ed9902b
tools/build/v2/build/targets.py
python
generate_from_reference
(target_reference, project, property_set)
return target.generate(rproperties)
Attempts to generate the target given by target reference, which can refer both to a main target or to a file. Returns a list consisting of - usage requirements - generated virtual targets, if any target_reference: Target reference project: Project where the reference is made prop...
Attempts to generate the target given by target reference, which can refer both to a main target or to a file. Returns a list consisting of - usage requirements - generated virtual targets, if any target_reference: Target reference project: Project where the reference is made prop...
[ "Attempts", "to", "generate", "the", "target", "given", "by", "target", "reference", "which", "can", "refer", "both", "to", "a", "main", "target", "or", "to", "a", "file", ".", "Returns", "a", "list", "consisting", "of", "-", "usage", "requirements", "-", ...
def generate_from_reference(target_reference, project, property_set): """ Attempts to generate the target given by target reference, which can refer both to a main target or to a file. Returns a list consisting of - usage requirements - generated virtual targets, if any target_reference: Target...
[ "def", "generate_from_reference", "(", "target_reference", ",", "project", ",", "property_set", ")", ":", "target", ",", "sproperties", "=", "resolve_reference", "(", "target_reference", ",", "project", ")", "# Take properties which should be propagated and refine them", "#...
https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/targets.py#L802-L819
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/strings.py
python
_map_stringarray
( func: Callable[[str], Any], arr: "StringArray", na_value: Any, dtype: Dtype )
Map a callable over valid elements of a StringArrray. Parameters ---------- func : Callable[[str], Any] Apply to each valid element. arr : StringArray na_value : Any The value to use for missing values. By default, this is the original value (NA). dtype : Dtype T...
Map a callable over valid elements of a StringArrray.
[ "Map", "a", "callable", "over", "valid", "elements", "of", "a", "StringArrray", "." ]
def _map_stringarray( func: Callable[[str], Any], arr: "StringArray", na_value: Any, dtype: Dtype ) -> ArrayLike: """ Map a callable over valid elements of a StringArrray. Parameters ---------- func : Callable[[str], Any] Apply to each valid element. arr : StringArray na_value :...
[ "def", "_map_stringarray", "(", "func", ":", "Callable", "[", "[", "str", "]", ",", "Any", "]", ",", "arr", ":", "\"StringArray\"", ",", "na_value", ":", "Any", ",", "dtype", ":", "Dtype", ")", "->", "ArrayLike", ":", "from", "pandas", ".", "arrays", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/strings.py#L134-L201
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus3.in.py
python
exodus.get_element_property_value
(self, object_id, name)
return int(propVal)
get element property value (an integer) for a specified element block and element property name >>> eprop_val = exo.get_element_property_value(elem_blk_id, eprop_name) Parameters ---------- elem_blk_id : int element block *ID* (not *INDEX*) <string> epr...
get element property value (an integer) for a specified element block and element property name
[ "get", "element", "property", "value", "(", "an", "integer", ")", "for", "a", "specified", "element", "block", "and", "element", "property", "name" ]
def get_element_property_value(self, object_id, name): """ get element property value (an integer) for a specified element block and element property name >>> eprop_val = exo.get_element_property_value(elem_blk_id, eprop_name) Parameters ---------- elem_blk_id :...
[ "def", "get_element_property_value", "(", "self", ",", "object_id", ",", "name", ")", ":", "propVal", "=", "self", ".", "__ex_get_prop", "(", "'EX_ELEM_BLOCK'", ",", "object_id", ",", "name", ")", "return", "int", "(", "propVal", ")" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L3088-L3106
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/engine/cell.py
python
Cell.minimum_distance
(self, atom1, atom2)
return np.dot(self.h, s)
Takes two atoms and tries to find the smallest vector between two images. This is only rigorously accurate in the case of a cubic cell, but gives the correct results as long as the cut-off radius is defined as smaller than the smallest width between parallel faces even for triclinic cells...
Takes two atoms and tries to find the smallest vector between two images.
[ "Takes", "two", "atoms", "and", "tries", "to", "find", "the", "smallest", "vector", "between", "two", "images", "." ]
def minimum_distance(self, atom1, atom2): """Takes two atoms and tries to find the smallest vector between two images. This is only rigorously accurate in the case of a cubic cell, but gives the correct results as long as the cut-off radius is defined as smaller than the smallest width be...
[ "def", "minimum_distance", "(", "self", ",", "atom1", ",", "atom2", ")", ":", "s", "=", "np", ".", "dot", "(", "self", ".", "ih", ",", "atom1", ".", "q", "-", "atom2", ".", "q", ")", "for", "i", "in", "range", "(", "3", ")", ":", "s", "[", ...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/cell.py#L119-L140
fifengine/fifengine
4b62c42e85bec19893cef8e63e6855927cff2c47
engine/python/fife/extensions/pychan/internal.py
python
Manager.createFont
(self, path="", size=0, glyphs="")
return self.hook.create_font(path,size,glyphs)
Creates and returns a GuiFont from the GUI Manager
Creates and returns a GuiFont from the GUI Manager
[ "Creates", "and", "returns", "a", "GuiFont", "from", "the", "GUI", "Manager" ]
def createFont(self, path="", size=0, glyphs=""): """ Creates and returns a GuiFont from the GUI Manager """ return self.hook.create_font(path,size,glyphs)
[ "def", "createFont", "(", "self", ",", "path", "=", "\"\"", ",", "size", "=", "0", ",", "glyphs", "=", "\"\"", ")", ":", "return", "self", ".", "hook", ".", "create_font", "(", "path", ",", "size", ",", "glyphs", ")" ]
https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/internal.py#L172-L176
hcdth011/ROS-Hydro-SLAM
629448eecd2c9a3511158115fa53ea9e4ae41359
rpg_vikit/vikit_py/src/vikit_py/transformations.py
python
quaternion_from_matrix
(matrix)
return q
Return quaternion from rotation matrix. >>> R = rotation_matrix(0.123, (1, 2, 3)) >>> q = quaternion_from_matrix(R) >>> numpy.allclose(q, [0.0164262, 0.0328524, 0.0492786, 0.9981095]) True
Return quaternion from rotation matrix.
[ "Return", "quaternion", "from", "rotation", "matrix", "." ]
def quaternion_from_matrix(matrix): """Return quaternion from rotation matrix. >>> R = rotation_matrix(0.123, (1, 2, 3)) >>> q = quaternion_from_matrix(R) >>> numpy.allclose(q, [0.0164262, 0.0328524, 0.0492786, 0.9981095]) True """ q = numpy.empty((4, ), dtype=numpy.float64) M = numpy....
[ "def", "quaternion_from_matrix", "(", "matrix", ")", ":", "q", "=", "numpy", ".", "empty", "(", "(", "4", ",", ")", ",", "dtype", "=", "numpy", ".", "float64", ")", "M", "=", "numpy", ".", "array", "(", "matrix", ",", "dtype", "=", "numpy", ".", ...
https://github.com/hcdth011/ROS-Hydro-SLAM/blob/629448eecd2c9a3511158115fa53ea9e4ae41359/rpg_vikit/vikit_py/src/vikit_py/transformations.py#L1200-L1229
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/numpy/_symbol.py
python
log
(x, out=None, **kwargs)
return _unary_func_helper(x, _npi.log, _np.log, out=out, **kwargs)
Natural logarithm, element-wise. The natural logarithm `log` is the inverse of the exponential function, so that `log(exp(x)) = x`. The natural logarithm is logarithm in base `e`. Parameters ---------- x : _Symbol Input value. Elements must be of real value. out : _Symbol or None, o...
Natural logarithm, element-wise. The natural logarithm `log` is the inverse of the exponential function, so that `log(exp(x)) = x`. The natural logarithm is logarithm in base `e`.
[ "Natural", "logarithm", "element", "-", "wise", ".", "The", "natural", "logarithm", "log", "is", "the", "inverse", "of", "the", "exponential", "function", "so", "that", "log", "(", "exp", "(", "x", "))", "=", "x", ".", "The", "natural", "logarithm", "is"...
def log(x, out=None, **kwargs): """ Natural logarithm, element-wise. The natural logarithm `log` is the inverse of the exponential function, so that `log(exp(x)) = x`. The natural logarithm is logarithm in base `e`. Parameters ---------- x : _Symbol Input value. Elements must be...
[ "def", "log", "(", "x", ",", "out", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "_unary_func_helper", "(", "x", ",", "_npi", ".", "log", ",", "_np", ".", "log", ",", "out", "=", "out", ",", "*", "*", "kwargs", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L3096-L3129
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/input_lib.py
python
_get_next_as_optional
(iterator, strategy, name=None)
return global_has_value, replicas
Returns an empty dataset indicator and the next input from the iterator.
Returns an empty dataset indicator and the next input from the iterator.
[ "Returns", "an", "empty", "dataset", "indicator", "and", "the", "next", "input", "from", "the", "iterator", "." ]
def _get_next_as_optional(iterator, strategy, name=None): """Returns an empty dataset indicator and the next input from the iterator.""" replicas = [] worker_has_values = [] worker_devices = [] for i, worker in enumerate(iterator._input_workers.worker_devices): # pylint: disable=protected-access if name ...
[ "def", "_get_next_as_optional", "(", "iterator", ",", "strategy", ",", "name", "=", "None", ")", ":", "replicas", "=", "[", "]", "worker_has_values", "=", "[", "]", "worker_devices", "=", "[", "]", "for", "i", ",", "worker", "in", "enumerate", "(", "iter...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/input_lib.py#L186-L227
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/xrc.py
python
XmlDocument.GetVersion
(*args, **kwargs)
return _xrc.XmlDocument_GetVersion(*args, **kwargs)
GetVersion(self) -> String
GetVersion(self) -> String
[ "GetVersion", "(", "self", ")", "-", ">", "String" ]
def GetVersion(*args, **kwargs): """GetVersion(self) -> String""" return _xrc.XmlDocument_GetVersion(*args, **kwargs)
[ "def", "GetVersion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_xrc", ".", "XmlDocument_GetVersion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L539-L541
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Rect2D.IsEmpty
(*args, **kwargs)
return _core_.Rect2D_IsEmpty(*args, **kwargs)
IsEmpty(self) -> bool
IsEmpty(self) -> bool
[ "IsEmpty", "(", "self", ")", "-", ">", "bool" ]
def IsEmpty(*args, **kwargs): """IsEmpty(self) -> bool""" return _core_.Rect2D_IsEmpty(*args, **kwargs)
[ "def", "IsEmpty", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_IsEmpty", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L1975-L1977
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
clang/tools/scan-build-py/libscanbuild/report.py
python
assemble_cover
(args, prefix, fragments)
Put together the fragments into a final report.
Put together the fragments into a final report.
[ "Put", "together", "the", "fragments", "into", "a", "final", "report", "." ]
def assemble_cover(args, prefix, fragments): """ Put together the fragments into a final report. """ import getpass import socket if args.html_title is None: args.html_title = os.path.basename(prefix) + ' - analyzer results' with open(os.path.join(args.output, 'index.html'), 'w') as handl...
[ "def", "assemble_cover", "(", "args", ",", "prefix", ",", "fragments", ")", ":", "import", "getpass", "import", "socket", "if", "args", ".", "html_title", "is", "None", ":", "args", ".", "html_title", "=", "os", ".", "path", ".", "basename", "(", "prefix...
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/tools/scan-build-py/libscanbuild/report.py#L63-L107
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/frontend/mxnet.py
python
_convert_symbol
(op_name, inputs, attrs, identity_list=None, convert_map=None)
return sym
Convert from mxnet op to nnvm op. The converter must specify some conversions explicitly to support gluon format ops such as conv2d... Parameters ---------- op_name : str Operator name, such as Convolution, FullyConnected inputs : list of nnvm.Symbol List of input symbols. a...
Convert from mxnet op to nnvm op. The converter must specify some conversions explicitly to support gluon format ops such as conv2d...
[ "Convert", "from", "mxnet", "op", "to", "nnvm", "op", ".", "The", "converter", "must", "specify", "some", "conversions", "explicitly", "to", "support", "gluon", "format", "ops", "such", "as", "conv2d", "..." ]
def _convert_symbol(op_name, inputs, attrs, identity_list=None, convert_map=None): """Convert from mxnet op to nnvm op. The converter must specify some conversions explicitly to support gluon format ops such as conv2d... Parameters ---------- op_name : st...
[ "def", "_convert_symbol", "(", "op_name", ",", "inputs", ",", "attrs", ",", "identity_list", "=", "None", ",", "convert_map", "=", "None", ")", ":", "identity_list", "=", "identity_list", "if", "identity_list", "else", "_identity_list", "convert_map", "=", "conv...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/frontend/mxnet.py#L260-L296
fifengine/fifengine
4b62c42e85bec19893cef8e63e6855927cff2c47
engine/python/fife/extensions/pychan/dialog/filebrowser.py
python
FileBrowser.setDirectory
(self, path)
sets the current directory according to path
sets the current directory according to path
[ "sets", "the", "current", "directory", "according", "to", "path" ]
def setDirectory(self, path): """ sets the current directory according to path """ path_copy = self.path self.path = path if not self._widget: return def decodeList(list): fs_encoding = sys.getfilesystemencoding() if fs_encoding is None: fs_encoding = "ascii" newList = [] for i in list: try:...
[ "def", "setDirectory", "(", "self", ",", "path", ")", ":", "path_copy", "=", "self", ".", "path", "self", ".", "path", "=", "path", "if", "not", "self", ".", "_widget", ":", "return", "def", "decodeList", "(", "list", ")", ":", "fs_encoding", "=", "s...
https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/pychan/dialog/filebrowser.py#L117-L165
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py
python
_AddSlots
(message_descriptor, dictionary)
Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type. Args: message_descriptor: A Descriptor instance describing this message type. dictionary: Class dictionary to which we'll add a '__slots__' entry.
Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type.
[ "Adds", "a", "__slots__", "entry", "to", "dictionary", "containing", "the", "names", "of", "all", "valid", "attributes", "for", "this", "message", "type", "." ]
def _AddSlots(message_descriptor, dictionary): """Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type. Args: message_descriptor: A Descriptor instance describing this message type. dictionary: Class dictionary to which we'll add a '__slots__' entry. ...
[ "def", "_AddSlots", "(", "message_descriptor", ",", "dictionary", ")", ":", "dictionary", "[", "'__slots__'", "]", "=", "[", "'_cached_byte_size'", ",", "'_cached_byte_size_dirty'", ",", "'_fields'", ",", "'_is_present_in_parent'", ",", "'_listener'", ",", "'_listener...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py#L155-L169
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/finddlg.py
python
FindReplaceDlgBase.SetFindDirectory
(self, path)
Set the directory selection for find in files @param path: path to set for lookin data
Set the directory selection for find in files @param path: path to set for lookin data
[ "Set", "the", "directory", "selection", "for", "find", "in", "files", "@param", "path", ":", "path", "to", "set", "for", "lookin", "data" ]
def SetFindDirectory(self, path): """Set the directory selection for find in files @param path: path to set for lookin data """ self._panel.SetLookinSelection(path)
[ "def", "SetFindDirectory", "(", "self", ",", "path", ")", ":", "self", ".", "_panel", ".", "SetLookinSelection", "(", "path", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/finddlg.py#L560-L565
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/internal/well_known_types.py
python
_FieldMaskTree.MergeMessage
( self, source, destination, replace_message, replace_repeated)
Merge all fields specified by this tree from source to destination.
Merge all fields specified by this tree from source to destination.
[ "Merge", "all", "fields", "specified", "by", "this", "tree", "from", "source", "to", "destination", "." ]
def MergeMessage( self, source, destination, replace_message, replace_repeated): """Merge all fields specified by this tree from source to destination.""" _MergeMessage( self._root, source, destination, replace_message, replace_repeated)
[ "def", "MergeMessage", "(", "self", ",", "source", ",", "destination", ",", "replace_message", ",", "replace_repeated", ")", ":", "_MergeMessage", "(", "self", ".", "_root", ",", "source", ",", "destination", ",", "replace_message", ",", "replace_repeated", ")" ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L554-L559
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/dataview.py
python
DataViewColumn.__init__
(self, *args, **kwargs)
__init__(self, PyObject title_or_bitmap, DataViewRenderer renderer, unsigned int model_column, int width=80, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
__init__(self, PyObject title_or_bitmap, DataViewRenderer renderer, unsigned int model_column, int width=80, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
[ "__init__", "(", "self", "PyObject", "title_or_bitmap", "DataViewRenderer", "renderer", "unsigned", "int", "model_column", "int", "width", "=", "80", "int", "align", "=", "ALIGN_CENTER", "int", "flags", "=", "DATAVIEW_COL_RESIZABLE", ")", "-", ">", "DataViewColumn" ...
def __init__(self, *args, **kwargs): """ __init__(self, PyObject title_or_bitmap, DataViewRenderer renderer, unsigned int model_column, int width=80, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn """ _dataview.DataViewColumn_swigin...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_dataview", ".", "DataViewColumn_swiginit", "(", "self", ",", "_dataview", ".", "new_DataViewColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L1523-L1529
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/csv.py
python
Sniffer._guess_delimiter
(self, data, delimiters)
return (delim, skipinitialspace)
The delimiter /should/ occur the same number of times on each row. However, due to malformed data, it may not. We don't want an all or nothing approach, so we allow for small variations in this number. 1) build a table of the frequency of each character on every line. 2) buil...
The delimiter /should/ occur the same number of times on each row. However, due to malformed data, it may not. We don't want an all or nothing approach, so we allow for small variations in this number. 1) build a table of the frequency of each character on every line. 2) buil...
[ "The", "delimiter", "/", "should", "/", "occur", "the", "same", "number", "of", "times", "on", "each", "row", ".", "However", "due", "to", "malformed", "data", "it", "may", "not", ".", "We", "don", "t", "want", "an", "all", "or", "nothing", "approach",...
def _guess_delimiter(self, data, delimiters): """ The delimiter /should/ occur the same number of times on each row. However, due to malformed data, it may not. We don't want an all or nothing approach, so we allow for small variations in this number. 1) build a table o...
[ "def", "_guess_delimiter", "(", "self", ",", "data", ",", "delimiters", ")", ":", "data", "=", "list", "(", "filter", "(", "None", ",", "data", ".", "split", "(", "'\\n'", ")", ")", ")", "ascii", "=", "[", "chr", "(", "c", ")", "for", "c", "in", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/csv.py#L281-L381
leela-zero/leela-zero
e3ed6310d33d75078ba74c3adf887d18439fc2e3
training/tf/chunkparser.py
python
ChunkParser.convert_v2_to_tuple
(self, content)
return (planes, probs, winner)
Convert v2 binary training data to packed tensors v2 struct format is int32 ver float probs[19*18+1] byte planes[19*19*16/8] byte to_move byte winner packed tensor formats are float32 winner ...
Convert v2 binary training data to packed tensors
[ "Convert", "v2", "binary", "training", "data", "to", "packed", "tensors" ]
def convert_v2_to_tuple(self, content): """ Convert v2 binary training data to packed tensors v2 struct format is int32 ver float probs[19*18+1] byte planes[19*19*16/8] byte to_move byte winner ...
[ "def", "convert_v2_to_tuple", "(", "self", ",", "content", ")", ":", "(", "ver", ",", "probs", ",", "planes", ",", "to_move", ",", "winner", ")", "=", "self", ".", "v2_struct", ".", "unpack", "(", "content", ")", "# Unpack planes.", "planes", "=", "np", ...
https://github.com/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/training/tf/chunkparser.py#L251-L282
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pipes.py
python
Template.clone
(self)
return t
t.clone() returns a new pipeline template with identical initial state as the current one.
t.clone() returns a new pipeline template with identical initial state as the current one.
[ "t", ".", "clone", "()", "returns", "a", "new", "pipeline", "template", "with", "identical", "initial", "state", "as", "the", "current", "one", "." ]
def clone(self): """t.clone() returns a new pipeline template with identical initial state as the current one.""" t = Template() t.steps = self.steps[:] t.debugging = self.debugging return t
[ "def", "clone", "(", "self", ")", ":", "t", "=", "Template", "(", ")", "t", ".", "steps", "=", "self", ".", "steps", "[", ":", "]", "t", ".", "debugging", "=", "self", ".", "debugging", "return", "t" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pipes.py#L98-L104
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
DC.Blit
(*args, **kwargs)
return _gdi_.DC_Blit(*args, **kwargs)
Blit(self, int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc, int rop=COPY, bool useMask=False, int xsrcMask=-1, int ysrcMask=-1) -> bool Copy from a source DC to this DC. Parameters specify the destination coordinates, size of area to copy, source DC...
Blit(self, int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc, int rop=COPY, bool useMask=False, int xsrcMask=-1, int ysrcMask=-1) -> bool
[ "Blit", "(", "self", "int", "xdest", "int", "ydest", "int", "width", "int", "height", "DC", "source", "int", "xsrc", "int", "ysrc", "int", "rop", "=", "COPY", "bool", "useMask", "=", "False", "int", "xsrcMask", "=", "-", "1", "int", "ysrcMask", "=", ...
def Blit(*args, **kwargs): """ Blit(self, int xdest, int ydest, int width, int height, DC source, int xsrc, int ysrc, int rop=COPY, bool useMask=False, int xsrcMask=-1, int ysrcMask=-1) -> bool Copy from a source DC to this DC. Parameters specify the destination ...
[ "def", "Blit", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_Blit", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L3779-L3790
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sframe.py
python
SFrame.__init__
(self, data=None, format='auto', _proxy=None)
__init__(data=list(), format='auto') Construct a new SFrame from a url or a pandas.DataFrame.
__init__(data=list(), format='auto') Construct a new SFrame from a url or a pandas.DataFrame.
[ "__init__", "(", "data", "=", "list", "()", "format", "=", "auto", ")", "Construct", "a", "new", "SFrame", "from", "a", "url", "or", "a", "pandas", ".", "DataFrame", "." ]
def __init__(self, data=None, format='auto', _proxy=None): """__init__(data=list(), format='auto') Construct a new SFrame from a url or a pandas.DataFrame. """ # emit metrics for num_rows, num_columns, and type (local://, s3, hdfs, http) SFrame._...
[ "def", "__init__", "(", "self", ",", "data", "=", "None", ",", "format", "=", "'auto'", ",", "_proxy", "=", "None", ")", ":", "# emit metrics for num_rows, num_columns, and type (local://, s3, hdfs, http)", "SFrame", ".", "__construct_ctr", "+=", "1", "if", "SFrame"...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sframe.py#L852-L957
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
FileType_ExpandCommand
(*args, **kwargs)
return _misc_.FileType_ExpandCommand(*args, **kwargs)
FileType_ExpandCommand(String command, String filename, String mimetype=EmptyString) -> String
FileType_ExpandCommand(String command, String filename, String mimetype=EmptyString) -> String
[ "FileType_ExpandCommand", "(", "String", "command", "String", "filename", "String", "mimetype", "=", "EmptyString", ")", "-", ">", "String" ]
def FileType_ExpandCommand(*args, **kwargs): """FileType_ExpandCommand(String command, String filename, String mimetype=EmptyString) -> String""" return _misc_.FileType_ExpandCommand(*args, **kwargs)
[ "def", "FileType_ExpandCommand", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileType_ExpandCommand", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2645-L2647
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
Gauge.IsVertical
(*args, **kwargs)
return _controls_.Gauge_IsVertical(*args, **kwargs)
IsVertical(self) -> bool
IsVertical(self) -> bool
[ "IsVertical", "(", "self", ")", "-", ">", "bool" ]
def IsVertical(*args, **kwargs): """IsVertical(self) -> bool""" return _controls_.Gauge_IsVertical(*args, **kwargs)
[ "def", "IsVertical", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Gauge_IsVertical", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L767-L769
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/dataclasses.py
python
field
(*, default=MISSING, default_factory=MISSING, init=True, repr=True, hash=None, compare=True, metadata=None)
return Field(default, default_factory, init, repr, hash, compare, metadata)
Return an object to identify dataclass fields. default is the default value of the field. default_factory is a 0-argument function called to initialize a field's value. If init is True, the field will be a parameter to the class's __init__() function. If repr is True, the field will be included in t...
Return an object to identify dataclass fields.
[ "Return", "an", "object", "to", "identify", "dataclass", "fields", "." ]
def field(*, default=MISSING, default_factory=MISSING, init=True, repr=True, hash=None, compare=True, metadata=None): """Return an object to identify dataclass fields. default is the default value of the field. default_factory is a 0-argument function called to initialize a field's value. If in...
[ "def", "field", "(", "*", ",", "default", "=", "MISSING", ",", "default_factory", "=", "MISSING", ",", "init", "=", "True", ",", "repr", "=", "True", ",", "hash", "=", "None", ",", "compare", "=", "True", ",", "metadata", "=", "None", ")", ":", "if...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/dataclasses.py#L309-L328
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/all_reduce/python/all_reduce.py
python
_padded_split
(tensor, pieces)
Like split for 1D tensors but pads-out case where len % pieces != 0. Args: tensor: T @{tf.Tensor} that must be 1D. pieces: a positive integer specifying the number of pieces into which tensor should be split. Returns: list of T @{tf.Tensor} of length pieces, which hold the values of thin i...
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: T @{tf.Tensor} that must be 1D. pieces: a positive integer specifying the number of pieces into which tensor should be split. Returns: list of T @{tf.Tensor} of length piece...
[ "def", "_padded_split", "(", "tensor", ",", "pieces", ")", ":", "shape", "=", "tensor", ".", "shape", "if", "1", "!=", "len", "(", "shape", ")", ":", "raise", "ValueError", "(", "\"input tensor must be 1D\"", ")", "tensor_len", "=", "shape", "[", "0", "]...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/all_reduce/python/all_reduce.py#L78-L128
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/model_selection/_search.py
python
_CVScoreTuple.__repr__
(self)
return "mean: {0:.5f}, std: {1:.5f}, params: {2}".format( self.mean_validation_score, np.std(self.cv_validation_scores), self.parameters)
Simple custom repr to summarize the main info
Simple custom repr to summarize the main info
[ "Simple", "custom", "repr", "to", "summarize", "the", "main", "info" ]
def __repr__(self): """Simple custom repr to summarize the main info""" return "mean: {0:.5f}, std: {1:.5f}, params: {2}".format( self.mean_validation_score, np.std(self.cv_validation_scores), self.parameters)
[ "def", "__repr__", "(", "self", ")", ":", "return", "\"mean: {0:.5f}, std: {1:.5f}, params: {2}\"", ".", "format", "(", "self", ".", "mean_validation_score", ",", "np", ".", "std", "(", "self", ".", "cv_validation_scores", ")", ",", "self", ".", "parameters", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/model_selection/_search.py#L364-L369
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/util/fileops.py
python
get_file_handle
(path, append_file=False)
return open(path, mode)
Open 'path', truncate it if 'append_file' is False, and return file handle.
Open 'path', truncate it if 'append_file' is False, and return file handle.
[ "Open", "path", "truncate", "it", "if", "append_file", "is", "False", "and", "return", "file", "handle", "." ]
def get_file_handle(path, append_file=False): """Open 'path', truncate it if 'append_file' is False, and return file handle.""" mode = "a+" if append_file else "w" return open(path, mode)
[ "def", "get_file_handle", "(", "path", ",", "append_file", "=", "False", ")", ":", "mode", "=", "\"a+\"", "if", "append_file", "else", "\"w\"", "return", "open", "(", "path", ",", "mode", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/util/fileops.py#L26-L29
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/internals/managers.py
python
BlockManager.as_array
( self, transpose: bool = False, dtype: Dtype | None = None, copy: bool = False, na_value=lib.no_default, )
return arr.transpose() if transpose else arr
Convert the blockmanager data into an numpy array. Parameters ---------- transpose : bool, default False If True, transpose the return array. dtype : object, default None Data type of the return array. copy : bool, default False If True then g...
Convert the blockmanager data into an numpy array.
[ "Convert", "the", "blockmanager", "data", "into", "an", "numpy", "array", "." ]
def as_array( self, transpose: bool = False, dtype: Dtype | None = None, copy: bool = False, na_value=lib.no_default, ) -> np.ndarray: """ Convert the blockmanager data into an numpy array. Parameters ---------- transpose : bool, defau...
[ "def", "as_array", "(", "self", ",", "transpose", ":", "bool", "=", "False", ",", "dtype", ":", "Dtype", "|", "None", "=", "None", ",", "copy", ":", "bool", "=", "False", ",", "na_value", "=", "lib", ".", "no_default", ",", ")", "->", "np", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/managers.py#L1411-L1476
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py
python
UpdateIncludeState
(filename, include_dict, io=codecs)
return True
Fill up the include_dict with new includes found from the file. Args: filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testability. Returns: True if a header was successfully added. Fals...
Fill up the include_dict with new includes found from the file.
[ "Fill", "up", "the", "include_dict", "with", "new", "includes", "found", "from", "the", "file", "." ]
def UpdateIncludeState(filename, include_dict, io=codecs): """Fill up the include_dict with new includes found from the file. Args: filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testabilit...
[ "def", "UpdateIncludeState", "(", "filename", ",", "include_dict", ",", "io", "=", "codecs", ")", ":", "headerfile", "=", "None", "try", ":", "headerfile", "=", "io", ".", "open", "(", "filename", ",", "'r'", ",", "'utf8'", ",", "'replace'", ")", "except...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L5724-L5748
NVIDIA/MDL-SDK
aa9642b2546ad7b6236b5627385d882c2ed83c5d
src/mdl/jit/llvm/dist/utils/lit/lit/Util.py
python
to_string
(b)
Return the parameter as type 'str', possibly encoding it. In Python2, the 'str' type is the same as 'bytes'. In Python3, the 'str' type is (essentially) Python2's 'unicode' type, and 'bytes' is distinct.
Return the parameter as type 'str', possibly encoding it.
[ "Return", "the", "parameter", "as", "type", "str", "possibly", "encoding", "it", "." ]
def to_string(b): """Return the parameter as type 'str', possibly encoding it. In Python2, the 'str' type is the same as 'bytes'. In Python3, the 'str' type is (essentially) Python2's 'unicode' type, and 'bytes' is distinct. """ if isinstance(b, str): # In Python2, this branch is taken...
[ "def", "to_string", "(", "b", ")", ":", "if", "isinstance", "(", "b", ",", "str", ")", ":", "# In Python2, this branch is taken for types 'str' and 'bytes'.", "# In Python3, this branch is taken only for 'str'.", "return", "b", "if", "isinstance", "(", "b", ",", "bytes"...
https://github.com/NVIDIA/MDL-SDK/blob/aa9642b2546ad7b6236b5627385d882c2ed83c5d/src/mdl/jit/llvm/dist/utils/lit/lit/Util.py#L64-L100
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
lldb/examples/python/gdbremote.py
python
TerminalColors.strike
(self, on=True)
return ''
Enable or disable strike through depending on the "on" parameter.
Enable or disable strike through depending on the "on" parameter.
[ "Enable", "or", "disable", "strike", "through", "depending", "on", "the", "on", "parameter", "." ]
def strike(self, on=True): '''Enable or disable strike through depending on the "on" parameter.''' if self.enabled: if on: return "\x1b[9m" else: return "\x1b[29m" return ''
[ "def", "strike", "(", "self", ",", "on", "=", "True", ")", ":", "if", "self", ".", "enabled", ":", "if", "on", ":", "return", "\"\\x1b[9m\"", "else", ":", "return", "\"\\x1b[29m\"", "return", "''" ]
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/examples/python/gdbremote.py#L92-L99
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/layers/python/layers/target_column.py
python
_TargetColumn.loss
(self, logits, target, features)
Returns loss tensor for this head. Args: logits: logits, a float tensor. target: either a tensor for labels or in multihead case, a dict of string to target tensor. features: features dict. Returns: Loss tensor.
Returns loss tensor for this head.
[ "Returns", "loss", "tensor", "for", "this", "head", "." ]
def loss(self, logits, target, features): """Returns loss tensor for this head. Args: logits: logits, a float tensor. target: either a tensor for labels or in multihead case, a dict of string to target tensor. features: features dict. Returns: Loss tensor. """ targe...
[ "def", "loss", "(", "self", ",", "logits", ",", "target", ",", "features", ")", ":", "target", "=", "target", "[", "self", ".", "name", "]", "if", "isinstance", "(", "target", ",", "dict", ")", "else", "target", "loss_unweighted", "=", "self", ".", "...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/layers/python/layers/target_column.py#L166-L192
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/util.py
python
parse_marker
(marker_string)
return marker(marker_string)
Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a ...
Parse a marker string and return a dictionary containing a marker expression.
[ "Parse", "a", "marker", "string", "and", "return", "a", "dictionary", "containing", "a", "marker", "expression", "." ]
def parse_marker(marker_string): """ Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, a...
[ "def", "parse_marker", "(", "marker_string", ")", ":", "def", "marker_var", "(", "remaining", ")", ":", "# either identifier, or literal string", "m", "=", "IDENTIFIER", ".", "match", "(", "remaining", ")", "if", "m", ":", "result", "=", "m", ".", "groups", ...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/util.py#L56-L142
intel-iot-devkit/how-to-code-samples
b4ea616f36bbfa2e042beb1698f968cfd651d79f
watering-system/python/iot_watering_system/log.py
python
log
(event)
Publish message to MQTT server and data store.
Publish message to MQTT server and data store.
[ "Publish", "message", "to", "MQTT", "server", "and", "data", "store", "." ]
def log(event): """ Publish message to MQTT server and data store. """ message = "{0} {1}".format(datetime.utcnow().isoformat(), event) payload = {"value": message} print(message) send(payload)
[ "def", "log", "(", "event", ")", ":", "message", "=", "\"{0} {1}\"", ".", "format", "(", "datetime", ".", "utcnow", "(", ")", ".", "isoformat", "(", ")", ",", "event", ")", "payload", "=", "{", "\"value\"", ":", "message", "}", "print", "(", "message...
https://github.com/intel-iot-devkit/how-to-code-samples/blob/b4ea616f36bbfa2e042beb1698f968cfd651d79f/watering-system/python/iot_watering_system/log.py#L45-L54
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitored_session.py
python
_as_graph_element
(obj, graph)
return element
Retrieves Graph element.
Retrieves Graph element.
[ "Retrieves", "Graph", "element", "." ]
def _as_graph_element(obj, graph): """Retrieves Graph element.""" graph = graph or ops.get_default_graph() if not isinstance(obj, six.string_types): if not hasattr(obj, 'graph') or obj.graph != graph: raise ValueError('Passed %s should have graph attribute that is equal ' 'to curr...
[ "def", "_as_graph_element", "(", "obj", ",", "graph", ")", ":", "graph", "=", "graph", "or", "ops", ".", "get_default_graph", "(", ")", "if", "not", "isinstance", "(", "obj", ",", "six", ".", "string_types", ")", ":", "if", "not", "hasattr", "(", "obj"...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitored_session.py#L118-L139