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
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/graph/lattice.py
python
Lattice.vector_to_site
(self, vector: CoordT)
return self.id_from_basis_coords([*vector, 0])
Deprecated. please use :code:`id_from_basis_coords([*vector, 0])` instead.
Deprecated. please use :code:`id_from_basis_coords([*vector, 0])` instead.
[ "Deprecated", ".", "please", "use", ":", "code", ":", "id_from_basis_coords", "(", "[", "*", "vector", "0", "]", ")", "instead", "." ]
def vector_to_site(self, vector: CoordT) -> int: """Deprecated. please use :code:`id_from_basis_coords([*vector, 0])` instead.""" # Note: This only gives one site within the unit cell, so that # `vector_to_site(site_to_vector(i)) == i` is _not_ true in general, # which is consistent with...
[ "def", "vector_to_site", "(", "self", ",", "vector", ":", "CoordT", ")", "->", "int", ":", "# Note: This only gives one site within the unit cell, so that", "# `vector_to_site(site_to_vector(i)) == i` is _not_ true in general,", "# which is consistent with the behavior of the v2 lattice....
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/graph/lattice.py#L722-L727
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/s3transfer/download.py
python
IOStreamingWriteTask._main
(self, fileobj, data)
Write data to a fileobj. Data will be written directly to the fileboj without any prior seeking. :param fileobj: The fileobj to write content to :param data: The data to write
Write data to a fileobj.
[ "Write", "data", "to", "a", "fileobj", "." ]
def _main(self, fileobj, data): """Write data to a fileobj. Data will be written directly to the fileboj without any prior seeking. :param fileobj: The fileobj to write content to :param data: The data to write """ fileobj.write(data)
[ "def", "_main", "(", "self", ",", "fileobj", ",", "data", ")", ":", "fileobj", ".", "write", "(", "data", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/s3transfer/download.py#L589-L599
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/kvstore/base.py
python
KVStoreBase.load_optimizer_states
(self, fname)
Loads the optimizer (updater) state from the file. Parameters ---------- fname : str Path to input states file.
Loads the optimizer (updater) state from the file.
[ "Loads", "the", "optimizer", "(", "updater", ")", "state", "from", "the", "file", "." ]
def load_optimizer_states(self, fname): """Loads the optimizer (updater) state from the file. Parameters ---------- fname : str Path to input states file. """ raise NotImplementedError()
[ "def", "load_optimizer_states", "(", "self", ",", "fname", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/kvstore/base.py#L174-L182
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/packager/formats.py
python
FlatFormatter._get_base
(self, path)
return mozpath.basedir(path, self._bases)
Return the deepest base directory containing the given path.
Return the deepest base directory containing the given path.
[ "Return", "the", "deepest", "base", "directory", "containing", "the", "given", "path", "." ]
def _get_base(self, path): ''' Return the deepest base directory containing the given path. ''' self._frozen_bases = True return mozpath.basedir(path, self._bases)
[ "def", "_get_base", "(", "self", ",", "path", ")", ":", "self", ".", "_frozen_bases", "=", "True", "return", "mozpath", ".", "basedir", "(", "path", ",", "self", ".", "_bases", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/packager/formats.py#L85-L90
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/davclient/davclient.py
python
DAVClient.move_collection
(self, source, destination, depth='infinity', overwrite=True, headers=None)
Move DAV collection and copy all properties
Move DAV collection and copy all properties
[ "Move", "DAV", "collection", "and", "copy", "all", "properties" ]
def move_collection(self, source, destination, depth='infinity', overwrite=True, headers=None): """Move DAV collection and copy all properties""" body = '<?xml version="1.0" encoding="utf-8" ?><d:propertybehavior xmlns:d="DAV:"><d:keepalive>*</d:keepalive></d:propertybehavior>' # Add pr...
[ "def", "move_collection", "(", "self", ",", "source", ",", "destination", ",", "depth", "=", "'infinity'", ",", "overwrite", "=", "True", ",", "headers", "=", "None", ")", ":", "body", "=", "'<?xml version=\"1.0\" encoding=\"utf-8\" ?><d:propertybehavior xmlns:d=\"DAV...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/davclient/davclient.py#L183-L192
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rostopic/src/rostopic/__init__.py
python
CallbackEcho.__init__
(self, topic, msg_eval, plot=False, filter_fn=None, echo_clear=False, echo_all_topics=False, offset_time=False, count=None, field_filter_fn=None, fixed_numeric_width=None)
:param plot: if ``True``, echo in plotting-friendly format (csv), ``bool`` :param filter_fn: function that evaluates to ``True`` if message is to be echo'd, ``fn(topic, msg)`` :param echo_all_topics: (optional) if ``True``, echo all messages in bag, ``bool`` :param offset_time: (optional) if ``T...
:param plot: if ``True``, echo in plotting-friendly format (csv), ``bool`` :param filter_fn: function that evaluates to ``True`` if message is to be echo'd, ``fn(topic, msg)`` :param echo_all_topics: (optional) if ``True``, echo all messages in bag, ``bool`` :param offset_time: (optional) if ``T...
[ ":", "param", "plot", ":", "if", "True", "echo", "in", "plotting", "-", "friendly", "format", "(", "csv", ")", "bool", ":", "param", "filter_fn", ":", "function", "that", "evaluates", "to", "True", "if", "message", "is", "to", "be", "echo", "d", "fn", ...
def __init__(self, topic, msg_eval, plot=False, filter_fn=None, echo_clear=False, echo_all_topics=False, offset_time=False, count=None, field_filter_fn=None, fixed_numeric_width=None): """ :param plot: if ``True``, echo in plotting-friendly format (csv)...
[ "def", "__init__", "(", "self", ",", "topic", ",", "msg_eval", ",", "plot", "=", "False", ",", "filter_fn", "=", "None", ",", "echo_clear", "=", "False", ",", "echo_all_topics", "=", "False", ",", "offset_time", "=", "False", ",", "count", "=", "None", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rostopic/src/rostopic/__init__.py#L715-L765
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py
python
mbox.__init__
(self, path, factory=None, create=True)
Initialize an mbox mailbox.
Initialize an mbox mailbox.
[ "Initialize", "an", "mbox", "mailbox", "." ]
def __init__(self, path, factory=None, create=True): """Initialize an mbox mailbox.""" self._message_factory = mboxMessage _mboxMMDF.__init__(self, path, factory, create)
[ "def", "__init__", "(", "self", ",", "path", ",", "factory", "=", "None", ",", "create", "=", "True", ")", ":", "self", ".", "_message_factory", "=", "mboxMessage", "_mboxMMDF", ".", "__init__", "(", "self", ",", "path", ",", "factory", ",", "create", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L844-L847
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
python
_RegistryGetValue
(key, value)
return match.group(1)
Use _winreg or reg.exe to obtain the value of a registry key. Using _winreg is preferable because it solves an issue on some corporate environments where access to reg.exe is locked down. However, we still need to fallback to reg.exe for the case where the _winreg module is not available (for example in cygwin...
Use _winreg or reg.exe to obtain the value of a registry key.
[ "Use", "_winreg", "or", "reg", ".", "exe", "to", "obtain", "the", "value", "of", "a", "registry", "key", "." ]
def _RegistryGetValue(key, value): """Use _winreg or reg.exe to obtain the value of a registry key. Using _winreg is preferable because it solves an issue on some corporate environments where access to reg.exe is locked down. However, we still need to fallback to reg.exe for the case where the _winreg module i...
[ "def", "_RegistryGetValue", "(", "key", ",", "value", ")", ":", "try", ":", "return", "_RegistryGetValueUsingWinReg", "(", "key", ",", "value", ")", "except", "ImportError", ":", "pass", "# Fallback to reg.exe if we fail to import _winreg.", "text", "=", "_RegistryQue...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py#L199-L226
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/agents/ppo/utility.py
python
lambda_advantage
(reward, value, length, discount)
return tf.check_numerics(tf.stop_gradient(advantage), 'advantage')
Generalized Advantage Estimation.
Generalized Advantage Estimation.
[ "Generalized", "Advantage", "Estimation", "." ]
def lambda_advantage(reward, value, length, discount): """Generalized Advantage Estimation.""" timestep = tf.range(reward.shape[1].value) mask = tf.cast(timestep[None, :] < length[:, None], tf.float32) next_value = tf.concat([value[:, 1:], tf.zeros_like(value[:, -1:])], 1) delta = reward + discount * next_val...
[ "def", "lambda_advantage", "(", "reward", ",", "value", ",", "length", ",", "discount", ")", ":", "timestep", "=", "tf", ".", "range", "(", "reward", ".", "shape", "[", "1", "]", ".", "value", ")", "mask", "=", "tf", ".", "cast", "(", "timestep", "...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/ppo/utility.py#L117-L128
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibar.py
python
AuiToolBar.SetMarginsSize
(self, size)
Set the values to be used as margins for the toolbar. :param Size `size`: the margin size (an instance of :class:`Size`).
Set the values to be used as margins for the toolbar.
[ "Set", "the", "values", "to", "be", "used", "as", "margins", "for", "the", "toolbar", "." ]
def SetMarginsSize(self, size): """ Set the values to be used as margins for the toolbar. :param Size `size`: the margin size (an instance of :class:`Size`). """ self.SetMargins(size.x, size.x, size.y, size.y)
[ "def", "SetMarginsSize", "(", "self", ",", "size", ")", ":", "self", ".", "SetMargins", "(", "size", ".", "x", ",", "size", ".", "x", ",", "size", ".", "y", ",", "size", ".", "y", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L2453-L2460
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py
python
_FeedingQueueRunner._run
(self, sess, enqueue_op, feed_fn, coord=None)
Execute the enqueue op in a loop, close the queue in case of error. Args: sess: A `Session`. enqueue_op: The `Operation` to run. feed_fn: the feed function to pass to `sess.run`. coord: Optional `Coordinator` object for reporting errors and checking for stop conditions.
Execute the enqueue op in a loop, close the queue in case of error.
[ "Execute", "the", "enqueue", "op", "in", "a", "loop", "close", "the", "queue", "in", "case", "of", "error", "." ]
def _run(self, sess, enqueue_op, feed_fn, coord=None): """Execute the enqueue op in a loop, close the queue in case of error. Args: sess: A `Session`. enqueue_op: The `Operation` to run. feed_fn: the feed function to pass to `sess.run`. coord: Optional `Coordinator` object for reporting...
[ "def", "_run", "(", "self", ",", "sess", ",", "enqueue_op", ",", "feed_fn", ",", "coord", "=", "None", ")", ":", "# TODO(jamieas): Reduce code duplication with `QueueRunner`.", "if", "coord", ":", "coord", ".", "register_thread", "(", "threading", ".", "current_th...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py#L73-L120
koth/kcws
88efbd36a7022de4e6e90f5a1fb880cf87cfae9f
third_party/setuptools/pkg_resources.py
python
load_entry_point
(dist, group, name)
return get_distribution(dist).load_entry_point(group, name)
Return `name` entry point of `group` for `dist` or raise ImportError
Return `name` entry point of `group` for `dist` or raise ImportError
[ "Return", "name", "entry", "point", "of", "group", "for", "dist", "or", "raise", "ImportError" ]
def load_entry_point(dist, group, name): """Return `name` entry point of `group` for `dist` or raise ImportError""" return get_distribution(dist).load_entry_point(group, name)
[ "def", "load_entry_point", "(", "dist", ",", "group", ",", "name", ")", ":", "return", "get_distribution", "(", "dist", ")", ".", "load_entry_point", "(", "group", ",", "name", ")" ]
https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/setuptools/pkg_resources.py#L354-L356
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/data/experimental/ops/readers.py
python
_infer_column_names
(filenames, field_delim, use_quote_delim, file_io_fn)
return column_names
Infers column names from first rows of files.
Infers column names from first rows of files.
[ "Infers", "column", "names", "from", "first", "rows", "of", "files", "." ]
def _infer_column_names(filenames, field_delim, use_quote_delim, file_io_fn): """Infers column names from first rows of files.""" csv_kwargs = { "delimiter": field_delim, "quoting": csv.QUOTE_MINIMAL if use_quote_delim else csv.QUOTE_NONE } with file_io_fn(filenames[0]) as f: try: column_n...
[ "def", "_infer_column_names", "(", "filenames", ",", "field_delim", ",", "use_quote_delim", ",", "file_io_fn", ")", ":", "csv_kwargs", "=", "{", "\"delimiter\"", ":", "field_delim", ",", "\"quoting\"", ":", "csv", ".", "QUOTE_MINIMAL", "if", "use_quote_delim", "el...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/experimental/ops/readers.py#L157-L180
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/maya/scripts/AEwalterStandinTemplate.py
python
AEwalterStandinTemplate.__toolbarNew
(self, plug)
Create the Panel button.
Create the Panel button.
[ "Create", "the", "Panel", "button", "." ]
def __toolbarNew(self, plug): """Create the Panel button.""" currentWidget = self.__currentWidget() toolbar = WalterToolbar(currentWidget, self._nodeName) currentWidget.layout().addWidget(toolbar) toolbar.setObjectName("abcToolbarWidget") self.__toolbarReplace(plug)
[ "def", "__toolbarNew", "(", "self", ",", "plug", ")", ":", "currentWidget", "=", "self", ".", "__currentWidget", "(", ")", "toolbar", "=", "WalterToolbar", "(", "currentWidget", ",", "self", ".", "_nodeName", ")", "currentWidget", ".", "layout", "(", ")", ...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/maya/scripts/AEwalterStandinTemplate.py#L380-L387
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/grit/grit/format/policy_templates/writers/plist_strings_writer.py
python
PListStringsWriter.WritePolicy
(self, policy)
Add strings to the stringtable corresponding a given policy. Args: policy: The policy for which the strings will be added to the string table.
Add strings to the stringtable corresponding a given policy.
[ "Add", "strings", "to", "the", "stringtable", "corresponding", "a", "given", "policy", "." ]
def WritePolicy(self, policy): '''Add strings to the stringtable corresponding a given policy. Args: policy: The policy for which the strings will be added to the string table. ''' desc = policy['desc'] if policy['type'] == 'external': # This type can only be set through cloud p...
[ "def", "WritePolicy", "(", "self", ",", "policy", ")", ":", "desc", "=", "policy", "[", "'desc'", "]", "if", "policy", "[", "'type'", "]", "==", "'external'", ":", "# This type can only be set through cloud policy.", "return", "elif", "policy", "[", "'type'", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/format/policy_templates/writers/plist_strings_writer.py#L47-L65
OGRECave/ogre
d2cae7220c21e9cf6cc5a00b35c351c38914bcf0
Tools/Wings3DExporter/pgon.py
python
Triangulator.this_v
(self, vert)
return self.pgon[vert]
return position of given vertex
return position of given vertex
[ "return", "position", "of", "given", "vertex" ]
def this_v(self, vert): "return position of given vertex" return self.pgon[vert]
[ "def", "this_v", "(", "self", ",", "vert", ")", ":", "return", "self", ".", "pgon", "[", "vert", "]" ]
https://github.com/OGRECave/ogre/blob/d2cae7220c21e9cf6cc5a00b35c351c38914bcf0/Tools/Wings3DExporter/pgon.py#L54-L56
numworks/epsilon
8952d2f8b1de1c3f064eec8ffcea804c5594ba4c
build/device/usb/util.py
python
dispose_resources
(device)
r"""Release internal resources allocated by the object. Sometimes you need to provide deterministic resources freeing, for example to allow another application to talk to the device. As Python does not provide deterministic destruction, this function releases all internal resources allocated by the...
r"""Release internal resources allocated by the object.
[ "r", "Release", "internal", "resources", "allocated", "by", "the", "object", "." ]
def dispose_resources(device): r"""Release internal resources allocated by the object. Sometimes you need to provide deterministic resources freeing, for example to allow another application to talk to the device. As Python does not provide deterministic destruction, this function releases all inte...
[ "def", "dispose_resources", "(", "device", ")", ":", "device", ".", "_ctx", ".", "dispose", "(", "device", ")" ]
https://github.com/numworks/epsilon/blob/8952d2f8b1de1c3f064eec8ffcea804c5594ba4c/build/device/usb/util.py#L221-L235
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/random.py
python
randint
(low, high, shape=_Null, dtype=_Null, **kwargs)
return _random_helper(_internal._random_randint, None, [low, high], shape, dtype, kwargs)
Draw random samples from a discrete uniform distribution. Samples are uniformly distributed over the half-open interval *[low, high)* (includes *low*, but excludes *high*). Parameters ---------- low : int, required Lower boundary of the output interval. All values generated will be ...
Draw random samples from a discrete uniform distribution.
[ "Draw", "random", "samples", "from", "a", "discrete", "uniform", "distribution", "." ]
def randint(low, high, shape=_Null, dtype=_Null, **kwargs): """Draw random samples from a discrete uniform distribution. Samples are uniformly distributed over the half-open interval *[low, high)* (includes *low*, but excludes *high*). Parameters ---------- low : int, required Lower bo...
[ "def", "randint", "(", "low", ",", "high", ",", "shape", "=", "_Null", ",", "dtype", "=", "_Null", ",", "*", "*", "kwargs", ")", ":", "return", "_random_helper", "(", "_internal", ".", "_random_randint", ",", "None", ",", "[", "low", ",", "high", "]"...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/random.py#L461-L488
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/grid_rnn/python/ops/grid_rnn_cell.py
python
_propagate
(dim_indices, conf, cells, c_prev, m_prev, new_output, new_state, first_call)
Propagates through all the cells in dim_indices dimensions.
Propagates through all the cells in dim_indices dimensions.
[ "Propagates", "through", "all", "the", "cells", "in", "dim_indices", "dimensions", "." ]
def _propagate(dim_indices, conf, cells, c_prev, m_prev, new_output, new_state, first_call): """Propagates through all the cells in dim_indices dimensions. """ if len(dim_indices) == 0: return # Because of the way RNNCells are implemented, we take the last dimension # (H_{N-1}) out and fee...
[ "def", "_propagate", "(", "dim_indices", ",", "conf", ",", "cells", ",", "c_prev", ",", "m_prev", ",", "new_output", ",", "new_state", ",", "first_call", ")", ":", "if", "len", "(", "dim_indices", ")", "==", "0", ":", "return", "# Because of the way RNNCells...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/grid_rnn/python/ops/grid_rnn_cell.py#L608-L665
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextCompositeObject.GetChildCount
(*args, **kwargs)
return _richtext.RichTextCompositeObject_GetChildCount(*args, **kwargs)
GetChildCount(self) -> size_t
GetChildCount(self) -> size_t
[ "GetChildCount", "(", "self", ")", "-", ">", "size_t" ]
def GetChildCount(*args, **kwargs): """GetChildCount(self) -> size_t""" return _richtext.RichTextCompositeObject_GetChildCount(*args, **kwargs)
[ "def", "GetChildCount", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCompositeObject_GetChildCount", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1562-L1564
ZhouWeikuan/DouDiZhu
0d84ff6c0bc54dba6ae37955de9ae9307513dc99
code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py
python
Diagnostic.category_name
(self)
return conf.lib.clang_getDiagnosticCategoryName(self.category_number)
The string name of the category for this diagnostic.
The string name of the category for this diagnostic.
[ "The", "string", "name", "of", "the", "category", "for", "this", "diagnostic", "." ]
def category_name(self): """The string name of the category for this diagnostic.""" return conf.lib.clang_getDiagnosticCategoryName(self.category_number)
[ "def", "category_name", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getDiagnosticCategoryName", "(", "self", ".", "category_number", ")" ]
https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L345-L347
nlohmann/json
eb2182414749825be086c825edb5229e5c28503d
third_party/cpplint/cpplint.py
python
_CppLintState.SetCountingStyle
(self, counting_style)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style
[ "def", "SetCountingStyle", "(", "self", ",", "counting_style", ")", ":", "self", ".", "counting", "=", "counting_style" ]
https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L1289-L1291
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/utils/shapely_utils.py
python
invert_line_string
(line)
return LineString(line.coords[::-1])
Revert the coords order from a LineString.
Revert the coords order from a LineString.
[ "Revert", "the", "coords", "order", "from", "a", "LineString", "." ]
def invert_line_string(line): """Revert the coords order from a LineString.""" assert isinstance(line, LineString) # http://stackoverflow.com/questions/33175022/order-of-linestrings-in-multilinestring-object-in-shapely return LineString(line.coords[::-1])
[ "def", "invert_line_string", "(", "line", ")", ":", "assert", "isinstance", "(", "line", ",", "LineString", ")", "# http://stackoverflow.com/questions/33175022/order-of-linestrings-in-multilinestring-object-in-shapely", "return", "LineString", "(", "line", ".", "coords", "[",...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/utils/shapely_utils.py#L58-L62
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/output/vt100.py
python
_EscapeCodeCache._color_name_to_rgb
(self, color: str)
Turn 'ffffff', into (0xff, 0xff, 0xff).
Turn 'ffffff', into (0xff, 0xff, 0xff).
[ "Turn", "ffffff", "into", "(", "0xff", "0xff", "0xff", ")", "." ]
def _color_name_to_rgb(self, color: str) -> Tuple[int, int, int]: "Turn 'ffffff', into (0xff, 0xff, 0xff)." try: rgb = int(color, 16) except ValueError: raise else: r = (rgb >> 16) & 0xFF g = (rgb >> 8) & 0xFF b = rgb & 0xFF ...
[ "def", "_color_name_to_rgb", "(", "self", ",", "color", ":", "str", ")", "->", "Tuple", "[", "int", ",", "int", ",", "int", "]", ":", "try", ":", "rgb", "=", "int", "(", "color", ",", "16", ")", "except", "ValueError", ":", "raise", "else", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/output/vt100.py#L317-L327
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/device_assignment.py
python
_ring_2d
(height, width)
return ret
Ring-order of a height x width mesh. For example, in a 4x4 mesh, this returns the following order. 0 -- 1 -- 2 -- 3 | | | | 15-- 6 -- 5 -- 4 | | | | 14-- 7 -- 8 -- 9 | | | | 13-- 12-- 11-- 10 Args: height: An integer represents the height. width: An i...
Ring-order of a height x width mesh.
[ "Ring", "-", "order", "of", "a", "height", "x", "width", "mesh", "." ]
def _ring_2d(height, width): """Ring-order of a height x width mesh. For example, in a 4x4 mesh, this returns the following order. 0 -- 1 -- 2 -- 3 | | | | 15-- 6 -- 5 -- 4 | | | | 14-- 7 -- 8 -- 9 | | | | 13-- 12-- 11-- 10 Args: height: An integer repr...
[ "def", "_ring_2d", "(", "height", ",", "width", ")", ":", "if", "height", "==", "1", ":", "return", "[", "(", "0", ",", "i", ")", "for", "i", "in", "range", "(", "width", ")", "]", "if", "width", "==", "1", ":", "return", "[", "(", "i", ",", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/device_assignment.py#L178-L212
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Font.GetWeight
(*args, **kwargs)
return _gdi_.Font_GetWeight(*args, **kwargs)
GetWeight(self) -> int Gets the font weight.
GetWeight(self) -> int
[ "GetWeight", "(", "self", ")", "-", ">", "int" ]
def GetWeight(*args, **kwargs): """ GetWeight(self) -> int Gets the font weight. """ return _gdi_.Font_GetWeight(*args, **kwargs)
[ "def", "GetWeight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Font_GetWeight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2315-L2321
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/third_party/depot_tools/cpplint.py
python
_IsSourceExtension
(s)
return s in ('c', 'cc', 'cpp', 'cxx')
File extension (excluding dot) matches a source file extension.
File extension (excluding dot) matches a source file extension.
[ "File", "extension", "(", "excluding", "dot", ")", "matches", "a", "source", "file", "extension", "." ]
def _IsSourceExtension(s): """File extension (excluding dot) matches a source file extension.""" return s in ('c', 'cc', 'cpp', 'cxx')
[ "def", "_IsSourceExtension", "(", "s", ")", ":", "return", "s", "in", "(", "'c'", ",", "'cc'", ",", "'cpp'", ",", "'cxx'", ")" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/depot_tools/cpplint.py#L657-L659
danxuhk/ContinuousCRF-CNN
2b6dcaf179620f118b225ed12c890414ca828e21
scripts/cpp_lint.py
python
CheckVlogArguments
(filename, clean_lines, linenum, error)
Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to ...
Checks that VLOG() is only used for defining a logging level.
[ "Checks", "that", "VLOG", "()", "is", "only", "used", "for", "defining", "a", "logging", "level", "." ]
def CheckVlogArguments(filename, clean_lines, linenum, error): """Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines i...
[ "def", "CheckVlogArguments", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "Search", "(", "r'\\bVLOG\\((INFO|ERROR|WARNING|DFATAL|FATAL)\\)'", ",", "line", ")", ...
https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L1712-L1728
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py3/jinja2/compiler.py
python
CodeGenerator.signature
( self, node: t.Union[nodes.Call, nodes.Filter, nodes.Test], frame: Frame, extra_kwargs: t.Optional[t.Mapping[str, t.Any]] = None, )
Writes a function call to the stream for the current node. A leading comma is added automatically. The extra keyword arguments may not include python keywords otherwise a syntax error could occur. The extra keyword arguments should be given as python dict.
Writes a function call to the stream for the current node. A leading comma is added automatically. The extra keyword arguments may not include python keywords otherwise a syntax error could occur. The extra keyword arguments should be given as python dict.
[ "Writes", "a", "function", "call", "to", "the", "stream", "for", "the", "current", "node", ".", "A", "leading", "comma", "is", "added", "automatically", ".", "The", "extra", "keyword", "arguments", "may", "not", "include", "python", "keywords", "otherwise", ...
def signature( self, node: t.Union[nodes.Call, nodes.Filter, nodes.Test], frame: Frame, extra_kwargs: t.Optional[t.Mapping[str, t.Any]] = None, ) -> None: """Writes a function call to the stream for the current node. A leading comma is added automatically. The extra ...
[ "def", "signature", "(", "self", ",", "node", ":", "t", ".", "Union", "[", "nodes", ".", "Call", ",", "nodes", ".", "Filter", ",", "nodes", ".", "Test", "]", ",", "frame", ":", "Frame", ",", "extra_kwargs", ":", "t", ".", "Optional", "[", "t", "....
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/compiler.py#L481-L536
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_beziers.py
python
CubicBezCurve.finish
(self, closed=False, cont=False)
Terminate the operation and close the curve if asked. Parameters ---------- closed: bool, optional Close the line if `True`.
Terminate the operation and close the curve if asked.
[ "Terminate", "the", "operation", "and", "close", "the", "curve", "if", "asked", "." ]
def finish(self, closed=False, cont=False): """Terminate the operation and close the curve if asked. Parameters ---------- closed: bool, optional Close the line if `True`. """ if self.ui: if hasattr(self, "bezcurvetrack"): self.bez...
[ "def", "finish", "(", "self", ",", "closed", "=", "False", ",", "cont", "=", "False", ")", ":", "if", "self", ".", "ui", ":", "if", "hasattr", "(", "self", ",", "\"bezcurvetrack\"", ")", ":", "self", ".", "bezcurvetrack", ".", "finalize", "(", ")", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_beziers.py#L411-L464
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/boto3/resources/factory.py
python
ResourceFactory._load_attributes
(self, attrs, meta, resource_name, resource_model, service_context)
Load resource attributes based on the resource shape. The shape name is referenced in the resource JSON, but the shape itself is defined in the Botocore service JSON, hence the need for access to the ``service_model``.
Load resource attributes based on the resource shape. The shape name is referenced in the resource JSON, but the shape itself is defined in the Botocore service JSON, hence the need for access to the ``service_model``.
[ "Load", "resource", "attributes", "based", "on", "the", "resource", "shape", ".", "The", "shape", "name", "is", "referenced", "in", "the", "resource", "JSON", "but", "the", "shape", "itself", "is", "defined", "in", "the", "Botocore", "service", "JSON", "henc...
def _load_attributes(self, attrs, meta, resource_name, resource_model, service_context): """ Load resource attributes based on the resource shape. The shape name is referenced in the resource JSON, but the shape itself is defined in the Botocore service JSON, hen...
[ "def", "_load_attributes", "(", "self", ",", "attrs", ",", "meta", ",", "resource_name", ",", "resource_model", ",", "service_context", ")", ":", "if", "not", "resource_model", ".", "shape", ":", "return", "shape", "=", "service_context", ".", "service_model", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/boto3/resources/factory.py#L170-L203
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/mesa/MesaLib/src/gallium/auxiliary/util/u_format_pack.py
python
generate_format_fetch
(format, dst_channel, dst_native_type, dst_suffix)
Generate the function to unpack pixels from a particular format
Generate the function to unpack pixels from a particular format
[ "Generate", "the", "function", "to", "unpack", "pixels", "from", "a", "particular", "format" ]
def generate_format_fetch(format, dst_channel, dst_native_type, dst_suffix): '''Generate the function to unpack pixels from a particular format''' name = format.short_name() print 'static INLINE void' print 'util_format_%s_fetch_%s(%s *dst, const uint8_t *src, unsigned i, unsigned j)' % (name, dst_suf...
[ "def", "generate_format_fetch", "(", "format", ",", "dst_channel", ",", "dst_native_type", ",", "dst_suffix", ")", ":", "name", "=", "format", ".", "short_name", "(", ")", "print", "'static INLINE void'", "print", "'util_format_%s_fetch_%s(%s *dst, const uint8_t *src, uns...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/gallium/auxiliary/util/u_format_pack.py#L618-L631
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/datetime.py
python
date.ctime
(self)
return "%s %s %2d 00:00:00 %04d" % ( _DAYNAMES[weekday], _MONTHNAMES[self._month], self._day, self._year)
Return ctime() style string.
Return ctime() style string.
[ "Return", "ctime", "()", "style", "string", "." ]
def ctime(self): "Return ctime() style string." weekday = self.toordinal() % 7 or 7 return "%s %s %2d 00:00:00 %04d" % ( _DAYNAMES[weekday], _MONTHNAMES[self._month], self._day, self._year)
[ "def", "ctime", "(", "self", ")", ":", "weekday", "=", "self", ".", "toordinal", "(", ")", "%", "7", "or", "7", "return", "\"%s %s %2d 00:00:00 %04d\"", "%", "(", "_DAYNAMES", "[", "weekday", "]", ",", "_MONTHNAMES", "[", "self", ".", "_month", "]", ",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/datetime.py#L950-L956
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/spreadsheet/service.py
python
SpreadsheetsService.AddWorksheet
(self, title, row_count, col_count, key)
return self.Post(new_worksheet, 'http://%s/feeds/worksheets/%s/private/full' % (self.server, key), converter=gdata.spreadsheet.SpreadsheetsWorksheetFromString)
Creates a new worksheet in the desired spreadsheet. The new worksheet is appended to the end of the list of worksheets. The new worksheet will only have the available number of columns and cells specified. Args: title: str The title which will be displayed in the list of worksheets. row_c...
Creates a new worksheet in the desired spreadsheet.
[ "Creates", "a", "new", "worksheet", "in", "the", "desired", "spreadsheet", "." ]
def AddWorksheet(self, title, row_count, col_count, key): """Creates a new worksheet in the desired spreadsheet. The new worksheet is appended to the end of the list of worksheets. The new worksheet will only have the available number of columns and cells specified. Args: title: str The tit...
[ "def", "AddWorksheet", "(", "self", ",", "title", ",", "row_count", ",", "col_count", ",", "key", ")", ":", "new_worksheet", "=", "gdata", ".", "spreadsheet", ".", "SpreadsheetsWorksheet", "(", "title", "=", "atom", ".", "Title", "(", "text", "=", "title",...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/spreadsheet/service.py#L128-L151
jeog/TDAmeritradeAPI
91c738afd7d57b54f6231170bd64c2550fafd34d
python/tdma_api/stream.py
python
AcctActivitySubscription.ParseResponseData
(data)
return results
Convert responses containing XML to a list-of-dict-of-[dict|str|None] The 'data' 4th arg of the callback should be passed ONLY when the callback type is of CALLBACK_TYPE_DATA and the service type is of SERVICE_TYPE_ACCT_ACTIVITY. 'data' should be of form: [ {"1":...
Convert responses containing XML to a list-of-dict-of-[dict|str|None]
[ "Convert", "responses", "containing", "XML", "to", "a", "list", "-", "of", "-", "dict", "-", "of", "-", "[", "dict|str|None", "]" ]
def ParseResponseData(data): """Convert responses containing XML to a list-of-dict-of-[dict|str|None] The 'data' 4th arg of the callback should be passed ONLY when the callback type is of CALLBACK_TYPE_DATA and the service type is of SERVICE_TYPE_ACCT_ACTIVITY. 'data' should ...
[ "def", "ParseResponseData", "(", "data", ")", ":", "results", "=", "[", "]", "for", "elem", "in", "data", ":", "msg_type", "=", "elem", "[", "\"2\"", "]", "res", "=", "{", "\"account\"", ":", "elem", "[", "\"1\"", "]", ",", "\"message_type\"", ":", "...
https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/stream.py#L403-L489
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/boost/tools/build/src/build/project.py
python
ProjectRegistry.attributes
(self, project)
return self.module2attributes[project]
Returns the project-attribute instance for the specified jamfile module.
Returns the project-attribute instance for the specified jamfile module.
[ "Returns", "the", "project", "-", "attribute", "instance", "for", "the", "specified", "jamfile", "module", "." ]
def attributes(self, project): """Returns the project-attribute instance for the specified jamfile module.""" assert isinstance(project, basestring) return self.module2attributes[project]
[ "def", "attributes", "(", "self", ",", "project", ")", ":", "assert", "isinstance", "(", "project", ",", "basestring", ")", "return", "self", ".", "module2attributes", "[", "project", "]" ]
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/project.py#L587-L591
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_collections_abc.py
python
MutableMapping.setdefault
(self, key, default=None)
return default
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
[ "D", ".", "setdefault", "(", "k", "[", "d", "]", ")", "-", ">", "D", ".", "get", "(", "k", "d", ")", "also", "set", "D", "[", "k", "]", "=", "d", "if", "k", "not", "in", "D" ]
def setdefault(self, key, default=None): 'D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D' try: return self[key] except KeyError: self[key] = default return default
[ "def", "setdefault", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "try", ":", "return", "self", "[", "key", "]", "except", "KeyError", ":", "self", "[", "key", "]", "=", "default", "return", "default" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_collections_abc.py#L851-L857
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.GetDefaultColLabelSize
(*args, **kwargs)
return _grid.Grid_GetDefaultColLabelSize(*args, **kwargs)
GetDefaultColLabelSize(self) -> int
GetDefaultColLabelSize(self) -> int
[ "GetDefaultColLabelSize", "(", "self", ")", "-", ">", "int" ]
def GetDefaultColLabelSize(*args, **kwargs): """GetDefaultColLabelSize(self) -> int""" return _grid.Grid_GetDefaultColLabelSize(*args, **kwargs)
[ "def", "GetDefaultColLabelSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetDefaultColLabelSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1478-L1480
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py
python
_SetQuiet
(quiet)
return _cpplint_state.SetQuiet(quiet)
Set the module's quiet status, and return previous setting.
Set the module's quiet status, and return previous setting.
[ "Set", "the", "module", "s", "quiet", "status", "and", "return", "previous", "setting", "." ]
def _SetQuiet(quiet): """Set the module's quiet status, and return previous setting.""" return _cpplint_state.SetQuiet(quiet)
[ "def", "_SetQuiet", "(", "quiet", ")", ":", "return", "_cpplint_state", ".", "SetQuiet", "(", "quiet", ")" ]
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L1175-L1177
yushroom/FishEngine
a4b9fb9b0a6dc202f7990e75f4b7d8d5163209d9
Script/reflect/clang/cindex.py
python
Config.set_compatibility_check
(check_status)
Perform compatibility check when loading libclang The python bindings are only tested and evaluated with the version of libclang they are provided with. To ensure correct behavior a (limited) compatibility check is performed when loading the bindings. This check will throw an exception,...
Perform compatibility check when loading libclang
[ "Perform", "compatibility", "check", "when", "loading", "libclang" ]
def set_compatibility_check(check_status): """ Perform compatibility check when loading libclang The python bindings are only tested and evaluated with the version of libclang they are provided with. To ensure correct behavior a (limited) compatibility check is performed when loading th...
[ "def", "set_compatibility_check", "(", "check_status", ")", ":", "if", "Config", ".", "loaded", ":", "raise", "Exception", "(", "\"compatibility_check must be set before before \"", "\"using any other functionalities in libclang.\"", ")", "Config", ".", "compatibility_check", ...
https://github.com/yushroom/FishEngine/blob/a4b9fb9b0a6dc202f7990e75f4b7d8d5163209d9/Script/reflect/clang/cindex.py#L3814-L3835
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py
python
_SparseMatrixSoftmaxGrad
(op, grad_softmax)
return sparse_csr_matrix_ops.sparse_matrix_softmax_grad( softmax, grad_softmax, type=op.get_attr("type"))
Gradient for sparse_matrix_softmax op.
Gradient for sparse_matrix_softmax op.
[ "Gradient", "for", "sparse_matrix_softmax", "op", "." ]
def _SparseMatrixSoftmaxGrad(op, grad_softmax): """Gradient for sparse_matrix_softmax op.""" softmax = op.outputs[0] return sparse_csr_matrix_ops.sparse_matrix_softmax_grad( softmax, grad_softmax, type=op.get_attr("type"))
[ "def", "_SparseMatrixSoftmaxGrad", "(", "op", ",", "grad_softmax", ")", ":", "softmax", "=", "op", ".", "outputs", "[", "0", "]", "return", "sparse_csr_matrix_ops", ".", "sparse_matrix_softmax_grad", "(", "softmax", ",", "grad_softmax", ",", "type", "=", "op", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg/sparse/sparse_csr_matrix_grad.py#L200-L204
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_cpp_types.py
python
VariantType.isa
(self,variant_idx,expr)
return '((' + expr + ').tag == {})'.format(variant_idx)
return a test indicating whether expr is of the variant type with index variant_idx
return a test indicating whether expr is of the variant type with index variant_idx
[ "return", "a", "test", "indicating", "whether", "expr", "is", "of", "the", "variant", "type", "with", "index", "variant_idx" ]
def isa(self,variant_idx,expr): """ return a test indicating whether expr is of the variant type with index variant_idx """ return '((' + expr + ').tag == {})'.format(variant_idx)
[ "def", "isa", "(", "self", ",", "variant_idx", ",", "expr", ")", ":", "return", "'(('", "+", "expr", "+", "').tag == {})'", ".", "format", "(", "variant_idx", ")" ]
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_cpp_types.py#L311-L314
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html.py
python
HtmlWinParser.SetLinkColor
(*args, **kwargs)
return _html.HtmlWinParser_SetLinkColor(*args, **kwargs)
SetLinkColor(self, Colour clr)
SetLinkColor(self, Colour clr)
[ "SetLinkColor", "(", "self", "Colour", "clr", ")" ]
def SetLinkColor(*args, **kwargs): """SetLinkColor(self, Colour clr)""" return _html.HtmlWinParser_SetLinkColor(*args, **kwargs)
[ "def", "SetLinkColor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWinParser_SetLinkColor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L344-L346
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/defchararray.py
python
partition
(a, sep)
return _to_string_or_unicode_array( _vec_string(a, object_, 'partition', (sep,)))
Partition each element in `a` around `sep`. Calls `str.partition` element-wise. For each element in `a`, split the element as the first occurrence of `sep`, and return 3 strings containing the part before the separator, the separator itself, and the part after the separator. If the separator is no...
Partition each element in `a` around `sep`.
[ "Partition", "each", "element", "in", "a", "around", "sep", "." ]
def partition(a, sep): """ Partition each element in `a` around `sep`. Calls `str.partition` element-wise. For each element in `a`, split the element as the first occurrence of `sep`, and return 3 strings containing the part before the separator, the separator itself, and the part after th...
[ "def", "partition", "(", "a", ",", "sep", ")", ":", "return", "_to_string_or_unicode_array", "(", "_vec_string", "(", "a", ",", "object_", ",", "'partition'", ",", "(", "sep", ",", ")", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/core/defchararray.py#L1109-L1141
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.GetIdlBuildData
(self, source, config)
return outdir, output, variables, flags
Determine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.
Determine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.
[ "Determine", "the", "implicit", "outputs", "for", "an", "idl", "file", ".", "Returns", "output", "directory", "outputs", "and", "variables", "and", "flags", "that", "are", "required", "." ]
def GetIdlBuildData(self, source, config): """Determine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.""" config = self._TargetConfig(config) midl_get = self._GetWrapper(self, self.msvs_settings[config], 'VCMIDLTool') def midl(name...
[ "def", "GetIdlBuildData", "(", "self", ",", "source", ",", "config", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "midl_get", "=", "self", ".", "_GetWrapper", "(", "self", ",", "self", ".", "msvs_settings", "[", "config", "]...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/msvs_emulation.py#L840-L865
su2code/SU2
72b2fa977b64b9683a388920f05298a40d39e5c5
SU2_PY/SU2/io/state.py
python
State.update
(self,ztate)
Updates self given another state
Updates self given another state
[ "Updates", "self", "given", "another", "state" ]
def update(self,ztate): """ Updates self given another state """ if not ztate: return assert isinstance(ztate,State) , 'must update with another State-type' for key in self.keys(): if isinstance(ztate[key],dict): self[key].update( ztate[key] )...
[ "def", "update", "(", "self", ",", "ztate", ")", ":", "if", "not", "ztate", ":", "return", "assert", "isinstance", "(", "ztate", ",", "State", ")", ",", "'must update with another State-type'", "for", "key", "in", "self", ".", "keys", "(", ")", ":", "if"...
https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/io/state.py#L146-L158
blackberry/Boost
fc90c3fde129c62565c023f091eddc4a7ed9902b
tools/build/v2/util/utility.py
python
replace_suffix
(name, new_suffix)
return split [0] + new_suffix
Replaces the suffix of name by new_suffix. If no suffix exists, the new one is added.
Replaces the suffix of name by new_suffix. If no suffix exists, the new one is added.
[ "Replaces", "the", "suffix", "of", "name", "by", "new_suffix", ".", "If", "no", "suffix", "exists", "the", "new", "one", "is", "added", "." ]
def replace_suffix (name, new_suffix): """ Replaces the suffix of name by new_suffix. If no suffix exists, the new one is added. """ split = os.path.splitext (name) return split [0] + new_suffix
[ "def", "replace_suffix", "(", "name", ",", "new_suffix", ")", ":", "split", "=", "os", ".", "path", ".", "splitext", "(", "name", ")", "return", "split", "[", "0", "]", "+", "new_suffix" ]
https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/util/utility.py#L108-L113
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
setup.py
python
check_linker_need_libatomic
()
return cpp_test.returncode == 0
Test if linker on system needs libatomic.
Test if linker on system needs libatomic.
[ "Test", "if", "linker", "on", "system", "needs", "libatomic", "." ]
def check_linker_need_libatomic(): """Test if linker on system needs libatomic.""" code_test = (b'#include <atomic>\n' + b'int main() { return std::atomic<int64_t>{}; }') cxx = os.environ.get('CXX', 'c++') cpp_test = subprocess.Popen([cxx, '-x', 'c++', '-std=c++11', '-'], ...
[ "def", "check_linker_need_libatomic", "(", ")", ":", "code_test", "=", "(", "b'#include <atomic>\\n'", "+", "b'int main() { return std::atomic<int64_t>{}; }'", ")", "cxx", "=", "os", ".", "environ", ".", "get", "(", "'CXX'", ",", "'c++'", ")", "cpp_test", "=", "su...
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/setup.py#L199-L219
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/mixture/_gaussian_mixture.py
python
_compute_precision_cholesky
(covariances, covariance_type)
return precisions_chol
Compute the Cholesky decomposition of the precisions. Parameters ---------- covariances : array-like The covariance matrix of the current components. The shape depends of the covariance_type. covariance_type : {'full', 'tied', 'diag', 'spherical'} The type of precision matrices...
Compute the Cholesky decomposition of the precisions.
[ "Compute", "the", "Cholesky", "decomposition", "of", "the", "precisions", "." ]
def _compute_precision_cholesky(covariances, covariance_type): """Compute the Cholesky decomposition of the precisions. Parameters ---------- covariances : array-like The covariance matrix of the current components. The shape depends of the covariance_type. covariance_type : {'full...
[ "def", "_compute_precision_cholesky", "(", "covariances", ",", "covariance_type", ")", ":", "estimate_precision_error_message", "=", "(", "\"Fitting the mixture model failed because some components have \"", "\"ill-defined empirical covariance (for instance caused by singleton \"", "\"or c...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/mixture/_gaussian_mixture.py#L288-L335
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py
python
TurtleScreen.listen
(self, xdummy=None, ydummy=None)
Set focus on TurtleScreen (in order to collect key-events) No arguments. Dummy arguments are provided in order to be able to pass listen to the onclick method. Example (for a TurtleScreen instance named screen): >>> screen.listen()
Set focus on TurtleScreen (in order to collect key-events)
[ "Set", "focus", "on", "TurtleScreen", "(", "in", "order", "to", "collect", "key", "-", "events", ")" ]
def listen(self, xdummy=None, ydummy=None): """Set focus on TurtleScreen (in order to collect key-events) No arguments. Dummy arguments are provided in order to be able to pass listen to the onclick method. Example (for a TurtleScreen instance named screen): >>> screen....
[ "def", "listen", "(", "self", ",", "xdummy", "=", "None", ",", "ydummy", "=", "None", ")", ":", "self", ".", "_listen", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L1428-L1438
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/src/inspector/build/rjsmin.py
python
jsmin_for_posers
(script)
return _re.sub( r'([^\047"/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]|\r?' r'\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|' r'\r)[^"\\\r\n]*)*"))[^\047"/\000-\040]*)|(?<=[(,=:\[!&|?{};\r\n])(?' r':[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)...
r""" Minify javascript based on `jsmin.c by Douglas Crockford`_\. Instead of parsing the stream char by char, it uses a regular expression approach which minifies the whole script with one big substitution regex. .. _jsmin.c by Douglas Crockford: http://www.crockford.com/javascript/jsmin.c ...
r""" Minify javascript based on `jsmin.c by Douglas Crockford`_\.
[ "r", "Minify", "javascript", "based", "on", "jsmin", ".", "c", "by", "Douglas", "Crockford", "_", "\\", "." ]
def jsmin_for_posers(script): r""" Minify javascript based on `jsmin.c by Douglas Crockford`_\. Instead of parsing the stream char by char, it uses a regular expression approach which minifies the whole script with one big substitution regex. .. _jsmin.c by Douglas Crockford: http://www...
[ "def", "jsmin_for_posers", "(", "script", ")", ":", "def", "subber", "(", "match", ")", ":", "\"\"\" Substitution callback \"\"\"", "groups", "=", "match", ".", "groups", "(", ")", "return", "(", "groups", "[", "0", "]", "or", "groups", "[", "1", "]", "o...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/src/inspector/build/rjsmin.py#L230-L290
CGRU/cgru
1881a4128530e3d31ac6c25314c18314fc50c2c7
plugins/maya/afanasy/maya_ui_proc.py
python
browseFile
(rootDir, control, extFilter)
browseFile :param rootDir: :param control: :param extFilter: :return:
browseFile
[ "browseFile" ]
def browseFile(rootDir, control, extFilter): """browseFile :param rootDir: :param control: :param extFilter: :return: """ path = cmds.textFieldButtonGrp(control, q=True, text=True) startDir = path if isRelative(path): startDir = os.path.join(rootDir, path) fileNames = cmds.fileDialog2( fileMode=1, sta...
[ "def", "browseFile", "(", "rootDir", ",", "control", ",", "extFilter", ")", ":", "path", "=", "cmds", ".", "textFieldButtonGrp", "(", "control", ",", "q", "=", "True", ",", "text", "=", "True", ")", "startDir", "=", "path", "if", "isRelative", "(", "pa...
https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/plugins/maya/afanasy/maya_ui_proc.py#L294-L318
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
python
MacTool.ExecMergeInfoPlist
(self, output, *inputs)
Merge multiple .plist files into a single .plist file.
Merge multiple .plist files into a single .plist file.
[ "Merge", "multiple", ".", "plist", "files", "into", "a", "single", ".", "plist", "file", "." ]
def ExecMergeInfoPlist(self, output, *inputs): """Merge multiple .plist files into a single .plist file.""" merged_plist = {} for path in inputs: plist = self._LoadPlistMaybeBinary(path) self._MergePlist(merged_plist, plist) plistlib.writePlist(merged_plist, output)
[ "def", "ExecMergeInfoPlist", "(", "self", ",", "output", ",", "*", "inputs", ")", ":", "merged_plist", "=", "{", "}", "for", "path", "in", "inputs", ":", "plist", "=", "self", ".", "_LoadPlistMaybeBinary", "(", "path", ")", "self", ".", "_MergePlist", "(...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py#L344-L350
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/importlib_metadata/__init__.py
python
files
(distribution_name)
return distribution(distribution_name).files
Return a list of files for the named package. :param distribution_name: The name of the distribution package to query. :return: List of files composing the distribution.
Return a list of files for the named package.
[ "Return", "a", "list", "of", "files", "for", "the", "named", "package", "." ]
def files(distribution_name): """Return a list of files for the named package. :param distribution_name: The name of the distribution package to query. :return: List of files composing the distribution. """ return distribution(distribution_name).files
[ "def", "files", "(", "distribution_name", ")", ":", "return", "distribution", "(", "distribution_name", ")", ".", "files" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/importlib_metadata/__init__.py#L583-L589
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/framemanager.py
python
AuiManager.GetPaneByName
(self, name)
return NonePaneInfo
This version of :meth:`GetPane` looks up a pane based on a 'pane name'. :param string `name`: the pane name. :see: :meth:`GetPane`
This version of :meth:`GetPane` looks up a pane based on a 'pane name'.
[ "This", "version", "of", ":", "meth", ":", "GetPane", "looks", "up", "a", "pane", "based", "on", "a", "pane", "name", "." ]
def GetPaneByName(self, name): """ This version of :meth:`GetPane` looks up a pane based on a 'pane name'. :param string `name`: the pane name. :see: :meth:`GetPane` """ for p in self._panes: if p.name == name: return p return NoneP...
[ "def", "GetPaneByName", "(", "self", ",", "name", ")", ":", "for", "p", "in", "self", ".", "_panes", ":", "if", "p", ".", "name", "==", "name", ":", "return", "p", "return", "NonePaneInfo" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L4272-L4285
wesnoth/wesnoth
6ccac5a5e8ff75303c9190c0da60580925cb32c0
data/tools/wesnoth/wmlparser.py
python
Parser.read_encoded
(self, filename)
return text
Helper for gracefully handling non-utf8 files and fixing up non-unix line endings.
Helper for gracefully handling non-utf8 files and fixing up non-unix line endings.
[ "Helper", "for", "gracefully", "handling", "non", "-", "utf8", "files", "and", "fixing", "up", "non", "-", "unix", "line", "endings", "." ]
def read_encoded(self, filename): """ Helper for gracefully handling non-utf8 files and fixing up non-unix line endings. """ try: with open(filename, encoding="utf8") as f: text = f.read() except UnicodeDecodeError: with open(filena...
[ "def", "read_encoded", "(", "self", ",", "filename", ")", ":", "try", ":", "with", "open", "(", "filename", ",", "encoding", "=", "\"utf8\"", ")", "as", "f", ":", "text", "=", "f", ".", "read", "(", ")", "except", "UnicodeDecodeError", ":", "with", "...
https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/wmlparser.py#L99-L116
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/dataview.py
python
DataViewVirtualListModel.GetRow
(*args, **kwargs)
return _dataview.DataViewVirtualListModel_GetRow(*args, **kwargs)
GetRow(self, DataViewItem item) -> unsigned int Returns the row position of item.
GetRow(self, DataViewItem item) -> unsigned int
[ "GetRow", "(", "self", "DataViewItem", "item", ")", "-", ">", "unsigned", "int" ]
def GetRow(*args, **kwargs): """ GetRow(self, DataViewItem item) -> unsigned int Returns the row position of item. """ return _dataview.DataViewVirtualListModel_GetRow(*args, **kwargs)
[ "def", "GetRow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewVirtualListModel_GetRow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L1056-L1062
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/profiler/internal/flops_registry.py
python
_unary_op_flops
(graph, node, ops_per_element=1)
return ops.OpStats("flops", in_shape.num_elements() * ops_per_element)
Common code which compute flops for unary operations.
Common code which compute flops for unary operations.
[ "Common", "code", "which", "compute", "flops", "for", "unary", "operations", "." ]
def _unary_op_flops(graph, node, ops_per_element=1): """Common code which compute flops for unary operations.""" in_shape = graph_util.tensor_shape_from_node_def_name(graph, node.input[0]) in_shape.assert_is_fully_defined() return ops.OpStats("flops", in_shape.num_elements() * ops_per_element)
[ "def", "_unary_op_flops", "(", "graph", ",", "node", ",", "ops_per_element", "=", "1", ")", ":", "in_shape", "=", "graph_util", ".", "tensor_shape_from_node_def_name", "(", "graph", ",", "node", ".", "input", "[", "0", "]", ")", "in_shape", ".", "assert_is_f...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/profiler/internal/flops_registry.py#L64-L68
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.IndicatorAllOnFor
(*args, **kwargs)
return _stc.StyledTextCtrl_IndicatorAllOnFor(*args, **kwargs)
IndicatorAllOnFor(self, int position) -> int Are any indicators present at position?
IndicatorAllOnFor(self, int position) -> int
[ "IndicatorAllOnFor", "(", "self", "int", "position", ")", "-", ">", "int" ]
def IndicatorAllOnFor(*args, **kwargs): """ IndicatorAllOnFor(self, int position) -> int Are any indicators present at position? """ return _stc.StyledTextCtrl_IndicatorAllOnFor(*args, **kwargs)
[ "def", "IndicatorAllOnFor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_IndicatorAllOnFor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5695-L5701
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/hermite.py
python
hermvander3d
(x, y, z, deg)
return pu._vander_nd_flat((hermvander, hermvander, hermvander), (x, y, z), deg)
Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees `deg` and sample points `(x, y, z)`. If `l, m, n` are the given degrees in `x, y, z`, then The pseudo-Vandermonde matrix is defined by .. math:: V[..., (m+1)(n+1)i + (n+1)j + k] = H_i(x)*H_j(y)*H_k(z), wh...
Pseudo-Vandermonde matrix of given degrees.
[ "Pseudo", "-", "Vandermonde", "matrix", "of", "given", "degrees", "." ]
def hermvander3d(x, y, z, deg): """Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees `deg` and sample points `(x, y, z)`. If `l, m, n` are the given degrees in `x, y, z`, then The pseudo-Vandermonde matrix is defined by .. math:: V[..., (m+1)(n+1)i + (n+1...
[ "def", "hermvander3d", "(", "x", ",", "y", ",", "z", ",", "deg", ")", ":", "return", "pu", ".", "_vander_nd_flat", "(", "(", "hermvander", ",", "hermvander", ",", "hermvander", ")", ",", "(", "x", ",", "y", ",", "z", ")", ",", "deg", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/hermite.py#L1199-L1250
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xpathParserContext.xpathConcatFunction
(self, nargs)
Implement the concat() XPath function string concat(string, string, string*) The concat function returns the concatenation of its arguments.
Implement the concat() XPath function string concat(string, string, string*) The concat function returns the concatenation of its arguments.
[ "Implement", "the", "concat", "()", "XPath", "function", "string", "concat", "(", "string", "string", "string", "*", ")", "The", "concat", "function", "returns", "the", "concatenation", "of", "its", "arguments", "." ]
def xpathConcatFunction(self, nargs): """Implement the concat() XPath function string concat(string, string, string*) The concat function returns the concatenation of its arguments. """ libxml2mod.xmlXPathConcatFunction(self._o, nargs)
[ "def", "xpathConcatFunction", "(", "self", ",", "nargs", ")", ":", "libxml2mod", ".", "xmlXPathConcatFunction", "(", "self", ".", "_o", ",", "nargs", ")" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L7417-L7421
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
uCSIsHiragana
(code)
return ret
Check whether the character is part of Hiragana UCS Block
Check whether the character is part of Hiragana UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "Hiragana", "UCS", "Block" ]
def uCSIsHiragana(code): """Check whether the character is part of Hiragana UCS Block """ ret = libxml2mod.xmlUCSIsHiragana(code) return ret
[ "def", "uCSIsHiragana", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsHiragana", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2608-L2611
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
GridCellAttr.GetRenderer
(*args, **kwargs)
return _grid.GridCellAttr_GetRenderer(*args, **kwargs)
GetRenderer(self, Grid grid, int row, int col) -> GridCellRenderer
GetRenderer(self, Grid grid, int row, int col) -> GridCellRenderer
[ "GetRenderer", "(", "self", "Grid", "grid", "int", "row", "int", "col", ")", "-", ">", "GridCellRenderer" ]
def GetRenderer(*args, **kwargs): """GetRenderer(self, Grid grid, int row, int col) -> GridCellRenderer""" return _grid.GridCellAttr_GetRenderer(*args, **kwargs)
[ "def", "GetRenderer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridCellAttr_GetRenderer", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L643-L645
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_menu.py
python
KeyBinder.GetBinding
(self, item_id)
return unicode(shortcut)
Get the keybinding string for use in a menu @param item_id: Menu Item Id @return: string
Get the keybinding string for use in a menu @param item_id: Menu Item Id @return: string
[ "Get", "the", "keybinding", "string", "for", "use", "in", "a", "menu", "@param", "item_id", ":", "Menu", "Item", "Id", "@return", ":", "string" ]
def GetBinding(self, item_id): """Get the keybinding string for use in a menu @param item_id: Menu Item Id @return: string """ rbind = self.GetRawBinding(item_id) shortcut = u'' if rbind is not None: shortcut = u"+".join(rbind) if len(shor...
[ "def", "GetBinding", "(", "self", ",", "item_id", ")", ":", "rbind", "=", "self", ".", "GetRawBinding", "(", "item_id", ")", "shortcut", "=", "u''", "if", "rbind", "is", "not", "None", ":", "shortcut", "=", "u\"+\"", ".", "join", "(", "rbind", ")", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_menu.py#L248-L260
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextCtrl.SetListStyle
(*args, **kwargs)
return _richtext.RichTextCtrl_SetListStyle(*args, **kwargs)
SetListStyle(self, RichTextRange range, String defName, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1) -> bool
SetListStyle(self, RichTextRange range, String defName, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1) -> bool
[ "SetListStyle", "(", "self", "RichTextRange", "range", "String", "defName", "int", "flags", "=", "RICHTEXT_SETSTYLE_WITH_UNDO", "int", "startFrom", "=", "1", "int", "specifiedLevel", "=", "-", "1", ")", "-", ">", "bool" ]
def SetListStyle(*args, **kwargs): """ SetListStyle(self, RichTextRange range, String defName, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1) -> bool """ return _richtext.RichTextCtrl_SetListStyle(*args, **kwargs)
[ "def", "SetListStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_SetListStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3185-L3190
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/mozjar.py
python
JarLog.canonicalize
(url)
The jar path is stored in a MOZ_JAR_LOG_FILE log as a url. This method returns a unique value corresponding to such urls. - file:///{path} becomes {path} - jar:file:///{path}!/{subpath} becomes ({path}, {subpath}) - jar:jar:file:///{path}!/{subpath}!/{subpath2} becomes ({path}...
The jar path is stored in a MOZ_JAR_LOG_FILE log as a url. This method returns a unique value corresponding to such urls. - file:///{path} becomes {path} - jar:file:///{path}!/{subpath} becomes ({path}, {subpath}) - jar:jar:file:///{path}!/{subpath}!/{subpath2} becomes ({path}...
[ "The", "jar", "path", "is", "stored", "in", "a", "MOZ_JAR_LOG_FILE", "log", "as", "a", "url", ".", "This", "method", "returns", "a", "unique", "value", "corresponding", "to", "such", "urls", ".", "-", "file", ":", "///", "{", "path", "}", "becomes", "{...
def canonicalize(url): ''' The jar path is stored in a MOZ_JAR_LOG_FILE log as a url. This method returns a unique value corresponding to such urls. - file:///{path} becomes {path} - jar:file:///{path}!/{subpath} becomes ({path}, {subpath}) - jar:jar:file:///{path}!/{subp...
[ "def", "canonicalize", "(", "url", ")", ":", "if", "not", "isinstance", "(", "url", ",", "ParseResult", ")", ":", "# Assume that if it doesn't start with jar: or file:, it's a path.", "if", "not", "url", ".", "startswith", "(", "(", "'jar:'", ",", "'file:'", ")", ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/mozjar.py#L776-L806
godlikepanos/anki-3d-engine
e2f65e5045624492571ea8527a4dbf3fad8d2c0a
AnKi/Script/LuaGlueGen.py
python
args
(args_el, stack_index)
return args_str
Write the pop code for argument parsing and return the arg list
Write the pop code for argument parsing and return the arg list
[ "Write", "the", "pop", "code", "for", "argument", "parsing", "and", "return", "the", "arg", "list" ]
def args(args_el, stack_index): """ Write the pop code for argument parsing and return the arg list """ if args_el is None: return "" wglue("// Pop arguments") arg_index = 0 # Do the work args_str = "" arg_index = 0 for arg_el in args_el.iter("arg"): arg(arg_el.text, s...
[ "def", "args", "(", "args_el", ",", "stack_index", ")", ":", "if", "args_el", "is", "None", ":", "return", "\"\"", "wglue", "(", "\"// Pop arguments\"", ")", "arg_index", "=", "0", "# Do the work", "args_str", "=", "\"\"", "arg_index", "=", "0", "for", "ar...
https://github.com/godlikepanos/anki-3d-engine/blob/e2f65e5045624492571ea8527a4dbf3fad8d2c0a/AnKi/Script/LuaGlueGen.py#L210-L232
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py
python
_find_adapter
(registry, ob)
Return an adapter factory for `ob` from `registry`
Return an adapter factory for `ob` from `registry`
[ "Return", "an", "adapter", "factory", "for", "ob", "from", "registry" ]
def _find_adapter(registry, ob): """Return an adapter factory for `ob` from `registry`""" types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob)))) for t in types: if t in registry: return registry[t]
[ "def", "_find_adapter", "(", "registry", ",", "ob", ")", ":", "types", "=", "_always_object", "(", "inspect", ".", "getmro", "(", "getattr", "(", "ob", ",", "'__class__'", ",", "type", "(", "ob", ")", ")", ")", ")", "for", "t", "in", "types", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py#L3172-L3177
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/turtle.py
python
TNavigator.circle
(self, radius, extent = None, steps = None)
Draw a circle with given radius. Arguments: radius -- a number extent (optional) -- a number steps (optional) -- an integer Draw a circle with given radius. The center is radius units left of the turtle; extent - an angle - determines which part of the circle is...
Draw a circle with given radius.
[ "Draw", "a", "circle", "with", "given", "radius", "." ]
def circle(self, radius, extent = None, steps = None): """ Draw a circle with given radius. Arguments: radius -- a number extent (optional) -- a number steps (optional) -- an integer Draw a circle with given radius. The center is radius units left of the turtle;...
[ "def", "circle", "(", "self", ",", "radius", ",", "extent", "=", "None", ",", "steps", "=", "None", ")", ":", "if", "self", ".", "undobuffer", ":", "self", ".", "undobuffer", ".", "push", "(", "[", "\"seq\"", "]", ")", "self", ".", "undobuffer", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/turtle.py#L1938-L1999
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/control_flow_ops.py
python
WhileContext.AddForwardLoopCounter
(self, outer_grad_state)
return total_iterations, next_n
Adds a loop that counts the number of iterations. This is added to the forward loop at the time when we start to create the loop for backprop gradient computation. Called in the outer context of this forward context. The pseudocode is: `n = 0; while (_pivot) { n++; }` Note that a control de...
Adds a loop that counts the number of iterations.
[ "Adds", "a", "loop", "that", "counts", "the", "number", "of", "iterations", "." ]
def AddForwardLoopCounter(self, outer_grad_state): """Adds a loop that counts the number of iterations. This is added to the forward loop at the time when we start to create the loop for backprop gradient computation. Called in the outer context of this forward context. The pseudocode is: `n...
[ "def", "AddForwardLoopCounter", "(", "self", ",", "outer_grad_state", ")", ":", "n", "=", "constant_op", ".", "constant", "(", "0", ",", "name", "=", "\"f_count\"", ")", "if", "outer_grad_state", "is", "not", "None", ":", "# Force the stack pushes of i-th executio...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/control_flow_ops.py#L2251-L2295
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py
python
ConfigObj._str
(self, value)
Used by ``stringify`` within validate, to turn non-string values into strings.
Used by ``stringify`` within validate, to turn non-string values into strings.
[ "Used", "by", "stringify", "within", "validate", "to", "turn", "non", "-", "string", "values", "into", "strings", "." ]
def _str(self, value): """ Used by ``stringify`` within validate, to turn non-string values into strings. """ if not isinstance(value, basestring): return str(value) else: return value
[ "def", "_str", "(", "self", ",", "value", ")", ":", "if", "not", "isinstance", "(", "value", ",", "basestring", ")", ":", "return", "str", "(", "value", ")", "else", ":", "return", "value" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/configobj/configobj.py#L1522-L1530
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
Window.InheritsBackgroundColour
(*args, **kwargs)
return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
InheritsBackgroundColour(self) -> bool
InheritsBackgroundColour(self) -> bool
[ "InheritsBackgroundColour", "(", "self", ")", "-", ">", "bool" ]
def InheritsBackgroundColour(*args, **kwargs): """InheritsBackgroundColour(self) -> bool""" return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
[ "def", "InheritsBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_InheritsBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L10902-L10904
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/req/req_uninstall.py
python
UninstallPathSet._allowed_to_proceed
(self, verbose)
return ask('Proceed (y/n)? ', ('y', 'n')) == 'y'
Display which files would be deleted and prompt for confirmation
Display which files would be deleted and prompt for confirmation
[ "Display", "which", "files", "would", "be", "deleted", "and", "prompt", "for", "confirmation" ]
def _allowed_to_proceed(self, verbose): # type: (bool) -> bool """Display which files would be deleted and prompt for confirmation """ def _display(msg, paths): # type: (str, Iterable[str]) -> None if not paths: return logger.info(msg...
[ "def", "_allowed_to_proceed", "(", "self", ",", "verbose", ")", ":", "# type: (bool) -> bool", "def", "_display", "(", "msg", ",", "paths", ")", ":", "# type: (str, Iterable[str]) -> None", "if", "not", "paths", ":", "return", "logger", ".", "info", "(", "msg", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/req/req_uninstall.py#L408-L437
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/ntpath.py
python
split
(p)
return d + head, tail
Split a pathname. Return tuple (head, tail) where tail is everything after the final slash. Either part may be empty.
Split a pathname.
[ "Split", "a", "pathname", "." ]
def split(p): """Split a pathname. Return tuple (head, tail) where tail is everything after the final slash. Either part may be empty.""" d, p = splitdrive(p) # set i to index beyond p's last slash i = len(p) while i and p[i-1] not in '/\\': i = i - 1 head, tail = p[:i], p[i:] ...
[ "def", "split", "(", "p", ")", ":", "d", ",", "p", "=", "splitdrive", "(", "p", ")", "# set i to index beyond p's last slash", "i", "=", "len", "(", "p", ")", "while", "i", "and", "p", "[", "i", "-", "1", "]", "not", "in", "'/\\\\'", ":", "i", "=...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ntpath.py#L164-L181
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel.create_side_set_from_expression
(self, side_set_id, expression, element_block_ids='all', tolerance='auto', timesteps='last_if_any', ...
Create a side set from faces which satisfy an expression. Only external element faces of the given element blocks are checked. For example, if the model had a symmetry plane at 'Y = 0', the expression 'Y == 0' would select all element faces on this plane. Example: >>> model.cr...
Create a side set from faces which satisfy an expression.
[ "Create", "a", "side", "set", "from", "faces", "which", "satisfy", "an", "expression", "." ]
def create_side_set_from_expression(self, side_set_id, expression, element_block_ids='all', tolerance='auto', timesteps=...
[ "def", "create_side_set_from_expression", "(", "self", ",", "side_set_id", ",", "expression", ",", "element_block_ids", "=", "'all'", ",", "tolerance", "=", "'auto'", ",", "timesteps", "=", "'last_if_any'", ",", "zero_member_warning", "=", "True", ")", ":", "times...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L4357-L4441
NVIDIAGameWorks/kaolin
e5148d05e9c1e2ce92a07881ce3593b1c5c3f166
kaolin/io/usd.py
python
create_stage
(file_path, up_axis='Y')
return stage
r"""Create a new USD file and return an empty stage. Args: file_path (str): Path to usd file (\*.usd, \*.usda). up_axis (['Y', 'Z']): Specify the stage up axis. Choose from ``['Y', 'Z']``. Returns: (Usd.Stage) Example: >>> stage = create_stage('./new_stage.usd', up_axis='Z...
r"""Create a new USD file and return an empty stage.
[ "r", "Create", "a", "new", "USD", "file", "and", "return", "an", "empty", "stage", "." ]
def create_stage(file_path, up_axis='Y'): r"""Create a new USD file and return an empty stage. Args: file_path (str): Path to usd file (\*.usd, \*.usda). up_axis (['Y', 'Z']): Specify the stage up axis. Choose from ``['Y', 'Z']``. Returns: (Usd.Stage) Example: >>> stag...
[ "def", "create_stage", "(", "file_path", ",", "up_axis", "=", "'Y'", ")", ":", "assert", "os", ".", "path", ".", "exists", "(", "os", ".", "path", ".", "dirname", "(", "file_path", ")", ")", ",", "f'Directory {os.path.dirname(file_path)} not found.'", "stage",...
https://github.com/NVIDIAGameWorks/kaolin/blob/e5148d05e9c1e2ce92a07881ce3593b1c5c3f166/kaolin/io/usd.py#L358-L378
D-X-Y/caffe-faster-rcnn
eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb
tools/extra/parse_log.py
python
save_csv_files
(logfile_path, output_dir, train_dict_list, test_dict_list, delimiter=',', verbose=False)
Save CSV files to output_dir If the input log file is, e.g., caffe.INFO, the names will be caffe.INFO.train and caffe.INFO.test
Save CSV files to output_dir
[ "Save", "CSV", "files", "to", "output_dir" ]
def save_csv_files(logfile_path, output_dir, train_dict_list, test_dict_list, delimiter=',', verbose=False): """Save CSV files to output_dir If the input log file is, e.g., caffe.INFO, the names will be caffe.INFO.train and caffe.INFO.test """ log_basename = os.path.basename(log...
[ "def", "save_csv_files", "(", "logfile_path", ",", "output_dir", ",", "train_dict_list", ",", "test_dict_list", ",", "delimiter", "=", "','", ",", "verbose", "=", "False", ")", ":", "log_basename", "=", "os", ".", "path", ".", "basename", "(", "logfile_path", ...
https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/tools/extra/parse_log.py#L141-L154
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/scipy/sparse/linalg.py
python
arnoldi_iteration
(k, A, M, V, H)
return V, H, breakdown
Performs a single (the k'th) step of the Arnoldi process.
Performs a single (the k'th) step of the Arnoldi process.
[ "Performs", "a", "single", "(", "the", "k", "th", ")", "step", "of", "the", "Arnoldi", "process", "." ]
def arnoldi_iteration(k, A, M, V, H): """ Performs a single (the k'th) step of the Arnoldi process.""" v_ = V[..., k] v = M(A(v_)) v, h = gram_schmidt(V, v) _, v_norm_0 = _safe_normalize(v) tol = _eps(v) * v_norm_0 unit_v, v_norm_1 = _safe_normalize(v, tol) V[..., k + 1] = unit_v h[k...
[ "def", "arnoldi_iteration", "(", "k", ",", "A", ",", "M", ",", "V", ",", "H", ")", ":", "v_", "=", "V", "[", "...", ",", "k", "]", "v", "=", "M", "(", "A", "(", "v_", ")", ")", "v", ",", "h", "=", "gram_schmidt", "(", "V", ",", "v", ")"...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/scipy/sparse/linalg.py#L35-L47
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py
python
SingleServerIRCBot._on_join
(self, c, e)
[Internal]
[Internal]
[ "[", "Internal", "]" ]
def _on_join(self, c, e): """[Internal]""" ch = e.target() nick = nm_to_n(e.source()) if nick == c.get_nickname(): self.channels[ch] = Channel() self.channels[ch].add_user(nick)
[ "def", "_on_join", "(", "self", ",", "c", ",", "e", ")", ":", "ch", "=", "e", ".", "target", "(", ")", "nick", "=", "nm_to_n", "(", "e", ".", "source", "(", ")", ")", "if", "nick", "==", "c", ".", "get_nickname", "(", ")", ":", "self", ".", ...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py#L106-L112
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/cef_version.py
python
VersionFormatter.get_cef_version_components
(self)
return self._cef_version
Returns CEF version components.
Returns CEF version components.
[ "Returns", "CEF", "version", "components", "." ]
def get_cef_version_components(self): """ Returns CEF version components. """ if not bool(self._cef_version): file_path = os.path.join(self.cef_path, 'VERSION.in') assert os.path.isfile(file_path), file_path read_version_file(file_path, self._cef_version) return self._cef_version
[ "def", "get_cef_version_components", "(", "self", ")", ":", "if", "not", "bool", "(", "self", ".", "_cef_version", ")", ":", "file_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "cef_path", ",", "'VERSION.in'", ")", "assert", "os", ".", ...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/cef_version.py#L52-L58
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pyio.py
python
FileIO.readable
(self)
return self._readable
True if file was opened in a read mode.
True if file was opened in a read mode.
[ "True", "if", "file", "was", "opened", "in", "a", "read", "mode", "." ]
def readable(self): """True if file was opened in a read mode.""" self._checkClosed() return self._readable
[ "def", "readable", "(", "self", ")", ":", "self", ".", "_checkClosed", "(", ")", "return", "self", ".", "_readable" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pyio.py#L1723-L1726
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
IconBundle.__init__
(self, *args, **kwargs)
__init__(self) -> IconBundle
__init__(self) -> IconBundle
[ "__init__", "(", "self", ")", "-", ">", "IconBundle" ]
def __init__(self, *args, **kwargs): """__init__(self) -> IconBundle""" _gdi_.IconBundle_swiginit(self,_gdi_.new_IconBundle(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "IconBundle_swiginit", "(", "self", ",", "_gdi_", ".", "new_IconBundle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1383-L1385
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/inplace_ops.py
python
alias_inplace_sub
(x, i, v)
return _inplace_helper(x, i, v, gen_array_ops.inplace_sub)
Applies an inplace sub on input x at index i with value v. Aliases x. If i is None, x and v must be the same shape. Computes x -= v; If i is a scalar, x has a rank 1 higher than v's. Computes x[i, :] -= v; Otherwise, x and v must have the same rank. Computes x[i, :] -= v; Args: x: A Tensor. ...
Applies an inplace sub on input x at index i with value v. Aliases x.
[ "Applies", "an", "inplace", "sub", "on", "input", "x", "at", "index", "i", "with", "value", "v", ".", "Aliases", "x", "." ]
def alias_inplace_sub(x, i, v): """Applies an inplace sub on input x at index i with value v. Aliases x. If i is None, x and v must be the same shape. Computes x -= v; If i is a scalar, x has a rank 1 higher than v's. Computes x[i, :] -= v; Otherwise, x and v must have the same rank. Computes x[i, ...
[ "def", "alias_inplace_sub", "(", "x", ",", "i", ",", "v", ")", ":", "return", "_inplace_helper", "(", "x", ",", "i", ",", "v", ",", "gen_array_ops", ".", "inplace_sub", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/inplace_ops.py#L119-L138
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/isolate/trace_inputs.py
python
get_native_path_case
(root, relative_path)
Returns the native path case.
Returns the native path case.
[ "Returns", "the", "native", "path", "case", "." ]
def get_native_path_case(root, relative_path): """Returns the native path case.""" if sys.platform == 'win32': # Windows used to have an option to turn on case sensitivity on non Win32 # subsystem but that's out of scope here and isn't supported anymore. # First process root. if root: root = G...
[ "def", "get_native_path_case", "(", "root", ",", "relative_path", ")", ":", "if", "sys", ".", "platform", "==", "'win32'", ":", "# Windows used to have an option to turn on case sensitivity on non Win32", "# subsystem but that's out of scope here and isn't supported anymore.", "# F...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/isolate/trace_inputs.py#L147-L166
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/syntax.py
python
Field.__init__
(self, file_name, line, column)
Construct a Field.
Construct a Field.
[ "Construct", "a", "Field", "." ]
def __init__(self, file_name, line, column): # type: (unicode, int, int) -> None """Construct a Field.""" self.name = None # type: unicode self.cpp_name = None # type: unicode self.description = None # type: unicode self.type = None # type: unicode self.ignore...
[ "def", "__init__", "(", "self", ",", "file_name", ",", "line", ",", "column", ")", ":", "# type: (unicode, int, int) -> None", "self", ".", "name", "=", "None", "# type: unicode", "self", ".", "cpp_name", "=", "None", "# type: unicode", "self", ".", "description...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/syntax.py#L277-L293
ideawu/ssdb-rocks
a3cbb322cafb2f493252829c608e2239df98c9ac
deps/cpy/antlr3/tree.py
python
TreeNodeStream.setUniqueNavigationNodes
(self, uniqueNavigationNodes)
As we flatten the tree, we use UP, DOWN nodes to represent the tree structure. When debugging we need unique nodes so we have to instantiate new ones. When doing normal tree parsing, it's slow and a waste of memory to create unique navigation nodes. Default should be false;
As we flatten the tree, we use UP, DOWN nodes to represent the tree structure. When debugging we need unique nodes so we have to instantiate new ones. When doing normal tree parsing, it's slow and a waste of memory to create unique navigation nodes. Default should be false;
[ "As", "we", "flatten", "the", "tree", "we", "use", "UP", "DOWN", "nodes", "to", "represent", "the", "tree", "structure", ".", "When", "debugging", "we", "need", "unique", "nodes", "so", "we", "have", "to", "instantiate", "new", "ones", ".", "When", "doin...
def setUniqueNavigationNodes(self, uniqueNavigationNodes): """ As we flatten the tree, we use UP, DOWN nodes to represent the tree structure. When debugging we need unique nodes so we have to instantiate new ones. When doing normal tree parsing, it's slow and a waste of memory ...
[ "def", "setUniqueNavigationNodes", "(", "self", ",", "uniqueNavigationNodes", ")", ":", "raise", "NotImplementedError" ]
https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tree.py#L1613-L1622
bayandin/chromedriver
d40a2092b50f2fca817221eeb5ea093e0e642c10
log_replay/client_replay.py
python
_Payload.SubstituteIds
(self, id_map, binary, base_url="", init_session=False)
Replace old IDs in the given payload with ones for the current session. Args: id_map: mapping from logged IDs to current-session ones binary: binary to add into this command, if |init_session| is True base_url: base url to replace in the payload for navigation commands init_session: whether...
Replace old IDs in the given payload with ones for the current session.
[ "Replace", "old", "IDs", "in", "the", "given", "payload", "with", "ones", "for", "the", "current", "session", "." ]
def SubstituteIds(self, id_map, binary, base_url="", init_session=False): """Replace old IDs in the given payload with ones for the current session. Args: id_map: mapping from logged IDs to current-session ones binary: binary to add into this command, if |init_session| is True base_url: base ...
[ "def", "SubstituteIds", "(", "self", ",", "id_map", ",", "binary", ",", "base_url", "=", "\"\"", ",", "init_session", "=", "False", ")", ":", "if", "self", ".", "is_error", "or", "self", ".", "is_empty", ":", "return", "_ReplaceWindowAndElementIds", "(", "...
https://github.com/bayandin/chromedriver/blob/d40a2092b50f2fca817221eeb5ea093e0e642c10/log_replay/client_replay.py#L426-L444
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
catalogSetDebug
(level)
return ret
Used to set the debug level for catalog operation, 0 disable debugging, 1 enable it
Used to set the debug level for catalog operation, 0 disable debugging, 1 enable it
[ "Used", "to", "set", "the", "debug", "level", "for", "catalog", "operation", "0", "disable", "debugging", "1", "enable", "it" ]
def catalogSetDebug(level): """Used to set the debug level for catalog operation, 0 disable debugging, 1 enable it """ ret = libxml2mod.xmlCatalogSetDebug(level) return ret
[ "def", "catalogSetDebug", "(", "level", ")", ":", "ret", "=", "libxml2mod", ".", "xmlCatalogSetDebug", "(", "level", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L177-L181
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/python/m5/util/fdthelper.py
python
FdtState.addrCells
(self, addr)
return self.int_to_cells(addr, self.addr_cells)
Format an integer type according to the address_cells value of this state.
Format an integer type according to the address_cells value of this state.
[ "Format", "an", "integer", "type", "according", "to", "the", "address_cells", "value", "of", "this", "state", "." ]
def addrCells(self, addr): """Format an integer type according to the address_cells value of this state.""" return self.int_to_cells(addr, self.addr_cells)
[ "def", "addrCells", "(", "self", ",", "addr", ")", ":", "return", "self", ".", "int_to_cells", "(", "addr", ",", "self", ".", "addr_cells", ")" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/m5/util/fdthelper.py#L128-L131
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
External/INCHI-API/python/inchi.py
python
MolToInchiKey
(mol, options="")
return rdinchi.MolToInchiKey(mol,options)
Returns the standard InChI key for a molecule Returns: the standard InChI key returned by InChI API for the input molecule
Returns the standard InChI key for a molecule
[ "Returns", "the", "standard", "InChI", "key", "for", "a", "molecule" ]
def MolToInchiKey(mol, options=""): """Returns the standard InChI key for a molecule Returns: the standard InChI key returned by InChI API for the input molecule """ return rdinchi.MolToInchiKey(mol,options)
[ "def", "MolToInchiKey", "(", "mol", ",", "options", "=", "\"\"", ")", ":", "return", "rdinchi", ".", "MolToInchiKey", "(", "mol", ",", "options", ")" ]
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/External/INCHI-API/python/inchi.py#L221-L227
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/ops/__init__.py
python
tan
(x, name='')
return tan(x, name)
Computes the element-wise tangent of ``x``: The output tensor has the same shape as ``x``. Example: >>> np.round(C.tan([-1, 0, 1]).eval(), 5) array([-1.55741, 0. , 1.55741], dtype=float32) Args: x: numpy array or any :class:`~cntk.ops.functions.Function` that outputs a tenso...
Computes the element-wise tangent of ``x``:
[ "Computes", "the", "element", "-", "wise", "tangent", "of", "x", ":" ]
def tan(x, name=''): ''' Computes the element-wise tangent of ``x``: The output tensor has the same shape as ``x``. Example: >>> np.round(C.tan([-1, 0, 1]).eval(), 5) array([-1.55741, 0. , 1.55741], dtype=float32) Args: x: numpy array or any :class:`~cntk.ops.functio...
[ "def", "tan", "(", "x", ",", "name", "=", "''", ")", ":", "from", "cntk", ".", "cntk_py", "import", "tan", "x", "=", "sanitize_input", "(", "x", ")", "return", "tan", "(", "x", ",", "name", ")" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/ops/__init__.py#L1727-L1745
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/numbers.py
python
Real.imag
(self)
return 0
Real numbers have no imaginary component.
Real numbers have no imaginary component.
[ "Real", "numbers", "have", "no", "imaginary", "component", "." ]
def imag(self): """Real numbers have no imaginary component.""" return 0
[ "def", "imag", "(", "self", ")", ":", "return", "0" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/numbers.py#L259-L261
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/main.py
python
close
(wait=True)
Tells TraCI to close the connection.
Tells TraCI to close the connection.
[ "Tells", "TraCI", "to", "close", "the", "connection", "." ]
def close(wait=True): """ Tells TraCI to close the connection. """ if "" not in _connections: raise FatalTraCIError("Not connected.") _connections[""].close(wait) _connections[""].simulation._setConnection(None) del _connections[_currentLabel[0]] del _connections[""] if _curr...
[ "def", "close", "(", "wait", "=", "True", ")", ":", "if", "\"\"", "not", "in", "_connections", ":", "raise", "FatalTraCIError", "(", "\"Not connected.\"", ")", "_connections", "[", "\"\"", "]", ".", "close", "(", "wait", ")", "_connections", "[", "\"\"", ...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/main.py#L278-L289
ucbrise/confluo
578883a4f7fbbb4aea78c342d366f5122ef598f7
pyclient/confluo/rpc/schema.py
python
make_schema
(s)
return Schema(sb.build())
Converts a JSON-like string representation of the schema to our internal representation of the schema. Args: s: A JSON-like schema string Returns: Our internal representation of the schema.
Converts a JSON-like string representation of the schema to our internal representation of the schema.
[ "Converts", "a", "JSON", "-", "like", "string", "representation", "of", "the", "schema", "to", "our", "internal", "representation", "of", "the", "schema", "." ]
def make_schema(s): """Converts a JSON-like string representation of the schema to our internal representation of the schema. Args: s: A JSON-like schema string Returns: Our internal representation of the schema. """ def ordered_load(stream): class OrderedLoader(yaml.Loader...
[ "def", "make_schema", "(", "s", ")", ":", "def", "ordered_load", "(", "stream", ")", ":", "class", "OrderedLoader", "(", "yaml", ".", "Loader", ")", ":", "pass", "def", "construct_mapping", "(", "loader", ",", "node", ")", ":", "loader", ".", "flatten_ma...
https://github.com/ucbrise/confluo/blob/578883a4f7fbbb4aea78c342d366f5122ef598f7/pyclient/confluo/rpc/schema.py#L236-L259
pirobot/rbx2
2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a
rbx2_utils/src/rbx2_utils/srv/_LaunchProcess.py
python
LaunchProcessResponse._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/pirobot/rbx2/blob/2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a/rbx2_utils/src/rbx2_utils/srv/_LaunchProcess.py#L160-L164
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/dist.py
python
Distribution.get_cmdline_options
(self)
return d
Return a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config fi...
Return a '{cmd: {opt:val}}' map of all command-line options
[ "Return", "a", "{", "cmd", ":", "{", "opt", ":", "val", "}}", "map", "of", "all", "command", "-", "line", "options" ]
def get_cmdline_options(self): """Return a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. ...
[ "def", "get_cmdline_options", "(", "self", ")", ":", "d", "=", "{", "}", "for", "cmd", ",", "opts", "in", "self", ".", "command_options", ".", "items", "(", ")", ":", "for", "opt", ",", "(", "src", ",", "val", ")", "in", "opts", ".", "items", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/dist.py#L1025-L1063
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeInt64
(self)
return result
Consumes a signed 64bit integer number. Returns: The integer parsed. Raises: ParseError: If a signed 64bit integer couldn't be consumed.
Consumes a signed 64bit integer number.
[ "Consumes", "a", "signed", "64bit", "integer", "number", "." ]
def ConsumeInt64(self): """Consumes a signed 64bit integer number. Returns: The integer parsed. Raises: ParseError: If a signed 64bit integer couldn't be consumed. """ try: result = self._ParseInteger(self.token, is_signed=True, is_long=True) except ValueError, e: raise...
[ "def", "ConsumeInt64", "(", "self", ")", ":", "try", ":", "result", "=", "self", ".", "_ParseInteger", "(", "self", ".", "token", ",", "is_signed", "=", "True", ",", "is_long", "=", "True", ")", "except", "ValueError", ",", "e", ":", "raise", "self", ...
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/text_format.py#L431-L445
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
utils/cpplint.py
python
GetLineWidth
(line)
Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters.
Determines the width of the line in column positions.
[ "Determines", "the", "width", "of", "the", "line", "in", "column", "positions", "." ]
def GetLineWidth(line): """Determines the width of the line in column positions. Args: line: A string, which may be a Unicode string. Returns: The width of the line in column positions, accounting for Unicode combining characters and wide characters. """ if isinstance(line, unicode): width =...
[ "def", "GetLineWidth", "(", "line", ")", ":", "if", "isinstance", "(", "line", ",", "unicode", ")", ":", "width", "=", "0", "for", "uc", "in", "unicodedata", ".", "normalize", "(", "'NFC'", ",", "line", ")", ":", "if", "unicodedata", ".", "east_asian_w...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/utils/cpplint.py#L4355-L4374
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Task.py
python
set_file_constraints
(tasks)
Updates the ``run_after`` attribute of all tasks based on the task inputs and outputs :param tasks: tasks :type tasks: list of :py:class:`waflib.Task.Task`
Updates the ``run_after`` attribute of all tasks based on the task inputs and outputs
[ "Updates", "the", "run_after", "attribute", "of", "all", "tasks", "based", "on", "the", "task", "inputs", "and", "outputs" ]
def set_file_constraints(tasks): """ Updates the ``run_after`` attribute of all tasks based on the task inputs and outputs :param tasks: tasks :type tasks: list of :py:class:`waflib.Task.Task` """ ins = Utils.defaultdict(set) outs = Utils.defaultdict(set) for x in tasks: for a in x.inputs: ins[a].add(x) ...
[ "def", "set_file_constraints", "(", "tasks", ")", ":", "ins", "=", "Utils", ".", "defaultdict", "(", "set", ")", "outs", "=", "Utils", ".", "defaultdict", "(", "set", ")", "for", "x", "in", "tasks", ":", "for", "a", "in", "x", ".", "inputs", ":", "...
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Task.py#L949-L969
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlTextReader.NewMemory
(self, buffer, size, URL, encoding, options)
return ret
Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader.
Setup an xmltextReader to parse an XML in-memory document. The parsing flags
[ "Setup", "an", "xmltextReader", "to", "parse", "an", "XML", "in", "-", "memory", "document", ".", "The", "parsing", "flags" ]
def NewMemory(self, buffer, size, URL, encoding, options): """Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewMemory...
[ "def", "NewMemory", "(", "self", ",", "buffer", ",", "size", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlReaderNewMemory", "(", "self", ".", "_o", ",", "buffer", ",", "size", ",", "URL", ",", "encoding", ...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L6759-L6765