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
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/symbol.py
python
Symbol.softmin
(self, *args, **kwargs)
return op.softmin(self, *args, **kwargs)
Convenience fluent method for :py:func:`softmin`. The arguments are the same as for :py:func:`softmin`, with this array as data.
Convenience fluent method for :py:func:`softmin`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "softmin", "." ]
def softmin(self, *args, **kwargs): """Convenience fluent method for :py:func:`softmin`. The arguments are the same as for :py:func:`softmin`, with this array as data. """ return op.softmin(self, *args, **kwargs)
[ "def", "softmin", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "softmin", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/symbol.py#L2621-L2627
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/tix.py
python
Grid.delete_row
(self, from_, to=None)
Delete rows between from_ and to inclusive. If to is not provided, delete only row at from_
Delete rows between from_ and to inclusive. If to is not provided, delete only row at from_
[ "Delete", "rows", "between", "from_", "and", "to", "inclusive", ".", "If", "to", "is", "not", "provided", "delete", "only", "row", "at", "from_" ]
def delete_row(self, from_, to=None): """Delete rows between from_ and to inclusive. If to is not provided, delete only row at from_""" if to is None: self.tk.call(self, 'delete', 'row', from_) else: self.tk.call(self, 'delete', 'row', from_, to)
[ "def", "delete_row", "(", "self", ",", "from_", ",", "to", "=", "None", ")", ":", "if", "to", "is", "None", ":", "self", ".", "tk", ".", "call", "(", "self", ",", "'delete'", ",", "'row'", ",", "from_", ")", "else", ":", "self", ".", "tk", ".",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/tix.py#L1809-L1815
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/sources_list.py
python
CachedDataSource.origin
(self)
return self.source.origin
:returns: data source origin, if set, or ``None``
:returns: data source origin, if set, or ``None``
[ ":", "returns", ":", "data", "source", "origin", "if", "set", "or", "None" ]
def origin(self): """ :returns: data source origin, if set, or ``None`` """ return self.source.origin
[ "def", "origin", "(", "self", ")", ":", "return", "self", ".", "source", ".", "origin" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/sources_list.py#L249-L253
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
PreChoicebook
(*args, **kwargs)
return val
PreChoicebook() -> Choicebook
PreChoicebook() -> Choicebook
[ "PreChoicebook", "()", "-", ">", "Choicebook" ]
def PreChoicebook(*args, **kwargs): """PreChoicebook() -> Choicebook""" val = _controls_.new_PreChoicebook(*args, **kwargs) return val
[ "def", "PreChoicebook", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PreChoicebook", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3277-L3280
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/wsgiref/util.py
python
is_hop_by_hop
(header_name)
return _hoppish(header_name.lower())
Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header
Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header
[ "Return", "true", "if", "header_name", "is", "an", "HTTP", "/", "1", ".", "1", "Hop", "-", "by", "-", "Hop", "header" ]
def is_hop_by_hop(header_name): """Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header""" return _hoppish(header_name.lower())
[ "def", "is_hop_by_hop", "(", "header_name", ")", ":", "return", "_hoppish", "(", "header_name", ".", "lower", "(", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/wsgiref/util.py#L163-L165
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/python_message.py
python
_AddSerializeToStringMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddSerializeToStringMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def SerializeToString(self): # Check if the message has all of its required fields set. errors = [] if not self.IsInitialized(): raise message_mod.EncodeError( 'Message %s is missing require...
[ "def", "_AddSerializeToStringMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "SerializeToString", "(", "self", ")", ":", "# Check if the message has all of its required fields set.", "errors", "=", "[", "]", "if", "not", "self", ".", "IsInitialized", ...
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/python_message.py#L758-L769
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/mem/slicc/parser.py
python
SLICC.p_pairsx__many
(self, p)
pairsx : pair ',' pairsx
pairsx : pair ',' pairsx
[ "pairsx", ":", "pair", "pairsx" ]
def p_pairsx__many(self, p): "pairsx : pair ',' pairsx" p[0] = p[3] p[0].addPair(p[1])
[ "def", "p_pairsx__many", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "3", "]", "p", "[", "0", "]", ".", "addPair", "(", "p", "[", "1", "]", ")" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/slicc/parser.py#L547-L550
f4exb/sdrangel
fce235b2bc59b932f93d2cb8784055d51b3b8424
scriptsapi/ptt_active.py
python
getInputOptions
()
return options.addr, options.port, options.sdrangel_port, options.delay, options.freq_sync, other_dict, options.limerfe_dev
This is the argument line parser
This is the argument line parser
[ "This", "is", "the", "argument", "line", "parser" ]
def getInputOptions(): """ This is the argument line parser """ # ---------------------------------------------------------------------- parser = argparse.ArgumentParser(description="Manages PTT from an SDRangel instance automatically") parser.add_argument("-A", "--address", dest="addr", help="listening add...
[ "def", "getInputOptions", "(", ")", ":", "# ----------------------------------------------------------------------", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"Manages PTT from an SDRangel instance automatically\"", ")", "parser", ".", "add_argu...
https://github.com/f4exb/sdrangel/blob/fce235b2bc59b932f93d2cb8784055d51b3b8424/scriptsapi/ptt_active.py#L271-L302
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/multidirdialog.py
python
MultiDirDialog.RecurseTopDir
(self, treeCtrl, item, itemText)
return itemText
Recurse a directory tree to include the parent-folder. :param `treeCtrl`: the tree control associated with teh internal :class:`GenericDirCtrl`; :param `item`: the selected tree control item; :param `itemText`: the selected tree control item text.
Recurse a directory tree to include the parent-folder.
[ "Recurse", "a", "directory", "tree", "to", "include", "the", "parent", "-", "folder", "." ]
def RecurseTopDir(self, treeCtrl, item, itemText): """ Recurse a directory tree to include the parent-folder. :param `treeCtrl`: the tree control associated with teh internal :class:`GenericDirCtrl`; :param `item`: the selected tree control item; :param `itemText`: the selected ...
[ "def", "RecurseTopDir", "(", "self", ",", "treeCtrl", ",", "item", ",", "itemText", ")", ":", "# Get the item parent ", "parent", "=", "treeCtrl", ".", "GetItemParent", "(", "item", ")", "if", "parent", "!=", "treeCtrl", ".", "GetRootItem", "(", ")", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/multidirdialog.py#L466-L482
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/saved_model/load.py
python
Loader._recreate
(self, proto, node_id, nodes)
Creates a Python object from a SavedObject protocol buffer. Args: proto: a SavedObject proto node_id: int, the index of this object in the SavedObjectGraph node list. nodes: dict mapping int node_ids -> created objects. Returns: The recreated object, and the set-attribute function for ...
Creates a Python object from a SavedObject protocol buffer.
[ "Creates", "a", "Python", "object", "from", "a", "SavedObject", "protocol", "buffer", "." ]
def _recreate(self, proto, node_id, nodes): """Creates a Python object from a SavedObject protocol buffer. Args: proto: a SavedObject proto node_id: int, the index of this object in the SavedObjectGraph node list. nodes: dict mapping int node_ids -> created objects. Returns: The re...
[ "def", "_recreate", "(", "self", ",", "proto", ",", "node_id", ",", "nodes", ")", ":", "registered_class", "=", "registration", ".", "get_registered_class", "(", "proto", ".", "registered_name", ")", "if", "registered_class", "is", "None", ":", "registered_class...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/load.py#L558-L587
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
GridStringTable.__init__
(self, *args, **kwargs)
__init__(self, int numRows=0, int numCols=0) -> GridStringTable
__init__(self, int numRows=0, int numCols=0) -> GridStringTable
[ "__init__", "(", "self", "int", "numRows", "=", "0", "int", "numCols", "=", "0", ")", "-", ">", "GridStringTable" ]
def __init__(self, *args, **kwargs): """__init__(self, int numRows=0, int numCols=0) -> GridStringTable""" _grid.GridStringTable_swiginit(self,_grid.new_GridStringTable(*args, **kwargs)) self._setOORInfo(self)
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_grid", ".", "GridStringTable_swiginit", "(", "self", ",", "_grid", ".", "new_GridStringTable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1051-L1054
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_poi.py
python
PoiDomain.getColor
(self, poiID)
return self._getUniversal(tc.VAR_COLOR, poiID)
getColor(string) -> (integer, integer, integer, integer) Returns the rgba color of the given poi.
getColor(string) -> (integer, integer, integer, integer)
[ "getColor", "(", "string", ")", "-", ">", "(", "integer", "integer", "integer", "integer", ")" ]
def getColor(self, poiID): """getColor(string) -> (integer, integer, integer, integer) Returns the rgba color of the given poi. """ return self._getUniversal(tc.VAR_COLOR, poiID)
[ "def", "getColor", "(", "self", ",", "poiID", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_COLOR", ",", "poiID", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_poi.py#L46-L51
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/descriptor.py
python
describe_field
(field_definition)
return field_descriptor
Build descriptor for Field instance. Args: field_definition: Field instance to provide descriptor for. Returns: Initialized FieldDescriptor instance describing the Field instance.
Build descriptor for Field instance.
[ "Build", "descriptor", "for", "Field", "instance", "." ]
def describe_field(field_definition): """Build descriptor for Field instance. Args: field_definition: Field instance to provide descriptor for. Returns: Initialized FieldDescriptor instance describing the Field instance. """ field_descriptor = FieldDescriptor() field_descriptor.name = field_defini...
[ "def", "describe_field", "(", "field_definition", ")", ":", "field_descriptor", "=", "FieldDescriptor", "(", ")", "field_descriptor", ".", "name", "=", "field_definition", ".", "name", "field_descriptor", ".", "number", "=", "field_definition", ".", "number", "field...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/descriptor.py#L341-L373
continental/ecal
204dab80a24fe01abca62541133b311bf0c09608
lang/python/core/ecal/core/core.py
python
pub_set_qos_reliability
(topic_handle, qpolicy)
return _ecal.pub_set_qos_reliability(topic_handle, qpolicy)
set publisher quality of service reliability mode :param topic_handle: the topic handle :param qpolicy: 0 = best_effort_reliability_qos, 1 = reliable_reliability_qos :type qpolicy: int :param depth: history kind buffer depth
set publisher quality of service reliability mode
[ "set", "publisher", "quality", "of", "service", "reliability", "mode" ]
def pub_set_qos_reliability(topic_handle, qpolicy): """ set publisher quality of service reliability mode :param topic_handle: the topic handle :param qpolicy: 0 = best_effort_reliability_qos, 1 = reliable_reliability_qos :type qpolicy: int :param depth: history kind buffer depth """ return _ecal.pub...
[ "def", "pub_set_qos_reliability", "(", "topic_handle", ",", "qpolicy", ")", ":", "return", "_ecal", ".", "pub_set_qos_reliability", "(", "topic_handle", ",", "qpolicy", ")" ]
https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/lang/python/core/ecal/core/core.py#L203-L213
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/coverage/coverage/collector.py
python
Collector.stop
(self)
Stop collecting trace information.
Stop collecting trace information.
[ "Stop", "collecting", "trace", "information", "." ]
def stop(self): """Stop collecting trace information.""" assert self._collectors assert self._collectors[-1] is self, ( "Expected current collector to be %r, but it's %r" % (self, self._collectors[-1]) ) self.pause() self.tracers = [] # Remove this C...
[ "def", "stop", "(", "self", ")", ":", "assert", "self", ".", "_collectors", "assert", "self", ".", "_collectors", "[", "-", "1", "]", "is", "self", ",", "(", "\"Expected current collector to be %r, but it's %r\"", "%", "(", "self", ",", "self", ".", "_collec...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/collector.py#L273-L287
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/training/python/training/hparam.py
python
HParams.set_hparam
(self, name, value)
Set the value of an existing hyperparameter. This function verifies that the type of the value matches the type of the existing hyperparameter. Args: name: Name of the hyperparameter. value: New value of the hyperparameter. Raises: ValueError: If there is a type mismatch.
Set the value of an existing hyperparameter.
[ "Set", "the", "value", "of", "an", "existing", "hyperparameter", "." ]
def set_hparam(self, name, value): """Set the value of an existing hyperparameter. This function verifies that the type of the value matches the type of the existing hyperparameter. Args: name: Name of the hyperparameter. value: New value of the hyperparameter. Raises: ValueErro...
[ "def", "set_hparam", "(", "self", ",", "name", ",", "value", ")", ":", "_", ",", "is_list", "=", "self", ".", "_hparam_types", "[", "name", "]", "if", "isinstance", "(", "value", ",", "list", ")", ":", "if", "not", "is_list", ":", "raise", "ValueErro...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/training/python/training/hparam.py#L428-L451
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/ordered_set.py
python
OrderedSet.difference_update
(self, *sets)
Update this OrderedSet to remove items from one or more other sets. Example: >>> this = OrderedSet([1, 2, 3]) >>> this.difference_update(OrderedSet([2, 4])) >>> print(this) OrderedSet([1, 3]) >>> this = OrderedSet([1, 2, 3, 4, 5]) >>> thi...
Update this OrderedSet to remove items from one or more other sets.
[ "Update", "this", "OrderedSet", "to", "remove", "items", "from", "one", "or", "more", "other", "sets", "." ]
def difference_update(self, *sets): """ Update this OrderedSet to remove items from one or more other sets. Example: >>> this = OrderedSet([1, 2, 3]) >>> this.difference_update(OrderedSet([2, 4])) >>> print(this) OrderedSet([1, 3]) >>...
[ "def", "difference_update", "(", "self", ",", "*", "sets", ")", ":", "items_to_remove", "=", "set", "(", ")", "for", "other", "in", "sets", ":", "items_to_remove", "|=", "set", "(", "other", ")", "self", ".", "_update_items", "(", "[", "item", "for", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/ordered_set.py#L437-L455
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/io/mmio.py
python
MMFile._open
(filespec, mode='rb')
return stream, close_it
Return an open file stream for reading based on source. If source is a file name, open it (after trying to find it with mtx and gzipped mtx extensions). Otherwise, just return source. Parameters ---------- filespec : str or file-like String giving file name or file...
Return an open file stream for reading based on source.
[ "Return", "an", "open", "file", "stream", "for", "reading", "based", "on", "source", "." ]
def _open(filespec, mode='rb'): """ Return an open file stream for reading based on source. If source is a file name, open it (after trying to find it with mtx and gzipped mtx extensions). Otherwise, just return source. Parameters ---------- filespec : str or file-like...
[ "def", "_open", "(", "filespec", ",", "mode", "=", "'rb'", ")", ":", "close_it", "=", "False", "if", "isinstance", "(", "filespec", ",", "string_types", ")", ":", "close_it", "=", "True", "# open for reading", "if", "mode", "[", "0", "]", "==", "'r'", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/io/mmio.py#L269-L323
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/cookielib.py
python
CookieJar.__len__
(self)
return i
Return number of contained cookies.
Return number of contained cookies.
[ "Return", "number", "of", "contained", "cookies", "." ]
def __len__(self): """Return number of contained cookies.""" i = 0 for cookie in self: i = i + 1 return i
[ "def", "__len__", "(", "self", ")", ":", "i", "=", "0", "for", "cookie", "in", "self", ":", "i", "=", "i", "+", "1", "return", "i" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/cookielib.py#L1713-L1717
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/tokenize.py
python
tokenize
(readline, tokeneater=printtoken)
The tokenize() function accepts two parameters: one representing the input stream, and one providing an output mechanism for tokenize(). The first parameter, readline, must be a callable object which provides the same interface as the readline() method of built-in file objects. Each call to the functio...
The tokenize() function accepts two parameters: one representing the input stream, and one providing an output mechanism for tokenize().
[ "The", "tokenize", "()", "function", "accepts", "two", "parameters", ":", "one", "representing", "the", "input", "stream", "and", "one", "providing", "an", "output", "mechanism", "for", "tokenize", "()", "." ]
def tokenize(readline, tokeneater=printtoken): """ The tokenize() function accepts two parameters: one representing the input stream, and one providing an output mechanism for tokenize(). The first parameter, readline, must be a callable object which provides the same interface as the readline() me...
[ "def", "tokenize", "(", "readline", ",", "tokeneater", "=", "printtoken", ")", ":", "try", ":", "tokenize_loop", "(", "readline", ",", "tokeneater", ")", "except", "StopTokenizing", ":", "pass" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/tokenize.py#L155-L171
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchGrid.py
python
makeGrid
(name="Grid")
return obj
makeGrid(): makes a grid object
makeGrid(): makes a grid object
[ "makeGrid", "()", ":", "makes", "a", "grid", "object" ]
def makeGrid(name="Grid"): '''makeGrid(): makes a grid object''' obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Grid") obj.Label = translate("Arch",name) ArchGrid(obj) if FreeCAD.GuiUp: ViewProviderArchGrid(obj.ViewObject) obj.ViewObject.Transparency = 85 FreeCAD...
[ "def", "makeGrid", "(", "name", "=", "\"Grid\"", ")", ":", "obj", "=", "FreeCAD", ".", "ActiveDocument", ".", "addObject", "(", "\"Part::FeaturePython\"", ",", "\"Grid\"", ")", "obj", ".", "Label", "=", "translate", "(", "\"Arch\"", ",", "name", ")", "Arch...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchGrid.py#L47-L58
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/_strptime.py
python
TimeRE.pattern
(self, format)
return "%s%s" % (processed_format, format)
Return regex pattern for the format string. Need to make sure that any characters that might be interpreted as regex syntax are escaped.
Return regex pattern for the format string.
[ "Return", "regex", "pattern", "for", "the", "format", "string", "." ]
def pattern(self, format): """Return regex pattern for the format string. Need to make sure that any characters that might be interpreted as regex syntax are escaped. """ processed_format = '' # The sub() call escapes all characters that might be misconstrued # ...
[ "def", "pattern", "(", "self", ",", "format", ")", ":", "processed_format", "=", "''", "# The sub() call escapes all characters that might be misconstrued", "# as regex syntax. Cannot use re.escape since we have to deal with", "# format directives (%m, etc.).", "regex_chars", "=", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/_strptime.py#L240-L261
zju3dv/clean-pvnet
5870c509e3cc205e1bb28910a7b1a9a3c8add9a8
lib/utils/pysixd/view_sampler.py
python
save_vis
(path, views, views_level=None)
Creates a PLY file visualizing the views. :param path: Path to output PLY file. :param views: Views as returned by sample_views(). :param views_level: View levels as returned by sample_views(). :return: -
Creates a PLY file visualizing the views.
[ "Creates", "a", "PLY", "file", "visualizing", "the", "views", "." ]
def save_vis(path, views, views_level=None): ''' Creates a PLY file visualizing the views. :param path: Path to output PLY file. :param views: Views as returned by sample_views(). :param views_level: View levels as returned by sample_views(). :return: - ''' # Visualization (saved as a P...
[ "def", "save_vis", "(", "path", ",", "views", ",", "views_level", "=", "None", ")", ":", "# Visualization (saved as a PLY file)", "pts", "=", "[", "]", "normals", "=", "[", "]", "colors", "=", "[", "]", "for", "view_id", ",", "view", "in", "enumerate", "...
https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/pysixd/view_sampler.py#L232-L273
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/pseudo-palindromic-paths-in-a-binary-tree.py
python
Solution2.pseudoPalindromicPaths
(self, root)
return dfs(root, 0)
:type root: TreeNode :rtype: int
:type root: TreeNode :rtype: int
[ ":", "type", "root", ":", "TreeNode", ":", "rtype", ":", "int" ]
def pseudoPalindromicPaths (self, root): """ :type root: TreeNode :rtype: int """ def dfs(node, count): if not root: return 0 count ^= 1 << (node.val-1) return int(node.left == node.right and count&(count-1) == 0) + \ ...
[ "def", "pseudoPalindromicPaths", "(", "self", ",", "root", ")", ":", "def", "dfs", "(", "node", ",", "count", ")", ":", "if", "not", "root", ":", "return", "0", "count", "^=", "1", "<<", "(", "node", ".", "val", "-", "1", ")", "return", "int", "(...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/pseudo-palindromic-paths-in-a-binary-tree.py#L34-L45
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/build/gyp/pylib/gyp/mac_tool.py
python
MacTool.ExecPackageFramework
(self, framework, version)
Takes a path to Something.framework and the Current version of that and sets up all the symlinks.
Takes a path to Something.framework and the Current version of that and sets up all the symlinks.
[ "Takes", "a", "path", "to", "Something", ".", "framework", "and", "the", "Current", "version", "of", "that", "and", "sets", "up", "all", "the", "symlinks", "." ]
def ExecPackageFramework(self, framework, version): """Takes a path to Something.framework and the Current version of that and sets up all the symlinks.""" # Find the name of the binary based on the part before the ".framework". binary = os.path.basename(framework).split('.')[0] CURRENT = 'Current'...
[ "def", "ExecPackageFramework", "(", "self", ",", "framework", ",", "version", ")", ":", "# Find the name of the binary based on the part before the \".framework\".", "binary", "=", "os", ".", "path", ".", "basename", "(", "framework", ")", ".", "split", "(", "'.'", ...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/mac_tool.py#L172-L199
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/module.py
python
Module.imported_modules
(self)
return [_GetImport(self, i) for i in range(nmod)]
Get imported modules Returns ---------- modules : list of Module The module
Get imported modules
[ "Get", "imported", "modules" ]
def imported_modules(self): """Get imported modules Returns ---------- modules : list of Module The module """ nmod = _ImportsSize(self) return [_GetImport(self, i) for i in range(nmod)]
[ "def", "imported_modules", "(", "self", ")", ":", "nmod", "=", "_ImportsSize", "(", "self", ")", "return", "[", "_GetImport", "(", "self", ",", "i", ")", "for", "i", "in", "range", "(", "nmod", ")", "]" ]
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/module.py#L50-L59
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py
python
ServerConnection.remove_global_handler
(self, *args)
Remove global handler. See documentation for IRC.remove_global_handler.
Remove global handler.
[ "Remove", "global", "handler", "." ]
def remove_global_handler(self, *args): """Remove global handler. See documentation for IRC.remove_global_handler. """ self.irclibobj.remove_global_handler(*args)
[ "def", "remove_global_handler", "(", "self", ",", "*", "args", ")", ":", "self", ".", "irclibobj", ".", "remove_global_handler", "(", "*", "args", ")" ]
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L623-L628
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TFlt.SaveXml
(self, *args)
return _snap.TFlt_SaveXml(self, *args)
SaveXml(TFlt self, TSOut SOut, TStr Nm) Parameters: SOut: TSOut & Nm: TStr const &
SaveXml(TFlt self, TSOut SOut, TStr Nm)
[ "SaveXml", "(", "TFlt", "self", "TSOut", "SOut", "TStr", "Nm", ")" ]
def SaveXml(self, *args): """ SaveXml(TFlt self, TSOut SOut, TStr Nm) Parameters: SOut: TSOut & Nm: TStr const & """ return _snap.TFlt_SaveXml(self, *args)
[ "def", "SaveXml", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TFlt_SaveXml", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L14265-L14274
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/smtplib.py
python
SMTP.send_message
(self, msg, from_addr=None, to_addrs=None, mail_options=(), rcpt_options=())
return self.sendmail(from_addr, to_addrs, flatmsg, mail_options, rcpt_options)
Converts message to a bytestring and passes it to sendmail. The arguments are as for sendmail, except that msg is an email.message.Message object. If from_addr is None or to_addrs is None, these arguments are taken from the headers of the Message as described in RFC 2822 (a ValueError ...
Converts message to a bytestring and passes it to sendmail.
[ "Converts", "message", "to", "a", "bytestring", "and", "passes", "it", "to", "sendmail", "." ]
def send_message(self, msg, from_addr=None, to_addrs=None, mail_options=(), rcpt_options=()): """Converts message to a bytestring and passes it to sendmail. The arguments are as for sendmail, except that msg is an email.message.Message object. If from_addr is None or to_ad...
[ "def", "send_message", "(", "self", ",", "msg", ",", "from_addr", "=", "None", ",", "to_addrs", "=", "None", ",", "mail_options", "=", "(", ")", ",", "rcpt_options", "=", "(", ")", ")", ":", "# 'Resent-Date' is a mandatory field if the Message is resent (RFC 2822"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/smtplib.py#L892-L967
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py
python
SineStandExample
()
An example of minitaur standing and squatting on the floor. To validate the accurate motor model we command the robot and sit and stand up periodically in both simulation and experiment. We compare the measured motor trajectories, torques and gains.
An example of minitaur standing and squatting on the floor.
[ "An", "example", "of", "minitaur", "standing", "and", "squatting", "on", "the", "floor", "." ]
def SineStandExample(): """An example of minitaur standing and squatting on the floor. To validate the accurate motor model we command the robot and sit and stand up periodically in both simulation and experiment. We compare the measured motor trajectories, torques and gains. """ environment = minitaur_gym...
[ "def", "SineStandExample", "(", ")", ":", "environment", "=", "minitaur_gym_env", ".", "MinitaurBulletEnv", "(", "render", "=", "True", ",", "leg_model_enabled", "=", "False", ",", "motor_velocity_limit", "=", "np", ".", "inf", ",", "motor_overheat_protection", "=...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/examples/minitaur_gym_env_example.py#L72-L106
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/mime/multipart.py
python
MIMEMultipart.__init__
(self, _subtype='mixed', boundary=None, _subparts=None, **_params)
Creates a multipart/* type message. By default, creates a multipart/mixed message, with proper Content-Type and MIME-Version headers. _subtype is the subtype of the multipart content type, defaulting to `mixed'. boundary is the multipart boundary string. By default it is ...
Creates a multipart/* type message.
[ "Creates", "a", "multipart", "/", "*", "type", "message", "." ]
def __init__(self, _subtype='mixed', boundary=None, _subparts=None, **_params): """Creates a multipart/* type message. By default, creates a multipart/mixed message, with proper Content-Type and MIME-Version headers. _subtype is the subtype of the multipart content typ...
[ "def", "__init__", "(", "self", ",", "_subtype", "=", "'mixed'", ",", "boundary", "=", "None", ",", "_subparts", "=", "None", ",", "*", "*", "_params", ")", ":", "MIMEBase", ".", "__init__", "(", "self", ",", "'multipart'", ",", "_subtype", ",", "*", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/mime/multipart.py#L16-L47
apache/mesos
97d9a4063332aae3825d78de71611657e05cf5e2
src/python/cli_new/lib/cli/mesos.py
python
get_frameworks
(master, config)
return get_key_endpoint(key, endpoint, master, config)
Get the frameworks in a Mesos cluster.
Get the frameworks in a Mesos cluster.
[ "Get", "the", "frameworks", "in", "a", "Mesos", "cluster", "." ]
def get_frameworks(master, config): """ Get the frameworks in a Mesos cluster. """ endpoint = "master/frameworks/" key = "frameworks" return get_key_endpoint(key, endpoint, master, config)
[ "def", "get_frameworks", "(", "master", ",", "config", ")", ":", "endpoint", "=", "\"master/frameworks/\"", "key", "=", "\"frameworks\"", "return", "get_key_endpoint", "(", "key", ",", "endpoint", ",", "master", ",", "config", ")" ]
https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/src/python/cli_new/lib/cli/mesos.py#L82-L88
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/coverage/coverage/execfile.py
python
make_code_from_py
(filename)
return code
Get source from `filename` and make a code object of it.
Get source from `filename` and make a code object of it.
[ "Get", "source", "from", "filename", "and", "make", "a", "code", "object", "of", "it", "." ]
def make_code_from_py(filename): """Get source from `filename` and make a code object of it.""" # Open the source file. try: source = get_python_source(filename) except (IOError, NoSource): raise NoSource("No file to run: '%s'" % filename) code = compile_unicode(source, filename, "e...
[ "def", "make_code_from_py", "(", "filename", ")", ":", "# Open the source file.", "try", ":", "source", "=", "get_python_source", "(", "filename", ")", "except", "(", "IOError", ",", "NoSource", ")", ":", "raise", "NoSource", "(", "\"No file to run: '%s'\"", "%", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/execfile.py#L204-L213
tum-vision/fusenet
a1451be2971b348a01b0f525c2a3a7a0e215a591
python/caffe/draw.py
python
choose_color_by_layertype
(layertype)
return color
Define colors for nodes based on the layer type.
Define colors for nodes based on the layer type.
[ "Define", "colors", "for", "nodes", "based", "on", "the", "layer", "type", "." ]
def choose_color_by_layertype(layertype): """Define colors for nodes based on the layer type. """ color = '#6495ED' # Default if layertype == 'Convolution' or layertype == 'Deconvolution': color = '#FF5050' elif layertype == 'Pooling': color = '#FF9900' elif layertype == 'InnerP...
[ "def", "choose_color_by_layertype", "(", "layertype", ")", ":", "color", "=", "'#6495ED'", "# Default", "if", "layertype", "==", "'Convolution'", "or", "layertype", "==", "'Deconvolution'", ":", "color", "=", "'#FF5050'", "elif", "layertype", "==", "'Pooling'", ":...
https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/python/caffe/draw.py#L117-L127
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
uCSIsSinhala
(code)
return ret
Check whether the character is part of Sinhala UCS Block
Check whether the character is part of Sinhala UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "Sinhala", "UCS", "Block" ]
def uCSIsSinhala(code): """Check whether the character is part of Sinhala UCS Block """ ret = libxml2mod.xmlUCSIsSinhala(code) return ret
[ "def", "uCSIsSinhala", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsSinhala", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L2056-L2059
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/train/train_thor/convert_utils.py
python
ConvertNetUtils._convert_embedding
(subcell)
return new_subcell
Convert embedding cell to second-order cell
Convert embedding cell to second-order cell
[ "Convert", "embedding", "cell", "to", "second", "-", "order", "cell" ]
def _convert_embedding(subcell): """ Convert embedding cell to second-order cell """ new_subcell = nn.EmbeddingThor(vocab_size=subcell.vocab_size, embedding_size=subcell.embedding_size, use_one_hot=False) ...
[ "def", "_convert_embedding", "(", "subcell", ")", ":", "new_subcell", "=", "nn", ".", "EmbeddingThor", "(", "vocab_size", "=", "subcell", ".", "vocab_size", ",", "embedding_size", "=", "subcell", ".", "embedding_size", ",", "use_one_hot", "=", "False", ")", "n...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/train_thor/convert_utils.py#L70-L78
facebook/wangle
2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3
build/fbcode_builder/getdeps/envfuncs.py
python
path_search
(env, exename, defval=None)
return result
Search for exename in the PATH specified in env. exename is eg: `ninja` and this function knows to append a .exe to the end on windows. Returns the path to the exe if found, or None if either no PATH is set in env or no executable is found.
Search for exename in the PATH specified in env. exename is eg: `ninja` and this function knows to append a .exe to the end on windows. Returns the path to the exe if found, or None if either no PATH is set in env or no executable is found.
[ "Search", "for", "exename", "in", "the", "PATH", "specified", "in", "env", ".", "exename", "is", "eg", ":", "ninja", "and", "this", "function", "knows", "to", "append", "a", ".", "exe", "to", "the", "end", "on", "windows", ".", "Returns", "the", "path"...
def path_search(env, exename, defval=None): """Search for exename in the PATH specified in env. exename is eg: `ninja` and this function knows to append a .exe to the end on windows. Returns the path to the exe if found, or None if either no PATH is set in env or no executable is found.""" path...
[ "def", "path_search", "(", "env", ",", "exename", ",", "defval", "=", "None", ")", ":", "path", "=", "env", ".", "get", "(", "\"PATH\"", ",", "None", ")", "if", "path", "is", "None", ":", "return", "defval", "# The project hash computation code searches for ...
https://github.com/facebook/wangle/blob/2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3/build/fbcode_builder/getdeps/envfuncs.py#L159-L178
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
examples/python/route_guide/route_guide_server.py
python
get_feature
(feature_db, point)
return None
Returns Feature at given location or None.
Returns Feature at given location or None.
[ "Returns", "Feature", "at", "given", "location", "or", "None", "." ]
def get_feature(feature_db, point): """Returns Feature at given location or None.""" for feature in feature_db: if feature.location == point: return feature return None
[ "def", "get_feature", "(", "feature_db", ",", "point", ")", ":", "for", "feature", "in", "feature_db", ":", "if", "feature", ".", "location", "==", "point", ":", "return", "feature", "return", "None" ]
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/examples/python/route_guide/route_guide_server.py#L27-L32
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/back/ReverseInputChannels.py
python
ReverseChannelsPropagationUp.lift_up_through_eltwise
(node: Node, reverse_channels: Node)
return True, copies
r""" BEFORE AFTER previous_op previous_op' \ / previous_op previous_op' ReverseChannels ReverseChannels \ / \ /...
r""" BEFORE AFTER
[ "r", "BEFORE", "AFTER" ]
def lift_up_through_eltwise(node: Node, reverse_channels: Node): r""" BEFORE AFTER previous_op previous_op' \ / previous_op previous_op' ReverseChannels Re...
[ "def", "lift_up_through_eltwise", "(", "node", ":", "Node", ",", "reverse_channels", ":", "Node", ")", ":", "before_shape", "=", "reverse_channels", ".", "in_port", "(", "0", ")", ".", "data", ".", "get_shape", "(", ")", "port_axis", "=", "[", "]", "for", ...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/back/ReverseInputChannels.py#L424-L482
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/graphy/graphy/backends/google_chart_api/util.py
python
ScaleData
(data, old_min, old_max, new_min, new_max)
return map(ScalePoint, data)
Scale the input data so that the range old_min-old_max maps to new_min-new_max.
Scale the input data so that the range old_min-old_max maps to new_min-new_max.
[ "Scale", "the", "input", "data", "so", "that", "the", "range", "old_min", "-", "old_max", "maps", "to", "new_min", "-", "new_max", "." ]
def ScaleData(data, old_min, old_max, new_min, new_max): """Scale the input data so that the range old_min-old_max maps to new_min-new_max. """ def ScalePoint(x): if x is None: return None return scale * x + translate if old_min == old_max: scale = 1 else: scale = (new_max - new_min) ...
[ "def", "ScaleData", "(", "data", ",", "old_min", ",", "old_max", ",", "new_min", ",", "new_max", ")", ":", "def", "ScalePoint", "(", "x", ")", ":", "if", "x", "is", "None", ":", "return", "None", "return", "scale", "*", "x", "+", "translate", "if", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/graphy/graphy/backends/google_chart_api/util.py#L217-L231
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Text.compare
(self, index1, op, index2)
return self.tk.getboolean(self.tk.call( self._w, 'compare', index1, op, index2))
Return whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.
Return whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.
[ "Return", "whether", "between", "index", "INDEX1", "and", "index", "INDEX2", "the", "relation", "OP", "is", "satisfied", ".", "OP", "is", "one", "of", "<", "<", "=", "==", ">", "=", ">", "or", "!", "=", "." ]
def compare(self, index1, op, index2): """Return whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.""" return self.tk.getboolean(self.tk.call( self._w, 'compare', index1, op, index2))
[ "def", "compare", "(", "self", ",", "index1", ",", "op", ",", "index2", ")", ":", "return", "self", ".", "tk", ".", "getboolean", "(", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'compare'", ",", "index1", ",", "op", ",", "index...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2903-L2907
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.PageUpExtend
(*args, **kwargs)
return _stc.StyledTextCtrl_PageUpExtend(*args, **kwargs)
PageUpExtend(self) Move caret one page up extending selection to new caret position.
PageUpExtend(self)
[ "PageUpExtend", "(", "self", ")" ]
def PageUpExtend(*args, **kwargs): """ PageUpExtend(self) Move caret one page up extending selection to new caret position. """ return _stc.StyledTextCtrl_PageUpExtend(*args, **kwargs)
[ "def", "PageUpExtend", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_PageUpExtend", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L4497-L4503
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/ops.py
python
Graph.device
(self, device_name_or_function)
Returns a context manager that specifies the default device to use. The `device_name_or_function` argument may either be a device name string, a device function, or None: * If it is a device name string, all operations constructed in this context will be assigned to the device with that name, unless...
Returns a context manager that specifies the default device to use.
[ "Returns", "a", "context", "manager", "that", "specifies", "the", "default", "device", "to", "use", "." ]
def device(self, device_name_or_function): # pylint: disable=line-too-long """Returns a context manager that specifies the default device to use. The `device_name_or_function` argument may either be a device name string, a device function, or None: * If it is a device name string, all operations c...
[ "def", "device", "(", "self", ",", "device_name_or_function", ")", ":", "# pylint: disable=line-too-long", "# pylint: enable=line-too-long", "if", "(", "device_name_or_function", "is", "not", "None", "and", "not", "callable", "(", "device_name_or_function", ")", ")", ":...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L3721-L3790
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/value.py
python
ValueRef.instructions
(self)
return _InstructionsIterator(it, parents)
Return an iterator over this block's instructions. The iterator will yield a ValueRef for each instruction.
Return an iterator over this block's instructions. The iterator will yield a ValueRef for each instruction.
[ "Return", "an", "iterator", "over", "this", "block", "s", "instructions", ".", "The", "iterator", "will", "yield", "a", "ValueRef", "for", "each", "instruction", "." ]
def instructions(self): """ Return an iterator over this block's instructions. The iterator will yield a ValueRef for each instruction. """ if not self.is_block: raise ValueError('expected block value, got %s' % (self._kind,)) it = ffi.lib.LLVMPY_BlockInstruct...
[ "def", "instructions", "(", "self", ")", ":", "if", "not", "self", ".", "is_block", ":", "raise", "ValueError", "(", "'expected block value, got %s'", "%", "(", "self", ".", "_kind", ",", ")", ")", "it", "=", "ffi", ".", "lib", ".", "LLVMPY_BlockInstructio...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/value.py#L269-L279
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextAttr.SetTextBoxAttr
(*args, **kwargs)
return _richtext.RichTextAttr_SetTextBoxAttr(*args, **kwargs)
SetTextBoxAttr(self, TextBoxAttr attr)
SetTextBoxAttr(self, TextBoxAttr attr)
[ "SetTextBoxAttr", "(", "self", "TextBoxAttr", "attr", ")" ]
def SetTextBoxAttr(*args, **kwargs): """SetTextBoxAttr(self, TextBoxAttr attr)""" return _richtext.RichTextAttr_SetTextBoxAttr(*args, **kwargs)
[ "def", "SetTextBoxAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextAttr_SetTextBoxAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L900-L902
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
unicycler/bridge_long_read.py
python
reduce_expected_count
(expected_count, a, b)
return expected_count * ((a / (a + expected_count)) * (1.0 - b) + b)
This function reduces the expected read count. It reduces by a factor which is a function of the read count, so low expected values aren't reduced much, but high expected values are reduced more. This is to help with high read depth cases where expected counts get quite high. https://www.desmos.com/calcula...
This function reduces the expected read count. It reduces by a factor which is a function of the read count, so low expected values aren't reduced much, but high expected values are reduced more. This is to help with high read depth cases where expected counts get quite high.
[ "This", "function", "reduces", "the", "expected", "read", "count", ".", "It", "reduces", "by", "a", "factor", "which", "is", "a", "function", "of", "the", "read", "count", "so", "low", "expected", "values", "aren", "t", "reduced", "much", "but", "high", ...
def reduce_expected_count(expected_count, a, b): """ This function reduces the expected read count. It reduces by a factor which is a function of the read count, so low expected values aren't reduced much, but high expected values are reduced more. This is to help with high read depth cases where expect...
[ "def", "reduce_expected_count", "(", "expected_count", ",", "a", ",", "b", ")", ":", "return", "expected_count", "*", "(", "(", "a", "/", "(", "a", "+", "expected_count", ")", ")", "*", "(", "1.0", "-", "b", ")", "+", "b", ")" ]
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/bridge_long_read.py#L618-L627
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
PyApp_GetMacSupportPCMenuShortcuts
(*args)
return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
PyApp_GetMacSupportPCMenuShortcuts() -> bool
PyApp_GetMacSupportPCMenuShortcuts() -> bool
[ "PyApp_GetMacSupportPCMenuShortcuts", "()", "-", ">", "bool" ]
def PyApp_GetMacSupportPCMenuShortcuts(*args): """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
[ "def", "PyApp_GetMacSupportPCMenuShortcuts", "(", "*", "args", ")", ":", "return", "_core_", ".", "PyApp_GetMacSupportPCMenuShortcuts", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L8274-L8276
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/jitclass/base.py
python
ctor_impl
(context, builder, sig, args)
return imputils.impl_ret_new_ref(context, builder, inst_typ, ret)
Generic constructor (__new__) for jitclasses.
Generic constructor (__new__) for jitclasses.
[ "Generic", "constructor", "(", "__new__", ")", "for", "jitclasses", "." ]
def ctor_impl(context, builder, sig, args): """ Generic constructor (__new__) for jitclasses. """ # Allocate the instance inst_typ = sig.return_type alloc_type = context.get_data_type(inst_typ.get_data_type()) alloc_size = context.get_abi_sizeof(alloc_type) meminfo = context.nrt.meminfo...
[ "def", "ctor_impl", "(", "context", ",", "builder", ",", "sig", ",", "args", ")", ":", "# Allocate the instance", "inst_typ", "=", "sig", ".", "return_type", "alloc_type", "=", "context", ".", "get_data_type", "(", "inst_typ", ".", "get_data_type", "(", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/jitclass/base.py#L488-L528
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/training/input.py
python
_enqueue
(queue, tensor_list, threads, enqueue_many, keep_input)
Enqueue `tensor_list` in `queue`.
Enqueue `tensor_list` in `queue`.
[ "Enqueue", "tensor_list", "in", "queue", "." ]
def _enqueue(queue, tensor_list, threads, enqueue_many, keep_input): """Enqueue `tensor_list` in `queue`.""" if enqueue_many: enqueue_fn = queue.enqueue_many else: enqueue_fn = queue.enqueue if keep_input.shape.ndims == 1: enqueue_ops = [ enqueue_fn(_select_which_to_enqueue(tensor_list, keep...
[ "def", "_enqueue", "(", "queue", ",", "tensor_list", ",", "threads", ",", "enqueue_many", ",", "keep_input", ")", ":", "if", "enqueue_many", ":", "enqueue_fn", "=", "queue", ".", "enqueue_many", "else", ":", "enqueue_fn", "=", "queue", ".", "enqueue", "if", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/input.py#L666-L680
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/utils/cli_parser.py
python
check_available_transforms
(transforms: list)
return True
This function check that transformations specified by user are available. :param transforms: list of user specified transformations :return: raises an Error if transformation is not available
This function check that transformations specified by user are available. :param transforms: list of user specified transformations :return: raises an Error if transformation is not available
[ "This", "function", "check", "that", "transformations", "specified", "by", "user", "are", "available", ".", ":", "param", "transforms", ":", "list", "of", "user", "specified", "transformations", ":", "return", ":", "raises", "an", "Error", "if", "transformation"...
def check_available_transforms(transforms: list): """ This function check that transformations specified by user are available. :param transforms: list of user specified transformations :return: raises an Error if transformation is not available """ from openvino.tools.mo.back.offline_transforma...
[ "def", "check_available_transforms", "(", "transforms", ":", "list", ")", ":", "from", "openvino", ".", "tools", ".", "mo", ".", "back", ".", "offline_transformations", "import", "get_available_transformations", "available_transforms", "=", "get_available_transformations"...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/utils/cli_parser.py#L1535-L1553
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/tabart.py
python
FF2TabArt.DrawTab
(self, dc, wnd, page, in_rect, close_button_state, paint_control=False)
return out_tab_rect, out_button_rect, x_extent
Draws a single tab. :param `dc`: a :class:`DC` device context; :param `wnd`: a :class:`Window` instance object; :param `page`: the tab control page associated with the tab; :param Rect `in_rect`: rectangle the tab should be confined to; :param integer `close_button_state`: the s...
Draws a single tab.
[ "Draws", "a", "single", "tab", "." ]
def DrawTab(self, dc, wnd, page, in_rect, close_button_state, paint_control=False): """ Draws a single tab. :param `dc`: a :class:`DC` device context; :param `wnd`: a :class:`Window` instance object; :param `page`: the tab control page associated with the tab; :param Rec...
[ "def", "DrawTab", "(", "self", ",", "dc", ",", "wnd", ",", "page", ",", "in_rect", ",", "close_button_state", ",", "paint_control", "=", "False", ")", ":", "# Firefox 2 style", "control", "=", "page", ".", "control", "# figure out the size of the tab", "tab_size...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/tabart.py#L1917-L2108
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/report_config.py
python
RptSetup.__init__
(self, profile, prod_name)
Parameters ---------- profile: dict Dictionary representation of the report file. prod_name: str Name of the target device.
Parameters ---------- profile: dict Dictionary representation of the report file.
[ "Parameters", "----------", "profile", ":", "dict", "Dictionary", "representation", "of", "the", "report", "file", "." ]
def __init__(self, profile, prod_name): """ Parameters ---------- profile: dict Dictionary representation of the report file. prod_name: str Name of the target device. """ self.profile = profile self.prod_name = prod_name s...
[ "def", "__init__", "(", "self", ",", "profile", ",", "prod_name", ")", ":", "self", ".", "profile", "=", "profile", "self", ".", "prod_name", "=", "prod_name", "self", ".", "version", "=", "[", "\"ReportVersion\"", ",", "\"Version\"", "]", "# Units", "self...
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/report_config.py#L22-L62
physercoe/starquant
c00cad64d1de2da05081b3dc320ef264c6295e08
cppsrc/log4cplus-2.0.4/catch/scripts/updateDocumentToC.py
python
buildMarkdown
(toc_headlines, body, spacer=0, placeholder=None)
return markdown
Returns a string with the Markdown output contents incl. the table of contents. Keyword arguments: toc_headlines: lines for the table of contents as created by the createToc function. body: contents of the Markdown file including ID-anchor tags as returned by the ...
Returns a string with the Markdown output contents incl. the table of contents.
[ "Returns", "a", "string", "with", "the", "Markdown", "output", "contents", "incl", ".", "the", "table", "of", "contents", "." ]
def buildMarkdown(toc_headlines, body, spacer=0, placeholder=None): """ Returns a string with the Markdown output contents incl. the table of contents. Keyword arguments: toc_headlines: lines for the table of contents as created by the createToc function. body: contents of t...
[ "def", "buildMarkdown", "(", "toc_headlines", ",", "body", ",", "spacer", "=", "0", ",", "placeholder", "=", "None", ")", ":", "if", "spacer", ":", "spacer_line", "=", "[", "'\\n<div style=\"height:%spx;\"></div>\\n'", "%", "(", "spacer", ")", "]", "toc_markdo...
https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/cppsrc/log4cplus-2.0.4/catch/scripts/updateDocumentToC.py#L227-L259
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/glcanvas.py
python
GLContext.SetCurrent
(*args, **kwargs)
return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
SetCurrent(self, GLCanvas win) -> bool
SetCurrent(self, GLCanvas win) -> bool
[ "SetCurrent", "(", "self", "GLCanvas", "win", ")", "-", ">", "bool" ]
def SetCurrent(*args, **kwargs): """SetCurrent(self, GLCanvas win) -> bool""" return _glcanvas.GLContext_SetCurrent(*args, **kwargs)
[ "def", "SetCurrent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_glcanvas", ".", "GLContext_SetCurrent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/glcanvas.py#L70-L72
cksystemsgroup/scal
fa2208a97a77d65f4e90f85fef3404c27c1f2ac2
tools/cpplint.py
python
CheckForNewlineAtEOF
(filename, lines, error)
Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found.
Logs an error if there is no newline char at the end of the file.
[ "Logs", "an", "error", "if", "there", "is", "no", "newline", "char", "at", "the", "end", "of", "the", "file", "." ]
def CheckForNewlineAtEOF(filename, lines, error): """Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ # The array ...
[ "def", "CheckForNewlineAtEOF", "(", "filename", ",", "lines", ",", "error", ")", ":", "# The array lines() was created by adding two newlines to the", "# original file (go figure), then splitting on \\n.", "# To verify that the file ends in \\n, we just have to make sure the", "# last-but-...
https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L1825-L1840
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/indexes/multi.py
python
MultiIndex.copy
( self, names=None, dtype=None, levels=None, codes=None, deep=False, name=None, )
return new_index
Make a copy of this object. Names, dtype, levels and codes can be passed and will be set on new copy. Parameters ---------- names : sequence, optional dtype : numpy dtype or pandas type, optional .. deprecated:: 1.2.0 levels : sequence, optional ...
Make a copy of this object. Names, dtype, levels and codes can be passed and will be set on new copy.
[ "Make", "a", "copy", "of", "this", "object", ".", "Names", "dtype", "levels", "and", "codes", "can", "be", "passed", "and", "will", "be", "set", "on", "new", "copy", "." ]
def copy( self, names=None, dtype=None, levels=None, codes=None, deep=False, name=None, ): """ Make a copy of this object. Names, dtype, levels and codes can be passed and will be set on new copy. Parameters ---------- ...
[ "def", "copy", "(", "self", ",", "names", "=", "None", ",", "dtype", "=", "None", ",", "levels", "=", "None", ",", "codes", "=", "None", ",", "deep", "=", "False", ",", "name", "=", "None", ",", ")", ":", "names", "=", "self", ".", "_validate_nam...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/multi.py#L1119-L1203
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/multiarray.py
python
stack
(arrays, axis=0, out=None)
return _mx_nd_np.stack(arrays, axis=axis, out=out)
Join a sequence of arrays along a new axis. The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if `axis=0` it will be the first dimension and if `axis=-1` it will be the last dimension. Parameters ---------- arrays : sequence of array_like ...
Join a sequence of arrays along a new axis. The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if `axis=0` it will be the first dimension and if `axis=-1` it will be the last dimension.
[ "Join", "a", "sequence", "of", "arrays", "along", "a", "new", "axis", ".", "The", "axis", "parameter", "specifies", "the", "index", "of", "the", "new", "axis", "in", "the", "dimensions", "of", "the", "result", ".", "For", "example", "if", "axis", "=", ...
def stack(arrays, axis=0, out=None): """Join a sequence of arrays along a new axis. The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if `axis=0` it will be the first dimension and if `axis=-1` it will be the last dimension. Parameters ----...
[ "def", "stack", "(", "arrays", ",", "axis", "=", "0", ",", "out", "=", "None", ")", ":", "return", "_mx_nd_np", ".", "stack", "(", "arrays", ",", "axis", "=", "axis", ",", "out", "=", "out", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L7453-L7501
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
demo3_modelVisualization/vlfeat/docsrc/formatter.py
python
Formatter.parse_DIV
(self, indent)
return xs
Parse a DIV(N) symbol. A DIV(N) a sequence of blank
Parse a DIV(N) symbol. A DIV(N) a sequence of blank
[ "Parse", "a", "DIV", "(", "N", ")", "symbol", ".", "A", "DIV", "(", "N", ")", "a", "sequence", "of", "blank" ]
def parse_DIV(self, indent): "Parse a DIV(N) symbol. A DIV(N) a sequence of blank" "lines (B or other blocks at indentation level N, such as" "pharagraphs P(N), bullet lists BL(N), description lists DN(N)" pos = self.tokens.getpos() xs = [] while True: x = sel...
[ "def", "parse_DIV", "(", "self", ",", "indent", ")", ":", "\"lines (B or other blocks at indentation level N, such as\"", "\"pharagraphs P(N), bullet lists BL(N), description lists DN(N)\"", "pos", "=", "self", ".", "tokens", ".", "getpos", "(", ")", "xs", "=", "[", "]", ...
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/demo3_modelVisualization/vlfeat/docsrc/formatter.py#L293-L325
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_delivery.py
python
Delivery.transport
(self)
return self.connection.transport
The :class:`Transport` bound to the :class:`Connection` over which the delivery was sent or received.
The :class:`Transport` bound to the :class:`Connection` over which the delivery was sent or received.
[ "The", ":", "class", ":", "Transport", "bound", "to", "the", ":", "class", ":", "Connection", "over", "which", "the", "delivery", "was", "sent", "or", "received", "." ]
def transport(self) -> 'Transport': """ The :class:`Transport` bound to the :class:`Connection` over which the delivery was sent or received. """ return self.connection.transport
[ "def", "transport", "(", "self", ")", "->", "'Transport'", ":", "return", "self", ".", "connection", ".", "transport" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_delivery.py#L453-L458
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
UTF8Charcmp
(utf1, utf2)
return ret
compares the two UCS4 values
compares the two UCS4 values
[ "compares", "the", "two", "UCS4", "values" ]
def UTF8Charcmp(utf1, utf2): """compares the two UCS4 values """ ret = libxml2mod.xmlUTF8Charcmp(utf1, utf2) return ret
[ "def", "UTF8Charcmp", "(", "utf1", ",", "utf2", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUTF8Charcmp", "(", "utf1", ",", "utf2", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1248-L1251
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/__init__.py
python
__build_libxml2
(target, source, env)
return None
General XSLT builder (HTML/FO), using the libxml2 module.
General XSLT builder (HTML/FO), using the libxml2 module.
[ "General", "XSLT", "builder", "(", "HTML", "/", "FO", ")", "using", "the", "libxml2", "module", "." ]
def __build_libxml2(target, source, env): """ General XSLT builder (HTML/FO), using the libxml2 module. """ xsl_style = env.subst('$DOCBOOK_XSL') styledoc = libxml2.parseFile(xsl_style) style = libxslt.parseStylesheetDoc(styledoc) doc = libxml2.readFile(str(source[0]),None,libxml2.XML_PARSE_...
[ "def", "__build_libxml2", "(", "target", ",", "source", ",", "env", ")", ":", "xsl_style", "=", "env", ".", "subst", "(", "'$DOCBOOK_XSL'", ")", "styledoc", "=", "libxml2", ".", "parseFile", "(", "xsl_style", ")", "style", "=", "libxslt", ".", "parseStyles...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/docbook/__init__.py#L309-L328
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathToolController.py
python
ToolController.getTool
(self, obj)
return obj.Tool
returns the tool associated with this tool controller
returns the tool associated with this tool controller
[ "returns", "the", "tool", "associated", "with", "this", "tool", "controller" ]
def getTool(self, obj): """returns the tool associated with this tool controller""" PathLog.track() return obj.Tool
[ "def", "getTool", "(", "self", ",", "obj", ")", ":", "PathLog", ".", "track", "(", ")", "return", "obj", ".", "Tool" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathToolController.py#L295-L298
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibook.py
python
TabFrame.DoGetSize
(self)
return self._rect.width, self._rect.height
Returns the window size. :note: Overridden from :class:`PyControl`.
Returns the window size.
[ "Returns", "the", "window", "size", "." ]
def DoGetSize(self): """ Returns the window size. :note: Overridden from :class:`PyControl`. """ return self._rect.width, self._rect.height
[ "def", "DoGetSize", "(", "self", ")", ":", "return", "self", ".", "_rect", ".", "width", ",", "self", ".", "_rect", ".", "height" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibook.py#L2578-L2585
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Window.GetAutoLayout
(*args, **kwargs)
return _core_.Window_GetAutoLayout(*args, **kwargs)
GetAutoLayout(self) -> bool Returns the current autoLayout setting
GetAutoLayout(self) -> bool
[ "GetAutoLayout", "(", "self", ")", "-", ">", "bool" ]
def GetAutoLayout(*args, **kwargs): """ GetAutoLayout(self) -> bool Returns the current autoLayout setting """ return _core_.Window_GetAutoLayout(*args, **kwargs)
[ "def", "GetAutoLayout", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetAutoLayout", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L11483-L11489
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListHeaderWindow.HitTestColumn
(self, x, y)
return -1
HitTest method for column headers. :param `x`: the mouse `x` position; :param `y`: the mouse `y` position. :return: The column index if any column client rectangle contains the mouse position, ``wx.NOT_FOUND`` otherwise.
HitTest method for column headers.
[ "HitTest", "method", "for", "column", "headers", "." ]
def HitTestColumn(self, x, y): """ HitTest method for column headers. :param `x`: the mouse `x` position; :param `y`: the mouse `y` position. :return: The column index if any column client rectangle contains the mouse position, ``wx.NOT_FOUND`` otherwise. """ ...
[ "def", "HitTestColumn", "(", "self", ",", "x", ",", "y", ")", ":", "xOld", "=", "0", "for", "i", "in", "xrange", "(", "self", ".", "_owner", ".", "GetColumnCount", "(", ")", ")", ":", "if", "not", "self", ".", "IsColumnShown", "(", "i", ")", ":",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L5673-L5694
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/blogger/data.py
python
BloggerEntry.get_blog_name
(self)
return None
Finds the name of this blog as used in the 'alternate' URL. An alternate URL is in the form 'http://blogName.blogspot.com/'. For an entry representing the above example, this method would return 'blogName'. Returns: The blog's URL name component as a string.
Finds the name of this blog as used in the 'alternate' URL.
[ "Finds", "the", "name", "of", "this", "blog", "as", "used", "in", "the", "alternate", "URL", "." ]
def get_blog_name(self): """Finds the name of this blog as used in the 'alternate' URL. An alternate URL is in the form 'http://blogName.blogspot.com/'. For an entry representing the above example, this method would return 'blogName'. Returns: The blog's URL name component as a string. """ ...
[ "def", "get_blog_name", "(", "self", ")", ":", "for", "link", "in", "self", ".", "link", ":", "if", "link", ".", "rel", "==", "'alternate'", ":", "return", "BLOG_NAME_PATTERN", ".", "match", "(", "link", ".", "href", ")", ".", "group", "(", "2", ")",...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/blogger/data.py#L64-L76
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
_IncludeState.ResetSection
(self, directive)
Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else").
Reset section checking for preprocessor directive.
[ "Reset", "section", "checking", "for", "preprocessor", "directive", "." ]
def ResetSection(self, directive): """Reset section checking for preprocessor directive. Args: directive: preprocessor directive (e.g. "if", "else"). """ # The name of the current section. self._section = self._INITIAL_SECTION # The path of last found header. self._last_header = '' ...
[ "def", "ResetSection", "(", "self", ",", "directive", ")", ":", "# The name of the current section.", "self", ".", "_section", "=", "self", ".", "_INITIAL_SECTION", "# The path of last found header.", "self", ".", "_last_header", "=", "''", "# Update list of includes. No...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L751-L767
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pubsub/py2and3.py
python
with_metaclass
(meta, *bases)
return meta("NewBase", bases, {})
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, *bases): """Create a base class with a metaclass.""" return meta("NewBase", bases, {})
[ "def", "with_metaclass", "(", "meta", ",", "*", "bases", ")", ":", "return", "meta", "(", "\"NewBase\"", ",", "bases", ",", "{", "}", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/py2and3.py#L564-L566
google/shaka-player-embedded
dabbeb5b47cc257b37b9a254661546352aaf0afe
shaka/tools/gen_eme_plugins.py
python
_ParsePlugin
(file_path)
Reads the given file and parses it into an object.
Reads the given file and parses it into an object.
[ "Reads", "the", "given", "file", "and", "parses", "it", "into", "an", "object", "." ]
def _ParsePlugin(file_path): """Reads the given file and parses it into an object.""" with open(file_path, 'r') as f: return json.load(f)
[ "def", "_ParsePlugin", "(", "file_path", ")", ":", "with", "open", "(", "file_path", ",", "'r'", ")", "as", "f", ":", "return", "json", ".", "load", "(", "f", ")" ]
https://github.com/google/shaka-player-embedded/blob/dabbeb5b47cc257b37b9a254661546352aaf0afe/shaka/tools/gen_eme_plugins.py#L42-L45
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
projects/default/controllers/sumo_supervisor/SumoSupervisor.py
python
SumoSupervisor.run
(self, port, disableTrafficLight, directory, step, rotateWheels, maxVehicles, radius, enableHeight, useDisplay, displayRefreshRate, displayZoom, displayFitSize, maximumLateralSpeed, maximumAngularSpeed, laneChangeDelay, traci, sumolib)
Main loop function.
Main loop function.
[ "Main", "loop", "function", "." ]
def run(self, port, disableTrafficLight, directory, step, rotateWheels, maxVehicles, radius, enableHeight, useDisplay, displayRefreshRate, displayZoom, displayFitSize, maximumLateralSpeed, maximumAngularSpeed, laneChangeDelay, traci, sumolib): """Main loop function.""" ...
[ "def", "run", "(", "self", ",", "port", ",", "disableTrafficLight", ",", "directory", ",", "step", ",", "rotateWheels", ",", "maxVehicles", ",", "radius", ",", "enableHeight", ",", "useDisplay", ",", "displayRefreshRate", ",", "displayZoom", ",", "displayFitSize...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/projects/default/controllers/sumo_supervisor/SumoSupervisor.py#L424-L566
AXErunners/axe
53f14e8112ab6370b96e1e78d2858dabc886bba4
contrib/devtools/update-translations.py
python
find_format_specifiers
(s)
return specifiers
Find all format specifiers in a string.
Find all format specifiers in a string.
[ "Find", "all", "format", "specifiers", "in", "a", "string", "." ]
def find_format_specifiers(s): '''Find all format specifiers in a string.''' pos = 0 specifiers = [] while True: percent = s.find('%', pos) if percent < 0: break try: specifiers.append(s[percent+1]) except: print('Failed to get specifie...
[ "def", "find_format_specifiers", "(", "s", ")", ":", "pos", "=", "0", "specifiers", "=", "[", "]", "while", "True", ":", "percent", "=", "s", ".", "find", "(", "'%'", ",", "pos", ")", "if", "percent", "<", "0", ":", "break", "try", ":", "specifiers...
https://github.com/AXErunners/axe/blob/53f14e8112ab6370b96e1e78d2858dabc886bba4/contrib/devtools/update-translations.py#L45-L58
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py2/jinja2/loaders.py
python
BaseLoader.list_templates
(self)
Iterates over all templates. If the loader does not support that it should raise a :exc:`TypeError` which is the default behavior.
Iterates over all templates. If the loader does not support that it should raise a :exc:`TypeError` which is the default behavior.
[ "Iterates", "over", "all", "templates", ".", "If", "the", "loader", "does", "not", "support", "that", "it", "should", "raise", "a", ":", "exc", ":", "TypeError", "which", "is", "the", "default", "behavior", "." ]
def list_templates(self): """Iterates over all templates. If the loader does not support that it should raise a :exc:`TypeError` which is the default behavior. """ raise TypeError("this loader cannot iterate over all templates")
[ "def", "list_templates", "(", "self", ")", ":", "raise", "TypeError", "(", "\"this loader cannot iterate over all templates\"", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/loaders.py#L95-L99
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/install.py
python
add_targets_to_INSTALLED_FILES
(target, source, env)
return (target, source)
An emitter that adds all target files to the list stored in the _INSTALLED_FILES global variable. This way all installed files of one scons call will be collected.
An emitter that adds all target files to the list stored in the _INSTALLED_FILES global variable. This way all installed files of one scons call will be collected.
[ "An", "emitter", "that", "adds", "all", "target", "files", "to", "the", "list", "stored", "in", "the", "_INSTALLED_FILES", "global", "variable", ".", "This", "way", "all", "installed", "files", "of", "one", "scons", "call", "will", "be", "collected", "." ]
def add_targets_to_INSTALLED_FILES(target, source, env): """ An emitter that adds all target files to the list stored in the _INSTALLED_FILES global variable. This way all installed files of one scons call will be collected. """ global _INSTALLED_FILES, _UNIQUE_INSTALLED_FILES _INSTALLED_FILES.e...
[ "def", "add_targets_to_INSTALLED_FILES", "(", "target", ",", "source", ",", "env", ")", ":", "global", "_INSTALLED_FILES", ",", "_UNIQUE_INSTALLED_FILES", "_INSTALLED_FILES", ".", "extend", "(", "target", ")", "_UNIQUE_INSTALLED_FILES", "=", "None", "return", "(", "...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/install.py#L227-L236
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
GradLoopState.forward_index
(self)
return self._forward_index
The loop index of forward loop.
The loop index of forward loop.
[ "The", "loop", "index", "of", "forward", "loop", "." ]
def forward_index(self): """The loop index of forward loop.""" return self._forward_index
[ "def", "forward_index", "(", "self", ")", ":", "return", "self", ".", "_forward_index" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L571-L573
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/interactiveshell.py
python
InteractiveShell.mktempfile
(self, data=None, prefix='ipython_edit_')
return filename
Make a new tempfile and return its filename. This makes a call to tempfile.mkstemp (created in a tempfile.mkdtemp), but it registers the created filename internally so ipython cleans it up at exit time. Optional inputs: - data(None): if data is given, it gets written out to ...
Make a new tempfile and return its filename.
[ "Make", "a", "new", "tempfile", "and", "return", "its", "filename", "." ]
def mktempfile(self, data=None, prefix='ipython_edit_'): """Make a new tempfile and return its filename. This makes a call to tempfile.mkstemp (created in a tempfile.mkdtemp), but it registers the created filename internally so ipython cleans it up at exit time. Optional inputs...
[ "def", "mktempfile", "(", "self", ",", "data", "=", "None", ",", "prefix", "=", "'ipython_edit_'", ")", ":", "dirname", "=", "tempfile", ".", "mkdtemp", "(", "prefix", "=", "prefix", ")", "self", ".", "tempdirs", ".", "append", "(", "dirname", ")", "ha...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/interactiveshell.py#L3634-L3656
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/qa_header_payload_demux.py
python
qa_header_payload_demux.connect_all_blocks
(self, data_src, trigger_src, hpd, mock_header_demod, payload_sink, header_sink)
Connect the standard HPD test flowgraph
Connect the standard HPD test flowgraph
[ "Connect", "the", "standard", "HPD", "test", "flowgraph" ]
def connect_all_blocks(self, data_src, trigger_src, hpd, mock_header_demod, payload_sink, header_sink): """ Connect the standard HPD test flowgraph """ self.tb.connect(data_src, (h...
[ "def", "connect_all_blocks", "(", "self", ",", "data_src", ",", "trigger_src", ",", "hpd", ",", "mock_header_demod", ",", "payload_sink", ",", "header_sink", ")", ":", "self", ".", "tb", ".", "connect", "(", "data_src", ",", "(", "hpd", ",", "0", ")", ")...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_header_payload_demux.py#L74-L91
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/demand/turnflows_wxgui.py
python
TurnflowWxGuiMixin.on_turnflows_to_routes
(self, event=None)
Generates routes, based on flow information and turnflow probabilities. This function will apply the JTROUTER for each transport mode separately.
Generates routes, based on flow information and turnflow probabilities. This function will apply the JTROUTER for each transport mode separately.
[ "Generates", "routes", "based", "on", "flow", "information", "and", "turnflow", "probabilities", ".", "This", "function", "will", "apply", "the", "JTROUTER", "for", "each", "transport", "mode", "separately", "." ]
def on_turnflows_to_routes(self, event=None): """Generates routes, based on flow information and turnflow probabilities. This function will apply the JTROUTER for each transport mode separately. """ # TODO: maka proper control-panel #self._demand.turnflows.turnflows_to_routes(is_...
[ "def", "on_turnflows_to_routes", "(", "self", ",", "event", "=", "None", ")", ":", "# TODO: maka proper control-panel", "#self._demand.turnflows.turnflows_to_routes(is_clear_trips = False, is_make_probabilities = True)", "# self._mainframe.browse_obj(self._demand.trips)", "tfrouter", "="...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/turnflows_wxgui.py#L114-L142
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/clang/bindings/python/clang/cindex.py
python
TranslationUnit.diagnostics
(self)
return DiagIterator(self)
Return an iterable (and indexable) object containing the diagnostics.
Return an iterable (and indexable) object containing the diagnostics.
[ "Return", "an", "iterable", "(", "and", "indexable", ")", "object", "containing", "the", "diagnostics", "." ]
def diagnostics(self): """ Return an iterable (and indexable) object containing the diagnostics. """ class DiagIterator(object): def __init__(self, tu): self.tu = tu def __len__(self): return int(conf.lib.clang_getNumDiagnostics(se...
[ "def", "diagnostics", "(", "self", ")", ":", "class", "DiagIterator", "(", "object", ")", ":", "def", "__init__", "(", "self", ",", "tu", ")", ":", "self", ".", "tu", "=", "tu", "def", "__len__", "(", "self", ")", ":", "return", "int", "(", "conf",...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L2969-L2986
google/iree
1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76
integrations/tensorflow/python_projects/iree_tf/iree/tf/support/module_utils.py
python
IreeCompiledModule.reinitialize
(self)
Reinitializes all stateful variables.
Reinitializes all stateful variables.
[ "Reinitializes", "all", "stateful", "variables", "." ]
def reinitialize(self): """Reinitializes all stateful variables.""" # set_random_seed is not needed here because the model_class.__init__ is not # called. self._context = iree.runtime.SystemContext(vm_modules=[self._vm_module], config=self._config)
[ "def", "reinitialize", "(", "self", ")", ":", "# set_random_seed is not needed here because the model_class.__init__ is not", "# called.", "self", ".", "_context", "=", "iree", ".", "runtime", ".", "SystemContext", "(", "vm_modules", "=", "[", "self", ".", "_vm_module",...
https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/integrations/tensorflow/python_projects/iree_tf/iree/tf/support/module_utils.py#L432-L437
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.CmdKeyAssign
(*args, **kwargs)
return _stc.StyledTextCtrl_CmdKeyAssign(*args, **kwargs)
CmdKeyAssign(self, int key, int modifiers, int cmd) When key+modifier combination km is pressed perform msg.
CmdKeyAssign(self, int key, int modifiers, int cmd)
[ "CmdKeyAssign", "(", "self", "int", "key", "int", "modifiers", "int", "cmd", ")" ]
def CmdKeyAssign(*args, **kwargs): """ CmdKeyAssign(self, int key, int modifiers, int cmd) When key+modifier combination km is pressed perform msg. """ return _stc.StyledTextCtrl_CmdKeyAssign(*args, **kwargs)
[ "def", "CmdKeyAssign", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_CmdKeyAssign", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L2779-L2785
etternagame/etterna
8775f74ac9c353320128609d4b4150672e9a6d04
extern/SQLiteCpp/cpplint.py
python
CheckSpacingForFunctionCall
(filename, line, linenum, error)
Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for the correctness of various spacing around function calls.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "around", "function", "calls", "." ]
def CheckSpacingForFunctionCall(filename, line, linenum, error): """Checks for the correctness of various spacing around function calls. Args: filename: The name of the current file. line: The text of the line to check. linenum: The number of the line to check. error: The function to call with any ...
[ "def", "CheckSpacingForFunctionCall", "(", "filename", ",", "line", ",", "linenum", ",", "error", ")", ":", "# Since function calls often occur inside if/for/while/switch", "# expressions - which have their own, more liberal conventions - we", "# first see if we should be looking inside ...
https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/SQLiteCpp/cpplint.py#L2230-L2295
zhaoweicai/hwgq
ebc706bee3e2d145de1da4be446ce8de8740738f
scripts/cpp_lint.py
python
CheckSpacing
(filename, clean_lines, linenum, nesting_state, error)
Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't ...
Checks for the correctness of various spacing issues in the code.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "issues", "in", "the", "code", "." ]
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't star...
[ "def", "CheckSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want to check inside C++11", ...
https://github.com/zhaoweicai/hwgq/blob/ebc706bee3e2d145de1da4be446ce8de8740738f/scripts/cpp_lint.py#L2643-L2988
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview.py
python
MplGraphicsView.draw
(self)
return self._myCanvas.draw()
Draw to commit the change
Draw to commit the change
[ "Draw", "to", "commit", "the", "change" ]
def draw(self): """ Draw to commit the change """ return self._myCanvas.draw()
[ "def", "draw", "(", "self", ")", ":", "return", "self", ".", "_myCanvas", ".", "draw", "(", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview.py#L656-L659
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/lib/twodim_base.py
python
vander
(x, N=None)
return X
Generate a Van der Monde matrix. The columns of the output matrix are decreasing powers of the input vector. Specifically, the `i`-th output column is the input vector raised element-wise to the power of ``N - i - 1``. Such a matrix with a geometric progression in each row is named for Alexandre-Theo...
Generate a Van der Monde matrix.
[ "Generate", "a", "Van", "der", "Monde", "matrix", "." ]
def vander(x, N=None): """ Generate a Van der Monde matrix. The columns of the output matrix are decreasing powers of the input vector. Specifically, the `i`-th output column is the input vector raised element-wise to the power of ``N - i - 1``. Such a matrix with a geometric progression in e...
[ "def", "vander", "(", "x", ",", "N", "=", "None", ")", ":", "x", "=", "asarray", "(", "x", ")", "if", "N", "is", "None", ":", "N", "=", "len", "(", "x", ")", "X", "=", "ones", "(", "(", "len", "(", "x", ")", ",", "N", ")", ",", "x", "...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/twodim_base.py#L457-L519
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/geo.py
python
lla_from_topocentric
(x, y, z, reflat, reflon, refalt)
return lla_from_ecef(ex, ey, ez)
Transform from topocentric XYZ to lat, lon, alt.
Transform from topocentric XYZ to lat, lon, alt.
[ "Transform", "from", "topocentric", "XYZ", "to", "lat", "lon", "alt", "." ]
def lla_from_topocentric(x, y, z, reflat, reflon, refalt): ''' Transform from topocentric XYZ to lat, lon, alt. ''' T = ecef_from_topocentric_transform(reflat, reflon, refalt) ex = T[0, 0] * x + T[0, 1] * y + T[0, 2] * z + T[0, 3] ey = T[1, 0] * x + T[1, 1] * y + T[1, 2] * z + T[1, 3] ez = T...
[ "def", "lla_from_topocentric", "(", "x", ",", "y", ",", "z", ",", "reflat", ",", "reflon", ",", "refalt", ")", ":", "T", "=", "ecef_from_topocentric_transform", "(", "reflat", ",", "reflon", ",", "refalt", ")", "ex", "=", "T", "[", "0", ",", "0", "]"...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/geo.py#L123-L131
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/wsgi/service.py
python
service_mapping
(service_factory, service_path=r'.*', protocols=None)
return protorpc_service_app
WSGI application that handles a single ProtoRPC service mapping. Args: service_factory: Service factory for creating instances of service request handlers. Either callable that takes no parameters and returns a service instance or a service class whose constructor requires no parameters. service...
WSGI application that handles a single ProtoRPC service mapping.
[ "WSGI", "application", "that", "handles", "a", "single", "ProtoRPC", "service", "mapping", "." ]
def service_mapping(service_factory, service_path=r'.*', protocols=None): """WSGI application that handles a single ProtoRPC service mapping. Args: service_factory: Service factory for creating instances of service request handlers. Either callable that takes no parameters and returns a service in...
[ "def", "service_mapping", "(", "service_factory", ",", "service_path", "=", "r'.*'", ",", "protocols", "=", "None", ")", ":", "service_class", "=", "getattr", "(", "service_factory", ",", "'service_class'", ",", "service_factory", ")", "remote_methods", "=", "serv...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/wsgi/service.py#L57-L203
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tensorboard_logging.py
python
log
(level, message, *args)
Conditionally logs `message % args` at the level `level`. Note that tensorboard_logging verbosity and logging verbosity are separate; the message will always be passed through to the logging module regardless of whether it passes the tensorboard_logging verbosity check. Args: level: The verbosity level to...
Conditionally logs `message % args` at the level `level`.
[ "Conditionally", "logs", "message", "%", "args", "at", "the", "level", "level", "." ]
def log(level, message, *args): """Conditionally logs `message % args` at the level `level`. Note that tensorboard_logging verbosity and logging verbosity are separate; the message will always be passed through to the logging module regardless of whether it passes the tensorboard_logging verbosity check. Ar...
[ "def", "log", "(", "level", ",", "message", ",", "*", "args", ")", ":", "if", "_summary_writer", "is", "_sentinel_summary_writer", ":", "raise", "RuntimeError", "(", "'Must call set_summary_writer before doing any '", "'logging from tensorboard_logging'", ")", "_check_ver...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/tensorboard_logging.py#L117-L147
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/operations/build/wheel.py
python
build_wheel_pep517
( name, # type: str backend, # type: Pep517HookCaller metadata_directory, # type: str build_options, # type: List[str] tempd, # type: str )
return os.path.join(tempd, wheel_name)
Build one InstallRequirement using the PEP 517 build process. Returns path to wheel if successfully built. Otherwise, returns None.
Build one InstallRequirement using the PEP 517 build process.
[ "Build", "one", "InstallRequirement", "using", "the", "PEP", "517", "build", "process", "." ]
def build_wheel_pep517( name, # type: str backend, # type: Pep517HookCaller metadata_directory, # type: str build_options, # type: List[str] tempd, # type: str ): # type: (...) -> Optional[str] """Build one InstallRequirement using the PEP 517 build process. Returns path ...
[ "def", "build_wheel_pep517", "(", "name", ",", "# type: str", "backend", ",", "# type: Pep517HookCaller", "metadata_directory", ",", "# type: str", "build_options", ",", "# type: List[str]", "tempd", ",", "# type: str", ")", ":", "# type: (...) -> Optional[str]", "assert", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/operations/build/wheel.py#L29-L93
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/meta_optimizers/sharding/fp16_helper.py
python
FP16Utils.prune_fp16
(block, shard, reduced_grads_to_param, ring_ids)
1. prune all cast_fp16_to_fp32 ops if the param not belongs to this shard 2. revise amp inifine grad checking for sharding
1. prune all cast_fp16_to_fp32 ops if the param not belongs to this shard 2. revise amp inifine grad checking for sharding
[ "1", ".", "prune", "all", "cast_fp16_to_fp32", "ops", "if", "the", "param", "not", "belongs", "to", "this", "shard", "2", ".", "revise", "amp", "inifine", "grad", "checking", "for", "sharding" ]
def prune_fp16(block, shard, reduced_grads_to_param, ring_ids): """ 1. prune all cast_fp16_to_fp32 ops if the param not belongs to this shard 2. revise amp inifine grad checking for sharding """ # remove cast for idx, op in reversed(list(enumerate(block.ops))): ...
[ "def", "prune_fp16", "(", "block", ",", "shard", ",", "reduced_grads_to_param", ",", "ring_ids", ")", ":", "# remove cast", "for", "idx", ",", "op", "in", "reversed", "(", "list", "(", "enumerate", "(", "block", ".", "ops", ")", ")", ")", ":", "if", "n...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/meta_optimizers/sharding/fp16_helper.py#L76-L184
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/utils.py
python
LRUCache.items
(self)
return result
Return a list of items.
Return a list of items.
[ "Return", "a", "list", "of", "items", "." ]
def items(self): """Return a list of items.""" result = [(key, self._mapping[key]) for key in list(self._queue)] result.reverse() return result
[ "def", "items", "(", "self", ")", ":", "result", "=", "[", "(", "key", ",", "self", ".", "_mapping", "[", "key", "]", ")", "for", "key", "in", "list", "(", "self", ".", "_queue", ")", "]", "result", ".", "reverse", "(", ")", "return", "result" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/utils.py#L444-L448
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py3/pygments/formatters/rtf.py
python
RtfFormatter.__init__
(self, **options)
r""" Additional options accepted: ``fontface`` Name of the font used. Could for example be ``'Courier New'`` to further specify the default which is ``'\fmodern'``. The RTF specification claims that ``\fmodern`` are "Fixed-pitch serif and sans serif fonts...
r""" Additional options accepted:
[ "r", "Additional", "options", "accepted", ":" ]
def __init__(self, **options): r""" Additional options accepted: ``fontface`` Name of the font used. Could for example be ``'Courier New'`` to further specify the default which is ``'\fmodern'``. The RTF specification claims that ``\fmodern`` are "Fixed-pitch...
[ "def", "__init__", "(", "self", ",", "*", "*", "options", ")", ":", "Formatter", ".", "__init__", "(", "self", ",", "*", "*", "options", ")", "self", ".", "fontface", "=", "options", ".", "get", "(", "'fontface'", ")", "or", "''", "self", ".", "fon...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/formatters/rtf.py#L50-L64
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/rsqrt_ds.py
python
_rsqrt_ds_tbe
()
return
Rsqrt TBE register
Rsqrt TBE register
[ "Rsqrt", "TBE", "register" ]
def _rsqrt_ds_tbe(): """Rsqrt TBE register""" return
[ "def", "_rsqrt_ds_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/rsqrt_ds.py#L36-L38
johmathe/shotdetect
1ecf93a695c96fd7601a41ab5834f1117b9d7d50
tools/cpplint.py
python
ResetNolintSuppressions
()
Resets the set of NOLINT suppressions to empty.
Resets the set of NOLINT suppressions to empty.
[ "Resets", "the", "set", "of", "NOLINT", "suppressions", "to", "empty", "." ]
def ResetNolintSuppressions(): "Resets the set of NOLINT suppressions to empty." _error_suppressions.clear()
[ "def", "ResetNolintSuppressions", "(", ")", ":", "_error_suppressions", ".", "clear", "(", ")" ]
https://github.com/johmathe/shotdetect/blob/1ecf93a695c96fd7601a41ab5834f1117b9d7d50/tools/cpplint.py#L329-L331
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/message.py
python
Message.__setstate__
(self, state)
Support the pickle protocol.
Support the pickle protocol.
[ "Support", "the", "pickle", "protocol", "." ]
def __setstate__(self, state): """Support the pickle protocol.""" self.__init__() self.ParseFromString(state['serialized'])
[ "def", "__setstate__", "(", "self", ",", "state", ")", ":", "self", ".", "__init__", "(", ")", "self", ".", "ParseFromString", "(", "state", "[", "'serialized'", "]", ")" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/message.py#L292-L295
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/actor/Actor.py
python
Actor.verifySubpartsComplete
(self, partName = None, lodName = None)
Ensures that each joint is defined by at least one subPart. Prints a warning if this is not the case.
Ensures that each joint is defined by at least one subPart. Prints a warning if this is not the case.
[ "Ensures", "that", "each", "joint", "is", "defined", "by", "at", "least", "one", "subPart", ".", "Prints", "a", "warning", "if", "this", "is", "not", "the", "case", "." ]
def verifySubpartsComplete(self, partName = None, lodName = None): """ Ensures that each joint is defined by at least one subPart. Prints a warning if this is not the case. """ if partName: assert partName not in self.__subpartDict partNames = [partName] else: ...
[ "def", "verifySubpartsComplete", "(", "self", ",", "partName", "=", "None", ",", "lodName", "=", "None", ")", ":", "if", "partName", ":", "assert", "partName", "not", "in", "self", ".", "__subpartDict", "partNames", "=", "[", "partName", "]", "else", ":", ...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/actor/Actor.py#L2098-L2120
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/Input/InputFileEditorPlugin.py
python
InputFileEditorPlugin._saveInputFileAs
(self)
Ask the user what file to save the input tree to.
Ask the user what file to save the input tree to.
[ "Ask", "the", "user", "what", "file", "to", "save", "the", "input", "tree", "to", "." ]
def _saveInputFileAs(self): """ Ask the user what file to save the input tree to. """ input_name, other = QFileDialog.getSaveFileName(self, "Choose input file", os.getcwd(), "Input File (*.i)") if input_name: input_name = os.path.abspath(input_name) self.w...
[ "def", "_saveInputFileAs", "(", "self", ")", ":", "input_name", ",", "other", "=", "QFileDialog", ".", "getSaveFileName", "(", "self", ",", "\"Choose input file\"", ",", "os", ".", "getcwd", "(", ")", ",", "\"Input File (*.i)\"", ")", "if", "input_name", ":", ...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/Input/InputFileEditorPlugin.py#L108-L118
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/pyfakefs/pyfakefs/fake_filesystem.py
python
FakeDirectory.GetEntry
(self, pathname_name)
return self.contents[pathname_name]
Retrieves the specified child file or directory. Args: pathname_name: basename of the child object to retrieve Returns: string, file contents Raises: KeyError: if no child exists by the specified name
Retrieves the specified child file or directory.
[ "Retrieves", "the", "specified", "child", "file", "or", "directory", "." ]
def GetEntry(self, pathname_name): """Retrieves the specified child file or directory. Args: pathname_name: basename of the child object to retrieve Returns: string, file contents Raises: KeyError: if no child exists by the specified name """ return self.contents[pathname_name...
[ "def", "GetEntry", "(", "self", ",", "pathname_name", ")", ":", "return", "self", ".", "contents", "[", "pathname_name", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L324-L334
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/FortranCommon.py
python
ComputeFortranSuffixes
(suffixes, ppsuffixes)
suffixes are fortran source files, and ppsuffixes the ones to be pre-processed. Both should be sequences, not strings.
suffixes are fortran source files, and ppsuffixes the ones to be pre-processed. Both should be sequences, not strings.
[ "suffixes", "are", "fortran", "source", "files", "and", "ppsuffixes", "the", "ones", "to", "be", "pre", "-", "processed", ".", "Both", "should", "be", "sequences", "not", "strings", "." ]
def ComputeFortranSuffixes(suffixes, ppsuffixes): """suffixes are fortran source files, and ppsuffixes the ones to be pre-processed. Both should be sequences, not strings.""" assert len(suffixes) > 0 s = suffixes[0] sup = s.upper() upper_suffixes = [_.upper() for _ in suffixes] if SCons.Util...
[ "def", "ComputeFortranSuffixes", "(", "suffixes", ",", "ppsuffixes", ")", ":", "assert", "len", "(", "suffixes", ")", ">", "0", "s", "=", "suffixes", "[", "0", "]", "sup", "=", "s", ".", "upper", "(", ")", "upper_suffixes", "=", "[", "_", ".", "upper...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/FortranCommon.py#L88-L98
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html.py
python
HtmlWidgetCell.__init__
(self, *args, **kwargs)
__init__(self, Window wnd, int w=0) -> HtmlWidgetCell
__init__(self, Window wnd, int w=0) -> HtmlWidgetCell
[ "__init__", "(", "self", "Window", "wnd", "int", "w", "=", "0", ")", "-", ">", "HtmlWidgetCell" ]
def __init__(self, *args, **kwargs): """__init__(self, Window wnd, int w=0) -> HtmlWidgetCell""" _html.HtmlWidgetCell_swiginit(self,_html.new_HtmlWidgetCell(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_html", ".", "HtmlWidgetCell_swiginit", "(", "self", ",", "_html", ".", "new_HtmlWidgetCell", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L895-L897
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/aui_utilities.py
python
LightColour
(colour, percent)
return wx.Colour(r, g, b)
Brighten input `colour` by `percent`. :param Colour `colour`: the colour to be brightened; :param integer `percent`: brightening percentage.
Brighten input `colour` by `percent`.
[ "Brighten", "input", "colour", "by", "percent", "." ]
def LightColour(colour, percent): """ Brighten input `colour` by `percent`. :param Colour `colour`: the colour to be brightened; :param integer `percent`: brightening percentage. """ end_colour = wx.WHITE rd = end_colour.Red() - colour.Red() gd = end_colour.Green() - colour.Gr...
[ "def", "LightColour", "(", "colour", ",", "percent", ")", ":", "end_colour", "=", "wx", ".", "WHITE", "rd", "=", "end_colour", ".", "Red", "(", ")", "-", "colour", ".", "Red", "(", ")", "gd", "=", "end_colour", ".", "Green", "(", ")", "-", "colour"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/aui_utilities.py#L252-L273