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
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/util.py
python
make_placeholder_from_dtype_and_shape
(dtype, shape=None, scope=None, prefix=_DEFAULT_PLACEHOLDER_PREFIX)
return tf_array_ops.placeholder( dtype=dtype, shape=shape, name=placeholder_name(scope=scope, prefix=prefix))
Create a tf.compat.v1.placeholder for the Graph Editor. Note that the correct graph scope must be set by the calling function. The placeholder is named using the function placeholder_name (with no tensor argument). Args: dtype: the tensor type. shape: the tensor shape (optional). scope: absolute s...
Create a tf.compat.v1.placeholder for the Graph Editor.
[ "Create", "a", "tf", ".", "compat", ".", "v1", ".", "placeholder", "for", "the", "Graph", "Editor", "." ]
def make_placeholder_from_dtype_and_shape(dtype, shape=None, scope=None, prefix=_DEFAULT_PLACEHOLDER_PREFIX): """Create a tf.compat.v1.placeholder for the Graph Editor. Note that the correct graph scope must be set by the calling function. The placeholder is named using ...
[ "def", "make_placeholder_from_dtype_and_shape", "(", "dtype", ",", "shape", "=", "None", ",", "scope", "=", "None", ",", "prefix", "=", "_DEFAULT_PLACEHOLDER_PREFIX", ")", ":", "return", "tf_array_ops", ".", "placeholder", "(", "dtype", "=", "dtype", ",", "shape...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/util.py#L474-L494
r-barnes/richdem
9e2646153c5b96cb4e6802a5a0c484b72ff9e622
wrappers/pyrichdem/richdem/__init__.py
python
FillDepressions
( dem, epsilon = False, in_place = False, topology = 'D8' )
Fills all depressions in a DEM. Args: dem (rdarray): An elevation model epsilon (float): If True, an epsilon gradient is imposed to all flat regions. This ensures that there is always a local gradient. in_place (bool): If True, the DEM is modified in ...
Fills all depressions in a DEM.
[ "Fills", "all", "depressions", "in", "a", "DEM", "." ]
def FillDepressions( dem, epsilon = False, in_place = False, topology = 'D8' ): """Fills all depressions in a DEM. Args: dem (rdarray): An elevation model epsilon (float): If True, an epsilon gradient is imposed to all flat regions. This ensures that ...
[ "def", "FillDepressions", "(", "dem", ",", "epsilon", "=", "False", ",", "in_place", "=", "False", ",", "topology", "=", "'D8'", ")", ":", "if", "type", "(", "dem", ")", "is", "not", "rdarray", ":", "raise", "Exception", "(", "\"A richdem.rdarray or numpy....
https://github.com/r-barnes/richdem/blob/9e2646153c5b96cb4e6802a5a0c484b72ff9e622/wrappers/pyrichdem/richdem/__init__.py#L323-L369
dicecco1/fpga_caffe
7a191704efd7873071cfef35772d7e7bf3e3cfd6
scripts/cpp_lint.py
python
IsCppString
(line)
return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant.
Does line terminate so, that the next symbol is in string constant.
[ "Does", "line", "terminate", "so", "that", "the", "next", "symbol", "is", "in", "string", "constant", "." ]
def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string c...
[ "def", "IsCppString", "(", "line", ")", ":", "line", "=", "line", ".", "replace", "(", "r'\\\\'", ",", "'XX'", ")", "# after this, \\\\\" does not match to \\\"", "return", "(", "(", "line", ".", "count", "(", "'\"'", ")", "-", "line", ".", "count", "(", ...
https://github.com/dicecco1/fpga_caffe/blob/7a191704efd7873071cfef35772d7e7bf3e3cfd6/scripts/cpp_lint.py#L1049-L1063
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/wsgiref/handlers.py
python
BaseHandler._flush
(self)
Override in subclass to force sending of recent '_write()' calls It's okay if this method is a no-op (i.e., if '_write()' actually sends the data.
Override in subclass to force sending of recent '_write()' calls
[ "Override", "in", "subclass", "to", "force", "sending", "of", "recent", "_write", "()", "calls" ]
def _flush(self): """Override in subclass to force sending of recent '_write()' calls It's okay if this method is a no-op (i.e., if '_write()' actually sends the data. """ raise NotImplementedError
[ "def", "_flush", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/wsgiref/handlers.py#L341-L347
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py
python
Decimal.__nonzero__
(self)
return self._is_special or self._int != '0'
Return True if self is nonzero; otherwise return False. NaNs and infinities are considered nonzero.
Return True if self is nonzero; otherwise return False.
[ "Return", "True", "if", "self", "is", "nonzero", ";", "otherwise", "return", "False", "." ]
def __nonzero__(self): """Return True if self is nonzero; otherwise return False. NaNs and infinities are considered nonzero. """ return self._is_special or self._int != '0'
[ "def", "__nonzero__", "(", "self", ")", ":", "return", "self", ".", "_is_special", "or", "self", ".", "_int", "!=", "'0'" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L793-L798
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
GBSpan.GetColspan
(*args, **kwargs)
return _core_.GBSpan_GetColspan(*args, **kwargs)
GetColspan(self) -> int
GetColspan(self) -> int
[ "GetColspan", "(", "self", ")", "-", ">", "int" ]
def GetColspan(*args, **kwargs): """GetColspan(self) -> int""" return _core_.GBSpan_GetColspan(*args, **kwargs)
[ "def", "GetColspan", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "GBSpan_GetColspan", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L15660-L15662
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py
python
reroute_b2a
(sgv0, sgv1)
return _reroute_sgv(sgv0, sgv1, _RerouteMode.b2a)
Re-route the inputs and outputs of sgv1 to sgv0 (see _reroute).
Re-route the inputs and outputs of sgv1 to sgv0 (see _reroute).
[ "Re", "-", "route", "the", "inputs", "and", "outputs", "of", "sgv1", "to", "sgv0", "(", "see", "_reroute", ")", "." ]
def reroute_b2a(sgv0, sgv1): """Re-route the inputs and outputs of sgv1 to sgv0 (see _reroute).""" return _reroute_sgv(sgv0, sgv1, _RerouteMode.b2a)
[ "def", "reroute_b2a", "(", "sgv0", ",", "sgv1", ")", ":", "return", "_reroute_sgv", "(", "sgv0", ",", "sgv1", ",", "_RerouteMode", ".", "b2a", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/graph_editor/reroute.py#L438-L440
apache/madlib
be297fe6beada0640f93317e8948834032718e32
src/madpack/upgrade_util.py
python
ScriptCleaner._get_existing_udo
(self)
@brief Get the existing UDOs in the current version
[]
def _get_existing_udo(self): """ @brief Get the existing UDOs in the current version """ rows = self._run_sql(""" SELECT oprname, oprleft::regtype, oprright::regtype FROM pg_operator AS o, pg_namespace AS ns WHERE ...
[ "def", "_get_existing_udo", "(", "self", ")", ":", "rows", "=", "self", ".", "_run_sql", "(", "\"\"\"\n SELECT\n oprname, oprleft::regtype, oprright::regtype\n FROM\n pg_operator AS o, pg_namespace AS ns\n WHERE\n ...
https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/upgrade_util.py#L1003-L1020
infinisql/infinisql
6e858e142196e20b6779e1ee84c4a501e246c1f8
manager/infinisqlmgr/management/whisper.py
python
fetch
(path,fromTime,untilTime=None)
return file_fetch(fh, fromTime, untilTime)
fetch(path,fromTime,untilTime=None) path is a string fromTime is an epoch time untilTime is also an epoch time, but defaults to now. Returns a tuple of (timeInfo, valueList) where timeInfo is itself a tuple of (fromTime, untilTime, step) Returns None if no data can be returned
fetch(path,fromTime,untilTime=None)
[ "fetch", "(", "path", "fromTime", "untilTime", "=", "None", ")" ]
def fetch(path,fromTime,untilTime=None): """fetch(path,fromTime,untilTime=None) path is a string fromTime is an epoch time untilTime is also an epoch time, but defaults to now. Returns a tuple of (timeInfo, valueList) where timeInfo is itself a tuple of (fromTime, untilTime, step) Returns None if no data can be re...
[ "def", "fetch", "(", "path", ",", "fromTime", ",", "untilTime", "=", "None", ")", ":", "fh", "=", "open", "(", "path", ",", "'rb'", ")", "return", "file_fetch", "(", "fh", ",", "fromTime", ",", "untilTime", ")" ]
https://github.com/infinisql/infinisql/blob/6e858e142196e20b6779e1ee84c4a501e246c1f8/manager/infinisqlmgr/management/whisper.py#L686-L699
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
tools/fast_nvcc/fast_nvcc.py
python
run_graph
( *, env: Dict[str, str], commands: List[str], graph: Graph, gather_data: bool = False, save: Optional[str] = None, )
return [await task for task in tasks]
Return outputs/errors (and optionally time/file info) from commands.
Return outputs/errors (and optionally time/file info) from commands.
[ "Return", "outputs", "/", "errors", "(", "and", "optionally", "time", "/", "file", "info", ")", "from", "commands", "." ]
async def run_graph( *, env: Dict[str, str], commands: List[str], graph: Graph, gather_data: bool = False, save: Optional[str] = None, ) -> List[Result]: """ Return outputs/errors (and optionally time/file info) from commands. """ tasks: List[Awaitable[Result]] = [] for i, (c...
[ "async", "def", "run_graph", "(", "*", ",", "env", ":", "Dict", "[", "str", ",", "str", "]", ",", "commands", ":", "List", "[", "str", "]", ",", "graph", ":", "Graph", ",", "gather_data", ":", "bool", "=", "False", ",", "save", ":", "Optional", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/fast_nvcc/fast_nvcc.py#L413-L435
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Base/Python/slicer/util.py
python
findChildren
(widget=None, name="", text="", title="", className="")
return children
Return a list of child widgets that meet all the given criteria. If no criteria are provided, the function will return all widgets descendants. If no widget is provided, slicer.util.mainWindow() is used. :param widget: parent widget where the widgets will be searched :param name: name attribute of the widget ...
Return a list of child widgets that meet all the given criteria.
[ "Return", "a", "list", "of", "child", "widgets", "that", "meet", "all", "the", "given", "criteria", "." ]
def findChildren(widget=None, name="", text="", title="", className=""): """ Return a list of child widgets that meet all the given criteria. If no criteria are provided, the function will return all widgets descendants. If no widget is provided, slicer.util.mainWindow() is used. :param widget: parent widget w...
[ "def", "findChildren", "(", "widget", "=", "None", ",", "name", "=", "\"\"", ",", "text", "=", "\"\"", ",", "title", "=", "\"\"", ",", "className", "=", "\"\"", ")", ":", "# TODO: figure out why the native QWidget.findChildren method does not seem to work from PythonQ...
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Base/Python/slicer/util.py#L239-L287
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=STCNameStr) -> StyledTextCtrl
__init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=STCNameStr) -> StyledTextCtrl
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "ID_ANY", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", "String", "name", "=", "STCNameStr", ")", "-", ">", "StyledTextCtrl" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=STCNameStr) -> StyledTextCtrl """ _stc.StyledTextCtrl_swiginit(self,_stc.new_StyledTextCtrl(*args, **kwargs)) ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_stc", ".", "StyledTextCtrl_swiginit", "(", "self", ",", "_stc", ".", "new_StyledTextCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setO...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L2020-L2026
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/json_schema_compiler/dart_generator.py
python
_Generator._NeedsProxy
(self, f)
return any(not self._IsBaseType(p.type_) for p in f.params)
Given a function, returns True if it needs to be proxied, False if not. A function needs to be proxied if any of its members are non-base types. This means that, when the function object is passed to Javascript, it needs to be wrapped in a "proxied" call that converts the JS inputs to Dart objects expl...
Given a function, returns True if it needs to be proxied, False if not.
[ "Given", "a", "function", "returns", "True", "if", "it", "needs", "to", "be", "proxied", "False", "if", "not", "." ]
def _NeedsProxy(self, f): """Given a function, returns True if it needs to be proxied, False if not. A function needs to be proxied if any of its members are non-base types. This means that, when the function object is passed to Javascript, it needs to be wrapped in a "proxied" call that converts the J...
[ "def", "_NeedsProxy", "(", "self", ",", "f", ")", ":", "return", "any", "(", "not", "self", ".", "_IsBaseType", "(", "p", ".", "type_", ")", "for", "p", "in", "f", ".", "params", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/dart_generator.py#L359-L367
koth/kcws
88efbd36a7022de4e6e90f5a1fb880cf87cfae9f
third_party/setuptools/pkg_resources.py
python
IMetadataProvider.metadata_listdir
(name)
List of metadata names in the directory (like ``os.listdir()``)
List of metadata names in the directory (like ``os.listdir()``)
[ "List", "of", "metadata", "names", "in", "the", "directory", "(", "like", "os", ".", "listdir", "()", ")" ]
def metadata_listdir(name): """List of metadata names in the directory (like ``os.listdir()``)"""
[ "def", "metadata_listdir", "(", "name", ")", ":" ]
https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/setuptools/pkg_resources.py#L384-L385
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/model/trajectory.py
python
HermiteTrajectory.makeBezier
(self, times: List[float], controlPoints: List[Vector])
Sets up this spline to perform Bezier interpolation of the given control points, with segment 0 a Bezier curve on cps[0:3], segment 1 a Bezier curve on cps[3:6], etc.
Sets up this spline to perform Bezier interpolation of the given control points, with segment 0 a Bezier curve on cps[0:3], segment 1 a Bezier curve on cps[3:6], etc.
[ "Sets", "up", "this", "spline", "to", "perform", "Bezier", "interpolation", "of", "the", "given", "control", "points", "with", "segment", "0", "a", "Bezier", "curve", "on", "cps", "[", "0", ":", "3", "]", "segment", "1", "a", "Bezier", "curve", "on", "...
def makeBezier(self, times: List[float], controlPoints: List[Vector]) -> None: """Sets up this spline to perform Bezier interpolation of the given control points, with segment 0 a Bezier curve on cps[0:3], segment 1 a Bezier curve on cps[3:6], etc. """ nsegs = len(times)-1 ...
[ "def", "makeBezier", "(", "self", ",", "times", ":", "List", "[", "float", "]", ",", "controlPoints", ":", "List", "[", "Vector", "]", ")", "->", "None", ":", "nsegs", "=", "len", "(", "times", ")", "-", "1", "if", "nsegs", "*", "3", "+", "1", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/trajectory.py#L886-L916
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
_SetCountingStyle
(level)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def _SetCountingStyle(level): """Sets the module's counting options.""" _cpplint_state.SetCountingStyle(level)
[ "def", "_SetCountingStyle", "(", "level", ")", ":", "_cpplint_state", ".", "SetCountingStyle", "(", "level", ")" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L651-L653
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/kms/layer1.py
python
KMSConnection.create_alias
(self, alias_name, target_key_id)
return self.make_request(action='CreateAlias', body=json.dumps(params))
Creates a display name for a customer master key. An alias can be used to identify a key and should be unique. The console enforces a one-to-one mapping between the alias and a key. An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (...
Creates a display name for a customer master key. An alias can be used to identify a key and should be unique. The console enforces a one-to-one mapping between the alias and a key. An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (...
[ "Creates", "a", "display", "name", "for", "a", "customer", "master", "key", ".", "An", "alias", "can", "be", "used", "to", "identify", "a", "key", "and", "should", "be", "unique", ".", "The", "console", "enforces", "a", "one", "-", "to", "-", "one", ...
def create_alias(self, alias_name, target_key_id): """ Creates a display name for a customer master key. An alias can be used to identify a key and should be unique. The console enforces a one-to-one mapping between the alias and a key. An alias name can contain only alphanumeric...
[ "def", "create_alias", "(", "self", ",", "alias_name", ",", "target_key_id", ")", ":", "params", "=", "{", "'AliasName'", ":", "alias_name", ",", "'TargetKeyId'", ":", "target_key_id", ",", "}", "return", "self", ".", "make_request", "(", "action", "=", "'Cr...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/kms/layer1.py#L131-L156
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/list_ops.py
python
_TensorListFromTensorGrad
(op, dlist)
return tensor_grad, shape_grad
Gradient for TensorListFromTensor.
Gradient for TensorListFromTensor.
[ "Gradient", "for", "TensorListFromTensor", "." ]
def _TensorListFromTensorGrad(op, dlist): """Gradient for TensorListFromTensor.""" t = op.inputs[0] if t.shape.dims and t.shape.dims[0].value is not None: num_elements = t.shape.dims[0].value else: num_elements = None if dlist is None: dlist = empty_tensor_list( element_dtype=t.dtype, ...
[ "def", "_TensorListFromTensorGrad", "(", "op", ",", "dlist", ")", ":", "t", "=", "op", ".", "inputs", "[", "0", "]", "if", "t", ".", "shape", ".", "dims", "and", "t", ".", "shape", ".", "dims", "[", "0", "]", ".", "value", "is", "not", "None", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/list_ops.py#L264-L282
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/common/utils.py
python
GetPostgresHost
()
return None
Get postgres host for remote connections Returns: Host name of remote database to connect to or None.
Get postgres host for remote connections
[ "Get", "postgres", "host", "for", "remote", "connections" ]
def GetPostgresHost(): """Get postgres host for remote connections Returns: Host name of remote database to connect to or None. """ pattern = r"^\s*host\s*=\s*(\d{4,})\s*" match = MatchPattern(POSTGRES_PROPERTIES_PATH, pattern) if match: host = match[0] return host return None
[ "def", "GetPostgresHost", "(", ")", ":", "pattern", "=", "r\"^\\s*host\\s*=\\s*(\\d{4,})\\s*\"", "match", "=", "MatchPattern", "(", "POSTGRES_PROPERTIES_PATH", ",", "pattern", ")", "if", "match", ":", "host", "=", "match", "[", "0", "]", "return", "host", "retur...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/common/utils.py#L278-L291
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
models/AI-Model-Zoo/caffe-xilinx/examples/pycaffe/tools.py
python
SimpleTransformer.deprocess
(self, im)
return np.uint8(im)
inverse of preprocess()
inverse of preprocess()
[ "inverse", "of", "preprocess", "()" ]
def deprocess(self, im): """ inverse of preprocess() """ im = im.transpose(1, 2, 0) im /= self.scale im += self.mean im = im[:, :, ::-1] # change to RGB return np.uint8(im)
[ "def", "deprocess", "(", "self", ",", "im", ")", ":", "im", "=", "im", ".", "transpose", "(", "1", ",", "2", ",", "0", ")", "im", "/=", "self", ".", "scale", "im", "+=", "self", ".", "mean", "im", "=", "im", "[", ":", ",", ":", ",", ":", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/examples/pycaffe/tools.py#L41-L50
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.WriteSources
(self, configs, deps, sources, extra_outputs, extra_link_deps, part_of_all, precompiled_header)
Write Makefile code for any 'sources' from the gyp input. These are source files necessary to build the current target. configs, deps, sources: input from gyp. extra_outputs: a list of extra outputs this action should be dependent on; used to serialize action/rules before compilation ...
Write Makefile code for any 'sources' from the gyp input. These are source files necessary to build the current target.
[ "Write", "Makefile", "code", "for", "any", "sources", "from", "the", "gyp", "input", ".", "These", "are", "source", "files", "necessary", "to", "build", "the", "current", "target", "." ]
def WriteSources(self, configs, deps, sources, extra_outputs, extra_link_deps, part_of_all, precompiled_header): """Write Makefile code for any 'sources' from the gyp input. These are source files necessary to build the current target. configs, deps, sources: input fro...
[ "def", "WriteSources", "(", "self", ",", "configs", ",", "deps", ",", "sources", ",", "extra_outputs", ",", "extra_link_deps", ",", "part_of_all", ",", "precompiled_header", ")", ":", "# Write configuration-specific variables for CFLAGS, etc.", "for", "configname", "in"...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/make.py#L1197-L1319
quantOS-org/DataCore
e2ef9bd2c22ee9e2845675b6435a14fa607f3551
mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/containers.py
python
BaseContainer.__getitem__
(self, key)
return self._values[key]
Retrieves item by the specified key.
Retrieves item by the specified key.
[ "Retrieves", "item", "by", "the", "specified", "key", "." ]
def __getitem__(self, key): """Retrieves item by the specified key.""" return self._values[key]
[ "def", "__getitem__", "(", "self", ",", "key", ")", ":", "return", "self", ".", "_values", "[", "key", "]" ]
https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/containers.py#L62-L64
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/requireprovidesorter.py
python
RequireProvideSorter._GetRequireOrProvideTokens
(self, token, token_string)
return tokens
Gets all goog.provide or goog.require tokens in the given token stream. Args: token: The first token in the token stream. token_string: One of 'goog.provide' or 'goog.require' to indicate which tokens to find. Returns: A list of goog.provide or goog.require tokens in the ...
Gets all goog.provide or goog.require tokens in the given token stream.
[ "Gets", "all", "goog", ".", "provide", "or", "goog", ".", "require", "tokens", "in", "the", "given", "token", "stream", "." ]
def _GetRequireOrProvideTokens(self, token, token_string): """Gets all goog.provide or goog.require tokens in the given token stream. Args: token: The first token in the token stream. token_string: One of 'goog.provide' or 'goog.require' to indicate which tokens to find. Re...
[ "def", "_GetRequireOrProvideTokens", "(", "self", ",", "token", ",", "token_string", ")", ":", "tokens", "=", "[", "]", "while", "token", ":", "if", "token", ".", "type", "==", "Type", ".", "IDENTIFIER", ":", "if", "token", ".", "string", "==", "token_st...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/requireprovidesorter.py#L153-L176
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/json_schema_compiler/cc_generator.py
python
_Generator._GenerateFunction
(self, function)
return c
Generates the definitions for function structs.
Generates the definitions for function structs.
[ "Generates", "the", "definitions", "for", "function", "structs", "." ]
def _GenerateFunction(self, function): """Generates the definitions for function structs. """ c = Code() # TODO(kalman): use function.unix_name not Classname. function_namespace = cpp_util.Classname(function.name) # Windows has a #define for SendMessage, so to avoid any issues, we need # to...
[ "def", "_GenerateFunction", "(", "self", ",", "function", ")", ":", "c", "=", "Code", "(", ")", "# TODO(kalman): use function.unix_name not Classname.", "function_namespace", "=", "cpp_util", ".", "Classname", "(", "function", ".", "name", ")", "# Windows has a #defin...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/cc_generator.py#L402-L432
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/autoscale/__init__.py
python
AutoScaleConnection.get_termination_policies
(self)
return self.get_object('DescribeTerminationPolicyTypes', {}, TerminationPolicies)
Gets all valid termination policies. These values can then be used as the termination_policies arg when creating and updating autoscale groups.
Gets all valid termination policies.
[ "Gets", "all", "valid", "termination", "policies", "." ]
def get_termination_policies(self): """Gets all valid termination policies. These values can then be used as the termination_policies arg when creating and updating autoscale groups. """ return self.get_object('DescribeTerminationPolicyTypes', {}, ...
[ "def", "get_termination_policies", "(", "self", ")", ":", "return", "self", ".", "get_object", "(", "'DescribeTerminationPolicyTypes'", ",", "{", "}", ",", "TerminationPolicies", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/autoscale/__init__.py#L434-L441
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/objectivec/DevTools/pddm.py
python
MacroCollection.ParseInput
(self, a_file)
Consumes input extracting definitions. Args: a_file: The file like stream to parse. Raises: PDDMError if there are any issues.
Consumes input extracting definitions.
[ "Consumes", "input", "extracting", "definitions", "." ]
def ParseInput(self, a_file): """Consumes input extracting definitions. Args: a_file: The file like stream to parse. Raises: PDDMError if there are any issues. """ input_lines = a_file.read().splitlines() self.ParseLines(input_lines)
[ "def", "ParseInput", "(", "self", ",", "a_file", ")", ":", "input_lines", "=", "a_file", ".", "read", "(", ")", ".", "splitlines", "(", ")", "self", ".", "ParseLines", "(", "input_lines", ")" ]
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/objectivec/DevTools/pddm.py#L182-L192
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/tree.py
python
TreeItem.IsEditable
(self)
Return whether the item's text may be edited.
Return whether the item's text may be edited.
[ "Return", "whether", "the", "item", "s", "text", "may", "be", "edited", "." ]
def IsEditable(self): """Return whether the item's text may be edited."""
[ "def", "IsEditable", "(", "self", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/tree.py#L372-L373
ablab/quast
5f6709528129a6ad266a6b24ef3f40b88f0fe04b
quast_libs/site_packages/joblib2/numpy_pickle.py
python
NumpyPickler.save
(self, obj)
return pickle.Pickler.save(self, obj)
Subclass the save method, to save ndarray subclasses in npy files, rather than pickling them. Of course, this is a total abuse of the Pickler class.
Subclass the save method, to save ndarray subclasses in npy files, rather than pickling them. Of course, this is a total abuse of the Pickler class.
[ "Subclass", "the", "save", "method", "to", "save", "ndarray", "subclasses", "in", "npy", "files", "rather", "than", "pickling", "them", ".", "Of", "course", "this", "is", "a", "total", "abuse", "of", "the", "Pickler", "class", "." ]
def save(self, obj): """ Subclass the save method, to save ndarray subclasses in npy files, rather than pickling them. Of course, this is a total abuse of the Pickler class. """ if self.np is not None and type(obj) in (self.np.ndarray, ...
[ "def", "save", "(", "self", ",", "obj", ")", ":", "if", "self", ".", "np", "is", "not", "None", "and", "type", "(", "obj", ")", "in", "(", "self", ".", "np", ".", "ndarray", ",", "self", ".", "np", ".", "matrix", ",", "self", ".", "np", ".", ...
https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/joblib2/numpy_pickle.py#L218-L246
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/genericpath.py
python
getctime
(filename)
return os.stat(filename).st_ctime
Return the metadata change time of a file, reported by os.stat().
Return the metadata change time of a file, reported by os.stat().
[ "Return", "the", "metadata", "change", "time", "of", "a", "file", "reported", "by", "os", ".", "stat", "()", "." ]
def getctime(filename): """Return the metadata change time of a file, reported by os.stat().""" return os.stat(filename).st_ctime
[ "def", "getctime", "(", "filename", ")", ":", "return", "os", ".", "stat", "(", "filename", ")", ".", "st_ctime" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/genericpath.py#L62-L64
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/batch_norm_benchmark.py
python
batch_norm_py
(tensor, mean, variance, beta, gamma, scale)
return tf.nn.batch_normalization( tensor, mean, variance, beta, gamma if scale else None, 0.001)
Python implementation of batch normalization.
Python implementation of batch normalization.
[ "Python", "implementation", "of", "batch", "normalization", "." ]
def batch_norm_py(tensor, mean, variance, beta, gamma, scale): """Python implementation of batch normalization.""" return tf.nn.batch_normalization( tensor, mean, variance, beta, gamma if scale else None, 0.001)
[ "def", "batch_norm_py", "(", "tensor", ",", "mean", ",", "variance", ",", "beta", ",", "gamma", ",", "scale", ")", ":", "return", "tf", ".", "nn", ".", "batch_normalization", "(", "tensor", ",", "mean", ",", "variance", ",", "beta", ",", "gamma", "if",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/batch_norm_benchmark.py#L45-L48
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
TransformPoser.enableTranslationAxes
(self, x: "bool", y: "bool", z: "bool")
return _robotsim.TransformPoser_enableTranslationAxes(self, x, y, z)
r""" enableTranslationAxes(TransformPoser self, bool x, bool y, bool z)
r""" enableTranslationAxes(TransformPoser self, bool x, bool y, bool z)
[ "r", "enableTranslationAxes", "(", "TransformPoser", "self", "bool", "x", "bool", "y", "bool", "z", ")" ]
def enableTranslationAxes(self, x: "bool", y: "bool", z: "bool") -> "void": r""" enableTranslationAxes(TransformPoser self, bool x, bool y, bool z) """ return _robotsim.TransformPoser_enableTranslationAxes(self, x, y, z)
[ "def", "enableTranslationAxes", "(", "self", ",", "x", ":", "\"bool\"", ",", "y", ":", "\"bool\"", ",", "z", ":", "\"bool\"", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "TransformPoser_enableTranslationAxes", "(", "self", ",", "x", ",", "y", "...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L3584-L3590
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/training/training_ops.py
python
_SparseApplyFtrlShape
(op)
return [linear_shape]
Shape function for the SparseApplyFtrl op.
Shape function for the SparseApplyFtrl op.
[ "Shape", "function", "for", "the", "SparseApplyFtrl", "op", "." ]
def _SparseApplyFtrlShape(op): """Shape function for the SparseApplyFtrl op.""" var_shape = op.inputs[0].get_shape() accum_shape = op.inputs[1].get_shape().merge_with(var_shape) linear_shape = op.inputs[2].get_shape().merge_with(accum_shape) grad_shape = op.inputs[3].get_shape().merge_with( tensor_shape...
[ "def", "_SparseApplyFtrlShape", "(", "op", ")", ":", "var_shape", "=", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", "accum_shape", "=", "op", ".", "inputs", "[", "1", "]", ".", "get_shape", "(", ")", ".", "merge_with", "(", "var_sh...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/training_ops.py#L235-L248
apache/arrow
af33dd1157eb8d7d9bfac25ebf61445b793b7943
dev/archery/archery/crossbow/core.py
python
Queue.jobs
(self, pattern)
Return jobs sorted by its identifier in reverse order
Return jobs sorted by its identifier in reverse order
[ "Return", "jobs", "sorted", "by", "its", "identifier", "in", "reverse", "order" ]
def jobs(self, pattern): """Return jobs sorted by its identifier in reverse order""" job_names = [] for name in self.repo.branches.remote: origin, name = name.split('/', 1) result = re.match(pattern, name) if result: job_names.append(name) ...
[ "def", "jobs", "(", "self", ",", "pattern", ")", ":", "job_names", "=", "[", "]", "for", "name", "in", "self", ".", "repo", ".", "branches", ".", "remote", ":", "origin", ",", "name", "=", "name", ".", "split", "(", "'/'", ",", "1", ")", "result"...
https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/dev/archery/archery/crossbow/core.py#L586-L596
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Variables/__init__.py
python
Variables.GenerateHelpText
(self, env, sort=None)
return ''.join(lines)
Generate the help text for the options. env - an environment that is used to get the current values of the options. cmp - Either a function as follows: The specific sort function should take two arguments and return -1, 0 or 1 or a boolean to indicate if it should be sorted...
Generate the help text for the options.
[ "Generate", "the", "help", "text", "for", "the", "options", "." ]
def GenerateHelpText(self, env, sort=None): """ Generate the help text for the options. env - an environment that is used to get the current values of the options. cmp - Either a function as follows: The specific sort function should take two arguments and return -1, 0 or ...
[ "def", "GenerateHelpText", "(", "self", ",", "env", ",", "sort", "=", "None", ")", ":", "if", "callable", "(", "sort", ")", ":", "options", "=", "sorted", "(", "self", ".", "options", ",", "key", "=", "cmp_to_key", "(", "lambda", "x", ",", "y", ":"...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Variables/__init__.py#L285-L310
NASA-SW-VnV/ikos
71325dfb94737332542caa708d7537752021522d
analyzer/python/ikos/output_db.py
python
CallContext.parent
(self)
return self.db.call_contexts[self.parent_id]
Return the parent calling context
Return the parent calling context
[ "Return", "the", "parent", "calling", "context" ]
def parent(self): ''' Return the parent calling context ''' assert self.parent_id is not None return self.db.call_contexts[self.parent_id]
[ "def", "parent", "(", "self", ")", ":", "assert", "self", ".", "parent_id", "is", "not", "None", "return", "self", ".", "db", ".", "call_contexts", "[", "self", ".", "parent_id", "]" ]
https://github.com/NASA-SW-VnV/ikos/blob/71325dfb94737332542caa708d7537752021522d/analyzer/python/ikos/output_db.py#L300-L303
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/python/pyext.py
python
Module.WrapCapsule
(self, p, unused_ln, ns, unused_class_ns='')
return []
Process AST.ForwardDecl p.
Process AST.ForwardDecl p.
[ "Process", "AST", ".", "ForwardDecl", "p", "." ]
def WrapCapsule(self, p, unused_ln, ns, unused_class_ns=''): """Process AST.ForwardDecl p.""" self.types.append(types.CapsuleType(p.name.cpp_name, p.name.native, ns)) return []
[ "def", "WrapCapsule", "(", "self", ",", "p", ",", "unused_ln", ",", "ns", ",", "unused_class_ns", "=", "''", ")", ":", "self", ".", "types", ".", "append", "(", "types", ".", "CapsuleType", "(", "p", ".", "name", ".", "cpp_name", ",", "p", ".", "na...
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/pyext.py#L654-L657
google/tink
59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14
python/tink/core/_registry.py
python
Registry._key_manager_internal
( cls, type_url: str)
return cls._key_managers[type_url]
Returns a key manager, new_key_allowed pair for the given type_url.
Returns a key manager, new_key_allowed pair for the given type_url.
[ "Returns", "a", "key", "manager", "new_key_allowed", "pair", "for", "the", "given", "type_url", "." ]
def _key_manager_internal( cls, type_url: str) -> Tuple[_key_manager.KeyManager, bool]: """Returns a key manager, new_key_allowed pair for the given type_url.""" if type_url not in cls._key_managers: raise _tink_error.TinkError( 'No manager for type {} has been registered.'.format(type_url...
[ "def", "_key_manager_internal", "(", "cls", ",", "type_url", ":", "str", ")", "->", "Tuple", "[", "_key_manager", ".", "KeyManager", ",", "bool", "]", ":", "if", "type_url", "not", "in", "cls", ".", "_key_managers", ":", "raise", "_tink_error", ".", "TinkE...
https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/core/_registry.py#L53-L59
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/zipfile.py
python
ZipFile.write
(self, filename, arcname=None, compress_type=None)
Put the bytes from filename into the archive under the name arcname.
Put the bytes from filename into the archive under the name arcname.
[ "Put", "the", "bytes", "from", "filename", "into", "the", "archive", "under", "the", "name", "arcname", "." ]
def write(self, filename, arcname=None, compress_type=None): """Put the bytes from filename into the archive under the name arcname.""" if not self.fp: raise RuntimeError( "Attempt to write to ZIP archive that was already closed") st = os.stat(filename) ...
[ "def", "write", "(", "self", ",", "filename", ",", "arcname", "=", "None", ",", "compress_type", "=", "None", ")", ":", "if", "not", "self", ".", "fp", ":", "raise", "RuntimeError", "(", "\"Attempt to write to ZIP archive that was already closed\"", ")", "st", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/zipfile.py#L1107-L1194
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml.py
python
SAXCallback.internalSubset
(self, name, externalID, systemID)
called when a DOCTYPE declaration has been found, name is the DTD name and externalID, systemID are the DTD public and system identifier for that DTD if available
called when a DOCTYPE declaration has been found, name is the DTD name and externalID, systemID are the DTD public and system identifier for that DTD if available
[ "called", "when", "a", "DOCTYPE", "declaration", "has", "been", "found", "name", "is", "the", "DTD", "name", "and", "externalID", "systemID", "are", "the", "DTD", "public", "and", "system", "identifier", "for", "that", "DTD", "if", "available" ]
def internalSubset(self, name, externalID, systemID): """called when a DOCTYPE declaration has been found, name is the DTD name and externalID, systemID are the DTD public and system identifier for that DTD if available""" pass
[ "def", "internalSubset", "(", "self", ",", "name", ",", "externalID", ",", "systemID", ")", ":", "pass" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml.py#L217-L221
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
demo3_modelVisualization/vlfeat/docsrc/webdoc.py
python
DocHandler.setDocumentLocator
(self, locator)
SAX interface: This is called when a new file is parsed to set the locator object.
SAX interface: This is called when a new file is parsed to set the locator object.
[ "SAX", "interface", ":", "This", "is", "called", "when", "a", "new", "file", "is", "parsed", "to", "set", "the", "locator", "object", "." ]
def setDocumentLocator(self, locator): """SAX interface: This is called when a new file is parsed to set the locator object.""" self.locatorStack.append(locator)
[ "def", "setDocumentLocator", "(", "self", ",", "locator", ")", ":", "self", ".", "locatorStack", ".", "append", "(", "locator", ")" ]
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/demo3_modelVisualization/vlfeat/docsrc/webdoc.py#L1143-L1145
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
NotificationMessage.Show
(*args, **kwargs)
return _misc_.NotificationMessage_Show(*args, **kwargs)
Show(self, int timeout=Timeout_Auto) -> bool
Show(self, int timeout=Timeout_Auto) -> bool
[ "Show", "(", "self", "int", "timeout", "=", "Timeout_Auto", ")", "-", ">", "bool" ]
def Show(*args, **kwargs): """Show(self, int timeout=Timeout_Auto) -> bool""" return _misc_.NotificationMessage_Show(*args, **kwargs)
[ "def", "Show", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "NotificationMessage_Show", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L1236-L1238
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py
python
IRC.server
(self)
return c
Creates and returns a ServerConnection object.
Creates and returns a ServerConnection object.
[ "Creates", "and", "returns", "a", "ServerConnection", "object", "." ]
def server(self): """Creates and returns a ServerConnection object.""" c = ServerConnection(self) self.connections.append(c) return c
[ "def", "server", "(", "self", ")", ":", "c", "=", "ServerConnection", "(", "self", ")", "self", ".", "connections", ".", "append", "(", "c", ")", "return", "c" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L164-L169
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/shape_base.py
python
dstack
(tup)
return _nx.concatenate(arrs, 2)
Stack arrays in sequence depth wise (along third axis). This is equivalent to concatenation along the third axis after 2-D arrays of shape `(M,N)` have been reshaped to `(M,N,1)` and 1-D arrays of shape `(N,)` have been reshaped to `(1,N,1)`. Rebuilds arrays divided by `dsplit`. This function make...
Stack arrays in sequence depth wise (along third axis).
[ "Stack", "arrays", "in", "sequence", "depth", "wise", "(", "along", "third", "axis", ")", "." ]
def dstack(tup): """ Stack arrays in sequence depth wise (along third axis). This is equivalent to concatenation along the third axis after 2-D arrays of shape `(M,N)` have been reshaped to `(M,N,1)` and 1-D arrays of shape `(N,)` have been reshaped to `(1,N,1)`. Rebuilds arrays divided by `dsp...
[ "def", "dstack", "(", "tup", ")", ":", "if", "not", "overrides", ".", "ARRAY_FUNCTION_ENABLED", ":", "# raise warning if necessary", "_arrays_for_stack_dispatcher", "(", "tup", ",", "stacklevel", "=", "2", ")", "arrs", "=", "atleast_3d", "(", "*", "tup", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/shape_base.py#L664-L721
baoboa/pyqt5
11d5f43bc6f213d9d60272f3954a0048569cfc7c
pyuic/uic/driver.py
python
Driver._preview
(self)
return app.exec_()
Preview the .ui file. Return the exit status to be passed back to the parent process.
Preview the .ui file. Return the exit status to be passed back to the parent process.
[ "Preview", "the", ".", "ui", "file", ".", "Return", "the", "exit", "status", "to", "be", "passed", "back", "to", "the", "parent", "process", "." ]
def _preview(self): """ Preview the .ui file. Return the exit status to be passed back to the parent process. """ from PyQt5 import QtWidgets app = QtWidgets.QApplication([self._ui_file]) widget = loadUi(self._ui_file) widget.show() return app.exec_()
[ "def", "_preview", "(", "self", ")", ":", "from", "PyQt5", "import", "QtWidgets", "app", "=", "QtWidgets", ".", "QApplication", "(", "[", "self", ".", "_ui_file", "]", ")", "widget", "=", "loadUi", "(", "self", ".", "_ui_file", ")", "widget", ".", "sho...
https://github.com/baoboa/pyqt5/blob/11d5f43bc6f213d9d60272f3954a0048569cfc7c/pyuic/uic/driver.py#L63-L74
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/glcanvas.py
python
GLCanvas.SwapBuffers
(*args, **kwargs)
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
SwapBuffers(self) -> bool
SwapBuffers(self) -> bool
[ "SwapBuffers", "(", "self", ")", "-", ">", "bool" ]
def SwapBuffers(*args, **kwargs): """SwapBuffers(self) -> bool""" return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)
[ "def", "SwapBuffers", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_glcanvas", ".", "GLCanvas_SwapBuffers", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/glcanvas.py#L122-L124
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/esptool/pyaes/aes.py
python
AES.decrypt
(self, ciphertext)
return result
Decrypt a block of cipher text using the AES block cipher.
Decrypt a block of cipher text using the AES block cipher.
[ "Decrypt", "a", "block", "of", "cipher", "text", "using", "the", "AES", "block", "cipher", "." ]
def decrypt(self, ciphertext): 'Decrypt a block of cipher text using the AES block cipher.' if len(ciphertext) != 16: raise ValueError('wrong block length') rounds = len(self._Kd) - 1 (s1, s2, s3) = [3, 2, 1] a = [0, 0, 0, 0] # Convert ciphertext to (ints ^...
[ "def", "decrypt", "(", "self", ",", "ciphertext", ")", ":", "if", "len", "(", "ciphertext", ")", "!=", "16", ":", "raise", "ValueError", "(", "'wrong block length'", ")", "rounds", "=", "len", "(", "self", ".", "_Kd", ")", "-", "1", "(", "s1", ",", ...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/pyaes/aes.py#L237-L269
HackWebRTC/webrtc
7abfc990c00ab35090fff285fcf635d1d7892433
tools_webrtc/android/release_aar.py
python
_TestAAR
(tmp_dir, username, password, version)
Runs AppRTCMobile tests using the AAR. Returns true if the tests pass.
Runs AppRTCMobile tests using the AAR. Returns true if the tests pass.
[ "Runs", "AppRTCMobile", "tests", "using", "the", "AAR", ".", "Returns", "true", "if", "the", "tests", "pass", "." ]
def _TestAAR(tmp_dir, username, password, version): """Runs AppRTCMobile tests using the AAR. Returns true if the tests pass.""" logging.info('Testing library.') env = jinja2.Environment( loader=jinja2.PackageLoader('release_aar'), ) gradle_backup = os.path.join(tmp_dir, 'build.gradle.backup') app_grad...
[ "def", "_TestAAR", "(", "tmp_dir", ",", "username", ",", "password", ",", "version", ")", ":", "logging", ".", "info", "(", "'Testing library.'", ")", "env", "=", "jinja2", ".", "Environment", "(", "loader", "=", "jinja2", ".", "PackageLoader", "(", "'rele...
https://github.com/HackWebRTC/webrtc/blob/7abfc990c00ab35090fff285fcf635d1d7892433/tools_webrtc/android/release_aar.py#L138-L197
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_keyh.py
python
ViKeyHandler._ProcessKey
(self, key_code)
The real processing of keys
The real processing of keys
[ "The", "real", "processing", "of", "keys" ]
def _ProcessKey(self, key_code): """The real processing of keys""" char = unichr(key_code) if self.IsNormalMode() or self.IsVisualMode(): self.buffer += char if ed_vim.Parse(self.buffer, self.commander): # command was handled (or invalid) so clear buffer ...
[ "def", "_ProcessKey", "(", "self", ",", "key_code", ")", ":", "char", "=", "unichr", "(", "key_code", ")", "if", "self", ".", "IsNormalMode", "(", ")", "or", "self", ".", "IsVisualMode", "(", ")", ":", "self", ".", "buffer", "+=", "char", "if", "ed_v...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_keyh.py#L264-L277
OpenLightingProject/ola
d1433a1bed73276fbe55ce18c03b1c208237decc
python/ola/PidStore.py
python
Group.__init__
(self, name, atoms, **kwargs)
Create a group of atoms. Args: name: The name of the group atoms: The list of atoms the group contains Raises: PidStructureException: if the structure of this group is invalid.
Create a group of atoms.
[ "Create", "a", "group", "of", "atoms", "." ]
def __init__(self, name, atoms, **kwargs): """Create a group of atoms. Args: name: The name of the group atoms: The list of atoms the group contains Raises: PidStructureException: if the structure of this group is invalid. """ super(Group, self).__init__(name) self._atoms = a...
[ "def", "__init__", "(", "self", ",", "name", ",", "atoms", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Group", ",", "self", ")", ".", "__init__", "(", "name", ")", "self", ".", "_atoms", "=", "atoms", "self", ".", "_min", "=", "kwargs", "."...
https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/python/ola/PidStore.py#L700-L716
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/mixed_precision/autocast_variable.py
python
AutoCastVariable._dense_var_to_tensor
(self, dtype=None, name=None, as_ref=False)
return math_ops.cast(val, self._cast_dtype)
Converts this variable to a tensor.
Converts this variable to a tensor.
[ "Converts", "this", "variable", "to", "a", "tensor", "." ]
def _dense_var_to_tensor(self, dtype=None, name=None, as_ref=False): """Converts this variable to a tensor.""" if as_ref: # This ValueError should not occur in practice since it is impossible to # pass as_ref=True using public APIs. raise ValueError('Cannot convert AutoCastVariable to a tensor...
[ "def", "_dense_var_to_tensor", "(", "self", ",", "dtype", "=", "None", ",", "name", "=", "None", ",", "as_ref", "=", "False", ")", ":", "if", "as_ref", ":", "# This ValueError should not occur in practice since it is impossible to", "# pass as_ref=True using public APIs."...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/mixed_precision/autocast_variable.py#L133-L150
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Tool/GettextCommon.py
python
_translate
(env, target=None, source=SCons.Environment._null, *args, **kw)
return po
Function for `Translate()` pseudo-builder
Function for `Translate()` pseudo-builder
[ "Function", "for", "Translate", "()", "pseudo", "-", "builder" ]
def _translate(env, target=None, source=SCons.Environment._null, *args, **kw): """ Function for `Translate()` pseudo-builder """ if target is None: target = [] pot = env.POTUpdate(None, source, *args, **kw) po = env.POUpdate(target, pot, *args, **kw) return po
[ "def", "_translate", "(", "env", ",", "target", "=", "None", ",", "source", "=", "SCons", ".", "Environment", ".", "_null", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "if", "target", "is", "None", ":", "target", "=", "[", "]", "pot", "=", ...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/GettextCommon.py#L261-L266
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/html.py
python
HtmlWindow.OnOpeningURL
(*args, **kwargs)
return _html.HtmlWindow_OnOpeningURL(*args, **kwargs)
OnOpeningURL(self, int type, String url, String redirect) -> int
OnOpeningURL(self, int type, String url, String redirect) -> int
[ "OnOpeningURL", "(", "self", "int", "type", "String", "url", "String", "redirect", ")", "-", ">", "int" ]
def OnOpeningURL(*args, **kwargs): """OnOpeningURL(self, int type, String url, String redirect) -> int""" return _html.HtmlWindow_OnOpeningURL(*args, **kwargs)
[ "def", "OnOpeningURL", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWindow_OnOpeningURL", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1130-L1132
flexflow/FlexFlow
581fad8ba8d10a16a3102ee2b406b0319586df24
examples/python/keras/candle_uno/default_utils.py
python
finalize_parameters
(bmk)
return gParameters
Utility to parse parameters in common as well as parameters particular to each benchmark. Parameters ---------- bmk : benchmark object Object that has benchmark filepaths and specifications Return ---------- gParameters : python dictionary ...
Utility to parse parameters in common as well as parameters particular to each benchmark.
[ "Utility", "to", "parse", "parameters", "in", "common", "as", "well", "as", "parameters", "particular", "to", "each", "benchmark", "." ]
def finalize_parameters(bmk): """Utility to parse parameters in common as well as parameters particular to each benchmark. Parameters ---------- bmk : benchmark object Object that has benchmark filepaths and specifications Return ---------- gPara...
[ "def", "finalize_parameters", "(", "bmk", ")", ":", "# Parse common parameters", "bmk", ".", "parse_from_common", "(", ")", "# Parse parameters that are applicable just to benchmark", "bmk", ".", "parse_from_benchmark", "(", ")", "#print('Args:', args)", "# Get parameters from ...
https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/examples/python/keras/candle_uno/default_utils.py#L411-L463
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/data/benchmarks/interleave_benchmark.py
python
_make_fake_dataset_fn
(initial_delay_us, remainder_delay_us)
return fake_dataset_fn
Returns a dataset that emulates a remote storage data source. Returns a dataset factory which creates a dataset with 100 elements that emulates the performance characteristic of a file-based dataset stored in a remote storage. In particular, the first element will take an order of magnitude longer to produce t...
Returns a dataset that emulates a remote storage data source.
[ "Returns", "a", "dataset", "that", "emulates", "a", "remote", "storage", "data", "source", "." ]
def _make_fake_dataset_fn(initial_delay_us, remainder_delay_us): """Returns a dataset that emulates a remote storage data source. Returns a dataset factory which creates a dataset with 100 elements that emulates the performance characteristic of a file-based dataset stored in a remote storage. In particular, t...
[ "def", "_make_fake_dataset_fn", "(", "initial_delay_us", ",", "remainder_delay_us", ")", ":", "def", "fake_dataset_fn", "(", "unused", ")", ":", "\"\"\"Returns a function that creates a dataset with the specified delays.\"\"\"", "del", "unused", "def", "make_dataset", "(", "t...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/benchmarks/interleave_benchmark.py#L27-L56
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
python
MacTool._CommandifyName
(self, name_string)
return name_string.title().replace("-", "")
Transforms a tool name like copy-info-plist to CopyInfoPlist
Transforms a tool name like copy-info-plist to CopyInfoPlist
[ "Transforms", "a", "tool", "name", "like", "copy", "-", "info", "-", "plist", "to", "CopyInfoPlist" ]
def _CommandifyName(self, name_string): """Transforms a tool name like copy-info-plist to CopyInfoPlist""" return name_string.title().replace("-", "")
[ "def", "_CommandifyName", "(", "self", ",", "name_string", ")", ":", "return", "name_string", ".", "title", "(", ")", ".", "replace", "(", "\"-\"", ",", "\"\"", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py#L45-L47
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/utils/XmlParser.py
python
Element.getAttr
(self, key=None)
Get an attribute value.
Get an attribute value.
[ "Get", "an", "attribute", "value", "." ]
def getAttr(self, key=None): """ Get an attribute value. """ if key is None: return self.attribute else: return self.attribute.get(key)
[ "def", "getAttr", "(", "self", ",", "key", "=", "None", ")", ":", "if", "key", "is", "None", ":", "return", "self", ".", "attribute", "else", ":", "return", "self", ".", "attribute", ".", "get", "(", "key", ")" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/utils/XmlParser.py#L453-L460
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/MooseDocs/extensions/pdf.py
python
PDFExtension._processPages
(self, root)
return main
Build a main latex file that includes the others.
Build a main latex file that includes the others.
[ "Build", "a", "main", "latex", "file", "that", "includes", "the", "others", "." ]
def _processPages(self, root): """ Build a main latex file that includes the others. """ main = base.NodeBase(None, None) latex.Command(main, 'documentclass', string='report', end='') for package, options in self.translator.renderer.getPackages().items(): arg...
[ "def", "_processPages", "(", "self", ",", "root", ")", ":", "main", "=", "base", ".", "NodeBase", "(", "None", ",", "None", ")", "latex", ".", "Command", "(", "main", ",", "'documentclass'", ",", "string", "=", "'report'", ",", "end", "=", "''", ")",...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/pdf.py#L107-L144
nnrg/opennero
43e12a1bcba6e228639db3886fec1dc47ddc24cb
mods/TowerofHanoi/tree_viewer.py
python
TreeViewer.add_completed_index
(self, index_to_add, viewer_index)
adds the given item index to the list of items to mark completed, then updates the display. Makes sure the index isn't alreay there first
adds the given item index to the list of items to mark completed, then updates the display. Makes sure the index isn't alreay there first
[ "adds", "the", "given", "item", "index", "to", "the", "list", "of", "items", "to", "mark", "completed", "then", "updates", "the", "display", ".", "Makes", "sure", "the", "index", "isn", "t", "alreay", "there", "first" ]
def add_completed_index(self, index_to_add, viewer_index): """adds the given item index to the list of items to mark completed, then updates the display. Makes sure the index isn't alreay there first""" if (viewer_index < self.MAX_ITEM_VIEWERS): self.item_viewers[viewer_index].addCompletedI...
[ "def", "add_completed_index", "(", "self", ",", "index_to_add", ",", "viewer_index", ")", ":", "if", "(", "viewer_index", "<", "self", ".", "MAX_ITEM_VIEWERS", ")", ":", "self", ".", "item_viewers", "[", "viewer_index", "]", ".", "addCompletedIndex", "(", "ind...
https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/TowerofHanoi/tree_viewer.py#L242-L245
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/partitioned_variables.py
python
create_partitioned_variables
( shape, slicing, initializer, dtype=dtypes.float32, trainable=True, collections=None, name=None, reuse=None)
Create a list of partitioned variables according to the given `slicing`. Currently only one dimension of the full variable can be sliced, and the full variable can be reconstructed by the concatenation of the returned list along that dimension. Args: shape: List of integers. The shape of the full variabl...
Create a list of partitioned variables according to the given `slicing`.
[ "Create", "a", "list", "of", "partitioned", "variables", "according", "to", "the", "given", "slicing", "." ]
def create_partitioned_variables( shape, slicing, initializer, dtype=dtypes.float32, trainable=True, collections=None, name=None, reuse=None): """Create a list of partitioned variables according to the given `slicing`. Currently only one dimension of the full variable can be sliced, and the full variable...
[ "def", "create_partitioned_variables", "(", "shape", ",", "slicing", ",", "initializer", ",", "dtype", "=", "dtypes", ".", "float32", ",", "trainable", "=", "True", ",", "collections", "=", "None", ",", "name", "=", "None", ",", "reuse", "=", "None", ")", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/partitioned_variables.py#L218-L290
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
DataObjectComposite.GetReceivedFormat
(*args, **kwargs)
return _misc_.DataObjectComposite_GetReceivedFormat(*args, **kwargs)
GetReceivedFormat(self) -> DataFormat Report the format passed to the `SetData` method. This should be the format of the data object within the composite that recieved data from the clipboard or the DnD operation. You can use this method to find out what kind of data object was reciev...
GetReceivedFormat(self) -> DataFormat
[ "GetReceivedFormat", "(", "self", ")", "-", ">", "DataFormat" ]
def GetReceivedFormat(*args, **kwargs): """ GetReceivedFormat(self) -> DataFormat Report the format passed to the `SetData` method. This should be the format of the data object within the composite that recieved data from the clipboard or the DnD operation. You can use this me...
[ "def", "GetReceivedFormat", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DataObjectComposite_GetReceivedFormat", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5142-L5151
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/security.py
python
IdentityPoolUtils.add_pool_to_assume_role_policy
(identity_pool_id, policy_document)
return policy_document, update
Add an identity pool to an AssumeRolePolicy statement - Only adds the pool if the role federates to Cognito identities via AssumeRoleWithWebIdentity - Ensures that the pool identity is only added if its not in the standard aud condition :param identity_pool_id: The pool_id to add :para...
Add an identity pool to an AssumeRolePolicy statement - Only adds the pool if the role federates to Cognito identities via AssumeRoleWithWebIdentity - Ensures that the pool identity is only added if its not in the standard aud condition
[ "Add", "an", "identity", "pool", "to", "an", "AssumeRolePolicy", "statement", "-", "Only", "adds", "the", "pool", "if", "the", "role", "federates", "to", "Cognito", "identities", "via", "AssumeRoleWithWebIdentity", "-", "Ensures", "that", "the", "pool", "identit...
def add_pool_to_assume_role_policy(identity_pool_id, policy_document): """ Add an identity pool to an AssumeRolePolicy statement - Only adds the pool if the role federates to Cognito identities via AssumeRoleWithWebIdentity - Ensures that the pool identity is only added if its not in th...
[ "def", "add_pool_to_assume_role_policy", "(", "identity_pool_id", ",", "policy_document", ")", ":", "existing_pool_ids", ",", "cognito_federation_statement", ",", "cognito_aud_condition", "=", "IdentityPoolUtils", ".", "find_existing_pool_ids_references_in_assume_role_policy", "(",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/resource_manager/security.py#L940-L984
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/srv/_GetGeographicMap.py
python
GetGeographicMapResponse._get_types
(self)
return self._slot_types
internal API method
internal API method
[ "internal", "API", "method" ]
def _get_types(self): """ internal API method """ return self._slot_types
[ "def", "_get_types", "(", "self", ")", ":", "return", "self", ".", "_slot_types" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/srv/_GetGeographicMap.py#L347-L351
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/aoc/media_subprocessor.py
python
AoCMediaSubprocessor.convert
(cls, full_data_set)
Create all export requests for the dataset.
Create all export requests for the dataset.
[ "Create", "all", "export", "requests", "for", "the", "dataset", "." ]
def convert(cls, full_data_set): """ Create all export requests for the dataset. """ cls.create_graphics_requests(full_data_set) # cls.create_blend_requests(full_data_set) cls.create_sound_requests(full_data_set)
[ "def", "convert", "(", "cls", ",", "full_data_set", ")", ":", "cls", ".", "create_graphics_requests", "(", "full_data_set", ")", "# cls.create_blend_requests(full_data_set)", "cls", ".", "create_sound_requests", "(", "full_data_set", ")" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/media_subprocessor.py#L21-L27
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/multi_worker_util.py
python
has_worker_context
()
return dc_context.get_current_worker_context() is not None
Returns whether a worker context has been entered.
Returns whether a worker context has been entered.
[ "Returns", "whether", "a", "worker", "context", "has", "been", "entered", "." ]
def has_worker_context(): """Returns whether a worker context has been entered.""" return dc_context.get_current_worker_context() is not None
[ "def", "has_worker_context", "(", ")", ":", "return", "dc_context", ".", "get_current_worker_context", "(", ")", "is", "not", "None" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/multi_worker_util.py#L257-L259
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/serial/serialwin32.py
python
Serial.cd
(self)
return win32.MS_RLSD_ON & self._GetCommModemStatus() != 0
Read terminal status line: Carrier Detect
Read terminal status line: Carrier Detect
[ "Read", "terminal", "status", "line", ":", "Carrier", "Detect" ]
def cd(self): """Read terminal status line: Carrier Detect""" return win32.MS_RLSD_ON & self._GetCommModemStatus() != 0
[ "def", "cd", "(", "self", ")", ":", "return", "win32", ".", "MS_RLSD_ON", "&", "self", ".", "_GetCommModemStatus", "(", ")", "!=", "0" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialwin32.py#L410-L412
baidu/tera
dbcd28af792d879d961bf9fc7eb60de81b437646
src/sdk/python/TeraSdk.py
python
RowMutation.DeleteColumn
(self, cf, qu)
删除这一行上 ColumnFamily为<cf>, Qualifier为<qu>的cell Args: cf(string): ColumnFamily名 qu(string): Qualifier名
删除这一行上 ColumnFamily为<cf>, Qualifier为<qu>的cell
[ "删除这一行上", "ColumnFamily为<cf", ">", "Qualifier为<qu", ">", "的cell" ]
def DeleteColumn(self, cf, qu): """ 删除这一行上 ColumnFamily为<cf>, Qualifier为<qu>的cell Args: cf(string): ColumnFamily名 qu(string): Qualifier名 """ lib.tera_row_mutation_delete_column(self.mutation, cf, qu, c_uint6...
[ "def", "DeleteColumn", "(", "self", ",", "cf", ",", "qu", ")", ":", "lib", ".", "tera_row_mutation_delete_column", "(", "self", ".", "mutation", ",", "cf", ",", "qu", ",", "c_uint64", "(", "len", "(", "qu", ")", ")", ")" ]
https://github.com/baidu/tera/blob/dbcd28af792d879d961bf9fc7eb60de81b437646/src/sdk/python/TeraSdk.py#L421-L430
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSProject.py
python
Writer.AddFileConfig
(self, path, config, attrs=None, tools=None)
Adds a configuration to a file. Args: path: Relative path to the file. config: Name of configuration to add. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. Raises: ValueError: Relative path does not match any fil...
Adds a configuration to a file.
[ "Adds", "a", "configuration", "to", "a", "file", "." ]
def AddFileConfig(self, path, config, attrs=None, tools=None): """Adds a configuration to a file. Args: path: Relative path to the file. config: Name of configuration to add. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be Non...
[ "def", "AddFileConfig", "(", "self", ",", "path", ",", "config", ",", "attrs", "=", "None", ",", "tools", "=", "None", ")", ":", "# Find the file node with the right relative path", "parent", "=", "self", ".", "files_dict", ".", "get", "(", "path", ")", "if"...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSProject.py#L166-L186
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/generator/ninja.py
python
CalculateVariables
(default_variables, params)
Calculate additional variables for use in the build (called by gyp).
Calculate additional variables for use in the build (called by gyp).
[ "Calculate", "additional", "variables", "for", "use", "in", "the", "build", "(", "called", "by", "gyp", ")", "." ]
def CalculateVariables(default_variables, params): """Calculate additional variables for use in the build (called by gyp).""" global generator_additional_non_configuration_keys global generator_additional_path_sections flavor = gyp.common.GetFlavor(params) if flavor == 'mac': default_variables.setdefault(...
[ "def", "CalculateVariables", "(", "default_variables", ",", "params", ")", ":", "global", "generator_additional_non_configuration_keys", "global", "generator_additional_path_sections", "flavor", "=", "gyp", ".", "common", ".", "GetFlavor", "(", "params", ")", "if", "fla...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/ninja.py#L1222-L1284
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBData.Append
(self, rhs)
return _lldb.SBData_Append(self, rhs)
Append(SBData self, SBData rhs) -> bool
Append(SBData self, SBData rhs) -> bool
[ "Append", "(", "SBData", "self", "SBData", "rhs", ")", "-", ">", "bool" ]
def Append(self, rhs): """Append(SBData self, SBData rhs) -> bool""" return _lldb.SBData_Append(self, rhs)
[ "def", "Append", "(", "self", ",", "rhs", ")", ":", "return", "_lldb", ".", "SBData_Append", "(", "self", ",", "rhs", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3422-L3424
bumptop/BumpTop
466d23597a07ae738f4265262fa01087fc6e257c
trunk/win/Source/bin/jinja2/parser.py
python
Parser.parse_assign_target
(self, with_tuple=True, name_only=False, extra_end_rules=None)
return target
Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that can be disable however by setting `with_tuple` to `False`. If only assignments to names are wanted `name_only`...
Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that can be disable however by setting `with_tuple` to `False`. If only assignments to names are wanted `name_only`...
[ "Parse", "an", "assignment", "target", ".", "As", "Jinja2", "allows", "assignments", "to", "tuples", "this", "function", "can", "parse", "all", "allowed", "assignment", "targets", ".", "Per", "default", "assignments", "to", "tuples", "are", "parsed", "that", "...
def parse_assign_target(self, with_tuple=True, name_only=False, extra_end_rules=None): """Parse an assignment target. As Jinja2 allows assignments to tuples, this function can parse all allowed assignment targets. Per default assignments to tuples are parsed, that c...
[ "def", "parse_assign_target", "(", "self", ",", "with_tuple", "=", "True", ",", "name_only", "=", "False", ",", "extra_end_rules", "=", "None", ")", ":", "if", "name_only", ":", "token", "=", "self", ".", "stream", ".", "expect", "(", "'name'", ")", "tar...
https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/parser.py#L281-L303
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/passes/auto_parallel_recompute.py
python
_get_stop_gradients
(program, no_grad_set)
return no_grad_set_name
get no grad var
get no grad var
[ "get", "no", "grad", "var" ]
def _get_stop_gradients(program, no_grad_set): """ get no grad var """ if no_grad_set is None: no_grad_set = set() else: no_grad_set = _get_no_grad_set_name(no_grad_set) no_grad_set_name = set() for var in program.list_vars(): assert isinstance(var, Variable) if "@GR...
[ "def", "_get_stop_gradients", "(", "program", ",", "no_grad_set", ")", ":", "if", "no_grad_set", "is", "None", ":", "no_grad_set", "=", "set", "(", ")", "else", ":", "no_grad_set", "=", "_get_no_grad_set_name", "(", "no_grad_set", ")", "no_grad_set_name", "=", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/passes/auto_parallel_recompute.py#L162-L177
cmu-db/bustub
fe1b9e984bd2967997b52df872c873d80f71cf7d
build_support/cpplint.py
python
CheckForIncludeWhatYouUse
(filename, clean_lines, include_state, error, io=codecs)
Reports for missing stl includes. This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one reason to include a header. For example, if you use both equal_to<> and less<> in a .h file, only one (the latter in the ...
Reports for missing stl includes.
[ "Reports", "for", "missing", "stl", "includes", "." ]
def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, io=codecs): """Reports for missing stl includes. This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one r...
[ "def", "CheckForIncludeWhatYouUse", "(", "filename", ",", "clean_lines", ",", "include_state", ",", "error", ",", "io", "=", "codecs", ")", ":", "required", "=", "{", "}", "# A map of header name to linenumber and the template entity.", "# Example of required: { '<functiona...
https://github.com/cmu-db/bustub/blob/fe1b9e984bd2967997b52df872c873d80f71cf7d/build_support/cpplint.py#L5782-L5880
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/posixpath.py
python
abspath
(path)
return normpath(path)
Return an absolute path.
Return an absolute path.
[ "Return", "an", "absolute", "path", "." ]
def abspath(path): """Return an absolute path.""" path = os.fspath(path) if not isabs(path): if isinstance(path, bytes): cwd = os.getcwdb() else: cwd = os.getcwd() path = join(cwd, path) return normpath(path)
[ "def", "abspath", "(", "path", ")", ":", "path", "=", "os", ".", "fspath", "(", "path", ")", "if", "not", "isabs", "(", "path", ")", ":", "if", "isinstance", "(", "path", ",", "bytes", ")", ":", "cwd", "=", "os", ".", "getcwdb", "(", ")", "else...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/posixpath.py#L373-L382
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/zoombar.py
python
ImageBar.SetSize
(self, xSize, ySize)
Sets the size of :class:`ImageBar`. :param `xSize`: the width of the bar, in pixels; :param `ySize`: the height of the bar, in pixels.
Sets the size of :class:`ImageBar`.
[ "Sets", "the", "size", "of", ":", "class", ":", "ImageBar", "." ]
def SetSize(self, xSize, ySize): """ Sets the size of :class:`ImageBar`. :param `xSize`: the width of the bar, in pixels; :param `ySize`: the height of the bar, in pixels. """ self.SetBarColour(self._startColour, xSize, ySize)
[ "def", "SetSize", "(", "self", ",", "xSize", ",", "ySize", ")", ":", "self", ".", "SetBarColour", "(", "self", ".", "_startColour", ",", "xSize", ",", "ySize", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/zoombar.py#L610-L618
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py
python
DNSFlippingRatioCorr.__init__
(self)
Init
Init
[ "Init" ]
def __init__(self): """ Init """ PythonAlgorithm.__init__(self) self.input_workspaces = {} self.sf_outws_name = None self.nsf_outws_name = None
[ "def", "__init__", "(", "self", ")", ":", "PythonAlgorithm", ".", "__init__", "(", "self", ")", "self", ".", "input_workspaces", "=", "{", "}", "self", ".", "sf_outws_name", "=", "None", "self", ".", "nsf_outws_name", "=", "None" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py#L25-L32
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/utils/io/io_xml.py
python
xml_handler.__init__
(self)
Initializes xml_handler.
Initializes xml_handler.
[ "Initializes", "xml_handler", "." ]
def __init__(self): """Initializes xml_handler.""" #root xml node with all the data self.root = xml_node(name="root", fields=[]) self.open = [self.root] #current level of the hierarchy self.level = 0 #Holds all the data between each of the tags. #If level = 1, then buffe...
[ "def", "__init__", "(", "self", ")", ":", "#root xml node with all the data", "self", ".", "root", "=", "xml_node", "(", "name", "=", "\"root\"", ",", "fields", "=", "[", "]", ")", "self", ".", "open", "=", "[", "self", ".", "root", "]", "#current level ...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/utils/io/io_xml.py#L103-L115
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Rect2D.SetTop
(*args, **kwargs)
return _core_.Rect2D_SetTop(*args, **kwargs)
SetTop(self, Double n)
SetTop(self, Double n)
[ "SetTop", "(", "self", "Double", "n", ")" ]
def SetTop(*args, **kwargs): """SetTop(self, Double n)""" return _core_.Rect2D_SetTop(*args, **kwargs)
[ "def", "SetTop", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_SetTop", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L1871-L1873
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_search.py
python
SearchResultList.ApplyStyles
(self, start, txt)
Set a hotspot for each search result Search matches strings should be formatted as follows /file/name (line) match string @param start: long @param txt: string
Set a hotspot for each search result Search matches strings should be formatted as follows /file/name (line) match string @param start: long @param txt: string
[ "Set", "a", "hotspot", "for", "each", "search", "result", "Search", "matches", "strings", "should", "be", "formatted", "as", "follows", "/", "file", "/", "name", "(", "line", ")", "match", "string", "@param", "start", ":", "long", "@param", "txt", ":", "...
def ApplyStyles(self, start, txt): """Set a hotspot for each search result Search matches strings should be formatted as follows /file/name (line) match string @param start: long @param txt: string """ self.StartStyling(start, 0x1f) if re.match(SearchResu...
[ "def", "ApplyStyles", "(", "self", ",", "start", ",", "txt", ")", ":", "self", ".", "StartStyling", "(", "start", ",", "0x1f", ")", "if", "re", ".", "match", "(", "SearchResultList", ".", "RE_FIND_MATCH", ",", "txt", ")", ":", "self", ".", "SetStyling"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_search.py#L1471-L1483
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/bdist_egg.py
python
bdist_egg.call_command
(self, cmdname, **kw)
return cmd
Invoke reinitialized command `cmdname` with keyword args
Invoke reinitialized command `cmdname` with keyword args
[ "Invoke", "reinitialized", "command", "cmdname", "with", "keyword", "args" ]
def call_command(self, cmdname, **kw): """Invoke reinitialized command `cmdname` with keyword args""" for dirname in INSTALL_DIRECTORY_ATTRS: kw.setdefault(dirname, self.bdist_dir) kw.setdefault('skip_build', self.skip_build) kw.setdefault('dry_run', self.dry_run) cmd...
[ "def", "call_command", "(", "self", ",", "cmdname", ",", "*", "*", "kw", ")", ":", "for", "dirname", "in", "INSTALL_DIRECTORY_ATTRS", ":", "kw", ".", "setdefault", "(", "dirname", ",", "self", ".", "bdist_dir", ")", "kw", ".", "setdefault", "(", "'skip_b...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/bdist_egg.py#L152-L160
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/idlelib/TreeWidget.py
python
TreeItem.GetSubList
(self)
Return list of items forming sublist.
Return list of items forming sublist.
[ "Return", "list", "of", "items", "forming", "sublist", "." ]
def GetSubList(self): """Return list of items forming sublist."""
[ "def", "GetSubList", "(", "self", ")", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/TreeWidget.py#L356-L357
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/docs/parser.py
python
_ModulePageInfo.collect_docs_for_module
(self, parser_config)
Collect information necessary specifically for a module's doc page. Mainly this is information about the members of the module. Args: parser_config: An instance of ParserConfig.
Collect information necessary specifically for a module's doc page.
[ "Collect", "information", "necessary", "specifically", "for", "a", "module", "s", "doc", "page", "." ]
def collect_docs_for_module(self, parser_config): """Collect information necessary specifically for a module's doc page. Mainly this is information about the members of the module. Args: parser_config: An instance of ParserConfig. """ relative_path = os.path.relpath( path='.', ...
[ "def", "collect_docs_for_module", "(", "self", ",", "parser_config", ")", ":", "relative_path", "=", "os", ".", "path", ".", "relpath", "(", "path", "=", "'.'", ",", "start", "=", "os", ".", "path", ".", "dirname", "(", "documentation_path", "(", "self", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/docs/parser.py#L1408-L1447
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextFileHandlerList.__iter__
(*args, **kwargs)
return _richtext.RichTextFileHandlerList___iter__(*args, **kwargs)
__iter__(self) -> RichTextFileHandlerList_iterator
__iter__(self) -> RichTextFileHandlerList_iterator
[ "__iter__", "(", "self", ")", "-", ">", "RichTextFileHandlerList_iterator" ]
def __iter__(*args, **kwargs): """__iter__(self) -> RichTextFileHandlerList_iterator""" return _richtext.RichTextFileHandlerList___iter__(*args, **kwargs)
[ "def", "__iter__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextFileHandlerList___iter__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2187-L2189
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
benchmarks/operator_benchmark/benchmark_caffe2.py
python
generate_c2_test
(configs, c2_bench_op)
return _register_test(configs, c2_bench_op, create_caffe2_op_test_case, False)
This function creates Caffe2 op test based on the given operator
This function creates Caffe2 op test based on the given operator
[ "This", "function", "creates", "Caffe2", "op", "test", "based", "on", "the", "given", "operator" ]
def generate_c2_test(configs, c2_bench_op): """ This function creates Caffe2 op test based on the given operator """ return _register_test(configs, c2_bench_op, create_caffe2_op_test_case, False)
[ "def", "generate_c2_test", "(", "configs", ",", "c2_bench_op", ")", ":", "return", "_register_test", "(", "configs", ",", "c2_bench_op", ",", "create_caffe2_op_test_case", ",", "False", ")" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/benchmarks/operator_benchmark/benchmark_caffe2.py#L194-L198
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/inspector_protocol/jinja2/debug.py
python
ProcessedTraceback.exc_info
(self)
return self.exc_type, self.exc_value, self.frames[0]
Exception info tuple with a proxy around the frame objects.
Exception info tuple with a proxy around the frame objects.
[ "Exception", "info", "tuple", "with", "a", "proxy", "around", "the", "frame", "objects", "." ]
def exc_info(self): """Exception info tuple with a proxy around the frame objects.""" return self.exc_type, self.exc_value, self.frames[0]
[ "def", "exc_info", "(", "self", ")", ":", "return", "self", ".", "exc_type", ",", "self", ".", "exc_value", ",", "self", ".", "frames", "[", "0", "]" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/debug.py#L117-L119
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/appController.py
python
AppController._setFrameIndex
(self, frameIndex)
Set the `frameIndex`. Args: frameIndex (int): The new frame index value.
Set the `frameIndex`.
[ "Set", "the", "frameIndex", "." ]
def _setFrameIndex(self, frameIndex): """Set the `frameIndex`. Args: frameIndex (int): The new frame index value. """ # Ensure the frameIndex exists, if not, return. try: frame = self._timeSamples[frameIndex] except IndexError: return ...
[ "def", "_setFrameIndex", "(", "self", ",", "frameIndex", ")", ":", "# Ensure the frameIndex exists, if not, return.", "try", ":", "frame", "=", "self", ".", "_timeSamples", "[", "frameIndex", "]", "except", "IndexError", ":", "return", "currentFrame", "=", "Usd", ...
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/appController.py#L3451-L3471
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Taskmaster.py
python
Taskmaster.stop
(self)
Stops the current build completely.
Stops the current build completely.
[ "Stops", "the", "current", "build", "completely", "." ]
def stop(self): """ Stops the current build completely. """ self.next_candidate = self.no_next_candidate
[ "def", "stop", "(", "self", ")", ":", "self", ".", "next_candidate", "=", "self", ".", "no_next_candidate" ]
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Taskmaster.py#L1020-L1024
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py
python
VimPane.get_content
(self, target, controller)
subclasses implement this to provide pane content
subclasses implement this to provide pane content
[ "subclasses", "implement", "this", "to", "provide", "pane", "content" ]
def get_content(self, target, controller): """ subclasses implement this to provide pane content """ assert(0 and "pane subclass must implement this") pass
[ "def", "get_content", "(", "self", ",", "target", ",", "controller", ")", ":", "assert", "(", "0", "and", "\"pane subclass must implement this\"", ")", "pass" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L388-L391
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/compat/numpy/function.py
python
validate_take_with_convert
(convert, args, kwargs)
return convert
If this function is called via the 'numpy' library, the third parameter in its signature is 'axis', which takes either an ndarray or 'None', so check if the 'convert' parameter is either an instance of ndarray or is None
If this function is called via the 'numpy' library, the third parameter in its signature is 'axis', which takes either an ndarray or 'None', so check if the 'convert' parameter is either an instance of ndarray or is None
[ "If", "this", "function", "is", "called", "via", "the", "numpy", "library", "the", "third", "parameter", "in", "its", "signature", "is", "axis", "which", "takes", "either", "an", "ndarray", "or", "None", "so", "check", "if", "the", "convert", "parameter", ...
def validate_take_with_convert(convert, args, kwargs): """ If this function is called via the 'numpy' library, the third parameter in its signature is 'axis', which takes either an ndarray or 'None', so check if the 'convert' parameter is either an instance of ndarray or is None """ if isin...
[ "def", "validate_take_with_convert", "(", "convert", ",", "args", ",", "kwargs", ")", ":", "if", "isinstance", "(", "convert", ",", "ndarray", ")", "or", "convert", "is", "None", ":", "args", "=", "(", "convert", ",", ")", "+", "args", "convert", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/compat/numpy/function.py#L281-L294
bitcoinx-project/bitcoinx
d422a992e7efee1ea1fb82cf7a1e81e04ca716c0
contrib/linearize/linearize-data.py
python
hex_switchEndian
(s)
return b''.join(pairList[::-1]).decode()
Switches the endianness of a hex string (in pairs of hex chars)
Switches the endianness of a hex string (in pairs of hex chars)
[ "Switches", "the", "endianness", "of", "a", "hex", "string", "(", "in", "pairs", "of", "hex", "chars", ")" ]
def hex_switchEndian(s): """ Switches the endianness of a hex string (in pairs of hex chars) """ pairList = [s[i:i+2].encode() for i in range(0, len(s), 2)] return b''.join(pairList[::-1]).decode()
[ "def", "hex_switchEndian", "(", "s", ")", ":", "pairList", "=", "[", "s", "[", "i", ":", "i", "+", "2", "]", ".", "encode", "(", ")", "for", "i", "in", "range", "(", "0", ",", "len", "(", "s", ")", ",", "2", ")", "]", "return", "b''", ".", ...
https://github.com/bitcoinx-project/bitcoinx/blob/d422a992e7efee1ea1fb82cf7a1e81e04ca716c0/contrib/linearize/linearize-data.py#L25-L28
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBProcess.ReadMemory
(self, addr, buf, error)
return _lldb.SBProcess_ReadMemory(self, addr, buf, error)
Reads memory from the current process's address space and removes any traps that may have been inserted into the memory. It returns the byte buffer in a Python string. Example: # Read 4 bytes from address 'addr' and assume error.Success() is True. content = process.ReadMemory(addr, 4, e...
[]
def ReadMemory(self, addr, buf, error): """ Reads memory from the current process's address space and removes any traps that may have been inserted into the memory. It returns the byte buffer in a Python string. Example: # Read 4 bytes from address 'addr' and assume error.Succe...
[ "def", "ReadMemory", "(", "self", ",", "addr", ",", "buf", ",", "error", ")", ":", "return", "_lldb", ".", "SBProcess_ReadMemory", "(", "self", ",", "addr", ",", "buf", ",", "error", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L8567-L8578
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/xml/etree/ElementTree.py
python
XMLPullParser.feed
(self, data)
Feed encoded data to parser.
Feed encoded data to parser.
[ "Feed", "encoded", "data", "to", "parser", "." ]
def feed(self, data): """Feed encoded data to parser.""" if self._parser is None: raise ValueError("feed() called after end of stream") if data: try: self._parser.feed(data) except SyntaxError as exc: self._events_queue.append(e...
[ "def", "feed", "(", "self", ",", "data", ")", ":", "if", "self", ".", "_parser", "is", "None", ":", "raise", "ValueError", "(", "\"feed() called after end of stream\"", ")", "if", "data", ":", "try", ":", "self", ".", "_parser", ".", "feed", "(", "data",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/etree/ElementTree.py#L1295-L1303
sigmaai/self-driving-golf-cart
8d891600af3d851add27a10ae45cf3c2108bb87c
ros/src/detection/object_detection/scripts/yolo3/model.py
python
tiny_yolo_body
(inputs, num_anchors, num_classes)
return Model(inputs, [y1,y2])
Create Tiny YOLO_v3 model CNN body in keras.
Create Tiny YOLO_v3 model CNN body in keras.
[ "Create", "Tiny", "YOLO_v3", "model", "CNN", "body", "in", "keras", "." ]
def tiny_yolo_body(inputs, num_anchors, num_classes): """Create Tiny YOLO_v3 model CNN body in keras.""" x1 = compose( DarknetConv2D_BN_Leaky(16, (3,3)), MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='same'), DarknetConv2D_BN_Leaky(32, (3,3)), MaxPooling2D(...
[ "def", "tiny_yolo_body", "(", "inputs", ",", "num_anchors", ",", "num_classes", ")", ":", "x1", "=", "compose", "(", "DarknetConv2D_BN_Leaky", "(", "16", ",", "(", "3", ",", "3", ")", ")", ",", "MaxPooling2D", "(", "pool_size", "=", "(", "2", ",", "2",...
https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/detection/object_detection/scripts/yolo3/model.py#L102-L132
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
ResourceManager.cleanup_resources
(self, force=False)
Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be called when the extraction path is a temporary directory ex...
Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be called when the extraction path is a temporary directory ex...
[ "Delete", "all", "extracted", "resource", "files", "and", "directories", "returning", "a", "list", "of", "the", "file", "and", "directory", "names", "that", "could", "not", "be", "successfully", "removed", ".", "This", "function", "does", "not", "have", "any",...
def cleanup_resources(self, force=False): """ Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be calle...
[ "def", "cleanup_resources", "(", "self", ",", "force", "=", "False", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L1291-L1301
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/regularizers.py
python
sum_regularizer
(regularizer_list, scope=None)
return sum_reg
Returns a function that applies the sum of multiple regularizers. Args: regularizer_list: A list of regularizers to apply. scope: An optional scope name Returns: A function with signature `sum_reg(weights)` that applies the sum of all the input regularizers.
Returns a function that applies the sum of multiple regularizers.
[ "Returns", "a", "function", "that", "applies", "the", "sum", "of", "multiple", "regularizers", "." ]
def sum_regularizer(regularizer_list, scope=None): """Returns a function that applies the sum of multiple regularizers. Args: regularizer_list: A list of regularizers to apply. scope: An optional scope name Returns: A function with signature `sum_reg(weights)` that applies the sum of all the inp...
[ "def", "sum_regularizer", "(", "regularizer_list", ",", "scope", "=", "None", ")", ":", "regularizer_list", "=", "[", "reg", "for", "reg", "in", "regularizer_list", "if", "reg", "is", "not", "None", "]", "if", "not", "regularizer_list", ":", "return", "None"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/regularizers.py#L141-L167
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/muji.py
python
OnGPU
(gpu_id)
return device_option
A utility function that returns a device option protobuf of the specified gpu id.
A utility function that returns a device option protobuf of the specified gpu id.
[ "A", "utility", "function", "that", "returns", "a", "device", "option", "protobuf", "of", "the", "specified", "gpu", "id", "." ]
def OnGPU(gpu_id): """A utility function that returns a device option protobuf of the specified gpu id. """ device_option = caffe2_pb2.DeviceOption() device_option.device_type = workspace.GpuDeviceType device_option.device_id = gpu_id return device_option
[ "def", "OnGPU", "(", "gpu_id", ")", ":", "device_option", "=", "caffe2_pb2", ".", "DeviceOption", "(", ")", "device_option", ".", "device_type", "=", "workspace", ".", "GpuDeviceType", "device_option", ".", "device_id", "=", "gpu_id", "return", "device_option" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/muji.py#L23-L30
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_4_0_2.py
python
MiroInterpreter.do_mythtv_item_remove
(self, args)
Removes an item from Miro by file name or Channel and title
Removes an item from Miro by file name or Channel and title
[ "Removes", "an", "item", "from", "Miro", "by", "file", "name", "or", "Channel", "and", "title" ]
def do_mythtv_item_remove(self, args): """Removes an item from Miro by file name or Channel and title""" for it in item.Item.downloaded_view(): if isinstance(args, list): if not args[0] or not args[1]: continue if filter(self.is_not_punct_...
[ "def", "do_mythtv_item_remove", "(", "self", ",", "args", ")", ":", "for", "it", "in", "item", ".", "Item", ".", "downloaded_view", "(", ")", ":", "if", "isinstance", "(", "args", ",", "list", ")", ":", "if", "not", "args", "[", "0", "]", "or", "no...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_4_0_2.py#L372-L394
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/clang/tools/scan-build-py/libscanbuild/intercept.py
python
entry_hash
(entry)
return '<>'.join([filename, directory, command])
Implement unique hash method for compilation database entries.
Implement unique hash method for compilation database entries.
[ "Implement", "unique", "hash", "method", "for", "compilation", "database", "entries", "." ]
def entry_hash(entry): """ Implement unique hash method for compilation database entries. """ # For faster lookup in set filename is reverted filename = entry['file'][::-1] # For faster lookup in set directory is reverted directory = entry['directory'][::-1] # On OS X the 'cc' and 'c++' compile...
[ "def", "entry_hash", "(", "entry", ")", ":", "# For faster lookup in set filename is reverted", "filename", "=", "entry", "[", "'file'", "]", "[", ":", ":", "-", "1", "]", "# For faster lookup in set directory is reverted", "directory", "=", "entry", "[", "'directory'...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/tools/scan-build-py/libscanbuild/intercept.py#L249-L262
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/api.py
python
pinned
(*arylist)
A context manager for temporary pinning a sequence of host ndarrays.
A context manager for temporary pinning a sequence of host ndarrays.
[ "A", "context", "manager", "for", "temporary", "pinning", "a", "sequence", "of", "host", "ndarrays", "." ]
def pinned(*arylist): """A context manager for temporary pinning a sequence of host ndarrays. """ pmlist = [] for ary in arylist: pm = current_context().mempin(ary, driver.host_pointer(ary), driver.host_memory_size(ary), ...
[ "def", "pinned", "(", "*", "arylist", ")", ":", "pmlist", "=", "[", "]", "for", "ary", "in", "arylist", ":", "pm", "=", "current_context", "(", ")", ".", "mempin", "(", "ary", ",", "driver", ".", "host_pointer", "(", "ary", ")", ",", "driver", ".",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/api.py#L276-L285
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListItemData.SetBackgroundColour
(self, colour)
Sets the background colour for the item. :param `colour`: an instance of :class:`Colour`.
Sets the background colour for the item.
[ "Sets", "the", "background", "colour", "for", "the", "item", "." ]
def SetBackgroundColour(self, colour): """ Sets the background colour for the item. :param `colour`: an instance of :class:`Colour`. """ if colour == wx.NullColour: self._hasBackColour = False del self._backColour return self...
[ "def", "SetBackgroundColour", "(", "self", ",", "colour", ")", ":", "if", "colour", "==", "wx", ".", "NullColour", ":", "self", ".", "_hasBackColour", "=", "False", "del", "self", ".", "_backColour", "return", "self", ".", "_hasBackColour", "=", "True", "s...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L2667-L2680
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/feature_extraction/text.py
python
strip_accents_unicode
(s)
Transform accentuated unicode symbols into their simple counterpart Warning: the python-level loop and join operations make this implementation 20 times slower than the strip_accents_ascii basic normalization. See also -------- strip_accents_ascii Remove accentuated char for any unicod...
Transform accentuated unicode symbols into their simple counterpart
[ "Transform", "accentuated", "unicode", "symbols", "into", "their", "simple", "counterpart" ]
def strip_accents_unicode(s): """Transform accentuated unicode symbols into their simple counterpart Warning: the python-level loop and join operations make this implementation 20 times slower than the strip_accents_ascii basic normalization. See also -------- strip_accents_ascii R...
[ "def", "strip_accents_unicode", "(", "s", ")", ":", "normalized", "=", "unicodedata", ".", "normalize", "(", "'NFKD'", ",", "s", ")", "if", "normalized", "==", "s", ":", "return", "s", "else", ":", "return", "''", ".", "join", "(", "[", "c", "for", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/feature_extraction/text.py#L45-L62