blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
616
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
112
| license_type
stringclasses 2
values | repo_name
stringlengths 5
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 777
values | visit_date
timestamp[us]date 2015-08-06 10:31:46
2023-09-06 10:44:38
| revision_date
timestamp[us]date 1970-01-01 02:38:32
2037-05-03 13:00:00
| committer_date
timestamp[us]date 1970-01-01 02:38:32
2023-09-06 01:08:06
| github_id
int64 4.92k
681M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us]date 2012-06-04 01:52:49
2023-09-14 21:59:50
⌀ | gha_created_at
timestamp[us]date 2008-05-22 07:58:19
2023-08-21 12:35:19
⌀ | gha_language
stringclasses 149
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 2
classes | is_generated
bool 2
classes | length_bytes
int64 3
10.2M
| extension
stringclasses 188
values | content
stringlengths 3
10.2M
| authors
listlengths 1
1
| author_id
stringlengths 1
132
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a1cf5368c4eea778d041c5af86d0bf3a3f4abd62 | 9743d5fd24822f79c156ad112229e25adb9ed6f6 | /xai/brain/wordbase/adjectives/_sodden.py | 9a58a5d33739918fea93b36c32416d0d46ba6316 | [
"MIT"
]
| permissive | cash2one/xai | de7adad1758f50dd6786bf0111e71a903f039b64 | e76f12c9f4dcf3ac1c7c08b0cc8844c0b0a104b6 | refs/heads/master | 2021-01-19T12:33:54.964379 | 2017-01-28T02:00:50 | 2017-01-28T02:00:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 410 | py |
#calss header
class _SODDEN():
def __init__(self,):
self.name = "SODDEN"
self.definitions = [u'(of something that can absorb water) extremely wet: ']
self.parents = []
self.childen = []
self.properties = []
self.jsondata = {}
self.specie = 'adjectives'
def run(self, obj1, obj2):
self.jsondata[obj2] = {}
self.jsondata[obj2]['properties'] = self.name.lower()
return self.jsondata
| [
"[email protected]"
]
| |
282399609317833cf35a9418fdac25bece55fe85 | 5afc3043b9b43a0e72bc94a90ed832a9576bb580 | /base/skill_59/py_06/py_44_copyreg.py | d527bd7b1839bbf108f061884156436b5976dfb3 | []
| no_license | JR1QQ4/python | 629e7ddec7a261fb8a59b834160ceea80239a0f7 | a162a5121fdeeffbfdad9912472f2a790bb1ff53 | refs/heads/main | 2023-08-25T00:40:25.975915 | 2021-11-07T14:10:20 | 2021-11-07T14:10:20 | 311,769,673 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 517 | py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# 第 44 条: 用 copyreg 实现可靠的 pickle 操作
# 内置的 pickle 模块,只适合用来在彼此信任的程序之间,对相关对象执行序列化和反序列化操作
# 如果用法比较复杂,那么 pickle 模块的功能也许就会出问题
# 我们可以把内置的 copyreg 模块同 pickle 结合起来使用,以便为旧数据缺失的属性值、进行类的版本管理,
# 并给序列化之后的数据提供固定的引入路径
| [
"[email protected]"
]
| |
627b37547257bf028218c394028ba638d78fb0a6 | bdd8fe60144b364dade0c383ba9ac7a400457c69 | /freight/api/task_log.py | 1f03bac3b2cbdff6275b4d8d6b4886d30a94c799 | [
"Apache-2.0"
]
| permissive | thoas/freight | 61eda7cb397696eb2c3a7504d03f2f4654ad7e8f | 9934cfb3c868b5e4b813259ca83c748676d598a0 | refs/heads/master | 2021-01-18T17:24:25.758448 | 2015-09-03T20:45:35 | 2015-09-03T20:45:36 | 41,413,179 | 1 | 0 | null | 2015-08-26T08:13:07 | 2015-08-26T08:13:06 | Python | UTF-8 | Python | false | false | 2,200 | py | from __future__ import absolute_import
from flask_restful import reqparse
from freight.api.base import ApiView
from freight.config import db
from freight.models import LogChunk
from .task_details import TaskMixin
class TaskLogApiView(ApiView, TaskMixin):
get_parser = reqparse.RequestParser()
get_parser.add_argument('offset', location='args', type=int, default=0)
get_parser.add_argument('limit', location='args', type=int)
def get(self, **kwargs):
"""
Retrieve task log.
"""
task = self._get_task(**kwargs)
if task is None:
return self.error('Invalid task', name='invalid_resource', status_code=404)
args = self.get_parser.parse_args()
queryset = db.session.query(
LogChunk.text, LogChunk.offset, LogChunk.size
).filter(
LogChunk.task_id == task.id,
).order_by(LogChunk.offset.asc())
if args.offset == -1:
# starting from the end so we need to know total size
tail = db.session.query(LogChunk.offset + LogChunk.size).filter(
LogChunk.task_id == task.id,
).order_by(LogChunk.offset.desc()).limit(1).scalar()
if tail is None:
logchunks = []
else:
if args.limit:
queryset = queryset.filter(
(LogChunk.offset + LogChunk.size) >= max(tail - args.limit + 1, 0),
)
else:
if args.offset:
queryset = queryset.filter(
LogChunk.offset >= args.offset,
)
if args.limit:
queryset = queryset.filter(
LogChunk.offset < args.offset + args.limit,
)
logchunks = list(queryset)
if logchunks:
next_offset = logchunks[-1].offset + logchunks[-1].size
else:
next_offset = args.offset
links = self.build_cursor_link('next', next_offset)
context = {
'text': ''.join(l.text for l in logchunks),
'nextOffset': next_offset,
}
return self.respond(context, links=links)
| [
"[email protected]"
]
| |
7e5e4f719b75a501b9e069ca581e0344b89df260 | 51f887286aa3bd2c3dbe4c616ad306ce08976441 | /pybind/slxos/v17r_1_01a/brocade_mpls_rpc/clear_mpls_auto_bandwidth_statistics_lsp/input/__init__.py | c69003159bbe860e7c9e51d4eb0d278fd1ce133e | [
"Apache-2.0"
]
| permissive | b2220333/pybind | a8c06460fd66a97a78c243bf144488eb88d7732a | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | refs/heads/master | 2020-03-18T09:09:29.574226 | 2018-04-03T20:09:50 | 2018-04-03T20:09:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,711 | py |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitarray
import __builtin__
class input(PybindBase):
"""
This class was auto-generated by the PythonClass plugin for PYANG
from YANG module brocade-mpls - based on the path /brocade_mpls_rpc/clear-mpls-auto-bandwidth-statistics-lsp/input. Each member element of
the container is represented as a class variable - with a specific
YANG type.
"""
__slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_rest_name', '_extmethods', '__lsp_name',)
_yang_name = 'input'
_rest_name = 'input'
_pybind_generated_by = 'container'
def __init__(self, *args, **kwargs):
path_helper_ = kwargs.pop("path_helper", None)
if path_helper_ is False:
self._path_helper = False
elif path_helper_ is not None and isinstance(path_helper_, xpathhelper.YANGPathHelper):
self._path_helper = path_helper_
elif hasattr(self, "_parent"):
path_helper_ = getattr(self._parent, "_path_helper", False)
self._path_helper = path_helper_
else:
self._path_helper = False
extmethods = kwargs.pop("extmethods", None)
if extmethods is False:
self._extmethods = False
elif extmethods is not None and isinstance(extmethods, dict):
self._extmethods = extmethods
elif hasattr(self, "_parent"):
extmethods = getattr(self._parent, "_extmethods", None)
self._extmethods = extmethods
else:
self._extmethods = False
self.__lsp_name = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..64']}), is_leaf=True, yang_name="lsp-name", rest_name="lsp-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='string', is_config=True)
load = kwargs.pop("load", None)
if args:
if len(args) > 1:
raise TypeError("cannot create a YANG container with >1 argument")
all_attr = True
for e in self._pyangbind_elements:
if not hasattr(args[0], e):
all_attr = False
break
if not all_attr:
raise ValueError("Supplied object did not have the correct attributes")
for e in self._pyangbind_elements:
nobj = getattr(args[0], e)
if nobj._changed() is False:
continue
setmethod = getattr(self, "_set_%s" % e)
if load is None:
setmethod(getattr(args[0], e))
else:
setmethod(getattr(args[0], e), load=load)
def _path(self):
if hasattr(self, "_parent"):
return self._parent._path()+[self._yang_name]
else:
return [u'brocade_mpls_rpc', u'clear-mpls-auto-bandwidth-statistics-lsp', u'input']
def _rest_path(self):
if hasattr(self, "_parent"):
if self._rest_name:
return self._parent._rest_path()+[self._rest_name]
else:
return self._parent._rest_path()
else:
return [u'clear-mpls-auto-bandwidth-statistics-lsp', u'input']
def _get_lsp_name(self):
"""
Getter method for lsp_name, mapped from YANG variable /brocade_mpls_rpc/clear_mpls_auto_bandwidth_statistics_lsp/input/lsp_name (string)
YANG Description: LSP Name
"""
return self.__lsp_name
def _set_lsp_name(self, v, load=False):
"""
Setter method for lsp_name, mapped from YANG variable /brocade_mpls_rpc/clear_mpls_auto_bandwidth_statistics_lsp/input/lsp_name (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_lsp_name is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_lsp_name() directly.
YANG Description: LSP Name
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..64']}), is_leaf=True, yang_name="lsp-name", rest_name="lsp-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='string', is_config=True)
except (TypeError, ValueError):
raise ValueError({
'error-string': """lsp_name must be of a type compatible with string""",
'defined-type': "string",
'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..64']}), is_leaf=True, yang_name="lsp-name", rest_name="lsp-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='string', is_config=True)""",
})
self.__lsp_name = t
if hasattr(self, '_set'):
self._set()
def _unset_lsp_name(self):
self.__lsp_name = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'length': [u'1..64']}), is_leaf=True, yang_name="lsp-name", rest_name="lsp-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=False, namespace='urn:brocade.com:mgmt:brocade-mpls', defining_module='brocade-mpls', yang_type='string', is_config=True)
lsp_name = __builtin__.property(_get_lsp_name, _set_lsp_name)
_pyangbind_elements = {'lsp_name': lsp_name, }
| [
"[email protected]"
]
| |
8a5591e66fcadfc9f649b0d75c3579d01549b7b8 | 2e5c0e502216b59a4e348437d4291767e29666ea | /Flask-Web/flasky/Lib/site-packages/dns/tokenizer.py | 3e5d2ba92e8762532c2b3c5d6cbd0170298b26c7 | [
"Apache-2.0",
"GPL-1.0-or-later"
]
| permissive | fengzse/Feng_Repository | 8881b64213eef94ca8b01652e5bc48e92a28e1f5 | db335441fa48440e72eefab6b5fd61103af20c5d | refs/heads/master | 2023-07-24T04:47:30.910625 | 2023-02-16T10:34:26 | 2023-02-16T10:34:26 | 245,704,594 | 1 | 0 | Apache-2.0 | 2023-07-15T00:54:20 | 2020-03-07T20:59:04 | Python | UTF-8 | Python | false | false | 20,833 | py | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""Tokenize DNS master file format"""
import io
import sys
import dns.exception
import dns.name
import dns.ttl
_DELIMITERS = {' ', '\t', '\n', ';', '(', ')', '"'}
_QUOTING_DELIMITERS = {'"'}
EOF = 0
EOL = 1
WHITESPACE = 2
IDENTIFIER = 3
QUOTED_STRING = 4
COMMENT = 5
DELIMITER = 6
class UngetBufferFull(dns.exception.DNSException):
"""An attempt was made to unget a token when the unget buffer was full."""
class Token:
"""A DNS master file format token.
ttype: The token type
value: The token value
has_escape: Does the token value contain escapes?
"""
def __init__(self, ttype, value='', has_escape=False):
"""Initialize a token instance."""
self.ttype = ttype
self.value = value
self.has_escape = has_escape
def is_eof(self):
return self.ttype == EOF
def is_eol(self):
return self.ttype == EOL
def is_whitespace(self):
return self.ttype == WHITESPACE
def is_identifier(self):
return self.ttype == IDENTIFIER
def is_quoted_string(self):
return self.ttype == QUOTED_STRING
def is_comment(self):
return self.ttype == COMMENT
def is_delimiter(self): # pragma: no cover (we don't return delimiters yet)
return self.ttype == DELIMITER
def is_eol_or_eof(self):
return self.ttype == EOL or self.ttype == EOF
def __eq__(self, other):
if not isinstance(other, Token):
return False
return (self.ttype == other.ttype and
self.value == other.value)
def __ne__(self, other):
if not isinstance(other, Token):
return True
return (self.ttype != other.ttype or
self.value != other.value)
def __str__(self):
return '%d "%s"' % (self.ttype, self.value)
def unescape(self):
if not self.has_escape:
return self
unescaped = ''
l = len(self.value)
i = 0
while i < l:
c = self.value[i]
i += 1
if c == '\\':
if i >= l:
raise dns.exception.UnexpectedEnd
c = self.value[i]
i += 1
if c.isdigit():
if i >= l:
raise dns.exception.UnexpectedEnd
c2 = self.value[i]
i += 1
if i >= l:
raise dns.exception.UnexpectedEnd
c3 = self.value[i]
i += 1
if not (c2.isdigit() and c3.isdigit()):
raise dns.exception.SyntaxError
c = chr(int(c) * 100 + int(c2) * 10 + int(c3))
unescaped += c
return Token(self.ttype, unescaped)
def unescape_to_bytes(self):
# We used to use unescape() for TXT-like records, but this
# caused problems as we'd process DNS escapes into Unicode code
# points instead of byte values, and then a to_text() of the
# processed data would not equal the original input. For
# example, \226 in the TXT record would have a to_text() of
# \195\162 because we applied UTF-8 encoding to Unicode code
# point 226.
#
# We now apply escapes while converting directly to bytes,
# avoiding this double encoding.
#
# This code also handles cases where the unicode input has
# non-ASCII code-points in it by converting it to UTF-8. TXT
# records aren't defined for Unicode, but this is the best we
# can do to preserve meaning. For example,
#
# foo\u200bbar
#
# (where \u200b is Unicode code point 0x200b) will be treated
# as if the input had been the UTF-8 encoding of that string,
# namely:
#
# foo\226\128\139bar
#
unescaped = b''
l = len(self.value)
i = 0
while i < l:
c = self.value[i]
i += 1
if c == '\\':
if i >= l:
raise dns.exception.UnexpectedEnd
c = self.value[i]
i += 1
if c.isdigit():
if i >= l:
raise dns.exception.UnexpectedEnd
c2 = self.value[i]
i += 1
if i >= l:
raise dns.exception.UnexpectedEnd
c3 = self.value[i]
i += 1
if not (c2.isdigit() and c3.isdigit()):
raise dns.exception.SyntaxError
unescaped += b'%c' % (int(c) * 100 + int(c2) * 10 + int(c3))
else:
# Note that as mentioned above, if c is a Unicode
# code point outside of the ASCII range, then this
# += is converting that code point to its UTF-8
# encoding and appending multiple bytes to
# unescaped.
unescaped += c.encode()
else:
unescaped += c.encode()
return Token(self.ttype, bytes(unescaped))
class Tokenizer:
"""A DNS master file format tokenizer.
A token object is basically a (type, value) tuple. The valid
types are EOF, EOL, WHITESPACE, IDENTIFIER, QUOTED_STRING,
COMMENT, and DELIMITER.
file: The file to tokenize
ungotten_char: The most recently ungotten character, or None.
ungotten_token: The most recently ungotten token, or None.
multiline: The current multiline level. This value is increased
by one every time a '(' delimiter is read, and decreased by one every time
a ')' delimiter is read.
quoting: This variable is true if the tokenizer is currently
reading a quoted string.
eof: This variable is true if the tokenizer has encountered EOF.
delimiters: The current delimiter dictionary.
line_number: The current line number
filename: A filename that will be returned by the where() method.
idna_codec: A dns.name.IDNACodec, specifies the IDNA
encoder/decoder. If None, the default IDNA 2003
encoder/decoder is used.
"""
def __init__(self, f=sys.stdin, filename=None, idna_codec=None):
"""Initialize a tokenizer instance.
f: The file to tokenize. The default is sys.stdin.
This parameter may also be a string, in which case the tokenizer
will take its input from the contents of the string.
filename: the name of the filename that the where() method
will return.
idna_codec: A dns.name.IDNACodec, specifies the IDNA
encoder/decoder. If None, the default IDNA 2003
encoder/decoder is used.
"""
if isinstance(f, str):
f = io.StringIO(f)
if filename is None:
filename = '<string>'
elif isinstance(f, bytes):
f = io.StringIO(f.decode())
if filename is None:
filename = '<string>'
else:
if filename is None:
if f is sys.stdin:
filename = '<stdin>'
else:
filename = '<file>'
self.file = f
self.ungotten_char = None
self.ungotten_token = None
self.multiline = 0
self.quoting = False
self.eof = False
self.delimiters = _DELIMITERS
self.line_number = 1
self.filename = filename
if idna_codec is None:
idna_codec = dns.name.IDNA_2003
self.idna_codec = idna_codec
def _get_char(self):
"""Read a character from input.
"""
if self.ungotten_char is None:
if self.eof:
c = ''
else:
c = self.file.read(1)
if c == '':
self.eof = True
elif c == '\n':
self.line_number += 1
else:
c = self.ungotten_char
self.ungotten_char = None
return c
def where(self):
"""Return the current location in the input.
Returns a (string, int) tuple. The first item is the filename of
the input, the second is the current line number.
"""
return (self.filename, self.line_number)
def _unget_char(self, c):
"""Unget a character.
The unget buffer for characters is only one character large; it is
an error to try to unget a character when the unget buffer is not
empty.
c: the character to unget
raises UngetBufferFull: there is already an ungotten char
"""
if self.ungotten_char is not None:
# this should never happen!
raise UngetBufferFull # pragma: no cover
self.ungotten_char = c
def skip_whitespace(self):
"""Consume input until a non-whitespace character is encountered.
The non-whitespace character is then ungotten, and the number of
whitespace characters consumed is returned.
If the tokenizer is in multiline mode, then newlines are whitespace.
Returns the number of characters skipped.
"""
skipped = 0
while True:
c = self._get_char()
if c != ' ' and c != '\t':
if (c != '\n') or not self.multiline:
self._unget_char(c)
return skipped
skipped += 1
def get(self, want_leading=False, want_comment=False):
"""Get the next token.
want_leading: If True, return a WHITESPACE token if the
first character read is whitespace. The default is False.
want_comment: If True, return a COMMENT token if the
first token read is a comment. The default is False.
Raises dns.exception.UnexpectedEnd: input ended prematurely
Raises dns.exception.SyntaxError: input was badly formed
Returns a Token.
"""
if self.ungotten_token is not None:
token = self.ungotten_token
self.ungotten_token = None
if token.is_whitespace():
if want_leading:
return token
elif token.is_comment():
if want_comment:
return token
else:
return token
skipped = self.skip_whitespace()
if want_leading and skipped > 0:
return Token(WHITESPACE, ' ')
token = ''
ttype = IDENTIFIER
has_escape = False
while True:
c = self._get_char()
if c == '' or c in self.delimiters:
if c == '' and self.quoting:
raise dns.exception.UnexpectedEnd
if token == '' and ttype != QUOTED_STRING:
if c == '(':
self.multiline += 1
self.skip_whitespace()
continue
elif c == ')':
if self.multiline <= 0:
raise dns.exception.SyntaxError
self.multiline -= 1
self.skip_whitespace()
continue
elif c == '"':
if not self.quoting:
self.quoting = True
self.delimiters = _QUOTING_DELIMITERS
ttype = QUOTED_STRING
continue
else:
self.quoting = False
self.delimiters = _DELIMITERS
self.skip_whitespace()
continue
elif c == '\n':
return Token(EOL, '\n')
elif c == ';':
while 1:
c = self._get_char()
if c == '\n' or c == '':
break
token += c
if want_comment:
self._unget_char(c)
return Token(COMMENT, token)
elif c == '':
if self.multiline:
raise dns.exception.SyntaxError(
'unbalanced parentheses')
return Token(EOF)
elif self.multiline:
self.skip_whitespace()
token = ''
continue
else:
return Token(EOL, '\n')
else:
# This code exists in case we ever want a
# delimiter to be returned. It never produces
# a token currently.
token = c
ttype = DELIMITER
else:
self._unget_char(c)
break
elif self.quoting and c == '\n':
raise dns.exception.SyntaxError('newline in quoted string')
elif c == '\\':
#
# It's an escape. Put it and the next character into
# the token; it will be checked later for goodness.
#
token += c
has_escape = True
c = self._get_char()
if c == '' or c == '\n':
raise dns.exception.UnexpectedEnd
token += c
if token == '' and ttype != QUOTED_STRING:
if self.multiline:
raise dns.exception.SyntaxError('unbalanced parentheses')
ttype = EOF
return Token(ttype, token, has_escape)
def unget(self, token):
"""Unget a token.
The unget buffer for tokens is only one token large; it is
an error to try to unget a token when the unget buffer is not
empty.
token: the token to unget
Raises UngetBufferFull: there is already an ungotten token
"""
if self.ungotten_token is not None:
raise UngetBufferFull
self.ungotten_token = token
def next(self):
"""Return the next item in an iteration.
Returns a Token.
"""
token = self.get()
if token.is_eof():
raise StopIteration
return token
__next__ = next
def __iter__(self):
return self
# Helpers
def get_int(self, base=10):
"""Read the next token and interpret it as an unsigned integer.
Raises dns.exception.SyntaxError if not an unsigned integer.
Returns an int.
"""
token = self.get().unescape()
if not token.is_identifier():
raise dns.exception.SyntaxError('expecting an identifier')
if not token.value.isdigit():
raise dns.exception.SyntaxError('expecting an integer')
return int(token.value, base)
def get_uint8(self):
"""Read the next token and interpret it as an 8-bit unsigned
integer.
Raises dns.exception.SyntaxError if not an 8-bit unsigned integer.
Returns an int.
"""
value = self.get_int()
if value < 0 or value > 255:
raise dns.exception.SyntaxError(
'%d is not an unsigned 8-bit integer' % value)
return value
def get_uint16(self, base=10):
"""Read the next token and interpret it as a 16-bit unsigned
integer.
Raises dns.exception.SyntaxError if not a 16-bit unsigned integer.
Returns an int.
"""
value = self.get_int(base=base)
if value < 0 or value > 65535:
if base == 8:
raise dns.exception.SyntaxError(
'%o is not an octal unsigned 16-bit integer' % value)
else:
raise dns.exception.SyntaxError(
'%d is not an unsigned 16-bit integer' % value)
return value
def get_uint32(self, base=10):
"""Read the next token and interpret it as a 32-bit unsigned
integer.
Raises dns.exception.SyntaxError if not a 32-bit unsigned integer.
Returns an int.
"""
value = self.get_int(base=base)
if value < 0 or value > 4294967295:
raise dns.exception.SyntaxError(
'%d is not an unsigned 32-bit integer' % value)
return value
def get_string(self, max_length=None):
"""Read the next token and interpret it as a string.
Raises dns.exception.SyntaxError if not a string.
Raises dns.exception.SyntaxError if token value length
exceeds max_length (if specified).
Returns a string.
"""
token = self.get().unescape()
if not (token.is_identifier() or token.is_quoted_string()):
raise dns.exception.SyntaxError('expecting a string')
if max_length and len(token.value) > max_length:
raise dns.exception.SyntaxError("string too long")
return token.value
def get_identifier(self):
"""Read the next token, which should be an identifier.
Raises dns.exception.SyntaxError if not an identifier.
Returns a string.
"""
token = self.get().unescape()
if not token.is_identifier():
raise dns.exception.SyntaxError('expecting an identifier')
return token.value
def concatenate_remaining_identifiers(self):
"""Read the remaining tokens on the line, which should be identifiers.
Raises dns.exception.SyntaxError if a token is seen that is not an
identifier.
Returns a string containing a concatenation of the remaining
identifiers.
"""
s = ""
while True:
token = self.get().unescape()
if token.is_eol_or_eof():
break
if not token.is_identifier():
raise dns.exception.SyntaxError
s += token.value
return s
def as_name(self, token, origin=None, relativize=False, relativize_to=None):
"""Try to interpret the token as a DNS name.
Raises dns.exception.SyntaxError if not a name.
Returns a dns.name.Name.
"""
if not token.is_identifier():
raise dns.exception.SyntaxError('expecting an identifier')
name = dns.name.from_text(token.value, origin, self.idna_codec)
return name.choose_relativity(relativize_to or origin, relativize)
def get_name(self, origin=None, relativize=False, relativize_to=None):
"""Read the next token and interpret it as a DNS name.
Raises dns.exception.SyntaxError if not a name.
Returns a dns.name.Name.
"""
token = self.get()
return self.as_name(token, origin, relativize, relativize_to)
def get_eol(self):
"""Read the next token and raise an exception if it isn't EOL or
EOF.
Returns a string.
"""
token = self.get()
if not token.is_eol_or_eof():
raise dns.exception.SyntaxError(
'expected EOL or EOF, got %d "%s"' % (token.ttype,
token.value))
return token.value
def get_ttl(self):
"""Read the next token and interpret it as a DNS TTL.
Raises dns.exception.SyntaxError or dns.ttl.BadTTL if not an
identifier or badly formed.
Returns an int.
"""
token = self.get().unescape()
if not token.is_identifier():
raise dns.exception.SyntaxError('expecting an identifier')
return dns.ttl.from_text(token.value)
| [
"[email protected]"
]
| |
0f63546dde37b4f558b0a06b0b9db13717c4d47a | 871ad716e6e9ceaa783e5ba914fbe678d0e6819a | /bubbly/util.py | ae9aac625d05659c200c9109fbd41d1daab4dddb | [
"MIT"
]
| permissive | linan7788626/brut | d653b8e3110fd0025e8c5279d3a36c8acbbad3d0 | f4223b84448d1db1b0e98e043dc6670adf05ee5d | refs/heads/master | 2020-12-02T15:08:57.724313 | 2014-06-25T12:34:55 | 2014-06-25T12:34:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,461 | py | import os
from cPickle import load, dump
import logging
from skimage.transform import resize
from sklearn.metrics import recall_score, auc_score
import numpy as np
def lon_offset(x, y):
"""Return angular separation between two offsets which possibly
straddle l=0
>>> lon_offset(0, 1)
1
>>> lon_offset(1, 0)
1
>>> lon_offset(0, 355)
5
>>> lon_offset(355, 0)
5
>>> lon_offset(181, 0)
179
"""
return min(abs(x - y), abs(x + 360 - y), abs(x - (y + 360)))
def up_to_date(inputs, output):
"""Test whether an output file is more recent than
a list of input files
Parameters
----------
inputs: List of strings (paths to input files)
output: string (path to output file)
Returns
-------
Boolean (True if output more recent than all inputs)
"""
if not os.path.exists(output):
return False
itime = max(os.path.getmtime(input) for input in inputs)
otime = os.path.getmtime(output)
return otime > itime
def scale(x, mask=None, limits=None):
"""Scale an array as is done in MWP paper
Sqrt transform of data cipped at 5 and 99.8%
"""
limits = limits or [5, 99.8]
if mask is None:
lo, hi = np.percentile(x, limits)
else:
lo, hi = np.percentile(x[mask], limits)
x = (np.clip(x, lo, hi) - lo) / (hi - lo)
return (np.sqrt(x) * 255).astype(np.uint8)
def resample(arr, shape):
"""Resample a 2D array, to change its shape"""
# skimage's resize needs scaled data
lo, hi = np.nanmin(arr), np.nanmax(arr)
arr = (arr - lo) / (hi - lo)
result = resize(arr, shape, mode='nearest')
return result * (hi - lo) + lo
def save_learner(clf, filename):
"""Save a scikit-learn model to a file"""
with open(filename, 'w') as outfile:
dump(clf, outfile)
def load_learner(filename):
""" Load a scikit-learn model from a file"""
with open(filename) as infile:
result = load(infile)
return result
def false_pos(Y, Yp):
return 1.0 * ((Y == 0) & (Yp == 1)).sum() / (Y == 0).sum()
def recall(Y, Yp):
return recall_score(Y, Yp)
def summary(clf, x, y):
df = clf.decision_function(x).ravel()
yp = df > 0
print 'False Positive: %0.3f' % false_pos(y, yp)
print 'Recall: %0.3f' % recall(y, yp)
print 'AUC: %0.3f' % auc_score(y, yp)
print 'Accuracy: %0.3f' % (yp == y).mean()
def roc_curve(y, yp, **kwargs):
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve as skroc
fp, tp, th = skroc(y, yp)
plt.plot(fp, tp, **kwargs)
plt.xlabel('False Positive')
plt.ylabel('True Positive')
ax = plt.gca()
ax.grid(which='major', axis='x',
linewidth=0.75, linestyle='-', color='0.75')
ax.grid(which='minor', axis='x',
linewidth=0.25, linestyle='-', color='0.75')
ax.grid(which='major', axis='y',
linewidth=0.75, linestyle='-', color='0.75')
ax.grid(which='minor', axis='y',
linewidth=0.25, linestyle='-', color='0.75')
return fp, tp
def rfp_curve(yp, Y, **kwargs):
""" Plot the false positive rate as a function of recall """
import matplotlib.pyplot as plt
npos = Y.sum()
nneg = Y.size - npos
ind = np.argsort(yp)[::-1]
y = Y[ind]
yp = yp[ind]
recall = (1. * np.cumsum(y == 1)) / npos
false_pos = (1. * np.cumsum(y == 0)) / nneg
r = 1.0 * ((yp > 0) & (y == 1)).sum() / npos
fp = 1.0 * ((yp > 0) & (y == 0)).sum() / nneg
l, = plt.plot(recall, false_pos, **kwargs)
plt.plot([r], [fp], 'o', c=l.get_color())
plt.xlabel('Recall')
plt.ylabel('False Positive')
plt.title("R=%0.3f, FP=%0.4f" % (r, fp))
ax = plt.gca()
ax.grid(which='major', axis='x',
linewidth=0.75, linestyle='-', color='0.75')
ax.grid(which='minor', axis='x',
linewidth=0.25, linestyle='-', color='0.75')
ax.grid(which='major', axis='y',
linewidth=0.75, linestyle='-', color='0.75')
ax.grid(which='minor', axis='y',
linewidth=0.25, linestyle='-', color='0.75')
return recall, false_pos
def _stamp_distances(stamps):
#compute distance matrix for a list of stamps
n = len(stamps)
result = np.zeros((n, n)) * np.nan
for i in range(n):
si = stamps[i]
xi, yi, di = si[1:4]
for j in range(i + 1, n, 1):
sj = stamps[j]
xj, yj, dj = sj[1:4]
dx = np.hypot(xi - xj, yi - yj)
if dx > max(di, dj):
continue
elif max(di / dj, dj / di) > 3:
continue
else:
d = dx / ((di + dj) / 2.)
result[i, j] = result[j, i] = d
return result
def _decimate(dist_matrix, scores):
inds = np.arange(dist_matrix.shape[0])
while True:
if ~np.isfinite(dist_matrix).any():
break
best = np.nanargmin(dist_matrix)
i, j = np.unravel_index(best, dist_matrix.shape)
merge = i if scores[i] < scores[j] else j
inds = np.delete(inds, merge)
scores = np.delete(scores, merge)
dist_matrix = np.delete(np.delete(dist_matrix, merge, 0), merge, 1)
return inds
def merge_detections(detections):
locations, scores = zip(*detections)
scores = np.array(scores)
dist = _stamp_distances(locations)
result = _decimate(dist, scores)
return np.asarray(detections)[result]
def normalize(arr):
"""Flatten and L2-normalize an array, and return"""
arr = arr.ravel().astype(np.float)
n = np.sqrt((arr ** 2).sum())
return arr / n
ely, elx = np.mgrid[:40, :40]
def ellipse(x0, y0, a, b, dr, theta0):
"""Make a 40x40 pix image of an ellipse"""
r = np.hypot(elx - x0, ely - y0)
theta = np.arctan2(ely - y0, elx - x0) - np.radians(theta0)
r0 = a * b / np.hypot(a * np.cos(theta), b * np.sin(theta))
return np.exp(-np.log(r / r0) ** 2 / (dr / 10.) ** 2)
def _sample_and_scale(i4, mips, do_scale, limits, shp=(40, 40), i3=None):
mips = np.where(mips > 0, mips, np.nan)
i4 = resample(i4, shp)
mips = resample(mips, shp)
if i3 is not None:
i3 = resample(i3, shp)
assert i4.shape == shp, i4.shape
assert mips.shape == shp, mips.shape
mask = np.isfinite(mips)
if do_scale:
try:
i4 = scale(i4, limits=limits)
mips = scale(mips, mask, limits=limits)
mips[~mask] = 255
if i3 is not None:
i3 = scale(i3, mask, limits=[1, 99])
except ValueError:
#print 'Could not rescale images (bad pixels?)'
return
else:
mips[~mask] = np.nan
b = i3 if i3 is not None else i4 * 0
rgb = np.dstack((mips, i4, b))
return rgb
def _unpack(tree):
if isinstance(tree, np.ndarray):
return tree.ravel()
return np.hstack(_unpack(t) for t in tree)
def multiwavelet_from_rgb(rgb):
from scipy.fftpack import dct
from pywt import wavedec2
r = rgb[:, :, 0].astype(np.float)
g = rgb[:, :, 1].astype(np.float)
dctr = dct(r, norm='ortho').ravel()
dctg = dct(g, norm='ortho').ravel()
daubr = _unpack(wavedec2(r, 'db4'))
daubg = _unpack(wavedec2(g, 'db4'))
return np.hstack([dctr, dctg, daubr, daubg])
def overlap(l, b, r, l0, b0, r0):
overlap = np.zeros(l.size, dtype=np.bool)
for i in range(l0.size):
dl = np.abs(l - l0[i])
db = np.abs(b - b0[i])
dr = np.maximum(dl, db)
thresh = r + r0[i]
r_ratio = np.maximum(r / r0[i], r0[i] / r)
overlap |= ((dr < thresh) & (r_ratio < 5))
return overlap
def chunk(x, n):
"""
Split a sequence into approximately n continguous chunks
Parameters
----------
x : list-like
a sequence to extract. Must support len() and slicing
Outputs
-------
A list of approximately n slices of x. The length of the list
will always be <= n
"""
nx = len(x)
if n < 1 or n > nx:
raise ValueError("n must be >0, and <= %i: %i" % (n, nx))
chunksz = int(np.ceil(1. * nx / n))
return [x[i: i + chunksz] for i in range(0, nx, chunksz)]
def cloud_map(func, args, jobs=None, return_jobs=False,
**cloud_opts):
"""
Call cloud.map, with some standard logging info
Parameters
----------
func : function to map
args : list of mapping arguments
jobs : list of pre-existing job ids, or None
If present, will fetch the results from these jobs
return_jobs : boolean (optional, default false)
If True, return the job IDs instead of
the job results
cloud_opts : dict (optional)
Extra keyword arguments to pass to cloud.map
Returns
-------
Result of cloud.map if return_jobs=False, else the job ids
"""
import cloud
cloud_opts.setdefault('_env', 'mwp')
cloud_opts.setdefault('_type', 'c2')
cloud_opts.setdefault('_label', func.__name__)
if jobs is None:
log = logging.getLogger(func.__module__)
log.debug(
"Starting %i jobs on PiCloud for %s" % (len(args), func.__name__))
jobs = cloud.map(func, args, **cloud_opts)
log.debug("To re-fetch results, use \n"
"%s(jobs=range(%i, %i))" %
(func.__name__, min(jobs), max(jobs) + 1))
if return_jobs:
return jobs
return cloud.result(jobs)
| [
"[email protected]"
]
| |
8dcecbb2db91f0781c70434f88392b4d940ba544 | 32eeb97dff5b1bf18cf5be2926b70bb322e5c1bd | /benchmark/ankiandroid/testcase/firstcases/testcase4_014.py | be1af9489a3d62454bebe7063c442ec02f4fe4d7 | []
| no_license | Prefest2018/Prefest | c374d0441d714fb90fca40226fe2875b41cf37fc | ac236987512889e822ea6686c5d2e5b66b295648 | refs/heads/master | 2021-12-09T19:36:24.554864 | 2021-12-06T12:46:14 | 2021-12-06T12:46:14 | 173,225,161 | 5 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,621 | py | #coding=utf-8
import os
import subprocess
import time
import traceback
from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction
from selenium.common.exceptions import NoSuchElementException, WebDriverException
desired_caps = {
'platformName' : 'Android',
'deviceName' : 'Android Emulator',
'platformVersion' : '4.4',
'appPackage' : 'com.ichi2.anki',
'appActivity' : 'com.ichi2.anki.IntentHandler',
'resetKeyboard' : True,
'androidCoverage' : 'com.ichi2.anki/com.ichi2.anki.JacocoInstrumentation',
'noReset' : True
}
def command(cmd, timeout=5):
p = subprocess.Popen(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=True)
time.sleep(timeout)
p.terminate()
return
def getElememt(driver, str) :
for i in range(0, 5, 1):
try:
element = driver.find_element_by_android_uiautomator(str)
except NoSuchElementException:
time.sleep(1)
else:
return element
os.popen("adb shell input tap 50 50")
element = driver.find_element_by_android_uiautomator(str)
return element
def getElememtBack(driver, str1, str2) :
for i in range(0, 2, 1):
try:
element = driver.find_element_by_android_uiautomator(str1)
except NoSuchElementException:
time.sleep(1)
else:
return element
for i in range(0, 5, 1):
try:
element = driver.find_element_by_android_uiautomator(str2)
except NoSuchElementException:
time.sleep(1)
else:
return element
os.popen("adb shell input tap 50 50")
element = driver.find_element_by_android_uiautomator(str2)
return element
def swipe(driver, startxper, startyper, endxper, endyper) :
size = driver.get_window_size()
width = size["width"]
height = size["height"]
try:
driver.swipe(start_x=int(width * startxper), start_y=int(height * startyper), end_x=int(width * endxper),
end_y=int(height * endyper), duration=2000)
except WebDriverException:
time.sleep(1)
driver.swipe(start_x=int(width * startxper), start_y=int(height * startyper), end_x=int(width * endxper),
end_y=int(height * endyper), duration=2000)
return
# testcase014
try :
starttime = time.time()
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
element = getElememt(driver, "new UiSelector().resourceId(\"com.ichi2.anki:id/action_sync\").className(\"android.widget.TextView\")")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"You must log in to a third party account to use the cloud sync service. You can create one in the next step.\")", "new UiSelector().className(\"android.widget.TextView\").instance(1)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"You must log in to a third party account to use the cloud sync service. You can create one in the next step.\")", "new UiSelector().className(\"android.widget.TextView\").instance(1)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"You must log in to a third party account to use the cloud sync service. You can create one in the next step.\")", "new UiSelector().className(\"android.widget.TextView\").instance(1)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"You must log in to a third party account to use the cloud sync service. You can create one in the next step.\")", "new UiSelector().className(\"android.widget.TextView\").instance(1)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"Cancel\")", "new UiSelector().className(\"android.widget.TextView\").instance(2)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"Default\")", "new UiSelector().className(\"android.widget.TextView\").instance(3)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"0\")", "new UiSelector().className(\"android.widget.TextView\").instance(6)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"0\")", "new UiSelector().className(\"android.widget.TextView\").instance(6)")
TouchAction(driver).tap(element).perform()
element = getElememt(driver, "new UiSelector().resourceId(\"com.ichi2.anki:id/action_sync\").className(\"android.widget.TextView\")")
TouchAction(driver).long_press(element).release().perform()
element = getElememt(driver, "new UiSelector().className(\"android.widget.ImageView\").description(\"More options\")")
TouchAction(driver).tap(element).perform()
driver.press_keycode(4)
element = getElememtBack(driver, "new UiSelector().text(\"Custom study session\")", "new UiSelector().className(\"android.widget.TextView\").instance(3)")
TouchAction(driver).long_press(element).release().perform()
element = getElememtBack(driver, "new UiSelector().text(\"Options\")", "new UiSelector().className(\"android.widget.TextView\").instance(4)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\"Define custom steps\")", "new UiSelector().className(\"android.widget.TextView\").instance(11)")
TouchAction(driver).tap(element).perform()
element = getElememtBack(driver, "new UiSelector().text(\" rated:1:1\")", "new UiSelector().className(\"android.widget.TextView\").instance(3)")
TouchAction(driver).tap(element).perform()
element = getElememt(driver, "new UiSelector().resourceId(\"android:id/edit\").className(\"android.widget.EditText\")")
element.clear()
element.send_keys(" rated:1:1");
element = getElememt(driver, "new UiSelector().resourceId(\"android:id/edit\").className(\"android.widget.EditText\")")
element.clear()
element.send_keys("99999");
element = getElememt(driver, "new UiSelector().resourceId(\"android:id/edit\").className(\"android.widget.EditText\")")
element.clear()
element.send_keys("0");
element = getElememt(driver, "new UiSelector().resourceId(\"android:id/edit\").className(\"android.widget.EditText\")")
element.clear()
element.send_keys("1");
except Exception, e:
print 'FAIL'
print 'str(e):\t\t', str(e)
print 'repr(e):\t', repr(e)
print traceback.format_exc()
else:
print 'OK'
finally:
cpackage = driver.current_package
endtime = time.time()
print 'consumed time:', str(endtime - starttime), 's'
command("adb shell am broadcast -a com.example.pkg.END_EMMA --es name \"4_014\"")
jacocotime = time.time()
print 'jacoco time:', str(jacocotime - endtime), 's'
driver.quit()
if (cpackage != 'com.ichi2.anki'):
cpackage = "adb shell am force-stop " + cpackage
os.popen(cpackage) | [
"[email protected]"
]
| |
95eaf80a4b064aa8106077d14d8e97f76da9bee4 | 9a03b4c88a31cc05648f6a7dee1c22cfe08dc872 | /mod_pydoc.py | dacb667e4bae87618e48f4bc9594ad048609d8f4 | []
| no_license | u8y7541/mod_pydoc | 71a9f1802752a79d560c7cc155f060227ec7bf99 | a5fdf9409debf39724bd1fbf5553d86b117e201b | refs/heads/master | 2021-05-04T09:11:26.622118 | 2016-10-09T17:45:25 | 2016-10-09T17:45:25 | 70,418,784 | 0 | 0 | null | 2016-10-09T17:22:23 | 2016-10-09T17:22:22 | null | UTF-8 | Python | false | false | 101,217 | py | #!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
At the Python interactive prompt, calling help(thing) on a Python object
documents the object, and calling help() starts up an interactive
help session.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation on something. <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package. If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.
Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.
Run "pydoc -p <port>" to start an HTTP server on the given port on the
local machine. Port number 0 can be used to get an arbitrary unused port.
Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
open a Web browser to interactively browse documentation. The -p option
can be used with the -b option to explicitly specify the server port.
Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".
Module docs for core modules are assumed to be in
http://docs.python.org/X.Y/library/
This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
"""
__all__ = ['help']
__author__ = "Ka-Ping Yee <[email protected]>"
__date__ = "26 February 2001"
__credits__ = """Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
"""
# Known bugs that can't be fixed here:
# - synopsis() cannot be prevented from clobbering existing
# loaded modules.
# - If the __file__ attribute on a module is a relative path and
# the current directory is changed with os.chdir(), an incorrect
# path will be displayed.
import builtins
import importlib._bootstrap
import importlib.machinery
import importlib.util
import inspect
import io
import os
import pkgutil
import platform
import re
import sys
import time
import tokenize
import warnings
from collections import deque
from reprlib import Repr
from traceback import format_exception_only
# --------------------------------------------------------- common routines
def pathdirs():
"""Convert sys.path into a list of absolute, existing, unique paths."""
dirs = []
normdirs = []
for dir in sys.path:
dir = os.path.abspath(dir or '.')
normdir = os.path.normcase(dir)
if normdir not in normdirs and os.path.isdir(dir):
dirs.append(dir)
normdirs.append(normdir)
return dirs
def getdoc(object):
"""Get the doc string or comments for an object."""
result = inspect.getdoc(object) or inspect.getcomments(object)
return result and re.sub('^ *\n', '', result.rstrip()) or ''
def splitdoc(doc):
"""Split a doc string into a synopsis line (if any) and the rest."""
lines = doc.strip().split('\n')
if len(lines) == 1:
return lines[0], ''
elif len(lines) >= 2 and not lines[1].rstrip():
return lines[0], '\n'.join(lines[2:])
return '', '\n'.join(lines)
def classname(object, modname):
"""Get a class name and qualify it with a module name if necessary."""
name = object.__name__
if object.__module__ != modname:
name = object.__module__ + '.' + name
return name
def isdata(object):
"""Check if an object is of a type that probably means it's data."""
return not (inspect.ismodule(object) or inspect.isclass(object) or
inspect.isroutine(object) or inspect.isframe(object) or
inspect.istraceback(object) or inspect.iscode(object))
def replace(text, *pairs):
"""Do a series of global replacements on a string."""
while pairs:
text = pairs[1].join(text.split(pairs[0]))
pairs = pairs[2:]
return text
def cram(text, maxlen):
"""Omit part of a string if needed to make it fit in a maximum length."""
if len(text) > maxlen:
pre = max(0, (maxlen-3)//2)
post = max(0, maxlen-3-pre)
return text[:pre] + '...' + text[len(text)-post:]
return text
_re_stripid = re.compile(r' at 0x[0-9a-f]{6,16}(>+)$', re.IGNORECASE)
def stripid(text):
"""Remove the hexadecimal id from a Python object representation."""
# The behaviour of %p is implementation-dependent in terms of case.
return _re_stripid.sub(r'\1', text)
def _is_some_method(obj):
return (inspect.isfunction(obj) or
inspect.ismethod(obj) or
inspect.isbuiltin(obj) or
inspect.ismethoddescriptor(obj))
def _is_bound_method(fn):
"""
Returns True if fn is a bound method, regardless of whether
fn was implemented in Python or in C.
"""
if inspect.ismethod(fn):
return True
if inspect.isbuiltin(fn):
self = getattr(fn, '__self__', None)
return not (inspect.ismodule(self) or (self is None))
return False
def allmethods(cl):
methods = {}
for key, value in inspect.getmembers(cl, _is_some_method):
methods[key] = 1
for base in cl.__bases__:
methods.update(allmethods(base)) # all your base are belong to us
for key in methods.keys():
methods[key] = getattr(cl, key)
return methods
def _split_list(s, predicate):
"""Split sequence s via predicate, and return pair ([true], [false]).
The return value is a 2-tuple of lists,
([x for x in s if predicate(x)],
[x for x in s if not predicate(x)])
"""
yes = []
no = []
for x in s:
if predicate(x):
yes.append(x)
else:
no.append(x)
return yes, no
def visiblename(name, all=None, obj=None):
"""Decide whether to show documentation on a variable."""
# Certain special names are redundant or internal.
# XXX Remove __initializing__?
if name in {'__author__', '__builtins__', '__cached__', '__credits__',
'__date__', '__doc__', '__file__', '__spec__',
'__loader__', '__module__', '__name__', '__package__',
'__path__', '__qualname__', '__slots__', '__version__'}:
return 0
# Private names are hidden, but special names are displayed.
if name.startswith('__') and name.endswith('__'): return 1
# Namedtuples have public fields and methods with a single leading underscore
if name.startswith('_') and hasattr(obj, '_fields'):
return True
if all is not None:
# only document that which the programmer exported in __all__
return name in all
else:
return not name.startswith('_')
def classify_class_attrs(object):
"""Wrap inspect.classify_class_attrs, with fixup for data descriptors."""
results = []
for (name, kind, cls, value) in inspect.classify_class_attrs(object):
if inspect.isdatadescriptor(value):
kind = 'data descriptor'
results.append((name, kind, cls, value))
return results
# ----------------------------------------------------- module manipulation
def ispackage(path):
"""Guess whether a path refers to a package directory."""
if os.path.isdir(path):
for ext in ('.py', '.pyc', '.pyo'):
if os.path.isfile(os.path.join(path, '__init__' + ext)):
return True
return False
def source_synopsis(file):
line = file.readline()
while line[:1] == '#' or not line.strip():
line = file.readline()
if not line: break
line = line.strip()
if line[:4] == 'r"""': line = line[1:]
if line[:3] == '"""':
line = line[3:]
if line[-1:] == '\\': line = line[:-1]
while not line.strip():
line = file.readline()
if not line: break
result = line.split('"""')[0].strip()
else: result = None
return result
def synopsis(filename, cache={}):
"""Get the one-line summary out of a module file."""
mtime = os.stat(filename).st_mtime
lastupdate, result = cache.get(filename, (None, None))
if lastupdate is None or lastupdate < mtime:
# Look for binary suffixes first, falling back to source.
if filename.endswith(tuple(importlib.machinery.BYTECODE_SUFFIXES)):
loader_cls = importlib.machinery.SourcelessFileLoader
elif filename.endswith(tuple(importlib.machinery.EXTENSION_SUFFIXES)):
loader_cls = importlib.machinery.ExtensionFileLoader
else:
loader_cls = None
# Now handle the choice.
if loader_cls is None:
# Must be a source file.
try:
file = tokenize.open(filename)
except OSError:
# module can't be opened, so skip it
return None
# text modules can be directly examined
with file:
result = source_synopsis(file)
else:
# Must be a binary module, which has to be imported.
loader = loader_cls('__temp__', filename)
# XXX We probably don't need to pass in the loader here.
spec = importlib.util.spec_from_file_location('__temp__', filename,
loader=loader)
_spec = importlib._bootstrap._SpecMethods(spec)
try:
module = _spec.load()
except:
return None
del sys.modules['__temp__']
result = (module.__doc__ or '').splitlines()[0]
# Cache the result.
cache[filename] = (mtime, result)
return result
class ErrorDuringImport(Exception):
"""Errors that occurred while trying to import something to document it."""
def __init__(self, filename, exc_info):
self.filename = filename
self.exc, self.value, self.tb = exc_info
def __str__(self):
exc = self.exc.__name__
return 'problem in %s - %s: %s' % (self.filename, exc, self.value)
def importfile(path):
"""Import a Python source file or compiled file given its path."""
magic = importlib.util.MAGIC_NUMBER
with open(path, 'rb') as file:
is_bytecode = magic == file.read(len(magic))
filename = os.path.basename(path)
name, ext = os.path.splitext(filename)
if is_bytecode:
loader = importlib._bootstrap.SourcelessFileLoader(name, path)
else:
loader = importlib._bootstrap.SourceFileLoader(name, path)
# XXX We probably don't need to pass in the loader here.
spec = importlib.util.spec_from_file_location(name, path, loader=loader)
_spec = importlib._bootstrap._SpecMethods(spec)
try:
return _spec.load()
except:
raise ErrorDuringImport(path, sys.exc_info())
def safeimport(path, forceload=0, cache={}):
"""Import a module; handle errors; return None if the module isn't found.
If the module *is* found but an exception occurs, it's wrapped in an
ErrorDuringImport exception and reraised. Unlike __import__, if a
package path is specified, the module at the end of the path is returned,
not the package at the beginning. If the optional 'forceload' argument
is 1, we reload the module from disk (unless it's a dynamic extension)."""
try:
# If forceload is 1 and the module has been previously loaded from
# disk, we always have to reload the module. Checking the file's
# mtime isn't good enough (e.g. the module could contain a class
# that inherits from another module that has changed).
if forceload and path in sys.modules:
if path not in sys.builtin_module_names:
# Remove the module from sys.modules and re-import to try
# and avoid problems with partially loaded modules.
# Also remove any submodules because they won't appear
# in the newly loaded module's namespace if they're already
# in sys.modules.
subs = [m for m in sys.modules if m.startswith(path + '.')]
for key in [path] + subs:
# Prevent garbage collection.
cache[key] = sys.modules[key]
del sys.modules[key]
module = __import__(path)
except:
# Did the error occur before or after the module was found?
(exc, value, tb) = info = sys.exc_info()
if path in sys.modules:
# An error occurred while executing the imported module.
raise ErrorDuringImport(sys.modules[path].__file__, info)
elif exc is SyntaxError:
# A SyntaxError occurred before we could execute the module.
raise ErrorDuringImport(value.filename, info)
elif exc is ImportError and value.name == path:
# No such module in the path.
return None
else:
# Some other error occurred during the importing process.
raise ErrorDuringImport(path, sys.exc_info())
for part in path.split('.')[1:]:
try: module = getattr(module, part)
except AttributeError: return None
return module
# ---------------------------------------------------- formatter base class
class Doc:
PYTHONDOCS = os.environ.get("PYTHONDOCS",
"http://docs.python.org/%d.%d/library"
% sys.version_info[:2])
def document(self, object, name=None, *args):
"""Generate documentation for an object."""
args = (object, name) + args
# 'try' clause is to attempt to handle the possibility that inspect
# identifies something in a way that pydoc itself has issues handling;
# think 'super' and how it is a descriptor (which raises the exception
# by lacking a __name__ attribute) and an instance.
if inspect.isgetsetdescriptor(object): return self.docdata(*args)
if inspect.ismemberdescriptor(object): return self.docdata(*args)
try:
if inspect.ismodule(object): return self.docmodule(*args)
if inspect.isclass(object): return self.docclass(*args)
if inspect.isroutine(object): return self.docroutine(*args)
except AttributeError:
pass
if isinstance(object, property): return self.docproperty(*args)
return self.docother(*args)
def fail(self, object, name=None, *args):
"""Raise an exception for unimplemented types."""
message = "don't know how to document object%s of type %s" % (
name and ' ' + repr(name), type(object).__name__)
raise TypeError(message)
docmodule = docclass = docroutine = docother = docproperty = docdata = fail
def getdocloc(self, object):
"""Return the location of module docs or None"""
try:
file = inspect.getabsfile(object)
except TypeError:
file = '(built-in)'
docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)
basedir = os.path.join(sys.base_exec_prefix, "lib",
"python%d.%d" % sys.version_info[:2])
if (isinstance(object, type(os)) and
(object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
'marshal', 'posix', 'signal', 'sys',
'_thread', 'zipimport') or
(file.startswith(basedir) and
not file.startswith(os.path.join(basedir, 'site-packages')))) and
object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
if docloc.startswith("http://"):
docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__)
else:
docloc = os.path.join(docloc, object.__name__ + ".html")
else:
docloc = None
return docloc
# -------------------------------------------- HTML documentation generator
class HTMLRepr(Repr):
"""Class for safely making an HTML representation of a Python object."""
def __init__(self):
Repr.__init__(self)
self.maxlist = self.maxtuple = 20
self.maxdict = 10
self.maxstring = self.maxother = 100
def escape(self, text):
return replace(text, '&', '&', '<', '<', '>', '>')
def repr(self, object):
return Repr.repr(self, object)
def repr1(self, x, level):
if hasattr(type(x), '__name__'):
methodname = 'repr_' + '_'.join(type(x).__name__.split())
if hasattr(self, methodname):
return getattr(self, methodname)(x, level)
return self.escape(cram(stripid(repr(x)), self.maxother))
def repr_string(self, x, level):
test = cram(x, self.maxstring)
testrepr = repr(test)
if '\\' in test and '\\' not in replace(testrepr, r'\\', ''):
# Backslashes are only literal in the string and are never
# needed to make any special characters, so show a raw string.
return 'r' + testrepr[0] + self.escape(test) + testrepr[0]
return re.sub(r'((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)',
r'<span class="repr_string">\1</span>',
self.escape(testrepr))
repr_str = repr_string
def repr_instance(self, x, level):
try:
return self.escape(cram(stripid(repr(x)), self.maxstring))
except:
return self.escape('<%s instance>' % x.__class__.__name__)
repr_unicode = repr_string
class HTMLDoc(Doc):
"""Formatter class for HTML documentation."""
# ------------------------------------------- HTML formatting utilities
_repr_instance = HTMLRepr()
repr = _repr_instance.repr
escape = _repr_instance.escape
def page(self, title, contents):
"""Format an HTML page."""
return '''\
<!doctype html>
<html><head><title>Python: %s</title>
<meta charset="UTF-8">
</head><body>
%s
</body></html>''' % (title, contents)
def heading(self, title, extras=''):
"""Format a page heading."""
return '''
<table class="heading">
<tr><td>{}</td><td class="align_right normal">{}</td></tr></table>
'''.format(title, extras or ' ')
def html_section(self, title, contents, width=6,
prelude='', marginalia=None, gap=' ',
css_class=''):
"""Format a section with a heading."""
if marginalia is None:
marginalia = '<code>' + ' ' * width + '</code>'
result = '''<br>
<table class="{}">
<tr>
<td colspan="3"> <br>
{}</td></tr>
'''.format(css_class, title)
if prelude:
result = result + '''
<tr><td rowspan="2">{}</td>
<td colspan="2">{}</td></tr>
<tr><td>{}</td>'''.format(marginalia, prelude, gap)
else:
result = result + '''
<tr><td>{}</td><td>{}</td>'''.format(marginalia, gap)
contents = '{}</td></tr></table>'.format(contents)
return result + '\n<td class="inner_table">' + contents
def bigsection(self, title, *args, **kwargs):
"""Format a section with a big heading."""
title = '<span class="section_title">{}</span>'.format(title)
return self.html_section(title, *args, **kwargs)
def preformat(self, text):
"""Format literal preformatted text."""
text = self.escape(text.expandtabs())
return replace(text, '\n\n', '\n \n', '\n\n', '\n \n',
' ', ' ', '\n', '<br>\n')
def multicolumn(self, list, format, cols=4):
"""Format a list of items into a multi-column list."""
result = ''
rows = (len(list)+cols-1)//cols
for col in range(cols):
result = result + '<td style="width:%d%%;vertical-align:text-top">' % (100//cols)
for i in range(rows*col, rows*col+rows):
if i < len(list):
result = result + format(list[i]) + '<br>\n'
result = result + '</td>'
return '<table style="width:100%%"><tr>%s</tr></table>' % result
def grey(self, text): return '<span class="grey">%s</span>' % text
def namelink(self, name, *dicts):
"""Make a link for an identifier, given name-to-URL mappings."""
for dict in dicts:
if name in dict:
return '<a href="%s">%s</a>' % (dict[name], name)
return name
def classlink(self, object, modname):
"""Make a link for a class."""
name, module = object.__name__, sys.modules.get(object.__module__)
if hasattr(module, name) and getattr(module, name) is object:
return '<a href="%s.html#%s">%s</a>' % (
module.__name__, name, classname(object, modname))
return classname(object, modname)
def modulelink(self, object):
"""Make a link for a module."""
return '<a href="%s.html">%s</a>' % (object.__name__, object.__name__)
def modpkglink(self, modpkginfo):
"""Make a link for a module or package to display in an index."""
name, path, ispackage, shadowed = modpkginfo
if shadowed:
return self.grey(name)
if path:
url = '%s.%s.html' % (path, name)
else:
url = '%s.html' % name
if ispackage:
text = '<strong>%s</strong> (package)' % name
else:
text = name
return '<a href="%s">%s</a>' % (url, text)
def filelink(self, url, path):
"""Make a link to source file."""
return '<a href="file:%s">%s</a>' % (url, path)
def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
"""Mark up some plain text, given a context of symbols to look for.
Each context dictionary maps object names to anchor names."""
escape = escape or self.escape
results = []
here = 0
pattern = re.compile(r'\b((http|ftp)://\S+[\w/]|'
r'RFC[- ]?(\d+)|'
r'PEP[- ]?(\d+)|'
r'(self\.)?(\w+))')
while True:
match = pattern.search(text, here)
if not match: break
start, end = match.span()
results.append(escape(text[here:start]))
all, scheme, rfc, pep, selfdot, name = match.groups()
if scheme:
url = escape(all).replace('"', '"')
results.append('<a href="%s">%s</a>' % (url, url))
elif rfc:
url = 'http://www.rfc-editor.org/rfc/rfc%d.txt' % int(rfc)
results.append('<a href="%s">%s</a>' % (url, escape(all)))
elif pep:
url = 'http://www.python.org/dev/peps/pep-%04d/' % int(pep)
results.append('<a href="%s">%s</a>' % (url, escape(all)))
elif text[end:end+1] == '(':
results.append(self.namelink(name, methods, funcs, classes))
elif selfdot:
results.append('self.<strong>%s</strong>' % name)
else:
results.append(self.namelink(name, classes))
here = end
results.append(escape(text[here:]))
return ''.join(results)
# ---------------------------------------------- type-specific routines
def formattree(self, tree, modname, parent=None):
"""Produce HTML for a class tree as given by inspect.getclasstree()."""
result = ''
for entry in tree:
if type(entry) is type(()):
c, bases = entry
result = result + '<dt>'
result = result + self.classlink(c, modname)
if bases and bases != (parent,):
parents = []
for base in bases:
parents.append(self.classlink(base, modname))
result = result + '(' + ', '.join(parents) + ')'
result = result + '\n</dt>'
elif type(entry) is type([]):
result = result + '<dd>\n%s</dd>\n' % self.formattree(
entry, modname, c)
return '<dl><dt></dt>\n%s<dd></dd></dl>\n' % result
def docmodule(self, object, name=None, mod=None, *ignored):
"""Produce HTML documentation for a module object."""
name = object.__name__ # ignore the passed-in name
try:
all = object.__all__
except AttributeError:
all = None
parts = name.split('.')
links = []
for i in range(len(parts)-1):
links.append(
'<a href="{}.html" class="docmodule_link">{}</a>'.format(
'.'.join(parts[:i+1]), parts[i]))
head = '.'.join(links + parts[-1:])
try:
path = inspect.getabsfile(object)
url = path
if sys.platform == 'win32':
import nturl2path
url = nturl2path.pathname2url(path)
filelink = self.filelink(url, path)
except TypeError:
filelink = '(built-in)'
info = []
if hasattr(object, '__version__'):
version = str(object.__version__)
if version[:11] == '$' + 'Revision: ' and version[-1:] == '$':
version = version[11:-1].strip()
info.append('version %s' % self.escape(version))
if hasattr(object, '__date__'):
info.append(self.escape(str(object.__date__)))
if info:
head = head + ' (%s)' % ', '.join(info)
docloc = self.getdocloc(object)
if docloc is not None:
docloc = '<br><a href="%(docloc)s">Module Reference</a>' % locals()
else:
docloc = ''
extras = '<a href=".">index</a><br>' + filelink + docloc
result = self.heading(head, extras)
modules = inspect.getmembers(object, inspect.ismodule)
classes, cdict = [], {}
for key, value in inspect.getmembers(object, inspect.isclass):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None or
(inspect.getmodule(value) or object) is object):
if visiblename(key, all, object):
classes.append((key, value))
cdict[key] = cdict[value] = '#' + key
for key, value in classes:
for base in value.__bases__:
key, modname = base.__name__, base.__module__
module = sys.modules.get(modname)
if modname != name and module and hasattr(module, key):
if getattr(module, key) is base:
if key not in cdict:
cdict[key] = cdict[base] = modname + '.html#' + key
funcs, fdict = [], {}
for key, value in inspect.getmembers(object, inspect.isroutine):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None or inspect.isbuiltin(value) or
inspect.getmodule(value) is object):
if visiblename(key, all, object):
funcs.append((key, value))
fdict[key] = '#-' + key
if inspect.isfunction(value): fdict[value] = fdict[key]
data = []
for key, value in inspect.getmembers(object, isdata):
if visiblename(key, all, object):
data.append((key, value))
doc = self.markup(getdoc(object), self.preformat, fdict, cdict)
doc = doc and '<code>{}</code>'.format(doc)
result = result + '<p>%s</p>\n' % doc
if hasattr(object, '__path__'):
modpkgs = []
for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
modpkgs.append((modname, name, ispkg, 0))
modpkgs.sort()
contents = self.multicolumn(modpkgs, self.modpkglink)
result = result + self.bigsection('Package Contents', contents,
css_class="package")
elif modules:
contents = self.multicolumn(
modules, lambda t: self.modulelink(t[1]))
result = result + self.bigsection('Modules', contents,
css_class="module")
if classes:
classlist = [value for (key, value) in classes]
contents = [
self.formattree(inspect.getclasstree(classlist, 1), name)]
for key, value in classes:
contents.append(self.document(value, key, name, fdict, cdict))
result = result + self.bigsection('Classes', ' '.join(contents),
css_class="classes")
if funcs:
contents = []
for key, value in funcs:
contents.append(self.document(value, key, name, fdict, cdict))
result = result + self.bigsection('Functions', ' '.join(contents),
css_class="functions")
if data:
contents = []
for key, value in data:
contents.append(self.document(value, key))
result = result + self.bigsection('Data', '<br>\n'.join(contents),
css_class="data")
if hasattr(object, '__author__'):
contents = self.markup(str(object.__author__), self.preformat)
result = result + self.bigsection('Author', contents, css_class="author")
if hasattr(object, '__credits__'):
contents = self.markup(str(object.__credits__), self.preformat)
result = result + self.bigsection('Credits', contents, css_class="credits")
return result
def docclass(self, object, name=None, mod=None, funcs={}, classes={},
*ignored):
"""Produce HTML documentation for a class object."""
realname = object.__name__
name = name or realname
bases = object.__bases__
contents = []
push = contents.append
# Cute little class to pump out a horizontal rule between sections.
class HorizontalRule:
def __init__(self):
self.needone = 0
def maybe(self):
if self.needone:
push('<hr>\n')
self.needone = 1
hr = HorizontalRule()
# List the mro, if non-trivial.
mro = deque(inspect.getmro(object))
if len(mro) > 2:
hr.maybe()
push('<dl><dt>Method resolution order:</dt>\n')
for base in mro:
push('<dd>%s</dd>\n' % self.classlink(base,
object.__module__))
push('</dl>\n')
def spill(msg, attrs, predicate):
ok, attrs = _split_list(attrs, predicate)
if ok:
hr.maybe()
push(msg)
for name, kind, homecls, value in ok:
try:
value = getattr(object, name)
except Exception:
# Some descriptors may meet a failure in their __get__.
# (bug #1785)
push(self._docdescriptor(name, value, mod))
else:
push(self.document(value, name, mod,
funcs, classes, mdict, object))
push('\n')
return attrs
def spilldescriptors(msg, attrs, predicate):
ok, attrs = _split_list(attrs, predicate)
if ok:
hr.maybe()
push(msg)
for name, kind, homecls, value in ok:
push(self._docdescriptor(name, value, mod))
return attrs
def spilldata(msg, attrs, predicate):
ok, attrs = _split_list(attrs, predicate)
if ok:
hr.maybe()
push(msg)
for name, kind, homecls, value in ok:
base = self.docother(getattr(object, name), name, mod)
if callable(value) or inspect.isdatadescriptor(value):
doc = getattr(value, "__doc__", None)
else:
doc = None
if doc is None:
push('<dl><dt>%s</dt><dd></dd></dl>\n' % base)
else:
doc = self.markup(getdoc(value), self.preformat,
funcs, classes, mdict)
doc = '<dd><code>%s</code></dd>' % doc
push('<dl><dt>%s%s</dt></dl>\n' % (base, doc))
push('\n')
return attrs
attrs = [(name, kind, cls, value)
for name, kind, cls, value in classify_class_attrs(object)
if visiblename(name, obj=object)]
mdict = {}
for key, kind, homecls, value in attrs:
mdict[key] = anchor = '#' + name + '-' + key
try:
value = getattr(object, name)
except Exception:
# Some descriptors may meet a failure in their __get__.
# (bug #1785)
pass
try:
# The value may not be hashable (e.g., a data attr with
# a dict or list value).
mdict[value] = anchor
except TypeError:
pass
while attrs:
if mro:
thisclass = mro.popleft()
else:
thisclass = attrs[0][2]
attrs, inherited = _split_list(attrs, lambda t: t[2] is thisclass)
if thisclass is builtins.object:
attrs = inherited
continue
elif thisclass is object:
tag = 'defined here'
else:
tag = 'inherited from %s' % self.classlink(thisclass,
object.__module__)
tag += ':<br>\n'
# Sort attrs by name.
attrs.sort(key=lambda t: t[0])
# Pump out the attrs, segregated by kind.
attrs = spill('Methods %s' % tag, attrs,
lambda t: t[1] == 'method')
attrs = spill('Class methods %s' % tag, attrs,
lambda t: t[1] == 'class method')
attrs = spill('Static methods %s' % tag, attrs,
lambda t: t[1] == 'static method')
attrs = spilldescriptors('Data descriptors %s' % tag, attrs,
lambda t: t[1] == 'data descriptor')
attrs = spilldata('Data and other attributes %s' % tag, attrs,
lambda t: t[1] == 'data')
assert attrs == []
attrs = inherited
contents = ''.join(contents)
if name == realname:
title = '<a id="%s">class <strong>%s</strong></a>' % (
name, realname)
else:
title = '<strong>%s</strong> = <a id="%s">class %s</a>' % (
name, name, realname)
if bases:
parents = []
for base in bases:
parents.append(self.classlink(base, object.__module__))
title = title + '(%s)' % ', '.join(parents)
doc = self.markup(getdoc(object), self.preformat, funcs, classes, mdict)
doc = doc and '<code>%s<br> </code>' % doc
return self.html_section(title, contents, 3, doc, css_class="docclass")
def formatvalue(self, object):
"""Format an argument default value as text."""
return self.grey('=' + self.repr(object))
def docroutine(self, object, name=None, mod=None,
funcs={}, classes={}, methods={}, cl=None):
"""Produce HTML documentation for a function or method object."""
realname = object.__name__
name = name or realname
anchor = (cl and cl.__name__ or '') + '-' + name
note = ''
skipdocs = 0
if _is_bound_method(object):
imclass = object.__self__.__class__
if cl:
if imclass is not cl:
note = ' from ' + self.classlink(imclass, mod)
else:
if object.__self__ is not None:
note = ' method of %s instance' % self.classlink(
object.__self__.__class__, mod)
else:
note = ' unbound %s method' % self.classlink(imclass, mod)
if name == realname:
title = '<a id="%s"><strong>%s</strong></a>' % (anchor, realname)
else:
if (cl and realname in cl.__dict__ and
cl.__dict__[realname] is object):
reallink = '<a href="#%s">%s</a>' % (
cl.__name__ + '-' + realname, realname)
skipdocs = 1
else:
reallink = realname
title = '<a id="%s"><strong>%s</strong></a> = %s' % (
anchor, name, reallink)
argspec = None
if inspect.isroutine(object):
try:
signature = inspect.signature(object)
except (ValueError, TypeError):
signature = None
if signature:
argspec = str(signature)
if realname == '<lambda>':
title = '<strong>%s</strong> <em>lambda</em> ' % name
# XXX lambda's won't usually have func_annotations['return']
# since the syntax doesn't support but it is possible.
# So removing parentheses isn't truly safe.
argspec = argspec[1:-1] # remove parentheses
if not argspec:
argspec = '(...)'
decl = title + argspec + (note and self.grey(note))
if skipdocs:
return '<dl><dt>%s</dt><dd></dd></dl>\n' % decl
else:
doc = self.markup(
getdoc(object), self.preformat, funcs, classes, methods)
doc = doc and '<dd><code>%s</code></dd>' % doc
return '<dl><dt>%s</dt><dd></dd>%s</dl>\n' % (decl, doc)
def _docdescriptor(self, name, value, mod):
results = []
push = results.append
if name:
push('<dl><dt><strong>%s</strong></dt>\n' % name)
if value.__doc__ is not None:
doc = self.markup(getdoc(value), self.preformat)
push('<dd><code>%s</code></dd>\n' % doc)
push('<dd></dd></dl>\n')
return ''.join(results)
def docproperty(self, object, name=None, mod=None, cl=None):
"""Produce html documentation for a property."""
return self._docdescriptor(name, object, mod)
def docother(self, object, name=None, mod=None, *ignored):
"""Produce HTML documentation for a data object."""
lhs = name and '<strong>%s</strong> = ' % name or ''
return lhs + self.repr(object)
def docdata(self, object, name=None, mod=None, cl=None):
"""Produce html documentation for a data descriptor."""
return self._docdescriptor(name, object, mod)
def index(self, dir_, shadowed=None):
"""Generate an HTML index for a directory of modules."""
modpkgs = []
if shadowed is None: shadowed = {}
for importer, name, ispkg in pkgutil.iter_modules([dir_]):
if any((0xD800 <= ord(ch) <= 0xDFFF) for ch in name):
# ignore a module if its name contains a surrogate character
continue
modpkgs.append((name, '', ispkg, name in shadowed))
shadowed[name] = 1
modpkgs.sort()
contents = self.multicolumn(modpkgs, self.modpkglink)
return self.bigsection(dir_, contents, css_class="index")
# -------------------------------------------- text documentation generator
class TextRepr(Repr):
"""Class for safely making a text representation of a Python object."""
def __init__(self):
Repr.__init__(self)
self.maxlist = self.maxtuple = 20
self.maxdict = 10
self.maxstring = self.maxother = 100
def repr1(self, x, level):
if hasattr(type(x), '__name__'):
methodname = 'repr_' + '_'.join(type(x).__name__.split())
if hasattr(self, methodname):
return getattr(self, methodname)(x, level)
return cram(stripid(repr(x)), self.maxother)
def repr_string(self, x, level):
test = cram(x, self.maxstring)
testrepr = repr(test)
if '\\' in test and '\\' not in replace(testrepr, r'\\', ''):
# Backslashes are only literal in the string and are never
# needed to make any special characters, so show a raw string.
return 'r' + testrepr[0] + test + testrepr[0]
return testrepr
repr_str = repr_string
def repr_instance(self, x, level):
try:
return cram(stripid(repr(x)), self.maxstring)
except:
return '<%s instance>' % x.__class__.__name__
class TextDoc(Doc):
"""Formatter class for text documentation."""
# ------------------------------------------- text formatting utilities
_repr_instance = TextRepr()
repr = _repr_instance.repr
def bold(self, text):
"""Format a string in bold by overstriking."""
return ''.join(ch + '\b' + ch for ch in text)
def indent(self, text, prefix=' '):
"""Indent text by prepending a given prefix to each line."""
if not text: return ''
lines = [prefix + line for line in text.split('\n')]
if lines: lines[-1] = lines[-1].rstrip()
return '\n'.join(lines)
def section(self, title, contents):
"""Format a section with a given heading."""
clean_contents = self.indent(contents).rstrip()
return self.bold(title) + '\n' + clean_contents + '\n\n'
# ---------------------------------------------- type-specific routines
def formattree(self, tree, modname, parent=None, prefix=''):
"""Render in text a class tree as returned by inspect.getclasstree()."""
result = ''
for entry in tree:
if type(entry) is type(()):
c, bases = entry
result = result + prefix + classname(c, modname)
if bases and bases != (parent,):
parents = (classname(c, modname) for c in bases)
result = result + '(%s)' % ', '.join(parents)
result = result + '\n'
elif type(entry) is type([]):
result = result + self.formattree(
entry, modname, c, prefix + ' ')
return result
def docmodule(self, object, name=None, mod=None):
"""Produce text documentation for a given module object."""
name = object.__name__ # ignore the passed-in name
synop, desc = splitdoc(getdoc(object))
result = self.section('NAME', name + (synop and ' - ' + synop))
all = getattr(object, '__all__', None)
docloc = self.getdocloc(object)
if docloc is not None:
result = result + self.section('MODULE REFERENCE', docloc + """
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
""")
if desc:
result = result + self.section('DESCRIPTION', desc)
classes = []
for key, value in inspect.getmembers(object, inspect.isclass):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None
or (inspect.getmodule(value) or object) is object):
if visiblename(key, all, object):
classes.append((key, value))
funcs = []
for key, value in inspect.getmembers(object, inspect.isroutine):
# if __all__ exists, believe it. Otherwise use old heuristic.
if (all is not None or
inspect.isbuiltin(value) or inspect.getmodule(value) is object):
if visiblename(key, all, object):
funcs.append((key, value))
data = []
for key, value in inspect.getmembers(object, isdata):
if visiblename(key, all, object):
data.append((key, value))
modpkgs = []
modpkgs_names = set()
if hasattr(object, '__path__'):
for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
modpkgs_names.add(modname)
if ispkg:
modpkgs.append(modname + ' (package)')
else:
modpkgs.append(modname)
modpkgs.sort()
result = result + self.section(
'PACKAGE CONTENTS', '\n'.join(modpkgs))
# Detect submodules as sometimes created by C extensions
submodules = []
for key, value in inspect.getmembers(object, inspect.ismodule):
if value.__name__.startswith(name + '.') and key not in modpkgs_names:
submodules.append(key)
if submodules:
submodules.sort()
result = result + self.section(
'SUBMODULES', '\n'.join(submodules))
if classes:
classlist = [value for key, value in classes]
contents = [self.formattree(
inspect.getclasstree(classlist, 1), name)]
for key, value in classes:
contents.append(self.document(value, key, name))
result = result + self.section('CLASSES', '\n'.join(contents))
if funcs:
contents = []
for key, value in funcs:
contents.append(self.document(value, key, name))
result = result + self.section('FUNCTIONS', '\n'.join(contents))
if data:
contents = []
for key, value in data:
contents.append(self.docother(value, key, name, maxlen=70))
result = result + self.section('DATA', '\n'.join(contents))
if hasattr(object, '__version__'):
version = str(object.__version__)
if version[:11] == '$' + 'Revision: ' and version[-1:] == '$':
version = version[11:-1].strip()
result = result + self.section('VERSION', version)
if hasattr(object, '__date__'):
result = result + self.section('DATE', str(object.__date__))
if hasattr(object, '__author__'):
result = result + self.section('AUTHOR', str(object.__author__))
if hasattr(object, '__credits__'):
result = result + self.section('CREDITS', str(object.__credits__))
try:
file = inspect.getabsfile(object)
except TypeError:
file = '(built-in)'
result = result + self.section('FILE', file)
return result
def docclass(self, object, name=None, mod=None, *ignored):
"""Produce text documentation for a given class object."""
realname = object.__name__
name = name or realname
bases = object.__bases__
def makename(c, m=object.__module__):
return classname(c, m)
if name == realname:
title = 'class ' + self.bold(realname)
else:
title = self.bold(name) + ' = class ' + realname
if bases:
parents = map(makename, bases)
title = title + '(%s)' % ', '.join(parents)
doc = getdoc(object)
contents = doc and [doc + '\n'] or []
push = contents.append
# List the mro, if non-trivial.
mro = deque(inspect.getmro(object))
if len(mro) > 2:
push("Method resolution order:")
for base in mro:
push(' ' + makename(base))
push('')
# Cute little class to pump out a horizontal rule between sections.
class HorizontalRule:
def __init__(self):
self.needone = 0
def maybe(self):
if self.needone:
push('-' * 70)
self.needone = 1
hr = HorizontalRule()
def spill(msg, attrs, predicate):
ok, attrs = _split_list(attrs, predicate)
if ok:
hr.maybe()
push(msg)
for name, kind, homecls, value in ok:
try:
value = getattr(object, name)
except Exception:
# Some descriptors may meet a failure in their __get__.
# (bug #1785)
push(self._docdescriptor(name, value, mod))
else:
push(self.document(value,
name, mod, object))
return attrs
def spilldescriptors(msg, attrs, predicate):
ok, attrs = _split_list(attrs, predicate)
if ok:
hr.maybe()
push(msg)
for name, kind, homecls, value in ok:
push(self._docdescriptor(name, value, mod))
return attrs
def spilldata(msg, attrs, predicate):
ok, attrs = _split_list(attrs, predicate)
if ok:
hr.maybe()
push(msg)
for name, kind, homecls, value in ok:
if callable(value) or inspect.isdatadescriptor(value):
doc = getdoc(value)
else:
doc = None
try:
obj = getattr(object, name)
except AttributeError:
obj = homecls.__dict__[name]
push(self.docother(obj, name, mod, maxlen=70, doc=doc) +
'\n')
return attrs
attrs = [(name, kind, cls, value)
for name, kind, cls, value in classify_class_attrs(object)
if visiblename(name, obj=object)]
while attrs:
if mro:
thisclass = mro.popleft()
else:
thisclass = attrs[0][2]
attrs, inherited = _split_list(attrs, lambda t: t[2] is thisclass)
if thisclass is builtins.object:
attrs = inherited
continue
elif thisclass is object:
tag = "defined here"
else:
tag = "inherited from %s" % classname(thisclass,
object.__module__)
# Sort attrs by name.
attrs.sort()
# Pump out the attrs, segregated by kind.
attrs = spill("Methods %s:\n" % tag, attrs,
lambda t: t[1] == 'method')
attrs = spill("Class methods %s:\n" % tag, attrs,
lambda t: t[1] == 'class method')
attrs = spill("Static methods %s:\n" % tag, attrs,
lambda t: t[1] == 'static method')
attrs = spilldescriptors("Data descriptors %s:\n" % tag, attrs,
lambda t: t[1] == 'data descriptor')
attrs = spilldata("Data and other attributes %s:\n" % tag, attrs,
lambda t: t[1] == 'data')
assert attrs == []
attrs = inherited
contents = '\n'.join(contents)
if not contents:
return title + '\n'
return title + '\n' + self.indent(contents.rstrip(), ' | ') + '\n'
def formatvalue(self, object):
"""Format an argument default value as text."""
return '=' + self.repr(object)
def docroutine(self, object, name=None, mod=None, cl=None):
"""Produce text documentation for a function or method object."""
realname = object.__name__
name = name or realname
note = ''
skipdocs = 0
if _is_bound_method(object):
imclass = object.__self__.__class__
if cl:
if imclass is not cl:
note = ' from ' + classname(imclass, mod)
else:
if object.__self__ is not None:
note = ' method of %s instance' % classname(
object.__self__.__class__, mod)
else:
note = ' unbound %s method' % classname(imclass, mod)
if name == realname:
title = self.bold(realname)
else:
if (cl and realname in cl.__dict__ and
cl.__dict__[realname] is object):
skipdocs = 1
title = self.bold(name) + ' = ' + realname
argspec = None
if inspect.isroutine(object):
try:
signature = inspect.signature(object)
except (ValueError, TypeError):
signature = None
if signature:
argspec = str(signature)
if realname == '<lambda>':
title = self.bold(name) + ' lambda '
# XXX lambda's won't usually have func_annotations['return']
# since the syntax doesn't support but it is possible.
# So removing parentheses isn't truly safe.
argspec = argspec[1:-1] # remove parentheses
if not argspec:
argspec = '(...)'
decl = title + argspec + note
if skipdocs:
return decl + '\n'
else:
doc = getdoc(object) or ''
return decl + '\n' + (doc and self.indent(doc).rstrip() + '\n')
def _docdescriptor(self, name, value, mod):
results = []
push = results.append
if name:
push(self.bold(name))
push('\n')
doc = getdoc(value) or ''
if doc:
push(self.indent(doc))
push('\n')
return ''.join(results)
def docproperty(self, object, name=None, mod=None, cl=None):
"""Produce text documentation for a property."""
return self._docdescriptor(name, object, mod)
def docdata(self, object, name=None, mod=None, cl=None):
"""Produce text documentation for a data descriptor."""
return self._docdescriptor(name, object, mod)
def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=None):
"""Produce text documentation for a data object."""
repr = self.repr(object)
if maxlen:
line = (name and name + ' = ' or '') + repr
chop = maxlen - len(line)
if chop < 0: repr = repr[:chop] + '...'
line = (name and self.bold(name) + ' = ' or '') + repr
if doc is not None:
line += '\n' + self.indent(str(doc))
return line
class _PlainTextDoc(TextDoc):
"""Subclass of TextDoc which overrides string styling"""
def bold(self, text):
return text
# --------------------------------------------------------- user interfaces
def pager(text):
"""The first time this is called, determine what kind of pager to use."""
global pager
# Escape non-encodable characters to avoid encoding errors later
encoding = sys.getfilesystemencoding()
text = text.encode(encoding, 'backslashreplace').decode(encoding)
pager = getpager()
pager(text)
def getpager():
"""Decide what method to use for paging through text."""
if not hasattr(sys.stdout, "isatty"):
return plainpager
if not sys.stdin.isatty() or not sys.stdout.isatty():
return plainpager
if 'PAGER' in os.environ:
if sys.platform == 'win32': # pipes completely broken in Windows
return lambda text: tempfilepager(plain(text), os.environ['PAGER'])
elif os.environ.get('TERM') in ('dumb', 'emacs'):
return lambda text: pipepager(plain(text), os.environ['PAGER'])
else:
return lambda text: pipepager(text, os.environ['PAGER'])
if os.environ.get('TERM') in ('dumb', 'emacs'):
return plainpager
if sys.platform == 'win32':
return lambda text: tempfilepager(plain(text), 'more <')
if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
return lambda text: pipepager(text, 'less')
import tempfile
(fd, filename) = tempfile.mkstemp()
os.close(fd)
try:
if hasattr(os, 'system') and os.system('more "%s"' % filename) == 0:
return lambda text: pipepager(text, 'more')
else:
return ttypager
finally:
os.unlink(filename)
def plain(text):
"""Remove boldface formatting from text."""
return re.sub('.\b', '', text)
def pipepager(text, cmd):
"""Page through text by feeding it to another program."""
pipe = os.popen(cmd, 'w')
try:
pipe.write(text)
pipe.close()
except OSError:
pass # Ignore broken pipes caused by quitting the pager program.
def tempfilepager(text, cmd):
"""Page through text by invoking a program on a temporary file."""
import tempfile
filename = tempfile.mktemp()
with open(filename, 'w') as file:
file.write(text)
try:
os.system(cmd + ' "' + filename + '"')
finally:
os.unlink(filename)
def ttypager(text):
"""Page through text on a text terminal."""
lines = plain(text).split('\n')
try:
import tty
fd = sys.stdin.fileno()
old = tty.tcgetattr(fd)
tty.setcbreak(fd)
getchar = lambda: sys.stdin.read(1)
except (ImportError, AttributeError):
tty = None
getchar = lambda: sys.stdin.readline()[:-1][:1]
try:
r = inc = os.environ.get('LINES', 25) - 1
sys.stdout.write('\n'.join(lines[:inc]) + '\n')
while lines[r:]:
sys.stdout.write('-- more --')
sys.stdout.flush()
c = getchar()
if c in ('q', 'Q'):
sys.stdout.write('\r \r')
break
elif c in ('\r', '\n'):
sys.stdout.write('\r \r' + lines[r] + '\n')
r = r + 1
continue
if c in ('b', 'B', '\x1b'):
r = r - inc - inc
if r < 0: r = 0
sys.stdout.write('\n' + '\n'.join(lines[r:r+inc]) + '\n')
r = r + inc
finally:
if tty:
tty.tcsetattr(fd, tty.TCSAFLUSH, old)
def plainpager(text):
"""Simply print unformatted text. This is the ultimate fallback."""
sys.stdout.write(plain(text))
def describe(thing):
"""Produce a short description of the given thing."""
if inspect.ismodule(thing):
if thing.__name__ in sys.builtin_module_names:
return 'built-in module ' + thing.__name__
if hasattr(thing, '__path__'):
return 'package ' + thing.__name__
else:
return 'module ' + thing.__name__
if inspect.isbuiltin(thing):
return 'built-in function ' + thing.__name__
if inspect.isgetsetdescriptor(thing):
return 'getset descriptor %s.%s.%s' % (
thing.__objclass__.__module__, thing.__objclass__.__name__,
thing.__name__)
if inspect.ismemberdescriptor(thing):
return 'member descriptor %s.%s.%s' % (
thing.__objclass__.__module__, thing.__objclass__.__name__,
thing.__name__)
if inspect.isclass(thing):
return 'class ' + thing.__name__
if inspect.isfunction(thing):
return 'function ' + thing.__name__
if inspect.ismethod(thing):
return 'method ' + thing.__name__
return type(thing).__name__
def locate(path, forceload=0):
"""Locate an object by name or dotted path, importing as necessary."""
parts = [part for part in path.split('.') if part]
module, n = None, 0
while n < len(parts):
nextmodule = safeimport('.'.join(parts[:n+1]), forceload)
if nextmodule: module, n = nextmodule, n + 1
else: break
if module:
object = module
else:
object = builtins
for part in parts[n:]:
try:
object = getattr(object, part)
except AttributeError:
return None
return object
# --------------------------------------- interactive interpreter interface
text = TextDoc()
plaintext = _PlainTextDoc()
html = HTMLDoc()
def resolve(thing, forceload=0):
"""Given an object or a path to an object, get the object and its name."""
if isinstance(thing, str):
object = locate(thing, forceload)
if not object:
raise ImportError('no Python documentation found for %r' % thing)
return object, thing
else:
name = getattr(thing, '__name__', None)
return thing, name if isinstance(name, str) else None
def render_doc(thing, title='Python Library Documentation: %s', forceload=0,
renderer=None):
"""Render text documentation, given an object or a path to an object."""
if renderer is None:
renderer = text
object, name = resolve(thing, forceload)
desc = describe(object)
module = inspect.getmodule(object)
if name and '.' in name:
desc += ' in ' + name[:name.rfind('.')]
elif module and module is not object:
desc += ' in module ' + module.__name__
if not (inspect.ismodule(object) or
inspect.isclass(object) or
inspect.isroutine(object) or
inspect.isgetsetdescriptor(object) or
inspect.ismemberdescriptor(object) or
isinstance(object, property)):
# If the passed object is a piece of data or an instance,
# document its available methods instead of its value.
object = type(object)
desc += ' object'
return title % desc + '\n\n' + renderer.document(object, name)
def doc(thing, title='Python Library Documentation: %s', forceload=0,
output=None):
"""Display text documentation, given an object or a path to an object."""
try:
if output is None:
pager(render_doc(thing, title, forceload))
else:
output.write(render_doc(thing, title, forceload, plaintext))
except (ImportError, ErrorDuringImport) as value:
print(value)
def writedoc(thing, forceload=0):
"""Write HTML documentation to a file in the current directory."""
try:
object, name = resolve(thing, forceload)
page = html.page(describe(object), html.document(object, name))
file = open(name + '.html', 'w', encoding='utf-8')
file.write(page)
file.close()
print('wrote', name + '.html')
except (ImportError, ErrorDuringImport) as value:
print(value)
def writedocs(dir, pkgpath='', done=None):
"""Write out HTML documentation for all modules in a directory tree."""
if done is None: done = {}
for importer, modname, ispkg in pkgutil.walk_packages([dir], pkgpath):
writedoc(modname)
return
class Helper:
# These dictionaries map a topic name to either an alias, or a tuple
# (label, seealso-items). The "label" is the label of the corresponding
# section in the .rst file under Doc/ and an index into the dictionary
# in pydoc_data/topics.py.
#
# CAUTION: if you change one of these dictionaries, be sure to adapt the
# list of needed labels in Doc/tools/sphinxext/pyspecific.py and
# regenerate the pydoc_data/topics.py file by running
# make pydoc-topics
# in Doc/ and copying the output file into the Lib/ directory.
keywords = {
'False': '',
'None': '',
'True': '',
'and': 'BOOLEAN',
'as': 'with',
'assert': ('assert', ''),
'break': ('break', 'while for'),
'class': ('class', 'CLASSES SPECIALMETHODS'),
'continue': ('continue', 'while for'),
'def': ('function', ''),
'del': ('del', 'BASICMETHODS'),
'elif': 'if',
'else': ('else', 'while for'),
'except': 'try',
'finally': 'try',
'for': ('for', 'break continue while'),
'from': 'import',
'global': ('global', 'nonlocal NAMESPACES'),
'if': ('if', 'TRUTHVALUE'),
'import': ('import', 'MODULES'),
'in': ('in', 'SEQUENCEMETHODS'),
'is': 'COMPARISON',
'lambda': ('lambda', 'FUNCTIONS'),
'nonlocal': ('nonlocal', 'global NAMESPACES'),
'not': 'BOOLEAN',
'or': 'BOOLEAN',
'pass': ('pass', ''),
'raise': ('raise', 'EXCEPTIONS'),
'return': ('return', 'FUNCTIONS'),
'try': ('try', 'EXCEPTIONS'),
'while': ('while', 'break continue if TRUTHVALUE'),
'with': ('with', 'CONTEXTMANAGERS EXCEPTIONS yield'),
'yield': ('yield', ''),
}
# Either add symbols to this dictionary or to the symbols dictionary
# directly: Whichever is easier. They are merged later.
_symbols_inverse = {
'STRINGS': ("'", "'''", "r'", "b'", '"""', '"', 'r"', 'b"'),
'OPERATORS': ('+', '-', '*', '**', '/', '//', '%', '<<', '>>', '&',
'|', '^', '~', '<', '>', '<=', '>=', '==', '!=', '<>'),
'COMPARISON': ('<', '>', '<=', '>=', '==', '!=', '<>'),
'UNARY': ('-', '~'),
'AUGMENTEDASSIGNMENT': ('+=', '-=', '*=', '/=', '%=', '&=', '|=',
'^=', '<<=', '>>=', '**=', '//='),
'BITWISE': ('<<', '>>', '&', '|', '^', '~'),
'COMPLEX': ('j', 'J')
}
symbols = {
'%': 'OPERATORS FORMATTING',
'**': 'POWER',
',': 'TUPLES LISTS FUNCTIONS',
'.': 'ATTRIBUTES FLOAT MODULES OBJECTS',
'...': 'ELLIPSIS',
':': 'SLICINGS DICTIONARYLITERALS',
'@': 'def class',
'\\': 'STRINGS',
'_': 'PRIVATENAMES',
'__': 'PRIVATENAMES SPECIALMETHODS',
'`': 'BACKQUOTES',
'(': 'TUPLES FUNCTIONS CALLS',
')': 'TUPLES FUNCTIONS CALLS',
'[': 'LISTS SUBSCRIPTS SLICINGS',
']': 'LISTS SUBSCRIPTS SLICINGS'
}
for topic, symbols_ in _symbols_inverse.items():
for symbol in symbols_:
topics = symbols.get(symbol, topic)
if topic not in topics:
topics = topics + ' ' + topic
symbols[symbol] = topics
topics = {
'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS '
'FUNCTIONS CLASSES MODULES FILES inspect'),
'STRINGS': ('strings', 'str UNICODE SEQUENCES STRINGMETHODS '
'FORMATTING TYPES'),
'STRINGMETHODS': ('string-methods', 'STRINGS FORMATTING'),
'FORMATTING': ('formatstrings', 'OPERATORS'),
'UNICODE': ('strings', 'encodings unicode SEQUENCES STRINGMETHODS '
'FORMATTING TYPES'),
'NUMBERS': ('numbers', 'INTEGER FLOAT COMPLEX TYPES'),
'INTEGER': ('integers', 'int range'),
'FLOAT': ('floating', 'float math'),
'COMPLEX': ('imaginary', 'complex cmath'),
'SEQUENCES': ('typesseq', 'STRINGMETHODS FORMATTING range LISTS'),
'MAPPINGS': 'DICTIONARIES',
'FUNCTIONS': ('typesfunctions', 'def TYPES'),
'METHODS': ('typesmethods', 'class def CLASSES TYPES'),
'CODEOBJECTS': ('bltin-code-objects', 'compile FUNCTIONS TYPES'),
'TYPEOBJECTS': ('bltin-type-objects', 'types TYPES'),
'FRAMEOBJECTS': 'TYPES',
'TRACEBACKS': 'TYPES',
'NONE': ('bltin-null-object', ''),
'ELLIPSIS': ('bltin-ellipsis-object', 'SLICINGS'),
'FILES': ('bltin-file-objects', ''),
'SPECIALATTRIBUTES': ('specialattrs', ''),
'CLASSES': ('types', 'class SPECIALMETHODS PRIVATENAMES'),
'MODULES': ('typesmodules', 'import'),
'PACKAGES': 'import',
'EXPRESSIONS': ('operator-summary', 'lambda or and not in is BOOLEAN '
'COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER '
'UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES '
'LISTS DICTIONARIES'),
'OPERATORS': 'EXPRESSIONS',
'PRECEDENCE': 'EXPRESSIONS',
'OBJECTS': ('objects', 'TYPES'),
'SPECIALMETHODS': ('specialnames', 'BASICMETHODS ATTRIBUTEMETHODS '
'CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS '
'NUMBERMETHODS CLASSES'),
'BASICMETHODS': ('customization', 'hash repr str SPECIALMETHODS'),
'ATTRIBUTEMETHODS': ('attribute-access', 'ATTRIBUTES SPECIALMETHODS'),
'CALLABLEMETHODS': ('callable-types', 'CALLS SPECIALMETHODS'),
'SEQUENCEMETHODS': ('sequence-types', 'SEQUENCES SEQUENCEMETHODS '
'SPECIALMETHODS'),
'MAPPINGMETHODS': ('sequence-types', 'MAPPINGS SPECIALMETHODS'),
'NUMBERMETHODS': ('numeric-types', 'NUMBERS AUGMENTEDASSIGNMENT '
'SPECIALMETHODS'),
'EXECUTION': ('execmodel', 'NAMESPACES DYNAMICFEATURES EXCEPTIONS'),
'NAMESPACES': ('naming', 'global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES'),
'DYNAMICFEATURES': ('dynamic-features', ''),
'SCOPING': 'NAMESPACES',
'FRAMES': 'NAMESPACES',
'EXCEPTIONS': ('exceptions', 'try except finally raise'),
'CONVERSIONS': ('conversions', ''),
'IDENTIFIERS': ('identifiers', 'keywords SPECIALIDENTIFIERS'),
'SPECIALIDENTIFIERS': ('id-classes', ''),
'PRIVATENAMES': ('atom-identifiers', ''),
'LITERALS': ('atom-literals', 'STRINGS NUMBERS TUPLELITERALS '
'LISTLITERALS DICTIONARYLITERALS'),
'TUPLES': 'SEQUENCES',
'TUPLELITERALS': ('exprlists', 'TUPLES LITERALS'),
'LISTS': ('typesseq-mutable', 'LISTLITERALS'),
'LISTLITERALS': ('lists', 'LISTS LITERALS'),
'DICTIONARIES': ('typesmapping', 'DICTIONARYLITERALS'),
'DICTIONARYLITERALS': ('dict', 'DICTIONARIES LITERALS'),
'ATTRIBUTES': ('attribute-references', 'getattr hasattr setattr ATTRIBUTEMETHODS'),
'SUBSCRIPTS': ('subscriptions', 'SEQUENCEMETHODS'),
'SLICINGS': ('slicings', 'SEQUENCEMETHODS'),
'CALLS': ('calls', 'EXPRESSIONS'),
'POWER': ('power', 'EXPRESSIONS'),
'UNARY': ('unary', 'EXPRESSIONS'),
'BINARY': ('binary', 'EXPRESSIONS'),
'SHIFTING': ('shifting', 'EXPRESSIONS'),
'BITWISE': ('bitwise', 'EXPRESSIONS'),
'COMPARISON': ('comparisons', 'EXPRESSIONS BASICMETHODS'),
'BOOLEAN': ('booleans', 'EXPRESSIONS TRUTHVALUE'),
'ASSERTION': 'assert',
'ASSIGNMENT': ('assignment', 'AUGMENTEDASSIGNMENT'),
'AUGMENTEDASSIGNMENT': ('augassign', 'NUMBERMETHODS'),
'DELETION': 'del',
'RETURNING': 'return',
'IMPORTING': 'import',
'CONDITIONAL': 'if',
'LOOPING': ('compound', 'for while break continue'),
'TRUTHVALUE': ('truth', 'if while and or not BASICMETHODS'),
'DEBUGGING': ('debugger', 'pdb'),
'CONTEXTMANAGERS': ('context-managers', 'with'),
}
def __init__(self, input=None, output=None):
self._input = input
self._output = output
input = property(lambda self: self._input or sys.stdin)
output = property(lambda self: self._output or sys.stdout)
def __repr__(self):
if inspect.stack()[1][3] == '?':
self()
return ''
return '<pydoc.Helper instance>'
_GoInteractive = object()
def __call__(self, request=_GoInteractive):
if request is not self._GoInteractive:
self.help(request)
else:
self.intro()
self.interact()
self.output.write('''
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)". Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
''')
def interact(self):
self.output.write('\n')
while True:
try:
request = self.getline('help> ')
if not request: break
except (KeyboardInterrupt, EOFError):
break
request = replace(request, '"', '', "'", '').strip()
if request.lower() in ('q', 'quit'): break
self.help(request)
def getline(self, prompt):
"""Read one line, using input() when appropriate."""
if self.input is sys.stdin:
return input(prompt)
else:
self.output.write(prompt)
self.output.flush()
return self.input.readline()
def help(self, request):
if type(request) is type(''):
request = request.strip()
if request == 'help': self.intro()
elif request == 'keywords': self.listkeywords()
elif request == 'symbols': self.listsymbols()
elif request == 'topics': self.listtopics()
elif request == 'modules': self.listmodules()
elif request[:8] == 'modules ':
self.listmodules(request.split()[1])
elif request in self.symbols: self.showsymbol(request)
elif request in ['True', 'False', 'None']:
# special case these keywords since they are objects too
doc(eval(request), 'Help on %s:')
elif request in self.keywords: self.showtopic(request)
elif request in self.topics: self.showtopic(request)
elif request: doc(request, 'Help on %s:', output=self._output)
elif isinstance(request, Helper): self()
else: doc(request, 'Help on %s:', output=self._output)
self.output.write('\n')
def intro(self):
self.output.write('''
Welcome to Python %s's help utility!
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/%s/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".
To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics". Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
''' % tuple([sys.version[:3]]*2))
def list(self, items, columns=4, width=80):
items = list(sorted(items))
colw = width // columns
rows = (len(items) + columns - 1) // columns
for row in range(rows):
for col in range(columns):
i = col * rows + row
if i < len(items):
self.output.write(items[i])
if col < columns - 1:
self.output.write(' ' + ' ' * (colw - 1 - len(items[i])))
self.output.write('\n')
def listkeywords(self):
self.output.write('''
Here is a list of the Python keywords. Enter any keyword to get more help.
''')
self.list(self.keywords.keys())
def listsymbols(self):
self.output.write('''
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.
''')
self.list(self.symbols.keys())
def listtopics(self):
self.output.write('''
Here is a list of available topics. Enter any topic name to get more help.
''')
self.list(self.topics.keys())
def showtopic(self, topic, more_xrefs=''):
try:
import pydoc_data.topics
except ImportError:
self.output.write('''
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
''')
return
target = self.topics.get(topic, self.keywords.get(topic))
if not target:
self.output.write('no documentation found for %s\n' % repr(topic))
return
if type(target) is type(''):
return self.showtopic(target, more_xrefs)
label, xrefs = target
try:
doc = pydoc_data.topics.topics[label]
except KeyError:
self.output.write('no documentation found for %s\n' % repr(topic))
return
pager(doc.strip() + '\n')
if more_xrefs:
xrefs = (xrefs or '') + ' ' + more_xrefs
if xrefs:
import textwrap
text = 'Related help topics: ' + ', '.join(xrefs.split()) + '\n'
wrapped_text = textwrap.wrap(text, 72)
self.output.write('\n%s\n' % ''.join(wrapped_text))
def _gettopic(self, topic, more_xrefs=''):
"""Return unbuffered tuple of (topic, xrefs).
If an error occurs here, the exception is caught and displayed by
the url handler.
This function duplicates the showtopic method but returns its
result directly so it can be formatted for display in an html page.
"""
try:
import pydoc_data.topics
except ImportError:
return('''
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
''', '')
target = self.topics.get(topic, self.keywords.get(topic))
if not target:
raise ValueError('could not find topic')
if isinstance(target, str):
return self._gettopic(target, more_xrefs)
label, xrefs = target
doc = pydoc_data.topics.topics[label]
if more_xrefs:
xrefs = (xrefs or '') + ' ' + more_xrefs
return doc, xrefs
def showsymbol(self, symbol):
target = self.symbols[symbol]
topic, _, xrefs = target.partition(' ')
self.showtopic(topic, xrefs)
def listmodules(self, key=''):
if key:
self.output.write('''
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.
'''.format(key))
apropos(key)
else:
self.output.write('''
Please wait a moment while I gather a list of all available modules...
''')
modules = {}
def callback(path, modname, desc, modules=modules):
if modname and modname[-9:] == '.__init__':
modname = modname[:-9] + ' (package)'
if modname.find('.') < 0:
modules[modname] = 1
def onerror(modname):
callback(None, modname, None)
ModuleScanner().run(callback, onerror=onerror)
self.list(modules.keys())
self.output.write('''
Enter any module name to get more help. Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
''')
help = Helper()
class ModuleScanner:
"""An interruptible scanner that searches module synopses."""
def run(self, callback, key=None, completer=None, onerror=None):
if key: key = key.lower()
self.quit = False
seen = {}
for modname in sys.builtin_module_names:
if modname != '__main__':
seen[modname] = 1
if key is None:
callback(None, modname, '')
else:
name = __import__(modname).__doc__ or ''
desc = name.split('\n')[0]
name = modname + ' - ' + desc
if name.lower().find(key) >= 0:
callback(None, modname, desc)
for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
if self.quit:
break
if key is None:
callback(None, modname, '')
else:
try:
spec = pkgutil._get_spec(importer, modname)
except SyntaxError:
# raised by tests for bad coding cookies or BOM
continue
loader = spec.loader
if hasattr(loader, 'get_source'):
try:
source = loader.get_source(modname)
except Exception:
if onerror:
onerror(modname)
continue
desc = source_synopsis(io.StringIO(source)) or ''
if hasattr(loader, 'get_filename'):
path = loader.get_filename(modname)
else:
path = None
else:
_spec = importlib._bootstrap._SpecMethods(spec)
try:
module = _spec.load()
except ImportError:
if onerror:
onerror(modname)
continue
desc = (module.__doc__ or '').splitlines()[0]
path = getattr(module, '__file__', None)
name = modname + ' - ' + desc
if name.lower().find(key) >= 0:
callback(path, modname, desc)
if completer:
completer()
def apropos(key):
"""Print all the one-line module summaries that contain a substring."""
def callback(path, modname, desc):
if modname[-9:] == '.__init__':
modname = modname[:-9] + ' (package)'
print(modname, desc and '- ' + desc)
def onerror(modname):
pass
with warnings.catch_warnings():
warnings.filterwarnings('ignore') # ignore problems during import
ModuleScanner().run(callback, key, onerror=onerror)
# --------------------------------------- enhanced Web browser interface
def _start_server(urlhandler, port):
"""Start an HTTP server thread on a specific port.
Start an HTML/text server thread, so HTML or text documents can be
browsed dynamically and interactively with a Web browser. Example use:
>>> import time
>>> import pydoc
Define a URL handler. To determine what the client is asking
for, check the URL and content_type.
Then get or generate some text or HTML code and return it.
>>> def my_url_handler(url, content_type):
... text = 'the URL sent was: (%s, %s)' % (url, content_type)
... return text
Start server thread on port 0.
If you use port 0, the server will pick a random port number.
You can then use serverthread.port to get the port number.
>>> port = 0
>>> serverthread = pydoc._start_server(my_url_handler, port)
Check that the server is really started. If it is, open browser
and get first page. Use serverthread.url as the starting page.
>>> if serverthread.serving:
... import webbrowser
The next two lines are commented out so a browser doesn't open if
doctest is run on this module.
#... webbrowser.open(serverthread.url)
#True
Let the server do its thing. We just need to monitor its status.
Use time.sleep so the loop doesn't hog the CPU.
>>> starttime = time.time()
>>> timeout = 1 #seconds
This is a short timeout for testing purposes.
>>> while serverthread.serving:
... time.sleep(.01)
... if serverthread.serving and time.time() - starttime > timeout:
... serverthread.stop()
... break
Print any errors that may have occurred.
>>> print(serverthread.error)
None
"""
import http.server
import email.message
import select
import threading
class DocHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
"""Process a request from an HTML browser.
The URL received is in self.path.
Get an HTML page from self.urlhandler and send it.
"""
if self.path.endswith('.css'):
content_type = 'text/css'
else:
content_type = 'text/html'
self.send_response(200)
self.send_header('Content-Type', content_type)
self.end_headers()
self.wfile.write(self.urlhandler(
self.path, content_type).encode('utf-8'))
def log_message(self, *args):
# Don't log messages.
pass
class DocServer(http.server.HTTPServer):
def __init__(self, port, callback):
self.host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost'
self.address = ('', port)
self.callback = callback
self.base.__init__(self, self.address, self.handler)
self.quit = False
def serve_until_quit(self):
while not self.quit:
rd, wr, ex = select.select([self.socket.fileno()], [], [], 1)
if rd:
self.handle_request()
self.server_close()
def server_activate(self):
self.base.server_activate(self)
if self.callback:
self.callback(self)
class ServerThread(threading.Thread):
def __init__(self, urlhandler, port):
self.urlhandler = urlhandler
self.port = int(port)
threading.Thread.__init__(self)
self.serving = False
self.error = None
def run(self):
"""Start the server."""
try:
DocServer.base = http.server.HTTPServer
DocServer.handler = DocHandler
DocHandler.MessageClass = email.message.Message
DocHandler.urlhandler = staticmethod(self.urlhandler)
docsvr = DocServer(self.port, self.ready)
self.docserver = docsvr
docsvr.serve_until_quit()
except Exception as e:
self.error = e
def ready(self, server):
self.serving = True
self.host = server.host
self.port = server.server_port
self.url = 'http://%s:%d/' % (self.host, self.port)
def stop(self):
"""Stop the server and this thread nicely"""
self.docserver.quit = True
self.serving = False
self.url = None
thread = ServerThread(urlhandler, port)
thread.start()
# Wait until thread.serving is True to make sure we are
# really up before returning.
while not thread.error and not thread.serving:
time.sleep(.01)
return thread
CSS_PATH = "pydoc_data/pydoc.css"
def _url_handler(url, content_type="text/html"):
"""The pydoc url handler for use with the pydoc server.
If the content_type is 'text/css', the css style
sheet is read and returned if it exists.
If the content_type is 'text/html', then the result of
get_html_page(url) is returned.
"""
class _HTMLDoc(HTMLDoc):
def page(self, title, contents):
"""Format an HTML page."""
return '''<!doctype html>
<html><head><title>Mod_Pydoc: {}</title><meta charset="utf-8">
<link href="{}" rel="stylesheet">
</head><body>{}
<div class="main">{}</div>
</body></html>'''.format(title, CSS_PATH, html_navbar(), contents)
def filelink(self, url, path):
return '<a href="getfile?key=%s">%s</a>' % (url, path)
html = _HTMLDoc()
def html_navbar():
version = html.escape("%s [%s, %s]" % (platform.python_version(),
platform.python_build()[0],
platform.python_compiler()))
return """
<div style='float:left'>
Python %s<br>%s
</div>
<div style='float:right'>
<div style='text-align:center'>
<a href="index.html">Module Index</a>
: <a href="topics.html">Topics</a>
: <a href="keywords.html">Keywords</a>
</div>
<div>
<form action="get" style='display:inline;'>
<input type=text name=key size=15>
<input type=submit value="Get">
</form>
<form action="search" style='display:inline;'>
<input type=text name=key size=15>
<input type=submit value="Search">
</form>
</div>
</div>
""" % (version, html.escape(platform.platform(terse=True)))
def html_index():
"""Module Index page."""
def bltinlink(name):
return '<a href="%s.html">%s</a>' % (name, name)
heading = html.heading('<span>Index of Modules</span>')
names = [name for name in sys.builtin_module_names
if name != '__main__']
contents = html.multicolumn(names, bltinlink)
contents = [heading, '<p>' + html.bigsection('Built-in Modules',
contents, css_class="builtin_modules")]
seen = {}
for dir in sys.path:
contents.append(html.index(dir, seen))
contents.append(
'<p class="ka_ping_yee"><strong>pydoc</strong> by Ka-Ping Yee'
'<[email protected]></p>')
return 'Index of Modules', ''.join(contents)
def html_search(key):
"""Search results page."""
# scan for modules
search_result = []
def callback(path, modname, desc):
if modname[-9:] == '.__init__':
modname = modname[:-9] + ' (package)'
search_result.append((modname, desc and '- ' + desc))
with warnings.catch_warnings():
warnings.filterwarnings('ignore') # ignore problems during import
ModuleScanner().run(callback, key)
# format page
def bltinlink(name):
return '<a href="%s.html">%s</a>' % (name, name)
results = []
heading = html.heading('Search Results')
for name, desc in search_result:
results.append(bltinlink(name) + desc)
contents = heading + html.bigsection('key = {}'.format(key),
'<br>'.join(results), css_class="search")
return 'Search Results', contents
def html_getfile(path):
"""Get and display a source file listing safely."""
path = path.replace('%20', ' ')
with tokenize.open(path) as fp:
lines = html.escape(fp.read())
body = '<pre>%s</pre>' % lines
heading = html.heading('File Listing')
contents = heading + html.bigsection('File: {}'.format(path), body,
css_class="getfile")
return 'getfile %s' % path, contents
def html_topics():
"""Index of topic texts available."""
def bltinlink(name):
return '<a href="topic?key=%s">%s</a>' % (name, name)
heading = html.heading('Index of Topics')
names = sorted(Helper.topics.keys())
contents = html.multicolumn(names, bltinlink)
contents = heading + html.bigsection('Topics', contents, css_class="topics")
return 'Topics', contents
def html_keywords():
"""Index of keywords."""
heading = html.heading('Index of Keywords')
names = sorted(Helper.keywords.keys())
def bltinlink(name):
return '<a href="topic?key=%s">%s</a>' % (name, name)
contents = html.multicolumn(names, bltinlink)
contents = heading + html.bigsection('Keywords', contents, css_class="keywords")
return 'Keywords', contents
def html_topicpage(topic):
"""Topic or keyword help page."""
buf = io.StringIO()
htmlhelp = Helper(buf, buf)
contents, xrefs = htmlhelp._gettopic(topic)
if topic in htmlhelp.keywords:
title = 'Keyword'
else:
title = 'Topic'
heading = html.heading(title)
contents = '<pre>%s</pre>' % html.markup(contents)
contents = html.bigsection(topic, contents, css_class="topics")
if xrefs:
xrefs = sorted(xrefs.split())
def bltinlink(name):
return '<a href="topic?key=%s">%s</a>' % (name, name)
xrefs = html.multicolumn(xrefs, bltinlink)
xrefs = html.html_section('Related help topics: ', xrefs,
css_class="topics")
return ('%s %s' % (title, topic),
''.join((heading, contents, xrefs)))
def html_getobj(url):
obj = locate(url, forceload=1)
if obj is None and url != 'None':
raise ValueError('could not find object')
title = describe(obj)
content = html.document(obj, url)
return title, content
def html_error(url, exc):
heading = html.heading('Error')
contents = '<br>'.join(html.escape(line) for line in
format_exception_only(type(exc), exc))
contents = heading + html.bigsection(url, contents, css_class="error")
return "Error - %s" % url, contents
def get_html_page(url):
"""Generate an HTML page for url."""
complete_url = url
if url.endswith('.html'):
url = url[:-5]
try:
if url in ("", "index"):
title, content = html_index()
elif url == "topics":
title, content = html_topics()
elif url == "keywords":
title, content = html_keywords()
elif '=' in url:
op, _, url = url.partition('=')
if op == "search?key":
title, content = html_search(url)
elif op == "getfile?key":
title, content = html_getfile(url)
elif op == "topic?key":
# try topics first, then objects.
try:
title, content = html_topicpage(url)
except ValueError:
title, content = html_getobj(url)
elif op == "get?key":
# try objects first, then topics.
if url in ("", "index"):
title, content = html_index()
else:
try:
title, content = html_getobj(url)
except ValueError:
title, content = html_topicpage(url)
else:
raise ValueError('bad pydoc url')
else:
title, content = html_getobj(url)
except Exception as exc:
# Catch any errors and display them in an error page.
title, content = html_error(complete_url, exc)
return html.page(title, content)
if url.startswith('/'):
url = url[1:]
if url.endswith('.css'):
if os.path.isfile(url):
css_path = url
else:
path_here = os.path.dirname(os.path.realpath(__file__))
css_path = os.path.join(path_here, CSS_PATH)
with open(css_path) as fp:
return ''.join(fp.readlines())
elif content_type == 'text/html':
return get_html_page(url)
# Errors outside the url handler are caught by the server.
raise TypeError('unknown content type %r for url %s' % (content_type, url))
def browse(port=0, *, open_browser=True):
"""Start the enhanced pydoc Web server and open a Web browser.
Use port '0' to start the server on an arbitrary port.
Set open_browser to False to suppress opening a browser.
"""
import webbrowser
serverthread = _start_server(_url_handler, port)
if serverthread.error:
print(serverthread.error)
return
if serverthread.serving:
server_help_msg = 'Server commands: [b]rowser, [q]uit'
if open_browser:
webbrowser.open(serverthread.url)
try:
print('Server ready at', serverthread.url)
print(server_help_msg)
while serverthread.serving:
cmd = input('server> ')
cmd = cmd.lower()
if cmd == 'q':
break
elif cmd == 'b':
webbrowser.open(serverthread.url)
else:
print(server_help_msg)
except (KeyboardInterrupt, EOFError):
print()
finally:
if serverthread.serving:
serverthread.stop()
print('Server stopped')
# -------------------------------------------------- command-line interface
def ispath(x):
return isinstance(x, str) and x.find(os.sep) >= 0
def cli():
"""Command-line interface (looks at sys.argv to decide what to do)."""
import getopt
class BadUsage(Exception): pass
global CSS_PATH
# Scripts don't get the current directory in their path by default
# unless they are run with the '-m' switch
if '' not in sys.path:
scriptdir = os.path.dirname(sys.argv[0])
if scriptdir in sys.path:
sys.path.remove(scriptdir)
sys.path.insert(0, '.')
try:
opts, args = getopt.getopt(sys.argv[1:], 'bkc:p:w')
writing = False
start_server = False
open_browser = False
port = None
for opt, val in opts:
if opt == '-b':
start_server = True
open_browser = True
if opt == '-k':
apropos(val)
return
if opt == '-p':
start_server = True
port = val
if opt == '-w':
writing = True
if opt == '-c':
if val == "classic":
CSS_PATH = "pydoc_data/pydoc_orig.css"
else:
css_ = os.path.join(os.getcwd(), val)
if os.path.isfile(css_):
CSS_PATH = val
if start_server:
if port is None:
port = 0
browse(port, open_browser=open_browser)
return
if not args: raise BadUsage
for arg in args:
if ispath(arg) and not os.path.exists(arg):
print('file %r does not exist' % arg)
break
try:
if ispath(arg) and os.path.isfile(arg):
arg = importfile(arg)
if writing:
if ispath(arg) and os.path.isdir(arg):
writedocs(arg)
else:
writedoc(arg)
else:
help.help(arg)
except ErrorDuringImport as value:
print(value)
except (getopt.error, BadUsage):
cmd = os.path.splitext(os.path.basename(sys.argv[0]))[0]
print("""pydoc - the Python documentation tool
{cmd} <name> ...
Show text documentation on something. <name> may be the name of a
Python keyword, topic, function, module, or package, or a dotted
reference to a class or function within a module or module in a
package. If <name> contains a '{sep}', it is used as the path to a
Python source file to document. If name is 'keywords', 'topics',
or 'modules', a listing of these things is displayed.
{cmd} -k <keyword>
Search for a keyword in the synopsis lines of all available modules.
{cmd} -p <port>
Start an HTTP server on the given port on the local machine. Port
number 0 can be used to get an arbitrary unused port.
{cmd} -b
Start an HTTP server on an arbitrary unused port and open a Web browser
to interactively browse documentation. The -p option can be used with
the -b option to explicitly specify the server port.
{cmd} -w <name> ...
Write out the HTML documentation for a module to a file in the current
directory. If <name> contains a '{sep}', it is treated as a filename; if
it names a directory, documentation is written for all the contents.
{cmd} -c <name>
Alternate choice for styling option. If name == classic, the color scheme
used mimics the original pydoc style. If a valid css file path is given
(relative to the server), it is used instead.
""".format(cmd=cmd, sep=os.sep))
if __name__ == '__main__':
cli()
| [
"[email protected]"
]
| |
ce641dbede6f04804b41a0a8460de2268bda2a1e | b87f66b13293782321e20c39aebc05defd8d4b48 | /maps/build/TraitsGUI/enthought/pyface/key_pressed_event.py | 0072c81aca8d415f585dffb9111cb439544649df | [
"BSD-3-Clause"
]
| permissive | m-elhussieny/code | 5eae020932d935e4d724c2f3d16126a0d42ebf04 | 5466f5858dbd2f1f082fa0d7417b57c8fb068fad | refs/heads/master | 2021-06-13T18:47:08.700053 | 2016-11-01T05:51:06 | 2016-11-01T05:51:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 673 | py | """ The event that is generated when a key is pressed. """
# Enthought library imports.
from enthought.traits.api import Bool, HasTraits, Int, Any
class KeyPressedEvent(HasTraits):
""" The event that is generated when a key is pressed. """
#### 'KeyPressedEvent' interface ##########################################
# Is the alt key down?
alt_down = Bool
# Is the control key down?
control_down = Bool
# Is the shift key down?
shift_down = Bool
# The keycode.
key_code = Int
# The original toolkit specific event.
event = Any
#### EOF ######################################################################
| [
"[email protected]"
]
| |
222f0e68d1e3968f67a837653d786d78e9316e0c | 56b174addb87128ef54c85d2701b222b21877bbb | /settings_tornado.py | cfe56e91c425ecd2e6699d4db0e35992861de686 | [
"BSD-2-Clause-Views"
]
| permissive | kwarodom/bemoss_web_ui-1 | f8abbe7defc099bc40ff3c9c2b10c143a22ddbe5 | 6c65c49b8f52bc7d189c9f2391f9098ec0f2dd92 | refs/heads/master | 2020-12-11T01:37:47.205927 | 2016-03-16T21:35:38 | 2016-03-16T21:35:38 | 54,082,914 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,265 | py | # -*- coding: utf-8 -*-
'''
Copyright (c) 2016, Virginia Tech
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those of the authors and should not be
interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.
This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the
United States Government nor the United States Department of Energy, nor Virginia Tech, nor any of their employees,
nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty,
express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or
any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe
privately owned rights.
Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or
otherwise does not necessarily constitute or imply its endorsement, recommendation, favoring by the United States
Government or any agency thereof, or Virginia Tech - Advanced Research Institute. The views and opinions of authors
expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.
VIRGINIA TECH – ADVANCED RESEARCH INSTITUTE
under Contract DE-EE0006352
#__author__ = "BEMOSS Team"
#__credits__ = ""
#__version__ = "2.0"
#__maintainer__ = "BEMOSS Team"
#__email__ = "[email protected]"
#__website__ = "www.bemoss.org"
#__created__ = "2014-09-12 12:04:50"
#__lastUpdated__ = "2016-03-14 11:23:33"
'''
from django.core.urlresolvers import reverse_lazy
# Django settings for bemoss_web_ui project.
import os
import sys
DEBUG = True
#DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('kruthika', '[email protected]'),
)
PROJECT_DIR = os.path.dirname(__file__)
sys.path.insert(1, PROJECT_DIR + '/lib/clock')
MANAGERS = ADMINS
LOGIN_REDIRECT_URL = reverse_lazy('/login')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'bemossdb', # Or path to database file if using sqlite3.
'USER': 'admin', # Not used with sqlite3.
'PASSWORD': 'admin', # Not used with sqlite3.
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
},
'smap': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
# Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'archiver', # Or path to database file if using sqlite3.
'USER': 'admin', # Not used with sqlite3.
'PASSWORD': 'admin', # Not used with sqlite3.
'HOST': '127.0.0.1',
'PORT': '',
},
}
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['bemoss.com','localhost','38.68.232.107','127.0.0.1']
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/New_York'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = PROJECT_DIR + '/resources/'
#MEDIA_ROOT = PROJECT_DIR + '/logs/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/dummy/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_DIR, 'static'),
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'TEMP_KEY'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
#'corsheaders.middleware.CorsMiddleware',
'_utils.dos_secure.middleware.BanishMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'_utils.lockout.middleware.LockoutMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'Your Email'
EMAIL_HOST_PASSWORD = 'Your Password'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = 'Your Email'
ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_DIR, 'templates'),
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
'django.contrib.messages.context_processors.messages',
)
APPEND_SLASH = True
BANISH_ENABLED = True
BANISH_EMPTY_UA = False
BANISH_ABUSE_THRESHOLD = 50
BANISH_MESSAGE = "Excessive attempts to reach BEMOSS Server. IP Banned."
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
'apps.accounts',
'zmq',
'apps.dashboard',
'apps.thermostat',
'apps.smartplug',
'apps.admin',
'apps.lighting',
'clock',
'volttron',
'apps.error',
'apps.alerts',
'apps.schedule',
'apps.VAV',
'apps.RTU',
'tablib',
'_utils',
'_utils.dos_secure',
'apps.discovery'
#'_utils.lockout'
#'apps.registration'
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
BOOTSTRAP3 = {
'jquery_url': '//code.jquery.com/jquery.min.js',
'base_url': '//netdna.bootstrapcdn.com/bootstrap/3.0.3/',
'css_url': None,
'theme_url': None,
'javascript_url': None,
'horizontal_label_class': 'col-md-2',
'horizontal_field_class': 'col-md-4',
}
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
'''LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
},
},
'handlers': {
'default': {
'level':'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'filename': os.path.join(PROJECT_DIR, 'logs/bemoss_ui_log.log'),
'maxBytes': 1024*1024*5, # 5 MB
'backupCount': 5,
'formatter':'standard',
},
'request_handler': {
'level':'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'filename': os.path.join(PROJECT_DIR, 'logs/django_request.log'),
'maxBytes': 1024*1024*5, # 5 MB
'backupCount': 5,
'formatter': 'standard',
},
},
'loggers': {
'': {
'handlers': ['default'],
'level': 'DEBUG',
'propagate': True
},
'django.request': {
'handlers': ['request_handler'],
'level': 'DEBUG',
'propagate': False
},
}
}'''
| [
"[email protected]"
]
| |
d94eac8d709bc2eb7d4ac8bf5765e1247c5dc9c7 | 67ceb35320d3d02867350bc6d460ae391e0324e8 | /practice/easy/0231-Power_of_Two.py | 2937bb2cf84cca61705c0d77d1f846cbe4ef3766 | []
| no_license | mattjp/leetcode | fb11cf6016aef46843eaf0b55314e88ccd87c91a | 88ccd910dfdb0e6ca6a70fa2d37906c31f4b3d70 | refs/heads/master | 2023-01-22T20:40:48.104388 | 2022-12-26T22:03:02 | 2022-12-26T22:03:02 | 184,347,356 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 140 | py | class Solution:
def isPowerOfTwo(self, n: int) -> bool:
while n > 0 and n % 2 == 0:
n /= 2
return True if n == 1 else False
| [
"[email protected]"
]
| |
979864f68c8f51e1001c261521bd88c954863337 | 8c917dc4810e2dddf7d3902146280a67412c65ea | /v_7/GDS/shamil_v3/purchase_transportation/transportations.py | 8ed7b8054bde56377337d809bee89f1ca678875a | []
| no_license | musabahmed/baba | d0906e03c1bbd222d3950f521533f3874434b993 | 0b997095c260d58b026440967fea3a202bef7efb | refs/heads/master | 2021-10-09T02:37:32.458269 | 2018-12-20T06:00:00 | 2018-12-20T06:00:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 26,282 | py | # -*- coding: utf-8 -*-
##############################################################################
#
# NCTR, Nile Center for Technology Research
# Copyright (C) 2011-2012 NCTR (<http://www.nctr.sd>).
#
##############################################################################
import netsvc
import time
from tools.translate import _
from osv import osv, fields
import decimal_precision as dp
class transportation_order(osv.osv):
"""
To manage the transportation basic concepts and operations"""
def create(self, cr, user, vals, context=None):
"""
This method override the create method to get sequence and update
field name by sequence value.
@param vals: list of record to be process
@return: new created record ID
"""
if ('name' not in vals) or (vals.get('name')=='/'):
vals['name'] = self.pool.get('ir.sequence').get(cr, user, 'transportation.order')
new_id = super(transportation_order, self).create(cr, user, vals, context)
return new_id
TYPE = [
('purchase', 'Purchase transportation'),
]
STATE_SELECTION = [
('draft', 'Draft'),
('confirmed', 'Confirmed'),
('invoice','Invoice'),
('done', 'Done'),
('cancel', 'Cancel'),
]
DELIVERY_SELECTION = [
('air_freight', 'Air Freight'),
('sea_freight', 'Sea Freight'),
('land_freight', 'Land Freight'),
]
_name = 'transportation.order'
_description = "Transportation order"
_columns = {
'name': fields.char('Reference', size=64, required=True, readonly=1, select=True,
help="unique number of the transportations, computed automatically when the transportations order is created"),
'purchase_order_id' : fields.many2one('purchase.order', 'Purchase order',states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'department_id':fields.many2one('hr.department', 'Department',states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'source_location': fields.char('Source location', size=64,select=True,states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'destination_location': fields.char('Destination location', size=64,select=True,states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'transportation_date':fields.date('Transportation Date', required=True, select=True,states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],},
help="Date on which this document has been created."),
'transportation_type': fields.selection(TYPE, 'Transportation type', select=True,states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'description': fields.text('Transportation description' ,states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'delivery_method': fields.selection(DELIVERY_SELECTION, 'Method of dispatch', select=True ,states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],} ),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', help="Pricelist for current supplier",states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'transportation_line_ids':fields.one2many('transportation.order.line', 'transportation_id' , 'Products',states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'transportation_drivers':fields.one2many('transportation.driver', 'transportation_id' , 'Drivers',states={'done':[('readonly',True)]}),
'state': fields.selection(STATE_SELECTION, 'State', readonly=True, help="The state of the transportation.", select=True),
'notes': fields.text('Notes',states={'done':[('readonly',True)]}),
'user': fields.many2one('res.users', 'Responsible',readonly=True,states={'done':[('readonly',True)]}),
'account_vouchers': fields.many2many('account.voucher', 'transportation_voucher', 'transportation_id', 'voucher_id', 'Account voucher',states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'allocation_base':fields.selection([('weight','WEIGHT'),('quantity','QUANTITY'),('space','Space (volume)'),('price','PRICE'),],'Allocation Base',states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'quotes_ids':fields.one2many('transportation.quotes', 'transportation_id' ,'Quotes',states={'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'supplier_chose_reason_delivery':fields.boolean('Good delivery',states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'supplier_chose_reason_quality':fields.boolean('High quality',states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'supplier_chose_reason_price':fields.boolean('Good price',states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'supplier_chose_reason_others': fields.char('Other Reasons', size=256 ,states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],} ),
'partner_id':fields.many2one('res.partner', 'Transporter', states={'done':[('readonly',True)],'invoice':[('readonly',True)],}),
'purpose': fields.selection([('purchase','Purchase'),('stock','Stock'),('other','Other')],'Purpose', required=True ,select=True, states={'confirmed':[('readonly',True)],'done':[('readonly',True)],'invoice':[('readonly',True)],}),
}
_defaults = {
'name': lambda self, cr, uid, context: '/',
'transportation_date': lambda *a: time.strftime('%Y-%m-%d'),
'state': 'draft',
'user': lambda self, cr, uid, context: uid,
'transportation_type':'purchase',
'allocation_base': 'price',
}
def copy(self, cr, uid, id, default={}, context=None):
"""
Override copy function to edit defult value.
@param default: default vals dict
@return: super copy method
"""
seq_obj = self.pool.get('ir.sequence')
default.update({
'state':'draft',
'name': seq_obj.get(cr, uid, 'transportation.order'),
'transportation_date':time.strftime('%Y-%m-%d'),
'transportation_line_ids':[],
})
return super(transportation_order, self).copy(cr, uid, id, default, context)
def get_products(self, cr, uid, ids, purchase_id, context={}):
"""
To read purchase order lines when select a purchase order.
@param purchase_id : purchase order id
@return: True
"""
purchase_obj = self.pool.get('purchase.order').browse(cr, uid, purchase_id)
transportation_product_odj=self.pool.get('transportation.order.line')
transportation = self.pool.get('transportation.order').browse(cr, uid, ids)
if transportation[0].transportation_line_ids != []:
raise osv.except_osv(_('this Transportation is already contain products !'), _('to chose a Purchase Order delete all the products first ..'))
for product in purchase_obj.order_line:
transportation_product_odj.create(cr,uid,{
'name': purchase_obj.name + ': ' +(product.name or ''),
'product_id': product.product_id.id,
'price_unit': product.price_unit,
'product_qty': product.product_qty,
'product_uom': product.product_uom.id,
'transportation_id': ids[0],
'description': 'purchase order '+ purchase_obj.name ,
'purchase_line_id': product.id,
'price_unit': product.price_unit,
'code_calling':True, })
self.write(cr,uid,ids,{'description':purchase_obj.name})
return True
def load_items(self, cr, uid, ids,purchase_id, context=None):
"""
To load purchase order lines of the selected purchase order to transportaion lines.
@param purchase_id: purchase order id
@return: True
"""
for order in self.browse(cr, uid, ids):
if order.purchase_order_id:
self.get_products(cr, uid, ids,order.purchase_order_id.id, context=context)
return True
def confirmed(self,cr,uid,ids,*args):
"""
Workflow function to change state of Purchase transportation to confirmed.
@return: True
"""
for order in self.browse(cr, uid, ids):
if order.purchase_order_id:
if not order.transportation_line_ids:
raise osv.except_osv(_('Load purchase items first!'), _('Please Load purchase items Purchase Order ..'))
if order.transportation_line_ids:
self.write(cr, uid, ids, {'state':'confirmed'})
else:
raise osv.except_osv(_('No Products !'), _('Please fill the products list first ..'))
return True
def invoice(self, cr, uid, ids, context={}):
"""
function to change state of Purchase transportation to invoice,
check driver information and calculate transportaion price of purche
line by allocate_purchase_order_line_price() and write the price to
purhase order.
@return: True
"""
purchase_ids = []
for transportation in self.browse(cr, uid, ids):
if not transportation.quotes_ids:
raise osv.except_osv(_('wrong action!'), _('Sorry no quotes to be invoiced'))
if not transportation.transportation_drivers :
raise osv.except_osv(_('No Driver !'), _('Please add the Drivers first ..'))
amount = 0.0
for quote in transportation.quotes_ids:
if quote.state in ['done']:
quote_obj = quote
#else : raise osv.except_osv(_('wrong action!'), _('Please approve your quotes first'))
purchase_ids.append(transportation.purchase_order_id.id)
transportation._calculate_transportation_amount(quote_obj.amount_total,quote_obj)
self.write(cr, uid, ids, {'state':'invoice'},context=context)
if False not in purchase_ids:
self.allocate_purchase_order_line_price(cr,uid,ids,purchase_ids)
return True
def done(self, cr, uid, ids, context=None):
"""
Workflow function to change state of Purchase transportation to Done
and create voucher and voucher lines with transportaion price.
@return: True
"""
self.invoice(cr, uid, ids, context)
transportation_line_obj = self.pool.get('transportation.order.line')
company_obj = self.pool.get('res.users').browse(cr, uid, uid).company_id
journal = company_obj.transportation_jorunal
account = company_obj.transportation_account
if not journal:
raise osv.except_osv(_('wrong action!'), _('no Transportation journal defined for your company! please add the journal first ..'))
voucher_obj = self.pool.get('account.voucher')
voucher_line_obj = self.pool.get('account.voucher.line')
transportation_obj = self.pool.get('transportation.order').browse(cr,uid,ids)
transportation_voucher = []
purchase_ids = []
for transportation in transportation_obj:
amount = 0.0
purchase = ''
if transportation.purpose == 'purchase':
purchase = transportation.purchase_order_id.name
if transportation.purchase_order_id.purchase_type == 'foreign':
account = company_obj.purchase_foreign_account
if transportation.purchase_order_id.contract_id:
if not transportation.purchase_order_id.contract_id:
raise osv.except_osv(_('Missing Account Number !'),_('There No Account Defined Fore This Contract please chose the account first') )
account = transportation.purchase_order_id.contract_id.contract_account
for quote in transportation.quotes_ids:
if quote.state in ['done']:
quote_obj = quote
if not account:
raise osv.except_osv(_('wrong action!'), _('no Transportation Account defined! please add the account first ..'))
voucher_id = voucher_obj.create(cr, uid, {
'amount': quote_obj.amount_total ,
'type': 'purchase',
'date': time.strftime('%Y-%m-%d'),
'partner_id': quote_obj.supplier_id.id,
'account_id': quote_obj.supplier_id.property_account_payable.id,
'journal_id': journal.id,
'reference': transportation.name + purchase,})
vocher_line_id = voucher_line_obj.create(cr, uid, {
'amount': quote_obj.amount_total ,
'voucher_id': voucher_id,
'type': 'dr',
'account_id': account.id,
'name': transportation.description or transportation.name ,
})
transportation_voucher.append(voucher_id)
purchase_ids.append(transportation.purchase_order_id.id)
self.write(cr, uid, ids, {'state':'done','account_vouchers':[(6,0,transportation_voucher)]})
return True
def allocate_purchase_order_line_price(self, cr, uid,ids,purchase_ids):
"""
Calculate transportaion price for every purchase line and write the price to purchase order lines.
@param purchase_ids: list of purchase orders ids
@return: Ture
"""
purchase_line_obj = self.pool.get('purchase.order.line')
transportation_product_obj = self.pool.get('transportation.order.line')
for purchase in self.pool.get('purchase.order').browse(cr, uid, purchase_ids):
for line in purchase.order_line:
transportation_item = transportation_product_obj.search(cr,uid,[('product_id','=',line.product_id.id),('transportation_id','in',[ids])])
if transportation_item :
transportation_product = transportation_product_obj.browse(cr, uid, transportation_item[0])
amount = transportation_product.transportation_price_unit
total = line.extra_price_total+amount
if line.transportation_price:
amount += line.transportation_price
purchase_line_obj.write(cr,uid,line.id,{'transportation_price': amount,'extra_price_total':total})
return True
def cancel(self,cr,uid,ids,notes=''):
"""
Workflow function to changes clearance state to cancell and writes notes.
@param notes : contains information.
@return: True
"""
notes = ""
user = self.pool.get('res.users').browse(cr, uid,uid).name
notes = notes +'\n'+'purchase Transportation Cancelled at : '+time.strftime('%Y-%m-%d') + ' by '+ user
self.write(cr, uid, ids, {'state':'cancel','notes':notes})
return True
def ir_action_cancel_draft(self, cr, uid, ids, *args):
"""
To changes clearance state to Draft and reset workflow.
@return: True
"""
if not len(ids):
return False
wf_service = netsvc.LocalService("workflow")
for s_id in ids:
self.write(cr, uid, s_id, {'state':'draft'})
wf_service.trg_delete(uid, 'transportation.order', s_id, cr)
wf_service.trg_create(uid, 'transportation.order', s_id, cr)
return True
def partner_id_change(self, cr, uid, ids,partner):
"""
On change partner function to read partner pricelist.
@param partner: partner id.
@return: Dictonary of partner's pricelist value
"""
partne = self.pool.get('res.partner.address').search(cr, uid, [('partner_id', '=', partner)])
if partne:
prod= self.pool.get('res.partner.address').browse(cr, uid,partne[0])
return {'value': {'pricelist_id':prod.partner_id.property_product_pricelist_purchase.id }}
def create_quote(self, cr, uid, ids, context=None):
"""
Button function to creates qoutation
@return: True
"""
for obj in self.browse(cr, uid, ids):
if obj.transportation_line_ids:
pq_id = self.pool.get('transportation.quotes').create(cr, uid, {'transportation_id': obj.id,}, context=context)
for product in obj.transportation_line_ids:
prod_name = ''
if product.product_id.id :
prod_name = self.pool.get('product.product').browse(cr, uid,product.product_id.id, context=context).name
if product.name:
prod_name = product.name
q_id = self.pool.get('transportation.quotes.products').create(cr, uid, {
'name':prod_name,
'price_unit': 0.0,
'price_unit_tax': 0.0,
'price_unit_total': 0.0,
'product_id': product.product_id.id or False,
'product_qty': product.product_qty,
'quote_id':pq_id,
'description': product.description,
'transportation_line': product.id,
})
else:
raise osv.except_osv(('No Products !'), ('Please fill the product list first ..'))
return True
def _calculate_transportation_amount(self, cr, uid, ids, quote_amount,quote):
"""
To calculate transportasiion amount for every clearance line accourding to
allocation base the default allocation is price percentage.
@return: True
"""
quote_product = self.pool.get('transportation.quotes.products')
for transportation in self.browse(cr, uid, ids):
total_qty = total_weight = total_space = 0.0
# calculate the total amount of qty, wight, space and price
for item in transportation.transportation_line_ids:
total_qty += item.product_qty
if transportation.allocation_base in ['weight']:
if item.weight:
total_weight += item.weight
else:
raise osv.except_osv(_('No Product weight!'), _('Please fill the product weight first ..'))
if transportation.allocation_base in ['space']:
if item.space :
total_space += item.space
else:
raise osv.except_osv(_('No Product Space (volume) !'), _('Please fill the product Space (volume) first ..'))
for item in transportation.transportation_line_ids:
# get the line Id to get the price of the item
line = quote_product.search(cr, uid,[('quote_id','=',quote.id), ('product_id','=',item.product_id.id),('product_qty','=',item.product_qty)])[0]
line_obj = quote_product.browse(cr, uid, line)
# alocate the price to the item base on the allocation base
if transportation.allocation_base in ['quantity']: amount = quote_amount*( item.product_qty/ total_qty)
elif transportation.allocation_base in ['weight']:amount = quote_amount*(item.weight/total_weight)
elif transportation.allocation_base in ['space']: amount = quote_amount*(item.space / total_space)
else: amount = line_obj.price_unit
item.write({'transportation_price_unit':amount})
return True
def purchase_ref(self, cr, uid, ids, purchase_ref, context=None):
#To Clear Products Line From Clearance_Ids
if purchase_ref:
if ids == []:
raise osv.except_osv(_('The Transportation must be saved first!'), _('please save the Transportation before selecting the Purchase Order ..'))
else:
self.get_products(cr, uid, ids,purchase_ref)
return {}
def onchange_purpose(self, cr, uid, ids, purpose ,context=None):
"""
On change purpose function to change delivery Method
@param purpose: purpose
@return: Dictionary
"""
if purpose and ids:
unlink_ids = self.pool.get('transportation.order.line').search(cr, uid,[('transportation_id','=',ids[0])] )
self.pool.get('transportation.order.line').unlink(cr, uid, unlink_ids, context=context)
land = 'land_freight'
if purpose != 'purchase' :
return {'value': { 'delivery_method' : land }}
return {}
class transportation_order_line(osv.osv):
"""
To manage transportaion order lines """
_name = 'transportation.order.line'
_description = "Transportation order line"
_columns = {
'name': fields.char('Description', size=256, required=True,readonly=False),
'product_qty': fields.float('Quantity', required=True, digits=(16,2)),
'product_uom': fields.many2one('product.uom', 'Product UOM',readonly=False),
'product_id': fields.many2one('product.product', 'Product', required=True),
'transportation_id': fields.many2one('transportation.order', 'Transportation',),
'transportation_price_unit': fields.float('Transportation price',readonly=True, digits=(16,2)),
'product_packaging': fields.many2one('product.packaging', 'Packaging', help="Control the packages of the products"),
'description': fields.text('Specification' ,readonly=True),
'weight': fields.float('Weight',readonly=False, digits=(16, 2)),
'space': fields.float('Space (volume)',readonly=True, digits=(16, 2)),
'notes': fields.text('Notes'),
'purchase_line_id': fields.many2one('purchase.order.line','order_line'),
'price_unit': fields.float('Purchase Price Unite',readonly=True, digits=(16,2)),
}
_defaults = {
'name': lambda self, cr, uid, context: '/',
}
_sql_constraints = [
('produc_uniq', 'unique(product_id,transportation_id)', 'Sorry You Entered Product Two Time You are not Allow to do this.... So We going to delete The Duplicts!'),
('check_product_quantity', 'CHECK ( product_qty > 0 )', "Sorry Product quantity must be greater than Zero."),
]
def create(self, cr, uid, vals, context=None):
purpose = vals and vals['transportation_id'] and self.pool.get('transportation.order').browse(cr, uid,vals['transportation_id']).purpose
if purpose =='purchase' and ( ('code_calling' not in vals) or not vals['code_calling']):
raise osv.except_osv(_('Sorry Can not add new items'), _('the purpose is purchase'))
return super(transportation_order_line, self).create(cr, uid, vals, context)
def product_id_change(self, cr, uid, ids,product):
"""
On cange product function to read the default name and UOM of product
@param product: product_id
@return: Dictionary of product name and uom or empty dictionary
"""
if product:
prod= self.pool.get('product.product').browse(cr, uid,product)
return {'value': { 'name':prod.name,'product_uom':prod.uom_po_id.id,'product_qty': 1.0}}
return {}
def qty_change(self, cr, uid, ids, product_qty, context=None):
"""
To check the product quantity to not vaulate transportaion order quantity.
@return: True
"""
for product in self.browse(cr, uid, ids):
purchase_id = product.transportation_id.purchase_order_id
if purchase_id.order_line:
for line in purchase_id.order_line:
if product.product_id == line.product_id:
if product_qty > line.product_qty :
raise osv.except_osv(_('wrong action!'), _('This Quantity is more than the Purchase Order Quantity ..'))
return True
class transportation_driver(osv.osv):
"""
To manage transportaion driver """
_name = 'transportation.driver'
_description = "Transportation Driver"
_columns = {
'name': fields.char('Reference', size=64, required=True, readonly=1, select=True),
'driver_name': fields.char('Driver Name', size=64, required=True,),
'phone_number': fields.integer('Phone Number'),
'car_type': fields.char('Car Type', size=64, required=True, select=True),
'car_number': fields.char('Car Number', size=64, required=True, select=True),
'transportation_id': fields.many2one('transportation.order', 'Transportation ref',),
'description': fields.text('Description'),
}
_defaults = {
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'transportation.driver')
}
_sql_constraints = [
#('tran_driver_uniq', 'unique(transportation_id,car_number)', 'Sorry You Entered The Same Car Tow Times for this transportaion order!'),
]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
| [
"[email protected]"
]
| |
ddfd6d214af241497a8523161e43f40420496bea | 5fc2e6c28853b5c3f5df65048714fe3252a69cd6 | /python/Tools/cutSamples.py | 6f529c1c80da99470665ccc699cbc74ff0dfbb20 | []
| no_license | zaixingmao/H2hh2bbTauTau | 2f5fec23546a90f0055798147e8fd762307bf44f | 44b114ce48419b502fa233ddcb8d06eb0e5219f7 | refs/heads/master | 2016-09-05T13:18:21.214825 | 2014-09-17T12:52:59 | 2014-09-17T12:52:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 24,778 | py | #!/usr/bin/env python
import ROOT as r
import tool
from operator import itemgetter
import os
import enVars
from array import array
import optparse
import math
import varsList
import kinfit
r.gROOT.SetBatch(True)
r.gErrorIgnoreLevel = 2000
r.gStyle.SetOptStat("e")
xLabels = ['processedEvents', 'PATSkimmedEvents',
'eTau',"eleTausEleID", "eleTausEleConvRej", "eleTausElePtEta",
"eleTausTauPtEta", "eleTausDecayFound", "eleTausVLooseIsolation",
"eleTausTauMuonVeto", "eleTausTauElectronVeto", "eleTausTauElectronVetoM",
"eleTausEleIsolation", "eleTausLooseIsolation", "eleTauOS",
"muTau", "muTauId", "muTausMuonPtEta", "muTausTauPtEta", "muTausDecayFound",
"muTausVLooseTauIsolation", "muTausTauElectronVeto", "muTausTauMuonVeto",
"muTausMuonIsolation", "muTausLooseTauIsolation", "muTausLooseIsolation", "muTausOS",
'atLeastOneDiTau', 'ptEta1', 'ptEta2', 'tau1Hadronic',
'tau2Hadronic','muonVeto1', 'muonVeto2', 'eleVeto1', 'eleVeto2', 'isolation1', 'relaxed', 'myCut']
lvClass = r.Math.LorentzVector(r.Math.PtEtaPhiM4D('double'))
J1 = lvClass()
J2 = lvClass()
J3 = lvClass()
J4 = lvClass()
matchedGenJet = lvClass()
mGenJet1 = lvClass()
mGenJet2 = lvClass()
CSVJet1 = lvClass()
CSVJet2 = lvClass()
tau1 = lvClass()
tau2 = lvClass()
combinedJJ = lvClass()
sv4Vec = lvClass()
#Setup Kinematic Fit
kinfit.setup(path="/afs/hep.wisc.edu/home/zmao/myScripts/H2hh2bbTauTau/python/HHKinFit",
lib="libHHKinFit.so",)
def calcTrigOneTauEff(eta, pt, data = True, fitStart=25):
le14_da = {20: (0.898, 44.3, 1.02),
25: (0.866, 43.1, 0.86),
30: (0.839, 42.3, 0.73),
35: (0.846, 42.4, 0.78),
}
le14_mc = {20: (0.837, 43.6, 1.09),
25: (0.832, 40.4, 0.80),
30: (0.829, 40.4, 0.74),
35: (0.833, 40.1, 0.86),
}
ge16_da = {20: (0.81, 43.6, 1.09),
25: (0.76, 41.8, 0.86),
30: (0.74, 41.2, 0.75),
35: (0.74, 41.2, 0.79),
}
ge16_mc = {20: (0.70, 39.7, 0.95),
25: (0.69, 38.6, 0.74),
30: (0.69, 38.7, 0.61),
35: (0.69, 38.8, 0.61),
}
le14 = le14_da if data else le14_mc
ge16 = ge16_da if data else ge16_mc
if abs(eta) < 1.4:
d = le14
else:
d = ge16
e, x0, sigma = d[fitStart]
y = r.TMath.Erf((pt-x0)/2.0/sigma/math.sqrt(pt)) # https://github.com/rmanzoni/HTT/blob/master/CMGTools/H2TauTau/interface/TriggerEfficiency.h
#y = r.TMath.Erf((pt-x0)/sigma/math.sqrt(2.0))
return (1+y)*e/2.0
def opts():
parser = optparse.OptionParser()
parser.add_option("-l", dest="location", default="/scratch/zmao", help="location to be saved")
parser.add_option("-n", dest="nevents", default="-1", help="amount of events to be saved")
parser.add_option("-g", dest="genMatch", default="jet", help="gen particle for the reco-jet to match to")
parser.add_option("-a", dest="addFiles", default="False", help="")
options, args = parser.parse_args()
return options
options = opts()
def findFullMass(jetsList = [], sv4Vec = ''):
jetsList = sorted(jetsList, key=itemgetter(0), reverse=True)
combinedJJ = jetsList[0][1]+jetsList[1][1]
if jetsList[1][0] > 0 and jetsList[0][1].pt() > 30 and jetsList[1][1].pt() > 30 and abs(jetsList[0][1].eta()) < 2.4 and abs(jetsList[1][1].eta()) < 2.4:
return combinedJJ, jetsList[0][0], jetsList[1][0], jetsList[0][1], jetsList[1][1], (combinedJJ+sv4Vec).mass(), r.Math.VectorUtil.DeltaR(jetsList[0][1], jetsList[1][1]), jetsList[0][2], jetsList[1][2]
else:
return -1, -1, -1, -1, -1, -1, -1, -1, -1
def findGenJet(j1Name, jet1, j2Name, jet2, tChain):
genJet1 = lvClass()
genJet2 = lvClass()
genJet1.SetCoordinates(0,0,0,0)
genJet2.SetCoordinates(0,0,0,0)
if varsList.findVarInChain(tChain, '%sGenPt' %j1Name) > 0 and varsList.findVarInChain(tChain, '%sGenMass' %j1Name) > 0:
genJet1.SetCoordinates(varsList.findVarInChain(tChain, '%sGenPt' %j1Name),
varsList.findVarInChain(tChain, '%sGenEta' %j1Name),
varsList.findVarInChain(tChain, '%sGenPhi' %j1Name),
varsList.findVarInChain(tChain, '%sGenMass' %j2Name))
if varsList.findVarInChain(tChain, '%sGenPt' %j2Name) > 0 and varsList.findVarInChain(tChain, '%sGenMass' %j2Name) > 0:
genJet2.SetCoordinates(varsList.findVarInChain(tChain, '%sGenPt' %j2Name),
varsList.findVarInChain(tChain, '%sGenEta' %j2Name),
varsList.findVarInChain(tChain, '%sGenPhi' %j2Name),
varsList.findVarInChain(tChain, '%sGenMass' %j2Name))
dR1 = r.Math.VectorUtil.DeltaR(genJet1, jet1)
dR2 = r.Math.VectorUtil.DeltaR(genJet2, jet2)
return dR1, genJet1, dR2, genJet2
def findGenBJet(jet1, jet2, tChain):
genJet1 = lvClass()
genJet2 = lvClass()
genJet1.SetCoordinates(0,0,0,0)
genJet2.SetCoordinates(0,0,0,0)
tmpJet = lvClass()
tmpJet.SetCoordinates(0,0,0,0)
dR1 = 0.5
dR2 = 0.5
for i in range(tChain.genBPt.size()):
tmpJet.SetCoordinates(tChain.genBPt.at(i), tChain.genBEta.at(i), tChain.genBPhi.at(i), tChain.genBMass.at(i))
tmpDR1 = r.Math.VectorUtil.DeltaR(tmpJet, jet1)
if dR1 > tmpDR1:
dR1 = tmpDR1
genJet1.SetCoordinates(tChain.genBPt.at(i), tChain.genBEta.at(i), tChain.genBPhi.at(i), tChain.genBMass.at(i))
for i in range(tChain.genBPt.size()):
tmpJet.SetCoordinates(tChain.genBPt.at(i), tChain.genBEta.at(i), tChain.genBPhi.at(i), tChain.genBMass.at(i))
tmpDR2 = r.Math.VectorUtil.DeltaR(tmpJet, jet2)
if dR2 > tmpDR2 and genJet1 != tmpJet:
dR2 = tmpDR2
genJet2.SetCoordinates(tChain.genBPt.at(i), tChain.genBEta.at(i), tChain.genBPhi.at(i), tChain.genBMass.at(i))
if genJet1 == genJet2:
print ' WARNING:: Matched to the same b quark (b mass = %.3f)' %genJet2.mass()
return dR1, genJet1, dR2, genJet2
def getRegVars(jName, tChain):
jet = lvClass()
SoftLeptPt = 0
jet.SetCoordinates(varsList.findVarInChain_Data(tChain, '%sPt' %jName), varsList.findVarInChain_Data(tChain,'%sEta' %jName),
varsList.findVarInChain_Data(tChain, '%sPhi' %jName), 0)
if varsList.findVarInChain_Data(tChain,'%sSoftLeptPID' %jName) == 0:
SoftLeptPtRel = 0
SoftLeptdR = 0
else:
SoftLeptPtRel = varsList.findVarInChain_Data(tChain,'%sPt' %jName) - varsList.findVarInChain_Data(tChain,'%sSoftLeptPt' %jName)
softLept = lvClass()
softLept.SetCoordinates(varsList.findVarInChain_Data(tChain, '%sSoftLeptPt' %jName), varsList.findVarInChain_Data(tChain,'%sSoftLeptEta' %jName),
varsList.findVarInChain_Data(tChain, '%sSoftLeptPhi' %jName), 0)
SoftLeptdR = r.Math.VectorUtil.DeltaR(softLept, jet)
SoftLeptPt = varsList.findVarInChain_Data(tChain, '%sSoftLeptPt' %jName)
if SoftLeptPt < 0:
SoftLeptPt = 0
return varsList.findVarInChain_Data(tChain, '%sPtUncorr' %jName), varsList.findVarInChain_Data(tChain, '%sEt' %jName), varsList.findVarInChain_Data(tChain, '%sMt' %jName), varsList.findVarInChain_Data(tChain, '%sptLeadTrk' %jName), varsList.findVarInChain_Data(tChain, '%sVtx3dL' %jName),varsList.findVarInChain_Data(tChain, '%sVtx3deL' %jName), varsList.findVarInChain_Data(tChain, '%svtxMass' %jName), varsList.findVarInChain_Data(tChain, '%sVtxPt' %jName), varsList.findVarInChain_Data(tChain, '%sJECUnc' %jName), float(varsList.findVarInChain_Data(tChain, '%sNtot' %jName)), SoftLeptPtRel, SoftLeptPt, SoftLeptdR
def setDPhiInRange(dPhi):
if dPhi > 3.14:
return 6.283-dPhi
else:
return dPhi
def calcdPhiMetValues(tau1Phi, tau2Phi, j1Phi, j2Phi, metPhi, tauTauPhi, jjPhi, svPhi):
return setDPhiInRange(abs(tau1Phi - metPhi)), setDPhiInRange(abs(tau2Phi - metPhi)), setDPhiInRange(abs(j1Phi - metPhi)), setDPhiInRange(abs(j2Phi - metPhi)), setDPhiInRange(abs(tauTauPhi - metPhi)), setDPhiInRange(abs(jjPhi - metPhi)), setDPhiInRange(abs(svPhi - metPhi))
r.gStyle.SetOptStat(0)
signalEntries = enVars.signalEntries
ttEntries = enVars.ttEntries
ZZEntries = enVars.ZZEntries
#*******Get Sample Name and Locations******
sampleLocations = enVars.sampleLocations
preVarList = ['EVENT', 'HMass', 'svMass', 'svPt', 'svEta', 'svPhi', 'J1Pt', 'J1Eta','J1Phi', 'J1Mass', 'NBTags', 'iso1', 'iso2', 'mJJ', 'J2Pt', 'J2Eta','J2Phi', 'J2Mass','pZeta', 'pZ', 'm1', 'm2',
'pZV', 'J3Pt', 'J3Eta','J3Phi', 'J3Mass', 'J4Pt', 'J4Eta','J4Phi', 'J4Mass', 'J1CSVbtag', 'J2CSVbtag', 'J3CSVbtag', 'J4CSVbtag', 'pt1', 'eta1', 'phi1', 'pt2', 'eta2', 'phi2', 'met',
'charge1', 'charge2', 'metphi',
'J1PtUncorr', 'J1VtxPt', 'J1Vtx3dL', 'J1Vtx3deL', 'J1ptLeadTrk', 'J1vtxMass', 'J1vtxPt', 'J1Ntot',
'J1SoftLepPt', 'J1SoftLepEta', 'J1SoftLepPhi', 'J1SoftLepPID', 'J1JECUnc', 'J1Et', 'J1Mt',
'J2PtUncorr', 'J2VtxPt', 'J2Vtx3dL', 'J2Vtx3deL', 'J2ptLeadTrk', 'J2vtxMass', 'J2vtxPt', 'J2Ntot',
'J2SoftLepPt', 'J2SoftLepEta', 'J2SoftLepPhi', 'J2SoftLepPID', 'J2JECUnc', 'J2Et', 'J2Mt',
'J3PtUncorr', 'J3VtxPt', 'J3Vtx3dL', 'J3Vtx3deL', 'J3ptLeadTrk', 'J3vtxMass', 'J3vtxPt', 'J3Ntot',
'J3SoftLepPt', 'J3SoftLepEta', 'J3SoftLepPhi', 'J3SoftLepPID', 'J3JECUnc', 'J3Et', 'J3Mt',
'J4PtUncorr', 'J4VtxPt', 'J4Vtx3dL', 'J4Vtx3deL', 'J4ptLeadTrk', 'J4vtxMass', 'J4vtxPt', 'J4Ntot',
'J4SoftLepPt', 'J4SoftLepEta', 'J4SoftLepPhi', 'J4SoftLepPID', 'J4JECUnc', 'J4Et', 'J4Mt', 'tauDecayMode1', 'tauDecayMode2',
'mvacov00','mvacov01','mvacov10','mvacov11', 'byIsolationMVA2raw_1', 'byIsolationMVA2raw_2'
]
genVarList = ['genBPt', 'genBEta', 'genBPhi','genBMass', 'genTauPt', 'genTauEta', 'genTauPhi', 'genElePt', 'genEleEta',
'genElePhi', 'genMuPt', 'genMuEta', 'genMuPhi','J1GenPt', 'J1GenEta', 'J1GenPhi', 'J1GenMass',
'J2GenPt', 'J2GenEta', 'J2GenPhi', 'J2GenMass', 'J3GenPt', 'J3GenEta', 'J3GenPhi', 'J3GenMass',
'J4GenPt', 'J4GenEta', 'J4GenPhi', 'J4GenMass']
fullVarList = []
for iVar in preVarList:
fullVarList.append(iVar)
for iVar in genVarList:
fullVarList.append(iVar)
blackList = enVars.corruptedROOTfiles
for iSample, iLocation in sampleLocations:
if 'data' in iSample:
isData = True
varList = preVarList
else:
isData = False
varList = fullVarList
cutFlow = r.TH1F('cutFlow', '', len(xLabels), 0, len(xLabels))
if options.addFiles == 'True':
tool.addHistFromFiles(dirName=iLocation, histName = "preselection", hist = cutFlow, xAxisLabels=xLabels)
else:
tool.addHistFromFiles(dirName=iLocation, histName = "TT/results", hist = cutFlow, xAxisLabels=xLabels)
cutFlow.SetName('preselection')
if options.addFiles == 'True':
iChain = r.TChain("eventTree")
else:
iChain = r.TChain("ttTreeBeforeChargeCut/eventTree")
nEntries = tool.addFiles(ch=iChain, dirName=iLocation, knownEventNumber=signalEntries, printTotalEvents=True, blackList=blackList)
iChain.SetBranchStatus("*",0)
for iVar in range(len(varList)):
iChain.SetBranchStatus(varList[iVar],1)
fullMass = array('f', [0.])
mJJ = array('f', [0.])
ptJJ = array('f', [0.])
etaJJ = array('f', [0.])
phiJJ = array('f', [0.])
CSVJ1 = array('f', [0.])
CSVJ1Pt = array('f', [0.])
CSVJ1Eta = array('f', [0.])
CSVJ1Phi = array('f', [0.])
CSVJ1Mass = array('f', [0.])
CSVJ2 = array('f', [0.])
CSVJ2Pt = array('f', [0.])
CSVJ2Eta = array('f', [0.])
CSVJ2Phi = array('f', [0.])
CSVJ2Mass = array('f', [0.])
dRTauTau = array('f', [0.])
dRJJ = array('f', [0.])
dRhh = array('f', [0.])
mTop1 = array('f', [0.])
mTop2 = array('f', [0.])
pZ_new = array('f', [0.])
pZV_new = array('f', [0.])
pZ_new2 = array('f', [0.])
pZV_new2 = array('f', [0.])
triggerEff = array('f', [0.])
triggerEff1 = array('f', [0.])
triggerEff2 = array('f', [0.])
metTau1DPhi = array('f', [0.])
metTau2DPhi = array('f', [0.])
metJ1DPhi = array('f', [0.])
metJ2DPhi = array('f', [0.])
metTauPairDPhi = array('f', [0.])
metJetPairDPhi = array('f', [0.])
metSvTauPairDPhi = array('f', [0.])
dRGenJet1Match = array('f', [0.])
dRGenJet2Match = array('f', [0.])
matchGenJet1Pt = array('f', [0.])
matchGenJet1Eta = array('f', [0.])
matchGenJet1Phi = array('f', [0.])
matchGenJet1Mass = array('f', [0.])
matchGenJet2Pt = array('f', [0.])
matchGenJet2Eta = array('f', [0.])
matchGenJet2Phi = array('f', [0.])
matchGenJet2Mass = array('f', [0.])
matchGenMJJ = array('f', [0.])
matchGenPtJJ = array('f', [0.])
matchGendRJJ = array('f', [0.])
CSVJ1PtUncorr = array('f', [0.])
CSVJ1Et = array('f', [0.])
CSVJ1Mt = array('f', [0.])
CSVJ1ptLeadTrk = array('f', [0.])
CSVJ1Vtx3dL = array('f', [0.])
CSVJ1Vtx3deL = array('f', [0.])
CSVJ1vtxMass = array('f', [0.])
CSVJ1VtxPt = array('f', [0.])
CSVJ1JECUnc = array('f', [0.])
CSVJ1Ntot = array('f', [0.])
CSVJ1SoftLeptPtRel = array('f', [0.])
CSVJ1SoftLeptPt = array('f', [0.])
CSVJ1SoftLeptdR = array('f', [0.])
CSVJ2PtUncorr = array('f', [0.])
CSVJ2Et = array('f', [0.])
CSVJ2Mt = array('f', [0.])
CSVJ2ptLeadTrk = array('f', [0.])
CSVJ2Vtx3dL = array('f', [0.])
CSVJ2Vtx3deL = array('f', [0.])
CSVJ2vtxMass = array('f', [0.])
CSVJ2VtxPt = array('f', [0.])
CSVJ2JECUnc = array('f', [0.])
CSVJ2Ntot = array('f', [0.])
CSVJ2SoftLeptPtRel = array('f', [0.])
CSVJ2SoftLeptPt = array('f', [0.])
CSVJ2SoftLeptdR = array('f', [0.])
chi2KinFit = array('f', [0.])
fMassKinFit = array('f', [0.])
iChain.LoadTree(0)
iTree = iChain.GetTree().CloneTree(0)
iSample = iSample + '_%s' %('all' if options.nevents == "-1" else options.nevents)
iFile = r.TFile("%s/%s.root" %(options.location,iSample),"recreate")
iTree.Branch("fMass", fullMass, "fMass/F")
iTree.Branch("mJJ", mJJ, "mJJ/F")
iTree.Branch("etaJJ", etaJJ, "etaJJ/F")
iTree.Branch("phiJJ", phiJJ, "phiJJ/F")
iTree.Branch("ptJJ", ptJJ, "ptJJ/F")
iTree.Branch("CSVJ1", CSVJ1, "CSVJ1/F")
iTree.Branch("CSVJ1Pt", CSVJ1Pt, "CSVJ1Pt/F")
iTree.Branch("CSVJ1Eta", CSVJ1Eta, "CSVJ1Eta/F")
iTree.Branch("CSVJ1Phi", CSVJ1Phi, "CSVJ1Phi/F")
iTree.Branch("CSVJ1Mass", CSVJ1Mass, "CSVJ1Mass/F")
iTree.Branch("CSVJ2", CSVJ2, "CSVJ2/F")
iTree.Branch("CSVJ2Pt", CSVJ2Pt, "CSVJ2Pt/F")
iTree.Branch("CSVJ2Eta", CSVJ2Eta, "CSVJ2Eta/F")
iTree.Branch("CSVJ2Phi", CSVJ2Phi, "CSVJ2Phi/F")
iTree.Branch("CSVJ2Mass", CSVJ2Mass, "CSVJ2Mass/F")
iTree.Branch("dRTauTau", dRTauTau, "dRTauTau/F")
iTree.Branch("dRJJ", dRJJ, "dRJJ/F")
iTree.Branch("dRhh", dRhh, "dRhh/F")
iTree.Branch("mTop1", mTop1, "mTop1/F")
iTree.Branch("mTop2", mTop2, "mTop2/F")
iTree.Branch("pZ_new", pZ_new, "pZ_new/F")
iTree.Branch("pZV_new", pZV_new, "pZV_new/F")
iTree.Branch("pZ_new2", pZ_new2, "pZ_new2/F")
iTree.Branch("pZV_new2", pZV_new2, "pZV_new2/F")
iTree.Branch("triggerEff", triggerEff, "triggerEff/F")
iTree.Branch("triggerEff1", triggerEff1, "triggerEff1/F")
iTree.Branch("triggerEff2", triggerEff2, "triggerEff2/F")
iTree.Branch("metTau1DPhi", metTau1DPhi, "metTau1DPhi/F")
iTree.Branch("metTau2DPhi", metTau2DPhi, "metTau2DPhi/F")
iTree.Branch("metJ1DPhi", metJ1DPhi, "metJ1DPhi/F")
iTree.Branch("metJ2DPhi", metJ2DPhi, "metJ2DPhi/F")
iTree.Branch("metTauPairDPhi", metTauPairDPhi, "metTauPairDPhi/F")
iTree.Branch("metJetPairDPhi", metJetPairDPhi, "metJetPairDPhi/F")
iTree.Branch("metSvTauPairDPhi", metSvTauPairDPhi, "metSvTauPairDPhi/F")
iTree.Branch("chi2KinFit", chi2KinFit, "chi2KinFit/F")
iTree.Branch("fMassKinFit", fMassKinFit, "fMassKinFit/F")
if not isData:
iTree.Branch("dRGenJet1Match", dRGenJet1Match, "dRGenJet1Match/F")
iTree.Branch("dRGenJet2Match", dRGenJet2Match, "dRGenJet2Match/F")
iTree.Branch("matchGenJet1Pt", matchGenJet1Pt, "matchGenJet1Pt/F")
iTree.Branch("matchGenJet1Eta", matchGenJet1Eta, "matchGenJet1Eta/F")
iTree.Branch("matchGenJet1Phi", matchGenJet1Phi, "matchGenJet1Phi/F")
iTree.Branch("matchGenJet1Mass", matchGenJet1Mass, "matchGenJet1Mass/F")
iTree.Branch("matchGenJet2Pt", matchGenJet2Pt, "matchGenJet2Pt/F")
iTree.Branch("matchGenJet2Eta", matchGenJet2Eta, "matchGenJet2Eta/F")
iTree.Branch("matchGenJet2Phi", matchGenJet2Phi, "matchGenJet2Phi/F")
iTree.Branch("matchGenJet2Mass", matchGenJet2Mass, "matchGenJet2Mass/F")
iTree.Branch("matchGenMJJ", matchGenMJJ, "matchGenMJJ/F")
iTree.Branch("matchGenPtJJ", matchGenPtJJ, "matchGenPtJJ/F")
iTree.Branch("matchGendRJJ", matchGendRJJ, "matchGendRJJ/F")
iTree.Branch("CSVJ1PtUncorr",CSVJ1PtUncorr,"CSVJ1PtUncorr/F")
iTree.Branch("CSVJ1Et",CSVJ1Et,"CSVJ1Et/F")
iTree.Branch("CSVJ1Mt",CSVJ1Mt,"CSVJ1Mt/F")
iTree.Branch("CSVJ1ptLeadTrk",CSVJ1ptLeadTrk,"CSVJ1ptLeadTrk/F")
iTree.Branch("CSVJ1Vtx3dL",CSVJ1Vtx3dL,"CSVJ1Vtx3dL/F")
iTree.Branch("CSVJ1Vtx3deL",CSVJ1Vtx3deL,"CSVJ1Vtx3deL/F")
iTree.Branch("CSVJ1vtxMass",CSVJ1vtxMass,"CSVJ1vtxMass/F")
iTree.Branch("CSVJ1VtxPt",CSVJ1VtxPt,"CSVJ1VtxPt/F")
iTree.Branch("CSVJ1JECUnc",CSVJ1JECUnc,"CSVJ1JECUnc/F")
iTree.Branch("CSVJ1Ntot",CSVJ1Ntot,"CSVJ1Ntot/F")
iTree.Branch("CSVJ1SoftLeptPtRel",CSVJ1SoftLeptPtRel,"CSVJ1SoftLeptPtRel/F")
iTree.Branch("CSVJ1SoftLeptPt",CSVJ1SoftLeptPt,"CSVJ1SoftLeptPt/F")
iTree.Branch("CSVJ1SoftLeptdR",CSVJ1SoftLeptdR,"CSVJ1SoftLeptdR/F")
iTree.Branch("CSVJ2PtUncorr",CSVJ2PtUncorr,"CSVJ2PtUncorr/F")
iTree.Branch("CSVJ2Et",CSVJ2Et,"CSVJ2Et/F")
iTree.Branch("CSVJ2Mt",CSVJ2Mt,"CSVJ2Mt/F")
iTree.Branch("CSVJ2ptLeadTrk",CSVJ2ptLeadTrk,"CSVJ2ptLeadTrk/F")
iTree.Branch("CSVJ2Vtx3dL",CSVJ2Vtx3dL,"CSVJ2Vtx3dL/F")
iTree.Branch("CSVJ2Vtx3deL",CSVJ2Vtx3deL,"CSVJ2Vtx3deL/F")
iTree.Branch("CSVJ2vtxMass",CSVJ2vtxMass,"CSVJ2vtxMass/F")
iTree.Branch("CSVJ2VtxPt",CSVJ2VtxPt,"CSVJ2VtxPt/F")
iTree.Branch("CSVJ2JECUnc",CSVJ2JECUnc,"CSVJ2JECUnc/F")
iTree.Branch("CSVJ2Ntot",CSVJ2Ntot,"CSVJ2Ntot/F")
iTree.Branch("CSVJ2SoftLeptPtRel",CSVJ2SoftLeptPtRel,"CSVJ2SoftLeptPtRel/F")
iTree.Branch("CSVJ2SoftLeptPt",CSVJ2SoftLeptPt,"CSVJ2SoftLeptPt/F")
iTree.Branch("CSVJ2SoftLeptdR",CSVJ2SoftLeptdR,"CSVJ2SoftLeptdR/F")
counter = 0
for iEntry in range(nEntries):
iChain.LoadTree(iEntry)
iChain.GetEntry(iEntry)
if counter == int(options.nevents):
break
if iChain.svMass.size() == 0:
continue
if not tool.calc(iChain):
continue
# if iChain.charge1.at(0) - iChain.charge2.at(0) == 0: #sign requirement
# continue
if iChain.pt1.at(0)<45 or iChain.pt2.at(0)<45: #pt cut
continue
if abs(iChain.eta1.at(0))>2.1 or abs(iChain.eta2.at(0))>2.1: #pt cut
continue
# if iChain.iso1.at(0)<1.5 or iChain.iso2.at(0)<1.5: #iso cut
# continue
jetsList = [(iChain.J1CSVbtag, J1.SetCoordinates(iChain.J1Pt, iChain.J1Eta, iChain.J1Phi, iChain.J1Mass), 'J1'),
(iChain.J2CSVbtag, J2.SetCoordinates(iChain.J2Pt, iChain.J2Eta, iChain.J2Phi, iChain.J2Mass), 'J2'),
(iChain.J3CSVbtag, J3.SetCoordinates(iChain.J3Pt, iChain.J3Eta, iChain.J3Phi, iChain.J3Mass), 'J3'),
(iChain.J4CSVbtag, J4.SetCoordinates(iChain.J4Pt, iChain.J4Eta, iChain.J4Phi, iChain.J4Mass), 'J4')]
sv4Vec.SetCoordinates(iChain.svPt.at(0), iChain.svEta.at(0), iChain.svPhi.at(0), iChain.svMass.at(0))
bb = lvClass()
bb, CSVJ1[0], CSVJ2[0], CSVJet1, CSVJet2, fullMass[0], dRJJ[0], j1Name, j2Name = findFullMass(jetsList=jetsList, sv4Vec=sv4Vec)
if bb == -1:
continue
matchGenJet1Pt[0] = 0
matchGenJet2Pt[0] = 0
if not isData:
if options.genMatch == 'jet':
dRGenJet1Match[0], mGenJet1, dRGenJet2Match[0], mGenJet2 = findGenJet(j1Name, CSVJet1, j2Name, CSVJet2, iChain)
else:
dRGenJet1Match[0], mGenJet1, dRGenJet2Match[0], mGenJet2 = findGenBJet(CSVJet1, CSVJet2, iChain)
matchGenJet1Pt[0] = mGenJet1.pt()
matchGenJet1Eta[0] = mGenJet1.eta()
matchGenJet1Phi[0] = mGenJet1.phi()
matchGenJet1Mass[0] = mGenJet1.mass()
matchGenJet2Pt[0] = mGenJet2.pt()
matchGenJet2Eta[0] = mGenJet2.eta()
matchGenJet2Phi[0] = mGenJet2.phi()
matchGenJet2Mass[0] = mGenJet2.mass()
genJJ = mGenJet1 + mGenJet2
matchGenMJJ[0] = genJJ.mass()
matchGenPtJJ[0] = genJJ.pt()
matchGendRJJ[0] = r.Math.VectorUtil.DeltaR(mGenJet1, mGenJet2)
if matchGenMJJ[0] < 0:
matchGenMJJ[0] = 0
matchGenPtJJ[0] = 0
CSVJ1Pt[0] = CSVJet1.pt()
CSVJ1Eta[0] = CSVJet1.eta()
CSVJ1Phi[0] = CSVJet1.phi()
CSVJ1Mass[0] = CSVJet1.mass()
CSVJ2Pt[0] = CSVJet2.pt()
CSVJ2Eta[0] = CSVJet2.eta()
CSVJ2Phi[0] = CSVJet2.phi()
CSVJ2Mass[0] = CSVJet2.mass()
CSVJ1PtUncorr[0], CSVJ1Et[0], CSVJ1Mt[0], CSVJ1ptLeadTrk[0], CSVJ1Vtx3dL[0], CSVJ1Vtx3deL[0], CSVJ1vtxMass[0], CSVJ1VtxPt[0], CSVJ1JECUnc[0], CSVJ1Ntot[0], CSVJ1SoftLeptPtRel[0], CSVJ1SoftLeptPt[0], CSVJ1SoftLeptdR[0] = getRegVars(j1Name, iChain)
CSVJ2PtUncorr[0], CSVJ2Et[0], CSVJ2Mt[0], CSVJ2ptLeadTrk[0], CSVJ2Vtx3dL[0], CSVJ2Vtx3deL[0], CSVJ2vtxMass[0], CSVJ2VtxPt[0], CSVJ2JECUnc[0], CSVJ2Ntot[0], CSVJ2SoftLeptPtRel[0], CSVJ2SoftLeptPt[0], CSVJ2SoftLeptdR[0] = getRegVars(j2Name, iChain)
if CSVJ1Vtx3dL[0] == -10:
CSVJ1Vtx3dL[0] = 0
CSVJ1Vtx3deL[0] = 0
CSVJ1vtxMass[0] = 0
CSVJ1VtxPt[0] = 0
if CSVJ1ptLeadTrk[0] < 0:
CSVJ1ptLeadTrk[0] = 0
if CSVJ2Vtx3dL[0] == -10:
CSVJ2Vtx3dL[0] = 0
CSVJ2Vtx3deL[0] = 0
CSVJ2vtxMass[0] = 0
CSVJ2VtxPt[0] = 0
if CSVJ2ptLeadTrk[0] < 0:
CSVJ2ptLeadTrk[0] = 0
if CSVJ1SoftLeptPtRel[0] == -10:
CSVJ1SoftLeptPtRel[0] == 0
CSVJ1SoftLeptPt[0] == 0
if CSVJ2SoftLeptPtRel[0] == -10:
CSVJ2SoftLeptPtRel[0] == 0
CSVJ2SoftLeptPt[0] == 0
ptJJ[0] = bb.pt()
etaJJ[0] = bb.eta()
phiJJ[0] = bb.phi()
mJJ[0] = bb.mass()
tau1.SetCoordinates(iChain.pt1.at(0), iChain.eta1.at(0), iChain.phi1.at(0), iChain.m1.at(0))
tau2.SetCoordinates(iChain.pt2.at(0), iChain.eta2.at(0), iChain.phi2.at(0), iChain.m2.at(0))
mTop1[0] = (CSVJet1 + tau1).mass()
mTop2[0] = (CSVJet2 + tau2).mass()
pZ_new[0] = iChain.pZ/iChain.svPt.at(0)
pZV_new[0] = iChain.pZV/iChain.svPt.at(0)
pZ_new2[0] = iChain.pZ/fullMass[0]
pZV_new2[0] = iChain.pZV/fullMass[0]
dRTauTau[0] = r.Math.VectorUtil.DeltaR(tau1, tau2)
dRhh[0] = r.Math.VectorUtil.DeltaR(bb, sv4Vec)
metTau1DPhi[0], metTau2DPhi[0], metJ1DPhi[0], metJ2DPhi[0], metTauPairDPhi[0], metJetPairDPhi[0], metSvTauPairDPhi[0] = calcdPhiMetValues(iChain.phi1.at(0), iChain.phi2.at(0), CSVJet1.phi(), CSVJet2.phi(), iChain.metphi.at(0), (tau1+tau2).phi(), bb.phi(), iChain.svPhi.at(0))
eff1 = calcTrigOneTauEff(eta=iChain.eta1.at(0), pt=iChain.pt1.at(0), data = True, fitStart=25)
eff2 = calcTrigOneTauEff(eta=iChain.eta2.at(0), pt=iChain.pt2.at(0), data = True, fitStart=25)
triggerEff1[0] = eff1
triggerEff2[0] = eff2
triggerEff[0] = eff1*eff2
if isData:
triggerEff[0] = 1
triggerEff1[0] = 1
triggerEff2[0] = 1
#For Kinematic Fit
chi2KinFit[0], fMassKinFit[0] = kinfit.fit(iChain, CSVJet1, CSVJet2)
iTree.Fill()
counter += 1
tool.printProcessStatus(iEntry, nEntries, 'Saving to file %s.root' %(iSample))
print ' -- saved %d events' %(counter)
tool.addEventsCount2Hist(hist = cutFlow, count = counter, labelName = 'myCut')
iFile.cd()
cutFlow.Write()
iTree.Write()
iFile.Close()
| [
"[email protected]"
]
| |
dfdf08871a317bd868aaf96af910a062abbb121c | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03005/s702594618.py | 664af542c17dd1cc55af2decc0b25ecea2d985cf | []
| no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 101 | py | import sys
n,k = input().split()
n,k = int(n), int(k)
if k==1 :
print(0)
else :
print(n-k)
| [
"[email protected]"
]
| |
52140a927a1c45b88b007bd1af0bfe4d2d942003 | 50402cc4388dfee3a9dbe9e121ef217759ebdba8 | /django_wk/Mikesite/pubApp/pubmanager.py | fec872afed9ea1d9834c4cc18521c7088d2b2c74 | []
| no_license | dqyi11/SVNBackup | bd46a69ec55e3a4f981a9bca4c8340944d8d5886 | 9ad38e38453ef8539011cf4d9a9c0a363e668759 | refs/heads/master | 2020-03-26T12:15:01.155873 | 2015-12-10T01:11:36 | 2015-12-10T01:11:36 | 144,883,382 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,134 | py | '''
Created on 2013-12-29
@author: Walter
'''
from pubApp.models import Paper
class PubManager(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
self.type = "all"
self.year = "all"
self.type_all = "all"
self.type_article = "article"
self.type_proceeding = "inproceedings"
self.year_all = "all"
self.typeIdx = 0
def getYearList(self):
years = []
publications = Paper.objects.all();
for p in publications:
if not (str(p.year) in years):
years.append(str(p.year))
years.sort(reverse=True)
return years
def getPubList(self):
papers = []
if self.type == "all" and self.year =="all":
papers = Paper.objects.all().order_by('-year','title')
elif self.type == "all":
papers = Paper.objects.filter(year=self.year).order_by('-year','title')
elif self.year == "all":
papers = Paper.objects.filter(type=self.type).order_by('-year','title')
else:
papers = Paper.objects.filter(type=self.type).filter(year=self.year).order_by('-year','title')
self.typeIdx = self.getTypeIndex()
pub_years = []
for p in papers:
ys = [y for y in pub_years if p.year==y[0]]
if len(ys) == 0:
pub_years.append((p.year, []))
for p in papers:
year = next(y for y in pub_years if p.year==y[0])
year[1].append(p)
return pub_years
def getTypeIndex(self):
if self.type == self.type_article:
return 1
if self.type == self.type_proceeding:
return 2
return 0
def getYearIndex(self):
if self.year == self.year_all:
return 0
return int(self.year)
| [
"walter@e224401c-0ce2-47f2-81f6-2da1fe30fd39"
]
| walter@e224401c-0ce2-47f2-81f6-2da1fe30fd39 |
3a42023dfd9ac8cc3bbee4b8459c832bd62732a1 | 9e38b45f555ffa08fe036b7b0429871ccdd85303 | /Python/string_split_and_join.py | 8b17eac33966a7d952c106de079a896dbe6307f7 | []
| no_license | shayaankhan05/HackerRank | b066969b0514046bd8620b55d0458d8284a12005 | a975fac85af80310ec2ec5f6275c94ceefe3715b | refs/heads/master | 2023-06-01T09:06:23.374474 | 2021-06-24T08:10:38 | 2021-06-24T08:10:38 | 294,485,980 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 193 | py | def split_and_join(line):
a = line
a = a.split(" ")
a = "-".join(a)
return a
if __name__ == '__main__':
line = input()
result = split_and_join(line)
print(result)
| [
"[email protected]"
]
| |
8dbad1d4354d63d045a7b9f71ef8405a05615120 | e16cc78f0e05e50d589558535ae0fc5e414dd4a0 | /IM5.4.0_timing/ztest_e_send5_video.py | 1c13ecf0caf88ccbce3128b36482d9396bea79b6 | []
| no_license | wenqiang1990/wenqiang_code | df825b089e3bd3c55bcff98f4946f235f50f2f3d | 3c9d77e0a11af081c60a5b1f4c72ecd159945864 | refs/heads/master | 2020-06-19T04:38:39.052037 | 2019-12-18T03:40:39 | 2019-12-18T03:40:39 | 196,561,628 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,642 | py | #coding:utf-8
import time
import datetime
import unittest
from appium.webdriver.common.touch_action import TouchAction
from robot.utils.asserts import *
from appium import webdriver
from public import login
from public import logout
from clear_massage import clear_massage
from set_driver import set_driver
class Imtest(unittest.TestCase):
def setUp(self):
wq=set_driver()
self.driver=wq.get_driver()
self.verificationErrors = []
self.driver.implicitly_wait(10)
def test_send_video(self):
'''群成员发送图片消息'''
clear_massage(self,name="groupname1")
clear_massage(self,name=u"系统通知")
driver = self.driver
with open('F:\Appium\group\groupID.txt','r') as f:
el=f.read()
driver.find_element_by_id("com.yuntongxun.eckuailiao:id/btn_address_list").click()#点击联系人
driver.find_element_by_id("com.yuntongxun.eckuailiao:id/tv_head_group").click()#点击群组
driver.find_element_by_id("com.yuntongxun.eckuailiao:id/p_list").click()#点击群组列表
el=u"群组id:"+el
driver.find_element_by_name(el).click()#点击群组id,以后改为读取上一条用例创建群组的id
#群成员发送图片
self.driver.find_element_by_id("chatting_attach_btn").click()#点击加号
self.driver.find_element_by_name(u"短视频").click()
time.sleep(2)
action1 = TouchAction(self.driver)
el = self.driver.find_element_by_id("com.yuntongxun.eckuailiao:id/start")
action1.long_press(el,duration=10000).perform()
self.driver.find_element_by_id("com.yuntongxun.eckuailiao:id/ok").click()#点击发送
time.sleep(5)
el=self.driver.find_element_by_id("tv_read_unread").get_attribute("text")
assert_equal(el, u"已读", msg=u"状态验证失败")
print el+u" 阅读状态验证成功"
el = self.driver.find_element_by_id("tv_read_unread")#状态
action1 = TouchAction(self.driver)
action1.long_press(el,duration=5000).perform()
self.driver.find_element_by_name(u"删除").click()
self.driver.find_element_by_id("dilaog_button3").click()#确认删除
time.sleep(2)
def tearDown(self):
self.driver.quit()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
# 构造测试集
suite = unittest.TestSuite()
suite.addTest(Imtest("test_send_video"))
# 执行测试
runner = unittest.TextTestRunner()
runner.run(suite) | [
"[email protected]"
]
| |
088973a0dbd18923e03afc75a341c75a61a348e9 | cb80ebc49bc92c350f6d6f039a6a4f0efa6b4c60 | /EnvironmentVariables/EnvironmentVariables.py | 9e6a9451d078f7f1d2002410d1982b10be2b1a30 | []
| no_license | rabramley/pythonTrials | 9708ef1b39011c8c08909808132114ff3b30d34a | bbc93a9f69afbe3cd045de5835ad3c8a4a557050 | refs/heads/master | 2021-01-15T23:07:48.074817 | 2015-06-22T14:11:20 | 2015-06-22T14:11:20 | 32,924,481 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 361 | py | #!/usr/bin/env python
import os
print os.environ['HOME']
# using get will return `None` if a key is not present rather than raise a `KeyError`
print os.environ.get('KEY_THAT_MIGHT_EXIST')
default_value = 'Use this instead'
# os.getenv is equivalent, and can also give a default value instead of `None`
print os.getenv('KEY_THAT_MIGHT_EXIST', default_value)
| [
"[email protected]"
]
| |
745f90f519853d1de410ac75ee637f5d3b14f3a6 | 070b693744e7e73634c19b1ee5bc9e06f9fb852a | /python/problem-tree/maximum_width_of_binary_tree.py | a18203e5b1c59a32be6b1e9d83fef22553353874 | []
| no_license | rheehot/practice | a7a4ce177e8cb129192a60ba596745eec9a7d19e | aa0355d3879e61cf43a4333a6446f3d377ed5580 | refs/heads/master | 2021-04-15T22:04:34.484285 | 2020-03-20T17:20:00 | 2020-03-20T17:20:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,855 | py | # https://leetcode.com/problems/maximum-width-of-binary-tree
# https://leetcode.com/problems/maximum-width-of-binary-tree/solution
from TreeNode import TreeNode
class Solution:
# Wrong Answer
def widthOfBinaryTree0(self, root):
if root is None:
return 0
print(root)
width, nodes, curDepth, q = 0, [], 0, [(0, root)]
while q:
depth, node = q.pop(0)
if depth != curDepth:
curDepth = depth
while nodes[0] is None:
nodes.pop(0)
while nodes[-1] is None:
nodes.pop()
width = max(width, len(nodes))
nodes = [node]
else:
nodes.append(node)
if node:
if node.left or node.right:
q.append((depth + 1, node.left))
q.append((depth + 1, node.right))
print(nodes)
while nodes[0] is None:
nodes.pop(0)
while nodes[-1] is None:
nodes.pop()
width = max(width, len(nodes))
return width
# Wrong Answer
def widthOfBinaryTree1(self, root):
if root is None:
return 0
if root.left is None and root.right is None:
return 1
def getWidth(width, minW, maxW):
if minW == maxW:
return max(width, 1)
return max(width, maxW - minW + 1)
width, curDepth, minW, maxW, q = 0, 0, 0, 0, [(0, 1, root)]
while q:
depth, pos, node = q.pop(0)
print(depth, pos, node.val)
if curDepth != depth:
width = getWidth(width, minW, maxW)
curDepth, minW, maxW = depth, pos, pos
else:
maxW = pos
if node.left:
q.append((depth + 1, pos * 2, node.left))
if node.right:
q.append((depth + 1, pos * 2 + 1, node.right))
width = getWidth(width, minW, maxW)
return width
# runtime; 40ms, 100.00%
# memory; 13MB, 100.00%
def widthOfBinaryTree(self, root):
if root is None:
return 0
nodesDict, prevDepth, q = {}, -1, [(0, 1, root)]
while q:
depth, pos, node = q.pop(0)
if prevDepth != depth:
prevDepth = depth
nodesDict[depth] = [pos, pos]
else:
nodesDict[depth][1] = pos
if node.left:
q.append((depth + 1, pos * 2, node.left))
if node.right:
q.append((depth + 1, pos * 2 + 1, node.right))
print(nodesDict)
return max([maxPos - minPos + 1 for minPos, maxPos in nodesDict.values()])
s = Solution()
root1 = TreeNode(1)
root1.left = TreeNode(3)
root1.right = TreeNode(2)
root1.left.left = TreeNode(5)
root1.left.right = TreeNode(3)
root1.right.right = TreeNode(9)
root2 = TreeNode(1)
root2.left = TreeNode(3)
root2.left.left = TreeNode(5)
root2.left.right = TreeNode(3)
root3 = TreeNode(1)
root3.left = TreeNode(3)
root3.right = TreeNode(2)
root3.left.left = TreeNode(5)
root4 = TreeNode(1)
root4.left = TreeNode(1)
root4.right = TreeNode(1)
root4.left.left = TreeNode(1)
root4.right.right = TreeNode(1)
root4.left.left.left = TreeNode(1)
root4.right.right.right = TreeNode(1)
root5 = TreeNode(1)
root6 = TreeNode(1)
root6.left = TreeNode(2)
root7 = TreeNode(1)
root7.left = TreeNode(3)
root7.right = TreeNode(2)
root7.left.left = TreeNode(5)
data = [(root1, 4),
(root2, 2),
(root3, 2),
(root4, 8),
(root5, 1),
(root6, 1),
(root7, 2),
]
for root, expected in data:
real = s.widthOfBinaryTree(root)
print('{}, expected {}, real {}, result {}'.format(root, expected, real, expected == real))
| [
"[email protected]"
]
| |
e3f4e1bc264e4e9e928ef3ebb533de57033f0c84 | 600df3590cce1fe49b9a96e9ca5b5242884a2a70 | /tools/perf/measurements/power.py | 58551ae3207e2de8e876bea951fc32323d5b63c9 | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-only",
"Apache-2.0",
"LicenseRef-scancode-unknown",
"MIT"
]
| permissive | metux/chromium-suckless | efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a | 72a05af97787001756bae2511b7985e61498c965 | refs/heads/orig | 2022-12-04T23:53:58.681218 | 2017-04-30T10:59:06 | 2017-04-30T23:35:58 | 89,884,931 | 5 | 3 | BSD-3-Clause | 2022-11-23T20:52:53 | 2017-05-01T00:09:08 | null | UTF-8 | Python | false | false | 1,961 | py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
from metrics import network
from metrics import power
from telemetry.core import util
from telemetry.page import legacy_page_test
class Power(legacy_page_test.LegacyPageTest):
"""Measures power draw and idle wakeups during the page's interactions."""
def __init__(self):
super(Power, self).__init__()
self._power_metric = None
self._network_metric = None
def WillStartBrowser(self, platform):
self._power_metric = power.PowerMetric(platform)
self._network_metric = network.NetworkMetric(platform)
def WillNavigateToPage(self, page, tab):
self._network_metric.Start(page, tab)
def DidNavigateToPage(self, page, tab):
self._power_metric.Start(page, tab)
def ValidateAndMeasurePage(self, page, tab, results):
self._network_metric.Stop(page, tab)
self._power_metric.Stop(page, tab)
self._network_metric.AddResults(tab, results)
self._power_metric.AddResults(tab, results)
def DidRunPage(self, platform):
del platform # unused
self._power_metric.Close()
class LoadPower(Power):
def WillNavigateToPage(self, page, tab):
self._network_metric.Start(page, tab)
self._power_metric.Start(page, tab)
def DidNavigateToPage(self, page, tab):
pass
class QuiescentPower(legacy_page_test.LegacyPageTest):
"""Measures power draw and idle wakeups after the page finished loading."""
# Amount of time to measure, in seconds.
SAMPLE_TIME = 30
def ValidateAndMeasurePage(self, page, tab, results):
if not tab.browser.platform.CanMonitorPower():
return
util.WaitFor(tab.HasReachedQuiescence, 60)
metric = power.PowerMetric(tab.browser.platform)
metric.Start(page, tab)
time.sleep(QuiescentPower.SAMPLE_TIME)
metric.Stop(page, tab)
metric.AddResults(tab, results)
| [
"[email protected]"
]
| |
c144c9ebf7ac40827af104a5950dc340e65e4004 | 83d947dd8683ed447b6bdb9d15683109ca0195bc | /git_sew/ui/cli/containers/App.py | b38e83e444cd4ff51285d171725911c2c7266b75 | [
"MIT"
]
| permissive | fcurella/git-sew | dda6b84a3b522bb1fc5982bfa610b174159cb691 | 920bc26125a127e257be3e37a9bf10cb90aa5368 | refs/heads/master | 2020-07-23T14:51:39.476225 | 2019-09-09T22:56:11 | 2019-09-10T15:45:11 | 207,599,791 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 475 | py | import urwid
from urwid_pydux import ConnectedComponent
from git_sew.ui.cli.components.gitlogs import Footer, Loading
class App(ConnectedComponent):
def map_state_to_props(self, state, own_props):
return {"body": state["box"]}
def render_component(self, props):
if props["body"] is None:
body = Loading()
else:
body = props["body"]
return urwid.Padding(urwid.Frame(body, footer=Footer()), left=2, right=2)
| [
"[email protected]"
]
| |
ce3a31a37fad7413fec2ae08f830708f46ff664b | acb8e84e3b9c987fcab341f799f41d5a5ec4d587 | /langs/3/iju.py | 64d6a1b3ccf14cabc615879040affc0ee38aa5ae | []
| no_license | G4te-Keep3r/HowdyHackers | 46bfad63eafe5ac515da363e1c75fa6f4b9bca32 | fb6d391aaecb60ab5c4650d4ae2ddd599fd85db2 | refs/heads/master | 2020-08-01T12:08:10.782018 | 2016-11-13T20:45:50 | 2016-11-13T20:45:50 | 73,624,224 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 486 | py | import sys
def printFunction(lineRemaining):
if lineRemaining[0] == '"' and lineRemaining[-1] == '"':
if len(lineRemaining) > 2:
#data to print
lineRemaining = lineRemaining[1:-1]
print ' '.join(lineRemaining)
else:
print
def main(fileName):
with open(fileName) as f:
for line in f:
data = line.split()
if data[0] == 'iJU':
printFunction(data[1:])
else:
print 'ERROR'
return
if __name__ == '__main__':
main(sys.argv[1]) | [
"[email protected]"
]
| |
17f859589c603a22117367624010559c8063f80b | f6a8d93c0b764f84b9e90eaf4415ab09d8060ec8 | /Functions/orders.py | 7fef95d38a0f0303db054de91a1ee188f9750e62 | []
| no_license | DimoDimchev/SoftUni-Python-Fundamentals | 90c92f6e8128b62954c4f9c32b01ff4fbb405a02 | 970360dd6ffd54b852946a37d81b5b16248871ec | refs/heads/main | 2023-03-18T17:44:11.856197 | 2021-03-06T12:00:32 | 2021-03-06T12:00:32 | 329,729,960 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 478 | py | def order(product, times_ordered):
final_price = 0
for i in range (times_ordered):
if product == "coffee":
final_price += 1.50
elif product == "water":
final_price += 1.00
elif product == "coke":
final_price += 1.40
elif product == "snacks":
final_price += 2.00
return final_price
product_input = input()
number = int(input())
print('{0:.2f}'.format(order(product_input, number)))
| [
"[email protected]"
]
| |
3f5447789a83847dcf555f556eaf2067a532731c | c06c2c4e084dad8191cbb6fb02227f7b05ba86e7 | /chat/extras/output/output_adapter.py | 33c6cd8c7c3458943de637f070c279efad3b0687 | []
| no_license | thiagorocha06/chatbot | 053c525d0c6d037570851411618f3cb1186b32b4 | 2d22a355926c50d9b389d3db883f435950b47a77 | refs/heads/master | 2020-03-24T14:31:59.134462 | 2018-07-29T14:42:55 | 2018-07-29T14:42:55 | 142,770,645 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 660 | py | from chat.extras.adapters import Adapter
class OutputAdapter(Adapter):
"""
A generic class that can be overridden by a subclass to provide extended
functionality, such as delivering a response to an API endpoint.
"""
def process_response(self, statement, session_id=None):
"""
Override this method in a subclass to implement customized functionality.
:param statement: The statement that the chat bot has produced in response to some input.
:param session_id: The unique id of the current chat session.
:returns: The response statement.
"""
return statement
| [
"[email protected]"
]
| |
e2c63fd44222cfa6dd178d152e811377be48d2ef | 25873da962b0acdcf2c46b60695866d29008c11d | /test/programrtest/aiml_tests/learn_tests/test_learn_aiml.py | face1b7f8aacdcafc02f4548da2466da762b9c4a | []
| no_license | LombeC/program-r | 79f81fa82a617f053ccde1115af3344369b1cfa5 | a7eb6820696a2e5314d29f8d82aaad45a0dc0362 | refs/heads/master | 2022-12-01T14:40:40.208360 | 2020-08-10T21:10:30 | 2020-08-10T21:10:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,303 | py | import unittest
import os
from programr.context import ClientContext
from programrtest.aiml_tests.client import TestClient
class LearnTestClient(TestClient):
def __init__(self):
TestClient.__init__(self)
def load_configuration(self, arguments):
super(LearnTestClient, self).load_configuration(arguments)
self.configuration.client_configuration.brain_config[0].brain_config[0].files.aiml_files._files = [os.path.dirname(__file__)]
class LearnAIMLTests(unittest.TestCase):
def setUp(self):
client = LearnTestClient()
self._client_context = client.create_client_context("testid")
def test_learn(self):
response = self._client_context.bot.ask_question(self._client_context, "MY NAME IS FRED")
self.assertIsNotNone(response)
self.assertEqual(response, "OK, I will remember your name is FRED")
response = self._client_context.bot.ask_question(self._client_context, "WHAT IS MY NAME")
self.assertIsNotNone(response)
self.assertEqual(response, "YOUR NAME IS FRED")
def test_learn_x_is_y(self):
response = self._client_context.bot.ask_question(self._client_context, "LEARN THE SUN IS HOT")
self.assertIsNotNone(response)
self.assertEqual(response, "OK, I will remember THE SUN is HOT")
response = self._client_context.bot.ask_question(self._client_context, "LEARN THE SKY IS BLUE")
self.assertIsNotNone(response)
self.assertEqual(response, "OK, I will remember THE SKY is BLUE")
response = self._client_context.bot.ask_question(self._client_context, "LEARN THE MOON IS GREY")
self.assertIsNotNone(response)
self.assertEqual(response, "OK, I will remember THE MOON is GREY")
response = self._client_context.bot.ask_question(self._client_context, "WHAT IS THE SUN")
self.assertIsNotNone(response)
self.assertEqual(response, "HOT")
response = self._client_context.bot.ask_question(self._client_context, "WHAT IS THE SKY")
self.assertIsNotNone(response)
self.assertEqual(response, "BLUE")
response = self._client_context.bot.ask_question(self._client_context, "WHAT IS THE MOON")
self.assertIsNotNone(response)
self.assertEqual(response, "GREY")
| [
"[email protected]"
]
| |
39fe66b6f1dcefaec65de082d6af8a0c15789557 | e77a7cc1ed343a85662f0ad3c448a350ab776261 | /data_structures/array/number_of_1_in_sorted_array.py | 79689872fbb5d35fdec0a24168779d5ce80f4454 | [
"MIT"
]
| permissive | M4cs/python-ds | 9dcecab10291be6a274130c42450319dc112ac46 | 434c127ea4c49eb8d6bf65c71ff6ee10361d994e | refs/heads/master | 2020-08-10T03:40:22.340529 | 2019-10-10T17:52:28 | 2019-10-10T17:52:28 | 214,247,733 | 2 | 0 | MIT | 2019-10-10T17:43:31 | 2019-10-10T17:43:30 | null | UTF-8 | Python | false | false | 390 | py | # The array is sorted in decreasing order
def count(arr):
start = 0
end = len(arr) - 1
while start <= end:
mid = (start + end) // 2
if arr[mid] == 1 and (arr[mid + 1] == 0 or mid == high):
return mid + 1
if arr[mid] == 1:
start = mid + 1
else:
end = mid - 1
return 0
arr = [0,0,0,0]
print(count(arr))
| [
"[email protected]"
]
| |
37c6df9686c851389868af110179898a2a55def7 | 8775aac665c4011cc743d737c12342e1b08d8f41 | /config/hosts.py | 3766ccf2d2f934ea128736f30b19f3dc8166cf79 | []
| no_license | kongp3/sys_deploy | 734dfa3815c93305eca77f5d3f9488968c90ef6f | 8cd750c4df3f3f64515e3b0051038569d6e8bce2 | refs/heads/master | 2020-04-09T06:53:01.340569 | 2018-12-03T04:13:22 | 2018-12-03T04:13:22 | 160,131,093 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 176 | py | # -*- coding: utf-8 -*-
from config import *
SERVER_HOSTS = [
SERVER1_USER + '@' + SERVER1_IP,
SERVER2_USER + '@' + SERVER2_IP,
SERVER3_USER + '@' + SERVER3_IP,
]
| [
"kongp3@outlook"
]
| kongp3@outlook |
37423e07b41d1f3ab5e6bb839b8d4732d4a9d304 | 7fd0c4608e32c53fea935ac63cacf66e1a0c971d | /Canonical_Monojet/VectorModel/DMsimp_s_spin1_1750_500_800/parameters.py | 91afdccfe54a967aad9a343a3a55bf02e074ce3e | []
| no_license | Quantumapple/MadGraph5_cards | 285f8a303b04b9745abfc83f5ea4fb06a2922fc9 | 3db368ada01f59bace11b48eab2f58ab40ba29f2 | refs/heads/master | 2020-05-02T20:43:23.791641 | 2020-01-17T16:10:46 | 2020-01-17T16:10:46 | 178,199,838 | 0 | 2 | null | null | null | null | UTF-8 | Python | false | false | 18,298 | py | # This file was automatically created by FeynRules 2.3.7
# Mathematica version: 9.0 for Linux x86 (64-bit) (November 20, 2012)
# Date: Mon 24 Aug 2015 13:37:17
from object_library import all_parameters, Parameter
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
# This is a default parameter object representing 0.
ZERO = Parameter(name = 'ZERO',
nature = 'internal',
type = 'real',
value = '0.0',
texname = '0')
# This is a default parameter object representing the renormalization scale (MU_R).
MU_R = Parameter(name = 'MU_R',
nature = 'external',
type = 'real',
value = 91.188,
texname = '\\text{\\mu_r}',
lhablock = 'LOOP',
lhacode = [1])
# User-defined parameters.
cabi = Parameter(name = 'cabi',
nature = 'external',
type = 'real',
value = 0.227736,
texname = '\\theta _c',
lhablock = 'CKMBLOCK',
lhacode = [ 1 ])
gVXc = Parameter(name = 'gVXc',
nature = 'external',
type = 'real',
value = 0.,
texname = 'g_{\\text{VXc}}',
lhablock = 'DMINPUTS',
lhacode = [ 1 ])
gVXd = Parameter(name = 'gVXd',
nature = 'external',
type = 'real',
value = 0.9999999,
texname = 'g_{\\text{VXd}}',
lhablock = 'DMINPUTS',
lhacode = [ 2 ])
gAXd = Parameter(name = 'gAXd',
nature = 'external',
type = 'real',
value = 1e-99,
texname = 'g_{\\text{AXd}}',
lhablock = 'DMINPUTS',
lhacode = [ 3 ])
gVd11 = Parameter(name = 'gVd11',
nature = 'external',
type = 'real',
value = 0.25,
texname = 'g_{\\text{Vd11}}',
lhablock = 'DMINPUTS',
lhacode = [ 4 ])
gVu11 = Parameter(name = 'gVu11',
nature = 'external',
type = 'real',
value = 0.25,
texname = 'g_{\\text{Vu11}}',
lhablock = 'DMINPUTS',
lhacode = [ 5 ])
gVd22 = Parameter(name = 'gVd22',
nature = 'external',
type = 'real',
value = 0.25,
texname = 'g_{\\text{Vd22}}',
lhablock = 'DMINPUTS',
lhacode = [ 6 ])
gVu22 = Parameter(name = 'gVu22',
nature = 'external',
type = 'real',
value = 0.25,
texname = 'g_{\\text{Vu22}}',
lhablock = 'DMINPUTS',
lhacode = [ 7 ])
gVd33 = Parameter(name = 'gVd33',
nature = 'external',
type = 'real',
value = 0.25,
texname = 'g_{\\text{Vd33}}',
lhablock = 'DMINPUTS',
lhacode = [ 8 ])
gVu33 = Parameter(name = 'gVu33',
nature = 'external',
type = 'real',
value = 0.25,
texname = 'g_{\\text{Vu33}}',
lhablock = 'DMINPUTS',
lhacode = [ 9 ])
gAd11 = Parameter(name = 'gAd11',
nature = 'external',
type = 'real',
value = 1e-99,
texname = 'g_{\\text{Ad11}}',
lhablock = 'DMINPUTS',
lhacode = [ 10 ])
gAu11 = Parameter(name = 'gAu11',
nature = 'external',
type = 'real',
value = 1e-99,
texname = 'g_{\\text{Au11}}',
lhablock = 'DMINPUTS',
lhacode = [ 11 ])
gAd22 = Parameter(name = 'gAd22',
nature = 'external',
type = 'real',
value = 1e-99,
texname = 'g_{\\text{Ad22}}',
lhablock = 'DMINPUTS',
lhacode = [ 12 ])
gAu22 = Parameter(name = 'gAu22',
nature = 'external',
type = 'real',
value = 1e-99,
texname = 'g_{\\text{Au22}}',
lhablock = 'DMINPUTS',
lhacode = [ 13 ])
gAd33 = Parameter(name = 'gAd33',
nature = 'external',
type = 'real',
value = 1e-99,
texname = 'g_{\\text{Ad33}}',
lhablock = 'DMINPUTS',
lhacode = [ 14 ])
gAu33 = Parameter(name = 'gAu33',
nature = 'external',
type = 'real',
value = 1e-99,
texname = 'g_{\\text{Au33}}',
lhablock = 'DMINPUTS',
lhacode = [ 15 ])
gVh = Parameter(name = 'gVh',
nature = 'external',
type = 'real',
value = 0.,
texname = 'g_{\\text{Vh}}',
lhablock = 'DMINPUTS',
lhacode = [ 16 ])
aEWM1 = Parameter(name = 'aEWM1',
nature = 'external',
type = 'real',
value = 127.9,
texname = '\\text{aEWM1}',
lhablock = 'SMINPUTS',
lhacode = [ 1 ])
Gf = Parameter(name = 'Gf',
nature = 'external',
type = 'real',
value = 0.0000116637,
texname = 'G_f',
lhablock = 'SMINPUTS',
lhacode = [ 2 ])
aS = Parameter(name = 'aS',
nature = 'external',
type = 'real',
value = 0.1184,
texname = '\\alpha _s',
lhablock = 'SMINPUTS',
lhacode = [ 3 ])
ymt = Parameter(name = 'ymt',
nature = 'external',
type = 'real',
value = 172,
texname = '\\text{ymt}',
lhablock = 'YUKAWA',
lhacode = [ 6 ])
ymtau = Parameter(name = 'ymtau',
nature = 'external',
type = 'real',
value = 1.777,
texname = '\\text{ymtau}',
lhablock = 'YUKAWA',
lhacode = [ 15 ])
MZ = Parameter(name = 'MZ',
nature = 'external',
type = 'real',
value = 91.1876,
texname = '\\text{MZ}',
lhablock = 'MASS',
lhacode = [ 23 ])
MTA = Parameter(name = 'MTA',
nature = 'external',
type = 'real',
value = 1.777,
texname = '\\text{MTA}',
lhablock = 'MASS',
lhacode = [ 15 ])
MT = Parameter(name = 'MT',
nature = 'external',
type = 'real',
value = 172,
texname = '\\text{MT}',
lhablock = 'MASS',
lhacode = [ 6 ])
MH = Parameter(name = 'MH',
nature = 'external',
type = 'real',
value = 125,
texname = '\\text{MH}',
lhablock = 'MASS',
lhacode = [ 25 ])
MXr = Parameter(name = 'MXr',
nature = 'external',
type = 'real',
value = 10.,
texname = '\\text{MXr}',
lhablock = 'MASS',
lhacode = [ 5000001 ])
MXc = Parameter(name = 'MXc',
nature = 'external',
type = 'real',
value = 10.,
texname = '\\text{MXc}',
lhablock = 'MASS',
lhacode = [ 51 ])
MXd = Parameter(name = 'MXd',
nature = 'external',
type = 'real',
value = 500.0,
texname = '\\text{MXd}',
lhablock = 'MASS',
lhacode = [ 18 ])
MY1 = Parameter(name = 'MY1',
nature = 'external',
type = 'real',
value = 1750,
texname = '\\text{MY1}',
lhablock = 'MASS',
lhacode = [ 55 ])
WZ = Parameter(name = 'WZ',
nature = 'external',
type = 'real',
value = 2.4952,
texname = '\\text{WZ}',
lhablock = 'DECAY',
lhacode = [ 23 ])
WW = Parameter(name = 'WW',
nature = 'external',
type = 'real',
value = 2.085,
texname = '\\text{WW}',
lhablock = 'DECAY',
lhacode = [ 24 ])
WT = Parameter(name = 'WT',
nature = 'external',
type = 'real',
value = 1.50833649,
texname = '\\text{WT}',
lhablock = 'DECAY',
lhacode = [ 6 ])
WH = Parameter(name = 'WH',
nature = 'external',
type = 'real',
value = 0.00407,
texname = '\\text{WH}',
lhablock = 'DECAY',
lhacode = [ 25 ])
#WY1 = Parameter(name = 'WY1',
# nature = 'external',
# type = 'real',
# value = 10.,
# texname = '\\text{WY1}',
# lhablock = 'DECAY',
# lhacode = [ 55 ])
CKM1x1 = Parameter(name = 'CKM1x1',
nature = 'internal',
type = 'complex',
value = 'cmath.cos(cabi)',
texname = '\\text{CKM1x1}')
CKM1x2 = Parameter(name = 'CKM1x2',
nature = 'internal',
type = 'complex',
value = 'cmath.sin(cabi)',
texname = '\\text{CKM1x2}')
CKM2x1 = Parameter(name = 'CKM2x1',
nature = 'internal',
type = 'complex',
value = '-cmath.sin(cabi)',
texname = '\\text{CKM2x1}')
CKM2x2 = Parameter(name = 'CKM2x2',
nature = 'internal',
type = 'complex',
value = 'cmath.cos(cabi)',
texname = '\\text{CKM2x2}')
aEW = Parameter(name = 'aEW',
nature = 'internal',
type = 'real',
value = '1/aEWM1',
texname = '\\alpha _{\\text{EW}}')
G = Parameter(name = 'G',
nature = 'internal',
type = 'real',
value = '2*cmath.sqrt(aS)*cmath.sqrt(cmath.pi)',
texname = 'G')
MW = Parameter(name = 'MW',
nature = 'internal',
type = 'real',
value = 'cmath.sqrt(MZ**2/2. + cmath.sqrt(MZ**4/4. - (aEW*cmath.pi*MZ**2)/(Gf*cmath.sqrt(2))))',
texname = 'M_W')
ee = Parameter(name = 'ee',
nature = 'internal',
type = 'real',
value = '2*cmath.sqrt(aEW)*cmath.sqrt(cmath.pi)',
texname = 'e')
sw2 = Parameter(name = 'sw2',
nature = 'internal',
type = 'real',
value = '1 - MW**2/MZ**2',
texname = '\\text{sw2}')
cw = Parameter(name = 'cw',
nature = 'internal',
type = 'real',
value = 'cmath.sqrt(1 - sw2)',
texname = 'c_w')
sw = Parameter(name = 'sw',
nature = 'internal',
type = 'real',
value = 'cmath.sqrt(sw2)',
texname = 's_w')
g1 = Parameter(name = 'g1',
nature = 'internal',
type = 'real',
value = 'ee/cw',
texname = 'g_1')
gw = Parameter(name = 'gw',
nature = 'internal',
type = 'real',
value = 'ee/sw',
texname = 'g_w')
vev = Parameter(name = 'vev',
nature = 'internal',
type = 'real',
value = '(2*MW*sw)/ee',
texname = '\\text{vev}')
lam = Parameter(name = 'lam',
nature = 'internal',
type = 'real',
value = 'MH**2/(2.*vev**2)',
texname = '\\text{lam}')
yt = Parameter(name = 'yt',
nature = 'internal',
type = 'real',
value = '(ymt*cmath.sqrt(2))/vev',
texname = '\\text{yt}')
ytau = Parameter(name = 'ytau',
nature = 'internal',
type = 'real',
value = '(ymtau*cmath.sqrt(2))/vev',
texname = '\\text{ytau}')
muH = Parameter(name = 'muH',
nature = 'internal',
type = 'real',
value = 'cmath.sqrt(lam*vev**2)',
texname = '\\mu')
I2a33 = Parameter(name = 'I2a33',
nature = 'internal',
type = 'complex',
value = 'yt',
texname = '\\text{I2a33}')
I3a33 = Parameter(name = 'I3a33',
nature = 'internal',
type = 'complex',
value = 'yt',
texname = '\\text{I3a33}')
MFU = Parameter(name = 'MFU',
nature = 'internal',
type = 'real',
value = '0.002550',
texname = '\\text{MFU}')
MFC = Parameter(name = 'MFC',
nature = 'internal',
type = 'real',
value = '1.27',
texname = '\\text{MFC}')
MFD = Parameter(name = 'MFD',
nature = 'internal',
type = 'real',
value = '0.00504',
texname = '\\text{MFD}')
MFS = Parameter(name = 'MFS',
nature = 'internal',
type = 'real',
value = '0.101',
texname = '\\text{MFS}')
MFB = Parameter(name = 'MFB',
nature = 'internal',
type = 'real',
value = '4.7',
texname = '\\text{MFB}')
# vector, 1411.0535
WVuu = Parameter(name = 'WVuu',
nature = 'internal',
type = 'real',
value = '((gVd11**2)*(MY1**2 + 2*MFU**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFU**2/MY1**2))',
texname = '\\text{WVuu}')
WVcc = Parameter(name = 'WVcc',
nature = 'internal',
type = 'real',
value = '((gVd22**2)*(MY1**2 + 2*MFC**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFC**2/MY1**2))',
texname = '\\text{WVcc}')
WVtt = Parameter(name = 'WVtt',
nature = 'internal',
type = 'real',
value = '((gVd33**2)*(MY1**2 + 2*MT**2)/(12*MY1*cmath.pi))*cmath.sqrt(max(1-(4*MT**2/MY1**2),0.01))',
texname = '\\text{WVtt}')
WVdd = Parameter(name = 'WVdd',
nature = 'internal',
type = 'real',
value = '((gVd11**2)*(MY1**2 + 2*MFD**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFD**2/MY1**2))',
texname = '\\text{WVdd}')
WVss = Parameter(name = 'WVss',
nature = 'internal',
type = 'real',
value = '((gVd22**2)*(MY1**2 + 2*MFS**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFS**2/MY1**2))',
texname = '\\text{WVss}')
WVbb = Parameter(name = 'WVbb',
nature = 'internal',
type = 'real',
value = '((gVd33**2)*(MY1**2 + 2*MFB**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFB**2/MY1**2))',
texname = '\\text{WVbb}')
WVDM = Parameter(name = 'WVDM',
nature = 'internal',
type = 'real',
value = '((gVXd**2)*(MY1**2 + 2*MXd**2)/(12*MY1*cmath.pi))*cmath.sqrt(max(1-(4*MXd**2/MY1**2),0.01))',
texname = '\\text{WVDM}')
# axial, 1411.0535
WAuu = Parameter(name = 'WAuu',
nature = 'internal',
type = 'real',
value = '((gAd11**2)*(MY1**2 - 4*MFU**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFU**2/MY1**2))',
texname = '\\text{WAuu}')
WAcc = Parameter(name = 'WAcc',
nature = 'internal',
type = 'real',
value = '((gAd22**2)*(MY1**2 - 4*MFC**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFC**2/MY1**2))',
texname = '\\text{WAcc}')
WAtt = Parameter(name = 'WAtt',
nature = 'internal',
type = 'real',
value = '((gAd33**2)*(MY1**2 - 4*MT**2)/(12*MY1*cmath.pi))*cmath.sqrt(max(1-(4*MT**2/MY1**2),0.01))',
texname = '\\text{WAtt}')
WAdd = Parameter(name = 'WAdd',
nature = 'internal',
type = 'real',
value = '((gAd11**2)*(MY1**2 - 4*MFD**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFD**2/MY1**2))',
texname = '\\text{WAdd}')
WAss= Parameter(name = 'WAss',
nature = 'internal',
type = 'real',
value = '((gAd22**2)*(MY1**2 - 4*MFS**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFS**2/MY1**2))',
texname = '\\text{WAss}')
WAbb= Parameter(name = 'WAbb',
nature = 'internal',
type = 'real',
value = '((gAd33**2)*(MY1**2 - 4*MFB**2)/(12*MY1*cmath.pi))*cmath.sqrt(1-(4*MFB**2/MY1**2))',
texname = '\\text{WAbb}')
WADM = Parameter(name = 'WADM',
nature = 'internal',
type = 'real',
value = '((gAXd**2)*(MY1**2 - 4*MXd**2)/(12*MY1*cmath.pi))*cmath.sqrt(max(1-(4*MXd**2/MY1**2),0.01))',
texname = '\\text{WADM}')
sumY1 = Parameter(name = 'sumY1',
nature = 'internal',
type = 'real',
value = 'WVDM + WADM + 3*(WVuu+WVcc+WVtt+WVdd+WVss+WVbb+WAuu+WAcc+WAtt+WAdd+WAss+WAbb)',
texname = '\\text{sumZpV}')
WY1 = Parameter(name = 'WY1',
nature = 'internal',
type = 'real',
value = 'sumY1',
texname = '\\text{WY1}',
lhablock = 'DECAY',
lhacode = [ 55 ])
| [
"[email protected]"
]
| |
7b57c6b8f00aee7146f0fe59c37715e1d98abd23 | 360558c34098ef95077e70a318cda7cb3895c6d9 | /tests/test_observable/test_windowwithtimeorcount.py | 266b08416b4ddd813c1b2536d83e66bbad25aa6f | [
"Apache-2.0"
]
| permissive | AlexMost/RxPY | 8bcccf04fb5a0bab171aaec897e909ab8098b117 | 05cb14c72806dc41e243789c05f498dede11cebd | refs/heads/master | 2021-01-15T07:53:20.515781 | 2016-03-04T04:53:10 | 2016-03-04T04:53:10 | 53,108,280 | 0 | 1 | null | 2016-03-04T04:50:00 | 2016-03-04T04:49:59 | null | UTF-8 | Python | false | false | 3,316 | py | import unittest
from datetime import timedelta
from rx import Observable
from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable
from rx.disposables import Disposable, SerialDisposable
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest.disposed
created = ReactiveTest.created
class TestWindowWithTime(unittest.TestCase):
def test_window_with_time_or_count_basic(self):
scheduler = TestScheduler()
xs = scheduler.create_hot_observable(on_next(205, 1), on_next(210, 2), on_next(240, 3), on_next(280, 4), on_next(320, 5), on_next(350, 6), on_next(370, 7), on_next(420, 8), on_next(470, 9), on_completed(600))
def create():
def projection(w, i):
def inner_proj(x):
return "%s %s" % (i, x)
return w.map(inner_proj)
return xs.window_with_time_or_count(70, 3, scheduler).map(projection).merge_observable()
results = scheduler.start(create)
results.messages.assert_equal(on_next(205, "0 1"), on_next(210, "0 2"), on_next(240, "0 3"), on_next(280, "1 4"), on_next(320, "2 5"), on_next(350, "2 6"), on_next(370, "2 7"), on_next(420, "3 8"), on_next(470, "4 9"), on_completed(600))
xs.subscriptions.assert_equal(subscribe(200, 600))
def test_window_with_time_or_count_error(self):
ex = 'ex'
scheduler = TestScheduler()
xs = scheduler.create_hot_observable(on_next(205, 1), on_next(210, 2), on_next(240, 3), on_next(280, 4), on_next(320, 5), on_next(350, 6), on_next(370, 7), on_next(420, 8), on_next(470, 9), on_error(600, ex))
def create():
def projection(w, i):
def inner_proj(x):
return "%s %s" % (i, x)
return w.map(inner_proj)
return xs.window_with_time_or_count(70, 3, scheduler).map(projection).merge_observable()
results = scheduler.start(create)
results.messages.assert_equal(on_next(205, "0 1"), on_next(210, "0 2"), on_next(240, "0 3"), on_next(280, "1 4"), on_next(320, "2 5"), on_next(350, "2 6"), on_next(370, "2 7"), on_next(420, "3 8"), on_next(470, "4 9"), on_error(600, ex))
xs.subscriptions.assert_equal(subscribe(200, 600))
def test_window_with_time_or_count_disposed(self):
scheduler = TestScheduler()
xs = scheduler.create_hot_observable(on_next(205, 1), on_next(210, 2), on_next(240, 3), on_next(280, 4), on_next(320, 5), on_next(350, 6), on_next(370, 7), on_next(420, 8), on_next(470, 9), on_completed(600))
def create():
def projection(w, i):
def inner_proj(x):
return "%s %s" % (i, x)
return w.map(inner_proj)
return xs.window_with_time_or_count(70, 3, scheduler).map(projection).merge_observable()
results = scheduler.start(create, disposed=370)
results.messages.assert_equal(on_next(205, "0 1"), on_next(210, "0 2"), on_next(240, "0 3"), on_next(280, "1 4"), on_next(320, "2 5"), on_next(350, "2 6"), on_next(370, "2 7"))
xs.subscriptions.assert_equal(subscribe(200, 370))
| [
"[email protected]"
]
| |
f12ce4028eef8a875d3961103e02377c34e07746 | 7a1a65b0cda41ea204fad4848934db143ebf199a | /automatedprocesses_firststage/adsym_core_last60_test.py | c36727a8b0dc54c680f0dc9be9f8cf1ac23510a5 | []
| no_license | bpopovich44/ReaperSec | 4b015e448ed5ce23316bd9b9e33966373daea9c0 | 22acba4d84313e62dbbf95cf2a5465283a6491b0 | refs/heads/master | 2021-05-02T18:26:11.875122 | 2019-06-22T15:02:09 | 2019-06-22T15:02:09 | 120,664,056 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,164 | py | #!/usr/bin/python2.7
import json
from mysql.connector import MySQLConnection, Error
from python_dbconfig import read_db_config
import aol_api_R_test
def connect():
# """Gets AOL Data and writes them to a MySQL table"""
db = "mysql_sl"
api = "adsym"
# Connect To DB:
db_config = read_db_config(db)
try:
print('Connecting to database...')
conn = MySQLConnection(**db_config)
if conn.is_connected():
print('connection established.')
cursor = conn.cursor()
sql = "DROP TABLE IF EXISTS adsym_core_last60"
cursor.execute(sql)
sql = "CREATE TABLE adsym_core_last60 (date varchar(50), inventory_source varchar(255), ad_opportunities bigint, \
market_opportunities bigint, ad_attempts bigint, ad_impressions bigint, ad_errors bigint, ad_revenue decimal(15, 5), \
aol_cost decimal(15, 5), epiphany_gross_revenue decimal(15, 5), adsym_revenue decimal(15, 5), total_clicks int, \
iab_viewability_measurable_ad_impressions bigint, iab_viewable_ad_impressions bigint, platform int)"
cursor.execute(sql)
# calls get_access_token function and starts script
logintoken = aol_api_R_test.get_access_token(api)
print(logintoken)
result = aol_api_R_test.run_existing_report(logintoken, "161186")
#print(result)
info = json.loads(result)
#print(info)
for x in json.loads(result)['data']:
date = x['row'][0]
inventory_source = x['row'][1]
ad_opportunities = x['row'][2]
market_opportunities = x['row'][3]
ad_attempts = x['row'][4]
ad_impressions = x['row'][5]
ad_errors = x['row'][6]
ad_revenue = x['row'][7]
aol_cost = x['row'][7]
epiphany_gross_revenue = x['row'][7]
adsym_revenue = x['row'][7]
total_clicks = x['row'][8]
iab_viewability_measurable_ad_impressions = "0"
iab_viewable_ad_impressions = "0"
platform = '4'
list = (date, inventory_source, ad_opportunities, market_opportunities, ad_attempts, ad_impressions, \
ad_errors, ad_revenue, aol_cost, epiphany_gross_revenue, adsym_revenue, total_clicks, \
iab_viewability_measurable_ad_impressions, iab_viewable_ad_impressions, platform)
#print(list)
sql = """INSERT INTO adsym_core_last60 VALUES ("%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s"*.20, "%s"*.56, \
"%s"*.24, "%s", "%s", "%s", "%s")""" % (date, inventory_source, ad_opportunities, market_opportunities, \
ad_attempts, ad_impressions, ad_errors, ad_revenue, aol_cost, epiphany_gross_revenue, adsym_revenue, \
total_clicks, iab_viewability_measurable_ad_impressions, iab_viewable_ad_impressions, platform)
cursor.execute(sql)
cursor.execute('commit')
else:
print('connection failed.')
except Error as error:
print(error)
finally:
conn.close()
print('Connection closed.')
if __name__ == '__main__':
connect()
| [
"[email protected]"
]
| |
88316ac5704d66e90cf23a4f9bf3cc8f3441e3df | 50948d4cb10dcb1cc9bc0355918478fb2841322a | /sdk/cognitiveservices/azure-cognitiveservices-formrecognizer/azure/cognitiveservices/formrecognizer/form_recognizer_client.py | f080824c5befddc8650458e653398bd431232f5c | [
"MIT"
]
| permissive | xiafu-msft/azure-sdk-for-python | de9cd680b39962702b629a8e94726bb4ab261594 | 4d9560cfd519ee60667f3cc2f5295a58c18625db | refs/heads/master | 2023-08-12T20:36:24.284497 | 2019-05-22T00:55:16 | 2019-05-22T00:55:16 | 187,986,993 | 1 | 0 | MIT | 2020-10-02T01:17:02 | 2019-05-22T07:33:46 | Python | UTF-8 | Python | false | false | 17,235 | py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.service_client import SDKClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from msrest.pipeline import ClientRawResponse
from . import models
class FormRecognizerClientConfiguration(Configuration):
"""Configuration for FormRecognizerClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus2.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""
def __init__(
self, endpoint, credentials):
if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
base_url = '{Endpoint}/formrecognizer/v1.0-preview'
super(FormRecognizerClientConfiguration, self).__init__(base_url)
self.add_user_agent('azure-cognitiveservices-formrecognizer/{}'.format(VERSION))
self.endpoint = endpoint
self.credentials = credentials
class FormRecognizerClient(SDKClient):
"""Extracts information from forms and images into structured data based on a model created by a set of representative training forms.
:ivar config: Configuration for client.
:vartype config: FormRecognizerClientConfiguration
:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus2.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""
def __init__(
self, endpoint, credentials):
self.config = FormRecognizerClientConfiguration(endpoint, credentials)
super(FormRecognizerClient, self).__init__(self.config.credentials, self.config)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '1.0-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
def train_custom_model(
self, source, custom_headers=None, raw=False, **operation_config):
"""Train Model.
The train request must include a source parameter that is either an
externally accessible Azure Storage blob container Uri (preferably a
Shared Access Signature Uri) or valid path to a data folder in a
locally mounted drive. When local paths are specified, they must follow
the Linux/Unix path format and be an absolute path rooted to the input
mount configuration
setting value e.g., if '{Mounts:Input}' configuration setting value is
'/input' then a valid source path would be '/input/contosodataset'. All
data to be trained are expected to be under the source. Models are
trained using documents that are of the following content type -
'application/pdf', 'image/jpeg' and 'image/png'."
Other content is ignored when training a model.
:param source: Get or set source path.
:type source: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: TrainResult or ClientRawResponse if raw=true
:rtype: ~azure.cognitiveservices.formrecognizer.models.TrainResult or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.formrecognizer.models.ErrorResponseException>`
"""
train_request = models.TrainRequest(source=source)
# Construct URL
url = self.train_custom_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True)
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if custom_headers:
header_parameters.update(custom_headers)
# Construct body
body_content = self._serialize.body(train_request, 'TrainRequest')
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('TrainResult', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
train_custom_model.metadata = {'url': '/custom/train'}
def get_extracted_keys(
self, id, custom_headers=None, raw=False, **operation_config):
"""Get Keys.
Use the API to retrieve the keys that were
extracted by the specified model.
:param id: Model identifier.
:type id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: KeysResult or ClientRawResponse if raw=true
:rtype: ~azure.cognitiveservices.formrecognizer.models.KeysResult or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.formrecognizer.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_extracted_keys.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'id': self._serialize.url("id", id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('KeysResult', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_extracted_keys.metadata = {'url': '/custom/models/{id}/keys'}
def get_custom_models(
self, custom_headers=None, raw=False, **operation_config):
"""Get Models.
Get information about all trained models.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: ModelsResult or ClientRawResponse if raw=true
:rtype: ~azure.cognitiveservices.formrecognizer.models.ModelsResult or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.formrecognizer.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_custom_models.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True)
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('ModelsResult', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_custom_models.metadata = {'url': '/custom/models'}
def get_custom_model(
self, id, custom_headers=None, raw=False, **operation_config):
"""Get Model.
Get information about a model.
:param id: Model identifier.
:type id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: ModelResult or ClientRawResponse if raw=true
:rtype: ~azure.cognitiveservices.formrecognizer.models.ModelResult or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.formrecognizer.models.ErrorResponseException>`
"""
# Construct URL
url = self.get_custom_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'id': self._serialize.url("id", id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('ModelResult', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
get_custom_model.metadata = {'url': '/custom/models/{id}'}
def delete_custom_model(
self, id, custom_headers=None, raw=False, **operation_config):
"""Delete Model.
Delete model artifacts.
:param id: The identifier of the model to delete.
:type id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.formrecognizer.models.ErrorResponseException>`
"""
# Construct URL
url = self.delete_custom_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'id': self._serialize.url("id", id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
# Construct headers
header_parameters = {}
if custom_headers:
header_parameters.update(custom_headers)
# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [204]:
raise models.ErrorResponseException(self._deserialize, response)
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
delete_custom_model.metadata = {'url': '/custom/models/{id}'}
def analyze_with_custom_model(
self, id, form_stream, keys=None, custom_headers=None, raw=False, **operation_config):
"""Analyze Form.
The document to analyze must be of a supported content type -
'application/pdf', 'image/jpeg' or 'image/png'. The response contains
not just the extracted information of the analyzed form but also
information about content that was not extracted along with a reason.
:param id: Model Identifier to analyze the document with.
:type id: str
:param form_stream: A pdf document or image (jpg,png) file to analyze.
:type form_stream: Generator
:param keys: An optional list of known keys to extract the values for.
:type keys: list[str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: AnalyzeResult or ClientRawResponse if raw=true
:rtype: ~azure.cognitiveservices.formrecognizer.models.AnalyzeResult
or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.formrecognizer.models.ErrorResponseException>`
"""
# Construct URL
url = self.analyze_with_custom_model.metadata['url']
path_format_arguments = {
'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True),
'id': self._serialize.url("id", id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {}
if keys is not None:
query_parameters['keys'] = self._serialize.query("keys", keys, '[str]', div=',')
# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'multipart/form-data'
if custom_headers:
header_parameters.update(custom_headers)
# Construct form data
form_data_content = {
'form_stream': form_stream,
}
# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, form_content=form_data_content)
response = self._client.send(request, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('AnalyzeResult', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
analyze_with_custom_model.metadata = {'url': '/custom/models/{id}/analyze'}
| [
"[email protected]"
]
| |
6e4dd4e629e9a48bb151508f9ec6c2120f4cb676 | ce3964c7195de67e07818b08a43286f7ec9fec3e | /angle_peaks.py | 3f18f3fab246542885ea6329ac9dc15a38b0f1c8 | []
| no_license | zhuligs/physics | 82b601c856f12817c0cfedb17394b7b6ce6b843c | 7cbac1be7904612fd65b66b34edef453aac77973 | refs/heads/master | 2021-05-28T07:39:19.822692 | 2013-06-05T04:53:08 | 2013-06-05T04:53:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,031 | py | #!/usr/bin/env python
"""
Create a data set of nn_dist peak distances vs rs & P, for a given neighbor
"""
import os, sys, commands, glob
# RS is a list of all the names of the rs directories
global RS
RS = commands.getoutput('ls -1 | grep "1\." | grep -v c').split()
def main():
# Open the output file
out = open('angle_EV.dat','w')
out.write('# rs, <angle>, P(GPa)\n')
for rs in RS:
# Get pressure
try:
P = commands.getoutput("tail -2 "+rs+"/analysis/pressure.blocker | head -1 | awk '{print $4}'").strip()
except:
P = '--------'
# Get location of peak
try:
EV = float(commands.getoutput("expectation_value.py "+rs+"/analysis/CO2_angles.dat 1 2").split()[-1])
except:
EV = '--------'
# Write to the output file
if '--' in P or '--' in str(EV):
out.write('#')
out.write(rs+' '+str(EV)+' '+P+'\n')
out.close()
if __name__ == '__main__':
main()
| [
"[email protected]"
]
| |
d0b528903a9a1e72d759138a3f5ab4c43d124a28 | 494b763f2613d4447bc0013100705a0b852523c0 | /cnn/answer/M1_cp32_3_m_d512.py | f18fed9ba897d5083554c7a56ca3c5934c11fd9c | []
| no_license | DL-DeepLearning/Neural-Network | dc4a2dd5efb1b4ef1a3480a1df6896c191ae487f | 3160c4af78dba6bd39552bb19f09a699aaab8e9e | refs/heads/master | 2021-06-17T05:16:22.583816 | 2017-06-07T01:21:39 | 2017-06-07T01:21:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,704 | py | # libraries & packages
import numpy
import math
import sys
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.optimizers import SGD
from keras.utils import np_utils
from os import listdir
from os.path import isfile, join
# this function is provided from the official site
def unpickle(file):
import cPickle
fo = open(file, 'rb')
dict = cPickle.load(fo)
fo.close()
return dict
# from PIL import Image
# def ndarray2image (arr_data, image_fn):
# img = Image.fromarray(arr_data, 'RGB')
# img.save(image_fn)
from scipy.misc import imsave
def ndarray2image (arr_data, image_fn):
imsave(image_fn, arr_data)
# set dataset path
dataset_path = '../cifar_10/'
# define the information of images which can be obtained from official website
height, width, dim = 32, 32, 3
classes = 10
''' read training data '''
# get the file names which start with "data_batch" (training data)
train_fns = [fn for fn in listdir(dataset_path) if isfile(join(dataset_path, fn)) & fn.startswith("data_batch")]
# list sorting
train_fns.sort()
# make a glace about the training data
fn = train_fns[0]
raw_data = unpickle(dataset_path + fn)
# type of raw data
type(raw_data)
# <type 'dict'>
# check keys of training data
raw_data_keys = raw_data.keys()
# output ['data', 'labels', 'batch_label', 'filenames']
# check dimensions of ['data']
raw_data['data'].shape
# (10000, 3072)
# concatenate pixel (px) data into one ndarray [img_px_values]
# concatenate label data into one ndarray [img_lab]
img_px_values = 0
img_lab = 0
for fn in train_fns:
raw_data = unpickle(dataset_path + fn)
if fn == train_fns[0]:
img_px_values = raw_data['data']
img_lab = raw_data['labels']
else:
img_px_values = numpy.vstack((img_px_values, raw_data['data']))
img_lab = numpy.hstack((img_lab, raw_data['labels']))
print img_px_values
print img_lab
c = raw_input("...")
# convert 1d-ndarray (0:3072) to 3d-ndarray(32,32,3)
X_train = numpy.asarray([numpy.dstack((r[0:(width*height)].reshape(height,width),
r[(width*height):(2*width*height)].reshape(height,width),
r[(2*width*height):(3*width*height)].reshape(height,width)
)) for r in img_px_values])
Y_train = np_utils.to_categorical(numpy.array(img_lab), classes)
# check is same or not!
# lab_eql = numpy.array_equal([(numpy.argmax(r)) for r in Y_train], numpy.array(img_lab))
# draw one image from the pixel data
ndarray2image(X_train[0],"test_image.png")
# print the dimension of training data
print 'X_train shape:', X_train.shape
print 'Y_train shape:', Y_train.shape
''' read testing data '''
# get the file names which start with "test_batch" (testing data)
test_fns = [fn for fn in listdir(dataset_path) if isfile(join(dataset_path, fn)) & fn.startswith("test_batch")]
# read testing data
raw_data = unpickle(dataset_path + fn)
# type of raw data
type(raw_data)
# check keys of testing data
raw_data_keys = raw_data.keys()
# ['data', 'labels', 'batch_label', 'filenames']
img_px_values = raw_data['data']
# check dimensions of data
print "dim(data)", numpy.array(img_px_values).shape
# dim(data) (10000, 3072)
img_lab = raw_data['labels']
# check dimensions of labels
print "dim(labels)",numpy.array(img_lab).shape
# dim(data) (10000,)
X_test = numpy.asarray([numpy.dstack((r[0:(width*height)].reshape(height,width),
r[(width*height):(2*width*height)].reshape(height,width),
r[(2*width*height):(3*width*height)].reshape(height,width)
)) for r in img_px_values])
Y_test = np_utils.to_categorical(numpy.array(raw_data['labels']), classes)
# scale image data to range [0, 1]
X_train = X_train.astype('float32')
X_test = X_test.astype('float32')
X_train /= 255.0
X_test /= 255.0
# print the dimension of training data
print 'X_test shape:', X_test.shape
print 'Y_test shape:', Y_test.shape
# normalize inputs from 0-255 to 0.0-1.0
'''CNN model'''
model = Sequential()
model.add(Convolution2D(32, 3, 3, border_mode='same', input_shape=X_train[0].shape))
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.2))
model.add(Flatten())
model.add(Dense(512))
model.add(Activation('relu'))
model.add(Dropout(0.5))
model.add(Dense(classes))
model.add(Activation('softmax'))
'''setting optimizer'''
learning_rate = 0.01
learning_decay = 0.01/32
sgd = SGD(lr=learning_rate, decay=learning_decay, momentum=0.9, nesterov=True)
model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])
# check parameters of every layers
model.summary()
''' training'''
batch_size = 128
epoch = 32
# validation data comes from training data
# model.fit(X_train, Y_train, batch_size=batch_size,
# nb_epoch=epoch, validation_split=0.1, shuffle=True)
# validation data comes from testing data
fit_log = model.fit(X_train, Y_train, batch_size=batch_size,
nb_epoch=epoch, validation_data=(X_test, Y_test), shuffle=True)
'''saving training history'''
import csv
history_fn = 'cp32_3_m_d512.csv'
with open(history_fn, 'wb') as csv_file:
w = csv.writer(csv_file)
temp = numpy.array(fit_log.history.values())
w.writerow(fit_log.history.keys())
for i in range(temp.shape[1]):
w.writerow(temp[:,i])
'''saving model'''
from keras.models import load_model
model.save('cp32_3_m_d512.h5')
del model
'''loading model'''
model = load_model('cp32_3_m_d512.h5')
'''prediction'''
pred = model.predict_classes(X_test, batch_size, verbose=0)
ans = [numpy.argmax(r) for r in Y_test]
# caculate accuracy rate of testing data
acc_rate = sum(pred-ans == 0)/float(pred.shape[0])
print "Accuracy rate:", acc_rate
| [
"[email protected]"
]
| |
88743421203b00b54d21f449bdbbc3fddf47d0a0 | faea85c8583771933ffc9c2807aacb59c7bd96e6 | /python/pencilnew/visu/internal/MinorSymLogLocator.py | 1e83f3c925453c62d8eeb6f112a86c81dcdb0538 | []
| no_license | JosephMouallem/pencil_code | 1dc68377ecdbda3bd3dd56731593ddb9b0e35404 | 624b742369c09d65bc20fdef25d2201cab7f758d | refs/heads/master | 2023-03-25T09:12:02.647416 | 2021-03-22T02:30:54 | 2021-03-22T02:30:54 | 350,038,447 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,328 | py | ##
## symlog tick helper
from matplotlib.ticker import Locator
class MinorSymLogLocator(Locator):
"""
Dynamically find minor tick positions based on the positions of
major ticks for a symlog scaling.
"""
def __init__(self, linthresh):
"""
Ticks will be placed between the major ticks.
The placement is linear for x between -linthresh and linthresh,
otherwise its logarithmically
"""
self.linthresh = linthresh
def __call__(self):
import numpy as np
'Return the locations of the ticks'
majorlocs = self.axis.get_majorticklocs()
majorlocs = np.append(majorlocs, majorlocs[-1]*10.)
majorlocs = np.append(majorlocs[0]*0.1, majorlocs)
# iterate through minor locs
minorlocs = []
# handle the lowest part
for i in xrange(1, len(majorlocs)):
majorstep = majorlocs[i] - majorlocs[i-1]
if abs(majorlocs[i-1] + majorstep/2) < self.linthresh:
ndivs = 10
else:
ndivs = 9
minorstep = majorstep / ndivs
locs = np.arange(majorlocs[i-1], majorlocs[i], minorstep)[1:]
minorlocs.extend(locs)
return self.raise_if_exceeds(np.array(minorlocs))
def tick_values(self, vmin, vmax):
raise NotImplementedError('Cannot get tick locations for a '
'%s type.' % type(self))
| [
"[email protected]"
]
| |
a69df7f43308fc5480efdd170214dcdb43a9bc12 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03288/s994428906.py | 8f675834b3b195d3bece521191e038e01a6a4385 | []
| no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 158 | py | def main():
n = int(input())
if n < 1200:
print("ABC")
elif 1200 <= n < 2800:
print("ARC")
else:
print("AGC")
main() | [
"[email protected]"
]
| |
942bad6052ac0e1168ff2fd57652246ca6e3a2fd | 3416464630bc3322dd677001811de1a6884c7dd0 | /others/q14_longest_common_prefix/__init__.py | 2e8fe4c2d56cc68aee767b789c99e32124d7ef6d | []
| no_license | ttomchy/LeetCodeInAction | f10403189faa9fb21e6a952972d291dc04a01ff8 | 14a56b5eca8d292c823a028b196fe0c780a57e10 | refs/heads/master | 2023-03-29T22:10:04.324056 | 2021-03-25T13:37:01 | 2021-03-25T13:37:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 149 | py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
FileName: __init__.py.py
Description:
Author: Barry Chow
Date: 2020/12/4 10:45 PM
Version: 0.1
""" | [
"[email protected]"
]
| |
9fbd4414790f6c01e7a84591c3d5093412933571 | f07a42f652f46106dee4749277d41c302e2b7406 | /Data Set/bug-fixing-5/1293ec85dd68dfc31183ae9ec654333301103660-<test_distribution_version>-fix.py | fb83f3cec75b577fead88273ad25d671dc08b97c | []
| no_license | wsgan001/PyFPattern | e0fe06341cc5d51b3ad0fe29b84098d140ed54d1 | cc347e32745f99c0cd95e79a18ddacc4574d7faa | refs/heads/main | 2023-08-25T23:48:26.112133 | 2021-10-23T14:11:22 | 2021-10-23T14:11:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 902 | py | @pytest.mark.parametrize('testcase', TESTSETS, ids=(lambda x: x['name']))
def test_distribution_version(testcase):
'tests the distribution parsing code of the Facts class\n\n testsets have\n * a name (for output/debugging only)\n * input files that are faked\n * those should be complete and also include "irrelevant" files that might be mistaken as coming from other distributions\n * all files that are not listed here are assumed to not exist at all\n * the output of pythons platform.dist()\n * results for the ansible variables distribution* and os_family\n '
from ansible.module_utils import basic
args = json.dumps(dict(ANSIBLE_MODULE_ARGS={
}))
with swap_stdin_and_argv(stdin_data=args):
basic._ANSIBLE_ARGS = None
module = basic.AnsibleModule(argument_spec=dict())
_test_one_distribution(facts, module, testcase) | [
"[email protected]"
]
| |
c7097703377e37843c47abd796ec4f333f4d2e77 | fde31c14f7a31bc98221e3959748748c32bfc7ad | /stock/tests.py | 6c296e822db3a61d931e039b2f4a94f5f04f77dd | []
| no_license | schoolofnetcom/django-avancado | d557d05a96db6bc8471fec6cfc1bc80b78ea2266 | 0a9e0c92c437928caf3e647b7d9a35a0633d1ff2 | refs/heads/master | 2021-05-04T19:47:14.636565 | 2018-12-19T22:13:39 | 2018-12-19T22:13:39 | 106,818,135 | 5 | 4 | null | null | null | null | UTF-8 | Python | false | false | 1,908 | py | from django.contrib.auth.models import User
from django.test import TestCase
# Create your tests here.
from django.test.testcases import SimpleTestCase
from django.urls.base import reverse
from stock.models import Product, TimestampableMixin, StockEntry
class ProductTest(SimpleTestCase):
def test_value_initial_stock_field(self):
product = Product()
self.assertEquals(0, product.stock)
# self.assertEquals(1, product.stock)
def test_product_has_timestampable(self):
product = Product()
self.assertIsInstance(product, TimestampableMixin)
def test_exception_when_stock_less_zero(self):
product = Product()
with self.assertRaises(ValueError) as exception:
product.stock = 10
product.decrement(11)
self.assertEquals('Sem estoque disponível', str(exception.exception))
class ProductDatabaseTest(TestCase):
fixtures = ['data.json']
def setUp(self):
self.product = Product.objects.create(
name="Produto YY", stock_max=200, price_sale=50.50, price_purchase=25.25,
)
def test_product_save(self):
self.assertEquals('Produto YY', self.product.name)
self.assertEquals(0, self.product.stock)
def test_if_user_exists(self):
user = User.objects.all().first()
self.assertIsNotNone(user)
class StockEntryHttpTest(TestCase):
fixtures = ['data.json']
def test_list(self):
response = self.client.get('/stock_entries/')
self.assertEquals(200, response.status_code)
self.assertIn('Produto A', str(response.content))
def test_create(self):
url = reverse('entries_create')
self.client.post(url, {'product': 1, 'amount': 20})
entry = StockEntry.objects.filter(amount=20, product_id=1).first()
self.assertIsNotNone(entry)
self.assertEquals(31, entry.product.stock)
| [
"[email protected]"
]
| |
9fe52b0d2955064f02e33f7ef81e170492fd5ec5 | 1ee90596d52554cb4ef51883c79093897f5279a0 | /Sisteme/[C++] Ox Event Manager - Top 5 winners by Vegas [PREMIUM]/03. Client/root/uioxevent.py | 1c602cfdb96c46c0b87d52f75e480054a6e1e75f | []
| no_license | Reizonr1/metin2-adv | bf7ecb26352b13641cd69b982a48a6b20061979a | 5c2c096015ef3971a2f1121b54e33358d973c694 | refs/heads/master | 2022-04-05T20:50:38.176241 | 2020-03-03T18:20:58 | 2020-03-03T18:20:58 | 233,462,795 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 16,095 | py | # -*- coding: utf-8 -*-
###################################################################
# title_name : Metin2 - Ox Event Manager & Top 5 winners [Full source]
# date_created : 2017.01.21
# filename : uioxevent.py
# author : VegaS
# version_actual : Version 0.0.1
#
import ui
import dbg
import app
import chat
import uiToolTip
import wndMgr
import localeInfo
import playerSettingModule
import oxevent
import net
import introLogin, item_proto_list, item, ime, grp, uiCommon
EMPIRE_NAME = {
net.EMPIRE_A : localeInfo.EMPIRE_A, net.EMPIRE_B : localeInfo.EMPIRE_B, net.EMPIRE_C : localeInfo.EMPIRE_C
}
PATH_IMAGE__UNKNOWN_WINNER = "d:/ymir work/ui/path_oxevent/face/face_unknown.tga"
FACE_IMAGE_DICT = {
playerSettingModule.RACE_WARRIOR_M : "d:/ymir work/ui/path_oxevent/face/face_warrior_m_01.sub",
playerSettingModule.RACE_WARRIOR_W : "d:/ymir work/ui/path_oxevent/face/face_warrior_w_01.sub",
playerSettingModule.RACE_ASSASSIN_M : "d:/ymir work/ui/path_oxevent/face/face_assassin_m_01.sub",
playerSettingModule.RACE_ASSASSIN_W : "d:/ymir work/ui/path_oxevent/face/face_assassin_w_01.sub",
playerSettingModule.RACE_SURA_M : "d:/ymir work/ui/path_oxevent/face/face_sura_m_01.sub",
playerSettingModule.RACE_SURA_W : "d:/ymir work/ui/path_oxevent/face/face_sura_w_01.sub",
playerSettingModule.RACE_SHAMAN_M : "d:/ymir work/ui/path_oxevent/face/face_shaman_m_01.sub",
playerSettingModule.RACE_SHAMAN_W : "d:/ymir work/ui/path_oxevent/face/face_shaman_w_01.sub",
}
#if app.ENABLE_WOLFMAN_CHARACTER:
#FACE_IMAGE_DICT.update({playerSettingModule.RACE_WOLFMAN_M : "d:/ymir work/ui/path_oxevent/face/face_wolf_m_01.sub",})
class OxEventManagerLogin(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.Initialize()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Initialize(self):
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "uiscript/OxEventManagerLogin.py")
except:
import exception
exception.Abort("OxEventManagerLogin.Initialize.LoadObject")
try:
self.GetChild("accept_button").SetEvent(self.Open)
self.GetChild("cancel_button").SetEvent(self.Close)
self.GetChild("titlebar").SetCloseEvent(self.Close)
self.LinePassword = self.GetChild("currentLine_Value")
self.LinePassword.SetFocus()
except:
import exception
exception.Abort("OxEventManagerLogin.Initialize.BindObject")
self.SetCenterPosition()
def Destroy(self):
self.ClearDictionary()
def Close(self):
self.Hide()
def Login(self):
oxevent.Manager(oxevent.LOGIN, str(self.LinePassword.GetText()), oxevent.EMPTY_VALUE, oxevent.EMPTY_VALUE)
self.Hide()
def Open(self):
self.connectDialog = introLogin.ConnectingDialog()
self.connectDialog.Open(3.0)
self.connectDialog.SetText(localeInfo.OXEVENT_MANAGER_BTN_LOGIN)
self.connectDialog.SAFE_SetTimeOverEvent(self.Login)
self.connectDialog.SAFE_SetExitEvent(self.Close)
class OxEventManager(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.row = 0
self.key = 0
self.itemName = ""
self.vnumIndex = []
self.listKeys = []
self.wndOpenQuestion = {}
self.pageKey = ["open_event", "close_gates", "close_event", "reward_players", "ask_question", "close_force", "clear_reward"]
self.Initialize()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Initialize(self):
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "uiscript/OxEventManager.py")
except:
import exception
exception.Abort("OxEventManager.Initialize.LoadObject")
try:
GetObject = self.GetChild
self.main = {
"rewards" : {
"password" : oxevent.EMPTY_PASSWORD,
"vnum" : oxevent.EMPTY_VNUM,
"count" : oxevent.EMPTY_COUNT
},
"elements" :
{
"board" : GetObject("Board"),
"participants" : GetObject("current_participants"),
"slot_vnum" : GetObject("slot_vnum_value"),
"slot_count" : GetObject("slot_count_value"),
"slot_image" : GetObject("slot_image_value"),
"listbox_bar" : GetObject("listbox_bar"),
"listbox" : GetObject("ListBox")
},
"btn" :
{
"open_event" : GetObject("open_button_btn"),
"close_gates" : GetObject("close_gates_btn"),
"close_event" : GetObject("close_event_btn"),
"close_force" : GetObject("force_close_event_btn"),
"reward_players" : GetObject("reward_players_btn"),
"ask_question" : GetObject("ask_question_btn"),
"clear_reward" : GetObject("clear_reward_btn"),
}
}
for key in xrange(oxevent.APPEND_WINDOW):
self.main["btn"][self.pageKey[key]].SAFE_SetEvent(self.AskQuestionPacket, key + 1)
self.main["elements"]["slot_vnum"].SetEscapeEvent(self.Close)
self.main["elements"]["slot_vnum"].OnIMEUpdate = ui.__mem_func__(self.OnUpdateKeyVnum)
self.main["elements"]["slot_count"].SetEscapeEvent(self.Close)
self.main["elements"]["slot_count"].OnIMEUpdate = ui.__mem_func__(self.OnUpdateKeyCount)
self.main["elements"]["slot_count"].SetNumberMode()
self.main["elements"]["listbox"].SetEvent(self.OnClick)
self.main["elements"]["board"].SetCloseEvent(self.Close)
except:
import exception
exception.Abort("OxEventManager.Initialize.BindObject")
self.main["elements"]["slot_image"].Hide()
self.itemTooltip = uiToolTip.ItemToolTip()
self.itemTooltip.HideToolTip()
self.SetStatusListBox(0)
self.SetCenterPosition()
self.UpdateRect()
def SetStatusListBox(self, key):
for it in [self.main["elements"]["listbox"], self.main["elements"]["listbox_bar"]]:
if key == 0:
it.Hide()
else:
it.Show()
def GetIsSearchedVnum(self):
return ((self.main["rewards"]["vnum"] != oxevent.EMPTY_VNUM) and (self.main["rewards"]["count"] != oxevent.EMPTY_COUNT))
def OnUpdateKeyCount(self):
ui.EditLine.OnIMEUpdate(self.main["elements"]["slot_count"])
def GetText():
return self.main["elements"]["slot_count"].GetText()
def GetIsTextDigit(val):
return (val.isdigit())
def IsStackable():
item.SelectItem(int(self.main["rewards"]["vnum"]))
return (item.IsAntiFlag(item.ITEM_ANTIFLAG_STACK))
def IsDenied(val):
return (int(val) > oxevent.ITEM_MAX_COUNT)
val = GetText()
if GetIsTextDigit(val):
it = int(val)
if IsDenied(it):
self.main["elements"]["slot_count"].SetText(str(oxevent.ITEM_MAX_COUNT))
self.main["rewards"]["count"] = it
def OnUpdateKeyVnum(self):
ui.EditLine.OnIMEUpdate(self.main["elements"]["slot_vnum"])
def GetText():
return str(self.main["elements"]["slot_vnum"].GetText())
def GetTextSize():
return len(GetText())
def SetKey(key):
if key in [oxevent.CLEAR_DATA, oxevent.REFRESH_DATA]:
self.vnumIndex = []
self.listKeys = []
self.row = 0
if key != oxevent.REFRESH_DATA:
self.SetStatusListBox(0)
self.main["elements"]["listbox"].ClearItem()
def GetItemCountListBox():
return self.main["elements"]["listbox"].GetItemCount()
def SetSizeListBox():
for it in [self.main["elements"]["listbox"], self.main["elements"]["listbox_bar"]]:
it.SetSize(200, 17.5 * GetItemCountListBox())
if GetTextSize() <= oxevent.NEED_SIZE:
SetKey(oxevent.CLEAR_DATA)
return
SetKey(oxevent.REFRESH_DATA)
c_szText = GetText()
for key in item_proto_list.DICT:
c_szItem, c_szName = key["vnum"], key["name"]
if len(c_szName) >= len(c_szText) and c_szName[:len(c_szText)].lower() == c_szText.lower():
self.listKeys.append(c_szItem)
for key in xrange(len(self.listKeys)):
if self.row >= oxevent.MAX_ROWS:
break
item.SelectItem(self.listKeys[key])
c_szName = item.GetItemName()
self.main["elements"]["listbox"].InsertItem(key, c_szName)
self.vnumIndex.append(self.listKeys[key])
self.row += 1
self.SetStatusListBox(1)
SetSizeListBox()
if len(self.vnumIndex) == (oxevent.NEED_SIZE - 1):
SetKey(oxevent.CLEAR_DATA)
return
def AppendTextLine(self, c_szName):
self.itemName = c_szName
self.main["elements"]["slot_vnum"].SetText(c_szName)
self.main["elements"]["slot_vnum"].SetFocus()
def OnClick(self, key, c_szName):
def Clear():
self.SetStatusListBox(0)
self.main["elements"]["listbox"].ClearItem()
self.row = 0
def ShowImage():
if self.GetIsSearchedVnum():
item.SelectItem(self.main["rewards"]["vnum"])
try:
self.main["elements"]["slot_image"].LoadImage(item.GetIconImageFileName())
self.main["elements"]["slot_image"].Show()
except:
dbg.TraceError("OxEventManager.LoadImage - Failed to find item data")
def MoveCursor(text):
ime.SetCursorPosition(len(text) + 1)
def SetItemVnum(key):
self.key = key
self.main["rewards"]["vnum"] = self.vnumIndex[self.key]
self.main["elements"]["slot_count"].SetText(str(oxevent.NEED_SIZE))
self.main["rewards"]["count"] = 1
self.AppendTextLine(c_szName)
SetItemVnum(key)
MoveCursor(c_szName)
ShowImage()
Clear()
def OnUpdate(self):
def PermisionOnToolTip():
return ((self.main["elements"]["slot_image"].IsShow() and self.main["elements"]["slot_image"].IsIn()) and self.GetIsSearchedVnum())
if PermisionOnToolTip():
self.itemTooltip.SetItemToolTip(self.main["rewards"]["vnum"])
else:
self.itemTooltip.HideToolTip()
def ClearList(self):
self.main["rewards"]["vnum"] = 0
self.AppendTextLine(oxevent.EMPTY_PASSWORD)
self.main["elements"]["slot_count"].SetText(str(oxevent.NEED_SIZE))
self.main["elements"]["slot_image"].Hide()
def RefreshCounter(self, participantsCount, observersCount):
self.main["elements"]["participants"].SetText(localeInfo.OXEVENT_MANAGER_USER_COUNT % (participantsCount, observersCount))
def AnswerWithKey(self, answer, key):
if not self.wndOpenQuestion[key]:
return
self.wndOpenQuestion[key].Close()
self.wndOpenQuestion[key] = None
if not answer:
return
if key in (oxevent.OPEN_EVENT, oxevent.CLOSE_GATES, oxevent.CLOSE_EVENT, oxevent.ASK_QUESTION, oxevent.FORCE_CLOSE_EVENT):
oxevent.Manager(key, oxevent.EMPTY_PASSWORD, oxevent.EMPTY_VALUE, oxevent.EMPTY_VALUE)
else:
if self.GetIsSearchedVnum():
oxevent.Manager(key, oxevent.EMPTY_PASSWORD, self.main["rewards"]["vnum"], self.main["rewards"]["count"])
self.ClearList()
def AskQuestionPacket(self, key):
def resize(key):
return ("|cFFb6ff7d%s|r" % str(key))
self.QUESTION_DESCRIPTION = {
oxevent.OPEN_EVENT : localeInfo.OXEVENT_MANAGER_QUEST_OPEN_GATES,
oxevent.CLOSE_GATES : localeInfo.OXEVENT_MANAGER_QUEST_CLOSE_GATES,
oxevent.CLOSE_EVENT : localeInfo.OXEVENT_MANAGER_QUEST_FINISH_EVENT,
oxevent.REWARD_PLAYERS : (localeInfo.OXEVENT_MANAGER_QUEST_GIVE_REWARD % (resize(self.main["rewards"]["vnum"]), resize(self.itemName), resize(self.main["rewards"]["count"]))),
oxevent.ASK_QUESTION : localeInfo.OXEVENT_MANAGER_QUEST_RUN_QUIZ,
oxevent.FORCE_CLOSE_EVENT : localeInfo.OXEVENT_MANAGER_QUEST_FORCE_CLOSE,
oxevent.CLEAR_REWARD : localeInfo.OXEVENT_MANAGER_QUEST_CLEAR_REWARD
}
if key == oxevent.REWARD_PLAYERS and not self.GetIsSearchedVnum():
return
self.wndOpenQuestion[key] = uiCommon.QuestionDialog()
self.wndOpenQuestion[key].SetText(self.QUESTION_DESCRIPTION[key])
self.wndOpenQuestion[key].SetWidth(450)
self.wndOpenQuestion[key].SetAcceptEvent(lambda arg = TRUE, key = key: self.AnswerWithKey(arg, key))
self.wndOpenQuestion[key].SetCancelEvent(lambda arg = FALSE, key = key: self.AnswerWithKey(arg, key))
self.wndOpenQuestion[key].Open()
def OpenWindow(self):
self.Show()
def Close(self):
self.itemTooltip.HideToolTip()
self.Hide()
class OxEventWinners(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.textToolTip = None
self.Initialize()
def __del__(self):
ui.ScriptWindow.__del__(self)
def Initialize(self):
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "uiscript/OxEventWinners.py")
except:
import exception
exception.Abort("OxEventWinners.Initialize.LoadObject")
try:
GetObject = self.GetChild
self.main = {
"data" : {
"real_name" : {}, "name" : {}, "level" : {}, "guild" : {}, "empire" : {}, "real_job" : {}, "job" : {}, "date" : {}, "real_correct_answers" : {}, "correct_answers" : {}
},
"elements" :
{
"board" : GetObject("board"),
"slot" : [GetObject("character_slot_%d" % (i + 1)) for i in xrange(oxevent.MAX_RANGE)],
"name" : [GetObject("character_name_%d" % (i + 1)) for i in xrange(oxevent.MAX_RANGE)],
"face" : [GetObject("character_face_%d" % (i + 1)) for i in xrange(oxevent.MAX_RANGE)],
"answers" : [GetObject("character_answers_%d" % (i + 1)) for i in xrange(oxevent.MAX_RANGE)],
}
}
except:
import exception
exception.Abort("OxEventWinners.Initialize.BindObject")
self.main["elements"]["board"].SetSize(175, 235)
self.SetPosition(5, wndMgr.GetScreenHeight() - 600)
self.UpdateRect()
def GetCurrentKeys(self):
return ([self.main["data"]["real_name"], self.main["data"]["name"], self.main["data"]["level"], self.main["data"]["guild"], self.main["data"]["empire"], self.main["data"]["real_job"], self.main["data"]["job"], self.main["data"]["date"], self.main["data"]["real_correct_answers"], self.main["data"]["correct_answers"]])
def GetExistKey(self, key):
self.sumKeys = self.GetCurrentKeys()
return (self.sumKeys[key].get(key) != localeInfo.OXEVENT_TOOLTIP_EMPTY)
def GetRealFace(self, index):
return FACE_IMAGE_DICT[index]
def AppendTextLine(self):
for key in xrange(oxevent.MAX_RANGE):
if self.GetExistKey(key):
self.main["elements"]["name"][key].SetText(self.main["data"]["real_name"].get(key))
self.main["elements"]["answers"][key].SetText(str(self.main["data"]["real_correct_answers"].get(key)))
self.main["elements"]["face"][key].LoadImage(self.GetRealFace(self.main["data"]["real_job"].get(key)))
else:
self.main["elements"]["face"][key].LoadImage(PATH_IMAGE__UNKNOWN_WINNER)
def Append(self):
def resize(key):
return ("|cFFfffbaa%s|r" % str(key))
def GetEmpire(index):
return resize(EMPIRE_NAME[index])
for key in xrange(oxevent.MAX_RANGE):
row = oxevent.GetWinners(key)
name, level, guild, empire, job, date, correct_answers = row[0], row[1], row[2], row[3], row[4], row[5], row[6]
if level == oxevent.EMPTY_DATA:
for keyEmpty in self.GetCurrentKeys():
keyEmpty.update({key : localeInfo.OXEVENT_TOOLTIP_EMPTY})
else:
self.main["data"]["real_name"].update({key : name})
self.main["data"]["name"].update({key : (localeInfo.OXEVENT_TOOLTIP_NAME % resize(name))})
self.main["data"]["level"].update({key : (localeInfo.OXEVENT_TOOLTIP_LEVEL % resize(level))})
self.main["data"]["guild"].update({key : (localeInfo.OXEVENT_TOOLTIP_GUILD % resize(guild))})
self.main["data"]["empire"].update({key : (localeInfo.OXEVENT_TOOLTIP_EMPIRE % GetEmpire(empire))})
self.main["data"]["real_job"].update({key : job})
self.main["data"]["job"].update({key : self.GetRealFace(job)})
self.main["data"]["date"].update({key : (localeInfo.OXEVENT_TOOLTIP_DATE % resize(date))})
self.main["data"]["real_correct_answers"].update({key : correct_answers})
self.main["data"]["correct_answers"].update({key : (localeInfo.OXEVENT_TOOLTIP_ANSWERS % resize(correct_answers))})
self.AppendTextLine()
self.Show()
def OnUpdate(self):
(x, y) = wndMgr.GetMousePosition()
for key in xrange(oxevent.MAX_RANGE):
if self.main["elements"]["slot"][key].IsIn() ^ self.main["elements"]["face"][key].IsIn():
if self.GetExistKey(key):
self.textToolTip = uiToolTip.ToolTip()
self.textToolTip.SetPosition(x + 15, y)
self.textToolTip.AppendPlayersDesc(self.main["data"]["name"].get(key),self.main["data"]["level"].get(key),self.main["data"]["guild"].get(key), self.main["data"]["empire"].get(key),self.main["data"]["job"].get(key), self.main["data"]["date"].get(key),self.main["data"]["correct_answers"].get(key))
def Openwindow(self):
if self.IsShow():
self.Hide()
else:
self.Show() | [
"[email protected]"
]
| |
7e5bb7c4fd4c0b14d3a1b3190ac870bc303b7697 | a20c2e03720ac51191c2807af29d85ea0fa23390 | /vowelorconsonant.py | 18231b547eae391f8d07f55d552ba6abc0453b56 | []
| no_license | KishoreKicha14/Guvi1 | f71577a2c16dfe476adc3640dfdd8658da532e0d | ddea89224f4f20f92ebc47d45294ec79040e48ac | refs/heads/master | 2020-04-29T23:32:13.628601 | 2019-08-05T17:48:18 | 2019-08-05T17:48:18 | 176,479,262 | 0 | 3 | null | null | null | null | UTF-8 | Python | false | false | 255 | py | n=input()
a=ord(n)
f=0
if (a in range(97,123))or(a in range(65,98)):
v=[65,69,73,79,85,97,101,105,111,117]
for i in v:
if(i==a):
f=1
print(vowel)
break
if(f==0):
print("Consonant")
else:
print("invalid")
| [
"[email protected]"
]
| |
3d48ec33045fb784ead90b898d450e65020f22cd | 40ce4d7545309ca57f0670a3aa27573d43b18552 | /com.ppc.Microservices/intelligence/daylight/location_midnight_microservice.py | c6ef5c09622b3603af1f31da45b9aac04e419e01 | [
"Apache-2.0"
]
| permissive | slrobertson1/botlab | 769dab97cca9ee291f3cccffe214544663d5178e | fef6005c57010a30ed8d1d599d15644dd7c870d8 | refs/heads/master | 2020-07-28T06:45:37.316094 | 2019-09-18T15:34:08 | 2019-09-18T15:34:08 | 209,341,818 | 0 | 0 | Apache-2.0 | 2019-09-18T15:23:37 | 2019-09-18T15:23:37 | null | UTF-8 | Python | false | false | 878 | py | '''
Created on February 25, 2019
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
from intelligence.intelligence import Intelligence
class LocationMidnightMicroservice(Intelligence):
"""
Announce midnight throughout the microservices framework
"""
def schedule_fired(self, botengine, schedule_id):
"""
The bot executed on a hard coded schedule specified by our runtime.json file
:param botengine: BotEngine environment
:param schedule_id: Schedule ID that is executing from our list of runtime schedules
"""
self.parent.track(botengine, "midnight")
if schedule_id == "MIDNIGHT":
self.parent.distribute_datastream_message(botengine, "midnight_fired", None, internal=True, external=False)
| [
"[email protected]"
]
| |
bee0d4a64d8b86383ac57f7631cf62041079a8ed | b66bf5a58584b45c76b9d0c5bf828a3400ecbe04 | /week-04/4-recursion/6.py | 757f22bf72fb91301f22cd313315ff7f695c6926 | []
| no_license | greenfox-velox/szepnapot | 1196dcb4be297f12af7953221c27cd1a5924cfaa | 41c3825b920b25e20b3691a1680da7c10820a718 | refs/heads/master | 2020-12-21T08:11:41.252889 | 2016-08-13T10:07:15 | 2016-08-13T10:07:15 | 58,042,932 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 501 | py | # 6. We have bunnies standing in a line, numbered 1, 2, ... The odd bunnies
# (1, 3, ..) have the normal 2 ears. The even bunnies (2, 4, ..) we'll say
# have 3 ears, because they each have a raised foot. Recursively return the
# number of "ears" in the bunny line 1, 2, ... n (without loops or
# multiplication).
def handicap_bunny_ears(n):
if n == 1:
return 2
elif n % 2 == 0:
return 3 + handicap_bunny_ears(n - 1)
else:
return 2 + handicap_bunny_ears(n - 1)
print(handicap_bunny_ears(6)) | [
"[email protected]"
]
| |
7ac8563d6aacb10540b4737d547e048a5b5d34cb | 8723e6a6104e0aa6d0a1e865fcaaa8900b50ff35 | /util/test_registration.py | 552ee309cf404634bd31b78fa6016c8364671422 | []
| no_license | ejeschke/ginga-plugin-template | 9c4324b7c6ffaa5009cce718de8ea2fc5172bc81 | 545c785a184aedb1535d161d3c5ca5e7bf5bed6e | refs/heads/master | 2022-11-22T17:50:57.503956 | 2022-11-10T23:20:09 | 2022-11-10T23:20:09 | 78,906,928 | 0 | 2 | null | null | null | null | UTF-8 | Python | false | false | 833 | py | """
This program allows you to test whether your plugin will register
itself correctly.
"""
from pkg_resources import iter_entry_points
groups = ['ginga.rv.plugins']
available_methods = []
for group in groups:
for entry_point in iter_entry_points(group=group, name=None):
available_methods.append(entry_point.load())
d = dict(name='Name', ptype='Type', klass='Class', module='Module')
print("%(name)14.14s %(ptype)6.6s %(klass)20s %(module)20s" % d)
for method in available_methods:
spec = method()
# for debugging
#print(spec)
d = dict(spec)
d.setdefault('name', spec.get('name', spec.get('menu', spec.get('klass', spec.get('module')))))
d.setdefault('klass', spec.get('module'))
d.setdefault('ptype', 'local')
print("%(name)14.14s %(ptype)6.6s %(klass)20s %(module)20s" % d)
| [
"[email protected]"
]
| |
2bf06e0ad8127a620f73166fdad183db2ad4a00b | 54f352a242a8ad6ff5516703e91da61e08d9a9e6 | /Source Codes/AtCoder/abc026/A/4904316.py | f402a614334f49b3bcdec3a0f4f6dd30b813e978 | []
| no_license | Kawser-nerd/CLCDSA | 5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb | aee32551795763b54acb26856ab239370cac4e75 | refs/heads/master | 2022-02-09T11:08:56.588303 | 2022-01-26T18:53:40 | 2022-01-26T18:53:40 | 211,783,197 | 23 | 9 | null | null | null | null | UTF-8 | Python | false | false | 42 | py | a = int(input())
print(int((a ** 2) / 4)) | [
"[email protected]"
]
| |
036b5f311d7c71f462bc035c75e1f709fda7d0c1 | c9ddbdb5678ba6e1c5c7e64adf2802ca16df778c | /cases/synthetic/sieve-big-582.py | 53920cabcfe9a30a69d9844b54243579ff6513d3 | []
| no_license | Virtlink/ccbench-chocopy | c3f7f6af6349aff6503196f727ef89f210a1eac8 | c7efae43bf32696ee2b2ee781bdfe4f7730dec3f | refs/heads/main | 2023-04-07T15:07:12.464038 | 2022-02-03T15:42:39 | 2022-02-03T15:42:39 | 451,969,776 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 31,755 | py | # A resizable list of integers
class Vector(object):
items: [int] = None
size: int = 0
def __init__(self:"Vector"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector", idx: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector") -> int:
return self.size
# A resizable list of integers
class Vector2(object):
items: [int] = None
items2: [int] = None
size: int = 0
size2: int = 0
def __init__(self:"Vector2"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector2") -> int:
return len(self.items)
# Returns current capacity
def capacity2(self:"Vector2") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector2") -> int:
self.items = self.items + [0]
return $Exp.capacity()
# Increases capacity of vector by one element
def increase_capacity2(self:"Vector2") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector2", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append2(self:"Vector2", item: int, item2: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector2", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all2(self:"Vector2", new_items: [int], new_items2: [int]) -> object:
item:int = 0
item2:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector2", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at2(self:"Vector2", idx: int, idx2: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector2", idx: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get2(self:"Vector2", idx: int, idx2: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector2") -> int:
return self.size
# Retrieves the current size of the vector
def length2(self:"Vector2") -> int:
return self.size
# A resizable list of integers
class Vector3(object):
items: [int] = None
items2: [int] = None
items3: [int] = None
size: int = 0
size2: int = 0
size3: int = 0
def __init__(self:"Vector3"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector3") -> int:
return len(self.items)
# Returns current capacity
def capacity2(self:"Vector3") -> int:
return len(self.items)
# Returns current capacity
def capacity3(self:"Vector3") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector3") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity2(self:"Vector3") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity3(self:"Vector3") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector3", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append2(self:"Vector3", item: int, item2: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append3(self:"Vector3", item: int, item2: int, item3: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector3", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all2(self:"Vector3", new_items: [int], new_items2: [int]) -> object:
item:int = 0
item2:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all3(self:"Vector3", new_items: [int], new_items2: [int], new_items3: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector3", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at2(self:"Vector3", idx: int, idx2: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at3(self:"Vector3", idx: int, idx2: int, idx3: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector3", idx: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get2(self:"Vector3", idx: int, idx2: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get3(self:"Vector3", idx: int, idx2: int, idx3: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector3") -> int:
return self.size
# Retrieves the current size of the vector
def length2(self:"Vector3") -> int:
return self.size
# Retrieves the current size of the vector
def length3(self:"Vector3") -> int:
return self.size
# A resizable list of integers
class Vector4(object):
items: [int] = None
items2: [int] = None
items3: [int] = None
items4: [int] = None
size: int = 0
size2: int = 0
size3: int = 0
size4: int = 0
def __init__(self:"Vector4"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector4") -> int:
return len(self.items)
# Returns current capacity
def capacity2(self:"Vector4") -> int:
return len(self.items)
# Returns current capacity
def capacity3(self:"Vector4") -> int:
return len(self.items)
# Returns current capacity
def capacity4(self:"Vector4") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector4") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity2(self:"Vector4") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity3(self:"Vector4") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity4(self:"Vector4") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector4", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append2(self:"Vector4", item: int, item2: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append3(self:"Vector4", item: int, item2: int, item3: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append4(self:"Vector4", item: int, item2: int, item3: int, item4: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector4", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all2(self:"Vector4", new_items: [int], new_items2: [int]) -> object:
item:int = 0
item2:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all3(self:"Vector4", new_items: [int], new_items2: [int], new_items3: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all4(self:"Vector4", new_items: [int], new_items2: [int], new_items3: [int], new_items4: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
item4:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector4", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at2(self:"Vector4", idx: int, idx2: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at3(self:"Vector4", idx: int, idx2: int, idx3: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at4(self:"Vector4", idx: int, idx2: int, idx3: int, idx4: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector4", idx: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get2(self:"Vector4", idx: int, idx2: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get3(self:"Vector4", idx: int, idx2: int, idx3: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get4(self:"Vector4", idx: int, idx2: int, idx3: int, idx4: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector4") -> int:
return self.size
# Retrieves the current size of the vector
def length2(self:"Vector4") -> int:
return self.size
# Retrieves the current size of the vector
def length3(self:"Vector4") -> int:
return self.size
# Retrieves the current size of the vector
def length4(self:"Vector4") -> int:
return self.size
# A resizable list of integers
class Vector5(object):
items: [int] = None
items2: [int] = None
items3: [int] = None
items4: [int] = None
items5: [int] = None
size: int = 0
size2: int = 0
size3: int = 0
size4: int = 0
size5: int = 0
def __init__(self:"Vector5"):
self.items = [0]
# Returns current capacity
def capacity(self:"Vector5") -> int:
return len(self.items)
# Returns current capacity
def capacity2(self:"Vector5") -> int:
return len(self.items)
# Returns current capacity
def capacity3(self:"Vector5") -> int:
return len(self.items)
# Returns current capacity
def capacity4(self:"Vector5") -> int:
return len(self.items)
# Returns current capacity
def capacity5(self:"Vector5") -> int:
return len(self.items)
# Increases capacity of vector by one element
def increase_capacity(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity2(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity3(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity4(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Increases capacity of vector by one element
def increase_capacity5(self:"Vector5") -> int:
self.items = self.items + [0]
return self.capacity()
# Appends one item to end of vector
def append(self:"Vector5", item: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append2(self:"Vector5", item: int, item2: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append3(self:"Vector5", item: int, item2: int, item3: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append4(self:"Vector5", item: int, item2: int, item3: int, item4: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends one item to end of vector
def append5(self:"Vector5", item: int, item2: int, item3: int, item4: int, item5: int) -> object:
if self.size == self.capacity():
self.increase_capacity()
self.items[self.size] = item
self.size = self.size + 1
# Appends many items to end of vector
def append_all(self:"Vector5", new_items: [int]) -> object:
item:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all2(self:"Vector5", new_items: [int], new_items2: [int]) -> object:
item:int = 0
item2:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all3(self:"Vector5", new_items: [int], new_items2: [int], new_items3: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all4(self:"Vector5", new_items: [int], new_items2: [int], new_items3: [int], new_items4: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
item4:int = 0
for item in new_items:
self.append(item)
# Appends many items to end of vector
def append_all5(self:"Vector5", new_items: [int], new_items2: [int], new_items3: [int], new_items4: [int], new_items5: [int]) -> object:
item:int = 0
item2:int = 0
item3:int = 0
item4:int = 0
item5:int = 0
for item in new_items:
self.append(item)
# Removes an item from the middle of vector
def remove_at(self:"Vector5", idx: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at2(self:"Vector5", idx: int, idx2: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at3(self:"Vector5", idx: int, idx2: int, idx3: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at4(self:"Vector5", idx: int, idx2: int, idx3: int, idx4: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Removes an item from the middle of vector
def remove_at5(self:"Vector5", idx: int, idx2: int, idx3: int, idx4: int, idx5: int) -> object:
if idx < 0:
return
while idx < self.size - 1:
self.items[idx] = self.items[idx + 1]
idx = idx + 1
self.size = self.size - 1
# Retrieves an item at a given index
def get(self:"Vector5", idx: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get2(self:"Vector5", idx: int, idx2: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get3(self:"Vector5", idx: int, idx2: int, idx3: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get4(self:"Vector5", idx: int, idx2: int, idx3: int, idx4: int) -> int:
return self.items[idx]
# Retrieves an item at a given index
def get5(self:"Vector5", idx: int, idx2: int, idx3: int, idx4: int, idx5: int) -> int:
return self.items[idx]
# Retrieves the current size of the vector
def length(self:"Vector5") -> int:
return self.size
# Retrieves the current size of the vector
def length2(self:"Vector5") -> int:
return self.size
# Retrieves the current size of the vector
def length3(self:"Vector5") -> int:
return self.size
# Retrieves the current size of the vector
def length4(self:"Vector5") -> int:
return self.size
# Retrieves the current size of the vector
def length5(self:"Vector5") -> int:
return self.size
# A faster (but more memory-consuming) implementation of vector
class DoublingVector(Vector):
doubling_limit:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# A faster (but more memory-consuming) implementation of vector
class DoublingVector2(Vector):
doubling_limit:int = 1000
doubling_limit2:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector2") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity2(self:"DoublingVector2") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# A faster (but more memory-consuming) implementation of vector
class DoublingVector3(Vector):
doubling_limit:int = 1000
doubling_limit2:int = 1000
doubling_limit3:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector3") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity2(self:"DoublingVector3") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity3(self:"DoublingVector3") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# A faster (but more memory-consuming) implementation of vector
class DoublingVector4(Vector):
doubling_limit:int = 1000
doubling_limit2:int = 1000
doubling_limit3:int = 1000
doubling_limit4:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector4") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity2(self:"DoublingVector4") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity3(self:"DoublingVector4") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity4(self:"DoublingVector4") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# A faster (but more memory-consuming) implementation of vector
class DoublingVector5(Vector):
doubling_limit:int = 1000
doubling_limit2:int = 1000
doubling_limit3:int = 1000
doubling_limit4:int = 1000
doubling_limit5:int = 1000
# Overriding to do fewer resizes
def increase_capacity(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity2(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity3(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity4(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Overriding to do fewer resizes
def increase_capacity5(self:"DoublingVector5") -> int:
if (self.capacity() <= self.doubling_limit // 2):
self.items = self.items + self.items
else:
# If doubling limit has been reached, fall back to
# standard capacity increases
self.items = self.items + [0]
return self.capacity()
# Makes a vector in the range [i, j)
def vrange(i:int, j:int) -> Vector:
v:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
def vrange2(i:int, j:int, i2:int, j2:int) -> Vector:
v:Vector = None
v2:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
def vrange3(i:int, j:int, i2:int, j2:int, i3:int, j3:int) -> Vector:
v:Vector = None
v2:Vector = None
v3:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
def vrange4(i:int, j:int, i2:int, j2:int, i3:int, j3:int, i4:int, j4:int) -> Vector:
v:Vector = None
v2:Vector = None
v3:Vector = None
v4:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
def vrange5(i:int, j:int, i2:int, j2:int, i3:int, j3:int, i4:int, j4:int, i5:int, j5:int) -> Vector:
v:Vector = None
v2:Vector = None
v3:Vector = None
v4:Vector = None
v5:Vector = None
v = DoublingVector()
while i < j:
v.append(i)
i = i + 1
return v
# Sieve of Eratosthenes (not really)
def sieve(v:Vector) -> object:
i:int = 0
j:int = 0
k:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
def sieve2(v:Vector, v2:Vector) -> object:
i:int = 0
i2:int = 0
j:int = 0
j2:int = 0
k:int = 0
k2:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
def sieve3(v:Vector, v2:Vector, v3:Vector) -> object:
i:int = 0
i2:int = 0
i3:int = 0
j:int = 0
j2:int = 0
j3:int = 0
k:int = 0
k2:int = 0
k3:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
def sieve4(v:Vector, v2:Vector, v3:Vector, v4:Vector) -> object:
i:int = 0
i2:int = 0
i3:int = 0
i4:int = 0
j:int = 0
j2:int = 0
j3:int = 0
j4:int = 0
k:int = 0
k2:int = 0
k3:int = 0
k4:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
def sieve5(v:Vector, v2:Vector, v3:Vector, v4:Vector, v5:Vector) -> object:
i:int = 0
i2:int = 0
i3:int = 0
i4:int = 0
i5:int = 0
j:int = 0
j2:int = 0
j3:int = 0
j4:int = 0
j5:int = 0
k:int = 0
k2:int = 0
k3:int = 0
k4:int = 0
k5:int = 0
while i < v.length():
k = v.get(i)
j = i + 1
while j < v.length():
if v.get(j) % k == 0:
v.remove_at(j)
else:
j = j + 1
i = i + 1
# Input parameter
n:int = 50
n2:int = 50
n3:int = 50
n4:int = 50
n5:int = 50
# Data
v:Vector = None
v2:Vector = None
v3:Vector = None
v4:Vector = None
v5:Vector = None
i:int = 0
i2:int = 0
i3:int = 0
i4:int = 0
i5:int = 0
# Crunch
v = vrange(2, n)
v2 = vrange(2, n)
v3 = vrange(2, n)
v4 = vrange(2, n)
v5 = vrange(2, n)
sieve(v)
# Print
while i < v.length():
print(v.get(i))
i = i + 1
| [
"[email protected]"
]
| |
4ab0aeb36367fb0df10d5a681a0fd858593a06fd | 5d13e9565779b4123e1b72815396eee0051d4980 | /parse_titles_with_dictionary.py | 136868340d5c6c8b92b10d3a91f34b556fdbc104 | []
| no_license | futuresystems-courses/475-Dictionary-Based-Analysis-of-PubMed-Article-Titles-for-Mental-Disorders-Kia | b455574908971e487b99a175d8fdbd48d13f8c60 | 1ab992b1859905ee57e51a258777192b2ec32339 | refs/heads/master | 2021-01-10T11:06:37.112800 | 2015-12-28T17:03:00 | 2015-12-28T17:03:00 | 48,702,480 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,328 | py | import sys
import nltk
import csv
import ast
from operator import itemgetter
import random
stopwords = nltk.corpus.stopwords.words('english')
disorder_phrases = {}
DICTIONARY_FILE = 'mental diseases dictionary.csv'
try:
TITLES_FILE = 'parsed_titles.txt'
except IndexError:
print "\nERROR: No file name given. Please add the filename of the titles file; e.g.,:\n\n"
sys.exit(0)
#parse target mental disorder phrases, but keep original version of phrase
with open(DICTIONARY_FILE, 'rb') as csvfile:
dictreader = csv.reader(csvfile, delimiter='\t')
for row in dictreader:
#print row
term_words = [w.lower() for w in nltk.RegexpTokenizer(r'\w+').tokenize(row[0])]
for word in term_words:
#print word
if word in stopwords:
term_words.remove(word)
disorder_phrases[row[0]] = term_words
#print disorder_phrases
with open(TITLES_FILE, 'rb') as csvfile:
file_id = str(random.randint(1,99999)) # add a random number to filenames to make them unique
with open('tagging_titles_' + file_id + '.txt', 'wb') as pubfile:
titlesreader = csv.reader(csvfile, delimiter='|', escapechar='\\')
recordwriter = csv.writer(pubfile, delimiter='|', quotechar='"', escapechar='\\')
recordwriter.writerow(["pmid","pubyear","lang","title","match_found","best_full_match","best_window_match"])
'''
run through titles in file
file format is "pmid|year|title|language"
'''
for row in titlesreader:
title = ''
match_found = ''
best_full_match = ''
best_window_match = ''
pmid = row[0]
pubyear = row[1]
title = row[2] #third column of original file
lang = row[3]
print title
#split and tokenize the title
title_words = [w.lower() for w in nltk.RegexpTokenizer(r'\w+').tokenize(title)]
full_title_scores = {}
small_window_scores = {}
# test paper titles for each word of disorder phrase from dictionary
# keep scores for all disorder phrases
for phrase in disorder_phrases:
word_matches = {}
for word in disorder_phrases[phrase]:
'''
for each word in disorder phrase, find the index of that word in the title
'''
indexes = [i for i, j in enumerate(title_words) if j == word]
'''
if word was found at least once, keep track of it and the indexes
'''
if len(indexes) > 0:
word_matches[word] = indexes
'''
if found as many words in the title as started with
in the disorder phrase, keep it as at least a "full title"
match, and possibly also a "within window" match
'''
if len(word_matches) == len(disorder_phrases[phrase]):
print "potential match (all words found in title):", phrase
full_title_scores[phrase] = len(disorder_phrases[phrase])
'''
if phrase is only one word long, it also counts as a small_window_match
'''
if len(disorder_phrases[phrase]) == 1:
small_window_scores[phrase] = len(disorder_phrases[phrase])
print "single word phrase; stored!"
else:
'''
if phrase is longer than one word, find min and max indexes
by sorting the matched words by the indexes (in descending
order), then taking the first and last elements
'''
sorted_word_matches = sorted(word_matches.items(), key=itemgetter(1), reverse=True)
max_index = sorted_word_matches[0][1][0] #first index value of first element
min_index = sorted_word_matches[-1][1][0] #first index value of last element
'''
if difference between max and min index is no more than 2
more than the length of the original phrase (that is, if there
are no more than 2 additional words intermingled in the disorder
phrase words), count it as a match
'''
if (max_index - min_index) <= len(disorder_phrases[phrase]) + 2:
small_window_scores[phrase] = len(disorder_phrases[phrase])
print "in window!"
else:
print "not in window!"
'''
Take all of the potential "full title" and "small window" matches.
If more than one match has been found in either category, sort
the matches by the length of the phrase, and take the longest phrase
as the best match.
'''
if len(full_title_scores) > 0 and len(small_window_scores) > 0:
match_found = 'Y'
print "all phrases checked; testing for best one"
if len(full_title_scores) == 1:
best_full_match = full_title_scores.keys()[0]
print "only one full match:", best_full_match
else:
sorted_full_scores = sorted(full_title_scores.items(), key=itemgetter(1), reverse=True)
best_full_match = sorted_full_scores[0][0]
print "found best full match:", best_full_match
#but need to check if first and second are tied
if len(small_window_scores) == 1:
best_window_match = small_window_scores.keys()[0]
print "only one window match:", best_window_match
else:
sorted_window_scores = sorted(small_window_scores.items(), key=itemgetter(1), reverse=True)
best_window_match = sorted_window_scores[0][0]
print "found best window match:", best_window_match
#but need to check if first and second are tied
else:
print "no matches found."
match_found = 'N'
recordwriter.writerow([pmid,pubyear,lang,title,match_found,best_full_match,best_window_match]) | [
"[email protected]"
]
| |
dec11357af01c915a67ab8710067b1a3a55ad0ad | 3f90f4f6876f77d6b43e4a5759b20e2e8d20e684 | /ex10/ex10.py | 89d4ec1d631136bdb021736fec2f1dbed4325af0 | []
| no_license | kwangilahn/kwang | 00d82d1bdca45000ee44fa2be55bdb8bff182c91 | df2fa199648ae894cbcf18952f6924a9b897d639 | refs/heads/master | 2021-01-21T04:47:02.719819 | 2016-06-07T03:59:57 | 2016-06-07T03:59:57 | 54,316,240 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 252 | py | tabby_cat = "\t I'm tabbed in"
persian_cat = "I'm split\non a line"
backslash_cat = "I'm \\ a \\ cat."
fat_cat = """
I'll do a list:
\t* Cat food
\t* Fishes
\t* catnip\n\t* Grass
"""
print tabby_cat
print persian_cat
print backslash_cat
print fat_cat | [
"CAD Client"
]
| CAD Client |
6df8795ce5b75fe8c3f8c5df2849243b52446321 | aa1972e6978d5f983c48578bdf3b51e311cb4396 | /mas_nitro-python-1.0/massrc/com/citrix/mas/nitro/resource/config/ns/ns_vlan.py | d1c25cf0083cc9debb8d5c39b6a0cd53dac1af6d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
]
| permissive | MayankTahil/nitro-ide | 3d7ddfd13ff6510d6709bdeaef37c187b9f22f38 | 50054929214a35a7bb19ed10c4905fffa37c3451 | refs/heads/master | 2020-12-03T02:27:03.672953 | 2017-07-05T18:09:09 | 2017-07-05T18:09:09 | 95,933,896 | 2 | 5 | null | 2017-07-05T16:51:29 | 2017-07-01T01:03:20 | HTML | UTF-8 | Python | false | false | 8,561 | py | '''
Copyright (c) 2008-2015 Citrix Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''
from massrc.com.citrix.mas.nitro.resource.Base import *
from massrc.com.citrix.mas.nitro.service.options import options
from massrc.com.citrix.mas.nitro.exception.nitro_exception import nitro_exception
from massrc.com.citrix.mas.nitro.util.filtervalue import filtervalue
from massrc.com.citrix.mas.nitro.resource.Base.base_resource import base_resource
from massrc.com.citrix.mas.nitro.resource.Base.base_response import base_response
'''
Configuration for NS Vlan resource
'''
class ns_vlan(base_resource):
_bound_ifaces= ""
_ns_vlan_ip_address= ""
_tagged_ifaces= ""
_if_ipv6_routing= ""
_ns_vlan_id= ""
__count=""
'''
get the resource id
'''
def get_resource_id(self) :
try:
if hasattr(self, 'id'):
return self.id
else:
return None
except Exception as e :
raise e
'''
get the resource type
'''
def get_object_type(self) :
try:
return "ns_vlan"
except Exception as e :
raise e
'''
Returns the value of object identifier argument.
'''
def get_object_id(self) :
try:
return None
except Exception as e :
raise e
'''
Returns the value of object file path argument.
'''
@property
def file_path_value(self) :
try:
return None
except Exception as e :
raise e
'''
Returns the value of object file component name.
'''
@property
def file_component_value(self) :
try :
return "ns_vlans"
except Exception as e :
raise e
'''
get Bounded Interfaces
'''
@property
def bound_ifaces(self) :
try:
return self._bound_ifaces
except Exception as e :
raise e
'''
set Bounded Interfaces
'''
@bound_ifaces.setter
def bound_ifaces(self,bound_ifaces):
try :
if not isinstance(bound_ifaces,str):
raise TypeError("bound_ifaces must be set to str value")
self._bound_ifaces = bound_ifaces
except Exception as e :
raise e
'''
get NetScaler IP Address
'''
@property
def ns_vlan_ip_address(self) :
try:
return self._ns_vlan_ip_address
except Exception as e :
raise e
'''
set NetScaler IP Address
'''
@ns_vlan_ip_address.setter
def ns_vlan_ip_address(self,ns_vlan_ip_address):
try :
if not isinstance(ns_vlan_ip_address,str):
raise TypeError("ns_vlan_ip_address must be set to str value")
self._ns_vlan_ip_address = ns_vlan_ip_address
except Exception as e :
raise e
'''
get Tagged Interfaces
'''
@property
def tagged_ifaces(self) :
try:
return self._tagged_ifaces
except Exception as e :
raise e
'''
set Tagged Interfaces
'''
@tagged_ifaces.setter
def tagged_ifaces(self,tagged_ifaces):
try :
if not isinstance(tagged_ifaces,str):
raise TypeError("tagged_ifaces must be set to str value")
self._tagged_ifaces = tagged_ifaces
except Exception as e :
raise e
'''
get VLAN for Network 1/8 on VM Instance
'''
@property
def if_ipv6_routing(self) :
try:
return self._if_ipv6_routing
except Exception as e :
raise e
'''
set VLAN for Network 1/8 on VM Instance
'''
@if_ipv6_routing.setter
def if_ipv6_routing(self,if_ipv6_routing):
try :
if not isinstance(if_ipv6_routing,str):
raise TypeError("if_ipv6_routing must be set to str value")
self._if_ipv6_routing = if_ipv6_routing
except Exception as e :
raise e
'''
get VLAN Id
'''
@property
def ns_vlan_id(self) :
try:
return self._ns_vlan_id
except Exception as e :
raise e
'''
set VLAN Id
'''
@ns_vlan_id.setter
def ns_vlan_id(self,ns_vlan_id):
try :
if not isinstance(ns_vlan_id,int):
raise TypeError("ns_vlan_id must be set to int value")
self._ns_vlan_id = ns_vlan_id
except Exception as e :
raise e
'''
Use this operation to delete configured vlans.
'''
@classmethod
def delete(cls,client=None,resource=None):
try :
if resource is None :
raise Exception("Resource Object Not Found")
if type(resource) is not list :
return resource.delete_resource(client)
else :
ns_vlan_obj=ns_vlan()
return cls.delete_bulk_request(client,resource,ns_vlan_obj)
except Exception as e :
raise e
'''
Use this operation to get configured vlans.
'''
@classmethod
def get(cls,client = None,resource="",option_=""):
try:
response=""
if not resource :
ns_vlan_obj=ns_vlan()
response = ns_vlan_obj.get_resources(client,option_)
else:
response = resource.get_resource(client, option_)
return response
except Exception as e :
raise e
'''
Use this API to fetch filtered set of ns_vlan resources.
filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+"
'''
@classmethod
def get_filtered(cls,service,filter_) :
try:
ns_vlan_obj = ns_vlan()
option_ = options()
option_._filter=filter_
return ns_vlan_obj.getfiltered(service, option_)
except Exception as e :
raise e
'''
* Use this API to count the ns_vlan resources.
'''
@classmethod
def count(cls,service) :
try:
ns_vlan_obj = ns_vlan()
option_ = options()
option_._count=True
response = ns_vlan_obj.get_resources(service, option_)
if response :
return response[0].__dict__['___count']
return 0
except Exception as e :
raise e
'''
Use this API to count the filtered set of ns_vlan resources.
filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+"
'''
@classmethod
def count_filtered(cls,service,filter_):
try:
ns_vlan_obj = ns_vlan()
option_ = options()
option_._count=True
option_._filter=filter_
response = ns_vlan_obj.getfiltered(service, option_)
if response :
return response[0].__dict__['_count']
return 0;
except Exception as e :
raise e
'''
Converts API response into object and returns the object array in case of get request.
'''
def get_nitro_response(self,service ,response):
try :
result=service.payload_formatter.string_to_resource(ns_vlan_response, response, self.__class__.__name__)
if(result.errorcode != 0) :
if (result.errorcode == 444) :
service.clear_session(self)
if result.severity :
if (result.severity == "ERROR") :
raise nitro_exception(result.errorcode, str(result.message), str(result.severity))
else :
raise nitro_exception(result.errorcode, str(result.message), str(result.severity))
return result.ns_vlan
except Exception as e :
raise e
'''
Converts API response into object and returns the object array .
'''
def get_nitro_bulk_response(self,service ,response):
try :
result=service.payload_formatter.string_to_resource(ns_vlan_responses, response, "ns_vlan_response_array")
if(result.errorcode != 0) :
if (result.errorcode == 444) :
service.clear_session(self)
response = result.ns_vlan_response_array
i=0
error = [ns_vlan() for _ in range(len(response))]
for obj in response :
error[i]= obj._message
i=i+1
raise nitro_exception(result.errorcode, str(result.message), error)
response = result.ns_vlan_response_array
i=0
ns_vlan_objs = [ns_vlan() for _ in range(len(response))]
for obj in response :
if hasattr(obj,'_ns_vlan'):
for props in obj._ns_vlan:
result = service.payload_formatter.string_to_bulk_resource(ns_vlan_response,self.__class__.__name__,props)
ns_vlan_objs[i] = result.ns_vlan
i=i+1
return ns_vlan_objs
except Exception as e :
raise e
'''
Performs generic data validation for the operation to be performed
'''
def validate(self,operationType):
try:
super(ns_vlan,self).validate()
except Exception as e :
raise e
'''
Forms the proper response.
'''
class ns_vlan_response(base_response):
def __init__(self,length=1) :
self.ns_vlan= []
self.errorcode = 0
self.message = ""
self.severity = ""
self.ns_vlan= [ ns_vlan() for _ in range(length)]
'''
Forms the proper response for bulk operation.
'''
class ns_vlan_responses(base_response):
def __init__(self,length=1) :
self.ns_vlan_response_array = []
self.errorcode = 0
self.message = ""
self.ns_vlan_response_array = [ ns_vlan() for _ in range(length)]
| [
"[email protected]"
]
| |
e5aca0d6b7938b6734d193163f7dc5763682145e | c6d4fa98b739a64bb55a8750b4aecd0fc0b105fd | /ScanPi/QRbytes/66.py | a9eaa790c24644f8755bc148732af6e70b5c38f8 | []
| no_license | NUSTEM-UK/Heart-of-Maker-Faire | de2c2f223c76f54a8b4c460530e56a5c74b65ca3 | fa5a1661c63dac3ae982ed080d80d8da0480ed4e | refs/heads/master | 2021-06-18T13:14:38.204811 | 2017-07-18T13:47:49 | 2017-07-18T13:47:49 | 73,701,984 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 94,946 | py | data = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xFF,
0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00,
0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00,
0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x0F, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x0F,
0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
]
| [
"[email protected]"
]
| |
6ac47a2b80b00b8628a0e5edd7e2a578430cde8a | 7d2442279b6dbaae617e2653ded92e63bb00f573 | /neupy/layers/transformations.py | ee9240912d7a646656b8944c68acbf4b57ff406b | [
"MIT"
]
| permissive | albertwy/neupy | c830526859b821472592f38033f8475828f2d389 | a8a9a8b1c11b8039382c27bf8f826c57e90e8b30 | refs/heads/master | 2021-06-03T21:23:37.636005 | 2016-05-24T21:18:25 | 2016-05-24T21:18:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,522 | py | import numpy as np
import theano.tensor as T
from neupy.core.properties import ProperFractionProperty, TypedListProperty
from .base import BaseLayer
__all__ = ('Dropout', 'Reshape')
class Dropout(BaseLayer):
""" Dropout layer
Parameters
----------
proba : float
Fraction of the input units to drop. Value needs to be
between 0 and 1.
"""
proba = ProperFractionProperty(required=True)
def __init__(self, proba, **options):
options['proba'] = proba
super(Dropout, self).__init__(**options)
@property
def size(self):
return self.relate_to_layer.size
def output(self, input_value):
# Use NumPy seed to make Theano code easely reproducible
max_possible_seed = 4e9
seed = np.random.randint(max_possible_seed)
theano_random = T.shared_randomstreams.RandomStreams(seed)
proba = (1.0 - self.proba)
mask = theano_random.binomial(n=1, p=proba,
size=input_value.shape,
dtype=input_value.dtype)
return (mask * input_value) / proba
def __repr__(self):
return "{name}(proba={proba})".format(
name=self.__class__.__name__,
proba=self.proba
)
class Reshape(BaseLayer):
""" Gives a new shape to an input value without changing
its data.
Parameters
----------
shape : tuple or list
New feature shape. ``None`` value means that feature
will be flatten in 1D vector. If you need to get the
output feature with more that 2 dimensions then you can
set up new feature shape using tuples. Defaults to ``None``.
"""
shape = TypedListProperty()
def __init__(self, shape=None, **options):
if shape is not None:
options['shape'] = shape
super(Reshape, self).__init__(**options)
def output(self, input_value):
""" Reshape the feature space for the input value.
Parameters
----------
input_value : array-like or Theano variable
"""
new_feature_shape = self.shape
input_shape = input_value.shape[0]
if new_feature_shape is None:
output_shape = input_value.shape[1:]
new_feature_shape = T.prod(output_shape)
output_shape = (input_shape, new_feature_shape)
else:
output_shape = (input_shape,) + new_feature_shape
return T.reshape(input_value, output_shape)
| [
"[email protected]"
]
| |
b63a247f0dd508911578fa7843a6d083a5623821 | ab79f8297105a7d412303a8b33eaa25038f38c0b | /mutif_all_vit_addons/vit_order_analysis/sale_order_analysis.py | c0ecfe10c045ce7610f50f2b9d062756034a7600 | []
| no_license | adahra/addons | 41a23cbea1e35079f7a9864ade3c32851ee2fb09 | c5a5678379649ccdf57a9d55b09b30436428b430 | refs/heads/master | 2022-06-17T21:22:22.306787 | 2020-05-15T10:51:14 | 2020-05-15T10:51:14 | 264,167,002 | 1 | 0 | null | 2020-05-15T10:39:26 | 2020-05-15T10:39:26 | null | UTF-8 | Python | false | false | 1,273 | py | from openerp import tools
from openerp.osv import fields,osv
import openerp.addons.decimal_precision as dp
import time
import logging
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
class sale_order_analysis(osv.osv):
_name = "vit_order_analysis.sale_order_analysis"
_columns = {
'order_id' : fields.many2one('sale.order', 'Sale Order'),
'order_date' : fields.related('order_id', 'date_order' ,
type="char", relation="sale.order", string="Order Date", store=True),
'product_id' : fields.many2one('product.product', 'Product'),
'categ_id' : fields.related('product_id', 'categ_id' , type="many2one",
relation="product.category", string="Category", store=True),
'name_template' : fields.char("Product Name"),
'real_order' : fields.float("Real Order"),
'qty_order' : fields.float("Qty Order"),
'delivered' : fields.float("Delivered"),
'back_order' : fields.float("Back Order"),
'unfilled' : fields.float("Un-Filled"),
'partner_id' : fields.many2one('res.partner','Partner',readonly=True),
'age' : fields.integer('Age (Days)'),
'status' : fields.related('order_id', 'state' ,
type="char", string="Status", store=True),
'qty_invoice' : fields.float("Qty in Invoice"),
} | [
"prog1@381544ba-743e-41a5-bf0d-221725b9d5af"
]
| prog1@381544ba-743e-41a5-bf0d-221725b9d5af |
97dd34b3acce5c12e2addd1d0a29713f76135553 | f4b60f5e49baf60976987946c20a8ebca4880602 | /lib64/python2.7/site-packages/acimodel-1.3_2j-py2.7.egg/cobra/modelimpl/eqptcapacity/bdentryhist1qtr.py | 9064eba3f5f878d3153633d8be710cf51ec1d501 | []
| no_license | cqbomb/qytang_aci | 12e508d54d9f774b537c33563762e694783d6ba8 | a7fab9d6cda7fadcc995672e55c0ef7e7187696e | refs/heads/master | 2022-12-21T13:30:05.240231 | 2018-12-04T01:46:53 | 2018-12-04T01:46:53 | 159,911,666 | 0 | 0 | null | 2022-12-07T23:53:02 | 2018-12-01T05:17:50 | Python | UTF-8 | Python | false | false | 11,049 | py | # coding=UTF-8
# **********************************************************************
# Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved
# written by zen warriors, do not modify!
# **********************************************************************
from cobra.mit.meta import ClassMeta
from cobra.mit.meta import StatsClassMeta
from cobra.mit.meta import CounterMeta
from cobra.mit.meta import PropMeta
from cobra.mit.meta import Category
from cobra.mit.meta import SourceRelationMeta
from cobra.mit.meta import NamedSourceRelationMeta
from cobra.mit.meta import TargetRelationMeta
from cobra.mit.meta import DeploymentPathMeta, DeploymentCategory
from cobra.model.category import MoCategory, PropCategory, CounterCategory
from cobra.mit.mo import Mo
# ##################################################
class BDEntryHist1qtr(Mo):
"""
A class that represents historical statistics for bridge domain entry in a 1 quarter sampling interval. This class updates every day.
"""
meta = StatsClassMeta("cobra.model.eqptcapacity.BDEntryHist1qtr", "bridge domain entry")
counter = CounterMeta("normalized", CounterCategory.GAUGE, "percentage", "bridge domain entries usage")
counter._propRefs[PropCategory.IMPLICIT_MIN] = "normalizedMin"
counter._propRefs[PropCategory.IMPLICIT_MAX] = "normalizedMax"
counter._propRefs[PropCategory.IMPLICIT_AVG] = "normalizedAvg"
counter._propRefs[PropCategory.IMPLICIT_SUSPECT] = "normalizedSpct"
counter._propRefs[PropCategory.IMPLICIT_THRESHOLDED] = "normalizedThr"
counter._propRefs[PropCategory.IMPLICIT_TREND] = "normalizedTr"
meta._counters.append(counter)
meta.moClassName = "eqptcapacityBDEntryHist1qtr"
meta.rnFormat = "HDeqptcapacityBDEntry1qtr-%(index)s"
meta.category = MoCategory.STATS_HISTORY
meta.label = "historical bridge domain entry stats in 1 quarter"
meta.writeAccessMask = 0x1
meta.readAccessMask = 0x1
meta.isDomainable = False
meta.isReadOnly = True
meta.isConfigurable = False
meta.isDeletable = False
meta.isContextRoot = True
meta.parentClasses.add("cobra.model.eqptcapacity.Entity")
meta.superClasses.add("cobra.model.stats.Item")
meta.superClasses.add("cobra.model.stats.Hist")
meta.superClasses.add("cobra.model.eqptcapacity.BDEntryHist")
meta.rnPrefixes = [
('HDeqptcapacityBDEntry1qtr-', True),
]
prop = PropMeta("str", "childAction", "childAction", 4, PropCategory.CHILD_ACTION)
prop.label = "None"
prop.isImplicit = True
prop.isAdmin = True
prop._addConstant("deleteAll", "deleteall", 16384)
prop._addConstant("deleteNonPresent", "deletenonpresent", 8192)
prop._addConstant("ignore", "ignore", 4096)
meta.props.add("childAction", prop)
prop = PropMeta("str", "cnt", "cnt", 16212, PropCategory.REGULAR)
prop.label = "Number of Collections During this Interval"
prop.isImplicit = True
prop.isAdmin = True
meta.props.add("cnt", prop)
prop = PropMeta("str", "dn", "dn", 1, PropCategory.DN)
prop.label = "None"
prop.isDn = True
prop.isImplicit = True
prop.isAdmin = True
prop.isCreateOnly = True
meta.props.add("dn", prop)
prop = PropMeta("str", "index", "index", 6346, PropCategory.REGULAR)
prop.label = "History Index"
prop.isConfig = True
prop.isAdmin = True
prop.isCreateOnly = True
prop.isNaming = True
meta.props.add("index", prop)
prop = PropMeta("str", "lastCollOffset", "lastCollOffset", 111, PropCategory.REGULAR)
prop.label = "Collection Length"
prop.isImplicit = True
prop.isAdmin = True
meta.props.add("lastCollOffset", prop)
prop = PropMeta("str", "modTs", "modTs", 7, PropCategory.REGULAR)
prop.label = "None"
prop.isImplicit = True
prop.isAdmin = True
prop.defaultValue = 0
prop.defaultValueStr = "never"
prop._addConstant("never", "never", 0)
meta.props.add("modTs", prop)
prop = PropMeta("str", "normalizedAvg", "normalizedAvg", 8935, PropCategory.IMPLICIT_AVG)
prop.label = "bridge domain entries usage average value"
prop.isOper = True
prop.isStats = True
meta.props.add("normalizedAvg", prop)
prop = PropMeta("str", "normalizedMax", "normalizedMax", 8934, PropCategory.IMPLICIT_MAX)
prop.label = "bridge domain entries usage maximum value"
prop.isOper = True
prop.isStats = True
meta.props.add("normalizedMax", prop)
prop = PropMeta("str", "normalizedMin", "normalizedMin", 8933, PropCategory.IMPLICIT_MIN)
prop.label = "bridge domain entries usage minimum value"
prop.isOper = True
prop.isStats = True
meta.props.add("normalizedMin", prop)
prop = PropMeta("str", "normalizedSpct", "normalizedSpct", 8936, PropCategory.IMPLICIT_SUSPECT)
prop.label = "bridge domain entries usage suspect count"
prop.isOper = True
prop.isStats = True
meta.props.add("normalizedSpct", prop)
prop = PropMeta("str", "normalizedThr", "normalizedThr", 8937, PropCategory.IMPLICIT_THRESHOLDED)
prop.label = "bridge domain entries usage thresholded flags"
prop.isOper = True
prop.isStats = True
prop.defaultValue = 0
prop.defaultValueStr = "unspecified"
prop._addConstant("avgCrit", "avg-severity-critical", 2199023255552)
prop._addConstant("avgHigh", "avg-crossed-high-threshold", 68719476736)
prop._addConstant("avgLow", "avg-crossed-low-threshold", 137438953472)
prop._addConstant("avgMajor", "avg-severity-major", 1099511627776)
prop._addConstant("avgMinor", "avg-severity-minor", 549755813888)
prop._addConstant("avgRecovering", "avg-recovering", 34359738368)
prop._addConstant("avgWarn", "avg-severity-warning", 274877906944)
prop._addConstant("cumulativeCrit", "cumulative-severity-critical", 8192)
prop._addConstant("cumulativeHigh", "cumulative-crossed-high-threshold", 256)
prop._addConstant("cumulativeLow", "cumulative-crossed-low-threshold", 512)
prop._addConstant("cumulativeMajor", "cumulative-severity-major", 4096)
prop._addConstant("cumulativeMinor", "cumulative-severity-minor", 2048)
prop._addConstant("cumulativeRecovering", "cumulative-recovering", 128)
prop._addConstant("cumulativeWarn", "cumulative-severity-warning", 1024)
prop._addConstant("lastReadingCrit", "lastreading-severity-critical", 64)
prop._addConstant("lastReadingHigh", "lastreading-crossed-high-threshold", 2)
prop._addConstant("lastReadingLow", "lastreading-crossed-low-threshold", 4)
prop._addConstant("lastReadingMajor", "lastreading-severity-major", 32)
prop._addConstant("lastReadingMinor", "lastreading-severity-minor", 16)
prop._addConstant("lastReadingRecovering", "lastreading-recovering", 1)
prop._addConstant("lastReadingWarn", "lastreading-severity-warning", 8)
prop._addConstant("maxCrit", "max-severity-critical", 17179869184)
prop._addConstant("maxHigh", "max-crossed-high-threshold", 536870912)
prop._addConstant("maxLow", "max-crossed-low-threshold", 1073741824)
prop._addConstant("maxMajor", "max-severity-major", 8589934592)
prop._addConstant("maxMinor", "max-severity-minor", 4294967296)
prop._addConstant("maxRecovering", "max-recovering", 268435456)
prop._addConstant("maxWarn", "max-severity-warning", 2147483648)
prop._addConstant("minCrit", "min-severity-critical", 134217728)
prop._addConstant("minHigh", "min-crossed-high-threshold", 4194304)
prop._addConstant("minLow", "min-crossed-low-threshold", 8388608)
prop._addConstant("minMajor", "min-severity-major", 67108864)
prop._addConstant("minMinor", "min-severity-minor", 33554432)
prop._addConstant("minRecovering", "min-recovering", 2097152)
prop._addConstant("minWarn", "min-severity-warning", 16777216)
prop._addConstant("periodicCrit", "periodic-severity-critical", 1048576)
prop._addConstant("periodicHigh", "periodic-crossed-high-threshold", 32768)
prop._addConstant("periodicLow", "periodic-crossed-low-threshold", 65536)
prop._addConstant("periodicMajor", "periodic-severity-major", 524288)
prop._addConstant("periodicMinor", "periodic-severity-minor", 262144)
prop._addConstant("periodicRecovering", "periodic-recovering", 16384)
prop._addConstant("periodicWarn", "periodic-severity-warning", 131072)
prop._addConstant("rateCrit", "rate-severity-critical", 36028797018963968)
prop._addConstant("rateHigh", "rate-crossed-high-threshold", 1125899906842624)
prop._addConstant("rateLow", "rate-crossed-low-threshold", 2251799813685248)
prop._addConstant("rateMajor", "rate-severity-major", 18014398509481984)
prop._addConstant("rateMinor", "rate-severity-minor", 9007199254740992)
prop._addConstant("rateRecovering", "rate-recovering", 562949953421312)
prop._addConstant("rateWarn", "rate-severity-warning", 4503599627370496)
prop._addConstant("trendCrit", "trend-severity-critical", 281474976710656)
prop._addConstant("trendHigh", "trend-crossed-high-threshold", 8796093022208)
prop._addConstant("trendLow", "trend-crossed-low-threshold", 17592186044416)
prop._addConstant("trendMajor", "trend-severity-major", 140737488355328)
prop._addConstant("trendMinor", "trend-severity-minor", 70368744177664)
prop._addConstant("trendRecovering", "trend-recovering", 4398046511104)
prop._addConstant("trendWarn", "trend-severity-warning", 35184372088832)
prop._addConstant("unspecified", None, 0)
meta.props.add("normalizedThr", prop)
prop = PropMeta("str", "normalizedTr", "normalizedTr", 8938, PropCategory.IMPLICIT_TREND)
prop.label = "bridge domain entries usage trend"
prop.isOper = True
prop.isStats = True
meta.props.add("normalizedTr", prop)
prop = PropMeta("str", "repIntvEnd", "repIntvEnd", 110, PropCategory.REGULAR)
prop.label = "Reporting End Time"
prop.isImplicit = True
prop.isAdmin = True
meta.props.add("repIntvEnd", prop)
prop = PropMeta("str", "repIntvStart", "repIntvStart", 109, PropCategory.REGULAR)
prop.label = "Reporting Start Time"
prop.isImplicit = True
prop.isAdmin = True
meta.props.add("repIntvStart", prop)
prop = PropMeta("str", "rn", "rn", 2, PropCategory.RN)
prop.label = "None"
prop.isRn = True
prop.isImplicit = True
prop.isAdmin = True
prop.isCreateOnly = True
meta.props.add("rn", prop)
prop = PropMeta("str", "status", "status", 3, PropCategory.STATUS)
prop.label = "None"
prop.isImplicit = True
prop.isAdmin = True
prop._addConstant("created", "created", 2)
prop._addConstant("deleted", "deleted", 8)
prop._addConstant("modified", "modified", 4)
meta.props.add("status", prop)
meta.namingProps.append(getattr(meta.props, "index"))
def __init__(self, parentMoOrDn, index, markDirty=True, **creationProps):
namingVals = [index]
Mo.__init__(self, parentMoOrDn, markDirty, *namingVals, **creationProps)
# End of package file
# ##################################################
| [
"[email protected]"
]
| |
86c3fa0419163a6f6c84f50c5591118e84995339 | 53fab060fa262e5d5026e0807d93c75fb81e67b9 | /backup/user_233/ch29_2020_03_04_11_52_21_685286.py | 86e106c02ae7810c6ae8a20278ff5d4c498791af | []
| no_license | gabriellaec/desoft-analise-exercicios | b77c6999424c5ce7e44086a12589a0ad43d6adca | 01940ab0897aa6005764fc220b900e4d6161d36b | refs/heads/main | 2023-01-31T17:19:42.050628 | 2020-12-16T05:21:31 | 2020-12-16T05:21:31 | 306,735,108 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 497 | py | inicial = float(input())
taxa = float(input())
aumento = 0
for i in range(24):
valor = inicial * taxa ** i
aumento += valor - inicial
decimos = int(valor * 10 - int(valor))
centesimos = int(valor * 100 - decimos * 10 - int(valor) * 100)
print('%d,%d%d' % (int(valor), decimos, centesimos))
decimos = int(aumento * 10 - int(aumento))
centesimos = int(aumento * 100 - decimos * 10 - int(aumento))
print('%d,%d%d' % (int(aumento), decimos, centesimos) | [
"[email protected]"
]
| |
4f349f89eb2be66ea2a6218beb51cb31cef6cd36 | 8e62465c912ccbe41e322006a5c62b883e39143d | /src/boot/commands.py | 91a37e3fd7c203c3e16b96d277ed893a5ada17b4 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
]
| permissive | JayHeng/NXP-MCUBootFlasher | b41dd2ffe0bf2cde61b9deacdb6353835e9e4538 | a7643b2de6429481c3bf54bc2508d7e76c76562d | refs/heads/master | 2022-05-27T06:26:49.532173 | 2022-03-21T07:23:01 | 2022-03-21T07:23:01 | 176,099,535 | 37 | 16 | Apache-2.0 | 2022-03-14T06:28:23 | 2019-03-17T12:42:14 | Python | UTF-8 | Python | false | false | 3,357 | py | #! /usr/bin/env python
# Copyright 2021 NXP
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
from collections import namedtuple
# Command constants.
kCommandTag_FlashEraseAll = 0x01
kCommandTag_FlashEraseRegion = 0x02
kCommandTag_ReadMemory = 0x03
kCommandTag_WriteMemory = 0x04
kCommandTag_FillMemory = 0x05
kCommandTag_FlashSecurityDisable = 0x06
kCommandTag_GetProperty = 0x07
kCommandTag_ReceiveSBFile = 0x08
kCommandTag_Execute = 0x09
kCommandTag_Call = 0x0a
kCommandTag_Reset = 0x0b
kCommandTag_SetProperty = 0x0c
kCommandTag_FlashEraseAllUnsecure = 0x0d
kCommandTag_FlashProgramOnce = 0x0e,
kCommandTag_FlashReadOnce = 0x0f,
kCommandTag_FlashReadResource = 0x10,
kCommandTag_ConfigureMemory = 0x11,
kCommandTag_ReliableUpdate = 0x12,
kCommandTag_GenerateKeyBlob = 0x13,
kCommandTag_KeyProvisoning = 0x15,
Command = namedtuple('Command', 'tag, propertyMask, name')
Commands = {
kCommandTag_FlashEraseAll : Command(kCommandTag_FlashEraseAll, 0x00000001, 'flash-erase-all'),
kCommandTag_FlashEraseRegion : Command(kCommandTag_FlashEraseRegion, 0x00000002, 'flash-erase-region'),
kCommandTag_ReadMemory : Command(kCommandTag_ReadMemory, 0x00000004, 'read-memory'),
kCommandTag_WriteMemory : Command(kCommandTag_WriteMemory, 0x00000008, 'write-memory'),
kCommandTag_FillMemory : Command(kCommandTag_FillMemory, 0x00000010, 'fill-memory'),
kCommandTag_FlashSecurityDisable : Command(kCommandTag_FlashSecurityDisable, 0x00000020, 'flash-security-disable'),
kCommandTag_GetProperty : Command(kCommandTag_GetProperty, 0x00000040, 'get-property'),
kCommandTag_ReceiveSBFile : Command(kCommandTag_ReceiveSBFile, 0x00000080, 'receive-sb-file'),
kCommandTag_Execute : Command(kCommandTag_Execute, 0x00000100, 'execute'),
kCommandTag_Call : Command(kCommandTag_Call, 0x00000200, 'call'),
kCommandTag_Reset : Command(kCommandTag_Reset, 0x00000400, 'reset'),
kCommandTag_SetProperty : Command(kCommandTag_SetProperty, 0x00000800, 'set-property'),
kCommandTag_FlashEraseAllUnsecure : Command(kCommandTag_FlashEraseAllUnsecure, 0x00001000, 'flash-erase-all-unsecure'),
kCommandTag_FlashProgramOnce : Command(kCommandTag_FlashProgramOnce, 0x00002000, 'flash-program-once'),
kCommandTag_FlashReadOnce : Command(kCommandTag_FlashReadOnce, 0x00004000, 'flash-read-once'),
kCommandTag_FlashReadResource : Command(kCommandTag_FlashReadResource, 0x00008000, 'flash-read-resource'),
kCommandTag_ConfigureMemory : Command(kCommandTag_ConfigureMemory, 0x00010000, 'configure-memory'),
kCommandTag_ReliableUpdate : Command(kCommandTag_ReliableUpdate, 0x00100000, 'reliable-update'),
kCommandTag_GenerateKeyBlob : Command(kCommandTag_GenerateKeyBlob, 0x00200000, 'generate-key-blob'),
kCommandTag_KeyProvisoning : Command(kCommandTag_KeyProvisoning, 0x00400000, 'key-provisioning'),
}
| [
"[email protected]"
]
| |
796e00eb1d56efcf0a57251345c0236b3a28f9da | 16e69196886254bc0fe9d8dc919ebcfa844f326a | /edc/base/modeladmin/admin/base_model_admin.py | 5b0f9d99161144063c25f8b56d2d0ac3ca00c756 | []
| no_license | botswana-harvard/edc | b54edc305e7f4f6b193b4498c59080a902a6aeee | 4f75336ff572babd39d431185677a65bece9e524 | refs/heads/master | 2021-01-23T19:15:08.070350 | 2015-12-07T09:36:41 | 2015-12-07T09:36:41 | 35,820,838 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 20,157 | py | import logging
import re
from datetime import datetime
from django.contrib import admin
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import NoReverseMatch
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.encoding import force_unicode
from edc.entry_meta_data.helpers import ScheduledEntryMetaDataHelper
from edc.subject.rule_groups.classes import site_rule_groups
from edc.base.modeladmin import NextUrlError
logger = logging.getLogger(__name__)
class NullHandler(logging.Handler):
def emit(self, record):
pass
nullhandler = logger.addHandler(NullHandler())
class BaseModelAdmin (admin.ModelAdmin):
list_per_page = 15
instructions = ['Please complete the questions below.']
required_instructions = ('Required questions are in bold. '
'When all required data has been entered click SAVE to return to the dashboard '
'or SAVE NEXT to go to the next form (if available). Additional questions may be required or may need to be corrected when you attempt to save.')
def __init__(self, *args):
if not isinstance(self.instructions, list):
raise ImproperlyConfigured('ModelAdmin {0} attribute \'instructions\' must be a list.'.format(self.__class__))
if not isinstance(self.required_instructions, basestring):
raise ImproperlyConfigured('ModelAdmin {0} attribute \'required_instructions\' must be a list.'.format(self.__class__))
super(BaseModelAdmin, self).__init__(*args)
def save_model(self, request, obj, form, change):
self.update_modified_stamp(request, obj, change)
super(BaseModelAdmin, self).save_model(request, obj, form, change)
def contribute_to_extra_context(self, extra_context, object_id=None):
return extra_context
def add_view(self, request, form_url='', extra_context=None):
extra_context = extra_context or dict()
extra_context = self.contribute_to_extra_context(extra_context)
extra_context.update(instructions=self.instructions)
extra_context.update(required_instructions=self.required_instructions)
extra_context.update(form_language_code=request.GET.get('form_language_code', ''))
if request.GET.get('group_title'):
extra_context.update(title=('{group_title}: Add {title}').format(group_title=request.GET.get('group_title'), title=force_unicode(self.model._meta.verbose_name)))
extra_context.update(self.get_dashboard_context(request))
# model_help_text = '' #self.get_model_help_text(self.model._meta.app_label, self.model._meta.object_name)
# extra_context.update(model_help_text_meta=model_help_text[META], model_help_text=model_help_text[DCT])
return super(BaseModelAdmin, self).add_view(request, form_url=form_url, extra_context=extra_context)
def change_view(self, request, object_id, form_url='', extra_context=None):
extra_context = extra_context or dict()
extra_context = self.contribute_to_extra_context(extra_context, object_id)
extra_context.update(instructions=self.instructions)
extra_context.update(required_instructions=self.required_instructions)
extra_context.update(form_language_code=request.GET.get('form_language_code', ''))
if request.GET.get('group_title'):
extra_context.update(title=('{group_title}: Add {title}').format(group_title=request.GET.get('group_title'), title=force_unicode(self.model._meta.verbose_name)))
extra_context.update(self.get_dashboard_context(request))
result = super(BaseModelAdmin, self).change_view(request, object_id, form_url=form_url, extra_context=extra_context)
# Look at the referer for a query string '^.*\?.*$'
ref = request.META.get('HTTP_REFERER', '')
if ref.find('?') != -1:
# We've got a query string, set the session value
request.session['filtered'] = ref
return result
def response_add(self, request, obj, post_url_continue=None):
"""Redirects as default unless keyword 'next' is in the GET and is a valid url_name (e.g. can be reversed using other GET values)."""
http_response_redirect = super(BaseModelAdmin, self).response_add(request, obj, post_url_continue)
custom_http_response_redirect = None
if '_addanother' not in request.POST and '_continue' not in request.POST:
if request.GET.get('next'):
custom_http_response_redirect = self.response_add_redirect_on_next_url(
request.GET.get('next'),
request,
obj,
post_url_continue,
post_save=request.POST.get('_save'),
post_save_next=request.POST.get('_savenext'),
post_cancel=request.POST.get('_cancel'))
return custom_http_response_redirect or http_response_redirect
def response_change(self, request, obj, post_url_continue=None):
"""Redirects as default unless keyword 'next' is in the GET and is a valid url_name (e.g. can be reversed using other GET values)."""
http_response_redirect = super(BaseModelAdmin, self).response_add(request, obj, post_url_continue)
custom_http_response_redirect = None
if '_addanother' not in request.POST and '_continue' not in request.POST:
# look for session variable "filtered" set in change_view
if request.session.get('filtered', None):
if 'next=' not in request.session.get('filtered'):
# return to the changelist using the same changelist filter, e.g. ?q=Erik
custom_http_response_redirect = HttpResponseRedirect(request.session['filtered'])
request.session['filtered'] = None
if request.GET.get('next'):
# go back to the dashboard or something custom
custom_http_response_redirect = self.reponse_change_redirect_on_next_url(
request.GET.get('next'),
request,
obj,
post_url_continue,
post_save=request.POST.get('_save'),
post_save_next=request.POST.get('_savenext'),
post_cancel=request.POST.get('_cancel'))
return custom_http_response_redirect or http_response_redirect
def response_add_redirect_on_next_url(self, next_url_name, request, obj, post_url_continue, post_save=None, post_save_next=None, post_cancel=None):
"""Returns a http_response_redirect when called using the next_url_name.
Users may override to to add special handling for a named url next_url_name."""
custom_http_response_redirect = None
if not next_url_name:
raise NextUrlError('Attribute \'next_url_name\' may not be none. Check the GET parameter \'next\' in your url.')
else:
url = None
if next_url_name in ['changelist', 'add']:
# reverse to a default admin url
# next_url_name is "mode" and is being used to get to the default admin add or changelist
mode = next_url_name
app_label = request.GET.get('app_label')
module_name = request.GET.get('module_name')
if module_name:
module_name = module_name.lower()
if not app_label or not module_name:
raise NextUrlError('next_url_name shortcut \'{0}\' (next={0}) requires GET attributes \'app_label\' and \'module_name\'. Got app_label={1}, module_name={2}.'.format(next_url_name, app_label, module_name))
url = reverse('admin:{app_label}_{module_name}_{mode}'.format(app_label=app_label, module_name=module_name, mode=mode))
else:
try:
# try to reverse using the next_url_name and the all values in the GET string
# less ['next', 'dashboard_id', 'dashboard_model', 'dashboard_type', 'show'].
# dashbord_xx values are excluded because we do not want to intercept a dashboard url here
kwargs = dict()
[kwargs.update({key: value}) for key, value in request.GET.iteritems() if key not in ['next', 'dashboard_id', 'dashboard_model', 'dashboard_type', 'show']]
if kwargs:
url = reverse(next_url_name, kwargs=kwargs)
except NoReverseMatch:
# ok, failed to reverse with exactly what was given
dashboard_id = request.GET.get('dashboard_id')
dashboard_model = request.GET.get('dashboard_model')
dashboard_type = request.GET.get('dashboard_type')
entry_order = request.GET.get('entry_order')
visit_attr = request.GET.get('visit_attr')
help_link = request.GET.get('help_link') # help link added to custom change form
show = request.GET.get('show', 'any')
# at this point we may have a url
# 1. an admin url (default)
# 2. a reversed url using next= and all other non-dashboard GET values
# if we do not have a url, then we have set the dashboard values
# and will treat the next url as a dashboard url
if not url:
if post_save:
# will default to a url that takes us back to the subject dashoard below
pass
elif post_save_next:
# post_save_next is only available to subject forms
# try to reverse using method next_url_in_scheduled_entry_meta_data()
# which jumps to the next form on the subject dashboard instead of going
# back to the subject dashboard
try:
next_url, visit_model_instance, entry_order = self.next_url_in_scheduled_entry_meta_data(obj, visit_attr, entry_order)
if next_url:
url = ('{next_url}?next={next}&dashboard_type={dashboard_type}&dashboard_id={dashboard_id}'
'&dashboard_model={dashboard_model}&show={show}{visit_attr}{visit_model_instance}{entry_order}{help_link}'
).format(next_url=next_url,
next=next_url_name,
dashboard_type=dashboard_type,
dashboard_id=dashboard_id,
dashboard_model=dashboard_model,
show=show,
visit_attr='&visit_attr={0}'.format(visit_attr),
visit_model_instance='&{0}={1}'.format(visit_attr, visit_model_instance.pk),
entry_order='&entry_order={0}'.format(entry_order),
help_link='&help_link={0}'.format(help_link))
except NoReverseMatch:
pass
elif post_cancel:
# cancel goes back to the dashboard
# FIXME: i think the URL for the cancel button/link is calculated for by the dashboard
# for the template or reversed on the template, so this might
# be code that cannot be reached
url = reverse(
'subject_dashboard_url', kwargs={ # TODO: this defaults to the value subject_dashboard_url, not the variable!!!
'dashboard_type': dashboard_type,
'dashboard_id': dashboard_id,
'dashboard_model': dashboard_model,
'show': show})
else:
pass
if not url:
# default back to the dashboard
url = self.reverse_next_to_dashboard(next_url_name, request, obj)
custom_http_response_redirect = HttpResponseRedirect(url)
return custom_http_response_redirect
def reponse_change_redirect_on_next_url(self, next_url_name, request, obj, post_url_continue, post_save, post_save_next, post_cancel):
"""Returns an http_response_redirect if next_url_name can be reversed otherwise None.
Users may override to to add special handling for a named url next_url_name.
.. note:: currently this assumes the next_url_name is reversible using dashboard criteria or returns nothing."""
custom_http_response_redirect = None
if 'dashboard' in next_url_name: # FIXME: find a better way to intercept dashboard urls and ignore others
url = self.reverse_next_to_dashboard(next_url_name, request, obj)
custom_http_response_redirect = HttpResponseRedirect(url)
request.session['filtered'] = None
else:
change_list_q = ''
kwargs = {}
[kwargs.update({key: value}) for key, value in request.GET.iteritems() if key != 'next']
try:
if '_add' in next_url_name:
url = reverse(next_url_name)
elif '_changelist' in next_url_name:
url = reverse(next_url_name)
if kwargs.get('q', None) and kwargs.get('q') != 'None':
change_list_q = '?q={}'.format(kwargs.get('q'))
else:
url = reverse(next_url_name, kwargs=kwargs)
except NoReverseMatch:
try:
# try reversing to the url from just section_name
url = reverse(next_url_name, kwargs={'section_name': kwargs.get('section_name')})
except NoReverseMatch:
raise NoReverseMatch('response_change failed to reverse url \'{0}\' with kwargs {1}. Is this a dashboard url?'.format(next_url_name, kwargs))
custom_http_response_redirect = HttpResponseRedirect('{}{}'.format(url, change_list_q))
request.session['filtered'] = None
return custom_http_response_redirect
def get_form_prep(self, request, obj=None, **kwargs):
pass
def get_form_post(self, form, request, obj=None, **kwargs):
return form
def get_form(self, request, obj=None, **kwargs):
"""Overrides to check if supplemental fields have been defined in the admin class.
* get_form is called once to render and again to save, e.g. on GET and then on POST.
* Need to be sure that the same supplemental choice is given on GET and POST for both
add and change.
"""
self.get_form_prep(request, obj, **kwargs)
form = super(BaseModelAdmin, self).get_form(request, obj, **kwargs)
form = self.get_form_post(form, request, obj, **kwargs)
form = self.auto_number(form)
return form
def update_modified_stamp(self, request, obj, change):
"""Forces username to be saved on add/change and other stuff, called from save_model"""
if not change:
obj.user_created = request.user.username
if change:
obj.user_modified = request.user.username
obj.modified = datetime.today()
def insert_translation_help_text(self, form):
WIDGET = 1
for fld in form.base_fields.iteritems():
fld[WIDGET].translation_help_text = unicode('translation')
return form
def auto_number(self, form):
WIDGET = 1
auto_number = True
if 'auto_number' in dir(form._meta):
auto_number = form._meta.auto_number
if auto_number:
for index, fld in enumerate(form.base_fields.iteritems()):
if not re.match(r'^\d+\.', unicode(fld[WIDGET].label)):
fld[WIDGET].label = '{0}. {1}'.format(unicode(index + 1), unicode(fld[WIDGET].label))
return form
def get_dashboard_context(self, request):
return {'subject_dashboard_url': request.GET.get('next', ''),
'dashboard_type': request.GET.get('dashboard_type', ''),
'dashboard_model': request.GET.get('dashboard_model', ''),
'dashboard_id': request.GET.get('dashboard_id', ''),
'show': request.GET.get('show', 'any')}
def reverse_next_to_dashboard(self, next_url_name, request, obj, **kwargs):
url = ''
if next_url_name and request.GET.get('dashboard_id') and request.GET.get('dashboard_model') and request.GET.get('dashboard_type'):
kwargs = {'dashboard_id': request.GET.get('dashboard_id'),
'dashboard_model': request.GET.get('dashboard_model'),
'dashboard_type': request.GET.get('dashboard_type')}
# a subject dashboard url will also have "show"
if request.GET.get('show'): # this may fail if a subject template does not set show
kwargs.update({'show': request.GET.get('show', 'any')})
url = reverse(next_url_name, kwargs=kwargs)
elif next_url_name in ['changelist', 'add']:
app_label = request.GET.get('app_label')
module_name = request.GET.get('module_name').lower()
mode = next_url_name
url = reverse('admin:{app_label}_{module_name}_{mode}'.format(app_label=app_label, module_name=module_name, mode=mode))
else:
# normally you should not be here.
try:
kwargs = self.convert_get_to_kwargs(request, obj)
url = reverse(next_url_name, kwargs=kwargs)
except NoReverseMatch:
try:
# try reversing to the url from just section_name
url = reverse(next_url_name, kwargs={'section_name': kwargs.get('section_name')})
except NoReverseMatch:
raise NoReverseMatch('response_add failed to reverse url \'{0}\' with kwargs {1}. Is this a dashboard url?'.format(next_url_name, kwargs))
except:
raise
return url
def convert_get_to_kwargs(self, request, obj):
kwargs = dict()
for k, v in request.GET.iteritems():
kwargs.update({str(k): ''.join(unicode(i) for i in request.GET.get(k))})
if not v:
if k in dir(obj):
try:
kwargs.update({str(k): getattr(obj, k)})
except AttributeError:
pass
if 'next' in kwargs:
del kwargs['next']
if 'csrfmiddlewaretoken' in kwargs:
del kwargs['csrfmiddlewaretoken']
return kwargs
def next_url_in_scheduled_entry_meta_data(self, obj, visit_attr, entry_order):
"""Returns a tuple with the reverse of the admin url for the next model listed in scheduled_entry_meta_data.
If there is not a "next" model, returns an empty tuple (None, None, None).
Called from response_add and response_change."""
next_url_tuple = (None, None, None)
if visit_attr and entry_order:
visit_instance = getattr(obj, visit_attr)
# site_rule_groups.update_all(visit_instance)
site_rule_groups.update_rules_for_source_model(obj, visit_instance)
next_entry = ScheduledEntryMetaDataHelper(visit_instance.get_appointment(), visit_instance.__class__, visit_attr).get_next_entry_for(entry_order)
if next_entry:
next_url_tuple = (
reverse('admin:{0}_{1}_add'.format(next_entry.entry.content_type_map.app_label, next_entry.entry.content_type_map.module_name)),
visit_instance,
next_entry.entry.entry_order
)
return next_url_tuple
| [
"[email protected]"
]
| |
747707c028e314a5eff983e4a9e35bede5aae0c0 | fb133bb72cbc965f405e726796e02d01ef8905e2 | /combinatorics/permutations.py | 25809abf4e33cb533feaca93aa0fc997e499ce67 | [
"Unlicense",
"LicenseRef-scancode-public-domain"
]
| permissive | eklitzke/algorithms | a90b470c6ea485b3b6227fe74b23f40109cfd1f5 | 170b49c7aaeb06f0a91142b1c04e47246ec52fd1 | refs/heads/master | 2021-01-22T11:15:52.029559 | 2017-05-28T19:39:32 | 2017-05-28T19:39:32 | 92,677,550 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 621 | py | """Implementation of permutations.
This uses the "interleaving" technique, which I find the most intuitive. It's
not the most efficient algorithm.
"""
def interleave(x, xs):
"""Interleave x into xs."""
for pos in range(len(xs) + 1):
yield xs[:pos] + [x] + xs[pos:]
def permutations(xs):
"""Generate the permuations of xs."""
if len(xs) == 0:
yield []
else:
for subperm in permutations(xs[1:]):
for inter in interleave(xs[0], subperm):
yield inter
def list_permutations(xs):
"""Permutations as a list."""
return list(permutations(xs))
| [
"[email protected]"
]
| |
0d4217a71c1443b49fbe2b08c76d0a241f2633fd | c237dfae82e07e606ba9385b336af8173d01b251 | /lib/python/Products/ZCTextIndex/tests/mailtest.py | e8852d178ca4296bb828459acad38e1cdfcd1f25 | [
"ZPL-2.0"
]
| permissive | OS2World/APP-SERVER-Zope | 242e0eec294bfb1ac4e6fa715ed423dd2b3ea6ff | dedc799bd7eda913ffc45da43507abe2fa5113be | refs/heads/master | 2020-05-09T18:29:47.818789 | 2014-11-07T01:48:29 | 2014-11-07T01:48:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,988 | py | """Test an index with a Unix mailbox file.
usage: python mailtest.py [options] <data.fs>
options:
-v -- verbose
Index Generation
-i mailbox
-n NNN -- max number of messages to read from mailbox
-t NNN -- commit a transaction every NNN messages (default: 1)
-p NNN -- pack <data.fs> every NNN messages (default: 500), and at end
-p 0 -- don't pack at all
-x -- exclude the message text from the data.fs
Queries
-q query
-b NNN -- return the NNN best matches (default: 10)
-c NNN -- context; if -v, show the first NNN lines of results (default: 5)
The script either indexes or queries depending on whether -q or -i is
passed as an option.
For -i mailbox, the script reads mail messages from the mailbox and
indexes them. It indexes one message at a time, then commits the
transaction.
For -q query, it performs a query on an existing index.
If both are specified, the index is performed first.
You can also interact with the index after it is completed. Load the
index from the database:
import ZODB
from ZODB.FileStorage import FileStorage
fs = FileStorage(<data.fs>
db = ZODB.DB(fs)
index = cn.open().root()["index"]
index.search("python AND unicode")
"""
import ZODB
import ZODB.FileStorage
from Products.ZCTextIndex.Lexicon import \
Lexicon, CaseNormalizer, Splitter, StopWordRemover
from Products.ZCTextIndex.ZCTextIndex import ZCTextIndex
from BTrees.IOBTree import IOBTree
from Products.ZCTextIndex.QueryParser import QueryParser
import sys
import mailbox
import time
def usage(msg):
print msg
print __doc__
sys.exit(2)
class Message:
total_bytes = 0
def __init__(self, msg):
subject = msg.getheader('subject', '')
author = msg.getheader('from', '')
if author:
summary = "%s (%s)\n" % (subject, author)
else:
summary = "%s\n" % subject
self.text = summary + msg.fp.read()
Message.total_bytes += len(self.text)
class Extra:
pass
def index(rt, mboxfile, db, profiler):
global NUM
idx_time = 0
pack_time = 0
start_time = time.time()
lexicon = Lexicon(Splitter(), CaseNormalizer(), StopWordRemover())
extra = Extra()
extra.lexicon_id = 'lexicon'
extra.doc_attr = 'text'
extra.index_type = 'Okapi BM25 Rank'
caller = Extra()
caller.lexicon = lexicon
rt["index"] = idx = ZCTextIndex("index", extra, caller)
if not EXCLUDE_TEXT:
rt["documents"] = docs = IOBTree()
else:
docs = None
get_transaction().commit()
mbox = mailbox.UnixMailbox(open(mboxfile, 'rb'))
if VERBOSE:
print "opened", mboxfile
if not NUM:
NUM = sys.maxint
if profiler:
itime, ptime, i = profiler.runcall(indexmbox, mbox, idx, docs, db)
else:
itime, ptime, i = indexmbox(mbox, idx, docs, db)
idx_time += itime
pack_time += ptime
get_transaction().commit()
if PACK_INTERVAL and i % PACK_INTERVAL != 0:
if VERBOSE >= 2:
print "packing one last time..."
p0 = time.clock()
db.pack(time.time())
p1 = time.clock()
if VERBOSE:
print "pack took %s sec" % (p1 - p0)
pack_time += p1 - p0
if VERBOSE:
finish_time = time.time()
print
print "Index time", round(idx_time / 60, 3), "minutes"
print "Pack time", round(pack_time / 60, 3), "minutes"
print "Index bytes", Message.total_bytes
rate = (Message.total_bytes / idx_time) / 1024
print "Index rate %.2f KB/sec" % rate
print "Indexing began", time.ctime(start_time)
print "Indexing ended", time.ctime(finish_time)
print "Wall clock minutes", round((finish_time - start_time)/60, 3)
def indexmbox(mbox, idx, docs, db):
idx_time = 0
pack_time = 0
i = 0
while i < NUM:
_msg = mbox.next()
if _msg is None:
break
i += 1
msg = Message(_msg)
if VERBOSE >= 2:
print "indexing msg", i
i0 = time.clock()
idx.index_object(i, msg)
if not EXCLUDE_TEXT:
docs[i] = msg
if i % TXN_SIZE == 0:
get_transaction().commit()
i1 = time.clock()
idx_time += i1 - i0
if VERBOSE and i % 50 == 0:
print i, "messages indexed"
print "cache size", db.cacheSize()
if PACK_INTERVAL and i % PACK_INTERVAL == 0:
if VERBOSE >= 2:
print "packing..."
p0 = time.clock()
db.pack(time.time())
p1 = time.clock()
if VERBOSE:
print "pack took %s sec" % (p1 - p0)
pack_time += p1 - p0
return idx_time, pack_time, i
def query(rt, query_str, profiler):
idx = rt["index"]
docs = rt["documents"]
start = time.clock()
if profiler is None:
results, num_results = idx.query(query_str, BEST)
else:
if WARM_CACHE:
print "Warming the cache..."
idx.query(query_str, BEST)
start = time.clock()
results, num_results = profiler.runcall(idx.query, query_str, BEST)
elapsed = time.clock() - start
print "query:", query_str
print "# results:", len(results), "of", num_results, \
"in %.2f ms" % (elapsed * 1000)
tree = QueryParser(idx.lexicon).parseQuery(query_str)
qw = idx.index.query_weight(tree.terms())
for docid, score in results:
scaled = 100.0 * score / qw
print "docid %7d score %6d scaled %5.2f%%" % (docid, score, scaled)
if VERBOSE:
msg = docs[docid]
ctx = msg.text.split("\n", CONTEXT)
del ctx[-1]
print "-" * 60
print "message:"
for l in ctx:
print l
print "-" * 60
def main(fs_path, mbox_path, query_str, profiler):
f = ZODB.FileStorage.FileStorage(fs_path)
db = ZODB.DB(f, cache_size=CACHE_SIZE)
cn = db.open()
rt = cn.root()
if mbox_path is not None:
index(rt, mbox_path, db, profiler)
if query_str is not None:
query(rt, query_str, profiler)
cn.close()
db.close()
f.close()
if __name__ == "__main__":
import getopt
NUM = 0
VERBOSE = 0
PACK_INTERVAL = 500
EXCLUDE_TEXT = 0
CACHE_SIZE = 10000
TXN_SIZE = 1
BEST = 10
CONTEXT = 5
WARM_CACHE = 0
query_str = None
mbox_path = None
profile = None
old_profile = None
try:
opts, args = getopt.getopt(sys.argv[1:], 'vn:p:i:q:b:c:xt:w',
['profile=', 'old-profile='])
except getopt.error, msg:
usage(msg)
if len(args) != 1:
usage("exactly 1 filename argument required")
for o, v in opts:
if o == '-n':
NUM = int(v)
elif o == '-v':
VERBOSE += 1
elif o == '-p':
PACK_INTERVAL = int(v)
elif o == '-q':
query_str = v
elif o == '-i':
mbox_path = v
elif o == '-b':
BEST = int(v)
elif o == '-x':
EXCLUDE_TEXT = 1
elif o == '-t':
TXN_SIZE = int(v)
elif o == '-c':
CONTEXT = int(v)
elif o == '-w':
WARM_CACHE = 1
elif o == '--profile':
profile = v
elif o == '--old-profile':
old_profile = v
fs_path, = args
if profile:
import hotshot
profiler = hotshot.Profile(profile, lineevents=1, linetimings=1)
elif old_profile:
import profile
profiler = profile.Profile()
else:
profiler = None
main(fs_path, mbox_path, query_str, profiler)
if profile:
profiler.close()
elif old_profile:
import pstats
profiler.dump_stats(old_profile)
stats = pstats.Stats(old_profile)
stats.strip_dirs().sort_stats('time').print_stats(20)
| [
"[email protected]"
]
| |
4f3c73e27f6f55f81e9f77fb85fc19fbed7f387b | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p02928/s256920562.py | c89b4ce6cab3fe975f18c176f86c82863230a7df | []
| no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 797 | py | #第一回日本最強プログラマー学生選手権-予選- -B Kleene Inversion
"""
リストをk回繰り返したものの、転倒数の個数を求めよ
先ず純粋に与えられたリスト内での転倒数を求めた後、
それを1~k倍したものを足し合わせる
"""
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
mod = 10**9+7
n,k = map(int,readline().split())
lst1 = list(map(int,readline().split()))
fall = 0
fall_al = 0
for i in range(n-1):
for j in range(i+1,n):
if lst1[i] > lst1[j]:
fall += 1
lst1.sort(reverse=True)
for i in range(n-1):
for j in range(i+1,n):
if lst1[i] > lst1[j]:
fall_al += 1
def reydeoro(n):
return n*(n+1)//2
print((fall*k+fall_al*reydeoro(k-1))%mod) | [
"[email protected]"
]
| |
96fd7941d77aa61220eefc52fc789617803291c0 | eaba398a0ca5414c10dd1890e662fdcd87e157b6 | /tests/steps/basic.py | 1ca0ec3034bcc7987e7c7eee0bf0ef965a096c27 | [
"MIT"
]
| permissive | coddingtonbear/jirafs | a78f47e59836d9a6024bc287ea2a1247fb297e62 | 778cba9812f99eeaf726a77c1bca5ae2650a35e9 | refs/heads/development | 2023-06-16T00:06:33.262635 | 2022-09-20T04:06:26 | 2022-09-20T04:06:26 | 21,588,191 | 125 | 17 | MIT | 2023-06-02T05:48:53 | 2014-07-07T21:54:20 | Python | UTF-8 | Python | false | false | 3,047 | py | from __future__ import print_function
import collections
import json
import os
import shutil
import subprocess
from behave import *
from jira.client import JIRA
@given("jirafs is installed and configured")
def installed_and_configured(context):
pass
@given("a cloned ticket with the following fields")
def cloned_ticket_with_following_fields(context):
jira_client = JIRA(
{
"server": context.integration_testing["url"],
"verify": False,
"check_update": False,
},
basic_auth=(
context.integration_testing["username"],
context.integration_testing["password"],
),
)
issue_data = {
"project": {"key": context.integration_testing["project"]},
"issuetype": {
"name": "Task",
},
}
for row in context.table:
issue_data[row[0]] = json.loads(row[1])
issue = jira_client.create_issue(issue_data)
if not "cleanup_steps" in context:
context.cleanup_steps = []
context.cleanup_steps.append(lambda context: issue.delete())
context.execute_steps(
u"""
when the command "jirafs clone {url}" is executed
and we enter the ticket folder for "{url}"
""".format(
url=issue.permalink()
)
)
@when('the command "{command}" is executed')
def execute_command(context, command):
command = command.format(**context.integration_testing)
env = os.environ.copy()
env["JIRAFS_GLOBAL_CONFIG"] = context.integration_testing["config_path"]
env["JIRAFS_ALLOW_USER_INPUT__BOOL"] = "0"
proc = subprocess.Popen(
command.encode("utf-8"),
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env,
)
stdout, stderr = proc.communicate()
if not hasattr(context, "executions"):
context.executions = collections.deque()
context.executions.appendleft(
{
"command": command,
"stdout": stdout.decode("utf-8"),
"stderr": stderr.decode("utf-8"),
"return_code": proc.returncode,
}
)
@when('we enter the ticket folder for "{url}"')
def execute_command(context, url):
url = url.format(**context.integration_testing)
os.chdir(os.path.join(os.getcwd(), url.split("/")[-1]))
@then('the directory will contain a file named "{filename}"')
def directory_contains_file(context, filename):
assert filename in os.listdir("."), "%s not in folder" % filename
@then('the output will contain the text "{expected}"')
def output_will_contain(context, expected):
expected = expected.format(**context.integration_testing)
assert expected in context.executions[0]["stdout"], "%s not in %s" % (
expected,
context.executions[0]["stdout"],
)
@step("print execution results")
def print_stdout(context):
print(json.dumps(context.executions[0], indent=4, sort_keys=True))
@step("debugger")
def debugger(context):
import ipdb
ipdb.set_trace()
| [
"[email protected]"
]
| |
14ebd393b7eb8046d3b0633dd9cde072d9aa2afe | 6061ebee9fbce8eb5b48ed7ccd2aecb196156598 | /modulo02-basico/desafios/desafio04.py | 6b061eeeb1901a297582e79d7c39ea815235dd66 | []
| no_license | DarioCampagnaCoutinho/logica-programacao-python | fdc64871849bea5f5bbf2c342db5fda15778110b | b494bb6ef226c89f4bcfc66f964987046aba692d | refs/heads/master | 2023-02-24T11:45:29.551278 | 2021-01-26T22:02:49 | 2021-01-26T22:02:49 | 271,899,650 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 167 | py | import random
nome1 = 'Dario'
nome2 = 'Maria'
nome3 = 'Ana'
nome4 = 'José'
x = random.choice([nome1, nome2, nome3, nome4])
print('O escolhido foi = {} '.format(x)) | [
"[email protected]"
]
| |
dea33f85af7f66f7636b976164a57c513d9e0b8c | 59166105545cdd87626d15bf42e60a9ee1ef2413 | /test/test_gaelic_games_player_api.py | 652e74921fb7bba2124a47a636a082cc9d1127cd | []
| no_license | mosoriob/dbpedia_api_client | 8c594fc115ce75235315e890d55fbf6bd555fa85 | 8d6f0d04a3a30a82ce0e9277e4c9ce00ecd0c0cc | refs/heads/master | 2022-11-20T01:42:33.481024 | 2020-05-12T23:22:54 | 2020-05-12T23:22:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,057 | py | # coding: utf-8
"""
DBpedia
This is the API of the DBpedia Ontology # noqa: E501
The version of the OpenAPI document: v0.0.1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import dbpedia
from dbpedia.api.gaelic_games_player_api import GaelicGamesPlayerApi # noqa: E501
from dbpedia.rest import ApiException
class TestGaelicGamesPlayerApi(unittest.TestCase):
"""GaelicGamesPlayerApi unit test stubs"""
def setUp(self):
self.api = dbpedia.api.gaelic_games_player_api.GaelicGamesPlayerApi() # noqa: E501
def tearDown(self):
pass
def test_gaelicgamesplayers_get(self):
"""Test case for gaelicgamesplayers_get
List all instances of GaelicGamesPlayer # noqa: E501
"""
pass
def test_gaelicgamesplayers_id_get(self):
"""Test case for gaelicgamesplayers_id_get
Get a single GaelicGamesPlayer by its id # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| [
"[email protected]"
]
| |
ca3562bb02d7bbdba2a3884a09cb3e1ef762c919 | f76e11d4da15768bf8683380b1b1312f04060f9a | /sample_conlls_for_files_in_folder.py | a41592d79ee73224376e3b60857161c7a140304b | []
| no_license | rasoolims/scripts | 0804a2e5f7f405846cb659f9f8199f6bd93c4af6 | fd8110558fff1bb5a7527ff854eeea87b0b3c597 | refs/heads/master | 2021-07-07T03:53:20.507765 | 2021-04-13T14:53:00 | 2021-04-13T14:53:00 | 24,770,177 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 364 | py | import os,sys
sampler = os.path.dirname(os.path.abspath(sys.argv[0]))+'/sample_conlls.py'
folder = os.path.abspath(sys.argv[1])+'/'
o_folder = os.path.abspath(sys.argv[2])+'/'
max_num = int(sys.argv[3])
for f in sorted(os.listdir(folder)):
command = 'python ' + sampler + ' '+folder+f +' '+o_folder+f + ' '+str(max_num) + '&'
print command
os.system(command)
| [
"[email protected]"
]
| |
3f44a961dc17d224810f89b2af9967c97b56e9cc | 2eae961147a9627a2b9c8449fa61cb7292ad4f6a | /openapi_client/models/put_financial_settings_financial_settings.py | 528befb129e62a58e2aa4a47305b7c13242a06cc | []
| no_license | kgr-eureka/SageOneSDK | 5a57cc6f62ffc571620ec67c79757dcd4e6feca7 | 798e240eb8f4a5718013ab74ec9a0f9f9054399a | refs/heads/master | 2021-02-10T04:04:19.202332 | 2020-03-02T11:11:04 | 2020-03-02T11:11:04 | 244,350,350 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 22,975 | py | # coding: utf-8
"""
Sage Business Cloud Accounting - Accounts
Documentation of the Sage Business Cloud Accounting API. # noqa: E501
The version of the OpenAPI document: 3.1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from openapi_client.configuration import Configuration
class PutFinancialSettingsFinancialSettings(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'year_end_date': 'date',
'year_end_lockdown_date': 'date',
'accounting_type': 'str',
'accounts_start_date': 'date',
'base_currency_id': 'str',
'multi_currency_enabled': 'bool',
'use_live_exchange_rates': 'bool',
'mtd_activation_status': 'str',
'mtd_connected': 'bool',
'mtd_authenticated_date': 'date',
'tax_return_frequency_id': 'str',
'tax_number': 'str',
'general_tax_number': 'str',
'tax_office_id': 'str',
'default_irpf_rate': 'float',
'flat_rate_tax_percentage': 'float',
'sales_tax_calculation': 'str',
'purchase_tax_calculation': 'str'
}
attribute_map = {
'year_end_date': 'year_end_date',
'year_end_lockdown_date': 'year_end_lockdown_date',
'accounting_type': 'accounting_type',
'accounts_start_date': 'accounts_start_date',
'base_currency_id': 'base_currency_id',
'multi_currency_enabled': 'multi_currency_enabled',
'use_live_exchange_rates': 'use_live_exchange_rates',
'mtd_activation_status': 'mtd_activation_status',
'mtd_connected': 'mtd_connected',
'mtd_authenticated_date': 'mtd_authenticated_date',
'tax_return_frequency_id': 'tax_return_frequency_id',
'tax_number': 'tax_number',
'general_tax_number': 'general_tax_number',
'tax_office_id': 'tax_office_id',
'default_irpf_rate': 'default_irpf_rate',
'flat_rate_tax_percentage': 'flat_rate_tax_percentage',
'sales_tax_calculation': 'sales_tax_calculation',
'purchase_tax_calculation': 'purchase_tax_calculation'
}
def __init__(self, year_end_date=None, year_end_lockdown_date=None, accounting_type=None, accounts_start_date=None, base_currency_id=None, multi_currency_enabled=None, use_live_exchange_rates=None, mtd_activation_status=None, mtd_connected=None, mtd_authenticated_date=None, tax_return_frequency_id=None, tax_number=None, general_tax_number=None, tax_office_id=None, default_irpf_rate=None, flat_rate_tax_percentage=None, sales_tax_calculation=None, purchase_tax_calculation=None, local_vars_configuration=None): # noqa: E501
"""PutFinancialSettingsFinancialSettings - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._year_end_date = None
self._year_end_lockdown_date = None
self._accounting_type = None
self._accounts_start_date = None
self._base_currency_id = None
self._multi_currency_enabled = None
self._use_live_exchange_rates = None
self._mtd_activation_status = None
self._mtd_connected = None
self._mtd_authenticated_date = None
self._tax_return_frequency_id = None
self._tax_number = None
self._general_tax_number = None
self._tax_office_id = None
self._default_irpf_rate = None
self._flat_rate_tax_percentage = None
self._sales_tax_calculation = None
self._purchase_tax_calculation = None
self.discriminator = None
if year_end_date is not None:
self.year_end_date = year_end_date
if year_end_lockdown_date is not None:
self.year_end_lockdown_date = year_end_lockdown_date
if accounting_type is not None:
self.accounting_type = accounting_type
if accounts_start_date is not None:
self.accounts_start_date = accounts_start_date
if base_currency_id is not None:
self.base_currency_id = base_currency_id
if multi_currency_enabled is not None:
self.multi_currency_enabled = multi_currency_enabled
if use_live_exchange_rates is not None:
self.use_live_exchange_rates = use_live_exchange_rates
if mtd_activation_status is not None:
self.mtd_activation_status = mtd_activation_status
if mtd_connected is not None:
self.mtd_connected = mtd_connected
if mtd_authenticated_date is not None:
self.mtd_authenticated_date = mtd_authenticated_date
if tax_return_frequency_id is not None:
self.tax_return_frequency_id = tax_return_frequency_id
if tax_number is not None:
self.tax_number = tax_number
if general_tax_number is not None:
self.general_tax_number = general_tax_number
if tax_office_id is not None:
self.tax_office_id = tax_office_id
if default_irpf_rate is not None:
self.default_irpf_rate = default_irpf_rate
if flat_rate_tax_percentage is not None:
self.flat_rate_tax_percentage = flat_rate_tax_percentage
if sales_tax_calculation is not None:
self.sales_tax_calculation = sales_tax_calculation
if purchase_tax_calculation is not None:
self.purchase_tax_calculation = purchase_tax_calculation
@property
def year_end_date(self):
"""Gets the year_end_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
The financial year end date of the business # noqa: E501
:return: The year_end_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: date
"""
return self._year_end_date
@year_end_date.setter
def year_end_date(self, year_end_date):
"""Sets the year_end_date of this PutFinancialSettingsFinancialSettings.
The financial year end date of the business # noqa: E501
:param year_end_date: The year_end_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: date
"""
self._year_end_date = year_end_date
@property
def year_end_lockdown_date(self):
"""Gets the year_end_lockdown_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
The year end lockdown date of the business # noqa: E501
:return: The year_end_lockdown_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: date
"""
return self._year_end_lockdown_date
@year_end_lockdown_date.setter
def year_end_lockdown_date(self, year_end_lockdown_date):
"""Sets the year_end_lockdown_date of this PutFinancialSettingsFinancialSettings.
The year end lockdown date of the business # noqa: E501
:param year_end_lockdown_date: The year_end_lockdown_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: date
"""
self._year_end_lockdown_date = year_end_lockdown_date
@property
def accounting_type(self):
"""Gets the accounting_type of this PutFinancialSettingsFinancialSettings. # noqa: E501
Indicates the accounting type of a business, it can be accrual or cash based # noqa: E501
:return: The accounting_type of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._accounting_type
@accounting_type.setter
def accounting_type(self, accounting_type):
"""Sets the accounting_type of this PutFinancialSettingsFinancialSettings.
Indicates the accounting type of a business, it can be accrual or cash based # noqa: E501
:param accounting_type: The accounting_type of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._accounting_type = accounting_type
@property
def accounts_start_date(self):
"""Gets the accounts_start_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
The accounts start date of the business # noqa: E501
:return: The accounts_start_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: date
"""
return self._accounts_start_date
@accounts_start_date.setter
def accounts_start_date(self, accounts_start_date):
"""Sets the accounts_start_date of this PutFinancialSettingsFinancialSettings.
The accounts start date of the business # noqa: E501
:param accounts_start_date: The accounts_start_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: date
"""
self._accounts_start_date = accounts_start_date
@property
def base_currency_id(self):
"""Gets the base_currency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
The ID of the Base Currency. # noqa: E501
:return: The base_currency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._base_currency_id
@base_currency_id.setter
def base_currency_id(self, base_currency_id):
"""Sets the base_currency_id of this PutFinancialSettingsFinancialSettings.
The ID of the Base Currency. # noqa: E501
:param base_currency_id: The base_currency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._base_currency_id = base_currency_id
@property
def multi_currency_enabled(self):
"""Gets the multi_currency_enabled of this PutFinancialSettingsFinancialSettings. # noqa: E501
Indicates whether multi-currency is enabled for the business # noqa: E501
:return: The multi_currency_enabled of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: bool
"""
return self._multi_currency_enabled
@multi_currency_enabled.setter
def multi_currency_enabled(self, multi_currency_enabled):
"""Sets the multi_currency_enabled of this PutFinancialSettingsFinancialSettings.
Indicates whether multi-currency is enabled for the business # noqa: E501
:param multi_currency_enabled: The multi_currency_enabled of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: bool
"""
self._multi_currency_enabled = multi_currency_enabled
@property
def use_live_exchange_rates(self):
"""Gets the use_live_exchange_rates of this PutFinancialSettingsFinancialSettings. # noqa: E501
Indicates whether to use live or business defined exchange rates # noqa: E501
:return: The use_live_exchange_rates of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: bool
"""
return self._use_live_exchange_rates
@use_live_exchange_rates.setter
def use_live_exchange_rates(self, use_live_exchange_rates):
"""Sets the use_live_exchange_rates of this PutFinancialSettingsFinancialSettings.
Indicates whether to use live or business defined exchange rates # noqa: E501
:param use_live_exchange_rates: The use_live_exchange_rates of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: bool
"""
self._use_live_exchange_rates = use_live_exchange_rates
@property
def mtd_activation_status(self):
"""Gets the mtd_activation_status of this PutFinancialSettingsFinancialSettings. # noqa: E501
Indicates the UK Making Tax Digital for VAT activation status # noqa: E501
:return: The mtd_activation_status of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._mtd_activation_status
@mtd_activation_status.setter
def mtd_activation_status(self, mtd_activation_status):
"""Sets the mtd_activation_status of this PutFinancialSettingsFinancialSettings.
Indicates the UK Making Tax Digital for VAT activation status # noqa: E501
:param mtd_activation_status: The mtd_activation_status of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._mtd_activation_status = mtd_activation_status
@property
def mtd_connected(self):
"""Gets the mtd_connected of this PutFinancialSettingsFinancialSettings. # noqa: E501
Indicates whether UK Making Tax Digital for VAT is currently connected # noqa: E501
:return: The mtd_connected of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: bool
"""
return self._mtd_connected
@mtd_connected.setter
def mtd_connected(self, mtd_connected):
"""Sets the mtd_connected of this PutFinancialSettingsFinancialSettings.
Indicates whether UK Making Tax Digital for VAT is currently connected # noqa: E501
:param mtd_connected: The mtd_connected of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: bool
"""
self._mtd_connected = mtd_connected
@property
def mtd_authenticated_date(self):
"""Gets the mtd_authenticated_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
Indicates when a UK business enabled UK Making Tax Digital for VAT, nil if not enabled or non-uk # noqa: E501
:return: The mtd_authenticated_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: date
"""
return self._mtd_authenticated_date
@mtd_authenticated_date.setter
def mtd_authenticated_date(self, mtd_authenticated_date):
"""Sets the mtd_authenticated_date of this PutFinancialSettingsFinancialSettings.
Indicates when a UK business enabled UK Making Tax Digital for VAT, nil if not enabled or non-uk # noqa: E501
:param mtd_authenticated_date: The mtd_authenticated_date of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: date
"""
self._mtd_authenticated_date = mtd_authenticated_date
@property
def tax_return_frequency_id(self):
"""Gets the tax_return_frequency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
The ID of the Tax Return Frequency. # noqa: E501
:return: The tax_return_frequency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._tax_return_frequency_id
@tax_return_frequency_id.setter
def tax_return_frequency_id(self, tax_return_frequency_id):
"""Sets the tax_return_frequency_id of this PutFinancialSettingsFinancialSettings.
The ID of the Tax Return Frequency. # noqa: E501
:param tax_return_frequency_id: The tax_return_frequency_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._tax_return_frequency_id = tax_return_frequency_id
@property
def tax_number(self):
"""Gets the tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501
The tax number # noqa: E501
:return: The tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._tax_number
@tax_number.setter
def tax_number(self, tax_number):
"""Sets the tax_number of this PutFinancialSettingsFinancialSettings.
The tax number # noqa: E501
:param tax_number: The tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._tax_number = tax_number
@property
def general_tax_number(self):
"""Gets the general_tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501
The number for various tax report submissions # noqa: E501
:return: The general_tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._general_tax_number
@general_tax_number.setter
def general_tax_number(self, general_tax_number):
"""Sets the general_tax_number of this PutFinancialSettingsFinancialSettings.
The number for various tax report submissions # noqa: E501
:param general_tax_number: The general_tax_number of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._general_tax_number = general_tax_number
@property
def tax_office_id(self):
"""Gets the tax_office_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
The ID of the Tax Office. # noqa: E501
:return: The tax_office_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._tax_office_id
@tax_office_id.setter
def tax_office_id(self, tax_office_id):
"""Sets the tax_office_id of this PutFinancialSettingsFinancialSettings.
The ID of the Tax Office. # noqa: E501
:param tax_office_id: The tax_office_id of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._tax_office_id = tax_office_id
@property
def default_irpf_rate(self):
"""Gets the default_irpf_rate of this PutFinancialSettingsFinancialSettings. # noqa: E501
The default IRPF rate # noqa: E501
:return: The default_irpf_rate of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: float
"""
return self._default_irpf_rate
@default_irpf_rate.setter
def default_irpf_rate(self, default_irpf_rate):
"""Sets the default_irpf_rate of this PutFinancialSettingsFinancialSettings.
The default IRPF rate # noqa: E501
:param default_irpf_rate: The default_irpf_rate of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: float
"""
self._default_irpf_rate = default_irpf_rate
@property
def flat_rate_tax_percentage(self):
"""Gets the flat_rate_tax_percentage of this PutFinancialSettingsFinancialSettings. # noqa: E501
The tax percentage that applies to flat rate tax schemes. # noqa: E501
:return: The flat_rate_tax_percentage of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: float
"""
return self._flat_rate_tax_percentage
@flat_rate_tax_percentage.setter
def flat_rate_tax_percentage(self, flat_rate_tax_percentage):
"""Sets the flat_rate_tax_percentage of this PutFinancialSettingsFinancialSettings.
The tax percentage that applies to flat rate tax schemes. # noqa: E501
:param flat_rate_tax_percentage: The flat_rate_tax_percentage of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: float
"""
self._flat_rate_tax_percentage = flat_rate_tax_percentage
@property
def sales_tax_calculation(self):
"""Gets the sales_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501
The method of collection for tax on sales. Allowed values - \"invoice\", \"cash\". # noqa: E501
:return: The sales_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._sales_tax_calculation
@sales_tax_calculation.setter
def sales_tax_calculation(self, sales_tax_calculation):
"""Sets the sales_tax_calculation of this PutFinancialSettingsFinancialSettings.
The method of collection for tax on sales. Allowed values - \"invoice\", \"cash\". # noqa: E501
:param sales_tax_calculation: The sales_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._sales_tax_calculation = sales_tax_calculation
@property
def purchase_tax_calculation(self):
"""Gets the purchase_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501
The method of collection for tax on purchases. Allowed values - \"invoice\", \"cash\". # noqa: E501
:return: The purchase_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501
:rtype: str
"""
return self._purchase_tax_calculation
@purchase_tax_calculation.setter
def purchase_tax_calculation(self, purchase_tax_calculation):
"""Sets the purchase_tax_calculation of this PutFinancialSettingsFinancialSettings.
The method of collection for tax on purchases. Allowed values - \"invoice\", \"cash\". # noqa: E501
:param purchase_tax_calculation: The purchase_tax_calculation of this PutFinancialSettingsFinancialSettings. # noqa: E501
:type: str
"""
self._purchase_tax_calculation = purchase_tax_calculation
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, PutFinancialSettingsFinancialSettings):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, PutFinancialSettingsFinancialSettings):
return True
return self.to_dict() != other.to_dict()
| [
"[email protected]"
]
| |
2a12122d9d5b99a129dc3fa2a52bf6b57a7b4e4d | a8b2ab984cf02660efce5a7696cd3218d7023883 | /python/598.range-addition-ii.py | a16fc8861d35c55faac849acfad8d6b4554fd525 | [
"MIT"
]
| permissive | vermouth1992/Leetcode | b445f51de3540ef453fb594f04d5c9d9ad934c0c | 386e794861f37c17cfea0c8baa3f544c8e5ca7a8 | refs/heads/master | 2022-11-07T13:04:00.393597 | 2022-10-28T02:59:22 | 2022-10-28T02:59:22 | 100,220,916 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,460 | py | #
# @lc app=leetcode id=598 lang=python3
#
# [598] Range Addition II
#
# https://leetcode.com/problems/range-addition-ii/description/
#
# algorithms
# Easy (50.41%)
# Total Accepted: 47.5K
# Total Submissions: 94.3K
# Testcase Example: '3\n3\n[[2,2],[3,3]]'
#
# You are given an m x n matrix M initialized with all 0's and an array of
# operations ops, where ops[i] = [ai, bi] means M[x][y] should be incremented
# by one for all 0 <= x < ai and 0 <= y < bi.
#
# Count and return the number of maximum integers in the matrix after
# performing all the operations.
#
#
# Example 1:
#
#
# Input: m = 3, n = 3, ops = [[2,2],[3,3]]
# Output: 4
# Explanation: The maximum integer in M is 2, and there are four of it in M. So
# return 4.
#
#
# Example 2:
#
#
# Input: m = 3, n = 3, ops =
# [[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3]]
# Output: 4
#
#
# Example 3:
#
#
# Input: m = 3, n = 3, ops = []
# Output: 9
#
#
#
# Constraints:
#
#
# 1 <= m, n <= 4 * 10^4
# 1 <= ops.length <= 10^4
# ops[i].length == 2
# 1 <= ai <= m
# 1 <= bi <= n
#
#
#
from typing import List
class Solution:
def maxCount(self, m: int, n: int, ops: List[List[int]]) -> int:
# find min_x and min_y
min_x = m
min_y = n
for position in ops:
x, y = position
if x < min_x:
min_x = x
if y < min_y:
min_y = y
return min_x * min_y
| [
"[email protected]"
]
| |
3a346913704674caee5c77cd75948fe136288495 | 375f29655b966e7dbac2297b3f79aadb5d03b737 | /Image/Morphw.py | 480c580be1281ed1523a76b52adc5b0beb2b5854 | [
"MIT"
]
| permissive | pection-zz/FindJointwithImageprocessing | 33e0b47ca3629d85e739edcd88dcd1663af88631 | 3dd4563be88dfcf005c32f19ae97d03f9bf715ad | refs/heads/master | 2022-12-23T11:09:04.391591 | 2020-10-05T16:35:21 | 2020-10-05T16:35:21 | 301,473,183 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,051 | py | import sys
# import urllib2
import cv2 as cv
src = 0
image = 0
dest = 0
element_shape = cv.CV_SHAPE_RECT
def Opening(pos):
element = cv.CreateStructuringElementEx(pos*2+1, pos*2+1, pos, pos, element_shape)
cv.Erode(src, image, element, 1)
cv.Dilate(image, dest, element, 1)
cv.ShowImage("Opening & Closing", dest)
def Closing(pos):
element = cv.CreateStructuringElementEx(pos*2+1, pos*2+1, pos, pos, element_shape)
cv.Dilate(src, image, element, 1)
cv.Erode(image, dest, element, 1)
cv.ShowImage("Opening & Closing", dest)
def Erosion(pos):
element = cv.CreateStructuringElementEx(pos*2+1, pos*2+1, pos, pos, element_shape)
cv.Erode(src, dest, element, 1)
cv.ShowImage("Erosion & Dilation", dest)
def Dilation(pos):
element = cv.CreateStructuringElementEx(pos*2+1, pos*2+1, pos, pos, element_shape)
cv.Dilate(src, dest, element, 1)
cv.ShowImage("Erosion & Dilation", dest)
if __name__ == "__main__":
if len(sys.argv) > 1:
src = cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_COLOR)
else:
url = 'https://code.ros.org/svn/opencv/trunk/opencv/samples/c/fruits.jpg'
filedata = urllib2.urlopen(url).read()
imagefiledata = cv.CreateMatHeader(1, len(filedata), cv.CV_8UC1)
cv.SetData(imagefiledata, filedata, len(filedata))
src = cv.DecodeImage(imagefiledata, cv.CV_LOAD_IMAGE_COLOR)
image = cv.CloneImage(src)
dest = cv.CloneImage(src)
cv.NamedWindow("Opening & Closing", 1)
cv.NamedWindow("Erosion & Dilation", 1)
cv.ShowImage("Opening & Closing", src)
cv.ShowImage("Erosion & Dilation", src)
cv.CreateTrackbar("Open", "Opening & Closing", 0, 10, Opening)
cv.CreateTrackbar("Close", "Opening & Closing", 0, 10, Closing)
cv.CreateTrackbar("Dilate", "Erosion & Dilation", 0, 10, Dilation)
cv.CreateTrackbar("Erode", "Erosion & Dilation", 0, 10, Erosion)
cv.WaitKey(0)
cv.DestroyWindow("Opening & Closing")
cv.DestroyWindow("Erosion & Dilation") | [
"[email protected]"
]
| |
7537600bafe78ac26d429c8c02a71a336bd9f55a | 63ace5832d453e325681d02f6496a0999b72edcb | /bip_utils/addr/ergo_addr.py | 3866b51985ebe93e5c043e028807fdc3bf08fece | [
"MIT"
]
| permissive | ebellocchia/bip_utils | c9ec04c687f4247e57434319e36b2abab78f0b32 | d15c75ddd74e4838c396a0d036ef6faf11b06a4b | refs/heads/master | 2023-09-01T13:38:55.567370 | 2023-08-16T17:04:14 | 2023-08-16T17:04:14 | 251,130,186 | 244 | 88 | MIT | 2023-08-23T13:46:19 | 2020-03-29T20:42:48 | Python | UTF-8 | Python | false | false | 6,215 | py | # Copyright (c) 2022 Emanuele Bellocchia
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""Module for Ergo address encoding/decoding."""
# Imports
from enum import IntEnum, unique
from typing import Any, Union
from bip_utils.addr.addr_dec_utils import AddrDecUtils
from bip_utils.addr.addr_key_validator import AddrKeyValidator
from bip_utils.addr.iaddr_decoder import IAddrDecoder
from bip_utils.addr.iaddr_encoder import IAddrEncoder
from bip_utils.base58 import Base58Decoder, Base58Encoder
from bip_utils.ecc import IPublicKey, Secp256k1PublicKey
from bip_utils.utils.crypto import Blake2b256
from bip_utils.utils.misc import IntegerUtils
@unique
class ErgoAddressTypes(IntEnum):
"""Enumerative for Ergo address types."""
P2PKH = 0x01
P2SH = 0x02
@unique
class ErgoNetworkTypes(IntEnum):
"""Enumerative for Ergo network types."""
MAINNET = 0x00
TESTNET = 0x10
class ErgoAddrConst:
"""Class container for Ergo address constants."""
# Checksum length in bytes
CHECKSUM_BYTE_LEN: int = 4
class _ErgoAddrUtils:
"""Ergo address utility class."""
@staticmethod
def ComputeChecksum(pub_key_bytes: bytes) -> bytes:
"""
Compute checksum in Ergo format.
Args:
pub_key_bytes (bytes): Public key bytes
Returns:
bytes: Computed checksum
"""
return Blake2b256.QuickDigest(pub_key_bytes)[:ErgoAddrConst.CHECKSUM_BYTE_LEN]
@staticmethod
def EncodePrefix(addr_type: ErgoAddressTypes,
net_type: ErgoNetworkTypes) -> bytes:
"""
Encode prefix.
Args:
addr_type (ErgoAddressTypes): Address type
net_type (ErgoNetworkTypes) : Network type
Returns:
bytes: Prefix byte
"""
return IntegerUtils.ToBytes(addr_type + net_type)
class ErgoP2PKHAddrDecoder(IAddrDecoder):
"""
Ergo P2PKH address decoder class.
It allows the Ergo P2PKH address decoding.
"""
@staticmethod
def DecodeAddr(addr: str,
**kwargs: Any) -> bytes:
"""
Decode an Ergo P2PKH address to bytes.
Args:
addr (str): Address string
Other Parameters:
net_type (ErgoNetworkTypes): Expected network type (default: main net)
Returns:
bytes: Public key bytes
Raises:
ValueError: If the address encoding is not valid
TypeError: If the network tag is not a ErgoNetworkTypes enum
"""
net_type = kwargs.get("net_type", ErgoNetworkTypes.MAINNET)
if not isinstance(net_type, ErgoNetworkTypes):
raise TypeError("Address type is not an enumerative of ErgoNetworkTypes")
# Decode from base58
addr_dec_bytes = Base58Decoder.Decode(addr)
# Validate length
AddrDecUtils.ValidateLength(addr_dec_bytes,
Secp256k1PublicKey.CompressedLength() + ErgoAddrConst.CHECKSUM_BYTE_LEN + 1)
# Get back checksum and public key bytes
addr_with_prefix, checksum_bytes = AddrDecUtils.SplitPartsByChecksum(addr_dec_bytes,
ErgoAddrConst.CHECKSUM_BYTE_LEN)
# Validate checksum
AddrDecUtils.ValidateChecksum(addr_with_prefix, checksum_bytes, _ErgoAddrUtils.ComputeChecksum)
# Validate and remove prefix
pub_key_bytes = AddrDecUtils.ValidateAndRemovePrefix(
addr_with_prefix,
_ErgoAddrUtils.EncodePrefix(ErgoAddressTypes.P2PKH, net_type)
)
# Validate public key
AddrDecUtils.ValidatePubKey(pub_key_bytes, Secp256k1PublicKey)
return pub_key_bytes
class ErgoP2PKHAddrEncoder(IAddrEncoder):
"""
Ergo P2PKH address encoder class.
It allows the Ergo P2PKH address encoding.
"""
@staticmethod
def EncodeKey(pub_key: Union[bytes, IPublicKey],
**kwargs: Any) -> str:
"""
Encode a public key to Ergo P2PKH address.
Args:
pub_key (bytes or IPublicKey): Public key bytes or object
Other Parameters:
net_type (ErgoNetworkTypes): Network type (default: main net)
Returns:
str: Address string
Raised:
ValueError: If the public key is not valid
TypeError: If the public key is not secp256k1 or the network tag is not a ErgoNetworkTypes enum
"""
net_type = kwargs.get("net_type", ErgoNetworkTypes.MAINNET)
if not isinstance(net_type, ErgoNetworkTypes):
raise TypeError("Address type is not an enumerative of ErgoNetworkTypes")
pub_key_obj = AddrKeyValidator.ValidateAndGetSecp256k1Key(pub_key)
pub_key_bytes = pub_key_obj.RawCompressed().ToBytes()
prefix_byte = _ErgoAddrUtils.EncodePrefix(ErgoAddressTypes.P2PKH, net_type)
addr_payload_bytes = prefix_byte + pub_key_bytes
return Base58Encoder.Encode(addr_payload_bytes + _ErgoAddrUtils.ComputeChecksum(addr_payload_bytes))
# Deprecated: only for compatibility, Encoder class shall be used instead
ErgoP2PKHAddr = ErgoP2PKHAddrEncoder
| [
"[email protected]"
]
| |
71f2f3f6ab8c82d999fdc5604d74c6ca35798e00 | a4df0ee67d0d56fc8595877470318aed20dd4511 | /vplexapi-6.2.0.3/vplexapi/api/system_config_api.py | 0cf62487a151978bcac867ff393426037a25be5b | [
"Apache-2.0"
]
| permissive | QD888/python-vplex | b5a7de6766840a205583165c88480d446778e529 | e2c49faee3bfed343881c22e6595096c7f8d923d | refs/heads/main | 2022-12-26T17:11:43.625308 | 2020-10-07T09:40:04 | 2020-10-07T09:40:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,577 | py | # coding: utf-8
"""
VPlex REST API
A defnition for the next-gen VPlex API # noqa: E501
OpenAPI spec version: 0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from vplexapi.api_client import ApiClient
class SystemConfigApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_system_config(self, **kwargs): # noqa: E501
"""Return the system configuration # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_system_config(async=True)
>>> result = thread.get()
:param async bool
:return: SystemConfig
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_system_config_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_system_config_with_http_info(**kwargs) # noqa: E501
return data
def get_system_config_with_http_info(self, **kwargs): # noqa: E501
"""Return the system configuration # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_system_config_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:return: SystemConfig
If the method is called asynchronously,
returns the request thread.
"""
all_params = [] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_system_config" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# Authentication setting
auth_settings = ['basicAuth', 'jwtAuth'] # noqa: E501
return self.api_client.call_api(
'/system_config', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SystemConfig', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| [
"[email protected]"
]
| |
bbe80be9f9fff0ea613053c45361bc9ec7a96a24 | abaa806550f6e6e7bcdf71b9ec23e09a85fe14fd | /data/global-configuration/packs/sshd/collectors/collector_sshd.py | c0b458e04e59a61fc4c9e68ec80c8eb193eddf40 | [
"MIT"
]
| permissive | naparuba/opsbro | 02809ddfe22964cd5983c60c1325c965e8b02adf | 98618a002cd47250d21e7b877a24448fc95fec80 | refs/heads/master | 2023-04-16T08:29:31.143781 | 2019-05-15T12:56:11 | 2019-05-15T12:56:11 | 31,333,676 | 34 | 7 | null | null | null | null | UTF-8 | Python | false | false | 825 | py | import os
from opsbro.collector import Collector
class Sshd(Collector):
def launch(self):
self.logger.debug('get_sshd: starting')
if not os.path.exists('/etc/ssh'):
self.set_not_eligible('There is no ssh server. Missing /etc/ssh directory.')
return
res = {}
if os.path.exists('/etc/ssh/ssh_host_rsa_key.pub'):
f = open('/etc/ssh/ssh_host_rsa_key.pub', 'r')
buf = f.read().strip()
f.close()
res['host_rsa_key_pub'] = buf.replace('ssh-rsa ', '')
if os.path.exists('/etc/ssh/ssh_host_dsa_key.pub'):
f = open('/etc/ssh/ssh_host_dsa_key.pub', 'r')
buf = f.read().strip()
f.close()
res['host_dsa_key_pub'] = buf.replace('ssh-dss ', '')
return res
| [
"[email protected]"
]
| |
3262ca2157e7e55a7bc3b144133ddefce3b3e3a7 | f07a42f652f46106dee4749277d41c302e2b7406 | /Data Set/bug-fixing-5/44a9b167bda9654ce60588cf2dcee88e4bad831d-<test_apply_with_reduce_empty>-bug.py | 2a11ec39a3f937351a774e71f7fba648b2061694 | []
| no_license | wsgan001/PyFPattern | e0fe06341cc5d51b3ad0fe29b84098d140ed54d1 | cc347e32745f99c0cd95e79a18ddacc4574d7faa | refs/heads/main | 2023-08-25T23:48:26.112133 | 2021-10-23T14:11:22 | 2021-10-23T14:11:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 665 | py | def test_apply_with_reduce_empty(self):
x = []
result = self.empty.apply(x.append, axis=1, result_type='expand')
assert_frame_equal(result, self.empty)
result = self.empty.apply(x.append, axis=1, result_type='reduce')
assert_series_equal(result, Series([], index=pd.Index([], dtype=object)))
empty_with_cols = DataFrame(columns=['a', 'b', 'c'])
result = empty_with_cols.apply(x.append, axis=1, result_type='expand')
assert_frame_equal(result, empty_with_cols)
result = empty_with_cols.apply(x.append, axis=1, result_type='reduce')
assert_series_equal(result, Series([], index=pd.Index([], dtype=object)))
assert (x == []) | [
"[email protected]"
]
| |
9ee850f579c896ce0e8288b66817cca063a7a3d0 | c67f2d0677f8870bc1d970891bbe31345ea55ce2 | /zippy/lib-python/3/tkinter/font.py | 5425b060132a7f3319d4038b8185c548b23e4efa | [
"BSD-3-Clause"
]
| permissive | securesystemslab/zippy | a5a1ecf5c688504d8d16128ce901406ffd6f32c2 | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | refs/heads/master | 2022-07-05T23:45:36.330407 | 2018-07-10T22:17:32 | 2018-07-10T22:17:32 | 67,824,983 | 324 | 27 | null | null | null | null | UTF-8 | Python | false | false | 6,135 | py | # Tkinter font wrapper
#
# written by Fredrik Lundh, February 1998
#
# FIXME: should add 'displayof' option where relevant (actual, families,
# measure, and metrics)
#
__version__ = "0.9"
import tkinter
# weight/slant
NORMAL = "normal"
ROMAN = "roman"
BOLD = "bold"
ITALIC = "italic"
def nametofont(name):
"""Given the name of a tk named font, returns a Font representation.
"""
return Font(name=name, exists=True)
class Font:
"""Represents a named font.
Constructor options are:
font -- font specifier (name, system font, or (family, size, style)-tuple)
name -- name to use for this font configuration (defaults to a unique name)
exists -- does a named font by this name already exist?
Creates a new named font if False, points to the existing font if True.
Raises _tkinter.TclError if the assertion is false.
the following are ignored if font is specified:
family -- font 'family', e.g. Courier, Times, Helvetica
size -- font size in points
weight -- font thickness: NORMAL, BOLD
slant -- font slant: ROMAN, ITALIC
underline -- font underlining: false (0), true (1)
overstrike -- font strikeout: false (0), true (1)
"""
def _set(self, kw):
options = []
for k, v in kw.items():
options.append("-"+k)
options.append(str(v))
return tuple(options)
def _get(self, args):
options = []
for k in args:
options.append("-"+k)
return tuple(options)
def _mkdict(self, args):
options = {}
for i in range(0, len(args), 2):
options[args[i][1:]] = args[i+1]
return options
def __init__(self, root=None, font=None, name=None, exists=False, **options):
if not root:
root = tkinter._default_root
if font:
# get actual settings corresponding to the given font
font = root.tk.splitlist(root.tk.call("font", "actual", font))
else:
font = self._set(options)
if not name:
name = "font" + str(id(self))
self.name = name
if exists:
self.delete_font = False
# confirm font exists
if self.name not in root.tk.call("font", "names"):
raise tkinter._tkinter.TclError(
"named font %s does not already exist" % (self.name,))
# if font config info supplied, apply it
if font:
root.tk.call("font", "configure", self.name, *font)
else:
# create new font (raises TclError if the font exists)
root.tk.call("font", "create", self.name, *font)
self.delete_font = True
# backlinks!
self._root = root
self._split = root.tk.splitlist
self._call = root.tk.call
def __str__(self):
return self.name
def __eq__(self, other):
return isinstance(other, Font) and self.name == other.name
def __getitem__(self, key):
return self.cget(key)
def __setitem__(self, key, value):
self.configure(**{key: value})
def __del__(self):
try:
if self.delete_font:
self._call("font", "delete", self.name)
except (KeyboardInterrupt, SystemExit):
raise
except Exception:
pass
def copy(self):
"Return a distinct copy of the current font"
return Font(self._root, **self.actual())
def actual(self, option=None):
"Return actual font attributes"
if option:
return self._call("font", "actual", self.name, "-"+option)
else:
return self._mkdict(
self._split(self._call("font", "actual", self.name))
)
def cget(self, option):
"Get font attribute"
return self._call("font", "config", self.name, "-"+option)
def config(self, **options):
"Modify font attributes"
if options:
self._call("font", "config", self.name,
*self._set(options))
else:
return self._mkdict(
self._split(self._call("font", "config", self.name))
)
configure = config
def measure(self, text):
"Return text width"
return int(self._call("font", "measure", self.name, text))
def metrics(self, *options):
"""Return font metrics.
For best performance, create a dummy widget
using this font before calling this method."""
if options:
return int(
self._call("font", "metrics", self.name, self._get(options))
)
else:
res = self._split(self._call("font", "metrics", self.name))
options = {}
for i in range(0, len(res), 2):
options[res[i][1:]] = int(res[i+1])
return options
def families(root=None):
"Get font families (as a tuple)"
if not root:
root = tkinter._default_root
return root.tk.splitlist(root.tk.call("font", "families"))
def names(root=None):
"Get names of defined fonts (as a tuple)"
if not root:
root = tkinter._default_root
return root.tk.splitlist(root.tk.call("font", "names"))
# --------------------------------------------------------------------
# test stuff
if __name__ == "__main__":
root = tkinter.Tk()
# create a font
f = Font(family="times", size=30, weight=NORMAL)
print(f.actual())
print(f.actual("family"))
print(f.actual("weight"))
print(f.config())
print(f.cget("family"))
print(f.cget("weight"))
print(names())
print(f.measure("hello"), f.metrics("linespace"))
print(f.metrics())
f = Font(font=("Courier", 20, "bold"))
print(f.measure("hello"), f.metrics("linespace"))
w = tkinter.Label(root, text="Hello, world", font=f)
w.pack()
w = tkinter.Button(root, text="Quit!", command=root.destroy)
w.pack()
fb = Font(font=w["font"]).copy()
fb.config(weight=BOLD)
w.config(font=fb)
tkinter.mainloop()
| [
"[email protected]"
]
| |
d0676c8bf7212cd46f2beb1288e21d745b2f5132 | dd3ee2babd81d7d37399fd92f637c5600661b408 | /latest_changes/wagtail_hooks.py | b9b2ac9588fa27f8e9aa842568a27b12208540e4 | []
| no_license | andsimakov/wagtail-latest-changes | 2dc65f6e8212f02be51e3da957ce8804b08054f7 | 055004fd1e8fa65558bf030e258b82ec7891999c | refs/heads/master | 2022-06-17T22:01:05.821551 | 2020-05-08T10:47:39 | 2020-05-08T10:47:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 810 | py | from django.http import HttpResponse
from django.conf.urls import url
from django.urls import reverse
from wagtail.admin.menu import MenuItem
from wagtail.core import hooks
from wagtail.core.models import UserPagePermissionsProxy
from .views import LatestChangesView
@hooks.register('register_admin_urls')
def urlconf_time():
return [
url(r'^latest_changes/$', LatestChangesView.as_view(), name='latest_changes'),
]
class LatestChangesPagesMenuItem(MenuItem):
def is_shown(self, request):
return UserPagePermissionsProxy(request.user).can_remove_locks()
@hooks.register("register_reports_menu_item")
def register_latest_changes_menu_item():
return LatestChangesPagesMenuItem(
"Latest changes", reverse("latest_changes"), classnames="icon icon-date", order=100,
)
| [
"[email protected]"
]
| |
9b5cc1f531bb419eff65159e5e7de7bc03c0bcf9 | 32819d5a91c8ffc6f9594cbeb3eb66a19de6c89e | /tracklets/python/bag_to_kitti.py | 3fa47e3cd9a0c75f0483fb0791a22eb793b71d7d | []
| no_license | td2014/didi-competition | 89b4dfa33c3252c214b56d7199a0b4d49e8c0945 | a92ca1cb36907bcf5db6c8e454063e45451f5842 | refs/heads/master | 2021-01-19T11:54:28.623417 | 2017-04-19T17:24:31 | 2017-04-19T17:24:31 | 88,005,585 | 0 | 0 | null | 2017-04-12T03:25:23 | 2017-04-12T03:25:22 | null | UTF-8 | Python | false | false | 19,193 | py | #! /usr/bin/python
""" Udacity Self-Driving Car Challenge Bag Processing
"""
from __future__ import print_function
from cv_bridge import CvBridge, CvBridgeError
from collections import defaultdict
import os
import sys
import cv2
import math
import imghdr
import argparse
import functools
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import PyKDL as kd
from bag_topic_def import *
from bag_utils import *
from generate_tracklet import *
def get_outdir(base_dir, name=''):
outdir = os.path.join(base_dir, name)
if not os.path.exists(outdir):
os.makedirs(outdir)
return outdir
def obs_prefix_from_topic(topic):
words = topic.split('/')
start, end = (1, 4) if topic.startswith(OBJECTS_TOPIC_ROOT) else (1, 3)
prefix = '_'.join(words[start:end])
name = words[2] if topic.startswith(OBJECTS_TOPIC_ROOT) else words[1]
return prefix, name
def check_format(data):
img_fmt = imghdr.what(None, h=data)
return 'jpg' if img_fmt == 'jpeg' else img_fmt
def write_image(bridge, outdir, msg, fmt='png'):
results = {}
image_filename = os.path.join(outdir, str(msg.header.stamp.to_nsec()) + '.' + fmt)
try:
if hasattr(msg, 'format') and 'compressed' in msg.format:
buf = np.ndarray(shape=(1, len(msg.data)), dtype=np.uint8, buffer=msg.data)
cv_image = cv2.imdecode(buf, cv2.IMREAD_ANYCOLOR)
if cv_image.shape[2] != 3:
print("Invalid image %s" % image_filename)
return results
results['height'] = cv_image.shape[0]
results['width'] = cv_image.shape[1]
# Avoid re-encoding if we don't have to
if check_format(msg.data) == fmt:
buf.tofile(image_filename)
else:
cv2.imwrite(image_filename, cv_image)
else:
cv_image = bridge.imgmsg_to_cv2(msg, "bgr8")
cv2.imwrite(image_filename, cv_image)
except CvBridgeError as e:
print(e)
results['filename'] = image_filename
return results
def camera2dict(msg, write_results, camera_dict):
camera_dict["timestamp"].append(msg.header.stamp.to_nsec())
if write_results:
camera_dict["width"].append(write_results['width'] if 'width' in write_results else msg.width)
camera_dict['height'].append(write_results['height'] if 'height' in write_results else msg.height)
camera_dict["frame_id"].append(msg.header.frame_id)
camera_dict["filename"].append(write_results['filename'])
def gps2dict(msg, gps_dict):
gps_dict["timestamp"].append(msg.header.stamp.to_nsec())
gps_dict["lat"].append(msg.latitude)
gps_dict["long"].append(msg.longitude)
gps_dict["alt"].append(msg.altitude)
def rtk2dict(msg, rtk_dict):
rtk_dict["timestamp"].append(msg.header.stamp.to_nsec())
rtk_dict["tx"].append(msg.pose.pose.position.x)
rtk_dict["ty"].append(msg.pose.pose.position.y)
rtk_dict["tz"].append(msg.pose.pose.position.z)
rotq = kd.Rotation.Quaternion(
msg.pose.pose.orientation.x,
msg.pose.pose.orientation.y,
msg.pose.pose.orientation.z,
msg.pose.pose.orientation.w)
rot_xyz = rotq.GetRPY()
rtk_dict["rx"].append(0.0) #rot_xyz[0]
rtk_dict["ry"].append(0.0) #rot_xyz[1]
rtk_dict["rz"].append(rot_xyz[2])
def imu2dict(msg, imu_dict):
imu_dict["timestamp"].append(msg.header.stamp.to_nsec())
imu_dict["ax"].append(msg.linear_acceleration.x)
imu_dict["ay"].append(msg.linear_acceleration.y)
imu_dict["az"].append(msg.linear_acceleration.z)
def get_yaw(p1, p2):
if abs(p1[0] - p2[0]) < 1e-2:
return 0.
return math.atan2(p1[1] - p2[1], p1[0] - p2[0])
def dict_to_vect(di):
return kd.Vector(di['tx'], di['ty'], di['tz'])
def list_to_vect(li):
return kd.Vector(li[0], li[1], li[2])
def frame_to_dict(frame):
r, p, y = frame.M.GetRPY()
return dict(tx=frame.p[0], ty=frame.p[1], tz=frame.p[2], rx=r, ry=p, rz=y)
def get_obstacle_pos(
front,
rear,
obstacle,
velodyne_to_front,
gps_to_centroid):
front_v = dict_to_vect(front)
rear_v = dict_to_vect(rear)
obs_v = dict_to_vect(obstacle)
yaw = get_yaw(front_v, rear_v)
rot_z = kd.Rotation.RotZ(-yaw)
diff = obs_v - front_v
res = rot_z * diff
res += list_to_vect(velodyne_to_front)
# FIXME the gps_to_centroid offset of the obstacle should be rotated by
# the obstacle's yaw. Unfortunately the obstacle's pose is unknown at this
# point so we will assume obstacle is axis aligned with capture vehicle
# for now.
res += list_to_vect(gps_to_centroid)
return frame_to_dict(kd.Frame(kd.Rotation(), res))
def interpolate_to_camera(camera_df, other_dfs, filter_cols=[]):
if not isinstance(other_dfs, list):
other_dfs = [other_dfs]
if not isinstance(camera_df.index, pd.DatetimeIndex):
print('Error: Camera dataframe needs to be indexed by timestamp for interpolation')
return pd.DataFrame()
for o in other_dfs:
o['timestamp'] = pd.to_datetime(o['timestamp'])
o.set_index(['timestamp'], inplace=True)
o.index.rename('index', inplace=True)
merged = functools.reduce(lambda left, right: pd.merge(
left, right, how='outer', left_index=True, right_index=True), [camera_df] + other_dfs)
merged.interpolate(method='time', inplace=True, limit=100, limit_direction='both')
filtered = merged.loc[camera_df.index] # back to only camera rows
filtered.fillna(0.0, inplace=True)
filtered['timestamp'] = filtered.index.astype('int') # add back original timestamp integer col
if filter_cols:
if not 'timestamp' in filter_cols:
filter_cols += ['timestamp']
filtered = filtered[filter_cols]
return filtered
def estimate_obstacle_poses(
cap_front_rtk,
#cap_front_gps_offset,
cap_rear_rtk,
#cap_rear_gps_offset,
obs_rear_rtk,
obs_rear_gps_offset, # offset along [l, w, h] dim of car, in obstacle relative coords
):
# offsets are all [l, w, h] lists (or tuples)
assert(len(obs_rear_gps_offset) == 3)
# all coordinate records should be interpolated to same sample base at this point
assert len(cap_front_rtk) == len(cap_rear_rtk) == len(obs_rear_rtk)
velo_to_front = [-1.0922, 0, -0.0508]
rtk_coords = zip(cap_front_rtk, cap_rear_rtk, obs_rear_rtk)
output_poses = [
get_obstacle_pos(c[0], c[1], c[2], velo_to_front, obs_rear_gps_offset) for c in rtk_coords]
return output_poses
def check_oneof_topics_present(topic_map, name, topics):
if not isinstance(topics, list):
topics = [topics]
if not any(t in topic_map for t in topics):
print('Error: One of %s must exist in bag, skipping bag %s.' % (topics, name))
return False
return True
def main():
parser = argparse.ArgumentParser(description='Convert rosbag to images and csv.')
parser.add_argument('-o', '--outdir', type=str, nargs='?', default='/output',
help='Output folder')
parser.add_argument('-i', '--indir', type=str, nargs='?', default='/data',
help='Input folder where bagfiles are located')
parser.add_argument('-f', '--img_format', type=str, nargs='?', default='jpg',
help='Image encode format, png or jpg')
parser.add_argument('-m', dest='msg_only', action='store_true', help='Messages only, no images')
parser.add_argument('-d', dest='debug', action='store_true', help='Debug print enable')
parser.set_defaults(msg_only=False)
parser.set_defaults(debug=False)
args = parser.parse_args()
img_format = args.img_format
base_outdir = args.outdir
indir = args.indir
msg_only = args.msg_only
debug_print = args.debug
bridge = CvBridge()
include_images = False if msg_only else True
filter_topics = CAMERA_TOPICS + CAP_FRONT_RTK_TOPICS + CAP_REAR_RTK_TOPICS \
+ CAP_FRONT_GPS_TOPICS + CAP_REAR_GPS_TOPICS
# For bag sets that may have missing metadata.csv file
default_metadata = [{
'obstacle_name': 'obs1',
'object_type': 'Car',
'gps_l': 2.032,
'gps_w': 1.4478,
'gps_h': 1.6256,
'l': 4.2418,
'w': 1.4478,
'h': 1.5748,
}]
#FIXME scan from bag info in /obstacles/ topic path
OBSTACLES = ['obs1']
OBSTACLE_RTK_TOPICS = [OBJECTS_TOPIC_ROOT + '/' + x + '/rear/gps/rtkfix' for x in OBSTACLES]
filter_topics += OBSTACLE_RTK_TOPICS
bagsets = find_bagsets(indir, filter_topics=filter_topics, set_per_file=True, metadata_filename='metadata.csv')
if not bagsets:
print("No bags found in %s" % indir)
exit(-1)
for bs in bagsets:
print("Processing set %s" % bs.name)
sys.stdout.flush()
if not check_oneof_topics_present(bs.topic_map, bs.name, CAP_FRONT_RTK_TOPICS):
continue
if not check_oneof_topics_present(bs.topic_map, bs.name, CAP_REAR_RTK_TOPICS):
continue
camera_cols = ["timestamp", "width", "height", "frame_id", "filename"]
camera_dict = defaultdict(list)
gps_cols = ["timestamp", "lat", "long", "alt"]
cap_rear_gps_dict = defaultdict(list)
cap_front_gps_dict = defaultdict(list)
rtk_cols = ["timestamp", "tx", "ty", "tz", "rx", "ry", "rz"]
cap_rear_rtk_dict = defaultdict(list)
cap_front_rtk_dict = defaultdict(list)
# For the obstacles, keep track of rtk values for each one in a dictionary (key == topic)
obstacle_rtk_dicts = {k: defaultdict(list) for k in OBSTACLE_RTK_TOPICS}
dataset_outdir = os.path.join(base_outdir, "%s" % bs.name)
get_outdir(dataset_outdir)
if include_images:
camera_outdir = get_outdir(dataset_outdir, "camera")
bs.write_infos(dataset_outdir)
readers = bs.get_readers()
stats_acc = defaultdict(int)
def _process_msg(topic, msg, stats):
timestamp = msg.header.stamp.to_nsec()
if topic in CAMERA_TOPICS:
if debug_print:
print("%s_camera %d" % (topic[1], timestamp))
write_results = {}
if include_images:
write_results = write_image(bridge, camera_outdir, msg, fmt=img_format)
write_results['filename'] = os.path.relpath(write_results['filename'], dataset_outdir)
camera2dict(msg, write_results, camera_dict)
stats['img_count'] += 1
stats['msg_count'] += 1
elif topic in CAP_REAR_RTK_TOPICS:
rtk2dict(msg, cap_rear_rtk_dict)
stats['msg_count'] += 1
elif topic in CAP_FRONT_RTK_TOPICS:
rtk2dict(msg, cap_front_rtk_dict)
stats['msg_count'] += 1
elif topic in CAP_REAR_GPS_TOPICS:
gps2dict(msg, cap_rear_gps_dict)
stats['msg_count'] += 1
elif topic in CAP_FRONT_GPS_TOPICS:
gps2dict(msg, cap_front_gps_dict)
stats['msg_count'] += 1
elif topic in OBSTACLE_RTK_TOPICS:
rtk2dict(msg, obstacle_rtk_dicts[topic])
stats['msg_count'] += 1
else:
pass
for reader in readers:
last_img_log = 0
last_msg_log = 0
for result in reader.read_messages():
_process_msg(*result, stats=stats_acc)
if last_img_log != stats_acc['img_count'] and stats_acc['img_count'] % 1000 == 0:
print("%d images, processed..." % stats_acc['img_count'])
last_img_log = stats_acc['img_count']
sys.stdout.flush()
if last_msg_log != stats_acc['msg_count'] and stats_acc['msg_count'] % 10000 == 0:
print("%d messages processed..." % stats_acc['msg_count'])
last_msg_log = stats_acc['msg_count']
sys.stdout.flush()
print("Writing done. %d images, %d messages processed." %
(stats_acc['img_count'], stats_acc['msg_count']))
sys.stdout.flush()
camera_df = pd.DataFrame(data=camera_dict, columns=camera_cols)
cap_rear_gps_df = pd.DataFrame(data=cap_rear_gps_dict, columns=gps_cols)
cap_front_gps_df = pd.DataFrame(data=cap_front_gps_dict, columns=gps_cols)
cap_rear_rtk_df = pd.DataFrame(data=cap_rear_rtk_dict, columns=rtk_cols)
if not len(cap_rear_rtk_df.index):
print('Error: No capture vehicle rear RTK entries exist.'
'Skipping bag %s.' % bag.name)
continue
cap_front_rtk_df = pd.DataFrame(data=cap_front_rtk_dict, columns=rtk_cols)
if not len(cap_rear_rtk_df.index):
print('Error: No capture vehicle front RTK entries exist.'
'Skipping bag %s.' % bag.name)
continue
if include_images:
camera_df.to_csv(os.path.join(dataset_outdir, 'capture_vehicle_camera.csv'), index=False)
cap_rear_gps_df.to_csv(os.path.join(dataset_outdir, 'capture_vehicle_rear_gps.csv'), index=False)
cap_front_gps_df.to_csv(os.path.join(dataset_outdir, 'capture_vehicle_front_gps.csv'), index=False)
cap_rear_rtk_df.to_csv(os.path.join(dataset_outdir, 'capture_vehicle_rear_rtk.csv'), index=False)
cap_front_rtk_df.to_csv(os.path.join(dataset_outdir, 'capture_vehicle_front_rtk.csv'), index=False)
obs_rtk_df_dict = {}
for obs_topic, obs_rtk_dict in obstacle_rtk_dicts.items():
obs_prefix, obs_name = obs_prefix_from_topic(obs_topic)
obs_rtk_df = pd.DataFrame(data=obs_rtk_dict, columns=rtk_cols)
if not len(obs_rtk_df.index):
print('Warning: No entries for obstacle %s in %s. Skipping.' % (obs_name, bs.name))
continue
obs_rtk_df.to_csv(os.path.join(dataset_outdir, '%s_rtk.csv' % obs_prefix), index=False)
obs_rtk_df_dict[obs_topic] = obs_rtk_df
if len(camera_dict['timestamp']):
# Interpolate samples from all used sensors to camera frame timestamps
camera_df['timestamp'] = pd.to_datetime(camera_df['timestamp'])
camera_df.set_index(['timestamp'], inplace=True)
camera_df.index.rename('index', inplace=True)
camera_index_df = pd.DataFrame(index=camera_df.index)
cap_rear_gps_interp = interpolate_to_camera(camera_index_df, cap_rear_gps_df, filter_cols=gps_cols)
cap_rear_gps_interp.to_csv(
os.path.join(dataset_outdir, 'capture_vehicle_rear_gps_interp.csv'), header=True)
cap_front_gps_interp = interpolate_to_camera(camera_index_df, cap_front_gps_df, filter_cols=gps_cols)
cap_front_gps_interp.to_csv(
os.path.join(dataset_outdir, 'capture_vehicle_front_gps_interp.csv'), header=True)
cap_rear_rtk_interp = interpolate_to_camera(camera_index_df, cap_rear_rtk_df, filter_cols=rtk_cols)
cap_rear_rtk_interp.to_csv(
os.path.join(dataset_outdir, 'capture_vehicle_rear_rtk_interp.csv'), header=True)
cap_rear_rtk_interp_rec = cap_rear_rtk_interp.to_dict(orient='records')
cap_front_rtk_interp = interpolate_to_camera(camera_index_df, cap_front_rtk_df, filter_cols=rtk_cols)
cap_front_rtk_interp.to_csv(
os.path.join(dataset_outdir, 'capture_vehicle_front_rtk_interp.csv'), header=True)
cap_front_rtk_interp_rec = cap_front_rtk_interp.to_dict(orient='records')
if not obs_rtk_df_dict:
print('Warning: No obstacles or obstacle RTK data present. '
'Skipping Tracklet generation for %s.' % bs.name)
continue
collection = TrackletCollection()
for obs_topic in obstacle_rtk_dicts.keys():
obs_rtk_df = obs_rtk_df_dict[obs_topic]
obs_interp = interpolate_to_camera(camera_index_df, obs_rtk_df, filter_cols=rtk_cols)
obs_prefix, obs_name = obs_prefix_from_topic(obs_topic)
obs_interp.to_csv(
os.path.join(dataset_outdir, '%s_rtk_interpolated.csv' % obs_prefix), header=True)
# Plot obstacle and front/rear rtk paths in absolute RTK ENU coords
fig = plt.figure()
plt.plot(
obs_interp['tx'].tolist(),
obs_interp['ty'].tolist(),
cap_front_rtk_interp['tx'].tolist(),
cap_front_rtk_interp['ty'].tolist(),
cap_rear_rtk_interp['tx'].tolist(),
cap_rear_rtk_interp['ty'].tolist())
fig.savefig(os.path.join(dataset_outdir, '%s-%s-plot.png' % (bs.name, obs_name)))
plt.close(fig)
# Extract lwh and object type from CSV metadata mapping file
md = bs.metadata if bs.metadata else default_metadata
if not bs.metadata:
print('Warning: Default metadata used, metadata.csv file should be with .bag files.')
for x in md:
if x['obstacle_name'] == obs_name:
mdr = x
obs_tracklet = Tracklet(
object_type=mdr['object_type'], l=mdr['l'], w=mdr['w'], h=mdr['h'], first_frame=0)
# NOTE these calculations are done in obstacle oriented coordinates. The LWH offsets from
# metadata specify offsets from lower left, rear, ground corner of the vehicle. Where +ve is
# along the respective length, width, height axis away from that point. They are converted to
# velodyne/ROS compatible X,Y,Z where X +ve is forward, Y +ve is left, and Z +ve is up.
lrg_to_gps = [mdr['gps_l'], -mdr['gps_w'], mdr['gps_h']]
lrg_to_centroid = [mdr['l'] / 2., -mdr['w'] / 2., mdr['h'] / 2.]
gps_to_centroid = np.subtract(lrg_to_centroid, lrg_to_gps)
# Convert NED RTK coords of obstacle to capture vehicle body frame relative coordinates
obs_tracklet.poses = estimate_obstacle_poses(
cap_front_rtk=cap_front_rtk_interp_rec,
#cap_front_gps_offset=[0.0, 0.0, 0.0],
cap_rear_rtk=cap_rear_rtk_interp_rec,
#cap_rear_gps_offset=[0.0, 0.0, 0.0],
obs_rear_rtk=obs_interp.to_dict(orient='records'),
obs_rear_gps_offset=gps_to_centroid,
)
collection.tracklets.append(obs_tracklet)
# end for obs_topic loop
tracklet_path = os.path.join(dataset_outdir, 'tracklet_labels.xml')
collection.write_xml(tracklet_path)
else:
print('Warning: No camera image times were found. '
'Skipping sensor interpolation and Tracklet generation.')
if __name__ == '__main__':
main()
| [
"[email protected]"
]
| |
9c0b5755bd03830f93fded39f854b1e51d9fe91e | 50015e72ea35113ad40e13cb36c85116b0048aa9 | /shop_paypal/modifiers.py | 12daf8625068c27aa5c5550745293b3cf29d2b51 | [
"MIT"
]
| permissive | haricot/djangoshop-paypal | 30085baf75d7712aa1b4c39eba7256d9b0f39ef5 | f1c381b4a64201029dcfe60af6e0243dc43fe50c | refs/heads/master | 2020-12-20T12:18:17.495255 | 2020-01-10T22:29:43 | 2020-01-10T22:29:43 | 236,073,186 | 0 | 1 | MIT | 2020-01-24T19:54:41 | 2020-01-24T19:54:40 | null | UTF-8 | Python | false | false | 1,240 | py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from shop.payment.modifiers import PaymentModifier as PaymentModifierBase
from .payment import PayPalPayment
class PaymentModifier(PaymentModifierBase):
"""
Cart modifier which handles payment through PayPal.
"""
payment_provider = PayPalPayment()
commision_percentage = None
def get_choice(self):
return (self.identifier, "PayPal")
def is_disabled(self, cart):
return cart.total == 0
def add_extra_cart_row(self, cart, request):
from decimal import Decimal
from shop.serializers.cart import ExtraCartRow
if not self.is_active(cart) or not self.commision_percentage:
return
amount = cart.total * Decimal(self.commision_percentage / 100.0)
instance = {'label': _("plus {}% handling fees").format(self.commision_percentage), 'amount': amount}
cart.extra_rows[self.identifier] = ExtraCartRow(instance)
cart.total += amount
def update_render_context(self, context):
super(PaymentModifier, self).update_render_context(context)
context['payment_modifiers']['paypal_payment'] = True
| [
"[email protected]"
]
| |
b326be0d3157e8e4c6291097ba566e5d4d202d38 | 0247690e0b33e919c8611f6feef37867052bbf51 | /mayan/apps/events/classes.py | 7c34b0368df856fcc39496b4c7ed1f8016eb9b45 | [
"Apache-2.0",
"BSD-3-Clause"
]
| permissive | tobennanwokike/mayan-edms | 2a499daf9ceb5d9a41c71270135fe652ad304ce1 | 89c145adde90eef849903907394b1c79e88470fd | refs/heads/master | 2020-03-28T00:22:12.704262 | 2018-08-17T08:52:12 | 2018-08-17T08:52:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,928 | py | from __future__ import unicode_literals
import logging
from django.apps import apps
from django.contrib.auth import get_user_model
from django.core.exceptions import PermissionDenied
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from actstream import action
from .permissions import permission_events_view
logger = logging.getLogger(__name__)
@python_2_unicode_compatible
class EventTypeNamespace(object):
_registry = {}
@classmethod
def all(cls):
return sorted(cls._registry.values())
@classmethod
def get(cls, name):
return cls._registry[name]
def __init__(self, name, label):
self.name = name
self.label = label
self.event_types = []
self.__class__._registry[name] = self
def __str__(self):
return force_text(self.label)
def add_event_type(self, name, label):
event_type = EventType(namespace=self, name=name, label=label)
self.event_types.append(event_type)
return event_type
def get_event_types(self):
return EventType.sort(event_type_list=self.event_types)
@python_2_unicode_compatible
class EventType(object):
_registry = {}
@staticmethod
def sort(event_type_list):
return sorted(
event_type_list, key=lambda x: (x.namespace.label, x.label)
)
@classmethod
def all(cls):
# Return sorted permisions by namespace.name
return EventType.sort(event_type_list=cls._registry.values())
@classmethod
def get(cls, name):
try:
return cls._registry[name]
except KeyError:
return _('Unknown or obsolete event type: %s') % name
@classmethod
def refresh(cls):
for event_type in cls.all():
event_type.get_stored_event_type()
def __init__(self, namespace, name, label):
self.namespace = namespace
self.name = name
self.label = label
self.stored_event_type = None
self.__class__._registry[self.id] = self
def __str__(self):
return force_text('{}: {}'.format(self.namespace.label, self.label))
def commit(self, actor=None, action_object=None, target=None):
AccessControlList = apps.get_model(
app_label='acls', model_name='AccessControlList'
)
Action = apps.get_model(
app_label='actstream', model_name='Action'
)
ContentType = apps.get_model(
app_label='contenttypes', model_name='ContentType'
)
Notification = apps.get_model(
app_label='events', model_name='Notification'
)
results = action.send(
actor or target, actor=actor, verb=self.id,
action_object=action_object, target=target
)
for handler, result in results:
if isinstance(result, Action):
for user in get_user_model().objects.all():
notification = None
if user.event_subscriptions.filter(stored_event_type__name=result.verb).exists():
if result.target:
try:
AccessControlList.objects.check_access(
permissions=permission_events_view,
user=user, obj=result.target
)
except PermissionDenied:
pass
else:
notification, created = Notification.objects.get_or_create(
action=result, user=user
)
else:
notification, created = Notification.objects.get_or_create(
action=result, user=user
)
if result.target:
content_type = ContentType.objects.get_for_model(model=result.target)
relationship = user.object_subscriptions.filter(
content_type=content_type,
object_id=result.target.pk,
stored_event_type__name=result.verb
)
if relationship.exists():
try:
AccessControlList.objects.check_access(
permissions=permission_events_view,
user=user, obj=result.target
)
except PermissionDenied:
pass
else:
notification, created = Notification.objects.get_or_create(
action=result, user=user
)
if not notification and result.action_object:
content_type = ContentType.objects.get_for_model(model=result.action_object)
relationship = user.object_subscriptions.filter(
content_type=content_type,
object_id=result.action_object.pk,
stored_event_type__name=result.verb
)
if relationship.exists():
try:
AccessControlList.objects.check_access(
permissions=permission_events_view,
user=user, obj=result.action_object
)
except PermissionDenied:
pass
else:
notification, created = Notification.objects.get_or_create(
action=result, user=user
)
def get_stored_event_type(self):
if not self.stored_event_type:
StoredEventType = apps.get_model('events', 'StoredEventType')
self.stored_event_type, created = StoredEventType.objects.get_or_create(
name=self.id
)
return self.stored_event_type
@property
def id(self):
return '%s.%s' % (self.namespace.name, self.name)
class ModelEventType(object):
"""
Class to allow matching a model to a specific set of events.
"""
_inheritances = {}
_proxies = {}
_registry = {}
@classmethod
def get_for_class(cls, klass):
return cls._registry.get(klass, ())
@classmethod
def get_for_instance(cls, instance):
StoredEventType = apps.get_model(
app_label='events', model_name='StoredEventType'
)
events = []
class_events = cls._registry.get(type(instance))
if class_events:
events.extend(class_events)
proxy = cls._proxies.get(type(instance))
if proxy:
events.extend(cls._registry.get(proxy))
pks = [
event.id for event in set(events)
]
return EventType.sort(
event_type_list=StoredEventType.objects.filter(name__in=pks)
)
@classmethod
def get_inheritance(cls, model):
return cls._inheritances[model]
@classmethod
def register(cls, model, event_types):
cls._registry.setdefault(model, [])
for event_type in event_types:
cls._registry[model].append(event_type)
@classmethod
def register_inheritance(cls, model, related):
cls._inheritances[model] = related
@classmethod
def register_proxy(cls, source, model):
cls._proxies[model] = source
| [
"[email protected]"
]
| |
3c63fe02ede7587da3872d2f6648382246af942d | 09fafd03fc39cb890b57f143285925a48d114318 | /tool_angle/DynamixelSDK/python/tests/protocol2_0/read_write.py | 345cc047828cda6bc773f29f448adc7eb29f2018 | [
"BSD-3-Clause",
"Apache-2.0"
]
| permissive | SamKaiYang/robot_control_hiwin_ros | 83914e1af44da69631b079ad5eeff4bd49e6abc9 | 50457391013b4cad90b932ffc5afa078f00da7bb | refs/heads/master | 2023-08-17T03:21:57.466251 | 2021-09-18T06:32:30 | 2021-09-18T06:32:30 | 292,339,605 | 1 | 2 | BSD-3-Clause | 2020-09-22T17:04:20 | 2020-09-02T16:45:12 | Python | UTF-8 | Python | false | false | 5,851 | py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
# Copyright 2017 ROBOTIS CO., LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
# Author: Ryu Woon Jung (Leon)
#
# ********* Read and Write Example *********
#
#
# Available Dynamixel model on this example : All models using Protocol 2.0
# This example is designed for using a Dynamixel PRO 54-200, and an USB2DYNAMIXEL.
# To use another Dynamixel model, such as X series, see their details in E-Manual(emanual.robotis.com) and edit below variables yourself.
# Be sure that Dynamixel PRO properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 57600)
#
import os
if os.name == 'nt':
import msvcrt
def getch():
return msvcrt.getch().decode()
else:
import sys, tty, termios
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
def getch():
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch
from dynamixel_sdk import * # Uses Dynamixel SDK library
# Control table address
ADDR_PRO_TORQUE_ENABLE = 64 # Control table address is different in Dynamixel model
ADDR_PRO_GOAL_POSITION = 116
ADDR_PRO_PRESENT_POSITION = 132
# Protocol version
PROTOCOL_VERSION = 2.0 # See which protocol version is used in the Dynamixel
# Default setting
DXL_ID = 1 # Dynamixel ID : 1
BAUDRATE = 57600 # Dynamixel default baudrate : 57600
DEVICENAME = '/dev/ttyUSB0' # Check which port is being used on your controller
# ex) Windows: "COM1" Linux: "/dev/ttyUSB0" Mac: "/dev/tty.usbserial-*"
TORQUE_ENABLE = 1 # Value for enabling the torque
TORQUE_DISABLE = 0 # Value for disabling the torque
DXL_MINIMUM_POSITION_VALUE = 10 # Dynamixel will rotate between this value
DXL_MAXIMUM_POSITION_VALUE = 4000 # and this value (note that the Dynamixel would not move when the position value is out of movable range. Check e-manual about the range of the Dynamixel you use.)
DXL_MOVING_STATUS_THRESHOLD = 20 # Dynamixel moving status threshold
index = 0
dxl_goal_position = [DXL_MINIMUM_POSITION_VALUE, DXL_MAXIMUM_POSITION_VALUE] # Goal position
# Initialize PortHandler instance
# Set the port path
# Get methods and members of PortHandlerLinux or PortHandlerWindows
portHandler = PortHandler(DEVICENAME)
# Initialize PacketHandler instance
# Set the protocol version
# Get methods and members of Protocol1PacketHandler or Protocol2PacketHandler
packetHandler = PacketHandler(PROTOCOL_VERSION)
# Open port
if portHandler.openPort():
print("Succeeded to open the port")
else:
print("Failed to open the port")
print("Press any key to terminate...")
getch()
quit()
# Set port baudrate
if portHandler.setBaudRate(BAUDRATE):
print("Succeeded to change the baudrate")
else:
print("Failed to change the baudrate")
print("Press any key to terminate...")
getch()
quit()
# Enable Dynamixel Torque
dxl_comm_result, dxl_error = packetHandler.write1ByteTxRx(portHandler, DXL_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_ENABLE)
if dxl_comm_result != COMM_SUCCESS:
print("%s" % packetHandler.getTxRxResult(dxl_comm_result))
elif dxl_error != 0:
print("%s" % packetHandler.getRxPacketError(dxl_error))
else:
print("Dynamixel has been successfully connected")
while 1:
print("Press any key to continue! (or press ESC to quit!)")
if getch() == chr(0x1b):
break
# Write goal position
dxl_comm_result, dxl_error = packetHandler.write4ByteTxRx(portHandler, DXL_ID, ADDR_PRO_GOAL_POSITION, dxl_goal_position[index])
if dxl_comm_result != COMM_SUCCESS:
print("%s" % packetHandler.getTxRxResult(dxl_comm_result))
elif dxl_error != 0:
print("%s" % packetHandler.getRxPacketError(dxl_error))
while 1:
# Read present position
dxl_present_position, dxl_comm_result, dxl_error = packetHandler.read4ByteTxRx(portHandler, DXL_ID, ADDR_PRO_PRESENT_POSITION)
if dxl_comm_result != COMM_SUCCESS:
print("%s" % packetHandler.getTxRxResult(dxl_comm_result))
elif dxl_error != 0:
print("%s" % packetHandler.getRxPacketError(dxl_error))
print("[ID:%03d] GoalPos:%03d PresPos:%03d" % (DXL_ID, dxl_goal_position[index], dxl_present_position))
if not abs(dxl_goal_position[index] - dxl_present_position) > DXL_MOVING_STATUS_THRESHOLD:
break
# Change goal position
if index == 0:
index = 1
else:
index = 0
# Disable Dynamixel Torque
dxl_comm_result, dxl_error = packetHandler.write1ByteTxRx(portHandler, DXL_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_DISABLE)
if dxl_comm_result != COMM_SUCCESS:
print("%s" % packetHandler.getTxRxResult(dxl_comm_result))
elif dxl_error != 0:
print("%s" % packetHandler.getRxPacketError(dxl_error))
# Close port
portHandler.closePort()
| [
"[email protected]"
]
| |
351daf0695f3655bb2f5c218f0f16aa10b92f746 | 159a527d5333f848fa58fed8c39ee6303a507c62 | /RPi_Drone/simpleCali.py | 1c52e69d2795f1f083679fe9fbd2b707efe1af8c | []
| no_license | GitDubs/Pi_Drone | ca3f15f4e33797dd276f8b39c6ac62186ace8d10 | d3bf8817ce12cd6483128b7dd233a7e132b6e2e9 | refs/heads/master | 2020-04-15T19:56:46.744054 | 2020-03-24T16:02:14 | 2020-03-24T16:02:14 | 164,971,308 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 455 | py | import pigpio
import time
import os
import atexit
def exit_handler():
pi.set_servo_pulsewidth(ESC, 0)
ESC = 18
pi = pigpio.pi();
pi.set_servo_pulsewidth(ESC, 0)
max_value = 2500
min_value = 1400
pi.set_servo_pulsewidth(ESC, max_value)
print "connect battery"
input = raw_input()
pi.set_servo_pulsewidth(ESC, min_value)
time.sleep(5)
pi.set_servo_pulsewidth(ESC, 1800)
print "press enter to stop"
input = raw_input()
atexit.register(exit_handler)
| [
"user.email"
]
| user.email |
1b2c6861f8b770d3e0adc653245cf15c1653ed49 | 255e19ddc1bcde0d3d4fe70e01cec9bb724979c9 | /all-gists/d9933aefec50d5a14e37/snippet.py | 87ad5fd6c98ff7ea83980693401ab52e949be51f | [
"MIT"
]
| permissive | gistable/gistable | 26c1e909928ec463026811f69b61619b62f14721 | 665d39a2bd82543d5196555f0801ef8fd4a3ee48 | refs/heads/master | 2023-02-17T21:33:55.558398 | 2023-02-11T18:20:10 | 2023-02-11T18:20:10 | 119,861,038 | 76 | 19 | null | 2020-07-26T03:14:55 | 2018-02-01T16:19:24 | Python | UTF-8 | Python | false | false | 7,254 | py | # Author: Kyle Kastner
# License: BSD 3-Clause
# For a reference on parallel processing in Python see tutorial by David Beazley
# http://www.slideshare.net/dabeaz/an-introduction-to-python-concurrency
# Loosely based on IBM example
# http://www.ibm.com/developerworks/aix/library/au-threadingpython/
# If you want to download all the PASCAL VOC data, use the following in bash...
"""
#! /bin/bash
# 2008
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2008/VOCtrainval_14-Jul-2008.tar
# 2009
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2009/VOCtrainval_11-May-2009.tar
# 2010
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar
# 2011
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2011/VOCtrainval_25-May-2011.tar
# 2012
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
# Latest devkit
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCdevkit_18-May-2011.tar
"""
try:
import Queue
except ImportError:
import queue as Queue
import threading
import time
import glob
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import itertools
import random
class VOCThread(threading.Thread):
"""Image Thread"""
def __init__(self, queue, out_queue):
threading.Thread.__init__(self)
self.queue = queue
self.out_queue = out_queue
def run(self):
while True:
# Grabs image path from queue
image_path_group, mask_path_group = self.queue.get()
image_group = [plt.imread(i) for i in image_path_group]
mask_group = [plt.imread(m) for m in mask_path_group]
# Place images in out queue
self.out_queue.put((image_group, mask_group))
# Signals to queue job is done
self.queue.task_done()
class VOC_dataset(object):
def __init__(self, minibatch_size=3, which_set="train",
voc_path="/data/lisa/data/PASCAL-VOC/VOCdevkit/"):
image_paths = []
mask_paths = []
years = ["VOC2008", "VOC2009", "VOC2010", "VOC2011", "VOC2012"]
for year in years:
voc_year_path = os.path.join(voc_path, year)
image_path = os.path.join(voc_year_path, "JPEGImages")
more_image_paths = glob.glob(os.path.join(image_path, "*.jpg"))
image_paths += more_image_paths
mask_path = os.path.join(voc_year_path, "SegmentationClass")
more_mask_paths = glob.glob(os.path.join(mask_path, "*.png"))
mask_paths += more_mask_paths
def match_paths(seg_file):
names = []
for year in years:
voc_year_path = os.path.join(voc_path, year)
fp = os.path.join(voc_year_path, "ImageSets", "Segmentation")
with open(os.path.join(fp, seg_file)) as f:
names += [fi.strip() for fi in f.readlines()]
ims = []
masks = []
s_ims = sorted(image_paths)
s_masks = sorted(mask_paths)
# Go through short list of names, find first match for each im and
# mask and append
for n in names:
for i in s_ims:
if n in i:
ims.append(i)
break
# slower but logic is easier
for m in s_masks:
if n in m:
masks.append(m)
break
assert len(ims) == len(masks)
return ims, masks
if which_set == "train":
image_paths, mask_paths = match_paths("train.txt")
elif which_set == "trainval":
image_paths, mask_paths = match_paths("trainval.txt")
else:
raise ValueError("Unknown argument to which_set %s" % which_set)
# no segmentations for the test set, assertion will fail
#test_image_paths, test_mask_paths = match_paths("test.txt")
self.image_paths = image_paths
self.mask_paths = mask_paths
assert len(self.image_paths) == len(self.mask_paths)
self.n_per_epoch = len(image_paths)
self.n_samples_seen_ = 0
# Test random order
# random.shuffle(self.image_paths)
self.buffer_size = 5
self.minibatch_size = minibatch_size
self.input_qsize = 15
self.min_input_qsize = 10
if len(self.image_paths) % self.minibatch_size != 0:
print("WARNING: Sample size not an even multiple of minibatch size")
print("Truncating...")
self.image_paths = self.image_paths[:-(
len(self.image_paths) % self.minibatch_size)]
self.mask_paths = self.mask_paths[:-(
len(self.mask_paths) % self.minibatch_size)]
assert len(self.image_paths) % self.minibatch_size == 0
assert len(self.mask_paths) % self.minibatch_size == 0
assert len(self.image_paths) == len(self.mask_paths)
self.grouped_images = zip(*[iter(self.image_paths)] *
self.minibatch_size)
self.grouped_masks = zip(*[iter(self.mask_paths)] *
self.minibatch_size)
assert len(self.grouped_images) == len(self.grouped_masks)
# Infinite...
self.grouped_elements = itertools.cycle(zip(self.grouped_images,
self.grouped_masks))
self.queue = Queue.Queue()
self.out_queue = Queue.Queue(maxsize=self.buffer_size)
self._init_queues()
def _init_queues(self):
for i in range(1):
self.it = VOCThread(self.queue, self.out_queue)
self.it.setDaemon(True)
self.it.start()
# Populate queue with some paths to image data
for n, _ in enumerate(range(self.input_qsize)):
group = self.grouped_elements.next()
self.queue.put(group)
def __iter__(self):
return self
def __next__(self):
return self.next()
def next(self):
return self._step()
def reset(self):
self.n_samples_seen_ = 0
def _step(self):
if self.n_samples_seen_ >= self.n_per_epoch:
self.reset()
raise StopIteration("End of epoch")
image_group, mask_group = self.out_queue.get()
self.n_samples_seen_ += self.minibatch_size
if self.queue.qsize() <= self.min_input_qsize:
for i in range(self.input_qsize):
group = self.grouped_elements.next()
self.queue.put(group)
return image_group, mask_group
if __name__ == "__main__":
# Example usage
ds = VOC_dataset(which_set="trainval")
start = time.time()
#n_minibatches_to_run = 5000
itr = 1
while True:
image_group, mask_group = ds.next()
# time.sleep approximates running some model
time.sleep(1)
stop = time.time()
tot = stop - start
print("Threaded time: %s" % (tot))
print("Minibatch %s" % str(itr))
print("Time ratio (s per minibatch): %s" % (tot / float(itr)))
itr += 1
# test
#if itr >= n_minibatches_to_run:
# break
| [
"[email protected]"
]
| |
45b45006fa8d12f989dc183ab1e0f50b4e2d9667 | 3032a58254a0d61403cc75476438bf60a119c2ea | /ADB Scripts/GMLAB Scripts/GM9 Pro/Functional/GPSGoogleMap.py | 7d7bc345cf7bbd1792137326ec544a1abf74c86b | []
| no_license | anithamini/useful-info | 1e05528d61609ca4249920e41c88957ed1476fd7 | a393db8d8e727d29d185d75f7920e21770a39e70 | refs/heads/master | 2020-04-14T15:42:06.627213 | 2019-01-03T07:02:16 | 2019-01-03T07:02:16 | 163,935,084 | 2 | 3 | null | null | null | null | UTF-8 | Python | false | false | 3,142 | py | import os
import re
from time import sleep
def GPS_ON():
print("Enabling GPS.........")
os.system("adb shell settings put secure location_providers_allowed +gps")
def GPS_OFF():
print("Disabling GPS.........")
os.system("adb shell settings put secure location_providers_allowed -gps")
def kill_map():
print("Closing the GoogleMaps Application.......")
os.system("adb shell am force-stop com.google.android.apps.maps")
sleep(1)
def Google_map_launch():
print("Launching the GoogleMaps Application.......")
os.system("adb shell am start -n com.google.android.apps.maps/com.google.android.maps.MapsActivity")
def search_location():
os.system("adb shell input tap 349 109")
sleep(2)
os.system("adb shell input text 'waverock SEZ'")
os.system("adb shell input keyevent 66")
def sim_test():
os.system("adb shell getprop >gsm.txt ")
with open("gsm.txt","r+") as fh:
lines=fh.readlines()
for line in lines:
#print(line)
string1="[gsm.sim.state]: [READY,READY]"
string2 = "[gsm.sim.state]: [READY,NOT_READY]"
string3 = "[gsm.sim.state]: [NOT_READY,READY]"
string4 = "[gsm.sim.state]: [ABSENT,READY]"
string5 = "[gsm.sim.state]: [READY,ABSENT]"
if (string1 in line or string2 in line or string3 in line or string4 in line or string5 in line):
print("Sim present, so procedding the test")
return 1
else:
print("sim not present, please insert the sim and start the test")
return 0
def switch_mobiledata():
print("Enabling the MobileData")
os.system("adb shell svc data enable")
sleep(3)
def mobiledata_off():
print("Disabling the MobileData")
os.system("adb shell svc data disable")
sleep(1)
def validation():
os.system("adb shell dumpsys location>text.txt")
str1="mStarted=false"
with open("text.txt","r") as fd:
buf=fd.read()
if(re.search(str1,buf,re.I)):
return(True)
else:
return(False)
def checkmobiledata():
os.system("adb shell getprop>mobiledata.txt")
fp=open("mobiledata.txt","r+")
buff=fp.read()
str1="[gsm.defaultpdpcontext.active]: [true]"
if str1 in buff:
print(str1)
return 1
else:
return 0
res=sim_test()
if res:
print("sim is present")
switch_mobiledata()
pre=checkmobiledata()
if pre:
print("mobile data on")
sleep(2)
if(validation()):
print("GPS is disabled.....So enabling GPS now")
GPS_ON()
sleep(3)
kill_map()
Google_map_launch()
sleep(2)
search_location()
sleep(3)
kill_map()
mobiledata_off()
GPS_OFF()
| [
"[email protected]"
]
| |
b1ff178eefe0307fd51681e85df4fbbba93522bc | 9743d5fd24822f79c156ad112229e25adb9ed6f6 | /xai/brain/wordbase/otherforms/_freshening.py | 4611789aff9058da179cb60091496dbac47b7753 | [
"MIT"
]
| permissive | cash2one/xai | de7adad1758f50dd6786bf0111e71a903f039b64 | e76f12c9f4dcf3ac1c7c08b0cc8844c0b0a104b6 | refs/heads/master | 2021-01-19T12:33:54.964379 | 2017-01-28T02:00:50 | 2017-01-28T02:00:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 230 | py |
#calss header
class _FRESHENING():
def __init__(self,):
self.name = "FRESHENING"
self.definitions = freshen
self.parents = []
self.childen = []
self.properties = []
self.jsondata = {}
self.basic = ['freshen']
| [
"[email protected]"
]
| |
6a8b5a661bc5de5d995d5ebc3032fec9c32bb3bd | 3d4fcc7cbfafc4aaebea8e08d3a084ed0f0d06a1 | /Programme_1/Creation_donnees/MIDI/schumm-3fMidiSimple.py | 3b960ac7c7a4d5f017387e01b32ea2cd76707b76 | []
| no_license | XgLsuLzRMy/Composition-Musicale-par-Reseau-de-Neurones | 0421d540efe2d9dc522346810f6237c5f24fa3bf | 518a6485e2ad44e8c7fbae93c94a9dc767454a83 | refs/heads/master | 2021-09-03T20:43:01.218089 | 2018-01-11T20:02:00 | 2018-01-11T20:02:00 | 106,448,584 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 117,270 | py | import midi
pattern=midi.Pattern(format=1, resolution=480, tracks=\
[midi.Track(\
[ midi.NoteOnEvent(tick=1860, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 56]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 55]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 51]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=360, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 50]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 56]),
midi.NoteOnEvent(tick=420, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 56]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 55]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 60]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 54]),
midi.NoteOnEvent(tick=420, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 52]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 58]),
midi.NoteOnEvent(tick=420, channel=0, data=[78, 43]),
midi.NoteOnEvent(tick=60, channel=0, data=[78, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 52]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 52]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[78, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[78, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 48]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 45]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 48]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[82, 43]),
midi.NoteOnEvent(tick=120, channel=0, data=[82, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 42]),
midi.NoteOnEvent(tick=480, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[65, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 39]),
midi.NoteOnEvent(tick=12, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[67, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=12, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[68, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 42]),
midi.NoteOnEvent(tick=12, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 38]),
midi.NoteOnEvent(tick=480, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 43]),
midi.NoteOnEvent(tick=400, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=20, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 56]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 55]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 51]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=360, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 51]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=420, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 56]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 55]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 60]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 54]),
midi.NoteOnEvent(tick=420, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 52]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 58]),
midi.NoteOnEvent(tick=420, channel=0, data=[78, 43]),
midi.NoteOnEvent(tick=60, channel=0, data=[78, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 52]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[78, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[78, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 48]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 45]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 48]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[82, 43]),
midi.NoteOnEvent(tick=120, channel=0, data=[82, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 42]),
midi.NoteOnEvent(tick=480, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[65, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 39]),
midi.NoteOnEvent(tick=12, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[67, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=12, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[68, 42]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 42]),
midi.NoteOnEvent(tick=12, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 38]),
midi.NoteOnEvent(tick=480, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 43]),
midi.NoteOnEvent(tick=480, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 51]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[75, 55]),
midi.NoteOnEvent(tick=12, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 52]),
midi.NoteOnEvent(tick=12, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 52]),
midi.NoteOnEvent(tick=360, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 49]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=30, channel=0, data=[72, 43]),
midi.NoteOnEvent(tick=30, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 49]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 54]),
midi.NoteOnEvent(tick=480, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 54]),
midi.NoteOnEvent(tick=420, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 46]),
midi.NoteOnEvent(tick=60, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 51]),
midi.NoteOnEvent(tick=420, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 45]),
midi.NoteOnEvent(tick=60, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 56]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 56]),
midi.NoteOnEvent(tick=480, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 50]),
midi.NoteOnEvent(tick=12, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[72, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 45]),
midi.NoteOnEvent(tick=12, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 45]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 50]),
midi.NoteOnEvent(tick=480, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 49]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 49]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 55]),
midi.NoteOnEvent(tick=120, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 52]),
midi.NoteOnEvent(tick=240, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 42]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 42]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 39]),
midi.NoteOnEvent(tick=480, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 39]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 35]),
midi.NoteOnEvent(tick=480, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 51]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[75, 55]),
midi.NoteOnEvent(tick=12, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 52]),
midi.NoteOnEvent(tick=12, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 52]),
midi.NoteOnEvent(tick=360, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 49]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=30, channel=0, data=[72, 43]),
midi.NoteOnEvent(tick=30, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 52]),
midi.NoteOnEvent(tick=240, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=240, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 49]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 54]),
midi.NoteOnEvent(tick=480, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 54]),
midi.NoteOnEvent(tick=420, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 46]),
midi.NoteOnEvent(tick=60, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 51]),
midi.NoteOnEvent(tick=420, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 45]),
midi.NoteOnEvent(tick=60, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 56]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 56]),
midi.NoteOnEvent(tick=480, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 50]),
midi.NoteOnEvent(tick=12, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[72, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 45]),
midi.NoteOnEvent(tick=12, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 45]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 50]),
midi.NoteOnEvent(tick=480, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 49]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 49]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 55]),
midi.NoteOnEvent(tick=120, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 52]),
midi.NoteOnEvent(tick=240, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 42]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 42]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 39]),
midi.NoteOnEvent(tick=480, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 39]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 35]),
midi.NoteOnEvent(tick=480, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 64]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 57]),
midi.NoteOnEvent(tick=480, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 64]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 57]),
midi.NoteOnEvent(tick=420, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 56]),
midi.NoteOnEvent(tick=60, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 54]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 54]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 69]),
midi.NoteOnEvent(tick=240, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 48]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 66]),
midi.NoteOnEvent(tick=120, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 67]),
midi.NoteOnEvent(tick=120, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 67]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 63]),
midi.NoteOnEvent(tick=120, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 63]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 64]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 64]),
midi.NoteOnEvent(tick=420, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 57]),
midi.NoteOnEvent(tick=60, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 55]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 55]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 73]),
midi.NoteOnEvent(tick=240, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 62]),
midi.NoteOnEvent(tick=120, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 62]),
midi.NoteOnEvent(tick=120, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 62]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 56]),
midi.NoteOnEvent(tick=120, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 56]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 51]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[66, 49]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 55]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[66, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 60]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[75, 62]),
midi.NoteOnEvent(tick=12, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 58]),
midi.NoteOnEvent(tick=12, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 52]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 58]),
midi.NoteOnEvent(tick=240, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 50]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=240, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=240, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 43]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 39]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 44]),
midi.NoteOnEvent(tick=12, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[63, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 45]),
midi.NoteOnEvent(tick=12, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[61, 39]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 44]),
midi.NoteOnEvent(tick=12, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 43]),
midi.NoteOnEvent(tick=12, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=468, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 43]),
midi.NoteOnEvent(tick=480, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 64]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 57]),
midi.NoteOnEvent(tick=480, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 64]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 57]),
midi.NoteOnEvent(tick=420, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 56]),
midi.NoteOnEvent(tick=60, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 54]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 54]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 69]),
midi.NoteOnEvent(tick=240, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 48]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 66]),
midi.NoteOnEvent(tick=120, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 67]),
midi.NoteOnEvent(tick=120, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 67]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 63]),
midi.NoteOnEvent(tick=120, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 63]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 64]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 64]),
midi.NoteOnEvent(tick=420, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 57]),
midi.NoteOnEvent(tick=60, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 55]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 55]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 73]),
midi.NoteOnEvent(tick=240, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 62]),
midi.NoteOnEvent(tick=120, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 62]),
midi.NoteOnEvent(tick=120, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 62]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[75, 56]),
midi.NoteOnEvent(tick=120, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 56]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 51]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[66, 49]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 55]),
midi.NoteOnEvent(tick=480, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[66, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 57]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 60]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[75, 62]),
midi.NoteOnEvent(tick=12, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 58]),
midi.NoteOnEvent(tick=12, channel=0, data=[75, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 52]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 58]),
midi.NoteOnEvent(tick=240, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 46]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 50]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[60, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=12, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=228, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 48]),
midi.NoteOnEvent(tick=240, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 43]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 39]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 44]),
midi.NoteOnEvent(tick=12, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[63, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 45]),
midi.NoteOnEvent(tick=12, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[61, 39]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 44]),
midi.NoteOnEvent(tick=12, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 43]),
midi.NoteOnEvent(tick=12, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=468, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 43]),
midi.NoteOnEvent(tick=420, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 48]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 40]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 40]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 43]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 39]),
midi.NoteOnEvent(tick=60, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 45]),
midi.NoteOnEvent(tick=360, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 39]),
midi.NoteOnEvent(tick=60, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 45]),
midi.NoteOnEvent(tick=420, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=60, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 42]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 39]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 49]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 44]),
midi.NoteOnEvent(tick=420, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 39]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 43]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 48]),
midi.NoteOnEvent(tick=420, channel=0, data=[78, 34]),
midi.NoteOnEvent(tick=60, channel=0, data=[78, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 43]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 33]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 37]),
midi.NoteOnEvent(tick=120, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[78, 37]),
midi.NoteOnEvent(tick=120, channel=0, data=[78, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 39]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 33]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 37]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 39]),
midi.NoteOnEvent(tick=240, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[82, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[82, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 33]),
midi.NoteOnEvent(tick=480, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 33]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 31]),
midi.NoteOnEvent(tick=12, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 31]),
midi.NoteOnEvent(tick=12, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 31]),
midi.NoteOnEvent(tick=12, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=108, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 33]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 34]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 30]),
midi.NoteOnEvent(tick=480, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 34]),
midi.NoteOnEvent(tick=400, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=20, channel=0, data=[80, 34]),
midi.NoteOnEvent(tick=60, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 39]),
midi.NoteOnEvent(tick=240, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 33]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 37]),
midi.NoteOnEvent(tick=120, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 37]),
midi.NoteOnEvent(tick=120, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 39]),
midi.NoteOnEvent(tick=240, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 36]),
midi.NoteOnEvent(tick=240, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[82, 45]),
midi.NoteOnEvent(tick=240, channel=0, data=[82, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 43]),
midi.NoteOnEvent(tick=480, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 39]),
midi.NoteOnEvent(tick=60, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 34]),
midi.NoteOnEvent(tick=60, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 43]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[73, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[73, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 39]),
midi.NoteOnEvent(tick=240, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 32]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 32]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 32]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 36]),
midi.NoteOnEvent(tick=120, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 42]),
midi.NoteOnEvent(tick=480, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 42]),
midi.NoteOnEvent(tick=420, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 30]),
midi.NoteOnEvent(tick=60, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 34]),
midi.NoteOnEvent(tick=240, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 34]),
midi.NoteOnEvent(tick=240, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 36]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 32]),
midi.NoteOnEvent(tick=240, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 34]),
midi.NoteOnEvent(tick=0, channel=0, data=[82, 38]),
midi.NoteOnEvent(tick=240, channel=0, data=[82, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[80, 36]),
midi.NoteOnEvent(tick=480, channel=0, data=[80, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[79, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[79, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 34]),
midi.NoteOnEvent(tick=60, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 31]),
midi.NoteOnEvent(tick=60, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 34]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[69, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 34]),
midi.NoteOnEvent(tick=240, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 34]),
midi.NoteOnEvent(tick=180, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 31]),
midi.NoteOnEvent(tick=60, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 34]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[69, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 34]),
midi.NoteOnEvent(tick=240, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 34]),
midi.NoteOnEvent(tick=180, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 31]),
midi.NoteOnEvent(tick=60, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 34]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[69, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 34]),
midi.NoteOnEvent(tick=240, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 34]),
midi.NoteOnEvent(tick=0, channel=0, data=[76, 38]),
midi.NoteOnEvent(tick=240, channel=0, data=[76, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 42]),
midi.NoteOnEvent(tick=480, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[77, 42]),
midi.NoteOnEvent(tick=420, channel=0, data=[77, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 38]),
midi.NoteOnEvent(tick=60, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 42]),
midi.NoteOnEvent(tick=240, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 42]),
midi.NoteOnEvent(tick=240, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 32]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 36]),
midi.NoteOnEvent(tick=240, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=480, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 35]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 39]),
midi.NoteOnEvent(tick=420, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 37]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 42]),
midi.NoteOnEvent(tick=240, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 42]),
midi.NoteOnEvent(tick=240, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 33]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 37]),
midi.NoteOnEvent(tick=240, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 31]),
midi.NoteOnEvent(tick=480, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 31]),
midi.NoteOnEvent(tick=420, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 30]),
midi.NoteOnEvent(tick=60, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 33]),
midi.NoteOnEvent(tick=240, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[74, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[74, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 33]),
midi.NoteOnEvent(tick=240, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[69, 28]),
midi.NoteOnEvent(tick=240, channel=0, data=[69, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 31]),
midi.NoteOnEvent(tick=480, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 31]),
midi.NoteOnEvent(tick=420, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 28]),
midi.NoteOnEvent(tick=60, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 33]),
midi.NoteOnEvent(tick=240, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 30]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[72, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[72, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[70, 33]),
midi.NoteOnEvent(tick=240, channel=0, data=[70, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 26]),
midi.NoteOnEvent(tick=240, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 24]),
midi.NoteOnEvent(tick=480, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 18]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=480, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 18]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=480, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 17]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 19]),
midi.NoteOnEvent(tick=480, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 16]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 18]),
midi.NoteOnEvent(tick=960, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[57, 0]),
midi.EndOfTrackEvent(tick=0, data=[])]),
midi.Track(\
[ midi.NoteOnEvent(tick=0, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[64, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 37]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 37]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 24]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 24]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[64, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 24]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 38]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 25]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 38]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 25]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[49, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 32]),
midi.NoteOnEvent(tick=183, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 20]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 20]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 30]),
midi.NoteOnEvent(tick=134, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 30]),
midi.NoteOnEvent(tick=90, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[48, 29]),
midi.NoteOnEvent(tick=90, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[64, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 32]),
midi.NoteOnEvent(tick=39, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=86, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[64, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 36]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 25]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 32]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 24]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 34]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 24]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 32]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[64, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 24]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 38]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 25]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 38]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 25]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[49, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 32]),
midi.NoteOnEvent(tick=190, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 20]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 20]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 29]),
midi.NoteOnEvent(tick=148, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 30]),
midi.NoteOnEvent(tick=90, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[48, 29]),
midi.NoteOnEvent(tick=90, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[64, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 32]),
midi.NoteOnEvent(tick=49, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 30]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 23]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 28]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 34]),
midi.NoteOnEvent(tick=208, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 24]),
midi.NoteOnEvent(tick=240, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 32]),
midi.NoteOnEvent(tick=183, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 25]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[49, 29]),
midi.NoteOnEvent(tick=75, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 23]),
midi.NoteOnEvent(tick=90, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[49, 30]),
midi.NoteOnEvent(tick=90, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 23]),
midi.NoteOnEvent(tick=90, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[51, 29]),
midi.NoteOnEvent(tick=90, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[63, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[51, 29]),
midi.NoteOnEvent(tick=90, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=169, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 28]),
midi.NoteOnEvent(tick=56, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 30]),
midi.NoteOnEvent(tick=92, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 23]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 28]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[68, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 23]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 34]),
midi.NoteOnEvent(tick=233, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 28]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 24]),
midi.NoteOnEvent(tick=240, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 32]),
midi.NoteOnEvent(tick=197, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 29]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 25]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[68, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[49, 29]),
midi.NoteOnEvent(tick=76, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 23]),
midi.NoteOnEvent(tick=90, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[49, 30]),
midi.NoteOnEvent(tick=90, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 23]),
midi.NoteOnEvent(tick=90, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[51, 29]),
midi.NoteOnEvent(tick=90, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[63, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[51, 29]),
midi.NoteOnEvent(tick=90, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 22]),
midi.NoteOnEvent(tick=90, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[56, 29]),
midi.NoteOnEvent(tick=141, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 28]),
midi.NoteOnEvent(tick=70, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 20]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 51]),
midi.NoteOnEvent(tick=91, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 48]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 40]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 48]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 40]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[44, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[44, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[45, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[45, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[54, 33]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[54, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 33]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[37, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[37, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[49, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 33]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[39, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[39, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[51, 20]),
midi.NoteOnEvent(tick=120, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[39, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[39, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[55, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[51, 20]),
midi.NoteOnEvent(tick=120, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[44, 27]),
midi.NoteOnEvent(tick=169, channel=0, data=[44, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[51, 18]),
midi.NoteOnEvent(tick=240, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[44, 27]),
midi.NoteOnEvent(tick=99, channel=0, data=[44, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[51, 18]),
midi.NoteOnEvent(tick=240, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 51]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 45]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 37]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 31]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 48]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 40]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 52]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 48]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 40]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 38]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 32]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[44, 46]),
midi.NoteOnEvent(tick=120, channel=0, data=[44, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 40]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 34]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[45, 45]),
midi.NoteOnEvent(tick=120, channel=0, data=[45, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[54, 33]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 39]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[54, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 33]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[37, 38]),
midi.NoteOnEvent(tick=120, channel=0, data=[37, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[49, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 33]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[39, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[39, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[56, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[51, 20]),
midi.NoteOnEvent(tick=120, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[39, 29]),
midi.NoteOnEvent(tick=120, channel=0, data=[39, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[55, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[51, 20]),
midi.NoteOnEvent(tick=120, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[44, 27]),
midi.NoteOnEvent(tick=190, channel=0, data=[44, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[51, 18]),
midi.NoteOnEvent(tick=240, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[44, 27]),
midi.NoteOnEvent(tick=173, channel=0, data=[44, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[51, 18]),
midi.NoteOnEvent(tick=180, channel=0, data=[51, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[56, 0]),
midi.NoteOnEvent(tick=60, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=65, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[64, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 29]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 29]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[64, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 30]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[53, 30]),
midi.NoteOnEvent(tick=90, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[65, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=90, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[49, 27]),
midi.NoteOnEvent(tick=183, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 18]),
midi.NoteOnEvent(tick=240, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 27]),
midi.NoteOnEvent(tick=165, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 18]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[63, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[46, 27]),
midi.NoteOnEvent(tick=162, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 19]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 16]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 16]),
midi.NoteOnEvent(tick=240, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 25]),
midi.NoteOnEvent(tick=141, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 19]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 16]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 25]),
midi.NoteOnEvent(tick=105, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 19]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 16]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[61, 25]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 20]),
midi.NoteOnEvent(tick=120, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[47, 29]),
midi.NoteOnEvent(tick=240, channel=0, data=[47, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[62, 27]),
midi.NoteOnEvent(tick=0, channel=0, data=[59, 23]),
midi.NoteOnEvent(tick=240, channel=0, data=[59, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[62, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[47, 24]),
midi.NoteOnEvent(tick=240, channel=0, data=[47, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[62, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[59, 19]),
midi.NoteOnEvent(tick=120, channel=0, data=[59, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[62, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=208, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 27]),
midi.NoteOnEvent(tick=240, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 19]),
midi.NoteOnEvent(tick=240, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[46, 21]),
midi.NoteOnEvent(tick=90, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[61, 18]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 15]),
midi.NoteOnEvent(tick=90, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[46, 21]),
midi.NoteOnEvent(tick=90, channel=0, data=[46, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[61, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[58, 18]),
midi.NoteOnEvent(tick=90, channel=0, data=[58, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[61, 0]),
midi.NoteOnEvent(tick=150, channel=0, data=[47, 27]),
midi.NoteOnEvent(tick=240, channel=0, data=[47, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[62, 24]),
midi.NoteOnEvent(tick=0, channel=0, data=[59, 19]),
midi.NoteOnEvent(tick=240, channel=0, data=[59, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[62, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[47, 21]),
midi.NoteOnEvent(tick=240, channel=0, data=[47, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[62, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[59, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[59, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[62, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[64, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[64, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[65, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[65, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 24]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[67, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[60, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[60, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[67, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 27]),
midi.NoteOnEvent(tick=194, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 21]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 18]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 27]),
midi.NoteOnEvent(tick=240, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 18]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 27]),
midi.NoteOnEvent(tick=97, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[53, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 19]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 27]),
midi.NoteOnEvent(tick=194, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 19]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 27]),
midi.NoteOnEvent(tick=194, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 23]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 19]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 27]),
midi.NoteOnEvent(tick=104, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[55, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 27]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[55, 22]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 18]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 21]),
midi.NoteOnEvent(tick=163, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 17]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 14]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 21]),
midi.NoteOnEvent(tick=240, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 17]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 14]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 21]),
midi.NoteOnEvent(tick=137, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 17]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 14]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 21]),
midi.NoteOnEvent(tick=80, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[54, 18]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 15]),
midi.NoteOnEvent(tick=120, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[54, 0]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 21]),
midi.NoteOnEvent(tick=187, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 18]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 15]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 21]),
midi.NoteOnEvent(tick=240, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 18]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 15]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 21]),
midi.NoteOnEvent(tick=120, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 17]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 14]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 21]),
midi.NoteOnEvent(tick=92, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 17]),
midi.NoteOnEvent(tick=0, channel=0, data=[49, 14]),
midi.NoteOnEvent(tick=240, channel=0, data=[49, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[55, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 18]),
midi.NoteOnEvent(tick=70, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 13]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 10]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 16]),
midi.NoteOnEvent(tick=240, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 13]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 10]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 14]),
midi.NoteOnEvent(tick=240, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 10]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 9]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 13]),
midi.NoteOnEvent(tick=240, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 10]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 9]),
midi.NoteOnEvent(tick=240, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 10]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 9]),
midi.NoteOnEvent(tick=0, channel=0, data=[41, 9]),
midi.NoteOnEvent(tick=960, channel=0, data=[41, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[48, 0]),
midi.NoteOnEvent(tick=0, channel=0, data=[53, 0]),
midi.EndOfTrackEvent(tick=0, data=[])])])
midi.write_midifile("creationMidi.mid", pattern) | [
"[email protected]"
]
| |
cec5a465126042fd03b4663dc6672c08cd539861 | d6589ff7cf647af56938a9598f9e2e674c0ae6b5 | /ice-20201109/alibabacloud_ice20201109/client.py | 88953d6b4eec3b55cb3d1cba4ff70b9ae9734e45 | [
"Apache-2.0"
]
| permissive | hazho/alibabacloud-python-sdk | 55028a0605b1509941269867a043f8408fa8c296 | cddd32154bb8c12e50772fec55429a9a97f3efd9 | refs/heads/master | 2023-07-01T17:51:57.893326 | 2021-08-02T08:55:22 | 2021-08-02T08:55:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 85,614 | py | # -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from typing import Dict
from Tea.core import TeaCore
from alibabacloud_tea_openapi.client import Client as OpenApiClient
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_tea_util.client import Client as UtilClient
from alibabacloud_endpoint_util.client import Client as EndpointUtilClient
from alibabacloud_ice20201109 import models as ice20201109_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_openapi_util.client import Client as OpenApiUtilClient
class Client(OpenApiClient):
"""
*\
"""
def __init__(
self,
config: open_api_models.Config,
):
super().__init__(config)
self._endpoint_rule = 'regional'
self._endpoint_map = {
'ap-northeast-1': 'ice.aliyuncs.com',
'ap-northeast-2-pop': 'ice.aliyuncs.com',
'ap-south-1': 'ice.aliyuncs.com',
'ap-southeast-1': 'ice.aliyuncs.com',
'ap-southeast-2': 'ice.aliyuncs.com',
'ap-southeast-3': 'ice.aliyuncs.com',
'ap-southeast-5': 'ice.aliyuncs.com',
'cn-beijing': 'ice.aliyuncs.com',
'cn-beijing-finance-1': 'ice.aliyuncs.com',
'cn-beijing-finance-pop': 'ice.aliyuncs.com',
'cn-beijing-gov-1': 'ice.aliyuncs.com',
'cn-beijing-nu16-b01': 'ice.aliyuncs.com',
'cn-chengdu': 'ice.aliyuncs.com',
'cn-edge-1': 'ice.aliyuncs.com',
'cn-fujian': 'ice.aliyuncs.com',
'cn-haidian-cm12-c01': 'ice.aliyuncs.com',
'cn-hangzhou': 'ice.aliyuncs.com',
'cn-hangzhou-bj-b01': 'ice.aliyuncs.com',
'cn-hangzhou-finance': 'ice.aliyuncs.com',
'cn-hangzhou-internal-prod-1': 'ice.aliyuncs.com',
'cn-hangzhou-internal-test-1': 'ice.aliyuncs.com',
'cn-hangzhou-internal-test-2': 'ice.aliyuncs.com',
'cn-hangzhou-internal-test-3': 'ice.aliyuncs.com',
'cn-hangzhou-test-306': 'ice.aliyuncs.com',
'cn-hongkong': 'ice.aliyuncs.com',
'cn-hongkong-finance-pop': 'ice.aliyuncs.com',
'cn-huhehaote': 'ice.aliyuncs.com',
'cn-huhehaote-nebula-1': 'ice.aliyuncs.com',
'cn-north-2-gov-1': 'ice.aliyuncs.com',
'cn-qingdao': 'ice.aliyuncs.com',
'cn-qingdao-nebula': 'ice.aliyuncs.com',
'cn-shanghai-et15-b01': 'ice.aliyuncs.com',
'cn-shanghai-et2-b01': 'ice.aliyuncs.com',
'cn-shanghai-finance-1': 'ice.aliyuncs.com',
'cn-shanghai-inner': 'ice.aliyuncs.com',
'cn-shanghai-internal-test-1': 'ice.aliyuncs.com',
'cn-shenzhen': 'ice.aliyuncs.com',
'cn-shenzhen-finance-1': 'ice.aliyuncs.com',
'cn-shenzhen-inner': 'ice.aliyuncs.com',
'cn-shenzhen-st4-d01': 'ice.aliyuncs.com',
'cn-shenzhen-su18-b01': 'ice.aliyuncs.com',
'cn-wuhan': 'ice.aliyuncs.com',
'cn-wulanchabu': 'ice.aliyuncs.com',
'cn-yushanfang': 'ice.aliyuncs.com',
'cn-zhangbei': 'ice.aliyuncs.com',
'cn-zhangbei-na61-b01': 'ice.aliyuncs.com',
'cn-zhangjiakou': 'ice.aliyuncs.com',
'cn-zhangjiakou-na62-a01': 'ice.aliyuncs.com',
'cn-zhengzhou-nebula-1': 'ice.aliyuncs.com',
'eu-central-1': 'ice.aliyuncs.com',
'eu-west-1': 'ice.aliyuncs.com',
'eu-west-1-oxs': 'ice.aliyuncs.com',
'me-east-1': 'ice.aliyuncs.com',
'rus-west-1-pop': 'ice.aliyuncs.com',
'us-east-1': 'ice.aliyuncs.com',
'us-west-1': 'ice.aliyuncs.com'
}
self.check_config(config)
self._endpoint = self.get_endpoint('ice', self._region_id, self._endpoint_rule, self._network, self._suffix, self._endpoint_map, self._endpoint)
def get_endpoint(
self,
product_id: str,
region_id: str,
endpoint_rule: str,
network: str,
suffix: str,
endpoint_map: Dict[str, str],
endpoint: str,
) -> str:
if not UtilClient.empty(endpoint):
return endpoint
if not UtilClient.is_unset(endpoint_map) and not UtilClient.empty(endpoint_map.get(region_id)):
return endpoint_map.get(region_id)
return EndpointUtilClient.get_endpoint_rules(product_id, region_id, endpoint_rule, network, suffix)
def list_smart_jobs_with_options(
self,
request: ice20201109_models.ListSmartJobsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListSmartJobsResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.ListSmartJobsResponse(),
self.do_rpcrequest('ListSmartJobs', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def list_smart_jobs_with_options_async(
self,
request: ice20201109_models.ListSmartJobsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListSmartJobsResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.ListSmartJobsResponse(),
await self.do_rpcrequest_async('ListSmartJobs', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def list_smart_jobs(
self,
request: ice20201109_models.ListSmartJobsRequest,
) -> ice20201109_models.ListSmartJobsResponse:
runtime = util_models.RuntimeOptions()
return self.list_smart_jobs_with_options(request, runtime)
async def list_smart_jobs_async(
self,
request: ice20201109_models.ListSmartJobsRequest,
) -> ice20201109_models.ListSmartJobsResponse:
runtime = util_models.RuntimeOptions()
return await self.list_smart_jobs_with_options_async(request, runtime)
def describe_related_authorization_status_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DescribeRelatedAuthorizationStatusResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
ice20201109_models.DescribeRelatedAuthorizationStatusResponse(),
self.do_rpcrequest('DescribeRelatedAuthorizationStatus', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def describe_related_authorization_status_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DescribeRelatedAuthorizationStatusResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
ice20201109_models.DescribeRelatedAuthorizationStatusResponse(),
await self.do_rpcrequest_async('DescribeRelatedAuthorizationStatus', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def describe_related_authorization_status(self) -> ice20201109_models.DescribeRelatedAuthorizationStatusResponse:
runtime = util_models.RuntimeOptions()
return self.describe_related_authorization_status_with_options(runtime)
async def describe_related_authorization_status_async(self) -> ice20201109_models.DescribeRelatedAuthorizationStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_related_authorization_status_with_options_async(runtime)
def delete_smart_job_with_options(
self,
request: ice20201109_models.DeleteSmartJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteSmartJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.DeleteSmartJobResponse(),
self.do_rpcrequest('DeleteSmartJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_smart_job_with_options_async(
self,
request: ice20201109_models.DeleteSmartJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteSmartJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.DeleteSmartJobResponse(),
await self.do_rpcrequest_async('DeleteSmartJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_smart_job(
self,
request: ice20201109_models.DeleteSmartJobRequest,
) -> ice20201109_models.DeleteSmartJobResponse:
runtime = util_models.RuntimeOptions()
return self.delete_smart_job_with_options(request, runtime)
async def delete_smart_job_async(
self,
request: ice20201109_models.DeleteSmartJobRequest,
) -> ice20201109_models.DeleteSmartJobResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_smart_job_with_options_async(request, runtime)
def add_template_with_options(
self,
request: ice20201109_models.AddTemplateRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.AddTemplateResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.AddTemplateResponse(),
self.do_rpcrequest('AddTemplate', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def add_template_with_options_async(
self,
request: ice20201109_models.AddTemplateRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.AddTemplateResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.AddTemplateResponse(),
await self.do_rpcrequest_async('AddTemplate', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def add_template(
self,
request: ice20201109_models.AddTemplateRequest,
) -> ice20201109_models.AddTemplateResponse:
runtime = util_models.RuntimeOptions()
return self.add_template_with_options(request, runtime)
async def add_template_async(
self,
request: ice20201109_models.AddTemplateRequest,
) -> ice20201109_models.AddTemplateResponse:
runtime = util_models.RuntimeOptions()
return await self.add_template_with_options_async(request, runtime)
def update_editing_project_with_options(
self,
request: ice20201109_models.UpdateEditingProjectRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.UpdateEditingProjectResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.UpdateEditingProjectResponse(),
self.do_rpcrequest('UpdateEditingProject', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def update_editing_project_with_options_async(
self,
request: ice20201109_models.UpdateEditingProjectRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.UpdateEditingProjectResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.UpdateEditingProjectResponse(),
await self.do_rpcrequest_async('UpdateEditingProject', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def update_editing_project(
self,
request: ice20201109_models.UpdateEditingProjectRequest,
) -> ice20201109_models.UpdateEditingProjectResponse:
runtime = util_models.RuntimeOptions()
return self.update_editing_project_with_options(request, runtime)
async def update_editing_project_async(
self,
request: ice20201109_models.UpdateEditingProjectRequest,
) -> ice20201109_models.UpdateEditingProjectResponse:
runtime = util_models.RuntimeOptions()
return await self.update_editing_project_with_options_async(request, runtime)
def list_media_producing_jobs_with_options(
self,
request: ice20201109_models.ListMediaProducingJobsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListMediaProducingJobsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListMediaProducingJobsResponse(),
self.do_rpcrequest('ListMediaProducingJobs', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def list_media_producing_jobs_with_options_async(
self,
request: ice20201109_models.ListMediaProducingJobsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListMediaProducingJobsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListMediaProducingJobsResponse(),
await self.do_rpcrequest_async('ListMediaProducingJobs', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def list_media_producing_jobs(
self,
request: ice20201109_models.ListMediaProducingJobsRequest,
) -> ice20201109_models.ListMediaProducingJobsResponse:
runtime = util_models.RuntimeOptions()
return self.list_media_producing_jobs_with_options(request, runtime)
async def list_media_producing_jobs_async(
self,
request: ice20201109_models.ListMediaProducingJobsRequest,
) -> ice20201109_models.ListMediaProducingJobsResponse:
runtime = util_models.RuntimeOptions()
return await self.list_media_producing_jobs_with_options_async(request, runtime)
def get_editing_project_materials_with_options(
self,
request: ice20201109_models.GetEditingProjectMaterialsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetEditingProjectMaterialsResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetEditingProjectMaterialsResponse(),
self.do_rpcrequest('GetEditingProjectMaterials', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def get_editing_project_materials_with_options_async(
self,
request: ice20201109_models.GetEditingProjectMaterialsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetEditingProjectMaterialsResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetEditingProjectMaterialsResponse(),
await self.do_rpcrequest_async('GetEditingProjectMaterials', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def get_editing_project_materials(
self,
request: ice20201109_models.GetEditingProjectMaterialsRequest,
) -> ice20201109_models.GetEditingProjectMaterialsResponse:
runtime = util_models.RuntimeOptions()
return self.get_editing_project_materials_with_options(request, runtime)
async def get_editing_project_materials_async(
self,
request: ice20201109_models.GetEditingProjectMaterialsRequest,
) -> ice20201109_models.GetEditingProjectMaterialsResponse:
runtime = util_models.RuntimeOptions()
return await self.get_editing_project_materials_with_options_async(request, runtime)
def get_default_storage_location_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetDefaultStorageLocationResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
ice20201109_models.GetDefaultStorageLocationResponse(),
self.do_rpcrequest('GetDefaultStorageLocation', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_default_storage_location_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetDefaultStorageLocationResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
ice20201109_models.GetDefaultStorageLocationResponse(),
await self.do_rpcrequest_async('GetDefaultStorageLocation', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_default_storage_location(self) -> ice20201109_models.GetDefaultStorageLocationResponse:
runtime = util_models.RuntimeOptions()
return self.get_default_storage_location_with_options(runtime)
async def get_default_storage_location_async(self) -> ice20201109_models.GetDefaultStorageLocationResponse:
runtime = util_models.RuntimeOptions()
return await self.get_default_storage_location_with_options_async(runtime)
def delete_media_infos_with_options(
self,
request: ice20201109_models.DeleteMediaInfosRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteMediaInfosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.DeleteMediaInfosResponse(),
self.do_rpcrequest('DeleteMediaInfos', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_media_infos_with_options_async(
self,
request: ice20201109_models.DeleteMediaInfosRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteMediaInfosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.DeleteMediaInfosResponse(),
await self.do_rpcrequest_async('DeleteMediaInfos', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_media_infos(
self,
request: ice20201109_models.DeleteMediaInfosRequest,
) -> ice20201109_models.DeleteMediaInfosResponse:
runtime = util_models.RuntimeOptions()
return self.delete_media_infos_with_options(request, runtime)
async def delete_media_infos_async(
self,
request: ice20201109_models.DeleteMediaInfosRequest,
) -> ice20201109_models.DeleteMediaInfosResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_media_infos_with_options_async(request, runtime)
def set_event_callback_with_options(
self,
request: ice20201109_models.SetEventCallbackRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SetEventCallbackResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SetEventCallbackResponse(),
self.do_rpcrequest('SetEventCallback', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def set_event_callback_with_options_async(
self,
request: ice20201109_models.SetEventCallbackRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SetEventCallbackResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SetEventCallbackResponse(),
await self.do_rpcrequest_async('SetEventCallback', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def set_event_callback(
self,
request: ice20201109_models.SetEventCallbackRequest,
) -> ice20201109_models.SetEventCallbackResponse:
runtime = util_models.RuntimeOptions()
return self.set_event_callback_with_options(request, runtime)
async def set_event_callback_async(
self,
request: ice20201109_models.SetEventCallbackRequest,
) -> ice20201109_models.SetEventCallbackResponse:
runtime = util_models.RuntimeOptions()
return await self.set_event_callback_with_options_async(request, runtime)
def get_template_with_options(
self,
request: ice20201109_models.GetTemplateRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetTemplateResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetTemplateResponse(),
self.do_rpcrequest('GetTemplate', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def get_template_with_options_async(
self,
request: ice20201109_models.GetTemplateRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetTemplateResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetTemplateResponse(),
await self.do_rpcrequest_async('GetTemplate', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def get_template(
self,
request: ice20201109_models.GetTemplateRequest,
) -> ice20201109_models.GetTemplateResponse:
runtime = util_models.RuntimeOptions()
return self.get_template_with_options(request, runtime)
async def get_template_async(
self,
request: ice20201109_models.GetTemplateRequest,
) -> ice20201109_models.GetTemplateResponse:
runtime = util_models.RuntimeOptions()
return await self.get_template_with_options_async(request, runtime)
def register_media_info_with_options(
self,
request: ice20201109_models.RegisterMediaInfoRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.RegisterMediaInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.RegisterMediaInfoResponse(),
self.do_rpcrequest('RegisterMediaInfo', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def register_media_info_with_options_async(
self,
request: ice20201109_models.RegisterMediaInfoRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.RegisterMediaInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.RegisterMediaInfoResponse(),
await self.do_rpcrequest_async('RegisterMediaInfo', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def register_media_info(
self,
request: ice20201109_models.RegisterMediaInfoRequest,
) -> ice20201109_models.RegisterMediaInfoResponse:
runtime = util_models.RuntimeOptions()
return self.register_media_info_with_options(request, runtime)
async def register_media_info_async(
self,
request: ice20201109_models.RegisterMediaInfoRequest,
) -> ice20201109_models.RegisterMediaInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.register_media_info_with_options_async(request, runtime)
def create_editing_project_with_options(
self,
request: ice20201109_models.CreateEditingProjectRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.CreateEditingProjectResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.CreateEditingProjectResponse(),
self.do_rpcrequest('CreateEditingProject', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def create_editing_project_with_options_async(
self,
request: ice20201109_models.CreateEditingProjectRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.CreateEditingProjectResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.CreateEditingProjectResponse(),
await self.do_rpcrequest_async('CreateEditingProject', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def create_editing_project(
self,
request: ice20201109_models.CreateEditingProjectRequest,
) -> ice20201109_models.CreateEditingProjectResponse:
runtime = util_models.RuntimeOptions()
return self.create_editing_project_with_options(request, runtime)
async def create_editing_project_async(
self,
request: ice20201109_models.CreateEditingProjectRequest,
) -> ice20201109_models.CreateEditingProjectResponse:
runtime = util_models.RuntimeOptions()
return await self.create_editing_project_with_options_async(request, runtime)
def batch_get_media_infos_with_options(
self,
request: ice20201109_models.BatchGetMediaInfosRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.BatchGetMediaInfosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.BatchGetMediaInfosResponse(),
self.do_rpcrequest('BatchGetMediaInfos', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def batch_get_media_infos_with_options_async(
self,
request: ice20201109_models.BatchGetMediaInfosRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.BatchGetMediaInfosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.BatchGetMediaInfosResponse(),
await self.do_rpcrequest_async('BatchGetMediaInfos', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def batch_get_media_infos(
self,
request: ice20201109_models.BatchGetMediaInfosRequest,
) -> ice20201109_models.BatchGetMediaInfosResponse:
runtime = util_models.RuntimeOptions()
return self.batch_get_media_infos_with_options(request, runtime)
async def batch_get_media_infos_async(
self,
request: ice20201109_models.BatchGetMediaInfosRequest,
) -> ice20201109_models.BatchGetMediaInfosResponse:
runtime = util_models.RuntimeOptions()
return await self.batch_get_media_infos_with_options_async(request, runtime)
def set_default_storage_location_with_options(
self,
request: ice20201109_models.SetDefaultStorageLocationRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SetDefaultStorageLocationResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SetDefaultStorageLocationResponse(),
self.do_rpcrequest('SetDefaultStorageLocation', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def set_default_storage_location_with_options_async(
self,
request: ice20201109_models.SetDefaultStorageLocationRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SetDefaultStorageLocationResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SetDefaultStorageLocationResponse(),
await self.do_rpcrequest_async('SetDefaultStorageLocation', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def set_default_storage_location(
self,
request: ice20201109_models.SetDefaultStorageLocationRequest,
) -> ice20201109_models.SetDefaultStorageLocationResponse:
runtime = util_models.RuntimeOptions()
return self.set_default_storage_location_with_options(request, runtime)
async def set_default_storage_location_async(
self,
request: ice20201109_models.SetDefaultStorageLocationRequest,
) -> ice20201109_models.SetDefaultStorageLocationResponse:
runtime = util_models.RuntimeOptions()
return await self.set_default_storage_location_with_options_async(request, runtime)
def update_media_info_with_options(
self,
request: ice20201109_models.UpdateMediaInfoRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.UpdateMediaInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.UpdateMediaInfoResponse(),
self.do_rpcrequest('UpdateMediaInfo', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def update_media_info_with_options_async(
self,
request: ice20201109_models.UpdateMediaInfoRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.UpdateMediaInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.UpdateMediaInfoResponse(),
await self.do_rpcrequest_async('UpdateMediaInfo', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def update_media_info(
self,
request: ice20201109_models.UpdateMediaInfoRequest,
) -> ice20201109_models.UpdateMediaInfoResponse:
runtime = util_models.RuntimeOptions()
return self.update_media_info_with_options(request, runtime)
async def update_media_info_async(
self,
request: ice20201109_models.UpdateMediaInfoRequest,
) -> ice20201109_models.UpdateMediaInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.update_media_info_with_options_async(request, runtime)
def get_media_producing_job_with_options(
self,
request: ice20201109_models.GetMediaProducingJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetMediaProducingJobResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetMediaProducingJobResponse(),
self.do_rpcrequest('GetMediaProducingJob', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def get_media_producing_job_with_options_async(
self,
request: ice20201109_models.GetMediaProducingJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetMediaProducingJobResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetMediaProducingJobResponse(),
await self.do_rpcrequest_async('GetMediaProducingJob', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def get_media_producing_job(
self,
request: ice20201109_models.GetMediaProducingJobRequest,
) -> ice20201109_models.GetMediaProducingJobResponse:
runtime = util_models.RuntimeOptions()
return self.get_media_producing_job_with_options(request, runtime)
async def get_media_producing_job_async(
self,
request: ice20201109_models.GetMediaProducingJobRequest,
) -> ice20201109_models.GetMediaProducingJobResponse:
runtime = util_models.RuntimeOptions()
return await self.get_media_producing_job_with_options_async(request, runtime)
def describe_ice_product_status_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DescribeIceProductStatusResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
ice20201109_models.DescribeIceProductStatusResponse(),
self.do_rpcrequest('DescribeIceProductStatus', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def describe_ice_product_status_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DescribeIceProductStatusResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
ice20201109_models.DescribeIceProductStatusResponse(),
await self.do_rpcrequest_async('DescribeIceProductStatus', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def describe_ice_product_status(self) -> ice20201109_models.DescribeIceProductStatusResponse:
runtime = util_models.RuntimeOptions()
return self.describe_ice_product_status_with_options(runtime)
async def describe_ice_product_status_async(self) -> ice20201109_models.DescribeIceProductStatusResponse:
runtime = util_models.RuntimeOptions()
return await self.describe_ice_product_status_with_options_async(runtime)
def list_media_basic_infos_with_options(
self,
request: ice20201109_models.ListMediaBasicInfosRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListMediaBasicInfosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListMediaBasicInfosResponse(),
self.do_rpcrequest('ListMediaBasicInfos', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def list_media_basic_infos_with_options_async(
self,
request: ice20201109_models.ListMediaBasicInfosRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListMediaBasicInfosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListMediaBasicInfosResponse(),
await self.do_rpcrequest_async('ListMediaBasicInfos', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def list_media_basic_infos(
self,
request: ice20201109_models.ListMediaBasicInfosRequest,
) -> ice20201109_models.ListMediaBasicInfosResponse:
runtime = util_models.RuntimeOptions()
return self.list_media_basic_infos_with_options(request, runtime)
async def list_media_basic_infos_async(
self,
request: ice20201109_models.ListMediaBasicInfosRequest,
) -> ice20201109_models.ListMediaBasicInfosResponse:
runtime = util_models.RuntimeOptions()
return await self.list_media_basic_infos_with_options_async(request, runtime)
def submit_subtitle_produce_job_with_options(
self,
request: ice20201109_models.SubmitSubtitleProduceJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitSubtitleProduceJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitSubtitleProduceJobResponse(),
self.do_rpcrequest('SubmitSubtitleProduceJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_subtitle_produce_job_with_options_async(
self,
request: ice20201109_models.SubmitSubtitleProduceJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitSubtitleProduceJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitSubtitleProduceJobResponse(),
await self.do_rpcrequest_async('SubmitSubtitleProduceJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_subtitle_produce_job(
self,
request: ice20201109_models.SubmitSubtitleProduceJobRequest,
) -> ice20201109_models.SubmitSubtitleProduceJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_subtitle_produce_job_with_options(request, runtime)
async def submit_subtitle_produce_job_async(
self,
request: ice20201109_models.SubmitSubtitleProduceJobRequest,
) -> ice20201109_models.SubmitSubtitleProduceJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_subtitle_produce_job_with_options_async(request, runtime)
def submit_key_word_cut_job_with_options(
self,
request: ice20201109_models.SubmitKeyWordCutJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitKeyWordCutJobResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.SubmitKeyWordCutJobResponse(),
self.do_rpcrequest('SubmitKeyWordCutJob', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def submit_key_word_cut_job_with_options_async(
self,
request: ice20201109_models.SubmitKeyWordCutJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitKeyWordCutJobResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.SubmitKeyWordCutJobResponse(),
await self.do_rpcrequest_async('SubmitKeyWordCutJob', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def submit_key_word_cut_job(
self,
request: ice20201109_models.SubmitKeyWordCutJobRequest,
) -> ice20201109_models.SubmitKeyWordCutJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_key_word_cut_job_with_options(request, runtime)
async def submit_key_word_cut_job_async(
self,
request: ice20201109_models.SubmitKeyWordCutJobRequest,
) -> ice20201109_models.SubmitKeyWordCutJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_key_word_cut_job_with_options_async(request, runtime)
def add_editing_project_materials_with_options(
self,
request: ice20201109_models.AddEditingProjectMaterialsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.AddEditingProjectMaterialsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.AddEditingProjectMaterialsResponse(),
self.do_rpcrequest('AddEditingProjectMaterials', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def add_editing_project_materials_with_options_async(
self,
request: ice20201109_models.AddEditingProjectMaterialsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.AddEditingProjectMaterialsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.AddEditingProjectMaterialsResponse(),
await self.do_rpcrequest_async('AddEditingProjectMaterials', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def add_editing_project_materials(
self,
request: ice20201109_models.AddEditingProjectMaterialsRequest,
) -> ice20201109_models.AddEditingProjectMaterialsResponse:
runtime = util_models.RuntimeOptions()
return self.add_editing_project_materials_with_options(request, runtime)
async def add_editing_project_materials_async(
self,
request: ice20201109_models.AddEditingProjectMaterialsRequest,
) -> ice20201109_models.AddEditingProjectMaterialsResponse:
runtime = util_models.RuntimeOptions()
return await self.add_editing_project_materials_with_options_async(request, runtime)
def submit_asrjob_with_options(
self,
request: ice20201109_models.SubmitASRJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitASRJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitASRJobResponse(),
self.do_rpcrequest('SubmitASRJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_asrjob_with_options_async(
self,
request: ice20201109_models.SubmitASRJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitASRJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitASRJobResponse(),
await self.do_rpcrequest_async('SubmitASRJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_asrjob(
self,
request: ice20201109_models.SubmitASRJobRequest,
) -> ice20201109_models.SubmitASRJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_asrjob_with_options(request, runtime)
async def submit_asrjob_async(
self,
request: ice20201109_models.SubmitASRJobRequest,
) -> ice20201109_models.SubmitASRJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_asrjob_with_options_async(request, runtime)
def get_editing_project_with_options(
self,
request: ice20201109_models.GetEditingProjectRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetEditingProjectResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetEditingProjectResponse(),
self.do_rpcrequest('GetEditingProject', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def get_editing_project_with_options_async(
self,
request: ice20201109_models.GetEditingProjectRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetEditingProjectResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetEditingProjectResponse(),
await self.do_rpcrequest_async('GetEditingProject', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def get_editing_project(
self,
request: ice20201109_models.GetEditingProjectRequest,
) -> ice20201109_models.GetEditingProjectResponse:
runtime = util_models.RuntimeOptions()
return self.get_editing_project_with_options(request, runtime)
async def get_editing_project_async(
self,
request: ice20201109_models.GetEditingProjectRequest,
) -> ice20201109_models.GetEditingProjectResponse:
runtime = util_models.RuntimeOptions()
return await self.get_editing_project_with_options_async(request, runtime)
def list_sys_templates_with_options(
self,
request: ice20201109_models.ListSysTemplatesRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListSysTemplatesResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.ListSysTemplatesResponse(),
self.do_rpcrequest('ListSysTemplates', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def list_sys_templates_with_options_async(
self,
request: ice20201109_models.ListSysTemplatesRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListSysTemplatesResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.ListSysTemplatesResponse(),
await self.do_rpcrequest_async('ListSysTemplates', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def list_sys_templates(
self,
request: ice20201109_models.ListSysTemplatesRequest,
) -> ice20201109_models.ListSysTemplatesResponse:
runtime = util_models.RuntimeOptions()
return self.list_sys_templates_with_options(request, runtime)
async def list_sys_templates_async(
self,
request: ice20201109_models.ListSysTemplatesRequest,
) -> ice20201109_models.ListSysTemplatesResponse:
runtime = util_models.RuntimeOptions()
return await self.list_sys_templates_with_options_async(request, runtime)
def delete_template_with_options(
self,
request: ice20201109_models.DeleteTemplateRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteTemplateResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.DeleteTemplateResponse(),
self.do_rpcrequest('DeleteTemplate', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def delete_template_with_options_async(
self,
request: ice20201109_models.DeleteTemplateRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteTemplateResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.DeleteTemplateResponse(),
await self.do_rpcrequest_async('DeleteTemplate', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def delete_template(
self,
request: ice20201109_models.DeleteTemplateRequest,
) -> ice20201109_models.DeleteTemplateResponse:
runtime = util_models.RuntimeOptions()
return self.delete_template_with_options(request, runtime)
async def delete_template_async(
self,
request: ice20201109_models.DeleteTemplateRequest,
) -> ice20201109_models.DeleteTemplateResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_template_with_options_async(request, runtime)
def submit_irjob_with_options(
self,
request: ice20201109_models.SubmitIRJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitIRJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitIRJobResponse(),
self.do_rpcrequest('SubmitIRJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_irjob_with_options_async(
self,
request: ice20201109_models.SubmitIRJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitIRJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitIRJobResponse(),
await self.do_rpcrequest_async('SubmitIRJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_irjob(
self,
request: ice20201109_models.SubmitIRJobRequest,
) -> ice20201109_models.SubmitIRJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_irjob_with_options(request, runtime)
async def submit_irjob_async(
self,
request: ice20201109_models.SubmitIRJobRequest,
) -> ice20201109_models.SubmitIRJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_irjob_with_options_async(request, runtime)
def delete_editing_project_materials_with_options(
self,
request: ice20201109_models.DeleteEditingProjectMaterialsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteEditingProjectMaterialsResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.DeleteEditingProjectMaterialsResponse(),
self.do_rpcrequest('DeleteEditingProjectMaterials', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def delete_editing_project_materials_with_options_async(
self,
request: ice20201109_models.DeleteEditingProjectMaterialsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteEditingProjectMaterialsResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.DeleteEditingProjectMaterialsResponse(),
await self.do_rpcrequest_async('DeleteEditingProjectMaterials', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def delete_editing_project_materials(
self,
request: ice20201109_models.DeleteEditingProjectMaterialsRequest,
) -> ice20201109_models.DeleteEditingProjectMaterialsResponse:
runtime = util_models.RuntimeOptions()
return self.delete_editing_project_materials_with_options(request, runtime)
async def delete_editing_project_materials_async(
self,
request: ice20201109_models.DeleteEditingProjectMaterialsRequest,
) -> ice20201109_models.DeleteEditingProjectMaterialsResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_editing_project_materials_with_options_async(request, runtime)
def search_editing_project_with_options(
self,
request: ice20201109_models.SearchEditingProjectRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SearchEditingProjectResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SearchEditingProjectResponse(),
self.do_rpcrequest('SearchEditingProject', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def search_editing_project_with_options_async(
self,
request: ice20201109_models.SearchEditingProjectRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SearchEditingProjectResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SearchEditingProjectResponse(),
await self.do_rpcrequest_async('SearchEditingProject', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def search_editing_project(
self,
request: ice20201109_models.SearchEditingProjectRequest,
) -> ice20201109_models.SearchEditingProjectResponse:
runtime = util_models.RuntimeOptions()
return self.search_editing_project_with_options(request, runtime)
async def search_editing_project_async(
self,
request: ice20201109_models.SearchEditingProjectRequest,
) -> ice20201109_models.SearchEditingProjectResponse:
runtime = util_models.RuntimeOptions()
return await self.search_editing_project_with_options_async(request, runtime)
def list_templates_with_options(
self,
request: ice20201109_models.ListTemplatesRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListTemplatesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListTemplatesResponse(),
self.do_rpcrequest('ListTemplates', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def list_templates_with_options_async(
self,
request: ice20201109_models.ListTemplatesRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListTemplatesResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListTemplatesResponse(),
await self.do_rpcrequest_async('ListTemplates', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def list_templates(
self,
request: ice20201109_models.ListTemplatesRequest,
) -> ice20201109_models.ListTemplatesResponse:
runtime = util_models.RuntimeOptions()
return self.list_templates_with_options(request, runtime)
async def list_templates_async(
self,
request: ice20201109_models.ListTemplatesRequest,
) -> ice20201109_models.ListTemplatesResponse:
runtime = util_models.RuntimeOptions()
return await self.list_templates_with_options_async(request, runtime)
def delete_editing_projects_with_options(
self,
request: ice20201109_models.DeleteEditingProjectsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteEditingProjectsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.DeleteEditingProjectsResponse(),
self.do_rpcrequest('DeleteEditingProjects', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def delete_editing_projects_with_options_async(
self,
request: ice20201109_models.DeleteEditingProjectsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.DeleteEditingProjectsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.DeleteEditingProjectsResponse(),
await self.do_rpcrequest_async('DeleteEditingProjects', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def delete_editing_projects(
self,
request: ice20201109_models.DeleteEditingProjectsRequest,
) -> ice20201109_models.DeleteEditingProjectsResponse:
runtime = util_models.RuntimeOptions()
return self.delete_editing_projects_with_options(request, runtime)
async def delete_editing_projects_async(
self,
request: ice20201109_models.DeleteEditingProjectsRequest,
) -> ice20201109_models.DeleteEditingProjectsResponse:
runtime = util_models.RuntimeOptions()
return await self.delete_editing_projects_with_options_async(request, runtime)
def get_media_info_with_options(
self,
request: ice20201109_models.GetMediaInfoRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetMediaInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.GetMediaInfoResponse(),
self.do_rpcrequest('GetMediaInfo', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_media_info_with_options_async(
self,
request: ice20201109_models.GetMediaInfoRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetMediaInfoResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.GetMediaInfoResponse(),
await self.do_rpcrequest_async('GetMediaInfo', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_media_info(
self,
request: ice20201109_models.GetMediaInfoRequest,
) -> ice20201109_models.GetMediaInfoResponse:
runtime = util_models.RuntimeOptions()
return self.get_media_info_with_options(request, runtime)
async def get_media_info_async(
self,
request: ice20201109_models.GetMediaInfoRequest,
) -> ice20201109_models.GetMediaInfoResponse:
runtime = util_models.RuntimeOptions()
return await self.get_media_info_with_options_async(request, runtime)
def submit_smart_job_with_options(
self,
request: ice20201109_models.SubmitSmartJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitSmartJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitSmartJobResponse(),
self.do_rpcrequest('SubmitSmartJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_smart_job_with_options_async(
self,
request: ice20201109_models.SubmitSmartJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitSmartJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitSmartJobResponse(),
await self.do_rpcrequest_async('SubmitSmartJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_smart_job(
self,
request: ice20201109_models.SubmitSmartJobRequest,
) -> ice20201109_models.SubmitSmartJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_smart_job_with_options(request, runtime)
async def submit_smart_job_async(
self,
request: ice20201109_models.SubmitSmartJobRequest,
) -> ice20201109_models.SubmitSmartJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_smart_job_with_options_async(request, runtime)
def submit_delogo_job_with_options(
self,
request: ice20201109_models.SubmitDelogoJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitDelogoJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitDelogoJobResponse(),
self.do_rpcrequest('SubmitDelogoJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_delogo_job_with_options_async(
self,
request: ice20201109_models.SubmitDelogoJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitDelogoJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitDelogoJobResponse(),
await self.do_rpcrequest_async('SubmitDelogoJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_delogo_job(
self,
request: ice20201109_models.SubmitDelogoJobRequest,
) -> ice20201109_models.SubmitDelogoJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_delogo_job_with_options(request, runtime)
async def submit_delogo_job_async(
self,
request: ice20201109_models.SubmitDelogoJobRequest,
) -> ice20201109_models.SubmitDelogoJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_delogo_job_with_options_async(request, runtime)
def update_template_with_options(
self,
request: ice20201109_models.UpdateTemplateRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.UpdateTemplateResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.UpdateTemplateResponse(),
self.do_rpcrequest('UpdateTemplate', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def update_template_with_options_async(
self,
request: ice20201109_models.UpdateTemplateRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.UpdateTemplateResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.UpdateTemplateResponse(),
await self.do_rpcrequest_async('UpdateTemplate', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def update_template(
self,
request: ice20201109_models.UpdateTemplateRequest,
) -> ice20201109_models.UpdateTemplateResponse:
runtime = util_models.RuntimeOptions()
return self.update_template_with_options(request, runtime)
async def update_template_async(
self,
request: ice20201109_models.UpdateTemplateRequest,
) -> ice20201109_models.UpdateTemplateResponse:
runtime = util_models.RuntimeOptions()
return await self.update_template_with_options_async(request, runtime)
def submit_audio_produce_job_with_options(
self,
request: ice20201109_models.SubmitAudioProduceJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitAudioProduceJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitAudioProduceJobResponse(),
self.do_rpcrequest('SubmitAudioProduceJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_audio_produce_job_with_options_async(
self,
request: ice20201109_models.SubmitAudioProduceJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitAudioProduceJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitAudioProduceJobResponse(),
await self.do_rpcrequest_async('SubmitAudioProduceJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_audio_produce_job(
self,
request: ice20201109_models.SubmitAudioProduceJobRequest,
) -> ice20201109_models.SubmitAudioProduceJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_audio_produce_job_with_options(request, runtime)
async def submit_audio_produce_job_async(
self,
request: ice20201109_models.SubmitAudioProduceJobRequest,
) -> ice20201109_models.SubmitAudioProduceJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_audio_produce_job_with_options_async(request, runtime)
def submit_media_producing_job_with_options(
self,
request: ice20201109_models.SubmitMediaProducingJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitMediaProducingJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitMediaProducingJobResponse(),
self.do_rpcrequest('SubmitMediaProducingJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_media_producing_job_with_options_async(
self,
request: ice20201109_models.SubmitMediaProducingJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitMediaProducingJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitMediaProducingJobResponse(),
await self.do_rpcrequest_async('SubmitMediaProducingJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_media_producing_job(
self,
request: ice20201109_models.SubmitMediaProducingJobRequest,
) -> ice20201109_models.SubmitMediaProducingJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_media_producing_job_with_options(request, runtime)
async def submit_media_producing_job_async(
self,
request: ice20201109_models.SubmitMediaProducingJobRequest,
) -> ice20201109_models.SubmitMediaProducingJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_media_producing_job_with_options_async(request, runtime)
def update_smart_job_with_options(
self,
request: ice20201109_models.UpdateSmartJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.UpdateSmartJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.UpdateSmartJobResponse(),
self.do_rpcrequest('UpdateSmartJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def update_smart_job_with_options_async(
self,
request: ice20201109_models.UpdateSmartJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.UpdateSmartJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.UpdateSmartJobResponse(),
await self.do_rpcrequest_async('UpdateSmartJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def update_smart_job(
self,
request: ice20201109_models.UpdateSmartJobRequest,
) -> ice20201109_models.UpdateSmartJobResponse:
runtime = util_models.RuntimeOptions()
return self.update_smart_job_with_options(request, runtime)
async def update_smart_job_async(
self,
request: ice20201109_models.UpdateSmartJobRequest,
) -> ice20201109_models.UpdateSmartJobResponse:
runtime = util_models.RuntimeOptions()
return await self.update_smart_job_with_options_async(request, runtime)
def list_all_public_media_tags_with_options(
self,
request: ice20201109_models.ListAllPublicMediaTagsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListAllPublicMediaTagsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListAllPublicMediaTagsResponse(),
self.do_rpcrequest('ListAllPublicMediaTags', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def list_all_public_media_tags_with_options_async(
self,
request: ice20201109_models.ListAllPublicMediaTagsRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListAllPublicMediaTagsResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListAllPublicMediaTagsResponse(),
await self.do_rpcrequest_async('ListAllPublicMediaTags', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def list_all_public_media_tags(
self,
request: ice20201109_models.ListAllPublicMediaTagsRequest,
) -> ice20201109_models.ListAllPublicMediaTagsResponse:
runtime = util_models.RuntimeOptions()
return self.list_all_public_media_tags_with_options(request, runtime)
async def list_all_public_media_tags_async(
self,
request: ice20201109_models.ListAllPublicMediaTagsRequest,
) -> ice20201109_models.ListAllPublicMediaTagsResponse:
runtime = util_models.RuntimeOptions()
return await self.list_all_public_media_tags_with_options_async(request, runtime)
def submit_matting_job_with_options(
self,
request: ice20201109_models.SubmitMattingJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitMattingJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitMattingJobResponse(),
self.do_rpcrequest('SubmitMattingJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_matting_job_with_options_async(
self,
request: ice20201109_models.SubmitMattingJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitMattingJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitMattingJobResponse(),
await self.do_rpcrequest_async('SubmitMattingJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_matting_job(
self,
request: ice20201109_models.SubmitMattingJobRequest,
) -> ice20201109_models.SubmitMattingJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_matting_job_with_options(request, runtime)
async def submit_matting_job_async(
self,
request: ice20201109_models.SubmitMattingJobRequest,
) -> ice20201109_models.SubmitMattingJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_matting_job_with_options_async(request, runtime)
def get_event_callback_with_options(
self,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetEventCallbackResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
ice20201109_models.GetEventCallbackResponse(),
self.do_rpcrequest('GetEventCallback', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def get_event_callback_with_options_async(
self,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetEventCallbackResponse:
req = open_api_models.OpenApiRequest()
return TeaCore.from_map(
ice20201109_models.GetEventCallbackResponse(),
await self.do_rpcrequest_async('GetEventCallback', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def get_event_callback(self) -> ice20201109_models.GetEventCallbackResponse:
runtime = util_models.RuntimeOptions()
return self.get_event_callback_with_options(runtime)
async def get_event_callback_async(self) -> ice20201109_models.GetEventCallbackResponse:
runtime = util_models.RuntimeOptions()
return await self.get_event_callback_with_options_async(runtime)
def list_public_media_basic_infos_with_options(
self,
request: ice20201109_models.ListPublicMediaBasicInfosRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListPublicMediaBasicInfosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListPublicMediaBasicInfosResponse(),
self.do_rpcrequest('ListPublicMediaBasicInfos', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def list_public_media_basic_infos_with_options_async(
self,
request: ice20201109_models.ListPublicMediaBasicInfosRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.ListPublicMediaBasicInfosResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.ListPublicMediaBasicInfosResponse(),
await self.do_rpcrequest_async('ListPublicMediaBasicInfos', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def list_public_media_basic_infos(
self,
request: ice20201109_models.ListPublicMediaBasicInfosRequest,
) -> ice20201109_models.ListPublicMediaBasicInfosResponse:
runtime = util_models.RuntimeOptions()
return self.list_public_media_basic_infos_with_options(request, runtime)
async def list_public_media_basic_infos_async(
self,
request: ice20201109_models.ListPublicMediaBasicInfosRequest,
) -> ice20201109_models.ListPublicMediaBasicInfosResponse:
runtime = util_models.RuntimeOptions()
return await self.list_public_media_basic_infos_with_options_async(request, runtime)
def submit_cover_job_with_options(
self,
request: ice20201109_models.SubmitCoverJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitCoverJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitCoverJobResponse(),
self.do_rpcrequest('SubmitCoverJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_cover_job_with_options_async(
self,
request: ice20201109_models.SubmitCoverJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitCoverJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitCoverJobResponse(),
await self.do_rpcrequest_async('SubmitCoverJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_cover_job(
self,
request: ice20201109_models.SubmitCoverJobRequest,
) -> ice20201109_models.SubmitCoverJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_cover_job_with_options(request, runtime)
async def submit_cover_job_async(
self,
request: ice20201109_models.SubmitCoverJobRequest,
) -> ice20201109_models.SubmitCoverJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_cover_job_with_options_async(request, runtime)
def get_smart_handle_job_with_options(
self,
request: ice20201109_models.GetSmartHandleJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetSmartHandleJobResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetSmartHandleJobResponse(),
self.do_rpcrequest('GetSmartHandleJob', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def get_smart_handle_job_with_options_async(
self,
request: ice20201109_models.GetSmartHandleJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.GetSmartHandleJobResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.GetSmartHandleJobResponse(),
await self.do_rpcrequest_async('GetSmartHandleJob', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def get_smart_handle_job(
self,
request: ice20201109_models.GetSmartHandleJobRequest,
) -> ice20201109_models.GetSmartHandleJobResponse:
runtime = util_models.RuntimeOptions()
return self.get_smart_handle_job_with_options(request, runtime)
async def get_smart_handle_job_async(
self,
request: ice20201109_models.GetSmartHandleJobRequest,
) -> ice20201109_models.GetSmartHandleJobResponse:
runtime = util_models.RuntimeOptions()
return await self.get_smart_handle_job_with_options_async(request, runtime)
def submit_h2vjob_with_options(
self,
request: ice20201109_models.SubmitH2VJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitH2VJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitH2VJobResponse(),
self.do_rpcrequest('SubmitH2VJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
async def submit_h2vjob_with_options_async(
self,
request: ice20201109_models.SubmitH2VJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitH2VJobResponse:
UtilClient.validate_model(request)
req = open_api_models.OpenApiRequest(
body=UtilClient.to_map(request)
)
return TeaCore.from_map(
ice20201109_models.SubmitH2VJobResponse(),
await self.do_rpcrequest_async('SubmitH2VJob', '2020-11-09', 'HTTPS', 'POST', 'AK', 'json', req, runtime)
)
def submit_h2vjob(
self,
request: ice20201109_models.SubmitH2VJobRequest,
) -> ice20201109_models.SubmitH2VJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_h2vjob_with_options(request, runtime)
async def submit_h2vjob_async(
self,
request: ice20201109_models.SubmitH2VJobRequest,
) -> ice20201109_models.SubmitH2VJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_h2vjob_with_options_async(request, runtime)
def submit_pptcut_job_with_options(
self,
request: ice20201109_models.SubmitPPTCutJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitPPTCutJobResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.SubmitPPTCutJobResponse(),
self.do_rpcrequest('SubmitPPTCutJob', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
async def submit_pptcut_job_with_options_async(
self,
request: ice20201109_models.SubmitPPTCutJobRequest,
runtime: util_models.RuntimeOptions,
) -> ice20201109_models.SubmitPPTCutJobResponse:
UtilClient.validate_model(request)
query = OpenApiUtilClient.query(UtilClient.to_map(request))
req = open_api_models.OpenApiRequest(
query=query
)
return TeaCore.from_map(
ice20201109_models.SubmitPPTCutJobResponse(),
await self.do_rpcrequest_async('SubmitPPTCutJob', '2020-11-09', 'HTTPS', 'GET', 'AK', 'json', req, runtime)
)
def submit_pptcut_job(
self,
request: ice20201109_models.SubmitPPTCutJobRequest,
) -> ice20201109_models.SubmitPPTCutJobResponse:
runtime = util_models.RuntimeOptions()
return self.submit_pptcut_job_with_options(request, runtime)
async def submit_pptcut_job_async(
self,
request: ice20201109_models.SubmitPPTCutJobRequest,
) -> ice20201109_models.SubmitPPTCutJobResponse:
runtime = util_models.RuntimeOptions()
return await self.submit_pptcut_job_with_options_async(request, runtime)
| [
"[email protected]"
]
| |
69b765b6c43f5b3185f837bec89da018492bd0ac | 9ff1058a0500be499fd3de9ec0beccd697d5273c | /Shared/Ollinger/pyparserial/parallel/parallelppdev.py | eec2104495335dd90f546039d63dbbeb5c306dc7 | []
| no_license | jrussell9000/NeuroScripts | 93f53c7d38c1d51fdc0cf39096e0996daee887cf | e41558754bd36385f94934333cb39a6500abfd9f | refs/heads/master | 2021-06-09T20:30:59.956137 | 2021-04-08T18:45:39 | 2021-04-08T18:45:39 | 151,635,108 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 22,750 | py | #!/usr/bin/env python
# parallel port access using the ppdev driver
import sys
import struct
import fcntl
import os
#----
# Generated by h2py 0.1.1 from <linux/ppdev.h>,
# then cleaned up a bit by Michael P. Ashton and then a gain by chris ;-)
# Changes for Python2.2 support (c) September 2004 [email protected]
# JMO: This part from /usr/include/asm-generic/ioctl.h
def sizeof(type): return struct.calcsize(type)
def _IOC(dir, type, nr, size): return int((dir << _IOC_DIRSHIFT ) | (type << _IOC_TYPESHIFT ) |\
(nr << _IOC_NRSHIFT ) | (size << _IOC_SIZESHIFT))
def _IO(type, nr): return _IOC(_IOC_NONE, type, nr, 0)
def _IOR(type,nr,size): return _IOC(_IOC_READ, type, nr, sizeof(size))
def _IOW(type,nr,size): return _IOC(_IOC_WRITE, type, nr, sizeof(size))
_IOC_SIZEBITS = 14
_IOC_SIZEMASK = (1 << _IOC_SIZEBITS ) - 1
#_IOC_SIZEMASK = (1L << _IOC_SIZEBITS ) - 1
_IOC_NRSHIFT = 0
_IOC_NRBITS = 8
_IOC_TYPESHIFT = _IOC_NRSHIFT + _IOC_NRBITS
_IOC_TYPEBITS = 8
_IOC_SIZESHIFT = _IOC_TYPESHIFT + _IOC_TYPEBITS
IOCSIZE_MASK = _IOC_SIZEMASK << _IOC_SIZESHIFT
IOCSIZE_SHIFT = _IOC_SIZESHIFT
# Python 2.2 uses a signed int for the ioctl() call, so ...
if ( sys.version_info[0] < 3 ) and ( sys.version_info[1] < 3 ): # JMO 4/8/2009
_IOC_WRITE = 1L
_IOC_READ = -2L
_IOC_INOUT = -1L
else:
_IOC_WRITE = 1
_IOC_READ = 2
_IOC_INOUT = 3
_IOC_DIRSHIFT = _IOC_SIZESHIFT + _IOC_SIZEBITS
IOC_INOUT = _IOC_INOUT << _IOC_DIRSHIFT
IOC_IN = _IOC_WRITE << _IOC_DIRSHIFT
IOC_OUT = _IOC_READ << _IOC_DIRSHIFT
_IOC_NONE = 0
PP_IOCTL = ord('p')
PPCLAIM = _IO(PP_IOCTL, 0x8b)
PPCLRIRQ = _IOR(PP_IOCTL, 0x93, 'i')
PPDATADIR = _IOW(PP_IOCTL, 0x90, 'i')
PPEXCL = _IO(PP_IOCTL, 0x8f)
PPFCONTROL = _IOW(PP_IOCTL, 0x8e, 'BB')
PPGETFLAGS = _IOR(PP_IOCTL, 0x9a, 'i')
PPGETMODE = _IOR(PP_IOCTL, 0x98, 'i')
PPGETMODES = _IOR(PP_IOCTL, 0x97, 'I')
PPGETPHASE = _IOR(PP_IOCTL, 0x99, 'i')
PPGETTIME = _IOR(PP_IOCTL, 0x95, 'll')
PPNEGOT = _IOW(PP_IOCTL, 0x91, 'i')
PPRCONTROL = _IOR(PP_IOCTL, 0x83, 'B')
PPRDATA = _IOR(PP_IOCTL, 0x85, 'B')
#'OBSOLETE__IOR' undefined in 'PPRECONTROL'
PPRELEASE = _IO(PP_IOCTL, 0x8c)
#'OBSOLETE__IOR' undefined in 'PPRFIFO'
PPRSTATUS = _IOR(PP_IOCTL, 0x81, 'B')
PPSETFLAGS = _IOW(PP_IOCTL, 0x9b, 'i')
PPSETMODE = _IOW(PP_IOCTL, 0x80, 'i')
PPSETPHASE = _IOW(PP_IOCTL, 0x94, 'i')
PPSETTIME = _IOW(PP_IOCTL, 0x96, 'll')
PPWCONTROL = _IOW(PP_IOCTL, 0x84, 'B')
PPWCTLONIRQ = _IOW(PP_IOCTL, 0x92, 'B')
PPWDATA = _IOW(PP_IOCTL, 0x86, 'B')
#'OBSOLETE__IOW' undefined in 'PPWECONTROL'
#'OBSOLETE__IOW' undefined in 'PPWFIFO'
#'OBSOLETE__IOW' undefined in 'PPWSTATUS'
PPYIELD = _IO(PP_IOCTL, 0x8d)
PP_FASTREAD = 1 << 3
PP_FASTWRITE = 1 << 2
PP_W91284PIC = 1 << 4
PP_FLAGMASK = PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC
PP_MAJOR = 99
_ASMI386_IOCTL_H= None
_IOC_DIRBITS = 2
_IOC_DIRMASK = (1 << _IOC_DIRBITS) - 1
_IOC_NRMASK = (1 << _IOC_NRBITS) - 1
_IOC_TYPEMASK = (1 << _IOC_TYPEBITS ) - 1
def _IOC_DIR(nr): return (nr >> _IOC_DIRSHIFT) & _IOC_DIRMASK
def _IOC_NR(nr): return (nr >> _IOC_NRSHIFT) & _IOC_NRMASK
def _IOC_SIZE(nr): return (nr >> _IOC_SIZESHIFT) & _IOC_SIZEMASK
def _IOC_TYPE(nr): return (nr >> _IOC_TYPESHIFT) & _IOC_TYPEMASK
def _IOWR(type, nr, size): return _IOC(_IOC_READ | _IOC_WRITE, type, nr , sizeof(size))
__ELF__ = 1
__i386 = 1
__i386__ = 1
__linux = 1
__linux__ = 1
__unix = 1
__unix__ = 1
i386 = 1
linux = 1
unix = 1
#-------- Constants from <linux/parport.h>
PARPORT_CONTROL_STROBE = 0x1
PARPORT_CONTROL_AUTOFD = 0x2
PARPORT_CONTROL_INIT = 0x4
PARPORT_CONTROL_SELECT = 0x8
PARPORT_STATUS_ERROR = 8
PARPORT_STATUS_SELECT = 0x10
PARPORT_STATUS_PAPEROUT = 0x20
PARPORT_STATUS_ACK = 0x40
PARPORT_STATUS_BUSY = 0x80
IEEE1284_MODE_NIBBLE = 0
IEEE1284_MODE_BYTE = 1
IEEE1284_MODE_COMPAT = 1<<8
IEEE1284_MODE_BECP = 1<<9
IEEE1284_MODE_ECP = 1<<4
IEEE1284_MODE_ECPRLE = IEEE1284_MODE_ECP | (1<<5)
IEEE1284_MODE_ECPSWE = 1<<10
IEEE1284_MODE_EPP = 1<<6
IEEE1284_MODE_EPPSL = 1<<11
IEEE1284_MODE_EPPSWE = 1<<12
IEEE1284_DEVICEID = 1<<2
IEEE1284_EXT_LINK = 1<<14
IEEE1284_ADDR = 1<<13
IEEE1284_DATA = 0
PARPORT_EPP_FAST = 1
PARPORT_W91284PIC = 2
#----
mode_codes = {IEEE1284_MODE_COMPAT: 'compatible', \
IEEE1284_MODE_NIBBLE: 'nibble', \
IEEE1284_MODE_BYTE: 'byte', \
IEEE1284_MODE_EPP: 'EPP', \
IEEE1284_MODE_ECP: 'ECP'} #JMO
code_modes = {'compatible': IEEE1284_MODE_COMPAT, \
'nibble': IEEE1284_MODE_NIBBLE, \
'byte': IEEE1284_MODE_BYTE, \
'epp': IEEE1284_MODE_EPP, \
'ecp': IEEE1284_MODE_ECP} #JMO
class Parallel:
"""Class for controlling the pins on a parallel port
This class provides bit-level access to the pins on a PC parallel
port. It is primarily designed for programs which must control
special circuitry - most often non-IEEE-1284-compliant devices
other than printers - using 'bit-banging' techniques.
The current implementation makes ioctl() calls to the Linux ppdev
driver, using the Python fcntl library. It might be rewritten in
C for extra speed. This particular implementation is written for
Linux; all of the upper-level calls can be ported to Windows as
well.
On Linux, the ppdev device driver, from the Linux 2.4 parallel
port subsystem, is used to control the parallel port hardware.
This driver must be made available from a kernel compile. The
option is called "Support user-space parallel-port drivers". When
using the module, be sure to unload the lp module first: usually
the lp module claims exclusive access to the parallel port, and if
it is loaded, this class will fail to open the parallel port file,
and throw an exception.
The primary source of information about the Linux 2.4 parallel
port subsystem is Tim Waugh's documentation, the source for which
is available in the kernel tree. This document (called,
appropriately enough, "The Linux 2.4 Parallel Port Subsystem"),
thoroughly describes the parallel port drivers and how to use
them.
This class provides a method for each of the ioctls supported by
the ppdev module. The ioctl methods are named, in uppercase, the
same as the ioctls they invoke. The documentation for these
methods was taken directly from the documentation for their
corresponding ioctl, and modified only where necessary.
Unless you have special reason to use the Linux ioctls, you should
use instead the upper-level functions, which are named in
lowerCase fashion and should be portable between Linux and
Windows. This way, any code you write for this class will (or
should) also work with the Windows version of this class.
"""
def __init__(self, port = 'dev/parport0'):
# if type(port) == type(""):
if isinstance(port, str):
self.device = port
else:
self.device = "/dev/parport%d" % port
# self._fd = os.open(self.device, os.O_RDWR)
self._fd = os.open(self.device, os.O_RDONLY)
# self.PPEXCL() # JMO
self.PPCLAIM() # JMO
self.setDataDir('out')
# self.setData(0)
def Close(self):
self.__del__()
def __del__(self):
self.PPRELEASE()
if self._fd is not None:
os.close(self._fd)
def timevalToFloat(self, timeval):
t=struct.unpack('ll', timeval)
return t[0] + (t[1]/1000000.0)
def floatToTimeval(self, time):
sec = int(time)
usec = int(time*1000000.0)
return struct.pack('ll', sec, usec)
def PPCLAIM(self):
"""
Claims access to the port. As a user-land device driver
writer, you will need to do this before you are able to
actually change the state of the parallel port in any
way. Note that some operations only affect the ppdev driver
and not the port, such as PPSETMODE; they can be performed
while access to the port is not claimed.
"""
fcntl.ioctl(self._fd, PPCLAIM)
def PPEXCL(self):
"""
Instructs the kernel driver to forbid any sharing of the port
with other drivers, i.e. it requests exclusivity. The PPEXCL
command is only valid when the port is not already claimed for
use, and it may mean that the next PPCLAIM ioctl will fail:
some other driver may already have registered itself on that
port.
Most device drivers don't need exclusive access to the
port. It's only provided in case it is really needed, for
example for devices where access to the port is required for
extensive periods of time (many seconds).
Note that the PPEXCL ioctl doesn't actually claim the port
there and then---action is deferred until the PPCLAIM ioctl is
performed.
"""
fcntl.ioctl(self._fd, PPEXCL)
def PPRELEASE(self):
"""
Releases the port. Releasing the port undoes the effect of
claiming the port. It allows other device drivers to talk to
their devices (assuming that there are any).
"""
fcntl.ioctl(self._fd, PPRELEASE)
def PPYIELD(self):
"""
Yields the port to another driver. This ioctl is a kind of
short-hand for releasing the port and immediately reclaiming
it. It gives other drivers a chance to talk to their devices,
but afterwards claims the port back. An example of using this
would be in a user-land printer driver: once a few characters
have been written we could give the port to another device
driver for a while, but if we still have characters to send to
the printer we would want the port back as soon as possible.
It is important not to claim the parallel port for too long,
as other device drivers will have no time to service their
devices. If your device does not allow for parallel port
sharing at all, it is better to claim the parallel port
exclusively (see PPEXCL).
"""
fcntl.ioctl(self._fd, PPYIELD)
def PPNEGOT(self, mode):
"""
Performs IEEE 1284 negotiation into a particular
mode. Briefly, negotiation is the method by which the host and
the peripheral decide on a protocol to use when transferring
data.
An IEEE 1284 compliant device will start out in compatibility
mode, and then the host can negotiate to another mode (such as
ECP).
The 'mode' parameter should be one of the following constants
from PPDEV:
- IEEE1284_MODE_COMPAT
- IEEE1284_MODE_NIBBLE
- IEEE1284_MODE_BYTE
- IEEE1284_MODE_EPP
- IEEE1284_MODE_ECP
The PPNEGOT ioctl actually does two things: it performs the
on-the-wire negotiation, and it sets the behaviour of
subsequent read/write calls so that they use that mode (but
see PPSETMODE).
"""
fcntl.ioctl(self._fd, PPNEGOT, struct.pack('i', mode))
def PPSETMODE(self, mode):
"""
Sets which IEEE 1284 protocol to use for the read and write
calls.
The 'mode' parameter should be one of the following constants
from PPDEV:
- IEEE1284_MODE_COMPAT
- IEEE1284_MODE_NIBBLE
- IEEE1284_MODE_BYTE
- IEEE1284_MODE_EPP
- IEEE1284_MODE_ECP
"""
mode = code_modes.get(mode)
fcntl.ioctl(self._fd, PPSETMODE, struct.pack('i', mode))
def PPGETMODE(self):
"""
Retrieves the IEEE 1284 mode being used for read and
write. The return value is one of the following constants
from PPDEV:
- IEEE1284_MODE_COMPAT
- IEEE1284_MODE_NIBBLE
- IEEE1284_MODE_BYTE
- IEEE1284_MODE_EPP
- IEEE1284_MODE_ECP
"""
# modes = {256: 'IEEE 1284 compatible', 0: 'IEEE 1284 nibble', 1: 'IEEE 1284 byte', 64: 'IEEE 1284 EPP', 16: 'IEEE 1284 ECP'} #JMO
ret = struct.pack('i', 0)
ret = fcntl.ioctl(self._fd, PPGETMODE, ret)
ret = struct.unpack('i', ret)[0]
# return struct.unpack('i', ret)[0]
return mode_codes.get(ret, 'Unavailable')
def PPGETTIME(self):
"""
Retrieves the time-out value. The read and write calls will
time out if the peripheral doesn't respond quickly enough. The
PPGETTIME ioctl retrieves the length of time that the
peripheral is allowed to have before giving up.
Returns the timeout value in seconds as a floating-point value.
"""
ret = struct.pack('ll', 0, 0)
ret = fcntl.ioctl(self._fd, PPGETTIME, ret)
return self.timevalToFloat(ret)
def PPSETTIME(self, time):
"""
Sets the time-out (see PPGETTIME for more information).
'time' is the new time-out in seconds; floating-point values
are acceptable.
"""
fcntl.ioctl(self._fd, PPSETTIME, floatToTimeval(time))
def PPGETMODES(self):
"""
Retrieves the capabilities of the hardware (i.e. the modes
field of the parport structure).
"""
raise NotImplementedError
def PPSETFLAGS(self):
"""
Sets flags on the ppdev device which can affect future I/O
operations. Available flags are:
- PP_FASTWRITE
- PP_FASTREAD
- PP_W91284PIC
"""
raise NotImplementedError
def PPWCONTROL(self, lines):
"""
Sets the control lines. The 'lines' parameter is a bitwise OR
of the following constants from PPDEV:
- PARPORT_CONTROL_STROBE
- PARPORT_CONTROL_AUTOFD
- PARPORT_CONTROL_INIT
- PARPORT_CONTROL_SELECT
"""
fcntl.ioctl(self._fd, PPWCONTROL, struct.pack('B', lines))
def PPRCONTROL(self):
"""
Returns the last value written to the control register, in the
form of an integer, for which each bit corresponds to a control
line (although some are unused).
This doesn't actually touch the hardware; the last value
written is remembered in software. This is because some
parallel port hardware does not offer read access to the
control register.
The control lines bits are defined by the following constants
from PPDEV:
- PARPORT_CONTROL_STROBE
- PARPORT_CONTROL_AUTOFD
- PARPORT_CONTROL_SELECT
- PARPORT_CONTROL_INIT
"""
ret = struct.pack('B',0)
ret = fcntl.ioctl(self._fd, PPRCONTROL, ret)
return struct.unpack('B', ret)[0]
def PPFCONTROL(self, mask, val):
"""
Frobs the control lines. Since a common operation is to change
one of the control signals while leaving the others alone, it
would be quite inefficient for the user-land driver to have to
use PPRCONTROL, make the change, and then use PPWCONTROL. Of
course, each driver could remember what state the control
lines are supposed to be in (they are never changed by
anything else), but in order to provide PPRCONTROL, ppdev must
remember the state of the control lines anyway.
The PPFCONTROL ioctl is for "frobbing" control lines, and is
like PPWCONTROL but acts on a restricted set of control
lines. The ioctl parameter is a pointer to a struct
ppdev_frob_struct:
struct ppdev_frob_struct {
unsigned char mask;
unsigned char val;
};
The mask and val fields are bitwise ORs of control line names
(such as in PPWCONTROL). The operation performed by PPFCONTROL
is:
new_ctr = (old_ctr & ~mask) | val
In other words, the signals named in mask are set to the
values in val.
"""
fcntl.ioctl(self._fd, PPFCONTROL, struct.pack('BB', mask, val))
def PPRSTATUS(self):
"""
Returns an unsigned char containing bits set for each status
line that is set (for instance, PARPORT_STATUS_BUSY). The
ioctl parameter should be a pointer to an unsigned char.
"""
ret = struct.pack('B',0)
# ret = struct.pack('b', 0)
# print 100,self._fd, type(PPRSTATUS), 'PPRSTATUS: 0x%08x' % PPRSTATUS
# PPRSTATUS = 0x80017081;
# PPRSTATUS = struct.pack('I',PPRSTATUS)
ret = fcntl.ioctl(self._fd, PPRSTATUS, ret)
# print 100,struct.unpack('B', ret)
return struct.unpack('B', ret)[0]
def PPDATADIR(self, out):
"""
Controls the data line drivers. Normally the computer's
parallel port will drive the data lines, but for byte-wide
transfers from the peripheral to the host it is useful to turn
off those drivers and let the peripheral drive the
signals. (If the drivers on the computer's parallel port are
left on when this happens, the port might be damaged.)
This is only needed in conjunction with PPWDATA or PPRDATA.
The 'out' parameter indicates the desired port direction. If
'out' is true or non-zero, the drivers are turned on (forward
direction); otherwise, the drivers are turned off (reverse
direction).
"""
if out:
msg=struct.pack('i',0)
else:
msg=struct.pack('i',1)
fcntl.ioctl(self._fd, PPDATADIR, msg)
def PPWDATA(self, byte):
"""
Sets the data lines (if in forward mode). The ioctl parameter
is a pointer to an unsigned char.
"""
fcntl.ioctl(self._fd, PPWDATA,struct.pack('B',byte))
def PPRDATA(self):
"""
Reads the data lines (if in reverse mode). The ioctl parameter
is a pointer to an unsigned char.
"""
ret=struct.pack('B',0)
ret=fcntl.ioctl(self._fd, PPRDATA,ret)
return struct.unpack('B',ret)[0]
def PPCLRIRQ(self):
"""
Returns the current interrupt count, and clears it. The ppdev
driver keeps a count of interrupts as they are triggered.
"""
ret=struct.pack('i',0)
ret=fcntl.ioctl(self._fd, PPCLRIRQ,ret)
return struct.unpack('i',ret)[0]
def PPWCTLONIRQ(self, lines):
"""
Set a trigger response. Afterwards when an interrupt is
triggered, the interrupt handler will set the control lines as
requested. The ioctl parameter is a pointer to an unsigned
char, which is interpreted in the same way as for PPWCONTROL.
The reason for this ioctl is simply speed. Without this ioctl,
responding to an interrupt would start in the interrupt
handler, switch context to the user-land driver via poll or
select, and then switch context back to the kernel in order to
handle PPWCONTROL. Doing the whole lot in the interrupt
handler is a lot faster.
"""
fcntl.ioctl(self._fd, PPWCTLONIRQ,struct.pack('B',lines))
#data lines
## def data(self):
## """Returns the states of the data bus line drivers (pins 2-9)"""
## return self._data
def setDataDir(self,direction):
"""Activates or deactivates the data bus line drivers (pins 2-9)"""
if direction == 'out':
idir = 1
elif direction == 'in':
idir = 0
else:
raise IOError('Invalid argument to setDataDir: %s' % direction)
self._dataDir = idir
self.PPDATADIR(self._dataDir)
def dataDir(self):
"""Returns true if the data bus line drivers are on (pins 2-9)"""
return self._dataDir
#control lines
## def strobe(self):
## """Returns the state of the nStrobe output (pin 1)"""
## return (self.PPRCONTROL()&PARPORT_CONTROL_STROBE)==0
def setDataStrobe(self, level):
"""Sets the state of the nStrobe output (pin 1)"""
if level:
self.PPFCONTROL(PARPORT_CONTROL_STROBE, 0)
else:
self.PPFCONTROL(PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE)
## def autoFd(self):
## """Returns the state of the nAutoFd output (pin 14)"""
## return (self.PPRCONTROL()&PARPORT_CONTROL_AUTOFD)==0
def setAutoFeed(self, level):
"""Sets the state of the nAutoFd output (pin 14)"""
if level:
self.PPFCONTROL(PARPORT_CONTROL_AUTOFD, 0)
else:
self.PPFCONTROL(PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_AUTOFD)
## def init(self):
## """Returns the state of the nInit output (pin 16)"""
## return (self.PPRCONTROL()&PARPORT_CONTROL_INIT)!=0
def setInitOut(self, level):
"""Sets the state of the nInit output (pin 16)"""
if level:
self.PPFCONTROL(PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT)
else:
self.PPFCONTROL(PARPORT_CONTROL_INIT, 0)
## def selectIn(self):
## """Returns the state of the nSelectIn output (pin 17)"""
## return (self.PPRCONTROL()&PARPORT_CONTROL_SELECT)==0
def setSelect(self,level):
"""Sets the state of the nSelectIn output (pin 17)"""
if level:
self.PPFCONTROL(PARPORT_CONTROL_SELECT, 0)
else:
self.PPFCONTROL(PARPORT_CONTROL_SELECT, PARPORT_CONTROL_SELECT)
def setData(self,d):
"""Sets the states of the data bus line drivers (pins 2-9)"""
self._data=d
return self.PPWDATA(d)
#status lines
def getInError(self):
"""Returns the level on the nFault pin (15)"""
return (self.PPRSTATUS() & PARPORT_STATUS_ERROR) != 0
def getInSelected(self):
"""Returns the level on the Select pin (13)"""
return (self.PPRSTATUS() & PARPORT_STATUS_SELECT) != 0
def getInPaperOut(self):
"""Returns the level on the paperOut pin (12)"""
return (self.PPRSTATUS() & PARPORT_STATUS_PAPEROUT) != 0
def getInAcknowledge(self):
"""Returns the level on the nAck pin (10)"""
return (self.PPRSTATUS() & PARPORT_STATUS_ACK) != 0
def getInBusy(self):
"""Returns the level on the Busy pin (11)"""
return (self.PPRSTATUS() & PARPORT_STATUS_BUSY) != 0
| [
"[email protected]"
]
| |
2de021e9e85df16452f8d08a2931aff200c9ce8a | e7a3961e94ffce63f02a3d5bb92b5850005c7955 | /django_tuts/forms_tuts/models.py | 4eca909a170d97954cf1c7b64b0d370e80410ad5 | []
| no_license | sbhusal123/django-collections | 219c032c97dd7bc2b3c5961f71fb8da5e4826ec1 | 4efed68d29fd1e383d15b303584fc4eb183aff98 | refs/heads/master | 2022-11-06T17:32:25.776023 | 2020-06-20T07:58:54 | 2020-06-20T07:58:54 | 273,394,086 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,007 | py | from _datetime import datetime
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Products(models.Model):
"""Products for sale"""
name = models.CharField(max_length=256, unique=True, null=False, blank=False)
price = models.DecimalField(max_digits=8, decimal_places=2)
def __str__(self):
return f'{self.name}: {self.price}'
class OrderItem(models.Model):
"""Item collection in an order"""
product = models.ForeignKey(Products, on_delete=models.CASCADE)
quantity = models.IntegerField(default=1, blank=False, null=False) # validate such that no less than 3
class Order(models.Model):
"""Order information"""
items = models.ManyToManyField('OrderItem')
date = models.DateTimeField(default=datetime.now, blank=False) # validate such that not yesterday
total = models.DecimalField(max_digits=8, decimal_places=2)
user = models.ForeignKey(User, related_name='orders', on_delete=models.CASCADE) | [
"[email protected]"
]
| |
467159dbc7962cddb1433df59cdc1a26132ca3af | 9743d5fd24822f79c156ad112229e25adb9ed6f6 | /xai/brain/wordbase/adjectives/_waxiest.py | ed828779dd11c8bd004322d280f17905dcb1f528 | [
"MIT"
]
| permissive | cash2one/xai | de7adad1758f50dd6786bf0111e71a903f039b64 | e76f12c9f4dcf3ac1c7c08b0cc8844c0b0a104b6 | refs/heads/master | 2021-01-19T12:33:54.964379 | 2017-01-28T02:00:50 | 2017-01-28T02:00:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 238 | py |
from xai.brain.wordbase.adjectives._waxy import _WAXY
#calss header
class _WAXIEST(_WAXY, ):
def __init__(self,):
_WAXY.__init__(self)
self.name = "WAXIEST"
self.specie = 'adjectives'
self.basic = "waxy"
self.jsondata = {}
| [
"[email protected]"
]
| |
60d734472901344d763d6e229ca2310ce9e90063 | 714cbe0205a4af7b8386116854c1eb85b63fb74d | /base.py | c506f9f1f78873528074a0dcd48211ca9c54dd1f | []
| no_license | hologerry/lincoln | 8ff7eb0b1ffe6b3792c8908e9db3adbe59e3ce22 | e3144d949c7e2e85075a2211c1f49bcf40d5b5b2 | refs/heads/master | 2021-02-05T19:10:40.708747 | 2020-03-02T16:24:16 | 2020-03-02T16:24:16 | 243,821,199 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,342 | py | from numpy import ndarray
from utils.np_utils import assert_same_shape
class Operation(object):
def __init__(self):
pass
def forward(self,
input_: ndarray,
inference: bool = False) -> ndarray:
self.input_ = input_
self.output = self._output(inference)
return self.output
def backward(self, output_grad: ndarray) -> ndarray:
assert_same_shape(self.output, output_grad)
self.input_grad = self._input_grad(output_grad)
assert_same_shape(self.input_, self.input_grad)
return self.input_grad
def _output(self, inference: bool) -> ndarray:
raise NotImplementedError()
def _input_grad(self, output_grad: ndarray) -> ndarray:
raise NotImplementedError()
class ParamOperation(Operation):
def __init__(self, param: ndarray) -> ndarray:
super().__init__()
self.param = param
def backward(self, output_grad: ndarray) -> ndarray:
assert_same_shape(self.output, output_grad)
self.input_grad = self._input_grad(output_grad)
self.param_grad = self._param_grad(output_grad)
assert_same_shape(self.input_, self.input_grad)
return self.input_grad
def _param_grad(self, output_grad: ndarray) -> ndarray:
raise NotImplementedError()
| [
"[email protected]"
]
| |
1b0636fcd3958c905c9dc3f2ad157ad20a18c1c8 | 029aa4fa6217dbb239037dec8f2e64f5b94795d0 | /Python算法指南/集合、列表、字符串/38_两数之和I_两数之和的应用_背.py | 9f582ae4669e34cd92b44ea088f6f44037c21e74 | []
| no_license | tonyyo/algorithm | 5a3f0bd4395a75703f9ee84b01e42a74283a5de9 | 60dd5281e7ce4dfb603b795aa194a67ff867caf6 | refs/heads/master | 2022-12-14T16:04:46.723771 | 2020-09-23T06:59:33 | 2020-09-23T06:59:33 | 270,216,530 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 857 | py | class Solution(object):
def twoSum(self, nums, target):
hash = {0: 1}
size = len(nums)
ans = []
for j in range(size):
if target - nums[j] in hash:
ans.append([hash[target - nums[j]], j])
hash[nums[j]] = j
return ans
def twoSum2(self, nums, target):
hash = {} # hash映射
ans = [] # 存储所有可能结果值
for i in range(len(nums)):
if target - nums[i] in hash:
ans.append([hash[target - nums[i]], i])
hash[nums[i]] = i
return ans
if __name__ == '__main__':
temp = Solution()
List = [5, 4, 3, 4, 11]
nums = 8
print(("输入:" + str(List) + " " + str(nums)))
print(("输出:" + str(temp.twoSum(List, nums))))
print(("输出:" + str(temp.twoSum2(List, nums))))
| [
"[email protected]"
]
| |
e398266ec2bb991e101560d67092ff805b861f66 | af4761b401ecec831ff42344a33cc1e85996eb64 | /freq.py | 6f1636fff4abfdfd953c32d3ee2924b86d831e62 | [
"MIT"
]
| permissive | rayjustinhuang/BitesofPy | 70aa0bb8fdbffa87810f00210b4cea78211db8cf | e5738f4f685bad4c8fb140cbc057faa441d4b34c | refs/heads/master | 2022-08-15T05:02:19.084123 | 2022-08-09T12:26:42 | 2022-08-09T12:26:42 | 219,509,496 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 129 | py | from collections import Counter
def freq_digit(num: int) -> int:
return int(Counter(str(num)).most_common(1)[0][0])
pass | [
"[email protected]"
]
| |
5088f6b3f2353635f7d058f8bacc384981913b52 | 5955ea34fd72c719f3cb78fbb3c7e802a2d9109a | /MATRIX/Trivial/trivia1.py | f67af7e92614c8d5539f7d8a23712859516740da | []
| no_license | AndreySperansky/TUITION | 3c90ac45f11c70dce04008adc1e9f9faad840b90 | 583d3a760d1f622689f6f4f482c905b065d6c732 | refs/heads/master | 2022-12-21T21:48:21.936988 | 2020-09-28T23:18:40 | 2020-09-28T23:18:40 | 299,452,924 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 181 | py | matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print(matrix[1])
print(matrix[1][1])
print(matrix[2][0])
matrix = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
print(matrix[1][1]) | [
"[email protected]"
]
| |
8ecbc754fb7b5d7fc3b127f5aba3afc90fec38bd | 55ceefc747e19cdf853e329dba06723a44a42623 | /_CodeTopics/LeetCode/401-600/000430/000430.py | 3d1bb3c077f5343fa55b72a6a1472a0b865025c4 | []
| no_license | BIAOXYZ/variousCodes | 6c04f3e257dbf87cbe73c98c72aaa384fc033690 | ee59b82125f100970c842d5e1245287c484d6649 | refs/heads/master | 2023-09-04T10:01:31.998311 | 2023-08-26T19:44:39 | 2023-08-26T19:44:39 | 152,967,312 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,241 | py | """
# Definition for a Node.
class Node(object):
def __init__(self, val, prev, next, child):
self.val = val
self.prev = prev
self.next = next
self.child = child
"""
class Solution(object):
def flatten(self, head):
"""
:type head: Node
:rtype: Node
"""
if not head:
return head
res = []
def flatten_one_level(curr):
while curr:
nextNode = curr.next
curr.prev = None
curr.next = None
res.append(curr)
if curr.child:
flatten_one_level(curr.child)
curr.child = None
curr = nextNode
flatten_one_level(head)
for i in range(len(res)-1):
res[i].next = res[i+1]
res[i+1].prev = res[i]
res[-1].next = None
return head
"""
https://leetcode-cn.com/submissions/detail/222579276/
26 / 26 个通过测试用例
状态:通过
执行用时: 28 ms
内存消耗: 13.7 MB
执行用时:28 ms, 在所有 Python 提交中击败了57.78%的用户
内存消耗:13.7 MB, 在所有 Python 提交中击败了66.67%的用户
"""
| [
"[email protected]"
]
| |
e33115a19dd732a6c8ce0df64c67a4d22df9a5b5 | 12796e7a68295a5777690cf916197f553dcfc690 | /plans/manageiq/rhev.py | cce05c9c1157767f73a22cb58d304b2c1cdf57a7 | [
"Apache-2.0"
]
| permissive | jruariveiro/kcli | 294768c25748f8a2281d9d7b3cad6f6d6dd5d9a9 | 2de467f9c74913b030ca8e2f32c7caad59bf53c1 | refs/heads/master | 2020-03-26T05:50:58.301210 | 2018-08-13T12:45:04 | 2018-08-13T12:45:04 | 144,577,929 | 0 | 0 | Apache-2.0 | 2018-08-13T12:39:19 | 2018-08-13T12:39:19 | null | UTF-8 | Python | false | false | 655 | py | #!/usr/bin/python
import json
import requests
user = "admin"
password = "[[ password ]]"
rhevuser = "admin@internal"
rhevpassword = "[[ rhev_password ]]"
rhevhost = "[[ rhev_host ]]"
headers = {'content-type': 'application/json', 'Accept': 'application/json'}
postdata = {
"type": "ManageIQ::Providers::Redhat::InfraManager",
"name": "rhev",
"hostname": rhevhost,
"ipaddress": rhevhost,
"credentials": {
"userid": rhevuser,
"password": rhevpassword
}
}
url = "https://127.0.0.1/api/providers"
r = requests.post(url, verify=False, headers=headers, auth=(user, password), data=json.dumps(postdata))
print r.json()
| [
"[email protected]"
]
| |
f8977685a94d80cf3dfd33f28317c3f562df7ba3 | 1fccf52e0a694ec03aac55e42795487a69ef1bd4 | /src/euler_python_package/euler_python/medium/p422.py | 3c591094a147780090d3295335ca6c74526aab21 | [
"MIT"
]
| permissive | wilsonify/euler | 3b7e742b520ee3980e54e523a018cd77f7246123 | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | refs/heads/master | 2020-05-27T12:15:50.417469 | 2019-09-14T22:42:35 | 2019-09-14T22:42:35 | 188,614,451 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 27 | py | def problem422():
pass
| [
"[email protected]"
]
| |
9e3792043fd56915f96a427288025faa54a6a339 | 8b7e9d06fca9d0999eabe7f6906db0e6f1f81d4c | /tourney/tournament/management/commands/players.py | f7ab85f516eaad2f0ee9ada587ed17b09dacad9e | [
"BSD-2-Clause",
"BSD-3-Clause"
]
| permissive | jonejone/tourney | 9efa442e9c27660a7a4544b008e066592011b194 | 1372c635c873b6dc6c085a2bfdb02f6528ef25c3 | refs/heads/master | 2021-01-17T11:37:13.876732 | 2015-06-17T13:51:47 | 2015-06-17T13:51:47 | 7,472,571 | 0 | 0 | null | 2013-04-19T10:17:36 | 2013-01-06T20:49:36 | Python | UTF-8 | Python | false | false | 1,945 | py | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from tourney.tournament.models import Player, Tournament
class Command(BaseCommand):
args = ''
help = 'Lists all players with their options'
option_list = BaseCommand.option_list + (
make_option('--with-options-only',
action='store_true',
dest='options-only',
default=False,
help='Only show players that has chosen any options.'),
)
def validate_tournament(self, *args, **options):
# First we must validate tournament
try:
t_slug = args[0]
tournament = Tournament.objects.get(slug=t_slug)
self.tournament = tournament
except IndexError:
raise CommandError('Please enter a tournament slug')
except Tournament.DoesNotExist:
raise CommandError('Tournament slug not found')
def handle(self, *args, **options):
self.validate_tournament(*args, **options)
if options['options-only']:
players = []
for p in self.tournament.tournamentplayer_set.all():
if p.options.count() > 0:
players.append(p)
else:
players = self.tournament.tournamentplayer_set.all()
for player in players:
opts = [opt.name for opt in player.options.all()]
if player.options.count() == 0:
output = '%(player_name)s - %(total_price)s'
else:
output = '%(player_name)s - %(total_price)s - %(options)s'
output_data = {
'player_name': player.player.name,
'options': ', '.join(opts),
'total_price': '%i %s' % (
player.get_player_price(),
self.tournament.currency),
}
self.stdout.write(output % output_data)
| [
"[email protected]"
]
| |
2c63726f954f6cb0ed0fa254ffeea056e8545a62 | 3481023b43028c5ee9520a8be0978e914bdcb548 | /manga_py/providers/nightow_net.py | 86e53cd25348d31c6966eb6c3205f80499332ff9 | [
"MIT"
]
| permissive | manga-py/manga-py | 18f6818d8efc96c3e69efee7dff3f3d6c773e32a | 0db97123acab1f2fb99e808b0ba54db08977e5c8 | refs/heads/stable_1.x | 2023-08-20T03:04:06.373108 | 2023-04-16T08:28:15 | 2023-04-16T08:28:15 | 98,638,892 | 444 | 56 | MIT | 2023-07-27T13:21:40 | 2017-07-28T10:27:43 | Python | UTF-8 | Python | false | false | 1,285 | py | from urllib.parse import unquote_plus
from manga_py.provider import Provider
from .helpers.std import Std
class NightowNet(Provider, Std):
_name_re = r'manga=(.+?)(?:&.+)?$'
def get_chapter_index(self) -> str:
ch = unquote_plus(self.chapter)
idx = self.re.search(r'chapter=(?:.+?)\+(\d+(?:\.\d+)?)', ch)
if idx:
return '-'.join(idx.group(1).split('.'))
return self.re.search('chapter=(.+?)(?:&.+)?$', ch).group(1)
def get_content(self):
name = self._get_name(self._name_re)
return self.http_get('{}/online/?manga={}'.format(
self.domain,
name
))
def get_manga_name(self) -> str:
return unquote_plus(self._get_name(self._name_re))
def get_chapters(self):
return self._elements('.selector .options a')
def prepare_cookies(self):
self._storage['referer'] = self.domain + '/online/'
def get_files(self):
content = self.http_get(self.chapter)
items = self.re.findall(r'imageArray\[\d+\]\s*=\s*[\'"](.+)[\'"];', content)
n = self.normalize_uri
return [n(i) for i in items]
def get_cover(self) -> str:
pass
def book_meta(self) -> dict:
# todo meta
pass
main = NightowNet
| [
"[email protected]"
]
| |
8a20174c536f7b7a825e2aa4666c5462ebb3d9a5 | a6106cedc42dcab94ccc4ee6d681372d2246ce5e | /python/활용자료/예제/02/ex2-24.py | c858e184ca1d9032edc29dc8ef0b5ed1a39a8b11 | []
| no_license | leemyoungwoo/pybasic | a5a4b68d6b3ddd6f07ff84dc8df76da02650196f | 481075f15613c5d8add9b8c4d523282510d146d2 | refs/heads/master | 2022-10-08T19:57:26.073431 | 2020-06-15T06:50:02 | 2020-06-15T06:50:02 | 267,502,565 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 170 | py | name = '황예린'
age = 18
eyesight = 1.2
a = '이름 : {}'.format(name)
b = '나이 : {}세'.format(age)
c = '시력 : {}'.format(eyesight)
print(a)
print(b)
print(c) | [
"[email protected]"
]
| |
2de31ce63bf56006e3b69bfa7c958f0145752bff | 555b9f764d9bca5232360979460bc35c2f5ad424 | /google/ads/google_ads/v1/proto/services/conversion_adjustment_upload_service_pb2_grpc.py | 6e9635e57ac9663a3ce02788dfd010e22f15e749 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
]
| permissive | juanmacugat/google-ads-python | b50256163782bc0223bcd8b29f789d74f4cfad05 | 0fc8a7dbf31d9e8e2a4364df93bec5f6b7edd50a | refs/heads/master | 2021-02-18T17:00:22.067673 | 2020-03-05T16:13:57 | 2020-03-05T16:13:57 | 245,215,877 | 1 | 0 | Apache-2.0 | 2020-03-05T16:39:34 | 2020-03-05T16:39:33 | null | UTF-8 | Python | false | false | 2,255 | py | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v1.proto.services import conversion_adjustment_upload_service_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_conversion__adjustment__upload__service__pb2
class ConversionAdjustmentUploadServiceStub(object):
"""Service to upload conversion adjustments.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.UploadConversionAdjustments = channel.unary_unary(
'/google.ads.googleads.v1.services.ConversionAdjustmentUploadService/UploadConversionAdjustments',
request_serializer=google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_conversion__adjustment__upload__service__pb2.UploadConversionAdjustmentsRequest.SerializeToString,
response_deserializer=google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_conversion__adjustment__upload__service__pb2.UploadConversionAdjustmentsResponse.FromString,
)
class ConversionAdjustmentUploadServiceServicer(object):
"""Service to upload conversion adjustments.
"""
def UploadConversionAdjustments(self, request, context):
"""Processes the given conversion adjustments.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ConversionAdjustmentUploadServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'UploadConversionAdjustments': grpc.unary_unary_rpc_method_handler(
servicer.UploadConversionAdjustments,
request_deserializer=google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_conversion__adjustment__upload__service__pb2.UploadConversionAdjustmentsRequest.FromString,
response_serializer=google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_conversion__adjustment__upload__service__pb2.UploadConversionAdjustmentsResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'google.ads.googleads.v1.services.ConversionAdjustmentUploadService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
| [
"[email protected]"
]
| |
fc5b935b9f8310e3f6f4113fb0a228bec78d5e73 | 2bb6f9c0a3658acf2bd6b97dcdeace9213723640 | /namespace/models/list_field.py | ee577399fe07b1476580fed945fe7ee0aef6dc04 | []
| no_license | hugoseabra/mailchimp-service | 4fee930fd11b30f4c7da3654da2cbb231ca34341 | 0424b90fdc0911b4a6b1d514ba51c88d7d3572b4 | refs/heads/develop | 2022-07-20T02:52:06.147740 | 2020-03-17T21:31:37 | 2020-03-17T21:31:37 | 242,433,347 | 0 | 0 | null | 2022-07-06T20:30:14 | 2020-02-23T00:39:43 | Python | UTF-8 | Python | false | false | 2,475 | py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from core.models import track_data
from core.models.mixins import (
DateTimeManagementMixin,
DeletableModelMixin,
EntityMixin,
UUIDPkMixin,
)
@track_data('namespace_id', 'label', 'tag')
class ListField(UUIDPkMixin,
EntityMixin,
DeletableModelMixin,
DateTimeManagementMixin,
models.Model):
"""
Campo adicionado a uma lista.
"""
class Meta:
verbose_name = _('list field')
verbose_name_plural = _('list fields')
unique_together = (
('namespace_id', 'tag',),
)
FIELD_TYPE_TEXT = 'text'
FIELD_TYPE_NUMBER = 'number'
FIELD_TYPES = (
(FIELD_TYPE_TEXT, _('Text')),
(FIELD_TYPE_NUMBER, _('Number')),
)
namespace = models.ForeignKey(
verbose_name=_('namespace'),
to='namespace.Namespace',
on_delete=models.PROTECT,
null=False,
blank=False,
related_name='fields',
)
field_type = models.CharField(
max_length=6,
verbose_name=_('field type'),
null=False,
blank=False,
choices=FIELD_TYPES,
default=FIELD_TYPE_TEXT,
)
label = models.CharField(
max_length=50,
verbose_name=_('label'),
null=False,
blank=False,
)
tag = models.CharField(
max_length=50,
verbose_name=_('tag'),
null=False,
blank=False,
)
help_text = models.CharField(
max_length=255,
verbose_name=_('help text'),
null=True,
blank=True,
)
active = models.BooleanField(
verbose_name=_('active'),
default=False,
null=False,
blank=False,
help_text=_('If true, it means that the field will be created in list'
' in MailChimp platform.'),
)
def to_sync_data(self):
return {
'name': self.label,
'tag': self.tag,
'type': self.field_type,
'required': False,
'list_id': self.namespace.default_list_id,
'help_text': self.help_text,
}
def __repr__(self):
return '<ListField pk: {}, label: {}, tag: {}'.format(
self.pk,
self.label,
self.tag,
)
def __str__(self):
return '{} ({})'.format(self.label, self.tag)
| [
"[email protected]"
]
| |
eae92e47c1d4a062e8b1bbd1f5491ed7c0450eb6 | 64ef180b1725d831891ef075557ddcc540c6e42a | /init.py | f947e2f7251a20b7e823621b1950cb622574ebbc | [
"MIT"
]
| permissive | nasingfaund/tkinter-gui-application-examples | 125acc088133020adae0bfc9c752a8e75c780c73 | 7073d163713829b2ff10a331c7f88f845d89b1bc | refs/heads/master | 2023-07-15T06:41:35.861732 | 2021-08-28T14:36:28 | 2021-08-28T14:36:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,703 | py | #!/usr/bin/env python3
# -*- coding:utf-8-*-
import tkinter.messagebox
from tkinter import Button, Label, Tk
from lib.functions import set_window_center
from lib.sqlite_helper import DBHelper
from main import App
class InitWindow(Tk):
"""初始化窗口"""
def __init__(self):
Tk.__init__(self)
self.title("初始化数据")
set_window_center(self, 300, 180)
self.resizable(False, False)
self.win_success = None # 初始化成功的提示窗口
self.init_page()
def init_page(self):
"""加载控件"""
btn_1 = Button(self, text="初始化数据库", command=self.do_init_db)
btn_1.pack(expand="yes", padx=10, pady=10, ipadx=5, ipady=5)
def do_init_db(self):
"""初始化"""
db_helper = DBHelper()
db_helper.reset_database()
db_helper.create_database()
try:
tmp = db_helper.insert_user("admin", "admin") # 默认用户
tmp2 = db_helper.insert_content_by_username(
"admin",
"Hello World !",
"源码仓库地址:https://github.com/doudoudzj/tkinter-app",
"github",
)
tmp3 = db_helper.get_content_by_username("admin")
print("添加用户admin:", tmp)
print("添加内容:", tmp2)
print("查询内容:", tmp3)
self.do_success()
self.destroy()
except KeyError:
print(KeyError)
self.do_failed()
def do_failed(self):
"""是否重试"""
res = tkinter.messagebox.askretrycancel('提示', '初始化失败,是否重试?', parent=self)
if res is True:
self.do_init_db()
elif res is False:
self.destroy()
def do_success(self):
"""初始化成功弹窗"""
self.win_success = Tk()
self.win_success.title("初始化成功")
set_window_center(self.win_success, 250, 150)
self.win_success.resizable(False, False)
msg = Label(self.win_success, text="初始化成功")
msg.pack(expand="yes", fill="both")
btn = Button(self.win_success, text="确定", command=self.quit)
btn.pack(side="right", padx=10, pady=10, ipadx=5, ipady=5)
btn_open_app = Button(self.win_success, text="启动程序", command=self.open_app)
btn_open_app.pack(side="right", padx=10, pady=10, ipadx=5, ipady=5)
def open_app(self):
"""打开应用程序"""
self.quit()
self.win_success.destroy()
self.win_success.quit()
App()
if __name__ == "__main__":
APP_INIT = InitWindow()
APP_INIT.mainloop()
| [
"[email protected]"
]
| |
243c82d2ac9b47f93c80d5616f675f92d84dc0ea | 3a69696a2c5debfb24dfacffa6d3b0e311d0375e | /src/tests/test_launcher.py | 80eca716e26f24ebe46b392f600f9e5be84878bf | [
"Apache-2.0"
]
| permissive | Build-The-Web/bootils | 7aeab92debc20258d645a70f5595738653ef46a7 | 8ee88f4d0583352f58fbb89c018e7caef8f07ce3 | refs/heads/master | 2021-01-17T09:14:18.317535 | 2016-06-03T13:38:01 | 2016-06-03T13:38:01 | 32,890,374 | 3 | 2 | Apache-2.0 | 2018-03-04T20:46:22 | 2015-03-25T20:57:07 | Python | UTF-8 | Python | false | false | 1,951 | py | # *- coding: utf-8 -*-
# pylint: disable=wildcard-import, missing-docstring, no-self-use, bad-continuation
# pylint: disable=invalid-name, redefined-outer-name, too-few-public-methods
""" Test «some_module».
"""
# Copyright © 2015 1&1 Group <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, unicode_literals, print_function
import os
import getpass
import pytest
from bootils import launcher
def test_signal_name_to_int():
assert launcher.signal2int(1) == 1
assert launcher.signal2int('1') == 1
assert launcher.signal2int('pipe') == 13
assert launcher.signal2int('PIPE') == 13
assert launcher.signal2int('sigPIPE') == 13
def test_signal2int_with_bad_name():
with pytest.raises(ValueError):
launcher.signal2int('foobar')
def test_signal2int_with_bad_type():
with pytest.raises(ValueError):
launcher.signal2int(None)
def test_uid_of_root():
assert launcher.check_uid(0) == 0
assert launcher.check_uid('0') == 0
assert launcher.check_uid('root') == 0
def test_uid_of_current_user():
uid_home = os.stat(os.path.expanduser('~')).st_uid
assert launcher.check_uid(getpass.getuser()) == uid_home
def test_gid_of_root():
assert launcher.check_gid(0) == 0
assert launcher.check_gid('0') == 0
assert launcher.check_gid('root') == 0
def test_gid_of_users():
assert launcher.check_gid('users') > 0
| [
"[email protected]"
]
| |
c8a41a9fd2264a175999475b482f5c7509481456 | 353def93fa77384ee3a5e3de98cfed318c480634 | /.history/week01/homework02/maoyanspiders/maoyanspiders/spiders/movies_20200627214427.py | 4ddb627414c18159133e722575fe0e29e8aa2e28 | []
| no_license | ydbB/Python001-class01 | d680abc3ea1ccaeb610751e3488421417d381156 | ad80037ccfc68d39125fa94d2747ab7394ac1be8 | refs/heads/master | 2022-11-25T11:27:45.077139 | 2020-07-19T12:35:12 | 2020-07-19T12:35:12 | 272,783,233 | 0 | 0 | null | 2020-06-16T18:28:15 | 2020-06-16T18:28:15 | null | UTF-8 | Python | false | false | 932 | py | # -*- coding: utf-8 -*-
import scrapy
from maoyanspiders.items import MaoyanspidersItem
# import xlml.etree
from bs4 import BeautifulSoup as bs
class MoviesSpider(scrapy.Spider):
name = 'movies'
allowed_domains = ['maoyan.com']
start_urls = ['http://maoyan.com/board/4']
# def parse(self, response):
# pass
def start_requests(self):
url = f'https://maoyan.com/board/4'
print(url)
yield scrapy.Request(url=url,callback=self.parse)
def parse(self, response):
soup = bs(response.text,'html.parser')
print(soup.text)
return soup
for i in soup.find_all('div',attrs={'class' : 'movie-item-info'}):\
item = MaoyanspidersItem()
link = i.get('href'.text)
item['films_name'] = 'name'
item['release_time'] = "tiome"
yield scrapy.Request(url=url,callback=self.parse1)
return item
| [
"[email protected]"
]
| |
ef98cfec035e621902aedc72b76f5850fc6e84ca | e380663d6a11d05828a040486c85e2dfae358597 | /djangove/utils/templatetags/navigation_tags.py | bafbc92d8d8e0530401dc4ad20eed4c5aac944d7 | [
"BSD-3-Clause"
]
| permissive | djangove/djangove | 4a2ad9dcd5236ff746bb09d21f2fab1424dfc2f5 | 1fee878d170e52ee0c5cacd1d2813b045d4cbb77 | refs/heads/master | 2021-09-10T05:58:01.868815 | 2020-03-09T22:27:58 | 2020-03-09T22:27:58 | 43,475,979 | 1 | 1 | BSD-3-Clause | 2021-09-07T23:57:06 | 2015-10-01T03:13:04 | Python | UTF-8 | Python | false | false | 4,882 | py | from django import template
from wagtail.wagtailcore.models import Page
register = template.Library()
@register.assignment_tag(takes_context=True)
def get_site_root(context):
return context['request'].site.root_page
def has_menu_children(page):
if page.get_children().filter(live=True, show_in_menus=True):
return True
else:
return False
@register.inclusion_tag(
'utils/tags/navigation/top_menu.html', takes_context=True)
def top_menu(context, parent, calling_page=None):
menuitems = parent.get_children().filter(
live=True,
show_in_menus=True
)
for menuitem in menuitems:
menuitem.show_dropdown = has_menu_children(menuitem)
return {
'calling_page': calling_page,
'menuitems': menuitems,
'request': context['request'],
}
# Retrieves the children of the top menu items for the drop downs
@register.inclusion_tag(
'utils/tags/navigation/top_menu_children.html', takes_context=True)
def top_menu_children(context, parent):
menuitems_children = parent.get_children()
menuitems_children = menuitems_children.filter(
live=True,
show_in_menus=True
)
for menuitem in menuitems_children:
menuitem.show_dropdown = has_menu_children(menuitem)
return {
'parent': parent,
'menuitems_children': menuitems_children,
# required by the pageurl tag that we want to use within this template
'request': context['request'],
}
@register.inclusion_tag(
'utils/tags/navigation/site_menu.html', takes_context=True)
def site_menu(context, parent, calling_page=None):
menuitems = parent.get_children().filter(
live=True,
show_in_menus=True
)
for menuitem in menuitems:
menuitem.show_dropdown = has_menu_children(menuitem)
return {
'calling_page': calling_page,
'menuitems': menuitems,
'request': context['request'],
}
@register.inclusion_tag(
'utils/tags/navigation/site_menu_children.html', takes_context=True)
def site_menu_children(context, parent):
menuitems_children = parent.get_children()
menuitems_children = menuitems_children.filter(
live=True,
show_in_menus=True
)
for menuitem in menuitems_children:
menuitem.show_dropdown = has_menu_children(menuitem)
return {
'parent': parent,
'menuitems_children': menuitems_children,
# required by the pageurl tag that we want to use within this template
'request': context['request'],
}
@register.inclusion_tag(
'utils/tags/navigation/secondary_menu.html', takes_context=True)
def secondary_menu(context, calling_page=None):
pages = []
if calling_page:
pages = calling_page.get_children().filter(
live=True,
show_in_menus=True
)
# If no children, get siblings instead
if len(pages) == 0:
pages = calling_page.get_siblings().filter(
live=True,
show_in_menus=True
)
return {
'pages': pages,
# required by the pageurl tag that we want to use within this template
'request': context['request'],
}
@register.inclusion_tag(
'utils/tags/navigation/breadcrumbs.html', takes_context=True)
def breadcrumbs(context):
self = context.get('self')
if self is None or self.depth <= 2:
# When on the home page, displaying breadcrumbs is irrelevant.
ancestors = ()
else:
ancestors = Page.objects.ancestor_of(
self, inclusive=True).filter(depth__gt=2)
return {
'ancestors': ancestors,
'request': context['request'],
}
@register.inclusion_tag(
'utils/tags/navigation/offcanvas_top_menu.html', takes_context=True)
def offcanvas_top_menu(context, parent, calling_page=None):
menuitems = parent.get_children().filter(
live=True,
show_in_menus=True
)
for menuitem in menuitems:
menuitem.show_dropdown = has_menu_children(menuitem)
return {
'calling_page': calling_page,
'menuitems': menuitems,
'request': context['request'],
}
# Retrieves the children of the top menu items for the drop downs
@register.inclusion_tag(
'utils/tags/navigation/offcanvas_top_menu_children.html', takes_context=True)
def offcanvas_top_menu_children(context, parent):
menuitems_children = parent.get_children()
menuitems_children = menuitems_children.filter(
live=True,
show_in_menus=True
)
for menuitem in menuitems_children:
menuitem.show_dropdown = has_menu_children(menuitem)
return {
'parent': parent,
'menuitems_children': menuitems_children,
# required by the pageurl tag that we want to use within this template
'request': context['request'],
}
| [
"[email protected]"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.