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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/datetime.py
python
datetime.hour
(self)
return self._hour
hour (0-23)
hour (0-23)
[ "hour", "(", "0", "-", "23", ")" ]
def hour(self): """hour (0-23)""" return self._hour
[ "def", "hour", "(", "self", ")", ":", "return", "self", ".", "_hour" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/datetime.py#L1554-L1556
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/labeled_tensor/python/ops/_typecheck.py
python
_type_repr
(t)
return string
A more succinct repr for typecheck tracebacks.
A more succinct repr for typecheck tracebacks.
[ "A", "more", "succinct", "repr", "for", "typecheck", "tracebacks", "." ]
def _type_repr(t): """A more succinct repr for typecheck tracebacks.""" string = repr(t) for type_, alias in _TYPE_ABBREVIATIONS.items(): string = string.replace(repr(type_), alias) string = re.sub(r"<(class|type) '([\w.]+)'>", r"\2", string) string = re.sub(r"typecheck\.(\w+)", r"\1", string) return st...
[ "def", "_type_repr", "(", "t", ")", ":", "string", "=", "repr", "(", "t", ")", "for", "type_", ",", "alias", "in", "_TYPE_ABBREVIATIONS", ".", "items", "(", ")", ":", "string", "=", "string", ".", "replace", "(", "repr", "(", "type_", ")", ",", "al...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/labeled_tensor/python/ops/_typecheck.py#L202-L209
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/pep425tags.py
python
get_impl_tag
()
return "{}{}".format(get_abbr_impl(), get_impl_ver())
Returns the Tag for this specific implementation.
Returns the Tag for this specific implementation.
[ "Returns", "the", "Tag", "for", "this", "specific", "implementation", "." ]
def get_impl_tag(): # type: () -> str """ Returns the Tag for this specific implementation. """ return "{}{}".format(get_abbr_impl(), get_impl_ver())
[ "def", "get_impl_tag", "(", ")", ":", "# type: () -> str", "return", "\"{}{}\"", ".", "format", "(", "get_abbr_impl", "(", ")", ",", "get_impl_ver", "(", ")", ")" ]
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/_internal/pep425tags.py#L75-L80
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py
python
Image.putdata
(self, data, scale=1.0, offset=0.0)
Copies pixel data to this image. This method copies data from a sequence object into the image, starting at the upper left corner (0, 0), and continuing until either the image or the sequence ends. The scale and offset values are used to adjust the sequence values: **pixel = value*scal...
Copies pixel data to this image. This method copies data from a sequence object into the image, starting at the upper left corner (0, 0), and continuing until either the image or the sequence ends. The scale and offset values are used to adjust the sequence values: **pixel = value*scal...
[ "Copies", "pixel", "data", "to", "this", "image", ".", "This", "method", "copies", "data", "from", "a", "sequence", "object", "into", "the", "image", "starting", "at", "the", "upper", "left", "corner", "(", "0", "0", ")", "and", "continuing", "until", "e...
def putdata(self, data, scale=1.0, offset=0.0): """ Copies pixel data to this image. This method copies data from a sequence object into the image, starting at the upper left corner (0, 0), and continuing until either the image or the sequence ends. The scale and offset values ...
[ "def", "putdata", "(", "self", ",", "data", ",", "scale", "=", "1.0", ",", "offset", "=", "0.0", ")", ":", "self", ".", "_ensure_mutable", "(", ")", "self", ".", "im", ".", "putdata", "(", "data", ",", "scale", ",", "offset", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py#L1639-L1654
bloomberg/bde
9c17f0041afa06511738c1a5a61d287e143d43ad
tools/lcov_cobertura/lcov_cobertura.py
python
LcovCobertura.parse
(self)
return coverage_data
Generate a data structure representing it that can be serialized in any logical format.
Generate a data structure representing it that can be serialized in any logical format.
[ "Generate", "a", "data", "structure", "representing", "it", "that", "can", "be", "serialized", "in", "any", "logical", "format", "." ]
def parse(self): """ Generate a data structure representing it that can be serialized in any logical format. """ coverage_data = { 'packages': {}, 'summary': {'lines-total': 0, 'lines-covered': 0, 'branches-total': 0, 'branches-cov...
[ "def", "parse", "(", "self", ")", ":", "coverage_data", "=", "{", "'packages'", ":", "{", "}", ",", "'summary'", ":", "{", "'lines-total'", ":", "0", ",", "'lines-covered'", ":", "0", ",", "'branches-total'", ":", "0", ",", "'branches-covered'", ":", "0"...
https://github.com/bloomberg/bde/blob/9c17f0041afa06511738c1a5a61d287e143d43ad/tools/lcov_cobertura/lcov_cobertura.py#L72-L200
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/ciconfig/evergreen.py
python
EvergreenProjectConfig.get_task
(self, task_name: str)
return self._tasks_by_name.get(task_name)
Return the task with the given name as a Task instance.
Return the task with the given name as a Task instance.
[ "Return", "the", "task", "with", "the", "given", "name", "as", "a", "Task", "instance", "." ]
def get_task(self, task_name: str) -> Task: """Return the task with the given name as a Task instance.""" return self._tasks_by_name.get(task_name)
[ "def", "get_task", "(", "self", ",", "task_name", ":", "str", ")", "->", "Task", ":", "return", "self", ".", "_tasks_by_name", ".", "get", "(", "task_name", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/ciconfig/evergreen.py#L69-L71
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.Pchify
(self, path, lang)
return '$(obj).%s/$(TARGET)/pch-%s/%s' % (self.toolset, lang, path)
Convert a prefix header path to its output directory form.
Convert a prefix header path to its output directory form.
[ "Convert", "a", "prefix", "header", "path", "to", "its", "output", "directory", "form", "." ]
def Pchify(self, path, lang): """Convert a prefix header path to its output directory form.""" path = self.Absolutify(path) if '$(' in path: path = path.replace('$(obj)/', '$(obj).%s/$(TARGET)/pch-%s' % (self.toolset, lang)) return path return '$(obj).%s/$(TARGET)/p...
[ "def", "Pchify", "(", "self", ",", "path", ",", "lang", ")", ":", "path", "=", "self", ".", "Absolutify", "(", "path", ")", "if", "'$('", "in", "path", ":", "path", "=", "path", ".", "replace", "(", "'$(obj)/'", ",", "'$(obj).%s/$(TARGET)/pch-%s'", "%"...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L1918-L1925
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
validateNmtokensValue
(value)
return ret
Validate that the given value match Nmtokens production [ VC: Name Token ]
Validate that the given value match Nmtokens production [ VC: Name Token ]
[ "Validate", "that", "the", "given", "value", "match", "Nmtokens", "production", "[", "VC", ":", "Name", "Token", "]" ]
def validateNmtokensValue(value): """Validate that the given value match Nmtokens production [ VC: Name Token ] """ ret = libxml2mod.xmlValidateNmtokensValue(value) return ret
[ "def", "validateNmtokensValue", "(", "value", ")", ":", "ret", "=", "libxml2mod", ".", "xmlValidateNmtokensValue", "(", "value", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L1800-L1804
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/utils.py
python
parse_timestamp
(value)
Parse a timestamp into a datetime object. Supported formats: * iso8601 * rfc822 * epoch (value is an integer) This will return a ``datetime.datetime`` object.
Parse a timestamp into a datetime object.
[ "Parse", "a", "timestamp", "into", "a", "datetime", "object", "." ]
def parse_timestamp(value): """Parse a timestamp into a datetime object. Supported formats: * iso8601 * rfc822 * epoch (value is an integer) This will return a ``datetime.datetime`` object. """ for tzinfo in get_tzinfo_options(): try: return _parse_tim...
[ "def", "parse_timestamp", "(", "value", ")", ":", "for", "tzinfo", "in", "get_tzinfo_options", "(", ")", ":", "try", ":", "return", "_parse_timestamp_with_tzinfo", "(", "value", ",", "tzinfo", ")", "except", "OSError", "as", "e", ":", "logger", ".", "debug",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/utils.py#L612-L631
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py
python
screen.newline
(self)
This is an alias for crlf().
This is an alias for crlf().
[ "This", "is", "an", "alias", "for", "crlf", "()", "." ]
def newline (self): '''This is an alias for crlf(). ''' self.crlf()
[ "def", "newline", "(", "self", ")", ":", "self", ".", "crlf", "(", ")" ]
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L194-L198
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
PyApp.SetMacPreferencesMenuItemId
(*args, **kwargs)
return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
SetMacPreferencesMenuItemId(long val)
SetMacPreferencesMenuItemId(long val)
[ "SetMacPreferencesMenuItemId", "(", "long", "val", ")" ]
def SetMacPreferencesMenuItemId(*args, **kwargs): """SetMacPreferencesMenuItemId(long val)""" return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
[ "def", "SetMacPreferencesMenuItemId", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PyApp_SetMacPreferencesMenuItemId", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L8175-L8177
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad_experimental/grad_inner_ops.py
python
get_bprop_roll
(self)
return bprop
Generate bprop for Roll
Generate bprop for Roll
[ "Generate", "bprop", "for", "Roll" ]
def get_bprop_roll(self): """Generate bprop for Roll""" shift = self.shift axis = self.axis roll_grad = inner.Roll(-shift, axis) def bprop(x_input, out, dout): dx = roll_grad(dout) return (dx,) return bprop
[ "def", "get_bprop_roll", "(", "self", ")", ":", "shift", "=", "self", ".", "shift", "axis", "=", "self", ".", "axis", "roll_grad", "=", "inner", ".", "Roll", "(", "-", "shift", ",", "axis", ")", "def", "bprop", "(", "x_input", ",", "out", ",", "dou...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad_experimental/grad_inner_ops.py#L40-L50
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
SearchCtrl.SetSearchBitmap
(*args, **kwargs)
return _controls_.SearchCtrl_SetSearchBitmap(*args, **kwargs)
SetSearchBitmap(self, Bitmap ?) Sets the bitmap to use for the search button. This currently does not work on the Mac.
SetSearchBitmap(self, Bitmap ?)
[ "SetSearchBitmap", "(", "self", "Bitmap", "?", ")" ]
def SetSearchBitmap(*args, **kwargs): """ SetSearchBitmap(self, Bitmap ?) Sets the bitmap to use for the search button. This currently does not work on the Mac. """ return _controls_.SearchCtrl_SetSearchBitmap(*args, **kwargs)
[ "def", "SetSearchBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "SearchCtrl_SetSearchBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L7571-L7578
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/Bastion.py
python
BastionClass.__getattr__
(self, name)
return attribute
Get an as-yet undefined attribute value. This calls the get() function that was passed to the constructor. The result is stored as an instance variable so that the next time the same attribute is requested, __getattr__() won't be invoked. If the get() function raises an except...
Get an as-yet undefined attribute value.
[ "Get", "an", "as", "-", "yet", "undefined", "attribute", "value", "." ]
def __getattr__(self, name): """Get an as-yet undefined attribute value. This calls the get() function that was passed to the constructor. The result is stored as an instance variable so that the next time the same attribute is requested, __getattr__() won't be invoked. ...
[ "def", "__getattr__", "(", "self", ",", "name", ")", ":", "attribute", "=", "self", ".", "_get_", "(", "name", ")", "self", ".", "__dict__", "[", "name", "]", "=", "attribute", "return", "attribute" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/Bastion.py#L70-L84
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-automation/autothreadharness/pdu_controller.py
python
PduController.reboot
(self, **params)
Reboot an outlet or a board passed as params
Reboot an outlet or a board passed as params
[ "Reboot", "an", "outlet", "or", "a", "board", "passed", "as", "params" ]
def reboot(self, **params): """Reboot an outlet or a board passed as params""" raise NotImplementedError
[ "def", "reboot", "(", "self", ",", "*", "*", "params", ")", ":", "raise", "NotImplementedError" ]
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-automation/autothreadharness/pdu_controller.py#L57-L59
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
DC.DrawRectangleList
(self, rectangles, pens=None, brushes=None)
return self._DrawRectangleList(rectangles, pens, brushes)
Draw a list of rectangles as quickly as possible. :param rectangles: A sequence of 4-element sequences representing each rectangle to draw, (x,y, w,h). :param pens: If None, then the current pen is used. If a single pen then it will b...
Draw a list of rectangles as quickly as possible.
[ "Draw", "a", "list", "of", "rectangles", "as", "quickly", "as", "possible", "." ]
def DrawRectangleList(self, rectangles, pens=None, brushes=None): """ Draw a list of rectangles as quickly as possible. :param rectangles: A sequence of 4-element sequences representing each rectangle to draw, (x,y, w,h). :param pens: If None, the...
[ "def", "DrawRectangleList", "(", "self", ",", "rectangles", ",", "pens", "=", "None", ",", "brushes", "=", "None", ")", ":", "if", "pens", "is", "None", ":", "pens", "=", "[", "]", "elif", "isinstance", "(", "pens", ",", "wx", ".", "Pen", ")", ":",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L4711-L4736
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/parallel/_utils.py
python
_check_task_sink_envs
()
return True
Check whether task_sink environment variables have been exported or not. return True if task_sink environment variables have been exported, False otherwise.
Check whether task_sink environment variables have been exported or not.
[ "Check", "whether", "task_sink", "environment", "variables", "have", "been", "exported", "or", "not", "." ]
def _check_task_sink_envs(): """ Check whether task_sink environment variables have been exported or not. return True if task_sink environment variables have been exported, False otherwise. """ import os task_sink = os.getenv("GRAPH_OP_RUN") if task_sink and task_sink.isdigit() and int(task...
[ "def", "_check_task_sink_envs", "(", ")", ":", "import", "os", "task_sink", "=", "os", ".", "getenv", "(", "\"GRAPH_OP_RUN\"", ")", "if", "task_sink", "and", "task_sink", ".", "isdigit", "(", ")", "and", "int", "(", "task_sink", ")", "==", "1", ":", "ret...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/_utils.py#L47-L57
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/sping/PDF/pdfutils.py
python
_AsciiHexDecode
(input)
return output.read()
Not used except to provide a test of the preceding
Not used except to provide a test of the preceding
[ "Not", "used", "except", "to", "provide", "a", "test", "of", "the", "preceding" ]
def _AsciiHexDecode(input): "Not used except to provide a test of the preceding" # strip out all whitespace stripped = ''.join(input.split(), '') assert stripped[-1] == '>', 'Invalid terminator for Ascii Hex Stream' stripped = stripped[:-1] # chop off terminator assert len(stripped) % 2 == 0, '...
[ "def", "_AsciiHexDecode", "(", "input", ")", ":", "# strip out all whitespace", "stripped", "=", "''", ".", "join", "(", "input", ".", "split", "(", ")", ",", "''", ")", "assert", "stripped", "[", "-", "1", "]", "==", "'>'", ",", "'Invalid terminator for A...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/PDF/pdfutils.py#L124-L138
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/xml/dom/expatbuilder.py
python
Namespaces.start_namespace_decl_handler
(self, prefix, uri)
Push this namespace declaration on our storage.
Push this namespace declaration on our storage.
[ "Push", "this", "namespace", "declaration", "on", "our", "storage", "." ]
def start_namespace_decl_handler(self, prefix, uri): """Push this namespace declaration on our storage.""" self._ns_ordered_prefixes.append((prefix, uri))
[ "def", "start_namespace_decl_handler", "(", "self", ",", "prefix", ",", "uri", ")", ":", "self", ".", "_ns_ordered_prefixes", ".", "append", "(", "(", "prefix", ",", "uri", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/xml/dom/expatbuilder.py#L739-L741
nasa/meshNetwork
ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c
python/mesh/generic/checksum.py
python
calc8bitFletcherChecksum
(msgBytes)
return [ck_A & 0xFF, ck_B & 0xFF]
Calculate 8-bit Fletcher checksum for Li-1 radio packets. Args: msgBytes: Raw message bytes to calculate checksum of.
Calculate 8-bit Fletcher checksum for Li-1 radio packets.
[ "Calculate", "8", "-", "bit", "Fletcher", "checksum", "for", "Li", "-", "1", "radio", "packets", "." ]
def calc8bitFletcherChecksum(msgBytes): """Calculate 8-bit Fletcher checksum for Li-1 radio packets. Args: msgBytes: Raw message bytes to calculate checksum of. """ ck_A = 0 ck_B = 0 for msgByte in msgBytes: ck_A += int(msgByte) ck_B += ck_A return [ck_A & 0xFF, ck_...
[ "def", "calc8bitFletcherChecksum", "(", "msgBytes", ")", ":", "ck_A", "=", "0", "ck_B", "=", "0", "for", "msgByte", "in", "msgBytes", ":", "ck_A", "+=", "int", "(", "msgByte", ")", "ck_B", "+=", "ck_A", "return", "[", "ck_A", "&", "0xFF", ",", "ck_B", ...
https://github.com/nasa/meshNetwork/blob/ff4bd66e0ca6bd424fd8897a97252bb3925d8b3c/python/mesh/generic/checksum.py#L3-L15
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/p4util/util.py
python
get_memory
()
return core.get_memory()
Function to return the total memory allocation.
Function to return the total memory allocation.
[ "Function", "to", "return", "the", "total", "memory", "allocation", "." ]
def get_memory(): """Function to return the total memory allocation.""" return core.get_memory()
[ "def", "get_memory", "(", ")", ":", "return", "core", ".", "get_memory", "(", ")" ]
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/p4util/util.py#L201-L203
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
third-party/benchmark/bindings/python/google_benchmark/example.py
python
custom_counters
(state)
Collect cutom metric using benchmark.Counter.
Collect cutom metric using benchmark.Counter.
[ "Collect", "cutom", "metric", "using", "benchmark", ".", "Counter", "." ]
def custom_counters(state): """Collect cutom metric using benchmark.Counter.""" num_foo = 0.0 while state: # Benchmark some code here pass # Collect some custom metric named foo num_foo += 0.13 # Automatic Counter from numbers. state.counters["foo"] = num_foo # S...
[ "def", "custom_counters", "(", "state", ")", ":", "num_foo", "=", "0.0", "while", "state", ":", "# Benchmark some code here", "pass", "# Collect some custom metric named foo", "num_foo", "+=", "0.13", "# Automatic Counter from numbers.", "state", ".", "counters", "[", "...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/third-party/benchmark/bindings/python/google_benchmark/example.py#L74-L92
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
ScrollHelper.GetScrollPageSize
(*args, **kwargs)
return _windows_.ScrollHelper_GetScrollPageSize(*args, **kwargs)
GetScrollPageSize(self, int orient) -> int
GetScrollPageSize(self, int orient) -> int
[ "GetScrollPageSize", "(", "self", "int", "orient", ")", "-", ">", "int" ]
def GetScrollPageSize(*args, **kwargs): """GetScrollPageSize(self, int orient) -> int""" return _windows_.ScrollHelper_GetScrollPageSize(*args, **kwargs)
[ "def", "GetScrollPageSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "ScrollHelper_GetScrollPageSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L159-L161
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/email/utils.py
python
encode_rfc2231
(s, charset=None, language=None)
return "%s'%s'%s" % (charset, language, s)
Encode string according to RFC 2231. If neither charset nor language is given, then s is returned as-is. If charset is given but not language, the string is encoded using the empty string for language.
Encode string according to RFC 2231.
[ "Encode", "string", "according", "to", "RFC", "2231", "." ]
def encode_rfc2231(s, charset=None, language=None): """Encode string according to RFC 2231. If neither charset nor language is given, then s is returned as-is. If charset is given but not language, the string is encoded using the empty string for language. """ import urllib s = urllib.quot...
[ "def", "encode_rfc2231", "(", "s", ",", "charset", "=", "None", ",", "language", "=", "None", ")", ":", "import", "urllib", "s", "=", "urllib", ".", "quote", "(", "s", ",", "safe", "=", "''", ")", "if", "charset", "is", "None", "and", "language", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/utils.py#L247-L260
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py
python
EmacsMode.backward_kill_line
(self, e)
Kill backward to the beginning of the line.
Kill backward to the beginning of the line.
[ "Kill", "backward", "to", "the", "beginning", "of", "the", "line", "." ]
def backward_kill_line(self, e): # (C-x Rubout) '''Kill backward to the beginning of the line. ''' self.l_buffer.backward_kill_line()
[ "def", "backward_kill_line", "(", "self", ",", "e", ")", ":", "# (C-x Rubout)", "self", ".", "l_buffer", ".", "backward_kill_line", "(", ")" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L313-L315
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/api.py
python
pinned_array
(shape, dtype=np.float, strides=None, order='C')
return np.ndarray(shape=shape, strides=strides, dtype=dtype, order=order, buffer=buffer)
pinned_array(shape, dtype=np.float, strides=None, order='C') Allocate a np.ndarray with a buffer that is pinned (pagelocked). Similar to np.empty().
pinned_array(shape, dtype=np.float, strides=None, order='C')
[ "pinned_array", "(", "shape", "dtype", "=", "np", ".", "float", "strides", "=", "None", "order", "=", "C", ")" ]
def pinned_array(shape, dtype=np.float, strides=None, order='C'): """pinned_array(shape, dtype=np.float, strides=None, order='C') Allocate a np.ndarray with a buffer that is pinned (pagelocked). Similar to np.empty(). """ shape, strides, dtype = _prepare_shape_strides_dtype(shape, strides, dtype, ...
[ "def", "pinned_array", "(", "shape", ",", "dtype", "=", "np", ".", "float", ",", "strides", "=", "None", ",", "order", "=", "'C'", ")", ":", "shape", ",", "strides", ",", "dtype", "=", "_prepare_shape_strides_dtype", "(", "shape", ",", "strides", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/api.py#L131-L143
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/core/defchararray.py
python
chararray.__gt__
(self, other)
return greater(self, other)
Return (self > other) element-wise. See also -------- greater
Return (self > other) element-wise.
[ "Return", "(", "self", ">", "other", ")", "element", "-", "wise", "." ]
def __gt__(self, other): """ Return (self > other) element-wise. See also -------- greater """ return greater(self, other)
[ "def", "__gt__", "(", "self", ",", "other", ")", ":", "return", "greater", "(", "self", ",", "other", ")" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/defchararray.py#L1932-L1940
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/_cpdispatch.py
python
MethodDispatcher.__call__
(self, path_info)
Set handler and config for the current request.
Set handler and config for the current request.
[ "Set", "handler", "and", "config", "for", "the", "current", "request", "." ]
def __call__(self, path_info): """Set handler and config for the current request.""" request = cherrypy.serving.request resource, vpath = self.find_handler(path_info) if resource: # Set Allow header avail = [m for m in dir(resource) if m.isupper()] ...
[ "def", "__call__", "(", "self", ",", "path_info", ")", ":", "request", "=", "cherrypy", ".", "serving", ".", "request", "resource", ",", "vpath", "=", "self", ".", "find_handler", "(", "path_info", ")", "if", "resource", ":", "# Set Allow header", "avail", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cpdispatch.py#L420-L449
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/wiredtiger/src/docs/tools/doxypy.py
python
FSM.makeTransition
(self, input)
Makes a transition based on the given input. @param input input to parse by the FSM
Makes a transition based on the given input.
[ "Makes", "a", "transition", "based", "on", "the", "given", "input", "." ]
def makeTransition(self, input): """Makes a transition based on the given input. @param input input to parse by the FSM """ for transition in self.transitions: [from_state, to_state, condition, callback] = transition if from_state == self.current_state: match = condition(input) if match: s...
[ "def", "makeTransition", "(", "self", ",", "input", ")", ":", "for", "transition", "in", "self", ".", "transitions", ":", "[", "from_state", ",", "to_state", ",", "condition", ",", "callback", "]", "=", "transition", "if", "from_state", "==", "self", ".", ...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/wiredtiger/src/docs/tools/doxypy.py#L75-L91
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/utils/io/io_xml.py
python
read_dict
(data, delims="{}", split=",", key_split=":", strip=" \n\t")
return rdict
Reads a formatted string and outputs a dictionary. The format is as for standard python dictionaries, which is {keyword[0]: arg[0], keyword[1]: arg[1], ... , keyword[n]: arg[n]}. Note the comma separators, and the use of curly brackets. Args: data: The string to be read in. delims: A string of...
Reads a formatted string and outputs a dictionary.
[ "Reads", "a", "formatted", "string", "and", "outputs", "a", "dictionary", "." ]
def read_dict(data, delims="{}", split=",", key_split=":", strip=" \n\t"): """Reads a formatted string and outputs a dictionary. The format is as for standard python dictionaries, which is {keyword[0]: arg[0], keyword[1]: arg[1], ... , keyword[n]: arg[n]}. Note the comma separators, and the use of curly br...
[ "def", "read_dict", "(", "data", ",", "delims", "=", "\"{}\"", ",", "split", "=", "\",\"", ",", "key_split", "=", "\":\"", ",", "strip", "=", "\" \\n\\t\"", ")", ":", "rlist", "=", "read_list", "(", "data", ",", "delims", "=", "delims", ",", "split", ...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/utils/io/io_xml.py#L368-L401
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/ContactStructuralMechanicsApplication/python_scripts/search_base_process.py
python
SearchBaseProcess.ExecuteFinalize
(self)
This method is executed in order to finalize the current computation Keyword arguments: self -- It signifies an instance of a class.
This method is executed in order to finalize the current computation
[ "This", "method", "is", "executed", "in", "order", "to", "finalize", "the", "current", "computation" ]
def ExecuteFinalize(self): """ This method is executed in order to finalize the current computation Keyword arguments: self -- It signifies an instance of a class. """ pass
[ "def", "ExecuteFinalize", "(", "self", ")", ":", "pass" ]
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/search_base_process.py#L275-L281
microsoft/AirSim
8057725712c0cd46979135396381784075ffc0f3
PythonClient/airsim/utils.py
python
write_file
(filename, bstr)
Write binary data to file. Used for writing compressed PNG images
Write binary data to file. Used for writing compressed PNG images
[ "Write", "binary", "data", "to", "file", ".", "Used", "for", "writing", "compressed", "PNG", "images" ]
def write_file(filename, bstr): """ Write binary data to file. Used for writing compressed PNG images """ with open(filename, 'wb') as afile: afile.write(bstr)
[ "def", "write_file", "(", "filename", ",", "bstr", ")", ":", "with", "open", "(", "filename", ",", "'wb'", ")", "as", "afile", ":", "afile", ".", "write", "(", "bstr", ")" ]
https://github.com/microsoft/AirSim/blob/8057725712c0cd46979135396381784075ffc0f3/PythonClient/airsim/utils.py#L44-L50
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/sync_replicas_optimizer.py
python
SyncReplicasOptimizer.apply_gradients
(self, grads_and_vars, global_step=None, name=None)
Apply gradients to variables. This contains most of the synchronization implementation and also wraps the apply_gradients() from the real optimizer. Args: grads_and_vars: List of (gradient, variable) pairs as returned by compute_gradients(). global_step: Optional Variable to increment ...
Apply gradients to variables.
[ "Apply", "gradients", "to", "variables", "." ]
def apply_gradients(self, grads_and_vars, global_step=None, name=None): """Apply gradients to variables. This contains most of the synchronization implementation and also wraps the apply_gradients() from the real optimizer. Args: grads_and_vars: List of (gradient, variable) pairs as returned by ...
[ "def", "apply_gradients", "(", "self", ",", "grads_and_vars", ",", "global_step", "=", "None", ",", "name", "=", "None", ")", ":", "if", "not", "grads_and_vars", ":", "raise", "ValueError", "(", "\"Must supply at least one variable\"", ")", "if", "global_step", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/sync_replicas_optimizer.py#L698-L847
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/saving/saved_model_experimental.py
python
_export_model_variables
(model, saved_model_path)
return checkpoint_prefix
Saves model weights in checkpoint format under variables folder.
Saves model weights in checkpoint format under variables folder.
[ "Saves", "model", "weights", "in", "checkpoint", "format", "under", "variables", "folder", "." ]
def _export_model_variables(model, saved_model_path): """Saves model weights in checkpoint format under variables folder.""" _get_or_create_variables_dir(saved_model_path) checkpoint_prefix = _get_variables_path(saved_model_path) model.save_weights(checkpoint_prefix, save_format='tf', overwrite=True) return c...
[ "def", "_export_model_variables", "(", "model", ",", "saved_model_path", ")", ":", "_get_or_create_variables_dir", "(", "saved_model_path", ")", "checkpoint_prefix", "=", "_get_variables_path", "(", "saved_model_path", ")", "model", ".", "save_weights", "(", "checkpoint_p...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saved_model_experimental.py#L158-L163
dscharrer/innoextract
5519d364cc8898f906f6285d81a87ab8c5469cde
cmake/cpplint.py
python
_SetCountingStyle
(level)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def _SetCountingStyle(level): """Sets the module's counting options.""" _cpplint_state.SetCountingStyle(level)
[ "def", "_SetCountingStyle", "(", "level", ")", ":", "_cpplint_state", ".", "SetCountingStyle", "(", "level", ")" ]
https://github.com/dscharrer/innoextract/blob/5519d364cc8898f906f6285d81a87ab8c5469cde/cmake/cpplint.py#L652-L654
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/top/nn.py
python
schedule_dense
(_, outs, target)
Schedule definition of dense
Schedule definition of dense
[ "Schedule", "definition", "of", "dense" ]
def schedule_dense(_, outs, target): """Schedule definition of dense""" with tvm.target.create(target): return topi.generic.schedule_dense(outs)
[ "def", "schedule_dense", "(", "_", ",", "outs", ",", "target", ")", ":", "with", "tvm", ".", "target", ".", "create", "(", "target", ")", ":", "return", "topi", ".", "generic", ".", "schedule_dense", "(", "outs", ")" ]
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/top/nn.py#L69-L72
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html.py
python
HtmlBookRecord.SetBasePath
(*args, **kwargs)
return _html.HtmlBookRecord_SetBasePath(*args, **kwargs)
SetBasePath(self, String path)
SetBasePath(self, String path)
[ "SetBasePath", "(", "self", "String", "path", ")" ]
def SetBasePath(*args, **kwargs): """SetBasePath(self, String path)""" return _html.HtmlBookRecord_SetBasePath(*args, **kwargs)
[ "def", "SetBasePath", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlBookRecord_SetBasePath", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L1443-L1445
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/smtplib.py
python
SMTP.helo
(self, name='')
return (code, msg)
SMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host.
SMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host.
[ "SMTP", "helo", "command", ".", "Hostname", "to", "send", "for", "this", "command", "defaults", "to", "the", "FQDN", "of", "the", "local", "host", "." ]
def helo(self, name=''): """SMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host. """ self.putcmd("helo", name or self.local_hostname) (code, msg) = self.getreply() self.helo_resp = msg return (code, msg)
[ "def", "helo", "(", "self", ",", "name", "=", "''", ")", ":", "self", ".", "putcmd", "(", "\"helo\"", ",", "name", "or", "self", ".", "local_hostname", ")", "(", "code", ",", "msg", ")", "=", "self", ".", "getreply", "(", ")", "self", ".", "helo_...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/smtplib.py#L398-L406
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
TextBoxAttr.GetRight
(*args)
return _richtext.TextBoxAttr_GetRight(*args)
GetRight(self) -> TextAttrDimension GetRight(self) -> TextAttrDimension
GetRight(self) -> TextAttrDimension GetRight(self) -> TextAttrDimension
[ "GetRight", "(", "self", ")", "-", ">", "TextAttrDimension", "GetRight", "(", "self", ")", "-", ">", "TextAttrDimension" ]
def GetRight(*args): """ GetRight(self) -> TextAttrDimension GetRight(self) -> TextAttrDimension """ return _richtext.TextBoxAttr_GetRight(*args)
[ "def", "GetRight", "(", "*", "args", ")", ":", "return", "_richtext", ".", "TextBoxAttr_GetRight", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L677-L682
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
TextEntryBase.IsEmpty
(*args, **kwargs)
return _core_.TextEntryBase_IsEmpty(*args, **kwargs)
IsEmpty(self) -> bool Returns True if the value in the text field is empty.
IsEmpty(self) -> bool
[ "IsEmpty", "(", "self", ")", "-", ">", "bool" ]
def IsEmpty(*args, **kwargs): """ IsEmpty(self) -> bool Returns True if the value in the text field is empty. """ return _core_.TextEntryBase_IsEmpty(*args, **kwargs)
[ "def", "IsEmpty", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "TextEntryBase_IsEmpty", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L13124-L13130
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/archive_util.py
python
_get_gid
(name)
return None
Returns a gid, given a group name.
Returns a gid, given a group name.
[ "Returns", "a", "gid", "given", "a", "group", "name", "." ]
def _get_gid(name): """Returns a gid, given a group name.""" if getgrnam is None or name is None: return None try: result = getgrnam(name) except KeyError: result = None if result is not None: return result[2] return None
[ "def", "_get_gid", "(", "name", ")", ":", "if", "getgrnam", "is", "None", "or", "name", "is", "None", ":", "return", "None", "try", ":", "result", "=", "getgrnam", "(", "name", ")", "except", "KeyError", ":", "result", "=", "None", "if", "result", "i...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/archive_util.py#L31-L41
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
GLGenerator.WriteGLES2InterfaceStubImpl
(self, filename)
Writes the GLES2 interface header.
Writes the GLES2 interface header.
[ "Writes", "the", "GLES2", "interface", "header", "." ]
def WriteGLES2InterfaceStubImpl(self, filename): """Writes the GLES2 interface header.""" file = CHeaderWriter( filename, "// This file is included by gles2_interface_stub.cc.\n") for func in self.original_functions: func.WriteGLES2InterfaceStubImpl(file) file.Close()
[ "def", "WriteGLES2InterfaceStubImpl", "(", "self", ",", "filename", ")", ":", "file", "=", "CHeaderWriter", "(", "filename", ",", "\"// This file is included by gles2_interface_stub.cc.\\n\"", ")", "for", "func", "in", "self", ".", "original_functions", ":", "func", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L7466-L7473
epam/Indigo
30e40b4b1eb9bae0207435a26cfcb81ddcc42be1
api/python/indigo/__init__.py
python
IndigoObject.isChiral
(self)
return bool( self.dispatcher._checkResult(Indigo._lib.indigoIsChiral(self.id)) )
Molecule method returns True if the structure contains chiral flag Returns: bool: True if contains chiral flag, False otherwise
Molecule method returns True if the structure contains chiral flag
[ "Molecule", "method", "returns", "True", "if", "the", "structure", "contains", "chiral", "flag" ]
def isChiral(self): """Molecule method returns True if the structure contains chiral flag Returns: bool: True if contains chiral flag, False otherwise """ self.dispatcher._setSessionId() return bool( self.dispatcher._checkResult(Indigo._lib.indigoIsChiral...
[ "def", "isChiral", "(", "self", ")", ":", "self", ".", "dispatcher", ".", "_setSessionId", "(", ")", "return", "bool", "(", "self", ".", "dispatcher", ".", "_checkResult", "(", "Indigo", ".", "_lib", ".", "indigoIsChiral", "(", "self", ".", "id", ")", ...
https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L3230-L3239
cinder/Cinder
e83f5bb9c01a63eec20168d02953a0879e5100f7
docs/libs/bs4/builder/__init__.py
python
TreeBuilder.can_be_empty_element
(self, tag_name)
return tag_name in self.empty_element_tags
Might a tag with this name be an empty-element tag? The final markup may or may not actually present this tag as self-closing. For instance: an HTMLBuilder does not consider a <p> tag to be an empty-element tag (it's not in HTMLBuilder.empty_element_tags). This means an empty <...
Might a tag with this name be an empty-element tag?
[ "Might", "a", "tag", "with", "this", "name", "be", "an", "empty", "-", "element", "tag?" ]
def can_be_empty_element(self, tag_name): """Might a tag with this name be an empty-element tag? The final markup may or may not actually present this tag as self-closing. For instance: an HTMLBuilder does not consider a <p> tag to be an empty-element tag (it's not in H...
[ "def", "can_be_empty_element", "(", "self", ",", "tag_name", ")", ":", "if", "self", ".", "empty_element_tags", "is", "None", ":", "return", "True", "return", "tag_name", "in", "self", ".", "empty_element_tags" ]
https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/bs4/builder/__init__.py#L101-L120
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
Timer.IsRunning
(*args, **kwargs)
return _misc_.Timer_IsRunning(*args, **kwargs)
IsRunning(self) -> bool
IsRunning(self) -> bool
[ "IsRunning", "(", "self", ")", "-", ">", "bool" ]
def IsRunning(*args, **kwargs): """IsRunning(self) -> bool""" return _misc_.Timer_IsRunning(*args, **kwargs)
[ "def", "IsRunning", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Timer_IsRunning", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L1334-L1336
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/concat.py
python
get_dtype_kinds
(l)
return typs
Parameters ---------- l : list of arrays Returns ------- a set of kinds that exist in this list of arrays
Parameters ---------- l : list of arrays
[ "Parameters", "----------", "l", ":", "list", "of", "arrays" ]
def get_dtype_kinds(l): """ Parameters ---------- l : list of arrays Returns ------- a set of kinds that exist in this list of arrays """ typs = set() for arr in l: dtype = arr.dtype if is_categorical_dtype(dtype): typ = "category" elif is_s...
[ "def", "get_dtype_kinds", "(", "l", ")", ":", "typs", "=", "set", "(", ")", "for", "arr", "in", "l", ":", "dtype", "=", "arr", ".", "dtype", "if", "is_categorical_dtype", "(", "dtype", ")", ":", "typ", "=", "\"category\"", "elif", "is_sparse", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/concat.py#L31-L69
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/bliptv/bliptv_api.py
python
Videos.searchTitle
(self, title, pagenumber, pagelen)
return elements_final
Key word video search of the blip.tv web site return an array of matching item dictionaries return
Key word video search of the blip.tv web site return an array of matching item dictionaries return
[ "Key", "word", "video", "search", "of", "the", "blip", ".", "tv", "web", "site", "return", "an", "array", "of", "matching", "item", "dictionaries", "return" ]
def searchTitle(self, title, pagenumber, pagelen): '''Key word video search of the blip.tv web site return an array of matching item dictionaries return ''' url = self.config['urls']['video.search'] % (urllib.parse.quote_plus(title.encode("utf-8")), pagenumber, pagelen, self.conf...
[ "def", "searchTitle", "(", "self", ",", "title", ",", "pagenumber", ",", "pagelen", ")", ":", "url", "=", "self", ".", "config", "[", "'urls'", "]", "[", "'video.search'", "]", "%", "(", "urllib", ".", "parse", ".", "quote_plus", "(", "title", ".", "...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/bliptv/bliptv_api.py#L416-L515
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/cr/cr/base/client.py
python
ReadGClient
()
return result
Loads the .gclient configuration for the current client. This will load from CR_CLIENT_PATH. Returns: The dict of values set in the .gclient file.
Loads the .gclient configuration for the current client.
[ "Loads", "the", ".", "gclient", "configuration", "for", "the", "current", "client", "." ]
def ReadGClient(): """Loads the .gclient configuration for the current client. This will load from CR_CLIENT_PATH. Returns: The dict of values set in the .gclient file. """ # Now attempt to load and parse the .gclient file result = {} try: gclient_file = cr.context.Substitute( os.path.j...
[ "def", "ReadGClient", "(", ")", ":", "# Now attempt to load and parse the .gclient file", "result", "=", "{", "}", "try", ":", "gclient_file", "=", "cr", ".", "context", ".", "Substitute", "(", "os", ".", "path", ".", "join", "(", "'{CR_CLIENT_PATH}'", ",", "G...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cr/cr/base/client.py#L163-L183
thunil/tempoGAN
a9b92181e28a82c2029049791f875a6c1341d62b
tensorflow/tools/tilecreator_t.py
python
TileCreator.getRandomDatum
(self, isTraining=True, tile_t = 1)
return self.getDatum(randNo*self.dim_t+randFrame, tile_t)
returns a copy of a random frame
returns a copy of a random frame
[ "returns", "a", "copy", "of", "a", "random", "frame" ]
def getRandomDatum(self, isTraining=True, tile_t = 1): '''returns a copy of a random frame''' if isTraining: randNo = randrange(0, self.setBorders[0]) else: randNo = randrange(self.setBorders[0], self.setBorders[1]) randFrame = 0 if tile_t<self.dim_t: randFrame = randrange(0, self.dim_t - tile_t) e...
[ "def", "getRandomDatum", "(", "self", ",", "isTraining", "=", "True", ",", "tile_t", "=", "1", ")", ":", "if", "isTraining", ":", "randNo", "=", "randrange", "(", "0", ",", "self", ".", "setBorders", "[", "0", "]", ")", "else", ":", "randNo", "=", ...
https://github.com/thunil/tempoGAN/blob/a9b92181e28a82c2029049791f875a6c1341d62b/tensorflow/tools/tilecreator_t.py#L518-L530
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/cookielib.py
python
CookieJar.clear_expired_cookies
(self)
Discard all expired cookies. You probably don't need to call this method: expired cookies are never sent back to the server (provided you're using DefaultCookiePolicy), this method is called by CookieJar itself every so often, and the .save() method won't save expired cookies anyway (un...
Discard all expired cookies.
[ "Discard", "all", "expired", "cookies", "." ]
def clear_expired_cookies(self): """Discard all expired cookies. You probably don't need to call this method: expired cookies are never sent back to the server (provided you're using DefaultCookiePolicy), this method is called by CookieJar itself every so often, and the .save() ...
[ "def", "clear_expired_cookies", "(", "self", ")", ":", "self", ".", "_cookies_lock", ".", "acquire", "(", ")", "try", ":", "now", "=", "time", ".", "time", "(", ")", "for", "cookie", "in", "self", ":", "if", "cookie", ".", "is_expired", "(", "now", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/cookielib.py#L1707-L1724
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/ma/core.py
python
mvoid.__iter__
(self)
Defines an iterator for mvoid
Defines an iterator for mvoid
[ "Defines", "an", "iterator", "for", "mvoid" ]
def __iter__(self): "Defines an iterator for mvoid" (_data, _mask) = (self._data, self._mask) if _mask is nomask: yield from _data else: for (d, m) in zip(_data, _mask): if m: yield masked else: ...
[ "def", "__iter__", "(", "self", ")", ":", "(", "_data", ",", "_mask", ")", "=", "(", "self", ".", "_data", ",", "self", ".", "_mask", ")", "if", "_mask", "is", "nomask", ":", "yield", "from", "_data", "else", ":", "for", "(", "d", ",", "m", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/core.py#L6306-L6316
rdiankov/openrave
d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7
python/databases/convexdecomposition.py
python
ConvexDecompositionModel.testPointsInside
(self,points)
return inside
tests if a point is inside the convex mesh of the robot. Returns an array the same length as points that specifies whether the point is in or not. This method is not meant to be optimized (use C++ for that).
tests if a point is inside the convex mesh of the robot.
[ "tests", "if", "a", "point", "is", "inside", "the", "convex", "mesh", "of", "the", "robot", "." ]
def testPointsInside(self,points): """tests if a point is inside the convex mesh of the robot. Returns an array the same length as points that specifies whether the point is in or not. This method is not meant to be optimized (use C++ for that). """ with self.env: inside = z...
[ "def", "testPointsInside", "(", "self", ",", "points", ")", ":", "with", "self", ".", "env", ":", "inside", "=", "zeros", "(", "len", "(", "points", ")", ",", "bool", ")", "leftinds", "=", "arange", "(", "len", "(", "points", ")", ")", "leftpoints", ...
https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/databases/convexdecomposition.py#L462-L505
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/math/so2.py
python
interp
(a : float, b : float, u : float)
return a + diff(b,a)*u
interpolates on the geodesic between angles a and b, with interpolation parameter u in the range [0,1] (can also be used for extrapolation).
interpolates on the geodesic between angles a and b, with interpolation parameter u in the range [0,1] (can also be used for extrapolation).
[ "interpolates", "on", "the", "geodesic", "between", "angles", "a", "and", "b", "with", "interpolation", "parameter", "u", "in", "the", "range", "[", "0", "1", "]", "(", "can", "also", "be", "used", "for", "extrapolation", ")", "." ]
def interp(a : float, b : float, u : float) -> float: """interpolates on the geodesic between angles a and b, with interpolation parameter u in the range [0,1] (can also be used for extrapolation).""" return a + diff(b,a)*u
[ "def", "interp", "(", "a", ":", "float", ",", "b", ":", "float", ",", "u", ":", "float", ")", "->", "float", ":", "return", "a", "+", "diff", "(", "b", ",", "a", ")", "*", "u" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/so2.py#L41-L44
NVIDIA/MDL-SDK
aa9642b2546ad7b6236b5627385d882c2ed83c5d
src/mdl/jit/llvm/dist/utils/lit/lit/Util.py
python
mkdir_p
(path)
mkdir_p(path) - Make the "path" directory, if it does not exist; this will also make directories for any missing parent directories.
mkdir_p(path) - Make the "path" directory, if it does not exist; this will also make directories for any missing parent directories.
[ "mkdir_p", "(", "path", ")", "-", "Make", "the", "path", "directory", "if", "it", "does", "not", "exist", ";", "this", "will", "also", "make", "directories", "for", "any", "missing", "parent", "directories", "." ]
def mkdir_p(path): """mkdir_p(path) - Make the "path" directory, if it does not exist; this will also make directories for any missing parent directories.""" if not path or os.path.exists(path): return parent = os.path.dirname(path) if parent != path: mkdir_p(parent) try: ...
[ "def", "mkdir_p", "(", "path", ")", ":", "if", "not", "path", "or", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "return", "parent", "=", "os", ".", "path", ".", "dirname", "(", "path", ")", "if", "parent", "!=", "path", ":", "mkdir_p...
https://github.com/NVIDIA/MDL-SDK/blob/aa9642b2546ad7b6236b5627385d882c2ed83c5d/src/mdl/jit/llvm/dist/utils/lit/lit/Util.py#L129-L145
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/coordinates.py
python
Frame.relativeRotation
(self)
return self._relativeCoordinates[0]
Returns an element of SO(3) denoting the rotation from this frame to its parent
Returns an element of SO(3) denoting the rotation from this frame to its parent
[ "Returns", "an", "element", "of", "SO", "(", "3", ")", "denoting", "the", "rotation", "from", "this", "frame", "to", "its", "parent" ]
def relativeRotation(self): """Returns an element of SO(3) denoting the rotation from this frame to its parent""" return self._relativeCoordinates[0]
[ "def", "relativeRotation", "(", "self", ")", ":", "return", "self", ".", "_relativeCoordinates", "[", "0", "]" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/coordinates.py#L63-L66
NVIDIA/DALI
bf16cc86ba8f091b145f91962f21fe1b6aff243d
third_party/cpplint.py
python
CheckForCopyright
(filename, lines, error)
Logs an error if no Copyright message appears at the top of the file.
Logs an error if no Copyright message appears at the top of the file.
[ "Logs", "an", "error", "if", "no", "Copyright", "message", "appears", "at", "the", "top", "of", "the", "file", "." ]
def CheckForCopyright(filename, lines, error): """Logs an error if no Copyright message appears at the top of the file.""" # We'll say it should occur by line 10. Don't forget there's a # dummy line at the front. for line in range(1, min(len(lines), 11)): if re.search(r'Copyright', lines[line], re.I): brea...
[ "def", "CheckForCopyright", "(", "filename", ",", "lines", ",", "error", ")", ":", "# We'll say it should occur by line 10. Don't forget there's a", "# dummy line at the front.", "for", "line", "in", "range", "(", "1", ",", "min", "(", "len", "(", "lines", ")", ",",...
https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/third_party/cpplint.py#L1754-L1764
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
uCSIsKhmer
(code)
return ret
Check whether the character is part of Khmer UCS Block
Check whether the character is part of Khmer UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "Khmer", "UCS", "Block" ]
def uCSIsKhmer(code): """Check whether the character is part of Khmer UCS Block """ ret = libxml2mod.xmlUCSIsKhmer(code) return ret
[ "def", "uCSIsKhmer", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsKhmer", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2654-L2657
libornovax/master_thesis_code
6eca474ed3cae673afde010caef338cf7349f839
scripts/data/shared/geometry.py
python
reconstruct_X_in_plane
(u, v, KR_3x3_inv, C_3x1, p_1x4)
return X_3x1
Reconstructs a point in 3D, which lies on the plane p_1x4 and projects to (u,v) in the image. Input: u, v: Point coordinates in the image KR_3x3_inv: Inverse of the KR matrix from the P matrix (P = KR[I|-C]) C_3x1: Position of the camera in the 3D world (from P = KR[I|-C]) p_1x4: np.matrix coe...
Reconstructs a point in 3D, which lies on the plane p_1x4 and projects to (u,v) in the image.
[ "Reconstructs", "a", "point", "in", "3D", "which", "lies", "on", "the", "plane", "p_1x4", "and", "projects", "to", "(", "u", "v", ")", "in", "the", "image", "." ]
def reconstruct_X_in_plane(u, v, KR_3x3_inv, C_3x1, p_1x4): """ Reconstructs a point in 3D, which lies on the plane p_1x4 and projects to (u,v) in the image. Input: u, v: Point coordinates in the image KR_3x3_inv: Inverse of the KR matrix from the P matrix (P = KR[I|-C]) C_3x1: Position of the came...
[ "def", "reconstruct_X_in_plane", "(", "u", ",", "v", ",", "KR_3x3_inv", ",", "C_3x1", ",", "p_1x4", ")", ":", "x_3x1", "=", "np", ".", "asmatrix", "(", "[", "[", "u", "]", ",", "[", "v", "]", ",", "[", "1.0", "]", "]", ")", "X_d_3x1", "=", "KR_...
https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/data/shared/geometry.py#L103-L122
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/internal/python_message.py
python
_AddSerializePartialToStringMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddSerializePartialToStringMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def SerializePartialToString(self): out = BytesIO() self._InternalSerialize(out.write) return out.getvalue() cls.SerializePartialToString = SerializePartialToString def InternalSerialize(self, w...
[ "def", "_AddSerializePartialToStringMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "SerializePartialToString", "(", "self", ")", ":", "out", "=", "BytesIO", "(", ")", "self", ".", "_InternalSerialize", "(", "out", ".", "write", ")", "return", ...
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/python_message.py#L1057-L1072
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py
python
FieldStorage.getvalue
(self, key, default=None)
Dictionary style get() method, including 'value' lookup.
Dictionary style get() method, including 'value' lookup.
[ "Dictionary", "style", "get", "()", "method", "including", "value", "lookup", "." ]
def getvalue(self, key, default=None): """Dictionary style get() method, including 'value' lookup.""" if key in self: value = self[key] if type(value) is type([]): return map(attrgetter('value'), value) else: return value.value ...
[ "def", "getvalue", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "if", "key", "in", "self", ":", "value", "=", "self", "[", "key", "]", "if", "type", "(", "value", ")", "is", "type", "(", "[", "]", ")", ":", "return", "map", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py#L546-L555
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/encoder.py
python
MessageSetItemEncoder
(field_number)
return EncodeField
Encoder for extensions of MessageSet. The message set message looks like this: message MessageSet { repeated group Item = 1 { required int32 type_id = 2; required string message = 3; } }
Encoder for extensions of MessageSet.
[ "Encoder", "for", "extensions", "of", "MessageSet", "." ]
def MessageSetItemEncoder(field_number): """Encoder for extensions of MessageSet. The message set message looks like this: message MessageSet { repeated group Item = 1 { required int32 type_id = 2; required string message = 3; } } """ start_bytes = b"".join([ TagBytes(...
[ "def", "MessageSetItemEncoder", "(", "field_number", ")", ":", "start_bytes", "=", "b\"\"", ".", "join", "(", "[", "TagBytes", "(", "1", ",", "wire_format", ".", "WIRETYPE_START_GROUP", ")", ",", "TagBytes", "(", "2", ",", "wire_format", ".", "WIRETYPE_VARINT"...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/encoder.py#L771-L796
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/platform/benchmark.py
python
_run_benchmarks
(regex)
Run benchmarks that match regex `regex`. This function goes through the global benchmark registry, and matches benchmark class and method names of the form `module.name.BenchmarkClass.benchmarkMethod` to the given regex. If a method matches, it is run. Args: regex: The string regular expression to match...
Run benchmarks that match regex `regex`.
[ "Run", "benchmarks", "that", "match", "regex", "regex", "." ]
def _run_benchmarks(regex): """Run benchmarks that match regex `regex`. This function goes through the global benchmark registry, and matches benchmark class and method names of the form `module.name.BenchmarkClass.benchmarkMethod` to the given regex. If a method matches, it is run. Args: regex: The s...
[ "def", "_run_benchmarks", "(", "regex", ")", ":", "registry", "=", "list", "(", "GLOBAL_BENCHMARK_REGISTRY", ")", "# Match benchmarks in registry against regex", "for", "benchmark", "in", "registry", ":", "benchmark_name", "=", "\"%s.%s\"", "%", "(", "benchmark", ".",...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/platform/benchmark.py#L252-L285
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGridInterface.ExpandAll
(*args, **kwargs)
return _propgrid.PropertyGridInterface_ExpandAll(*args, **kwargs)
ExpandAll(self, bool expand=True) -> bool
ExpandAll(self, bool expand=True) -> bool
[ "ExpandAll", "(", "self", "bool", "expand", "=", "True", ")", "-", ">", "bool" ]
def ExpandAll(*args, **kwargs): """ExpandAll(self, bool expand=True) -> bool""" return _propgrid.PropertyGridInterface_ExpandAll(*args, **kwargs)
[ "def", "ExpandAll", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridInterface_ExpandAll", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1158-L1160
interpretml/interpret
29466bffc04505fe4f836a83fcfebfd313ac8454
python/interpret-core/interpret/glassbox/ebm/ebm.py
python
DPExplainableBoostingRegressor.__init__
( self, # Explainer feature_names=None, feature_types=None, # Preprocessor max_bins=32, binning="private", # Stages mains="all", # Ensemble outer_bags=1, # Boosting learning_rate=0.01, validation_size=0, ...
Differentially Private Explainable Boosting Regressor. Note that many arguments are defaulted differently than regular EBMs. Args: feature_names: List of feature names. feature_types: List of feature types. max_bins: Max number of bins per feature for pre-processing stage. ...
Differentially Private Explainable Boosting Regressor. Note that many arguments are defaulted differently than regular EBMs.
[ "Differentially", "Private", "Explainable", "Boosting", "Regressor", ".", "Note", "that", "many", "arguments", "are", "defaulted", "differently", "than", "regular", "EBMs", "." ]
def __init__( self, # Explainer feature_names=None, feature_types=None, # Preprocessor max_bins=32, binning="private", # Stages mains="all", # Ensemble outer_bags=1, # Boosting learning_rate=0.01, validation_...
[ "def", "__init__", "(", "self", ",", "# Explainer", "feature_names", "=", "None", ",", "feature_types", "=", "None", ",", "# Preprocessor", "max_bins", "=", "32", ",", "binning", "=", "\"private\"", ",", "# Stages", "mains", "=", "\"all\"", ",", "# Ensemble", ...
https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/glassbox/ebm/ebm.py#L1684-L1768
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/build/lib.linux-x86_64-2.7/mxnet/executor.py
python
Executor.aux_dict
(self)
return self._aux_dict
Get dictionary representation of auxiliary states arrays. Returns ------- aux_dict : dict of str to NDArray The dictionary that maps name of auxiliary states to NDArrays. Raises ------ ValueError : if there are duplicated names in the auxiliary states.
Get dictionary representation of auxiliary states arrays.
[ "Get", "dictionary", "representation", "of", "auxiliary", "states", "arrays", "." ]
def aux_dict(self): """Get dictionary representation of auxiliary states arrays. Returns ------- aux_dict : dict of str to NDArray The dictionary that maps name of auxiliary states to NDArrays. Raises ------ ValueError : if there are duplicated names...
[ "def", "aux_dict", "(", "self", ")", ":", "if", "self", ".", "_aux_dict", "is", "None", ":", "self", ".", "_aux_dict", "=", "Executor", ".", "_get_dict", "(", "self", ".", "_symbol", ".", "list_auxiliary_states", "(", ")", ",", "self", ".", "aux_arrays",...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/executor.py#L187-L202
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
LoadExternalResponse.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(LoadExternalResponse)
Returns new LoadExternalResponse object constructed from its marshaled representation in the given byte buffer
Returns new LoadExternalResponse object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "LoadExternalResponse", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new LoadExternalResponse object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(LoadExternalResponse)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "LoadExternalResponse", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L9736-L9740
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
GridBagSizer.FindItemAtPosition
(*args, **kwargs)
return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
FindItemAtPosition(self, GBPosition pos) -> GBSizerItem Return the sizer item for the given grid cell, or None if there is no item at that position. (non-recursive)
FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
[ "FindItemAtPosition", "(", "self", "GBPosition", "pos", ")", "-", ">", "GBSizerItem" ]
def FindItemAtPosition(*args, **kwargs): """ FindItemAtPosition(self, GBPosition pos) -> GBSizerItem Return the sizer item for the given grid cell, or None if there is no item at that position. (non-recursive) """ return _core_.GridBagSizer_FindItemAtPosition(*args, **kw...
[ "def", "FindItemAtPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "GridBagSizer_FindItemAtPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L16034-L16041
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/generator/msvs.py
python
_GetMsbuildToolsetOfProject
(proj_path, spec, version)
return toolset
Get the platform toolset for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. spec: The target dictionary containing the properties of the target. version: The MSVSVersion object. Returns: the platform toolset string or None.
Get the platform toolset for the project.
[ "Get", "the", "platform", "toolset", "for", "the", "project", "." ]
def _GetMsbuildToolsetOfProject(proj_path, spec, version): """Get the platform toolset for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. spec: The target dictionary containing the properties of the target. version: The MSVSVersion object. Returns: the platform...
[ "def", "_GetMsbuildToolsetOfProject", "(", "proj_path", ",", "spec", ",", "version", ")", ":", "# Pluck out the default configuration.", "default_config", "=", "_GetDefaultConfiguration", "(", "spec", ")", "toolset", "=", "default_config", ".", "get", "(", "'msbuild_too...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/msvs.py#L935-L952
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py
python
OpsWorksConnection.unassign_volume
(self, volume_id)
return self.make_request(action='UnassignVolume', body=json.dumps(params))
Unassigns an assigned Amazon EBS volume. The volume remains registered with the stack. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that expli...
Unassigns an assigned Amazon EBS volume. The volume remains registered with the stack. For more information, see `Resource Management`_.
[ "Unassigns", "an", "assigned", "Amazon", "EBS", "volume", ".", "The", "volume", "remains", "registered", "with", "the", "stack", ".", "For", "more", "information", "see", "Resource", "Management", "_", "." ]
def unassign_volume(self, volume_id): """ Unassigns an assigned Amazon EBS volume. The volume remains registered with the stack. For more information, see `Resource Management`_. **Required Permissions**: To use this action, an IAM user must have a Manage permissions lev...
[ "def", "unassign_volume", "(", "self", ",", "volume_id", ")", ":", "params", "=", "{", "'VolumeId'", ":", "volume_id", ",", "}", "return", "self", ".", "make_request", "(", "action", "=", "'UnassignVolume'", ",", "body", "=", "json", ".", "dumps", "(", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/opsworks/layer1.py#L2396-L2414
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/skia/tools/llvm_coverage_run.py
python
main
()
Run coverage and generate a report.
Run coverage and generate a report.
[ "Run", "coverage", "and", "generate", "a", "report", "." ]
def main(): """Run coverage and generate a report.""" # Parse args. parser = argparse.ArgumentParser() parser.add_argument('--outResultsFile') args, cmd = parser.parse_known_args() # Run coverage. report = run_coverage(cmd) with open(args.outResultsFile, 'w') as f: f.write(report)
[ "def", "main", "(", ")", ":", "# Parse args.", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "parser", ".", "add_argument", "(", "'--outResultsFile'", ")", "args", ",", "cmd", "=", "parser", ".", "parse_known_args", "(", ")", "# Run coverage.", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/skia/tools/llvm_coverage_run.py#L49-L59
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Utils.py
python
alloc_process_pool
(n, force=False)
Allocates an amount of processes to the default pool so its size is at least *n*. It is useful to call this function early so that the pre-forked processes use as little memory as possible. :param n: pool size :type n: integer :param force: if True then *n* more processes are added to the existing pool :type for...
Allocates an amount of processes to the default pool so its size is at least *n*. It is useful to call this function early so that the pre-forked processes use as little memory as possible.
[ "Allocates", "an", "amount", "of", "processes", "to", "the", "default", "pool", "so", "its", "size", "is", "at", "least", "*", "n", "*", ".", "It", "is", "useful", "to", "call", "this", "function", "early", "so", "that", "the", "pre", "-", "forked", ...
def alloc_process_pool(n, force=False): """ Allocates an amount of processes to the default pool so its size is at least *n*. It is useful to call this function early so that the pre-forked processes use as little memory as possible. :param n: pool size :type n: integer :param force: if True then *n* more proce...
[ "def", "alloc_process_pool", "(", "n", ",", "force", "=", "False", ")", ":", "# mandatory on python2, unnecessary on python >= 3.2", "global", "run_process", ",", "get_process", ",", "alloc_process_pool", "if", "not", "force", ":", "n", "=", "max", "(", "n", "-", ...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Utils.py#L999-L1021
fluffos/fluffos
bf54d5d4acef4de49dbed7d184849a7b7b354156
src/thirdparty/widecharwidth/generate.py
python
gen_seps
(length)
Yield separators for a table of given length
Yield separators for a table of given length
[ "Yield", "separators", "for", "a", "table", "of", "given", "length" ]
def gen_seps(length): """ Yield separators for a table of given length """ table_columns = 1 for idx in xrange(1, length + 1): if idx == length: yield "" elif idx % table_columns == 0: yield ",\n " else: yield ", "
[ "def", "gen_seps", "(", "length", ")", ":", "table_columns", "=", "1", "for", "idx", "in", "xrange", "(", "1", ",", "length", "+", "1", ")", ":", "if", "idx", "==", "length", ":", "yield", "\"\"", "elif", "idx", "%", "table_columns", "==", "0", ":"...
https://github.com/fluffos/fluffos/blob/bf54d5d4acef4de49dbed7d184849a7b7b354156/src/thirdparty/widecharwidth/generate.py#L355-L364
fredakilla/GPlayEngine
ae6b45f4c68f696fcd171ce6996a5a4e80aee09e
thirdparty/freetype/src/tools/docmaker/content.py
python
ContentProcessor.add_markup
( self )
Add a new markup section.
Add a new markup section.
[ "Add", "a", "new", "markup", "section", "." ]
def add_markup( self ): """Add a new markup section.""" if self.markup and self.markup_lines: # get rid of last line of markup if it's empty marks = self.markup_lines if len( marks ) > 0 and not string.strip( marks[-1] ): self.markup_lines = marks[:-...
[ "def", "add_markup", "(", "self", ")", ":", "if", "self", ".", "markup", "and", "self", ".", "markup_lines", ":", "# get rid of last line of markup if it's empty", "marks", "=", "self", ".", "markup_lines", "if", "len", "(", "marks", ")", ">", "0", "and", "n...
https://github.com/fredakilla/GPlayEngine/blob/ae6b45f4c68f696fcd171ce6996a5a4e80aee09e/thirdparty/freetype/src/tools/docmaker/content.py#L433-L447
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiPaneInfo.MinSize
(*args, **kwargs)
return _aui.AuiPaneInfo_MinSize(*args, **kwargs)
MinSize(self, Size size) -> AuiPaneInfo
MinSize(self, Size size) -> AuiPaneInfo
[ "MinSize", "(", "self", "Size", "size", ")", "-", ">", "AuiPaneInfo" ]
def MinSize(*args, **kwargs): """MinSize(self, Size size) -> AuiPaneInfo""" return _aui.AuiPaneInfo_MinSize(*args, **kwargs)
[ "def", "MinSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiPaneInfo_MinSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L393-L395
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/DiamondAttenuationCorrection/FitTrans.py
python
allowedDiamRefs
(hmin, hmax, kmin, kmax, lmin, lmax)
return sorthkl
%UNTITLED6 generates a list of allowed reflections for diamond between % limits provided sorted descending according to d-spacing
%UNTITLED6 generates a list of allowed reflections for diamond between % limits provided sorted descending according to d-spacing
[ "%UNTITLED6", "generates", "a", "list", "of", "allowed", "reflections", "for", "diamond", "between", "%", "limits", "provided", "sorted", "descending", "according", "to", "d", "-", "spacing" ]
def allowedDiamRefs(hmin, hmax, kmin, kmax, lmin, lmax): ''' %UNTITLED6 generates a list of allowed reflections for diamond between % limits provided sorted descending according to d-spacing ''' # obtain all hkl within limits... allhkl = genhkl(hmin, hmax, kmin, kmax, lmin, lmax) # now pur...
[ "def", "allowedDiamRefs", "(", "hmin", ",", "hmax", ",", "kmin", ",", "kmax", ",", "lmin", ",", "lmax", ")", ":", "# obtain all hkl within limits...", "allhkl", "=", "genhkl", "(", "hmin", ",", "hmax", ",", "kmin", ",", "kmax", ",", "lmin", ",", "lmax", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/DiamondAttenuationCorrection/FitTrans.py#L175-L218
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py
python
NDFrame.rename_axis
(self, mapper=lib.no_default, **kwargs)
Set the name of the axis for the index or columns. Parameters ---------- mapper : scalar, list-like, optional Value to set the axis name attribute. index, columns : scalar, list-like, dict-like or function, optional A scalar, list-like, dict-like or functions tra...
Set the name of the axis for the index or columns.
[ "Set", "the", "name", "of", "the", "axis", "for", "the", "index", "or", "columns", "." ]
def rename_axis(self, mapper=lib.no_default, **kwargs): """ Set the name of the axis for the index or columns. Parameters ---------- mapper : scalar, list-like, optional Value to set the axis name attribute. index, columns : scalar, list-like, dict-like or fu...
[ "def", "rename_axis", "(", "self", ",", "mapper", "=", "lib", ".", "no_default", ",", "*", "*", "kwargs", ")", ":", "axes", ",", "kwargs", "=", "self", ".", "_construct_axes_from_arguments", "(", "(", ")", ",", "kwargs", ",", "sentinel", "=", "lib", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L1111-L1279
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/tool/android2grd.py
python
Android2Grd.__FormatPlaceholderText
(self, placeholder_node)
return self.__FormatAndroidString(''.join(text), inside_placeholder=True)
Returns the text inside of an <xliff:g> placeholder node.
Returns the text inside of an <xliff:g> placeholder node.
[ "Returns", "the", "text", "inside", "of", "an", "<xliff", ":", "g", ">", "placeholder", "node", "." ]
def __FormatPlaceholderText(self, placeholder_node): """Returns the text inside of an <xliff:g> placeholder node.""" text = [] for childNode in placeholder_node.childNodes: if childNode.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE): text.append(childNode.data) elif childNode.node...
[ "def", "__FormatPlaceholderText", "(", "self", ",", "placeholder_node", ")", ":", "text", "=", "[", "]", "for", "childNode", "in", "placeholder_node", ".", "childNodes", ":", "if", "childNode", ".", "nodeType", "in", "(", "Node", ".", "TEXT_NODE", ",", "Node...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/tool/android2grd.py#L367-L375
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGridInterface.SetPropertyImage
(*args, **kwargs)
return _propgrid.PropertyGridInterface_SetPropertyImage(*args, **kwargs)
SetPropertyImage(self, PGPropArg id, Bitmap bmp)
SetPropertyImage(self, PGPropArg id, Bitmap bmp)
[ "SetPropertyImage", "(", "self", "PGPropArg", "id", "Bitmap", "bmp", ")" ]
def SetPropertyImage(*args, **kwargs): """SetPropertyImage(self, PGPropArg id, Bitmap bmp)""" return _propgrid.PropertyGridInterface_SetPropertyImage(*args, **kwargs)
[ "def", "SetPropertyImage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridInterface_SetPropertyImage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L1437-L1439
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/listobj.py
python
_ListPayloadMixin.guard_index
(self, idx, msg)
Raise an error if the index is out of bounds.
Raise an error if the index is out of bounds.
[ "Raise", "an", "error", "if", "the", "index", "is", "out", "of", "bounds", "." ]
def guard_index(self, idx, msg): """ Raise an error if the index is out of bounds. """ with self._builder.if_then(self.is_out_of_bounds(idx), likely=False): self._context.call_conv.return_user_exc(self._builder, IndexError, ...
[ "def", "guard_index", "(", "self", ",", "idx", ",", "msg", ")", ":", "with", "self", ".", "_builder", ".", "if_then", "(", "self", ".", "is_out_of_bounds", "(", "idx", ")", ",", "likely", "=", "False", ")", ":", "self", ".", "_context", ".", "call_co...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/listobj.py#L105-L111
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/targets.py
python
TargetData.get_element_offset
(self, ty, position)
return offset
Get byte offset of type's ty element at the given position
Get byte offset of type's ty element at the given position
[ "Get", "byte", "offset", "of", "type", "s", "ty", "element", "at", "the", "given", "position" ]
def get_element_offset(self, ty, position): """ Get byte offset of type's ty element at the given position """ offset = ffi.lib.LLVMPY_OffsetOfElement(self, ty, position) if offset == -1: raise ValueError("Could not determined offset of {}th " "el...
[ "def", "get_element_offset", "(", "self", ",", "ty", ",", "position", ")", ":", "offset", "=", "ffi", ".", "lib", ".", "LLVMPY_OffsetOfElement", "(", "self", ",", "ty", ",", "position", ")", "if", "offset", "==", "-", "1", ":", "raise", "ValueError", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/targets.py#L136-L146
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/hashes.py
python
Hashes.__nonzero__
(self)
return bool(self._allowed)
Return whether I know any known-good hashes.
Return whether I know any known-good hashes.
[ "Return", "whether", "I", "know", "any", "known", "-", "good", "hashes", "." ]
def __nonzero__(self): # type: () -> bool """Return whether I know any known-good hashes.""" return bool(self._allowed)
[ "def", "__nonzero__", "(", "self", ")", ":", "# type: () -> bool", "return", "bool", "(", "self", ".", "_allowed", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/hashes.py#L118-L121
apache/parquet-cpp
642da055adf009652689b20e68a198cffb857651
build-support/cpplint.py
python
CheckRedundantOverrideOrFinal
(filename, clean_lines, linenum, error)
Check if line contains a redundant "override" or "final" virt-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check if line contains a redundant "override" or "final" virt-specifier.
[ "Check", "if", "line", "contains", "a", "redundant", "override", "or", "final", "virt", "-", "specifier", "." ]
def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error): """Check if line contains a redundant "override" or "final" virt-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. er...
[ "def", "CheckRedundantOverrideOrFinal", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Look for closing parenthesis nearby. We need one to confirm where", "# the declarator ends and where the virt-specifier starts to avoid", "# false positives.", "line...
https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L5811-L5837
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/distribute/multi_worker_training_state.py
python
MultiWorkerTrainingState.restore
(self)
return False
Restore the training state from the backed up checkpoint file. Returns: True if the training state is successfully restored. False if the training state doesn't need to be restored, or error occurred so it can't.
Restore the training state from the backed up checkpoint file.
[ "Restore", "the", "training", "state", "from", "the", "backed", "up", "checkpoint", "file", "." ]
def restore(self): """Restore the training state from the backed up checkpoint file. Returns: True if the training state is successfully restored. False if the training state doesn't need to be restored, or error occurred so it can't. """ self._assert_in_multi_worker_mode() if not multi...
[ "def", "restore", "(", "self", ")", ":", "self", ".", "_assert_in_multi_worker_mode", "(", ")", "if", "not", "multi_worker_util", ".", "should_load_checkpoint", "(", ")", ":", "# For multi-worker training, it should not restore a model in certain", "# worker setting (e.g. non...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/distribute/multi_worker_training_state.py#L131-L152
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py
python
ParseResults.get
(self, key, defaultValue=None)
Returns named result matching the given key, or if there is no such name, then returns the given C{defaultValue} or C{None} if no C{defaultValue} is specified. Similar to C{dict.get()}. Example:: integer = Word(nums) date_str = integer("year") + '/' + in...
Returns named result matching the given key, or if there is no such name, then returns the given C{defaultValue} or C{None} if no C{defaultValue} is specified.
[ "Returns", "named", "result", "matching", "the", "given", "key", "or", "if", "there", "is", "no", "such", "name", "then", "returns", "the", "given", "C", "{", "defaultValue", "}", "or", "C", "{", "None", "}", "if", "no", "C", "{", "defaultValue", "}", ...
def get(self, key, defaultValue=None): """ Returns named result matching the given key, or if there is no such name, then returns the given C{defaultValue} or C{None} if no C{defaultValue} is specified. Similar to C{dict.get()}. Example:: integer = W...
[ "def", "get", "(", "self", ",", "key", ",", "defaultValue", "=", "None", ")", ":", "if", "key", "in", "self", ":", "return", "self", "[", "key", "]", "else", ":", "return", "defaultValue" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L563-L583
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/deps/v8/tools/stats-viewer.py
python
ChromeCounterCollection.Counter
(self, i)
return ChromeCounter(self.data, name_offset, value_offset)
Return the i'th counter.
Return the i'th counter.
[ "Return", "the", "i", "th", "counter", "." ]
def Counter(self, i): """Return the i'th counter.""" name_offset = self.counter_names_offset + i * self._COUNTER_NAME_SIZE value_offset = self.counter_values_offset + i * self.max_threads * 4 return ChromeCounter(self.data, name_offset, value_offset)
[ "def", "Counter", "(", "self", ",", "i", ")", ":", "name_offset", "=", "self", ".", "counter_names_offset", "+", "i", "*", "self", ".", "_COUNTER_NAME_SIZE", "value_offset", "=", "self", ".", "counter_values_offset", "+", "i", "*", "self", ".", "max_threads"...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/stats-viewer.py#L447-L451
gnina/gnina
b9ae032f52fc7a8153987bde09c0efa3620d8bb6
caffe/scripts/cpp_lint.py
python
ReplaceAll
(pattern, rep, s)
return _regexp_compile_cache[pattern].sub(rep, s)
Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if no replacements)
Replaces instances of pattern in a string with a replacement.
[ "Replaces", "instances", "of", "pattern", "in", "a", "string", "with", "a", "replacement", "." ]
def ReplaceAll(pattern, rep, s): """Replaces instances of pattern in a string with a replacement. The compiled regex is kept in a cache shared by Match and Search. Args: pattern: regex pattern rep: replacement text s: search string Returns: string with replacements made (or original string if...
[ "def", "ReplaceAll", "(", "pattern", ",", "rep", ",", "s", ")", ":", "if", "pattern", "not", "in", "_regexp_compile_cache", ":", "_regexp_compile_cache", "[", "pattern", "]", "=", "sre_compile", ".", "compile", "(", "pattern", ")", "return", "_regexp_compile_c...
https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L529-L544
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/tools/grokdump.py
python
InspectionPadawan.FindObjectOrSmi
(self, tagged_address)
When used as a mixin in place of V8Heap.
When used as a mixin in place of V8Heap.
[ "When", "used", "as", "a", "mixin", "in", "place", "of", "V8Heap", "." ]
def FindObjectOrSmi(self, tagged_address): """When used as a mixin in place of V8Heap.""" found_obj = self.SenseObject(tagged_address) if found_obj: return found_obj if self.IsSmi(tagged_address): return self.FormatSmi(tagged_address) else: return "Unknown(%s)" % self.reader.FormatIntPtr...
[ "def", "FindObjectOrSmi", "(", "self", ",", "tagged_address", ")", ":", "found_obj", "=", "self", ".", "SenseObject", "(", "tagged_address", ")", "if", "found_obj", ":", "return", "found_obj", "if", "self", ".", "IsSmi", "(", "tagged_address", ")", ":", "ret...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/tools/grokdump.py#L2082-L2089
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py
python
get_default_cache
()
return ( os.environ.get('PYTHON_EGG_CACHE') or appdirs.user_cache_dir(appname='Python-Eggs') )
Return the ``PYTHON_EGG_CACHE`` environment variable or a platform-relevant user cache dir for an app named "Python-Eggs".
Return the ``PYTHON_EGG_CACHE`` environment variable or a platform-relevant user cache dir for an app named "Python-Eggs".
[ "Return", "the", "PYTHON_EGG_CACHE", "environment", "variable", "or", "a", "platform", "-", "relevant", "user", "cache", "dir", "for", "an", "app", "named", "Python", "-", "Eggs", "." ]
def get_default_cache(): """ Return the ``PYTHON_EGG_CACHE`` environment variable or a platform-relevant user cache dir for an app named "Python-Eggs". """ return ( os.environ.get('PYTHON_EGG_CACHE') or appdirs.user_cache_dir(appname='Python-Eggs') )
[ "def", "get_default_cache", "(", ")", ":", "return", "(", "os", ".", "environ", ".", "get", "(", "'PYTHON_EGG_CACHE'", ")", "or", "appdirs", ".", "user_cache_dir", "(", "appname", "=", "'Python-Eggs'", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L1307-L1316
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py
python
Combobox.set
(self, value)
Sets the value of the combobox to value.
Sets the value of the combobox to value.
[ "Sets", "the", "value", "of", "the", "combobox", "to", "value", "." ]
def set(self, value): """Sets the value of the combobox to value.""" self.tk.call(self._w, "set", value)
[ "def", "set", "(", "self", ",", "value", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "\"set\"", ",", "value", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L715-L717
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/user_preferences.py
python
UserPreferences.ticker_group
(self, ticker_group)
Sets the ticker_group of this UserPreferences. :param ticker_group: The ticker_group of this UserPreferences. # noqa: E501 :type: str
Sets the ticker_group of this UserPreferences.
[ "Sets", "the", "ticker_group", "of", "this", "UserPreferences", "." ]
def ticker_group(self, ticker_group): """Sets the ticker_group of this UserPreferences. :param ticker_group: The ticker_group of this UserPreferences. # noqa: E501 :type: str """ self._ticker_group = ticker_group
[ "def", "ticker_group", "(", "self", ",", "ticker_group", ")", ":", "self", ".", "_ticker_group", "=", "ticker_group" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user_preferences.py#L695-L703
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
DC.GetMultiLineTextExtent
(*args, **kwargs)
return _gdi_.DC_GetMultiLineTextExtent(*args, **kwargs)
GetMultiLineTextExtent(wxString string, Font font=None) -> (width, height, lineHeight) Get the width, height, and line height of the text using the current or specified font. Works for single as well as multi-line strings.
GetMultiLineTextExtent(wxString string, Font font=None) -> (width, height, lineHeight)
[ "GetMultiLineTextExtent", "(", "wxString", "string", "Font", "font", "=", "None", ")", "-", ">", "(", "width", "height", "lineHeight", ")" ]
def GetMultiLineTextExtent(*args, **kwargs): """ GetMultiLineTextExtent(wxString string, Font font=None) -> (width, height, lineHeight) Get the width, height, and line height of the text using the current or specified font. Works for single as well as multi-line strin...
[ "def", "GetMultiLineTextExtent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_GetMultiLineTextExtent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L4131-L4140
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/training/saver.py
python
get_checkpoint_mtimes
(checkpoint_prefixes)
return mtimes
Returns the mtimes (modification timestamps) of the checkpoints. Globs for the checkpoints pointed to by `checkpoint_prefixes`. If the files exist, collect their mtime. Both V2 and V1 checkpoints are considered, in that priority. This is the recommended way to get the mtimes, since it takes into account t...
Returns the mtimes (modification timestamps) of the checkpoints.
[ "Returns", "the", "mtimes", "(", "modification", "timestamps", ")", "of", "the", "checkpoints", "." ]
def get_checkpoint_mtimes(checkpoint_prefixes): """Returns the mtimes (modification timestamps) of the checkpoints. Globs for the checkpoints pointed to by `checkpoint_prefixes`. If the files exist, collect their mtime. Both V2 and V1 checkpoints are considered, in that priority. This is the recommended w...
[ "def", "get_checkpoint_mtimes", "(", "checkpoint_prefixes", ")", ":", "mtimes", "=", "[", "]", "def", "match_maybe_append", "(", "pathname", ")", ":", "fnames", "=", "file_io", ".", "get_matching_files", "(", "pathname", ")", "if", "fnames", ":", "mtimes", "."...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/saver.py#L1795-L1830
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/zipfile.py
python
ZipFile._RealGetContents
(self)
Read in the table of contents for the ZIP file.
Read in the table of contents for the ZIP file.
[ "Read", "in", "the", "table", "of", "contents", "for", "the", "ZIP", "file", "." ]
def _RealGetContents(self): """Read in the table of contents for the ZIP file.""" fp = self.fp try: endrec = _EndRecData(fp) except IOError: raise BadZipfile("File is not a zip file") if not endrec: raise BadZipfile, "File is not a zip file" ...
[ "def", "_RealGetContents", "(", "self", ")", ":", "fp", "=", "self", ".", "fp", "try", ":", "endrec", "=", "_EndRecData", "(", "fp", ")", "except", "IOError", ":", "raise", "BadZipfile", "(", "\"File is not a zip file\"", ")", "if", "not", "endrec", ":", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/zipfile.py#L799-L865
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
Pen.GetWidth
(*args, **kwargs)
return _gdi_.Pen_GetWidth(*args, **kwargs)
GetWidth(self) -> int
GetWidth(self) -> int
[ "GetWidth", "(", "self", ")", "-", ">", "int" ]
def GetWidth(*args, **kwargs): """GetWidth(self) -> int""" return _gdi_.Pen_GetWidth(*args, **kwargs)
[ "def", "GetWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Pen_GetWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L416-L418
Project-OSRM/osrm-backend
f2e284623e25b5570dd2a5e6985abcb3790fd348
third_party/flatbuffers/python/flatbuffers/builder.py
python
Builder.Slot
(self, slotnum)
Slot sets the vtable key `voffset` to the current location in the buffer.
Slot sets the vtable key `voffset` to the current location in the buffer.
[ "Slot", "sets", "the", "vtable", "key", "voffset", "to", "the", "current", "location", "in", "the", "buffer", "." ]
def Slot(self, slotnum): """ Slot sets the vtable key `voffset` to the current location in the buffer. """ self.assertNested() self.current_vtable[slotnum] = self.Offset()
[ "def", "Slot", "(", "self", ",", "slotnum", ")", ":", "self", ".", "assertNested", "(", ")", "self", ".", "current_vtable", "[", "slotnum", "]", "=", "self", ".", "Offset", "(", ")" ]
https://github.com/Project-OSRM/osrm-backend/blob/f2e284623e25b5570dd2a5e6985abcb3790fd348/third_party/flatbuffers/python/flatbuffers/builder.py#L503-L510
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/locale.py
python
resetlocale
(category=LC_ALL)
Sets the locale for category to the default setting. The default setting is determined by calling getdefaultlocale(). category defaults to LC_ALL.
Sets the locale for category to the default setting.
[ "Sets", "the", "locale", "for", "category", "to", "the", "default", "setting", "." ]
def resetlocale(category=LC_ALL): """ Sets the locale for category to the default setting. The default setting is determined by calling getdefaultlocale(). category defaults to LC_ALL. """ _setlocale(category, _build_localename(getdefaultlocale()))
[ "def", "resetlocale", "(", "category", "=", "LC_ALL", ")", ":", "_setlocale", "(", "category", ",", "_build_localename", "(", "getdefaultlocale", "(", ")", ")", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/locale.py#L515-L523
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
python
_GetOutputTargetExt
(spec)
return None
Returns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in the input files. Arguments: spec: The target dictionary containing the properties of the target. Ret...
Returns the extension for this target, including the dot
[ "Returns", "the", "extension", "for", "this", "target", "including", "the", "dot" ]
def _GetOutputTargetExt(spec): """Returns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in the input files. Arguments: spec: The target dictionary containing...
[ "def", "_GetOutputTargetExt", "(", "spec", ")", ":", "target_extension", "=", "spec", ".", "get", "(", "'product_extension'", ")", "if", "target_extension", ":", "return", "'.'", "+", "target_extension", "return", "None" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L1290-L1305
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/ogl/_composit.py
python
DivisionShape.GetTopSideStyle
(self)
return self._topSideStyle
Return the style used for the top side of the division.
Return the style used for the top side of the division.
[ "Return", "the", "style", "used", "for", "the", "top", "side", "of", "the", "division", "." ]
def GetTopSideStyle(self): """Return the style used for the top side of the division.""" return self._topSideStyle
[ "def", "GetTopSideStyle", "(", "self", ")", ":", "return", "self", ".", "_topSideStyle" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_composit.py#L995-L997
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/metrics/roc.py
python
ROC._roc
(self, y_pred, y, class_num=None, pos_label=None, sample_weights=None)
return self._roc_eval(y_pred, y, class_num, pos_label, sample_weights)
Update curve and return the result of the ROC curve. Args: y_pred (Union[Tensor, list, np.ndarray]): In most cases (not strictly), y_pred is a list of floating numbers in range :math:`[0, 1]` and the shape is :math:`(N, C)`, where :math:`N` is the number of cases and...
Update curve and return the result of the ROC curve.
[ "Update", "curve", "and", "return", "the", "result", "of", "the", "ROC", "curve", "." ]
def _roc(self, y_pred, y, class_num=None, pos_label=None, sample_weights=None): """ Update curve and return the result of the ROC curve. Args: y_pred (Union[Tensor, list, np.ndarray]): In most cases (not strictly), y_pred is a list of floating numbers in range :math:...
[ "def", "_roc", "(", "self", ",", "y_pred", ",", "y", ",", "class_num", "=", "None", ",", "pos_label", "=", "None", ",", "sample_weights", "=", "None", ")", ":", "y_pred", ",", "y", ",", "class_num", ",", "pos_label", "=", "self", ".", "_precision_recal...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/metrics/roc.py#L174-L193
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py
python
Categorical.categories
(self)
return self.dtype.categories
The categories of this categorical. Setting assigns new values to each category (effectively a rename of each individual category). The assigned value has to be a list-like object. All items must be unique and the number of items in the new categories must be the same as the nu...
The categories of this categorical.
[ "The", "categories", "of", "this", "categorical", "." ]
def categories(self): """ The categories of this categorical. Setting assigns new values to each category (effectively a rename of each individual category). The assigned value has to be a list-like object. All items must be unique and the number of items in the new cat...
[ "def", "categories", "(", "self", ")", ":", "return", "self", ".", "dtype", ".", "categories" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L397-L425