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
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/unit/baseunit.py
python
BaseUnit.iter_base_dimensions
(self)
Returns a dictionary of BaseDimension:exponent pairs, describing the dimension of this unit.
Returns a dictionary of BaseDimension:exponent pairs, describing the dimension of this unit.
[ "Returns", "a", "dictionary", "of", "BaseDimension", ":", "exponent", "pairs", "describing", "the", "dimension", "of", "this", "unit", "." ]
def iter_base_dimensions(self): """ Returns a dictionary of BaseDimension:exponent pairs, describing the dimension of this unit. """ yield (self.dimension, 1)
[ "def", "iter_base_dimensions", "(", "self", ")", ":", "yield", "(", "self", ".", "dimension", ",", "1", ")" ]
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/unit/baseunit.py#L78-L82
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Task.py
python
TaskBase.__hash__
(self)
return id(self)
Very fast hashing scheme but not persistent (replace/implement in subclasses and see :py:meth:`waflib.Task.Task.uid`)
Very fast hashing scheme but not persistent (replace/implement in subclasses and see :py:meth:`waflib.Task.Task.uid`)
[ "Very", "fast", "hashing", "scheme", "but", "not", "persistent", "(", "replace", "/", "implement", "in", "subclasses", "and", "see", ":", "py", ":", "meth", ":", "waflib", ".", "Task", ".", "Task", ".", "uid", ")" ]
def __hash__(self): "Very fast hashing scheme but not persistent (replace/implement in subclasses and see :py:meth:`waflib.Task.Task.uid`)" return id(self)
[ "def", "__hash__", "(", "self", ")", ":", "return", "id", "(", "self", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Task.py#L193-L195
mbbill/JSC.js
fc2a917e8a83424fdbd008a8c9202383312855c6
Source/JavaScriptCore/disassembler/udis86/ud_opcode.py
python
UdOpcodeTable.entryAt
(self, index)
Returns the entry at a given index of the table, None if there is none. Raises an exception if the index is out of bounds.
Returns the entry at a given index of the table, None if there is none. Raises an exception if the index is out of bounds.
[ "Returns", "the", "entry", "at", "a", "given", "index", "of", "the", "table", "None", "if", "there", "is", "none", ".", "Raises", "an", "exception", "if", "the", "index", "is", "out", "of", "bounds", "." ]
def entryAt(self, index): """Returns the entry at a given index of the table, None if there is none. Raises an exception if the index is out of bounds. """ if index < self.size(): return self._entries.get(index, None) raise self.IndexError("index out of ...
[ "def", "entryAt", "(", "self", ",", "index", ")", ":", "if", "index", "<", "self", ".", "size", "(", ")", ":", "return", "self", ".", "_entries", ".", "get", "(", "index", ",", "None", ")", "raise", "self", ".", "IndexError", "(", "\"index out of bou...
https://github.com/mbbill/JSC.js/blob/fc2a917e8a83424fdbd008a8c9202383312855c6/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py#L215-L222
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/plugin.py
python
PluginInterface.add_subcommand
(self, subparsers)
Add parser options for this plugin. :param subparsers: argparse subparsers
Add parser options for this plugin.
[ "Add", "parser", "options", "for", "this", "plugin", "." ]
def add_subcommand(self, subparsers): """ Add parser options for this plugin. :param subparsers: argparse subparsers """ raise NotImplementedError()
[ "def", "add_subcommand", "(", "self", ",", "subparsers", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/plugin.py#L17-L23
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/reshape.py
python
_get_unique
(column, dummy_na)
return unique
Returns unique values in a column, if dummy_na is False, nan's are also dropped.
Returns unique values in a column, if dummy_na is False, nan's are also dropped.
[ "Returns", "unique", "values", "in", "a", "column", "if", "dummy_na", "is", "False", "nan", "s", "are", "also", "dropped", "." ]
def _get_unique(column, dummy_na): """ Returns unique values in a column, if dummy_na is False, nan's are also dropped. """ if isinstance(column, cudf.core.column.CategoricalColumn): unique = column.categories else: unique = column.unique() if not dummy_na: if np.issu...
[ "def", "_get_unique", "(", "column", ",", "dummy_na", ")", ":", "if", "isinstance", "(", "column", ",", "cudf", ".", "core", ".", "column", ".", "CategoricalColumn", ")", ":", "unique", "=", "column", ".", "categories", "else", ":", "unique", "=", "colum...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/reshape.py#L1074-L1087
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/third_party/Python/module/pexpect-4.6/pexpect/expect.py
python
searcher_re.__str__
(self)
return '\n'.join(ss)
This returns a human-readable string that represents the state of the object.
This returns a human-readable string that represents the state of the object.
[ "This", "returns", "a", "human", "-", "readable", "string", "that", "represents", "the", "state", "of", "the", "object", "." ]
def __str__(self): '''This returns a human-readable string that represents the state of the object.''' #ss = [(n, ' %d: re.compile("%s")' % # (n, repr(s.pattern))) for n, s in self._searches] ss = list() for n, s in self._searches: ss.append((n, ' %d...
[ "def", "__str__", "(", "self", ")", ":", "#ss = [(n, ' %d: re.compile(\"%s\")' %", "# (n, repr(s.pattern))) for n, s in self._searches]", "ss", "=", "list", "(", ")", "for", "n", ",", "s", "in", "self", ".", "_searches", ":", "ss", ".", "append", "(", "(", ...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/expect.py#L256-L273
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlNode.xpointerNewLocationSetNodes
(self, end)
return xpathObjectRet(ret)
Create a new xmlXPathObjectPtr of type LocationSet and initialize it with the single range made of the two nodes @start and @end
Create a new xmlXPathObjectPtr of type LocationSet and initialize it with the single range made of the two nodes
[ "Create", "a", "new", "xmlXPathObjectPtr", "of", "type", "LocationSet", "and", "initialize", "it", "with", "the", "single", "range", "made", "of", "the", "two", "nodes" ]
def xpointerNewLocationSetNodes(self, end): """Create a new xmlXPathObjectPtr of type LocationSet and initialize it with the single range made of the two nodes @start and @end """ if end is None: end__o = None else: end__o = end._o ret = libxml2mod.xmlXPtrNewLocation...
[ "def", "xpointerNewLocationSetNodes", "(", "self", ",", "end", ")", ":", "if", "end", "is", "None", ":", "end__o", "=", "None", "else", ":", "end__o", "=", "end", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPtrNewLocationSetNodes", "(", "self", ".", "...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L3876-L3884
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/cloud/backend/multiprocessing_helper.py
python
_MultiprocessingWrapper
(queue, memory_share, function, args)
Helper function that sets a memory limit on the current process, then calls |function| on |args| and writes the results to |queue|. Args: queue: (multiprocessing.Queue) Queue where the results of the wrapped function are written. memory_share: (float) Share coefficient of the total physical memo...
Helper function that sets a memory limit on the current process, then calls |function| on |args| and writes the results to |queue|.
[ "Helper", "function", "that", "sets", "a", "memory", "limit", "on", "the", "current", "process", "then", "calls", "|function|", "on", "|args|", "and", "writes", "the", "results", "to", "|queue|", "." ]
def _MultiprocessingWrapper(queue, memory_share, function, args): """Helper function that sets a memory limit on the current process, then calls |function| on |args| and writes the results to |queue|. Args: queue: (multiprocessing.Queue) Queue where the results of the wrapped function are written....
[ "def", "_MultiprocessingWrapper", "(", "queue", ",", "memory_share", ",", "function", ",", "args", ")", ":", "try", ":", "if", "memory_share", ":", "_LimitMemory", "(", "memory_share", ")", "queue", ".", "put", "(", "function", "(", "*", "args", ")", ")", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/cloud/backend/multiprocessing_helper.py#L26-L44
OpenChemistry/tomviz
0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a
acquisition/tomviz/acquisition/vendors/passive/__init__.py
python
PassiveWatchSource.acquisition_params
(self, **params)
Update and fetch the acquisition parameters. :param params: The acquisition parameters. :type params: dict :returns: The current acquisition parameters
Update and fetch the acquisition parameters. :param params: The acquisition parameters. :type params: dict :returns: The current acquisition parameters
[ "Update", "and", "fetch", "the", "acquisition", "parameters", ".", ":", "param", "params", ":", "The", "acquisition", "parameters", ".", ":", "type", "params", ":", "dict", ":", "returns", ":", "The", "current", "acquisition", "parameters" ]
def acquisition_params(self, **params): """ Update and fetch the acquisition parameters. :param params: The acquisition parameters. :type params: dict :returns: The current acquisition parameters """ pass
[ "def", "acquisition_params", "(", "self", ",", "*", "*", "params", ")", ":", "pass" ]
https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/acquisition/tomviz/acquisition/vendors/passive/__init__.py#L214-L221
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
uCSIsMongolian
(code)
return ret
Check whether the character is part of Mongolian UCS Block
Check whether the character is part of Mongolian UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "Mongolian", "UCS", "Block" ]
def uCSIsMongolian(code): """Check whether the character is part of Mongolian UCS Block """ ret = libxml2mod.xmlUCSIsMongolian(code) return ret
[ "def", "uCSIsMongolian", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsMongolian", "(", "code", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2720-L2723
xiaolonw/caffe-video_triplet
c39ea1ad6e937ccf7deba4510b7e555165abf05f
scripts/cpp_lint.py
python
ProcessFile
(filename, vlevel, extra_check_functions=[])
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An array of additional check functions that will be ...
Does google-lint on a single file.
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
def ProcessFile(filename, vlevel, extra_check_functions=[]): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. extra_check_functions: An ar...
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ",", "extra_check_functions", "=", "[", "]", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "try", ":", "# Support the UNIX convention of using \"-\" for stdin. Note that", "# we are not opening the file with universal...
https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/scripts/cpp_lint.py#L4689-L4754
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/tools/clusterfuzz/v8_foozzie.py
python
content_bailout
(content, ignore_fun)
Print failure state and return if ignore_fun matches content.
Print failure state and return if ignore_fun matches content.
[ "Print", "failure", "state", "and", "return", "if", "ignore_fun", "matches", "content", "." ]
def content_bailout(content, ignore_fun): """Print failure state and return if ignore_fun matches content.""" bug = (ignore_fun(content) or '').strip() if bug: raise FailException(FAILURE_HEADER_TEMPLATE % dict( configs='', source_key='', suppression=bug))
[ "def", "content_bailout", "(", "content", ",", "ignore_fun", ")", ":", "bug", "=", "(", "ignore_fun", "(", "content", ")", "or", "''", ")", ".", "strip", "(", ")", "if", "bug", ":", "raise", "FailException", "(", "FAILURE_HEADER_TEMPLATE", "%", "dict", "...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/tools/clusterfuzz/v8_foozzie.py#L316-L321
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_mirror.py
python
Mirror.numericInput
(self, numx, numy, numz)
Validate the entry fields in the user interface. This function is called by the toolbar or taskpanel interface when valid x, y, and z have been entered in the input fields.
Validate the entry fields in the user interface.
[ "Validate", "the", "entry", "fields", "in", "the", "user", "interface", "." ]
def numericInput(self, numx, numy, numz): """Validate the entry fields in the user interface. This function is called by the toolbar or taskpanel interface when valid x, y, and z have been entered in the input fields. """ self.point = App.Vector(numx, numy, numz) if not ...
[ "def", "numericInput", "(", "self", ",", "numx", ",", "numy", ",", "numz", ")", ":", "self", ".", "point", "=", "App", ".", "Vector", "(", "numx", ",", "numy", ",", "numz", ")", "if", "not", "self", ".", "node", ":", "self", ".", "node", ".", "...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_mirror.py#L192-L210
blakesmith/embedded
61d02c8feed34eff75fe64f29cc8997f1c480867
nome/hardware/KiBoM/KiBOM/netlist_reader.py
python
netlist.endDocument
(self)
Called when the netlist document has been fully parsed
Called when the netlist document has been fully parsed
[ "Called", "when", "the", "netlist", "document", "has", "been", "fully", "parsed" ]
def endDocument(self): """Called when the netlist document has been fully parsed""" # When the document is complete, the library parts must be linked to # the components as they are seperate in the tree so as not to # duplicate library part information for every component for c i...
[ "def", "endDocument", "(", "self", ")", ":", "# When the document is complete, the library parts must be linked to", "# the components as they are seperate in the tree so as not to", "# duplicate library part information for every component", "for", "c", "in", "self", ".", "components", ...
https://github.com/blakesmith/embedded/blob/61d02c8feed34eff75fe64f29cc8997f1c480867/nome/hardware/KiBoM/KiBOM/netlist_reader.py#L330-L348
kitao/pyxel
f58bd6fe84153219a1e5edc506ae9606614883dc
pyxel/examples/07_snake.py
python
Snake.update
(self)
Update logic of game. Updates the snake and checks for scoring/win condition.
Update logic of game. Updates the snake and checks for scoring/win condition.
[ "Update", "logic", "of", "game", ".", "Updates", "the", "snake", "and", "checks", "for", "scoring", "/", "win", "condition", "." ]
def update(self): """Update logic of game. Updates the snake and checks for scoring/win condition.""" if not self.death: self.update_direction() self.update_snake() self.check_death() self.check_apple() if pyxel.btn(pyxel.KEY_Q): ...
[ "def", "update", "(", "self", ")", ":", "if", "not", "self", ".", "death", ":", "self", ".", "update_direction", "(", ")", "self", ".", "update_snake", "(", ")", "self", ".", "check_death", "(", ")", "self", ".", "check_apple", "(", ")", "if", "pyxel...
https://github.com/kitao/pyxel/blob/f58bd6fe84153219a1e5edc506ae9606614883dc/pyxel/examples/07_snake.py#L84-L98
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/__init__.py
python
find_on_path
(importer, path_item, only=False)
Yield distributions accessible on a sys.path directory
Yield distributions accessible on a sys.path directory
[ "Yield", "distributions", "accessible", "on", "a", "sys", ".", "path", "directory" ]
def find_on_path(importer, path_item, only=False): """Yield distributions accessible on a sys.path directory""" path_item = _normalize_cached(path_item) if _is_unpacked_egg(path_item): yield Distribution.from_filename( path_item, metadata=PathMetadata( path_item, os.path...
[ "def", "find_on_path", "(", "importer", ",", "path_item", ",", "only", "=", "False", ")", ":", "path_item", "=", "_normalize_cached", "(", "path_item", ")", "if", "_is_unpacked_egg", "(", "path_item", ")", ":", "yield", "Distribution", ".", "from_filename", "(...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/__init__.py#L2046-L2078
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py
python
EnvironmentInfo.return_env
(self, exists=True)
return env
Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. Return ------ dict environment
Return environment dict.
[ "Return", "environment", "dict", "." ]
def return_env(self, exists=True): """ Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. Return ------ dict environment """ env = dict( include=self._build...
[ "def", "return_env", "(", "self", ",", "exists", "=", "True", ")", ":", "env", "=", "dict", "(", "include", "=", "self", ".", "_build_paths", "(", "'include'", ",", "[", "self", ".", "VCIncludes", ",", "self", ".", "OSIncludes", ",", "self", ".", "UC...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py#L1720-L1768
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
DC.SetBackgroundMode
(*args, **kwargs)
return _gdi_.DC_SetBackgroundMode(*args, **kwargs)
SetBackgroundMode(self, int mode) *mode* may be one of ``wx.SOLID`` and ``wx.TRANSPARENT``. This setting determines whether text will be drawn with a background colour or not.
SetBackgroundMode(self, int mode)
[ "SetBackgroundMode", "(", "self", "int", "mode", ")" ]
def SetBackgroundMode(*args, **kwargs): """ SetBackgroundMode(self, int mode) *mode* may be one of ``wx.SOLID`` and ``wx.TRANSPARENT``. This setting determines whether text will be drawn with a background colour or not. """ return _gdi_.DC_SetBackgroundMode(*args...
[ "def", "SetBackgroundMode", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_SetBackgroundMode", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L4046-L4054
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/tensor_shape.py
python
Dimension.__mod__
(self, other)
Returns `self` modulo `other. Dimension moduli are computed as follows: Dimension(m) % Dimension(n) == Dimension(m % n) Dimension(m) % Dimension(None) == Dimension(None) Dimension(None) % Dimension(n) == Dimension(None) Dimension(None) % Dimension(None) == Dimension(None) ...
Returns `self` modulo `other.
[ "Returns", "self", "modulo", "other", "." ]
def __mod__(self, other): """Returns `self` modulo `other. Dimension moduli are computed as follows: Dimension(m) % Dimension(n) == Dimension(m % n) Dimension(m) % Dimension(None) == Dimension(None) Dimension(None) % Dimension(n) == Dimension(None) Dimension(None) % Di...
[ "def", "__mod__", "(", "self", ",", "other", ")", ":", "other", "=", "as_dimension", "(", "other", ")", "if", "self", ".", "_value", "is", "None", "or", "other", ".", "value", "is", "None", ":", "return", "Dimension", "(", "None", ")", "else", ":", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/tensor_shape.py#L247-L267
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/compiler/pyassem.py
python
FlowGraph.getRoot
(self)
return self.entry
Return nodes appropriate for use with dominator
Return nodes appropriate for use with dominator
[ "Return", "nodes", "appropriate", "for", "use", "with", "dominator" ]
def getRoot(self): """Return nodes appropriate for use with dominator""" return self.entry
[ "def", "getRoot", "(", "self", ")", ":", "return", "self", ".", "entry" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/compiler/pyassem.py#L87-L89
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/fuchsia/boot_data.py
python
ProvisionSSH
()
Generates a key pair and config file for SSH using the GN SDK.
Generates a key pair and config file for SSH using the GN SDK.
[ "Generates", "a", "key", "pair", "and", "config", "file", "for", "SSH", "using", "the", "GN", "SDK", "." ]
def ProvisionSSH(): """Generates a key pair and config file for SSH using the GN SDK.""" returncode, out, err = common.RunGnSdkFunction('fuchsia-common.sh', 'check-fuchsia-ssh-config') if returncode != 0: logging.error('Command exited with error code %d' % (re...
[ "def", "ProvisionSSH", "(", ")", ":", "returncode", ",", "out", ",", "err", "=", "common", ".", "RunGnSdkFunction", "(", "'fuchsia-common.sh'", ",", "'check-fuchsia-ssh-config'", ")", "if", "returncode", "!=", "0", ":", "logging", ".", "error", "(", "'Command ...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/fuchsia/boot_data.py#L50-L59
KhronosGroup/SPIR
f33c27876d9f3d5810162b60fa89cc13d2b55725
tools/scan-view/ScanView.py
python
ScanViewRequestHandler.do_POST
(self)
Serve a POST request.
Serve a POST request.
[ "Serve", "a", "POST", "request", "." ]
def do_POST(self): """Serve a POST request.""" try: length = self.headers.getheader('content-length') or "0" try: length = int(length) except: length = 0 content = self.rfile.read(length) fields = parse_query(con...
[ "def", "do_POST", "(", "self", ")", ":", "try", ":", "length", "=", "self", ".", "headers", ".", "getheader", "(", "'content-length'", ")", "or", "\"0\"", "try", ":", "length", "=", "int", "(", "length", ")", "except", ":", "length", "=", "0", "conte...
https://github.com/KhronosGroup/SPIR/blob/f33c27876d9f3d5810162b60fa89cc13d2b55725/tools/scan-view/ScanView.py#L219-L234
emlid/Navio
14b96c83ad57a10580655e3af49c9be1f5fc0ad2
Python/navio/adafruit_ads1x15.py
python
ADS1x15.readADCDifferential
(self, chP=0, chN=1, pga=6144, sps=250)
Gets a differential ADC reading from channels chP and chN in mV. \ The sample rate for this mode (single-shot) can be used to lower the noise \ (low sps) or to lower the power consumption (high sps) by duty cycling, \ see data sheet page 14 for more info. \ The pga must be given in mV, see page 13 for t...
Gets a differential ADC reading from channels chP and chN in mV. \ The sample rate for this mode (single-shot) can be used to lower the noise \ (low sps) or to lower the power consumption (high sps) by duty cycling, \ see data sheet page 14 for more info. \ The pga must be given in mV, see page 13 for t...
[ "Gets", "a", "differential", "ADC", "reading", "from", "channels", "chP", "and", "chN", "in", "mV", ".", "\\", "The", "sample", "rate", "for", "this", "mode", "(", "single", "-", "shot", ")", "can", "be", "used", "to", "lower", "the", "noise", "\\", ...
def readADCDifferential(self, chP=0, chN=1, pga=6144, sps=250): "Gets a differential ADC reading from channels chP and chN in mV. \ The sample rate for this mode (single-shot) can be used to lower the noise \ (low sps) or to lower the power consumption (high sps) by duty cycling, \ see data sheet page 1...
[ "def", "readADCDifferential", "(", "self", ",", "chP", "=", "0", ",", "chN", "=", "1", ",", "pga", "=", "6144", ",", "sps", "=", "250", ")", ":", "# Disable comparator, Non-latching, Alert/Rdy active low", "# traditional comparator, single-shot mode", "config", "=",...
https://github.com/emlid/Navio/blob/14b96c83ad57a10580655e3af49c9be1f5fc0ad2/Python/navio/adafruit_ads1x15.py#L230-L300
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/input_readers.py
python
_ReducerReader.decode_data
(data)
return pickle.loads(base64.b64decode(data))
Decodes data encoded with the encode_data function.
Decodes data encoded with the encode_data function.
[ "Decodes", "data", "encoded", "with", "the", "encode_data", "function", "." ]
def decode_data(data): """Decodes data encoded with the encode_data function.""" return pickle.loads(base64.b64decode(data))
[ "def", "decode_data", "(", "data", ")", ":", "return", "pickle", ".", "loads", "(", "base64", ".", "b64decode", "(", "data", ")", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/input_readers.py#L2689-L2691
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/linalg/decomp.py
python
eigvalsh_tridiagonal
(d, e, select='a', select_range=None, check_finite=True, tol=0., lapack_driver='auto')
return eigh_tridiagonal( d, e, eigvals_only=True, select=select, select_range=select_range, check_finite=check_finite, tol=tol, lapack_driver=lapack_driver)
Solve eigenvalue problem for a real symmetric tridiagonal matrix. Find eigenvalues `w` of ``a``:: a v[:,i] = w[i] v[:,i] v.H v = identity For a real symmetric matrix ``a`` with diagonal elements `d` and off-diagonal elements `e`. Parameters ---------- d : ndarray, shape (n...
Solve eigenvalue problem for a real symmetric tridiagonal matrix.
[ "Solve", "eigenvalue", "problem", "for", "a", "real", "symmetric", "tridiagonal", "matrix", "." ]
def eigvalsh_tridiagonal(d, e, select='a', select_range=None, check_finite=True, tol=0., lapack_driver='auto'): """ Solve eigenvalue problem for a real symmetric tridiagonal matrix. Find eigenvalues `w` of ``a``:: a v[:,i] = w[i] v[:,i] v.H v = identity For...
[ "def", "eigvalsh_tridiagonal", "(", "d", ",", "e", ",", "select", "=", "'a'", ",", "select_range", "=", "None", ",", "check_finite", "=", "True", ",", "tol", "=", "0.", ",", "lapack_driver", "=", "'auto'", ")", ":", "return", "eigh_tridiagonal", "(", "d"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/decomp.py#L956-L1033
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/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/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/wsgiref/util.py#L163-L165
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
hasher-matcher-actioner/hmalib/scripts/cli/soak.py
python
SoakShell.do_latency
(self, arg)
Get the latency of submissions: latency
Get the latency of submissions: latency
[ "Get", "the", "latency", "of", "submissions", ":", "latency" ]
def do_latency(self, arg): "Get the latency of submissions: latency" if self.listener: if data := self.listener.get_submission_latencies(): _, _, latencies = list(zip(*data)) latencies = np.array(latencies[-10:]) if latencies.size: ...
[ "def", "do_latency", "(", "self", ",", "arg", ")", ":", "if", "self", ".", "listener", ":", "if", "data", ":=", "self", ".", "listener", ".", "get_submission_latencies", "(", ")", ":", "_", ",", "_", ",", "latencies", "=", "list", "(", "zip", "(", ...
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/hasher-matcher-actioner/hmalib/scripts/cli/soak.py#L208-L222
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/_datasource.py
python
Repository._fullpath
(self, path)
return result
Return complete path for path. Prepends baseurl if necessary.
Return complete path for path. Prepends baseurl if necessary.
[ "Return", "complete", "path", "for", "path", ".", "Prepends", "baseurl", "if", "necessary", "." ]
def _fullpath(self, path): """Return complete path for path. Prepends baseurl if necessary.""" splitpath = path.split(self._baseurl, 2) if len(splitpath) == 1: result = os.path.join(self._baseurl, path) else: result = path # path contains baseurl already ...
[ "def", "_fullpath", "(", "self", ",", "path", ")", ":", "splitpath", "=", "path", ".", "split", "(", "self", ".", "_baseurl", ",", "2", ")", "if", "len", "(", "splitpath", ")", "==", "1", ":", "result", "=", "os", ".", "path", ".", "join", "(", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/_datasource.py#L545-L552
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/skype.py
python
ISkypeEvents.SmsMessageStatusChanged
(self, Message, Status)
This event is caused by a change in the SMS message status. @param Message: SMS message object. @type Message: L{ISmsMessage} @param Status: New status of the SMS message. @type Status: L{SMS message status<enums.smsMessageStatusUnknown>}
This event is caused by a change in the SMS message status.
[ "This", "event", "is", "caused", "by", "a", "change", "in", "the", "SMS", "message", "status", "." ]
def SmsMessageStatusChanged(self, Message, Status): '''This event is caused by a change in the SMS message status. @param Message: SMS message object. @type Message: L{ISmsMessage} @param Status: New status of the SMS message. @type Status: L{SMS message status<enums.smsMessageS...
[ "def", "SmsMessageStatusChanged", "(", "self", ",", "Message", ",", "Status", ")", ":" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/skype.py#L1639-L1646
redpony/cdec
f7c4899b174d86bc70b40b1cae68dcad364615cb
realtime/rt/rt.py
python
RealtimeTranslator.grammar
(self, sentence, ctx_name=None)
return grammar_file
Extract a sentence-level grammar on demand (or return cached) Threadsafe wrt extractor but NOT decoder. Acquire ctx_name lock before calling.
Extract a sentence-level grammar on demand (or return cached) Threadsafe wrt extractor but NOT decoder. Acquire ctx_name lock before calling.
[ "Extract", "a", "sentence", "-", "level", "grammar", "on", "demand", "(", "or", "return", "cached", ")", "Threadsafe", "wrt", "extractor", "but", "NOT", "decoder", ".", "Acquire", "ctx_name", "lock", "before", "calling", "." ]
def grammar(self, sentence, ctx_name=None): '''Extract a sentence-level grammar on demand (or return cached) Threadsafe wrt extractor but NOT decoder. Acquire ctx_name lock before calling.''' self.extractor_lock.acquire() self.lazy_ctx(ctx_name) grammar_dict = self.gramm...
[ "def", "grammar", "(", "self", ",", "sentence", ",", "ctx_name", "=", "None", ")", ":", "self", ".", "extractor_lock", ".", "acquire", "(", ")", "self", ".", "lazy_ctx", "(", "ctx_name", ")", "grammar_dict", "=", "self", ".", "grammar_dict", "[", "ctx_na...
https://github.com/redpony/cdec/blob/f7c4899b174d86bc70b40b1cae68dcad364615cb/realtime/rt/rt.py#L254-L281
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/generate_compile_expansions.py
python
generate_expansions
()
Entry point for the script. This calls functions to generate version and scons cache expansions and writes them to a file.
Entry point for the script.
[ "Entry", "point", "for", "the", "script", "." ]
def generate_expansions(): """Entry point for the script. This calls functions to generate version and scons cache expansions and writes them to a file. """ args = parse_args() expansions = {} expansions.update(generate_version_expansions(args)) expansions.update(generate_scons_cache_ex...
[ "def", "generate_expansions", "(", ")", ":", "args", "=", "parse_args", "(", ")", "expansions", "=", "{", "}", "expansions", ".", "update", "(", "generate_version_expansions", "(", "args", ")", ")", "expansions", ".", "update", "(", "generate_scons_cache_expansi...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/generate_compile_expansions.py#L20-L33
ArduPilot/ardupilot
6e684b3496122b8158ac412b609d00004b7ac306
Tools/scripts/build_binaries.py
python
build_binaries.skip_board_waf
(self, board)
return True
check if we should skip this build because we do not support the board in this release
check if we should skip this build because we do not support the board in this release
[ "check", "if", "we", "should", "skip", "this", "build", "because", "we", "do", "not", "support", "the", "board", "in", "this", "release" ]
def skip_board_waf(self, board): '''check if we should skip this build because we do not support the board in this release ''' try: out = self.run_program('waf', ['./waf', 'configure', '--board=BOARDTEST'], False) lines = out.split('\n') needles = ["B...
[ "def", "skip_board_waf", "(", "self", ",", "board", ")", ":", "try", ":", "out", "=", "self", ".", "run_program", "(", "'waf'", ",", "[", "'./waf'", ",", "'configure'", ",", "'--board=BOARDTEST'", "]", ",", "False", ")", "lines", "=", "out", ".", "spli...
https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/Tools/scripts/build_binaries.py#L209-L234
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/ndimage/filters.py
python
sobel
(input, axis=-1, output=None, mode="reflect", cval=0.0)
return return_value
Calculate a Sobel filter. Parameters ---------- %(input)s %(axis)s %(output)s %(mode)s %(cval)s Examples -------- >>> from scipy import ndimage, misc >>> import matplotlib.pyplot as plt >>> ascent = misc.ascent() >>> result = ndimage.sobel(ascent) >>> plt.gray()...
Calculate a Sobel filter.
[ "Calculate", "a", "Sobel", "filter", "." ]
def sobel(input, axis=-1, output=None, mode="reflect", cval=0.0): """Calculate a Sobel filter. Parameters ---------- %(input)s %(axis)s %(output)s %(mode)s %(cval)s Examples -------- >>> from scipy import ndimage, misc >>> import matplotlib.pyplot as plt >>> ascent ...
[ "def", "sobel", "(", "input", ",", "axis", "=", "-", "1", ",", "output", "=", "None", ",", "mode", "=", "\"reflect\"", ",", "cval", "=", "0.0", ")", ":", "input", "=", "numpy", ".", "asarray", "(", "input", ")", "axis", "=", "_ni_support", ".", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/ndimage/filters.py#L361-L388
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/descriptor_pool.py
python
DescriptorPool._ConvertEnumDescriptor
(self, enum_proto, package=None, file_desc=None, containing_type=None, scope=None, top_level=False)
return desc
Make a protobuf EnumDescriptor given an EnumDescriptorProto protobuf. Args: enum_proto: The descriptor_pb2.EnumDescriptorProto protobuf message. package: Optional package name for the new message EnumDescriptor. file_desc: The file containing the enum descriptor. containing_type: The type c...
Make a protobuf EnumDescriptor given an EnumDescriptorProto protobuf.
[ "Make", "a", "protobuf", "EnumDescriptor", "given", "an", "EnumDescriptorProto", "protobuf", "." ]
def _ConvertEnumDescriptor(self, enum_proto, package=None, file_desc=None, containing_type=None, scope=None, top_level=False): """Make a protobuf EnumDescriptor given an EnumDescriptorProto protobuf. Args: enum_proto: The descriptor_pb2.EnumDescriptorProto protobuf message. ...
[ "def", "_ConvertEnumDescriptor", "(", "self", ",", "enum_proto", ",", "package", "=", "None", ",", "file_desc", "=", "None", ",", "containing_type", "=", "None", ",", "scope", "=", "None", ",", "top_level", "=", "False", ")", ":", "if", "package", ":", "...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/descriptor_pool.py#L922-L972
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_snapper.py
python
Snapper.setAngle
(self, delta=None)
Keep the current angle.
Keep the current angle.
[ "Keep", "the", "current", "angle", "." ]
def setAngle(self, delta=None): """Keep the current angle.""" if delta: self.mask = delta elif isinstance(self.mask, App.Vector): self.mask = None elif self.trackLine: if self.trackLine.Visible: self.mask = self.trackLine.p2().sub(self....
[ "def", "setAngle", "(", "self", ",", "delta", "=", "None", ")", ":", "if", "delta", ":", "self", ".", "mask", "=", "delta", "elif", "isinstance", "(", "self", ".", "mask", ",", "App", ".", "Vector", ")", ":", "self", ".", "mask", "=", "None", "el...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_snapper.py#L1252-L1260
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/syntax/_inno.py
python
SyntaxData.GetKeywords
(self)
return [SECTION_KW, KEYWORDS, PARAM_KW, PREPROC_KW, PASCAL_KW]
Returns Specified Keywords List
Returns Specified Keywords List
[ "Returns", "Specified", "Keywords", "List" ]
def GetKeywords(self): """Returns Specified Keywords List """ return [SECTION_KW, KEYWORDS, PARAM_KW, PREPROC_KW, PASCAL_KW]
[ "def", "GetKeywords", "(", "self", ")", ":", "return", "[", "SECTION_KW", ",", "KEYWORDS", ",", "PARAM_KW", ",", "PREPROC_KW", ",", "PASCAL_KW", "]" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_inno.py#L129-L131
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/util/utility.py
python
on_windows
()
return False
Returns true if running on windows, whether in cygwin or not.
Returns true if running on windows, whether in cygwin or not.
[ "Returns", "true", "if", "running", "on", "windows", "whether", "in", "cygwin", "or", "not", "." ]
def on_windows (): """ Returns true if running on windows, whether in cygwin or not. """ if bjam.variable("NT"): return True elif bjam.variable("UNIX"): uname = bjam.variable("JAMUNAME") if uname and uname[0].startswith("CYGWIN"): return True return False
[ "def", "on_windows", "(", ")", ":", "if", "bjam", ".", "variable", "(", "\"NT\"", ")", ":", "return", "True", "elif", "bjam", ".", "variable", "(", "\"UNIX\"", ")", ":", "uname", "=", "bjam", ".", "variable", "(", "\"JAMUNAME\"", ")", "if", "uname", ...
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/util/utility.py#L143-L155
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/internal/decoder.py
python
_RaiseInvalidWireType
(buffer, pos, end)
Skip function for unknown wire types. Raises an exception.
Skip function for unknown wire types. Raises an exception.
[ "Skip", "function", "for", "unknown", "wire", "types", ".", "Raises", "an", "exception", "." ]
def _RaiseInvalidWireType(buffer, pos, end): """Skip function for unknown wire types. Raises an exception.""" raise _DecodeError('Tag had invalid wire type.')
[ "def", "_RaiseInvalidWireType", "(", "buffer", ",", "pos", ",", "end", ")", ":", "raise", "_DecodeError", "(", "'Tag had invalid wire type.'", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/internal/decoder.py#L676-L679
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/js2c.py
python
PrepareSources
(source_files, native_type, emit_js)
return result
Read, prepare and assemble the list of source files. Args: source_files: List of JavaScript-ish source files. A file named macros.py will be treated as a list of macros. native_type: String corresponding to a NativeType enum value, allowing us to treat different types of sources differently. ...
Read, prepare and assemble the list of source files.
[ "Read", "prepare", "and", "assemble", "the", "list", "of", "source", "files", "." ]
def PrepareSources(source_files, native_type, emit_js): """Read, prepare and assemble the list of source files. Args: source_files: List of JavaScript-ish source files. A file named macros.py will be treated as a list of macros. native_type: String corresponding to a NativeType enum value, allowing...
[ "def", "PrepareSources", "(", "source_files", ",", "native_type", ",", "emit_js", ")", ":", "macro_file", "=", "None", "macro_files", "=", "filter", "(", "IsMacroFile", ",", "source_files", ")", "assert", "len", "(", "macro_files", ")", "in", "[", "0", ",", ...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/js2c.py#L391-L454
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/generator.py
python
_CppSourceFileWriter.gen_field_list_entry_lookup_methods
(self, field_list)
Generate the definitions for generic argument or reply field lookup methods.
Generate the definitions for generic argument or reply field lookup methods.
[ "Generate", "the", "definitions", "for", "generic", "argument", "or", "reply", "field", "lookup", "methods", "." ]
def gen_field_list_entry_lookup_methods(self, field_list): # type: (ast.FieldListBase) -> None """Generate the definitions for generic argument or reply field lookup methods.""" field_list_info = generic_field_list_types.get_field_list_info(field_list) defn = field_list_info.get_has_fiel...
[ "def", "gen_field_list_entry_lookup_methods", "(", "self", ",", "field_list", ")", ":", "# type: (ast.FieldListBase) -> None", "field_list_info", "=", "generic_field_list_types", ".", "get_field_list_info", "(", "field_list", ")", "defn", "=", "field_list_info", ".", "get_h...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L1555-L1571
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/go/__init__.py
python
Config.add_ldflags
(self, flags)
return self
Add ldflags at the end of current ldflags. :param flags: A list of flags. :type flags: list of str :return: self.
Add ldflags at the end of current ldflags.
[ "Add", "ldflags", "at", "the", "end", "of", "current", "ldflags", "." ]
def add_ldflags(self, flags): """ Add ldflags at the end of current ldflags. :param flags: A list of flags. :type flags: list of str :return: self. """ collections.deque(map(self.__ldflags.add, flags)) return self
[ "def", "add_ldflags", "(", "self", ",", "flags", ")", ":", "collections", ".", "deque", "(", "map", "(", "self", ".", "__ldflags", ".", "add", ",", "flags", ")", ")", "return", "self" ]
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/go/__init__.py#L82-L92
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/gtk/gizmos.py
python
TreeListCtrl.SetColumnText
(*args, **kwargs)
return _gizmos.TreeListCtrl_SetColumnText(*args, **kwargs)
SetColumnText(self, int column, String text)
SetColumnText(self, int column, String text)
[ "SetColumnText", "(", "self", "int", "column", "String", "text", ")" ]
def SetColumnText(*args, **kwargs): """SetColumnText(self, int column, String text)""" return _gizmos.TreeListCtrl_SetColumnText(*args, **kwargs)
[ "def", "SetColumnText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_SetColumnText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L602-L604
RegrowthStudios/SoACode-Public
c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe
utils/git-hooks/cpplint/cpplint.py
python
_IsTestFilename
(filename)
Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise.
Determines if the given filename has a suffix that identifies it as a test.
[ "Determines", "if", "the", "given", "filename", "has", "a", "suffix", "that", "identifies", "it", "as", "a", "test", "." ]
def _IsTestFilename(filename): """Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise. """ if (filename.endswith('_test.cc') or filename.endswith('_unittest.cc') or ...
[ "def", "_IsTestFilename", "(", "filename", ")", ":", "if", "(", "filename", ".", "endswith", "(", "'_test.cc'", ")", "or", "filename", ".", "endswith", "(", "'_unittest.cc'", ")", "or", "filename", ".", "endswith", "(", "'_regtest.cc'", ")", ")", ":", "ret...
https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/cpplint/cpplint.py#L2321-L2335
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_snapper.py
python
Snapper.snapToExtensions
(self, point, last, constrain, eline)
return point,eline
Return a point snapped to extension or parallel line. The parallel line of the last object, if any.
Return a point snapped to extension or parallel line.
[ "Return", "a", "point", "snapped", "to", "extension", "or", "parallel", "line", "." ]
def snapToExtensions(self, point, last, constrain, eline): """Return a point snapped to extension or parallel line. The parallel line of the last object, if any. """ tsnap = self.snapToHold(point) if tsnap: if self.tracker and not self.selectMode: sel...
[ "def", "snapToExtensions", "(", "self", ",", "point", ",", "last", ",", "constrain", ",", "eline", ")", ":", "tsnap", "=", "self", ".", "snapToHold", "(", "point", ")", "if", "tsnap", ":", "if", "self", ".", "tracker", "and", "not", "self", ".", "sel...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_snapper.py#L568-L682
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/concurrent/futures/_base.py
python
as_completed
(fs, timeout=None)
An iterator over the given futures that yields each as it completes. Args: fs: The sequence of Futures (possibly created by different Executors) to iterate over. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. Returns: ...
An iterator over the given futures that yields each as it completes.
[ "An", "iterator", "over", "the", "given", "futures", "that", "yields", "each", "as", "it", "completes", "." ]
def as_completed(fs, timeout=None): """An iterator over the given futures that yields each as it completes. Args: fs: The sequence of Futures (possibly created by different Executors) to iterate over. timeout: The maximum number of seconds to wait. If None, then there is...
[ "def", "as_completed", "(", "fs", ",", "timeout", "=", "None", ")", ":", "if", "timeout", "is", "not", "None", ":", "end_time", "=", "timeout", "+", "time", ".", "monotonic", "(", ")", "fs", "=", "set", "(", "fs", ")", "total_futures", "=", "len", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/concurrent/futures/_base.py#L196-L256
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/metrics_impl.py
python
true_positives
(labels, predictions, weights=None, metrics_collections=None, updates_collections=None, name=None)
Sum the weights of true_positives. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. Args: labels: The ground truth values, a `Tensor` whose dimensions must match `predictions`. Will be cast to `bool`. predictions: The predicted values, a `Tensor` of arbitrary dimensions...
Sum the weights of true_positives.
[ "Sum", "the", "weights", "of", "true_positives", "." ]
def true_positives(labels, predictions, weights=None, metrics_collections=None, updates_collections=None, name=None): """Sum the weights of true_positives. If `weights` is `None`, weights default to 1. Use weights of 0 to mask values. Args: labels: Th...
[ "def", "true_positives", "(", "labels", ",", "predictions", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "with", "variable_scope", ".", "variable_scope", "(",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/metrics_impl.py#L1505-L1547
xiaolonw/caffe-video_triplet
c39ea1ad6e937ccf7deba4510b7e555165abf05f
scripts/cpp_lint.py
python
CleansedLines._CollapseStrings
(elided)
return elided
Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings.
Collapses strings and chars on a line to simple "" or '' blocks.
[ "Collapses", "strings", "and", "chars", "on", "a", "line", "to", "simple", "or", "blocks", "." ]
def _CollapseStrings(elided): """Collapses strings and chars on a line to simple "" or '' blocks. We nix strings first so we're not fooled by text like '"http://"' Args: elided: The line being processed. Returns: The line with collapsed strings. """ if not _RE_PATTERN_INCLUDE.matc...
[ "def", "_CollapseStrings", "(", "elided", ")", ":", "if", "not", "_RE_PATTERN_INCLUDE", ".", "match", "(", "elided", ")", ":", "# Remove escaped characters first to make quote/single quote collapsing", "# basic. Things that look like escaped characters shouldn't occur", "# outside...
https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/scripts/cpp_lint.py#L1209-L1227
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py
python
Set.__isub__
(self, other)
return self
Remove all elements of another set from this set.
Remove all elements of another set from this set.
[ "Remove", "all", "elements", "of", "another", "set", "from", "this", "set", "." ]
def __isub__(self, other): """Remove all elements of another set from this set.""" self._binary_sanity_check(other) self.difference_update(other) return self
[ "def", "__isub__", "(", "self", ",", "other", ")", ":", "self", ".", "_binary_sanity_check", "(", "other", ")", "self", ".", "difference_update", "(", "other", ")", "return", "self" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py#L471-L475
vnpy/vnpy
f50f2535ed39dd33272e0985ed40c7078e4c19f6
vnpy/chart/widget.py
python
ChartWidget._on_key_right
(self)
Move chart to right.
Move chart to right.
[ "Move", "chart", "to", "right", "." ]
def _on_key_right(self) -> None: """ Move chart to right. """ self._right_ix += 1 self._right_ix = min(self._right_ix, self._manager.get_count()) self._update_x_range() self._cursor.move_right() self._cursor.update_info()
[ "def", "_on_key_right", "(", "self", ")", "->", "None", ":", "self", ".", "_right_ix", "+=", "1", "self", ".", "_right_ix", "=", "min", "(", "self", ".", "_right_ix", ",", "self", ".", "_manager", ".", "get_count", "(", ")", ")", "self", ".", "_updat...
https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/chart/widget.py#L266-L275
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py
python
EnumValueDescriptor.__init__
(self, name, index, number, type=None, options=None)
Arguments are as described in the attribute description above.
Arguments are as described in the attribute description above.
[ "Arguments", "are", "as", "described", "in", "the", "attribute", "description", "above", "." ]
def __init__(self, name, index, number, type=None, options=None): """Arguments are as described in the attribute description above.""" super(EnumValueDescriptor, self).__init__(options, 'EnumValueOptions') self.name = name self.index = index self.number = number self.type = type
[ "def", "__init__", "(", "self", ",", "name", ",", "index", ",", "number", ",", "type", "=", "None", ",", "options", "=", "None", ")", ":", "super", "(", "EnumValueDescriptor", ",", "self", ")", ".", "__init__", "(", "options", ",", "'EnumValueOptions'", ...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L473-L479
vgteam/vg
cf4d516a5e9ee5163c783e4437ddf16b18a4b561
vgci/vgci.py
python
VGCITest._test_bakeoff
(self, region, graph, skip_indexing, mapper='map', tag_ext='', misc_opts=None, genotype=False)
Run bakeoff F1 test for NA12878
Run bakeoff F1 test for NA12878
[ "Run", "bakeoff", "F1", "test", "for", "NA12878" ]
def _test_bakeoff(self, region, graph, skip_indexing, mapper='map', tag_ext='', misc_opts=None, genotype=False): """ Run bakeoff F1 test for NA12878 """ assert not tag_ext or tag_ext.startswith('-') tag = '{}-{}{}'.format(region, graph, tag_ext) chrom, offset = self...
[ "def", "_test_bakeoff", "(", "self", ",", "region", ",", "graph", ",", "skip_indexing", ",", "mapper", "=", "'map'", ",", "tag_ext", "=", "''", ",", "misc_opts", "=", "None", ",", "genotype", "=", "False", ")", ":", "assert", "not", "tag_ext", "or", "t...
https://github.com/vgteam/vg/blob/cf4d516a5e9ee5163c783e4437ddf16b18a4b561/vgci/vgci.py#L507-L535
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/docs/pretty_docs.py
python
_build_function_page
(page_info)
return ''.join(parts)
Given a FunctionPageInfo object Return the page as an md string.
Given a FunctionPageInfo object Return the page as an md string.
[ "Given", "a", "FunctionPageInfo", "object", "Return", "the", "page", "as", "an", "md", "string", "." ]
def _build_function_page(page_info): """Given a FunctionPageInfo object Return the page as an md string.""" parts = ['# %s\n\n' % page_info.full_name] if len(page_info.aliases) > 1: parts.append('### Aliases:\n\n') parts.extend('* `%s`\n' % name for name in page_info.aliases) parts.append('\n') if...
[ "def", "_build_function_page", "(", "page_info", ")", ":", "parts", "=", "[", "'# %s\\n\\n'", "%", "page_info", ".", "full_name", "]", "if", "len", "(", "page_info", ".", "aliases", ")", ">", "1", ":", "parts", ".", "append", "(", "'### Aliases:\\n\\n'", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/docs/pretty_docs.py#L58-L79
mickem/nscp
79f89fdbb6da63f91bc9dedb7aea202fe938f237
scripts/python/lib/google/protobuf/internal/containers.py
python
RepeatedCompositeFieldContainer.__delitem__
(self, key)
Deletes the item at the specified position.
Deletes the item at the specified position.
[ "Deletes", "the", "item", "at", "the", "specified", "position", "." ]
def __delitem__(self, key): """Deletes the item at the specified position.""" del self._values[key] self._message_listener.Modified()
[ "def", "__delitem__", "(", "self", ",", "key", ")", ":", "del", "self", ".", "_values", "[", "key", "]", "self", ".", "_message_listener", ".", "Modified", "(", ")" ]
https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/internal/containers.py#L242-L245
vtraag/leidenalg
b53366829360e10922a2dbf57eb405a516c23bc9
src/leidenalg/Optimiser.py
python
Optimiser.consider_comms
(self)
return _c_leiden._Optimiser_get_consider_comms(self._optimiser)
Determine how alternative communities are considered for moving a node for *optimising* a partition. Nodes will only move to alternative communities that improve the given quality function. Notes ------- This attribute should be set to one of the following values * :attr:`leidenalg.ALL_NE...
Determine how alternative communities are considered for moving a node for *optimising* a partition.
[ "Determine", "how", "alternative", "communities", "are", "considered", "for", "moving", "a", "node", "for", "*", "optimising", "*", "a", "partition", "." ]
def consider_comms(self): """ Determine how alternative communities are considered for moving a node for *optimising* a partition. Nodes will only move to alternative communities that improve the given quality function. Notes ------- This attribute should be set to one of the following val...
[ "def", "consider_comms", "(", "self", ")", ":", "return", "_c_leiden", ".", "_Optimiser_get_consider_comms", "(", "self", ".", "_optimiser", ")" ]
https://github.com/vtraag/leidenalg/blob/b53366829360e10922a2dbf57eb405a516c23bc9/src/leidenalg/Optimiser.py#L78-L106
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGridPopulator.Add
(*args, **kwargs)
return _propgrid.PropertyGridPopulator_Add(*args, **kwargs)
Add(self, String propClass, String propLabel, String propName, String propValue, PGChoices pChoices=None) -> PGProperty
Add(self, String propClass, String propLabel, String propName, String propValue, PGChoices pChoices=None) -> PGProperty
[ "Add", "(", "self", "String", "propClass", "String", "propLabel", "String", "propName", "String", "propValue", "PGChoices", "pChoices", "=", "None", ")", "-", ">", "PGProperty" ]
def Add(*args, **kwargs): """ Add(self, String propClass, String propLabel, String propName, String propValue, PGChoices pChoices=None) -> PGProperty """ return _propgrid.PropertyGridPopulator_Add(*args, **kwargs)
[ "def", "Add", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridPopulator_Add", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2585-L2590
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ppapi/native_client/src/tools/srpcgen.py
python
CountName
(name)
return '%s_bytes' % name
Returns the name of the auxiliary count member used for array typed.
Returns the name of the auxiliary count member used for array typed.
[ "Returns", "the", "name", "of", "the", "auxiliary", "count", "member", "used", "for", "array", "typed", "." ]
def CountName(name): """Returns the name of the auxiliary count member used for array typed.""" return '%s_bytes' % name
[ "def", "CountName", "(", "name", ")", ":", "return", "'%s_bytes'", "%", "name" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/native_client/src/tools/srpcgen.py#L127-L129
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/agents/baseline_controller/locomotion_controller_example.py
python
_run_example
(max_time=_MAX_TIME_SECONDS, run_on_robot=False, use_keyboard=False)
Runs the locomotion controller example.
Runs the locomotion controller example.
[ "Runs", "the", "locomotion", "controller", "example", "." ]
def _run_example(max_time=_MAX_TIME_SECONDS, run_on_robot=False, use_keyboard=False): """Runs the locomotion controller example.""" if use_keyboard: kb = keyboard_utils.KeyboardInput() env = env_loader.load() env.reset() # To mitigate jittering from the python gc.coll...
[ "def", "_run_example", "(", "max_time", "=", "_MAX_TIME_SECONDS", ",", "run_on_robot", "=", "False", ",", "use_keyboard", "=", "False", ")", ":", "if", "use_keyboard", ":", "kb", "=", "keyboard_utils", ".", "KeyboardInput", "(", ")", "env", "=", "env_loader", ...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/agents/baseline_controller/locomotion_controller_example.py#L108-L179
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/create/pile.py
python
xy_jiggle
(world,objects,fixed_objects,bmin,bmax,iters,randomize=True, verbose=0)
return removed
Jiggles the objects' x-y positions within the range bmin - bmax, and randomizes orientation about the z axis until the objects are collision free. A list of fixed objects (fixed_objects) may be given as well. Objects for which collision-free resolutions are not found are returned.
Jiggles the objects' x-y positions within the range bmin - bmax, and randomizes orientation about the z axis until the objects are collision free. A list of fixed objects (fixed_objects) may be given as well.
[ "Jiggles", "the", "objects", "x", "-", "y", "positions", "within", "the", "range", "bmin", "-", "bmax", "and", "randomizes", "orientation", "about", "the", "z", "axis", "until", "the", "objects", "are", "collision", "free", ".", "A", "list", "of", "fixed",...
def xy_jiggle(world,objects,fixed_objects,bmin,bmax,iters,randomize=True, verbose=0): """Jiggles the objects' x-y positions within the range bmin - bmax, and randomizes orientation about the z axis until the objects are collision free. A list of fixed objects (fixed_objects) may be given as well. Obje...
[ "def", "xy_jiggle", "(", "world", ",", "objects", ",", "fixed_objects", ",", "bmin", ",", "bmax", ",", "iters", ",", "randomize", "=", "True", ",", "verbose", "=", "0", ")", ":", "if", "randomize", ":", "for", "obj", "in", "objects", ":", "xy_randomize...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/create/pile.py#L36-L97
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/parsers/XmlTopologyParser.py
python
XmlTopologyParser.get_connections
(self)
return self.__connections
Returns a topology object.
Returns a topology object.
[ "Returns", "a", "topology", "object", "." ]
def get_connections(self): """ Returns a topology object. """ return self.__connections
[ "def", "get_connections", "(", "self", ")", ":", "return", "self", ".", "__connections" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/parsers/XmlTopologyParser.py#L346-L350
rbgirshick/caffe-fast-rcnn
28a579eaf0668850705598b3075b8969f22226d9
python/caffe/pycaffe.py
python
_Net_forward
(self, blobs=None, start=None, end=None, **kwargs)
return {out: self.blobs[out].data for out in outputs}
Forward pass: prepare inputs and run the net forward. Parameters ---------- blobs : list of blobs to return in addition to output blobs. kwargs : Keys are input blob names and values are blob ndarrays. For formatting inputs for Caffe, see Net.preprocess(). If None, input is ta...
Forward pass: prepare inputs and run the net forward.
[ "Forward", "pass", ":", "prepare", "inputs", "and", "run", "the", "net", "forward", "." ]
def _Net_forward(self, blobs=None, start=None, end=None, **kwargs): """ Forward pass: prepare inputs and run the net forward. Parameters ---------- blobs : list of blobs to return in addition to output blobs. kwargs : Keys are input blob names and values are blob ndarrays. For form...
[ "def", "_Net_forward", "(", "self", ",", "blobs", "=", "None", ",", "start", "=", "None", ",", "end", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "blobs", "is", "None", ":", "blobs", "=", "[", "]", "if", "start", "is", "not", "None", ...
https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/python/caffe/pycaffe.py#L52-L98
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
shell/impala_client.py
python
ImpalaClient.get_column_names
(self, last_query_handle)
Get a list of column names for the query. The query must have a result set.
Get a list of column names for the query. The query must have a result set.
[ "Get", "a", "list", "of", "column", "names", "for", "the", "query", ".", "The", "query", "must", "have", "a", "result", "set", "." ]
def get_column_names(self, last_query_handle): """Get a list of column names for the query. The query must have a result set.""" raise NotImplementedError()
[ "def", "get_column_names", "(", "self", ",", "last_query_handle", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/impala_client.py#L279-L281
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/email/_policybase.py
python
Policy.register_defect
(self, obj, defect)
Record 'defect' on 'obj'. Called by handle_defect if raise_on_defect is False. This method is part of the Policy API so that Policy subclasses can implement custom defect handling. The default implementation calls the append method of the defects attribute of obj. The objects used by...
Record 'defect' on 'obj'.
[ "Record", "defect", "on", "obj", "." ]
def register_defect(self, obj, defect): """Record 'defect' on 'obj'. Called by handle_defect if raise_on_defect is False. This method is part of the Policy API so that Policy subclasses can implement custom defect handling. The default implementation calls the append method of ...
[ "def", "register_defect", "(", "self", ",", "obj", ",", "defect", ")", ":", "obj", ".", "defects", ".", "append", "(", "defect", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/_policybase.py#L188-L199
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
example/rcnn/rcnn/pycocotools/coco.py
python
COCO.loadImgs
(self, ids=[])
Load anns with the specified ids. :param ids (int array) : integer ids specifying img :return: imgs (object array) : loaded img objects
Load anns with the specified ids. :param ids (int array) : integer ids specifying img :return: imgs (object array) : loaded img objects
[ "Load", "anns", "with", "the", "specified", "ids", ".", ":", "param", "ids", "(", "int", "array", ")", ":", "integer", "ids", "specifying", "img", ":", "return", ":", "imgs", "(", "object", "array", ")", ":", "loaded", "img", "objects" ]
def loadImgs(self, ids=[]): """ Load anns with the specified ids. :param ids (int array) : integer ids specifying img :return: imgs (object array) : loaded img objects """ if type(ids) == list: return [self.imgs[id] for id in ids] elif type(ids) ...
[ "def", "loadImgs", "(", "self", ",", "ids", "=", "[", "]", ")", ":", "if", "type", "(", "ids", ")", "==", "list", ":", "return", "[", "self", ".", "imgs", "[", "id", "]", "for", "id", "in", "ids", "]", "elif", "type", "(", "ids", ")", "==", ...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/pycocotools/coco.py#L234-L243
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozpack/copier.py
python
FileRegistry.required_directories
(self)
return set(k for k, v in self._required_directories.items() if v > 0)
Return the set of directories required by the paths in the container, in no particular order. The returned directories are relative to an unspecified (virtual) root directory (and do not include said root directory).
Return the set of directories required by the paths in the container, in no particular order. The returned directories are relative to an unspecified (virtual) root directory (and do not include said root directory).
[ "Return", "the", "set", "of", "directories", "required", "by", "the", "paths", "in", "the", "container", "in", "no", "particular", "order", ".", "The", "returned", "directories", "are", "relative", "to", "an", "unspecified", "(", "virtual", ")", "root", "dir...
def required_directories(self): ''' Return the set of directories required by the paths in the container, in no particular order. The returned directories are relative to an unspecified (virtual) root directory (and do not include said root directory). ''' return...
[ "def", "required_directories", "(", "self", ")", ":", "return", "set", "(", "k", "for", "k", ",", "v", "in", "self", ".", "_required_directories", ".", "items", "(", ")", "if", "v", ">", "0", ")" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/copier.py#L137-L144
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/xgettext.py
python
exists
(env)
Check, whether the tool exists
Check, whether the tool exists
[ "Check", "whether", "the", "tool", "exists" ]
def exists(env): """ Check, whether the tool exists """ from SCons.Tool.GettextCommon import _xgettext_exists try: return _xgettext_exists(env) except: return False
[ "def", "exists", "(", "env", ")", ":", "from", "SCons", ".", "Tool", ".", "GettextCommon", "import", "_xgettext_exists", "try", ":", "return", "_xgettext_exists", "(", "env", ")", "except", ":", "return", "False" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/xgettext.py#L326-L332
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/pytree.py
python
NegatedPattern.__init__
(self, content=None)
Initializer. The argument is either a pattern or None. If it is None, this only matches an empty sequence (effectively '$' in regex lingo). If it is not None, this matches whenever the argument pattern doesn't have any matches.
Initializer.
[ "Initializer", "." ]
def __init__(self, content=None): """ Initializer. The argument is either a pattern or None. If it is None, this only matches an empty sequence (effectively '$' in regex lingo). If it is not None, this matches whenever the argument pattern doesn't have any matches. ...
[ "def", "__init__", "(", "self", ",", "content", "=", "None", ")", ":", "if", "content", "is", "not", "None", ":", "assert", "isinstance", "(", "content", ",", "BasePattern", ")", ",", "repr", "(", "content", ")", "self", ".", "content", "=", "content" ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/pytree.py#L829-L840
LLNL/lbann
26083e6c86050302ce33148aea70f62e61cacb92
applications/physics/cosmology/cosmoflow/cosmoflow.py
python
create_cosmoflow_data_reader
( train_path, val_path, test_path, num_responses)
return lbann.reader_pb2.DataReader(reader=readers)
Create a data reader for CosmoFlow. Args: {train, val, test}_path (str): Path to the corresponding dataset. num_responses (int): The number of parameters to predict.
Create a data reader for CosmoFlow.
[ "Create", "a", "data", "reader", "for", "CosmoFlow", "." ]
def create_cosmoflow_data_reader( train_path, val_path, test_path, num_responses): """Create a data reader for CosmoFlow. Args: {train, val, test}_path (str): Path to the corresponding dataset. num_responses (int): The number of parameters to predict. """ reader_args = [ ...
[ "def", "create_cosmoflow_data_reader", "(", "train_path", ",", "val_path", ",", "test_path", ",", "num_responses", ")", ":", "reader_args", "=", "[", "{", "\"role\"", ":", "\"train\"", ",", "\"data_filename\"", ":", "train_path", "}", ",", "{", "\"role\"", ":", ...
https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/applications/physics/cosmology/cosmoflow/cosmoflow.py#L229-L267
H-uru/Plasma
c2140ea046e82e9c199e257a7f2e7edb42602871
Scripts/Python/nb01RPSGame.py
python
nb01RPSGame._OnRPSChoice
(self, state, which, events)
We picked a thingo!
We picked a thingo!
[ "We", "picked", "a", "thingo!" ]
def _OnRPSChoice(self, state, which, events): """We picked a thingo!""" if PtWasLocallyNotified(self.key): self._round_played = True if self.sceneobject.isLocallyOwned(): avatar = PtFindAvatar(events) seat = self.players.index(PtGetClientIDFromAvatarKey(avatar...
[ "def", "_OnRPSChoice", "(", "self", ",", "state", ",", "which", ",", "events", ")", ":", "if", "PtWasLocallyNotified", "(", "self", ".", "key", ")", ":", "self", ".", "_round_played", "=", "True", "if", "self", ".", "sceneobject", ".", "isLocallyOwned", ...
https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/nb01RPSGame.py#L453-L463
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
python
XCConfigurationList.AppendBuildSetting
(self, key, value)
Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects.
Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects.
[ "Appends", "value", "to", "the", "build", "setting", "for", "key", "which", "is", "treated", "as", "a", "list", "in", "all", "child", "XCBuildConfiguration", "objects", "." ]
def AppendBuildSetting(self, key, value): """Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects. """ for configuration in self._properties['buildConfigurations']: configuration.AppendBuildSetting(key, value)
[ "def", "AppendBuildSetting", "(", "self", ",", "key", ",", "value", ")", ":", "for", "configuration", "in", "self", ".", "_properties", "[", "'buildConfigurations'", "]", ":", "configuration", ".", "AppendBuildSetting", "(", "key", ",", "value", ")" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py#L1680-L1686
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TIntV.AddBackSorted
(self, *args)
return _snap.TIntV_AddBackSorted(self, *args)
AddBackSorted(TIntV self, TInt Val, bool const & Asc) -> int Parameters: Val: TInt const & Asc: bool const &
AddBackSorted(TIntV self, TInt Val, bool const & Asc) -> int
[ "AddBackSorted", "(", "TIntV", "self", "TInt", "Val", "bool", "const", "&", "Asc", ")", "-", ">", "int" ]
def AddBackSorted(self, *args): """ AddBackSorted(TIntV self, TInt Val, bool const & Asc) -> int Parameters: Val: TInt const & Asc: bool const & """ return _snap.TIntV_AddBackSorted(self, *args)
[ "def", "AddBackSorted", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TIntV_AddBackSorted", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L15716-L15725
wujian16/Cornell-MOE
df299d1be882d2af9796d7a68b3f9505cac7a53e
moe/optimal_learning/python/repeated_domain.py
python
RepeatedDomain.get_constraint_list
(self)
return constraints
Return a list of lambda functions expressing the domain bounds as linear constraints. Used by COBYLA. Calls ``self._domain.get_constraint_list()`` for each repeat, writing the results sequentially. So output[0:2*dim] is from the first repeated domain, output[2*dim:4*dim] is from the second, etc. ...
Return a list of lambda functions expressing the domain bounds as linear constraints. Used by COBYLA.
[ "Return", "a", "list", "of", "lambda", "functions", "expressing", "the", "domain", "bounds", "as", "linear", "constraints", ".", "Used", "by", "COBYLA", "." ]
def get_constraint_list(self): """Return a list of lambda functions expressing the domain bounds as linear constraints. Used by COBYLA. Calls ``self._domain.get_constraint_list()`` for each repeat, writing the results sequentially. So output[0:2*dim] is from the first repeated domain, output[2*...
[ "def", "get_constraint_list", "(", "self", ")", ":", "constraints", "=", "[", "]", "for", "i", "in", "range", "(", "self", ".", "num_repeats", ")", ":", "# Using start_index, start each domain at the correct index when flattening out points in COBYLA.", "constraints", "."...
https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/repeated_domain.py#L83-L97
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/filelist.py
python
FileList.debug_print
(self, msg)
Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true.
Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true.
[ "Print", "msg", "to", "stdout", "if", "the", "global", "DEBUG", "(", "taken", "from", "the", "DISTUTILS_DEBUG", "environment", "variable", ")", "flag", "is", "true", "." ]
def debug_print(self, msg): """Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. """ from distutils.debug import DEBUG if DEBUG: print(msg)
[ "def", "debug_print", "(", "self", ",", "msg", ")", ":", "from", "distutils", ".", "debug", "import", "DEBUG", "if", "DEBUG", ":", "print", "(", "msg", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/filelist.py#L41-L47
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/lib/format.py
python
write_array_header_2_0
(fp, d)
Write the header for an array using the 2.0 format. The 2.0 format allows storing very large structured arrays. .. versionadded:: 1.9.0 Parameters ---------- fp : filelike object d : dict This has the appropriate entries for writing its string representation to the header o...
Write the header for an array using the 2.0 format. The 2.0 format allows storing very large structured arrays.
[ "Write", "the", "header", "for", "an", "array", "using", "the", "2", ".", "0", "format", ".", "The", "2", ".", "0", "format", "allows", "storing", "very", "large", "structured", "arrays", "." ]
def write_array_header_2_0(fp, d): """ Write the header for an array using the 2.0 format. The 2.0 format allows storing very large structured arrays. .. versionadded:: 1.9.0 Parameters ---------- fp : filelike object d : dict This has the appropriate entries for writing its st...
[ "def", "write_array_header_2_0", "(", "fp", ",", "d", ")", ":", "_write_array_header", "(", "fp", ",", "d", ",", "(", "2", ",", "0", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/format.py#L455-L468
carla-simulator/carla
8854804f4d7748e14d937ec763a2912823a7e5f5
Co-Simulation/Sumo/sumo_integration/bridge_helper.py
python
BridgeHelper.get_carla_traffic_light_state
(sumo_tl_state)
Returns carla traffic light state based on sumo traffic light state.
Returns carla traffic light state based on sumo traffic light state.
[ "Returns", "carla", "traffic", "light", "state", "based", "on", "sumo", "traffic", "light", "state", "." ]
def get_carla_traffic_light_state(sumo_tl_state): """ Returns carla traffic light state based on sumo traffic light state. """ if sumo_tl_state == SumoSignalState.RED or sumo_tl_state == SumoSignalState.RED_YELLOW: return carla.TrafficLightState.Red elif sumo_tl_stat...
[ "def", "get_carla_traffic_light_state", "(", "sumo_tl_state", ")", ":", "if", "sumo_tl_state", "==", "SumoSignalState", ".", "RED", "or", "sumo_tl_state", "==", "SumoSignalState", ".", "RED_YELLOW", ":", "return", "carla", ".", "TrafficLightState", ".", "Red", "elif...
https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/Co-Simulation/Sumo/sumo_integration/bridge_helper.py#L334-L352
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Diffraction/isis_powder/routines/common.py
python
generate_run_numbers
(run_number_string)
return run_list
Generates a list of run numbers as a list from the input. This input can be either a string or int type and uses the same syntax that Mantid supports i.e. 1-10 generates 1,2,3...9,10 inclusive and commas can specify breaks between runs :param run_number_string: The string or int to convert into a list of ru...
Generates a list of run numbers as a list from the input. This input can be either a string or int type and uses the same syntax that Mantid supports i.e. 1-10 generates 1,2,3...9,10 inclusive and commas can specify breaks between runs :param run_number_string: The string or int to convert into a list of ru...
[ "Generates", "a", "list", "of", "run", "numbers", "as", "a", "list", "from", "the", "input", ".", "This", "input", "can", "be", "either", "a", "string", "or", "int", "type", "and", "uses", "the", "same", "syntax", "that", "Mantid", "supports", "i", "."...
def generate_run_numbers(run_number_string): """ Generates a list of run numbers as a list from the input. This input can be either a string or int type and uses the same syntax that Mantid supports i.e. 1-10 generates 1,2,3...9,10 inclusive and commas can specify breaks between runs :param run_numb...
[ "def", "generate_run_numbers", "(", "run_number_string", ")", ":", "# Check its not a single run", "if", "isinstance", "(", "run_number_string", ",", "int", ")", ":", "# Cast into a list and return", "return", "[", "run_number_string", "]", "elif", "isinstance", "(", "r...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Diffraction/isis_powder/routines/common.py#L182-L202
OPAE/opae-sdk
221124343c8275243a249eb72d69e0ea2d568d1b
binaries/qpafilter/qpafilter.py
python
temp_verifier.verify_units
(self, units)
return units in [DEGREES_C, DEGREES_c]
Temperature units must be degrees C.
Temperature units must be degrees C.
[ "Temperature", "units", "must", "be", "degrees", "C", "." ]
def verify_units(self, units): """Temperature units must be degrees C.""" return units in [DEGREES_C, DEGREES_c]
[ "def", "verify_units", "(", "self", ",", "units", ")", ":", "return", "units", "in", "[", "DEGREES_C", ",", "DEGREES_c", "]" ]
https://github.com/OPAE/opae-sdk/blob/221124343c8275243a249eb72d69e0ea2d568d1b/binaries/qpafilter/qpafilter.py#L232-L234
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/minimum-time-visiting-all-points.py
python
Solution.minTimeToVisitAllPoints
(self, points)
return sum(max(abs(points[i+1][0] - points[i][0]), abs(points[i+1][1] - points[i][1])) for i in xrange(len(points)-1))
:type points: List[List[int]] :rtype: int
:type points: List[List[int]] :rtype: int
[ ":", "type", "points", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def minTimeToVisitAllPoints(self, points): """ :type points: List[List[int]] :rtype: int """ return sum(max(abs(points[i+1][0] - points[i][0]), abs(points[i+1][1] - points[i][1])) for i in xrange(len(points)-1))
[ "def", "minTimeToVisitAllPoints", "(", "self", ",", "points", ")", ":", "return", "sum", "(", "max", "(", "abs", "(", "points", "[", "i", "+", "1", "]", "[", "0", "]", "-", "points", "[", "i", "]", "[", "0", "]", ")", ",", "abs", "(", "points",...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-time-visiting-all-points.py#L5-L12
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewCtrl.PrependIconTextColumn
(*args, **kwargs)
return _dataview.DataViewCtrl_PrependIconTextColumn(*args, **kwargs)
PrependIconTextColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=-1, int align=ALIGN_NOT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
PrependIconTextColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=-1, int align=ALIGN_NOT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
[ "PrependIconTextColumn", "(", "self", "PyObject", "label_or_bitmap", "unsigned", "int", "model_column", "int", "mode", "=", "DATAVIEW_CELL_INERT", "int", "width", "=", "-", "1", "int", "align", "=", "ALIGN_NOT", "int", "flags", "=", "DATAVIEW_COL_RESIZABLE", ")", ...
def PrependIconTextColumn(*args, **kwargs): """ PrependIconTextColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=-1, int align=ALIGN_NOT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn """ return _data...
[ "def", "PrependIconTextColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewCtrl_PrependIconTextColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1597-L1603
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mimetypes.py
python
MimeTypes.readfp
(self, fp, strict=True)
Read a single mime.types-format file. If strict is true, information will be added to list of standard types, else to the list of non-standard types.
Read a single mime.types-format file.
[ "Read", "a", "single", "mime", ".", "types", "-", "format", "file", "." ]
def readfp(self, fp, strict=True): """ Read a single mime.types-format file. If strict is true, information will be added to list of standard types, else to the list of non-standard types. """ while 1: line = fp.readline() if not line: ...
[ "def", "readfp", "(", "self", ",", "fp", ",", "strict", "=", "True", ")", ":", "while", "1", ":", "line", "=", "fp", ".", "readline", "(", ")", "if", "not", "line", ":", "break", "words", "=", "line", ".", "split", "(", ")", "for", "i", "in", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mimetypes.py#L205-L226
reverbrain/elliptics
4b4f9b8094d7616c1ec50eb8605edb059b9f228e
recovery/elliptics_recovery/dc_server_send.py
python
ServerSendRecovery._on_server_send_timeout
(self, keys, key_infos_map, group_id)
@keys - is a list of keys that were not recovered due to timeout. Moves keys to next bucket, if appropriate bucket meta is identical to current meta, because less relevant replica (e.g. with older timestamp) should not be used for recovery due to temporary unavailability of relevant replica duri...
[]
def _on_server_send_timeout(self, keys, key_infos_map, group_id): ''' @keys - is a list of keys that were not recovered due to timeout. Moves keys to next bucket, if appropriate bucket meta is identical to current meta, because less relevant replica (e.g. with older timestamp) should not...
[ "def", "_on_server_send_timeout", "(", "self", ",", "keys", ",", "key_infos_map", ",", "group_id", ")", ":", "same_meta", "=", "lambda", "lhs", ",", "rhs", ":", "(", "lhs", ".", "timestamp", ",", "lhs", ".", "size", ",", "lhs", ".", "user_flags", ")", ...
https://github.com/reverbrain/elliptics/blob/4b4f9b8094d7616c1ec50eb8605edb059b9f228e/recovery/elliptics_recovery/dc_server_send.py#L231-L253
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/mcnp.py
python
SurfSrc.read_header
(self)
Read in the header block data. This block comprises 4 fortran records which we refer to as: header, table1, table2, summary.
Read in the header block data. This block comprises 4 fortran records which we refer to as: header, table1, table2, summary.
[ "Read", "in", "the", "header", "block", "data", ".", "This", "block", "comprises", "4", "fortran", "records", "which", "we", "refer", "to", "as", ":", "header", "table1", "table2", "summary", "." ]
def read_header(self): """Read in the header block data. This block comprises 4 fortran records which we refer to as: header, table1, table2, summary. """ # read header record header = self.get_fortran_record() # interpret header self.kod = header.get_string(8)[...
[ "def", "read_header", "(", "self", ")", ":", "# read header record", "header", "=", "self", ".", "get_fortran_record", "(", ")", "# interpret header", "self", ".", "kod", "=", "header", ".", "get_string", "(", "8", ")", "[", "0", "]", "# code identifier", "i...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/mcnp.py#L325-L449
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/pyfakefs/pyfakefs/fake_filesystem.py
python
FakeFilesystem.Exists
(self, file_path)
return True
True if a path points to an existing file system object. Args: file_path: path to examine Returns: bool(if object exists) Raises: TypeError: if file_path is None
True if a path points to an existing file system object.
[ "True", "if", "a", "path", "points", "to", "an", "existing", "file", "system", "object", "." ]
def Exists(self, file_path): """True if a path points to an existing file system object. Args: file_path: path to examine Returns: bool(if object exists) Raises: TypeError: if file_path is None """ if file_path is None: raise TypeError if not file_path: retu...
[ "def", "Exists", "(", "self", ",", "file_path", ")", ":", "if", "file_path", "is", "None", ":", "raise", "TypeError", "if", "not", "file_path", ":", "return", "False", "try", ":", "file_path", "=", "self", ".", "ResolvePath", "(", "file_path", ")", "exce...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L587-L615
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
cmake/developer_package/cpplint/cpplint.py
python
_CppLintState.SetOutputFormat
(self, output_format)
Sets the output format for errors.
Sets the output format for errors.
[ "Sets", "the", "output", "format", "for", "errors", "." ]
def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format
[ "def", "SetOutputFormat", "(", "self", ",", "output_format", ")", ":", "self", ".", "output_format", "=", "output_format" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L1030-L1032
tensorflow/minigo
6d89c202cdceaf449aefc3149ab2110d44f1a6a4
bigtable_input.py
python
GameQueue.count_moves_in_game_range
(self, game_begin, game_end)
return sum([int(r.cell_value(METADATA, MOVE_COUNT)) for r in rows])
Count the total moves in a game range. Args: game_begin: integer, starting game game_end: integer, ending game Uses the `ct_` keyspace for rapid move summary.
Count the total moves in a game range.
[ "Count", "the", "total", "moves", "in", "a", "game", "range", "." ]
def count_moves_in_game_range(self, game_begin, game_end): """Count the total moves in a game range. Args: game_begin: integer, starting game game_end: integer, ending game Uses the `ct_` keyspace for rapid move summary. """ rows = self.bt_table.read_rows(...
[ "def", "count_moves_in_game_range", "(", "self", ",", "game_begin", ",", "game_end", ")", ":", "rows", "=", "self", ".", "bt_table", ".", "read_rows", "(", "ROWCOUNT_PREFIX", ".", "format", "(", "game_begin", ")", ",", "ROWCOUNT_PREFIX", ".", "format", "(", ...
https://github.com/tensorflow/minigo/blob/6d89c202cdceaf449aefc3149ab2110d44f1a6a4/bigtable_input.py#L467-L481
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
adodbapi/adodbapi.py
python
Cursor.get_returned_parameters
(self)
return retLst
with some providers, returned parameters and the .return_value are not available until after the last recordset has been read. In that case, you must coll nextset() until it returns None, then call this method to get your returned information.
with some providers, returned parameters and the .return_value are not available until after the last recordset has been read. In that case, you must coll nextset() until it returns None, then call this method to get your returned information.
[ "with", "some", "providers", "returned", "parameters", "and", "the", ".", "return_value", "are", "not", "available", "until", "after", "the", "last", "recordset", "has", "been", "read", ".", "In", "that", "case", "you", "must", "coll", "nextset", "()", "unti...
def get_returned_parameters(self): """with some providers, returned parameters and the .return_value are not available until after the last recordset has been read. In that case, you must coll nextset() until it returns None, then call this method to get your returned information.""" r...
[ "def", "get_returned_parameters", "(", "self", ")", ":", "retLst", "=", "(", "[", "]", ")", "# store procedures may return altered parameters, including an added \"return value\" item", "for", "p", "in", "tuple", "(", "self", ".", "cmd", ".", "Parameters", ")", ":", ...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/adodbapi/adodbapi.py#L817-L848
apache/incubator-weex
5c25f0b59f7ac90703c363e7261f60bd06356dbe
weex_core/tools/cpplint.py
python
NestingState.Update
(self, filename, clean_lines, linenum, error)
Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Update nesting state with current line.
[ "Update", "nesting", "state", "with", "current", "line", "." ]
def Update(self, filename, clean_lines, linenum, error): """Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any err...
[ "def", "Update", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Remember top of the previous nesting stack.", "#", "# The stack is always pushed/popped and no...
https://github.com/apache/incubator-weex/blob/5c25f0b59f7ac90703c363e7261f60bd06356dbe/weex_core/tools/cpplint.py#L2582-L2744
yun-liu/RCF
91bfb054ad04187dbbe21e539e165ad9bd3ff00b
scripts/cpp_lint.py
python
IsBlankLine
(line)
return not line or line.isspace()
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
Returns true if the given line is blank.
[ "Returns", "true", "if", "the", "given", "line", "is", "blank", "." ]
def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace()
[ "def", "IsBlankLine", "(", "line", ")", ":", "return", "not", "line", "or", "line", ".", "isspace", "(", ")" ]
https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L2369-L2381
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/rpc/requests.py
python
write_record
(file_path, records, objector)
return None, res.status
write records to file path with objector
write records to file path with objector
[ "write", "records", "to", "file", "path", "with", "objector" ]
def write_record(file_path, records, objector): """ write records to file path with objector """ request = service_pb2.WriteLocalSeqFileRequest() request.file_path = file_path for record in records: request.key.append("") request.value.append(objector.serialize(record)) resp...
[ "def", "write_record", "(", "file_path", ",", "records", ",", "objector", ")", ":", "request", "=", "service_pb2", ".", "WriteLocalSeqFileRequest", "(", ")", "request", ".", "file_path", "=", "file_path", "for", "record", "in", "records", ":", "request", ".", ...
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/rpc/requests.py#L206-L221
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py
python
_DNNLinearCombinedBaseEstimator._get_target_column
(self)
return self._target_column
Returns the target column of this Estimator.
Returns the target column of this Estimator.
[ "Returns", "the", "target", "column", "of", "this", "Estimator", "." ]
def _get_target_column(self): """Returns the target column of this Estimator.""" return self._target_column
[ "def", "_get_target_column", "(", "self", ")", ":", "return", "self", ".", "_target_column" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py#L197-L199
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py
python
SourceLoader._cache_bytecode
(self, source_path, cache_path, data)
return self.set_data(cache_path, data)
Optional method which writes data (bytes) to a file path (a str). Implementing this method allows for the writing of bytecode files. The source path is needed in order to correctly transfer permissions
Optional method which writes data (bytes) to a file path (a str).
[ "Optional", "method", "which", "writes", "data", "(", "bytes", ")", "to", "a", "file", "path", "(", "a", "str", ")", "." ]
def _cache_bytecode(self, source_path, cache_path, data): """Optional method which writes data (bytes) to a file path (a str). Implementing this method allows for the writing of bytecode files. The source path is needed in order to correctly transfer permissions """ # For backw...
[ "def", "_cache_bytecode", "(", "self", ",", "source_path", ",", "cache_path", ",", "data", ")", ":", "# For backwards compatibility, we delegate to set_data()", "return", "self", ".", "set_data", "(", "cache_path", ",", "data", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py#L758-L766
apache/parquet-cpp
642da055adf009652689b20e68a198cffb857651
build-support/cpplint.py
python
CheckPrintf
(filename, clean_lines, linenum, error)
Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check for printf related issues.
[ "Check", "for", "printf", "related", "issues", "." ]
def CheckPrintf(filename, clean_lines, linenum, error): """Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ l...
[ "def", "CheckPrintf", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# When snprintf is used, the second argument shouldn't be a literal.", "match", "=", "Search", "(", "r...
https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L4971-L4997
raspberrypi/tools
13474ee775d0c5ec8a7da4fb0a9fa84187abfc87
arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/command/frame_filters.py
python
DisableFrameFilter.complete
(self, text, word)
Completion function for both frame filter dictionary, and frame filter name.
Completion function for both frame filter dictionary, and frame filter name.
[ "Completion", "function", "for", "both", "frame", "filter", "dictionary", "and", "frame", "filter", "name", "." ]
def complete(self, text, word): """Completion function for both frame filter dictionary, and frame filter name.""" if text.count(" ") == 0: return _complete_frame_filter_list(text, word, True) else: printer_list = gdb.frames.return_list(text.split()[0].rstrip()) ...
[ "def", "complete", "(", "self", ",", "text", ",", "word", ")", ":", "if", "text", ".", "count", "(", "\" \"", ")", "==", "0", ":", "return", "_complete_frame_filter_list", "(", "text", ",", "word", ",", "True", ")", "else", ":", "printer_list", "=", ...
https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/command/frame_filters.py#L270-L277
jubatus/jubatus
1251ce551bac980488a6313728e72b3fe0b79a9f
tools/codestyle/cpplint/cpplint.py
python
_Filters
()
return _cpplint_state.filters
Returns the module's list of output filters, as a list.
Returns the module's list of output filters, as a list.
[ "Returns", "the", "module", "s", "list", "of", "output", "filters", "as", "a", "list", "." ]
def _Filters(): """Returns the module's list of output filters, as a list.""" return _cpplint_state.filters
[ "def", "_Filters", "(", ")", ":", "return", "_cpplint_state", ".", "filters" ]
https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/tools/codestyle/cpplint/cpplint.py#L611-L613
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/HeppyCore/python/utils/das.py
python
get_data
(host, query, idx, limit, debug)
return data
Contact DAS server and retrieve data for given DAS query
Contact DAS server and retrieve data for given DAS query
[ "Contact", "DAS", "server", "and", "retrieve", "data", "for", "given", "DAS", "query" ]
def get_data(host, query, idx, limit, debug): """Contact DAS server and retrieve data for given DAS query""" params = {'input':query, 'idx':idx, 'limit':limit} path = '/das/cache' pat = re.compile('http[s]{0,1}://') if not pat.match(host): msg = 'Invalid hostname: %s' % host ...
[ "def", "get_data", "(", "host", ",", "query", ",", "idx", ",", "limit", ",", "debug", ")", ":", "params", "=", "{", "'input'", ":", "query", ",", "'idx'", ":", "idx", ",", "'limit'", ":", "limit", "}", "path", "=", "'/das/cache'", "pat", "=", "re",...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/HeppyCore/python/utils/das.py#L71-L121
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/codecs.py
python
StreamReader.read
(self, size=-1, chars=-1, firstline=False)
return result
Decodes data from the stream self.stream and returns the resulting object. chars indicates the number of characters to read from the stream. read() will never return more than chars characters, but it might return less, if there are not enough characters avai...
Decodes data from the stream self.stream and returns the resulting object.
[ "Decodes", "data", "from", "the", "stream", "self", ".", "stream", "and", "returns", "the", "resulting", "object", "." ]
def read(self, size=-1, chars=-1, firstline=False): """ Decodes data from the stream self.stream and returns the resulting object. chars indicates the number of characters to read from the stream. read() will never return more than chars characters, but it might...
[ "def", "read", "(", "self", ",", "size", "=", "-", "1", ",", "chars", "=", "-", "1", ",", "firstline", "=", "False", ")", ":", "# If we have lines cached, first merge them back into characters", "if", "self", ".", "linebuffer", ":", "self", ".", "charbuffer", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/codecs.py#L424-L501
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/petro/modelling.py
python
JointPetroInversion.setData
(self, data)
TODO.
TODO.
[ "TODO", "." ]
def setData(self, data): """TODO.""" if isinstance(data, list): if len(data) == len(self.managers): self.tD.clear() self.dataVals.clear() self.dataErrs.clear() self.fop.setData(data) for i, mgr in enumerate(sel...
[ "def", "setData", "(", "self", ",", "data", ")", ":", "if", "isinstance", "(", "data", ",", "list", ")", ":", "if", "len", "(", "data", ")", "==", "len", "(", "self", ".", "managers", ")", ":", "self", ".", "tD", ".", "clear", "(", ")", "self",...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/petro/modelling.py#L166-L194
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/PythonAnalysis/python/rootplot/root2matplotlib.py
python
Hist.errorbar
(self, xerr=False, yerr=False, label_rotation=0, label_alignment='center', **kwargs)
return errorbar
Generate a matplotlib errorbar figure. All additional keyword arguments will be passed to :func:`matplotlib.pyplot.errorbar`.
Generate a matplotlib errorbar figure.
[ "Generate", "a", "matplotlib", "errorbar", "figure", "." ]
def errorbar(self, xerr=False, yerr=False, label_rotation=0, label_alignment='center', **kwargs): """ Generate a matplotlib errorbar figure. All additional keyword arguments will be passed to :func:`matplotlib.pyplot.errorbar`. """ if xerr: k...
[ "def", "errorbar", "(", "self", ",", "xerr", "=", "False", ",", "yerr", "=", "False", ",", "label_rotation", "=", "0", ",", "label_alignment", "=", "'center'", ",", "*", "*", "kwargs", ")", ":", "if", "xerr", ":", "kwargs", "[", "'xerr'", "]", "=", ...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/PythonAnalysis/python/rootplot/root2matplotlib.py#L154-L171
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/pipeline/sync/skip/skippable.py
python
Skippable.dispatch
( self, input, handle_stash: Callable[[str, Optional[Tensor]], None], handle_pop: Callable[[str], Optional[Tensor]], )
Dispatches :class:`stash` or :class:`pop` commands generated by the module's ``forward()``.
Dispatches :class:`stash` or :class:`pop` commands generated by the module's ``forward()``.
[ "Dispatches", ":", "class", ":", "stash", "or", ":", "class", ":", "pop", "commands", "generated", "by", "the", "module", "s", "forward", "()", "." ]
def dispatch( self, input, handle_stash: Callable[[str, Optional[Tensor]], None], handle_pop: Callable[[str], Optional[Tensor]], ): """Dispatches :class:`stash` or :class:`pop` commands generated by the module's ``forward()``. """ generator = self.modu...
[ "def", "dispatch", "(", "self", ",", "input", ",", "handle_stash", ":", "Callable", "[", "[", "str", ",", "Optional", "[", "Tensor", "]", "]", ",", "None", "]", ",", "handle_pop", ":", "Callable", "[", "[", "str", "]", ",", "Optional", "[", "Tensor",...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/pipeline/sync/skip/skippable.py#L146-L180
dogecoin/dogecoin
31afd133119dd2e15862d46530cb99424cf564b0
contrib/devtools/symbol-check.py
python
read_symbols
(executable, imports=True)
return syms
Parse an ELF executable and return a list of (symbol,version) tuples for dynamic, imported symbols.
Parse an ELF executable and return a list of (symbol,version) tuples for dynamic, imported symbols.
[ "Parse", "an", "ELF", "executable", "and", "return", "a", "list", "of", "(", "symbol", "version", ")", "tuples", "for", "dynamic", "imported", "symbols", "." ]
def read_symbols(executable, imports=True): ''' Parse an ELF executable and return a list of (symbol,version) tuples for dynamic, imported symbols. ''' p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) (stdo...
[ "def", "read_symbols", "(", "executable", ",", "imports", "=", "True", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "[", "READELF_CMD", ",", "'--dyn-syms'", ",", "'-W'", ",", "executable", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", ...
https://github.com/dogecoin/dogecoin/blob/31afd133119dd2e15862d46530cb99424cf564b0/contrib/devtools/symbol-check.py#L97-L116
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/cli/debugger_cli_common.py
python
TabCompletionRegistry.remove_comp_items
(self, context_word, comp_items)
Remove a list of completion items from a completion context. Args: context_word: A single completion word as a string. The removal will also apply to all other context words of the same context. comp_items: Completion items to remove. Raises: KeyError: if the context word has not bee...
Remove a list of completion items from a completion context.
[ "Remove", "a", "list", "of", "completion", "items", "from", "a", "completion", "context", "." ]
def remove_comp_items(self, context_word, comp_items): """Remove a list of completion items from a completion context. Args: context_word: A single completion word as a string. The removal will also apply to all other context words of the same context. comp_items: Completion items to remove...
[ "def", "remove_comp_items", "(", "self", ",", "context_word", ",", "comp_items", ")", ":", "if", "context_word", "not", "in", "self", ".", "_comp_dict", ":", "raise", "KeyError", "(", "\"Context word \\\"%s\\\" has not been registered\"", "%", "context_word", ")", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/debugger_cli_common.py#L932-L949