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
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/descriptor.py
python
Descriptor.CopyToProto
(self, proto)
Copies this to a descriptor_pb2.DescriptorProto. Args: proto: An empty descriptor_pb2.DescriptorProto.
Copies this to a descriptor_pb2.DescriptorProto.
[ "Copies", "this", "to", "a", "descriptor_pb2", ".", "DescriptorProto", "." ]
def CopyToProto(self, proto): """Copies this to a descriptor_pb2.DescriptorProto. Args: proto: An empty descriptor_pb2.DescriptorProto. """ # This function is overriden to give a better doc comment. super(Descriptor, self).CopyToProto(proto)
[ "def", "CopyToProto", "(", "self", ",", "proto", ")", ":", "# This function is overriden to give a better doc comment.", "super", "(", "Descriptor", ",", "self", ")", ".", "CopyToProto", "(", "proto", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/descriptor.py#L253-L260
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PGArrayEditorDialog.Create
(*args, **kwargs)
return _propgrid.PGArrayEditorDialog_Create(*args, **kwargs)
Create(self, Window parent, String message, String caption, long style=(wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxOK|wxCANCEL|wxCENTRE), Point pos=DefaultPosition, Size sz=DefaultSize) -> bool
Create(self, Window parent, String message, String caption, long style=(wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxOK|wxCANCEL|wxCENTRE), Point pos=DefaultPosition, Size sz=DefaultSize) -> bool
[ "Create", "(", "self", "Window", "parent", "String", "message", "String", "caption", "long", "style", "=", "(", "wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxOK|wxCANCEL|wxCENTRE", ")", "Point", "pos", "=", "DefaultPosition", "Size", "sz", "=", "DefaultSize", ")", "-", ...
def Create(*args, **kwargs): """ Create(self, Window parent, String message, String caption, long style=(wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxOK|wxCANCEL|wxCENTRE), Point pos=DefaultPosition, Size sz=DefaultSize) -> bool """ return _propgrid.PGArrayEditorDia...
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGArrayEditorDialog_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L3177-L3183
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/Direct/DirectEnergyConversion.py
python
DirectEnergyConversion.remap
(self, result_ws, spec_masks, map_file)
return mtd[ws_name]
Mask and group detectors based on input parameters
Mask and group detectors based on input parameters
[ "Mask", "and", "group", "detectors", "based", "on", "input", "parameters" ]
def remap(self, result_ws, spec_masks, map_file): """ Mask and group detectors based on input parameters """ ws_name = result_ws.name() if spec_masks is not None: MaskDetectors(Workspace=ws_name, MaskedWorkspace=spec_masks) if map_file is not None: ...
[ "def", "remap", "(", "self", ",", "result_ws", ",", "spec_masks", ",", "map_file", ")", ":", "ws_name", "=", "result_ws", ".", "name", "(", ")", "if", "spec_masks", "is", "not", "None", ":", "MaskDetectors", "(", "Workspace", "=", "ws_name", ",", "Masked...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/DirectEnergyConversion.py#L947-L958
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
Examples/ReinforcementLearning/DeepQNeuralNetwork.py
python
ReplayMemory.sample
(self, size)
return indexes
Generate size random integers mapping indices in the memory. The returned indices can be retrieved using #get_state(). See the method #minibatch() if you want to retrieve samples directly. Attributes: size (int): The minibatch size Returns: Indexes of t...
Generate size random integers mapping indices in the memory. The returned indices can be retrieved using #get_state(). See the method #minibatch() if you want to retrieve samples directly.
[ "Generate", "size", "random", "integers", "mapping", "indices", "in", "the", "memory", ".", "The", "returned", "indices", "can", "be", "retrieved", "using", "#get_state", "()", ".", "See", "the", "method", "#minibatch", "()", "if", "you", "want", "to", "retr...
def sample(self, size): """ Generate size random integers mapping indices in the memory. The returned indices can be retrieved using #get_state(). See the method #minibatch() if you want to retrieve samples directly. Attributes: size (int): The minibatch size ...
[ "def", "sample", "(", "self", ",", "size", ")", ":", "# Local variable access is faster in loops", "count", ",", "pos", ",", "history_len", ",", "terminals", "=", "self", ".", "_count", "-", "1", ",", "self", ".", "_pos", ",", "self", ".", "_history_length",...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/Examples/ReinforcementLearning/DeepQNeuralNetwork.py#L66-L94
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_vendor/ordered_set.py
python
OrderedSet.difference
(self, *sets)
return cls(items)
Returns all elements that are in this set but not the others. Example: >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2])) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3])) OrderedSet([1]) >>> OrderedSet([1, 2...
Returns all elements that are in this set but not the others.
[ "Returns", "all", "elements", "that", "are", "in", "this", "set", "but", "not", "the", "others", "." ]
def difference(self, *sets): """ Returns all elements that are in this set but not the others. Example: >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2])) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3])) ...
[ "def", "difference", "(", "self", ",", "*", "sets", ")", ":", "cls", "=", "self", ".", "__class__", "if", "sets", ":", "other", "=", "set", ".", "union", "(", "*", "map", "(", "set", ",", "sets", ")", ")", "items", "=", "(", "item", "for", "ite...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/ordered_set.py#L355-L375
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/slim/python/slim/data/prefetch_queue.py
python
prefetch_queue
(tensors, capacity=8, shared_name=None, name=None)
Creates a queue to prefetech tensors from `tensors`. A queue runner for enqueing tensors into the prefetch_queue is automatically added to the TF QueueRunners collection. Example: This is for example useful to pre-assemble input batches read with `tf.train.batch()` and enqueue the pre-assembled batches. Op...
Creates a queue to prefetech tensors from `tensors`.
[ "Creates", "a", "queue", "to", "prefetech", "tensors", "from", "tensors", "." ]
def prefetch_queue(tensors, capacity=8, shared_name=None, name=None): """Creates a queue to prefetech tensors from `tensors`. A queue runner for enqueing tensors into the prefetch_queue is automatically added to the TF QueueRunners collection. Example: ...
[ "def", "prefetch_queue", "(", "tensors", ",", "capacity", "=", "8", ",", "shared_name", "=", "None", ",", "name", "=", "None", ")", ":", "if", "isinstance", "(", "tensors", ",", "dict", ")", ":", "# Need to wrap the keys and values in list() since Python3 returns ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/slim/python/slim/data/prefetch_queue.py#L28-L80
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/ensdf_processing.py
python
gabs
(inputdict_unchecked)
This program calculates Gamma-ray absolute intensity and normalization (GABS readme) Parameters ---------- inputdict_unchecked : dictionary dictionary that must have the following key-pair values: input_file : string, input ensdf file dataset_file : string, dataset file ...
This program calculates Gamma-ray absolute intensity and normalization (GABS readme)
[ "This", "program", "calculates", "Gamma", "-", "ray", "absolute", "intensity", "and", "normalization", "(", "GABS", "readme", ")" ]
def gabs(inputdict_unchecked): """ This program calculates Gamma-ray absolute intensity and normalization (GABS readme) Parameters ---------- inputdict_unchecked : dictionary dictionary that must have the following key-pair values: input_file : string, input ensdf file ...
[ "def", "gabs", "(", "inputdict_unchecked", ")", ":", "exe_path", "=", "path_to_exe", "(", "'gabs'", ")", "verify_download_exe", "(", "exe_path", ")", "inputdict", "=", "{", "}", "input_file", "=", "inputdict_unchecked", "[", "'input_file'", "]", "dataset_file", ...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/ensdf_processing.py#L275-L309
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py
python
_Stream.__read
(self, size)
return buf
Return size bytes from stream. If internal buffer is empty, read another block from the stream.
Return size bytes from stream. If internal buffer is empty, read another block from the stream.
[ "Return", "size", "bytes", "from", "stream", ".", "If", "internal", "buffer", "is", "empty", "read", "another", "block", "from", "the", "stream", "." ]
def __read(self, size): """Return size bytes from stream. If internal buffer is empty, read another block from the stream. """ c = len(self.buf) while c < size: buf = self.fileobj.read(self.bufsize) if not buf: break self.buf...
[ "def", "__read", "(", "self", ",", "size", ")", ":", "c", "=", "len", "(", "self", ".", "buf", ")", "while", "c", "<", "size", ":", "buf", "=", "self", ".", "fileobj", ".", "read", "(", "self", ".", "bufsize", ")", "if", "not", "buf", ":", "b...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L604-L617
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/platform.py
python
_syscmd_ver
(system='', release='', version='', supported_platforms=('win32','win16','dos','os2'))
return system,release,version
Tries to figure out the OS version used and returns a tuple (system,release,version). It uses the "ver" shell command for this which is known to exists on Windows, DOS and OS/2. XXX Others too ? In case this fails, the given parameters are used as defaults.
Tries to figure out the OS version used and returns a tuple (system,release,version).
[ "Tries", "to", "figure", "out", "the", "OS", "version", "used", "and", "returns", "a", "tuple", "(", "system", "release", "version", ")", "." ]
def _syscmd_ver(system='', release='', version='', supported_platforms=('win32','win16','dos','os2')): """ Tries to figure out the OS version used and returns a tuple (system,release,version). It uses the "ver" shell command for this which is known to exists on Windows, DOS...
[ "def", "_syscmd_ver", "(", "system", "=", "''", ",", "release", "=", "''", ",", "version", "=", "''", ",", "supported_platforms", "=", "(", "'win32'", ",", "'win16'", ",", "'dos'", ",", "'os2'", ")", ")", ":", "if", "sys", ".", "platform", "not", "in...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/platform.py#L475-L525
OpenNebula/one
982e09706fc444ae60a8ad2f818d6a795cbbdab4
share/websockify/websockify/websocket.py
python
WebSocketServer.top_new_client
(self, startsock, address)
Do something with a WebSockets client connection.
Do something with a WebSockets client connection.
[ "Do", "something", "with", "a", "WebSockets", "client", "connection", "." ]
def top_new_client(self, startsock, address): """ Do something with a WebSockets client connection. """ # handler process client = None try: try: client = self.do_handshake(startsock, address) except self.EClose: _, exc, _ = sys.exc...
[ "def", "top_new_client", "(", "self", ",", "startsock", ",", "address", ")", ":", "# handler process", "client", "=", "None", "try", ":", "try", ":", "client", "=", "self", ".", "do_handshake", "(", "startsock", ",", "address", ")", "except", "self", ".", ...
https://github.com/OpenNebula/one/blob/982e09706fc444ae60a8ad2f818d6a795cbbdab4/share/websockify/websockify/websocket.py#L924-L947
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/dist.py
python
Distribution._finalize_features
(self)
Add/remove features and resolve dependencies between them
Add/remove features and resolve dependencies between them
[ "Add", "/", "remove", "features", "and", "resolve", "dependencies", "between", "them" ]
def _finalize_features(self): """Add/remove features and resolve dependencies between them""" # First, flag all the enabled items (and thus their dependencies) for name, feature in self.features.items(): enabled = self.feature_is_included(name) if enabled or (enabled is ...
[ "def", "_finalize_features", "(", "self", ")", ":", "# First, flag all the enabled items (and thus their dependencies)", "for", "name", ",", "feature", "in", "self", ".", "features", ".", "items", "(", ")", ":", "enabled", "=", "self", ".", "feature_is_included", "(...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/dist.py#L813-L828
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/aicpu/standard_normal.py
python
_standard_normal_aicpu
()
return
RandomNormal AiCPU register
RandomNormal AiCPU register
[ "RandomNormal", "AiCPU", "register" ]
def _standard_normal_aicpu(): """RandomNormal AiCPU register""" return
[ "def", "_standard_normal_aicpu", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/aicpu/standard_normal.py#L31-L33
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/SHA3_224.py
python
SHA3_224_Hash.hexdigest
(self)
return "".join(["%02x" % bord(x) for x in self.digest()])
Return the **printable** digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Hexadecimal encoded. :rtype: string
Return the **printable** digest of the message that has been hashed so far.
[ "Return", "the", "**", "printable", "**", "digest", "of", "the", "message", "that", "has", "been", "hashed", "so", "far", "." ]
def hexdigest(self): """Return the **printable** digest of the message that has been hashed so far. :return: The hash digest, computed over the data processed so far. Hexadecimal encoded. :rtype: string """ return "".join(["%02x" % bord(x) for x in self.digest(...
[ "def", "hexdigest", "(", "self", ")", ":", "return", "\"\"", ".", "join", "(", "[", "\"%02x\"", "%", "bord", "(", "x", ")", "for", "x", "in", "self", ".", "digest", "(", ")", "]", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Hash/SHA3_224.py#L104-L112
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/_lib/six.py
python
with_metaclass
(meta, base=object)
return meta("NewBase", (base,), {})
Create a base class with a metaclass.
Create a base class with a metaclass.
[ "Create", "a", "base", "class", "with", "a", "metaclass", "." ]
def with_metaclass(meta, base=object): """Create a base class with a metaclass.""" return meta("NewBase", (base,), {})
[ "def", "with_metaclass", "(", "meta", ",", "base", "=", "object", ")", ":", "return", "meta", "(", "\"NewBase\"", ",", "(", "base", ",", ")", ",", "{", "}", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/_lib/six.py#L274-L276
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py
python
ShapeEquivSet._insert
(self, objs)
Overload EquivSet._insert to manage ind_to_var dictionary.
Overload EquivSet._insert to manage ind_to_var dictionary.
[ "Overload", "EquivSet", ".", "_insert", "to", "manage", "ind_to_var", "dictionary", "." ]
def _insert(self, objs): """Overload EquivSet._insert to manage ind_to_var dictionary. """ inds = [] for obj in objs: if obj in self.obj_to_ind: inds.append(self.obj_to_ind[obj]) varlist = [] constval = None names = set() for i ...
[ "def", "_insert", "(", "self", ",", "objs", ")", ":", "inds", "=", "[", "]", "for", "obj", "in", "objs", ":", "if", "obj", "in", "self", ".", "obj_to_ind", ":", "inds", ".", "append", "(", "self", ".", "obj_to_ind", "[", "obj", "]", ")", "varlist...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py#L444-L470
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/core/config.py
python
set_sending_batches
(batch_num)
Set the default sending batches when training with sink_mode=True in Ascend device. Args: batch_num (int): the total sending batches, when batch_num is set, it will wait unless sending batches increase, default is 0 which means will send all batches in dataset. Raises: TypeError: If b...
Set the default sending batches when training with sink_mode=True in Ascend device.
[ "Set", "the", "default", "sending", "batches", "when", "training", "with", "sink_mode", "=", "True", "in", "Ascend", "device", "." ]
def set_sending_batches(batch_num): """ Set the default sending batches when training with sink_mode=True in Ascend device. Args: batch_num (int): the total sending batches, when batch_num is set, it will wait unless sending batches increase, default is 0 which means will send all batches ...
[ "def", "set_sending_batches", "(", "batch_num", ")", ":", "if", "not", "isinstance", "(", "batch_num", ",", "int", ")", ":", "raise", "TypeError", "(", "\"batch_num must be an int dtype.\"", ")", "_config", ".", "set_sending_batches", "(", "batch_num", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/core/config.py#L548-L565
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/contacts/service.py
python
ContactsService.GetProfilesFeed
(self, uri=None)
return self.Get(uri, converter=gdata.contacts.ProfilesFeedFromString)
Retrieves a feed containing all domain's profiles. Args: uri: string (optional) the URL to retrieve the profiles feed, for example /m8/feeds/profiles/default/full Returns: On success, a ProfilesFeed containing the profiles. On failure, raises a RequestError.
Retrieves a feed containing all domain's profiles.
[ "Retrieves", "a", "feed", "containing", "all", "domain", "s", "profiles", "." ]
def GetProfilesFeed(self, uri=None): """Retrieves a feed containing all domain's profiles. Args: uri: string (optional) the URL to retrieve the profiles feed, for example /m8/feeds/profiles/default/full Returns: On success, a ProfilesFeed containing the profiles. On failure, ra...
[ "def", "GetProfilesFeed", "(", "self", ",", "uri", "=", "None", ")", ":", "uri", "=", "uri", "or", "self", ".", "GetFeedUri", "(", "'profiles'", ")", "return", "self", ".", "Get", "(", "uri", ",", "converter", "=", "gdata", ".", "contacts", ".", "Pro...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/contacts/service.py#L280-L294
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/lib/debug_data.py
python
DebugDumpDir.get_rel_timestamps
(self, node_name, output_slot, debug_op, device_name=None)
return self._watch_key_to_rel_time[device_name][watch_key]
Get the relative timestamp from for a debug-dumped tensor. Relative timestamp means (absolute timestamp - `t0`), where `t0` is the absolute timestamp of the first dumped tensor in the dump root. The tensor may be dumped multiple times in the dump root directory, so a list of relative timestamps (`numpy...
Get the relative timestamp from for a debug-dumped tensor.
[ "Get", "the", "relative", "timestamp", "from", "for", "a", "debug", "-", "dumped", "tensor", "." ]
def get_rel_timestamps(self, node_name, output_slot, debug_op, device_name=None): """Get the relative timestamp from for a debug-dumped tensor. Relative timestamp means (absolute timestamp - `t0`), where `t0` is...
[ "def", "get_rel_timestamps", "(", "self", ",", "node_name", ",", "output_slot", ",", "debug_op", ",", "device_name", "=", "None", ")", ":", "device_name", "=", "self", ".", "_infer_device_name", "(", "device_name", ",", "node_name", ")", "watch_key", "=", "_ge...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/debug_data.py#L1519-L1554
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/ragged/ragged_shape.py
python
_broadcast_dynamic_shape_extended_helper
( a: RaggedShape, b: RaggedShape)
Helper for broadcast_dynamic_shape_extended. Here, we force: a.rank <= b.rank 2 <= b.rank 1 <= a.rank Args: a: a RaggedShape b: a RaggedShape Returns: A triple of a shape and two broadcasters.
Helper for broadcast_dynamic_shape_extended.
[ "Helper", "for", "broadcast_dynamic_shape_extended", "." ]
def _broadcast_dynamic_shape_extended_helper( a: RaggedShape, b: RaggedShape) -> Tuple[RaggedShape, _Broadcaster, _Broadcaster]: """Helper for broadcast_dynamic_shape_extended. Here, we force: a.rank <= b.rank 2 <= b.rank 1 <= a.rank Args: a: a RaggedShape b: a RaggedShape Returns:...
[ "def", "_broadcast_dynamic_shape_extended_helper", "(", "a", ":", "RaggedShape", ",", "b", ":", "RaggedShape", ")", "->", "Tuple", "[", "RaggedShape", ",", "_Broadcaster", ",", "_Broadcaster", "]", ":", "assert", "a", ".", "rank", "<=", "b", ".", "rank", "as...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_shape.py#L2021-L2096
ComputationalRadiationPhysics/picongpu
59e9b53605f9a5c1bf271eeb055bc74370a99052
src/tools/bin/plot_chargeConservation.py
python
plotError
(file_pattern, slice_pos=[0.5, 0.5, 0.5], timestep=-1)
read field data from an openPMD file compute div(E) - rho/epsilon_0 plot slices through simulation volume Parameters: file_pattern: file name openPMD file series pattern e.g. simData_%%T.bp slice_pos: list of floats list of 3 floats to define slice position [0, 1] Default=...
read field data from an openPMD file compute div(E) - rho/epsilon_0 plot slices through simulation volume
[ "read", "field", "data", "from", "an", "openPMD", "file", "compute", "div", "(", "E", ")", "-", "rho", "/", "epsilon_0", "plot", "slices", "through", "simulation", "volume" ]
def plotError(file_pattern, slice_pos=[0.5, 0.5, 0.5], timestep=-1): """ read field data from an openPMD file compute div(E) - rho/epsilon_0 plot slices through simulation volume Parameters: file_pattern: file name openPMD file series pattern e.g. simData_%%T.bp slice_pos: list of...
[ "def", "plotError", "(", "file_pattern", ",", "slice_pos", "=", "[", "0.5", ",", "0.5", ",", "0.5", "]", ",", "timestep", "=", "-", "1", ")", ":", "# load file", "series", "=", "io", ".", "Series", "(", "file_pattern", ",", "io", ".", "Access", ".", ...
https://github.com/ComputationalRadiationPhysics/picongpu/blob/59e9b53605f9a5c1bf271eeb055bc74370a99052/src/tools/bin/plot_chargeConservation.py#L54-L179
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py
python
SysLogHandler.__init__
(self, address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=None)
Initialize a handler. If address is specified as a string, a UNIX socket is used. To log to a local syslogd, "SysLogHandler(address="/dev/log")" can be used. If facility is not specified, LOG_USER is used. If socktype is specified as socket.SOCK_DGRAM or socket.SOCK_STREAM, that specifi...
Initialize a handler.
[ "Initialize", "a", "handler", "." ]
def __init__(self, address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=None): """ Initialize a handler. If address is specified as a string, a UNIX socket is used. To log to a local syslogd, "SysLogHandler(address="/dev/log")" can be used. If fac...
[ "def", "__init__", "(", "self", ",", "address", "=", "(", "'localhost'", ",", "SYSLOG_UDP_PORT", ")", ",", "facility", "=", "LOG_USER", ",", "socktype", "=", "None", ")", ":", "logging", ".", "Handler", ".", "__init__", "(", "self", ")", "self", ".", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py#L795-L847
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/build_configurations.py
python
preprocess_target_configuration_list
(ctx, target, target_platform, configurations, auto_populate_empty=False)
return processed_configurations
Preprocess a list of configurations based on an optional target_platform filter from user input :param ctx: Context :param target: Optional target name to report target based errors :param target_platform: The target platform for the configuration list :param configurati...
Preprocess a list of configurations based on an optional target_platform filter from user input :param ctx: Context :param target: Optional target name to report target based errors :param target_platform: The target platform for the configuration list :param configurati...
[ "Preprocess", "a", "list", "of", "configurations", "based", "on", "an", "optional", "target_platform", "filter", "from", "user", "input", ":", "param", "ctx", ":", "Context", ":", "param", "target", ":", "Optional", "target", "name", "to", "report", "target", ...
def preprocess_target_configuration_list(ctx, target, target_platform, configurations, auto_populate_empty=False): """ Preprocess a list of configurations based on an optional target_platform filter from user input :param ctx: Context :param target: Optional target name to r...
[ "def", "preprocess_target_configuration_list", "(", "ctx", ",", "target", ",", "target_platform", ",", "configurations", ",", "auto_populate_empty", "=", "False", ")", ":", "if", "target_platform", ":", "# Collect the valid configuration names for the platform", "platform_det...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/build_configurations.py#L907-L972
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
kratos/python_scripts/restart_utility.py
python
RestartUtility.IsRestartOutputStep
(self)
This function checks and returns whether a restart file should be written in this time-step
This function checks and returns whether a restart file should be written in this time-step
[ "This", "function", "checks", "and", "returns", "whether", "a", "restart", "file", "should", "be", "written", "in", "this", "time", "-", "step" ]
def IsRestartOutputStep(self): """ This function checks and returns whether a restart file should be written in this time-step """ if self.restart_control_type_is_time: return (self.model_part.ProcessInfo[KratosMultiphysics.TIME] > self.next_output) else: ...
[ "def", "IsRestartOutputStep", "(", "self", ")", ":", "if", "self", ".", "restart_control_type_is_time", ":", "return", "(", "self", ".", "model_part", ".", "ProcessInfo", "[", "KratosMultiphysics", ".", "TIME", "]", ">", "self", ".", "next_output", ")", "else"...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/restart_utility.py#L174-L181
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
examples/python/jobshop_ft06_distance_sat.py
python
distance_between_jobs
(x, y)
return abs(x - y)
Returns the distance between tasks of job x and tasks of job y.
Returns the distance between tasks of job x and tasks of job y.
[ "Returns", "the", "distance", "between", "tasks", "of", "job", "x", "and", "tasks", "of", "job", "y", "." ]
def distance_between_jobs(x, y): """Returns the distance between tasks of job x and tasks of job y.""" return abs(x - y)
[ "def", "distance_between_jobs", "(", "x", ",", "y", ")", ":", "return", "abs", "(", "x", "-", "y", ")" ]
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/examples/python/jobshop_ft06_distance_sat.py#L33-L35
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/named_entity_recognition/src/iterators.py
python
BucketNerIter.reset
(self)
Resets the iterator to the beginning of the data.
Resets the iterator to the beginning of the data.
[ "Resets", "the", "iterator", "to", "the", "beginning", "of", "the", "data", "." ]
def reset(self): """Resets the iterator to the beginning of the data.""" self.curr_idx = 0 #shuffle data in each bucket random.shuffle(self.idx) for i, buck in enumerate(self.sentences): self.indices[i], self.sentences[i], self.characters[i], self.label[i] = shuffle(s...
[ "def", "reset", "(", "self", ")", ":", "self", ".", "curr_idx", "=", "0", "#shuffle data in each bucket", "random", ".", "shuffle", "(", "self", ".", "idx", ")", "for", "i", ",", "buck", "in", "enumerate", "(", "self", ".", "sentences", ")", ":", "self...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/named_entity_recognition/src/iterators.py#L135-L157
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/graph/common_lattices.py
python
Pyrochlore
( extent: Sequence[int], *, pbc: Union[bool, Sequence[bool]] = True, **kwargs )
return Lattice( basis_vectors=basis, site_offsets=sites, extent=extent, pbc=pbc, point_group=point_group, **kwargs, )
Constructs a pyrochlore lattice of a given spatial extent. Periodic boundary conditions can also be imposed. Sites are returned at the 16c Wyckoff positions of the FCC lattice ([111]/8, [1 -1 -1]/8, [-1 1 -1]/8, [-1 -1 1]/8, and translations thereof). Arguments: extent: Number of primitive uni...
Constructs a pyrochlore lattice of a given spatial extent. Periodic boundary conditions can also be imposed.
[ "Constructs", "a", "pyrochlore", "lattice", "of", "a", "given", "spatial", "extent", ".", "Periodic", "boundary", "conditions", "can", "also", "be", "imposed", "." ]
def Pyrochlore( extent: Sequence[int], *, pbc: Union[bool, Sequence[bool]] = True, **kwargs ) -> Lattice: """Constructs a pyrochlore lattice of a given spatial extent. Periodic boundary conditions can also be imposed. Sites are returned at the 16c Wyckoff positions of the FCC lattice ([111]/8, [1 -...
[ "def", "Pyrochlore", "(", "extent", ":", "Sequence", "[", "int", "]", ",", "*", ",", "pbc", ":", "Union", "[", "bool", ",", "Sequence", "[", "bool", "]", "]", "=", "True", ",", "*", "*", "kwargs", ")", "->", "Lattice", ":", "basis", "=", "[", "...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/graph/common_lattices.py#L350-L390
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/llvm/utils/benchmark/tools/gbench/util.py
python
is_json_file
(filename)
return False
Returns 'True' if 'filename' names a valid JSON output file. 'False' otherwise.
Returns 'True' if 'filename' names a valid JSON output file. 'False' otherwise.
[ "Returns", "True", "if", "filename", "names", "a", "valid", "JSON", "output", "file", ".", "False", "otherwise", "." ]
def is_json_file(filename): """ Returns 'True' if 'filename' names a valid JSON output file. 'False' otherwise. """ try: with open(filename, 'r') as f: json.load(f) return True except: pass return False
[ "def", "is_json_file", "(", "filename", ")", ":", "try", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "json", ".", "load", "(", "f", ")", "return", "True", "except", ":", "pass", "return", "False" ]
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/llvm/utils/benchmark/tools/gbench/util.py#L40-L51
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py
python
qa_digital_carrier_allocator_cvc.test_001_t2
(self)
pretty simple (same as before, but odd fft len)
pretty simple (same as before, but odd fft len)
[ "pretty", "simple", "(", "same", "as", "before", "but", "odd", "fft", "len", ")" ]
def test_001_t2(self): """ pretty simple (same as before, but odd fft len) """ fft_len = 5 tx_symbols = (1, 2, 3) # ^ this gets mapped to the DC carrier because occupied_carriers[0][0] == 0 occupied_carriers = ((0, 1, 2),) pilot_carriers = ((-2...
[ "def", "test_001_t2", "(", "self", ")", ":", "fft_len", "=", "5", "tx_symbols", "=", "(", "1", ",", "2", ",", "3", ")", "# ^ this gets mapped to the DC carrier because occupied_carriers[0][0] == 0", "occupied_carriers", "=", "(", "(", "0", ",", "1", ",...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_ofdm_carrier_allocator_cvc.py#L55-L86
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/frame.py
python
Frame.head
(self, n=5)
return self.iloc[:n]
Return the first `n` rows. This function returns the first `n` rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it. For negative values of `n`, this function returns all rows except the last `n` rows, equivalent ...
Return the first `n` rows. This function returns the first `n` rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it. For negative values of `n`, this function returns all rows except the last `n` rows, equivalent ...
[ "Return", "the", "first", "n", "rows", ".", "This", "function", "returns", "the", "first", "n", "rows", "for", "the", "object", "based", "on", "position", ".", "It", "is", "useful", "for", "quickly", "testing", "if", "your", "object", "has", "the", "righ...
def head(self, n=5): """ Return the first `n` rows. This function returns the first `n` rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it. For negative values of `n`, this function returns all rows exce...
[ "def", "head", "(", "self", ",", "n", "=", "5", ")", ":", "return", "self", ".", "iloc", "[", ":", "n", "]" ]
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/frame.py#L4668-L4749
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py
python
ValidationMonitor.__init__
(self, x=None, y=None, input_fn=None, batch_size=None, eval_steps=None, every_n_steps=100, metrics=None, early_stopping_rounds=None, early_stopping_metric="loss", early_stopping_metric_minimize=True, name=None)
Initializes a ValidationMonitor. Args: x: See `BaseEstimator.evaluate`. y: See `BaseEstimator.evaluate`. input_fn: See `BaseEstimator.evaluate`. batch_size: See `BaseEstimator.evaluate`. eval_steps: See `BaseEstimator.evaluate`. every_n_steps: Check for new checkpoints to evalua...
Initializes a ValidationMonitor.
[ "Initializes", "a", "ValidationMonitor", "." ]
def __init__(self, x=None, y=None, input_fn=None, batch_size=None, eval_steps=None, every_n_steps=100, metrics=None, early_stopping_rounds=None, early_stopping_metric="loss", early_stopping_metric_minimize=True, name=None): """Initializes a ValidationMonit...
[ "def", "__init__", "(", "self", ",", "x", "=", "None", ",", "y", "=", "None", ",", "input_fn", "=", "None", ",", "batch_size", "=", "None", ",", "eval_steps", "=", "None", ",", "every_n_steps", "=", "100", ",", "metrics", "=", "None", ",", "early_sto...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py#L604-L656
NicknineTheEagle/TF2-Base
20459c5a7fbc995b6bf54fa85c2f62a101e9fb64
src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py
python
_VarintEncoder
()
return EncodeVarint
Return an encoder for a basic varint value (does not include tag).
Return an encoder for a basic varint value (does not include tag).
[ "Return", "an", "encoder", "for", "a", "basic", "varint", "value", "(", "does", "not", "include", "tag", ")", "." ]
def _VarintEncoder(): """Return an encoder for a basic varint value (does not include tag).""" local_chr = chr def EncodeVarint(write, value): bits = value & 0x7f value >>= 7 while value: write(local_chr(0x80|bits)) bits = value & 0x7f value >>= 7 return write(local_chr(bits)) ...
[ "def", "_VarintEncoder", "(", ")", ":", "local_chr", "=", "chr", "def", "EncodeVarint", "(", "write", ",", "value", ")", ":", "bits", "=", "value", "&", "0x7f", "value", ">>=", "7", "while", "value", ":", "write", "(", "local_chr", "(", "0x80", "|", ...
https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L334-L347
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Dbase/StorageUtils.py
python
RegisterItem
(conn, table, value, columnName, data=None, id='', idColName='Id', leadText='RDCmpd')
return 1, ID
>>> from rdkit.Dbase.DbConnection import DbConnect >>> conn = DbConnect(tempDbName) >>> tblName = 'StorageTest' >>> conn.AddTable(tblName,'id varchar(32) not null primary key,label varchar(40),val int') >>> RegisterItem(conn,tblName,'label1','label',['label1',1])==(1, 'RDCmpd-000-001-1') True >>> RegisterIt...
>>> from rdkit.Dbase.DbConnection import DbConnect >>> conn = DbConnect(tempDbName) >>> tblName = 'StorageTest' >>> conn.AddTable(tblName,'id varchar(32) not null primary key,label varchar(40),val int') >>> RegisterItem(conn,tblName,'label1','label',['label1',1])==(1, 'RDCmpd-000-001-1') True >>> RegisterIt...
[ ">>>", "from", "rdkit", ".", "Dbase", ".", "DbConnection", "import", "DbConnect", ">>>", "conn", "=", "DbConnect", "(", "tempDbName", ")", ">>>", "tblName", "=", "StorageTest", ">>>", "conn", ".", "AddTable", "(", "tblName", "id", "varchar", "(", "32", ")"...
def RegisterItem(conn, table, value, columnName, data=None, id='', idColName='Id', leadText='RDCmpd'): """ >>> from rdkit.Dbase.DbConnection import DbConnect >>> conn = DbConnect(tempDbName) >>> tblName = 'StorageTest' >>> conn.AddTable(tblName,'id varchar(32) not null primary key,label varch...
[ "def", "RegisterItem", "(", "conn", ",", "table", ",", "value", ",", "columnName", ",", "data", "=", "None", ",", "id", "=", "''", ",", "idColName", "=", "'Id'", ",", "leadText", "=", "'RDCmpd'", ")", ":", "curs", "=", "conn", ".", "GetCursor", "(", ...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Dbase/StorageUtils.py#L175-L214
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/lookup/lookup_ops.py
python
LookupInterface.value_dtype
(self)
return self._value_dtype
The table value dtype.
The table value dtype.
[ "The", "table", "value", "dtype", "." ]
def value_dtype(self): """The table value dtype.""" return self._value_dtype
[ "def", "value_dtype", "(", "self", ")", ":", "return", "self", ".", "_value_dtype" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/lookup/lookup_ops.py#L50-L52
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py
python
_singlefileMailbox.close
(self)
Flush and close the mailbox.
Flush and close the mailbox.
[ "Flush", "and", "close", "the", "mailbox", "." ]
def close(self): """Flush and close the mailbox.""" self.flush() if self._locked: self.unlock() self._file.close()
[ "def", "close", "(", "self", ")", ":", "self", ".", "flush", "(", ")", "if", "self", ".", "_locked", ":", "self", ".", "unlock", "(", ")", "self", ".", "_file", ".", "close", "(", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mailbox.py#L714-L719
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/gtk/gizmos.py
python
SplitterScrolledWindow.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0) -> SplitterScrolledWindow
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0) -> SplitterScrolledWindow
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", ")", "-", ">", "SplitterScrolledWindow" ]
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0) -> SplitterScrolledWindow """ _gizmos.SplitterScrolledWindow_swiginit(self,_gizmos.new_SplitterScrolledWindow(*args, **kwargs)) ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gizmos", ".", "SplitterScrolledWindow_swiginit", "(", "self", ",", "_gizmos", ".", "new_SplitterScrolledWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L286-L292
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/png/png.py
python
Test.testWinfo
(self)
Test the dictionary returned by a `read` method can be used as args for :meth:`Writer`.
Test the dictionary returned by a `read` method can be used as args for :meth:`Writer`.
[ "Test", "the", "dictionary", "returned", "by", "a", "read", "method", "can", "be", "used", "as", "args", "for", ":", "meth", ":", "Writer", "." ]
def testWinfo(self): """Test the dictionary returned by a `read` method can be used as args for :meth:`Writer`. """ r = Reader(bytes=_pngsuite['basn2c16']) info = r.read()[3] w = Writer(**info)
[ "def", "testWinfo", "(", "self", ")", ":", "r", "=", "Reader", "(", "bytes", "=", "_pngsuite", "[", "'basn2c16'", "]", ")", "info", "=", "r", ".", "read", "(", ")", "[", "3", "]", "w", "=", "Writer", "(", "*", "*", "info", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/png/png.py#L2760-L2766
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/io/harwell_boeing/_fortran_format_parser.py
python
ExpFormat.__init__
(self, width, significand, min=None, repeat=None)
\ Parameters ---------- width : int number of characters taken by the string (includes space).
\ Parameters ---------- width : int number of characters taken by the string (includes space).
[ "\\", "Parameters", "----------", "width", ":", "int", "number", "of", "characters", "taken", "by", "the", "string", "(", "includes", "space", ")", "." ]
def __init__(self, width, significand, min=None, repeat=None): """\ Parameters ---------- width : int number of characters taken by the string (includes space). """ self.width = width self.significand = significand self.repeat = repeat ...
[ "def", "__init__", "(", "self", ",", "width", ",", "significand", ",", "min", "=", "None", ",", "repeat", "=", "None", ")", ":", "self", ".", "width", "=", "width", "self", ".", "significand", "=", "significand", "self", ".", "repeat", "=", "repeat", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/io/harwell_boeing/_fortran_format_parser.py#L134-L144
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
examples/manipulation_station/end_effector_teleop_mouse.py
python
MouseKeyboardTeleop.SetRPY
(self, rpy)
@param rpy is a RollPitchYaw object
[]
def SetRPY(self, rpy): """ @param rpy is a RollPitchYaw object """ self.roll = rpy.roll_angle() self.pitch = rpy.pitch_angle() self.yaw = rpy.yaw_angle()
[ "def", "SetRPY", "(", "self", ",", "rpy", ")", ":", "self", ".", "roll", "=", "rpy", ".", "roll_angle", "(", ")", "self", ".", "pitch", "=", "rpy", ".", "pitch_angle", "(", ")", "self", ".", "yaw", "=", "rpy", ".", "yaw_angle", "(", ")" ]
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/examples/manipulation_station/end_effector_teleop_mouse.py#L159-L165
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/retries/standard.py
python
ModeledRetryErrorDetector.detect_error_type
(self, context)
Detect the error type associated with an error code and model. This will either return: * ``self.TRANSIENT_ERROR`` - If the error is a transient error * ``self.THROTTLING_ERROR`` - If the error is a throttling error * ``None`` - If the error is neither type of error.
Detect the error type associated with an error code and model.
[ "Detect", "the", "error", "type", "associated", "with", "an", "error", "code", "and", "model", "." ]
def detect_error_type(self, context): """Detect the error type associated with an error code and model. This will either return: * ``self.TRANSIENT_ERROR`` - If the error is a transient error * ``self.THROTTLING_ERROR`` - If the error is a throttling error * ``None`...
[ "def", "detect_error_type", "(", "self", ",", "context", ")", ":", "error_code", "=", "context", ".", "get_error_code", "(", ")", "op_model", "=", "context", ".", "operation_model", "if", "op_model", "is", "None", "or", "not", "op_model", ".", "error_shapes", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/retries/standard.py#L363-L388
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/ipaddress.py
python
IPv4Address.is_reserved
(self)
return self in self._constants._reserved_network
Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within the reserved IPv4 Network range.
Test if the address is otherwise IETF reserved.
[ "Test", "if", "the", "address", "is", "otherwise", "IETF", "reserved", "." ]
def is_reserved(self): """Test if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within the reserved IPv4 Network range. """ return self in self._constants._reserved_network
[ "def", "is_reserved", "(", "self", ")", ":", "return", "self", "in", "self", ".", "_constants", ".", "_reserved_network" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ipaddress.py#L1315-L1323
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py
python
_FeatureColumn.config
(self)
Returns configuration of the base feature for `tf.parse_example`.
Returns configuration of the base feature for `tf.parse_example`.
[ "Returns", "configuration", "of", "the", "base", "feature", "for", "tf", ".", "parse_example", "." ]
def config(self): """Returns configuration of the base feature for `tf.parse_example`.""" pass
[ "def", "config", "(", "self", ")", ":", "pass" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py#L114-L116
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/framework.py
python
_var_base_to_np
(var_base)
return var_base.numpy()
convert VarBase tp numpy Args: var_base(VarBase) : the VarBase to convert Returns (np.ndarray): the np.ndarray contain the value of VarBase
convert VarBase tp numpy
[ "convert", "VarBase", "tp", "numpy" ]
def _var_base_to_np(var_base): """ convert VarBase tp numpy Args: var_base(VarBase) : the VarBase to convert Returns (np.ndarray): the np.ndarray contain the value of VarBase """ warnings.warn( "paddle.fluid.framework._var_base_to_np is deprecated, please use var_base.nump...
[ "def", "_var_base_to_np", "(", "var_base", ")", ":", "warnings", ".", "warn", "(", "\"paddle.fluid.framework._var_base_to_np is deprecated, please use var_base.numpy() instead of _var_base_to_np(var_base).\"", ")", "return", "var_base", ".", "numpy", "(", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/framework.py#L452-L465
freesurfer/freesurfer
6dbe527d43ffa611acb2cd112e9469f9bfec8e36
cnn_sphere_register/ext/neuron/neuron/utils.py
python
transform
(vol, loc_shift, interp_method='linear', indexing='ij')
return interpn(vol, loc, interp_method=interp_method)
transform (interpolation N-D volumes (features) given shifts at each location in tensorflow Essentially interpolates volume vol at locations determined by loc_shift. This is a spatial transform in the sense that at location [x] we now have the data from, [x + shift] so we've moved data. Parameters: ...
transform (interpolation N-D volumes (features) given shifts at each location in tensorflow
[ "transform", "(", "interpolation", "N", "-", "D", "volumes", "(", "features", ")", "given", "shifts", "at", "each", "location", "in", "tensorflow" ]
def transform(vol, loc_shift, interp_method='linear', indexing='ij'): """ transform (interpolation N-D volumes (features) given shifts at each location in tensorflow Essentially interpolates volume vol at locations determined by loc_shift. This is a spatial transform in the sense that at location [x] ...
[ "def", "transform", "(", "vol", ",", "loc_shift", ",", "interp_method", "=", "'linear'", ",", "indexing", "=", "'ij'", ")", ":", "# parse shapes", "if", "isinstance", "(", "loc_shift", ".", "shape", ",", "(", "tf", ".", "Dimension", ",", "tf", ".", "Tens...
https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/cnn_sphere_register/ext/neuron/neuron/utils.py#L199-L236
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_checkparam.py
python
Validator.check_subclass
(arg_name, type_, template_types, prim_name, addition_error_info=None)
Checks whether some type is subclass of another type
Checks whether some type is subclass of another type
[ "Checks", "whether", "some", "type", "is", "subclass", "of", "another", "type" ]
def check_subclass(arg_name, type_, template_types, prim_name, addition_error_info=None): """Checks whether some type is subclass of another type""" if not isinstance(template_types, Iterable): template_types = (template_types,) hit = False for template_type in template_types...
[ "def", "check_subclass", "(", "arg_name", ",", "type_", ",", "template_types", ",", "prim_name", ",", "addition_error_info", "=", "None", ")", ":", "if", "not", "isinstance", "(", "template_types", ",", "Iterable", ")", ":", "template_types", "=", "(", "templa...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_checkparam.py#L476-L498
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/interfaces/sockets.py
python
DriverSocket.poll
(self)
Waits for driver status.
Waits for driver status.
[ "Waits", "for", "driver", "status", "." ]
def poll(self): """Waits for driver status.""" self.status = Status.Disconnected # sets disconnected as failsafe status, in case _getstatus fails and exceptions are ignored upstream self.status = self._getstatus()
[ "def", "poll", "(", "self", ")", ":", "self", ".", "status", "=", "Status", ".", "Disconnected", "# sets disconnected as failsafe status, in case _getstatus fails and exceptions are ignored upstream", "self", ".", "status", "=", "self", ".", "_getstatus", "(", ")" ]
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/interfaces/sockets.py#L142-L146
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/bijectors/kumaraswamy.py
python
Kumaraswamy.concentration0
(self)
return self._concentration0
The `b` in: `Y = g(X) = (1 - (1 - X)**(1 / b))**(1 / a)`.
The `b` in: `Y = g(X) = (1 - (1 - X)**(1 / b))**(1 / a)`.
[ "The", "b", "in", ":", "Y", "=", "g", "(", "X", ")", "=", "(", "1", "-", "(", "1", "-", "X", ")", "**", "(", "1", "/", "b", "))", "**", "(", "1", "/", "a", ")", "." ]
def concentration0(self): """The `b` in: `Y = g(X) = (1 - (1 - X)**(1 / b))**(1 / a)`.""" return self._concentration0
[ "def", "concentration0", "(", "self", ")", ":", "return", "self", ".", "_concentration0" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/bijectors/kumaraswamy.py#L99-L101
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/geodesy/wu_point.py
python
WuPoint.uuid
(self)
return self.way_pt.id.uuid
:returns: UUID_ of way point.
:returns: UUID_ of way point.
[ ":", "returns", ":", "UUID_", "of", "way", "point", "." ]
def uuid(self): """:returns: UUID_ of way point. """ return self.way_pt.id.uuid
[ "def", "uuid", "(", "self", ")", ":", "return", "self", ".", "way_pt", ".", "id", ".", "uuid" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geodesy/wu_point.py#L110-L112
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/distutils/command/install.py
python
install.dump_dirs
(self, msg)
Dumps the list of user options.
Dumps the list of user options.
[ "Dumps", "the", "list", "of", "user", "options", "." ]
def dump_dirs(self, msg): """Dumps the list of user options.""" if not DEBUG: return from distutils.fancy_getopt import longopt_xlate log.debug(msg + ":") for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": o...
[ "def", "dump_dirs", "(", "self", ",", "msg", ")", ":", "if", "not", "DEBUG", ":", "return", "from", "distutils", ".", "fancy_getopt", "import", "longopt_xlate", "log", ".", "debug", "(", "msg", "+", "\":\"", ")", "for", "opt", "in", "self", ".", "user_...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/command/install.py#L374-L391
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py
python
HTTPPasswordMgr.is_suburi
(self, base, test)
return False
Check if test is below base in a URI tree Both args must be URIs in reduced form.
Check if test is below base in a URI tree
[ "Check", "if", "test", "is", "below", "base", "in", "a", "URI", "tree" ]
def is_suburi(self, base, test): """Check if test is below base in a URI tree Both args must be URIs in reduced form. """ if base == test: return True if base[0] != test[0]: return False common = posixpath.commonprefix((base[1], test[1])) ...
[ "def", "is_suburi", "(", "self", ",", "base", ",", "test", ")", ":", "if", "base", "==", "test", ":", "return", "True", "if", "base", "[", "0", "]", "!=", "test", "[", "0", "]", ":", "return", "False", "common", "=", "posixpath", ".", "commonprefix...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py#L884-L896
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/generator/eclipse.py
python
GetAllDefines
(target_list, target_dicts, data, config_name, params, compiler_path)
return all_defines
Calculate the defines for a project. Returns: A dict that includes explict defines declared in gyp files along with all of the default defines that the compiler uses.
Calculate the defines for a project.
[ "Calculate", "the", "defines", "for", "a", "project", "." ]
def GetAllDefines(target_list, target_dicts, data, config_name, params, compiler_path): """Calculate the defines for a project. Returns: A dict that includes explict defines declared in gyp files along with all of the default defines that the compiler uses. """ # Get defines declared...
[ "def", "GetAllDefines", "(", "target_list", ",", "target_dicts", ",", "data", ",", "config_name", ",", "params", ",", "compiler_path", ")", ":", "# Get defines declared in the gyp files.", "all_defines", "=", "{", "}", "flavor", "=", "gyp", ".", "common", ".", "...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/eclipse.py#L193-L249
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
GetdragcursorBitmap
()
return wx.BitmapFromImage(GetdragcursorImage())
Returns the drag and drop cursor image as a :class:`Bitmap`.
Returns the drag and drop cursor image as a :class:`Bitmap`.
[ "Returns", "the", "drag", "and", "drop", "cursor", "image", "as", "a", ":", "class", ":", "Bitmap", "." ]
def GetdragcursorBitmap(): """ Returns the drag and drop cursor image as a :class:`Bitmap`. """ return wx.BitmapFromImage(GetdragcursorImage())
[ "def", "GetdragcursorBitmap", "(", ")", ":", "return", "wx", ".", "BitmapFromImage", "(", "GetdragcursorImage", "(", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L648-L651
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/subscribe.py
python
_subscribe_new
(tensor, side_effects, control_cache)
return out
Helper method that subscribes a single tensor to a list of side_effects. Args: tensor: `tf.Tensor` side_effects: List of side_effect functions see subscribe for details. control_cache: `_ControlOutputCache` helper to get control_outputs faster. Returns: The modified replacement to the passed in ten...
Helper method that subscribes a single tensor to a list of side_effects.
[ "Helper", "method", "that", "subscribes", "a", "single", "tensor", "to", "a", "list", "of", "side_effects", "." ]
def _subscribe_new(tensor, side_effects, control_cache): """Helper method that subscribes a single tensor to a list of side_effects. Args: tensor: `tf.Tensor` side_effects: List of side_effect functions see subscribe for details. control_cache: `_ControlOutputCache` helper to get control_outputs faster...
[ "def", "_subscribe_new", "(", "tensor", ",", "side_effects", ",", "control_cache", ")", ":", "update_input", "=", "[", "]", "for", "consumer_op", "in", "list", "(", "tensor", ".", "consumers", "(", ")", ")", ":", "# explicit copy", "update_input", ".", "appe...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/subscribe.py#L105-L146
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/telnetlib.py
python
Telnet.rawq_getchar
(self)
return c
Get next char from raw queue. Block if no data is immediately available. Raise EOFError when connection is closed.
Get next char from raw queue.
[ "Get", "next", "char", "from", "raw", "queue", "." ]
def rawq_getchar(self): """Get next char from raw queue. Block if no data is immediately available. Raise EOFError when connection is closed. """ if not self.rawq: self.fill_rawq() if self.eof: raise EOFError c = self.rawq[self.i...
[ "def", "rawq_getchar", "(", "self", ")", ":", "if", "not", "self", ".", "rawq", ":", "self", ".", "fill_rawq", "(", ")", "if", "self", ".", "eof", ":", "raise", "EOFError", "c", "=", "self", ".", "rawq", "[", "self", ".", "irawq", ":", "self", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/telnetlib.py#L494-L510
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/transports.py
python
SubprocessTransport.send_signal
(self, signal)
Send signal to subprocess. See also: docs.python.org/3/library/subprocess#subprocess.Popen.send_signal
Send signal to subprocess.
[ "Send", "signal", "to", "subprocess", "." ]
def send_signal(self, signal): """Send signal to subprocess. See also: docs.python.org/3/library/subprocess#subprocess.Popen.send_signal """ raise NotImplementedError
[ "def", "send_signal", "(", "self", ",", "signal", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/transports.py#L199-L205
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/_inner_ops.py
python
StackPop.__init__
(self, index=1, shape=(1,), dtype=mstype.float32)
StackPop
StackPop
[ "StackPop" ]
def __init__(self, index=1, shape=(1,), dtype=mstype.float32): """StackPop""" validator.check_value_type("index", index, [int], self.name) validator.check_value_type('shape type', shape, [list, tuple], self.name) validator.check_int(len(np.array(shape).shape), 1, Rel.EQ, "dim of shape",...
[ "def", "__init__", "(", "self", ",", "index", "=", "1", ",", "shape", "=", "(", "1", ",", ")", ",", "dtype", "=", "mstype", ".", "float32", ")", ":", "validator", ".", "check_value_type", "(", "\"index\"", ",", "index", ",", "[", "int", "]", ",", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/_inner_ops.py#L991-L1005
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Web/Python/paraview/web/protocols.py
python
ParaViewWebViewPort.updateCenterAxesVisibility
(self, viewId, showAxis)
return view.GetGlobalIDAsString()
RPC callback to show/hide CenterAxesVisibility.
RPC callback to show/hide CenterAxesVisibility.
[ "RPC", "callback", "to", "show", "/", "hide", "CenterAxesVisibility", "." ]
def updateCenterAxesVisibility(self, viewId, showAxis): """ RPC callback to show/hide CenterAxesVisibility. """ view = self.getView(viewId) view.CenterAxesVisibility = showAxis if 1 else 0 self.getApplication().InvalidateCache(view.SMProxy) self.getApplication()....
[ "def", "updateCenterAxesVisibility", "(", "self", ",", "viewId", ",", "showAxis", ")", ":", "view", "=", "self", ".", "getView", "(", "viewId", ")", "view", ".", "CenterAxesVisibility", "=", "showAxis", "if", "1", "else", "0", "self", ".", "getApplication", ...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Web/Python/paraview/web/protocols.py#L330-L340
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_trimex.py
python
Trimex.numericRadius
(self, dist)
Validate the entry fields in the user interface. This function is called by the toolbar or taskpanel interface when valid x, y, and z have been entered in the input fields.
Validate the entry fields in the user interface.
[ "Validate", "the", "entry", "fields", "in", "the", "user", "interface", "." ]
def numericRadius(self, dist): """Validate the entry fields in the user interface. This function is called by the toolbar or taskpanel interface when valid x, y, and z have been entered in the input fields. """ self.force = dist self.trimObject() self.finish()
[ "def", "numericRadius", "(", "self", ",", "dist", ")", ":", "self", ".", "force", "=", "dist", "self", ".", "trimObject", "(", ")", "self", ".", "finish", "(", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_trimex.py#L568-L576
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/visualization.py
python
VisualizationScene.rayCast
(self,x,y,filter=None,tolerance=0.01)
return data[0]
Performs ray casting with the scene Args: x (float): the screen x-coordinate of the mouse cursor y (float): the screen y-coordinate of the mouse cursor filter (callable, optional): if given, a function f(name,item) that returns True if the item should be cons...
Performs ray casting with the scene
[ "Performs", "ray", "casting", "with", "the", "scene" ]
def rayCast(self,x,y,filter=None,tolerance=0.01): """Performs ray casting with the scene Args: x (float): the screen x-coordinate of the mouse cursor y (float): the screen y-coordinate of the mouse cursor filter (callable, optional): if given, a function f(name,item)...
[ "def", "rayCast", "(", "self", ",", "x", ",", "y", ",", "filter", "=", "None", ",", "tolerance", "=", "0.01", ")", ":", "(", "s", ",", "d", ")", "=", "self", ".", "view", ".", "click_ray", "(", "x", ",", "y", ")", "data", "=", "[", "(", "No...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L4012-L4045
xiaolonw/caffe-video_triplet
c39ea1ad6e937ccf7deba4510b7e555165abf05f
scripts/cpp_lint.py
python
CheckLanguage
(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error)
Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum:...
Checks rules from the 'C++ language rules' section of cppguide.html.
[ "Checks", "rules", "from", "the", "C", "++", "language", "rules", "section", "of", "cppguide", ".", "html", "." ]
def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error): """Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. ...
[ "def", "CheckLanguage", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "file_extension", ",", "include_state", ",", "nesting_state", ",", "error", ")", ":", "# If the line is empty or consists of entirely a comment, no need to", "# check it.", "line", "=", "cle...
https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/scripts/cpp_lint.py#L3834-L4132
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/suitesconfig.py
python
MatrixSuiteConfig.get_all_yamls
(cls, target_dir)
return { short_name: load_yaml_file(path) for short_name, path in cls.__get_suite_files_in_dir(os.path.abspath( target_dir)).items() }
Get all YAML files in the given directory.
Get all YAML files in the given directory.
[ "Get", "all", "YAML", "files", "in", "the", "given", "directory", "." ]
def get_all_yamls(cls, target_dir): """Get all YAML files in the given directory.""" return { short_name: load_yaml_file(path) for short_name, path in cls.__get_suite_files_in_dir(os.path.abspath( target_dir)).items() }
[ "def", "get_all_yamls", "(", "cls", ",", "target_dir", ")", ":", "return", "{", "short_name", ":", "load_yaml_file", "(", "path", ")", "for", "short_name", ",", "path", "in", "cls", ".", "__get_suite_files_in_dir", "(", "os", ".", "path", ".", "abspath", "...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/suitesconfig.py#L198-L204
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/site_compare/drivers/win32/windowing.py
python
WaitForProcessExit
(proc, timeout=None)
return (win32event.WaitForSingleObject(proc, timeout) == win32event.WAIT_OBJECT_0)
Waits for a given process to terminate. Args: proc: handle to process timeout: timeout (in seconds). None = wait indefinitely Returns: True if process ended, False if timed out
Waits for a given process to terminate.
[ "Waits", "for", "a", "given", "process", "to", "terminate", "." ]
def WaitForProcessExit(proc, timeout=None): """Waits for a given process to terminate. Args: proc: handle to process timeout: timeout (in seconds). None = wait indefinitely Returns: True if process ended, False if timed out """ if timeout is None: timeout = win32event.INFINITE else: # ...
[ "def", "WaitForProcessExit", "(", "proc", ",", "timeout", "=", "None", ")", ":", "if", "timeout", "is", "None", ":", "timeout", "=", "win32event", ".", "INFINITE", "else", ":", "# convert sec to msec", "timeout", "*=", "1000", "return", "(", "win32event", "....
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/site_compare/drivers/win32/windowing.py#L198-L215
runtimejs/runtime
0a6e84c30823d35a4548d6634166784260ae7b74
deps/v8/tools/stats-viewer.py
python
StatsViewer.UpdateTime
(self)
Update the title of the window with the current time.
Update the title of the window with the current time.
[ "Update", "the", "title", "of", "the", "window", "with", "the", "current", "time", "." ]
def UpdateTime(self): """Update the title of the window with the current time.""" self.root.title("Stats Viewer [updated %s]" % time.strftime("%H:%M:%S"))
[ "def", "UpdateTime", "(", "self", ")", ":", "self", ".", "root", ".", "title", "(", "\"Stats Viewer [updated %s]\"", "%", "time", ".", "strftime", "(", "\"%H:%M:%S\"", ")", ")" ]
https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/stats-viewer.py#L164-L166
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/tlslite/TLSRecordLayer.py
python
TLSRecordLayer.write
(self, s)
Write some data to the TLS connection. This function will block until all the data has been sent. If an exception is raised, the connection will have been automatically closed. @type s: str @param s: The data to transmit to the other party. @raise socket.error: If a s...
Write some data to the TLS connection.
[ "Write", "some", "data", "to", "the", "TLS", "connection", "." ]
def write(self, s): """Write some data to the TLS connection. This function will block until all the data has been sent. If an exception is raised, the connection will have been automatically closed. @type s: str @param s: The data to transmit to the other party. ...
[ "def", "write", "(", "self", ",", "s", ")", ":", "for", "result", "in", "self", ".", "writeAsync", "(", "s", ")", ":", "pass" ]
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/tlslite/TLSRecordLayer.py#L225-L239
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/lib2to3/main.py
python
main
(fixer_pkg, args=None)
return int(bool(rt.errors))
Main program. Args: fixer_pkg: the name of a package where the fixers are located. args: optional; a list of command line arguments. If omitted, sys.argv[1:] is used. Returns a suggested exit status (0, 1, 2).
Main program.
[ "Main", "program", "." ]
def main(fixer_pkg, args=None): """Main program. Args: fixer_pkg: the name of a package where the fixers are located. args: optional; a list of command line arguments. If omitted, sys.argv[1:] is used. Returns a suggested exit status (0, 1, 2). """ # Set up option par...
[ "def", "main", "(", "fixer_pkg", ",", "args", "=", "None", ")", ":", "# Set up option parser", "parser", "=", "optparse", ".", "OptionParser", "(", "usage", "=", "\"2to3 [options] file|dir ...\"", ")", "parser", ".", "add_option", "(", "\"-d\"", ",", "\"--doctes...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lib2to3/main.py#L133-L268
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/math/so3.py
python
axis_angle
(R : Rotation)
return (vectorops.unit(m),vectorops.norm(m))
Returns the (axis,angle) pair representing R
Returns the (axis,angle) pair representing R
[ "Returns", "the", "(", "axis", "angle", ")", "pair", "representing", "R" ]
def axis_angle(R : Rotation) -> Tuple: """Returns the (axis,angle) pair representing R""" m = rotation_vector(R) return (vectorops.unit(m),vectorops.norm(m))
[ "def", "axis_angle", "(", "R", ":", "Rotation", ")", "->", "Tuple", ":", "m", "=", "rotation_vector", "(", "R", ")", "return", "(", "vectorops", ".", "unit", "(", "m", ")", ",", "vectorops", ".", "norm", "(", "m", ")", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/so3.py#L190-L193
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/dist.py
python
Distribution.handle_display_options
(self, option_order)
return any_display_options
If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false.
If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false.
[ "If", "there", "were", "any", "non", "-", "global", "display", "-", "only", "options", "(", "--", "help", "-", "commands", "or", "the", "metadata", "display", "options", ")", "on", "the", "command", "line", "display", "the", "requested", "info", "and", "...
def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. """ from distutils.core import gen_...
[ "def", "handle_display_options", "(", "self", ",", "option_order", ")", ":", "from", "distutils", ".", "core", "import", "gen_usage", "# User just wants a list of commands -- we'll print it out and stop", "# processing now (ie. if they ran \"setup --help-commands foo bar\",", "# we i...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/dist.py#L671-L709
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
MenuItem.IsEnabled
(*args, **kwargs)
return _core_.MenuItem_IsEnabled(*args, **kwargs)
IsEnabled(self) -> bool
IsEnabled(self) -> bool
[ "IsEnabled", "(", "self", ")", "-", ">", "bool" ]
def IsEnabled(*args, **kwargs): """IsEnabled(self) -> bool""" return _core_.MenuItem_IsEnabled(*args, **kwargs)
[ "def", "IsEnabled", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MenuItem_IsEnabled", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12513-L12515
lightvector/KataGo
20d34784703c5b4000643d3ccc43bb37d418f3b5
python/sgfmill/boards.py
python
Board.area_score
(self)
return scores['b'] - scores['w']
Calculate the area score of a position. Assumes all stones are alive. Returns black score minus white score. Doesn't take komi into account.
Calculate the area score of a position.
[ "Calculate", "the", "area", "score", "of", "a", "position", "." ]
def area_score(self): """Calculate the area score of a position. Assumes all stones are alive. Returns black score minus white score. Doesn't take komi into account. """ scores = {'b' : 0, 'w' : 0} handled = set() for (row, col) in self.board_points: ...
[ "def", "area_score", "(", "self", ")", ":", "scores", "=", "{", "'b'", ":", "0", ",", "'w'", ":", "0", "}", "handled", "=", "set", "(", ")", "for", "(", "row", ",", "col", ")", "in", "self", ".", "board_points", ":", "colour", "=", "self", ".",...
https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/boards.py#L238-L264
bundy-dns/bundy
3d41934996b82b0cd2fe22dd74d2abc1daba835d
src/lib/python/bundy/statistics/counters.py
python
_add_counter
(element, spec, identifier)
return bundy.cc.data.find(element, identifier)
Returns value of the identifier if the identifier is in the element. Otherwise, sets a default value from the spec and returns it. If the top-level type of the identifier is named_set and the second-level type is map, it sets a set of default values under the level and then returns the default value of ...
Returns value of the identifier if the identifier is in the element. Otherwise, sets a default value from the spec and returns it. If the top-level type of the identifier is named_set and the second-level type is map, it sets a set of default values under the level and then returns the default value of ...
[ "Returns", "value", "of", "the", "identifier", "if", "the", "identifier", "is", "in", "the", "element", ".", "Otherwise", "sets", "a", "default", "value", "from", "the", "spec", "and", "returns", "it", ".", "If", "the", "top", "-", "level", "type", "of",...
def _add_counter(element, spec, identifier): """Returns value of the identifier if the identifier is in the element. Otherwise, sets a default value from the spec and returns it. If the top-level type of the identifier is named_set and the second-level type is map, it sets a set of default values un...
[ "def", "_add_counter", "(", "element", ",", "spec", ",", "identifier", ")", ":", "try", ":", "return", "bundy", ".", "cc", ".", "data", ".", "find", "(", "element", ",", "identifier", ")", "except", "bundy", ".", "cc", ".", "data", ".", "DataNotFoundEr...
https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/statistics/counters.py#L54-L109
jeog/TDAmeritradeAPI
91c738afd7d57b54f6231170bd64c2550fafd34d
python/tdma_api/get.py
python
HistoricalPeriodGetter.get_period
(self)
return clib.get_val(self._abi('GetPeriod'), c_int, self._obj)
Returns number of periods being used.
Returns number of periods being used.
[ "Returns", "number", "of", "periods", "being", "used", "." ]
def get_period(self): """Returns number of periods being used.""" return clib.get_val(self._abi('GetPeriod'), c_int, self._obj)
[ "def", "get_period", "(", "self", ")", ":", "return", "clib", ".", "get_val", "(", "self", ".", "_abi", "(", "'GetPeriod'", ")", ",", "c_int", ",", "self", ".", "_obj", ")" ]
https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L520-L522
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/download_titan.py
python
download_url
(filename, url)
Downloads the titan release
Downloads the titan release
[ "Downloads", "the", "titan", "release" ]
def download_url(filename, url): """ Downloads the titan release """ urllib.request.urlretrieve(url, filename, reporthook=download_progress_callback)
[ "def", "download_url", "(", "filename", ",", "url", ")", ":", "urllib", ".", "request", ".", "urlretrieve", "(", "url", ",", "filename", ",", "reporthook", "=", "download_progress_callback", ")" ]
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/download_titan.py#L130-L134
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/redshift/layer1.py
python
RedshiftConnection.describe_orderable_cluster_options
(self, cluster_version=None, node_type=None, max_records=None, marker=None)
return self._make_request( action='DescribeOrderableClusterOptions', verb='POST', path='/', params=params)
Returns a list of orderable cluster options. Before you create a new cluster you can use this operation to find what options are available, such as the EC2 Availability Zones (AZ) in the specific AWS region that you can specify, and the node types you can request. The node types differ b...
Returns a list of orderable cluster options. Before you create a new cluster you can use this operation to find what options are available, such as the EC2 Availability Zones (AZ) in the specific AWS region that you can specify, and the node types you can request. The node types differ b...
[ "Returns", "a", "list", "of", "orderable", "cluster", "options", ".", "Before", "you", "create", "a", "new", "cluster", "you", "can", "use", "this", "operation", "to", "find", "what", "options", "are", "available", "such", "as", "the", "EC2", "Availability",...
def describe_orderable_cluster_options(self, cluster_version=None, node_type=None, max_records=None, marker=None): """ Returns a list of orderable cluster options. Before you create a new cluster you can use th...
[ "def", "describe_orderable_cluster_options", "(", "self", ",", "cluster_version", "=", "None", ",", "node_type", "=", "None", ",", "max_records", "=", "None", ",", "marker", "=", "None", ")", ":", "params", "=", "{", "}", "if", "cluster_version", "is", "not"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/redshift/layer1.py#L1944-L2004
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
DateTime.FormatTime
(*args, **kwargs)
return _misc_.DateTime_FormatTime(*args, **kwargs)
FormatTime(self) -> String
FormatTime(self) -> String
[ "FormatTime", "(", "self", ")", "-", ">", "String" ]
def FormatTime(*args, **kwargs): """FormatTime(self) -> String""" return _misc_.DateTime_FormatTime(*args, **kwargs)
[ "def", "FormatTime", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_FormatTime", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4170-L4172
scummvm/scummvm
9c039d027e7ffb9d83ae2e274147e2daf8d57ce2
devtools/dumper-companion.py
python
generate_punyencoded_path
(destination_dir: Path, hpath: Tuple[str])
return upath
Convert a filepath to a punyencoded one
Convert a filepath to a punyencoded one
[ "Convert", "a", "filepath", "to", "a", "punyencoded", "one" ]
def generate_punyencoded_path(destination_dir: Path, hpath: Tuple[str]) -> Path: """Convert a filepath to a punyencoded one""" upath = destination_dir for el in hpath: upath /= punyencode(el) return upath
[ "def", "generate_punyencoded_path", "(", "destination_dir", ":", "Path", ",", "hpath", ":", "Tuple", "[", "str", "]", ")", "->", "Path", ":", "upath", "=", "destination_dir", "for", "el", "in", "hpath", ":", "upath", "/=", "punyencode", "(", "el", ")", "...
https://github.com/scummvm/scummvm/blob/9c039d027e7ffb9d83ae2e274147e2daf8d57ce2/devtools/dumper-companion.py#L266-L272
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
GridSizer.GetRows
(*args, **kwargs)
return _core_.GridSizer_GetRows(*args, **kwargs)
GetRows(self) -> int Returns the number of rows in the sizer.
GetRows(self) -> int
[ "GetRows", "(", "self", ")", "-", ">", "int" ]
def GetRows(*args, **kwargs): """ GetRows(self) -> int Returns the number of rows in the sizer. """ return _core_.GridSizer_GetRows(*args, **kwargs)
[ "def", "GetRows", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "GridSizer_GetRows", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L15245-L15251
scylladb/dpdk
cc7e6ed22c0fc08e3ff37b3e68a61979d8214547
tools/dpdk_nic_bind.py
python
dev_id_from_dev_name
(dev_name)
Take a device "name" - a string passed in by user to identify a NIC device, and determine the device id - i.e. the domain:bus:slot.func - for it, which can then be used to index into the devices array
Take a device "name" - a string passed in by user to identify a NIC device, and determine the device id - i.e. the domain:bus:slot.func - for it, which can then be used to index into the devices array
[ "Take", "a", "device", "name", "-", "a", "string", "passed", "in", "by", "user", "to", "identify", "a", "NIC", "device", "and", "determine", "the", "device", "id", "-", "i", ".", "e", ".", "the", "domain", ":", "bus", ":", "slot", ".", "func", "-",...
def dev_id_from_dev_name(dev_name): '''Take a device "name" - a string passed in by user to identify a NIC device, and determine the device id - i.e. the domain:bus:slot.func - for it, which can then be used to index into the devices array''' dev = None # check if it's already a suitable index i...
[ "def", "dev_id_from_dev_name", "(", "dev_name", ")", ":", "dev", "=", "None", "# check if it's already a suitable index", "if", "dev_name", "in", "devices", ":", "return", "dev_name", "# check if it's an index just missing the domain part", "elif", "\"0000:\"", "+", "dev_na...
https://github.com/scylladb/dpdk/blob/cc7e6ed22c0fc08e3ff37b3e68a61979d8214547/tools/dpdk_nic_bind.py#L279-L298
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/glprogram.py
python
GLProgram.keyboardfunc
(self,c,x,y)
return False
Called on keypress down. May be overridden. c is either the ASCII/unicode character of the key pressed or a string describing the character (up,down,left,right, home,end,delete,enter,f1,...,f12)
Called on keypress down. May be overridden. c is either the ASCII/unicode character of the key pressed or a string describing the character (up,down,left,right, home,end,delete,enter,f1,...,f12)
[ "Called", "on", "keypress", "down", ".", "May", "be", "overridden", ".", "c", "is", "either", "the", "ASCII", "/", "unicode", "character", "of", "the", "key", "pressed", "or", "a", "string", "describing", "the", "character", "(", "up", "down", "left", "r...
def keyboardfunc(self,c,x,y): """Called on keypress down. May be overridden. c is either the ASCII/unicode character of the key pressed or a string describing the character (up,down,left,right, home,end,delete,enter,f1,...,f12)""" if c == '?': self.print_help() r...
[ "def", "keyboardfunc", "(", "self", ",", "c", ",", "x", ",", "y", ")", ":", "if", "c", "==", "'?'", ":", "self", ".", "print_help", "(", ")", "return", "True", "if", "'alt'", "in", "self", ".", "modifiers", "(", ")", ":", "c", "=", "'Alt+'", "+...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/glprogram.py#L105-L121
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/__init__.py
python
_find_all_simple
(path)
return filter(os.path.isfile, results)
Find all files under 'path'
Find all files under 'path'
[ "Find", "all", "files", "under", "path" ]
def _find_all_simple(path): """ Find all files under 'path' """ results = ( os.path.join(base, file) for base, dirs, files in os.walk(path, followlinks=True) for file in files ) return filter(os.path.isfile, results)
[ "def", "_find_all_simple", "(", "path", ")", ":", "results", "=", "(", "os", ".", "path", ".", "join", "(", "base", ",", "file", ")", "for", "base", ",", "dirs", ",", "files", "in", "os", ".", "walk", "(", "path", ",", "followlinks", "=", "True", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/__init__.py#L220-L229
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_grad.py
python
_LogGrad
(op, grad)
Returns grad * (1/x).
Returns grad * (1/x).
[ "Returns", "grad", "*", "(", "1", "/", "x", ")", "." ]
def _LogGrad(op, grad): """Returns grad * (1/x).""" x = op.inputs[0] with ops.control_dependencies([grad]): x = math_ops.conj(x) return grad * math_ops.reciprocal(x)
[ "def", "_LogGrad", "(", "op", ",", "grad", ")", ":", "x", "=", "op", ".", "inputs", "[", "0", "]", "with", "ops", ".", "control_dependencies", "(", "[", "grad", "]", ")", ":", "x", "=", "math_ops", ".", "conj", "(", "x", ")", "return", "grad", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L692-L697
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py
python
ProcessTableWidget.get_merged_ws_name
(self, i_row)
return self._workspaceCacheDict[i_row]
Get merged workspace name :param i_row: :return:
Get merged workspace name :param i_row: :return:
[ "Get", "merged", "workspace", "name", ":", "param", "i_row", ":", ":", "return", ":" ]
def get_merged_ws_name(self, i_row): """ Get merged workspace name :param i_row: :return: """ # return self.get_cell_value(i_row, self._colIndexWorkspace) return self._workspaceCacheDict[i_row]
[ "def", "get_merged_ws_name", "(", "self", ",", "i_row", ")", ":", "# return self.get_cell_value(i_row, self._colIndexWorkspace)", "return", "self", ".", "_workspaceCacheDict", "[", "i_row", "]" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py#L846-L853
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/psro_v2/strategy_selectors.py
python
exhaustive_non_marginalized
(solver)
return solver.get_policies()
Returns every player's policies. Args: solver: A GenPSROSolver instance.
Returns every player's policies.
[ "Returns", "every", "player", "s", "policies", "." ]
def exhaustive_non_marginalized(solver): """Returns every player's policies. Args: solver: A GenPSROSolver instance. """ return solver.get_policies()
[ "def", "exhaustive_non_marginalized", "(", "solver", ")", ":", "return", "solver", ".", "get_policies", "(", ")" ]
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/psro_v2/strategy_selectors.py#L348-L354
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Adaptors/Pagosa/CoProcess.py
python
RequestDataDescription
(datadescription)
Callback to populate the request for current timestep
Callback to populate the request for current timestep
[ "Callback", "to", "populate", "the", "request", "for", "current", "timestep" ]
def RequestDataDescription(datadescription): "Callback to populate the request for current timestep" global coprocessor if datadescription.GetForceOutput() == True: # We are just going to request all fields and meshes from the simulation # code/adaptor. for i in range(datadescription.GetNu...
[ "def", "RequestDataDescription", "(", "datadescription", ")", ":", "global", "coprocessor", "if", "datadescription", ".", "GetForceOutput", "(", ")", "==", "True", ":", "# We are just going to request all fields and meshes from the simulation", "# code/adaptor.", "for", "i", ...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Adaptors/Pagosa/CoProcess.py#L55-L68
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
gtsam/3rdparty/GeographicLib/python/geographiclib/geomath.py
python
Math.polyval
(N, p, s, x)
return y
Evaluate a polynomial.
Evaluate a polynomial.
[ "Evaluate", "a", "polynomial", "." ]
def polyval(N, p, s, x): """Evaluate a polynomial.""" y = float(0 if N < 0 else p[s]) # make sure the returned value is a float while N > 0: N -= 1; s += 1 y = y * x + p[s] return y
[ "def", "polyval", "(", "N", ",", "p", ",", "s", ",", "x", ")", ":", "y", "=", "float", "(", "0", "if", "N", "<", "0", "else", "p", "[", "s", "]", ")", "# make sure the returned value is a float", "while", "N", ">", "0", ":", "N", "-=", "1", "s"...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/gtsam/3rdparty/GeographicLib/python/geographiclib/geomath.py#L106-L112
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/libs/mpl/preprocessed/fix_boost_mpl_preprocess.py
python
fix_input_files_for_variadic_seq
(headerDir, sourceDir, timestamp)
Fixes files used as input when pre-processing MPL-containers in their variadic form.
Fixes files used as input when pre-processing MPL-containers in their variadic form.
[ "Fixes", "files", "used", "as", "input", "when", "pre", "-", "processing", "MPL", "-", "containers", "in", "their", "variadic", "form", "." ]
def fix_input_files_for_variadic_seq(headerDir, sourceDir, timestamp): """Fixes files used as input when pre-processing MPL-containers in their variadic form.""" # Fix files in include/source-directories. files = glob.glob( os.path.join( headerDir, "*.hpp" ) ) files += glob.glob( os.path.join( headerDi...
[ "def", "fix_input_files_for_variadic_seq", "(", "headerDir", ",", "sourceDir", ",", "timestamp", ")", ":", "# Fix files in include/source-directories.", "files", "=", "glob", ".", "glob", "(", "os", ".", "path", ".", "join", "(", "headerDir", ",", "\"*.hpp\"", ")"...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/libs/mpl/preprocessed/fix_boost_mpl_preprocess.py#L104-L111
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/poolmanager.py
python
PoolManager.urlopen
(self, method, url, redirect=True, **kw)
return self.urlopen(method, redirect_location, **kw)
Same as :meth:`urllib3.connectionpool.HTTPConnectionPool.urlopen` with custom cross-host redirect logic and only sends the request-uri portion of the ``url``. The given ``url`` parameter must be absolute, such that an appropriate :class:`urllib3.connectionpool.ConnectionPool` can be cho...
Same as :meth:`urllib3.connectionpool.HTTPConnectionPool.urlopen` with custom cross-host redirect logic and only sends the request-uri portion of the ``url``.
[ "Same", "as", ":", "meth", ":", "urllib3", ".", "connectionpool", ".", "HTTPConnectionPool", ".", "urlopen", "with", "custom", "cross", "-", "host", "redirect", "logic", "and", "only", "sends", "the", "request", "-", "uri", "portion", "of", "the", "url", "...
def urlopen(self, method, url, redirect=True, **kw): """ Same as :meth:`urllib3.connectionpool.HTTPConnectionPool.urlopen` with custom cross-host redirect logic and only sends the request-uri portion of the ``url``. The given ``url`` parameter must be absolute, such that an appr...
[ "def", "urlopen", "(", "self", ",", "method", ",", "url", ",", "redirect", "=", "True", ",", "*", "*", "kw", ")", ":", "u", "=", "parse_url", "(", "url", ")", "conn", "=", "self", ".", "connection_from_host", "(", "u", ".", "host", ",", "port", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/poolmanager.py#L309-L369
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/views/rest/bandit_bla.py
python
BanditBLAView.pretty_view
(self)
return self.pretty_response()
A pretty, browser interactive view for the interface. Includes form request and response. .. http:get:: /bandit/bla/pretty
A pretty, browser interactive view for the interface. Includes form request and response.
[ "A", "pretty", "browser", "interactive", "view", "for", "the", "interface", ".", "Includes", "form", "request", "and", "response", "." ]
def pretty_view(self): """A pretty, browser interactive view for the interface. Includes form request and response. .. http:get:: /bandit/bla/pretty """ return self.pretty_response()
[ "def", "pretty_view", "(", "self", ")", ":", "return", "self", ".", "pretty_response", "(", ")" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/views/rest/bandit_bla.py#L38-L44
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/optimize/_lsq/common.py
python
CL_scaling_vector
(x, g, lb, ub)
return v, dv
Compute Coleman-Li scaling vector and its derivatives. Components of a vector v are defined as follows: :: | ub[i] - x[i], if g[i] < 0 and ub[i] < np.inf v[i] = | x[i] - lb[i], if g[i] > 0 and lb[i] > -np.inf | 1, otherwise According to this definiti...
Compute Coleman-Li scaling vector and its derivatives. Components of a vector v are defined as follows: :: | ub[i] - x[i], if g[i] < 0 and ub[i] < np.inf v[i] = | x[i] - lb[i], if g[i] > 0 and lb[i] > -np.inf | 1, otherwise According to this definiti...
[ "Compute", "Coleman", "-", "Li", "scaling", "vector", "and", "its", "derivatives", ".", "Components", "of", "a", "vector", "v", "are", "defined", "as", "follows", ":", "::", "|", "ub", "[", "i", "]", "-", "x", "[", "i", "]", "if", "g", "[", "i", ...
def CL_scaling_vector(x, g, lb, ub): """Compute Coleman-Li scaling vector and its derivatives. Components of a vector v are defined as follows: :: | ub[i] - x[i], if g[i] < 0 and ub[i] < np.inf v[i] = | x[i] - lb[i], if g[i] > 0 and lb[i] > -np.inf | 1, o...
[ "def", "CL_scaling_vector", "(", "x", ",", "g", ",", "lb", ",", "ub", ")", ":", "v", "=", "np", ".", "ones_like", "(", "x", ")", "dv", "=", "np", ".", "zeros_like", "(", "x", ")", "mask", "=", "(", "g", "<", "0", ")", "&", "np", ".", "isfin...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/_lsq/common.py#L468-L509
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/egg_info.py
python
FileList.exclude
(self, pattern)
return self._remove_files(match.match)
Exclude files that match 'pattern'.
Exclude files that match 'pattern'.
[ "Exclude", "files", "that", "match", "pattern", "." ]
def exclude(self, pattern): """Exclude files that match 'pattern'.""" match = translate_pattern(pattern) return self._remove_files(match.match)
[ "def", "exclude", "(", "self", ",", "pattern", ")", ":", "match", "=", "translate_pattern", "(", "pattern", ")", "return", "self", ".", "_remove_files", "(", "match", ".", "match", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/egg_info.py#L418-L421
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/rosdistro/dependency_walker.py
python
DependencyWalker.get_recursive_depends
(self, pkg_name, depend_types, ros_packages_only=False, ignore_pkgs=None, limit_depth=None)
return depends
Return a set of package names which the package (transitively) depends on.
Return a set of package names which the package (transitively) depends on.
[ "Return", "a", "set", "of", "package", "names", "which", "the", "package", "(", "transitively", ")", "depends", "on", "." ]
def get_recursive_depends(self, pkg_name, depend_types, ros_packages_only=False, ignore_pkgs=None, limit_depth=None): '''Return a set of package names which the package (transitively) depends on.''' ignore_pkgs = set(ignore_pkgs or []) depends = set([]) # mapping from the scheduled pkg n...
[ "def", "get_recursive_depends", "(", "self", ",", "pkg_name", ",", "depend_types", ",", "ros_packages_only", "=", "False", ",", "ignore_pkgs", "=", "None", ",", "limit_depth", "=", "None", ")", ":", "ignore_pkgs", "=", "set", "(", "ignore_pkgs", "or", "[", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdistro/dependency_walker.py#L63-L84
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/bayesflow/python/ops/csiszar_divergence_impl.py
python
triangular
(logu, name=None)
The Triangular Csiszar-function in log-space. A Csiszar-function is a member of, ```none F = { f:R_+ to R : f convex }. ``` The Triangular Csiszar-function is: ```none f(u) = (u - 1)**2 / (1 + u) ``` This Csiszar-function induces a symmetric f-Divergence, i.e., `D_f[p, q] = D_f[q, p]`. Warni...
The Triangular Csiszar-function in log-space.
[ "The", "Triangular", "Csiszar", "-", "function", "in", "log", "-", "space", "." ]
def triangular(logu, name=None): """The Triangular Csiszar-function in log-space. A Csiszar-function is a member of, ```none F = { f:R_+ to R : f convex }. ``` The Triangular Csiszar-function is: ```none f(u) = (u - 1)**2 / (1 + u) ``` This Csiszar-function induces a symmetric f-Divergence, i.e...
[ "def", "triangular", "(", "logu", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"triangular\"", ",", "[", "logu", "]", ")", ":", "logu", "=", "ops", ".", "convert_to_tensor", "(", "logu", ",", "name", "=", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/bayesflow/python/ops/csiszar_divergence_impl.py#L426-L458
scylladb/seastar
0cdd2329beb1cc4c0af8828598c26114397ffa9c
scripts/dpdk_nic_bind.py
python
get_nic_details
()
This function populates the "devices" dictionary. The keys used are the pci addresses (domain:bus:slot.func). The values are themselves dictionaries - one for each NIC.
This function populates the "devices" dictionary. The keys used are the pci addresses (domain:bus:slot.func). The values are themselves dictionaries - one for each NIC.
[ "This", "function", "populates", "the", "devices", "dictionary", ".", "The", "keys", "used", "are", "the", "pci", "addresses", "(", "domain", ":", "bus", ":", "slot", ".", "func", ")", ".", "The", "values", "are", "themselves", "dictionaries", "-", "one", ...
def get_nic_details(): '''This function populates the "devices" dictionary. The keys used are the pci addresses (domain:bus:slot.func). The values are themselves dictionaries - one for each NIC.''' global devices global dpdk_drivers # clear any old data devices = {} # first loop through...
[ "def", "get_nic_details", "(", ")", ":", "global", "devices", "global", "dpdk_drivers", "# clear any old data", "devices", "=", "{", "}", "# first loop through and read details for all devices", "# request machine readable format, with numeric IDs", "dev", "=", "{", "}", "dev...
https://github.com/scylladb/seastar/blob/0cdd2329beb1cc4c0af8828598c26114397ffa9c/scripts/dpdk_nic_bind.py#L216-L277
google/angle
d5df233189cad620b8e0de653fe5e6cb778e209d
scripts/roll_chromium_deps.py
python
FindSrcDirPath
()
return os.path.dirname(os.path.abspath(os.path.join(__file__, '..')))
Returns the abs path to the root dir of the project.
Returns the abs path to the root dir of the project.
[ "Returns", "the", "abs", "path", "to", "the", "root", "dir", "of", "the", "project", "." ]
def FindSrcDirPath(): """Returns the abs path to the root dir of the project.""" # Special cased for ANGLE. return os.path.dirname(os.path.abspath(os.path.join(__file__, '..')))
[ "def", "FindSrcDirPath", "(", ")", ":", "# Special cased for ANGLE.", "return", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "join", "(", "__file__", ",", "'..'", ")", ")", ")" ]
https://github.com/google/angle/blob/d5df233189cad620b8e0de653fe5e6cb778e209d/scripts/roll_chromium_deps.py#L27-L30
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/set_functions.py
python
unique_values
(x)
return _mx_nd_np.unique(x, False, False, False)
Returns the unique elements of an input array `x`. Notes ----- `unique_values` is a standard API in https://data-apis.org/array-api/latest/API_specification/set_functions.html#unique-values-x instead of an official NumPy operator. Parameters ---------- x : ndarray Input array. ...
Returns the unique elements of an input array `x`.
[ "Returns", "the", "unique", "elements", "of", "an", "input", "array", "x", "." ]
def unique_values(x): """ Returns the unique elements of an input array `x`. Notes ----- `unique_values` is a standard API in https://data-apis.org/array-api/latest/API_specification/set_functions.html#unique-values-x instead of an official NumPy operator. Parameters ---------- ...
[ "def", "unique_values", "(", "x", ")", ":", "return", "_mx_nd_np", ".", "unique", "(", "x", ",", "False", ",", "False", ",", "False", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/set_functions.py#L93-L113
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/imaplib.py
python
IMAP4.lsub
(self, directory='""', pattern='*')
return self._untagged_response(typ, dat, name)
List 'subscribed' mailbox names in directory matching pattern. (typ, [data, ...]) = <instance>.lsub(directory='""', pattern='*') 'data' are tuples of message part envelope and data.
List 'subscribed' mailbox names in directory matching pattern.
[ "List", "subscribed", "mailbox", "names", "in", "directory", "matching", "pattern", "." ]
def lsub(self, directory='""', pattern='*'): """List 'subscribed' mailbox names in directory matching pattern. (typ, [data, ...]) = <instance>.lsub(directory='""', pattern='*') 'data' are tuples of message part envelope and data. """ name = 'LSUB' typ, dat = self._simpl...
[ "def", "lsub", "(", "self", ",", "directory", "=", "'\"\"'", ",", "pattern", "=", "'*'", ")", ":", "name", "=", "'LSUB'", "typ", ",", "dat", "=", "self", ".", "_simple_command", "(", "name", ",", "directory", ",", "pattern", ")", "return", "self", "....
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/imaplib.py#L543-L552
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/logging/jasper_logger.py
python
JasperHandler.close
(self)
Close the logging handler.
Close the logging handler.
[ "Close", "the", "logging", "handler", "." ]
def close(self): """Close the logging handler.""" logging.Handler.close(self) if not self.closed: self.closed = True args = self.pb.LoggingCacheArgs(id=self.name) try: outcome = self.stub.LoggingCacheCloseAndRemove(args) if no...
[ "def", "close", "(", "self", ")", ":", "logging", ".", "Handler", ".", "close", "(", "self", ")", "if", "not", "self", ".", "closed", ":", "self", ".", "closed", "=", "True", "args", "=", "self", ".", "pb", ".", "LoggingCacheArgs", "(", "id", "=", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/logging/jasper_logger.py#L104-L118
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/uuid.py
python
_arp_getnode
()
return None
Get the hardware address on Unix by running arp.
Get the hardware address on Unix by running arp.
[ "Get", "the", "hardware", "address", "on", "Unix", "by", "running", "arp", "." ]
def _arp_getnode(): """Get the hardware address on Unix by running arp.""" import os, socket try: ip_addr = socket.gethostbyname(socket.gethostname()) except OSError: return None # Try getting the MAC addr from arp based on our IP address (Solaris). mac = _find_mac_near_keyword(...
[ "def", "_arp_getnode", "(", ")", ":", "import", "os", ",", "socket", "try", ":", "ip_addr", "=", "socket", ".", "gethostbyname", "(", "socket", ".", "gethostname", "(", ")", ")", "except", "OSError", ":", "return", "None", "# Try getting the MAC addr from arp ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/uuid.py#L523-L547
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py
python
new_compiler
(plat=None, compiler=None, verbose=0, dry_run=0, force=0)
return klass(None, dry_run, force)
Generate an instance of some CCompiler subclass for the supplied platform/compiler combination. 'plat' defaults to 'os.name' (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler for that platform. Currently only 'posix' and 'nt' are supported, and the default compilers are "traditional...
Generate an instance of some CCompiler subclass for the supplied platform/compiler combination. 'plat' defaults to 'os.name' (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler for that platform. Currently only 'posix' and 'nt' are supported, and the default compilers are "traditional...
[ "Generate", "an", "instance", "of", "some", "CCompiler", "subclass", "for", "the", "supplied", "platform", "/", "compiler", "combination", ".", "plat", "defaults", "to", "os", ".", "name", "(", "eg", ".", "posix", "nt", ")", "and", "compiler", "defaults", ...
def new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0): """Generate an instance of some CCompiler subclass for the supplied platform/compiler combination. 'plat' defaults to 'os.name' (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler for that platform. Currently o...
[ "def", "new_compiler", "(", "plat", "=", "None", ",", "compiler", "=", "None", ",", "verbose", "=", "0", ",", "dry_run", "=", "0", ",", "force", "=", "0", ")", ":", "if", "plat", "is", "None", ":", "plat", "=", "os", ".", "name", "try", ":", "i...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py#L964-L1006
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
caffe-fast-rcnn/python/caffe/detector.py
python
Detector.crop
(self, im, window)
return crop
Crop a window from the image for detection. Include surrounding context according to the `context_pad` configuration. Parameters ---------- im: H x W x K image ndarray to crop. window: bounding box coordinates as ymin, xmin, ymax, xmax. Returns ------- c...
Crop a window from the image for detection. Include surrounding context according to the `context_pad` configuration.
[ "Crop", "a", "window", "from", "the", "image", "for", "detection", ".", "Include", "surrounding", "context", "according", "to", "the", "context_pad", "configuration", "." ]
def crop(self, im, window): """ Crop a window from the image for detection. Include surrounding context according to the `context_pad` configuration. Parameters ---------- im: H x W x K image ndarray to crop. window: bounding box coordinates as ymin, xmin, ymax, ...
[ "def", "crop", "(", "self", ",", "im", ",", "window", ")", ":", "# Crop window from the image.", "crop", "=", "im", "[", "window", "[", "0", "]", ":", "window", "[", "2", "]", ",", "window", "[", "1", "]", ":", "window", "[", "3", "]", "]", "if",...
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/python/caffe/detector.py#L125-L179
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/code.py
python
InteractiveConsole.push
(self, line)
return more
Push a line to the interpreter. The line should not have a trailing newline; it may have internal newlines. The line is appended to a buffer and the interpreter's runsource() method is called with the concatenated contents of the buffer as source. If this indicates that the co...
Push a line to the interpreter.
[ "Push", "a", "line", "to", "the", "interpreter", "." ]
def push(self, line): """Push a line to the interpreter. The line should not have a trailing newline; it may have internal newlines. The line is appended to a buffer and the interpreter's runsource() method is called with the concatenated contents of the buffer as source. If t...
[ "def", "push", "(", "self", ",", "line", ")", ":", "self", ".", "buffer", ".", "append", "(", "line", ")", "source", "=", "\"\\n\"", ".", "join", "(", "self", ".", "buffer", ")", "more", "=", "self", ".", "runsource", "(", "source", ",", "self", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/code.py#L249-L268
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/distributions/bijector_impl.py
python
_Mapping._merge_dicts
(self, old=None, new=None)
return old
Helper to merge two dictionaries.
Helper to merge two dictionaries.
[ "Helper", "to", "merge", "two", "dictionaries", "." ]
def _merge_dicts(self, old=None, new=None): """Helper to merge two dictionaries.""" old = {} if old is None else old new = {} if new is None else new for k, v in new.items(): val = old.get(k, None) if val is not None and val is not v: raise ValueError("Found different value for exist...
[ "def", "_merge_dicts", "(", "self", ",", "old", "=", "None", ",", "new", "=", "None", ")", ":", "old", "=", "{", "}", "if", "old", "is", "None", "else", "old", "new", "=", "{", "}", "if", "new", "is", "None", "else", "new", "for", "k", ",", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/distributions/bijector_impl.py#L103-L114