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
codilime/veles
e65de5a7c268129acffcdb03034efd8d256d025c
python/veles/schema/fields.py
python
Field.cpp_type
(self)
this function should return tuple containing three elements first - C++ type name corresponding to this field second - True if this type is POD or False if it should be wrapped in smart pointer third - default value
this function should return tuple containing three elements
[ "this", "function", "should", "return", "tuple", "containing", "three", "elements" ]
def cpp_type(self): """this function should return tuple containing three elements first - C++ type name corresponding to this field second - True if this type is POD or False if it should be wrapped in smart pointer third - default value """ raise NotImplemente...
[ "def", "cpp_type", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/codilime/veles/blob/e65de5a7c268129acffcdb03034efd8d256d025c/python/veles/schema/fields.py#L81-L89
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py
python
ParseExpression.leaveWhitespace
( self )
return self
Extends ``leaveWhitespace`` defined in base class, and also invokes ``leaveWhitespace`` on all contained expressions.
Extends ``leaveWhitespace`` defined in base class, and also invokes ``leaveWhitespace`` on all contained expressions.
[ "Extends", "leaveWhitespace", "defined", "in", "base", "class", "and", "also", "invokes", "leaveWhitespace", "on", "all", "contained", "expressions", "." ]
def leaveWhitespace( self ): """Extends ``leaveWhitespace`` defined in base class, and also invokes ``leaveWhitespace`` on all contained expressions.""" self.skipWhitespace = False self.exprs = [ e.copy() for e in self.exprs ] for e in self.exprs: e.leaveWhitespace...
[ "def", "leaveWhitespace", "(", "self", ")", ":", "self", ".", "skipWhitespace", "=", "False", "self", ".", "exprs", "=", "[", "e", ".", "copy", "(", ")", "for", "e", "in", "self", ".", "exprs", "]", "for", "e", "in", "self", ".", "exprs", ":", "e...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py#L3586-L3593
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py
python
ParserElement.leaveWhitespace
( self )
return self
Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars.
[]
def leaveWhitespace( self ): """ Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. """ ...
[ "def", "leaveWhitespace", "(", "self", ")", ":", "self", ".", "skipWhitespace", "=", "False", "return", "self" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L4103-L4117
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/python_message.py
python
_IsPresent
(item)
Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().
Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().
[ "Given", "a", "(", "FieldDescriptor", "value", ")", "tuple", "from", "_fields", "return", "true", "if", "the", "value", "should", "be", "included", "in", "the", "list", "returned", "by", "ListFields", "()", "." ]
def _IsPresent(item): """Given a (FieldDescriptor, value) tuple from _fields, return true if the value should be included in the list returned by ListFields().""" if item[0].label == _FieldDescriptor.LABEL_REPEATED: return bool(item[1]) elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE: return ...
[ "def", "_IsPresent", "(", "item", ")", ":", "if", "item", "[", "0", "]", ".", "label", "==", "_FieldDescriptor", ".", "LABEL_REPEATED", ":", "return", "bool", "(", "item", "[", "1", "]", ")", "elif", "item", "[", "0", "]", ".", "cpp_type", "==", "_...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/python_message.py#L806-L815
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/resmokelib/utils/globstar.py
python
iglob
(globbed_pathname)
Emit a list of pathnames matching the 'globbed_pathname' pattern. In addition to containing simple shell-style wildcards a la fnmatch, the pattern may also contain globstars ("**"), which is recursively expanded to match zero or more subdirectories.
Emit a list of pathnames matching the 'globbed_pathname' pattern.
[ "Emit", "a", "list", "of", "pathnames", "matching", "the", "globbed_pathname", "pattern", "." ]
def iglob(globbed_pathname): """ Emit a list of pathnames matching the 'globbed_pathname' pattern. In addition to containing simple shell-style wildcards a la fnmatch, the pattern may also contain globstars ("**"), which is recursively expanded to match zero or more subdirectories. """ par...
[ "def", "iglob", "(", "globbed_pathname", ")", ":", "parts", "=", "_split_path", "(", "globbed_pathname", ")", "parts", "=", "_canonicalize", "(", "parts", ")", "index", "=", "_find_globstar", "(", "parts", ")", "if", "index", "==", "-", "1", ":", "for", ...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/resmokelib/utils/globstar.py#L38-L79
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/MooseDocs/extensions/template.py
python
TemplateExtension.initPage
(self, page)
Initialize page with Extension settings.
Initialize page with Extension settings.
[ "Initialize", "page", "with", "Extension", "settings", "." ]
def initPage(self, page): """Initialize page with Extension settings.""" self.initConfig(page, 'args') page['dependencies'] = set()
[ "def", "initPage", "(", "self", ",", "page", ")", ":", "self", ".", "initConfig", "(", "page", ",", "'args'", ")", "page", "[", "'dependencies'", "]", "=", "set", "(", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/template.py#L58-L61
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
PlatformInformation.GetEndianness
(*args, **kwargs)
return _misc_.PlatformInformation_GetEndianness(*args, **kwargs)
GetEndianness(self) -> int
GetEndianness(self) -> int
[ "GetEndianness", "(", "self", ")", "-", ">", "int" ]
def GetEndianness(*args, **kwargs): """GetEndianness(self) -> int""" return _misc_.PlatformInformation_GetEndianness(*args, **kwargs)
[ "def", "GetEndianness", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "PlatformInformation_GetEndianness", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L1105-L1107
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/psk_constellations.py
python
sd_psk_4_0x1_1_0
(x, Es=1)
return [dist * x_re, -dist * x_im]
| 00 | 10 | ------- | 01 | 11
| 00 | 10 | ------- | 01 | 11
[ "|", "00", "|", "10", "|", "-------", "|", "01", "|", "11" ]
def sd_psk_4_0x1_1_0(x, Es=1): ''' | 00 | 10 | ------- | 01 | 11 ''' x_re = x.real x_im = x.imag dist = Es * numpy.sqrt(2) return [dist * x_re, -dist * x_im]
[ "def", "sd_psk_4_0x1_1_0", "(", "x", ",", "Es", "=", "1", ")", ":", "x_re", "=", "x", ".", "real", "x_im", "=", "x", ".", "imag", "dist", "=", "Es", "*", "numpy", ".", "sqrt", "(", "2", ")", "return", "[", "dist", "*", "x_re", ",", "-", "dist...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/psk_constellations.py#L308-L317
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/tpu_feed.py
python
_PartitionedInfeedQueue._check_input_partition_dims
(self, tensor, dims)
Checks that input partition dims are valid for the `Tensor`. Args: tensor: Input tensor for partitioning. dims: A list of integer describes how to partition the input tensor. Raises: ValueError: If the tensor can't be partitioned by dims or the num_cores_per_replica doesn't match the...
Checks that input partition dims are valid for the `Tensor`.
[ "Checks", "that", "input", "partition", "dims", "are", "valid", "for", "the", "Tensor", "." ]
def _check_input_partition_dims(self, tensor, dims): """Checks that input partition dims are valid for the `Tensor`. Args: tensor: Input tensor for partitioning. dims: A list of integer describes how to partition the input tensor. Raises: ValueError: If the tensor can't be partitioned by...
[ "def", "_check_input_partition_dims", "(", "self", ",", "tensor", ",", "dims", ")", ":", "# No partitioning specified, so don't perform further checks.", "if", "dims", "is", "None", ":", "return", "dims", "=", "np", ".", "array", "(", "dims", ")", "if", "(", "di...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/tpu_feed.py#L884-L920
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
uCSIsTibetan
(code)
return ret
Check whether the character is part of Tibetan UCS Block
Check whether the character is part of Tibetan UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "Tibetan", "UCS", "Block" ]
def uCSIsTibetan(code): """Check whether the character is part of Tibetan UCS Block """ ret = libxml2mod.xmlUCSIsTibetan(code) return ret
[ "def", "uCSIsTibetan", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsTibetan", "(", "code", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2903-L2906
haiku/haiku
e51f545c9024f85687abf5e67e34093504eb05f0
src/add-ons/kernel/drivers/disk/virtual/nbd/nbd-server.py
python
serveclient
(asock, afile)
Serves a single client until it exits.
Serves a single client until it exits.
[ "Serves", "a", "single", "client", "until", "it", "exits", "." ]
def serveclient(asock, afile): "Serves a single client until it exits." afile.seek(0) abuf = list(afile.read()) asock.send(negotiation(len(abuf))) while 1: req = nbd_request(asock) if req.type == read_request: asock.send(req.reply(error=0, data=''.join(ab...
[ "def", "serveclient", "(", "asock", ",", "afile", ")", ":", "afile", ".", "seek", "(", "0", ")", "abuf", "=", "list", "(", "afile", ".", "read", "(", ")", ")", "asock", ".", "send", "(", "negotiation", "(", "len", "(", "abuf", ")", ")", ")", "w...
https://github.com/haiku/haiku/blob/e51f545c9024f85687abf5e67e34093504eb05f0/src/add-ons/kernel/drivers/disk/virtual/nbd/nbd-server.py#L100-L118
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/protocols/avr8protocol.py
python
Avr8Protocol.software_breakpoint_clear
(self, address)
Removes a software breakpoint from the given address :param address: breakpoint address
Removes a software breakpoint from the given address
[ "Removes", "a", "software", "breakpoint", "from", "the", "given", "address" ]
def software_breakpoint_clear(self, address): """ Removes a software breakpoint from the given address :param address: breakpoint address """ self.logger.debug("Clear SWBP") self.check_response(self.jtagice3_command_response( bytearray([self.CMD_AVR8_SW_BREAK...
[ "def", "software_breakpoint_clear", "(", "self", ",", "address", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Clear SWBP\"", ")", "self", ".", "check_response", "(", "self", ".", "jtagice3_command_response", "(", "bytearray", "(", "[", "self", ".", ...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/protocols/avr8protocol.py#L468-L476
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/layers/normalization.py
python
_smart_select
(pred, fn_then, fn_else)
return array_ops.squeeze(result, [0])
Selects fn_then() or fn_else() based on the value of pred. The purpose of this function is the same as `utils.smart_cond`. However, at the moment there is a bug (b/36297356) that seems to kick in only when `smart_cond` delegates to `tf.cond`, which sometimes results in the training hanging when using parameter...
Selects fn_then() or fn_else() based on the value of pred.
[ "Selects", "fn_then", "()", "or", "fn_else", "()", "based", "on", "the", "value", "of", "pred", "." ]
def _smart_select(pred, fn_then, fn_else): """Selects fn_then() or fn_else() based on the value of pred. The purpose of this function is the same as `utils.smart_cond`. However, at the moment there is a bug (b/36297356) that seems to kick in only when `smart_cond` delegates to `tf.cond`, which sometimes result...
[ "def", "_smart_select", "(", "pred", ",", "fn_then", ",", "fn_else", ")", ":", "pred_value", "=", "utils", ".", "constant_value", "(", "pred", ")", "if", "pred_value", ":", "return", "fn_then", "(", ")", "elif", "pred_value", "is", "False", ":", "return", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/layers/normalization.py#L540-L570
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
TextAttrDimensionConverter.GetPixels
(*args, **kwargs)
return _richtext.TextAttrDimensionConverter_GetPixels(*args, **kwargs)
GetPixels(self, TextAttrDimension dim, int direction=HORIZONTAL) -> int
GetPixels(self, TextAttrDimension dim, int direction=HORIZONTAL) -> int
[ "GetPixels", "(", "self", "TextAttrDimension", "dim", "int", "direction", "=", "HORIZONTAL", ")", "-", ">", "int" ]
def GetPixels(*args, **kwargs): """GetPixels(self, TextAttrDimension dim, int direction=HORIZONTAL) -> int""" return _richtext.TextAttrDimensionConverter_GetPixels(*args, **kwargs)
[ "def", "GetPixels", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "TextAttrDimensionConverter_GetPixels", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L270-L272
limbo018/DREAMPlace
146c3b9fd003d1acd52c96d9fd02e3f0a05154e4
dreamplace/PlaceObj.py
python
PlaceObj.update_gamma
(self, iteration, overflow, base_gamma)
return True
@brief update gamma in wirelength model @param iteration optimization step @param overflow evaluated in current step @param base_gamma base gamma
[]
def update_gamma(self, iteration, overflow, base_gamma): """ @brief update gamma in wirelength model @param iteration optimization step @param overflow evaluated in current step @param base_gamma base gamma """ ### overflow can have multiple values for fence regio...
[ "def", "update_gamma", "(", "self", ",", "iteration", ",", "overflow", ",", "base_gamma", ")", ":", "### overflow can have multiple values for fence regions, use their weighted average based on movable node number", "if", "overflow", ".", "numel", "(", ")", "==", "1", ":", ...
https://github.com/limbo018/DREAMPlace/blob/146c3b9fd003d1acd52c96d9fd02e3f0a05154e4/dreamplace/PlaceObj.py#L883-L897
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tree.py
python
TreeItem.SetText
(self, text)
Change the item's text (if it is editable).
Change the item's text (if it is editable).
[ "Change", "the", "item", "s", "text", "(", "if", "it", "is", "editable", ")", "." ]
def SetText(self, text): """Change the item's text (if it is editable)."""
[ "def", "SetText", "(", "self", ",", "text", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tree.py#L375-L376
ducha-aiki/LSUVinit
a42ecdc0d44c217a29b65e98748d80b90d5c6279
examples/web_demo/app.py
python
start_from_terminal
(app)
Parse command line options and start the server.
Parse command line options and start the server.
[ "Parse", "command", "line", "options", "and", "start", "the", "server", "." ]
def start_from_terminal(app): """ Parse command line options and start the server. """ parser = optparse.OptionParser() parser.add_option( '-d', '--debug', help="enable debug mode", action="store_true", default=False) parser.add_option( '-p', '--port', hel...
[ "def", "start_from_terminal", "(", "app", ")", ":", "parser", "=", "optparse", ".", "OptionParser", "(", ")", "parser", ".", "add_option", "(", "'-d'", ",", "'--debug'", ",", "help", "=", "\"enable debug mode\"", ",", "action", "=", "\"store_true\"", ",", "d...
https://github.com/ducha-aiki/LSUVinit/blob/a42ecdc0d44c217a29b65e98748d80b90d5c6279/examples/web_demo/app.py#L192-L220
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/cr/cr/actions/builder.py
python
Builder.Rebuild
(self, targets, arguments)
Make a target build even if it is up to date. Default implementation is to do a Clean and Build sequence. Do not call the base version if you implement a more efficient one.
Make a target build even if it is up to date.
[ "Make", "a", "target", "build", "even", "if", "it", "is", "up", "to", "date", "." ]
def Rebuild(self, targets, arguments): """Make a target build even if it is up to date. Default implementation is to do a Clean and Build sequence. Do not call the base version if you implement a more efficient one. """ self.Clean(targets, []) self.Build(targets, arguments)
[ "def", "Rebuild", "(", "self", ",", "targets", ",", "arguments", ")", ":", "self", ".", "Clean", "(", "targets", ",", "[", "]", ")", "self", ".", "Build", "(", "targets", ",", "arguments", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cr/cr/actions/builder.py#L38-L45
christinaa/LLVM-VideoCore4
7773c3c9e5d22b785d4b96ed0acea37c8aa9c183
utils/lit/lit/util.py
python
capture
(args, env=None)
return out
capture(command) - Run the given command (or argv list) in a shell and return the standard output.
capture(command) - Run the given command (or argv list) in a shell and return the standard output.
[ "capture", "(", "command", ")", "-", "Run", "the", "given", "command", "(", "or", "argv", "list", ")", "in", "a", "shell", "and", "return", "the", "standard", "output", "." ]
def capture(args, env=None): """capture(command) - Run the given command (or argv list) in a shell and return the standard output.""" p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) out,_ = p.communicate() return out
[ "def", "capture", "(", "args", ",", "env", "=", "None", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "args", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE", ",", "env", "=", "env", ")", "out", ...
https://github.com/christinaa/LLVM-VideoCore4/blob/7773c3c9e5d22b785d4b96ed0acea37c8aa9c183/utils/lit/lit/util.py#L48-L54
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/scipy/utils.py
python
_callable_const
(x)
return isinstance(x, typing.Function)
Returns true if x is a function in graph mode.
Returns true if x is a function in graph mode.
[ "Returns", "true", "if", "x", "is", "a", "function", "in", "graph", "mode", "." ]
def _callable_const(x): """Returns true if x is a function in graph mode.""" return isinstance(x, typing.Function)
[ "def", "_callable_const", "(", "x", ")", ":", "return", "isinstance", "(", "x", ",", "typing", ".", "Function", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/scipy/utils.py#L114-L116
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
configure.py
python
configure_ios
(environ_cp)
Configures TensorFlow for iOS builds.
Configures TensorFlow for iOS builds.
[ "Configures", "TensorFlow", "for", "iOS", "builds", "." ]
def configure_ios(environ_cp): """Configures TensorFlow for iOS builds.""" if not is_macos(): return if not get_var(environ_cp, 'TF_CONFIGURE_IOS', 'iOS', False): return for filepath in APPLE_BAZEL_FILES: existing_filepath = os.path.join(_TF_WORKSPACE_ROOT, filepath + '.apple') renamed_filepath ...
[ "def", "configure_ios", "(", "environ_cp", ")", ":", "if", "not", "is_macos", "(", ")", ":", "return", "if", "not", "get_var", "(", "environ_cp", ",", "'TF_CONFIGURE_IOS'", ",", "'iOS'", ",", "False", ")", ":", "return", "for", "filepath", "in", "APPLE_BAZ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/configure.py#L1204-L1217
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/display.py
python
Javascript.__init__
(self, data=None, url=None, filename=None, lib=None, css=None)
Create a Javascript display object given raw data. When this object is returned by an expression or passed to the display function, it will result in the data being displayed in the frontend. If the data is a URL, the data will first be downloaded and then displayed. In the Not...
Create a Javascript display object given raw data.
[ "Create", "a", "Javascript", "display", "object", "given", "raw", "data", "." ]
def __init__(self, data=None, url=None, filename=None, lib=None, css=None): """Create a Javascript display object given raw data. When this object is returned by an expression or passed to the display function, it will result in the data being displayed in the frontend. If the data is a...
[ "def", "__init__", "(", "self", ",", "data", "=", "None", ",", "url", "=", "None", ",", "filename", "=", "None", ",", "lib", "=", "None", ",", "css", "=", "None", ")", ":", "if", "isinstance", "(", "lib", ",", "string_types", ")", ":", "lib", "="...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/display.py#L841-L885
tkn-tub/ns3-gym
19bfe0a583e641142609939a090a09dfc63a095f
bindings/python/rad_util.py
python
lcm
(a, b, precision=None)
return result
Return the least common multiple of a and b, using the gcf function. Arguments: a, b -- two numbers. If both are integers return an integer result, otherwise a return a float result. precision -- scaling factor if a and/or b are floats. >>> lcm(21, 6) 42 >>> lcm(2.5, 3.5) 17....
Return the least common multiple of a and b, using the gcf function.
[ "Return", "the", "least", "common", "multiple", "of", "a", "and", "b", "using", "the", "gcf", "function", "." ]
def lcm(a, b, precision=None): """Return the least common multiple of a and b, using the gcf function. Arguments: a, b -- two numbers. If both are integers return an integer result, otherwise a return a float result. precision -- scaling factor if a and/or b are floats. >>> lcm(21, 6)...
[ "def", "lcm", "(", "a", ",", "b", ",", "precision", "=", "None", ")", ":", "# Note: Dummy precision argument is for backwards compatibility.", "# Do the division first.", "# (See http://en.wikipedia.org/wiki/Least_common_multiple )", "denom", "=", "gcf", "(", "a", ",", "b",...
https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/bindings/python/rad_util.py#L260-L290
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/aetools.py
python
TalkTo._set
(self, _object, _attributes={}, **_arguments)
set: Set an object's data. Required argument: the object for the command Keyword argument to: The new value. Keyword argument _attributes: AppleEvent attribute dictionary
set: Set an object's data. Required argument: the object for the command Keyword argument to: The new value. Keyword argument _attributes: AppleEvent attribute dictionary
[ "set", ":", "Set", "an", "object", "s", "data", ".", "Required", "argument", ":", "the", "object", "for", "the", "command", "Keyword", "argument", "to", ":", "The", "new", "value", ".", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", ...
def _set(self, _object, _attributes={}, **_arguments): """set: Set an object's data. Required argument: the object for the command Keyword argument to: The new value. Keyword argument _attributes: AppleEvent attribute dictionary """ _code = 'core' _subcode = 'setd...
[ "def", "_set", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'core'", "_subcode", "=", "'setd'", "keysubst", "(", "_arguments", ",", "self", ".", "_argmap_set", ")", "_arguments", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/aetools.py#L269-L288
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/linear_model/logistic.py
python
_log_reg_scoring_path
(X, y, train, test, pos_class=None, Cs=10, scoring=None, fit_intercept=False, max_iter=100, tol=1e-4, class_weight=None, verbose=0, solver='lbfgs', penalty='l2', dual=False, intercept_scaling=1., ...
return coefs, Cs, np.array(scores), n_iter
Computes scores across logistic_regression_path Parameters ---------- X : {array-like, sparse matrix}, shape (n_samples, n_features) Training data. y : array-like, shape (n_samples,) or (n_samples, n_targets) Target labels. train : list of indices The indices of the train ...
Computes scores across logistic_regression_path
[ "Computes", "scores", "across", "logistic_regression_path" ]
def _log_reg_scoring_path(X, y, train, test, pos_class=None, Cs=10, scoring=None, fit_intercept=False, max_iter=100, tol=1e-4, class_weight=None, verbose=0, solver='lbfgs', penalty='l2', dual=False, intercept_scaling...
[ "def", "_log_reg_scoring_path", "(", "X", ",", "y", ",", "train", ",", "test", ",", "pos_class", "=", "None", ",", "Cs", "=", "10", ",", "scoring", "=", "None", ",", "fit_intercept", "=", "False", ",", "max_iter", "=", "100", ",", "tol", "=", "1e-4",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/linear_model/logistic.py#L766-L944
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/global_notification.py
python
GlobalNotification.closable
(self, closable)
Sets the closable of this GlobalNotification. :param closable: The closable of this GlobalNotification. # noqa: E501 :type: bool
Sets the closable of this GlobalNotification.
[ "Sets", "the", "closable", "of", "this", "GlobalNotification", "." ]
def closable(self, closable): """Sets the closable of this GlobalNotification. :param closable: The closable of this GlobalNotification. # noqa: E501 :type: bool """ self._closable = closable
[ "def", "closable", "(", "self", ",", "closable", ")", ":", "self", ".", "_closable", "=", "closable" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/global_notification.py#L242-L250
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/AbstractGenerator.py
python
AbstractGenerator.__init__
(self)
Constructor.
Constructor.
[ "Constructor", "." ]
def __init__(self): """ Constructor. """
[ "def", "__init__", "(", "self", ")", ":" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/AbstractGenerator.py#L50-L53
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/setup_multiversion/setup_multiversion.py
python
SetupMultiversionPlugin.add_subcommand
(self, subparsers)
Create and add the parser for the subcommand.
Create and add the parser for the subcommand.
[ "Create", "and", "add", "the", "parser", "for", "the", "subcommand", "." ]
def add_subcommand(self, subparsers): """Create and add the parser for the subcommand.""" parser = subparsers.add_parser(SUBCOMMAND, help=__doc__) self._add_args_to_parser(parser)
[ "def", "add_subcommand", "(", "self", ",", "subparsers", ")", ":", "parser", "=", "subparsers", ".", "add_parser", "(", "SUBCOMMAND", ",", "help", "=", "__doc__", ")", "self", ".", "_add_args_to_parser", "(", "parser", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/setup_multiversion/setup_multiversion.py#L532-L535
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/wsgiref/handlers.py
python
BaseHandler.get_stderr
(self)
Override in subclass to return suitable 'wsgi.errors
Override in subclass to return suitable 'wsgi.errors
[ "Override", "in", "subclass", "to", "return", "suitable", "wsgi", ".", "errors" ]
def get_stderr(self): """Override in subclass to return suitable 'wsgi.errors'""" raise NotImplementedError
[ "def", "get_stderr", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/wsgiref/handlers.py#L349-L351
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/formats/style.py
python
Styler.applymap
(self, func, subset=None, **kwargs)
return self
Apply a function elementwise. Updates the HTML representation with the result. Parameters ---------- func : function ``func`` should take a scalar and return a scalar. subset : IndexSlice A valid indexer to limit ``data`` to *before* applying the ...
Apply a function elementwise.
[ "Apply", "a", "function", "elementwise", "." ]
def applymap(self, func, subset=None, **kwargs): """ Apply a function elementwise. Updates the HTML representation with the result. Parameters ---------- func : function ``func`` should take a scalar and return a scalar. subset : IndexSlice ...
[ "def", "applymap", "(", "self", ",", "func", ",", "subset", "=", "None", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_todo", ".", "append", "(", "(", "lambda", "instance", ":", "getattr", "(", "instance", ",", "\"_applymap\"", ")", ",", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/formats/style.py#L708-L735
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/findertools.py
python
_getwindowsize
(folder_alias)
Set the size of a Finder window for folder to (w, h)
Set the size of a Finder window for folder to (w, h)
[ "Set", "the", "size", "of", "a", "Finder", "window", "for", "folder", "to", "(", "w", "h", ")" ]
def _getwindowsize(folder_alias): """Set the size of a Finder window for folder to (w, h)""" finder = _getfinder() args = {} attrs = {} aeobj_0 = aetypes.ObjectSpecifier(want=aetypes.Type('cfol'), form="alis", seld=folder_alias, fr=None) aeobj_1 = aetypes.ObjectSpecifier(want=aetypes...
[ "def", "_getwindowsize", "(", "folder_alias", ")", ":", "finder", "=", "_getfinder", "(", ")", "args", "=", "{", "}", "attrs", "=", "{", "}", "aeobj_0", "=", "aetypes", ".", "ObjectSpecifier", "(", "want", "=", "aetypes", ".", "Type", "(", "'cfol'", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/findertools.py#L466-L482
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/atom.py
python
Atom.is_log_log_concave
(self)
Is the expression log-log concave?
Is the expression log-log concave?
[ "Is", "the", "expression", "log", "-", "log", "concave?" ]
def is_log_log_concave(self) -> bool: """Is the expression log-log concave? """ # Verifies DGP composition rule. if self.is_log_log_constant(): return True elif self.is_atom_log_log_concave(): for idx, arg in enumerate(self.args): if not (a...
[ "def", "is_log_log_concave", "(", "self", ")", "->", "bool", ":", "# Verifies DGP composition rule.", "if", "self", ".", "is_log_log_constant", "(", ")", ":", "return", "True", "elif", "self", ".", "is_atom_log_log_concave", "(", ")", ":", "for", "idx", ",", "...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/atom.py#L231-L245
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/PathList.py
python
_PathList.subst_path
(self, env, target, source)
return tuple(result)
Performs construction variable substitution on a pre-digested PathList for a specific target and source.
Performs construction variable substitution on a pre-digested PathList for a specific target and source.
[ "Performs", "construction", "variable", "substitution", "on", "a", "pre", "-", "digested", "PathList", "for", "a", "specific", "target", "and", "source", "." ]
def subst_path(self, env, target, source): """ Performs construction variable substitution on a pre-digested PathList for a specific target and source. """ result = [] for type, value in self.pathlist: if type == TYPE_STRING_SUBST: value = env....
[ "def", "subst_path", "(", "self", ",", "env", ",", "target", ",", "source", ")", ":", "result", "=", "[", "]", "for", "type", ",", "value", "in", "self", ".", "pathlist", ":", "if", "type", "==", "TYPE_STRING_SUBST", ":", "value", "=", "env", ".", ...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/PathList.py#L120-L140
ablab/spades
3a754192b88540524ce6fb69eef5ea9273a38465
assembler/ext/src/python_libs/pyyaml2/__init__.py
python
add_multi_representer
(data_type, multi_representer, Dumper=Dumper)
Add a representer for the given type. Multi-representer is a function accepting a Dumper instance and an instance of the given data type or subtype and producing the corresponding representation node.
Add a representer for the given type. Multi-representer is a function accepting a Dumper instance and an instance of the given data type or subtype and producing the corresponding representation node.
[ "Add", "a", "representer", "for", "the", "given", "type", ".", "Multi", "-", "representer", "is", "a", "function", "accepting", "a", "Dumper", "instance", "and", "an", "instance", "of", "the", "given", "data", "type", "or", "subtype", "and", "producing", "...
def add_multi_representer(data_type, multi_representer, Dumper=Dumper): """ Add a representer for the given type. Multi-representer is a function accepting a Dumper instance and an instance of the given data type or subtype and producing the corresponding representation node. """ Dumper.add_...
[ "def", "add_multi_representer", "(", "data_type", ",", "multi_representer", ",", "Dumper", "=", "Dumper", ")", ":", "Dumper", ".", "add_multi_representer", "(", "data_type", ",", "multi_representer", ")" ]
https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/assembler/ext/src/python_libs/pyyaml2/__init__.py#L275-L282
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/post/dumper_post.py
python
export
(objectslist, filename,argstring)
return final
called when freecad exports a list of objects
called when freecad exports a list of objects
[ "called", "when", "freecad", "exports", "a", "list", "of", "objects" ]
def export(objectslist, filename,argstring): "called when freecad exports a list of objects" # pylint: disable=unused-argument output = '''(This output produced with the dump post processor) (Dump is useful for inspecting the raw commands in your paths) (but is not useful for driving machines.) (Consider s...
[ "def", "export", "(", "objectslist", ",", "filename", ",", "argstring", ")", ":", "# pylint: disable=unused-argument", "output", "=", "'''(This output produced with the dump post processor)\n(Dump is useful for inspecting the raw commands in your paths)\n(but is not useful for driving mach...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/post/dumper_post.py#L43-L75
harfbuzz/harfbuzz
c4cf5ddb272cb1c05a572db5b76629368f9054f5
src/gen-tag-table.py
python
OpenTypeRegistryParser.add_language
(self, bcp_47_tag, ot_tag)
Add a language as if it were in the registry. Args: bcp_47_tag (str): A BCP 47 tag. If the tag is more than just a language subtag, and if the language subtag is a macrolanguage, then new languages are added corresponding to the macrolanguages' individual languages with the remainder of the tag ap...
Add a language as if it were in the registry.
[ "Add", "a", "language", "as", "if", "it", "were", "in", "the", "registry", "." ]
def add_language (self, bcp_47_tag, ot_tag): """Add a language as if it were in the registry. Args: bcp_47_tag (str): A BCP 47 tag. If the tag is more than just a language subtag, and if the language subtag is a macrolanguage, then new languages are added corresponding to the macrolanguages' individ...
[ "def", "add_language", "(", "self", ",", "bcp_47_tag", ",", "ot_tag", ")", ":", "global", "bcp_47", "self", ".", "to_bcp_47", "[", "ot_tag", "]", ".", "add", "(", "bcp_47_tag", ")", "self", ".", "from_bcp_47", "[", "bcp_47_tag", "]", ".", "add", "(", "...
https://github.com/harfbuzz/harfbuzz/blob/c4cf5ddb272cb1c05a572db5b76629368f9054f5/src/gen-tag-table.py#L412-L436
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/markupsafe/_native.py
python
soft_unicode
(s)
return s
Make a string unicode if it isn't already. That way a markup string is not converted back to unicode.
Make a string unicode if it isn't already. That way a markup string is not converted back to unicode.
[ "Make", "a", "string", "unicode", "if", "it", "isn", "t", "already", ".", "That", "way", "a", "markup", "string", "is", "not", "converted", "back", "to", "unicode", "." ]
def soft_unicode(s): """Make a string unicode if it isn't already. That way a markup string is not converted back to unicode. """ if not isinstance(s, text_type): s = text_type(s) return s
[ "def", "soft_unicode", "(", "s", ")", ":", "if", "not", "isinstance", "(", "s", ",", "text_type", ")", ":", "s", "=", "text_type", "(", "s", ")", "return", "s" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/markupsafe/_native.py#L40-L46
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py
python
Decimal.compare_total
(self, other, context=None)
return _Zero
Compares self to other using the abstract representations. This is not like the standard compare, which use their numerical value. Note that a total ordering is defined for all possible abstract representations.
Compares self to other using the abstract representations.
[ "Compares", "self", "to", "other", "using", "the", "abstract", "representations", "." ]
def compare_total(self, other, context=None): """Compares self to other using the abstract representations. This is not like the standard compare, which use their numerical value. Note that a total ordering is defined for all possible abstract representations. """ other ...
[ "def", "compare_total", "(", "self", ",", "other", ",", "context", "=", "None", ")", ":", "other", "=", "_convert_other", "(", "other", ",", "raiseit", "=", "True", ")", "# if one is negative and the other is positive, it's easy", "if", "self", ".", "_sign", "an...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L2935-L3005
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/node/misc.py
python
GritNode.GetSubstitutionMessages
(self)
return [n for n in self.ActiveDescendants() if isinstance(n, message.MessageNode) and n.attrs['sub_variable'] == 'true']
Returns the list of <message sub_variable="true"> nodes.
Returns the list of <message sub_variable="true"> nodes.
[ "Returns", "the", "list", "of", "<message", "sub_variable", "=", "true", ">", "nodes", "." ]
def GetSubstitutionMessages(self): """Returns the list of <message sub_variable="true"> nodes.""" return [n for n in self.ActiveDescendants() if isinstance(n, message.MessageNode) and n.attrs['sub_variable'] == 'true']
[ "def", "GetSubstitutionMessages", "(", "self", ")", ":", "return", "[", "n", "for", "n", "in", "self", ".", "ActiveDescendants", "(", ")", "if", "isinstance", "(", "n", ",", "message", ".", "MessageNode", ")", "and", "n", ".", "attrs", "[", "'sub_variabl...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/misc.py#L539-L543
NVIDIA-Merlin/HugeCTR
b596bcc44e14bb0c62c4f7e9c0b55301d94f2154
sparse_operation_kit/sparse_operation_kit/optimizers/optimizer.py
python
Optimizer._create_slots
(self, var_list)
if your optimizer algorithm requires additional variables
if your optimizer algorithm requires additional variables
[ "if", "your", "optimizer", "algorithm", "requires", "additional", "variables" ]
def _create_slots(self, var_list): """ if your optimizer algorithm requires additional variables """ pass
[ "def", "_create_slots", "(", "self", ",", "var_list", ")", ":", "pass" ]
https://github.com/NVIDIA-Merlin/HugeCTR/blob/b596bcc44e14bb0c62c4f7e9c0b55301d94f2154/sparse_operation_kit/sparse_operation_kit/optimizers/optimizer.py#L109-L113
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Diffraction/isis_powder/routines/common.py
python
subtract_summed_runs
(ws_to_correct, empty_sample)
return ws_to_correct
Subtracts the list of empty runs specified by the empty_sample_ws_string from the workspace specified. Returns the subtracted workspace. :param ws_to_correct: The workspace to correct :param empty_sample: The empty workspace to subtract :return: The workspace with the empty runs subtracted
Subtracts the list of empty runs specified by the empty_sample_ws_string from the workspace specified. Returns the subtracted workspace. :param ws_to_correct: The workspace to correct :param empty_sample: The empty workspace to subtract :return: The workspace with the empty runs subtracted
[ "Subtracts", "the", "list", "of", "empty", "runs", "specified", "by", "the", "empty_sample_ws_string", "from", "the", "workspace", "specified", ".", "Returns", "the", "subtracted", "workspace", ".", ":", "param", "ws_to_correct", ":", "The", "workspace", "to", "...
def subtract_summed_runs(ws_to_correct, empty_sample): """ Subtracts the list of empty runs specified by the empty_sample_ws_string from the workspace specified. Returns the subtracted workspace. :param ws_to_correct: The workspace to correct :param empty_sample: The empty workspace to subtract ...
[ "def", "subtract_summed_runs", "(", "ws_to_correct", ",", "empty_sample", ")", ":", "# Skip this step if the workspace has no current, as subtracting empty", "# would give us negative counts", "if", "workspace_has_current", "(", "ws_to_correct", ")", ":", "try", ":", "mantid", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Diffraction/isis_powder/routines/common.py#L520-L541
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixes/fix_metaclass.py
python
has_metaclass
(parent)
return False
we have to check the cls_node without changing it. There are two possiblities: 1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta') 2) clsdef => simple_stmt => expr_stmt => Leaf('__meta')
we have to check the cls_node without changing it. There are two possiblities: 1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta') 2) clsdef => simple_stmt => expr_stmt => Leaf('__meta')
[ "we", "have", "to", "check", "the", "cls_node", "without", "changing", "it", ".", "There", "are", "two", "possiblities", ":", "1", ")", "clsdef", "=", ">", "suite", "=", ">", "simple_stmt", "=", ">", "expr_stmt", "=", ">", "Leaf", "(", "__meta", ")", ...
def has_metaclass(parent): """ we have to check the cls_node without changing it. There are two possiblities: 1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta') 2) clsdef => simple_stmt => expr_stmt => Leaf('__meta') """ for node in parent.children: if nod...
[ "def", "has_metaclass", "(", "parent", ")", ":", "for", "node", "in", "parent", ".", "children", ":", "if", "node", ".", "type", "==", "syms", ".", "suite", ":", "return", "has_metaclass", "(", "node", ")", "elif", "node", ".", "type", "==", "syms", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixes/fix_metaclass.py#L26-L42
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/random-pick-with-blacklist.py
python
Solution2.pick
(self)
return index+left
:rtype: int
:rtype: int
[ ":", "rtype", ":", "int" ]
def pick(self): """ :rtype: int """ index = random.randint(0, self.__n-1) left, right = 0, len(self.__blacklist)-1 while left <= right: mid = left+(right-left)//2 if index+mid < self.__blacklist[mid]: right = mid-1 else:...
[ "def", "pick", "(", "self", ")", ":", "index", "=", "random", ".", "randint", "(", "0", ",", "self", ".", "__n", "-", "1", ")", "left", ",", "right", "=", "0", ",", "len", "(", "self", ".", "__blacklist", ")", "-", "1", "while", "left", "<=", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/random-pick-with-blacklist.py#L47-L59
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiToolBarArt.GetFont
(*args, **kwargs)
return _aui.AuiToolBarArt_GetFont(*args, **kwargs)
GetFont(self) -> Font
GetFont(self) -> Font
[ "GetFont", "(", "self", ")", "-", ">", "Font" ]
def GetFont(*args, **kwargs): """GetFont(self) -> Font""" return _aui.AuiToolBarArt_GetFont(*args, **kwargs)
[ "def", "GetFont", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBarArt_GetFont", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1906-L1908
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/platform.py
python
release
()
return uname()[2]
Returns the system's release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined.
Returns the system's release, e.g. '2.2.0' or 'NT'
[ "Returns", "the", "system", "s", "release", "e", ".", "g", ".", "2", ".", "2", ".", "0", "or", "NT" ]
def release(): """ Returns the system's release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined. """ return uname()[2]
[ "def", "release", "(", ")", ":", "return", "uname", "(", ")", "[", "2", "]" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/platform.py#L1225-L1232
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_parser.py
python
p_assert_rhs_fmla
(p)
assert_rhs : fmla
assert_rhs : fmla
[ "assert_rhs", ":", "fmla" ]
def p_assert_rhs_fmla(p): 'assert_rhs : fmla' p[0] = check_non_temporal(p[1])
[ "def", "p_assert_rhs_fmla", "(", "p", ")", ":", "p", "[", "0", "]", "=", "check_non_temporal", "(", "p", "[", "1", "]", ")" ]
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L1798-L1800
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/ccbench/ccbench.py
python
task_hashing
()
return compute, (arg, )
SHA1 hashing (C)
SHA1 hashing (C)
[ "SHA1", "hashing", "(", "C", ")" ]
def task_hashing(): """SHA1 hashing (C)""" import hashlib with open(__file__, "rb") as f: arg = f.read(5000) * 30 def compute(s): hashlib.sha1(s).digest() return compute, (arg, )
[ "def", "task_hashing", "(", ")", ":", "import", "hashlib", "with", "open", "(", "__file__", ",", "\"rb\"", ")", "as", "f", ":", "arg", "=", "f", ".", "read", "(", "5000", ")", "*", "30", "def", "compute", "(", "s", ")", ":", "hashlib", ".", "sha1...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/ccbench/ccbench.py#L124-L132
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/executor_manager.py
python
DataParallelExecutorManager.grad_arrays
(self)
return self.execgrp.grad_arrays
Shared gradient arrays.
Shared gradient arrays.
[ "Shared", "gradient", "arrays", "." ]
def grad_arrays(self): """Shared gradient arrays.""" # grad arrays should be shared by all executor groups return self.execgrp.grad_arrays
[ "def", "grad_arrays", "(", "self", ")", ":", "# grad arrays should be shared by all executor groups", "return", "self", ".", "execgrp", ".", "grad_arrays" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/executor_manager.py#L404-L407
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TNGraphNodeI.GetInDeg
(self)
return _snap.TNGraphNodeI_GetInDeg(self)
GetInDeg(TNGraphNodeI self) -> int Parameters: self: TNGraphNodeI const *
GetInDeg(TNGraphNodeI self) -> int
[ "GetInDeg", "(", "TNGraphNodeI", "self", ")", "-", ">", "int" ]
def GetInDeg(self): """ GetInDeg(TNGraphNodeI self) -> int Parameters: self: TNGraphNodeI const * """ return _snap.TNGraphNodeI_GetInDeg(self)
[ "def", "GetInDeg", "(", "self", ")", ":", "return", "_snap", ".", "TNGraphNodeI_GetInDeg", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L20288-L20296
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/simplejson/__init__.py
python
loads
(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, use_decimal=False, **kw)
return cls(encoding=encoding, **kw).decode(s)
Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) to a Python object. *encoding* determines the encoding used to interpret any :class:`str` objects decoded by this instance (``'utf-8'`` by default). It has no effect when decoding :class:`unicode` objects. Note that ...
Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) to a Python object.
[ "Deserialize", "s", "(", "a", "str", "or", "unicode", "instance", "containing", "a", "JSON", "document", ")", "to", "a", "Python", "object", "." ]
def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, use_decimal=False, **kw): """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) to a Python object. *encoding* determines the ...
[ "def", "loads", "(", "s", ",", "encoding", "=", "None", ",", "cls", "=", "None", ",", "object_hook", "=", "None", ",", "parse_float", "=", "None", ",", "parse_int", "=", "None", ",", "parse_constant", "=", "None", ",", "object_pairs_hook", "=", "None", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/simplejson/__init__.py#L434-L505
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
contrib/src/sceneeditor/seSession.py
python
SeSession.toggleVis
(self, nodePath = 'None Given')
Toggle visibility of node path
Toggle visibility of node path
[ "Toggle", "visibility", "of", "node", "path" ]
def toggleVis(self, nodePath = 'None Given'): """ Toggle visibility of node path """ # First kill the flashing task to avoid complications taskMgr.remove('flashNodePath') if nodePath == 'None Given': # If nothing specified, try selected node path nodePath = self.s...
[ "def", "toggleVis", "(", "self", ",", "nodePath", "=", "'None Given'", ")", ":", "# First kill the flashing task to avoid complications", "taskMgr", ".", "remove", "(", "'flashNodePath'", ")", "if", "nodePath", "==", "'None Given'", ":", "# If nothing specified, try selec...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/contrib/src/sceneeditor/seSession.py#L514-L526
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/util/oauth.py
python
_Handler.do_GET
(self)
Handle the callback response from the auth server.
Handle the callback response from the auth server.
[ "Handle", "the", "callback", "response", "from", "the", "auth", "server", "." ]
def do_GET(self) -> None: """Handle the callback response from the auth server.""" params = parse_qs(urlsplit(self.path).query) code = params.get("code") if not code: raise ValueError("Could not get authorization code when signing in to Okta") url = f"https://{self....
[ "def", "do_GET", "(", "self", ")", "->", "None", ":", "params", "=", "parse_qs", "(", "urlsplit", "(", "self", ".", "path", ")", ".", "query", ")", "code", "=", "params", ".", "get", "(", "\"code\"", ")", "if", "not", "code", ":", "raise", "ValueEr...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/util/oauth.py#L145-L186
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py
python
CopyTool
(flavor, out_path)
Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it to |out_path|.
Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it to |out_path|.
[ "Finds", "(", "flock|mac|win", ")", "_tool", ".", "gyp", "in", "the", "gyp", "directory", "and", "copies", "it", "to", "|out_path|", "." ]
def CopyTool(flavor, out_path): """Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it to |out_path|.""" # aix and solaris just need flock emulation. mac and win use more complicated # support scripts. prefix = { 'aix': 'flock', 'solaris': 'flock', 'mac': 'mac', 'win': 'w...
[ "def", "CopyTool", "(", "flavor", ",", "out_path", ")", ":", "# aix and solaris just need flock emulation. mac and win use more complicated", "# support scripts.", "prefix", "=", "{", "'aix'", ":", "'flock'", ",", "'solaris'", ":", "'flock'", ",", "'mac'", ":", "'mac'",...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py#L440-L467
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/compiler/xla/python_api/xla_shape.py
python
Shape.tuple_shapes
(self)
return self._tuple_shapes
If this is a tuple, returns its sequence of constituent Shape objects. Returns: Tuple sub-shapes. Raises: ValueError: if this is not a tuple.
If this is a tuple, returns its sequence of constituent Shape objects.
[ "If", "this", "is", "a", "tuple", "returns", "its", "sequence", "of", "constituent", "Shape", "objects", "." ]
def tuple_shapes(self): """If this is a tuple, returns its sequence of constituent Shape objects. Returns: Tuple sub-shapes. Raises: ValueError: if this is not a tuple. """ if not self.is_tuple(): raise ValueError('tuple_shapes() called on a non-tuple shape') return self._tup...
[ "def", "tuple_shapes", "(", "self", ")", ":", "if", "not", "self", ".", "is_tuple", "(", ")", ":", "raise", "ValueError", "(", "'tuple_shapes() called on a non-tuple shape'", ")", "return", "self", ".", "_tuple_shapes" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/compiler/xla/python_api/xla_shape.py#L76-L87
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/Main/glue/vboxapi.py
python
PlatformBase.getType
(self)
return None
Returns the platform type (class name sans 'Platform').
Returns the platform type (class name sans 'Platform').
[ "Returns", "the", "platform", "type", "(", "class", "name", "sans", "Platform", ")", "." ]
def getType(self): """ Returns the platform type (class name sans 'Platform'). """ return None
[ "def", "getType", "(", "self", ")", ":", "return", "None" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Main/glue/vboxapi.py#L223-L225
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/recfunctions.py
python
find_duplicates
(a, key=None, ignoremask=True, return_index=False)
Find the duplicates in a structured array along a given key Parameters ---------- a : array-like Input array key : {string, None}, optional Name of the fields along which to check the duplicates. If None, the search is performed by records ignoremask : {True, False}, optiona...
Find the duplicates in a structured array along a given key
[ "Find", "the", "duplicates", "in", "a", "structured", "array", "along", "a", "given", "key" ]
def find_duplicates(a, key=None, ignoremask=True, return_index=False): """ Find the duplicates in a structured array along a given key Parameters ---------- a : array-like Input array key : {string, None}, optional Name of the fields along which to check the duplicates. ...
[ "def", "find_duplicates", "(", "a", ",", "key", "=", "None", ",", "ignoremask", "=", "True", ",", "return_index", "=", "False", ")", ":", "a", "=", "np", ".", "asanyarray", "(", "a", ")", ".", "ravel", "(", ")", "# Get a dictionary of fields", "fields", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/recfunctions.py#L1348-L1402
p4lang/p4c
3272e79369f20813cc1a555a5eb26f44432f84a4
tools/stf/stf_parser.py
python
STFParser.p_qualified_name_many
(self, p)
qualified_name : qualified_name DOT ID
qualified_name : qualified_name DOT ID
[ "qualified_name", ":", "qualified_name", "DOT", "ID" ]
def p_qualified_name_many(self, p): 'qualified_name : qualified_name DOT ID' p[0] = p[1] + '.' + p[3]
[ "def", "p_qualified_name_many", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "+", "'.'", "+", "p", "[", "3", "]" ]
https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/stf/stf_parser.py#L243-L245
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/topology.py
python
Chain.atoms
(self)
Iterate over all Atoms in the Chain.
Iterate over all Atoms in the Chain.
[ "Iterate", "over", "all", "Atoms", "in", "the", "Chain", "." ]
def atoms(self): """Iterate over all Atoms in the Chain.""" for residue in self._residues: for atom in residue._atoms: yield atom
[ "def", "atoms", "(", "self", ")", ":", "for", "residue", "in", "self", ".", "_residues", ":", "for", "atom", "in", "residue", ".", "_atoms", ":", "yield", "atom" ]
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/topology.py#L400-L404
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/gradients_impl.py
python
_LogOpGradients
(op, out_grads, in_grads)
Log the in and out grads of an op.
Log the in and out grads of an op.
[ "Log", "the", "in", "and", "out", "grads", "of", "an", "op", "." ]
def _LogOpGradients(op, out_grads, in_grads): """Log the in and out grads of an op.""" logging.vlog(1, "Gradient for '" + op.name + "'") def _FilterGrad(x): if x is None: return False if isinstance(x, (list, tuple)): return bool(x) else: return True logging.vlog(1, " in --> %s"...
[ "def", "_LogOpGradients", "(", "op", ",", "out_grads", ",", "in_grads", ")", ":", "logging", ".", "vlog", "(", "1", ",", "\"Gradient for '\"", "+", "op", ".", "name", "+", "\"'\"", ")", "def", "_FilterGrad", "(", "x", ")", ":", "if", "x", "is", "None...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/gradients_impl.py#L750-L765
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py
python
_get_output_alternatives
(prediction_type, problem_type, prediction_dict)
Constructs output alternatives dict for `ModelFnOps`. Args: prediction_type: either `MULTIPLE_VALUE` or `SINGLE_VALUE`. problem_type: either `CLASSIFICATION` or `LINEAR_REGRESSION`. prediction_dict: a dictionary mapping strings to `Tensor`s containing predictions. Returns: `None` or a dictio...
Constructs output alternatives dict for `ModelFnOps`.
[ "Constructs", "output", "alternatives", "dict", "for", "ModelFnOps", "." ]
def _get_output_alternatives(prediction_type, problem_type, prediction_dict): """Constructs output alternatives dict for `ModelFnOps`. Args: prediction_type: either `MULTIPLE_VALUE` or `SINGLE_VALUE`. problem_type: either `CLASSIFICATION` or `LINEAR...
[ "def", "_get_output_alternatives", "(", "prediction_type", ",", "problem_type", ",", "prediction_dict", ")", ":", "if", "prediction_type", "==", "rnn_common", ".", "PredictionType", ".", "MULTIPLE_VALUE", ":", "return", "None", "if", "prediction_type", "==", "rnn_comm...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py#L354-L381
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/impl/tcpros_pubsub.py
python
TCPROSHandler.shutdown
(self)
stops the TCP/IP server responsible for receiving inbound connections
stops the TCP/IP server responsible for receiving inbound connections
[ "stops", "the", "TCP", "/", "IP", "server", "responsible", "for", "receiving", "inbound", "connections" ]
def shutdown(self): """ stops the TCP/IP server responsible for receiving inbound connections """ pass
[ "def", "shutdown", "(", "self", ")", ":", "pass" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/tcpros_pubsub.py#L222-L226
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/mailbox.py
python
MMDF.__init__
(self, path, factory=None, create=True)
Initialize an MMDF mailbox.
Initialize an MMDF mailbox.
[ "Initialize", "an", "MMDF", "mailbox", "." ]
def __init__(self, path, factory=None, create=True): """Initialize an MMDF mailbox.""" self._message_factory = MMDFMessage _mboxMMDF.__init__(self, path, factory, create)
[ "def", "__init__", "(", "self", ",", "path", ",", "factory", "=", "None", ",", "create", "=", "True", ")", ":", "self", ".", "_message_factory", "=", "MMDFMessage", "_mboxMMDF", ".", "__init__", "(", "self", ",", "path", ",", "factory", ",", "create", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L875-L878
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/internal/sanitize.py
python
sanitize_multi_axis_reduction_list
(axes)
return retAxes
Sanitizes a list of axes for multi-axis reduction which can not contain sequence axis. Args: axes (list of :class:`~cntk.axis.Axis` or int or None): the axes to be used. * :class:`~cntk.axis.Axis`: use axis instance directly (will convert row- to col-major in case of static axis). ...
Sanitizes a list of axes for multi-axis reduction which can not contain sequence axis.
[ "Sanitizes", "a", "list", "of", "axes", "for", "multi", "-", "axis", "reduction", "which", "can", "not", "contain", "sequence", "axis", "." ]
def sanitize_multi_axis_reduction_list(axes): ''' Sanitizes a list of axes for multi-axis reduction which can not contain sequence axis. Args: axes (list of :class:`~cntk.axis.Axis` or int or None): the axes to be used. * :class:`~cntk.axis.Axis`: use axis instance directly (will convert...
[ "def", "sanitize_multi_axis_reduction_list", "(", "axes", ")", ":", "if", "not", "type", "(", "axes", ")", "in", "(", "list", ",", "tuple", ")", ":", "axes", "=", "[", "axes", "]", "retAxes", "=", "[", "]", "for", "ax", "in", "axes", ":", "if", "("...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/internal/sanitize.py#L550-L570
amrayn/easyloggingpp
8489989bb26c6371df103f6cbced3fbee1bc3c2f
tools/cpplint.py
python
FindStartOfExpressionInLine
(line, endpos, depth, startchar, endchar)
return (-1, depth)
Find position at the matching startchar. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at this position. depth: nesting level at endpos. startchar: expression...
Find position at the matching startchar.
[ "Find", "position", "at", "the", "matching", "startchar", "." ]
def FindStartOfExpressionInLine(line, endpos, depth, startchar, endchar): """Find position at the matching startchar. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching ...
[ "def", "FindStartOfExpressionInLine", "(", "line", ",", "endpos", ",", "depth", ",", "startchar", ",", "endchar", ")", ":", "for", "i", "in", "xrange", "(", "endpos", ",", "-", "1", ",", "-", "1", ")", ":", "if", "line", "[", "i", "]", "==", "endch...
https://github.com/amrayn/easyloggingpp/blob/8489989bb26c6371df103f6cbced3fbee1bc3c2f/tools/cpplint.py#L1277-L1301
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/pylib/device/adb_wrapper.py
python
AdbWrapper.GetDevPath
(self, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES)
return self._DeviceAdbCmd(['get-devpath'], timeout, retries)
Gets the device path. Args: timeout: (optional) Timeout per try in seconds. retries: (optional) Number of retries to attempt. Returns: The device path (e.g. usb:3-4)
Gets the device path.
[ "Gets", "the", "device", "path", "." ]
def GetDevPath(self, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES): """Gets the device path. Args: timeout: (optional) Timeout per try in seconds. retries: (optional) Number of retries to attempt. Returns: The device path (e.g. usb:3-4) """ return self._DeviceAdbCmd(['get-d...
[ "def", "GetDevPath", "(", "self", ",", "timeout", "=", "_DEFAULT_TIMEOUT", ",", "retries", "=", "_DEFAULT_RETRIES", ")", ":", "return", "self", ".", "_DeviceAdbCmd", "(", "[", "'get-devpath'", "]", ",", "timeout", ",", "retries", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/device/adb_wrapper.py#L382-L392
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/arch/micro_asm.py
python
p_labels_2
(t)
labels : labels NEWLINE
labels : labels NEWLINE
[ "labels", ":", "labels", "NEWLINE" ]
def p_labels_2(t): 'labels : labels NEWLINE' t[0] = t[1]
[ "def", "p_labels_2", "(", "t", ")", ":", "t", "[", "0", "]", "=", "t", "[", "1", "]" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/arch/micro_asm.py#L444-L446
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextFileHandler.SaveFile
(*args, **kwargs)
return _richtext.RichTextFileHandler_SaveFile(*args, **kwargs)
SaveFile(self, RichTextBuffer buffer, String filename) -> bool
SaveFile(self, RichTextBuffer buffer, String filename) -> bool
[ "SaveFile", "(", "self", "RichTextBuffer", "buffer", "String", "filename", ")", "-", ">", "bool" ]
def SaveFile(*args, **kwargs): """SaveFile(self, RichTextBuffer buffer, String filename) -> bool""" return _richtext.RichTextFileHandler_SaveFile(*args, **kwargs)
[ "def", "SaveFile", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextFileHandler_SaveFile", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2764-L2766
smartdevicelink/sdl_core
68f082169e0a40fccd9eb0db3c83911c28870f07
tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py
python
CodeGenerator._gen_sturct_impls
(self, structs, namespace, class_name)
return u"\n".join([self._gen_struct_impl( x, namespace, class_name) for x in structs])
Generate structs implementation for source file. Generates implementation code of methods that provide schema items for structs. This code should be used in the source file. Keyword arguments: structs -- list of structs to generate methods for. namespace -- name of destination ...
Generate structs implementation for source file.
[ "Generate", "structs", "implementation", "for", "source", "file", "." ]
def _gen_sturct_impls(self, structs, namespace, class_name): """Generate structs implementation for source file. Generates implementation code of methods that provide schema items for structs. This code should be used in the source file. Keyword arguments: structs -- list of st...
[ "def", "_gen_sturct_impls", "(", "self", ",", "structs", ",", "namespace", ",", "class_name", ")", ":", "if", "structs", "is", "None", ":", "raise", "GenerateError", "(", "\"Structs is None\"", ")", "return", "u\"\\n\"", ".", "join", "(", "[", "self", ".", ...
https://github.com/smartdevicelink/sdl_core/blob/68f082169e0a40fccd9eb0db3c83911c28870f07/tools/InterfaceGenerator/generator/generators/SmartFactoryBase.py#L523-L543
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py
python
Gamma.mean
(self, name="mean")
Mean of each batch member.
Mean of each batch member.
[ "Mean", "of", "each", "batch", "member", "." ]
def mean(self, name="mean"): """Mean of each batch member.""" with ops.name_scope(self.name): with ops.op_scope([self._alpha, self._beta], name): return self._alpha / self._beta
[ "def", "mean", "(", "self", ",", "name", "=", "\"mean\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "self", ".", "_alpha", ",", "self", ".", "_beta", "]", ",", "name"...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py#L187-L191
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
dom/bindings/Configuration.py
python
Configuration._filterForFileAndWorkers
(items, filters)
return items
Gets the items that match the given filters.
Gets the items that match the given filters.
[ "Gets", "the", "items", "that", "match", "the", "given", "filters", "." ]
def _filterForFileAndWorkers(items, filters): """Gets the items that match the given filters.""" for key, val in filters.iteritems(): if key == 'webIDLFile': items = filter(lambda x: x.filename() == val, items) elif key == 'workers': if val: ...
[ "def", "_filterForFileAndWorkers", "(", "items", ",", "filters", ")", ":", "for", "key", ",", "val", "in", "filters", ".", "iteritems", "(", ")", ":", "if", "key", "==", "'webIDLFile'", ":", "items", "=", "filter", "(", "lambda", "x", ":", "x", ".", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/Configuration.py#L156-L168
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MSDFit.py
python
MSDFit._setup
(self)
Gets algorithm properties.
Gets algorithm properties.
[ "Gets", "algorithm", "properties", "." ]
def _setup(self): """ Gets algorithm properties. """ self._input_ws = self.getPropertyValue('InputWorkspace') self._model = self.getPropertyValue('Model') self._output_msd_ws = self.getPropertyValue('OutputWorkspace') self._output_param_ws = self.getPropertyValue...
[ "def", "_setup", "(", "self", ")", ":", "self", ".", "_input_ws", "=", "self", ".", "getPropertyValue", "(", "'InputWorkspace'", ")", "self", ".", "_model", "=", "self", ".", "getPropertyValue", "(", "'Model'", ")", "self", ".", "_output_msd_ws", "=", "sel...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MSDFit.py#L239-L259
MVIG-SJTU/RMPE
5188c230ec800c12be7369c3619615bc9b020aa4
scripts/cpp_lint.py
python
CheckForCopyright
(filename, lines, error)
Logs an error if a Copyright message appears at the top of the file.
Logs an error if a Copyright message appears at the top of the file.
[ "Logs", "an", "error", "if", "a", "Copyright", "message", "appears", "at", "the", "top", "of", "the", "file", "." ]
def CheckForCopyright(filename, lines, error): """Logs an error if a Copyright message appears at the top of the file.""" # We'll check up to line 10. Don't forget there's a # dummy line at the front. for line in xrange(1, min(len(lines), 11)): if _RE_COPYRIGHT.search(lines[line], re.I): error(filena...
[ "def", "CheckForCopyright", "(", "filename", ",", "lines", ",", "error", ")", ":", "# We'll check up to line 10. Don't forget there's a", "# dummy line at the front.", "for", "line", "in", "xrange", "(", "1", ",", "min", "(", "len", "(", "lines", ")", ",", "11", ...
https://github.com/MVIG-SJTU/RMPE/blob/5188c230ec800c12be7369c3619615bc9b020aa4/scripts/cpp_lint.py#L1372-L1381
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/resmokelib/selector.py
python
_pop_all
(kind, universe, iterable, validate=True)
return members
Removes all elements of 'iterable' from 'universe' and returns them. If 'validate' is true, then a ValueError is raised if a element would be removed multiple times, or if an element of 'iterable' does not appear in 'universe' at all.
Removes all elements of 'iterable' from 'universe' and returns them.
[ "Removes", "all", "elements", "of", "iterable", "from", "universe", "and", "returns", "them", "." ]
def _pop_all(kind, universe, iterable, validate=True): """ Removes all elements of 'iterable' from 'universe' and returns them. If 'validate' is true, then a ValueError is raised if a element would be removed multiple times, or if an element of 'iterable' does not appear in 'universe' at all. "...
[ "def", "_pop_all", "(", "kind", ",", "universe", ",", "iterable", ",", "validate", "=", "True", ")", ":", "members", "=", "set", "(", ")", "for", "elem", "in", "iterable", ":", "if", "validate", "and", "elem", "in", "members", ":", "raise", "ValueError...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/resmokelib/selector.py#L270-L291
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/util/command_line.py
python
OptparseCommand.main
(cls, args=None)
return min(cls().Run(options), 255)
Main method to run this command as a standalone script.
Main method to run this command as a standalone script.
[ "Main", "method", "to", "run", "this", "command", "as", "a", "standalone", "script", "." ]
def main(cls, args=None): """Main method to run this command as a standalone script.""" parser = cls.CreateParser() cls.AddCommandLineArgs(parser, None) options, args = parser.parse_args(args=args) options.positional_args = args cls.ProcessCommandLineArgs(parser, options, None) return min(cl...
[ "def", "main", "(", "cls", ",", "args", "=", "None", ")", ":", "parser", "=", "cls", ".", "CreateParser", "(", ")", "cls", ".", "AddCommandLineArgs", "(", "parser", ",", "None", ")", "options", ",", "args", "=", "parser", ".", "parse_args", "(", "arg...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/util/command_line.py#L81-L88
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/reduction/reducer.py
python
Reducer.is_clean
(self, workspace)
return True
Returns True if the workspace is clean
Returns True if the workspace is clean
[ "Returns", "True", "if", "the", "workspace", "is", "clean" ]
def is_clean(self, workspace): """ Returns True if the workspace is clean """ if workspace in self._dirty: return False return True
[ "def", "is_clean", "(", "self", ",", "workspace", ")", ":", "if", "workspace", "in", "self", ".", "_dirty", ":", "return", "False", "return", "True" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction/reducer.py#L386-L392
Yijunmaverick/GenerativeFaceCompletion
f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2
python/caffe/pycaffe.py
python
_Net_forward_backward_all
(self, blobs=None, diffs=None, **kwargs)
return all_outs, all_diffs
Run net forward + backward in batches. Parameters ---------- blobs: list of blobs to extract as in forward() diffs: list of diffs to extract as in backward() kwargs: Keys are input (for forward) and output (for backward) blob names and values are ndarrays. Refer to forward() and backwar...
Run net forward + backward in batches.
[ "Run", "net", "forward", "+", "backward", "in", "batches", "." ]
def _Net_forward_backward_all(self, blobs=None, diffs=None, **kwargs): """ Run net forward + backward in batches. Parameters ---------- blobs: list of blobs to extract as in forward() diffs: list of diffs to extract as in backward() kwargs: Keys are input (for forward) and output (for backw...
[ "def", "_Net_forward_backward_all", "(", "self", ",", "blobs", "=", "None", ",", "diffs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Batch blobs and diffs.", "all_outs", "=", "{", "out", ":", "[", "]", "for", "out", "in", "set", "(", "self", "....
https://github.com/Yijunmaverick/GenerativeFaceCompletion/blob/f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2/python/caffe/pycaffe.py#L192-L234
adventuregamestudio/ags
efa89736d868e9dfda4200149d33ba8637746399
Common/libsrc/freetype-2.1.3/src/tools/docmaker/tohtml.py
python
HtmlFormatter.make_html_word
( self, word )
return html_quote(word)
analyze a simple word to detect cross-references and styling
analyze a simple word to detect cross-references and styling
[ "analyze", "a", "simple", "word", "to", "detect", "cross", "-", "references", "and", "styling" ]
def make_html_word( self, word ): """analyze a simple word to detect cross-references and styling""" # look for cross-references # m = re_crossref.match( word ) if m: try: name = m.group(1) block = self.identifiers[ name ] ...
[ "def", "make_html_word", "(", "self", ",", "word", ")", ":", "# look for cross-references", "#", "m", "=", "re_crossref", ".", "match", "(", "word", ")", "if", "m", ":", "try", ":", "name", "=", "m", ".", "group", "(", "1", ")", "block", "=", "self",...
https://github.com/adventuregamestudio/ags/blob/efa89736d868e9dfda4200149d33ba8637746399/Common/libsrc/freetype-2.1.3/src/tools/docmaker/tohtml.py#L167-L192
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/tensorboard/backend/server.py
python
ReloadMultiplexer
(multiplexer, path_to_run)
Loads all runs into the multiplexer. Args: multiplexer: The `EventMultiplexer` to add runs to and reload. path_to_run: A dict mapping from paths to run names, where `None` as the run name is interpreted as a run name equal to the path.
Loads all runs into the multiplexer.
[ "Loads", "all", "runs", "into", "the", "multiplexer", "." ]
def ReloadMultiplexer(multiplexer, path_to_run): """Loads all runs into the multiplexer. Args: multiplexer: The `EventMultiplexer` to add runs to and reload. path_to_run: A dict mapping from paths to run names, where `None` as the run name is interpreted as a run name equal to the path. """ start...
[ "def", "ReloadMultiplexer", "(", "multiplexer", ",", "path_to_run", ")", ":", "start", "=", "time", ".", "time", "(", ")", "for", "(", "path", ",", "name", ")", "in", "six", ".", "iteritems", "(", "path_to_run", ")", ":", "multiplexer", ".", "AddRunsFrom...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/tensorboard/backend/server.py#L89-L102
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/msg/_GeoPose.py
python
GeoPose.serialize
(self, buff)
serialize message into buffer :param buff: buffer, ``StringIO``
serialize message into buffer :param buff: buffer, ``StringIO``
[ "serialize", "message", "into", "buffer", ":", "param", "buff", ":", "buffer", "StringIO" ]
def serialize(self, buff): """ serialize message into buffer :param buff: buffer, ``StringIO`` """ try: _x = self buff.write(_struct_7d.pack(_x.position.latitude, _x.position.longitude, _x.position.altitude, _x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w)) exc...
[ "def", "serialize", "(", "self", ",", "buff", ")", ":", "try", ":", "_x", "=", "self", "buff", ".", "write", "(", "_struct_7d", ".", "pack", "(", "_x", ".", "position", ".", "latitude", ",", "_x", ".", "position", ".", "longitude", ",", "_x", ".", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/msg/_GeoPose.py#L83-L92
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/ops.py
python
Tensor.__bool__
(self)
Dummy method to prevent a tensor from being used as a Python `bool`. This overload raises a `TypeError` when the user inadvertently treats a `Tensor` as a boolean (e.g. in an `if` statement). For example: ```python if tf.constant(True): # Will raise. # ... if tf.constant(5) < tf.consta...
Dummy method to prevent a tensor from being used as a Python `bool`.
[ "Dummy", "method", "to", "prevent", "a", "tensor", "from", "being", "used", "as", "a", "Python", "bool", "." ]
def __bool__(self): """Dummy method to prevent a tensor from being used as a Python `bool`. This overload raises a `TypeError` when the user inadvertently treats a `Tensor` as a boolean (e.g. in an `if` statement). For example: ```python if tf.constant(True): # Will raise. # ... if...
[ "def", "__bool__", "(", "self", ")", ":", "raise", "TypeError", "(", "\"Using a `tf.Tensor` as a Python `bool` is not allowed. \"", "\"Use `if t is not None:` instead of `if t:` to test if a \"", "\"tensor is defined, and use TensorFlow ops such as \"", "\"tf.cond to execute subgraphs condit...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L522-L547
rrwick/Porechop
109e437280436d1ec27e5a5b7a34ffb752176390
porechop/nanopore_read.py
python
NanoporeRead.formatted_whole_seq
(self, extra_trim_size)
return formatted_start + middle + formatted_end
Returns the entire read sequence, with any found adapters highlighted in red.
Returns the entire read sequence, with any found adapters highlighted in red.
[ "Returns", "the", "entire", "read", "sequence", "with", "any", "found", "adapters", "highlighted", "in", "red", "." ]
def formatted_whole_seq(self, extra_trim_size): """ Returns the entire read sequence, with any found adapters highlighted in red. """ if not self.start_trim_amount and not self.end_trim_amount: return self.seq red_start_bases, red_end_bases = 0, 0 if self.sta...
[ "def", "formatted_whole_seq", "(", "self", ",", "extra_trim_size", ")", ":", "if", "not", "self", ".", "start_trim_amount", "and", "not", "self", ".", "end_trim_amount", ":", "return", "self", ".", "seq", "red_start_bases", ",", "red_end_bases", "=", "0", ",",...
https://github.com/rrwick/Porechop/blob/109e437280436d1ec27e5a5b7a34ffb752176390/porechop/nanopore_read.py#L275-L304
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/db_manager/db_plugins/oracle/connector.py
python
OracleDBConnector.createView
(self, view, query)
Creates a view as defined.
Creates a view as defined.
[ "Creates", "a", "view", "as", "defined", "." ]
def createView(self, view, query): """Creates a view as defined.""" sql = u"CREATE VIEW {0} AS {1}".format(self.quoteId(view), query) self._execute_and_commit(sql)
[ "def", "createView", "(", "self", ",", "view", ",", "query", ")", ":", "sql", "=", "u\"CREATE VIEW {0} AS {1}\"", ".", "format", "(", "self", ".", "quoteId", "(", "view", ")", ",", "query", ")", "self", ".", "_execute_and_commit", "(", "sql", ")" ]
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/oracle/connector.py#L1249-L1253
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py
python
get_log_device_placement
()
return context().log_device_placement
Get if device placements are logged. Returns: If device placements are logged.
Get if device placements are logged.
[ "Get", "if", "device", "placements", "are", "logged", "." ]
def get_log_device_placement(): """Get if device placements are logged. Returns: If device placements are logged. """ return context().log_device_placement
[ "def", "get_log_device_placement", "(", ")", ":", "return", "context", "(", ")", ".", "log_device_placement" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py#L1695-L1701
PrincetonUniversity/athena-public-version
9c266692b9423743d8e23509b3ab266a232a92d2
tst/style/cpplint.py
python
_CppLintState.RestoreFilters
(self)
Restores filters previously backed up.
Restores filters previously backed up.
[ "Restores", "filters", "previously", "backed", "up", "." ]
def RestoreFilters(self): """ Restores filters previously backed up.""" self.filters = self._filters_backup[:]
[ "def", "RestoreFilters", "(", "self", ")", ":", "self", ".", "filters", "=", "self", ".", "_filters_backup", "[", ":", "]" ]
https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L1081-L1083
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/tensor/logic.py
python
bitwise_xor
(x, y, out=None, name=None)
return _bitwise_op( op_name="bitwise_xor", x=x, y=y, name=name, out=out, binary_op=True)
${comment} Args: x (Tensor): ${x_comment} y (Tensor): ${y_comment} out(Tensor): ${out_comment} Returns: Tensor: ${out_comment} Examples: .. code-block:: python import paddle x = paddle.to_tensor([-5, -1, 1]) y = paddle.to_tensor...
${comment}
[ "$", "{", "comment", "}" ]
def bitwise_xor(x, y, out=None, name=None): """ ${comment} Args: x (Tensor): ${x_comment} y (Tensor): ${y_comment} out(Tensor): ${out_comment} Returns: Tensor: ${out_comment} Examples: .. code-block:: python import paddle x = paddle...
[ "def", "bitwise_xor", "(", "x", ",", "y", ",", "out", "=", "None", ",", "name", "=", "None", ")", ":", "return", "_bitwise_op", "(", "op_name", "=", "\"bitwise_xor\"", ",", "x", "=", "x", ",", "y", "=", "y", ",", "name", "=", "name", ",", "out", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/logic.py#L538-L560
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/dev/Device.py
python
DmaDevice.addIommuProperty
(self, state, node)
This method takes an FdtState and a FdtNode as parameters, and it is appending a "iommus = <>" property in case the DmaDevice is attached to an IOMMU. This method is necessary for autogenerating a binding between a dma device and the iommu.
This method takes an FdtState and a FdtNode as parameters, and it is appending a "iommus = <>" property in case the DmaDevice is attached to an IOMMU. This method is necessary for autogenerating a binding between a dma device and the iommu.
[ "This", "method", "takes", "an", "FdtState", "and", "a", "FdtNode", "as", "parameters", "and", "it", "is", "appending", "a", "iommus", "=", "<", ">", "property", "in", "case", "the", "DmaDevice", "is", "attached", "to", "an", "IOMMU", ".", "This", "metho...
def addIommuProperty(self, state, node): """ This method takes an FdtState and a FdtNode as parameters, and it is appending a "iommus = <>" property in case the DmaDevice is attached to an IOMMU. This method is necessary for autogenerating a binding between a dma device a...
[ "def", "addIommuProperty", "(", "self", ",", "state", ",", "node", ")", ":", "if", "self", ".", "_iommu", "is", "not", "None", ":", "node", ".", "append", "(", "FdtPropertyWords", "(", "\"iommus\"", ",", "[", "state", ".", "phandle", "(", "self", ".", ...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/dev/Device.py#L99-L109
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py3/traitlets/traitlets.py
python
TraitType.tag
(self, **metadata)
return self
Sets metadata and returns self. This allows convenient metadata tagging when initializing the trait, such as: >>> Int(0).tag(config=True, sync=True)
Sets metadata and returns self.
[ "Sets", "metadata", "and", "returns", "self", "." ]
def tag(self, **metadata): """Sets metadata and returns self. This allows convenient metadata tagging when initializing the trait, such as: >>> Int(0).tag(config=True, sync=True) """ maybe_constructor_keywords = set(metadata.keys()).intersection({'help','allow_none', 'read_only...
[ "def", "tag", "(", "self", ",", "*", "*", "metadata", ")", ":", "maybe_constructor_keywords", "=", "set", "(", "metadata", ".", "keys", "(", ")", ")", ".", "intersection", "(", "{", "'help'", ",", "'allow_none'", ",", "'read_only'", ",", "'default_value'",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/traitlets.py#L718-L731
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlNode.docSetRootElement
(self, doc)
return __tmp
Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...).
Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...).
[ "Set", "the", "root", "element", "of", "the", "document", "(", "doc", "-", ">", "children", "is", "a", "list", "containing", "possibly", "comments", "PIs", "etc", "...", ")", "." ]
def docSetRootElement(self, doc): """Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlDocSetRootElement(doc__o, self._o) if ret is None...
[ "def", "docSetRootElement", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlDocSetRootElement", "(", "doc__o", ",", "self", ".", ...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L3206-L3214
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/tools/docs/doc_generator_visitor.py
python
DocGeneratorVisitor.reverse_index
(self)
return self._reverse_index
A map from `id(object)` to the preferred fully qualified name. This map only contains non-primitive objects (no numbers or strings) present in `index` (for primitive objects, `id()` doesn't quite do the right thing). It is computed when it, `duplicate_of`, or `duplicates` are first accessed. Returns:...
A map from `id(object)` to the preferred fully qualified name.
[ "A", "map", "from", "id", "(", "object", ")", "to", "the", "preferred", "fully", "qualified", "name", "." ]
def reverse_index(self): """A map from `id(object)` to the preferred fully qualified name. This map only contains non-primitive objects (no numbers or strings) present in `index` (for primitive objects, `id()` doesn't quite do the right thing). It is computed when it, `duplicate_of`, or `duplicates` a...
[ "def", "reverse_index", "(", "self", ")", ":", "self", ".", "_maybe_find_duplicates", "(", ")", "return", "self", ".", "_reverse_index" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/tools/docs/doc_generator_visitor.py#L76-L88
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/compiler.py
python
ast_to_source
(node, indentation=' ', include_encoding_marker=True)
return code
Return the source code of given AST. Args: node: The code to compile, as an AST object. indentation: The string to use for indentation. include_encoding_marker: Bool, thether to include a comment on the first line to explicitly specify UTF-8 encoding. Returns: code: The source code generated...
Return the source code of given AST.
[ "Return", "the", "source", "code", "of", "given", "AST", "." ]
def ast_to_source(node, indentation=' ', include_encoding_marker=True): """Return the source code of given AST. Args: node: The code to compile, as an AST object. indentation: The string to use for indentation. include_encoding_marker: Bool, thether to include a comment on the first line to expl...
[ "def", "ast_to_source", "(", "node", ",", "indentation", "=", "' '", ",", "include_encoding_marker", "=", "True", ")", ":", "if", "not", "isinstance", "(", "node", ",", "(", "list", ",", "tuple", ")", ")", ":", "node", "=", "(", "node", ",", ")", "g...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/compiler.py#L40-L86
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/os.py
python
makedirs
(name, mode=0o777, exist_ok=False)
makedirs(name [, mode=0o777][, exist_ok=False]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. If the target directory already exists, raise an OSError if exist_o...
makedirs(name [, mode=0o777][, exist_ok=False])
[ "makedirs", "(", "name", "[", "mode", "=", "0o777", "]", "[", "exist_ok", "=", "False", "]", ")" ]
def makedirs(name, mode=0o777, exist_ok=False): """makedirs(name [, mode=0o777][, exist_ok=False]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. If the target di...
[ "def", "makedirs", "(", "name", ",", "mode", "=", "0o777", ",", "exist_ok", "=", "False", ")", ":", "head", ",", "tail", "=", "path", ".", "split", "(", "name", ")", "if", "not", "tail", ":", "head", ",", "tail", "=", "path", ".", "split", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/os.py#L198-L228
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/selectors.py
python
BaseSelector.close
(self)
Close the selector. This must be called to make sure that any underlying resource is freed.
Close the selector.
[ "Close", "the", "selector", "." ]
def close(self): """Close the selector. This must be called to make sure that any underlying resource is freed. """ pass
[ "def", "close", "(", "self", ")", ":", "pass" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/selectors.py#L173-L178
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/graph/lattice.py
python
Lattice._clean_basis
(basis_vectors)
return basis_vectors
Check and convert `basis_vectors` init argument.
Check and convert `basis_vectors` init argument.
[ "Check", "and", "convert", "basis_vectors", "init", "argument", "." ]
def _clean_basis(basis_vectors): """Check and convert `basis_vectors` init argument.""" basis_vectors = _np.asarray(basis_vectors) if basis_vectors.ndim != 2: raise ValueError( "'basis_vectors' must have ndim==2 (as array of primtive vectors)" ) if...
[ "def", "_clean_basis", "(", "basis_vectors", ")", ":", "basis_vectors", "=", "_np", ".", "asarray", "(", "basis_vectors", ")", "if", "basis_vectors", ".", "ndim", "!=", "2", ":", "raise", "ValueError", "(", "\"'basis_vectors' must have ndim==2 (as array of primtive ve...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/graph/lattice.py#L313-L322
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
external/tools/build/v2/build/generators.py
python
Generator.generated_targets
(self, sources, prop_set, project, name)
return [ project.manager().virtual_targets().register(t) for t in targets ]
Constructs targets that are created after consuming 'sources'. The result will be the list of virtual-target, which the same length as 'target_types' attribute and with corresponding types. When 'name' is empty, all source targets must have the same value of ...
Constructs targets that are created after consuming 'sources'. The result will be the list of virtual-target, which the same length as 'target_types' attribute and with corresponding types. When 'name' is empty, all source targets must have the same value of ...
[ "Constructs", "targets", "that", "are", "created", "after", "consuming", "sources", ".", "The", "result", "will", "be", "the", "list", "of", "virtual", "-", "target", "which", "the", "same", "length", "as", "target_types", "attribute", "and", "with", "correspo...
def generated_targets (self, sources, prop_set, project, name): """ Constructs targets that are created after consuming 'sources'. The result will be the list of virtual-target, which the same length as 'target_types' attribute and with corresponding types. When ...
[ "def", "generated_targets", "(", "self", ",", "sources", ",", "prop_set", ",", "project", ",", "name", ")", ":", "if", "not", "name", ":", "name", "=", "self", ".", "determine_output_name", "(", "sources", ")", "# Assign an action for each target", "action", "...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/generators.py#L438-L483
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/xcode_emulation.py
python
XcodeSettings.GetWrapperName
(self)
return self.GetProductName() + self.GetWrapperExtension()
Returns the directory name of the bundle represented by this target. Only valid for bundles.
Returns the directory name of the bundle represented by this target. Only valid for bundles.
[ "Returns", "the", "directory", "name", "of", "the", "bundle", "represented", "by", "this", "target", ".", "Only", "valid", "for", "bundles", "." ]
def GetWrapperName(self): """Returns the directory name of the bundle represented by this target. Only valid for bundles.""" assert self._IsBundle() return self.GetProductName() + self.GetWrapperExtension()
[ "def", "GetWrapperName", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "self", ".", "GetProductName", "(", ")", "+", "self", ".", "GetWrapperExtension", "(", ")" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/xcode_emulation.py#L281-L285
astra-toolbox/astra-toolbox
1e7ec8af702e595b76654f2e500f4c00344b273f
python/astra/astra.py
python
credits
()
return a.credits()
Print credits of the ASTRA Toolbox.
Print credits of the ASTRA Toolbox.
[ "Print", "credits", "of", "the", "ASTRA", "Toolbox", "." ]
def credits(): """Print credits of the ASTRA Toolbox.""" return a.credits()
[ "def", "credits", "(", ")", ":", "return", "a", ".", "credits", "(", ")" ]
https://github.com/astra-toolbox/astra-toolbox/blob/1e7ec8af702e595b76654f2e500f4c00344b273f/python/astra/astra.py#L28-L30
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/internal/well_known_types.py
python
Timestamp.FromMilliseconds
(self, millis)
Converts milliseconds since epoch to Timestamp.
Converts milliseconds since epoch to Timestamp.
[ "Converts", "milliseconds", "since", "epoch", "to", "Timestamp", "." ]
def FromMilliseconds(self, millis): """Converts milliseconds since epoch to Timestamp.""" self.seconds = millis // _MILLIS_PER_SECOND self.nanos = (millis % _MILLIS_PER_SECOND) * _NANOS_PER_MILLISECOND
[ "def", "FromMilliseconds", "(", "self", ",", "millis", ")", ":", "self", ".", "seconds", "=", "millis", "//", "_MILLIS_PER_SECOND", "self", ".", "nanos", "=", "(", "millis", "%", "_MILLIS_PER_SECOND", ")", "*", "_NANOS_PER_MILLISECOND" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L217-L220
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/httplib.py
python
HTTPConnection.close
(self)
Close the connection to the HTTP server.
Close the connection to the HTTP server.
[ "Close", "the", "connection", "to", "the", "HTTP", "server", "." ]
def close(self): """Close the connection to the HTTP server.""" if self.sock: self.sock.close() # close it manually... there may be other refs self.sock = None if self.__response: self.__response.close() self.__response = None self.__stat...
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "sock", ":", "self", ".", "sock", ".", "close", "(", ")", "# close it manually... there may be other refs", "self", ".", "sock", "=", "None", "if", "self", ".", "__response", ":", "self", ".", "__...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/httplib.py#L777-L785
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_presenter.py
python
BackgroundCorrectionsPresenter._update_use_raw_in_view_and_model
(self, run: str, group: str, use_raw: bool)
Updates the Use Raw option in the view and model using the provided value.
Updates the Use Raw option in the view and model using the provided value.
[ "Updates", "the", "Use", "Raw", "option", "in", "the", "view", "and", "model", "using", "the", "provided", "value", "." ]
def _update_use_raw_in_view_and_model(self, run: str, group: str, use_raw: bool) -> None: """Updates the Use Raw option in the view and model using the provided value.""" if self.view.is_run_group_displayed(run, group): self.view.set_use_raw(run, group, use_raw) self.model.set_use_ra...
[ "def", "_update_use_raw_in_view_and_model", "(", "self", ",", "run", ":", "str", ",", "group", ":", "str", ",", "use_raw", ":", "bool", ")", "->", "None", ":", "if", "self", ".", "view", ".", "is_run_group_displayed", "(", "run", ",", "group", ")", ":", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_presenter.py#L168-L172
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/mturk/connection.py
python
MTurkConnection.set_reviewing
(self, hit_id, revert=None)
return self._process_request('SetHITAsReviewing', params)
Update a HIT with a status of Reviewable to have a status of Reviewing, or reverts a Reviewing HIT back to the Reviewable status. Only HITs with a status of Reviewable can be updated with a status of Reviewing. Similarly, only Reviewing HITs can be reverted back to a status of Reviewab...
Update a HIT with a status of Reviewable to have a status of Reviewing, or reverts a Reviewing HIT back to the Reviewable status.
[ "Update", "a", "HIT", "with", "a", "status", "of", "Reviewable", "to", "have", "a", "status", "of", "Reviewing", "or", "reverts", "a", "Reviewing", "HIT", "back", "to", "the", "Reviewable", "status", "." ]
def set_reviewing(self, hit_id, revert=None): """ Update a HIT with a status of Reviewable to have a status of Reviewing, or reverts a Reviewing HIT back to the Reviewable status. Only HITs with a status of Reviewable can be updated with a status of Reviewing. Similarly, only R...
[ "def", "set_reviewing", "(", "self", ",", "hit_id", ",", "revert", "=", "None", ")", ":", "params", "=", "{", "'HITId'", ":", "hit_id", "}", "if", "revert", ":", "params", "[", "'Revert'", "]", "=", "revert", "return", "self", ".", "_process_request", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/mturk/connection.py#L468-L480